rev:测试修改

This commit is contained in:
2026-01-26 17:47:54 +08:00
parent 0d9189fa70
commit ca66e7e776
13 changed files with 71 additions and 29 deletions

View File

@@ -119,8 +119,9 @@ public class NotCarToWmsServiceImpl implements NotCarToWmsService {
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
try {
if (tryLock) {
JSONObject data = whereJson.getJSONObject("data");
String statusType = data.getString("statusType");
// 前往点位
} else {
log.info("无人车到达输出参数:{}", NoCarResponse.requestError("当前任务正在执行中,请稍后在试...").toString());
return NoCarResponse.requestError("当前任务正在执行中,请稍后在试...");
@@ -130,7 +131,7 @@ public class NotCarToWmsServiceImpl implements NotCarToWmsService {
lock.unlock();
}
}
log.info("无人车到达输出参数:{}", NoCarResponse.responseOk().toString());
// log.info("无人车到达输出参数:{}", NoCarResponse.responseOk().toString());
return NoCarResponse.responseOk();
}
}

View File

@@ -6,7 +6,7 @@ import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.logging.annotation.Log;
import org.nl.wms.pda.general_management.service.NotCarService;
import org.nl.wms.pda.general_management.service.PdaNotCarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
@@ -27,10 +27,10 @@ import org.springframework.web.bind.annotation.RestController;
@RequiredArgsConstructor
@RequestMapping("/api/notCar")
@Slf4j
public class NotCarController {
public class PdaNotCarController {
@Autowired
private NotCarService notCarService;
private PdaNotCarService notCarService;
@PostMapping("/queryXhRegion")
@Log("无人车卸货 - 查询卸货区下拉框")

View File

@@ -11,7 +11,7 @@ import org.nl.wms.pda.util.PdaResponse;
* @author Liuxy
* @since 2026-01-06
*/
public interface NotCarService {
public interface PdaNotCarService {
/**
* 无人车卸货 - 查询卸货区下拉框

View File

@@ -252,6 +252,7 @@ public class PdaCommonServiceImpl implements PdaCommonService {
List<String> pointCodeList = pointDaoList.stream()
.map(SchBasePoint::getPoint_code)
.collect(Collectors.toList());
pointCodeList.add(IOSConstant.AGVZJZ001);
// 查询当前正在执行的任务
List<SchBaseTask> taskList = taskService.list(
@@ -270,7 +271,7 @@ public class PdaCommonServiceImpl implements PdaCommonService {
json.put("vehicle_qty", pointDao.getVehicle_qty());
// 查询待堆叠数量
List<SchBaseTask> collectQtyList = taskList.stream()
.filter(row -> row.getPoint_code2().equals(pointDao.getPoint_code()))
.filter(row -> row.getPoint_code3().equals(pointDao.getPoint_code()))
.collect(Collectors.toList());
json.put("execution_task", ObjectUtil.isNotEmpty(collectQtyList) ? collectQtyList.size() : 0);
// 计算剩余可堆叠数量
@@ -303,7 +304,8 @@ public class PdaCommonServiceImpl implements PdaCommonService {
// 生成任务
JSONObject jsonTask = new JSONObject();
jsonTask.put("point_code1", whereJson.getString("point_code"));
jsonTask.put("point_code2", row.getString("point_code"));
jsonTask.put("point_code2", IOSConstant.AGVZJZ001);
jsonTask.put("point_code3", row.getString("point_code"));
empStackPlatesTask.create(jsonTask);
return PdaResponse.requestOk();
}

View File

@@ -1,13 +1,10 @@
package org.nl.wms.pda.general_management.service.impl;
import cn.hutool.http.HttpStatus;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.nl.common.exception.BadRequestException;
import org.nl.common.utils.JSONObjectOf;
import org.nl.wms.ext.service.WmsToNotCarService;
import org.nl.wms.ext.util.BaseResponse;
import org.nl.wms.pda.general_management.service.NotCarService;
import org.nl.wms.pda.general_management.service.PdaNotCarService;
import org.nl.wms.pda.util.PdaResponse;
import org.nl.wms.sch_manage.service.ISchBaseRegionService;
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
@@ -31,7 +28,7 @@ import java.util.List;
* @since 2026-01-06
*/
@Service
public class NotCarServiceImpl implements NotCarService {
public class PdaNotCarServiceImpl implements PdaNotCarService {
/**
* 区域服务
@@ -127,7 +124,7 @@ public class NotCarServiceImpl implements NotCarService {
.eq(SchBasePoint::getRegion_code, region_code)
.eq(SchBasePoint::getIs_used, IOSConstant.ONE)
.and(row -> row.isNull(SchBasePoint::getIng_task_code)
.or().eq(SchBasePoint::getIng_task_code,"")
.or().eq(SchBasePoint::getIng_task_code, "")
)
.orderByAsc(SchBasePoint::getPoint_code)
);

View File

@@ -192,8 +192,9 @@ public class PdaPackagingServiceImpl implements PdaPackagingService {
jsonTask.put("point_code1", whereJson.getString("point_code"));
// 判断点位是否需要二次配送
SchBasePoint endPoint = iSchBasePointService.getById(whereJson.getString("in_point_code"));
jsonTask.put("point_code2", endPoint.getIs_auto() ? whereJson.getString("in_point_code") : IOSConstant.AGVZJZ001);
jsonTask.put("point_code3", whereJson.getString("in_point_code"));
jsonTask.put("point_code2", IOSConstant.AGVZJZ001);
jsonTask.put("point_code3", endPoint.getIs_auto() ? whereJson.getString("in_point_code") : "");
jsonTask.put("point_code4", whereJson.getString("in_point_code"));
jsonTask.put("material_id", rows.get(0).getString("material_id"));
jsonTask.put("material_qty", whereJson.getString("total_qty"));
packagingMiddleTask.create(jsonTask);

View File

@@ -51,6 +51,11 @@
AND
pack.point_code = #{param.out_point}
</if>
<if test="param.material_code != null and param.material_code != ''">
AND
mater.material_code = #{param.material_code}
</if>
</where>
ORDER BY pack.create_time Desc
</select>

View File

@@ -56,6 +56,7 @@ public class EmpStackPlatesTask extends AbstractTask {
task.setConfig_code(EmpStackPlatesTask.class.getSimpleName());
task.setPoint_code1(json.getString("point_code1"));
task.setPoint_code2(json.getString("point_code2"));
task.setPoint_code3(json.getString("point_code3"));
task.setVehicle_code(json.getString("vehicle_code"));
task.setMaterial_id(json.getString("material_id"));
task.setMaterial_qty(json.getBigDecimal("material_qty"));
@@ -144,10 +145,20 @@ public class EmpStackPlatesTask extends AbstractTask {
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
taskObj.setRemark("已完成");
taskService.updateById(taskObj);
// 更新当前点位载具数量
SchBasePoint pointDao = iSchBasePointService.getById(taskObj.getPoint_code2());
pointDao.setVehicle_qty(NumberUtil.add(pointDao.getVehicle_qty(), Integer.valueOf(1)).intValue());
iSchBasePointService.updateById(pointDao);
// 判断是否是中间站点
if (taskObj.getPoint_code2().equals(IOSConstant.AGVZJZ001)) {
// 生成二段任务
JSONObject jsonTask = new JSONObject();
jsonTask.put("point_code1", IOSConstant.AGVZJZ001);
jsonTask.put("point_code2", taskObj.getPoint_code3());
jsonTask.put("point_code3", taskObj.getPoint_code3());
this.create(jsonTask);
} else {
// 更新当前点位载具数量
SchBasePoint pointDao = iSchBasePointService.getById(taskObj.getPoint_code3());
pointDao.setVehicle_qty(NumberUtil.add(pointDao.getVehicle_qty(), Integer.valueOf(1)).intValue());
iSchBasePointService.updateById(pointDao);
}
}
@Transactional(rollbackFor = Exception.class)

View File

@@ -57,6 +57,7 @@ public class PackagingMiddleTask extends AbstractTask {
task.setPoint_code1(json.getString("point_code1"));
task.setPoint_code2(json.getString("point_code2"));
task.setPoint_code3(json.getString("point_code3"));
task.setPoint_code4(json.getString("point_code4"));
task.setVehicle_code(json.getString("vehicle_code"));
task.setMaterial_id(json.getString("material_id"));
task.setMaterial_qty(json.getBigDecimal("material_qty"));
@@ -145,12 +146,36 @@ public class PackagingMiddleTask extends AbstractTask {
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
taskObj.setRemark("已完成");
taskService.updateById(taskObj);
// 跟更新库存点位
iMdPdmPackagingService.update(
new UpdateWrapper<MdPdmPackaging>().lambda()
.eq(MdPdmPackaging::getPoint_code, taskObj.getPoint_code1())
.set(MdPdmPackaging::getPoint_code, taskObj.getPoint_code3())
);
if (taskObj.getPoint_code2().equals(IOSConstant.AGVZJZ001)) {
// 判断point_code3是否有值
if (ObjectUtil.isEmpty(taskObj.getPoint_code3())) {
// 更新库存
iMdPdmPackagingService.update(
new UpdateWrapper<MdPdmPackaging>().lambda()
.eq(MdPdmPackaging::getPoint_code, taskObj.getPoint_code1())
.set(MdPdmPackaging::getPoint_code, taskObj.getPoint_code4())
);
} else {
// 生成任务
JSONObject jsonTask = new JSONObject();
jsonTask.put("point_code1", IOSConstant.AGVZJZ001);
jsonTask.put("point_code2", taskObj.getPoint_code3());
// 储存第一条任务的起点
jsonTask.put("point_code3", taskObj.getPoint_code1());
// 储存最终终点
jsonTask.put("point_code4", taskObj.getPoint_code3());
jsonTask.put("material_id", taskObj.getMaterial_id());
jsonTask.put("material_qty", taskObj.getMaterial_qty());
this.create(jsonTask);
}
} else {
// 更新库存
iMdPdmPackagingService.update(
new UpdateWrapper<MdPdmPackaging>().lambda()
.eq(MdPdmPackaging::getPoint_code, taskObj.getPoint_code3())
.set(MdPdmPackaging::getPoint_code, taskObj.getPoint_code4())
);
}
}
@Transactional(rollbackFor = Exception.class)