精密流程生产订单-增加变更同步启源、同步启源时判断订单类型
This commit is contained in:
		
							parent
							
								
									7d2d0abed8
								
							
						
					
					
						commit
						c9f416977b
					
				|  | @ -5,6 +5,7 @@ import java.util.List; | |||
| 
 | ||||
| import nc.bs.mmpac.pmo.pac0002.bp.rule.AfterApproveSyncEpicMesRule; | ||||
| import nc.bs.mmpac.pmo.pac0002.bp.rule.AfterApprovingSynchronizeRuleRZ; | ||||
| import nc.bs.mmpac.pmo.pac0002.bp.rule.AfterPmoSyncJmQMSRule; | ||||
| import nc.bs.mmpac.pmo.pac0002.pluginpoint.PMOPluginPoint; | ||||
| import nc.bs.mmpac.pmo.pac0002.rule.PMOATPUpdateRule; | ||||
| import nc.bs.mmpac.pmo.pac0002.rule.PMOAdjustReserveRule; | ||||
|  | @ -254,6 +255,8 @@ public class PMOAdjustBP { | |||
| 		processer.addAfterFinalRule(pushRZRule); | ||||
| 		// 变更后推送流程生产订单到艾普MES | ||||
| 		processer.addAfterRule(new AfterApproveSyncEpicMesRule()); | ||||
| 		// 变更后推送流程生产订单到启源(精密铸造) | ||||
| 		processer.addAfterRule(new AfterPmoSyncJmQMSRule()); | ||||
| 	} | ||||
| 
 | ||||
| 	// 挪退料建议 | ||||
|  |  | |||
|  | @ -13,6 +13,7 @@ import nc.bs.uapbd.util.ThirdPartyPostRequestUtil; | |||
| import nc.impl.pubapp.pattern.rule.IRule; | ||||
| import nc.jdbc.framework.processor.ColumnProcessor; | ||||
| import nc.jdbc.framework.processor.MapProcessor; | ||||
| import nc.util.mmf.framework.base.MMValueCheck; | ||||
| import nc.vo.bc.pmpub.project.ProjectHeadVO; | ||||
| import nc.vo.mmpac.pmo.pac0002.entity.PMOAggVO; | ||||
| import nc.vo.mmpac.pmo.pac0002.entity.PMOHeadVO; | ||||
|  | @ -23,6 +24,7 @@ import nc.vo.pub.lang.UFDateTime; | |||
| import nc.vo.sm.UserVO; | ||||
| 
 | ||||
| import java.util.Map; | ||||
| import java.util.Set; | ||||
| 
 | ||||
| /** | ||||
|  * 精密-流程生产订单投放后推送QMS | ||||
|  | @ -70,19 +72,18 @@ public class AfterPmoSyncJmQMSRule implements IRule<PMOAggVO> { | |||
|             if (checkIfOrg(orgCode, configParams)) { | ||||
|                 continue; | ||||
|             } | ||||
| 
 | ||||
|             if(vo.getChildrenVO().length >=0 ){ | ||||
|                 if(vo.getChildrenVO()[0].getAttributeValue("vdef32").equals("Y")){ | ||||
|                     // continue; | ||||
|                 } | ||||
|             } | ||||
|             // 组装数据 | ||||
|             JSONObject singleObj = new JSONObject(); | ||||
|             PMOHeadVO pmoHeadVO = vo.getParentVO(); | ||||
|             PMOItemVO[] itemVOS = vo.getChildrenVO(); | ||||
| 
 | ||||
|             // 判断单据类型,部分类型的生产订单跳过推送 | ||||
|             String vtrantypecode = pmoHeadVO.getVtrantypecode(); | ||||
|             if (checkBillType(vtrantypecode)) continue; | ||||
| 
 | ||||
|             String sql = " select user_name from sm_user where dr = 0 and cuserid = '" + pmoHeadVO.getBillmaker() + "' "; | ||||
|             String billmakerName = (String) baseDAO.executeQuery(sql, new ColumnProcessor()); | ||||
| 
 | ||||
|             // 组装数据 | ||||
|             JSONObject singleObj = new JSONObject(); | ||||
|             singleObj.put("batchid", System.currentTimeMillis()); | ||||
|             singleObj.put("bipzyid", pmoHeadVO.getCpmohid());// BIP订单主键 | ||||
|             singleObj.put("scdh", pmoHeadVO.getVbillcode()); | ||||
|  | @ -115,12 +116,12 @@ public class AfterPmoSyncJmQMSRule implements IRule<PMOAggVO> { | |||
|                 String wlxhgg = MyHelper.skipNull(mrlmap.get("materialspec")) + MyHelper.skipNull(mrlmap.get("materialtype")); | ||||
|                 itemObj.put("wlxhgg", wlxhgg);// 产品型号规格 | ||||
|                 itemObj.put("jhsl", item.getNastnum().toString());// 计划数量,该产品的生产计划数量 | ||||
|                 UFDateTime tplanendtime = item.getTplanendtime(); | ||||
|                 UFDateTime tplanendtime = item.getTplanendtime(); // 计划完工时间 | ||||
|                 String tplanendtimeStr = ""; | ||||
|                 if (tplanendtime != null) { | ||||
|                     tplanendtimeStr = tplanendtime.toString(); | ||||
|                 } | ||||
|                 itemObj.put("jhrq", tplanendtimeStr);// 计划数量,该产品的生产计划数量 | ||||
|                 itemObj.put("jhrq", tplanendtimeStr);// 计划日期,该产品的计划生产日期 | ||||
|                 int flag_wg = 0; | ||||
|                 int flag_jqbz = 0; | ||||
|                 if (fitemstatus == 2) { | ||||
|  | @ -174,6 +175,24 @@ public class AfterPmoSyncJmQMSRule implements IRule<PMOAggVO> { | |||
|         } | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 判断单据类型 | ||||
|      * | ||||
|      * @param vtrantypecode 单据类型编码 | ||||
|      */ | ||||
|     private boolean checkBillType(String vtrantypecode) { | ||||
|         String typeCodeStr = configParams.get("MMleixingCode"); | ||||
|         if (MMValueCheck.isNotEmpty(typeCodeStr)) { | ||||
|             if (typeCodeStr.contains(",")) { | ||||
|                 Set<String> codeSet = Set.of(typeCodeStr.split(",", -1)); | ||||
|                 return codeSet.contains(vtrantypecode); | ||||
|             } else { | ||||
|                 return typeCodeStr.equals(vtrantypecode); | ||||
|             } | ||||
|         } | ||||
|         return false; | ||||
|     } | ||||
| 
 | ||||
|     private boolean checkIfOrg(String code, Map<String, String> configParams) throws BusinessException { | ||||
|         String targetCode = configParams.get("xbOrg"); | ||||
|         if (targetCode == null || nc.vo.am.common.util.StringUtils.isEmpty(targetCode)) { | ||||
|  | @ -187,6 +206,7 @@ public class AfterPmoSyncJmQMSRule implements IRule<PMOAggVO> { | |||
|         } | ||||
|         return true; | ||||
|     } | ||||
| 
 | ||||
|     private void updatePmo(String cpmohid) throws DAOException { | ||||
|         BaseDAO dao = new BaseDAO(); | ||||
|         String sql = "update mm_mo set vdef32='Y' where cpmohid='" | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue