入库错误编码修改
This commit is contained in:
@@ -19,6 +19,8 @@ import com.ruoyi.bas.cargoSpace.domain.BasCargoSpace;
|
||||
import com.ruoyi.bas.cargoSpace.service.IBasCargoSpaceService;
|
||||
import com.ruoyi.bas.container.domain.BasContainer;
|
||||
import com.ruoyi.bas.container.service.IBasContainerService;
|
||||
import com.ruoyi.bas.roadway.domain.BasRoadway;
|
||||
import com.ruoyi.bas.roadway.service.IBasRoadwayService;
|
||||
import com.ruoyi.bas.tag.domain.BasTag;
|
||||
import com.ruoyi.bas.tag.service.IBasTagService;
|
||||
import com.ruoyi.bas.taskNo.service.IBasTaskNoService;
|
||||
@@ -87,6 +89,8 @@ public class ToWmsServiceImpl implements IToWmsService {
|
||||
private IInStockinService inStockinService;
|
||||
@Autowired
|
||||
private IInStockinDetailService inStockinDetailService;
|
||||
@Autowired
|
||||
private IBasRoadwayService basRoadwayService;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -124,8 +128,8 @@ public class ToWmsServiceImpl implements IToWmsService {
|
||||
String xlh = decode[4];
|
||||
log.info("二维码详情 productId:{} model:{},color:{},serial:{},v:{},hz:{},ph:{},nw:{},gw:{},erpBill:{},xh:{},jx:{},fx:{},xlh:{}", productId, model, color, serial, v, hz, ph, nw, gw, erpBill, xh, jx, fx, xlh);
|
||||
for (String s : split) {
|
||||
if (StrUtil.isEmpty(s)){
|
||||
return new AjaxResult(503,"二维码内容错误");
|
||||
if (StrUtil.isEmpty(s)) {
|
||||
return new AjaxResult(1, "二维码内容错误");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +138,7 @@ public class ToWmsServiceImpl implements IToWmsService {
|
||||
basProductParam.setProductId(productId);
|
||||
List<BasProduct> basProducts = basProductService.selectBasProductList(basProductParam);
|
||||
if (CollUtil.isEmpty(basProducts)) {
|
||||
return AjaxResult.error("物料信息不存在");
|
||||
return new AjaxResult(2, "物料不存在");
|
||||
}
|
||||
|
||||
BasProduct basProduct = basProducts.get(0);
|
||||
@@ -143,12 +147,12 @@ public class ToWmsServiceImpl implements IToWmsService {
|
||||
int size = getSize(basProduct);
|
||||
|
||||
//超大托盘不处理 直接返回
|
||||
if (size == 5){
|
||||
return new AjaxResult(501,"超大托盘");
|
||||
if (size == 5) {
|
||||
return new AjaxResult(3, "超大托盘");
|
||||
}
|
||||
//托盘大小与电气返回不匹配
|
||||
if (size != Integer.parseInt(requestEnter.getSize())){
|
||||
return new AjaxResult(502,"托盘大小不匹配");
|
||||
if (size != Integer.parseInt(requestEnter.getSize())) {
|
||||
return new AjaxResult(4, "托盘大小不匹配");
|
||||
}
|
||||
|
||||
|
||||
@@ -164,7 +168,7 @@ public class ToWmsServiceImpl implements IToWmsService {
|
||||
return AjaxResult.error("单据不存在");
|
||||
}
|
||||
InStockin inStockin = inStockins.get(0);
|
||||
if ("1".equals(inStockin.getStatus()) ||"2".equals(inStockin.getStatus())){
|
||||
if ("1".equals(inStockin.getStatus()) || "2".equals(inStockin.getStatus())) {
|
||||
inStockin.setStatus("3");
|
||||
inStockinService.updateInStockin(inStockin);
|
||||
}
|
||||
@@ -194,13 +198,24 @@ public class ToWmsServiceImpl implements IToWmsService {
|
||||
mydoJob.setTrayCode(basJobIdService.getJobId("TP"));
|
||||
mydoJob.setWarehouseId("01");
|
||||
mydoJob.setRoadwayId(getRoadway(size));
|
||||
BasRoadway basRoadway = basRoadwayService.selectBasRoadwayById(mydoJob.getRoadwayId());
|
||||
if ("1".equals(requestEnter.getFloor())) {
|
||||
if ("Y".equals(basRoadway.getInLocked())) {
|
||||
return new AjaxResult(6, "巷道已锁");
|
||||
}
|
||||
} else {
|
||||
if ("Y".equals(basRoadway.getInLocked2())) {
|
||||
return new AjaxResult(6, "巷道已锁");
|
||||
}
|
||||
}
|
||||
|
||||
//根据巷道查找货位
|
||||
BasCargoSpace basCargoSpaceParam = new BasCargoSpace();
|
||||
basCargoSpaceParam.setWarehouseId(mydoJob.getWarehouseId());
|
||||
basCargoSpaceParam.setRoadwayId(mydoJob.getRoadwayId());
|
||||
BasCargoSpace basCargoSpace = basCargoSpaceService.selectEmptyCargoSpaceByWarehouseId(basCargoSpaceParam);
|
||||
if (ObjUtil.isNull(basCargoSpace)) {
|
||||
return AjaxResult.error("没有货位");
|
||||
return new AjaxResult(5, "没有货位");
|
||||
}
|
||||
mydoJob.setCargoSpaceId(basCargoSpace.getCargoSpaceId());
|
||||
mydoJob.setEntranceId(requestEnter.getEntranceId());
|
||||
@@ -234,7 +249,7 @@ public class ToWmsServiceImpl implements IToWmsService {
|
||||
basCargoSpace.setStatus("3");
|
||||
basCargoSpaceService.updateBasCargoSpace(basCargoSpace);
|
||||
|
||||
if ("1".equals(mydoJob.getInOrOut())){
|
||||
if ("1".equals(mydoJob.getInOrOut())) {
|
||||
//存入调拨单数据 已生成
|
||||
TransferBillCallback transferBillCallback = new TransferBillCallback();
|
||||
transferBillCallback.setJobId(mydoJob.getJobId());
|
||||
@@ -244,7 +259,7 @@ public class ToWmsServiceImpl implements IToWmsService {
|
||||
transferBillCallbackService.insertTransferBillCallback(transferBillCallback);
|
||||
}
|
||||
//修改作业状态为正执行
|
||||
HashMap<String,String> result = new HashMap<>();
|
||||
HashMap<String, String> result = new HashMap<>();
|
||||
result.put("jobId", mydoJob.getJobId());
|
||||
result.put("taskNo", mydoJob.getTaskNo());
|
||||
result.put("cargoSpaceId", mydoJob.getCargoSpaceId());
|
||||
@@ -256,13 +271,14 @@ public class ToWmsServiceImpl implements IToWmsService {
|
||||
private String getRoadway(int size) {
|
||||
return switch (size) {
|
||||
case 1 -> "2";
|
||||
case 2,3, 4 -> "2";
|
||||
case 2, 3, 4 -> "1";
|
||||
default -> null;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* todo 根据包装方式 主要包装方式 描述 长 宽 高 包装材积获取大小
|
||||
*
|
||||
* @param basProduct
|
||||
* @return
|
||||
*/
|
||||
@@ -284,7 +300,7 @@ public class ToWmsServiceImpl implements IToWmsService {
|
||||
param.setEntranceId("G1005");
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByEntranceId(param);
|
||||
|
||||
if(mydoJob != null && StrUtil.isNotEmpty(mydoJob.getTrayCode())){
|
||||
if (mydoJob != null && StrUtil.isNotEmpty(mydoJob.getTrayCode())) {
|
||||
List<MydoJobDetail> mydoJobDetails = mydoJobDetailService.selectMydoJobDetailListByJobId(mydoJob.getJobId());
|
||||
if (CollUtil.isEmpty(mydoJobDetails)) {
|
||||
return AjaxResult.error("没有任务");
|
||||
@@ -295,15 +311,15 @@ public class ToWmsServiceImpl implements IToWmsService {
|
||||
|
||||
int size = getSize(basProduct);
|
||||
//超大托盘不处理 直接返回
|
||||
if (size == 5){
|
||||
return new AjaxResult(501,"超大托盘");
|
||||
if (size == 5) {
|
||||
return new AjaxResult(3, "超大托盘");
|
||||
}
|
||||
//托盘大小与电气返回不匹配
|
||||
if (size != Integer.parseInt(requestEnter.getSize())){
|
||||
return new AjaxResult(502,"托盘大小不匹配");
|
||||
if (size != Integer.parseInt(requestEnter.getSize())) {
|
||||
return new AjaxResult(4, "托盘大小不匹配");
|
||||
}
|
||||
|
||||
HashMap<String,String> result = new HashMap<>();
|
||||
HashMap<String, String> result = new HashMap<>();
|
||||
result.put("jobId", mydoJob.getJobId());
|
||||
result.put("taskNo", mydoJob.getTaskNo());
|
||||
result.put("cargoSpaceId", mydoJob.getCargoSpaceId());
|
||||
@@ -311,7 +327,7 @@ public class ToWmsServiceImpl implements IToWmsService {
|
||||
result.put("entranceId", mydoJob.getEntranceId());
|
||||
return AjaxResult.success(result);
|
||||
|
||||
}else {
|
||||
} else {
|
||||
return AjaxResult.error("没有任务");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user