生产任务

This commit is contained in:
JinLu.Yin 2022-05-14 22:59:02 +08:00
parent c8ca4e450a
commit 5956298a02
13 changed files with 1016 additions and 3 deletions

View File

@ -0,0 +1,104 @@
package com.ktg.mes.pro.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ktg.common.annotation.Log;
import com.ktg.common.core.controller.BaseController;
import com.ktg.common.core.domain.AjaxResult;
import com.ktg.common.enums.BusinessType;
import com.ktg.mes.pro.domain.ProTask;
import com.ktg.mes.pro.service.IProTaskService;
import com.ktg.common.utils.poi.ExcelUtil;
import com.ktg.common.core.page.TableDataInfo;
/**
* 生产任务Controller
*
* @author yinjinlu
* @date 2022-05-14
*/
@RestController
@RequestMapping("/pro/protask")
public class ProTaskController extends BaseController
{
@Autowired
private IProTaskService proTaskService;
/**
* 查询生产任务列表
*/
@PreAuthorize("@ss.hasPermi('pro:protask:list')")
@GetMapping("/list")
public TableDataInfo list(ProTask proTask)
{
startPage();
List<ProTask> list = proTaskService.selectProTaskList(proTask);
return getDataTable(list);
}
/**
* 导出生产任务列表
*/
@PreAuthorize("@ss.hasPermi('pro:protask:export')")
@Log(title = "生产任务", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ProTask proTask)
{
List<ProTask> list = proTaskService.selectProTaskList(proTask);
ExcelUtil<ProTask> util = new ExcelUtil<ProTask>(ProTask.class);
util.exportExcel(response, list, "生产任务数据");
}
/**
* 获取生产任务详细信息
*/
@PreAuthorize("@ss.hasPermi('pro:protask:query')")
@GetMapping(value = "/{taskId}")
public AjaxResult getInfo(@PathVariable("taskId") Long taskId)
{
return AjaxResult.success(proTaskService.selectProTaskByTaskId(taskId));
}
/**
* 新增生产任务
*/
@PreAuthorize("@ss.hasPermi('pro:protask:add')")
@Log(title = "生产任务", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ProTask proTask)
{
return toAjax(proTaskService.insertProTask(proTask));
}
/**
* 修改生产任务
*/
@PreAuthorize("@ss.hasPermi('pro:protask:edit')")
@Log(title = "生产任务", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ProTask proTask)
{
return toAjax(proTaskService.updateProTask(proTask));
}
/**
* 删除生产任务
*/
@PreAuthorize("@ss.hasPermi('pro:protask:remove')")
@Log(title = "生产任务", businessType = BusinessType.DELETE)
@DeleteMapping("/{taskIds}")
public AjaxResult remove(@PathVariable Long[] taskIds)
{
return toAjax(proTaskService.deleteProTaskByTaskIds(taskIds));
}
}

View File

