流程生产订单: MES同步orderNo改为生产订单号+行号
- 将生产订单号和行号组合后作为 orderNo 传给 MES- 增加长度校验,确保组合后的长度不超过 18 位 - 优化错误提示信息,明确指出长度限制
This commit is contained in:
		
							parent
							
								
									941dec1543
								
							
						
					
					
						commit
						f5a8bd81c0
					
				|  | @ -196,16 +196,15 @@ public class AfterApproveRuleSyncMes implements IRule<PMOAggVO> { | |||
|     private void syncOrderItemToMes(PMOHeadVO head, PMOItemVO item) throws BusinessException { | ||||
|         JSONObject data = new JSONObject(); | ||||
|         String vbillcode = head.getVbillcode(); // µ¥¾ÝºÅ | ||||
|         String itemRow = item.getVrowno(); // 行号 | ||||
|         String itemRow = item.getVrowno(); // 行号        obmlog.info("开始为生产订单 " + vbillcode + " 行 " + itemRow + " 构建同步MES数据。"); | ||||
| 
 | ||||
|         obmlog.info("开始为生产订单 " + vbillcode + " 行 " + itemRow + " 构建同步MES数据。"); | ||||
| 
 | ||||
|         // orderNo String 是 生产订单号 vbillcode | ||||
|         if (vbillcode.length() > 18) { | ||||
|             throw new BusinessException("MES同步要求:生产订单 " + vbillcode + " 行 " + itemRow + " 单据号长度不能超过18位。"); | ||||
|         // orderNo String 是 生产订单号+行号 vbillcode+itemRow | ||||
|         String orderNoWithRow = vbillcode + itemRow; | ||||
|         if (orderNoWithRow.length() > 18) { | ||||
|             throw new BusinessException("MES同步要求:生产订单 " + vbillcode + " 行 " + itemRow + " 单据号+行号长度不能超过18位,当前长度:" + orderNoWithRow.length()); | ||||
|         } | ||||
| 
 | ||||
|         data.put("orderNo", vbillcode); | ||||
|         data.put("orderNo", orderNoWithRow); | ||||
| 
 | ||||
|         SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue