diff --git a/ktg-mes/src/main/java/com/ktg/mes/qc/controller/QcIpqcLineController.java b/ktg-mes/src/main/java/com/ktg/mes/qc/controller/QcIpqcLineController.java new file mode 100644 index 0000000..1cd43b3 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/qc/controller/QcIpqcLineController.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.QcIpqcLine; +import com.ktg.mes.qc.service.IQcIpqcLineService; +import com.ktg.common.utils.poi.ExcelUtil; +import com.ktg.common.core.page.TableDataInfo; + +/** + * 过程检验单行Controller + * + * @author yinjinlu + * @date 2022-08-30 + */ +@RestController +@RequestMapping("/mes/qc/ipqcline") +public class QcIpqcLineController extends BaseController +{ + @Autowired + private IQcIpqcLineService qcIpqcLineService; + + /** + * 查询过程检验单行列表 + */ + @PreAuthorize("@ss.hasPermi('mes:qc:ipqcline:list')") + @GetMapping("/list") + public TableDataInfo list(QcIpqcLine qcIpqcLine) + { + startPage(); + List list = qcIpqcLineService.selectQcIpqcLineList(qcIpqcLine); + return getDataTable(list); + } + + /** + * 导出过程检验单行列表 + */ + @PreAuthorize("@ss.hasPermi('mes:qc:ipqcline:export')") + @Log(title = "过程检验单行", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, QcIpqcLine qcIpqcLine) + { + List list = qcIpqcLineService.selectQcIpqcLineList(qcIpqcLine); + ExcelUtil util = new ExcelUtil(QcIpqcLine.class); + util.exportExcel(response, list, "过程检验单行数据"); + } + + /** + * 获取过程检验单行详细信息 + */ + @PreAuthorize("@ss.hasPermi('mes:qc:ipqcline:query')") + @GetMapping(value = "/{lineId}") + public AjaxResult getInfo(@PathVariable("lineId") Long lineId) + { + return AjaxResult.success(qcIpqcLineService.selectQcIpqcLineByLineId(lineId)); + } + + /** + * 新增过程检验单行 + */ + @PreAuthorize("@ss.hasPermi('mes:qc:ipqcline:add')") + @Log(title = "过程检验单行", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody QcIpqcLine qcIpqcLine) + { + return toAjax(qcIpqcLineService.insertQcIpqcLine(qcIpqcLine)); + } + + /** + * 修改过程检验单行 + */ + @PreAuthorize("@ss.hasPermi('mes:qc:ipqcline:edit')") + @Log(title = "过程检验单行", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody QcIpqcLine qcIpqcLine) + { + return toAjax(qcIpqcLineService.updateQcIpqcLine(qcIpqcLine)); + } + + /** + * 删除过程检验单行 + */ + @PreAuthorize("@ss.hasPermi('mes:qc:ipqcline:remove')") + @Log(title = "过程检验单行", businessType = BusinessType.DELETE) + @DeleteMapping("/{lineIds}") + public AjaxResult remove(@PathVariable Long[] lineIds) + { + return toAjax(qcIpqcLineService.deleteQcIpqcLineByLineIds(lineIds)); + } +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/qc/domain/QcIpqcLine.java b/ktg-mes/src/main/java/com/ktg/mes/qc/domain/QcIpqcLine.java new file mode 100644 index 0000000..e746e66 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/qc/domain/QcIpqcLine.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_ipqc_line + * + * @author yinjinlu + * @date 2022-08-30 + */ +public class QcIpqcLine extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 记录ID */ + private Long lineId; + + /** 检验单ID */ + @Excel(name = "检验单ID") + private Long ipqcId; + + /** 检测项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 BigDecimal crQuantity; + + /** 严重缺陷数量 */ + @Excel(name = "严重缺陷数量") + private BigDecimal majQuantity; + + /** 轻微缺陷数量 */ + @Excel(name = "轻微缺陷数量") + private BigDecimal 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 setIpqcId(Long ipqcId) + { + this.ipqcId = ipqcId; + } + + public Long getIpqcId() + { + return ipqcId; + } + 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(BigDecimal crQuantity) + { + this.crQuantity = crQuantity; + } + + public BigDecimal getCrQuantity() + { + return crQuantity; + } + public void setMajQuantity(BigDecimal majQuantity) + { + this.majQuantity = majQuantity; + } + + public BigDecimal getMajQuantity() + { + return majQuantity; + } + public void setMinQuantity(BigDecimal minQuantity) + { + this.minQuantity = minQuantity; + } + + public BigDecimal 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("ipqcId", getIpqcId()) + .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/QcIpqcLineMapper.java b/ktg-mes/src/main/java/com/ktg/mes/qc/mapper/QcIpqcLineMapper.java new file mode 100644 index 0000000..9654132 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/qc/mapper/QcIpqcLineMapper.java @@ -0,0 +1,61 @@ +package com.ktg.mes.qc.mapper; + +import java.util.List; +import com.ktg.mes.qc.domain.QcIpqcLine; + +/** + * 过程检验单行Mapper接口 + * + * @author yinjinlu + * @date 2022-08-30 + */ +public interface QcIpqcLineMapper +{ + /** + * 查询过程检验单行 + * + * @param lineId 过程检验单行主键 + * @return 过程检验单行 + */ + public QcIpqcLine selectQcIpqcLineByLineId(Long lineId); + + /** + * 查询过程检验单行列表 + * + * @param qcIpqcLine 过程检验单行 + * @return 过程检验单行集合 + */ + public List selectQcIpqcLineList(QcIpqcLine qcIpqcLine); + + /** + * 新增过程检验单行 + * + * @param qcIpqcLine 过程检验单行 + * @return 结果 + */ + public int insertQcIpqcLine(QcIpqcLine qcIpqcLine); + + /** + * 修改过程检验单行 + * + * @param qcIpqcLine 过程检验单行 + * @return 结果 + */ + public int updateQcIpqcLine(QcIpqcLine qcIpqcLine); + + /** + * 删除过程检验单行 + * + * @param lineId 过程检验单行主键 + * @return 结果 + */ + public int deleteQcIpqcLineByLineId(Long lineId); + + /** + * 批量删除过程检验单行 + * + * @param lineIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteQcIpqcLineByLineIds(Long[] lineIds); +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/qc/service/IQcIpqcLineService.java b/ktg-mes/src/main/java/com/ktg/mes/qc/service/IQcIpqcLineService.java new file mode 100644 index 0000000..da2448f --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/qc/service/IQcIpqcLineService.java @@ -0,0 +1,61 @@ +package com.ktg.mes.qc.service; + +import java.util.List; +import com.ktg.mes.qc.domain.QcIpqcLine; + +/** + * 过程检验单行Service接口 + * + * @author yinjinlu + * @date 2022-08-30 + */ +public interface IQcIpqcLineService +{ + /** + * 查询过程检验单行 + * + * @param lineId 过程检验单行主键 + * @return 过程检验单行 + */ + public QcIpqcLine selectQcIpqcLineByLineId(Long lineId); + + /** + * 查询过程检验单行列表 + * + * @param qcIpqcLine 过程检验单行 + * @return 过程检验单行集合 + */ + public List selectQcIpqcLineList(QcIpqcLine qcIpqcLine); + + /** + * 新增过程检验单行 + * + * @param qcIpqcLine 过程检验单行 + * @return 结果 + */ + public int insertQcIpqcLine(QcIpqcLine qcIpqcLine); + + /** + * 修改过程检验单行 + * + * @param qcIpqcLine 过程检验单行 + * @return 结果 + */ + public int updateQcIpqcLine(QcIpqcLine qcIpqcLine); + + /** + * 批量删除过程检验单行 + * + * @param lineIds 需要删除的过程检验单行主键集合 + * @return 结果 + */ + public int deleteQcIpqcLineByLineIds(Long[] lineIds); + + /** + * 删除过程检验单行信息 + * + * @param lineId 过程检验单行主键 + * @return 结果 + */ + public int deleteQcIpqcLineByLineId(Long lineId); +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/qc/service/impl/QcIpqcLineServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/qc/service/impl/QcIpqcLineServiceImpl.java new file mode 100644 index 0000000..c9b4c0e --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/qc/service/impl/QcIpqcLineServiceImpl.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.QcIpqcLineMapper; +import com.ktg.mes.qc.domain.QcIpqcLine; +import com.ktg.mes.qc.service.IQcIpqcLineService; + +/** + * 过程检验单行Service业务层处理 + * + * @author yinjinlu + * @date 2022-08-30 + */ +@Service +public class QcIpqcLineServiceImpl implements IQcIpqcLineService +{ + @Autowired + private QcIpqcLineMapper qcIpqcLineMapper; + + /** + * 查询过程检验单行 + * + * @param lineId 过程检验单行主键 + * @return 过程检验单行 + */ + @Override + public QcIpqcLine selectQcIpqcLineByLineId(Long lineId) + { + return qcIpqcLineMapper.selectQcIpqcLineByLineId(lineId); + } + + /** + * 查询过程检验单行列表 + * + * @param qcIpqcLine 过程检验单行 + * @return 过程检验单行 + */ + @Override + public List selectQcIpqcLineList(QcIpqcLine qcIpqcLine) + { + return qcIpqcLineMapper.selectQcIpqcLineList(qcIpqcLine); + } + + /** + * 新增过程检验单行 + * + * @param qcIpqcLine 过程检验单行 + * @return 结果 + */ + @Override + public int insertQcIpqcLine(QcIpqcLine qcIpqcLine) + { + qcIpqcLine.setCreateTime(DateUtils.getNowDate()); + return qcIpqcLineMapper.insertQcIpqcLine(qcIpqcLine); + } + + /** + * 修改过程检验单行 + * + * @param qcIpqcLine 过程检验单行 + * @return 结果 + */ + @Override + public int updateQcIpqcLine(QcIpqcLine qcIpqcLine) + { + qcIpqcLine.setUpdateTime(DateUtils.getNowDate()); + return qcIpqcLineMapper.updateQcIpqcLine(qcIpqcLine); + } + + /** + * 批量删除过程检验单行 + * + * @param lineIds 需要删除的过程检验单行主键 + * @return 结果 + */ + @Override + public int deleteQcIpqcLineByLineIds(Long[] lineIds) + { + return qcIpqcLineMapper.deleteQcIpqcLineByLineIds(lineIds); + } + + /** + * 删除过程检验单行信息 + * + * @param lineId 过程检验单行主键 + * @return 结果 + */ + @Override + public int deleteQcIpqcLineByLineId(Long lineId) + { + return qcIpqcLineMapper.deleteQcIpqcLineByLineId(lineId); + } +} diff --git a/ktg-mes/src/main/resources/mapper/qc/QcIpqcLineMapper.xml b/ktg-mes/src/main/resources/mapper/qc/QcIpqcLineMapper.xml new file mode 100644 index 0000000..34af741 --- /dev/null +++ b/ktg-mes/src/main/resources/mapper/qc/QcIpqcLineMapper.xml @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select line_id, ipqc_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_ipqc_line + + + + + + + + insert into qc_ipqc_line + + ipqc_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, + + + #{ipqcId}, + #{indexId}, + #{indexCode}, + #{indexName}, + #{indexType}, + #{qcTool}, + #{checkMethod}, + #{standerVal}, + #{unitOfMeasure}, + #{thresholdMax}, + #{thresholdMin}, + #{crQuantity}, + #{majQuantity}, + #{minQuantity}, + #{remark}, + #{attr1}, + #{attr2}, + #{attr3}, + #{attr4}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update qc_ipqc_line + + ipqc_id = #{ipqcId}, + 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_ipqc_line where line_id = #{lineId} + + + + delete from qc_ipqc_line where line_id in + + #{lineId} + + + \ No newline at end of file