From 2e5f6dab8ebb8b2b909450a461dabc5c10863373 Mon Sep 17 00:00:00 2001 From: Lin-XCC <754310653@QQ.COM> Date: Wed, 10 Nov 2021 09:36:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E5=8A=A0=E5=B7=A5=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=EF=BC=8C=E6=9F=A5=E8=AF=A2=E5=8A=A0=E5=B7=A5=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E4=BB=A5=E5=8F=8A=E8=AF=A6=E7=BB=86=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E7=9B=B8=E5=85=B3=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../empty/controller/CurrTaskController.java | 33 ++++- .../controller/CurrTaskDetController.java | 17 ++- .../com/mt/wms/empty/enums/TaskTypeEnum.java | 70 +++++++++++ .../empty/params/CurrTaskDetQueryParam.java | 26 ++++ .../wms/empty/params/CurrTaskQueryParam.java | 28 +++++ .../wms/empty/params/TaskCreateDetParam.java | 73 +++++++++++ .../mt/wms/empty/params/TaskCreateParam.java | 38 ++++++ .../wms/empty/service/CurrTaskDetService.java | 17 ++- .../mt/wms/empty/service/CurrTaskService.java | 33 +++++ .../service/impl/CurrTaskDetServiceImpl.java | 28 ++++- .../service/impl/CurrTaskServiceImpl.java | 50 ++++++++ .../com/mt/wms/empty/vo/CurrTaskDetVo.java | 2 +- .../com/mt/wms/empty/vo/CurrTaskQueryVo.java | 70 +++++++++++ .../java/com/mt/wms/empty/vo/CurrTaskVo.java | 115 ++++++++++++++++++ 14 files changed, 591 insertions(+), 9 deletions(-) create mode 100644 6.program/wms-empty/src/main/java/com/mt/wms/empty/enums/TaskTypeEnum.java create mode 100644 6.program/wms-empty/src/main/java/com/mt/wms/empty/params/CurrTaskDetQueryParam.java create mode 100644 6.program/wms-empty/src/main/java/com/mt/wms/empty/params/CurrTaskQueryParam.java create mode 100644 6.program/wms-empty/src/main/java/com/mt/wms/empty/params/TaskCreateDetParam.java create mode 100644 6.program/wms-empty/src/main/java/com/mt/wms/empty/params/TaskCreateParam.java create mode 100644 6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskQueryVo.java create mode 100644 6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskVo.java diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/CurrTaskController.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/CurrTaskController.java index fe662a3..d0984bb 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/CurrTaskController.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/CurrTaskController.java @@ -2,11 +2,23 @@ package com.mt.wms.empty.controller; import com.mt.wms.core.base.BaseController; import com.mt.wms.core.constants.CommonConstant; +import com.mt.wms.core.vo.IdVo; +import com.mt.wms.core.vo.PageVo; +import com.mt.wms.core.vo.R; +import com.mt.wms.empty.params.CurrTaskQueryParam; +import com.mt.wms.empty.params.TaskCreateParam; +import com.mt.wms.empty.service.CurrTaskDetService; import com.mt.wms.empty.service.CurrTaskService; +import com.mt.wms.empty.vo.CurrTaskQueryVo; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; +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 xcc @@ -16,10 +28,27 @@ import org.springframework.web.bind.annotation.*; @RestController @RequestMapping(CommonConstant.API_MODULE_BASE + "currTask") @Slf4j -@Api(value = "当前任务管理", tags = "任务管理", hidden = false) +@Api(value = "任务管理", tags = "当前任务管理", hidden = false) public class CurrTaskController extends BaseController { @Autowired private CurrTaskService currTaskService; + @Autowired + private CurrTaskDetService currTaskDetService; + + @PostMapping(value = "createTask") + @ApiOperation(value = "进入工业炉加工(首次加工)") + public R createFirstTask(@Validated @RequestBody TaskCreateParam param){ + R mainTask = currTaskService.createFirstTask(param); + currTaskDetService.createFirstTaskDet(param.getDetParams(),mainTask.getData().getId()); + //任务发起后,判断去窑炉,或者去缓存位,不由此处判断。 + //todo 调用后续的处理接口 + return successful("创建成功。"); + } + @PostMapping(value = "currentTaskNow") + @ApiOperation(value = "获取当前执行的任务") + public R> currentTask(@Validated @RequestBody CurrTaskQueryParam param){ + return currTaskService.currentTaskPage(param); + } } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/CurrTaskDetController.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/CurrTaskDetController.java index c7aae13..86b77eb 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/CurrTaskDetController.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/CurrTaskDetController.java @@ -2,12 +2,17 @@ package com.mt.wms.empty.controller; import com.mt.wms.core.base.BaseController; import com.mt.wms.core.constants.CommonConstant; +import com.mt.wms.core.vo.PageVo; +import com.mt.wms.core.vo.R; +import com.mt.wms.empty.params.CurrTaskDetQueryParam; import com.mt.wms.empty.service.CurrTaskDetService; +import com.mt.wms.empty.vo.CurrTaskDetVo; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; /** * @author xcc @@ -17,10 +22,14 @@ import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping(CommonConstant.API_MODULE_BASE + "currTaskDet") @Slf4j -@Api(value = "当前任务详情管理", tags = "任务详情管理", hidden = false) +@Api(value = "任务详情管理", tags = "当前任务详情管理", hidden = false) public class CurrTaskDetController extends BaseController { @Autowired CurrTaskDetService currTaskDetService; - + @PostMapping(value = "getTaskDet") + @ApiOperation(value = "查看主任务的详情任务列表") + public R> getTaskDetailsPage(@Validated@RequestBody CurrTaskDetQueryParam currTaskId){ + return currTaskDetService.getTaskDetailsPage(currTaskId); + } } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/enums/TaskTypeEnum.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/enums/TaskTypeEnum.java new file mode 100644 index 0000000..c56a46c --- /dev/null +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/enums/TaskTypeEnum.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2018. + * http://www.ulabcare.com + */ + +package com.mt.wms.empty.enums; + + +import com.mt.wms.core.base.IEnum; + +/** + * 订单来源信息 1.APMS 2.人工 + * + * @author xcc + * @date 2021/6/17 15:44 + */ +public enum TaskTypeEnum implements IEnum { + /** + * 入库到窑炉 + */ + WTK(0, "入库到窑炉"), + /** + * 入库到缓存 + */ + WTC(1, "入库到缓存"), + /** + * 出库到窑炉到缓存区 + */ + KTC(2, "出库到窑炉到缓存区"), + /** + * 缓存区出库 + */ + CTS(3, "缓存区出库"); + private final Integer value; + private final String label; + private final String remark; + + TaskTypeEnum(final Integer value, final String label) { + this(value, label, null); + } + + TaskTypeEnum(final Integer value, final String label, final String remark) { + this.value = value; + this.label = label; + this.remark = remark; + } + + /** + * @return 数据值 + */ + @Override + public Integer getValue() { + return value; + } + /** + * @return 标签名 + */ + @Override + public String getLabel() { + return label; + } + + /** + * @return 备注 + */ + @Override + public String getRemark() { + return remark; + } +} diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/CurrTaskDetQueryParam.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/CurrTaskDetQueryParam.java new file mode 100644 index 0000000..7c7801c --- /dev/null +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/CurrTaskDetQueryParam.java @@ -0,0 +1,26 @@ +package com.mt.wms.empty.params; + +import com.mt.wms.core.params.BasePageParam; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @author xcc + * @date 2021年11月9日 + * @since 1.0 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value = "获取任务信息", description = "获取任务信息") +public class CurrTaskDetQueryParam extends BasePageParam { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "主任务id",required = true) + private Long currTaskId; + +} diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/CurrTaskQueryParam.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/CurrTaskQueryParam.java new file mode 100644 index 0000000..b9d1445 --- /dev/null +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/CurrTaskQueryParam.java @@ -0,0 +1,28 @@ +package com.mt.wms.empty.params; + +import com.mt.wms.core.params.BasePageParam; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @author xcc + * @date 2021年11月9日 + * @since 1.0 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value = "获取任务信息", description = "获取任务信息") +public class CurrTaskQueryParam extends BasePageParam { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "标识卡号",required = false) + private String idenCardNum; + @ApiModelProperty(value = "车辆id") + private String vehicleId; + +} diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/TaskCreateDetParam.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/TaskCreateDetParam.java new file mode 100644 index 0000000..c8d50d8 --- /dev/null +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/TaskCreateDetParam.java @@ -0,0 +1,73 @@ +package com.mt.wms.empty.params; + +import com.mt.wms.core.base.BaseParam; +import com.mt.wms.core.params.BasePageParam; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @author xcc + * @date 2021年11月9日 + * @since 1.0 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value = "订单详细信息", description = "新建一个订单的详细信息") +public class TaskCreateDetParam extends BaseParam { + + private static final long serialVersionUID = 1L; + + + /** + * 标识卡号 + */ + @ApiModelProperty(value = "标识卡号", required = true) + private String idenCardNum; + + /** + * 订单号,APMS系统获取 + */ + @ApiModelProperty(value = "订单号", required = false) + private String orderNo; + + /** + * 客户名称、 + */ + @ApiModelProperty(value = "客户名称") + private String customerName; + + /** + * 产品名称、 + */ + @ApiModelProperty(value = "产品名称") + private String productName; + + /** + * 材料牌号 APMS系统获取 + */ + @ApiModelProperty(value = "材料牌号") + private String materialDes; + + /** + * 单位 + */ + @ApiModelProperty(value = "单位") + private String unit; + + /** + * 重量 + */ + @ApiModelProperty(value = "重量",required = true) + private Float weight; + + /** + * 数量 + */ + @ApiModelProperty(value = "数量",required = true) + private Float quantity; + +} diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/TaskCreateParam.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/TaskCreateParam.java new file mode 100644 index 0000000..d08ed64 --- /dev/null +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/TaskCreateParam.java @@ -0,0 +1,38 @@ +package com.mt.wms.empty.params; + +import com.mt.wms.core.base.BaseParam; +import com.mt.wms.core.params.BasePageParam; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.util.List; + +/** + * @author xcc + * @date 2021年11月9日 + * @since 1.0 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value = "新建一个订单信息", description = "新建一个订单信息") +public class TaskCreateParam extends BaseParam { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "托盘号") + private String palletCode; + @ApiModelProperty(value = "起点",required = true) + private String startPosition; + @ApiModelProperty(value = "终点位置",required = true) + private String targetPosition; + @ApiModelProperty(value = "窑炉Id",required = true) + private Long kilnId; + @ApiModelProperty(value = "详细信息",required = true) + private List detParams; + + +} diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskDetService.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskDetService.java index 2c4f689..e92e310 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskDetService.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskDetService.java @@ -1,7 +1,10 @@ package com.mt.wms.empty.service; import com.mt.wms.core.vo.PageVo; +import com.mt.wms.core.vo.R; +import com.mt.wms.empty.params.CurrTaskDetQueryParam; import com.mt.wms.empty.params.OrderInfoTaskDetParam; +import com.mt.wms.empty.params.TaskCreateDetParam; import com.mt.wms.empty.vo.CurrTaskDetVo; import com.mt.wms.empty.vo.OrderInfoTaskDetVo; @@ -20,6 +23,18 @@ public interface CurrTaskDetService { * @param param 订单号 和标识卡 * @return 结果 */ - public PageVo getCurrOrderCurrTask(OrderInfoTaskDetParam param); + PageVo getCurrOrderCurrTask(OrderInfoTaskDetParam param); + /** + * 创建正常加工的详细任务信息 + * @param taskDet 详细任务信息 + * @param taskId 主任务id + */ + void createFirstTaskDet(List taskDet, Long taskId); + /** + * 查询正常加工的详细任务信息 + * @param currTaskId 详细任务信息 + * @return 结果 + */ + R> getTaskDetailsPage(CurrTaskDetQueryParam currTaskId); } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskService.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskService.java index d47e5be..f8178c3 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskService.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskService.java @@ -1,5 +1,18 @@ package com.mt.wms.empty.service; +import com.mt.wms.core.dal.entity.CurrTaskDet; +import com.mt.wms.core.params.IdParam; +import com.mt.wms.core.vo.IdVo; +import com.mt.wms.core.vo.PageVo; +import com.mt.wms.core.vo.R; +import com.mt.wms.empty.params.CurrTaskQueryParam; +import com.mt.wms.empty.params.TaskCreateDetParam; +import com.mt.wms.empty.params.TaskCreateParam; +import com.mt.wms.empty.vo.CurrTaskQueryVo; +import com.mt.wms.empty.vo.CurrTaskVo; + +import java.util.List; + /** * 拆分任务相关服务 * @@ -9,4 +22,24 @@ package com.mt.wms.empty.service; */ public interface CurrTaskService { + /** + * 内部使用,获取详情任务的关联任务 + * @param idParam 任务id + * @return 任务实体 + */ + CurrTaskVo getCurrTask(IdParam idParam); + + + /** + * 创建正常加工的主任务信息 + * @param param 主任务信息 + * @return 结果 + */ + R createFirstTask(TaskCreateParam param); + /** + * 查询分页信息 + * @param param 查询参数 + * @return 结果 + */ + R> currentTaskPage(CurrTaskQueryParam param); } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskDetServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskDetServiceImpl.java index 7636510..36af814 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskDetServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskDetServiceImpl.java @@ -5,8 +5,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.mt.wms.core.base.BaseService; import com.mt.wms.core.dal.entity.CurrTaskDet; import com.mt.wms.core.dal.service.CurrTaskDetServiceBiz; +import com.mt.wms.core.utils.BeanUtils; import com.mt.wms.core.vo.PageVo; +import com.mt.wms.core.vo.R; +import com.mt.wms.empty.params.CurrTaskDetQueryParam; import com.mt.wms.empty.params.OrderInfoTaskDetParam; +import com.mt.wms.empty.params.TaskCreateDetParam; import com.mt.wms.empty.service.CurrTaskDetService; import com.mt.wms.empty.vo.CurrTaskDetVo; import com.mt.wms.empty.vo.OrderInfoTaskDetVo; @@ -14,6 +18,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; +import java.util.List; + /** * xx服务实现类 * @@ -30,11 +37,30 @@ public class CurrTaskDetServiceImpl extends BaseService implements CurrTaskDetSe @Override public PageVo getCurrOrderCurrTask(OrderInfoTaskDetParam param) { - QueryWrapper queryWrapper = new QueryWrapper(); + QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq(CurrTaskDet.IDEN_CARD_NUM,param.getIdenCardNum()) .eq(CurrTaskDet.ORDER_NO,param.getOrderNo()) .eq(CurrTaskDet.VALID,1); Page page = currTaskDetServiceBiz.page(new Page<>(param.getCurrent(), param.getSize()), queryWrapper); return new PageVo<>(page, OrderInfoTaskDetVo.class); } + + @Override + public void createFirstTaskDet(List taskDet, Long taskId) { + List params = BeanUtils.copyList(taskDet, CurrTaskDet.class); + params.forEach(param->{ + param.setCurrTaskId(taskId); + setCommonField(param); + }); + currTaskDetServiceBiz.saveBatch(params); + } + + @Override + public R> getTaskDetailsPage(CurrTaskDetQueryParam currTaskId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq(CurrTaskDet.CURR_TASK_ID,currTaskId.getCurrTaskId()) + .eq(CurrTaskDet.VALID,1); + Page page = currTaskDetServiceBiz.page(new Page<>(currTaskId.getCurrent(), currTaskId.getSize()), queryWrapper); + return successful(new PageVo<>(page, CurrTaskDetVo.class)); + } } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java index 9037499..a98cf19 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java @@ -1,8 +1,25 @@ package com.mt.wms.empty.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.mt.wms.core.api.Assert; import com.mt.wms.core.base.BaseService; +import com.mt.wms.core.dal.entity.CurrTask; import com.mt.wms.core.dal.service.CurrTaskServiceBiz; +import com.mt.wms.core.params.IdParam; +import com.mt.wms.core.vo.IdVo; +import com.mt.wms.core.vo.PageVo; +import com.mt.wms.core.vo.R; +import com.mt.wms.empty.enums.TaskTypeEnum; +import com.mt.wms.empty.params.CurrTaskQueryParam; +import com.mt.wms.empty.params.TaskCreateParam; +import com.mt.wms.empty.service.CurrTaskDetService; import com.mt.wms.empty.service.CurrTaskService; +import com.mt.wms.empty.vo.CurrTaskQueryVo; +import com.mt.wms.empty.vo.CurrTaskVo; +import org.apache.commons.codec.net.QCodec; +import org.apache.commons.lang.StringUtils; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -21,4 +38,37 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService @Autowired CurrTaskServiceBiz currTaskServiceBiz; + @Autowired + CurrTaskDetService currTaskDetService; + + @Override + public CurrTaskVo getCurrTask(IdParam idParam) { + CurrTask byId = currTaskServiceBiz.getById(idParam.getId()); + CurrTaskVo build = CurrTaskVo.builder().build(); + BeanUtils.copyProperties(byId,build); + return build; + } + + @Override + public R createFirstTask(TaskCreateParam param) { + CurrTask currTask = new CurrTask(); + currTask.setStartPosition(param.getStartPosition()); + currTask.setTargetPosition(param.getTargetPosition()); + currTask.setKilnId(param.getKilnId()); + currTask.setTaskType(TaskTypeEnum.WTK.getValue()); + currTask.setPalletCode(param.getPalletCode()); + currTask.setTaskSource(0); + setCommonField(currTask); + currTaskServiceBiz.save(currTask); + return successful(IdVo.builder().id(currTask.getId()).build()); + } + + @Override + public R> currentTaskPage(CurrTaskQueryParam param) { + QueryWrapper currTaskQueryWrapper= new QueryWrapper<>(); + currTaskQueryWrapper.eq(StringUtils.isNotBlank(param.getVehicleId()),CurrTask.VEHICLE_ID,param.getVehicleId()); + currTaskQueryWrapper.eq(CurrTask.VALID,1); + Page page = currTaskServiceBiz.page(new Page<>(param.getCurrent(), param.getSize()), currTaskQueryWrapper); + return successful(new PageVo<>(page,CurrTaskQueryVo.class)); + } } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskDetVo.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskDetVo.java index a3ab058..2a10900 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskDetVo.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskDetVo.java @@ -46,7 +46,7 @@ public class CurrTaskDetVo extends BaseVo implements PageVo.ConvertVo { * 当前任务id,关联当前任务表:t_curr_task */ @ApiModelProperty("当前任务id") - private Integer currTaskId; + private Long currTaskId; /** * 重量,手动输入 */ diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskQueryVo.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskQueryVo.java new file mode 100644 index 0000000..c5dd173 --- /dev/null +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskQueryVo.java @@ -0,0 +1,70 @@ +package com.mt.wms.empty.vo; + +import com.mt.wms.core.base.BaseVo; +import com.mt.wms.core.vo.PageVo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +/** + * + * @author xcc + * @date 2021年11月8日 + * @since 1.0 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@Builder +@ApiModel(value = "当前任务信息", description = "当前任务信息") +public class CurrTaskQueryVo extends BaseVo implements PageVo.ConvertVo { + @ApiModelProperty(value = "id") + private Long id; + + /** + * 任务编码, 查看任务编码规则 + */ + @ApiModelProperty("任务编码") + private String taskCode; + /** + * 发起任务时间 + */ + @ApiModelProperty("发起时间") + private LocalDateTime createTime; + /** + * 任务来源, 暂时只有人工 + */ + @ApiModelProperty("任务来源") + private String taskSource; + /** + * 状态: 0等待执行,1执行中,2执行完成,3追加后完成(追加后就按完成来算) + */ + @ApiModelProperty("状态") + private Integer status; + /** + * 任务类型:0:入库到窑炉,1:入库到缓存区,2出库到 窑炉到缓存区,3缓存区出库 + */ + @ApiModelProperty("任务类型") + private Integer taskType; + /** + * 开始位置 + */ + @ApiModelProperty("开始位置") + private String startPosition; + + /** + * 目标位置指的是窑炉的位置 + */ + @ApiModelProperty("窑炉位置") + private String targetPosition; + /** + * 车辆名称,关联车辆表:t_vehicle_info + */ + @ApiModelProperty("车辆名称") + private String vehicleName; +} diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskVo.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskVo.java new file mode 100644 index 0000000..a47c415 --- /dev/null +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskVo.java @@ -0,0 +1,115 @@ +package com.mt.wms.empty.vo; + +import com.mt.wms.core.base.BaseVo; +import com.mt.wms.core.vo.PageVo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +/** + * + * @author xcc + * @date 2021年11月8日 + * @since 1.0 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@Builder +@ApiModel(value = "当前任务信息", description = "当前任务信息") +public class CurrTaskVo extends BaseVo implements PageVo.ConvertVo { + @ApiModelProperty(value = "id") + private Long id; + /** + * 状态: 0等待执行,1执行中,2执行完成,3追加后完成(追加后就按完成来算) + */ + @ApiModelProperty("状态") + private Integer status; + + /** + * 内部编码,系统自动生成 + */ + @ApiModelProperty("内部编码") + private String interCode; + + /** + * 任务编码, 查看任务编码规则 + */ + @ApiModelProperty("任务编码") + private String taskCode; + + /** + * 任务来源, 暂时只有人工 + */ + @ApiModelProperty("任务来源") + private String taskSource; + + /** + * 任务类型:0:入库到窑炉,1:入库到缓存区,2出库到 窑炉到缓存区,3缓存区出库 + */ + @ApiModelProperty("任务类型") + private Integer taskType; + + /** + * 托盘编码 + */ + @ApiModelProperty("托盘编码") + private String palletCode; + + /** + * 发起任务时间 + */ + @ApiModelProperty("发起时间") + private LocalDateTime createTime; + + /** + * 缓存前开始时间,车辆开始执行 + */ + @ApiModelProperty("任务开始") + private LocalDateTime aBeginTime; + + /** + * 完成当前任务时间(可能是到缓存区,有可能直接到窑炉),车辆放完货物到缓存区收到的时间 + */ + @ApiModelProperty("任务结束") + private LocalDateTime aEndTime; + + /** + * 开始位置 + */ + @ApiModelProperty("开始位置") + private String startPosition; + + /** + * 目标位置指的是窑炉的位置 + */ + @ApiModelProperty("窑炉位置") + private String targetPosition; + + /** + * 目标窑炉id + */ + @ApiModelProperty("目标窑炉id") + private Long kilnId; + + /** + * 车辆id,关联车辆表:t_vehicle_info + */ + @ApiModelProperty("车辆id") + private Long vehicleId; + /** + * 库位id,关联库位表:t_location + */ + @ApiModelProperty("location_id") + private Integer locationId; + /** + * 库位名称 + */ + @ApiModelProperty("location_name") + private String locationName; +}