39 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			Java
		
	
	
	
			
		
		
	
	
			39 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			Java
		
	
	
	
| 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;
 | |
| import kd.bos.servicehelper.operation.SaveServiceHelper;
 | |
| import org.apache.commons.lang3.StringUtils;
 | |
| 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)){
 | |
|                         dataEntity.set("tqq9_ispushfw", true);
 | |
|                         SaveServiceHelper.save(new DynamicObject[]{dataEntity});
 | |
|                     }
 | |
|                 }
 | |
|             }
 | |
|         }
 | |
| 
 | |
|     }
 | |
| 
 | |
| 
 | |
| }
 |