diff --git a/lc123/cloud/app/api/controller/FWBillStateUpdController.java b/lc123/cloud/app/api/controller/FWBillStateUpdController.java index 16a7693..b6b71ab 100644 --- a/lc123/cloud/app/api/controller/FWBillStateUpdController.java +++ b/lc123/cloud/app/api/controller/FWBillStateUpdController.java @@ -46,6 +46,8 @@ public class FWBillStateUpdController { approveLog.set("tqq9_billno", KDBillNumber); approveLog.set("tqq9_returnstring_tag", JSONObject.toJSONString(model)); approveLog.set("tqq9_message", message); + approveLog.set("status", "A"); + approveLog.set("enable", "1"); //校验单据标识是否正确 QFilter f1 = new QFilter("number", "=", KDBillType); @@ -61,7 +63,6 @@ public class FWBillStateUpdController { if("BaseFormModel".equals(modeltype) || "gl_voucher".equals(enetityNumber)){ billNoFieldName = "number"; } - //查询对应的安居 QFilter qf1 = new QFilter(billNoFieldName, "=", KDBillNumber); DynamicObject[] billArr = BusinessDataServiceHelper.load(enetityNumber, "id,tqq9_issuccess", new QFilter[]{qf1}); @@ -70,15 +71,15 @@ public class FWBillStateUpdController { if(state == 0){ isSuccess = true; } - billArr[0].set("tqq9_issuccess", isSuccess); - SaveServiceHelper.save(new DynamicObject[]{billArr[0]}); + DynamicObject bill = BusinessDataServiceHelper.loadSingle(billArr[0].getPkValue(), enetityNumber); + bill.set("tqq9_issuccess", isSuccess); + SaveServiceHelper.save(new DynamicObject[]{bill}); approveLog.set("tqq9_issuccess", isSuccess); approveLog.set("tqq9_entityname", enetityName); OperationResult operationResult = OperationServiceHelper.executeOperate("save", "tqq9_fwapprovelog", new DynamicObject[]{approveLog}, OperateOption.create()); - if(isSuccess){ - OperationResult submitResult = OperationServiceHelper.executeOperate("submit", enetityNumber, new DynamicObject[]{billArr[0]}, OperateOption.create()); + OperationResult submitResult = OperationServiceHelper.executeOperate("audit", enetityNumber, new DynamicObject[]{bill}, OperateOption.create()); if(!submitResult.isSuccess()){ List allErrorOrValidateInfo = submitResult.getAllErrorOrValidateInfo(); for (IOperateInfo iOperateInfo : allErrorOrValidateInfo) { @@ -86,7 +87,7 @@ public class FWBillStateUpdController { } } }else{ - OperationResult submitResult = OperationServiceHelper.executeOperate("unsubmit", enetityNumber, new DynamicObject[]{billArr[0]}, OperateOption.create()); + OperationResult submitResult = OperationServiceHelper.executeOperate("unsubmit", enetityNumber, new DynamicObject[]{bill}, OperateOption.create()); if(!submitResult.isSuccess()){ List allErrorOrValidateInfo = submitResult.getAllErrorOrValidateInfo(); for (IOperateInfo iOperateInfo : allErrorOrValidateInfo) {