Commit 992fe842 sunke

移远料号转换

1 个父辈 da060140
...@@ -4,7 +4,9 @@ import com.google.common.base.Strings; ...@@ -4,7 +4,9 @@ import com.google.common.base.Strings;
import com.myproject.api.SmbUtil; import com.myproject.api.SmbUtil;
import com.myproject.bean.CodeBean; import com.myproject.bean.CodeBean;
import com.myproject.bean.update.Barcode; import com.myproject.bean.update.Barcode;
import com.myproject.exception.ApiException;
import com.myproject.webapp.controller.webService.DataCache; import com.myproject.webapp.controller.webService.DataCache;
import com.myproject.webapp.controller.webService.QisdaApiController;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
...@@ -438,6 +440,18 @@ public class BarcodeRule { ...@@ -438,6 +440,18 @@ public class BarcodeRule {
codeBean.setError("条码解析失败,未找到PN字段"); codeBean.setError("条码解析失败,未找到PN字段");
return codeBean; return codeBean;
} }
//移远物料,需要进行料号转换
if(partNumber.startsWith("QT")){
log.info("料号["+partNumber+"]为移远料号,进行料号转换");
try {
partNumber = QisdaApiController.PartNoMapping(partNumber);
} catch (ApiException e) {
codeBean.setError(e.getMessage());
return codeBean;
}
}
if(batch_item.hasThisField()){ if(batch_item.hasThisField()){
String batch = batch_item.getStrValue(codeArr); String batch = batch_item.getStrValue(codeArr);
b.setBatch(batch); b.setBatch(batch);
...@@ -555,12 +569,14 @@ public class BarcodeRule { ...@@ -555,12 +569,14 @@ public class BarcodeRule {
// codeStr = "=1+0x0-0x0=A0002"; // codeStr = "=1+0x0-0x0=A0002";
//阳光电源 //阳光电源
//[RI]_PN_PRODATEyyMMdd_QTYxxxx //[RI]_PN_PRODATEyyMMdd_QTYxxxx
rule = "[RI]_PN_PRODATEyyMMdd_QTY[0:5:4]"; //rule = "[RI]_PN_PRODATEyyMMdd_QTY[0:5:4]";
codeStr = "4500065747_CS000069_180101_0300000041"; //codeStr = "4500089600_DC000045_190528_003000006";
//佳世达 //佳世达
rule ="BATCH;PRODATEyyyyMMdd[1:8:-1]EXPD[-1:-4:-1];PN[1:12:-1]SP[13:5:-1]QTY[-1:-5:-1];RI"; rule ="BATCH;PRODATEyyyyMMdd[1:8:-1]EXPD[-1:-4:-1];PN[1:12:-1]SP[13:5:-1]QTY[-1:-5:-1];RI";
rule ="BATCH;PRODATEyyyyMMdd[1:8:-1]EXPD[-1:-4:-1];PN[1:12:-1]SP[13:5:-1]QTY[-1:-5:-1];RI";
codeStr = "=7x8=L00002019090199951797;E20190901 0365;B8C.R2003.V81506072019090103000;R506072019102200356"; codeStr = "=7x8=L00002019090199951797;E20190901 0365;B8C.R2003.V81506072019090103000;R506072019102200356";
codeStr = "=7x8=L0000000000000BF5NT8R;E20190605 0730 ;B7H.10524.5B1035042019060504000 ;R035042019060510182##"; codeStr = "=7x8=L0000000000000BF5NT8R;E20190605 0730 ;B7H.10524.5B1035042019060504000 ;R035042019060510182##";
codeStr = "=7x8=LRC11912020N1OR;E201912030365;BQT001100327706292019121915000;R06292019121900026";
BarcodeRule br = BarcodeRule.newRule(rule); BarcodeRule br = BarcodeRule.newRule(rule);
Barcode barcode = br.toCodeBean(codeStr).getBarcode(); Barcode barcode = br.toCodeBean(codeStr).getBarcode();
if(barcode != null){ if(barcode != null){
......
...@@ -74,7 +74,7 @@ public class DifferentInventoryController extends BaseController { ...@@ -74,7 +74,7 @@ public class DifferentInventoryController extends BaseController {
DiffInfo diffInfo = new DiffInfo(); DiffInfo diffInfo = new DiffInfo();
diffInfo.setReelId(barcode.getBarcode()); diffInfo.setReelId(barcode.getBarcode());
diffInfo.setPn(barcode.getPartNumber()); diffInfo.setPn(barcode.getPartNumber());
diffInfo.setQty(barcode.getAmount() + ""); diffInfo.setQty(barcode.getInitialAmount() + "");
diffInfo.setFacility(barcode.getAppendInfo().getFacility()); diffInfo.setFacility(barcode.getAppendInfo().getFacility());
diffInfo.setLocation(storagePos.getPosName()); diffInfo.setLocation(storagePos.getPosName());
neotelReelMap.put(barcode.getBarcode(), diffInfo); neotelReelMap.put(barcode.getBarcode(), diffInfo);
......
...@@ -293,6 +293,8 @@ public class DataCache{ ...@@ -293,6 +293,8 @@ public class DataCache{
try{ try{
//如果有料盘尺寸,重新设置料盘尺寸信息,没有档案时自动添加档案 //如果有料盘尺寸,重新设置料盘尺寸信息,没有档案时自动添加档案
if(codeBeanFromRule.hasReelSizeInfo()){ if(codeBeanFromRule.hasReelSizeInfo()){
//log.info("料盘["+barcode.getBarcode()+"]的尺寸信息从["+barcode.getPlateSize()+"x"+barcode.getHeight()+"]设置为["+codeBeanFromRule.getReelWidth()+"x"+codeBeanFromRule.getReelHeight()+"]"); //log.info("料盘["+barcode.getBarcode()+"]的尺寸信息从["+barcode.getPlateSize()+"x"+barcode.getHeight()+"]设置为["+codeBeanFromRule.getReelWidth()+"x"+codeBeanFromRule.getReelHeight()+"]");
Component component = componentManager.findByPartNumber(barcodeFromRule.getPartNumber()); Component component = componentManager.findByPartNumber(barcodeFromRule.getPartNumber());
......
...@@ -165,6 +165,7 @@ public class QisdaApiController extends BaseController { ...@@ -165,6 +165,7 @@ public class QisdaApiController extends BaseController {
@RequestMapping(value = "/out",method = RequestMethod.POST) @RequestMapping(value = "/out",method = RequestMethod.POST)
@ResponseBody @ResponseBody
public Object out(HttpServletRequest request) { public Object out(HttpServletRequest request) {
List<String> failedReelIdList = new ArrayList<>();
try { try {
String paramInfo = request.getParameter("paramInfo"); String paramInfo = request.getParameter("paramInfo");
if(Strings.isNullOrEmpty(paramInfo)){ if(Strings.isNullOrEmpty(paramInfo)){
...@@ -194,10 +195,52 @@ public class QisdaApiController extends BaseController { ...@@ -194,10 +195,52 @@ public class QisdaApiController extends BaseController {
outInfo = outInfoDao.save(outInfo); outInfo = outInfoDao.save(outInfo);
} }
} }
String reelID = outItem.getReelID();
if(reelID != null && !reelID.isEmpty()){
//指定出某盘料或单独出库,如果已经绑定,不允许出,如果未绑定直接进行绑定
StoragePos pos = storagePosDao.findByBarcode(reelID);
if(pos != null){
Barcode barcode = pos.getBarcode();
AppendInfo appendInfo = barcode.getAppendInfo();
int bindSlot = Integer.valueOf(appendInfo.getBindSlot());
if(bindSlot > 0 || barcode.hasCutInfo()){
//已经真实绑定过
log.error("料盘["+reelID+"]已经真实绑定过,不允许出库");
failedReelIdList.add(reelID);
}else{
//未真实绑定过,可以出库,绑定
appendInfo.sethSerial(outItem.gethSerial());
appendInfo.setRefno(outItem.getRefno());
appendInfo.setSo("HSerial:" + outItem.gethSerial());
appendInfo.setSoseq("HSerial:" + outItem.getSoseq());
appendInfo.setSlotStr(outItem.getSlotStr());
appendInfo.setBindSlot("1");
appendInfo.setSlotIndex(1);
barcode.setAppendInfo(appendInfo);
pos.setBarcode(barcode);
storagePosDao.save(pos);
outItem.setRealLockQty(barcode.getAmount());
outItem = outItemDao.save(outItem);
outInfo.updateItem(outItem);
outInfoMap.put(hSerial, outInfo);
}
}else{
//未找到指定料盘
log.error("料盘["+reelID+"]未找到,可能已经出库,不允许出库");
failedReelIdList.add(reelID);
}
}else{
//不是指定料
outItem = outItemDao.save(outItem); outItem = outItemDao.save(outItem);
outInfo.updateItem(outItem); outInfo.updateItem(outItem);
outInfoMap.put(hSerial, outInfo); outInfoMap.put(hSerial, outInfo);
} }
}
bindOutInfoList(outInfoMap.values()); bindOutInfoList(outInfoMap.values());
...@@ -206,6 +249,10 @@ public class QisdaApiController extends BaseController { ...@@ -206,6 +249,10 @@ public class QisdaApiController extends BaseController {
log.error("需求单请求处理出错", e); log.error("需求单请求处理出错", e);
return ResultBean.newErrorResult(1001,"内部错误:" + e.getMessage()); return ResultBean.newErrorResult(1001,"内部错误:" + e.getMessage());
} }
if(!failedReelIdList.isEmpty()){
String data = String.join(";",failedReelIdList);
return ResultBean.newOkResult(data);
}
return ResultBean.newOkResult(""); return ResultBean.newOkResult("");
} }
...@@ -342,6 +389,27 @@ public class QisdaApiController extends BaseController { ...@@ -342,6 +389,27 @@ public class QisdaApiController extends BaseController {
} }
} }
/**
* 移远料号转换
*/
public static String PartNoMapping(String vdPartNum) throws ApiException{
String url = "http://10.85.17.233/ESMTCommonInterface/CommonService.asmx/PartNoMapping";
Map<String,Object> paramMap = new HashMap<String,Object>();
paramMap.put("vdPartNum",vdPartNum);
log.info("从Qisda获取料号转换:vdPartNum=" + vdPartNum);
String result = HttpHelper.postParam(url,paramMap);
log.info("从Qisda获取料号转换:(PartNoMapping)返回:" + result);
Map<String, Object> resultMap = JsonUtil.toMap(result);
String msg = resultMap.get("msg").toString();
if(msg.startsWith("0")){
String errorMsg = "从Qisda获取料号["+vdPartNum+"]转换出错:" + msg;
log.info(errorMsg);
throw new ApiException(errorMsg);
}
return msg;
}
/** /**
* *
...@@ -633,6 +701,7 @@ public class QisdaApiController extends BaseController { ...@@ -633,6 +701,7 @@ public class QisdaApiController extends BaseController {
Barcode barcode = pos.getBarcode(); Barcode barcode = pos.getBarcode();
int totalLockQty = outItem.getLockQty() + barcode.getAmount(); int totalLockQty = outItem.getLockQty() + barcode.getAmount();
if(totalLockQty > outItem.getQty()){ if(totalLockQty > outItem.getQty()){
log.info("加总数量["+totalLockQty+"]大于需求数量["+outItem.getQty()+"]跳出第一轮绑定"); log.info("加总数量["+totalLockQty+"]大于需求数量["+outItem.getQty()+"]跳出第一轮绑定");
break; break;
} }
......
...@@ -201,7 +201,7 @@ ...@@ -201,7 +201,7 @@
rtl: Metronic.isRTL(), rtl: Metronic.isRTL(),
orientation: "left", orientation: "left",
autoclose: true, autoclose: true,
//language:'zh-CN' language:'zh-CN'
}); });
}); });
......
...@@ -144,10 +144,10 @@ ...@@ -144,10 +144,10 @@
<div class="bg-primary kabanTitle col-md-12"> <div class="bg-primary kabanTitle col-md-12">
<%--<span><fmt:message key="allBoxView.kanban"/></span>--%> <%--<span><fmt:message key="allBoxView.kanban"/></span>--%>
<%--<span style="margin-left: 40px;" id="storageTotalPos">总容量:1000</span>--%> <%--<span style="margin-left: 40px;" id="storageTotalPos">总容量:1000</span>--%>
<div class="col-md-3"> <%--<div class="col-md-3">--%>
<button class="btn yellow outBtn" id="outPn"><i class="fa fa-sign-out"></i><fmt:message key="button.checkout"/></button> <%--<button class="btn yellow outBtn" id="outPn"><i class="fa fa-sign-out"></i><fmt:message key="button.checkout"/></button>--%>
<button class="btn yellow outBtn" id="outOrder"><i class="fa fa-sign-out"></i><fmt:message key="工单出库"/></button> <%--<button class="btn yellow outBtn" id="outOrder"><i class="fa fa-sign-out"></i><fmt:message key="工单出库"/></button>--%>
</div> <%--</div>--%>
<div class="col-md-"> <div class="col-md-">
<div id="lineMsg"></div> <div id="lineMsg"></div>
</div> </div>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!