From cf34501387c45db1fedb0e1e88c3b89576c88920 Mon Sep 17 00:00:00 2001 From: Comair <1464848666@qq.com> Date: Mon, 21 Apr 2025 10:06:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8B=8F=E5=AE=A0=E6=96=B0=E5=A2=9E=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shkj-admin/pom.xml | 2 +- .../src/main/resources/application-test.yml | 4 +- .../src/main/resources/application-yun.yml | 2 +- shkj-admin/src/main/resources/application.yml | 2 +- shkj-admin/src/main/resources/logback.xml | 2 +- .../java/com/shkj/wcs/bo/WcsRequestBo.java | 23 +++++ .../controller/busin/AgvTaskContorller.java | 35 ++++++++ .../controller/busin/WcsTaskController.java | 85 +++++++++++++++++++ .../{wms => wcs}/domain/BusinDataTask.java | 11 +-- .../mapper/BusinDataTaskMapper.java | 4 +- .../java/com/shkj/wcs/plc/PlcEventTask.java | 6 +- .../wcs/service/IBusinDataTaskService.java | 12 +++ .../impl/BusinDataTaskServiceImpl.java | 10 +++ .../java/com/shkj/wcs/third/rcs/RCSUtil.java | 14 +-- .../workbinWcs/dto/WcsCreateTaskBody.java | 63 ++++++++++++++ .../workbinWcs/dto/WcsCreateTaskDto.java | 21 +++++ .../workbinWcs/dto/WcsCreateTaskHeader.java | 14 +++ .../workbinWcs/enums/WcsCallbackTaskEnum.java | 24 ++++++ .../com/shkj/wcs/vo/QueryAreaStatusVo.java | 15 ++++ .../java/com/shkj/wcs/vo/WcsResponseVo.java | 60 +++++++++++++ .../shkj/wms/mapper/BusinPickupMapper.java | 2 - .../java/com/shkj/wms/vo/BusinDataTaskVo.java | 3 - .../{wms => wcs}/BusinDataTaskMapper.xml | 7 +- 23 files changed, 377 insertions(+), 44 deletions(-) create mode 100644 shkj-wms/src/main/java/com/shkj/wcs/bo/WcsRequestBo.java create mode 100644 shkj-wms/src/main/java/com/shkj/wcs/controller/busin/AgvTaskContorller.java create mode 100644 shkj-wms/src/main/java/com/shkj/wcs/controller/busin/WcsTaskController.java rename shkj-wms/src/main/java/com/shkj/{wms => wcs}/domain/BusinDataTask.java (91%) rename shkj-wms/src/main/java/com/shkj/{wms => wcs}/mapper/BusinDataTaskMapper.java (96%) create mode 100644 shkj-wms/src/main/java/com/shkj/wcs/service/IBusinDataTaskService.java create mode 100644 shkj-wms/src/main/java/com/shkj/wcs/service/impl/BusinDataTaskServiceImpl.java create mode 100644 shkj-wms/src/main/java/com/shkj/wcs/third/workbinWcs/dto/WcsCreateTaskBody.java create mode 100644 shkj-wms/src/main/java/com/shkj/wcs/third/workbinWcs/dto/WcsCreateTaskDto.java create mode 100644 shkj-wms/src/main/java/com/shkj/wcs/third/workbinWcs/dto/WcsCreateTaskHeader.java create mode 100644 shkj-wms/src/main/java/com/shkj/wcs/third/workbinWcs/enums/WcsCallbackTaskEnum.java create mode 100644 shkj-wms/src/main/java/com/shkj/wcs/vo/QueryAreaStatusVo.java create mode 100644 shkj-wms/src/main/java/com/shkj/wcs/vo/WcsResponseVo.java rename shkj-wms/src/main/resources/mapper/{wms => wcs}/BusinDataTaskMapper.xml (95%) diff --git a/shkj-admin/pom.xml b/shkj-admin/pom.xml index 9269bb6..fb520ba 100644 --- a/shkj-admin/pom.xml +++ b/shkj-admin/pom.xml @@ -121,7 +121,7 @@ - kmv2-admin + sc-admin diff --git a/shkj-admin/src/main/resources/application-test.yml b/shkj-admin/src/main/resources/application-test.yml index b42d64c..4f7abd0 100644 --- a/shkj-admin/src/main/resources/application-test.yml +++ b/shkj-admin/src/main/resources/application-test.yml @@ -12,9 +12,9 @@ spring: druid: # 主库数据源 master: - url: jdbc:mysql://127.0.0.1:3306/mjk_wcs_2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + url: jdbc:mysql://127.0.0.1:3306/mjk_wms_wcs?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 username: root - password: Sh@2024_ + password: root # 从库数据源 slave: # 从数据源开关/默认关闭 diff --git a/shkj-admin/src/main/resources/application-yun.yml b/shkj-admin/src/main/resources/application-yun.yml index 0ce7b83..37aee8a 100644 --- a/shkj-admin/src/main/resources/application-yun.yml +++ b/shkj-admin/src/main/resources/application-yun.yml @@ -12,7 +12,7 @@ spring: druid: # 主库数据源 master: - url: jdbc:mysql://120.77.94.227:3306/mjk_wcs_2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + url: jdbc:mysql://120.77.94.227:3306/sc-wcs?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 username: root password: CTlTwKgIrRVTsEHqxxx # 从库数据源 diff --git a/shkj-admin/src/main/resources/application.yml b/shkj-admin/src/main/resources/application.yml index 39c840e..fc83ead 100644 --- a/shkj-admin/src/main/resources/application.yml +++ b/shkj-admin/src/main/resources/application.yml @@ -45,7 +45,7 @@ spring: # 国际化资源文件路径 basename: i18n/messages profiles: - active: yun + active: pro146 # 文件上传 servlet: multipart: diff --git a/shkj-admin/src/main/resources/logback.xml b/shkj-admin/src/main/resources/logback.xml index e4a1813..5d77252 100644 --- a/shkj-admin/src/main/resources/logback.xml +++ b/shkj-admin/src/main/resources/logback.xml @@ -8,7 +8,7 @@ logback - + diff --git a/shkj-wms/src/main/java/com/shkj/wcs/bo/WcsRequestBo.java b/shkj-wms/src/main/java/com/shkj/wcs/bo/WcsRequestBo.java new file mode 100644 index 0000000..221db99 --- /dev/null +++ b/shkj-wms/src/main/java/com/shkj/wcs/bo/WcsRequestBo.java @@ -0,0 +1,23 @@ +package com.shkj.wcs.bo; + +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.List; + +@Data +@NoArgsConstructor +@Accessors(chain = true) +public class WcsRequestBo implements Serializable { + + private Header header; + private List body; + + @Data + public static class Header { + private String businessType; + } +} + diff --git a/shkj-wms/src/main/java/com/shkj/wcs/controller/busin/AgvTaskContorller.java b/shkj-wms/src/main/java/com/shkj/wcs/controller/busin/AgvTaskContorller.java new file mode 100644 index 0000000..ec79383 --- /dev/null +++ b/shkj-wms/src/main/java/com/shkj/wcs/controller/busin/AgvTaskContorller.java @@ -0,0 +1,35 @@ +package com.shkj.wcs.controller.busin; + +import com.shkj.common.annotation.Log; +import com.shkj.common.annotation.RepeatSubmit; +import com.shkj.common.enums.BusinessType; +import com.shkj.wcs.bo.WcsRequestBo; +import com.shkj.wcs.vo.QueryAreaStatusVo; +import com.shkj.wcs.vo.WcsResponseVo; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.ArrayList; +import java.util.List; + +@RequiredArgsConstructor(onConstructor_ =@Autowired) +@RestController +@RequestMapping("/api") +public class AgvTaskContorller { + + + /** + * 执行task + */ + @Log(title = "查询每个库区状态",businessType = BusinessType.UPDATE) + @PostMapping("/toKjWcs/queryAreaStatus") + @RepeatSubmit + public WcsResponseVo queryAreaStatus(WcsRequestBo wcsRequestBo){ + // 请求agv接口... + List areaStatusVos = new ArrayList<>(); + return WcsResponseVo.success(areaStatusVos); + } +} diff --git a/shkj-wms/src/main/java/com/shkj/wcs/controller/busin/WcsTaskController.java b/shkj-wms/src/main/java/com/shkj/wcs/controller/busin/WcsTaskController.java new file mode 100644 index 0000000..c282da1 --- /dev/null +++ b/shkj-wms/src/main/java/com/shkj/wcs/controller/busin/WcsTaskController.java @@ -0,0 +1,85 @@ +package com.shkj.wcs.controller.busin; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.shkj.common.annotation.Log; +import com.shkj.common.annotation.RepeatSubmit; +import com.shkj.common.enums.BusinessType; +import com.shkj.common.utils.DateUtils; +import com.shkj.wcs.service.IBusinDataTaskService; +import com.shkj.wcs.third.workbinWcs.dto.WcsCreateTaskBody; +import com.shkj.wcs.third.workbinWcs.dto.WcsCreateTaskDto; +import com.shkj.wcs.vo.WcsResponseVo; +import com.shkj.wcs.domain.BusinDataTask; +import com.shkj.wms.service.IBusinTaskService; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +@RequiredArgsConstructor(onConstructor_ =@Autowired) +@RestController +@RequestMapping("/api") +public class WcsTaskController { + + @Autowired + private IBusinDataTaskService iBusinDataTaskService; + + + /** + * wz-wcs任务下发 + */ + @Log(title = "wz-wcs任务下发",businessType = BusinessType.UPDATE) + @PostMapping("/toKjWcs/commonApi") + @RepeatSubmit + public WcsResponseVo commonApi(WcsCreateTaskDto bo){ + if(bo != null){ + List body = bo.getBody(); + if(!body.isEmpty()){ + for(WcsCreateTaskBody by : body){ + String taskId = by.getTaskId(); + String trayCode = by.getTrayCode(); + String taskType = by.getTaskType(); + String fromBinCode = by.getFromBinCode(); + String toBinCode = by.getToBinCode(); + String dataChange = by.getDataChange(); + String priority = by.getPriority(); + LambdaQueryWrapper lqwDataTask = new LambdaQueryWrapper() + .eq(BusinDataTask::getContainerId,trayCode) + .in(BusinDataTask::getTaskStatus,"1","2"); + BusinDataTask one = iBusinDataTaskService.getOne(lqwDataTask); + if(dataChange.equals("1")){ + if (one != null){ + return WcsResponseVo.error(500,"该托盘"+trayCode+"存在未完成的任务"); + } + BusinDataTask businDataTask = new BusinDataTask(); + businDataTask.setTaskCode(taskId); + businDataTask.setTaskType(taskType); + businDataTask.setContainerId(Long.valueOf(trayCode)); + businDataTask.setFromSide(fromBinCode); + businDataTask.setToSide(toBinCode); + businDataTask.setCreateTime(DateUtils.getNowDate()); + businDataTask.setPriority(priority); + boolean save = iBusinDataTaskService.save(businDataTask); + if(save){ + //调用下游接口下任务 + + } + }else if(dataChange.equals("2")){ + if (one == null){ + return WcsResponseVo.error(500,"未查询到该托盘"+trayCode+"存在未完成的任务"); + } + one.setTaskStatus("6"); + iBusinDataTaskService.updateById(one); + //推送给下游 + + } + } + } + + } + return WcsResponseVo.success(); + } +} diff --git a/shkj-wms/src/main/java/com/shkj/wms/domain/BusinDataTask.java b/shkj-wms/src/main/java/com/shkj/wcs/domain/BusinDataTask.java similarity index 91% rename from shkj-wms/src/main/java/com/shkj/wms/domain/BusinDataTask.java rename to shkj-wms/src/main/java/com/shkj/wcs/domain/BusinDataTask.java index 1947903..9616bac 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/domain/BusinDataTask.java +++ b/shkj-wms/src/main/java/com/shkj/wcs/domain/BusinDataTask.java @@ -1,4 +1,4 @@ -package com.shkj.wms.domain; +package com.shkj.wcs.domain; import java.io.Serializable; import java.util.Date; @@ -11,8 +11,6 @@ import com.shkj.common.annotation.Excel; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; /** * 任务管理对象 busin_task @@ -51,13 +49,6 @@ public class BusinDataTask implements Serializable { @Excel(name = " 任务路径") private String taskPath; - /** 批次信息 以天为单位 日期+流水? */ - @Excel(name = "批次信息 以天为单位 日期+流水?") - private String batch; - - /** 是否是紧急任务 */ - @Excel(name = "是否是紧急任务") - private String isUrgent; /** 是否是置顶 */ @Excel(name = "是否是置顶") diff --git a/shkj-wms/src/main/java/com/shkj/wms/mapper/BusinDataTaskMapper.java b/shkj-wms/src/main/java/com/shkj/wcs/mapper/BusinDataTaskMapper.java similarity index 96% rename from shkj-wms/src/main/java/com/shkj/wms/mapper/BusinDataTaskMapper.java rename to shkj-wms/src/main/java/com/shkj/wcs/mapper/BusinDataTaskMapper.java index fa53c2b..1ab88f4 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/mapper/BusinDataTaskMapper.java +++ b/shkj-wms/src/main/java/com/shkj/wcs/mapper/BusinDataTaskMapper.java @@ -1,8 +1,8 @@ -package com.shkj.wms.mapper; +package com.shkj.wcs.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.shkj.wms.bo.BusinTaskQueryBo; -import com.shkj.wms.domain.BusinDataTask; +import com.shkj.wcs.domain.BusinDataTask; import com.shkj.wms.vo.BusinDataTaskVo; import java.util.Date; diff --git a/shkj-wms/src/main/java/com/shkj/wcs/plc/PlcEventTask.java b/shkj-wms/src/main/java/com/shkj/wcs/plc/PlcEventTask.java index 16c7773..a9279f9 100644 --- a/shkj-wms/src/main/java/com/shkj/wcs/plc/PlcEventTask.java +++ b/shkj-wms/src/main/java/com/shkj/wcs/plc/PlcEventTask.java @@ -212,10 +212,10 @@ public class PlcEventTask { if (pointType.equals("99")) { //log.info("地址:"+address+" 报警内容:"+devpName); if (pointMap.containsKey(address) && Boolean.valueOf((pointMap.get(address).toString()))) { - String message = MessageUtils.message(devpName); - log.info("报警内容转多语言:"+message); + //String message = MessageUtils.message(devpName); + //log.info("报警内容转多语言:"+message); businPlcException.setPlcPoint(address); - businPlcException.setExecMsg(message); + businPlcException.setExecMsg(devpName); businPlcException.setExecDate(DateUtils.getTime()); businPlcException.setExecDev(devType); execList.add(businPlcException); diff --git a/shkj-wms/src/main/java/com/shkj/wcs/service/IBusinDataTaskService.java b/shkj-wms/src/main/java/com/shkj/wcs/service/IBusinDataTaskService.java new file mode 100644 index 0000000..b609e62 --- /dev/null +++ b/shkj-wms/src/main/java/com/shkj/wcs/service/IBusinDataTaskService.java @@ -0,0 +1,12 @@ +package com.shkj.wcs.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.shkj.wcs.domain.BusinDataTask; + +/** + * @author Comair + * @date 2025年04月18日 9:11 + */ +public interface IBusinDataTaskService extends IService { + +} diff --git a/shkj-wms/src/main/java/com/shkj/wcs/service/impl/BusinDataTaskServiceImpl.java b/shkj-wms/src/main/java/com/shkj/wcs/service/impl/BusinDataTaskServiceImpl.java new file mode 100644 index 0000000..9936618 --- /dev/null +++ b/shkj-wms/src/main/java/com/shkj/wcs/service/impl/BusinDataTaskServiceImpl.java @@ -0,0 +1,10 @@ +package com.shkj.wcs.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.shkj.wcs.domain.BusinDataTask; +import com.shkj.wcs.mapper.BusinDataTaskMapper; +import com.shkj.wcs.service.IBusinDataTaskService; +import com.shkj.wms.service.IBusinTaskService; + +public class BusinDataTaskServiceImpl extends ServiceImpl implements IBusinDataTaskService { +} diff --git a/shkj-wms/src/main/java/com/shkj/wcs/third/rcs/RCSUtil.java b/shkj-wms/src/main/java/com/shkj/wcs/third/rcs/RCSUtil.java index b9fa23b..bc4f4c2 100644 --- a/shkj-wms/src/main/java/com/shkj/wcs/third/rcs/RCSUtil.java +++ b/shkj-wms/src/main/java/com/shkj/wcs/third/rcs/RCSUtil.java @@ -1,12 +1,9 @@ package com.shkj.wcs.third.rcs; -import cn.hutool.core.bean.BeanUtil; import cn.hutool.http.HttpRequest; -import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.shkj.common.constant.RedisConstant; import com.shkj.common.core.domain.Result; -import com.shkj.common.utils.DateUtils; import com.shkj.plc.sdk.device.PLCReadAndWrite; import com.shkj.plc.sdk.device.PlcOperate; import com.shkj.system.service.ISysParameterService; @@ -22,15 +19,7 @@ import com.shkj.wcs.third.rcs.dto.RcsCreateTaskDto; import com.shkj.wcs.third.rcs.dto.RcsIdList; import com.shkj.wcs.third.rcs.dto.RcsThirdResult; import com.shkj.wms.bo.AGVMoveBo; -import com.shkj.wms.bo.BusinDataTaskDatailAddBo; -import com.shkj.wms.bo.BusinTaskAddBo; -import com.shkj.wms.bo.BusinTaskQueryBo; -import com.shkj.wms.constants.ParameterConstants; -import com.shkj.wms.domain.BusinDataTask; -import com.shkj.wms.domain.BusinDataTaskDetail; -import com.shkj.wms.mapper.BusinDataTaskMapper; -import com.shkj.wms.utils.JsonUtil; -import com.shkj.wms.vo.BusinDataTaskVo; +import com.shkj.wcs.mapper.BusinDataTaskMapper; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -39,7 +28,6 @@ import org.springframework.stereotype.Component; import javax.annotation.Resource; import java.util.*; -import java.util.stream.Collectors; /** * AGV 接口文档 diff --git a/shkj-wms/src/main/java/com/shkj/wcs/third/workbinWcs/dto/WcsCreateTaskBody.java b/shkj-wms/src/main/java/com/shkj/wcs/third/workbinWcs/dto/WcsCreateTaskBody.java new file mode 100644 index 0000000..30e9294 --- /dev/null +++ b/shkj-wms/src/main/java/com/shkj/wcs/third/workbinWcs/dto/WcsCreateTaskBody.java @@ -0,0 +1,63 @@ +package com.shkj.wcs.third.workbinWcs.dto; + +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +@Data +@NoArgsConstructor +@Accessors(chain = true) +public class WcsCreateTaskBody implements Serializable { + /** + * 任务号(唯一编号) + */ + @NotBlank(message = "任务id不得为空") + private String taskId; + + /** + * 托盘码 + */ + @NotBlank(message = "托盘码不得为空") + private String trayCode; + + + /** + * 任务类型 + * 出库:1 + * 入库:2 + * 同层同巷道移库:3 + */ + @NotBlank(message = "任务类型不得为空") + private String taskType; + + /** + * 任务起点(线体站台,立库终点) + */ + @NotBlank(message = "任务起点不得为空") + private String fromBinCode; + + /** + * 任务终点 + */ + @NotBlank(message = "任务终点不得为空") + private String toBinCode; + + /** + * 任务下发时间 包括毫秒 + */ + private String createDt; + + /** + * 新增:1 + */ + @NotBlank(message = "数据类型不得为空") + private String dataChange; + + /** + * 优先级 + */ + private String priority; +} diff --git a/shkj-wms/src/main/java/com/shkj/wcs/third/workbinWcs/dto/WcsCreateTaskDto.java b/shkj-wms/src/main/java/com/shkj/wcs/third/workbinWcs/dto/WcsCreateTaskDto.java new file mode 100644 index 0000000..27af73c --- /dev/null +++ b/shkj-wms/src/main/java/com/shkj/wcs/third/workbinWcs/dto/WcsCreateTaskDto.java @@ -0,0 +1,21 @@ +package com.shkj.wcs.third.workbinWcs.dto; + +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.List; + +/** + * 任务下发实体类 + */ +@Data +@NoArgsConstructor +@Accessors(chain = true) +public class WcsCreateTaskDto implements Serializable { + + private WcsCreateTaskHeader header; + private List body; +} + diff --git a/shkj-wms/src/main/java/com/shkj/wcs/third/workbinWcs/dto/WcsCreateTaskHeader.java b/shkj-wms/src/main/java/com/shkj/wcs/third/workbinWcs/dto/WcsCreateTaskHeader.java new file mode 100644 index 0000000..d09d93b --- /dev/null +++ b/shkj-wms/src/main/java/com/shkj/wcs/third/workbinWcs/dto/WcsCreateTaskHeader.java @@ -0,0 +1,14 @@ +package com.shkj.wcs.third.workbinWcs.dto; + +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +@Data +@NoArgsConstructor +@Accessors(chain = true) +public class WcsCreateTaskHeader implements Serializable { + private String businessType = "commonTask"; +} diff --git a/shkj-wms/src/main/java/com/shkj/wcs/third/workbinWcs/enums/WcsCallbackTaskEnum.java b/shkj-wms/src/main/java/com/shkj/wcs/third/workbinWcs/enums/WcsCallbackTaskEnum.java new file mode 100644 index 0000000..f8c9e44 --- /dev/null +++ b/shkj-wms/src/main/java/com/shkj/wcs/third/workbinWcs/enums/WcsCallbackTaskEnum.java @@ -0,0 +1,24 @@ +package com.shkj.wcs.third.workbinWcs.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 任务状态枚举 + * + * @author zjx + * @date 2024/09/05 + */ +@Getter +@AllArgsConstructor +public enum WcsCallbackTaskEnum { + + wait("1", "等待"), + exec("2", "进行中"), + finish("3", "完成"), + fail("4", "失败"), + ; + + private String value; + private String desc; +} diff --git a/shkj-wms/src/main/java/com/shkj/wcs/vo/QueryAreaStatusVo.java b/shkj-wms/src/main/java/com/shkj/wcs/vo/QueryAreaStatusVo.java new file mode 100644 index 0000000..128447e --- /dev/null +++ b/shkj-wms/src/main/java/com/shkj/wcs/vo/QueryAreaStatusVo.java @@ -0,0 +1,15 @@ +package com.shkj.wcs.vo; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class QueryAreaStatusVo implements Serializable { + private static final long serialVersionUID = 1L; + //库区标识 + private String areaInLocation; + + //状态 + private Integer status; +} diff --git a/shkj-wms/src/main/java/com/shkj/wcs/vo/WcsResponseVo.java b/shkj-wms/src/main/java/com/shkj/wcs/vo/WcsResponseVo.java new file mode 100644 index 0000000..fa64ff3 --- /dev/null +++ b/shkj-wms/src/main/java/com/shkj/wcs/vo/WcsResponseVo.java @@ -0,0 +1,60 @@ +package com.shkj.wcs.vo; + +import lombok.Data; +import org.apache.poi.ss.formula.functions.T; + +import java.util.Collections; +import java.util.List; + +@Data +public class WcsResponseVo { + private ResponseHeader header; + private List body; + + @Data + public static class ResponseHeader { + private Integer msgCode; + private String message; + } + + // 成功 + public static WcsResponseVo success(List data) { + WcsResponseVo response = new WcsResponseVo<>(); + response.setHeader(createSuccessHeader()); + response.setBody(data != null ? data : Collections.emptyList()); + return response; + } + + // 无数据的成功响应 + public static WcsResponseVo success() { + return success(null); + } + + // 单对象成功响应(非List场景) + public static WcsResponseVo success(T item) { + WcsResponseVo response = new WcsResponseVo<>(); + response.setHeader(createSuccessHeader()); + response.setBody(item != null ? + Collections.singletonList(item) : + Collections.emptyList()); + return response; + } + + // 错误响应 + public static WcsResponseVo error(int code, String msg) { + WcsResponseVo response = new WcsResponseVo<>(); + ResponseHeader header = new ResponseHeader(); + header.setMsgCode(code); + header.setMessage(msg); + response.setHeader(header); + response.setBody(Collections.emptyList()); // 错误时body默认为空数组 + return response; + } + + private static ResponseHeader createSuccessHeader() { + ResponseHeader header = new ResponseHeader(); + header.setMsgCode(200); + header.setMessage("调用成功"); + return header; + } +} \ No newline at end of file diff --git a/shkj-wms/src/main/java/com/shkj/wms/mapper/BusinPickupMapper.java b/shkj-wms/src/main/java/com/shkj/wms/mapper/BusinPickupMapper.java index 01f224c..b64f533 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/mapper/BusinPickupMapper.java +++ b/shkj-wms/src/main/java/com/shkj/wms/mapper/BusinPickupMapper.java @@ -2,11 +2,9 @@ package com.shkj.wms.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.shkj.wms.bo.BusinPickupQueryBo; -import com.shkj.wms.domain.BusinDataTask; import com.shkj.wms.domain.BusinPickup; import com.shkj.wms.vo.BusinPickupVo; -import java.util.Date; import java.util.List; /** diff --git a/shkj-wms/src/main/java/com/shkj/wms/vo/BusinDataTaskVo.java b/shkj-wms/src/main/java/com/shkj/wms/vo/BusinDataTaskVo.java index 8d963cd..a288e18 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/vo/BusinDataTaskVo.java +++ b/shkj-wms/src/main/java/com/shkj/wms/vo/BusinDataTaskVo.java @@ -1,10 +1,7 @@ package com.shkj.wms.vo; -import com.shkj.wms.domain.BusinDataTask; import lombok.Data; -import java.math.BigDecimal; - /** * 任务视图对象 diff --git a/shkj-wms/src/main/resources/mapper/wms/BusinDataTaskMapper.xml b/shkj-wms/src/main/resources/mapper/wcs/BusinDataTaskMapper.xml similarity index 95% rename from shkj-wms/src/main/resources/mapper/wms/BusinDataTaskMapper.xml rename to shkj-wms/src/main/resources/mapper/wcs/BusinDataTaskMapper.xml index 5698a56..6824466 100644 --- a/shkj-wms/src/main/resources/mapper/wms/BusinDataTaskMapper.xml +++ b/shkj-wms/src/main/resources/mapper/wcs/BusinDataTaskMapper.xml @@ -2,14 +2,13 @@ - + - + - @@ -74,7 +73,6 @@ exception_msg, task_path, batch, - is_urgent, is_top, priority, from_row, @@ -110,7 +108,6 @@ #{exceptionMsg}, #{taskPath}, #{batch}, - #{isUrgent}, #{isTop}, #{priority}, #{fromRow},