add:手持功能

This commit is contained in:
2025-09-04 18:44:39 +08:00
parent 077c076bf6
commit 820e696c39
23 changed files with 699 additions and 29 deletions

View File

@@ -75,4 +75,11 @@ public class PdaGeneralPublicController {
return new ResponseEntity<>(PdaResponse.requestParamOk(pdaGeneralPublicService.queryBomInfo(whereJson)), HttpStatus.OK);
}
@PostMapping("/queryVehicleType")
@Log("查询载具类型")
@SaIgnore
public ResponseEntity<Object> queryVehicleType() {
return new ResponseEntity<>(PdaResponse.requestParamOk(pdaGeneralPublicService.queryVehicleType()), HttpStatus.OK);
}
}

View File

@@ -0,0 +1,56 @@
package org.nl.wms.pda.general_management.controller;
import cn.dev33.satoken.annotation.SaIgnore;
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.PdaPickUpConfirmService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 平板确认取放货
* </p>
*
* @author Liuxy
* @since 2025-09-04
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/pdaPickUp")
@Slf4j
public class PdaPickUpConfirmController {
@Autowired
private PdaPickUpConfirmService pdaPickUpConfirmService;
@PostMapping("/queryPointInfo")
@Log("查询点位物料信息")
@SaIgnore
public ResponseEntity<Object> createTask(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(pdaPickUpConfirmService.queryPointInfo(whereJson), HttpStatus.OK);
}
@PostMapping("/confirmGet")
@Log("确认取货")
@SaIgnore
public ResponseEntity<Object> confirmGet(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(pdaPickUpConfirmService.confirmGet(whereJson), HttpStatus.OK);
}
@PostMapping("/confirmPut")
@Log("确认放货")
@SaIgnore
public ResponseEntity<Object> confirmPut(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(pdaPickUpConfirmService.confirmPut(whereJson), HttpStatus.OK);
}
}

View File

@@ -0,0 +1,43 @@
package org.nl.wms.pda.general_management.controller;
import cn.dev33.satoken.annotation.SaIgnore;
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.PdaInGroupBoxService;
import org.nl.wms.pda.general_management.service.PdaPointAndPointBoxService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 平板点对点送货
* </p>
*
* @author Liuxy
* @since 2025-09-04
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/pdaPointAndPoint")
@Slf4j
public class PdaPointAndPointController {
@Autowired
private PdaPointAndPointBoxService pdaPointAndPointBoxService;
@PostMapping("/createTask")
@Log("生成任务")
@SaIgnore
public ResponseEntity<Object> createTask(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(pdaPointAndPointBoxService.createTask(whereJson), HttpStatus.OK);
}
}

View File

@@ -0,0 +1,42 @@
package org.nl.wms.pda.general_management.controller;
import cn.dev33.satoken.annotation.SaIgnore;
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.PdaUpdatePointService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 平板点位更新
* </p>
*
* @author Liuxy
* @since 2025-09-04
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/pdaUpdatePoint")
@Slf4j
public class PdaUpdatePointController {
@Autowired
private PdaUpdatePointService pdaUpdatePointService;
@PostMapping("/queryPointInfo")
@Log("查询点位物料信息")
@SaIgnore
public ResponseEntity<Object> createTask(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(pdaUpdatePointService.queryPointInfo(whereJson), HttpStatus.OK);
}
}

View File

@@ -59,11 +59,19 @@ public interface PdaGeneralPublicService {
/**
* 查询工单信息
*
* @param whereJson {
* start_time: 日期
* search: 工单编码/机台编码
* }
* }
* @return PdaResponse
*/
PdaResponse queryBomInfo(JSONObject whereJson);
/**
* 查询载具类型
*
* @return PdaResponse
*/
PdaResponse queryVehicleType();
}

View File

