修正注解错误导致的swagger问题
添加首页的执行中任务信息 将apms的接口改为无需token
This commit is contained in:
parent
4ddb2b35fb
commit
5f4b5687f1
@ -9,6 +9,7 @@ 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.dal.entity.CommunicationLog;
|
import com.mt.wms.core.dal.entity.CommunicationLog;
|
||||||
import com.mt.wms.core.dal.service.CommunicationLogServiceBiz;
|
import com.mt.wms.core.dal.service.CommunicationLogServiceBiz;
|
||||||
|
import com.mt.wms.core.enums.WhetherEnum;
|
||||||
import com.mt.wms.core.vo.R;
|
import com.mt.wms.core.vo.R;
|
||||||
import com.mt.wms.empty.params.*;
|
import com.mt.wms.empty.params.*;
|
||||||
import com.mt.wms.empty.service.OrderInfoService;
|
import com.mt.wms.empty.service.OrderInfoService;
|
||||||
@ -96,7 +97,7 @@ public class ApmsController extends BaseController {
|
|||||||
* 通过生产单编号删除生产单,如果生产单加工完成,不允许删除
|
* 通过生产单编号删除生产单,如果生产单加工完成,不允许删除
|
||||||
*
|
*
|
||||||
* @param sheetNo 生产单编号
|
* @param sheetNo 生产单编号
|
||||||
* @return
|
* @return 删除结果
|
||||||
*/
|
*/
|
||||||
@PostMapping(value = "deleteBySheetNo")
|
@PostMapping(value = "deleteBySheetNo")
|
||||||
@ApiOperation(value = "通知APMS删除生产单")
|
@ApiOperation(value = "通知APMS删除生产单")
|
||||||
@ -234,4 +235,10 @@ public class ApmsController extends BaseController {
|
|||||||
getApmsToken();
|
getApmsToken();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setCommonField(CommunicationLog communicationLog) {
|
||||||
|
communicationLog.setValid(WhetherEnum.YES.getValue());
|
||||||
|
communicationLog.setCreateTime(LocalDateTime.now());
|
||||||
|
communicationLog.setUpdateTime(LocalDateTime.now());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -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.BasePageParam;
|
||||||
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;
|
||||||
@ -11,6 +12,7 @@ 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.OrderInfoService;
|
import com.mt.wms.empty.service.OrderInfoService;
|
||||||
|
import com.mt.wms.empty.vo.CurrTaskMainQueryVo;
|
||||||
import com.mt.wms.empty.vo.CurrTaskQueryVo;
|
import com.mt.wms.empty.vo.CurrTaskQueryVo;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
@ -50,6 +52,12 @@ public class CurrTaskController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping(value = "mainCurrentTaskNow")
|
||||||
|
@ApiOperation(value = "首页-获取当前执行中的任务")
|
||||||
|
public R<PageVo<CurrTaskMainQueryVo>> mainCurrentTaskNow(BasePageParam param) {
|
||||||
|
return currTaskService.currentTaskMainPage(param);
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping(value = "currentTaskNow")
|
@PostMapping(value = "currentTaskNow")
|
||||||
@ApiOperation(value = "获取当前执行的任务 (车辆名称传id)")
|
@ApiOperation(value = "获取当前执行的任务 (车辆名称传id)")
|
||||||
public R<PageVo<CurrTaskQueryVo>> currentTask(@Validated @RequestBody CurrTaskQueryParam param) {
|
public R<PageVo<CurrTaskQueryVo>> currentTask(@Validated @RequestBody CurrTaskQueryParam param) {
|
||||||
|
@ -32,7 +32,7 @@ public class TaskDetHisController extends BaseController {
|
|||||||
|
|
||||||
@PostMapping(value = "getTaskDet")
|
@PostMapping(value = "getTaskDet")
|
||||||
@ApiOperation(value = "历史执行任务-查看详情")
|
@ApiOperation(value = "历史执行任务-查看详情")
|
||||||
public R<PageVo<TaskHisDetVo>> getTaskDetailsPage(@Validated @RequestBody CurrTaskDetQueryParam currTaskId) {
|
public R<PageVo<TaskHisDetVo>> getTaskDetailsPage(@Validated @RequestBody CurrTaskDetQueryParam param) {
|
||||||
return taskDetHisService.getTaskDetailsPage(currTaskId);
|
return taskDetHisService.getTaskDetailsPage(param);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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.utils.LocalDateTimeUtils;
|
||||||
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.TaskHisQueryParam;
|
import com.mt.wms.empty.params.TaskHisQueryParam;
|
||||||
@ -17,6 +18,8 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author xcc
|
* @author xcc
|
||||||
* @date 2021年11月16日
|
* @date 2021年11月16日
|
||||||
@ -33,6 +36,14 @@ public class TaskHisController extends BaseController {
|
|||||||
@PostMapping(value = "taskHis")
|
@PostMapping(value = "taskHis")
|
||||||
@ApiOperation(value = "获取历史执行的任务 (车辆名称传id)")
|
@ApiOperation(value = "获取历史执行的任务 (车辆名称传id)")
|
||||||
public R<PageVo<TaskHisQueryVo>> currentTask(@Validated @RequestBody TaskHisQueryParam param) {
|
public R<PageVo<TaskHisQueryVo>> currentTask(@Validated @RequestBody TaskHisQueryParam param) {
|
||||||
|
if (Objects.nonNull(param.getStartTime()))
|
||||||
|
{
|
||||||
|
param.setStartTime(LocalDateTimeUtils.getDayStart(param.getStartTime()));
|
||||||
|
}
|
||||||
|
if (Objects.nonNull(param.getEndTime()))
|
||||||
|
{
|
||||||
|
param.setEndTime(LocalDateTimeUtils.getDayEnd(param.getEndTime()));
|
||||||
|
}
|
||||||
return taskHisService.taskHisPage(param);
|
return taskHisService.taskHisPage(param);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ import java.util.List;
|
|||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@ApiModel(value = "Apms创建生产单", description = "Apms创建生产单")
|
@ApiModel(value = "Apms结束生产单", description = "Apms结束生产单")
|
||||||
public class ApmsFinishProcessSheet extends BaseParam {
|
public class ApmsFinishProcessSheet extends BaseParam {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
@ -15,12 +15,11 @@ import lombok.experimental.Accessors;
|
|||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@ApiModel(value = "获取任务信息", description = "获取任务信息")
|
@ApiModel(value = "获取任务详细信息", description = "获取任务详细信息")
|
||||||
public class CurrTaskDetQueryParam extends BasePageParam {
|
public class CurrTaskDetQueryParam extends BasePageParam {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@ApiModelProperty(value = "主任务id",required = true)
|
@ApiModelProperty(value = "主任务id",required = true)
|
||||||
private Long currTaskId;
|
private Long currTaskId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -24,8 +24,8 @@ public class TaskHisQueryParam extends BasePageParam {
|
|||||||
|
|
||||||
@ApiModelProperty(value = "车辆id")
|
@ApiModelProperty(value = "车辆id")
|
||||||
private String vehicleId;
|
private String vehicleId;
|
||||||
@ApiModelProperty(value = "开始时间")
|
@ApiModelProperty(value = "开始时间", example = "2021-11-20T12:05:20")
|
||||||
private LocalDateTime startTime;
|
private LocalDateTime startTime;
|
||||||
@ApiModelProperty(value = "开始时间")
|
@ApiModelProperty(value = "结束时间", example = "2021-11-25T12:05:20")
|
||||||
private LocalDateTime endTime;
|
private LocalDateTime endTime;
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
package com.mt.wms.empty.service;
|
package com.mt.wms.empty.service;
|
||||||
|
|
||||||
|
import com.mt.wms.core.params.BasePageParam;
|
||||||
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.TaskCreateParam;
|
import com.mt.wms.empty.params.TaskCreateParam;
|
||||||
|
import com.mt.wms.empty.vo.CurrTaskMainQueryVo;
|
||||||
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;
|
||||||
|
|
||||||
@ -57,4 +59,11 @@ public interface CurrTaskService {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
R<String> deleteBySheetNo(String sheetNo);
|
R<String> deleteBySheetNo(String sheetNo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页 获取当前执行的任务
|
||||||
|
*
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
R<PageVo<CurrTaskMainQueryVo>> currentTaskMainPage(BasePageParam param);
|
||||||
}
|
}
|
||||||
|
@ -4,11 +4,10 @@ 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.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.*;
|
||||||
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.dal.service.OrderInfoServiceBiz;
|
||||||
|
import com.mt.wms.core.params.BasePageParam;
|
||||||
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;
|
||||||
@ -22,6 +21,7 @@ import com.mt.wms.empty.service.CurrTaskService;
|
|||||||
import com.mt.wms.empty.service.TaskDetHisService;
|
import com.mt.wms.empty.service.TaskDetHisService;
|
||||||
import com.mt.wms.empty.service.TaskHisService;
|
import com.mt.wms.empty.service.TaskHisService;
|
||||||
import com.mt.wms.empty.vo.ApmsEndProcessVo;
|
import com.mt.wms.empty.vo.ApmsEndProcessVo;
|
||||||
|
import com.mt.wms.empty.vo.CurrTaskMainQueryVo;
|
||||||
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.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
@ -30,6 +30,7 @@ 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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -58,6 +59,9 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
|
|||||||
@Autowired
|
@Autowired
|
||||||
ApmsController apmsControl;
|
ApmsController apmsControl;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
OrderInfoServiceBiz orderInfoServiceBiz;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CurrTaskVo getCurrTask(IdParam idParam) {
|
public CurrTaskVo getCurrTask(IdParam idParam) {
|
||||||
CurrTask byId = currTaskServiceBiz.getById(idParam.getId());
|
CurrTask byId = currTaskServiceBiz.getById(idParam.getId());
|
||||||
@ -131,4 +135,36 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
|
|||||||
return failed("无法删除,任务正在执行中。");
|
return failed("无法删除,任务正在执行中。");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<PageVo<CurrTaskMainQueryVo>> currentTaskMainPage(BasePageParam param) {
|
||||||
|
QueryWrapper<CurrTask> currTaskQueryWrapper = new QueryWrapper<>();
|
||||||
|
currTaskQueryWrapper.eq(CurrTask.STATUS, 1);
|
||||||
|
currTaskQueryWrapper.eq(CurrTask.VALID, 1);
|
||||||
|
Page<CurrTask> page = currTaskServiceBiz.page(new Page<>(param.getCurrent(), param.getSize()), currTaskQueryWrapper);
|
||||||
|
PageVo<CurrTaskMainQueryVo> pageVo = new PageVo<>(page, CurrTaskMainQueryVo.class);
|
||||||
|
pageVo.getRecords().forEach(e ->
|
||||||
|
{
|
||||||
|
//根据当前主任务查详细任务
|
||||||
|
List<CurrTaskDet> taskDetailsByMainId = currTaskDetService.getTaskDetailsByMainId(IdParam.builder().id(e.getId()).build());
|
||||||
|
ArrayList<String> materialDes = new ArrayList<>();
|
||||||
|
ArrayList<String> iden = new ArrayList<>();
|
||||||
|
//写入材料名与标识卡号
|
||||||
|
taskDetailsByMainId.forEach(a -> {
|
||||||
|
materialDes.add(a.getMaterialDes());
|
||||||
|
iden.add(a.getIdenCardNum());
|
||||||
|
});
|
||||||
|
e.setMaterials(materialDes);
|
||||||
|
e.setCustomers(iden);
|
||||||
|
ArrayList<String> customers = new ArrayList<>();
|
||||||
|
//根据标识卡号查订单的客户名并写入
|
||||||
|
e.getIdens().forEach(id -> {
|
||||||
|
OrderInfo one = orderInfoServiceBiz.getOne(new QueryWrapper<OrderInfo>().eq(OrderInfo.IDEN_CARD_NUM, id));
|
||||||
|
customers.add(one.getCustomerName());
|
||||||
|
}
|
||||||
|
);
|
||||||
|
e.setCustomers(customers);
|
||||||
|
});
|
||||||
|
return successful(pageVo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,80 @@
|
|||||||
|
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.util.ArrayList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xcc
|
||||||
|
* @date 2021年11月8日
|
||||||
|
* @since 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@Builder
|
||||||
|
@ApiModel(value = "首页当前任务信息", description = "首页当前任务信息")
|
||||||
|
public class CurrTaskMainQueryVo extends BaseVo implements PageVo.ConvertVo {
|
||||||
|
@ApiModelProperty(value = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务编码, 查看任务编码规则
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("任务编码")
|
||||||
|
private String taskCode;
|
||||||
|
/**
|
||||||
|
* 标识卡集
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("标识卡集")
|
||||||
|
private ArrayList<String> idens;
|
||||||
|
/**
|
||||||
|
* 物料集 材料集?
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("物料集")
|
||||||
|
private ArrayList<String> materials;
|
||||||
|
/**
|
||||||
|
* 客户集
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("客户集")
|
||||||
|
private ArrayList<String> customers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态: 0等待执行,1执行中,2执行完成,3追加后完成(追加后就按完成来算)
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务类型:0:入库到窑炉,1:入库到缓存区,2出库到 窑炉到缓存区,3缓存区出库
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("任务类型")
|
||||||
|
private Integer taskType;
|
||||||
|
/**
|
||||||
|
* 开始位置
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("开始位置")
|
||||||
|
private String startPosition;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 目标位置指的是窑炉的位置
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("窑炉位置")
|
||||||
|
private String targetPosition;
|
||||||
|
/**
|
||||||
|
* 库位
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("库位")
|
||||||
|
private String locationName;
|
||||||
|
/**
|
||||||
|
* 窑炉名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("窑炉名称")
|
||||||
|
private String kilnName;
|
||||||
|
}
|
@ -88,6 +88,7 @@ wms:
|
|||||||
- /*/login
|
- /*/login
|
||||||
- /*/wechatLogin
|
- /*/wechatLogin
|
||||||
- /*/mobileLogin
|
- /*/mobileLogin
|
||||||
|
- /apms
|
||||||
|
|
||||||
#公共配置
|
#公共配置
|
||||||
common:
|
common:
|
||||||
|
Loading…
Reference in New Issue
Block a user