Compare commits

..

No commits in common. "fd2246ba591fba8ac6916951070fbc0dc726f2b6" and "45604cbd6dadead35d04d6e1a14018e9700d0242" have entirely different histories.

1 changed files with 746 additions and 756 deletions

View File

@ -15,7 +15,6 @@ 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;
@ -333,13 +332,12 @@ 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");//单据状态
//所属组织 //所属组织
//long rootOrgId = OrgUnitServiceHelper.getRootOrgId(); //DynamicObject org = BusinessDataServiceHelper.loadSingle("bos_org", new QFilter[]{new QFilter("number", QCP.equals, "dobe")});
long rootOrgId = dataEntity.getLong("org.id"); long rootOrgId = OrgUnitServiceHelper.getRootOrgId();
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);
@ -421,26 +419,18 @@ 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()){
OperateOption operateOption1 = OperateOption.create(); logger.error(operationResult.getMessage());
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:模仿标品新增字段,为接口返回数据反写分录做准备
@ -472,7 +462,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){