物料检验项目维护

highway
shaoyong 1 year ago
parent cd3d3bd928
commit 579a482c85

@ -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<QcCheckProject> 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<QcCheckProject> list = qcCheckProjectService.selectQcCheckProjectList(qcCheckProject);
ExcelUtil<QcCheckProject> util = new ExcelUtil<QcCheckProject>(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));
}
}

@ -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<QcCheckTypeProject> 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<QcCheckTypeProject> list = qcCheckTypeProjectService.selectQcCheckTypeProjectList(qcCheckTypeProject);
ExcelUtil<QcCheckTypeProject> util = new ExcelUtil<QcCheckTypeProject>(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));
}
}

@ -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<QcMaterialGroup> 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<QcMaterialGroup> list = qcMaterialGroupService.selectQcMaterialGroupList(qcMaterialGroup);
ExcelUtil<QcMaterialGroup> util = new ExcelUtil<QcMaterialGroup>(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));
}
}

@ -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<QcMaterialGroupDetail> 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<QcMaterialGroupDetail> list = qcMaterialGroupDetailService.selectQcMaterialGroupDetailList(qcMaterialGroupDetail);
ExcelUtil<QcMaterialGroupDetail> util = new ExcelUtil<QcMaterialGroupDetail>(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));
}
}

@ -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();
}
}

@ -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();
}
}

@ -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<QcMaterialGroup> children = new ArrayList<QcMaterialGroup>();
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<QcMaterialGroup> getChildren() {
return children;
}
public void setChildren(List<QcMaterialGroup> 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();
}
}

@ -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();
}
}

@ -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<TreeSelect> 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<TreeSelect> getChildren() {
return children;
}
public void setChildren(List<TreeSelect> children) {
this.children = children;
}
}

@ -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<QcCheckProject> 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);
}

@ -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<QcCheckTypeProject> 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);
}

@ -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<QcMaterialGroupDetail> 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);
}

@ -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<QcMaterialGroup> 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<QcMaterialGroup> getMaterialChildrenList(QcMaterialGroup qcMaterialGroup);
}

@ -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<QcCheckProject> 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);
}

@ -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<QcCheckTypeProject> 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);
}

@ -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<QcMaterialGroupDetail> 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);
}

@ -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<QcMaterialGroup> selectQcMaterialGroupList(QcMaterialGroup qcMaterialGroup);
public List<TreeSelect> selectQcMaterialTreeList(QcMaterialGroup qcMaterialGroup);
public List<TreeSelect> buildMaterialTreeSelect(List<QcMaterialGroup> groups);
public List<QcMaterialGroup> buildMaterialTree(List<QcMaterialGroup> groups);
public List<QcMaterialGroup> 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);
}

@ -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<QcCheckProject> 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);
}
}

@ -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<QcCheckTypeProject> 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);
}
}

@ -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);
}
/**

@ -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<QcMaterialGroupDetail> 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);
}
}

@ -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<QcMaterialGroup> selectQcMaterialGroupList(QcMaterialGroup qcMaterialGroup) {
return qcMaterialGroupMapper.selectQcMaterialGroupList(qcMaterialGroup);
}
/**
*
*
* @param qcMaterialGroup
* @return
*/
@Override
public List<TreeSelect> selectQcMaterialTreeList(QcMaterialGroup qcMaterialGroup) {
List<QcMaterialGroup> groups = SpringUtils.getAopProxy(this).selectQcMaterialGroupList(qcMaterialGroup);
return buildMaterialTreeSelect(groups);
}
@Override
public List<TreeSelect> buildMaterialTreeSelect(List<QcMaterialGroup> groups) {
List<QcMaterialGroup> groupTrees = buildMaterialTree(groups);
return groupTrees.stream().map(TreeSelect::new).collect(Collectors.toList());
}
@Override
public List<QcMaterialGroup> buildMaterialTree(List<QcMaterialGroup> groups) {
List<QcMaterialGroup> resultList = new ArrayList<>();
//获取所有的子数据
List<QcMaterialGroup> childList = SpringUtils.getAopProxy(this).getMaterialChildrenList(new QcMaterialGroup());
//根据父Id对子数据进行分组
Map<String,List<QcMaterialGroup>> 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<QcMaterialGroup> getMaterialChildrenList(QcMaterialGroup qcMaterialGroup) {
return qcMaterialGroupMapper.getMaterialChildrenList(qcMaterialGroup);
}
/**
*
*/
private List<QcMaterialGroup> getChildList(List<QcMaterialGroup> list, QcMaterialGroup t) {
List<QcMaterialGroup> tlist = new ArrayList<QcMaterialGroup>();
Iterator<QcMaterialGroup> 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<QcMaterialGroup> list, QcMaterialGroup t) {
return getChildList(list, t).size() > 0 ? true : false;
}
}

