diff --git a/ktg-mes/src/main/java/com/ktg/mes/qc/controller/QcIqcController.java b/ktg-mes/src/main/java/com/ktg/mes/qc/controller/QcIqcController.java index 82e43d4..d8b4831 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/qc/controller/QcIqcController.java +++ b/ktg-mes/src/main/java/com/ktg/mes/qc/controller/QcIqcController.java @@ -5,10 +5,15 @@ import javax.servlet.http.HttpServletResponse; import cn.hutool.core.collection.CollUtil; import com.ktg.common.constant.UserConstants; +import com.ktg.mes.qc.domain.QcIqcLine; +import com.ktg.mes.qc.domain.QcTemplateIndex; import com.ktg.mes.qc.domain.QcTemplateProduct; +import com.ktg.mes.qc.service.IQcIqcLineService; +import com.ktg.mes.qc.service.IQcTemplateIndexService; import com.ktg.mes.qc.service.IQcTemplateProductService; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; @@ -42,6 +47,12 @@ public class QcIqcController extends BaseController @Autowired private IQcTemplateProductService qcTemplateProductService; + @Autowired + private IQcTemplateIndexService qcTemplateIndexService; + + @Autowired + private IQcIqcLineService qcIqcLineService; + /** * 查询来料检验单列表 */ @@ -82,6 +93,7 @@ public class QcIqcController extends BaseController */ @PreAuthorize("@ss.hasPermi('mes:qc:iqc:add')") @Log(title = "来料检验单", businessType = BusinessType.INSERT) + @Transactional @PostMapping public AjaxResult add(@RequestBody QcIqc qcIqc) { @@ -97,7 +109,11 @@ public class QcIqcController extends BaseController }else{ return AjaxResult.error("当前产品未配置检测模板!"); } - return toAjax(qcIqcService.insertQcIqc(qcIqc)); + qcIqc.setInspector(getUsername()); + qcIqcService.insertQcIqc(qcIqc); + generateLine(qcIqc); + Long iqcId = qcIqc.getIqcId(); + return AjaxResult.success(iqcId); //将生成的ID返回给页面 } /** @@ -105,6 +121,7 @@ public class QcIqcController extends BaseController */ @PreAuthorize("@ss.hasPermi('mes:qc:iqc:edit')") @Log(title = "来料检验单", businessType = BusinessType.UPDATE) + @Transactional @PutMapping public AjaxResult edit(@RequestBody QcIqc qcIqc) { @@ -119,7 +136,10 @@ public class QcIqcController extends BaseController }else{ return AjaxResult.error("当前产品未配置检测模板!"); } - return toAjax(qcIqcService.updateQcIqc(qcIqc)); + qcIqcLineService.deleteByIqcId(qcIqc.getIqcId()); + int ret = qcIqcService.updateQcIqc(qcIqc); + generateLine(qcIqc); + return toAjax(ret); } /** @@ -127,9 +147,46 @@ public class QcIqcController extends BaseController */ @PreAuthorize("@ss.hasPermi('mes:qc:iqc:remove')") @Log(title = "来料检验单", businessType = BusinessType.DELETE) + @Transactional @DeleteMapping("/{iqcIds}") public AjaxResult remove(@PathVariable Long[] iqcIds) { + for (Long iqcId:iqcIds + ) { + qcIqcLineService.deleteByIqcId(iqcId); + } return toAjax(qcIqcService.deleteQcIqcByIqcIds(iqcIds)); } + + /** + * 根据头信息生成行信息 + * @param iqc + */ + private void generateLine(QcIqc iqc){ + QcTemplateIndex param = new QcTemplateIndex(); + param.setTemplateId(iqc.getTemplateId()); + List indexs = qcTemplateIndexService.selectQcTemplateIndexList(param); + if(CollUtil.isNotEmpty(indexs)){ + for (QcTemplateIndex index:indexs + ) { + QcIqcLine line = new QcIqcLine(); + line.setIqcId(iqc.getIqcId()); + line.setIndexId(index.getIndexId()); + line.setIndexCode(index.getIndexCode()); + line.setIndexName(index.getIndexName()); + line.setIndexType(index.getIndexType()); + line.setQcTool(index.getQcTool()); + line.setCheckMethod(index.getCheckMethod()); + line.setStanderVal(index.getStanderVal()); + line.setUnitOfMeasure(index.getUnitOfMeasure()); + line.setThresholdMax(index.getThresholdMax()); + line.setThresholdMin(index.getThresholdMin()); + line.setCrQuantity(0L); + line.setMajQuantity(0L); + line.setMajQuantity(0L); + qcIqcLineService.insertQcIqcLine(line); + } + } + } + } diff --git a/ktg-mes/src/main/java/com/ktg/mes/qc/controller/QcIqcLineController.java b/ktg-mes/src/main/java/com/ktg/mes/qc/controller/QcIqcLineController.java new file mode 100644 index 0000000..13a4b7f --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/qc/controller/QcIqcLineController.java @@ -0,0 +1,104 @@ +package com.ktg.mes.qc.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.qc.domain.QcIqcLine; +import com.ktg.mes.qc.service.IQcIqcLineService; +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/iqcline") +public class QcIqcLineController extends BaseController +{ + @Autowired + private IQcIqcLineService qcIqcLineService; + + /** + * 查询来料检验单行列表 + */ + @PreAuthorize("@ss.hasPermi('mes:qc:iqcline:list')") + @GetMapping("/list") + public TableDataInfo list(QcIqcLine qcIqcLine) + { + startPage(); + List list = qcIqcLineService.selectQcIqcLineList(qcIqcLine); + return getDataTable(list); + } + + /** + * 导出来料检验单行列表 + */ + @PreAuthorize("@ss.hasPermi('mes:qc:iqcline:export')") + @Log(title = "来料检验单行", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, QcIqcLine qcIqcLine) + { + List list = qcIqcLineService.selectQcIqcLineList(qcIqcLine); + ExcelUtil util = new ExcelUtil(QcIqcLine.class); + util.exportExcel(response, list, "来料检验单行数据"); + } + + /** + * 获取来料检验单行详细信息 + */ + @PreAuthorize("@ss.hasPermi('mes:qc:iqcline:query')") + @GetMapping(value = "/{lineId}") + public AjaxResult getInfo(@PathVariable("lineId") Long lineId) + { + return AjaxResult.success(qcIqcLineService.selectQcIqcLineByLineId(lineId)); + } + + /** + * 新增来料检验单行 + */ + @PreAuthorize("@ss.hasPermi('mes:qc:iqcline:add')") + @Log(title = "来料检验单行", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody QcIqcLine qcIqcLine) + { + return toAjax(qcIqcLineService.insertQcIqcLine(qcIqcLine)); + } + + /** + * 修改来料检验单行 + */ + @PreAuthorize("@ss.hasPermi('mes:qc:iqcline:edit')") + @Log(title = "来料检验单行", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody QcIqcLine qcIqcLine) + { + return toAjax(qcIqcLineService.updateQcIqcLine(qcIqcLine)); + } + + /** + * 删除来料检验单行 + */ + @PreAuthorize("@ss.hasPermi('mes:qc:iqcline:remove')") + @Log(title = "来料检验单行", businessType = BusinessType.DELETE) + @DeleteMapping("/{lineIds}") + public AjaxResult remove(@PathVariable Long[] lineIds) + { + return toAjax(qcIqcLineService.deleteQcIqcLineByLineIds(lineIds)); + } +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/qc/domain/QcIqc.java b/ktg-mes/src/main/java/com/ktg/mes/qc/domain/QcIqc.java index 12e62d1..54c6952 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/qc/domain/QcIqc.java +++ b/ktg-mes/src/main/java/com/ktg/mes/qc/domain/QcIqc.java @@ -135,6 +135,8 @@ public class QcIqc extends BaseEntity @Excel(name = "检测人员") private String inspector; + private String inspectorName; + /** 单据状态 */ @Excel(name = "单据状态") private String status; @@ -417,7 +419,15 @@ public class QcIqc extends BaseEntity this.status = status; } - public String getStatus() + public String getInspectorName() { + return inspectorName; + } + + public void setInspectorName(String inspectorName) { + this.inspectorName = inspectorName; + } + + public String getStatus() { return status; } @@ -460,46 +470,42 @@ public class QcIqc extends BaseEntity @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(); + return "QcIqc{" + + "iqcId=" + iqcId + + ", iqcCode='" + iqcCode + '\'' + + ", iqcName='" + iqcName + '\'' + + ", templateId=" + templateId + + ", vendorId=" + vendorId + + ", vendorCode='" + vendorCode + '\'' + + ", vendorName='" + vendorName + '\'' + + ", vendorNick='" + vendorNick + '\'' + + ", vendorBatch='" + vendorBatch + '\'' + + ", itemId=" + itemId + + ", itemCode='" + itemCode + '\'' + + ", itemName='" + itemName + '\'' + + ", specification='" + specification + '\'' + + ", unitOfMeasure='" + unitOfMeasure + '\'' + + ", quantityMinCheck=" + quantityMinCheck + + ", quantityMaxUnqualified=" + quantityMaxUnqualified + + ", quantityRecived=" + quantityRecived + + ", quantityCheck=" + quantityCheck + + ", quantityUnqualified=" + quantityUnqualified + + ", crRate=" + crRate + + ", majRate=" + majRate + + ", minRate=" + minRate + + ", crQuantity=" + crQuantity + + ", majQuantity=" + majQuantity + + ", minQuantity=" + minQuantity + + ", checkResult='" + checkResult + '\'' + + ", reciveDate=" + reciveDate + + ", inspectDate=" + inspectDate + + ", inspector='" + inspector + '\'' + + ", inspectorName='" + inspectorName + '\'' + + ", status='" + status + '\'' + + ", attr1='" + attr1 + '\'' + + ", attr2='" + attr2 + '\'' + + ", attr3=" + attr3 + + ", attr4=" + attr4 + + '}'; } } diff --git a/ktg-mes/src/main/java/com/ktg/mes/qc/domain/QcIqcLine.java b/ktg-mes/src/main/java/com/ktg/mes/qc/domain/QcIqcLine.java new file mode 100644 index 0000000..51862b1 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/qc/domain/QcIqcLine.java @@ -0,0 +1,291 @@ +package com.ktg.mes.qc.domain; + +import java.math.BigDecimal; +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_line + * + * @author yinjinlu + * @date 2022-05-19 + */ +public class QcIqcLine extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 记录ID */ + private Long lineId; + + /** 检验单ID */ + @Excel(name = "检验单ID") + private Long iqcId; + + /** 检测项ID */ + @Excel(name = "检测项ID") + private Long indexId; + + /** 检测项编码 */ + @Excel(name = "检测项编码") + private String indexCode; + + /** 检测项名称 */ + @Excel(name = "检测项名称") + private String indexName; + + /** 检测项类型 */ + @Excel(name = "检测项类型") + private String indexType; + + /** 检测工具 */ + @Excel(name = "检测工具") + private String qcTool; + + /** 检测要求 */ + @Excel(name = "检测要求") + private String checkMethod; + + /** 标准值 */ + @Excel(name = "标准值") + private BigDecimal standerVal; + + /** 单位 */ + @Excel(name = "单位") + private String unitOfMeasure; + + /** 误差上限 */ + @Excel(name = "误差上限") + private BigDecimal thresholdMax; + + /** 误差下限 */ + @Excel(name = "误差下限") + private BigDecimal thresholdMin; + + /** 致命缺陷数量 */ + @Excel(name = "致命缺陷数量") + private Long crQuantity; + + /** 严重缺陷数量 */ + @Excel(name = "严重缺陷数量") + private Long majQuantity; + + /** 轻微缺陷数量 */ + @Excel(name = "轻微缺陷数量") + private Long minQuantity; + + /** 预留字段1 */ + private String attr1; + + /** 预留字段2 */ + private String attr2; + + /** 预留字段3 */ + private Long attr3; + + /** 预留字段4 */ + private Long attr4; + + public void setLineId(Long lineId) + { + this.lineId = lineId; + } + + public Long getLineId() + { + return lineId; + } + public void setIqcId(Long iqcId) + { + this.iqcId = iqcId; + } + + public Long getIqcId() + { + return iqcId; + } + public void setIndexId(Long indexId) + { + this.indexId = indexId; + } + + public Long getIndexId() + { + return indexId; + } + public void setIndexCode(String indexCode) + { + this.indexCode = indexCode; + } + + public String getIndexCode() + { + return indexCode; + } + public void setIndexName(String indexName) + { + this.indexName = indexName; + } + + public String getIndexName() + { + return indexName; + } + public void setIndexType(String indexType) + { + this.indexType = indexType; + } + + public String getIndexType() + { + return indexType; + } + public void setQcTool(String qcTool) + { + this.qcTool = qcTool; + } + + public String getQcTool() + { + return qcTool; + } + public void setCheckMethod(String checkMethod) + { + this.checkMethod = checkMethod; + } + + public String getCheckMethod() + { + return checkMethod; + } + public void setStanderVal(BigDecimal standerVal) + { + this.standerVal = standerVal; + } + + public BigDecimal getStanderVal() + { + return standerVal; + } + public void setUnitOfMeasure(String unitOfMeasure) + { + this.unitOfMeasure = unitOfMeasure; + } + + public String getUnitOfMeasure() + { + return unitOfMeasure; + } + public void setThresholdMax(BigDecimal thresholdMax) + { + this.thresholdMax = thresholdMax; + } + + public BigDecimal getThresholdMax() + { + return thresholdMax; + } + public void setThresholdMin(BigDecimal thresholdMin) + { + this.thresholdMin = thresholdMin; + } + + public BigDecimal getThresholdMin() + { + return thresholdMin; + } + 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 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("lineId", getLineId()) + .append("iqcId", getIqcId()) + .append("indexId", getIndexId()) + .append("indexCode", getIndexCode()) + .append("indexName", getIndexName()) + .append("indexType", getIndexType()) + .append("qcTool", getQcTool()) + .append("checkMethod", getCheckMethod()) + .append("standerVal", getStanderVal()) + .append("unitOfMeasure", getUnitOfMeasure()) + .append("thresholdMax", getThresholdMax()) + .append("thresholdMin", getThresholdMin()) + .append("crQuantity", getCrQuantity()) + .append("majQuantity", getMajQuantity()) + .append("minQuantity", getMinQuantity()) + .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(); + } +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/qc/mapper/QcIqcLineMapper.java b/ktg-mes/src/main/java/com/ktg/mes/qc/mapper/QcIqcLineMapper.java new file mode 100644 index 0000000..222029d --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/qc/mapper/QcIqcLineMapper.java @@ -0,0 +1,63 @@ +package com.ktg.mes.qc.mapper; + +import java.util.List; +import com.ktg.mes.qc.domain.QcIqcLine; + +/** + * 来料检验单行Mapper接口 + * + * @author yinjinlu + * @date 2022-05-19 + */ +public interface QcIqcLineMapper +{ + /** + * 查询来料检验单行 + * + * @param lineId 来料检验单行主键 + * @return 来料检验单行 + */ + public QcIqcLine selectQcIqcLineByLineId(Long lineId); + + /** + * 查询来料检验单行列表 + * + * @param qcIqcLine 来料检验单行 + * @return 来料检验单行集合 + */ + public List selectQcIqcLineList(QcIqcLine qcIqcLine); + + /** + * 新增来料检验单行 + * + * @param qcIqcLine 来料检验单行 + * @return 结果 + */ + public int insertQcIqcLine(QcIqcLine qcIqcLine); + + /** + * 修改来料检验单行 + * + * @param qcIqcLine 来料检验单行 + * @return 结果 + */ + public int updateQcIqcLine(QcIqcLine qcIqcLine); + + /** + * 删除来料检验单行 + * + * @param lineId 来料检验单行主键 + * @return 结果 + */ + public int deleteQcIqcLineByLineId(Long lineId); + + public int deleteByIqcId(Long iqcId); + + /** + * 批量删除来料检验单行 + * + * @param lineIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteQcIqcLineByLineIds(Long[] lineIds); +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/qc/service/IQcIqcLineService.java b/ktg-mes/src/main/java/com/ktg/mes/qc/service/IQcIqcLineService.java new file mode 100644 index 0000000..c3b1aa7 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/qc/service/IQcIqcLineService.java @@ -0,0 +1,69 @@ +package com.ktg.mes.qc.service; + +import java.util.List; +import com.ktg.mes.qc.domain.QcIqcLine; + +/** + * 来料检验单行Service接口 + * + * @author yinjinlu + * @date 2022-05-19 + */ +public interface IQcIqcLineService +{ + /** + * 查询来料检验单行 + * + * @param lineId 来料检验单行主键 + * @return 来料检验单行 + */ + public QcIqcLine selectQcIqcLineByLineId(Long lineId); + + /** + * 查询来料检验单行列表 + * + * @param qcIqcLine 来料检验单行 + * @return 来料检验单行集合 + */ + public List selectQcIqcLineList(QcIqcLine qcIqcLine); + + /** + * 新增来料检验单行 + * + * @param qcIqcLine 来料检验单行 + * @return 结果 + */ + public int insertQcIqcLine(QcIqcLine qcIqcLine); + + /** + * 修改来料检验单行 + * + * @param qcIqcLine 来料检验单行 + * @return 结果 + */ + public int updateQcIqcLine(QcIqcLine qcIqcLine); + + /** + * 批量删除来料检验单行 + * + * @param lineIds 需要删除的来料检验单行主键集合 + * @return 结果 + */ + public int deleteQcIqcLineByLineIds(Long[] lineIds); + + /** + * 删除所有行信息 + * @param iqcId + * @return + */ + public int deleteByIqcId(Long iqcId); + + + /** + * 删除来料检验单行信息 + * + * @param lineId 来料检验单行主键 + * @return 结果 + */ + public int deleteQcIqcLineByLineId(Long lineId); +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/qc/service/impl/QcIqcLineServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/qc/service/impl/QcIqcLineServiceImpl.java new file mode 100644 index 0000000..8a45430 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/qc/service/impl/QcIqcLineServiceImpl.java @@ -0,0 +1,101 @@ +package com.ktg.mes.qc.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.qc.mapper.QcIqcLineMapper; +import com.ktg.mes.qc.domain.QcIqcLine; +import com.ktg.mes.qc.service.IQcIqcLineService; + +/** + * 来料检验单行Service业务层处理 + * + * @author yinjinlu + * @date 2022-05-19 + */ +@Service +public class QcIqcLineServiceImpl implements IQcIqcLineService +{ + @Autowired + private QcIqcLineMapper qcIqcLineMapper; + + /** + * 查询来料检验单行 + * + * @param lineId 来料检验单行主键 + * @return 来料检验单行 + */ + @Override + public QcIqcLine selectQcIqcLineByLineId(Long lineId) + { + return qcIqcLineMapper.selectQcIqcLineByLineId(lineId); + } + + /** + * 查询来料检验单行列表 + * + * @param qcIqcLine 来料检验单行 + * @return 来料检验单行 + */ + @Override + public List selectQcIqcLineList(QcIqcLine qcIqcLine) + { + return qcIqcLineMapper.selectQcIqcLineList(qcIqcLine); + } + + /** + * 新增来料检验单行 + * + * @param qcIqcLine 来料检验单行 + * @return 结果 + */ + @Override + public int insertQcIqcLine(QcIqcLine qcIqcLine) + { + qcIqcLine.setCreateTime(DateUtils.getNowDate()); + return qcIqcLineMapper.insertQcIqcLine(qcIqcLine); + } + + /** + * 修改来料检验单行 + * + * @param qcIqcLine 来料检验单行 + * @return 结果 + */ + @Override + public int updateQcIqcLine(QcIqcLine qcIqcLine) + { + qcIqcLine.setUpdateTime(DateUtils.getNowDate()); + return qcIqcLineMapper.updateQcIqcLine(qcIqcLine); + } + + /** + * 批量删除来料检验单行 + * + * @param lineIds 需要删除的来料检验单行主键 + * @return 结果 + */ + @Override + public int deleteQcIqcLineByLineIds(Long[] lineIds) + { + return qcIqcLineMapper.deleteQcIqcLineByLineIds(lineIds); + } + + @Override + public int deleteByIqcId(Long iqcId) { + return qcIqcLineMapper.deleteByIqcId(iqcId); + } + + /** + * 删除来料检验单行信息 + * + * @param lineId 来料检验单行主键 + * @return 结果 + */ + @Override + public int deleteQcIqcLineByLineId(Long lineId) + { + return qcIqcLineMapper.deleteQcIqcLineByLineId(lineId); + } +} diff --git a/ktg-mes/src/main/resources/mapper/qc/QcIqcLineMapper.xml b/ktg-mes/src/main/resources/mapper/qc/QcIqcLineMapper.xml new file mode 100644 index 0000000..7eacafc --- /dev/null +++ b/ktg-mes/src/main/resources/mapper/qc/QcIqcLineMapper.xml @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select line_id, iqc_id, index_id, index_code, index_name, index_type, qc_tool, check_method, stander_val, unit_of_measure, threshold_max, threshold_min, cr_quantity, maj_quantity, min_quantity, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from qc_iqc_line + + + + + + + + insert into qc_iqc_line + + iqc_id, + index_id, + index_code, + index_name, + index_type, + qc_tool, + check_method, + stander_val, + unit_of_measure, + threshold_max, + threshold_min, + cr_quantity, + maj_quantity, + min_quantity, + remark, + attr1, + attr2, + attr3, + attr4, + create_by, + create_time, + update_by, + update_time, + + + #{iqcId}, + #{indexId}, + #{indexCode}, + #{indexName}, + #{indexType}, + #{qcTool}, + #{checkMethod}, + #{standerVal}, + #{unitOfMeasure}, + #{thresholdMax}, + #{thresholdMin}, + #{crQuantity}, + #{majQuantity}, + #{minQuantity}, + #{remark}, + #{attr1}, + #{attr2}, + #{attr3}, + #{attr4}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update qc_iqc_line + + iqc_id = #{iqcId}, + index_id = #{indexId}, + index_code = #{indexCode}, + index_name = #{indexName}, + index_type = #{indexType}, + qc_tool = #{qcTool}, + check_method = #{checkMethod}, + stander_val = #{standerVal}, + unit_of_measure = #{unitOfMeasure}, + threshold_max = #{thresholdMax}, + threshold_min = #{thresholdMin}, + cr_quantity = #{crQuantity}, + maj_quantity = #{majQuantity}, + min_quantity = #{minQuantity}, + remark = #{remark}, + attr1 = #{attr1}, + attr2 = #{attr2}, + attr3 = #{attr3}, + attr4 = #{attr4}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where line_id = #{lineId} + + + + delete from qc_iqc_line where line_id = #{lineId} + + + + delete from qc_iqc_line where iqc_id =#{iqcId} + + + + delete from qc_iqc_line where line_id in + + #{lineId} + + + \ No newline at end of file diff --git a/ktg-mes/src/main/resources/mapper/qc/QcIqcMapper.xml b/ktg-mes/src/main/resources/mapper/qc/QcIqcMapper.xml index 38acca1..21836c4 100644 --- a/ktg-mes/src/main/resources/mapper/qc/QcIqcMapper.xml +++ b/ktg-mes/src/main/resources/mapper/qc/QcIqcMapper.xml @@ -34,6 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -47,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - 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 + 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,u.nick_name as inspector_name, q.status, q.remark, attr1, attr2, attr3, attr4, q.create_by, q.create_time, q.update_by, q.update_time from qc_iqc q left join sys_user u on u.user_name = q.inspector