【泛微新建供应商流程接口】推送时 忽略非采购供应商
This commit is contained in:
		
							parent
							
								
									a2c25aebd1
								
							
						
					
					
						commit
						519bf02bed
					
				|  | @ -2,6 +2,7 @@ package tqq9.lc123.cloud.app.plugin.operate.sys; | |||
| 
 | ||||
| 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; | ||||
|  | @ -25,22 +26,37 @@ public class SupplierSubmitToFwOp extends AbstractOperationServicePlugIn { | |||
|         List<Object> successPkIds = operationResult.getSuccessPkIds(); | ||||
|         for (Object successPkId : successPkIds) { | ||||
|             DynamicObject bill = BusinessDataServiceHelper.loadSingle(successPkId, "bd_supplier"); | ||||
|             boolean tqq9_issuccess = bill.getBoolean("tqq9_issuccess"); | ||||
|             String resultStr = FWImpl.pushFwSupplier(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"); | ||||
|                         if(tqq9_issuccess){ | ||||
|                             bill.set("tqq9_fwupdid", requestid); | ||||
|                         }else{ | ||||
|                             bill.set("tqq9_fwrequestid", requestid); | ||||
|             DynamicObjectCollection groupstandardColl = bill.getDynamicObjectCollection("entry_groupstandard"); | ||||
|             boolean isPurSupplier = false;//是否是采购供应商 | ||||
|             for (DynamicObject groupstandard : groupstandardColl) { | ||||
|                 DynamicObject groupid = groupstandard.getDynamicObject("groupid"); | ||||
|                 if(groupid != null){ | ||||
|                     String groupNumber = groupid.getString("number"); | ||||
|                     if("002".equals(groupNumber)){//002-采购供应商 | ||||
|                         isPurSupplier = true; | ||||
|                         break; | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|             if(isPurSupplier){ | ||||
|                 //是采购供应商 才需要推送泛微 | ||||
|                 boolean tqq9_issuccess = bill.getBoolean("tqq9_issuccess"); | ||||
|                 String resultStr = FWImpl.pushFwSupplier(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"); | ||||
|                             if(tqq9_issuccess){ | ||||
|                                 bill.set("tqq9_fwupdid", requestid); | ||||
|                             }else{ | ||||
|                                 bill.set("tqq9_fwrequestid", requestid); | ||||
|                             } | ||||
|                             bill.set("tqq9_fwstate", "B"); | ||||
|                             SaveServiceHelper.save(new DynamicObject[]{bill}); | ||||
|                         } | ||||
|                         bill.set("tqq9_fwstate", "B"); | ||||
|                         SaveServiceHelper.save(new DynamicObject[]{bill}); | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue