修正数据库字段错误。

This commit is contained in:
徐晨晨 2021-12-14 16:05:40 +08:00
parent 169e442af0
commit 336bc29ddc
7 changed files with 95 additions and 47 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

@ -26,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;
@ -90,11 +89,10 @@ 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);
@ -104,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));

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));