This commit is contained in:
李广豪 2021-12-14 18:42:05 +08:00
commit be40d7ede1
13 changed files with 127 additions and 59 deletions

View File

@ -106,7 +106,8 @@ public class MyGenerator {
@Test
public void generateCodeWithInjectConfigForAllTable() {
generateByTablesWithInjectConfig(new String[]{"t_in_stock_info"});
generateByTablesWithInjectConfig(new String[]{"t_curr_task"});
generateByTablesWithInjectConfig(new String[]{"t_task_his"});
}
public static void main(String[] args) {

View File

@ -1,18 +1,14 @@
package com.mt.wms.core.dal.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* <p>
* 任务表
@ -214,6 +210,24 @@ public class CurrTask extends Model<CurrTask> {
@TableField("task_code")
private String taskCode;
/**
* 生产单号 APMS生成生产单后返回
*/
@TableField("sheet_no")
private String sheetNo;
/**
* 任务类型0:入库到窑炉1:入库到缓存区2出库到 窑炉到缓存区3缓存区出库
*/
@TableField("task_type")
private Integer taskType;
/**
* 加工类型0 初始加工1 复加工
*/
@TableField("process_type")
private Integer processType;
public static final String ID = "id";
@ -277,6 +291,12 @@ public class CurrTask extends Model<CurrTask> {
public static final String TASK_CODE = "task_code";
public static final String SHEET_NO = "sheet_no";
public static final String TASK_TYPE = "task_type";
public static final String PROCESS_TYPE = "process_type";
@Override
protected Serializable pkVal() {
return this.id;

View File

@ -1,18 +1,14 @@
package com.mt.wms.core.dal.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* <p>
* 任务历史表
@ -214,6 +210,24 @@ public class TaskHis extends Model<TaskHis> {
@TableField("task_code")
private String taskCode;
/**
* 加工类型0 初始加工1 复加工
*/
@TableField("process_type")
private Integer processType;
/**
* 任务类型0:入库到窑炉1:入库到缓存区2出库到 窑炉到缓存区3缓存区出库
*/
@TableField("task_type")
private Integer taskType;
/**
* 生产单号 APMS生成生产单后返回
*/
@TableField("sheet_no")
private String sheetNo;
public static final String ID = "id";
@ -277,6 +291,12 @@ public class TaskHis extends Model<TaskHis> {
public static final String TASK_CODE = "task_code";
public static final String PROCESS_TYPE = "process_type";
public static final String TASK_TYPE = "task_type";
public static final String SHEET_NO = "sheet_no";
@Override
protected Serializable pkVal() {
return this.id;

View File

@ -25,21 +25,27 @@
<result column="run_task_id" property="runTaskId" />
<result column="start_position" property="startPosition" />
<result column="target_position" property="targetPosition" />
<result column="is_cache" property="isCache" />
<result column="cache_satatus" property="cacheSatatus" />
<result column="cache_run_task_id" property="cacheRunTaskId" />
<result column="location_id" property="locationId" />
<result column="location_name" property="locationName" />
<result column="is_out" property="isOut" />
<result column="out_run_task_id" property="outRunTaskId" />
<result column="out_start_position" property="outStartPosition" />
<result column="out_target_position" property="outTargetPosition" />
<result column="task_code" property="taskCode" />
<result column="is_cache" property="isCache"/>
<result column="cache_satatus" property="cacheSatatus"/>
<result column="cache_run_task_id" property="cacheRunTaskId"/>
<result column="location_id" property="locationId"/>
<result column="location_name" property="locationName"/>
<result column="is_out" property="isOut"/>
<result column="out_run_task_id" property="outRunTaskId"/>
<result column="out_start_position" property="outStartPosition"/>
<result column="out_target_position" property="outTargetPosition"/>
<result column="task_code" property="taskCode"/>
<result column="sheet_no" property="sheetNo"/>
<result column="task_type" property="taskType"/>
<result column="process_type" property="processType"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, valid, create_time, creator_id, updater_id, update_time, version, status, inter_code, is_auto, auto_exe_task_id, kiln_id, kiln_name, craft_code_id, plc_value, begin_time, end_time, is_in, run_task_id, start_position, target_position, is_cache, cache_satatus, cache_run_task_id, location_id, location_name, is_out, out_run_task_id, out_start_position, out_target_position, task_code
id, valid, create_time, creator_id, updater_id, update_time, version, status, inter_code, is_auto,
auto_exe_task_id, kiln_id, kiln_name, craft_code_id, plc_value, begin_time, end_time, is_in, run_task_id,
start_position, target_position, is_cache, cache_satatus, cache_run_task_id, location_id, location_name, is_out,
out_run_task_id, out_start_position, out_target_position, task_code, sheet_no, task_type, process_type
</sql>
</mapper>

View File

@ -25,21 +25,27 @@
<result column="run_task_id" property="runTaskId" />
<result column="start_position" property="startPosition" />
<result column="target_position" property="targetPosition" />
<result column="is_cache" property="isCache" />
<result column="cache_satatus" property="cacheSatatus" />
<result column="cache_run_task_id" property="cacheRunTaskId" />
<result column="location_id" property="locationId" />
<result column="location_name" property="locationName" />
<result column="is_out" property="isOut" />
<result column="out_run_task_id" property="outRunTaskId" />
<result column="out_start_position" property="outStartPosition" />
<result column="out_target_position" property="outTargetPosition" />
<result column="task_code" property="taskCode" />
<result column="is_cache" property="isCache"/>
<result column="cache_satatus" property="cacheSatatus"/>
<result column="cache_run_task_id" property="cacheRunTaskId"/>
<result column="location_id" property="locationId"/>
<result column="location_name" property="locationName"/>
<result column="is_out" property="isOut"/>
<result column="out_run_task_id" property="outRunTaskId"/>
<result column="out_start_position" property="outStartPosition"/>
<result column="out_target_position" property="outTargetPosition"/>
<result column="task_code" property="taskCode"/>
<result column="process_type" property="processType"/>
<result column="task_type" property="taskType"/>
<result column="sheet_no" property="sheetNo"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, valid, create_time, creator_id, updater_id, update_time, version, status, inter_code, is_auto, auto_exe_task_id, kiln_id, kiln_name, craft_code_id, plc_value, begin_time, end_time, is_in, run_task_id, start_position, target_position, is_cache, cache_satatus, cache_run_task_id, location_id, location_name, is_out, out_run_task_id, out_start_position, out_target_position, task_code
id, valid, create_time, creator_id, updater_id, update_time, version, status, inter_code, is_auto,
auto_exe_task_id, kiln_id, kiln_name, craft_code_id, plc_value, begin_time, end_time, is_in, run_task_id,
start_position, target_position, is_cache, cache_satatus, cache_run_task_id, location_id, location_name, is_out,
out_run_task_id, out_start_position, out_target_position, task_code, process_type, task_type, sheet_no
</sql>
</mapper>

View File

@ -79,11 +79,11 @@ public class ApmsController extends BaseController {
}
@PostMapping(value = "apmsCompleteOrder")
@ApiOperation(value = "APMS完成订单,返回加工单检验结果")
@ApiOperation(value = "APMS返回加工单检验结果")
public R<String> apmsCompleteOrder(@Validated @RequestBody ApmsCompleteOrder apmsCompleteOrder) {
CommunicationLog communicationLog = new CommunicationLog();
communicationLog.setCode("APMS" + System.currentTimeMillis());
communicationLog.setLogName("APMS完成订单,返回WMS加工单检验结果");
communicationLog.setLogName("APMS返回WMS加工单检验结果");
communicationLog.setType(3);
communicationLog.setContent(apmsCompleteOrder.toString());
setCommonField(communicationLog);

View File

@ -35,7 +35,7 @@ public class OrderInfoController extends BaseController {
private OrderInfoService orderInfoService;
@PostMapping(value = "page")
@ApiOperation(value = "订单加工管理-获取分页订单信息")
@ApiOperation(value = "订单加工管理-当前订单列表")
private R<PageVo<OrderInfoVo>> page(@Validated({PageGroup.class, Default.class}) @RequestBody OrderInfoBasePageParam orderBaseParam) {
return orderInfoService.page(orderBaseParam);
}
@ -44,7 +44,7 @@ public class OrderInfoController extends BaseController {
* 应该没有人工创建信息这个接口
*/
@PostMapping(value = "personCreateOrder")
@ApiOperation(value = "人工创建订单信息")
@ApiOperation(value = "人工创建订单信息", hidden = true)
@Deprecated
private R<String> personCreateOrder(@Validated({Default.class}) @RequestBody OrderInfoPersonCreateParam orderInfoPersonCreateParam) {
return orderInfoService.personCreateOrder(orderInfoPersonCreateParam);
@ -71,7 +71,6 @@ public class OrderInfoController extends BaseController {
@PostMapping(value = "completeOrder")
@ApiOperation(value = "人工完成订单不需通知apms仅在wms完成")
@Deprecated
private R<String> completeOrder(@Validated @RequestBody IdParam idParam) {
return orderInfoService.completeOrder(idParam);
}

View File

@ -23,13 +23,18 @@ public class OrderParamForApms extends BaseParam {
/**
* 订单号APMS系统获取
*/
@ApiModelProperty(value = "订单号", required = true)
@ApiModelProperty(value = "订单号", required = true)
private String orderNo;
/**
* 原订单号一般为空如果存在信息则为返工单 APMS系统获取
*/
@ApiModelProperty(value = "原订单号", required = false)
private String oldOrderNo;
/**
* 标识卡号APMS系统获取
*/
@ApiModelProperty(value = "标识卡号", required = true)
@ApiModelProperty(value = "标识卡号", required = true)
private String idenCardNum;
/**

View File

@ -9,6 +9,7 @@ import com.mt.wms.core.dal.service.CurrTaskDetServiceBiz;
import com.mt.wms.core.dal.service.OrderInfoServiceBiz;
import com.mt.wms.core.params.IdParam;
import com.mt.wms.core.utils.BeanUtils;
import com.mt.wms.core.utils.IDGenerator;
import com.mt.wms.core.vo.PageVo;
import com.mt.wms.core.vo.R;
import com.mt.wms.empty.params.CurrTaskDetQueryParam;
@ -59,6 +60,7 @@ public class CurrTaskDetServiceImpl extends BaseService implements CurrTaskDetSe
List<CurrTaskDet> params = BeanUtils.copyList(taskDet, CurrTaskDet.class);
params.forEach(param -> {
param.setCurrTaskId(taskId);
param.setInterCode(IDGenerator.gen("RWDET", IDGenerator.PATTERN_YYYYMMDDHHMM, 2, "TASK_DET_CODE"));
setCommonField(param);
});
currTaskDetServiceBiz.saveBatch(params);

View File

@ -10,6 +10,7 @@ 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.utils.IDGenerator;
import com.mt.wms.core.vo.IdVo;
import com.mt.wms.core.vo.PageVo;
import com.mt.wms.core.vo.R;
@ -25,7 +26,6 @@ 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.CurrTaskVo;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -89,11 +89,11 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
CurrTask currTask = new CurrTask();
BeanUtils.copyProperties(param, currTask);
currTask.setTaskType(TaskTypeEnum.WTK.getValue());
currTask.setTaskSource(0);
//根据工艺号查询工艺id以及工艺plc值
CraftInfo one = craftInfoServiceBiz.getOne(new QueryWrapper<CraftInfo>().eq(CraftInfo.CREATOR_ID, param.getCraftCode()));
currTask.setFCraftCodeId(one.getId());
currTask.setFPlcValue(one.getPlcValue());
currTask.setCraftCodeId(one.getId());
currTask.setPlcValue(one.getPlcValue());
currTask.setInterCode(IDGenerator.gen("RW", IDGenerator.PATTERN_YYYYMMDDHHMM, 2, "TASK_CODE"));
setCommonField(currTask);
currTaskServiceBiz.save(currTask);
return successful(IdVo.builder().id(currTask.getId()).build());
@ -102,7 +102,6 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
@Override
public R<PageVo<CurrTaskQueryVo>> currentTaskPage(CurrTaskQueryParam param) {
QueryWrapper<CurrTask> currTaskQueryWrapper = new QueryWrapper<>();
currTaskQueryWrapper.eq(StringUtils.isNotBlank(param.getVehicleId()), CurrTask.VEHICLE_ID, param.getVehicleId());
currTaskQueryWrapper.eq(CurrTask.VALID, 1);
Page<CurrTask> page = currTaskServiceBiz.page(new Page<>(param.getCurrent(), param.getSize()), currTaskQueryWrapper);
return successful(new PageVo<>(page, CurrTaskQueryVo.class));
@ -115,6 +114,8 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
BeanUtils.copyProperties(byId, taskHis);
taskHis.setStatus(2);
taskHis.setId(null);
taskHis.setInterCode(IDGenerator.gen("RWHIS", IDGenerator.PATTERN_YYYYMMDDHHMM, 2, "TASKHIS_CODE"));
setCommonField(taskHis);
//将主任务放入到历史表清空id防止重复
R<IdVo> save = taskHisService.save(taskHis);
byId.setValid(0);

View File

@ -19,6 +19,7 @@ import com.mt.wms.core.dal.service.CommunicationLogServiceBiz;
import com.mt.wms.core.dal.service.OrderInfoServiceBiz;
import com.mt.wms.core.enums.WhetherEnum;
import com.mt.wms.core.params.IdParam;
import com.mt.wms.core.utils.IDGenerator;
import com.mt.wms.core.vo.PageVo;
import com.mt.wms.core.vo.R;
import com.mt.wms.empty.controller.ApmsController;
@ -87,7 +88,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
setCommonField(orderInfo);
//设定来源信息为apms
orderInfo.setOrderSource(OrderSourceEnum.APMS.getValue());
orderInfo.setInterCode("APMS" + System.currentTimeMillis());
orderInfo.setInterCode(IDGenerator.gen("DD", IDGenerator.PATTERN_YYYYMMDDHHMM, 2, "ORDER_CODE"));
orderInfoService.save(orderInfo);
return successful("Wms接收Apms订单成功。");
}
@ -236,19 +237,24 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
@Override
public R<String> completeOrder(IdParam idParam) {
OrderInfo byId = orderInfoService.getById(idParam.getId());
orderInfoHisService.save(byId);
byId.setValid(0);
byId.setStatus(2);
orderInfoService.updateById(byId);
return successful("订单状态成功置为完成。");
byId.setId(null);
byId.setValid(1);
byId.setInterCode(IDGenerator.gen("DDHIS", IDGenerator.PATTERN_YYYYMMDDHHMM, 2, "ORDER_HIS_CODE"));
setCommonField(byId);
orderInfoHisService.save(byId);
return successful("成功,订单状态置为完成。");
}
@Override
public R<String> voidOrder(IdParam idParam) {
OrderInfo byId = orderInfoService.getById(idParam.getId());
byId.setUpdateTime(LocalDateTime.now());
byId.setValid(0);
orderInfoService.updateById(byId);
return successful("订单状态成功置为作废。");
return successful("成功,订单状态置为作废。");
}
@Override

View File

@ -13,7 +13,6 @@ import com.mt.wms.empty.params.TaskHisQueryParam;
import com.mt.wms.empty.service.TaskHisService;
import com.mt.wms.empty.vo.CurrTaskVo;
import com.mt.wms.empty.vo.TaskHisQueryVo;
import jodd.util.StringUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -53,8 +52,7 @@ public class TaskHisServiceImpl extends BaseService implements TaskHisService {
@Override
public R<PageVo<TaskHisQueryVo>> taskHisPage(TaskHisQueryParam param) {
QueryWrapper<TaskHis> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(StringUtil.isNotBlank(param.getVehicleId()), TaskHis.VEHICLE_ID, param.getVehicleId())
.between(Objects.nonNull(param.getStartTime()) && Objects.nonNull(param.getEndTime()), TaskHis.CREATE_TIME, param.getStartTime(), param.getEndTime())
queryWrapper.between(Objects.nonNull(param.getStartTime()) && Objects.nonNull(param.getEndTime()), TaskHis.CREATE_TIME, param.getStartTime(), param.getEndTime())
.eq(TaskHis.VALID, 1).orderByDesc(TaskHis.CREATE_TIME);
Page<TaskHis> page = taskHisService.page(new Page<>(param.getCurrent(), param.getSize()), queryWrapper);
return successful(new PageVo<>(page, TaskHisQueryVo.class));

View File

@ -28,6 +28,10 @@ public class OrderInfoVo extends BaseVo implements PageVo.ConvertVo {
*/
@ApiModelProperty(value = "主键")
private Long id;
@ApiModelProperty(value = "订单状态")
private Integer valid;
/**
* 来源1.APMS 2.人工输入
*/