@@ -0,0 +1,42 @@
package org.nl.wms.pda.general_management.service;
import com.alibaba.fastjson.JSONObject;
import org.nl.wms.pda.util.PdaResponse;
/**
* <p>
* 平板确认取放货 服务类
* </p>
*
* @author Liuxy
* @since 2025-09-03
*/
public interface PdaPickUpConfirmService {
/**
* 查询点位物料信息
* @param whereJson {
* search: 点位编码/载具编码
* }
* @return PdaResponse
*/
PdaResponse queryPointInfo(JSONObject whereJson);
/**
* 确认取货
* @param whereJson {
* point_code: 当前站点
* }
* @return PdaResponse
*/
PdaResponse confirmGet(JSONObject whereJson);
/**
* 确认放货
* @param whereJson {
* point_code: 当前站点
* }
* @return PdaResponse
*/
PdaResponse confirmPut(JSONObject whereJson);
}

View File

@@ -0,0 +1,28 @@
package org.nl.wms.pda.general_management.service;
import com.alibaba.fastjson.JSONObject;
import org.nl.wms.pda.util.PdaResponse;
/**
* <p>
* 平板点对点送货 服务类
* </p>
*
* @author Liuxy
* @since 2025-09-04
*/
public interface PdaPointAndPointBoxService {
/**
* 生成任务
*
* @param whereJson {
* storagevehicle_code: 载具编码
* point_code1: 起点
* point_code2: 终点
* task_type: 载具类型
* }
* @return PdaResponse
*/
PdaResponse createTask(JSONObject whereJson);
}

View File

@@ -0,0 +1,25 @@
package org.nl.wms.pda.general_management.service;
import com.alibaba.fastjson.JSONObject;
import org.nl.wms.pda.util.PdaResponse;
/**
* <p>
* 平板点位更新 服务类
* </p>
*
* @author Liuxy
* @since 2025-09-03
*/
public interface PdaUpdatePointService {
/**
* 查询点位物料信息
* @param whereJson {
* point_code: 点位编码
* storagevehicle_code: 载具编码
* }
* @return PdaResponse
*/
PdaResponse queryPointInfo(JSONObject whereJson);
}

View File

@@ -105,4 +105,9 @@ public class PdaGeneralPublicServiceImpl implements PdaGeneralPublicService {
public PdaResponse queryBomInfo(JSONObject whereJson) {
return PdaResponse.requestParamOk(pdmBomCallMaterialMapper.queryBomInfo(whereJson));
}
@Override
public PdaResponse queryVehicleType() {
return PdaResponse.requestParamOk(PDAEnum.TASK_TYPE.getDict());
}
}

View File

@@ -0,0 +1,95 @@
package org.nl.wms.pda.general_management.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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.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.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* <p>
* 平板确认取放货 实现类
* </p>
*
* @author Liuxy
* @since 2025-09-03
*/
@Service
public class PdaPickUpConfirmServiceImpl implements PdaPickUpConfirmService {
/**
* 点位服务
*/
@Autowired
private ISchBasePointService iSchBasePointService;
/**
* 任务服务
*/
@Autowired
private ISchBaseTaskService iSchBaseTaskService;
/**
* 带你为mapper
*/
@Autowired
private SchBasePointMapper schBasePointMapper;
@Override
public PdaResponse queryPointInfo(JSONObject whereJson) {
String search = whereJson.getString("search");
if (ObjectUtil.isEmpty(search)) {
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);
if (ObjectUtil.isEmpty(result)) {
throw new BadRequestException("未查询到当前信息!");
}
SchBaseTask taskDao = iSchBaseTaskService.getById(pointDao.getIng_task_code());
if (ObjectUtil.isNotEmpty(taskDao)) {
result.put("task_code", taskDao.getTask_code());
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);
result.put("rows", rows);
return PdaResponse.requestParamOk(result);
}
@Override
@Transactional
public PdaResponse confirmGet(JSONObject whereJson) {
iSchBasePointService.getConfirm(whereJson);
return PdaResponse.requestOk();
}
@Override
@Transactional
public PdaResponse confirmPut(JSONObject whereJson) {
iSchBasePointService.putConfirm(whereJson);
return PdaResponse.requestOk();
}
}

