期初生产订单、半成品生产订单不推QMS,其余生产订单类型推QMS
This commit is contained in:
		
							parent
							
								
									ac8c321931
								
							
						
					
					
						commit
						e5c5cdc764
					
				|  | @ -41,7 +41,7 @@ public class PmoToQmsAction implements ICommonAction { | |||
| 
 | ||||
|     private static final String LOG_INFO_NAME = "qyMesLog"; | ||||
|     private static final Log logger = Log.getInstance(LOG_INFO_NAME); | ||||
|     private static final String reqUrl = "/IF_QyErpApi.ashx?action=addsjd"; | ||||
|     private static final String reqUrl = "/IF_QyErpApi.ashx?action=addscjh"; | ||||
|     private Map<String, String> configParams; | ||||
| 
 | ||||
|     public BaseDAO dao; | ||||
|  | @ -87,9 +87,10 @@ public class PmoToQmsAction implements ICommonAction { | |||
|             if (checkIfOrg(orgCode, configParams)) { | ||||
|                 continue; | ||||
|             } | ||||
|             // 期初生产订单、半成品生产订单不推QMS,其余生产订单类型推QMS | ||||
|             String billType = vo.getParentVO().getVtrantypecode(); | ||||
|             if (checkBillType(billType, configParams)) { | ||||
|                 continue; | ||||
|                 throw new BusinessException("订单类型不符合条件"); | ||||
|             } | ||||
|             if (vo.getChildrenVO().length >= 0) { | ||||
|                 if (null != vo.getChildrenVO()[0].getAttributeValue("vdef32") && vo.getChildrenVO()[0].getAttributeValue("vdef32").equals("Y")) { | ||||
|  | @ -216,16 +217,16 @@ public class PmoToQmsAction implements ICommonAction { | |||
|         return true; | ||||
|     } | ||||
|     private boolean checkBillType(String code, Map<String, String> configParams) throws BusinessException { | ||||
|         String targetCode = configParams.get("xbBillType"); | ||||
|         String targetCode = configParams.get("pmoBillType"); | ||||
|         if (targetCode == null || nc.vo.am.common.util.StringUtils.isEmpty(targetCode)) { | ||||
|             throw new BusinessException("δÅäÖõ¥¾ÝÀàÐͲÎÊý"); | ||||
|         } | ||||
|         String[] types = targetCode.split(","); | ||||
|         for (String type : types) { | ||||
|             if (!type.isEmpty() && type.equals(code)) { | ||||
|                 return false; | ||||
|                 return true; | ||||
|             } | ||||
|         } | ||||
|         return true; | ||||
|         return false; | ||||
|     } | ||||
| } | ||||
|  |  | |||
|  | @ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONArray; | |||
| import com.alibaba.fastjson.JSONObject; | ||||
| import com.alibaba.fastjson.serializer.SerializerFeature; | ||||
| import nc.bs.dao.BaseDAO; | ||||
| import nc.bs.dao.DAOException; | ||||
| import nc.bs.logging.Log; | ||||
| import nc.bs.uapbd.util.MyHelper; | ||||
| import nc.bs.uapbd.util.ThirdPartyPostRequestUtil; | ||||
|  | @ -62,6 +63,11 @@ public class AfterApproveSyncQMSRule implements IRule<PMOAggVO> { | |||
|             if (checkIfOrg(orgCode, configParams)) { | ||||
|                 continue; | ||||
|             } | ||||
|             // 期初生产订单、半成品生产订单不推QMS,其余生产订单类型推QMS | ||||
|             String billType = vo.getParentVO().getVtrantypecode(); | ||||
|             if (checkBillType(billType, configParams)) { | ||||
|                 continue; | ||||
|             } | ||||
|             // ×é×°Êý¾Ý | ||||
|             JSONObject singleObj = new JSONObject(); | ||||
|             PMOHeadVO pmoHeadVO = vo.getParentVO(); | ||||
|  | @ -109,8 +115,15 @@ public class AfterApproveSyncQMSRule implements IRule<PMOAggVO> { | |||
|             } | ||||
|             singleObj.put("Content", contentArray); | ||||
|             pushData(singleObj); | ||||
|             updatePmo(vo.getParentVO().getCpmohid()); | ||||
|         } | ||||
|     } | ||||
|     private void updatePmo(String cpmohid) throws DAOException { | ||||
|         BaseDAO dao = new BaseDAO(); | ||||
|         String sql = "update mm_mo set vdef32='Y' where cpmohid='" | ||||
|                 + cpmohid + "'"; | ||||
|         dao.executeUpdate(sql); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * ÍÆËÍͬ²½Êý¾Ý | ||||
|  | @ -151,5 +164,17 @@ public class AfterApproveSyncQMSRule implements IRule<PMOAggVO> { | |||
|         return true; | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     private boolean checkBillType(String code, Map<String, String> configParams) throws BusinessException { | ||||
|         String targetCode = configParams.get("pmoBillType"); | ||||
|         if (targetCode == null || nc.vo.am.common.util.StringUtils.isEmpty(targetCode)) { | ||||
|             throw new BusinessException("未配置单据类型参数"); | ||||
|         } | ||||
|         String[] types = targetCode.split(","); | ||||
|         for (String type : types) { | ||||
|             if (!type.isEmpty() && type.equals(code)) { | ||||
|                 return true; | ||||
|             } | ||||
|         } | ||||
|         return false; | ||||
|     } | ||||
| } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue