开票登记组织=申请付款组织,提交审核优化

This commit is contained in:
李贵强 2024-12-20 16:21:46 +08:00
parent 3366517e7a
commit 9568d453a3
1 changed files with 758 additions and 748 deletions

View File

@ -15,6 +15,7 @@ import kd.bos.cache.CacheFactory;
import kd.bos.cache.TempFileCache; import kd.bos.cache.TempFileCache;
import kd.bos.coderule.api.CodeRuleInfo; import kd.bos.coderule.api.CodeRuleInfo;
import kd.bos.context.RequestContext; import kd.bos.context.RequestContext;
import kd.bos.dataentity.OperateOption;
import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection; import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.dataentity.resource.ResManager; import kd.bos.dataentity.resource.ResManager;
@ -332,12 +333,13 @@ public class ReconPayreqFormPlugin extends AbstractFormPlugin implements BeforeF
JSONArray resultList = saveCheckJson.getJSONArray("resultList"); JSONArray resultList = saveCheckJson.getJSONArray("resultList");
JSONObject result = resultList.getJSONObject(0);//保存返回结果 JSONObject result = resultList.getJSONObject(0);//保存返回结果
String pi_key = result.getString("pi_key");//发票结果key String pi_key = result.getString("pi_key");//发票结果key
//生成发票登记表单
DynamicObject recon_invoicebill = BusinessDataServiceHelper.newDynamicObject("recon_invoicebill"); DynamicObject recon_invoicebill = BusinessDataServiceHelper.newDynamicObject("recon_invoicebill");
// DynamicObject recon_invoicebill1 = BusinessDataServiceHelper.loadSingle("2031274535679975424", "recon_invoicebill");
recon_invoicebill.set("billstatus","A");//单据状态 recon_invoicebill.set("billstatus","A");//单据状态
//所属组织 //所属组织
//DynamicObject org = BusinessDataServiceHelper.loadSingle("bos_org", new QFilter[]{new QFilter("number", QCP.equals, "dobe")}); //long rootOrgId = OrgUnitServiceHelper.getRootOrgId();
long rootOrgId = OrgUnitServiceHelper.getRootOrgId(); long rootOrgId = dataEntity.getLong("org.id");
DynamicObject org = BusinessDataServiceHelper.loadSingle(rootOrgId, "bos_org"); DynamicObject org = BusinessDataServiceHelper.loadSingle(rootOrgId, "bos_org");
if (null != org) { if (null != org) {
recon_invoicebill.set("org",org); recon_invoicebill.set("org",org);
@ -419,18 +421,26 @@ public class ReconPayreqFormPlugin extends AbstractFormPlugin implements BeforeF
invoiceentr.set("entry_content",description);//项目名称 invoiceentr.set("entry_content",description);//项目名称
invoiceentr.set("entry_notaxamt",qeug_amount); invoiceentr.set("entry_notaxamt",qeug_amount);
} }
OperationResult operationResult = OperationServiceHelper.executeOperate("save", "recon_invoicebill", new DynamicObject[]{recon_invoicebill});
if (!operationResult.isSuccess()){ //保存
logger.error(operationResult.getMessage()); OperateOption operateOption1 = OperateOption.create();
} OperationResult operationResult1 = OperationServiceHelper.executeOperate("save", "recon_invoicebill", new DynamicObject[]{recon_invoicebill}, operateOption1);
OperationResult operationResult1 = OperationServiceHelper.executeOperate("submit", "recon_invoicebill", new DynamicObject[]{recon_invoicebill});
if (!operationResult1.isSuccess()){ if (!operationResult1.isSuccess()){
logger.error(operationResult1.getMessage()); logger.error(operationResult1.getMessage());
} }
OperationResult operationResult2 = OperationServiceHelper.executeOperate("audit", "recon_invoicebill", new DynamicObject[]{recon_invoicebill}); //提交
OperateOption operateOption2 = OperateOption.create();
OperationResult operationResult2 = OperationServiceHelper.executeOperate("submit", "recon_invoicebill", new DynamicObject[]{recon_invoicebill}, operateOption2);
if (!operationResult2.isSuccess()){ if (!operationResult2.isSuccess()){
logger.error(operationResult2.getMessage()); logger.error(operationResult2.getMessage());
} }
//审核
OperateOption operateOption3 = OperateOption.create();
OperationResult operationResult3 = OperationServiceHelper.executeOperate("audit", "recon_invoicebill", new DynamicObject[]{recon_invoicebill}, operateOption3);
if (!operationResult3.isSuccess()){
logger.error(operationResult3.getMessage());
}
//todo:添加发票信息分录 //todo:添加发票信息分录
DynamicObject dynamicObject = invoiceentry.addNew();//新增分录行 DynamicObject dynamicObject = invoiceentry.addNew();//新增分录行
//todo:模仿标品新增字段,为接口返回数据反写分录做准备 //todo:模仿标品新增字段,为接口返回数据反写分录做准备
@ -462,7 +472,7 @@ public class ReconPayreqFormPlugin extends AbstractFormPlugin implements BeforeF
this.getView().showTipNotification("请先选择用款单位!"); this.getView().showTipNotification("请先选择用款单位!");
} }
break; break;
//发票验真验重 //关联发票
case "qeug_refinvoice": case "qeug_refinvoice":
//todo: 关联发票二开接口 //todo: 关联发票二开接口
switch (billtype){ switch (billtype){