|
|
|
|
@ -370,12 +370,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
|
|
|
|
|
List<wmsReportWork> rlist = wmsProductPutMapper.getReportList(mesReportWork);
|
|
|
|
|
for (wmsReportWork wmsReportWork :
|
|
|
|
|
rlist) {
|
|
|
|
|
if (wmsReportWork.getBatch().length()>=23){
|
|
|
|
|
String batchsk = InterceptionRules(wmsReportWork.getBatch());
|
|
|
|
|
wmsReportWork.setBatchSK(batchsk);
|
|
|
|
|
}else {
|
|
|
|
|
wmsReportWork.setBatchSK(wmsReportWork.getBatch());
|
|
|
|
|
}
|
|
|
|
|
wmsReportWork.setBatchSK(InterceptionRules(wmsReportWork.getBatch()));
|
|
|
|
|
}
|
|
|
|
|
return rlist;
|
|
|
|
|
}
|
|
|
|
|
@ -654,11 +649,6 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public ProOrderWorkorder selectWmsOdsWhiteEmbryoInhAnd(WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIns) {
|
|
|
|
|
DynamicDataSourceContextHolder.push("ds_" + wmsOdsWhiteEmbryoIns.getSiteCode());
|
|
|
|
|
@ -812,20 +802,20 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* "MAKTX": "榄菊果蔬餐具净(海盐柠檬)1kg×10",描述 物料描述
|
|
|
|
|
* "KUNNR": "0001010404", //送达方
|
|
|
|
|
* "VBELN": "0081003133", //交货单
|
|
|
|
|
* "ZSAREA": "", //销售大区
|
|
|
|
|
* "BZTXT1": "", //销售大区描述
|
|
|
|
|
* "KUNNR_NM": "上海大润发有限公司(华东高新总仓)", //送达方描述
|
|
|
|
|
* "MENGE": "6.000", //数量
|
|
|
|
|
* "MEINS": "KAR", //单位
|
|
|
|
|
* "LIFNR_NM": "上海中集公联集装箱储运有限公司", //货运代理描述
|
|
|
|
|
* "TDDAT": "2202-02-09", //计划日期
|
|
|
|
|
* "LIFNR": "0000400213", //货运代理
|
|
|
|
|
* "VBELN_VA": "0000738138", //销售单
|
|
|
|
|
* "MATNR": "000000010201020100" 物料描述
|
|
|
|
|
*
|
|
|
|
|
"MAKTX": "榄菊果蔬餐具净(海盐柠檬)1kg×10",描述 物料描述
|
|
|
|
|
"KUNNR": "0001010404", //送达方
|
|
|
|
|
"VBELN": "0081003133", //交货单
|
|
|
|
|
"ZSAREA": "", //销售大区
|
|
|
|
|
"BZTXT1": "", //销售大区描述
|
|
|
|
|
"KUNNR_NM": "上海大润发有限公司(华东高新总仓)", //送达方描述
|
|
|
|
|
"MENGE": "6.000", //数量
|
|
|
|
|
"MEINS": "KAR", //单位
|
|
|
|
|
"LIFNR_NM": "上海中集公联集装箱储运有限公司", //货运代理描述
|
|
|
|
|
"TDDAT": "2202-02-09", //计划日期
|
|
|
|
|
"LIFNR": "0000400213", //货运代理
|
|
|
|
|
"VBELN_VA": "0000738138", //销售单
|
|
|
|
|
"MATNR": "000000010201020100" 物料描述
|
|
|
|
|
* @param wmsSellOutEmbryo
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@ -1023,6 +1013,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String finishedProductSalesReturnTD(WmsRuturnPutEmbryo wmsRuturnPutEmbryo) {
|
|
|
|
|
String results = "提单成功";//退货单
|
|
|
|
|
@ -1304,13 +1295,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
|
|
|
|
|
wmsProductPutk.setStatus("2");//
|
|
|
|
|
wmsProductPutk.setSapStatus("0");
|
|
|
|
|
wmsProductPutk.setAttr3(formattedDate);//
|
|
|
|
|
if (wmsProductPutk.getBatchNumber().trim().length()==24){
|
|
|
|
|
//String batch = mesReportWork.getBatch().substring(12);
|
|
|
|
|
String batch = InterceptionRules(wmsProductPutk.getBatchNumber());
|
|
|
|
|
wmsProductPutk.setAttr4(batch);
|
|
|
|
|
}else {
|
|
|
|
|
wmsProductPutk.setAttr4(wmsProductPutk.getBatchNumber());
|
|
|
|
|
}
|
|
|
|
|
wmsProductPutk.setAttr4(InterceptionRules(wmsProductPutk.getBatchNumber()));
|
|
|
|
|
wmsProductPutk.setCreateBy(wmsProductPut.getCreateBy());
|
|
|
|
|
wmsProductPutk.setCreateTime(new Date());
|
|
|
|
|
wmsProductPutk.setPutQuantity(new BigDecimal(wmsProductPut1.getNumber()));
|
|
|
|
|
@ -1390,7 +1375,9 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 获取批次号 **/
|
|
|
|
|
/**
|
|
|
|
|
* 获取批次号
|
|
|
|
|
**/
|
|
|
|
|
private String getBatchCode(String str) {
|
|
|
|
|
String batchCode = "";
|
|
|
|
|
|
|
|
|
|
@ -1506,6 +1493,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<WmsRuturnPutEmbryo> FinishedProductSalesReturn(WmsRuturnPutEmbryo wmsRuturnPutEmbryo) {
|
|
|
|
|
DynamicDataSourceContextHolder.push("ds_" + wmsRuturnPutEmbryo.getFactoryCode());
|
|
|
|
|
@ -1761,6 +1749,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
|
|
|
|
|
|
|
|
|
|
return result1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询成品退货入库列表
|
|
|
|
|
*
|
|
|
|
|
@ -1774,17 +1763,61 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* TODO: 入库批次生成规则
|
|
|
|
|
*
|
|
|
|
|
* <p>处理逻辑:
|
|
|
|
|
* <ul>
|
|
|
|
|
* <li>长度11:截取第3位起全部字符(索引2~末尾)</li>
|
|
|
|
|
* <li>长度13/14:截取第3位至倒数第3位(索引2~倒数第3位)</li>
|
|
|
|
|
* <li>长度16:截取第3-8位字符(索引2~7)</li>
|
|
|
|
|
* <li>长度22:截取后11位字符(索引11~末尾)</li>
|
|
|
|
|
* <li>长度24:截取第13-22位字符(索引12~倒数第3位)</li>
|
|
|
|
|
* <li>其他长度:返回清理空格后的原始字符串</li>
|
|
|
|
|
* </ul>
|
|
|
|
|
*
|
|
|
|
|
* <p>示例:
|
|
|
|
|
* <pre>
|
|
|
|
|
* InterceptionRules("AB123456789") → "123456789" // 11位:去前2位
|
|
|
|
|
* InterceptionRules("AB123456789XY") → "123456789" // 14位:去头尾各2位
|
|
|
|
|
* InterceptionRules("AB123456CDEFGHIJ") → "123456" // 16位:取中间6位
|
|
|
|
|
* </pre>
|
|
|
|
|
*
|
|
|
|
|
* @param input
|
|
|
|
|
* @return String
|
|
|
|
|
* @auther huangjinxian
|
|
|
|
|
* @version 1.0
|
|
|
|
|
* @see String
|
|
|
|
|
*/
|
|
|
|
|
public String InterceptionRules(String input) {
|
|
|
|
|
if (StringUtils.isBlank(input)) {
|
|
|
|
|
return input;
|
|
|
|
|
}
|
|
|
|
|
String clean = input.replace(" ", "");
|
|
|
|
|
int len = clean.length();
|
|
|
|
|
switch (len) {
|
|
|
|
|
case 11: {
|
|
|
|
|
return clean.substring(2);
|
|
|
|
|
}
|
|
|
|
|
case 13:
|
|
|
|
|
case 14: {
|
|
|
|
|
return clean.substring(2, len - 2);
|
|
|
|
|
}
|
|
|
|
|
case 16:{
|
|
|
|
|
return clean.substring(2, 8);
|
|
|
|
|
}
|
|
|
|
|
case 22:{
|
|
|
|
|
return clean.substring(11);
|
|
|
|
|
}
|
|
|
|
|
case 24:{
|
|
|
|
|
return clean.substring(12, len - 2);
|
|
|
|
|
}
|
|
|
|
|
default:
|
|
|
|
|
return clean;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//去除空格,截取规则,例子:20270106LJ20240107CBCD0J——》240107CBCD
|
|
|
|
|
public String InterceptionRules(String batchString){
|
|
|
|
|
boolean containsSpace = batchString.contains(" ");
|
|
|
|
|
if (containsSpace) {//去除空格
|
|
|
|
|
batchString = batchString.replace(" ", "");
|
|
|
|
|
}
|
|
|
|
|
batchString =batchString.substring(12,22);
|
|
|
|
|
return batchString;
|
|
|
|
|
}
|
|
|
|
|
//去除空格,截取规则,例子:20270106LJ20240107CBCD0J——》240107CBCD
|
|
|
|
|
public String InterceptionSJRules(String batchString) {
|
|
|
|
|
boolean containsSpace = batchString.contains(" ");
|
|
|
|
|
|