2025-10-13 07:49:19 +00:00
|
|
|
package tqq9.lc123.cloud.app.plugin.operate.sys;
|
|
|
|
|
|
|
|
|
|
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;
|
2025-10-17 03:38:03 +00:00
|
|
|
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
2025-10-13 09:16:45 +00:00
|
|
|
import org.apache.commons.lang3.StringUtils;
|
2025-10-13 07:49:19 +00:00
|
|
|
import tqq9.lc123.cloud.app.plugin.trd.FWImpl;
|
|
|
|
|
|
|
|
|
|
public class WarehouseAuditOp extends AbstractOperationServicePlugIn {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void afterExecuteOperationTransaction(AfterOperationArgs e) {
|
|
|
|
|
super.afterExecuteOperationTransaction(e);
|
|
|
|
|
OperationResult operationResult = this.getOperationResult();
|
|
|
|
|
if(operationResult.isSuccess()){
|
|
|
|
|
DynamicObject[] dataEntities = e.getDataEntities();
|
|
|
|
|
for (DynamicObject dataEntity : dataEntities) {
|
|
|
|
|
dataEntity = BusinessDataServiceHelper.loadSingle(dataEntity.getPkValue(), dataEntity.getDynamicObjectType().getName());
|
|
|
|
|
String resultStr = FWImpl.syncWH(dataEntity);
|
|
|
|
|
if(StringUtils.isNotBlank(resultStr)){
|
|
|
|
|
JSONObject resultJson = JSONObject.parseObject(resultStr);
|
|
|
|
|
String status = resultJson.getString("status");
|
|
|
|
|
if("1".equals(status)){
|
2025-10-17 03:38:03 +00:00
|
|
|
dataEntity.set("tqq9_ispushfw", true);
|
|
|
|
|
SaveServiceHelper.save(new DynamicObject[]{dataEntity});
|
2025-10-13 07:49:19 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|