@ -5,6 +5,7 @@ import java.util.List;
import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.collection.CollUtil;
import com.ktg.common.constant.UserConstants;
import com.ktg.common.utils.StringUtils;
import com.ktg.mes.md.domain.MdProductBom;
import com.ktg.mes.md.service.IMdProductBomService;
@ -89,6 +90,10 @@ public class ProWorkorderController extends BaseController
@PostMapping
public AjaxResult add(@RequestBody ProWorkorder proWorkorder)
{
if(UserConstants.NOT_UNIQUE.equals(proWorkorderService.checkWorkorderCodeUnique(proWorkorder))){
return AjaxResult.error("生产工单编号已存在!");
}
if(proWorkorder.getParentId()==null || proWorkorder.getParentId()==0){
proWorkorder.setAncestors("0");
}

View File

@ -0,0 +1,450 @@
package com.ktg.mes.pro.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ktg.common.annotation.Excel;
import com.ktg.common.core.domain.BaseEntity;
/**
* 生产任务对象 pro_task
*
* @author yinjinlu
* @date 2022-05-14
*/
public class ProTask extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 任务ID */
private Long taskId;
/** 任务编号 */
@Excel(name = "任务编号")
private String taskCode;
/** 任务名称 */
@Excel(name = "任务名称")
private String taskName;
/** 生产工单ID */
@Excel(name = "生产工单ID")
private Long workorderId;
/** 生产工单编号 */
@Excel(name = "生产工单编号")
private String workorderCode;
/** 工单名称 */
@Excel(name = "工单名称")
private String workorderName;
/** 工作站ID */
@Excel(name = "工作站ID")
private Long workstationId;
/** 工作站编号 */
@Excel(name = "工作站编号")
private String workstationCode;
/** 工作站名称 */
@Excel(name = "工作站名称")
private String workstationName;
/** 产品物料ID */
@Excel(name = "产品物料ID")
private Long itemId;
/** 产品物料编码 */
@Excel(name = "产品物料编码")
private String itemCode;
/** 产品物料名称 */
@Excel(name = "产品物料名称")
private String itemName;
/** 规格型号 */
@Excel(name = "规格型号")
private String specification;
/** 单位 */
@Excel(name = "单位")
private String unitOfMeasure;
/** 排产数量 */
@Excel(name = "排产数量")
private BigDecimal quantity;
/** 已生产数量 */
@Excel(name = "已生产数量")
private BigDecimal quantityProduced;
/** 调整数量 */
@Excel(name = "调整数量")
private BigDecimal quantityChanged;
/** 客户ID */
@Excel(name = "客户ID")
private Long clientId;
/** 客户编码 */
@Excel(name = "客户编码")
private String clientCode;
/** 客户名称 */
@Excel(name = "客户名称")
private String clientName;
/** 客户简称 */
@Excel(name = "客户简称")
private String clientNick;
/** 开始生产时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "开始生产时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date startTime;
/** 生产时长 */
@Excel(name = "生产时长")
private Long duration;
/** 完成生产时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "完成生产时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date endTime;
/** 甘特图显示颜色 */
@Excel(name = "甘特图显示颜色")
private String colorCode;
/** 需求日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "需求日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date requestDate;
/** 预留字段1 */
private String attr1;
/** 预留字段2 */
private String attr2;
/** 预留字段3 */
private Long attr3;
/** 预留字段4 */
private Long attr4;
public void setTaskId(Long taskId)
{
this.taskId = taskId;
}
public Long getTaskId()
{
return taskId;
}
public void setTaskCode(String taskCode)
{
this.taskCode = taskCode;
}
public String getTaskCode()
{
return taskCode;
}
public void setTaskName(String taskName)
{
this.taskName = taskName;
}
public String getTaskName()
{
return taskName;
}
public void setWorkorderId(Long workorderId)
{
this.workorderId = workorderId;
}
public Long getWorkorderId()
{
return workorderId;
}
public void setWorkorderCode(String workorderCode)
{
this.workorderCode = workorderCode;
}
public String getWorkorderCode()
{
return workorderCode;
}
public void setWorkorderName(String workorderName)
{
this.workorderName = workorderName;
}
public String getWorkorderName()
{
return workorderName;
}
public void setWorkstationId(Long workstationId)
{
this.workstationId = workstationId;
}
public Long getWorkstationId()
{
return workstationId;
}
public void setWorkstationCode(String workstationCode)
{
this.workstationCode = workstationCode;
}
public String getWorkstationCode()
{
return workstationCode;
}
public void setWorkstationName(String workstationName)
{
this.workstationName = workstationName;
}
public String getWorkstationName()
{
return workstationName;
}
public void setItemId(Long itemId)
{
this.itemId = itemId;
}
public Long getItemId()
{
return itemId;
}
public void setItemCode(String itemCode)
{
this.itemCode = itemCode;
}
public String getItemCode()
{
return itemCode;
}
public void setItemName(String itemName)
{
this.itemName = itemName;
}
public String getItemName()
{
return itemName;
}
public void setSpecification(String specification)
{
this.specification = specification;
}
public String getSpecification()
{
return specification;
}
public void setUnitOfMeasure(String unitOfMeasure)
{
this.unitOfMeasure = unitOfMeasure;
}
public String getUnitOfMeasure()
{
return unitOfMeasure;
}
public void setQuantity(BigDecimal quantity)
{
this.quantity = quantity;
}
public BigDecimal getQuantity()
{
return quantity;
}
public void setQuantityProduced(BigDecimal quantityProduced)
{
this.quantityProduced = quantityProduced;
}
public BigDecimal getQuantityProduced()
{
return quantityProduced;
}
public void setQuantityChanged(BigDecimal quantityChanged)
{
this.quantityChanged = quantityChanged;
}
public BigDecimal getQuantityChanged()
{
return quantityChanged;
}
public void setClientId(Long clientId)
{
this.clientId = clientId;
}
public Long getClientId()
{
return clientId;
}
public void setClientCode(String clientCode)
{
this.clientCode = clientCode;
}
public String getClientCode()
{
return clientCode;
}
public void setClientName(String clientName)
{
this.clientName = clientName;
}
public String getClientName()
{
return clientName;
}
public void setClientNick(String clientNick)
{
this.clientNick = clientNick;
}
public String getClientNick()
{
return clientNick;
}
public void setStartTime(Date startTime)
{
this.startTime = startTime;
}
public Date getStartTime()
{
return startTime;
}
public void setDuration(Long duration)
{
this.duration = duration;
}
public Long getDuration()
{
return duration;
}
public void setEndTime(Date endTime)
{
this.endTime = endTime;
}
public Date getEndTime()
{
return endTime;
}
public void setColorCode(String colorCode)
{
this.colorCode = colorCode;
}
public String getColorCode()
{
return colorCode;
}
public void setRequestDate(Date requestDate)
{
this.requestDate = requestDate;
}
public Date getRequestDate()
{
return requestDate;
}
public void setAttr1(String attr1)
{
this.attr1 = attr1;
}
public String getAttr1()
{
return attr1;
}
public void setAttr2(String attr2)
{
this.attr2 = attr2;
}
public String getAttr2()
{
return attr2;
}
public void setAttr3(Long attr3)
{
this.attr3 = attr3;
}
public Long getAttr3()
{
return attr3;
}
public void setAttr4(Long attr4)
{
this.attr4 = attr4;
}
public Long getAttr4()
{
return attr4;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("taskId", getTaskId())
.append("taskCode", getTaskCode())
.append("taskName", getTaskName())
.append("workorderId", getWorkorderId())
.append("workorderCode", getWorkorderCode())
.append("workorderName", getWorkorderName())
.append("workstationId", getWorkstationId())
.append("workstationCode", getWorkstationCode())
.append("workstationName", getWorkstationName())
.append("itemId", getItemId())
.append("itemCode", getItemCode())
.append("itemName", getItemName())
.append("specification", getSpecification())
.append("unitOfMeasure", getUnitOfMeasure())
.append("quantity", getQuantity())
.append("quantityProduced", getQuantityProduced())
.append("quantityChanged", getQuantityChanged())
.append("clientId", getClientId())
.append("clientCode", getClientCode())
.append("clientName", getClientName())
.append("clientNick", getClientNick())
.append("startTime", getStartTime())
.append("duration", getDuration())
.append("endTime", getEndTime())
.append("colorCode", getColorCode())
.append("requestDate", getRequestDate())
.append("remark", getRemark())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("attr4", getAttr4())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -0,0 +1,62 @@
package com.ktg.mes.pro.mapper;
import java.util.List;
import com.ktg.mes.pro.domain.ProTask;
/**
* 生产任务Mapper接口
*
* @author yinjinlu
* @date 2022-05-14
*/
public interface ProTaskMapper
{
/**
* 查询生产任务
*
* @param taskId 生产任务主键
* @return 生产任务
*/
public ProTask selectProTaskByTaskId(Long taskId);
/**
* 查询生产任务列表
*
* @param proTask 生产任务
* @return 生产任务集合
*/
public List<ProTask> selectProTaskList(ProTask proTask);
/**
* 新增生产任务
*
* @param proTask 生产任务
* @return 结果
*/
public int insertProTask(ProTask proTask);
/**
* 修改生产任务
*
* @param proTask 生产任务
* @return 结果
*/
public int updateProTask(ProTask proTask);
/**
* 删除生产任务
*
* @param taskId 生产任务主键
* @return 结果
*/
public int deleteProTaskByTaskId(Long taskId);
/**
* 批量删除生产任务
*
* @param taskIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteProTaskByTaskIds(Long[] taskIds);
}

View File

@ -27,6 +27,8 @@ public interface ProWorkorderMapper
*/
public List<ProWorkorder> selectProWorkorderList(ProWorkorder proWorkorder);
public ProWorkorder checkWorkorderCodeUnique(ProWorkorder proWorkorder);
/**
* 新增生产工单
*

View File

@ -0,0 +1,61 @@
package com.ktg.mes.pro.service;
import java.util.List;
import com.ktg.mes.pro.domain.ProTask;
/**
* 生产任务Service接口
*
* @author yinjinlu
* @date 2022-05-14
*/
public interface IProTaskService
{
/**
* 查询生产任务
*
* @param taskId 生产任务主键
* @return 生产任务
*/
public ProTask selectProTaskByTaskId(Long taskId);
/**
* 查询生产任务列表
*
* @param proTask 生产任务
* @return 生产任务集合
*/
public List<ProTask> selectProTaskList(ProTask proTask);
/**
* 新增生产任务
*
* @param proTask 生产任务
* @return 结果
*/
public int insertProTask(ProTask proTask);
/**
* 修改生产任务
*
* @param proTask 生产任务
* @return 结果
*/
public int updateProTask(ProTask proTask);
/**
* 批量删除生产任务
*
* @param taskIds 需要删除的生产任务主键集合
* @return 结果
*/
public int deleteProTaskByTaskIds(Long[] taskIds);
/**
* 删除生产任务信息
*
* @param taskId 生产任务主键
* @return 结果
*/
public int deleteProTaskByTaskId(Long taskId);
}

View File

@ -27,6 +27,9 @@ public interface IProWorkorderService
*/
public List<ProWorkorder> selectProWorkorderList(ProWorkorder proWorkorder);
public String checkWorkorderCodeUnique(ProWorkorder proWorkorder);
/**
* 新增生产工单
*

View File

@ -0,0 +1,96 @@
package com.ktg.mes.pro.service.impl;
import java.util.List;
import com.ktg.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ktg.mes.pro.mapper.ProTaskMapper;
import com.ktg.mes.pro.domain.ProTask;
import com.ktg.mes.pro.service.IProTaskService;
/**
* 生产任务Service业务层处理
*
* @author yinjinlu
* @date 2022-05-14
*/
@Service
public class ProTaskServiceImpl implements IProTaskService
{
@Autowired
private ProTaskMapper proTaskMapper;
/**
* 查询生产任务
*
* @param taskId 生产任务主键
* @return 生产任务
*/
@Override
public ProTask selectProTaskByTaskId(Long taskId)
{
return proTaskMapper.selectProTaskByTaskId(taskId);
}
/**
* 查询生产任务列表
*
* @param proTask 生产任务
* @return 生产任务
*/
@Override
public List<ProTask> selectProTaskList(ProTask proTask)
{
return proTaskMapper.selectProTaskList(proTask);
}
/**
* 新增生产任务
*
* @param proTask 生产任务
* @return 结果
*/
@Override
public int insertProTask(ProTask proTask)
{
proTask.setCreateTime(DateUtils.getNowDate());
return proTaskMapper.insertProTask(proTask);
}
/**
* 修改生产任务
*
* @param proTask 生产任务
* @return 结果
*/
@Override
public int updateProTask(ProTask proTask)
{
proTask.setUpdateTime(DateUtils.getNowDate());
return proTaskMapper.updateProTask(proTask);
}
/**
* 批量删除生产任务
*
* @param taskIds 需要删除的生产任务主键
* @return 结果
*/
@Override
public int deleteProTaskByTaskIds(Long[] taskIds)
{
return proTaskMapper.deleteProTaskByTaskIds(taskIds);
}
/**
* 删除生产任务信息
*
* @param taskId 生产任务主键
* @return 结果
*/
@Override
public int deleteProTaskByTaskId(Long taskId)
{
return proTaskMapper.deleteProTaskByTaskId(taskId);
}
}

View File

@ -1,6 +1,8 @@
package com.ktg.mes.pro.service.impl;
import java.util.List;
import com.ktg.common.constant.UserConstants;
import com.ktg.common.utils.DateUtils;
import com.ktg.common.utils.StringUtils;
import com.ktg.mes.dv.domain.DvMachineryType;
@ -46,6 +48,17 @@ public class ProWorkorderServiceImpl implements IProWorkorderService
return proWorkorderMapper.selectProWorkorderList(proWorkorder);
}
@Override
public String checkWorkorderCodeUnique(ProWorkorder proWorkorder) {
ProWorkorder workorder = proWorkorderMapper.checkWorkorderCodeUnique(proWorkorder);
Long workorderId = proWorkorder.getWorkorderId() == null? -1L: proWorkorder.getWorkorderId();
if(StringUtils.isNotNull(workorder) && workorder.getWorkorderId().longValue() != workorderId.longValue()){
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
}
/**
* 新增生产工单
*

View File

@ -0,0 +1,212 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ktg.mes.pro.mapper.ProTaskMapper">
<resultMap type="ProTask" id="ProTaskResult">
<result property="taskId" column="task_id" />
<result property="taskCode" column="task_code" />
<result property="taskName" column="task_name" />
<result property="workorderId" column="workorder_id" />
<result property="workorderCode" column="workorder_code" />
<result property="workorderName" column="workorder_name" />
<result property="workstationId" column="workstation_id" />
<result property="workstationCode" column="workstation_code" />
<result property="workstationName" column="workstation_name" />
<result property="itemId" column="item_id" />
<result property="itemCode" column="item_code" />
<result property="itemName" column="item_name" />
<result property="specification" column="specification" />
<result property="unitOfMeasure" column="unit_of_measure" />
<result property="quantity" column="quantity" />
<result property="quantityProduced" column="quantity_produced" />
<result property="quantityChanged" column="quantity_changed" />
<result property="clientId" column="client_id" />
<result property="clientCode" column="client_code" />
<result property="clientName" column="client_name" />
<result property="clientNick" column="client_nick" />
<result property="startTime" column="start_time" />
<result property="duration" column="duration" />
<result property="endTime" column="end_time" />
<result property="colorCode" column="color_code" />
<result property="requestDate" column="request_date" />
<result property="remark" column="remark" />
<result property="attr1" column="attr1" />
<result property="attr2" column="attr2" />
<result property="attr3" column="attr3" />
<result property="attr4" column="attr4" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectProTaskVo">
select task_id, task_code, task_name, workorder_id, workorder_code, workorder_name, workstation_id, workstation_code, workstation_name, item_id, item_code, item_name, specification, unit_of_measure, quantity, quantity_produced, quantity_changed, client_id, client_code, client_name, client_nick, start_time, duration, end_time, color_code, request_date, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from pro_task
</sql>
<select id="selectProTaskList" parameterType="ProTask" resultMap="ProTaskResult">
<include refid="selectProTaskVo"/>
<where>
<if test="taskCode != null and taskCode != ''"> and task_code = #{taskCode}</if>
<if test="taskName != null and taskName != ''"> and task_name like concat('%', #{taskName}, '%')</if>
<if test="workorderId != null "> and workorder_id = #{workorderId}</if>
<if test="workorderCode != null and workorderCode != ''"> and workorder_code = #{workorderCode}</if>
<if test="workorderName != null and workorderName != ''"> and workorder_name like concat('%', #{workorderName}, '%')</if>
<if test="workstationId != null "> and workstation_id = #{workstationId}</if>
<if test="workstationCode != null and workstationCode != ''"> and workstation_code = #{workstationCode}</if>
<if test="workstationName != null and workstationName != ''"> and workstation_name like concat('%', #{workstationName}, '%')</if>
<if test="itemId != null "> and item_id = #{itemId}</if>
<if test="itemCode != null and itemCode != ''"> and item_code = #{itemCode}</if>
<if test="itemName != null and itemName != ''"> and item_name like concat('%', #{itemName}, '%')</if>
<if test="specification != null and specification != ''"> and specification = #{specification}</if>
<if test="unitOfMeasure != null and unitOfMeasure != ''"> and unit_of_measure = #{unitOfMeasure}</if>
<if test="quantity != null "> and quantity = #{quantity}</if>
<if test="quantityProduced != null "> and quantity_produced = #{quantityProduced}</if>
<if test="quantityChanged != null "> and quantity_changed = #{quantityChanged}</if>
<if test="clientId != null "> and client_id = #{clientId}</if>
<if test="clientCode != null and clientCode != ''"> and client_code = #{clientCode}</if>
<if test="clientName != null and clientName != ''"> and client_name like concat('%', #{clientName}, '%')</if>
<if test="clientNick != null and clientNick != ''"> and client_nick = #{clientNick}</if>
<if test="startTime != null "> and start_time = #{startTime}</if>
<if test="duration != null "> and duration = #{duration}</if>
<if test="endTime != null "> and end_time = #{endTime}</if>
<if test="colorCode != null and colorCode != ''"> and color_code = #{colorCode}</if>
<if test="requestDate != null "> and request_date = #{requestDate}</if>
</where>
</select>
<select id="selectProTaskByTaskId" parameterType="Long" resultMap="ProTaskResult">
<include refid="selectProTaskVo"/>
where task_id = #{taskId}
</select>
<insert id="insertProTask" parameterType="ProTask" useGeneratedKeys="true" keyProperty="taskId">
insert into pro_task
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="taskCode != null and taskCode != ''">task_code,</if>
<if test="taskName != null and taskName != ''">task_name,</if>
<if test="workorderId != null">workorder_id,</if>
<if test="workorderCode != null and workorderCode != ''">workorder_code,</if>
<if test="workorderName != null and workorderName != ''">workorder_name,</if>
<if test="workstationId != null">workstation_id,</if>
<if test="workstationCode != null and workstationCode != ''">workstation_code,</if>
<if test="workstationName != null and workstationName != ''">workstation_name,</if>
<if test="itemId != null">item_id,</if>
<if test="itemCode != null and itemCode != ''">item_code,</if>
<if test="itemName != null and itemName != ''">item_name,</if>
<if test="specification != null">specification,</if>
<if test="unitOfMeasure != null and unitOfMeasure != ''">unit_of_measure,</if>
<if test="quantity != null">quantity,</if>
<if test="quantityProduced != null">quantity_produced,</if>
<if test="quantityChanged != null">quantity_changed,</if>
<if test="clientId != null">client_id,</if>
<if test="clientCode != null and clientCode != ''">client_code,</if>
<if test="clientName != null and clientName != ''">client_name,</if>
<if test="clientNick != null">client_nick,</if>
<if test="startTime != null">start_time,</if>
<if test="duration != null">duration,</if>
<if test="endTime != null">end_time,</if>
<if test="colorCode != null">color_code,</if>
<if test="requestDate != null">request_date,</if>
<if test="remark != null">remark,</if>
<if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if>
<if test="attr3 != null">attr3,</if>
<if test="attr4 != null">attr4,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="taskCode != null and taskCode != ''">#{taskCode},</if>
<if test="taskName != null and taskName != ''">#{taskName},</if>
<if test="workorderId != null">#{workorderId},</if>
<if test="workorderCode != null and workorderCode != ''">#{workorderCode},</if>
<if test="workorderName != null and workorderName != ''">#{workorderName},</if>
<if test="workstationId != null">#{workstationId},</if>
<if test="workstationCode != null and workstationCode != ''">#{workstationCode},</if>
<if test="workstationName != null and workstationName != ''">#{workstationName},</if>
<if test="itemId != null">#{itemId},</if>
<if test="itemCode != null and itemCode != ''">#{itemCode},</if>
<if test="itemName != null and itemName != ''">#{itemName},</if>
<if test="specification != null">#{specification},</if>
<if test="unitOfMeasure != null and unitOfMeasure != ''">#{unitOfMeasure},</if>
<if test="quantity != null">#{quantity},</if>
<if test="quantityProduced != null">#{quantityProduced},</if>
<if test="quantityChanged != null">#{quantityChanged},</if>
<if test="clientId != null">#{clientId},</if>
<if test="clientCode != null and clientCode != ''">#{clientCode},</if>
<if test="clientName != null and clientName != ''">#{clientName},</if>
<if test="clientNick != null">#{clientNick},</if>
<if test="startTime != null">#{startTime},</if>
<if test="duration != null">#{duration},</if>
<if test="endTime != null">#{endTime},</if>
<if test="colorCode != null">#{colorCode},</if>
<if test="requestDate != null">#{requestDate},</if>
<if test="remark != null">#{remark},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>
<if test="attr3 != null">#{attr3},</if>
<if test="attr4 != null">#{attr4},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateProTask" parameterType="ProTask">
update pro_task
<trim prefix="SET" suffixOverrides=",">
<if test="taskCode != null and taskCode != ''">task_code = #{taskCode},</if>
<if test="taskName != null and taskName != ''">task_name = #{taskName},</if>
<if test="workorderId != null">workorder_id = #{workorderId},</if>
<if test="workorderCode != null and workorderCode != ''">workorder_code = #{workorderCode},</if>
<if test="workorderName != null and workorderName != ''">workorder_name = #{workorderName},</if>
<if test="workstationId != null">workstation_id = #{workstationId},</if>
<if test="workstationCode != null and workstationCode != ''">workstation_code = #{workstationCode},</if>
<if test="workstationName != null and workstationName != ''">workstation_name = #{workstationName},</if>
<if test="itemId != null">item_id = #{itemId},</if>
<if test="itemCode != null and itemCode != ''">item_code = #{itemCode},</if>
<if test="itemName != null and itemName != ''">item_name = #{itemName},</if>
<if test="specification != null">specification = #{specification},</if>
<if test="unitOfMeasure != null and unitOfMeasure != ''">unit_of_measure = #{unitOfMeasure},</if>
<if test="quantity != null">quantity = #{quantity},</if>
<if test="quantityProduced != null">quantity_produced = #{quantityProduced},</if>
<if test="quantityChanged != null">quantity_changed = #{quantityChanged},</if>
<if test="clientId != null">client_id = #{clientId},</if>
<if test="clientCode != null and clientCode != ''">client_code = #{clientCode},</if>
<if test="clientName != null and clientName != ''">client_name = #{clientName},</if>
<if test="clientNick != null">client_nick = #{clientNick},</if>
<if test="startTime != null">start_time = #{startTime},</if>
<if test="duration != null">duration = #{duration},</if>
<if test="endTime != null">end_time = #{endTime},</if>
<if test="colorCode != null">color_code = #{colorCode},</if>
<if test="requestDate != null">request_date = #{requestDate},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if>
<if test="attr3 != null">attr3 = #{attr3},</if>
<if test="attr4 != null">attr4 = #{attr4},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where task_id = #{taskId}
</update>
<delete id="deleteProTaskByTaskId" parameterType="Long">
delete from pro_task where task_id = #{taskId}
</delete>
<delete id="deleteProTaskByTaskIds" parameterType="String">
delete from pro_task where task_id in
<foreach item="taskId" collection="array" open="(" separator="," close=")">
#{taskId}
</foreach>
</delete>
</mapper>

View File

@ -65,7 +65,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectProWorkorderVo"/>
where workorder_id = #{workorderId}
</select>
<select id="checkWorkorderCodeUnique" parameterType="ProWorkorder" resultMap="ProWorkorderResult">
<include refid="selectProWorkorderVo"/>
where workorder_code = #{workorderCode} limit 1
</select>
<insert id="insertProWorkorder" parameterType="ProWorkorder" useGeneratedKeys="true" keyProperty="workorderId">
insert into pro_workorder
<trim prefix="(" suffix=")" suffixOverrides=",">

View File

@ -123,7 +123,7 @@ public class AutoCodeUtil {
rs.setLastInputChar(inputChar);
iAutoCodeResultService.saveAutoCodeResult(rs);
}else{
//直接更新对应的记录我们默认一个RULE_CODE只有一种方式
//直接更新对应的记录我们默认非流水号模式下一个RULE_CODE只有一种方式
SysAutoCodeResult bo = new SysAutoCodeResult();
bo.setRuleId(rule.getRuleId());
List<SysAutoCodeResult> results = iAutoCodeResultService.list(bo);

View File

@ -37,7 +37,7 @@
<if test="genDate != null and genDate != ''">
AND gen_date like concat(#{genDate},'%')
</if>
order by gen_index asc
order by gen_date desc
</select>
<insert id="add" parameterType="SysAutoCodeResult" >