完成订单,作废订单,完成任务接口
This commit is contained in:
parent
579b77daaa
commit
87f91696e4
@ -2,6 +2,7 @@ package com.mt.wms.empty.controller;
|
|||||||
|
|
||||||
import com.mt.wms.core.base.BaseController;
|
import com.mt.wms.core.base.BaseController;
|
||||||
import com.mt.wms.core.constants.CommonConstant;
|
import com.mt.wms.core.constants.CommonConstant;
|
||||||
|
import com.mt.wms.core.params.IdParam;
|
||||||
import com.mt.wms.core.vo.IdVo;
|
import com.mt.wms.core.vo.IdVo;
|
||||||
import com.mt.wms.core.vo.PageVo;
|
import com.mt.wms.core.vo.PageVo;
|
||||||
import com.mt.wms.core.vo.R;
|
import com.mt.wms.core.vo.R;
|
||||||
@ -35,13 +36,11 @@ public class CurrTaskController extends BaseController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private CurrTaskDetService currTaskDetService;
|
private CurrTaskDetService currTaskDetService;
|
||||||
|
|
||||||
@PostMapping(value = "createTask")
|
@PostMapping(value = "createProcessTask")
|
||||||
@ApiOperation(value = "进入工业炉加工(首次加工)")
|
@ApiOperation(value = "创建一个加工任务至任务队列")
|
||||||
public R createFirstTask(@Validated @RequestBody TaskCreateParam param){
|
public R createProcessTask(@Validated @RequestBody TaskCreateParam param) {
|
||||||
R<IdVo> mainTask = currTaskService.createFirstTask(param);
|
R<IdVo> mainTask = currTaskService.createProcessTask(param);
|
||||||
currTaskDetService.createFirstTaskDet(param.getDetParams(),mainTask.getData().getId());
|
currTaskDetService.createProcessTaskDet(param.getDetParams(), mainTask.getData().getId());
|
||||||
//任务发起后,判断去窑炉,或者去缓存位,不由此处判断。
|
|
||||||
//todo 调用后续的处理接口
|
|
||||||
return successful("创建成功。");
|
return successful("创建成功。");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,4 +50,10 @@ public class CurrTaskController extends BaseController {
|
|||||||
public R<PageVo<CurrTaskQueryVo>> currentTask(@Validated @RequestBody CurrTaskQueryParam param) {
|
public R<PageVo<CurrTaskQueryVo>> currentTask(@Validated @RequestBody CurrTaskQueryParam param) {
|
||||||
return currTaskService.currentTaskPage(param);
|
return currTaskService.currentTaskPage(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "completeTask")
|
||||||
|
@ApiOperation(value = "完成执行任务")
|
||||||
|
public R completeTask(@Validated @RequestBody IdParam param) {
|
||||||
|
return currTaskService.completeTask(param);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ import com.mt.wms.core.params.IdParam;
|
|||||||
import com.mt.wms.core.validator.groups.PageGroup;
|
import com.mt.wms.core.validator.groups.PageGroup;
|
||||||
import com.mt.wms.core.vo.PageVo;
|
import com.mt.wms.core.vo.PageVo;
|
||||||
import com.mt.wms.core.vo.R;
|
import com.mt.wms.core.vo.R;
|
||||||
import com.mt.wms.empty.params.OrderParamForApms;
|
|
||||||
import com.mt.wms.empty.params.OrderInfoBasePageParam;
|
import com.mt.wms.empty.params.OrderInfoBasePageParam;
|
||||||
import com.mt.wms.empty.params.OrderInfoPersonCreateParam;
|
import com.mt.wms.empty.params.OrderInfoPersonCreateParam;
|
||||||
import com.mt.wms.empty.params.OrderInfoTaskDetParam;
|
import com.mt.wms.empty.params.OrderInfoTaskDetParam;
|
||||||
@ -35,12 +34,6 @@ public class OrderInfoController extends BaseController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private OrderInfoService orderInfoService;
|
private OrderInfoService orderInfoService;
|
||||||
|
|
||||||
@PostMapping(value = "apmsPostOrder")
|
|
||||||
@ApiOperation(value = "接收apms推送订单信息")
|
|
||||||
private R apmsPostOrder(@Validated @RequestBody OrderParamForApms apmsPostOrderParam) {
|
|
||||||
return orderInfoService.apmsPostOrder(apmsPostOrderParam);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping(value = "page")
|
@PostMapping(value = "page")
|
||||||
@ApiOperation(value = "获取分页订单基础信息")
|
@ApiOperation(value = "获取分页订单基础信息")
|
||||||
private R<PageVo<OrderInfoVo>> page(@Validated({PageGroup.class, Default.class}) @RequestBody OrderInfoBasePageParam orderBaseParam) {
|
private R<PageVo<OrderInfoVo>> page(@Validated({PageGroup.class, Default.class}) @RequestBody OrderInfoBasePageParam orderBaseParam) {
|
||||||
@ -70,4 +63,16 @@ public class OrderInfoController extends BaseController {
|
|||||||
return orderInfoService.getTaskInfoByIdenCardNum(idenCardNum);
|
return orderInfoService.getTaskInfoByIdenCardNum(idenCardNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping(value = "completeOrder")
|
||||||
|
@ApiOperation(value = "完成订单")
|
||||||
|
private R completeOrder(@Validated @RequestBody IdParam idParam) {
|
||||||
|
return orderInfoService.completeOrder(idParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "voidOrder")
|
||||||
|
@ApiOperation(value = "作废订单")
|
||||||
|
private R voidOrder(@Validated @RequestBody IdParam idParam) {
|
||||||
|
return orderInfoService.voidOrder(idParam);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package com.mt.wms.empty.params;
|
package com.mt.wms.empty.params;
|
||||||
|
|
||||||
import com.mt.wms.core.base.BaseParam;
|
import com.mt.wms.core.base.BaseParam;
|
||||||
import com.mt.wms.core.params.BasePageParam;
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@ -18,7 +17,7 @@ import java.util.List;
|
|||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@ApiModel(value = "新建一个订单信息", description = "新建一个订单信息")
|
@ApiModel(value = "新建一个任务信息", description = "新建一个任务信息")
|
||||||
public class TaskCreateParam extends BaseParam {
|
public class TaskCreateParam extends BaseParam {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@ -29,6 +28,8 @@ public class TaskCreateParam extends BaseParam {
|
|||||||
private String startPosition;
|
private String startPosition;
|
||||||
@ApiModelProperty(value = "终点位置", required = true)
|
@ApiModelProperty(value = "终点位置", required = true)
|
||||||
private String targetPosition;
|
private String targetPosition;
|
||||||
|
@ApiModelProperty(value = "加工任务类型", required = true)
|
||||||
|
private Integer processType;
|
||||||
@ApiModelProperty(value = "窑炉Id", required = true)
|
@ApiModelProperty(value = "窑炉Id", required = true)
|
||||||
private Long kilnId;
|
private Long kilnId;
|
||||||
@ApiModelProperty(value = "详细信息", required = true)
|
@ApiModelProperty(value = "详细信息", required = true)
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package com.mt.wms.empty.service;
|
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.PageVo;
|
import com.mt.wms.core.vo.PageVo;
|
||||||
import com.mt.wms.core.vo.R;
|
import com.mt.wms.core.vo.R;
|
||||||
import com.mt.wms.empty.params.CurrTaskDetQueryParam;
|
import com.mt.wms.empty.params.CurrTaskDetQueryParam;
|
||||||
@ -24,17 +26,28 @@ public interface CurrTaskDetService {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
PageVo<OrderInfoTaskDetVo> getCurrOrderCurrTask(OrderInfoTaskDetParam param);
|
PageVo<OrderInfoTaskDetVo> getCurrOrderCurrTask(OrderInfoTaskDetParam param);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建正常加工的详细任务信息
|
* 创建正常加工的详细任务信息
|
||||||
|
*
|
||||||
* @param taskDet 详细任务信息
|
* @param taskDet 详细任务信息
|
||||||
* @param taskId 主任务id
|
* @param taskId 主任务id
|
||||||
*/
|
*/
|
||||||
void createFirstTaskDet(List<TaskCreateDetParam> taskDet, Long taskId);
|
void createProcessTaskDet(List<TaskCreateDetParam> taskDet, Long taskId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询正常加工的详细任务信息
|
* 查询正常加工的详细任务信息
|
||||||
|
*
|
||||||
* @param currTaskId 详细任务信息
|
* @param currTaskId 详细任务信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
R<PageVo<CurrTaskDetVo>> getTaskDetailsPage(CurrTaskDetQueryParam currTaskId);
|
R<PageVo<CurrTaskDetVo>> getTaskDetailsPage(CurrTaskDetQueryParam currTaskId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询某个主任务下的详细任务列表
|
||||||
|
*
|
||||||
|
* @param idParam 主任务id
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
List<CurrTaskDet> getTaskDetailsByMainId(IdParam idParam);
|
||||||
}
|
}
|
||||||
|
@ -1,18 +1,14 @@
|
|||||||
package com.mt.wms.empty.service;
|
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.params.IdParam;
|
||||||
import com.mt.wms.core.vo.IdVo;
|
import com.mt.wms.core.vo.IdVo;
|
||||||
import com.mt.wms.core.vo.PageVo;
|
import com.mt.wms.core.vo.PageVo;
|
||||||
import com.mt.wms.core.vo.R;
|
import com.mt.wms.core.vo.R;
|
||||||
import com.mt.wms.empty.params.CurrTaskQueryParam;
|
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.params.TaskCreateParam;
|
||||||
import com.mt.wms.empty.vo.CurrTaskQueryVo;
|
import com.mt.wms.empty.vo.CurrTaskQueryVo;
|
||||||
import com.mt.wms.empty.vo.CurrTaskVo;
|
import com.mt.wms.empty.vo.CurrTaskVo;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拆分任务相关服务
|
* 拆分任务相关服务
|
||||||
*
|
*
|
||||||
@ -31,15 +27,26 @@ public interface CurrTaskService {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建正常加工的主任务信息
|
* 创建加工任务的主任务信息
|
||||||
|
*
|
||||||
* @param param 主任务信息
|
* @param param 主任务信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
R<IdVo> createFirstTask(TaskCreateParam param);
|
R<IdVo> createProcessTask(TaskCreateParam param);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询分页信息
|
* 查询分页信息
|
||||||
|
*
|
||||||
* @param param 查询参数
|
* @param param 查询参数
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
R<PageVo<CurrTaskQueryVo>> currentTaskPage(CurrTaskQueryParam param);
|
R<PageVo<CurrTaskQueryVo>> currentTaskPage(CurrTaskQueryParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成执行任务
|
||||||
|
*
|
||||||
|
* @param param id
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
R completeTask(IdParam param);
|
||||||
}
|
}
|
||||||
|
@ -3,10 +3,10 @@ package com.mt.wms.empty.service;
|
|||||||
import com.mt.wms.core.params.IdParam;
|
import com.mt.wms.core.params.IdParam;
|
||||||
import com.mt.wms.core.vo.PageVo;
|
import com.mt.wms.core.vo.PageVo;
|
||||||
import com.mt.wms.core.vo.R;
|
import com.mt.wms.core.vo.R;
|
||||||
import com.mt.wms.empty.params.OrderParamForApms;
|
|
||||||
import com.mt.wms.empty.params.OrderInfoBasePageParam;
|
import com.mt.wms.empty.params.OrderInfoBasePageParam;
|
||||||
import com.mt.wms.empty.params.OrderInfoPersonCreateParam;
|
import com.mt.wms.empty.params.OrderInfoPersonCreateParam;
|
||||||
import com.mt.wms.empty.params.OrderInfoTaskDetParam;
|
import com.mt.wms.empty.params.OrderInfoTaskDetParam;
|
||||||
|
import com.mt.wms.empty.params.OrderParamForApms;
|
||||||
import com.mt.wms.empty.vo.OrderInfoTaskDetVo;
|
import com.mt.wms.empty.vo.OrderInfoTaskDetVo;
|
||||||
import com.mt.wms.empty.vo.OrderInfoVo;
|
import com.mt.wms.empty.vo.OrderInfoVo;
|
||||||
|
|
||||||
@ -53,10 +53,28 @@ public interface OrderInfoService {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
R<PageVo<OrderInfoTaskDetVo>> getTaskInfo(OrderInfoTaskDetParam orderInfoTaskDetParam);
|
R<PageVo<OrderInfoTaskDetVo>> getTaskInfo(OrderInfoTaskDetParam orderInfoTaskDetParam);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建加工订单时查询订单信息
|
* 创建加工订单时查询订单信息
|
||||||
|
*
|
||||||
* @param idenCardNum 标识卡号
|
* @param idenCardNum 标识卡号
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
R<OrderInfoVo> getTaskInfoByIdenCardNum(String idenCardNum);
|
R<OrderInfoVo> getTaskInfoByIdenCardNum(String idenCardNum);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成订单
|
||||||
|
*
|
||||||
|
* @param idParam id号
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
R completeOrder(IdParam idParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 作废订单
|
||||||
|
*
|
||||||
|
* @param idParam id号
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
R voidOrder(IdParam idParam);
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import com.mt.wms.core.base.BaseService;
|
import com.mt.wms.core.base.BaseService;
|
||||||
import com.mt.wms.core.dal.entity.CurrTaskDet;
|
import com.mt.wms.core.dal.entity.CurrTaskDet;
|
||||||
import com.mt.wms.core.dal.service.CurrTaskDetServiceBiz;
|
import com.mt.wms.core.dal.service.CurrTaskDetServiceBiz;
|
||||||
|
import com.mt.wms.core.params.IdParam;
|
||||||
import com.mt.wms.core.utils.BeanUtils;
|
import com.mt.wms.core.utils.BeanUtils;
|
||||||
import com.mt.wms.core.vo.PageVo;
|
import com.mt.wms.core.vo.PageVo;
|
||||||
import com.mt.wms.core.vo.R;
|
import com.mt.wms.core.vo.R;
|
||||||
@ -18,7 +19,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -46,7 +46,7 @@ public class CurrTaskDetServiceImpl extends BaseService implements CurrTaskDetSe
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void createFirstTaskDet(List<TaskCreateDetParam> taskDet, Long taskId) {
|
public void createProcessTaskDet(List<TaskCreateDetParam> taskDet, Long taskId) {
|
||||||
List<CurrTaskDet> params = BeanUtils.copyList(taskDet, CurrTaskDet.class);
|
List<CurrTaskDet> params = BeanUtils.copyList(taskDet, CurrTaskDet.class);
|
||||||
params.forEach(param -> {
|
params.forEach(param -> {
|
||||||
param.setCurrTaskId(taskId);
|
param.setCurrTaskId(taskId);
|
||||||
@ -63,4 +63,12 @@ public class CurrTaskDetServiceImpl extends BaseService implements CurrTaskDetSe
|
|||||||
Page<CurrTaskDet> page = currTaskDetServiceBiz.page(new Page<>(currTaskId.getCurrent(), currTaskId.getSize()), queryWrapper);
|
Page<CurrTaskDet> page = currTaskDetServiceBiz.page(new Page<>(currTaskId.getCurrent(), currTaskId.getSize()), queryWrapper);
|
||||||
return successful(new PageVo<>(page, CurrTaskDetVo.class));
|
return successful(new PageVo<>(page, CurrTaskDetVo.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<CurrTaskDet> getTaskDetailsByMainId(IdParam idParam) {
|
||||||
|
QueryWrapper<CurrTaskDet> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq(CurrTaskDet.CURR_TASK_ID, idParam.getId())
|
||||||
|
.eq(CurrTaskDet.VALID, 1);
|
||||||
|
return currTaskDetServiceBiz.list(queryWrapper);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,9 +2,11 @@ package com.mt.wms.empty.service.impl;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
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.base.BaseService;
|
||||||
import com.mt.wms.core.dal.entity.CurrTask;
|
import com.mt.wms.core.dal.entity.CurrTask;
|
||||||
|
import com.mt.wms.core.dal.entity.CurrTaskDet;
|
||||||
|
import com.mt.wms.core.dal.entity.TaskDetHis;
|
||||||
|
import com.mt.wms.core.dal.entity.TaskHis;
|
||||||
import com.mt.wms.core.dal.service.CurrTaskServiceBiz;
|
import com.mt.wms.core.dal.service.CurrTaskServiceBiz;
|
||||||
import com.mt.wms.core.params.IdParam;
|
import com.mt.wms.core.params.IdParam;
|
||||||
import com.mt.wms.core.vo.IdVo;
|
import com.mt.wms.core.vo.IdVo;
|
||||||
@ -15,15 +17,18 @@ import com.mt.wms.empty.params.CurrTaskQueryParam;
|
|||||||
import com.mt.wms.empty.params.TaskCreateParam;
|
import com.mt.wms.empty.params.TaskCreateParam;
|
||||||
import com.mt.wms.empty.service.CurrTaskDetService;
|
import com.mt.wms.empty.service.CurrTaskDetService;
|
||||||
import com.mt.wms.empty.service.CurrTaskService;
|
import com.mt.wms.empty.service.CurrTaskService;
|
||||||
|
import com.mt.wms.empty.service.TaskDetHisService;
|
||||||
|
import com.mt.wms.empty.service.TaskHisService;
|
||||||
import com.mt.wms.empty.vo.CurrTaskQueryVo;
|
import com.mt.wms.empty.vo.CurrTaskQueryVo;
|
||||||
import com.mt.wms.empty.vo.CurrTaskVo;
|
import com.mt.wms.empty.vo.CurrTaskVo;
|
||||||
import org.apache.commons.codec.net.QCodec;
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* xx服务实现类
|
* xx服务实现类
|
||||||
*
|
*
|
||||||
@ -41,6 +46,12 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
|
|||||||
@Autowired
|
@Autowired
|
||||||
CurrTaskDetService currTaskDetService;
|
CurrTaskDetService currTaskDetService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
TaskHisService taskHisService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
TaskDetHisService taskDetHisService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CurrTaskVo getCurrTask(IdParam idParam) {
|
public CurrTaskVo getCurrTask(IdParam idParam) {
|
||||||
CurrTask byId = currTaskServiceBiz.getById(idParam.getId());
|
CurrTask byId = currTaskServiceBiz.getById(idParam.getId());
|
||||||
@ -50,13 +61,10 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public R<IdVo> createFirstTask(TaskCreateParam param) {
|
public R<IdVo> createProcessTask(TaskCreateParam param) {
|
||||||
CurrTask currTask = new CurrTask();
|
CurrTask currTask = new CurrTask();
|
||||||
currTask.setStartPosition(param.getStartPosition());
|
BeanUtils.copyProperties(param, currTask);
|
||||||
currTask.setTargetPosition(param.getTargetPosition());
|
|
||||||
currTask.setKilnId(param.getKilnId());
|
|
||||||
currTask.setTaskType(TaskTypeEnum.WTK.getValue());
|
currTask.setTaskType(TaskTypeEnum.WTK.getValue());
|
||||||
currTask.setPalletCode(param.getPalletCode());
|
|
||||||
currTask.setTaskSource(0);
|
currTask.setTaskSource(0);
|
||||||
setCommonField(currTask);
|
setCommonField(currTask);
|
||||||
currTaskServiceBiz.save(currTask);
|
currTaskServiceBiz.save(currTask);
|
||||||
@ -71,4 +79,24 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
|
|||||||
Page<CurrTask> page = currTaskServiceBiz.page(new Page<>(param.getCurrent(), param.getSize()), currTaskQueryWrapper);
|
Page<CurrTask> page = currTaskServiceBiz.page(new Page<>(param.getCurrent(), param.getSize()), currTaskQueryWrapper);
|
||||||
return successful(new PageVo<>(page, CurrTaskQueryVo.class));
|
return successful(new PageVo<>(page, CurrTaskQueryVo.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R completeTask(IdParam param) {
|
||||||
|
CurrTask byId = currTaskServiceBiz.getById(param.getId());
|
||||||
|
TaskHis taskHis = new TaskHis();
|
||||||
|
BeanUtils.copyProperties(byId, taskHis);
|
||||||
|
taskHis.setStatus(2);
|
||||||
|
taskHis.setId(null);
|
||||||
|
//将主任务放入到历史表,清空id,防止重复
|
||||||
|
R<IdVo> save = taskHisService.save(taskHis);
|
||||||
|
currTaskServiceBiz.removeById(byId.getId());
|
||||||
|
List<CurrTaskDet> taskDetailsByMainId = currTaskDetService.getTaskDetailsByMainId(IdParam.builder().id(byId.getId()).build());
|
||||||
|
List<TaskDetHis> taskDetHis = com.mt.wms.core.utils.BeanUtils.copyList(taskDetailsByMainId, TaskDetHis.class);
|
||||||
|
taskDetHis.forEach(detHis -> {
|
||||||
|
detHis.setTaskId(save.getData().getId());
|
||||||
|
});
|
||||||
|
//将详细任务信息放入详细历史表
|
||||||
|
taskDetHisService.saveList(taskDetHis);
|
||||||
|
return successful("执行成功。");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,13 +3,11 @@ package com.mt.wms.empty.service.impl;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.mt.wms.basic.params.KilnInfoQueryParam;
|
import com.mt.wms.basic.params.KilnInfoQueryParam;
|
||||||
import com.mt.wms.basic.params.LocationInfoQueryParam;
|
|
||||||
import com.mt.wms.basic.params.VehicleQueryParam;
|
import com.mt.wms.basic.params.VehicleQueryParam;
|
||||||
import com.mt.wms.basic.service.KilnInfoService;
|
import com.mt.wms.basic.service.KilnInfoService;
|
||||||
import com.mt.wms.basic.service.LocationInfoService;
|
import com.mt.wms.basic.service.LocationInfoService;
|
||||||
import com.mt.wms.basic.service.VehicleService;
|
import com.mt.wms.basic.service.VehicleService;
|
||||||
import com.mt.wms.basic.vo.KilnInfoVo;
|
import com.mt.wms.basic.vo.KilnInfoVo;
|
||||||
import com.mt.wms.basic.vo.LocationInfoVo;
|
|
||||||
import com.mt.wms.basic.vo.VehicleVo;
|
import com.mt.wms.basic.vo.VehicleVo;
|
||||||
import com.mt.wms.core.api.Assert;
|
import com.mt.wms.core.api.Assert;
|
||||||
import com.mt.wms.core.base.BaseService;
|
import com.mt.wms.core.base.BaseService;
|
||||||
@ -19,12 +17,13 @@ import com.mt.wms.core.params.IdParam;
|
|||||||
import com.mt.wms.core.vo.PageVo;
|
import com.mt.wms.core.vo.PageVo;
|
||||||
import com.mt.wms.core.vo.R;
|
import com.mt.wms.core.vo.R;
|
||||||
import com.mt.wms.empty.enums.OrderSourceEnum;
|
import com.mt.wms.empty.enums.OrderSourceEnum;
|
||||||
import com.mt.wms.empty.params.OrderParamForApms;
|
|
||||||
import com.mt.wms.empty.params.OrderInfoBasePageParam;
|
import com.mt.wms.empty.params.OrderInfoBasePageParam;
|
||||||
import com.mt.wms.empty.params.OrderInfoPersonCreateParam;
|
import com.mt.wms.empty.params.OrderInfoPersonCreateParam;
|
||||||
import com.mt.wms.empty.params.OrderInfoTaskDetParam;
|
import com.mt.wms.empty.params.OrderInfoTaskDetParam;
|
||||||
|
import com.mt.wms.empty.params.OrderParamForApms;
|
||||||
import com.mt.wms.empty.service.CurrTaskDetService;
|
import com.mt.wms.empty.service.CurrTaskDetService;
|
||||||
import com.mt.wms.empty.service.CurrTaskService;
|
import com.mt.wms.empty.service.CurrTaskService;
|
||||||
|
import com.mt.wms.empty.service.OrderInfoHisService;
|
||||||
import com.mt.wms.empty.service.OrderInfoService;
|
import com.mt.wms.empty.service.OrderInfoService;
|
||||||
import com.mt.wms.empty.vo.CurrTaskVo;
|
import com.mt.wms.empty.vo.CurrTaskVo;
|
||||||
import com.mt.wms.empty.vo.OrderInfoTaskDetVo;
|
import com.mt.wms.empty.vo.OrderInfoTaskDetVo;
|
||||||
@ -53,6 +52,8 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
|
|||||||
@Autowired
|
@Autowired
|
||||||
OrderInfoServiceBiz orderInfoService;
|
OrderInfoServiceBiz orderInfoService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
OrderInfoHisService orderInfoHisService;
|
||||||
@Autowired
|
@Autowired
|
||||||
CurrTaskDetService currTaskDetService;
|
CurrTaskDetService currTaskDetService;
|
||||||
@Autowired
|
@Autowired
|
||||||
@ -100,6 +101,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
|
|||||||
orderInfo.setOrderSource(OrderSourceEnum.PERSON.getValue());
|
orderInfo.setOrderSource(OrderSourceEnum.PERSON.getValue());
|
||||||
orderInfo.setInterCode("PERSONAL"+System.currentTimeMillis());
|
orderInfo.setInterCode("PERSONAL"+System.currentTimeMillis());
|
||||||
orderInfoService.save(orderInfo);
|
orderInfoService.save(orderInfo);
|
||||||
|
//todo 通知apms创建了一个订单
|
||||||
return successful("人工创建订单成功。");
|
return successful("人工创建订单成功。");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,4 +163,22 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
|
|||||||
BeanUtils.copyProperties(one, build);
|
BeanUtils.copyProperties(one, build);
|
||||||
return successful(build);
|
return successful(build);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R completeOrder(IdParam idParam) {
|
||||||
|
OrderInfo byId = orderInfoService.getById(idParam.getId());
|
||||||
|
orderInfoHisService.save(byId);
|
||||||
|
byId.setValid(0);
|
||||||
|
byId.setStatus(2);
|
||||||
|
orderInfoService.updateById(byId);
|
||||||
|
return successful("操作成功。");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R voidOrder(IdParam idParam) {
|
||||||
|
OrderInfo byId = orderInfoService.getById(idParam.getId());
|
||||||
|
byId.setValid(0);
|
||||||
|
orderInfoService.updateById(byId);
|
||||||
|
return successful("操作成功。");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user