rev:手持取放货确认优化

This commit is contained in:
2025-12-15 17:36:26 +08:00
parent 1265680b0c
commit 8922ae4a46
4 changed files with 88 additions and 33 deletions

View File

@@ -8,11 +8,13 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.nl.common.exception.BadRequestException;
import org.nl.wms.pda.general_management.service.PdaPickUpConfirmService;
import org.nl.wms.pda.util.PdaResponse;
import org.nl.wms.sch_manage.enums.TaskStatus;
import org.nl.wms.sch_manage.service.ISchBasePointService;
import org.nl.wms.sch_manage.service.ISchBaseTaskService;
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
import org.nl.wms.sch_manage.service.dao.SchBaseTask;
import org.nl.wms.sch_manage.service.dao.mapper.SchBasePointMapper;
import org.nl.wms.warehouse_management.enums.IOSConstant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -55,26 +57,30 @@ public class PdaPickUpConfirmServiceImpl implements PdaPickUpConfirmService {
throw new BadRequestException("搜索条件不能为空!");
}
LambdaQueryWrapper<SchBasePoint> lambda = new QueryWrapper<SchBasePoint>().lambda();
lambda.eq(SchBasePoint::getPoint_code, search)
.or(qw -> qw.eq(SchBasePoint::getVehicle_code, search));
SchBasePoint pointDao = iSchBasePointService.getOne(lambda);
JSONObject result = JSONObject.parseObject(JSON.toJSONString(pointDao), JSONObject.class);
// 查询任务
List<SchBaseTask> taskList = iSchBaseTaskService.list(
new QueryWrapper<SchBaseTask>().lambda()
.eq(SchBaseTask::getVehicle_code, search)
.eq(SchBaseTask::getTask_status, TaskStatus.EXECUTING.getCode())
.eq(SchBaseTask::getIs_delete, IOSConstant.ZERO)
);
if (ObjectUtil.isEmpty(result)) {
throw new BadRequestException("未查询到当前信息!");
if (taskList.size() > 1) {
throw new BadRequestException("当前载具存在多条正在执行中的任务【"+search+"");
}
SchBaseTask taskDao = iSchBaseTaskService.getById(pointDao.getIng_task_code());
if (ObjectUtil.isNotEmpty(taskDao)) {
JSONObject result = new JSONObject();
if (ObjectUtil.isNotEmpty(taskList)) {
SchBaseTask taskDao = taskList.get(0);
result.put("task_code", taskDao.getTask_code());
result.put("point_code", search);
result.put("car_no", taskDao.getCar_no());
result.put("point_code1", taskDao.getPoint_code1());
result.put("point_code2", taskDao.getPoint_code2());
}
// 查询明细
List<JSONObject> rows = schBasePointMapper.getPointDtl(whereJson);
List<JSONObject> rows = schBasePointMapper.getTaskDtl(whereJson);
result.put("rows", rows);
return PdaResponse.requestParamOk(result);
}

View File

@@ -56,4 +56,13 @@ public interface SchBasePointMapper extends BaseMapper<SchBasePoint> {
* @return List<JSONObject>
*/
List<JSONObject> getPointDtl(@Param("param") JSONObject whereJson);
/**
* 查询任务物料明细
* @param whereJson {
* search载具编码
* }
* @return List<JSONObject>
*/
List<JSONObject> getTaskDtl(@Param("param") JSONObject whereJson);
}

View File

@@ -110,4 +110,41 @@
</where>
</select>
<select id="getTaskDtl" resultType="com.alibaba.fastjson.JSONObject">
SELECT
task.task_code,
task.point_code1,
task.point_code2,
task.vehicle_code,
task.car_no,
mater.material_code,
mater.material_name,
late.pcsn,
late.qty,
late.produce_time,
late.quality_type,
supp.supp_code,
supp.supp_name,
late.bake_num,
late.device_code,
bom.bom_code,
late.qty_unit_name
FROM
sch_base_task task
LEFT JOIN md_pb_groupplate late ON late.storagevehicle_code = task.vehicle_code
LEFT JOIN md_me_materialbase mater ON late.material_id = mater.material_id
LEFT JOIN md_cs_supplierbase supp ON late.supp_code = supp.supp_code
LEFT JOIN pdm_bom_callmaterial bom ON bom.bom_id = late.bom_id
<where>
task.task_status = '4'
and task.is_delete = '0'
<if test="param.search != null and param.search != ''">
AND
task.vehicle_code = #{param.search}
</if>
</where>
</select>
</mapper>

View File

@@ -220,21 +220,22 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
@Override
@Transactional
public void getConfirm(JSONObject whereJson) {
SchBasePoint pointDao = this.getById(whereJson.getString("point_code"));
if (ObjectUtil.isEmpty(pointDao.getIng_task_code())) {
throw new BadRequestException("当前站点没有任务【"+pointDao.getPoint_code()+"");
}
// 查询任务
SchBaseTask taskDao = iSchBaseTaskService.getById(pointDao.getIng_task_code());
if (ObjectUtil.isEmpty(taskDao)) {
throw new BadRequestException("当前点位没有正在执行的任务!");
}
// 判断任务是否在执行中
if (!taskDao.getTask_status().equals(TaskStatus.EXECUTING.getCode())) {
throw new BadRequestException("当前点位任务已完成或未执行【"+taskDao.getTask_code()+"");
List<SchBaseTask> taskList = iSchBaseTaskService.list(
new QueryWrapper<SchBaseTask>().lambda()
.eq(SchBaseTask::getVehicle_code, whereJson.getString("point_code"))
.eq(SchBaseTask::getTask_status, TaskStatus.EXECUTING.getCode())
.eq(SchBaseTask::getIs_delete, IOSConstant.ZERO)
);
if (ObjectUtil.isEmpty(taskList)) {
throw new BadRequestException("当前载具没有正在执行的任务!");
}
if (taskList.size() > 1) {
throw new BadRequestException("当前载具存在多条正在执行中的任务【"+whereJson.getString("point_code")+"");
}
SchBaseTask taskDao = taskList.get(0);
// 通知ACS可以离开
JSONObject jsonParam = new JSONObject();
jsonParam.put("task_type", IOSConstant.ONE);
@@ -246,20 +247,22 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
@Override
@Transactional
public void putConfirm(JSONObject whereJson) {
SchBasePoint pointDao = this.getById(whereJson.getString("point_code"));
if (ObjectUtil.isEmpty(pointDao.getIng_task_code())) {
throw new BadRequestException("当前站点没有任务【"+pointDao.getPoint_code()+"");
}
// 查询任务
SchBaseTask taskDao = iSchBaseTaskService.getById(pointDao.getIng_task_code());
if (ObjectUtil.isEmpty(taskDao)) {
throw new BadRequestException("当前点位没有正在执行的任务!");
}
// 判断任务是否在执行中
if (!taskDao.getTask_status().equals(TaskStatus.EXECUTING.getCode())) {
throw new BadRequestException("当前点位任务已完成或未执行【"+taskDao.getTask_code()+"");
List<SchBaseTask> taskList = iSchBaseTaskService.list(
new QueryWrapper<SchBaseTask>().lambda()
.eq(SchBaseTask::getVehicle_code, whereJson.getString("point_code"))
.eq(SchBaseTask::getTask_status, TaskStatus.EXECUTING.getCode())
.eq(SchBaseTask::getIs_delete, IOSConstant.ZERO)
);
if (ObjectUtil.isEmpty(taskList)) {
throw new BadRequestException("当前载具没有正在执行的任务!");
}
if (taskList.size() > 1) {
throw new BadRequestException("当前载具存在多条正在执行中的任务【"+whereJson.getString("point_code")+"");
}
SchBaseTask taskDao = taskList.get(0);
// 通知ACS可以离开
JSONObject jsonParam = new JSONObject();
jsonParam.put("task_type", IOSConstant.TWO);