View File

@@ -0,0 +1,32 @@
package org.nl.wms.pda.general_management.service.impl;
import com.alibaba.fastjson.JSONObject;
import org.nl.wms.pda.general_management.service.PdaPointAndPointBoxService;
import org.nl.wms.pda.util.PdaResponse;
import org.nl.wms.sch_manage.service.PointToPointService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* <p>
* 平板点对点送货 实现类
* </p>
*
* @author Liuxy
* @since 2025-09-04
*/
@Service
public class PdaPointAndPointServiceImpl implements PdaPointAndPointBoxService {
/**
* PC点对点送货服务
*/
@Autowired
private PointToPointService pointToPointService;
@Override
public PdaResponse createTask(JSONObject whereJson) {
pointToPointService.create(whereJson);
return PdaResponse.requestOk();
}
}

View File

@@ -0,0 +1,45 @@
package org.nl.wms.pda.general_management.service.impl;
import com.alibaba.fastjson.JSONObject;
import org.nl.wms.pda.general_management.service.PdaUpdatePointService;
import org.nl.wms.pda.util.PdaResponse;
import org.nl.wms.sch_manage.service.ISchBaseTaskService;
import org.nl.wms.sch_manage.service.dao.mapper.SchBasePointMapper;
import org.nl.wms.warehouse_management.service.dao.mapper.MdPbGroupplateMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* <p>
* 平板点位更新 实现类
* </p>
*
* @author Liuxy
* @since 2025-09-03
*/
@Service
public class PdaUpdatePointServiceImpl implements PdaUpdatePointService {
/**
* 组盘mapper
*/
@Autowired
private MdPbGroupplateMapper mdPbGroupplateMapper;
/**
* 任务服务
*/
@Autowired
private ISchBaseTaskService iSchBaseTaskService;
/**
* 点位mapper
*/
@Autowired
private SchBasePointMapper schBasePointMapper;
@Override
public PdaResponse queryPointInfo(JSONObject whereJson) {
return PdaResponse.requestParamOk(mdPbGroupplateMapper.pdaGetPointDtl(whereJson));
}
}

View File

