fix:质检状态类型1时自动转仓逻辑更改
This commit is contained in:
parent
0d9de3c5ce
commit
8587d23b6a
@ -111,6 +111,7 @@ public class MaterialPacking extends FieldAccessor implements DataInfo<MaterialP
|
||||
|
||||
private String BUSINESS_UNIT;
|
||||
|
||||
private String POCATEGORY;
|
||||
|
||||
private String durableType;
|
||||
|
||||
@ -1003,6 +1004,14 @@ public class MaterialPacking extends FieldAccessor implements DataInfo<MaterialP
|
||||
this.preOqaResult = preOqaResult;
|
||||
}
|
||||
|
||||
public String getPOCATEGORY() {
|
||||
return POCATEGORY;
|
||||
}
|
||||
|
||||
public void setPOCATEGORY(String POCATEGORY) {
|
||||
this.POCATEGORY = POCATEGORY;
|
||||
}
|
||||
|
||||
public static class Field {
|
||||
public static final String messageID = "messageId";
|
||||
}
|
||||
|
@ -126,6 +126,7 @@ public class MESServiceImpl implements MESService{
|
||||
" WHERE m.SITENAME =:SITENAME \r\n" +
|
||||
" AND m.SHIPREQUESTNAME =:SHIPREQUESTNAME\r\n" +
|
||||
" AND m.MATERIALPACKINGNAME in(:BOXLIST) \r\n" +
|
||||
" AND m4.LANGUAGE = 'ZH' \r\n" +
|
||||
" AND m.MATERIALSPECNAME =m2.MATERIALSPECNAME \r\n" +
|
||||
" AND m.SHIPREQUESTNAME =m3.SHIPREQUESTNAME \r\n" +
|
||||
" AND m.MATERIALSPECNAME =m4.MATERIALSPECNAME \r\n" +
|
||||
@ -250,6 +251,7 @@ public class MESServiceImpl implements MESService{
|
||||
" WHERE m.SITENAME =:SITENAME \r\n" +
|
||||
" AND m.SHIPREQUESTNAME =:SHIPREQUESTNAME\r\n" +
|
||||
" AND m.MATERIALPACKINGNAME in(:BOXLIST) \r\n" +
|
||||
" AND m4.LANGUAGE = 'ZH' \r\n" +
|
||||
" AND m.MATERIALSPECNAME =m2.MATERIALSPECNAME \r\n" +
|
||||
" AND m.SHIPREQUESTNAME =m3.SHIPREQUESTNAME \r\n" +
|
||||
" AND m.MATERIALSPECNAME =m4.MATERIALSPECNAME \r\n" +
|
||||
@ -386,9 +388,9 @@ public class MESServiceImpl implements MESService{
|
||||
erplog.setResultCode(code);
|
||||
MessageLogUtil.writeMessageLog(erplog);
|
||||
|
||||
if (!success) {
|
||||
throw new CustomException("MES删除标签接口返回报错:" + msg);
|
||||
}
|
||||
// if (!success) {
|
||||
// throw new CustomException("MES删除标签接口返回报错:" + msg);
|
||||
// }
|
||||
|
||||
return code;
|
||||
}
|
||||
|
@ -876,6 +876,7 @@ public class ToSAPServiceImpl {
|
||||
Map<String,String> bodyJSonData = new HashMap<>();
|
||||
MainData.put("HEAD",headJSonData);
|
||||
MainData.put("BODY",bodyJSonData);
|
||||
|
||||
headJSonData.put("INTF_ID","MM068");
|
||||
headJSonData.put("SRC_SYSTEM","WMS");
|
||||
headJSonData.put("DEST_SYSTEM","SAP");
|
||||
@ -886,6 +887,11 @@ public class ToSAPServiceImpl {
|
||||
bodyJSonData.put("MBLNR", MBLNR);
|
||||
bodyJSonData.put("MJAHR", MJAHR);
|
||||
|
||||
//过账日期
|
||||
bodyJSonData.put("BUDAT", "20250430");
|
||||
//凭证日期
|
||||
bodyJSonData.put("BLDAT", "20250430");
|
||||
|
||||
String sendData = MainData.toJSONString();
|
||||
return sendData;
|
||||
}
|
||||
@ -5197,7 +5203,6 @@ public class ToSAPServiceImpl {
|
||||
item.put("KOSTL", cqueryForList.get(0).get("COSTCENTER") == null ? "" : cqueryForList.get(0).get("COSTCENTER")); //成本中心
|
||||
item.put("AUFNR", mm.get("SHIPREQUESTNAME")); // //从mes_ship表获取的单据号
|
||||
item.put("AUFPS", mm.get("SHIPREQUESTDETAILNAME")); // //从mes_ship表获取的单据号
|
||||
item.put("AUFPS", mm.get("")); //移动原因
|
||||
}
|
||||
if(moveType.equals("262")) {
|
||||
item.put("AUFNR", mm.get("PRODUCTORDER"));; //生产工单
|
||||
|
@ -45,7 +45,7 @@ public class AllocateStockInController {
|
||||
@ApiParam(value = "调拨入库参数", required = true) @RequestBody BarcodeListByInvoice barcodeListByInvoice) {
|
||||
log.info("AllocateStockInController commit {}", barcodeListByInvoice);
|
||||
try {
|
||||
allocateStockInService.allocateStockIn(barcodeListByInvoice.getShipRequestName(),
|
||||
allocateStockInService.allocateStockIn(barcodeListByInvoice.getErpFactory(),barcodeListByInvoice.getShipRequestName(),
|
||||
barcodeListByInvoice.getSiteName(),
|
||||
barcodeListByInvoice.getUserId(),
|
||||
barcodeListByInvoice.getErpLocation(),barcodeListByInvoice.getLocationName(),barcodeListByInvoice.getCommitDate());
|
||||
|
@ -197,6 +197,8 @@ public class MaterialReceiveActController {
|
||||
String salesperson = box.getSALESPERSON();
|
||||
String business_UNIT = box.getBUSINESS_UNIT();
|
||||
String career_ASSISTANCE = box.getCAREER_ASSISTANCE();
|
||||
|
||||
String POCATEGORY = box.getPOCATEGORY();
|
||||
makeEventInfo = new EventInfoUtil().makeEventInfo("TrackOutBox", user, "TrackOutBox");
|
||||
|
||||
//判断数量卡控是否正确
|
||||
@ -221,7 +223,7 @@ public class MaterialReceiveActController {
|
||||
receiveActNo, makeDate, shipRequestName, shipRequestDetailName, reasonCodeType, reasonCode,
|
||||
erpLocation, erpFactory, charge, supplierName, npFlag, expirationDay, supplierCharge, sdkid,
|
||||
locationName, phase, specName, materialUnit, is_BATCH, iqcflag, funit, fqty, remark, truegg,
|
||||
salesperson,career_ASSISTANCE,business_UNIT);
|
||||
salesperson,career_ASSISTANCE,business_UNIT,POCATEGORY);
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
|
@ -493,6 +493,7 @@ public class QMSController {
|
||||
if ("PREOQA".equals(qqAresults) && "OK".equals(pqcResult) || "PREOQA".equals(qqAresults) && "NG".equals(pqcResult)) {
|
||||
sapBoxList.add( queryForList.get(0).get("MATERIALPACKINGNAME").toString());
|
||||
}
|
||||
bindMap.put("preOqaResult", qqAresults);
|
||||
}
|
||||
} else if (drkSqlList != null && drkSqlList.size() > 0) {
|
||||
String update = "UPDATE BS_MES_SHIPPED SET PACKINGGRADE = :PACKINGGRADE,IQCFLAG = 'Y' WHERE CHARGE = :BATCH AND PRODCUTSPECNAME = :MATERIALSPECNAME";
|
||||
@ -502,6 +503,7 @@ public class QMSController {
|
||||
if ("PREOQA".equals(qqAresults) && "OK".equals(pqcResult) || "PREOQA".equals(qqAresults) && "NG".equals(pqcResult)) {
|
||||
sapBoxList.add( queryForList.get(0).get("MATERIALPACKINGNAME").toString());
|
||||
}
|
||||
bindMap.put("preOqaResult", qqAresults);
|
||||
success ++;
|
||||
} else {
|
||||
errorCode += commonNumber + "," + materialCode + ";";
|
||||
|
@ -647,7 +647,7 @@ public class SAPToWMSController {
|
||||
for (int i=0; i < Items.size(); i++) {
|
||||
Map<String,Object> item = (Map<String,Object>)Items.get(i);
|
||||
String receiveRequestDetailName = MapUtils.getString(item, "EBELP"); // 订单行项目
|
||||
String pstyp = MapUtils.getString(item, "PSTYP"); // 项目类别 L表示委外订单(O库存), K是寄售(K库存) --供应商
|
||||
String pstyp = MapUtils.getString(item, "PSTYP"); // 项目类别 3(L)表示委外订单(O库存), 2 (K)是寄售(K库存) --供应商
|
||||
String knttp = MapUtils.getString(item, "KNTTP"); // 科目分配类别 E/M代表销售
|
||||
String materialSpecName = MapUtils.getString(item, "MATNR"); // 物料编号
|
||||
String description = MapUtils.getString(item, "TXZ01"); //物料描述
|
||||
@ -727,7 +727,7 @@ public class SAPToWMSController {
|
||||
createInfo.setReceiveRequestName(receiveRequestName);
|
||||
createInfo.setReceiveRequestDetailName(receiveRequestDetailName);
|
||||
createInfo.setReceiveRequestDetailType(knttp); //针对销售订单 E库存
|
||||
createInfo.setPocategory(pstyp); //针对 供应商的, L表示委外订单, K表示寄售
|
||||
createInfo.setPocategory(pstyp); //针对 供应商的, 3表示委外订单, 2表示寄售
|
||||
createInfo.setMaterialSpecName(materialSpecName);
|
||||
createInfo.setErpLocation(erpLocation);
|
||||
// 处理精度丢失
|
||||
|
@ -44,4 +44,6 @@ public class MaterialreceiveActDto {
|
||||
private String SALESPERSON;//业务
|
||||
private String CAREER_ASSISTANCE;//业助
|
||||
private String BUSINESS_UNIT; //事业部
|
||||
|
||||
private String POCATEGORY; //针对 供应商的, 3表示委外订单, 2表示寄售
|
||||
}
|
||||
|
@ -11,5 +11,5 @@ public interface AllocateStockInService {
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public String allocateStockIn(String shipRequestName, String siteName, String user,String erpLocation ,String locationName, String commitDate) throws Exception;
|
||||
public String allocateStockIn(String erpFactory,String shipRequestName, String siteName, String user,String erpLocation ,String locationName, String commitDate) throws Exception;
|
||||
}
|
||||
|
@ -40,10 +40,11 @@ public class AllocateStockInServiceImpl implements AllocateStockInService {
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public String allocateStockIn(String shipRequestName, String siteName, String user, String erpLocation,String locationName,String commitDate) throws Exception {
|
||||
public String allocateStockIn(String erpFactory,String shipRequestName, String siteName, String user, String erpLocation,String locationName,String commitDate) throws Exception {
|
||||
log.debug("AllocateStockInServiceImpl.allocateStockIn {} {} {} {}", shipRequestName, siteName, user, erpLocation);
|
||||
//提交SAP过账
|
||||
String undoId = toSAPServiceImpl.AlloctionStockIn(shipRequestName, siteName, user, erpLocation,commitDate);
|
||||
|
||||
//基于单据获取要操作的Box
|
||||
List<MaterialPacking> boxList = toSapDao.getBoxListByShipRequestName(shipRequestName);
|
||||
//保存物料凭证
|
||||
@ -59,6 +60,7 @@ public class AllocateStockInServiceImpl implements AllocateStockInService {
|
||||
SetEventInfo setEventInfo = new SetEventInfo();
|
||||
Map<String, Object> hashMap = new HashMap<>();
|
||||
hashMap.put("stockState", "Stocked");
|
||||
hashMap.put("erpFactory", erpFactory);
|
||||
hashMap.put("erpLocation", erpLocation);
|
||||
hashMap.put("locationName", locationName);
|
||||
hashMap.put("shipRequestName", "");
|
||||
|
@ -360,7 +360,7 @@ public class InvoiceServiceImpl implements InvoiceService {
|
||||
switch (shipRequestType) {
|
||||
case "NLCC" : //STO调拨出库
|
||||
|
||||
billCode=TransferStockOut_NLCC(shipRequestName, "SDK", eventUser,materialPackingKeyList);
|
||||
billCode=TransferStockOut_NLCC(shipRequestName, "SDK", eventUser,materialPackingKeyList,commitDate);
|
||||
//makeEventInfo = eventInfoUtil.makeEventInfo("CompleteShipRequest", eventUser, "CompleteShipRequest:"+shipRequestType);
|
||||
untils.SaveUnDoInfo_ForSap(materialPackingKeyList, billCode, makeEventInfo);
|
||||
break;
|
||||
@ -992,7 +992,7 @@ public class InvoiceServiceImpl implements InvoiceService {
|
||||
IDMFrameServiceProxy.getSqlTemplate().update(scSql, hashMap);
|
||||
}
|
||||
//重写STO业务销售交货单过账。zd.2024.8.14
|
||||
public String TransferStockOut_NLCC(String shipRequestName, String siteName, String user,List<String> boxList) throws Exception {
|
||||
public String TransferStockOut_NLCC(String shipRequestName, String siteName, String user,List<String> boxList, String commitDate) throws Exception {
|
||||
String rcode;
|
||||
String undoId = "";
|
||||
String rmsg = null;
|
||||
@ -1050,10 +1050,15 @@ public class InvoiceServiceImpl implements InvoiceService {
|
||||
*/
|
||||
//交货单号
|
||||
body.put("VBELN", shipRequestName);
|
||||
|
||||
SimpleDateFormat inputFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
SimpleDateFormat outputFormat = new SimpleDateFormat("yyyyMMdd");
|
||||
Date date = inputFormat.parse(commitDate);
|
||||
String outputDate = outputFormat.format(date);
|
||||
//实际过账日期
|
||||
body.put("WADAT_IST", TimeStampUtil.getCurrentTime("yyyyMMdd"));//yyyyMMddhhmmss
|
||||
body.put("WADAT_IST", outputDate);//yyyyMMdd
|
||||
//发送日期
|
||||
body.put("Z_SENDDATE", TimeStampUtil.getCurrentTime("yyyyMMdd"));
|
||||
body.put("Z_SENDDATE", outputDate);
|
||||
//操作类型(过账)
|
||||
body.put("Z_OPTION", "1");
|
||||
|
||||
|
@ -698,7 +698,7 @@ public void SaveUnDoInfo_ForSap(List<String> list, String undoid, EventInfo mak
|
||||
// 定义SQL查询语句,用于获取物料接收位置和接收工厂信息
|
||||
String sql="SELECT m.ERPRECEIVELOCATION,m.ERPRECEIVEFACTORY FROM MATERIALSHIPREQUEST a,MATERIALSHIPREQUESTDETAIL m \r\n" +
|
||||
" WHERE m.SHIPREQUESTNAME =:SHIPREQUESTNAME and m.SHIPREQUESTNAME=a.SHIPREQUESTNAME "
|
||||
+ " AND a.SHIPREQUESTDETAILTYPE in('311','261')";
|
||||
+ " AND a.SHIPREQUESTDETAILTYPE in('311','261','201')";
|
||||
// 创建参数映射,用于执行SQL查询
|
||||
Map<String, Object> bp=new HashMap<>();
|
||||
bp.put("SHIPREQUESTNAME", invoiceNo);
|
||||
|
@ -136,7 +136,7 @@
|
||||
m.REMARK REMARK, m.SALESMAN SALESPERSON, m.SALESASSISTANT CAREER_ASSISTANCE, m.BUSINESSDIVISION BUSINESS_UNIT,
|
||||
-- m2.STOCKORGNO AS ERPFACTORY,
|
||||
COALESCE(m2.STOCKORGNO, m.ERPFACTORY) AS ERPFACTORY,
|
||||
m2.SUPPLIERNO,
|
||||
m2.SUPPLIERNO,m.POCATEGORY,
|
||||
m3.WIDTH AS DESCRIPTION, m3.MATERIALUNITDESC, m3.WIDTH SPECNAME, m3.PHASE, m3.DESC_CN, DECODE( m3.IS_BATCH, 'Y', '是' , '否' ) IS_BATCH,
|
||||
CASE WHEN m3.EXPIRATION_RULES = '0' THEN '入厂保质期' WHEN m3.EXPIRATION_RULES = '1' THEN '出厂保质期' ELSE '未定义' END AS REPLACED_VALUE,
|
||||
DECODE( m4.IQCFLAG, 'Y', '是', '否' ) IQCFLAG,
|
||||
|
@ -32,6 +32,7 @@
|
||||
'Created' stockState,
|
||||
'Created' OldStockState,
|
||||
'N' HoldState,
|
||||
'Box' MATERIALPACKINGTYPE,
|
||||
T.DURABLETYPE durableType,
|
||||
#{erpFactory} ERPFactory,
|
||||
#{erpLocation} ERPLOCATION,
|
||||
|
@ -6520,7 +6520,7 @@ public void updateComplete(EventInfo eventInfo,String siteName,String invoiceNo,
|
||||
String charge, String supplierName, String NPFlag,String expirationDay,String supplierCharge,String sdkid,
|
||||
String locationName,String phase,String specName,String materialUnit,
|
||||
String IS_BATCH,String IQCFLAG,String funit,String fqty,String remark,String truegg,
|
||||
String SALESPERSON, String CAREER_ASSISTANCE, String BUSINESS_UNIT) throws Exception {
|
||||
String SALESPERSON, String CAREER_ASSISTANCE, String BUSINESS_UNIT, String POCATEGORY) throws Exception {
|
||||
|
||||
String lastEventTimeKey = "";
|
||||
List<CreateInfo> listMaterialPacking = new ArrayList<CreateInfo>();
|
||||
@ -6713,6 +6713,9 @@ public void updateComplete(EventInfo eventInfo,String siteName,String invoiceNo,
|
||||
bindMap.put("supplierName", supplierName);
|
||||
bindMap.put("npFlag", NPFlag);
|
||||
bindMap.put("locationName", locationName );
|
||||
|
||||
bindMap.put("POCATEGORY", POCATEGORY ); // 供应商 3表示委外订单, 2表示寄售
|
||||
|
||||
materialPacking.setUserColumns(bindMap);
|
||||
listMaterialPacking.add(materialPacking);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user