diff --git a/lc123/cloud/app/plugin/operate/im/ImInvCountBillSubmitToFwOp.java b/lc123/cloud/app/plugin/operate/im/ImInvCountBillSubmitToFwOp.java new file mode 100644 index 0000000..b7bbc51 --- /dev/null +++ b/lc123/cloud/app/plugin/operate/im/ImInvCountBillSubmitToFwOp.java @@ -0,0 +1,45 @@ +package tqq9.lc123.cloud.app.plugin.operate.im; + +import com.alibaba.fastjson.JSONObject; +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.entity.operate.result.OperationResult; +import kd.bos.entity.plugin.AbstractOperationServicePlugIn; +import kd.bos.entity.plugin.args.AfterOperationArgs; +import kd.bos.servicehelper.BusinessDataServiceHelper; +import kd.bos.servicehelper.operation.SaveServiceHelper; +import org.apache.commons.lang3.StringUtils; +import tqq9.lc123.cloud.app.plugin.trd.FWImpl; + +import java.util.List; + +/** + * 盘点表提交后推送泛微 + */ +public class ImInvCountBillSubmitToFwOp extends AbstractOperationServicePlugIn { + + + @Override + public void afterExecuteOperationTransaction(AfterOperationArgs e) { + super.afterExecuteOperationTransaction(e); + OperationResult operationResult = this.getOperationResult(); + List successPkIds = operationResult.getSuccessPkIds(); + for (Object successPkId : successPkIds) { + DynamicObject bill = BusinessDataServiceHelper.loadSingle(successPkId, "im_invcountbill"); + //采购费用暂估 + String resultStr = FWImpl.pushFwImInvCountBill(bill); + if (StringUtils.isNotBlank(resultStr)) { + JSONObject resultObj = JSONObject.parseObject(resultStr); + String code = resultObj.getString("code"); + if ("SUCCESS".equals(code)) { + bill.set("tqq9_issuccess", true); + JSONObject data = resultObj.getJSONObject("data"); + if (data != null) { + String requestid = data.getString("requestid"); + bill.set("tqq9_fwrequestid", requestid); + SaveServiceHelper.save(new DynamicObject[]{bill}); + } + } + } + } + } +}