理财相关操作
This commit is contained in:
parent
04b2c46dfb
commit
57d4c77696
|
|
@ -26,16 +26,19 @@ public class IntBillBatchOperation extends AbstractOperationServicePlugIn implem
|
||||||
if("audit".equals(eok)){
|
if("audit".equals(eok)){
|
||||||
DynamicObject[] dos = e.getDataEntities();
|
DynamicObject[] dos = e.getDataEntities();
|
||||||
DynamicObject prinfo;//理财收益批量预提单
|
DynamicObject prinfo;//理财收益批量预提单
|
||||||
DynamicObject destinfo;//预提记账处理单
|
// DynamicObject destinfo;//预提记账处理单
|
||||||
QFilter qFilter;
|
QFilter qFilter;//预提记账处理单集合
|
||||||
|
DynamicObject[] ytjzdos;
|
||||||
for (int i = 0; i < dos.length; i++) {
|
for (int i = 0; i < dos.length; i++) {
|
||||||
prinfo = BusinessDataServiceHelper.loadSingle(dos[i].getPkValue(), dos[i].getDataEntityType().getName());
|
prinfo = BusinessDataServiceHelper.loadSingle(dos[i].getPkValue(), dos[i].getDataEntityType().getName());
|
||||||
if(prinfo.getBoolean("shjh_needvoucher")){
|
if(prinfo.getBoolean("shjh_needvoucher")){
|
||||||
//将此字段值携带至预提记账处理单中 intbatchbillid
|
//将此字段值携带至预提记账处理单中 intbatchbillid
|
||||||
qFilter = new QFilter("intbatchbillid", QCP.equals, prinfo.getLong("id"));
|
qFilter = new QFilter("intbatchbillid", QCP.equals, prinfo.getLong("id"));
|
||||||
destinfo = BusinessDataServiceHelper.loadSingle(destName,new QFilter[]{qFilter});
|
ytjzdos = BusinessDataServiceHelper.load(destName,"id",new QFilter[]{qFilter});
|
||||||
if(destinfo != null){
|
if(ytjzdos != null){
|
||||||
DB.update(DBRoute.of("fi"), updateVoucher, new Object[]{destinfo.getLong("id")});
|
for (DynamicObject destinfo : ytjzdos){
|
||||||
|
DB.update(DBRoute.of("fi"), updateVoucher, new Object[]{destinfo.getLong("id")});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
package shjh.jhzj7.fi.fi.plugin.operate;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.sap.db.jdbc.packet.ErrorLevel;
|
||||||
|
import kd.bos.dataentity.entity.DynamicObject;
|
||||||
|
import kd.bos.db.DB;
|
||||||
|
import kd.bos.db.DBRoute;
|
||||||
|
import kd.bos.entity.operate.result.OperateErrorInfo;
|
||||||
|
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
|
||||||
|
import kd.bos.entity.plugin.args.AfterOperationArgs;
|
||||||
|
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||||
|
import kd.sdk.plugin.Plugin;
|
||||||
|
import shjh.jhzj7.fi.fi.utils.SapUtils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预提记账处理-单据操作插件
|
||||||
|
* @author yuxueliang
|
||||||
|
*/
|
||||||
|
public class RevenueBillOperation extends AbstractOperationServicePlugIn implements Plugin {
|
||||||
|
|
||||||
|
private static final String updateVoucherFlag = "update t_cim_revenue set fk_shjh_sendsap=1 where fid=?;";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterExecuteOperationTransaction(AfterOperationArgs e) {
|
||||||
|
super.afterExecuteOperationTransaction(e);
|
||||||
|
String eok = e.getOperationKey();
|
||||||
|
if("sendvoucher".equals(eok)){
|
||||||
|
//推送sap凭证接口
|
||||||
|
DynamicObject[] dos = e.getDataEntities();
|
||||||
|
DynamicObject prinfo;//预提记账处理单
|
||||||
|
JSONObject sapReturnData;
|
||||||
|
for (int i = 0; i < dos.length; i++) {
|
||||||
|
prinfo = BusinessDataServiceHelper.loadSingle(dos[i].getPkValue(), dos[i].getDataEntityType().getName());
|
||||||
|
if(prinfo.getBoolean("shjh_needvoucher") && !prinfo.getBoolean("shjh_sendsap")){
|
||||||
|
//TODO 如果预提记账处理单需要生成凭证且未推送sap的才推送sap
|
||||||
|
sapReturnData = sendVoucher(prinfo);
|
||||||
|
|
||||||
|
if(sapReturnData != null && "0".equals(sapReturnData.getString("code"))){
|
||||||
|
//推送sap成功后,反写已推送标记
|
||||||
|
DB.update(DBRoute.of("fi"), updateVoucherFlag, new Object[]{prinfo.getPkValue()});
|
||||||
|
this.operationResult.addSuccessPkId(prinfo.getPkValue());
|
||||||
|
}else{
|
||||||
|
addErrorInfo(prinfo,"推送SAP接口失败:"+sapReturnData.getString("msg"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private JSONObject sendVoucher(DynamicObject prinfo){
|
||||||
|
//组装参数调用推送sap接口
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addErrorInfo(DynamicObject bill, String errorMsg) {
|
||||||
|
OperateErrorInfo operateErrorInfo = new OperateErrorInfo();
|
||||||
|
operateErrorInfo.setMessage(bill.getString("billno") + errorMsg);
|
||||||
|
operateErrorInfo.setErrorLevel(ErrorLevel.Error.name());
|
||||||
|
operateErrorInfo.setPkValue(bill.getPkValue());
|
||||||
|
this.operationResult.addErrorInfo(operateErrorInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -116,10 +116,9 @@ public class PersonControler implements Serializable {
|
||||||
oausername = json_body.getString("username");//OA用户名
|
oausername = json_body.getString("username");//OA用户名
|
||||||
emailPrefix = json_body.getString("emailPrefix");//邮箱前缀
|
emailPrefix = json_body.getString("emailPrefix");//邮箱前缀
|
||||||
fycc = json_body.getString("hpyp_cc_id");//费用成本中心
|
fycc = json_body.getString("hpyp_cc_id");//费用成本中心
|
||||||
|
//去掉收款银行 详细分机银行 收款账号的为空校验
|
||||||
if(EsbUtils.isEmpty(number) || EsbUtils.isEmpty(name) || EsbUtils.isEmpty(deptid) || EsbUtils.isEmpty(email)
|
if(EsbUtils.isEmpty(number) || EsbUtils.isEmpty(name) || EsbUtils.isEmpty(deptid) || EsbUtils.isEmpty(email)
|
||||||
|| EsbUtils.isEmpty(oausername) || EsbUtils.isEmpty(emailPrefix) || EsbUtils.isEmpty(fycc) ||
|
|| EsbUtils.isEmpty(oausername) || EsbUtils.isEmpty(emailPrefix) || EsbUtils.isEmpty(fycc)){
|
||||||
EsbUtils.isEmpty(bank) || EsbUtils.isEmpty(bank_branch) || EsbUtils.isEmpty(bank_account)){
|
|
||||||
log.error(String.format("人员入参为空异常:%s", json_body.toJSONString()));
|
log.error(String.format("人员入参为空异常:%s", json_body.toJSONString()));
|
||||||
itemInfo = new JSONObject();
|
itemInfo = new JSONObject();
|
||||||
itemInfo.put("code",number);
|
itemInfo.put("code",number);
|
||||||
|
|
@ -279,10 +278,13 @@ public class PersonControler implements Serializable {
|
||||||
String cusnumber = (String) ups.getDataMap().get("number");//客户编号-即是 人员的编号
|
String cusnumber = (String) ups.getDataMap().get("number");//客户编号-即是 人员的编号
|
||||||
DynamicObject currentCus = BusinessDataServiceHelper.loadSingle(cusEntityName,new QFilter[]{new QFilter("number","=",cusnumber)});
|
DynamicObject currentCus = BusinessDataServiceHelper.loadSingle(cusEntityName,new QFilter[]{new QFilter("number","=",cusnumber)});
|
||||||
if(currentCus != null){
|
if(currentCus != null){
|
||||||
|
String acctnum = (String) ups.getDataMap().get("shjh_acctnum");//收款账号
|
||||||
|
if(EsbUtils.isEmpty(acctnum)){
|
||||||
|
return;
|
||||||
|
}
|
||||||
String cusname = (String) ups.getDataMap().get("name");//姓名
|
String cusname = (String) ups.getDataMap().get("name");//姓名
|
||||||
String skyh = (String) ups.getDataMap().get("shjh_skyh");//收款银行
|
String skyh = (String) ups.getDataMap().get("shjh_skyh");//收款银行
|
||||||
String xxyh = (String) ups.getDataMap().get("shjh_xxyh");//详细分机银行
|
String xxyh = (String) ups.getDataMap().get("shjh_xxyh");//详细分机银行
|
||||||
String acctnum = (String) ups.getDataMap().get("shjh_acctnum");//收款账号
|
|
||||||
DynamicObjectCollection doc_bank = currentCus.getDynamicObjectCollection("entry_bank");
|
DynamicObjectCollection doc_bank = currentCus.getDynamicObjectCollection("entry_bank");
|
||||||
DynamicObject bankinfo;
|
DynamicObject bankinfo;
|
||||||
if(doc_bank.isEmpty()){
|
if(doc_bank.isEmpty()){
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue