来料检验单
This commit is contained in:
parent
ea41209da4
commit
2a8a26e074
@ -0,0 +1,135 @@
|
||||
package com.ktg.mes.qc.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.mes.qc.domain.QcTemplateProduct;
|
||||
import com.ktg.mes.qc.service.IQcTemplateProductService;
|
||||
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.qc.domain.QcIqc;
|
||||
import com.ktg.mes.qc.service.IQcIqcService;
|
||||
import com.ktg.common.utils.poi.ExcelUtil;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 来料检验单Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-19
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/qc/iqc")
|
||||
public class QcIqcController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IQcIqcService qcIqcService;
|
||||
|
||||
@Autowired
|
||||
private IQcTemplateProductService qcTemplateProductService;
|
||||
|
||||
/**
|
||||
* 查询来料检验单列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:qc:iqc:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(QcIqc qcIqc)
|
||||
{
|
||||
startPage();
|
||||
List<QcIqc> list = qcIqcService.selectQcIqcList(qcIqc);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出来料检验单列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:qc:iqc:export')")
|
||||
@Log(title = "来料检验单", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, QcIqc qcIqc)
|
||||
{
|
||||
List<QcIqc> list = qcIqcService.selectQcIqcList(qcIqc);
|
||||
ExcelUtil<QcIqc> util = new ExcelUtil<QcIqc>(QcIqc.class);
|
||||
util.exportExcel(response, list, "来料检验单数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取来料检验单详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:qc:iqc:query')")
|
||||
@GetMapping(value = "/{iqcId}")
|
||||
public AjaxResult getInfo(@PathVariable("iqcId") Long iqcId)
|
||||
{
|
||||
return AjaxResult.success(qcIqcService.selectQcIqcByIqcId(iqcId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增来料检验单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:qc:iqc:add')")
|
||||
@Log(title = "来料检验单", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody QcIqc qcIqc)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(qcIqcService.checkIqcCodeUnique(qcIqc))){
|
||||
return AjaxResult.error("单据编号已存在!");
|
||||
}
|
||||
|
||||
QcTemplateProduct param = new QcTemplateProduct();
|
||||
param.setItemId(qcIqc.getItemId());
|
||||
List<QcTemplateProduct> templates = qcTemplateProductService.selectQcTemplateProductList(param);
|
||||
if(CollUtil.isNotEmpty(templates)){
|
||||
qcIqc.setTemplateId(templates.get(0).getTemplateId());
|
||||
}else{
|
||||
return AjaxResult.error("当前产品未配置检测模板!");
|
||||
}
|
||||
return toAjax(qcIqcService.insertQcIqc(qcIqc));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改来料检验单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:qc:iqc:edit')")
|
||||
@Log(title = "来料检验单", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody QcIqc qcIqc)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(qcIqcService.checkIqcCodeUnique(qcIqc))){
|
||||
return AjaxResult.error("单据编号已存在!");
|
||||
}
|
||||
QcTemplateProduct param = new QcTemplateProduct();
|
||||
param.setItemId(qcIqc.getItemId());
|
||||
List<QcTemplateProduct> templates = qcTemplateProductService.selectQcTemplateProductList(param);
|
||||
if(CollUtil.isNotEmpty(templates)){
|
||||
qcIqc.setTemplateId(templates.get(0).getTemplateId());
|
||||
}else{
|
||||
return AjaxResult.error("当前产品未配置检测模板!");
|
||||
}
|
||||
return toAjax(qcIqcService.updateQcIqc(qcIqc));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除来料检验单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:qc:iqc:remove')")
|
||||
@Log(title = "来料检验单", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{iqcIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] iqcIds)
|
||||
{
|
||||
return toAjax(qcIqcService.deleteQcIqcByIqcIds(iqcIds));
|
||||
}
|
||||
}
|
505
ktg-mes/src/main/java/com/ktg/mes/qc/domain/QcIqc.java
Normal file
505
ktg-mes/src/main/java/com/ktg/mes/qc/domain/QcIqc.java
Normal file
@ -0,0 +1,505 @@
|
||||
package com.ktg.mes.qc.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;
|
||||
|
||||
/**
|
||||
* 来料检验单对象 qc_iqc
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-19
|
||||
*/
|
||||
public class QcIqc extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 来料检验单ID */
|
||||
private Long iqcId;
|
||||
|
||||
/** 来料检验单编号 */
|
||||
@Excel(name = "来料检验单编号")
|
||||
private String iqcCode;
|
||||
|
||||
/** 来料检验单名称 */
|
||||
@Excel(name = "来料检验单名称")
|
||||
private String iqcName;
|
||||
|
||||
/** 检验模板ID */
|
||||
@Excel(name = "检验模板ID")
|
||||
private Long templateId;
|
||||
|
||||
/** 供应商ID */
|
||||
@Excel(name = "供应商ID")
|
||||
private Long vendorId;
|
||||
|
||||
/** 供应商编码 */
|
||||
@Excel(name = "供应商编码")
|
||||
private String vendorCode;
|
||||
|
||||
/** 供应商名称 */
|
||||
@Excel(name = "供应商名称")
|
||||
private String vendorName;
|
||||
|
||||
/** 供应商简称 */
|
||||
@Excel(name = "供应商简称")
|
||||
private String vendorNick;
|
||||
|
||||
/** 供应商批次号 */
|
||||
@Excel(name = "供应商批次号")
|
||||
private String vendorBatch;
|
||||
|
||||
/** 产品物料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 Long quantityMinCheck;
|
||||
|
||||
/** 最大不合格数 */
|
||||
@Excel(name = "最大不合格数")
|
||||
private Long quantityMaxUnqualified;
|
||||
|
||||
/** 本次接收数量 */
|
||||
@Excel(name = "本次接收数量")
|
||||
private BigDecimal quantityRecived;
|
||||
|
||||
/** 本次检测数量 */
|
||||
@Excel(name = "本次检测数量")
|
||||
private Long quantityCheck;
|
||||
|
||||
/** 不合格数 */
|
||||
@Excel(name = "不合格数")
|
||||
private Long quantityUnqualified;
|
||||
|
||||
/** 致命缺陷率 */
|
||||
@Excel(name = "致命缺陷率")
|
||||
private BigDecimal crRate;
|
||||
|
||||
/** 严重缺陷率 */
|
||||
@Excel(name = "严重缺陷率")
|
||||
private BigDecimal majRate;
|
||||
|
||||
/** 轻微缺陷率 */
|
||||
@Excel(name = "轻微缺陷率")
|
||||
private BigDecimal minRate;
|
||||
|
||||
/** 致命缺陷数量 */
|
||||
@Excel(name = "致命缺陷数量")
|
||||
private Long crQuantity;
|
||||
|
||||
/** 严重缺陷数量 */
|
||||
@Excel(name = "严重缺陷数量")
|
||||
private Long majQuantity;
|
||||
|
||||
/** 轻微缺陷数量 */
|
||||
@Excel(name = "轻微缺陷数量")
|
||||
private Long minQuantity;
|
||||
|
||||
/** 检测结果 */
|
||||
@Excel(name = "检测结果")
|
||||
private String checkResult;
|
||||
|
||||
/** 来料日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "来料日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date reciveDate;
|
||||
|
||||
/** 检测日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "检测日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date inspectDate;
|
||||
|
||||
/** 检测人员 */
|
||||
@Excel(name = "检测人员")
|
||||
private String inspector;
|
||||
|
||||
/** 单据状态 */
|
||||
@Excel(name = "单据状态")
|
||||
private String status;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
|
||||
public void setIqcId(Long iqcId)
|
||||
{
|
||||
this.iqcId = iqcId;
|
||||
}
|
||||
|
||||
public Long getIqcId()
|
||||
{
|
||||
return iqcId;
|
||||
}
|
||||
public void setIqcCode(String iqcCode)
|
||||
{
|
||||
this.iqcCode = iqcCode;
|
||||
}
|
||||
|
||||
public String getIqcCode()
|
||||
{
|
||||
return iqcCode;
|
||||
}
|
||||
public void setIqcName(String iqcName)
|
||||
{
|
||||
this.iqcName = iqcName;
|
||||
}
|
||||
|
||||
public String getIqcName()
|
||||
{
|
||||
return iqcName;
|
||||
}
|
||||
public void setTemplateId(Long templateId)
|
||||
{
|
||||
this.templateId = templateId;
|
||||
}
|
||||
|
||||
public Long getTemplateId()
|
||||
{
|
||||
return templateId;
|
||||
}
|
||||
public void setVendorId(Long vendorId)
|
||||
{
|
||||
this.vendorId = vendorId;
|
||||
}
|
||||
|
||||
public Long getVendorId()
|
||||
{
|
||||
return vendorId;
|
||||
}
|
||||
public void setVendorCode(String vendorCode)
|
||||
{
|
||||
this.vendorCode = vendorCode;
|
||||
}
|
||||
|
||||
public String getVendorCode()
|
||||
{
|
||||
return vendorCode;
|
||||
}
|
||||
public void setVendorName(String vendorName)
|
||||
{
|
||||
this.vendorName = vendorName;
|
||||
}
|
||||
|
||||
public String getVendorName()
|
||||
{
|
||||
return vendorName;
|
||||
}
|
||||
public void setVendorNick(String vendorNick)
|
||||
{
|
||||
this.vendorNick = vendorNick;
|
||||
}
|
||||
|
||||
public String getVendorNick()
|
||||
{
|
||||
return vendorNick;
|
||||
}
|
||||
public void setVendorBatch(String vendorBatch)
|
||||
{
|
||||
this.vendorBatch = vendorBatch;
|
||||
}
|
||||
|
||||
public String getVendorBatch()
|
||||
{
|
||||
return vendorBatch;
|
||||
}
|
||||
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 setQuantityMinCheck(Long quantityMinCheck)
|
||||
{
|
||||
this.quantityMinCheck = quantityMinCheck;
|
||||
}
|
||||
|
||||
public Long getQuantityMinCheck()
|
||||
{
|
||||
return quantityMinCheck;
|
||||
}
|
||||
public void setQuantityMaxUnqualified(Long quantityMaxUnqualified)
|
||||
{
|
||||
this.quantityMaxUnqualified = quantityMaxUnqualified;
|
||||
}
|
||||
|
||||
public Long getQuantityMaxUnqualified()
|
||||
{
|
||||
return quantityMaxUnqualified;
|
||||
}
|
||||
public void setQuantityRecived(BigDecimal quantityRecived)
|
||||
{
|
||||
this.quantityRecived = quantityRecived;
|
||||
}
|
||||
|
||||
public BigDecimal getQuantityRecived()
|
||||
{
|
||||
return quantityRecived;
|
||||
}
|
||||
public void setQuantityCheck(Long quantityCheck)
|
||||
{
|
||||
this.quantityCheck = quantityCheck;
|
||||
}
|
||||
|
||||
public Long getQuantityCheck()
|
||||
{
|
||||
return quantityCheck;
|
||||
}
|
||||
public void setQuantityUnqualified(Long quantityUnqualified)
|
||||
{
|
||||
this.quantityUnqualified = quantityUnqualified;
|
||||
}
|
||||
|
||||
public Long getQuantityUnqualified()
|
||||
{
|
||||
return quantityUnqualified;
|
||||
}
|
||||
public void setCrRate(BigDecimal crRate)
|
||||
{
|
||||
this.crRate = crRate;
|
||||
}
|
||||
|
||||
public BigDecimal getCrRate()
|
||||
{
|
||||
return crRate;
|
||||
}
|
||||
public void setMajRate(BigDecimal majRate)
|
||||
{
|
||||
this.majRate = majRate;
|
||||
}
|
||||
|
||||
public BigDecimal getMajRate()
|
||||
{
|
||||
return majRate;
|
||||
}
|
||||
public void setMinRate(BigDecimal minRate)
|
||||
{
|
||||
this.minRate = minRate;
|
||||
}
|
||||
|
||||
public BigDecimal getMinRate()
|
||||
{
|
||||
return minRate;
|
||||
}
|
||||
public void setCrQuantity(Long crQuantity)
|
||||
{
|
||||
this.crQuantity = crQuantity;
|
||||
}
|
||||
|
||||
public Long getCrQuantity()
|
||||
{
|
||||
return crQuantity;
|
||||
}
|
||||
public void setMajQuantity(Long majQuantity)
|
||||
{
|
||||
this.majQuantity = majQuantity;
|
||||
}
|
||||
|
||||
public Long getMajQuantity()
|
||||
{
|
||||
return majQuantity;
|
||||
}
|
||||
public void setMinQuantity(Long minQuantity)
|
||||
{
|
||||
this.minQuantity = minQuantity;
|
||||
}
|
||||
|
||||
public Long getMinQuantity()
|
||||
{
|
||||
return minQuantity;
|
||||
}
|
||||
public void setCheckResult(String checkResult)
|
||||
{
|
||||
this.checkResult = checkResult;
|
||||
}
|
||||
|
||||
public String getCheckResult()
|
||||
{
|
||||
return checkResult;
|
||||
}
|
||||
public void setReciveDate(Date reciveDate)
|
||||
{
|
||||
this.reciveDate = reciveDate;
|
||||
}
|
||||
|
||||
public Date getReciveDate()
|
||||
{
|
||||
return reciveDate;
|
||||
}
|
||||
public void setInspectDate(Date inspectDate)
|
||||
{
|
||||
this.inspectDate = inspectDate;
|
||||
}
|
||||
|
||||
public Date getInspectDate()
|
||||
{
|
||||
return inspectDate;
|
||||
}
|
||||
public void setInspector(String inspector)
|
||||
{
|
||||
this.inspector = inspector;
|
||||
}
|
||||
|
||||
public String getInspector()
|
||||
{
|
||||
return inspector;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
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("iqcId", getIqcId())
|
||||
.append("iqcCode", getIqcCode())
|
||||
.append("iqcName", getIqcName())
|
||||
.append("templateId", getTemplateId())
|
||||
.append("vendorId", getVendorId())
|
||||
.append("vendorCode", getVendorCode())
|
||||
.append("vendorName", getVendorName())
|
||||
.append("vendorNick", getVendorNick())
|
||||
.append("vendorBatch", getVendorBatch())
|
||||
.append("itemId", getItemId())
|
||||
.append("itemCode", getItemCode())
|
||||
.append("itemName", getItemName())
|
||||
.append("specification", getSpecification())
|
||||
.append("unitOfMeasure", getUnitOfMeasure())
|
||||
.append("quantityMinCheck", getQuantityMinCheck())
|
||||
.append("quantityMaxUnqualified", getQuantityMaxUnqualified())
|
||||
.append("quantityRecived", getQuantityRecived())
|
||||
.append("quantityCheck", getQuantityCheck())
|
||||
.append("quantityUnqualified", getQuantityUnqualified())
|
||||
.append("crRate", getCrRate())
|
||||
.append("majRate", getMajRate())
|
||||
.append("minRate", getMinRate())
|
||||
.append("crQuantity", getCrQuantity())
|
||||
.append("majQuantity", getMajQuantity())
|
||||
.append("minQuantity", getMinQuantity())
|
||||
.append("checkResult", getCheckResult())
|
||||
.append("reciveDate", getReciveDate())
|
||||
.append("inspectDate", getInspectDate())
|
||||
.append("inspector", getInspector())
|
||||
.append("status", getStatus())
|
||||
.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();
|
||||
}
|
||||
}
|
63
ktg-mes/src/main/java/com/ktg/mes/qc/mapper/QcIqcMapper.java
Normal file
63
ktg-mes/src/main/java/com/ktg/mes/qc/mapper/QcIqcMapper.java
Normal file
@ -0,0 +1,63 @@
|
||||
package com.ktg.mes.qc.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.qc.domain.QcIqc;
|
||||
|
||||
/**
|
||||
* 来料检验单Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-19
|
||||
*/
|
||||
public interface QcIqcMapper
|
||||
{
|
||||
/**
|
||||
* 查询来料检验单
|
||||
*
|
||||
* @param iqcId 来料检验单主键
|
||||
* @return 来料检验单
|
||||
*/
|
||||
public QcIqc selectQcIqcByIqcId(Long iqcId);
|
||||
|
||||
/**
|
||||
* 查询来料检验单列表
|
||||
*
|
||||
* @param qcIqc 来料检验单
|
||||
* @return 来料检验单集合
|
||||
*/
|
||||
public List<QcIqc> selectQcIqcList(QcIqc qcIqc);
|
||||
|
||||
public QcIqc checkIqcCodeUnique(QcIqc qcIqc);
|
||||
|
||||
/**
|
||||
* 新增来料检验单
|
||||
*
|
||||
* @param qcIqc 来料检验单
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertQcIqc(QcIqc qcIqc);
|
||||
|
||||
/**
|
||||
* 修改来料检验单
|
||||
*
|
||||
* @param qcIqc 来料检验单
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateQcIqc(QcIqc qcIqc);
|
||||
|
||||
/**
|
||||
* 删除来料检验单
|
||||
*
|
||||
* @param iqcId 来料检验单主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQcIqcByIqcId(Long iqcId);
|
||||
|
||||
/**
|
||||
* 批量删除来料检验单
|
||||
*
|
||||
* @param iqcIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQcIqcByIqcIds(Long[] iqcIds);
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package com.ktg.mes.qc.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.qc.domain.QcIqc;
|
||||
|
||||
/**
|
||||
* 来料检验单Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-19
|
||||
*/
|
||||
public interface IQcIqcService
|
||||
{
|
||||
/**
|
||||
* 查询来料检验单
|
||||
*
|
||||
* @param iqcId 来料检验单主键
|
||||
* @return 来料检验单
|
||||
*/
|
||||
public QcIqc selectQcIqcByIqcId(Long iqcId);
|
||||
|
||||
/**
|
||||
* 查询来料检验单列表
|
||||
*
|
||||
* @param qcIqc 来料检验单
|
||||
* @return 来料检验单集合
|
||||
*/
|
||||
public List<QcIqc> selectQcIqcList(QcIqc qcIqc);
|
||||
|
||||
/**
|
||||
* 检查来料检验单号是否重复
|
||||
* @param qcIqc
|
||||
* @return
|
||||
*/
|
||||
public String checkIqcCodeUnique(QcIqc qcIqc);
|
||||
|
||||
/**
|
||||
* 新增来料检验单
|
||||
*
|
||||
* @param qcIqc 来料检验单
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertQcIqc(QcIqc qcIqc);
|
||||
|
||||
/**
|
||||
* 修改来料检验单
|
||||
*
|
||||
* @param qcIqc 来料检验单
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateQcIqc(QcIqc qcIqc);
|
||||
|
||||
/**
|
||||
* 批量删除来料检验单
|
||||
*
|
||||
* @param iqcIds 需要删除的来料检验单主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQcIqcByIqcIds(Long[] iqcIds);
|
||||
|
||||
/**
|
||||
* 删除来料检验单信息
|
||||
*
|
||||
* @param iqcId 来料检验单主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQcIqcByIqcId(Long iqcId);
|
||||
}
|
@ -0,0 +1,109 @@
|
||||
package com.ktg.mes.qc.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.qc.mapper.QcIqcMapper;
|
||||
import com.ktg.mes.qc.domain.QcIqc;
|
||||
import com.ktg.mes.qc.service.IQcIqcService;
|
||||
|
||||
/**
|
||||
* 来料检验单Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-19
|
||||
*/
|
||||
@Service
|
||||
public class QcIqcServiceImpl implements IQcIqcService
|
||||
{
|
||||
@Autowired
|
||||
private QcIqcMapper qcIqcMapper;
|
||||
|
||||
/**
|
||||
* 查询来料检验单
|
||||
*
|
||||
* @param iqcId 来料检验单主键
|
||||
* @return 来料检验单
|
||||
*/
|
||||
@Override
|
||||
public QcIqc selectQcIqcByIqcId(Long iqcId)
|
||||
{
|
||||
return qcIqcMapper.selectQcIqcByIqcId(iqcId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询来料检验单列表
|
||||
*
|
||||
* @param qcIqc 来料检验单
|
||||
* @return 来料检验单
|
||||
*/
|
||||
@Override
|
||||
public List<QcIqc> selectQcIqcList(QcIqc qcIqc)
|
||||
{
|
||||
return qcIqcMapper.selectQcIqcList(qcIqc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String checkIqcCodeUnique(QcIqc qcIqc) {
|
||||
QcIqc iqc = qcIqcMapper.checkIqcCodeUnique(qcIqc);
|
||||
Long iqcId = qcIqc.getIqcId()==null?-1L:qcIqc.getIqcId();
|
||||
if(StringUtils.isNotNull(iqc) && iqc.getIqcId().longValue() != iqcId.longValue()){
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增来料检验单
|
||||
*
|
||||
* @param qcIqc 来料检验单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertQcIqc(QcIqc qcIqc)
|
||||
{
|
||||
qcIqc.setCreateTime(DateUtils.getNowDate());
|
||||
return qcIqcMapper.insertQcIqc(qcIqc);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改来料检验单
|
||||
*
|
||||
* @param qcIqc 来料检验单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateQcIqc(QcIqc qcIqc)
|
||||
{
|
||||
qcIqc.setUpdateTime(DateUtils.getNowDate());
|
||||
return qcIqcMapper.updateQcIqc(qcIqc);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除来料检验单
|
||||
*
|
||||
* @param iqcIds 需要删除的来料检验单主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteQcIqcByIqcIds(Long[] iqcIds)
|
||||
{
|
||||
return qcIqcMapper.deleteQcIqcByIqcIds(iqcIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除来料检验单信息
|
||||
*
|
||||
* @param iqcId 来料检验单主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteQcIqcByIqcId(Long iqcId)
|
||||
{
|
||||
return qcIqcMapper.deleteQcIqcByIqcId(iqcId);
|
||||
}
|
||||
}
|
237
ktg-mes/src/main/resources/mapper/qc/QcIqcMapper.xml
Normal file
237
ktg-mes/src/main/resources/mapper/qc/QcIqcMapper.xml
Normal file
@ -0,0 +1,237 @@
|
||||
<?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.qc.mapper.QcIqcMapper">
|
||||
|
||||
<resultMap type="QcIqc" id="QcIqcResult">
|
||||
<result property="iqcId" column="iqc_id" />
|
||||
<result property="iqcCode" column="iqc_code" />
|
||||
<result property="iqcName" column="iqc_name" />
|
||||
<result property="templateId" column="template_id" />
|
||||
<result property="vendorId" column="vendor_id" />
|
||||
<result property="vendorCode" column="vendor_code" />
|
||||
<result property="vendorName" column="vendor_name" />
|
||||
<result property="vendorNick" column="vendor_nick" />
|
||||
<result property="vendorBatch" column="vendor_batch" />
|
||||
<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="quantityMinCheck" column="quantity_min_check" />
|
||||
<result property="quantityMaxUnqualified" column="quantity_max_unqualified" />
|
||||
<result property="quantityRecived" column="quantity_recived" />
|
||||
<result property="quantityCheck" column="quantity_check" />
|
||||
<result property="quantityUnqualified" column="quantity_unqualified" />
|
||||
<result property="crRate" column="cr_rate" />
|
||||
<result property="majRate" column="maj_rate" />
|
||||
<result property="minRate" column="min_rate" />
|
||||
<result property="crQuantity" column="cr_quantity" />
|
||||
<result property="majQuantity" column="maj_quantity" />
|
||||
<result property="minQuantity" column="min_quantity" />
|
||||
<result property="checkResult" column="check_result" />
|
||||
<result property="reciveDate" column="recive_date" />
|
||||
<result property="inspectDate" column="inspect_date" />
|
||||
<result property="inspector" column="inspector" />
|
||||
<result property="status" column="status" />
|
||||
<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="selectQcIqcVo">
|
||||
select iqc_id, iqc_code, iqc_name, template_id, vendor_id, vendor_code, vendor_name, vendor_nick, vendor_batch, item_id, item_code, item_name, specification, unit_of_measure, quantity_min_check, quantity_max_unqualified, quantity_recived, quantity_check, quantity_unqualified, cr_rate, maj_rate, min_rate, cr_quantity, maj_quantity, min_quantity, check_result, recive_date, inspect_date, inspector, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from qc_iqc
|
||||
</sql>
|
||||
|
||||
<select id="selectQcIqcList" parameterType="QcIqc" resultMap="QcIqcResult">
|
||||
<include refid="selectQcIqcVo"/>
|
||||
<where>
|
||||
<if test="iqcCode != null and iqcCode != ''"> and iqc_code = #{iqcCode}</if>
|
||||
<if test="iqcName != null and iqcName != ''"> and iqc_name like concat('%', #{iqcName}, '%')</if>
|
||||
<if test="templateId != null "> and template_id = #{templateId}</if>
|
||||
<if test="vendorId != null "> and vendor_id = #{vendorId}</if>
|
||||
<if test="vendorCode != null and vendorCode != ''"> and vendor_code = #{vendorCode}</if>
|
||||
<if test="vendorName != null and vendorName != ''"> and vendor_name like concat('%', #{vendorName}, '%')</if>
|
||||
<if test="vendorNick != null and vendorNick != ''"> and vendor_nick = #{vendorNick}</if>
|
||||
<if test="vendorBatch != null and vendorBatch != ''"> and vendor_batch = #{vendorBatch}</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="quantityMinCheck != null "> and quantity_min_check = #{quantityMinCheck}</if>
|
||||
<if test="quantityMaxUnqualified != null "> and quantity_max_unqualified = #{quantityMaxUnqualified}</if>
|
||||
<if test="quantityRecived != null "> and quantity_recived = #{quantityRecived}</if>
|
||||
<if test="quantityCheck != null "> and quantity_check = #{quantityCheck}</if>
|
||||
<if test="quantityUnqualified != null "> and quantity_unqualified = #{quantityUnqualified}</if>
|
||||
<if test="crRate != null "> and cr_rate = #{crRate}</if>
|
||||
<if test="majRate != null "> and maj_rate = #{majRate}</if>
|
||||
<if test="minRate != null "> and min_rate = #{minRate}</if>
|
||||
<if test="crQuantity != null "> and cr_quantity = #{crQuantity}</if>
|
||||
<if test="majQuantity != null "> and maj_quantity = #{majQuantity}</if>
|
||||
<if test="minQuantity != null "> and min_quantity = #{minQuantity}</if>
|
||||
<if test="checkResult != null and checkResult != ''"> and check_result = #{checkResult}</if>
|
||||
<if test="reciveDate != null "> and recive_date = #{reciveDate}</if>
|
||||
<if test="inspectDate != null "> and inspect_date = #{inspectDate}</if>
|
||||
<if test="inspector != null and inspector != ''"> and inspector = #{inspector}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectQcIqcByIqcId" parameterType="Long" resultMap="QcIqcResult">
|
||||
<include refid="selectQcIqcVo"/>
|
||||
where iqc_id = #{iqcId}
|
||||
</select>
|
||||
|
||||
<select id="checkIqcCodeUnique" parameterType="QcIqc" resultMap="QcIqcResult">
|
||||
<include refid="selectQcIqcVo"/>
|
||||
where iqc_code = #{iqcCode} limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertQcIqc" parameterType="QcIqc" useGeneratedKeys="true" keyProperty="iqcId">
|
||||
insert into qc_iqc
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="iqcCode != null and iqcCode != ''">iqc_code,</if>
|
||||
<if test="iqcName != null and iqcName != ''">iqc_name,</if>
|
||||
<if test="templateId != null">template_id,</if>
|
||||
<if test="vendorId != null">vendor_id,</if>
|
||||
<if test="vendorCode != null and vendorCode != ''">vendor_code,</if>
|
||||
<if test="vendorName != null and vendorName != ''">vendor_name,</if>
|
||||
<if test="vendorNick != null">vendor_nick,</if>
|
||||
<if test="vendorBatch != null">vendor_batch,</if>
|
||||
<if test="itemId != null">item_id,</if>
|
||||
<if test="itemCode != null">item_code,</if>
|
||||
<if test="itemName != null">item_name,</if>
|
||||
<if test="specification != null">specification,</if>
|
||||
<if test="unitOfMeasure != null">unit_of_measure,</if>
|
||||
<if test="quantityMinCheck != null">quantity_min_check,</if>
|
||||
<if test="quantityMaxUnqualified != null">quantity_max_unqualified,</if>
|
||||
<if test="quantityRecived != null">quantity_recived,</if>
|
||||
<if test="quantityCheck != null">quantity_check,</if>
|
||||
<if test="quantityUnqualified != null">quantity_unqualified,</if>
|
||||
<if test="crRate != null">cr_rate,</if>
|
||||
<if test="majRate != null">maj_rate,</if>
|
||||
<if test="minRate != null">min_rate,</if>
|
||||
<if test="crQuantity != null">cr_quantity,</if>
|
||||
<if test="majQuantity != null">maj_quantity,</if>
|
||||
<if test="minQuantity != null">min_quantity,</if>
|
||||
<if test="checkResult != null">check_result,</if>
|
||||
<if test="reciveDate != null">recive_date,</if>
|
||||
<if test="inspectDate != null">inspect_date,</if>
|
||||
<if test="inspector != null">inspector,</if>
|
||||
<if test="status != null">status,</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="iqcCode != null and iqcCode != ''">#{iqcCode},</if>
|
||||
<if test="iqcName != null and iqcName != ''">#{iqcName},</if>
|
||||
<if test="templateId != null">#{templateId},</if>
|
||||
<if test="vendorId != null">#{vendorId},</if>
|
||||
<if test="vendorCode != null and vendorCode != ''">#{vendorCode},</if>
|
||||
<if test="vendorName != null and vendorName != ''">#{vendorName},</if>
|
||||
<if test="vendorNick != null">#{vendorNick},</if>
|
||||
<if test="vendorBatch != null">#{vendorBatch},</if>
|
||||
<if test="itemId != null">#{itemId},</if>
|
||||
<if test="itemCode != null">#{itemCode},</if>
|
||||
<if test="itemName != null">#{itemName},</if>
|
||||
<if test="specification != null">#{specification},</if>
|
||||
<if test="unitOfMeasure != null">#{unitOfMeasure},</if>
|
||||
<if test="quantityMinCheck != null">#{quantityMinCheck},</if>
|
||||
<if test="quantityMaxUnqualified != null">#{quantityMaxUnqualified},</if>
|
||||
<if test="quantityRecived != null">#{quantityRecived},</if>
|
||||
<if test="quantityCheck != null">#{quantityCheck},</if>
|
||||
<if test="quantityUnqualified != null">#{quantityUnqualified},</if>
|
||||
<if test="crRate != null">#{crRate},</if>
|
||||
<if test="majRate != null">#{majRate},</if>
|
||||
<if test="minRate != null">#{minRate},</if>
|
||||
<if test="crQuantity != null">#{crQuantity},</if>
|
||||
<if test="majQuantity != null">#{majQuantity},</if>
|
||||
<if test="minQuantity != null">#{minQuantity},</if>
|
||||
<if test="checkResult != null">#{checkResult},</if>
|
||||
<if test="reciveDate != null">#{reciveDate},</if>
|
||||
<if test="inspectDate != null">#{inspectDate},</if>
|
||||
<if test="inspector != null">#{inspector},</if>
|
||||
<if test="status != null">#{status},</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="updateQcIqc" parameterType="QcIqc">
|
||||
update qc_iqc
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="iqcCode != null and iqcCode != ''">iqc_code = #{iqcCode},</if>
|
||||
<if test="iqcName != null and iqcName != ''">iqc_name = #{iqcName},</if>
|
||||
<if test="templateId != null">template_id = #{templateId},</if>
|
||||
<if test="vendorId != null">vendor_id = #{vendorId},</if>
|
||||
<if test="vendorCode != null and vendorCode != ''">vendor_code = #{vendorCode},</if>
|
||||
<if test="vendorName != null and vendorName != ''">vendor_name = #{vendorName},</if>
|
||||
<if test="vendorNick != null">vendor_nick = #{vendorNick},</if>
|
||||
<if test="vendorBatch != null">vendor_batch = #{vendorBatch},</if>
|
||||
<if test="itemId != null">item_id = #{itemId},</if>
|
||||
<if test="itemCode != null">item_code = #{itemCode},</if>
|
||||
<if test="itemName != null">item_name = #{itemName},</if>
|
||||
<if test="specification != null">specification = #{specification},</if>
|
||||
<if test="unitOfMeasure != null">unit_of_measure = #{unitOfMeasure},</if>
|
||||
<if test="quantityMinCheck != null">quantity_min_check = #{quantityMinCheck},</if>
|
||||
<if test="quantityMaxUnqualified != null">quantity_max_unqualified = #{quantityMaxUnqualified},</if>
|
||||
<if test="quantityRecived != null">quantity_recived = #{quantityRecived},</if>
|
||||
<if test="quantityCheck != null">quantity_check = #{quantityCheck},</if>
|
||||
<if test="quantityUnqualified != null">quantity_unqualified = #{quantityUnqualified},</if>
|
||||
<if test="crRate != null">cr_rate = #{crRate},</if>
|
||||
<if test="majRate != null">maj_rate = #{majRate},</if>
|
||||
<if test="minRate != null">min_rate = #{minRate},</if>
|
||||
<if test="crQuantity != null">cr_quantity = #{crQuantity},</if>
|
||||
<if test="majQuantity != null">maj_quantity = #{majQuantity},</if>
|
||||
<if test="minQuantity != null">min_quantity = #{minQuantity},</if>
|
||||
<if test="checkResult != null">check_result = #{checkResult},</if>
|
||||
<if test="reciveDate != null">recive_date = #{reciveDate},</if>
|
||||
<if test="inspectDate != null">inspect_date = #{inspectDate},</if>
|
||||
<if test="inspector != null">inspector = #{inspector},</if>
|
||||
<if test="status != null">status = #{status},</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 iqc_id = #{iqcId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteQcIqcByIqcId" parameterType="Long">
|
||||
delete from qc_iqc where iqc_id = #{iqcId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteQcIqcByIqcIds" parameterType="String">
|
||||
delete from qc_iqc where iqc_id in
|
||||
<foreach item="iqcId" collection="array" open="(" separator="," close=")">
|
||||
#{iqcId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user