53 lines
		
	
	
		
			2.1 KiB
		
	
	
	
		
			Java
		
	
	
	
		
		
			
		
	
	
			53 lines
		
	
	
		
			2.1 KiB
		
	
	
	
		
			Java
		
	
	
	
| 
								 | 
							
								package tqq9.lc123.cloud.app.plugin.operate.im;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								import com.alibaba.fastjson.JSONArray;
							 | 
						||
| 
								 | 
							
								import com.alibaba.fastjson.JSONObject;
							 | 
						||
| 
								 | 
							
								import kd.bos.dataentity.entity.DynamicObject;
							 | 
						||
| 
								 | 
							
								import kd.bos.dataentity.entity.DynamicObjectCollection;
							 | 
						||
| 
								 | 
							
								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 tqq9.lc123.cloud.app.plugin.utils.ConfigUtils;
							 | 
						||
| 
								 | 
							
								import tqq9.lc123.cloud.app.plugin.utils.FWOrgMappingUtils;
							 | 
						||
| 
								 | 
							
								import tqq9.lc123.cloud.app.plugin.utils.FWRestfulUtils;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								import java.math.BigDecimal;
							 | 
						||
| 
								 | 
							
								import java.text.SimpleDateFormat;
							 | 
						||
| 
								 | 
							
								import java.util.ArrayList;
							 | 
						||
| 
								 | 
							
								import java.util.Arrays;
							 | 
						||
| 
								 | 
							
								import java.util.Date;
							 | 
						||
| 
								 | 
							
								import java.util.List;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								public class OtherOutSubmitToFwOp extends AbstractOperationServicePlugIn {
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    @Override
							 | 
						||
| 
								 | 
							
								    public void afterExecuteOperationTransaction(AfterOperationArgs e) {
							 | 
						||
| 
								 | 
							
								        super.afterExecuteOperationTransaction(e);
							 | 
						||
| 
								 | 
							
								        OperationResult operationResult = this.getOperationResult();
							 | 
						||
| 
								 | 
							
								        List<Object> successPkIds = operationResult.getSuccessPkIds();
							 | 
						||
| 
								 | 
							
								        for (Object successPkId : successPkIds) {
							 | 
						||
| 
								 | 
							
								            DynamicObject bill = BusinessDataServiceHelper.loadSingle(successPkId, "im_otheroutbill");
							 | 
						||
| 
								 | 
							
								            String resultStr = FWImpl.pushFwOtherOut(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);
							 | 
						||
| 
								 | 
							
								                        SaveServiceHelper.save(new DynamicObject[]{bill});
							 | 
						||
| 
								 | 
							
								                    }
							 | 
						||
| 
								 | 
							
								                }
							 | 
						||
| 
								 | 
							
								            }
							 | 
						||
| 
								 | 
							
								        }
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								}
							 |