工艺路线组成
This commit is contained in:
parent
fdab5b010e
commit
0273ad1871
@ -0,0 +1,112 @@
|
|||||||
|
package com.ktg.mes.pro.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.ktg.common.constant.UserConstants;
|
||||||
|
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.ProRouteProcess;
|
||||||
|
import com.ktg.mes.pro.service.IProRouteProcessService;
|
||||||
|
import com.ktg.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ktg.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺组成Controller
|
||||||
|
*
|
||||||
|
* @author yinjinlu
|
||||||
|
* @date 2022-05-13
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/mes/pro/routeprocess")
|
||||||
|
public class ProRouteProcessController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IProRouteProcessService proRouteProcessService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工艺组成列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('mes:pro:routeprocess:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(ProRouteProcess proRouteProcess)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<ProRouteProcess> list = proRouteProcessService.selectProRouteProcessList(proRouteProcess);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出工艺组成列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('mes:pro:routeprocess:export')")
|
||||||
|
@Log(title = "工艺组成", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, ProRouteProcess proRouteProcess)
|
||||||
|
{
|
||||||
|
List<ProRouteProcess> list = proRouteProcessService.selectProRouteProcessList(proRouteProcess);
|
||||||
|
ExcelUtil<ProRouteProcess> util = new ExcelUtil<ProRouteProcess>(ProRouteProcess.class);
|
||||||
|
util.exportExcel(response, list, "工艺组成数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取工艺组成详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('mes:pro:routeprocess:query')")
|
||||||
|
@GetMapping(value = "/{recordId}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("recordId") Long recordId)
|
||||||
|
{
|
||||||
|
return AjaxResult.success(proRouteProcessService.selectProRouteProcessByRecordId(recordId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增工艺组成
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('mes:pro:routeprocess:add')")
|
||||||
|
@Log(title = "工艺组成", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody ProRouteProcess proRouteProcess)
|
||||||
|
{
|
||||||
|
if(UserConstants.NOT_UNIQUE.equals(proRouteProcessService.checkOrderNumExists(proRouteProcess))){
|
||||||
|
return AjaxResult.error("序号已存在!");
|
||||||
|
}
|
||||||
|
return toAjax(proRouteProcessService.insertProRouteProcess(proRouteProcess));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改工艺组成
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('mes:pro:routeprocess:edit')")
|
||||||
|
@Log(title = "工艺组成", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody ProRouteProcess proRouteProcess)
|
||||||
|
{
|
||||||
|
if(UserConstants.NOT_UNIQUE.equals(proRouteProcessService.checkOrderNumExists(proRouteProcess))){
|
||||||
|
return AjaxResult.error("序号已存在!");
|
||||||
|
}
|
||||||
|
return toAjax(proRouteProcessService.updateProRouteProcess(proRouteProcess));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除工艺组成
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('mes:pro:routeprocess:remove')")
|
||||||
|
@Log(title = "工艺组成", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{recordIds}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] recordIds)
|
||||||
|
{
|
||||||
|
return toAjax(proRouteProcessService.deleteProRouteProcessByRecordIds(recordIds));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,262 @@
|
|||||||
|
package com.ktg.mes.pro.domain;
|
||||||
|
|
||||||
|
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_route_process
|
||||||
|
*
|
||||||
|
* @author yinjinlu
|
||||||
|
* @date 2022-05-13
|
||||||
|
*/
|
||||||
|
public class ProRouteProcess extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 记录ID */
|
||||||
|
private Long recordId;
|
||||||
|
|
||||||
|
/** 工艺路线ID */
|
||||||
|
@Excel(name = "工艺路线ID")
|
||||||
|
private Long routeId;
|
||||||
|
|
||||||
|
/** 工序ID */
|
||||||
|
@Excel(name = "工序ID")
|
||||||
|
private Long processId;
|
||||||
|
|
||||||
|
/** 工序编码 */
|
||||||
|
@Excel(name = "工序编码")
|
||||||
|
private String processCode;
|
||||||
|
|
||||||
|
/** 工序名称 */
|
||||||
|
@Excel(name = "工序名称")
|
||||||
|
private String processName;
|
||||||
|
|
||||||
|
/** 序号 */
|
||||||
|
@Excel(name = "序号")
|
||||||
|
private Integer orderNum;
|
||||||
|
|
||||||
|
/** 工序ID */
|
||||||
|
@Excel(name = "工序ID")
|
||||||
|
private Long nextProcessId;
|
||||||
|
|
||||||
|
/** 工序编码 */
|
||||||
|
@Excel(name = "工序编码")
|
||||||
|
private String nextProcessCode;
|
||||||
|
|
||||||
|
/** 工序名称 */
|
||||||
|
@Excel(name = "工序名称")
|
||||||
|
private String nextProcessName;
|
||||||
|
|
||||||
|
/** 与下一道工序关系 */
|
||||||
|
@Excel(name = "与下一道工序关系")
|
||||||
|
private String linkType;
|
||||||
|
|
||||||
|
/** 准备时间 */
|
||||||
|
@Excel(name = "准备时间")
|
||||||
|
private Long defaultPreTime;
|
||||||
|
|
||||||
|
/** 等待时间 */
|
||||||
|
@Excel(name = "等待时间")
|
||||||
|
private Long defaultSufTime;
|
||||||
|
|
||||||
|
/** 甘特图显示颜色 */
|
||||||
|
@Excel(name = "甘特图显示颜色")
|
||||||
|
private String colorCode;
|
||||||
|
|
||||||
|
/** 预留字段1 */
|
||||||
|
private String attr1;
|
||||||
|
|
||||||
|
/** 预留字段2 */
|
||||||
|
private String attr2;
|
||||||
|
|
||||||
|
/** 预留字段3 */
|
||||||
|
private Long attr3;
|
||||||
|
|
||||||
|
/** 预留字段4 */
|
||||||
|
private Long attr4;
|
||||||
|
|
||||||
|
public void setRecordId(Long recordId)
|
||||||
|
{
|
||||||
|
this.recordId = recordId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getRecordId()
|
||||||
|
{
|
||||||
|
return recordId;
|
||||||
|
}
|
||||||
|
public void setRouteId(Long routeId)
|
||||||
|
{
|
||||||
|
this.routeId = routeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getRouteId()
|
||||||
|
{
|
||||||
|
return routeId;
|
||||||
|
}
|
||||||
|
public void setProcessId(Long processId)
|
||||||
|
{
|
||||||
|
this.processId = processId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getProcessId()
|
||||||
|
{
|
||||||
|
return processId;
|
||||||
|
}
|
||||||
|
public void setProcessCode(String processCode)
|
||||||
|
{
|
||||||
|
this.processCode = processCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProcessCode()
|
||||||
|
{
|
||||||
|
return processCode;
|
||||||
|
}
|
||||||
|
public void setProcessName(String processName)
|
||||||
|
{
|
||||||
|
this.processName = processName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProcessName()
|
||||||
|
{
|
||||||
|
return processName;
|
||||||
|
}
|
||||||
|
public void setOrderNum(Integer orderNum)
|
||||||
|
{
|
||||||
|
this.orderNum = orderNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getOrderNum()
|
||||||
|
{
|
||||||
|
return orderNum;
|
||||||
|
}
|
||||||
|
public void setNextProcessId(Long nextProcessId)
|
||||||
|
{
|
||||||
|
this.nextProcessId = nextProcessId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getNextProcessId()
|
||||||
|
{
|
||||||
|
return nextProcessId;
|
||||||
|
}
|
||||||
|
public void setNextProcessCode(String nextProcessCode)
|
||||||
|
{
|
||||||
|
this.nextProcessCode = nextProcessCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNextProcessCode()
|
||||||
|
{
|
||||||
|
return nextProcessCode;
|
||||||
|
}
|
||||||
|
public void setNextProcessName(String nextProcessName)
|
||||||
|
{
|
||||||
|
this.nextProcessName = nextProcessName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNextProcessName()
|
||||||
|
{
|
||||||
|
return nextProcessName;
|
||||||
|
}
|
||||||
|
public void setLinkType(String linkType)
|
||||||
|
{
|
||||||
|
this.linkType = linkType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLinkType()
|
||||||
|
{
|
||||||
|
return linkType;
|
||||||
|
}
|
||||||
|
public void setDefaultPreTime(Long defaultPreTime)
|
||||||
|
{
|
||||||
|
this.defaultPreTime = defaultPreTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getDefaultPreTime()
|
||||||
|
{
|
||||||
|
return defaultPreTime;
|
||||||
|
}
|
||||||
|
public void setDefaultSufTime(Long defaultSufTime)
|
||||||
|
{
|
||||||
|
this.defaultSufTime = defaultSufTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getDefaultSufTime()
|
||||||
|
{
|
||||||
|
return defaultSufTime;
|
||||||
|
}
|
||||||
|
public void setColorCode(String colorCode)
|
||||||
|
{
|
||||||
|
this.colorCode = colorCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getColorCode()
|
||||||
|
{
|
||||||
|
return colorCode;
|
||||||
|
}
|
||||||
|
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("recordId", getRecordId())
|
||||||
|
.append("routeId", getRouteId())
|
||||||
|
.append("processId", getProcessId())
|
||||||
|
.append("processCode", getProcessCode())
|
||||||
|
.append("processName", getProcessName())
|
||||||
|
.append("orderNum", getOrderNum())
|
||||||
|
.append("nextProcessId", getNextProcessId())
|
||||||
|
.append("nextProcessCode", getNextProcessCode())
|
||||||
|
.append("nextProcessName", getNextProcessName())
|
||||||
|
.append("linkType", getLinkType())
|
||||||
|
.append("defaultPreTime", getDefaultPreTime())
|
||||||
|
.append("defaultSufTime", getDefaultSufTime())
|
||||||
|
.append("colorCode", getColorCode())
|
||||||
|
.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();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,63 @@
|
|||||||
|
package com.ktg.mes.pro.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ktg.mes.pro.domain.ProRouteProcess;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺组成Mapper接口
|
||||||
|
*
|
||||||
|
* @author yinjinlu
|
||||||
|
* @date 2022-05-13
|
||||||
|
*/
|
||||||
|
public interface ProRouteProcessMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询工艺组成
|
||||||
|
*
|
||||||
|
* @param recordId 工艺组成主键
|
||||||
|
* @return 工艺组成
|
||||||
|
*/
|
||||||
|
public ProRouteProcess selectProRouteProcessByRecordId(Long recordId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工艺组成列表
|
||||||
|
*
|
||||||
|
* @param proRouteProcess 工艺组成
|
||||||
|
* @return 工艺组成集合
|
||||||
|
*/
|
||||||
|
public List<ProRouteProcess> selectProRouteProcessList(ProRouteProcess proRouteProcess);
|
||||||
|
|
||||||
|
public ProRouteProcess checkOrderNumExists(ProRouteProcess proRouteProcess);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增工艺组成
|
||||||
|
*
|
||||||
|
* @param proRouteProcess 工艺组成
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertProRouteProcess(ProRouteProcess proRouteProcess);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改工艺组成
|
||||||
|
*
|
||||||
|
* @param proRouteProcess 工艺组成
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateProRouteProcess(ProRouteProcess proRouteProcess);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除工艺组成
|
||||||
|
*
|
||||||
|
* @param recordId 工艺组成主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteProRouteProcessByRecordId(Long recordId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除工艺组成
|
||||||
|
*
|
||||||
|
* @param recordIds 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteProRouteProcessByRecordIds(Long[] recordIds);
|
||||||
|
}
|
@ -0,0 +1,69 @@
|
|||||||
|
package com.ktg.mes.pro.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ktg.mes.pro.domain.ProRouteProcess;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺组成Service接口
|
||||||
|
*
|
||||||
|
* @author yinjinlu
|
||||||
|
* @date 2022-05-13
|
||||||
|
*/
|
||||||
|
public interface IProRouteProcessService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询工艺组成
|
||||||
|
*
|
||||||
|
* @param recordId 工艺组成主键
|
||||||
|
* @return 工艺组成
|
||||||
|
*/
|
||||||
|
public ProRouteProcess selectProRouteProcessByRecordId(Long recordId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工艺组成列表
|
||||||
|
*
|
||||||
|
* @param proRouteProcess 工艺组成
|
||||||
|
* @return 工艺组成集合
|
||||||
|
*/
|
||||||
|
public List<ProRouteProcess> selectProRouteProcessList(ProRouteProcess proRouteProcess);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查序号是否已经存在
|
||||||
|
* @param proRouteProcess
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String checkOrderNumExists(ProRouteProcess proRouteProcess);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增工艺组成
|
||||||
|
*
|
||||||
|
* @param proRouteProcess 工艺组成
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertProRouteProcess(ProRouteProcess proRouteProcess);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改工艺组成
|
||||||
|
*
|
||||||
|
* @param proRouteProcess 工艺组成
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateProRouteProcess(ProRouteProcess proRouteProcess);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除工艺组成
|
||||||
|
*
|
||||||
|
* @param recordIds 需要删除的工艺组成主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteProRouteProcessByRecordIds(Long[] recordIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除工艺组成信息
|
||||||
|
*
|
||||||
|
* @param recordId 工艺组成主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteProRouteProcessByRecordId(Long recordId);
|
||||||
|
}
|
@ -0,0 +1,109 @@
|
|||||||
|
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 org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.ktg.mes.pro.mapper.ProRouteProcessMapper;
|
||||||
|
import com.ktg.mes.pro.domain.ProRouteProcess;
|
||||||
|
import com.ktg.mes.pro.service.IProRouteProcessService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺组成Service业务层处理
|
||||||
|
*
|
||||||
|
* @author yinjinlu
|
||||||
|
* @date 2022-05-13
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ProRouteProcessServiceImpl implements IProRouteProcessService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private ProRouteProcessMapper proRouteProcessMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工艺组成
|
||||||
|
*
|
||||||
|
* @param recordId 工艺组成主键
|
||||||
|
* @return 工艺组成
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public ProRouteProcess selectProRouteProcessByRecordId(Long recordId)
|
||||||
|
{
|
||||||
|
return proRouteProcessMapper.selectProRouteProcessByRecordId(recordId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工艺组成列表
|
||||||
|
*
|
||||||
|
* @param proRouteProcess 工艺组成
|
||||||
|
* @return 工艺组成
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<ProRouteProcess> selectProRouteProcessList(ProRouteProcess proRouteProcess)
|
||||||
|
{
|
||||||
|
return proRouteProcessMapper.selectProRouteProcessList(proRouteProcess);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String checkOrderNumExists(ProRouteProcess proRouteProcess) {
|
||||||
|
ProRouteProcess process = proRouteProcessMapper.checkOrderNumExists(proRouteProcess);
|
||||||
|
Long recordId = proRouteProcess.getRecordId()==null?-1L:proRouteProcess.getRecordId();
|
||||||
|
if(StringUtils.isNotNull(process) && process.getRecordId().longValue() != recordId.longValue()){
|
||||||
|
return UserConstants.NOT_UNIQUE;
|
||||||
|
}
|
||||||
|
return UserConstants.UNIQUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增工艺组成
|
||||||
|
*
|
||||||
|
* @param proRouteProcess 工艺组成
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertProRouteProcess(ProRouteProcess proRouteProcess)
|
||||||
|
{
|
||||||
|
proRouteProcess.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return proRouteProcessMapper.insertProRouteProcess(proRouteProcess);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改工艺组成
|
||||||
|
*
|
||||||
|
* @param proRouteProcess 工艺组成
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateProRouteProcess(ProRouteProcess proRouteProcess)
|
||||||
|
{
|
||||||
|
proRouteProcess.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return proRouteProcessMapper.updateProRouteProcess(proRouteProcess);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除工艺组成
|
||||||
|
*
|
||||||
|
* @param recordIds 需要删除的工艺组成主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteProRouteProcessByRecordIds(Long[] recordIds)
|
||||||
|
{
|
||||||
|
return proRouteProcessMapper.deleteProRouteProcessByRecordIds(recordIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除工艺组成信息
|
||||||
|
*
|
||||||
|
* @param recordId 工艺组成主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteProRouteProcessByRecordId(Long recordId)
|
||||||
|
{
|
||||||
|
return proRouteProcessMapper.deleteProRouteProcessByRecordId(recordId);
|
||||||
|
}
|
||||||
|
}
|
153
ktg-mes/src/main/resources/mapper/pro/ProRouteProcessMapper.xml
Normal file
153
ktg-mes/src/main/resources/mapper/pro/ProRouteProcessMapper.xml
Normal file
@ -0,0 +1,153 @@
|
|||||||
|
<?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.ProRouteProcessMapper">
|
||||||
|
|
||||||
|
<resultMap type="ProRouteProcess" id="ProRouteProcessResult">
|
||||||
|
<result property="recordId" column="record_id" />
|
||||||
|
<result property="routeId" column="route_id" />
|
||||||
|
<result property="processId" column="process_id" />
|
||||||
|
<result property="processCode" column="process_code" />
|
||||||
|
<result property="processName" column="process_name" />
|
||||||
|
<result property="orderNum" column="order_num" />
|
||||||
|
<result property="nextProcessId" column="next_process_id" />
|
||||||
|
<result property="nextProcessCode" column="next_process_code" />
|
||||||
|
<result property="nextProcessName" column="next_process_name" />
|
||||||
|
<result property="linkType" column="link_type" />
|
||||||
|
<result property="defaultPreTime" column="default_pre_time" />
|
||||||
|
<result property="defaultSufTime" column="default_suf_time" />
|
||||||
|
<result property="colorCode" column="color_code" />
|
||||||
|
<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="selectProRouteProcessVo">
|
||||||
|
select record_id, route_id, process_id, process_code, process_name, order_num, next_process_id, next_process_code, next_process_name, link_type, default_pre_time, default_suf_time, color_code, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from pro_route_process
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectProRouteProcessList" parameterType="ProRouteProcess" resultMap="ProRouteProcessResult">
|
||||||
|
<include refid="selectProRouteProcessVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="routeId != null "> and route_id = #{routeId}</if>
|
||||||
|
<if test="processId != null "> and process_id = #{processId}</if>
|
||||||
|
<if test="processCode != null and processCode != ''"> and process_code = #{processCode}</if>
|
||||||
|
<if test="processName != null and processName != ''"> and process_name like concat('%', #{processName}, '%')</if>
|
||||||
|
<if test="orderNum != null "> and order_num = #{orderNum}</if>
|
||||||
|
<if test="nextProcessId != null "> and next_process_id = #{nextProcessId}</if>
|
||||||
|
<if test="nextProcessCode != null and nextProcessCode != ''"> and next_process_code = #{nextProcessCode}</if>
|
||||||
|
<if test="nextProcessName != null and nextProcessName != ''"> and next_process_name like concat('%', #{nextProcessName}, '%')</if>
|
||||||
|
<if test="linkType != null and linkType != ''"> and link_type = #{linkType}</if>
|
||||||
|
<if test="defaultPreTime != null "> and default_pre_time = #{defaultPreTime}</if>
|
||||||
|
<if test="defaultSufTime != null "> and default_suf_time = #{defaultSufTime}</if>
|
||||||
|
<if test="colorCode != null and colorCode != ''"> and color_code = #{colorCode}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectProRouteProcessByRecordId" parameterType="Long" resultMap="ProRouteProcessResult">
|
||||||
|
<include refid="selectProRouteProcessVo"/>
|
||||||
|
where record_id = #{recordId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="checkOrderNumExists" parameterType="ProRouteProcess" resultMap="ProRouteProcessResult">
|
||||||
|
<include refid="selectProRouteProcessVo"/>
|
||||||
|
where route_id = #{routeId} and order_num = #{orderNum} limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertProRouteProcess" parameterType="ProRouteProcess" useGeneratedKeys="true" keyProperty="recordId">
|
||||||
|
insert into pro_route_process
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="routeId != null">route_id,</if>
|
||||||
|
<if test="processId != null">process_id,</if>
|
||||||
|
<if test="processCode != null">process_code,</if>
|
||||||
|
<if test="processName != null">process_name,</if>
|
||||||
|
<if test="orderNum != null">order_num,</if>
|
||||||
|
<if test="nextProcessId != null">next_process_id,</if>
|
||||||
|
<if test="nextProcessCode != null">next_process_code,</if>
|
||||||
|
<if test="nextProcessName != null">next_process_name,</if>
|
||||||
|
<if test="linkType != null">link_type,</if>
|
||||||
|
<if test="defaultPreTime != null">default_pre_time,</if>
|
||||||
|
<if test="defaultSufTime != null">default_suf_time,</if>
|
||||||
|
<if test="colorCode != null">color_code,</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="routeId != null">#{routeId},</if>
|
||||||
|
<if test="processId != null">#{processId},</if>
|
||||||
|
<if test="processCode != null">#{processCode},</if>
|
||||||
|
<if test="processName != null">#{processName},</if>
|
||||||
|
<if test="orderNum != null">#{orderNum},</if>
|
||||||
|
<if test="nextProcessId != null">#{nextProcessId},</if>
|
||||||
|
<if test="nextProcessCode != null">#{nextProcessCode},</if>
|
||||||
|
<if test="nextProcessName != null">#{nextProcessName},</if>
|
||||||
|
<if test="linkType != null">#{linkType},</if>
|
||||||
|
<if test="defaultPreTime != null">#{defaultPreTime},</if>
|
||||||
|
<if test="defaultSufTime != null">#{defaultSufTime},</if>
|
||||||
|
<if test="colorCode != null">#{colorCode},</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="updateProRouteProcess" parameterType="ProRouteProcess">
|
||||||
|
update pro_route_process
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="routeId != null">route_id = #{routeId},</if>
|
||||||
|
<if test="processId != null">process_id = #{processId},</if>
|
||||||
|
<if test="processCode != null">process_code = #{processCode},</if>
|
||||||
|
<if test="processName != null">process_name = #{processName},</if>
|
||||||
|
<if test="orderNum != null">order_num = #{orderNum},</if>
|
||||||
|
<if test="nextProcessId != null">next_process_id = #{nextProcessId},</if>
|
||||||
|
<if test="nextProcessCode != null">next_process_code = #{nextProcessCode},</if>
|
||||||
|
<if test="nextProcessName != null">next_process_name = #{nextProcessName},</if>
|
||||||
|
<if test="linkType != null">link_type = #{linkType},</if>
|
||||||
|
<if test="defaultPreTime != null">default_pre_time = #{defaultPreTime},</if>
|
||||||
|
<if test="defaultSufTime != null">default_suf_time = #{defaultSufTime},</if>
|
||||||
|
<if test="colorCode != null">color_code = #{colorCode},</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 record_id = #{recordId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteProRouteProcessByRecordId" parameterType="Long">
|
||||||
|
delete from pro_route_process where record_id = #{recordId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteProRouteProcessByRecordIds" parameterType="String">
|
||||||
|
delete from pro_route_process where record_id in
|
||||||
|
<foreach item="recordId" collection="array" open="(" separator="," close=")">
|
||||||
|
#{recordId}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue
Block a user