Commit fd6115bb zshaohui

1.增加料卷注册功能

2.7寸箱子隔口卡控20盘
1 个父辈 ec2a5c21
......@@ -1204,6 +1204,38 @@ public class LuxsanApi extends DefaultSmfApiListener {
}
}
public static void whRegister(String barcodeStr, String wareHouseCode) {
log.info("收到料卷注册信息,barcode为:" + barcodeStr + ",库别为:" + wareHouseCode);
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("PLANT", CommonUtil.plantCode);
paramMap.put("BARCODE", barcodeStr);
paramMap.put("WAREHOUSE", wareHouseCode);
log.info(barcodeStr + "料卷注册调用参数为:" + JSON.toJSONString(paramMap) + ",地址为:" + whRegisterUrl);
try {
String resultStr = HttpHelper.postJson(whRegisterUrl, paramMap);
log.info(barcodeStr + "料卷注册调用结果为:" + resultStr);
JSONObject resultObj = JSONObject.parseObject(resultStr);
String msgty = resultObj.getString("MSGTY");
if ("S".equals(msgty)) {
} else {
String msgtx = resultObj.getString("MSGTX");
if (StringUtils.isNotEmpty(msgtx) && msgtx.contains("已存在于系统中")){
} else {
throw new ValidateException("smfcore.api.error", "接口请求失败[{0}]", new String[]{msgtx});
}
}
} catch (Exception e) {
log.info(barcodeStr + "料卷注册调用失败:" + e.getMessage());
throw new ValidateException("smfcore.api.error", "接口请求失败[{0}]", new String[]{e.getMessage()});
}
}
@Override
public boolean isForThisApi(String apiName) {
return "luxsan".equals(apiName);
......@@ -1529,4 +1561,13 @@ public class LuxsanApi extends DefaultSmfApiListener {
public void setManualPalletUrl(String url) {
LuxsanApi.manualPalletUrl = url;
}
public static String whRegisterUrl;
@Value("${api.whRegister}")
public void setWhRegisterUrl(String url){
LuxsanApi.whRegisterUrl = url;
}
}
......@@ -66,12 +66,12 @@ public class ManualReturnTowerController {
//@AnonymousAccess
public synchronized ResultBean reelToBox(@RequestBody Map<String, String> paramMap) {
String wareHouseCode = paramMap.get("wareHouseCode");
String binCode = paramMap.get("binCode"); //料格信息
String codeStr = paramMap.get("codeStr"); //条码信息
String boxStr = paramMap.get("boxStr"); //料箱信息
log.info("人工手动退料,料格信息为:" + binCode + ",料箱信息为:" + boxStr + "条码信息为:" + codeStr);
log.info("人工手动退料,料格信息为:" + binCode + ",料箱信息为:" + boxStr + "条码信息为:" + codeStr+",库别为:"+wareHouseCode);
if (StringUtils.isEmpty(binCode)) {
return ResultBean.newErrorResult(-1, "smfcore.valueCanotNull", "{0}不能为空", new String[]{"料格信息"});
......@@ -82,11 +82,17 @@ public class ManualReturnTowerController {
if (StringUtils.isEmpty(boxStr)) {
return ResultBean.newErrorResult(-1, "smfcore.valueCanotNull", "{0}不能为空", new String[]{"料箱信息"});
}
if (StringUtils.isEmpty(wareHouseCode)) {
return ResultBean.newErrorResult(-1, "smfcore.valueCanotNull", "{0}不能为空", new String[]{"库别"});
}
codeStr = codeStr.toUpperCase(Locale.ROOT);
binCode = binCode.toUpperCase(Locale.ROOT);
boxStr = boxStr.toUpperCase(Locale.ROOT);
//先进行料卷注册
LuxsanApi.whRegister(codeStr,wareHouseCode);
Barcode noDbBarcode = codeResolve.resolveCode(codeStr);
if (noDbBarcode == null) {
return ResultBean.newErrorResult(-1, "smfcore.error.barcode.noValidCode", "条码无效");
......
......@@ -455,7 +455,7 @@ public class BinCacheUtil {
}
List<Barcode> subCodeList = boxBarcode.getSubCodeList();
//判断是否超过21
//判断是否超过20
if (subCodeList != null) {
int hasReelCount = 0;
for (Barcode barcode : subCodeList) {
......@@ -464,8 +464,8 @@ public class BinCacheUtil {
}
}
if(binId.startsWith("C07")) {
if (hasReelCount >= 21) {
return "料格中[" + binId + "]的数量为:" + hasReelCount + ",大于等于21个,请选择其他料格";
if (hasReelCount >= 20) {
return "料格中[" + binId + "]的数量为:" + hasReelCount + ",大于等于20个,请选择其他料格";
}
} else {
if (hasReelCount >= 500) {
......
......@@ -181,3 +181,5 @@ api:
batchCheckReel: http://10.68.25.42:8001/Npm/CheckReelBatch
fetchReel: http://10.68.30.22:8082/api/mlb/FetchReel
whRegister: http://10.68.30.22:8082/api/mlb/WhRegister
......@@ -180,4 +180,6 @@ api:
#批量禁用料
batchCheckReel: http://10.68.27.68:8001/Npm/CheckReelBatch
fetchReel: http://10.42.220.171:8082/api/mlb/FetchReel
\ No newline at end of file
fetchReel: http://10.42.220.171:8082/api/mlb/FetchReel
whRegister: http://10.42.220.171:8082/api/mlb/WhRegister
\ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!