材料出库审核后推送艾普MES-v1
This commit is contained in:
		
							parent
							
								
									6567a5cc07
								
							
						
					
					
						commit
						3c12653d77
					
				|  | @ -12,8 +12,7 @@ import nc.bs.ic.general.sign.SignBPTemplate; | |||
| import nc.bs.ic.m4d.base.BPPlugInPoint; | ||||
| import nc.bs.ic.m4d.base.UpdateSCOnhandRule; | ||||
| import nc.bs.ic.m4d.sign.rule.AfterSignRuleForLiabilityProcess; | ||||
| import nc.bs.ic.m4d.sign.rule.CheckDbizdateProcess; | ||||
| import nc.bs.ic.m4d.sign.rule.PullProcess; | ||||
| import nc.bs.ic.m4d.sign.rule.PullProcessEpicMesRule; | ||||
| import nc.bs.ic.m4d.sign.rule.PushSaveIAandTOBill; | ||||
| import nc.bs.ic.pub.util.SagasUtils; | ||||
| import nc.bs.scmpub.rule.VOSagaFrozenValidateRule; | ||||
|  | @ -36,8 +35,8 @@ public class SignBP implements ISignBP<MaterialOutVO>, ISignRuleProvider<Materia | |||
|         processor.addAfterRule(new PushSaveIAandTOBill()); | ||||
|         processor.addAfterRule(new AfterSignRuleForLiabilityProcess()); | ||||
| //        processor.addAfterRule(new CheckDbizdateProcess()); | ||||
| //        导入领料需求 | ||||
|         processor.addAfterRule(new PullProcess()); | ||||
| //        推送艾普MES-领料需求/退库单 | ||||
|         processor.addAfterRule(new PullProcessEpicMesRule()); | ||||
|     } | ||||
| 
 | ||||
|     public void addBeforeRule(MaterialOutVO[] vos, AroundProcesser<MaterialOutVO> processor) { | ||||
|  | @ -46,11 +45,11 @@ public class SignBP implements ISignBP<MaterialOutVO>, ISignRuleProvider<Materia | |||
| 
 | ||||
|     public MaterialOutVO[] sign(MaterialOutVO[] vos) { | ||||
|         SignBPTemplate<MaterialOutVO> signBP = new SignBPTemplate(BPPlugInPoint.SignBP, this); | ||||
|         SagasUtils.frozenAndAddSaga(vos, ICBillType.MaterialOut.getCode(), "1", (OperationInfo)null); | ||||
|         SagasUtils.frozenAndAddSaga(vos, ICBillType.MaterialOut.getCode(), "1", (OperationInfo) null); | ||||
|         Map<String, Serializable> paramMap = new HashMap(); | ||||
|         paramMap.put("actionname", "sign_4D"); | ||||
|         paramMap.put("hid", VOEntityUtil.getPksFromAggVO(vos)); | ||||
|         SagasUtils.compensate(paramMap, IMaterialOutSagasCompensate.class); | ||||
|         return (MaterialOutVO[])signBP.sign(vos); | ||||
|         return (MaterialOutVO[]) signBP.sign(vos); | ||||
|     } | ||||
| } | ||||
|  |  | |||
|  | @ -20,8 +20,8 @@ import java.util.Map; | |||
|  * | ||||
|  * @author lihao | ||||
|  */ | ||||
| public class PullProcess implements IRule<MaterialOutVO> { | ||||
|     public PullProcess() { | ||||
| public class PullProcessEpicMesRule implements IRule<MaterialOutVO> { | ||||
|     public PullProcessEpicMesRule() { | ||||
|     } | ||||
| 
 | ||||
|     private static final String LOG_INFO_NAME = "dldzlog"; | ||||
|  | @ -97,14 +97,14 @@ public class PullProcess implements IRule<MaterialOutVO> { | |||
|             detailItem.put("rowNum", Integer.parseInt(item.getCrowno()));// 明细行号(整数) | ||||
|             String mrlsql = "select code,name from bd_material_v where pk_source = '" + item.getCmaterialoid() + "' "; | ||||
|             Map<String, Object> mrl = (Map<String, Object>) dao.executeQuery(mrlsql, new MapProcessor()); | ||||
|             detailItem.put("mrlCode", mrl.get("code")); | ||||
|             detailItem.put("mrlName", mrl.get("name")); | ||||
|             detailItem.put("mrlCode", mrl.get("code"));// 物料编码 | ||||
|             detailItem.put("mrlName", mrl.get("name"));// 物料名称 | ||||
|             detailItem.put("planInDate", item.getDbizdate().toStdString()); // 计划入库日期(可为空) | ||||
|             //  计划入库数量(浮点数)MES退货单数量为正,需要转换 | ||||
|             detailItem.put("planInQty", item.getNassistnum().abs().doubleValue()); | ||||
|             String unitsql = "select code from bd_measdoc where pk_measdoc = '" + item.getCastunitid() + "' "; | ||||
|             String unitsql = "select name from bd_measdoc where pk_measdoc = '" + item.getCastunitid() + "' "; | ||||
|             Map<String, Object> unit = (Map<String, Object>) dao.executeQuery(unitsql, new MapProcessor()); | ||||
|             detailItem.put("unit", unit.get("code"));// 单位 | ||||
|             detailItem.put("unit", unit.get("name"));// 单位 | ||||
|             detailItem.put("contractNo", null);// 合同号(可为空) | ||||
| 
 | ||||
|             String areasql = "select code from bd_stordoc where pk_stordoc = '" + item.getCbodywarehouseid() + "' "; | ||||
|  | @ -126,7 +126,7 @@ public class PullProcess implements IRule<MaterialOutVO> { | |||
|         logDl.error("EpicMes-MaterialOut-req = " + result); | ||||
| 
 | ||||
|         if (!"1".equals(resultObj.getString("flag"))) { | ||||
|             throw new BusinessException("EpicMes-MaterialOut-failerror:" + resultObj.getString("msg")); | ||||
|             throw new BusinessException("EpicMes-MaterialOut-error:" + resultObj.getString("msg")); | ||||
|         } else { | ||||
|             logDl.error("EpicMes-MaterialOut-suc,result[" + resultObj.toJSONString() + "]"); | ||||
|         } | ||||
		Loading…
	
		Reference in New Issue