lc/lc123/cloud/app/plugin/operate/im/OtherInSubmitToFwOp.java

58 lines
2.4 KiB
Java
Raw Normal View History

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 OtherInSubmitToFwOp extends AbstractOperationServicePlugIn {
@Override
public void afterExecuteOperationTransaction(AfterOperationArgs e) {
super.afterExecuteOperationTransaction(e);
OperationResult operationResult = this.getOperationResult();
List<Object> successPkIds = operationResult.getSuccessPkIds();
for (Object successPkId : successPkIds) {
2025-11-07 10:10:09 +00:00
DynamicObject bill = BusinessDataServiceHelper.loadSingle(successPkId, "tqq9_otherinapply");
2025-11-11 09:40:09 +00:00
DynamicObject tqq9_biztype = bill.getDynamicObject("biztype");
if (tqq9_biztype != null) {
//调拨入库不推送泛微
String biztypenumber = tqq9_biztype.getString("number");
if ("605".equals(biztypenumber)) {
continue;
}
}
String resultStr = FWImpl.pushFwOtherIn(bill);
if (StringUtils.isNotBlank(resultStr)) {
JSONObject resultObj = JSONObject.parseObject(resultStr);
String code = resultObj.getString("code");
if ("SUCCESS".equals(code)) {
JSONObject data = resultObj.getJSONObject("data");
if (data != null) {
String requestid = data.getString("requestid");
bill.set("tqq9_fwrequestid", requestid);
bill.set("tqq9_fwstate", "B");
SaveServiceHelper.save(new DynamicObject[]{bill});
}
String tqq9_fwrequestid = bill.getString("tqq9_fwrequestid");
if (StringUtils.isNotBlank(tqq9_fwrequestid)) {//驳回后提交修改泛微审批状态
bill.set("tqq9_fwstate", "B");
SaveServiceHelper.save(new DynamicObject[]{bill});
}
}
}
}
}
}