流利架 入库出库逻辑修改

This commit is contained in:
liuhanqing
2025-07-31 13:37:58 +08:00
parent e1f0f8f35e
commit 58c3822e07
18 changed files with 156 additions and 65 deletions

View File

@@ -6,6 +6,7 @@ import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.api.service.IToWcsService;
import com.ruoyi.bas.cargoSpace.domain.BasCargoSpace;
import com.ruoyi.bas.cargoSpace.service.IBasCargoSpaceService;
import com.ruoyi.bas.container.domain.BasContainer;
@@ -102,6 +103,8 @@ public class PdaServiceImp implements PdaService {
private IBasWarehouseService basWarehouseService;
@Autowired
private IBasContainerService basContainerService;
@Autowired
private IToWcsService iToWcsService;
/**
* 空托盘入库
@@ -306,15 +309,14 @@ public class PdaServiceImp implements PdaService {
List<MydoJobDetail> currentMydoJobDetails = mydoJobDetailService.selectMydoJobDetailList(mydoJobDetailParam);
boolean flag = currentMydoJobDetails.stream().allMatch(mydoJobDetail -> mydoJobDetail.getPickQuantity().equals(mydoJobDetail.getOutQuantity()));
if (flag) {
deleteTagTask(trayCodeMakeSure, basWarehouse);
HashMap<String, Object> map = new HashMap<>();
map.put("v_tray_code", trayCodeMakeSure.getTrayCode());
map.put("v_type", "1");
pdaMapper.outMakeSure(map);
String result = map.get("v_result").toString();
if ("10".equals(result)) {
//通知wcs 出库确认
deleteTagTask(trayCodeMakeSure, basWarehouse);
return AjaxResult.success(map.get("v_resultmsg").toString());
} else {
return AjaxResult.warn(map.get("v_resultmsg").toString());
@@ -383,7 +385,7 @@ public class PdaServiceImp implements PdaService {
List<MydoJobDetail> currentMydoJobDetails = mydoJobDetailService.selectMydoJobDetailList(mydoJobDetailParam);
boolean flag = currentMydoJobDetails.stream().allMatch(mydoJobDetail -> mydoJobDetail.getPickQuantity().equals(mydoJobDetail.getOutQuantity()));
if (flag) {
deleteTagTask(trayCodeMakeSure, basWarehouse);
HashMap<String, Object> map = new HashMap<>();
@@ -392,6 +394,7 @@ public class PdaServiceImp implements PdaService {
pdaMapper.outMakeSure(map);
String result = map.get("v_result").toString();
if ("10".equals(result)) {
deleteTagTask(trayCodeMakeSure, basWarehouse);
return AjaxResult.success(map.get("v_resultmsg").toString());
} else {
return AjaxResult.warn(map.get("v_resultmsg").toString());
@@ -434,12 +437,13 @@ public class PdaServiceImp implements PdaService {
}
List<MydoJobDetail> mydoJobDetails = mydoJobDetailService.selectMydoJobDetailListByJobId(mydoJob.getJobId());
if (mydoJobDetails.stream().allMatch(x -> "1".equals(x.getSpare3()))) {
deleteTagTask(trayCodeMakeSure, basWarehouse);
HashMap<String, Object> map = new HashMap<>();
map.put("v_tray_code", trayCodeMakeSure.getTrayCode());
pdaMapper.checkMakeSure(map);
String result = map.get("v_result").toString();
if ("10".equals(result)) {
deleteTagTask(trayCodeMakeSure, basWarehouse);
return AjaxResult.success(map.get("v_resultmsg").toString());
} else {
return AjaxResult.warn(map.get("v_resultmsg").toString());
@@ -476,6 +480,8 @@ public class PdaServiceImp implements PdaService {
private void deleteTagTask(TrayCodeMakeSure trayCodeMakeSure, BasWarehouse basWarehouse) {
if ("2".equals(basWarehouse.getWarehouseType())) {
BasTag basTag = basTagService.selectBasTagByTrayCode(trayCodeMakeSure.getTrayCode());
basTag.setTrayCode("");
basTagService.updateBasTag(basTag);
//删除电子标签
TagTask param = new TagTask();
param.setTagId(basTag.getId());
@@ -485,6 +491,13 @@ public class PdaServiceImp implements PdaService {
.map(TagTask::getId)
.toArray(Long[]::new));
}
//通知wcs出库确认成功
HashMap<String, String> outMydojobMakeSureParam = new HashMap<>();
outMydojobMakeSureParam.put("trayCode", trayCodeMakeSure.getTrayCode());
AjaxResult ajaxResult = iToWcsService.outMydojobMakeSure(outMydojobMakeSureParam);
if (!ajaxResult.isSuccess()){
throw new RuntimeException(ajaxResult.toString());
}
}
}