@@ -89,4 +89,10 @@ public class SchBasePointController {
schBasePointService.putConfirm(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@Log("获取点位物料信息")
@PostMapping("/getPointDtl")
public ResponseEntity<Object> getPointDtl(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(schBasePointService.getPointDtl(whereJson),HttpStatus.OK);
}
}

View File

@@ -102,4 +102,14 @@ public interface ISchBasePointService extends IService<SchBasePoint> {
* @param whereJson 点位实体
*/
void putConfirm(JSONObject whereJson);
/**
*
* @param whereJson {
* point_code点位编码
* storagevehicle_code载具编码
* }
* @return
*/
JSONObject getPointDtl(JSONObject whereJson);
}

View File

@@ -1,7 +1,9 @@
package org.nl.wms.sch_manage.service.dao.mapper;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
import org.nl.wms.sch_manage.service.dto.SchBasePointQuery;
@@ -44,4 +46,14 @@ public interface SchBasePointMapper extends BaseMapper<SchBasePoint> {
* @return IPage<SchBasePoint>
*/
IPage<SchBasePoint> selectPageLeftJoin(IPage<SchBasePoint> pages, SchBasePointQuery whereJson);
/**
* 查询点位物料明细
* @param whereJson {
* point_code点位编码
* storagevehicle_code载具编码
* }
* @return List<JSONObject>
*/
List<JSONObject> getPointDtl(@Param("param") JSONObject whereJson);
}

View File

@@ -63,4 +63,51 @@
</where>
ORDER BY p.region_code, p.point_code, p.point_type
</select>
<select id="getPointDtl" resultType="com.alibaba.fastjson.JSONObject">
SELECT
point.*,
task.task_code,
task.point_code1,
task.point_code2,
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,
bom.device_code,
bom.bom_code,
late.qty_unit_name
FROM
sch_base_point point
LEFT JOIN sch_base_task task ON point.ing_task_code = task.task_id
LEFT JOIN md_pb_groupplate late ON late.storagevehicle_code = point.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>
1 = 1
<if test="param.point_code != null and param.point_code != ''">
AND
point.point_code = #{param.point_code}
</if>
<if test="param.storagevehicle_code != null and param.storagevehicle_code != ''">
AND
point.vehicle_code = #{param.storagevehicle_code}
</if>
<if test="param.search != null and param.search != ''">
AND
(point.vehicle_code = #{param.search} or
point.point_code = #{param.search})
</if>
</where>
</select>
</mapper>

View File

@@ -216,9 +216,11 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
@Transactional
public void putConfirm(JSONObject whereJson) {
SchBasePoint pointDao = this.getById(whereJson.getString("point_code"));
pointDao.setPoint_status(IOSEnum.POINT_STATUS.code("有箱有料"));
pointDao.setVehicle_code(whereJson.getString("vehicle_code"));
this.updateById(pointDao);
// TODO 通知ACS可以离开
}
@Override
public JSONObject getPointDtl(JSONObject whereJson) {
return pointMapper.getPointDtl(whereJson).get(0);
}
}

View File

@@ -117,6 +117,7 @@ public class PdaPointTask extends AbstractTask {
// 根据传来的类型去对任务进行操作
if (status.equals(TaskStatus.EXECUTING)) {
// 更新明细状态
this.executing(taskObj);
taskObj.setTask_status(TaskStatus.EXECUTING.getCode());
taskObj.setRemark("执行中");
taskService.updateById(taskObj);
@@ -147,7 +148,7 @@ public class PdaPointTask extends AbstractTask {
if (Integer.parseInt(taskObj.getTask_status()) > Integer.parseInt(TaskStatus.CREATE.getCode())) {
throw new BadRequestException("只能取消生成中的任务!");
}
this.cancelTask(taskObj);
this.cancelTask(taskObj);
}
@Override
@@ -222,4 +223,19 @@ public class PdaPointTask extends AbstractTask {
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
taskService.updateById(taskObj);
}
private void executing(SchBaseTask taskObj) {
// 更新起点
iSchBasePointService.update(
new UpdateWrapper<SchBasePoint>().lambda()
.eq(SchBasePoint::getPoint_code, taskObj.getPoint_code1())
.set(SchBasePoint::getIng_task_code, taskObj.getTask_id())
);
// 更新终点
iSchBasePointService.update(
new UpdateWrapper<SchBasePoint>().lambda()
.eq(SchBasePoint::getPoint_code, taskObj.getPoint_code2())
.set(SchBasePoint::getIng_task_code, taskObj.getTask_id())
);
}
}

View File

@@ -54,4 +54,13 @@ public interface MdPbGroupplateMapper extends BaseMapper<GroupPlate> {
* @return List<JSONObject>
*/
List<JSONObject> pdaQueryGeneralGroupInfo(@Param("param") JSONObject whereJson);
/**
* 手持根据点位载具查询
* @param whereJson {
* storagevehicle_code: 载具编码
* }
* @return List<JSONObject>
*/
List<JSONObject> pdaGetPointDtl(@Param("param") JSONObject whereJson);
}

View File

@@ -105,4 +105,28 @@
ORDER BY late.create_time Desc
</select>
<select id="pdaGetPointDtl" resultType="com.alibaba.fastjson.JSONObject">
SELECT
late.*,
mater.material_code,
mater.material_name
FROM
md_pb_groupplate late
LEFT JOIN md_me_materialbase mater ON mater.material_id = late.material_id
LEFT JOIN sch_base_point point ON point.vehicle_code = late.storagevehicle_code
<where>
late.status != '2'
<if test="param.point_code != null and param.point_code != ''">
AND
point.point_code = #{param.point_code}
</if>
<if test="param.storagevehicle_code != null and param.storagevehicle_code != ''">
AND
late.storagevehicle_code = #{param.storagevehicle_code}
</if>
</where>
</select>
</mapper>