update 备货出库,出库按钮增加现场仓
This commit is contained in:
parent
08ac09c914
commit
5cd5ee8d07
@ -3087,7 +3087,7 @@ public class InvoiceServiceImpl implements InvoiceService {
|
|||||||
src = IDMFrameServiceProxy.getSqlTemplate().queryForList(sqlc, bpc);
|
src = IDMFrameServiceProxy.getSqlTemplate().queryForList(sqlc, bpc);
|
||||||
}
|
}
|
||||||
//MES需要接收,则只抛送数据。 或如果是现场仓,先移到现场仓
|
//MES需要接收,则只抛送数据。 或如果是现场仓,先移到现场仓
|
||||||
if(src.size()>0) {
|
if (src.size()>0){
|
||||||
billCode="Y";
|
billCode="Y";
|
||||||
String sqlZK=" SELECT\r\n" +
|
String sqlZK=" SELECT\r\n" +
|
||||||
" t.MATERIALSPECNAME,m.MATERIALPACKINGNAME,\r\n" +
|
" t.MATERIALSPECNAME,m.MATERIALPACKINGNAME,\r\n" +
|
||||||
@ -3183,19 +3183,169 @@ public class InvoiceServiceImpl implements InvoiceService {
|
|||||||
hashMapPack.put("oldStockState", GenericServiceProxy.getConstantMap().STOCKSTATE_STOCKED);
|
hashMapPack.put("oldStockState", GenericServiceProxy.getConstantMap().STOCKSTATE_STOCKED);
|
||||||
setEventInfo.setUserColumns(hashMapPack);
|
setEventInfo.setUserColumns(hashMapPack);
|
||||||
MaterialPackingServiceProxy.getMaterialPackingService().setEvent(arrayList, mesEventInfo, setEventInfo);
|
MaterialPackingServiceProxy.getMaterialPackingService().setEvent(arrayList, mesEventInfo, setEventInfo);
|
||||||
}
|
}else if(!ERPRECEIVELOCATION.isEmpty()){
|
||||||
else
|
|
||||||
{
|
|
||||||
billCode=ProductionStockOut_NEW(shipRequestName, "SDK", eventUser,materialPackingKeyList,commitDate);
|
|
||||||
if (billCode.isEmpty()) {
|
|
||||||
throw new CustomException("SAP过账异常!");
|
|
||||||
}
|
|
||||||
// billCode=toSAPService.ProductionStockOut_NEW(shipRequestName, "SDK", eventUser,materialPackingKeyList);
|
|
||||||
//抛送MES数据
|
|
||||||
untils.sendMaterialInfoToMES_NEW(shipRequestName, "", materialPackingKeyList);
|
|
||||||
//billCode = NCWServiceImpl.SaleOut2(shipRequestName, "SDK", eventUser,materialPackingKeyList,"");
|
|
||||||
untils.SaveUnDoInfo_ForSap(materialPackingKeyList, billCode, makeEventInfo);
|
|
||||||
|
|
||||||
|
// 拆条码,查询MATERIALQUANTITY 与 MATERIALQUANTITY2是否相等,如果相等则未修改了数量,不相等则修改了数量
|
||||||
|
// 如果已修改数量,则进行拆条码
|
||||||
|
// for (int z = 0; z < packingQueryForList.size(); z++) {
|
||||||
|
// String MATERIALPACKINGNAME = packingQueryForList.get(z).get("MATERIALPACKINGNAME").toString();
|
||||||
|
// Object[] bindSet = {MATERIALPACKINGNAME};
|
||||||
|
// String qtysql = "WHERE MATERIALPACKINGNAME = ?";
|
||||||
|
// List<MaterialPacking> qtyQueryForList = MaterialPackingServiceProxy.getMaterialPackingService().select(qtysql, bindSet);
|
||||||
|
//
|
||||||
|
// String qty = String.valueOf(qtyQueryForList.get(z).getMaterialQuantity());
|
||||||
|
//
|
||||||
|
// String qty2 = new Double(qtyQueryForList.get(z).getMaterialQuantity2()) == null ? "0" : String.valueOf(qtyQueryForList.get(z).getMaterialQuantity2());
|
||||||
|
// String materialPackingName = qtyQueryForList.get(z).getMaterialPackingName();
|
||||||
|
// String charge = qtyQueryForList.get(z).getCharge();
|
||||||
|
// BigDecimal bigQty = new BigDecimal(qty);
|
||||||
|
// // 已拆数量
|
||||||
|
// BigDecimal bigQty2 = new BigDecimal(qty2);
|
||||||
|
//
|
||||||
|
// // 如果已拆数量不等于原数量,并且已拆数量为0(未拆分数量)
|
||||||
|
// if(bigQty.compareTo(bigQty2) != 0 && !"0".equals(qty2)) {
|
||||||
|
// // 剩余数量
|
||||||
|
// BigDecimal restQty = bigQty.subtract(bigQty2);
|
||||||
|
//
|
||||||
|
// // 生成新的拆分条码
|
||||||
|
// String stringBigQty2 = bigQty2.toString();
|
||||||
|
// String newPalletNo = CodeGenerator.packingGenerateCode(materialPackingName,stringBigQty2,charge);
|
||||||
|
//
|
||||||
|
// // 写入拆分的新条码,更新原数据库
|
||||||
|
// List<MaterialPacking> boxList = new ArrayList<MaterialPacking>();
|
||||||
|
//// MaterialPackingKey materialpackingKey = new MaterialPackingKey();
|
||||||
|
// MaterialPacking materialpackingNew = new MaterialPacking();
|
||||||
|
//// materialpackingKey.setSiteName("SDK");
|
||||||
|
//// materialpackingKey.setMaterialPackingName(newPalletNo);
|
||||||
|
//// materialpackingNew.setKey(materialpackingKey);
|
||||||
|
//
|
||||||
|
// // 复制一个当前的原标签数据
|
||||||
|
// materialpackingNew.setKey(qtyQueryForList.get(z).getKey());
|
||||||
|
//// MaterialPacking materialpackingNew = qtyQueryForList.get(z);
|
||||||
|
// // 设置新为标签和数量
|
||||||
|
// materialpackingNew.setMaterialPackingName(newPalletNo);
|
||||||
|
// // bigQty2 转double类型
|
||||||
|
// materialpackingNew.setMaterialQuantity(bigQty2.doubleValue());
|
||||||
|
// boxList.add(qtyQueryForList.get(z));
|
||||||
|
// boxList.add(materialpackingNew);
|
||||||
|
// boolean moveTransformOut = packingChargeSplit(boxList, eventUser);
|
||||||
|
// if (moveTransformOut != true) {
|
||||||
|
// throw new RuntimeException("修改数量拆分失败");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // 原条码扣减拆出的数量,用剩余数量更新原条码,条码不变,数量更新
|
||||||
|
// SetEventInfo setEventInfo = new SetEventInfo();
|
||||||
|
// Map<String, Object> pakHashMap = new HashMap<>();
|
||||||
|
// pakHashMap.put("materialQuantity", restQty.doubleValue());
|
||||||
|
//
|
||||||
|
// EventInfo eventInfo = new EventInfoUtil().makeEventInfo("备货出库拆分修改数量拆分条码", eventUser, "修改数量拆分条码");
|
||||||
|
// setEventInfo.setUserColumns(pakHashMap);
|
||||||
|
// MaterialPackingServiceProxy.getMaterialPackingService().setEvent(new MaterialPackingKey( queryForList.get(z).get("SITENAME").toString(),
|
||||||
|
// queryForList.get(z).get("MATERIALPACKINGNAME").toString()), eventInfo, setEventInfo);
|
||||||
|
//
|
||||||
|
// // 删除被拆分的原条码数据,用拆分出的新条码覆盖,进行后面的过账,现场仓过账只过账已拆分出的数量,剩余数量的原条码不过账
|
||||||
|
// boolean deletePacking = materialPackingKeyList.remove(MATERIALPACKINGNAME);
|
||||||
|
// if (deletePacking) {
|
||||||
|
// materialPackingKeyList.add(newPalletNo);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
//new MESServiceImpl().NeedReceiveMaterialInfoSend_NEW(shipRequestName, "SDK", materialPackingKeyList);
|
||||||
|
billCode="Y";
|
||||||
|
String sqlZK=" SELECT\r\n" +
|
||||||
|
" t.MATERIALSPECNAME,m.MATERIALPACKINGNAME,\r\n" +
|
||||||
|
" t.ERPFACTORY,\r\n" +
|
||||||
|
" t.ERPLOCATION,\r\n" +
|
||||||
|
" m2.SHIPREQUESTDETAILTYPE,\r\n" +
|
||||||
|
" t.UNIT,\r\n" +
|
||||||
|
" m1.COSTCENTER,\r\n" +
|
||||||
|
" m1.SHIPREQUESTNAME,\r\n" +
|
||||||
|
" m1.SHIPREQUESTDETAILNAME,\r\n" +
|
||||||
|
" m1.ERPRECEIVELOCATION,\r\n" +
|
||||||
|
" m1.ERPRECEIVEFACTORY,\r\n" +
|
||||||
|
" m1.SENDSALESORDER ,m1.SENDSALESORDERDETAILNO,\r\n" +
|
||||||
|
" CASE WHEN m1.SENDSALESORDER IS NOT NULL THEN 'E' ELSE '' END SOBKZ,\r\n" +
|
||||||
|
" (\r\n" +
|
||||||
|
" SELECT\r\n" +
|
||||||
|
" RECEIVEPRODUCTIONORDERNUMBER\r\n" +
|
||||||
|
" FROM\r\n" +
|
||||||
|
" MATERIALSHIPREQUESTDETAIL m5\r\n" +
|
||||||
|
" WHERE\r\n" +
|
||||||
|
" m5.SHIPREQUESTNAME =:SHIPREQUESTNAME\r\n" +
|
||||||
|
" AND m5.MATERIALSPECNAME = t.MATERIALSPECNAME\r\n" +
|
||||||
|
" ORDER BY\r\n" +
|
||||||
|
" m5.USEDATE,\r\n" +
|
||||||
|
" m5.SHIPREQUESTDETAILNAME FETCH FIRST ROW ONLY)RECEIVEPRODUCTIONORDERNUMBER,\r\n" +
|
||||||
|
" SUM(m.QTY) AS MATERIALQUANTITY\r\n" +
|
||||||
|
" FROM \r\n" +
|
||||||
|
" MATERIALPACKINGSUB m\r\n" +
|
||||||
|
" LEFT JOIN MATERIALPACKING T ON \r\n" +
|
||||||
|
" m.MATERIALPACKINGNAME = T.MATERIALPACKINGNAME\r\n" +
|
||||||
|
" AND m.RECEIVEREQUESTNAME = T.SHIPREQUESTNAME\r\n" +
|
||||||
|
" LEFT JOIN MATERIALSHIPREQUESTDETAIL M1 \r\n" +
|
||||||
|
" ON \r\n" +
|
||||||
|
" m.RECEIVEREQUESTNAME = M1.SHIPREQUESTNAME\r\n" +
|
||||||
|
" AND m.RECEIVEREQUESTDETAILNAME = M1.SHIPREQUESTDETAILNAME\r\n" +
|
||||||
|
" LEFT JOIN MATERIALSHIPREQUEST M2 \r\n" +
|
||||||
|
" ON \r\n" +
|
||||||
|
" M1.SHIPREQUESTNAME = M2.SHIPREQUESTNAME\r\n" +
|
||||||
|
" WHERE \r\n" +
|
||||||
|
" T.SHIPREQUESTNAME = :SHIPREQUESTNAME\r\n" +
|
||||||
|
" AND T.SITENAME = :SITENAME\r\n" +
|
||||||
|
" AND T.STOCKSTATE = 'Stocked'\r\n" +
|
||||||
|
" AND T.MATERIALPACKINGNAME IN (:BOXLIST)\r\n" +
|
||||||
|
" GROUP BY\r\n" +
|
||||||
|
" t.MATERIALSPECNAME,\r\n" +
|
||||||
|
" t.ERPFACTORY,\r\n" +
|
||||||
|
" t.ERPLOCATION,\r\n" +
|
||||||
|
" m2.SHIPREQUESTDETAILTYPE,\r\n" +
|
||||||
|
" t.UNIT,\r\n" +
|
||||||
|
" m1.COSTCENTER,\r\n" +
|
||||||
|
" m1.SHIPREQUESTNAME,m1.SENDSALESORDER ,m1.SENDSALESORDERDETAILNO,\r\n" +
|
||||||
|
" m1.SHIPREQUESTDETAILNAME,\r\n" +
|
||||||
|
" m1.ERPRECEIVELOCATION,\r\n" +
|
||||||
|
" m1.ERPRECEIVEFACTORY,m.MATERIALPACKINGNAME";
|
||||||
|
|
||||||
|
// 转库到线边仓
|
||||||
|
// String sqlZK = "SELECT b.MATERIALPACKINGNAME FROM MATERIALPACKINGSUB b WHERE b.MATERIALPACKINGNAME IN (:BOXLIST)";
|
||||||
|
Map<String, Object> hashMapZK = new HashMap<String, Object>();
|
||||||
|
hashMapZK.put("BOXLIST", materialPackingKeyList);
|
||||||
|
hashMapZK.put("SHIPREQUESTNAME", shipRequestName);
|
||||||
|
hashMapZK.put("SITENAME", siteName);
|
||||||
|
List<Map<String, Object>> ZKqueryForList = IDMFrameServiceProxy.getSqlTemplate().queryForList(sqlZK.toString(), hashMapZK);
|
||||||
|
|
||||||
|
for (int z = 0; z < ZKqueryForList.size(); z++) {
|
||||||
|
String materialPackingName = ZKqueryForList.get(z).get("MATERIALPACKINGNAME").toString();
|
||||||
|
materialPackingKeyList.add(materialPackingName);
|
||||||
|
MaterialPackingKey materialPackingKey = new MaterialPackingKey("SDK",materialPackingName);
|
||||||
|
arrayList.add(materialPackingKey);
|
||||||
|
}
|
||||||
|
billCode = UnSourcedChangeLocation(arrayList,ERPRECEIVEFACTORY,
|
||||||
|
ERPRECEIVELOCATION, "", eventUser, commitDate );
|
||||||
|
|
||||||
|
List<MaterialPackingKey> mpKeyList = new ArrayList<MaterialPackingKey> ();
|
||||||
|
SetEventInfo setEventInfo = new SetEventInfo();
|
||||||
|
for (MaterialPackingKey materialPacking : arrayList) {
|
||||||
|
MaterialPackingKey key = materialPacking;
|
||||||
|
mpKeyList.add(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, Object> hashMapPack = new HashMap<String,Object> ();
|
||||||
|
hashMapPack.put("erpLocation", ERPRECEIVELOCATION == null ? "" : ERPRECEIVELOCATION);
|
||||||
|
hashMapPack.put("erpFactory", ERPRECEIVEFACTORY == null ? "" : ERPRECEIVEFACTORY);
|
||||||
|
hashMapPack.put("locationName", "");
|
||||||
|
hashMapPack.put("lastEventUser", eventUser);
|
||||||
|
hashMapPack.put("unDoID", billCode);
|
||||||
|
setEventInfo.setUserColumns(hashMapPack);
|
||||||
|
MaterialPackingServiceProxy.getMaterialPackingService().setEvent(mpKeyList, makeEventInfo, setEventInfo);
|
||||||
|
//抛送MES数据
|
||||||
|
untils.sendMaterialInfoToMES_NEW2(shipRequestName, "", materialPackingKeyList);
|
||||||
|
|
||||||
|
WlySaveUnDoInfo( billCode,commitDate);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user