diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckProjectController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckProjectController.java new file mode 100644 index 00000000..b9f60e5f --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckProjectController.java @@ -0,0 +1,97 @@ +package com.op.quality.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +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.op.common.log.annotation.Log; +import com.op.common.log.enums.BusinessType; +import com.op.common.security.annotation.RequiresPermissions; +import com.op.quality.domain.QcCheckProject; +import com.op.quality.service.IQcCheckProjectService; +import com.op.common.core.web.controller.BaseController; +import com.op.common.core.web.domain.AjaxResult; +import com.op.common.core.utils.poi.ExcelUtil; +import com.op.common.core.web.page.TableDataInfo; + +/** + * 检验项目维护Controller + * + * @author Open Platform + * @date 2023-10-13 + */ +@RestController +@RequestMapping("/project") +public class QcCheckProjectController extends BaseController { + @Autowired + private IQcCheckProjectService qcCheckProjectService; + + /** + * 查询检验项目维护列表 + */ + @RequiresPermissions("quality:project:list") + @GetMapping("/list") + public TableDataInfo list(QcCheckProject qcCheckProject) { + startPage(); + List list = qcCheckProjectService.selectQcCheckProjectList(qcCheckProject); + return getDataTable(list); + } + + /** + * 导出检验项目维护列表 + */ + @RequiresPermissions("quality:project:export") + @Log(title = "检验项目维护", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, QcCheckProject qcCheckProject) { + List list = qcCheckProjectService.selectQcCheckProjectList(qcCheckProject); + ExcelUtil util = new ExcelUtil(QcCheckProject.class); + util.exportExcel(response, list, "检验项目维护数据"); + } + + /** + * 获取检验项目维护详细信息 + */ + @RequiresPermissions("quality:project:query") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") String id) { + return success(qcCheckProjectService.selectQcCheckProjectById(id)); + } + + /** + * 新增检验项目维护 + */ + @RequiresPermissions("quality:project:add") + @Log(title = "检验项目维护", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody QcCheckProject qcCheckProject) { + return toAjax(qcCheckProjectService.insertQcCheckProject(qcCheckProject)); + } + + /** + * 修改检验项目维护 + */ + @RequiresPermissions("quality:project:edit") + @Log(title = "检验项目维护", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody QcCheckProject qcCheckProject) { + return toAjax(qcCheckProjectService.updateQcCheckProject(qcCheckProject)); + } + + /** + * 删除检验项目维护 + */ + @RequiresPermissions("quality:project:remove") + @Log(title = "检验项目维护", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable String[] ids) { + return toAjax(qcCheckProjectService.deleteQcCheckProjectByIds(ids)); + } +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTypeProjectController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTypeProjectController.java new file mode 100644 index 00000000..f9d246dc --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTypeProjectController.java @@ -0,0 +1,110 @@ +package com.op.quality.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.op.quality.domain.QcMaterialGroup; +import com.op.quality.service.IQcMaterialGroupService; +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.op.common.log.annotation.Log; +import com.op.common.log.enums.BusinessType; +import com.op.common.security.annotation.RequiresPermissions; +import com.op.quality.domain.QcCheckTypeProject; +import com.op.quality.service.IQcCheckTypeProjectService; +import com.op.common.core.web.controller.BaseController; +import com.op.common.core.web.domain.AjaxResult; +import com.op.common.core.utils.poi.ExcelUtil; +import com.op.common.core.web.page.TableDataInfo; + +/** + * 物料检验项目维护Controller + * + * @author Open Platform + * @date 2023-10-17 + */ +@RestController +@RequestMapping("/checkTypeProject") +public class QcCheckTypeProjectController extends BaseController { + @Autowired + private IQcCheckTypeProjectService qcCheckTypeProjectService; + @Autowired + private IQcMaterialGroupService qcMaterialGroupService; + + /** + * 查询物料检验项目维护列表 + */ + @RequiresPermissions("quality:checkTypeProject:list") + @GetMapping("/list") + public TableDataInfo list(QcCheckTypeProject qcCheckTypeProject) { + startPage(); + List list = qcCheckTypeProjectService.selectQcCheckTypeProjectList(qcCheckTypeProject); + return getDataTable(list); + } + + /** + * 获取物料组树列表 + */ + @GetMapping("/materialTree") + public AjaxResult selectQcMaterialTreeList(QcMaterialGroup materialGroup) { + return success(qcMaterialGroupService.selectQcMaterialTreeList(materialGroup)); + } + + /** + * 导出物料检验项目维护列表 + */ + @RequiresPermissions("quality:checkTypeProject:export") + @Log(title = "物料检验项目维护", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, QcCheckTypeProject qcCheckTypeProject) { + List list = qcCheckTypeProjectService.selectQcCheckTypeProjectList(qcCheckTypeProject); + ExcelUtil util = new ExcelUtil(QcCheckTypeProject.class); + util.exportExcel(response, list, "物料检验项目维护数据"); + } + + /** + * 获取物料检验项目维护详细信息 + */ + @RequiresPermissions("quality:checkTypeProject:query") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") String id) { + return success(qcCheckTypeProjectService.selectQcCheckTypeProjectById(id)); + } + + /** + * 新增物料检验项目维护 + */ + @RequiresPermissions("quality:checkTypeProject:add") + @Log(title = "物料检验项目维护", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody QcCheckTypeProject qcCheckTypeProject) { + return toAjax(qcCheckTypeProjectService.insertQcCheckTypeProject(qcCheckTypeProject)); + } + + /** + * 修改物料检验项目维护 + */ + @RequiresPermissions("quality:checkTypeProject:edit") + @Log(title = "物料检验项目维护", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody QcCheckTypeProject qcCheckTypeProject) { + return toAjax(qcCheckTypeProjectService.updateQcCheckTypeProject(qcCheckTypeProject)); + } + + /** + * 删除物料检验项目维护 + */ + @RequiresPermissions("quality:checkTypeProject:remove") + @Log(title = "物料检验项目维护", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable String[] ids) { + return toAjax(qcCheckTypeProjectService.deleteQcCheckTypeProjectByIds(ids)); + } +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcMaterialGroupController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcMaterialGroupController.java new file mode 100644 index 00000000..5efe77b8 --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcMaterialGroupController.java @@ -0,0 +1,97 @@ +package com.op.quality.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +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.op.common.log.annotation.Log; +import com.op.common.log.enums.BusinessType; +import com.op.common.security.annotation.RequiresPermissions; +import com.op.quality.domain.QcMaterialGroup; +import com.op.quality.service.IQcMaterialGroupService; +import com.op.common.core.web.controller.BaseController; +import com.op.common.core.web.domain.AjaxResult; +import com.op.common.core.utils.poi.ExcelUtil; +import com.op.common.core.web.page.TableDataInfo; + +/** + * 物料组Controller + * + * @author materialGroup + * @date 2023-10-16 + */ +@RestController +@RequestMapping("/materialGroup") +public class QcMaterialGroupController extends BaseController { + @Autowired + private IQcMaterialGroupService qcMaterialGroupService; + + /** + * 查询物料组列表 + */ + @RequiresPermissions("quality:materialGroup:list") + @GetMapping("/list") + public TableDataInfo list(QcMaterialGroup qcMaterialGroup) { + startPage(); + List list = qcMaterialGroupService.selectQcMaterialGroupList(qcMaterialGroup); + return getDataTable(list); + } + + /** + * 导出物料组列表 + */ + @RequiresPermissions("quality:materialGroup:export") + @Log(title = "物料组", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, QcMaterialGroup qcMaterialGroup) { + List list = qcMaterialGroupService.selectQcMaterialGroupList(qcMaterialGroup); + ExcelUtil util = new ExcelUtil(QcMaterialGroup.class); + util.exportExcel(response, list, "物料组数据"); + } + + /** + * 获取物料组详细信息 + */ + @RequiresPermissions("quality:materialGroup:query") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") String id) { + return success(qcMaterialGroupService.selectQcMaterialGroupById(id)); + } + + /** + * 新增物料组 + */ + @RequiresPermissions("quality:materialGroup:add") + @Log(title = "物料组", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody QcMaterialGroup qcMaterialGroup) { + return toAjax(qcMaterialGroupService.insertQcMaterialGroup(qcMaterialGroup)); + } + + /** + * 修改物料组 + */ + @RequiresPermissions("quality:materialGroup:edit") + @Log(title = "物料组", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody QcMaterialGroup qcMaterialGroup) { + return toAjax(qcMaterialGroupService.updateQcMaterialGroup(qcMaterialGroup)); + } + + /** + * 删除物料组 + */ + @RequiresPermissions("quality:materialGroup:remove") + @Log(title = "物料组", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable String[] ids) { + return toAjax(qcMaterialGroupService.deleteQcMaterialGroupByIds(ids)); + } +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcMaterialGroupDetailController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcMaterialGroupDetailController.java new file mode 100644 index 00000000..3e7c287d --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcMaterialGroupDetailController.java @@ -0,0 +1,97 @@ +package com.op.quality.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +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.op.common.log.annotation.Log; +import com.op.common.log.enums.BusinessType; +import com.op.common.security.annotation.RequiresPermissions; +import com.op.quality.domain.QcMaterialGroupDetail; +import com.op.quality.service.IQcMaterialGroupDetailService; +import com.op.common.core.web.controller.BaseController; +import com.op.common.core.web.domain.AjaxResult; +import com.op.common.core.utils.poi.ExcelUtil; +import com.op.common.core.web.page.TableDataInfo; + +/** + * 物料组成员Controller + * + * @author Open Platform + * @date 2023-10-18 + */ +@RestController +@RequestMapping("/materialGroupDetail") +public class QcMaterialGroupDetailController extends BaseController { + @Autowired + private IQcMaterialGroupDetailService qcMaterialGroupDetailService; + + /** + * 查询物料组成员列表 + */ + @RequiresPermissions("quality:materialGroupDetail:list") + @GetMapping("/list") + public TableDataInfo list(QcMaterialGroupDetail qcMaterialGroupDetail) { + startPage(); + List list = qcMaterialGroupDetailService.selectQcMaterialGroupDetailList(qcMaterialGroupDetail); + return getDataTable(list); + } + + /** + * 导出物料组成员列表 + */ + @RequiresPermissions("quality:materialGroupDetail:export") + @Log(title = "物料组成员", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, QcMaterialGroupDetail qcMaterialGroupDetail) { + List list = qcMaterialGroupDetailService.selectQcMaterialGroupDetailList(qcMaterialGroupDetail); + ExcelUtil util = new ExcelUtil(QcMaterialGroupDetail.class); + util.exportExcel(response, list, "物料组成员数据"); + } + + /** + * 获取物料组成员详细信息 + */ + @RequiresPermissions("quality:materialGroupDetail:query") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") String id) { + return success(qcMaterialGroupDetailService.selectQcMaterialGroupDetailById(id)); + } + + /** + * 新增物料组成员 + */ + @RequiresPermissions("quality:materialGroupDetail:add") + @Log(title = "物料组成员", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody QcMaterialGroupDetail qcMaterialGroupDetail) { + return toAjax(qcMaterialGroupDetailService.insertQcMaterialGroupDetail(qcMaterialGroupDetail)); + } + + /** + * 修改物料组成员 + */ + @RequiresPermissions("quality:materialGroupDetail:edit") + @Log(title = "物料组成员", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody QcMaterialGroupDetail qcMaterialGroupDetail) { + return toAjax(qcMaterialGroupDetailService.updateQcMaterialGroupDetail(qcMaterialGroupDetail)); + } + + /** + * 删除物料组成员 + */ + @RequiresPermissions("quality:materialGroupDetail:remove") + @Log(title = "物料组成员", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable String[] ids) { + return toAjax(qcMaterialGroupDetailService.deleteQcMaterialGroupDetailByIds(ids)); + } +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckProject.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckProject.java new file mode 100644 index 00000000..2676ee09 --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckProject.java @@ -0,0 +1,157 @@ +package com.op.quality.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.op.common.core.annotation.Excel; +import com.op.common.core.web.domain.BaseEntity; + +/** + * 检验项目维护对象 qc_check_project + * + * @author Open Platform + * @date 2023-10-13 + */ +public class QcCheckProject extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** id */ + private String id; + + /** 检验规则编号 */ + @Excel(name = "检验规则编号") + private String orderNum; + + /** 检验规则名称 */ + @Excel(name = "检验规则名称") + private String ruleName; + + /** 检验规则属性 */ + @Excel(name = "检验规则属性") + private String propertyCode; + + /** 检验方式 */ + @Excel(name = "检验方式") + private String checkMode; + + /** 检验工具 */ + @Excel(name = "检验工具") + private String checkTool; + + /** 单位 */ + @Excel(name = "单位") + private String unitCode; + + /** 检验标准 */ + @Excel(name = "检验标准") + private String checkStandard; + + /** 预留字段1 */ + @Excel(name = "预留字段1") + private String attr1; + + /** 工厂编码 */ + @Excel(name = "工厂编码") + private String factoryCode; + + /** 删除标识1删除0正常 */ + private String delFlag; + + public void setId(String id) { + this.id = id; + } + + public String getId() { + return id; + } + public void setOrderNum(String orderNum) { + this.orderNum = orderNum; + } + + public String getOrderNum() { + return orderNum; + } + public void setRuleName(String ruleName) { + this.ruleName = ruleName; + } + + public String getRuleName() { + return ruleName; + } + public void setPropertyCode(String propertyCode) { + this.propertyCode = propertyCode; + } + + public String getPropertyCode() { + return propertyCode; + } + public void setCheckMode(String checkMode) { + this.checkMode = checkMode; + } + + public String getCheckMode() { + return checkMode; + } + public void setCheckTool(String checkTool) { + this.checkTool = checkTool; + } + + public String getCheckTool() { + return checkTool; + } + public void setUnitCode(String unitCode) { + this.unitCode = unitCode; + } + + public String getUnitCode() { + return unitCode; + } + public void setCheckStandard(String checkStandard) { + this.checkStandard = checkStandard; + } + + public String getCheckStandard() { + return checkStandard; + } + public void setAttr1(String attr1) { + this.attr1 = attr1; + } + + public String getAttr1() { + return attr1; + } + public void setFactoryCode(String factoryCode) { + this.factoryCode = factoryCode; + } + + public String getFactoryCode() { + return factoryCode; + } + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDelFlag() { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("orderNum", getOrderNum()) + .append("ruleName", getRuleName()) + .append("propertyCode", getPropertyCode()) + .append("checkMode", getCheckMode()) + .append("checkTool", getCheckTool()) + .append("unitCode", getUnitCode()) + .append("checkStandard", getCheckStandard()) + .append("attr1", getAttr1()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("factoryCode", getFactoryCode()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTypeProject.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTypeProject.java new file mode 100644 index 00000000..4920c001 --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTypeProject.java @@ -0,0 +1,182 @@ +package com.op.quality.domain; + +import java.math.BigDecimal; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.op.common.core.annotation.Excel; +import com.op.common.core.web.domain.BaseEntity; + +/** + * 物料检验项目维护对象 qc_check_type_project + * + * @author Open Platform + * @date 2023-10-18 + */ +public class QcCheckTypeProject extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** id */ + private String id; + + /** 检验项目id */ + @Excel(name = "检验项目id") + private String projectId; + + /** 检验节点id */ + @Excel(name = "检验节点id") + private String typeId; + + /** 标准值 */ + @Excel(name = "标准值") + private BigDecimal standardValue; + + /** 上差值 */ + @Excel(name = "上差值") + private BigDecimal upperDiff; + + /** 下差值 */ + @Excel(name = "下差值") + private BigDecimal downDiff; + + /** 抽样比例 */ + @Excel(name = "抽样比例") + private BigDecimal sample; + + /** 是否启用,0是1否 */ + @Excel(name = "是否启用,0是1否") + private String status; + + /** 预留字段1 */ + @Excel(name = "预留字段1") + private String attr1; + + /** 工厂编码 */ + @Excel(name = "工厂编码") + private String factoryCode; + + /** 删除标识1删除0正常 */ + private String delFlag; + + /** 物料组id */ + @Excel(name = "物料组id") + private String groupId; + + /** 物料编码 */ + @Excel(name = "物料编码") + private String materialCode; + + public void setId(String id) { + this.id = id; + } + + public String getId() { + return id; + } + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getProjectId() { + return projectId; + } + public void setTypeId(String typeId) { + this.typeId = typeId; + } + + public String getTypeId() { + return typeId; + } + public void setStandardValue(BigDecimal standardValue) { + this.standardValue = standardValue; + } + + public BigDecimal getStandardValue() { + return standardValue; + } + public void setUpperDiff(BigDecimal upperDiff) { + this.upperDiff = upperDiff; + } + + public BigDecimal getUpperDiff() { + return upperDiff; + } + public void setDownDiff(BigDecimal downDiff) { + this.downDiff = downDiff; + } + + public BigDecimal getDownDiff() { + return downDiff; + } + public void setSample(BigDecimal sample) { + this.sample = sample; + } + + public BigDecimal getSample() { + return sample; + } + 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 setFactoryCode(String factoryCode) { + this.factoryCode = factoryCode; + } + + public String getFactoryCode() { + return factoryCode; + } + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDelFlag() { + return delFlag; + } + public void setGroupId(String groupId) { + this.groupId = groupId; + } + + public String getGroupId() { + return groupId; + } + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public String getMaterialCode() { + return materialCode; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("projectId", getProjectId()) + .append("typeId", getTypeId()) + .append("standardValue", getStandardValue()) + .append("upperDiff", getUpperDiff()) + .append("downDiff", getDownDiff()) + .append("sample", getSample()) + .append("status", getStatus()) + .append("attr1", getAttr1()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("factoryCode", getFactoryCode()) + .append("delFlag", getDelFlag()) + .append("groupId", getGroupId()) + .append("materialCode", getMaterialCode()) + .toString(); + } +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcMaterialGroup.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcMaterialGroup.java new file mode 100644 index 00000000..a908adc8 --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcMaterialGroup.java @@ -0,0 +1,119 @@ +package com.op.quality.domain; + +import com.op.system.api.domain.SysDept; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.op.common.core.annotation.Excel; +import com.op.common.core.web.domain.BaseEntity; + +import java.util.ArrayList; +import java.util.List; + +/** + * 物料组对象 qc_material_group + * + * @author materialGroup + * @date 2023-10-16 + */ +public class QcMaterialGroup extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** id */ + private String id; + + /** 物料组名称 */ + @Excel(name = "物料组名称") + private String groupName; + + /** 预留字段1 */ + @Excel(name = "预留字段1") + private String attr1; + + /** 工厂编码 */ + @Excel(name = "工厂编码") + private String factoryCode; + + /** 删除标识1删除0正常 */ + private String delFlag; + /*父ID*/ + private String parentId; + /*子名称*/ + private String materialName; + + private List children = new ArrayList(); + + public void setId(String id) { + this.id = id; + } + + public String getId() { + return id; + } + public void setGroupName(String groupName) { + this.groupName = groupName; + } + + public String getGroupName() { + return groupName; + } + public void setAttr1(String attr1) { + this.attr1 = attr1; + } + + public String getAttr1() { + return attr1; + } + public void setFactoryCode(String factoryCode) { + this.factoryCode = factoryCode; + } + + public String getFactoryCode() { + return factoryCode; + } + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDelFlag() { + return delFlag; + } + + public String getParentId() { + return parentId; + } + + public void setParentId(String parentId) { + this.parentId = parentId; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public List getChildren() { + return children; + } + + public void setChildren(List children) { + this.children = children; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("groupName", getGroupName()) + .append("attr1", getAttr1()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("factoryCode", getFactoryCode()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcMaterialGroupDetail.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcMaterialGroupDetail.java new file mode 100644 index 00000000..dcf7e1f8 --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcMaterialGroupDetail.java @@ -0,0 +1,109 @@ +package com.op.quality.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.op.common.core.annotation.Excel; +import com.op.common.core.web.domain.BaseEntity; + +/** + * 物料组成员对象 qc_material_group_detail + * + * @author Open Platform + * @date 2023-10-18 + */ +public class QcMaterialGroupDetail extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** id */ + private String id; + + /** 物料组id */ + @Excel(name = "物料组id") + private String groupId; + + /** 物料号 */ + @Excel(name = "物料号") + private String materialCode; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String materialName; + + /** 预留字段1 */ + @Excel(name = "预留字段1") + private String attr1; + + /** 工厂编码 */ + @Excel(name = "工厂编码") + private String factoryCode; + + /** 删除标识1删除0正常 */ + private String delFlag; + + public void setId(String id) { + this.id = id; + } + + public String getId() { + return id; + } + public void setGroupId(String groupId) { + this.groupId = groupId; + } + + public String getGroupId() { + return groupId; + } + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public String getMaterialCode() { + return materialCode; + } + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public String getMaterialName() { + return materialName; + } + public void setAttr1(String attr1) { + this.attr1 = attr1; + } + + public String getAttr1() { + return attr1; + } + public void setFactoryCode(String factoryCode) { + this.factoryCode = factoryCode; + } + + public String getFactoryCode() { + return factoryCode; + } + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDelFlag() { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("groupId", getGroupId()) + .append("materialCode", getMaterialCode()) + .append("materialName", getMaterialName()) + .append("attr1", getAttr1()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("factoryCode", getFactoryCode()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/vo/TreeSelect.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/vo/TreeSelect.java new file mode 100644 index 00000000..83ce9966 --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/vo/TreeSelect.java @@ -0,0 +1,62 @@ +package com.op.quality.domain.vo; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.op.quality.domain.QcMaterialGroup; + + +import java.io.Serializable; +import java.util.List; +import java.util.stream.Collectors; + +/** + * Treeselect树结构实体类 + * + * @author OP + */ +public class TreeSelect implements Serializable { + private static final long serialVersionUID = 1L; + + /** 节点ID */ + private String id; + + /** 节点名称 */ + private String label; + + /** 子节点 */ + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private List children; + + public TreeSelect() { + + } + + public TreeSelect(QcMaterialGroup qcMaterialGroup) { + this.id = qcMaterialGroup.getId(); + this.label = qcMaterialGroup.getGroupName(); + this.children = qcMaterialGroup.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public List getChildren() { + return children; + } + + public void setChildren(List children) { + this.children = children; + } +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckProjectMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckProjectMapper.java new file mode 100644 index 00000000..1c5f8282 --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckProjectMapper.java @@ -0,0 +1,63 @@ +package com.op.quality.mapper; + +import java.util.List; + +import com.op.quality.domain.QcCheckProject; +import org.apache.ibatis.annotations.Mapper; + +/** + * 检验项目维护Mapper接口 + * + * @author Open Platform + * @date 2023-10-13 + */ +@Mapper +public interface QcCheckProjectMapper { + /** + * 查询检验项目维护 + * + * @param id 检验项目维护主键 + * @return 检验项目维护 + */ + public QcCheckProject selectQcCheckProjectById(String id); + + /** + * 查询检验项目维护列表 + * + * @param qcCheckProject 检验项目维护 + * @return 检验项目维护集合 + */ + public List selectQcCheckProjectList(QcCheckProject qcCheckProject); + + /** + * 新增检验项目维护 + * + * @param qcCheckProject 检验项目维护 + * @return 结果 + */ + public int insertQcCheckProject(QcCheckProject qcCheckProject); + + /** + * 修改检验项目维护 + * + * @param qcCheckProject 检验项目维护 + * @return 结果 + */ + public int updateQcCheckProject(QcCheckProject qcCheckProject); + + /** + * 删除检验项目维护 + * + * @param id 检验项目维护主键 + * @return 结果 + */ + public int deleteQcCheckProjectById(String id); + + /** + * 批量删除检验项目维护 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteQcCheckProjectByIds(String[] ids); +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTypeProjectMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTypeProjectMapper.java new file mode 100644 index 00000000..db219e0c --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTypeProjectMapper.java @@ -0,0 +1,63 @@ +package com.op.quality.mapper; + +import java.util.List; + +import com.op.quality.domain.QcCheckTypeProject; +import org.apache.ibatis.annotations.Mapper; + +/** + * 物料检验项目维护Mapper接口 + * + * @author Open Platform + * @date 2023-10-17 + */ +@Mapper +public interface QcCheckTypeProjectMapper { + /** + * 查询物料检验项目维护 + * + * @param id 物料检验项目维护主键 + * @return 物料检验项目维护 + */ + public QcCheckTypeProject selectQcCheckTypeProjectById(String id); + + /** + * 查询物料检验项目维护列表 + * + * @param qcCheckTypeProject 物料检验项目维护 + * @return 物料检验项目维护集合 + */ + public List selectQcCheckTypeProjectList(QcCheckTypeProject qcCheckTypeProject); + + /** + * 新增物料检验项目维护 + * + * @param qcCheckTypeProject 物料检验项目维护 + * @return 结果 + */ + public int insertQcCheckTypeProject(QcCheckTypeProject qcCheckTypeProject); + + /** + * 修改物料检验项目维护 + * + * @param qcCheckTypeProject 物料检验项目维护 + * @return 结果 + */ + public int updateQcCheckTypeProject(QcCheckTypeProject qcCheckTypeProject); + + /** + * 删除物料检验项目维护 + * + * @param id 物料检验项目维护主键 + * @return 结果 + */ + public int deleteQcCheckTypeProjectById(String id); + + /** + * 批量删除物料检验项目维护 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteQcCheckTypeProjectByIds(String[] ids); +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcMaterialGroupDetailMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcMaterialGroupDetailMapper.java new file mode 100644 index 00000000..00450e3f --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcMaterialGroupDetailMapper.java @@ -0,0 +1,63 @@ +package com.op.quality.mapper; + +import java.util.List; + +import com.op.quality.domain.QcMaterialGroupDetail; +import org.apache.ibatis.annotations.Mapper; + +/** + * 物料组成员Mapper接口 + * + * @author Open Platform + * @date 2023-10-18 + */ +@Mapper +public interface QcMaterialGroupDetailMapper { + /** + * 查询物料组成员 + * + * @param id 物料组成员主键 + * @return 物料组成员 + */ + public QcMaterialGroupDetail selectQcMaterialGroupDetailById(String id); + + /** + * 查询物料组成员列表 + * + * @param qcMaterialGroupDetail 物料组成员 + * @return 物料组成员集合 + */ + public List selectQcMaterialGroupDetailList(QcMaterialGroupDetail qcMaterialGroupDetail); + + /** + * 新增物料组成员 + * + * @param qcMaterialGroupDetail 物料组成员 + * @return 结果 + */ + public int insertQcMaterialGroupDetail(QcMaterialGroupDetail qcMaterialGroupDetail); + + /** + * 修改物料组成员 + * + * @param qcMaterialGroupDetail 物料组成员 + * @return 结果 + */ + public int updateQcMaterialGroupDetail(QcMaterialGroupDetail qcMaterialGroupDetail); + + /** + * 删除物料组成员 + * + * @param id 物料组成员主键 + * @return 结果 + */ + public int deleteQcMaterialGroupDetailById(String id); + + /** + * 批量删除物料组成员 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteQcMaterialGroupDetailByIds(String[] ids); +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcMaterialGroupMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcMaterialGroupMapper.java new file mode 100644 index 00000000..31405898 --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcMaterialGroupMapper.java @@ -0,0 +1,65 @@ +package com.op.quality.mapper; + +import java.util.List; + +import com.op.quality.domain.QcMaterialGroup; +import org.apache.ibatis.annotations.Mapper; + +/** + * 物料组Mapper接口 + * + * @author materialGroup + * @date 2023-10-16 + */ +@Mapper +public interface QcMaterialGroupMapper { + /** + * 查询物料组 + * + * @param id 物料组主键 + * @return 物料组 + */ + public QcMaterialGroup selectQcMaterialGroupById(String id); + + /** + * 查询物料组列表 + * + * @param qcMaterialGroup 物料组 + * @return 物料组集合 + */ + public List selectQcMaterialGroupList(QcMaterialGroup qcMaterialGroup); + + /** + * 新增物料组 + * + * @param qcMaterialGroup 物料组 + * @return 结果 + */ + public int insertQcMaterialGroup(QcMaterialGroup qcMaterialGroup); + + /** + * 修改物料组 + * + * @param qcMaterialGroup 物料组 + * @return 结果 + */ + public int updateQcMaterialGroup(QcMaterialGroup qcMaterialGroup); + + /** + * 删除物料组 + * + * @param id 物料组主键 + * @return 结果 + */ + public int deleteQcMaterialGroupById(String id); + + /** + * 批量删除物料组 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteQcMaterialGroupByIds(String[] ids); + + public List getMaterialChildrenList(QcMaterialGroup qcMaterialGroup); +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckProjectService.java b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckProjectService.java new file mode 100644 index 00000000..c928bc11 --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckProjectService.java @@ -0,0 +1,60 @@ +package com.op.quality.service; + +import java.util.List; +import com.op.quality.domain.QcCheckProject; + +/** + * 检验项目维护Service接口 + * + * @author Open Platform + * @date 2023-10-13 + */ +public interface IQcCheckProjectService { + /** + * 查询检验项目维护 + * + * @param id 检验项目维护主键 + * @return 检验项目维护 + */ + public QcCheckProject selectQcCheckProjectById(String id); + + /** + * 查询检验项目维护列表 + * + * @param qcCheckProject 检验项目维护 + * @return 检验项目维护集合 + */ + public List selectQcCheckProjectList(QcCheckProject qcCheckProject); + + /** + * 新增检验项目维护 + * + * @param qcCheckProject 检验项目维护 + * @return 结果 + */ + public int insertQcCheckProject(QcCheckProject qcCheckProject); + + /** + * 修改检验项目维护 + * + * @param qcCheckProject 检验项目维护 + * @return 结果 + */ + public int updateQcCheckProject(QcCheckProject qcCheckProject); + + /** + * 批量删除检验项目维护 + * + * @param ids 需要删除的检验项目维护主键集合 + * @return 结果 + */ + public int deleteQcCheckProjectByIds(String[] ids); + + /** + * 删除检验项目维护信息 + * + * @param id 检验项目维护主键 + * @return 结果 + */ + public int deleteQcCheckProjectById(String id); +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckTypeProjectService.java b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckTypeProjectService.java new file mode 100644 index 00000000..bef13f3b --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckTypeProjectService.java @@ -0,0 +1,60 @@ +package com.op.quality.service; + +import java.util.List; +import com.op.quality.domain.QcCheckTypeProject; + +/** + * 物料检验项目维护Service接口 + * + * @author Open Platform + * @date 2023-10-17 + */ +public interface IQcCheckTypeProjectService { + /** + * 查询物料检验项目维护 + * + * @param id 物料检验项目维护主键 + * @return 物料检验项目维护 + */ + public QcCheckTypeProject selectQcCheckTypeProjectById(String id); + + /** + * 查询物料检验项目维护列表 + * + * @param qcCheckTypeProject 物料检验项目维护 + * @return 物料检验项目维护集合 + */ + public List selectQcCheckTypeProjectList(QcCheckTypeProject qcCheckTypeProject); + + /** + * 新增物料检验项目维护 + * + * @param qcCheckTypeProject 物料检验项目维护 + * @return 结果 + */ + public int insertQcCheckTypeProject(QcCheckTypeProject qcCheckTypeProject); + + /** + * 修改物料检验项目维护 + * + * @param qcCheckTypeProject 物料检验项目维护 + * @return 结果 + */ + public int updateQcCheckTypeProject(QcCheckTypeProject qcCheckTypeProject); + + /** + * 批量删除物料检验项目维护 + * + * @param ids 需要删除的物料检验项目维护主键集合 + * @return 结果 + */ + public int deleteQcCheckTypeProjectByIds(String[] ids); + + /** + * 删除物料检验项目维护信息 + * + * @param id 物料检验项目维护主键 + * @return 结果 + */ + public int deleteQcCheckTypeProjectById(String id); +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcMaterialGroupDetailService.java b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcMaterialGroupDetailService.java new file mode 100644 index 00000000..86583899 --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcMaterialGroupDetailService.java @@ -0,0 +1,60 @@ +package com.op.quality.service; + +import java.util.List; +import com.op.quality.domain.QcMaterialGroupDetail; + +/** + * 物料组成员Service接口 + * + * @author Open Platform + * @date 2023-10-18 + */ +public interface IQcMaterialGroupDetailService { + /** + * 查询物料组成员 + * + * @param id 物料组成员主键 + * @return 物料组成员 + */ + public QcMaterialGroupDetail selectQcMaterialGroupDetailById(String id); + + /** + * 查询物料组成员列表 + * + * @param qcMaterialGroupDetail 物料组成员 + * @return 物料组成员集合 + */ + public List selectQcMaterialGroupDetailList(QcMaterialGroupDetail qcMaterialGroupDetail); + + /** + * 新增物料组成员 + * + * @param qcMaterialGroupDetail 物料组成员 + * @return 结果 + */ + public int insertQcMaterialGroupDetail(QcMaterialGroupDetail qcMaterialGroupDetail); + + /** + * 修改物料组成员 + * + * @param qcMaterialGroupDetail 物料组成员 + * @return 结果 + */ + public int updateQcMaterialGroupDetail(QcMaterialGroupDetail qcMaterialGroupDetail); + + /** + * 批量删除物料组成员 + * + * @param ids 需要删除的物料组成员主键集合 + * @return 结果 + */ + public int deleteQcMaterialGroupDetailByIds(String[] ids); + + /** + * 删除物料组成员信息 + * + * @param id 物料组成员主键 + * @return 结果 + */ + public int deleteQcMaterialGroupDetailById(String id); +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcMaterialGroupService.java b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcMaterialGroupService.java new file mode 100644 index 00000000..e3dd2ffb --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcMaterialGroupService.java @@ -0,0 +1,70 @@ +package com.op.quality.service; + +import java.util.List; +import com.op.quality.domain.QcMaterialGroup; +import com.op.quality.domain.vo.TreeSelect; +import com.op.system.api.domain.SysDept; + +/** + * 物料组Service接口 + * + * @author materialGroup + * @date 2023-10-16 + */ +public interface IQcMaterialGroupService { + /** + * 查询物料组 + * + * @param id 物料组主键 + * @return 物料组 + */ + public QcMaterialGroup selectQcMaterialGroupById(String id); + + /** + * 查询物料组列表 + * + * @param qcMaterialGroup 物料组 + * @return 物料组集合 + */ + public List selectQcMaterialGroupList(QcMaterialGroup qcMaterialGroup); + + public List selectQcMaterialTreeList(QcMaterialGroup qcMaterialGroup); + + public List buildMaterialTreeSelect(List groups); + + public List buildMaterialTree(List groups); + + public List getMaterialChildrenList(QcMaterialGroup group); + + /** + * 新增物料组 + * + * @param qcMaterialGroup 物料组 + * @return 结果 + */ + public int insertQcMaterialGroup(QcMaterialGroup qcMaterialGroup); + + /** + * 修改物料组 + * + * @param qcMaterialGroup 物料组 + * @return 结果 + */ + public int updateQcMaterialGroup(QcMaterialGroup qcMaterialGroup); + + /** + * 批量删除物料组 + * + * @param ids 需要删除的物料组主键集合 + * @return 结果 + */ + public int deleteQcMaterialGroupByIds(String[] ids); + + /** + * 删除物料组信息 + * + * @param id 物料组主键 + * @return 结果 + */ + public int deleteQcMaterialGroupById(String id); +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckProjectServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckProjectServiceImpl.java new file mode 100644 index 00000000..f949c67d --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckProjectServiceImpl.java @@ -0,0 +1,114 @@ +package com.op.quality.service.serviceImpl; + +import java.util.List; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.op.common.core.utils.DateUtils; +import com.op.common.core.utils.StringUtils; +import com.op.common.core.utils.uuid.IdUtils; +import com.op.common.security.utils.SecurityUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.op.quality.mapper.QcCheckProjectMapper; +import com.op.quality.domain.QcCheckProject; +import com.op.quality.service.IQcCheckProjectService; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; + +/** + * 检验项目维护Service业务层处理 + * + * @author Open Platform + * @date 2023-10-13 + */ +@Service +public class QcCheckProjectServiceImpl implements IQcCheckProjectService { + @Autowired + private QcCheckProjectMapper qcCheckProjectMapper; + + /** + * 查询检验项目维护 + * + * @param id 检验项目维护主键 + * @return 检验项目维护 + */ + @Override + @DS("#header.poolName") + public QcCheckProject selectQcCheckProjectById(String id) { + return qcCheckProjectMapper.selectQcCheckProjectById(id); + } + + /** + * 查询检验项目维护列表 + * + * @param qcCheckProject 检验项目维护 + * @return 检验项目维护 + */ + @Override + @DS("#header.poolName") + public List selectQcCheckProjectList(QcCheckProject qcCheckProject) { + return qcCheckProjectMapper.selectQcCheckProjectList(qcCheckProject); + } + + /** + * 新增检验项目维护 + * + * @param qcCheckProject 检验项目维护 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int insertQcCheckProject(QcCheckProject qcCheckProject) { + if (StringUtils.isNotBlank(qcCheckProject.getRuleName())){ + qcCheckProject.setId(IdUtils.fastSimpleUUID()); + qcCheckProject.setCreateBy(SecurityUtils.getUsername()); + qcCheckProject.setCreateTime(DateUtils.getNowDate()); + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + String key = "#header.poolName"; + qcCheckProject.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_","")); + return qcCheckProjectMapper.insertQcCheckProject(qcCheckProject); + }else { + return 0; + } + } + + /** + * 修改检验项目维护 + * + * @param qcCheckProject 检验项目维护 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int updateQcCheckProject(QcCheckProject qcCheckProject) { + qcCheckProject.setUpdateTime(DateUtils.getNowDate()); + qcCheckProject.setUpdateBy(SecurityUtils.getUsername()); + return qcCheckProjectMapper.updateQcCheckProject(qcCheckProject); + } + + /** + * 批量删除检验项目维护 + * + * @param ids 需要删除的检验项目维护主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteQcCheckProjectByIds(String[] ids) { + return qcCheckProjectMapper.deleteQcCheckProjectByIds(ids); + } + + /** + * 删除检验项目维护信息 + * + * @param id 检验项目维护主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteQcCheckProjectById(String id) { + return qcCheckProjectMapper.deleteQcCheckProjectById(id); + } +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckTypeProjectServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckTypeProjectServiceImpl.java new file mode 100644 index 00000000..fe9c2c5d --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckTypeProjectServiceImpl.java @@ -0,0 +1,97 @@ +package com.op.quality.service.serviceImpl; + +import java.util.List; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.op.common.core.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.op.quality.mapper.QcCheckTypeProjectMapper; +import com.op.quality.domain.QcCheckTypeProject; +import com.op.quality.service.IQcCheckTypeProjectService; + +/** + * 物料检验项目维护Service业务层处理 + * + * @author Open Platform + * @date 2023-10-17 + */ +@Service +public class QcCheckTypeProjectServiceImpl implements IQcCheckTypeProjectService { + @Autowired + private QcCheckTypeProjectMapper qcCheckTypeProjectMapper; + + /** + * 查询物料检验项目维护 + * + * @param id 物料检验项目维护主键 + * @return 物料检验项目维护 + */ + @Override + @DS("#header.poolName") + public QcCheckTypeProject selectQcCheckTypeProjectById(String id) { + return qcCheckTypeProjectMapper.selectQcCheckTypeProjectById(id); + } + + /** + * 查询物料检验项目维护列表 + * + * @param qcCheckTypeProject 物料检验项目维护 + * @return 物料检验项目维护 + */ + @Override + @DS("#header.poolName") + public List selectQcCheckTypeProjectList(QcCheckTypeProject qcCheckTypeProject) { + return qcCheckTypeProjectMapper.selectQcCheckTypeProjectList(qcCheckTypeProject); + } + + /** + * 新增物料检验项目维护 + * + * @param qcCheckTypeProject 物料检验项目维护 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int insertQcCheckTypeProject(QcCheckTypeProject qcCheckTypeProject) { + qcCheckTypeProject.setCreateTime(DateUtils.getNowDate()); + return qcCheckTypeProjectMapper.insertQcCheckTypeProject(qcCheckTypeProject); + } + + /** + * 修改物料检验项目维护 + * + * @param qcCheckTypeProject 物料检验项目维护 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int updateQcCheckTypeProject(QcCheckTypeProject qcCheckTypeProject) { + qcCheckTypeProject.setUpdateTime(DateUtils.getNowDate()); + return qcCheckTypeProjectMapper.updateQcCheckTypeProject(qcCheckTypeProject); + } + + /** + * 批量删除物料检验项目维护 + * + * @param ids 需要删除的物料检验项目维护主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteQcCheckTypeProjectByIds(String[] ids) { + return qcCheckTypeProjectMapper.deleteQcCheckTypeProjectByIds(ids); + } + + /** + * 删除物料检验项目维护信息 + * + * @param id 物料检验项目维护主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteQcCheckTypeProjectById(String id) { + return qcCheckTypeProjectMapper.deleteQcCheckTypeProjectById(id); + } +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckTypeServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckTypeServiceImpl.java index 5ff9545d..0d023254 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckTypeServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckTypeServiceImpl.java @@ -68,9 +68,11 @@ public class QcCheckTypeServiceImpl implements IQcCheckTypeService { HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); String key = "#header.poolName"; qcCheckType.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_","")); + return qcCheckTypeMapper.insertQcCheckType(qcCheckType); + }else { + return 0; } - return qcCheckTypeMapper.insertQcCheckType(qcCheckType); } /** diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcMaterialGroupDetailServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcMaterialGroupDetailServiceImpl.java new file mode 100644 index 00000000..20b87a2e --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcMaterialGroupDetailServiceImpl.java @@ -0,0 +1,89 @@ +package com.op.quality.service.serviceImpl; + +import java.util.List; +import com.op.common.core.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.op.quality.mapper.QcMaterialGroupDetailMapper; +import com.op.quality.domain.QcMaterialGroupDetail; +import com.op.quality.service.IQcMaterialGroupDetailService; + +/** + * 物料组成员Service业务层处理 + * + * @author Open Platform + * @date 2023-10-18 + */ +@Service +public class QcMaterialGroupDetailServiceImpl implements IQcMaterialGroupDetailService { + @Autowired + private QcMaterialGroupDetailMapper qcMaterialGroupDetailMapper; + + /** + * 查询物料组成员 + * + * @param id 物料组成员主键 + * @return 物料组成员 + */ + @Override + public QcMaterialGroupDetail selectQcMaterialGroupDetailById(String id) { + return qcMaterialGroupDetailMapper.selectQcMaterialGroupDetailById(id); + } + + /** + * 查询物料组成员列表 + * + * @param qcMaterialGroupDetail 物料组成员 + * @return 物料组成员 + */ + @Override + public List selectQcMaterialGroupDetailList(QcMaterialGroupDetail qcMaterialGroupDetail) { + return qcMaterialGroupDetailMapper.selectQcMaterialGroupDetailList(qcMaterialGroupDetail); + } + + /** + * 新增物料组成员 + * + * @param qcMaterialGroupDetail 物料组成员 + * @return 结果 + */ + @Override + public int insertQcMaterialGroupDetail(QcMaterialGroupDetail qcMaterialGroupDetail) { + qcMaterialGroupDetail.setCreateTime(DateUtils.getNowDate()); + return qcMaterialGroupDetailMapper.insertQcMaterialGroupDetail(qcMaterialGroupDetail); + } + + /** + * 修改物料组成员 + * + * @param qcMaterialGroupDetail 物料组成员 + * @return 结果 + */ + @Override + public int updateQcMaterialGroupDetail(QcMaterialGroupDetail qcMaterialGroupDetail) { + qcMaterialGroupDetail.setUpdateTime(DateUtils.getNowDate()); + return qcMaterialGroupDetailMapper.updateQcMaterialGroupDetail(qcMaterialGroupDetail); + } + + /** + * 批量删除物料组成员 + * + * @param ids 需要删除的物料组成员主键 + * @return 结果 + */ + @Override + public int deleteQcMaterialGroupDetailByIds(String[] ids) { + return qcMaterialGroupDetailMapper.deleteQcMaterialGroupDetailByIds(ids); + } + + /** + * 删除物料组成员信息 + * + * @param id 物料组成员主键 + * @return 结果 + */ + @Override + public int deleteQcMaterialGroupDetailById(String id) { + return qcMaterialGroupDetailMapper.deleteQcMaterialGroupDetailById(id); + } +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcMaterialGroupServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcMaterialGroupServiceImpl.java new file mode 100644 index 00000000..27e50cce --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcMaterialGroupServiceImpl.java @@ -0,0 +1,161 @@ +package com.op.quality.service.serviceImpl; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.op.common.core.utils.DateUtils; +import com.op.common.core.utils.SpringUtils; +import com.op.common.core.utils.StringUtils; +import com.op.common.datascope.annotation.DataScope; +import com.op.quality.domain.vo.TreeSelect; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.op.quality.mapper.QcMaterialGroupMapper; +import com.op.quality.domain.QcMaterialGroup; +import com.op.quality.service.IQcMaterialGroupService; + +/** + * 物料组Service业务层处理 + * + * @author materialGroup + * @date 2023-10-16 + */ +@Service +public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService { + @Autowired + private QcMaterialGroupMapper qcMaterialGroupMapper; + + /** + * 查询物料组 + * + * @param id 物料组主键 + * @return 物料组 + */ + @Override + public QcMaterialGroup selectQcMaterialGroupById(String id) { + return qcMaterialGroupMapper.selectQcMaterialGroupById(id); + } + @Override + @DataScope(deptAlias = "d") + @DS("#header.poolName") + public List selectQcMaterialGroupList(QcMaterialGroup qcMaterialGroup) { + return qcMaterialGroupMapper.selectQcMaterialGroupList(qcMaterialGroup); + } + + /** + * 查询物料树列表 + * + * @param qcMaterialGroup 物料组 + * @return 物料组 + */ + @Override + public List selectQcMaterialTreeList(QcMaterialGroup qcMaterialGroup) { + List groups = SpringUtils.getAopProxy(this).selectQcMaterialGroupList(qcMaterialGroup); + return buildMaterialTreeSelect(groups); + } + + @Override + public List buildMaterialTreeSelect(List groups) { + List groupTrees = buildMaterialTree(groups); + return groupTrees.stream().map(TreeSelect::new).collect(Collectors.toList()); + } + + @Override + public List buildMaterialTree(List groups) { + List resultList = new ArrayList<>(); + //获取所有的子数据 + List childList = SpringUtils.getAopProxy(this).getMaterialChildrenList(new QcMaterialGroup()); + //根据父Id对子数据进行分组 + Map> listMap = childList.stream().collect(Collectors.groupingBy(QcMaterialGroup::getParentId)); + for (QcMaterialGroup material : groups) { + //根据根节点Id进行赋值 + material.setChildren(listMap.get(material.getId())); + resultList.add(material); + + } + if (resultList.isEmpty()) { + resultList = groups; + } + return resultList; + } + + /** + * 获取子节点 + * @param qcMaterialGroup + * @return + */ + @Override + @DS("#header.poolName") + public List getMaterialChildrenList(QcMaterialGroup qcMaterialGroup) { + return qcMaterialGroupMapper.getMaterialChildrenList(qcMaterialGroup); + } + /** + * 得到子节点列表 + */ + private List getChildList(List list, QcMaterialGroup t) { + List tlist = new ArrayList(); + Iterator it = list.iterator(); + while (it.hasNext()) { + QcMaterialGroup n = (QcMaterialGroup) it.next(); + if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().equals(t.getId()) ) { + tlist.add(n); + } + } + return tlist; + } + + + /** + * 新增物料组 + * + * @param qcMaterialGroup 物料组 + * @return 结果 + */ + @Override + public int insertQcMaterialGroup(QcMaterialGroup qcMaterialGroup) { + qcMaterialGroup.setCreateTime(DateUtils.getNowDate()); + return qcMaterialGroupMapper.insertQcMaterialGroup(qcMaterialGroup); + } + + /** + * 修改物料组 + * + * @param qcMaterialGroup 物料组 + * @return 结果 + */ + @Override + public int updateQcMaterialGroup(QcMaterialGroup qcMaterialGroup) { + qcMaterialGroup.setUpdateTime(DateUtils.getNowDate()); + return qcMaterialGroupMapper.updateQcMaterialGroup(qcMaterialGroup); + } + + /** + * 批量删除物料组 + * + * @param ids 需要删除的物料组主键 + * @return 结果 + */ + @Override + public int deleteQcMaterialGroupByIds(String[] ids) { + return qcMaterialGroupMapper.deleteQcMaterialGroupByIds(ids); + } + + /** + * 删除物料组信息 + * + * @param id 物料组主键 + * @return 结果 + */ + @Override + public int deleteQcMaterialGroupById(String id) { + return qcMaterialGroupMapper.deleteQcMaterialGroupById(id); + } + + private boolean hasChild(List list, QcMaterialGroup t) { + return getChildList(list, t).size() > 0 ? true : false; + } +} diff --git a/op-modules/op-quality/src/main/resources/mapper/QcCheckProjectMapper.xml b/op-modules/op-quality/src/main/resources/mapper/QcCheckProjectMapper.xml new file mode 100644 index 00000000..3ec1b2ae --- /dev/null +++ b/op-modules/op-quality/src/main/resources/mapper/QcCheckProjectMapper.xml @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + select id, order_num, rule_name, property_code, check_mode, check_tool, unit_code, check_standard, attr1, create_by, create_time, update_by, update_time, factory_code, del_flag from qc_check_project + + + + + + + + insert into qc_check_project + + id, + order_num, + rule_name, + property_code, + check_mode, + check_tool, + unit_code, + check_standard, + attr1, + create_by, + create_time, + update_by, + update_time, + factory_code, + del_flag, + + + #{id}, + #{orderNum}, + #{ruleName}, + #{propertyCode}, + #{checkMode}, + #{checkTool}, + #{unitCode}, + #{checkStandard}, + #{attr1}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{factoryCode}, + #{delFlag}, + + + + + update qc_check_project + + order_num = #{orderNum}, + rule_name = #{ruleName}, + property_code = #{propertyCode}, + check_mode = #{checkMode}, + check_tool = #{checkTool}, + unit_code = #{unitCode}, + check_standard = #{checkStandard}, + attr1 = #{attr1}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + factory_code = #{factoryCode}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from qc_check_project where id = #{id} + + + + delete from qc_check_project where id in + + #{id} + + + \ No newline at end of file diff --git a/op-modules/op-quality/src/main/resources/mapper/QcCheckTypeProjectMapper.xml b/op-modules/op-quality/src/main/resources/mapper/QcCheckTypeProjectMapper.xml new file mode 100644 index 00000000..069ceb36 --- /dev/null +++ b/op-modules/op-quality/src/main/resources/mapper/QcCheckTypeProjectMapper.xml @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + select id, project_id, type_id, standard_value, upper_diff, down_diff, sample, status, attr1, create_by, create_time, update_by, update_time, factory_code, del_flag, group_id, material_code from qc_check_type_project + + + + + + + + insert into qc_check_type_project + + id, + project_id, + type_id, + standard_value, + upper_diff, + down_diff, + sample, + status, + attr1, + create_by, + create_time, + update_by, + update_time, + factory_code, + del_flag, + group_id, + material_code, + + + #{id}, + #{projectId}, + #{typeId}, + #{standardValue}, + #{upperDiff}, + #{downDiff}, + #{sample}, + #{status}, + #{attr1}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{factoryCode}, + #{delFlag}, + #{groupId}, + #{materialCode}, + + + + + update qc_check_type_project + + project_id = #{projectId}, + type_id = #{typeId}, + standard_value = #{standardValue}, + upper_diff = #{upperDiff}, + down_diff = #{downDiff}, + sample = #{sample}, + status = #{status}, + attr1 = #{attr1}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + factory_code = #{factoryCode}, + del_flag = #{delFlag}, + group_id = #{groupId}, + material_code = #{materialCode}, + + where id = #{id} + + + + delete from qc_check_type_project where id = #{id} + + + + delete from qc_check_type_project where id in + + #{id} + + + \ No newline at end of file diff --git a/op-modules/op-quality/src/main/resources/mapper/QcMaterialGroupDetailMapper.xml b/op-modules/op-quality/src/main/resources/mapper/QcMaterialGroupDetailMapper.xml new file mode 100644 index 00000000..07e6bf7a --- /dev/null +++ b/op-modules/op-quality/src/main/resources/mapper/QcMaterialGroupDetailMapper.xml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + select id, group_id, material_code, material_name, attr1, create_by, create_time, update_by, update_time, factory_code, del_flag from qc_material_group_detail + + + + + + + + insert into qc_material_group_detail + + id, + group_id, + material_code, + material_name, + attr1, + create_by, + create_time, + update_by, + update_time, + factory_code, + del_flag, + + + #{id}, + #{groupId}, + #{materialCode}, + #{materialName}, + #{attr1}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{factoryCode}, + #{delFlag}, + + + + + update qc_material_group_detail + + group_id = #{groupId}, + material_code = #{materialCode}, + material_name = #{materialName}, + attr1 = #{attr1}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + factory_code = #{factoryCode}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from qc_material_group_detail where id = #{id} + + + + delete from qc_material_group_detail where id in + + #{id} + + + \ No newline at end of file diff --git a/op-modules/op-quality/src/main/resources/mapper/QcMaterialGroupMapper.xml b/op-modules/op-quality/src/main/resources/mapper/QcMaterialGroupMapper.xml new file mode 100644 index 00000000..84871491 --- /dev/null +++ b/op-modules/op-quality/src/main/resources/mapper/QcMaterialGroupMapper.xml @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + select id, group_name, attr1, create_by, create_time, update_by, update_time, factory_code, del_flag from qc_material_group + + + + + + + + + + + insert into qc_material_group + + id, + group_name, + attr1, + create_by, + create_time, + update_by, + update_time, + factory_code, + del_flag, + + + #{id}, + #{groupName}, + #{attr1}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{factoryCode}, + #{delFlag}, + + + + + update qc_material_group + + group_name = #{groupName}, + attr1 = #{attr1}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + factory_code = #{factoryCode}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from qc_material_group where id = #{id} + + + + delete from qc_material_group where id in + + #{id} + + + \ No newline at end of file