Commit 37d6678e hc

fix:备品仓lizhen日志输出修改,bug修改

1 个父辈 643f239b
...@@ -220,7 +220,7 @@ public class BarcodeManagerImpl implements IBarcodeManager { ...@@ -220,7 +220,7 @@ public class BarcodeManagerImpl implements IBarcodeManager {
} }
protected void validateSave(Barcode barcode) throws ValidateException { protected void validateSave(Barcode barcode) throws ValidateException {
barcode.setPartNumber(barcode.getPn());
if (barcode.getBarcode()==null) { if (barcode.getBarcode()==null) {
throw new ValidateException("smfcore.valueCanotNull","{0}不能为空",new String[]{"barcode"} ); throw new ValidateException("smfcore.valueCanotNull","{0}不能为空",new String[]{"barcode"} );
// throw new ValidateException("barcode.error.empty"); // throw new ValidateException("barcode.error.empty");
......
...@@ -57,7 +57,7 @@ public class LuxsanSpApi extends DefaultSmfApiListener { ...@@ -57,7 +57,7 @@ public class LuxsanSpApi extends DefaultSmfApiListener {
String url = GetReturnInventory + getQueryStr(request); String url = GetReturnInventory + getQueryStr(request);
// 发送GET请求并获取JSON格式的响应字符串 // 发送GET请求并获取JSON格式的响应字符串
String resJsonStr = HttpHelper.sendGet(url); String resJsonStr = HttpHelper.sendGet(url);
log.info("备品仓退库查询接口返回为:" + JSON.toJSONString(request)); log.info("备品仓退库查询接口返回为:" + JSON.toJSONString(resJsonStr));
// 将响应字符串解析为LizhenApiResult对象 // 将响应字符串解析为LizhenApiResult对象
LuxsanSpApiResult lizhenApiResult = JSONObject.parseObject(resJsonStr, LuxsanSpApiResult.class); LuxsanSpApiResult lizhenApiResult = JSONObject.parseObject(resJsonStr, LuxsanSpApiResult.class);
// 检查API调用是否成功,并返回结果对象 // 检查API调用是否成功,并返回结果对象
...@@ -85,8 +85,8 @@ public class LuxsanSpApi extends DefaultSmfApiListener { ...@@ -85,8 +85,8 @@ public class LuxsanSpApi extends DefaultSmfApiListener {
try { try {
log.info("预约待领取接口请求为:" + request); log.info("预约待领取接口请求为:" + request);
String url = GetUnclaimedUrl + getQueryStr(request); String url = GetUnclaimedUrl + getQueryStr(request);
log.info("预约待领取接口请求返回:" + JSON.toJSONString(request));
String resJsonStr = HttpHelper.sendGet(url); String resJsonStr = HttpHelper.sendGet(url);
log.info("预约待领取接口请求返回:" + JSON.toJSONString(resJsonStr));
LuxsanSpApiResult lizhenApiResult = JSONObject.parseObject(resJsonStr, LuxsanSpApiResult.class); LuxsanSpApiResult lizhenApiResult = JSONObject.parseObject(resJsonStr, LuxsanSpApiResult.class);
if (lizhenApiResult.getCode() != 200) { if (lizhenApiResult.getCode() != 200) {
throw new Exception(String.format("预约待领取接口接口请求失败, 错误代码[%d],错误原因[%s]", throw new Exception(String.format("预约待领取接口接口请求失败, 错误代码[%d],错误原因[%s]",
...@@ -109,7 +109,7 @@ public class LuxsanSpApi extends DefaultSmfApiListener { ...@@ -109,7 +109,7 @@ public class LuxsanSpApi extends DefaultSmfApiListener {
try { try {
log.info("备品仓入库接口请求为:" + JSON.toJSONString(request)); log.info("备品仓入库接口请求为:" + JSON.toJSONString(request));
String resJsonStr = HttpHelper.postJson(SpareInHourseUrl, request); String resJsonStr = HttpHelper.postJson(SpareInHourseUrl, request);
log.info("备品仓入库接口返回:" + JSON.toJSONString(request)); log.info("备品仓入库接口返回:" + JSON.toJSONString(resJsonStr));
LuxsanSpApiResult lizhenApiResult = JSONObject.parseObject(resJsonStr, LuxsanSpApiResult.class); LuxsanSpApiResult lizhenApiResult = JSONObject.parseObject(resJsonStr, LuxsanSpApiResult.class);
if (lizhenApiResult.getCode() != 200) { if (lizhenApiResult.getCode() != 200) {
throw new ApiException(String.format("备品仓入库接口请求失败, 错误代码[%d],错误原因[%s]", throw new ApiException(String.format("备品仓入库接口请求失败, 错误代码[%d],错误原因[%s]",
......
...@@ -29,7 +29,11 @@ import com.neotel.smfcore.custom.luxsan_sp.util.*; ...@@ -29,7 +29,11 @@ import com.neotel.smfcore.custom.luxsan_sp.util.*;
import com.neotel.smfcore.security.annotation.AnonymousAccess; import com.neotel.smfcore.security.annotation.AnonymousAccess;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -44,6 +48,7 @@ import java.util.Map; ...@@ -44,6 +48,7 @@ import java.util.Map;
@RequestMapping("/spBoxPutIn") @RequestMapping("/spBoxPutIn")
public class SpBoxPutInController { public class SpBoxPutInController {
private static final Logger log = LoggerFactory.getLogger(SpBoxPutInController.class);
@Autowired @Autowired
private CodeResolve codeResolve; private CodeResolve codeResolve;
...@@ -83,12 +88,12 @@ public class SpBoxPutInController { ...@@ -83,12 +88,12 @@ public class SpBoxPutInController {
} }
String currentRfid = station.getCurrentRfid(); String currentRfid = station.getCurrentRfid();
// currentRfid = "s1"; log.info("getStationInfo工位上"+currentRfid);
// currentRfid = "C0700377A";
if (StringUtils.isEmpty(currentRfid)){ if (StringUtils.isEmpty(currentRfid)){
return ResultBean.newErrorResult(-1,"","当前工位上currentRfid为空"); return ResultBean.newErrorResult(-1,"","当前工位上currentRfid为空");
} }
// Barcode barcode = barcodeManager.findByBarcode("C0700084");
Barcode barcode = codeResolve.resolveOneValideBarcode("=2x2=" + currentRfid); Barcode barcode = codeResolve.resolveOneValideBarcode("=2x2=" + currentRfid);
if (barcode == null){ if (barcode == null){
return ResultBean.newErrorResult(-1,"",currentRfid+"不是有效的条码"); return ResultBean.newErrorResult(-1,"",currentRfid+"不是有效的条码");
...@@ -113,11 +118,18 @@ public class SpBoxPutInController { ...@@ -113,11 +118,18 @@ public class SpBoxPutInController {
@RequestMapping("/reelToBox") @RequestMapping("/reelToBox")
@AnonymousAccess @AnonymousAccess
public synchronized ResultBean reelToBox(@RequestBody Map<String, String> paramMap) { public synchronized ResultBean reelToBox(@RequestBody Map<String, String> paramMap) {
// SpareNo spareNo1 = spareNoCache.getExecutIngSpareNo();
// ReturnInventoryNo returnInventoryNo1 = returnNoCache.getExecutingOrderNo();
// if (ObjectUtil.isAllEmpty(spareNo1, returnInventoryNo1)) {
// return ResultBean.newErrorResult(-1,"","没有找到正在执行的入库单或者退库单");
// }
String boxStr = paramMap.get("boxStr"); String boxStr = paramMap.get("boxStr");
String codeStr = paramMap.get("codeStr"); String codeStr = paramMap.get("codeStr");
String binCodeStr = paramMap.get("binCodeStr"); String binCodeStr = paramMap.get("binCodeStr");
// boxStr = "C0700377A";
// codeStr = "1950090020044V&&2";
// binCodeStr = "C0700377-01";
//解析料箱信息 //解析料箱信息
Barcode boxBarcode = codeResolve.resolveOneValideBarcode("=2x2=" + boxStr); Barcode boxBarcode = codeResolve.resolveOneValideBarcode("=2x2=" + boxStr);
...@@ -152,10 +164,10 @@ public class SpBoxPutInController { ...@@ -152,10 +164,10 @@ public class SpBoxPutInController {
//3.判断与当前隔口的料号是否匹配 //3.判断与当前隔口的料号是否匹配
String binPartNumber = binBarcode.getPartNumber(); // String binPartNumber = binBarcode.getPartNumber();
if (binPartNumber.equals("CS") || binPartNumber.equals("CB") || binPartNumber.equals("CM")) { // if (binPartNumber.equals("CS") || binPartNumber.equals("CB") || binPartNumber.equals("CM")) {
binPartNumber = ""; // binPartNumber = "";
} // }
boolean isOk = false; boolean isOk = false;
String codePartNumber = codeBarcode.getPartNumber(); String codePartNumber = codeBarcode.getPartNumber();
...@@ -201,7 +213,7 @@ public class SpBoxPutInController { ...@@ -201,7 +213,7 @@ public class SpBoxPutInController {
return ResultBean.newErrorResult(-1,"",codePartNumber+"没有入退库需求,请检查是否存在或者不符合入退库数量"); return ResultBean.newErrorResult(-1,"",codePartNumber+"没有入退库需求,请检查是否存在或者不符合入退库数量");
} }
//先调用入库接口 // 先调用入库接口
if (baseNo.getClass().equals(SpareNo.class)) { if (baseNo.getClass().equals(SpareNo.class)) {
SpareInHourseDetail detail = new SpareInHourseDetail(); SpareInHourseDetail detail = new SpareInHourseDetail();
detail.setInQty(codeBarcode.getQty()); detail.setInQty(codeBarcode.getQty());
......
...@@ -10,12 +10,12 @@ public class CodeUtil { ...@@ -10,12 +10,12 @@ public class CodeUtil {
public static CodeBarcode getCodeBarcode(String codeStr){ public static CodeBarcode getCodeBarcode(String codeStr){
if (!codeStr.contains("&&")){ if (!codeStr.contains(" ")){
return null; return null;
} }
try { try {
String[] split = codeStr.split("&&"); String[] split = codeStr.split(" ");
String partNumber = split[0]; String partNumber = split[0];
int qty = Integer.parseInt(split[1]); int qty = Integer.parseInt(split[1]);
......
package com.neotel.smfcore.custom.luxsan_sp.util; package com.neotel.smfcore.custom.luxsan_sp.util;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.neotel.smfcore.common.bean.ReelLockPosInfo; import com.neotel.smfcore.common.bean.ReelLockPosInfo;
import com.neotel.smfcore.common.utils.ReelLockPosUtil; import com.neotel.smfcore.common.utils.ReelLockPosUtil;
import com.neotel.smfcore.core.barcode.service.po.Barcode; import com.neotel.smfcore.core.barcode.service.po.Barcode;
...@@ -18,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -18,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -189,11 +191,13 @@ public class SpBoxUtil { ...@@ -189,11 +191,13 @@ public class SpBoxUtil {
} }
public static String getPartNumber(List<Barcode> subCodeList,String reelId){ public static String getPartNumber(List<Barcode> subCodeList,String reelId){
for (Barcode barcode : subCodeList) {
}
if (subCodeList != null && !subCodeList.isEmpty()){ if (subCodeList != null && !subCodeList.isEmpty()){
for (Barcode barcode : subCodeList) { for (Barcode barcode : subCodeList) {
if (reelId.replace("0", "") if (reelId.replace("0", "")
.equals(barcode.getBarcode().replace("0", ""))){ .equals(barcode.getBarcode().replace("0", ""))){
return barcode.getPartNumber(); return barcode.getPn();
} }
} }
} }
......
...@@ -263,8 +263,8 @@ public class SpareNoCache { ...@@ -263,8 +263,8 @@ public class SpareNoCache {
emptyBox = emptyPos.getBarcode(); emptyBox = emptyPos.getBarcode();
if (emptyPos != null) { if (emptyPos != null) {
newPn.setBarcode(emptyBox.getBarcode() + "-" + (emptyBox.getSubCodeList() == null ? 1 : emptyBox.getSubCodeList().size())); newPn.setBarcode(emptyBox.getBarcode() + "-" + (emptyBox.getSubCodeList() == null ? 1 : emptyBox.getSubCodeList().size()));
newPn = barcodeManager.save(newPn); // newPn = barcodeManager.save(newPn);
// newPn = barcodeManager.saveBarcode(newPn); newPn = barcodeManager.saveBarcode(newPn);
List<Barcode> subL = emptyBox.getSubCodeList(); List<Barcode> subL = emptyBox.getSubCodeList();
if (subL == null) { if (subL == null) {
subL = new ArrayList<>(); subL = new ArrayList<>();
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!