@ -0,0 +1,119 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.quality.mapper.QcCheckProjectMapper">
<resultMap type="QcCheckProject" id="QcCheckProjectResult">
<result property="id" column="id" />
<result property="orderNum" column="order_num" />
<result property="ruleName" column="rule_name" />
<result property="propertyCode" column="property_code" />
<result property="checkMode" column="check_mode" />
<result property="checkTool" column="check_tool" />
<result property="unitCode" column="unit_code" />
<result property="checkStandard" column="check_standard" />
<result property="attr1" column="attr1" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="factoryCode" column="factory_code" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="selectQcCheckProjectVo">
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
</sql>
<select id="selectQcCheckProjectList" parameterType="QcCheckProject" resultMap="QcCheckProjectResult">
<include refid="selectQcCheckProjectVo"/>
<where>
<if test="orderNum != null and orderNum != ''"> and order_num = #{orderNum}</if>
<if test="ruleName != null and ruleName != ''"> and rule_name like concat('%', #{ruleName}, '%')</if>
<if test="propertyCode != null and propertyCode != ''"> and property_code = #{propertyCode}</if>
<if test="checkMode != null and checkMode != ''"> and check_mode = #{checkMode}</if>
<if test="checkTool != null and checkTool != ''"> and check_tool = #{checkTool}</if>
<if test="unitCode != null and unitCode != ''"> and unit_code = #{unitCode}</if>
<if test="checkStandard != null and checkStandard != ''"> and check_standard = #{checkStandard}</if>
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
</where>
order by create_time
</select>
<select id="selectQcCheckProjectById" parameterType="String" resultMap="QcCheckProjectResult">
<include refid="selectQcCheckProjectVo"/>
where id = #{id}
</select>
<insert id="insertQcCheckProject" parameterType="QcCheckProject">
insert into qc_check_project
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="orderNum != null">order_num,</if>
<if test="ruleName != null">rule_name,</if>
<if test="propertyCode != null">property_code,</if>
<if test="checkMode != null">check_mode,</if>
<if test="checkTool != null">check_tool,</if>
<if test="unitCode != null">unit_code,</if>
<if test="checkStandard != null">check_standard,</if>
<if test="attr1 != null">attr1,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="factoryCode != null and factoryCode != ''">factory_code,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="orderNum != null">#{orderNum},</if>
<if test="ruleName != null">#{ruleName},</if>
<if test="propertyCode != null">#{propertyCode},</if>
<if test="checkMode != null">#{checkMode},</if>
<if test="checkTool != null">#{checkTool},</if>
<if test="unitCode != null">#{unitCode},</if>
<if test="checkStandard != null">#{checkStandard},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="factoryCode != null and factoryCode != ''">#{factoryCode},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updateQcCheckProject" parameterType="QcCheckProject">
update qc_check_project
<trim prefix="SET" suffixOverrides=",">
<if test="orderNum != null">order_num = #{orderNum},</if>
<if test="ruleName != null">rule_name = #{ruleName},</if>
<if test="propertyCode != null">property_code = #{propertyCode},</if>
<if test="checkMode != null">check_mode = #{checkMode},</if>
<if test="checkTool != null">check_tool = #{checkTool},</if>
<if test="unitCode != null">unit_code = #{unitCode},</if>
<if test="checkStandard != null">check_standard = #{checkStandard},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="factoryCode != null and factoryCode != ''">factory_code = #{factoryCode},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteQcCheckProjectById" parameterType="String">
delete from qc_check_project where id = #{id}
</delete>
<delete id="deleteQcCheckProjectByIds" parameterType="String">
delete from qc_check_project where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -0,0 +1,128 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.quality.mapper.QcCheckTypeProjectMapper">
<resultMap type="QcCheckTypeProject" id="QcCheckTypeProjectResult">
<result property="id" column="id" />
<result property="projectId" column="project_id" />
<result property="typeId" column="type_id" />
<result property="standardValue" column="standard_value" />
<result property="upperDiff" column="upper_diff" />
<result property="downDiff" column="down_diff" />
<result property="sample" column="sample" />
<result property="status" column="status" />
<result property="attr1" column="attr1" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="factoryCode" column="factory_code" />
<result property="delFlag" column="del_flag" />
<result property="groupId" column="group_id" />
<result property="materialCode" column="material_code" />
</resultMap>
<sql id="selectQcCheckTypeProjectVo">
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
</sql>
<select id="selectQcCheckTypeProjectList" parameterType="QcCheckTypeProject" resultMap="QcCheckTypeProjectResult">
<include refid="selectQcCheckTypeProjectVo"/>
<where>
<if test="projectId != null and projectId != ''"> and project_id = #{projectId}</if>
<if test="typeId != null and typeId != ''"> and type_id = #{typeId}</if>
<if test="standardValue != null "> and standard_value = #{standardValue}</if>
<if test="upperDiff != null "> and upper_diff = #{upperDiff}</if>
<if test="downDiff != null "> and down_diff = #{downDiff}</if>
<if test="sample != null "> and sample = #{sample}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="groupId != null and groupId != ''"> and group_id = #{groupId}</if>
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
</where>
</select>
<select id="selectQcCheckTypeProjectById" parameterType="String" resultMap="QcCheckTypeProjectResult">
<include refid="selectQcCheckTypeProjectVo"/>
where id = #{id}
</select>
<insert id="insertQcCheckTypeProject" parameterType="QcCheckTypeProject">
insert into qc_check_type_project
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="projectId != null and projectId != ''">project_id,</if>
<if test="typeId != null">type_id,</if>
<if test="standardValue != null">standard_value,</if>
<if test="upperDiff != null">upper_diff,</if>
<if test="downDiff != null">down_diff,</if>
<if test="sample != null">sample,</if>
<if test="status != null">status,</if>
<if test="attr1 != null">attr1,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="factoryCode != null and factoryCode != ''">factory_code,</if>
<if test="delFlag != null">del_flag,</if>
<if test="groupId != null">group_id,</if>
<if test="materialCode != null">material_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="projectId != null and projectId != ''">#{projectId},</if>
<if test="typeId != null">#{typeId},</if>
<if test="standardValue != null">#{standardValue},</if>
<if test="upperDiff != null">#{upperDiff},</if>
<if test="downDiff != null">#{downDiff},</if>
<if test="sample != null">#{sample},</if>
<if test="status != null">#{status},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="factoryCode != null and factoryCode != ''">#{factoryCode},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="groupId != null">#{groupId},</if>
<if test="materialCode != null">#{materialCode},</if>
</trim>
</insert>
<update id="updateQcCheckTypeProject" parameterType="QcCheckTypeProject">
update qc_check_type_project
<trim prefix="SET" suffixOverrides=",">
<if test="projectId != null and projectId != ''">project_id = #{projectId},</if>
<if test="typeId != null">type_id = #{typeId},</if>
<if test="standardValue != null">standard_value = #{standardValue},</if>
<if test="upperDiff != null">upper_diff = #{upperDiff},</if>
<if test="downDiff != null">down_diff = #{downDiff},</if>
<if test="sample != null">sample = #{sample},</if>
<if test="status != null">status = #{status},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="factoryCode != null and factoryCode != ''">factory_code = #{factoryCode},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="groupId != null">group_id = #{groupId},</if>
<if test="materialCode != null">material_code = #{materialCode},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteQcCheckTypeProjectById" parameterType="String">
delete from qc_check_type_project where id = #{id}
</delete>
<delete id="deleteQcCheckTypeProjectByIds" parameterType="String">
delete from qc_check_type_project where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -0,0 +1,98 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.quality.mapper.QcMaterialGroupDetailMapper">
<resultMap type="QcMaterialGroupDetail" id="QcMaterialGroupDetailResult">
<result property="id" column="id" />
<result property="groupId" column="group_id" />
<result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" />
<result property="attr1" column="attr1" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="factoryCode" column="factory_code" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="selectQcMaterialGroupDetailVo">
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
</sql>
<select id="selectQcMaterialGroupDetailList" parameterType="QcMaterialGroupDetail" resultMap="QcMaterialGroupDetailResult">
<include refid="selectQcMaterialGroupDetailVo"/>
<where>
<if test="groupId != null and groupId != ''"> and group_id = #{groupId}</if>
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
</where>
</select>
<select id="selectQcMaterialGroupDetailById" parameterType="String" resultMap="QcMaterialGroupDetailResult">
<include refid="selectQcMaterialGroupDetailVo"/>
where id = #{id}
</select>
<insert id="insertQcMaterialGroupDetail" parameterType="QcMaterialGroupDetail">
insert into qc_material_group_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="groupId != null and groupId != ''">group_id,</if>
<if test="materialCode != null">material_code,</if>
<if test="materialName != null">material_name,</if>
<if test="attr1 != null">attr1,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="factoryCode != null and factoryCode != ''">factory_code,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="groupId != null and groupId != ''">#{groupId},</if>
<if test="materialCode != null">#{materialCode},</if>
<if test="materialName != null">#{materialName},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="factoryCode != null and factoryCode != ''">#{factoryCode},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updateQcMaterialGroupDetail" parameterType="QcMaterialGroupDetail">
update qc_material_group_detail
<trim prefix="SET" suffixOverrides=",">
<if test="groupId != null and groupId != ''">group_id = #{groupId},</if>
<if test="materialCode != null">material_code = #{materialCode},</if>
<if test="materialName != null">material_name = #{materialName},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="factoryCode != null and factoryCode != ''">factory_code = #{factoryCode},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteQcMaterialGroupDetailById" parameterType="String">
delete from qc_material_group_detail where id = #{id}
</delete>
<delete id="deleteQcMaterialGroupDetailByIds" parameterType="String">
delete from qc_material_group_detail where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -0,0 +1,110 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.quality.mapper.QcMaterialGroupMapper">
<resultMap type="QcMaterialGroup" id="QcMaterialGroupResult">
<result property="id" column="id" />
<result property="groupName" column="group_name" />
<result property="attr1" column="attr1" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="factoryCode" column="factory_code" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="selectQcMaterialGroupVo">
select id, group_name, attr1, create_by, create_time, update_by, update_time, factory_code, del_flag from qc_material_group
</sql>
<select id="selectQcMaterialGroupList" parameterType="QcMaterialGroup" resultMap="QcMaterialGroupResult">
<include refid="selectQcMaterialGroupVo"/>
<where>
<if test="groupName != null and groupName != ''"> and group_name like concat('%', #{groupName}, '%')</if>
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
</where>
/*select
mg.id,
mg.group_name,
mgd.group_id AS parentId,
mgd.member_name AS memberName
from qc_material_group AS mg
LEFT JOIN qc_material_group_detail AS mgd ON mg.id = mgd.group_id AND mgd.del_flag = '0'
WHERE mg.del_flag = '0'*/
</select>
<select id="getMaterialChildrenList" parameterType="QcMaterialGroup" resultMap="QcMaterialGroupResult">
select
id,
group_id AS parentId,
material_name AS group_name
from qc_material_group_detail
where del_flag = '0'
<if test="id != null and id != ''" >
AND group_id = #{id}
</if>
</select>
<select id="selectQcMaterialGroupById" parameterType="String" resultMap="QcMaterialGroupResult">
<include refid="selectQcMaterialGroupVo"/>
where id = #{id}
</select>
<insert id="insertQcMaterialGroup" parameterType="QcMaterialGroup">
insert into qc_material_group
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="groupName != null">group_name,</if>
<if test="attr1 != null">attr1,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="factoryCode != null and factoryCode != ''">factory_code,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="groupName != null">#{groupName},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="factoryCode != null and factoryCode != ''">#{factoryCode},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updateQcMaterialGroup" parameterType="QcMaterialGroup">
update qc_material_group
<trim prefix="SET" suffixOverrides=",">
<if test="groupName != null">group_name = #{groupName},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="factoryCode != null and factoryCode != ''">factory_code = #{factoryCode},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteQcMaterialGroupById" parameterType="String">
delete from qc_material_group where id = #{id}
</delete>
<delete id="deleteQcMaterialGroupByIds" parameterType="String">
delete from qc_material_group where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save