From a94b7872f6a8acf24bd34525a6f412226af3816b Mon Sep 17 00:00:00 2001 From: psh Date: Mon, 11 Dec 2023 16:06:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E6=8C=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nl/wms/pda/controller/PdaController.java | 54 +++++++++++ .../org/nl/wms/pda/service/PdaService.java | 17 ++++ .../pda/service/dao/dto/BlendingMoveDto.java | 21 +++++ .../pda/service/dao/dto/CommonQueryDto.java | 13 +++ .../pda/service/dao/dto/ForcedRestingDto.java | 14 +++ .../pda/service/dao/dto/ManualGroupDto.java | 19 ++++ .../service/dao/dto/ManualResidueInDto.java | 18 ++++ .../pda/service/dao/dto/ManualSortingDto.java | 14 +++ .../wms/pda/service/dao/dto/PressMoveDto.java | 25 ++++++ .../wms/pda/service/dao/dto/ShelfSaveDto.java | 17 ++++ .../service/dao/dto/VehicleBindingDto.java | 14 +++ .../wms/pda/service/dao/mapper/PdaMapper.java | 15 ++++ .../wms/pda/service/dao/mapper/PdaMapper.xml | 5 ++ .../wms/pda/service/dao/vo/PdaResponseVo.java | 20 +++++ .../wms/pda/service/impl/PdaServiceImpl.java | 89 +++++++++++++++++++ 15 files changed, 355 insertions(+) create mode 100644 lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/controller/PdaController.java create mode 100644 lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/PdaService.java create mode 100644 lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/BlendingMoveDto.java create mode 100644 lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/CommonQueryDto.java create mode 100644 lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/ForcedRestingDto.java create mode 100644 lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/ManualGroupDto.java create mode 100644 lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/ManualResidueInDto.java create mode 100644 lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/ManualSortingDto.java create mode 100644 lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/PressMoveDto.java create mode 100644 lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/ShelfSaveDto.java create mode 100644 lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/VehicleBindingDto.java create mode 100644 lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/mapper/PdaMapper.java create mode 100644 lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/mapper/PdaMapper.xml create mode 100644 lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/vo/PdaResponseVo.java create mode 100644 lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/controller/PdaController.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/controller/PdaController.java new file mode 100644 index 0000000..532ecf8 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/controller/PdaController.java @@ -0,0 +1,54 @@ +package org.nl.wms.pda.controller; + +import cn.dev33.satoken.annotation.SaIgnore; +import com.alibaba.fastjson.JSONObject; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.nl.common.logging.annotation.Log; +import org.nl.wms.pda.service.PdaService; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +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; + +/** + * @Author: lyd + * @Description: 手持接口 + * @Date: 2023/8/1 + */ +@Slf4j +@RestController +@Api(tags = "手持接口") +@RequestMapping("/api/pda") +@SaIgnore +public class PdaController { + + private PdaService pdaService; + + + @PostMapping("/outStruct/outSave") + @Log("涂板线下料") + @ApiOperation("涂板线下料") + public ResponseEntity outSave(@RequestBody JSONObject param){ + return new ResponseEntity<>(pdaService.outSave(param), HttpStatus.OK); + } + + @PostMapping("/cleanVehicle") + @Log("清空物料信息") + @ApiOperation("清空物料信息") + public ResponseEntity cleanVehicle(@RequestBody JSONObject param){ + return new ResponseEntity<>(pdaService.cleanVehicle(param), HttpStatus.OK); + } + + @PostMapping("/callingMaterialTask") + @Log("包片机叫料") + @ApiOperation("包片机叫料") + public ResponseEntity callingMaterialTask(@RequestBody JSONObject param){ + return new ResponseEntity<>(pdaService.callingMaterialTask(param), HttpStatus.OK); + } + +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/PdaService.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/PdaService.java new file mode 100644 index 0000000..dbe9315 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/PdaService.java @@ -0,0 +1,17 @@ +package org.nl.wms.pda.service; + +import com.alibaba.fastjson.JSONObject; +import org.nl.wms.pda.service.dao.vo.PdaResponseVo; + +/** + * @Author: lyd + * @Description: + * @Date: 2023/8/1 + */ +public interface PdaService { + PdaResponseVo outSave(JSONObject param); + + PdaResponseVo cleanVehicle(JSONObject param); + + PdaResponseVo callingMaterialTask(JSONObject param); +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/BlendingMoveDto.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/BlendingMoveDto.java new file mode 100644 index 0000000..cbc53ce --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/BlendingMoveDto.java @@ -0,0 +1,21 @@ +package org.nl.wms.pda.service.dao.dto; + +import lombok.Data; + +/** + * @Author: lyd + * @Description: 混碾搬运参数 + * @Date: 2023/9/21 + */ +@Data +public class BlendingMoveDto { + private String vehicle_code; + /** + * 混碾对接位 + */ + private String start_point_code; + /** + * 压机号,需要自行寻找点位 + */ +// private String end_point_code; +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/CommonQueryDto.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/CommonQueryDto.java new file mode 100644 index 0000000..1c6c2d5 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/CommonQueryDto.java @@ -0,0 +1,13 @@ +package org.nl.wms.pda.service.dao.dto; + +import lombok.Data; + +/** + * @Author: lyd + * @Description: 通用实体 + * @Date: 2023/10/16 + */ +@Data +public class CommonQueryDto { + private String material_code; +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/ForcedRestingDto.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/ForcedRestingDto.java new file mode 100644 index 0000000..987a165 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/ForcedRestingDto.java @@ -0,0 +1,14 @@ +package org.nl.wms.pda.service.dao.dto; + +import lombok.Data; + +/** + * @Author: lyd + * @Description: 强制静置实体 + * @Date: 2023/9/25 + */ +@Data +public class ForcedRestingDto { + private Integer stand_time; // 静置时间 + private String group_id; // 组盘标识 +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/ManualGroupDto.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/ManualGroupDto.java new file mode 100644 index 0000000..22d7f0d --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/ManualGroupDto.java @@ -0,0 +1,19 @@ +package org.nl.wms.pda.service.dao.dto; + +import lombok.Data; + +import java.math.BigDecimal; + +/** + * @Author: lyd + * @Description: 人工组盘 + * @Date: 2023/9/18 + */ +@Data +public class ManualGroupDto { + private String vehicle_code; + private String vehicle_type; + private String point_code; + private String order_code; // 不需要 + private BigDecimal material_weight; +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/ManualResidueInDto.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/ManualResidueInDto.java new file mode 100644 index 0000000..440c929 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/ManualResidueInDto.java @@ -0,0 +1,18 @@ +package org.nl.wms.pda.service.dao.dto; + +import lombok.Data; + +/** + * @Author: lyd + * @Description: 剩料回库参数 + * @Date: 2023/9/28 + */ +@Data +public class ManualResidueInDto { + private String vehicle_code; + private String qty; + /** + * 剩余数量 + */ + private String surplus_quantity; +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/ManualSortingDto.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/ManualSortingDto.java new file mode 100644 index 0000000..50d07ae --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/ManualSortingDto.java @@ -0,0 +1,14 @@ +package org.nl.wms.pda.service.dao.dto; + +import lombok.Data; + +/** + * @Author: lyd + * @Description: 人工排产Dto + * @Date: 2023/9/28 + */ +@Data +public class ManualSortingDto { + private String workorder_code; + private String username; // 用户 +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/PressMoveDto.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/PressMoveDto.java new file mode 100644 index 0000000..50670af --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/PressMoveDto.java @@ -0,0 +1,25 @@ +package org.nl.wms.pda.service.dao.dto; + +import lombok.Data; + +/** + * @Author: lyd + * @Description: 压机搬运dto + * @Date: 2023/10/16 + */ +@Data +public class PressMoveDto { + /** + * 设备编码:对接位 + */ + private String device_code; + /** + * 载具编码 + */ + private String vehicle_code; + /** + * 数量 + */ + private String qty; + +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/ShelfSaveDto.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/ShelfSaveDto.java new file mode 100644 index 0000000..6c479ee --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/ShelfSaveDto.java @@ -0,0 +1,17 @@ +package org.nl.wms.pda.service.dao.dto; + +import lombok.Data; + +/** + * @Author: lyd + * @Description: 货架组盘信息dto + * @Date: 2023/10/16 + */ +@Data +public class ShelfSaveDto { + private String point_code; + private String point_status; + private String vehicle_code; + private String material_qty; + private String material_id; +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/VehicleBindingDto.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/VehicleBindingDto.java new file mode 100644 index 0000000..cd9f55b --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/VehicleBindingDto.java @@ -0,0 +1,14 @@ +package org.nl.wms.pda.service.dao.dto; + +import lombok.Data; + +/** + * @Author: lyd + * @Description: 载具绑定 + * @Date: 2023/10/7 + */ +@Data +public class VehicleBindingDto { + private String origin_vehicle_code; + private String target_vehicle_code; +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/mapper/PdaMapper.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/mapper/PdaMapper.java new file mode 100644 index 0000000..e3271dd --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/mapper/PdaMapper.java @@ -0,0 +1,15 @@ +package org.nl.wms.pda.service.dao.mapper; + +import org.nl.wms.pda.service.dao.dto.CommonQueryDto; +import org.nl.wms.sch.point.service.dao.SchBasePoint; + +import java.util.List; + +/** + * @Author: lyd + * @Description: 手持mapper接口 + * @Date: 2023/8/1 + */ +public interface PdaMapper { + +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/mapper/PdaMapper.xml b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/mapper/PdaMapper.xml new file mode 100644 index 0000000..0ea35f1 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/mapper/PdaMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/vo/PdaResponseVo.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/vo/PdaResponseVo.java new file mode 100644 index 0000000..c2757e9 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/vo/PdaResponseVo.java @@ -0,0 +1,20 @@ +package org.nl.wms.pda.service.dao.vo; + +import lombok.Data; + +/** + * @Author: lyd + * @Description: 手持返回 + * @Date: 2023/8/3 + */ +@Data +public class PdaResponseVo { + // 先提供一个message + private String message; + + public static PdaResponseVo pdaResultOk(String message) { + PdaResponseVo vo = new PdaResponseVo(); + vo.setMessage(message); + return vo; + } +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java new file mode 100644 index 0000000..83c12a1 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java @@ -0,0 +1,89 @@ +package org.nl.wms.pda.service.impl; + +import cn.hutool.core.date.DateUtil; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import lombok.extern.slf4j.Slf4j; +import org.nl.common.exception.BadRequestException; +import org.nl.wms.database.material.service.IMdBaseMaterialService; +import org.nl.wms.ext.service.AcsToWmsService; +import org.nl.wms.pda.service.PdaService; +import org.nl.wms.pda.service.dao.mapper.PdaMapper; +import org.nl.wms.pda.service.dao.vo.PdaResponseVo; +import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService; +import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup; +import org.nl.wms.sch.point.service.ISchBasePointService; +import org.nl.wms.sch.point.service.dao.SchBasePoint; +import org.nl.wms.sch.task.service.ISchBaseTaskService; +import org.nl.wms.sch.task_manage.GeneralDefinition; +import org.nl.wms.sch.task_manage.enums.GroupBindMaterialStatusEnum; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @Author: lyd + * @Description: 实现类 + * @Date: 2023/8/1 + */ +@Slf4j +@Service +public class PdaServiceImpl implements PdaService { + @Autowired + private PdaMapper pdaMapper; + @Autowired + private ISchBasePointService pointService; + @Autowired + private IMdBaseMaterialService materialService; + @Autowired + private ISchBaseVehiclematerialgroupService vehiclematerialgroupService; + @Autowired + private ISchBaseTaskService taskService; + @Autowired + private AcsToWmsService acsToWmsService; + + @Override + public PdaResponseVo outSave(JSONObject param) { + param.put("device_code",param.getString("point_code")); + if(!param.getString("point_code").startsWith("TBX")){ + throw new BadRequestException("非涂板线禁止叫料!"); + } + param.put("request_medthod_code","MJXLTask"); + param.put("request_medthod_name","涂板线满架下料"); + acsToWmsService.acsApply(param); + return PdaResponseVo.pdaResultOk("涂板线满架下料请求成功"); + } + @Override + public PdaResponseVo cleanVehicle(JSONObject param) { + //根据载具编码寻找点位,并且将它更新掉 + String vehicleCode=param.getString("vehicle_code"); + SchBaseVehiclematerialgroup groupEntity = vehiclematerialgroupService.getOne(new LambdaQueryWrapper() + .eq(SchBaseVehiclematerialgroup::getVehicle_code, vehicleCode) + .eq(SchBaseVehiclematerialgroup::getGroup_bind_material_status, + GroupBindMaterialStatusEnum.BOUND.getValue())); + groupEntity.setGroup_bind_material_status(GroupBindMaterialStatusEnum.UNBOUND.getValue()); + groupEntity.setUpdate_id(GeneralDefinition.ACS_ID); + groupEntity.setUpdate_name(GeneralDefinition.ACS_NAME); + groupEntity.setUpdate_time(DateUtil.now()); + vehiclematerialgroupService.save(groupEntity); + SchBasePoint pointObj=pointService.getById(groupEntity.getPoint_code()); + if(pointObj.getVehicle_code().contains(",")){ + vehicleCode+=','; + } + pointObj.setVehicle_code(pointObj.getVehicle_code().replace(vehicleCode,"")); + pointObj.setVehicle_qty(pointObj.getVehicle_qty()-1); + pointService.update(pointObj); + //清空组盘表的信息 + return PdaResponseVo.pdaResultOk("呼叫物料请求成功"); + } + @Override + public PdaResponseVo callingMaterialTask(JSONObject param) { + if(!param.getString("point_code").startsWith("BP")){ + throw new BadRequestException("非包片机禁止叫料!"); + } + param.put("device_code",param.getString("point_code")); + param.put("request_medthod_code","BPSLTask"); + param.put("request_medthod_name","包片上料"); + acsToWmsService.acsApply(param); + return PdaResponseVo.pdaResultOk("呼叫物料请求成功"); + } +}