现场代码修改

This commit is contained in:
liuhanqing
2026-02-04 15:03:23 +08:00
parent 772915a6c2
commit dca9a8f2f1
4 changed files with 30 additions and 24 deletions

View File

@@ -17,6 +17,7 @@ import com.ruoyi.bas.weightRule.domain.BasCargoSpaceWeightRule;
import com.ruoyi.bas.weightRule.service.IBasCargoSpaceWeightRuleService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.MessageUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.job.mydojob.domain.MydoJob;
import com.ruoyi.job.mydojob.service.IMydoJobService;
import com.ruoyi.job.mydojobdetail.domain.MydoJobDetail;
@@ -24,6 +25,7 @@ import com.ruoyi.job.mydojobdetail.service.IMydoJobDetailService;
import com.ruoyi.log.domain.RequestLog;
import com.ruoyi.log.service.IRequestLogService;
import com.ruoyi.out.outStockout.service.IOutStockoutService;
import com.ruoyi.pda.domain.TrayCodeMsg;
import com.ruoyi.pda.mapper.PdaMapper;
import com.ruoyi.pda.service.PdaService;
import lombok.extern.slf4j.Slf4j;
@@ -85,7 +87,7 @@ public class ToWcsServiceImpl implements IToWcsService {
mydoJobParam.setStatus("3");
mydoJobParam.setExitId(exitId + "");
List<MydoJob> roadwayRunningMydoJobs = mydoJobService.selectMydoJobListApi(mydoJobParam);
if (CollUtil.isEmpty(roadwayRunningMydoJobs)) {
if (CollUtil.isEmpty(roadwayRunningMydoJobs) || roadwayRunningMydoJobs.size() < 2) {
mydoJobParam1.setStatus("1");
mydoJobParam1.setRoadwayId(String.valueOf(i));
mydoJobParam1.setExitId(exitId + "");
@@ -108,7 +110,7 @@ public class ToWcsServiceImpl implements IToWcsService {
mydoJobParam.setRoadwayId(String.valueOf(i));
mydoJobParam.setStatus("3");
List<MydoJob> roadwayRunningMydoJobs = mydoJobService.selectMydoJobListApi(mydoJobParam);
if (CollUtil.isEmpty(roadwayRunningMydoJobs)) {
if (CollUtil.isEmpty(roadwayRunningMydoJobs) || roadwayRunningMydoJobs.size() < 2) {
mydoJobParam1.setStatus("1");
mydoJobParam1.setRoadwayId(String.valueOf(i));
List<MydoJob> roadwayWaitingMydoJobs = mydoJobService.selectMydoJobListApi(mydoJobParam1);
@@ -132,7 +134,7 @@ public class ToWcsServiceImpl implements IToWcsService {
@Override
public AjaxResult cancelTaskByTaskNo(String taskNo) {
Map<String,String> map = new HashMap<>();
Map<String, String> map = new HashMap<>();
map.put("taskNo", taskNo);
RequestLog requestLog = requestLogService.getRequestLog(CANCEL_MYDOJOB_1, JSONUtil.toJsonStr(map), "取消任务");
if ("1".equals(requestLog.getIsSuccessful())) {
@@ -147,19 +149,19 @@ public class ToWcsServiceImpl implements IToWcsService {
if (StrUtil.isEmpty(requestEnter.getTrayCode())) {
return AjaxResult.error("托盘条码不能为空");
}
if (requestEnter.getHeight()==0) {
if (requestEnter.getHeight() == 0) {
return AjaxResult.error("未检测到入库高度");
}
if (requestEnter.getWeight() ==0){
if (requestEnter.getWeight() == 0) {
return AjaxResult.error("未检测到入库重量");
}
if (StrUtil.isEmpty(requestEnter.getRoadwayId())){
if (StrUtil.isEmpty(requestEnter.getRoadwayId())) {
return AjaxResult.error("巷道参数不能为空");
}
if (StrUtil.isEmpty(requestEnter.getWarehouseId())){
if (StrUtil.isEmpty(requestEnter.getWarehouseId())) {
return AjaxResult.error("仓库参数不能为空");
}
if (StrUtil.isEmpty(requestEnter.getTrayCode())){
if (StrUtil.isEmpty(requestEnter.getTrayCode())) {
return AjaxResult.error("托盘参数不能为空");
}
@@ -170,17 +172,17 @@ public class ToWcsServiceImpl implements IToWcsService {
param.setTrayCode(requestEnter.getTrayCode());
param.setWarehouseId(requestEnter.getWarehouseId());
List<MydoJob> mydoJobs = mydoJobService.selectMydoJobListApi(param);
if (CollUtil.isEmpty(mydoJobs)){
if ("02".equals(requestEnter.getWarehouseId())){
if (CollUtil.isEmpty(mydoJobs)) {
if ("02".equals(requestEnter.getWarehouseId())) {
HashMap<String, Object> map = new HashMap<>();
map.put("v_tray_code", requestEnter.getTrayCode());
map.put("v_warehouse_id", requestEnter.getWarehouseId());
map.put("v_dept_id", "");
pdaMapper.ktpin(map);
String result1 = map.get("v_result").toString();
if ("10".equals(result1)){
if ("10".equals(result1)) {
return AjaxResult.success(map.get("v_resultmsg").toString());
}else{
} else {
return AjaxResult.error(map.get("v_resultmsg").toString());
}
}
@@ -188,7 +190,7 @@ public class ToWcsServiceImpl implements IToWcsService {
return AjaxResult.error("无入库任务", requestEnter.getTrayCode());
}
MydoJob mydoJob = mydoJobs.get(0);
if(StrUtil.isEmpty(mydoJob.getCargoSpaceId())){
if (StrUtil.isEmpty(mydoJob.getCargoSpaceId())) {
//根据重量平衡 两排货位
//查询重量
BasCargoSpace basCargoSpaceParam = new BasCargoSpace();
@@ -197,9 +199,9 @@ public class ToWcsServiceImpl implements IToWcsService {
//找到重量小的排数
Long plat = basCargoSpaceService.selectPlatByWeight(requestEnter);
basCargoSpaceParam.setThePlatoon(plat);
if (requestEnter.getHeight()==1){
if (requestEnter.getHeight() == 1) {
basCargoSpaceParam.setCargoHight("975");
}else {
} else {
basCargoSpaceParam.setCargoHight("1519");
}
//按 重量规则 查找货位
@@ -209,17 +211,20 @@ public class ToWcsServiceImpl implements IToWcsService {
weightParam.setSpare1(requestEnter.getHeight().toString());
BasCargoSpaceWeightRule basCargoSpaceWeightRule = basCargoSpaceWeightRuleService.selectBasCargoSpaceWeightRuleByWarehouseIdAndRoadwayId(weightParam);
BasCargoSpace basCargoSpace = null;
if (basCargoSpaceWeightRule!=null){
if (basCargoSpaceWeightRule != null) {
basCargoSpaceParam.setTheFloor(Convert.toLong(basCargoSpaceWeightRule.getFloor()));
if (requestEnter.getWeight()>= Convert.toDouble(basCargoSpaceWeightRule.getWeight())){
if (requestEnter.getWeight() >= Convert.toDouble(basCargoSpaceWeightRule.getWeight())) {
basCargoSpaceParam.setRule1("1");
basCargoSpace = basCargoSpaceService.selectEmptyCargoSpaceByWarehouseId(basCargoSpaceParam);
}else {
} else {
basCargoSpaceParam.setRule2("1");
basCargoSpace = basCargoSpaceService.selectEmptyCargoSpaceByWarehouseId(basCargoSpaceParam);
}
}
if (ObjUtil.isNull(basCargoSpace)){
if (ObjUtil.isNull(basCargoSpace)) {
if ("1519".equals(basCargoSpaceParam.getCargoHight())){
return AjaxResult.error("没有空货位");
}
//去除排的条件 再次查询货位
basCargoSpaceParam.setThePlatoon(null);
basCargoSpaceParam.setRule1(null);
@@ -227,7 +232,7 @@ public class ToWcsServiceImpl implements IToWcsService {
basCargoSpaceParam.setTheFloor(null);
basCargoSpaceParam.setCargoHight(null);
basCargoSpace = basCargoSpaceService.selectEmptyCargoSpaceByWarehouseId(basCargoSpaceParam);
if (ObjUtil.isNull(basCargoSpace)){
if (ObjUtil.isNull(basCargoSpace)) {
return AjaxResult.error("没有空货位");
}
}
@@ -291,7 +296,7 @@ public class ToWcsServiceImpl implements IToWcsService {
MydoJob outJob = outMydoJobs.get(0);
outJob.setExecutionPhase("2");
mydoJobService.updateMydoJob(outJob);
if ("24".equals(outJob.getInOrOut())){
if ("24".equals(outJob.getInOrOut())) {
String[] jobIds = new String[]{outJob.getJobId()};
mydoJobService.OuthandFinish(jobIds);
}

View File

@@ -133,7 +133,7 @@ token:
# 令牌密钥
secret: abcdefghijklmnopqrstuvwxyz
# 令牌有效期(默认30分钟)
expireTime: 30
expireTime: 720

View File

@@ -39,6 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
<if test="inDate != null and inDate != ''"> and in_date = #{inDate}</if>
</where>
order by tray_code
</select>
<select id="selectViewTraycodeStaticByWarehouseId" parameterType="String" resultMap="ViewTraycodeStaticResult">