From 0c9920eca8e75063ef2d772684e3e8c5cb62c6d3 Mon Sep 17 00:00:00 2001 From: "JinLu.Yin" <411641505@qq.com> Date: Wed, 18 May 2022 15:15:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A3=80=E6=B5=8B=E6=A8=A1=E6=9D=BF=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=A3=80=E6=B5=8B=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../qc/controller/QcTemplateController.java | 16 +- .../controller/QcTemplateIndexController.java | 120 ++++++++ .../ktg/mes/qc/domain/QcTemplateIndex.java | 263 ++++++++++++++++++ .../mes/qc/mapper/QcTemplateIndexMapper.java | 61 ++++ .../qc/service/IQcTemplateIndexService.java | 61 ++++ .../impl/QcTemplateIndexServiceImpl.java | 96 +++++++ .../mapper/qc/QcTemplateIndexMapper.xml | 147 ++++++++++ 7 files changed, 759 insertions(+), 5 deletions(-) create mode 100644 ktg-mes/src/main/java/com/ktg/mes/qc/controller/QcTemplateIndexController.java create mode 100644 ktg-mes/src/main/java/com/ktg/mes/qc/domain/QcTemplateIndex.java create mode 100644 ktg-mes/src/main/java/com/ktg/mes/qc/mapper/QcTemplateIndexMapper.java create mode 100644 ktg-mes/src/main/java/com/ktg/mes/qc/service/IQcTemplateIndexService.java create mode 100644 ktg-mes/src/main/java/com/ktg/mes/qc/service/impl/QcTemplateIndexServiceImpl.java create mode 100644 ktg-mes/src/main/resources/mapper/qc/QcTemplateIndexMapper.xml diff --git a/ktg-mes/src/main/java/com/ktg/mes/qc/controller/QcTemplateController.java b/ktg-mes/src/main/java/com/ktg/mes/qc/controller/QcTemplateController.java index ffb5347..8af0d30 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/qc/controller/QcTemplateController.java +++ b/ktg-mes/src/main/java/com/ktg/mes/qc/controller/QcTemplateController.java @@ -49,13 +49,12 @@ public class QcTemplateController extends BaseController startPage(); List list = qcTemplateService.selectQcTemplateList(qcTemplate); if(CollUtil.isNotEmpty(list)){ - int i=0; - for (QcTemplate template: list - ) { + for (int i=0;i list = qcTemplateIndexService.selectQcTemplateIndexList(qcTemplateIndex); + return getDataTable(list); + } + + /** + * 导出检测模板-检测项列表 + */ + @PreAuthorize("@ss.hasPermi('mes:qc:templateindex:export')") + @Log(title = "检测模板-检测项", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, QcTemplateIndex qcTemplateIndex) + { + List list = qcTemplateIndexService.selectQcTemplateIndexList(qcTemplateIndex); + ExcelUtil util = new ExcelUtil(QcTemplateIndex.class); + util.exportExcel(response, list, "检测模板-检测项数据"); + } + + /** + * 获取检测模板-检测项详细信息 + */ + @PreAuthorize("@ss.hasPermi('mes:qc:templateindex:query')") + @GetMapping(value = "/{recordId}") + public AjaxResult getInfo(@PathVariable("recordId") Long recordId) + { + return AjaxResult.success(qcTemplateIndexService.selectQcTemplateIndexByRecordId(recordId)); + } + + /** + * 新增检测模板-检测项 + */ + @PreAuthorize("@ss.hasPermi('mes:qc:templateindex:add')") + @Log(title = "检测模板-检测项", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody QcTemplateIndex qcTemplateIndex) + { + QcIndex index =qcIndexService.selectQcIndexByIndexId(qcTemplateIndex.getIndexId()); + qcTemplateIndex.setIndexCode(index.getIndexCode()); + qcTemplateIndex.setIndexName(index.getIndexName()); + qcTemplateIndex.setIndexType(index.getIndexType()); + qcTemplateIndex.setQcTool(index.getQcTool()); + return toAjax(qcTemplateIndexService.insertQcTemplateIndex(qcTemplateIndex)); + } + + /** + * 修改检测模板-检测项 + */ + @PreAuthorize("@ss.hasPermi('mes:qc:templateindex:edit')") + @Log(title = "检测模板-检测项", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody QcTemplateIndex qcTemplateIndex) + { + QcIndex index =qcIndexService.selectQcIndexByIndexId(qcTemplateIndex.getIndexId()); + qcTemplateIndex.setIndexCode(index.getIndexCode()); + qcTemplateIndex.setIndexName(index.getIndexName()); + qcTemplateIndex.setIndexType(index.getIndexType()); + qcTemplateIndex.setQcTool(index.getQcTool()); + return toAjax(qcTemplateIndexService.updateQcTemplateIndex(qcTemplateIndex)); + } + + /** + * 删除检测模板-检测项 + */ + @PreAuthorize("@ss.hasPermi('mes:qc:templateindex:remove')") + @Log(title = "检测模板-检测项", businessType = BusinessType.DELETE) + @DeleteMapping("/{recordIds}") + public AjaxResult remove(@PathVariable Long[] recordIds) + { + return toAjax(qcTemplateIndexService.deleteQcTemplateIndexByRecordIds(recordIds)); + } +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/qc/domain/QcTemplateIndex.java b/ktg-mes/src/main/java/com/ktg/mes/qc/domain/QcTemplateIndex.java new file mode 100644 index 0000000..1b2d523 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/qc/domain/QcTemplateIndex.java @@ -0,0 +1,263 @@ +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_template_index + * + * @author yinjinlu + * @date 2022-05-18 + */ +public class QcTemplateIndex extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 记录ID */ + private Long recordId; + + /** 检测模板ID */ + @Excel(name = "检测模板ID") + private Long templateId; + + /** 检测项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 String docUrl; + + /** 预留字段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 setTemplateId(Long templateId) + { + this.templateId = templateId; + } + + public Long getTemplateId() + { + return templateId; + } + 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 setDocUrl(String docUrl) + { + this.docUrl = docUrl; + } + + public String getDocUrl() + { + return docUrl; + } + 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("templateId", getTemplateId()) + .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("docUrl", getDocUrl()) + .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/QcTemplateIndexMapper.java b/ktg-mes/src/main/java/com/ktg/mes/qc/mapper/QcTemplateIndexMapper.java new file mode 100644 index 0000000..5e5bf00 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/qc/mapper/QcTemplateIndexMapper.java @@ -0,0 +1,61 @@ +package com.ktg.mes.qc.mapper; + +import java.util.List; +import com.ktg.mes.qc.domain.QcTemplateIndex; + +/** + * 检测模板-检测项Mapper接口 + * + * @author yinjinlu + * @date 2022-05-18 + */ +public interface QcTemplateIndexMapper +{ + /** + * 查询检测模板-检测项 + * + * @param recordId 检测模板-检测项主键 + * @return 检测模板-检测项 + */ + public QcTemplateIndex selectQcTemplateIndexByRecordId(Long recordId); + + /** + * 查询检测模板-检测项列表 + * + * @param qcTemplateIndex 检测模板-检测项 + * @return 检测模板-检测项集合 + */ + public List selectQcTemplateIndexList(QcTemplateIndex qcTemplateIndex); + + /** + * 新增检测模板-检测项 + * + * @param qcTemplateIndex 检测模板-检测项 + * @return 结果 + */ + public int insertQcTemplateIndex(QcTemplateIndex qcTemplateIndex); + + /** + * 修改检测模板-检测项 + * + * @param qcTemplateIndex 检测模板-检测项 + * @return 结果 + */ + public int updateQcTemplateIndex(QcTemplateIndex qcTemplateIndex); + + /** + * 删除检测模板-检测项 + * + * @param recordId 检测模板-检测项主键 + * @return 结果 + */ + public int deleteQcTemplateIndexByRecordId(Long recordId); + + /** + * 批量删除检测模板-检测项 + * + * @param recordIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteQcTemplateIndexByRecordIds(Long[] recordIds); +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/qc/service/IQcTemplateIndexService.java b/ktg-mes/src/main/java/com/ktg/mes/qc/service/IQcTemplateIndexService.java new file mode 100644 index 0000000..9e00d66 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/qc/service/IQcTemplateIndexService.java @@ -0,0 +1,61 @@ +package com.ktg.mes.qc.service; + +import java.util.List; +import com.ktg.mes.qc.domain.QcTemplateIndex; + +/** + * 检测模板-检测项Service接口 + * + * @author yinjinlu + * @date 2022-05-18 + */ +public interface IQcTemplateIndexService +{ + /** + * 查询检测模板-检测项 + * + * @param recordId 检测模板-检测项主键 + * @return 检测模板-检测项 + */ + public QcTemplateIndex selectQcTemplateIndexByRecordId(Long recordId); + + /** + * 查询检测模板-检测项列表 + * + * @param qcTemplateIndex 检测模板-检测项 + * @return 检测模板-检测项集合 + */ + public List selectQcTemplateIndexList(QcTemplateIndex qcTemplateIndex); + + /** + * 新增检测模板-检测项 + * + * @param qcTemplateIndex 检测模板-检测项 + * @return 结果 + */ + public int insertQcTemplateIndex(QcTemplateIndex qcTemplateIndex); + + /** + * 修改检测模板-检测项 + * + * @param qcTemplateIndex 检测模板-检测项 + * @return 结果 + */ + public int updateQcTemplateIndex(QcTemplateIndex qcTemplateIndex); + + /** + * 批量删除检测模板-检测项 + * + * @param recordIds 需要删除的检测模板-检测项主键集合 + * @return 结果 + */ + public int deleteQcTemplateIndexByRecordIds(Long[] recordIds); + + /** + * 删除检测模板-检测项信息 + * + * @param recordId 检测模板-检测项主键 + * @return 结果 + */ + public int deleteQcTemplateIndexByRecordId(Long recordId); +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/qc/service/impl/QcTemplateIndexServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/qc/service/impl/QcTemplateIndexServiceImpl.java new file mode 100644 index 0000000..c6cd871 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/qc/service/impl/QcTemplateIndexServiceImpl.java @@ -0,0 +1,96 @@ +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.QcTemplateIndexMapper; +import com.ktg.mes.qc.domain.QcTemplateIndex; +import com.ktg.mes.qc.service.IQcTemplateIndexService; + +/** + * 检测模板-检测项Service业务层处理 + * + * @author yinjinlu + * @date 2022-05-18 + */ +@Service +public class QcTemplateIndexServiceImpl implements IQcTemplateIndexService +{ + @Autowired + private QcTemplateIndexMapper qcTemplateIndexMapper; + + /** + * 查询检测模板-检测项 + * + * @param recordId 检测模板-检测项主键 + * @return 检测模板-检测项 + */ + @Override + public QcTemplateIndex selectQcTemplateIndexByRecordId(Long recordId) + { + return qcTemplateIndexMapper.selectQcTemplateIndexByRecordId(recordId); + } + + /** + * 查询检测模板-检测项列表 + * + * @param qcTemplateIndex 检测模板-检测项 + * @return 检测模板-检测项 + */ + @Override + public List selectQcTemplateIndexList(QcTemplateIndex qcTemplateIndex) + { + return qcTemplateIndexMapper.selectQcTemplateIndexList(qcTemplateIndex); + } + + /** + * 新增检测模板-检测项 + * + * @param qcTemplateIndex 检测模板-检测项 + * @return 结果 + */ + @Override + public int insertQcTemplateIndex(QcTemplateIndex qcTemplateIndex) + { + qcTemplateIndex.setCreateTime(DateUtils.getNowDate()); + return qcTemplateIndexMapper.insertQcTemplateIndex(qcTemplateIndex); + } + + /** + * 修改检测模板-检测项 + * + * @param qcTemplateIndex 检测模板-检测项 + * @return 结果 + */ + @Override + public int updateQcTemplateIndex(QcTemplateIndex qcTemplateIndex) + { + qcTemplateIndex.setUpdateTime(DateUtils.getNowDate()); + return qcTemplateIndexMapper.updateQcTemplateIndex(qcTemplateIndex); + } + + /** + * 批量删除检测模板-检测项 + * + * @param recordIds 需要删除的检测模板-检测项主键 + * @return 结果 + */ + @Override + public int deleteQcTemplateIndexByRecordIds(Long[] recordIds) + { + return qcTemplateIndexMapper.deleteQcTemplateIndexByRecordIds(recordIds); + } + + /** + * 删除检测模板-检测项信息 + * + * @param recordId 检测模板-检测项主键 + * @return 结果 + */ + @Override + public int deleteQcTemplateIndexByRecordId(Long recordId) + { + return qcTemplateIndexMapper.deleteQcTemplateIndexByRecordId(recordId); + } +} diff --git a/ktg-mes/src/main/resources/mapper/qc/QcTemplateIndexMapper.xml b/ktg-mes/src/main/resources/mapper/qc/QcTemplateIndexMapper.xml new file mode 100644 index 0000000..0de194b --- /dev/null +++ b/ktg-mes/src/main/resources/mapper/qc/QcTemplateIndexMapper.xml @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select record_id, template_id, index_id, index_code, index_name, index_type, qc_tool, check_method, stander_val, unit_of_measure, threshold_max, threshold_min, doc_url, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from qc_template_index + + + + + + + + insert into qc_template_index + + template_id, + index_id, + index_code, + index_name, + index_type, + qc_tool, + check_method, + stander_val, + unit_of_measure, + threshold_max, + threshold_min, + doc_url, + remark, + attr1, + attr2, + attr3, + attr4, + create_by, + create_time, + update_by, + update_time, + + + #{templateId}, + #{indexId}, + #{indexCode}, + #{indexName}, + #{indexType}, + #{qcTool}, + #{checkMethod}, + #{standerVal}, + #{unitOfMeasure}, + #{thresholdMax}, + #{thresholdMin}, + #{docUrl}, + #{remark}, + #{attr1}, + #{attr2}, + #{attr3}, + #{attr4}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update qc_template_index + + template_id = #{templateId}, + 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}, + doc_url = #{docUrl}, + remark = #{remark}, + attr1 = #{attr1}, + attr2 = #{attr2}, + attr3 = #{attr3}, + attr4 = #{attr4}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where record_id = #{recordId} + + + + delete from qc_template_index where record_id = #{recordId} + + + + delete from qc_template_index where record_id in + + #{recordId} + + + \ No newline at end of file