diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTypeController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTypeController.java new file mode 100644 index 000000000..bb84c5faa --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTypeController.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.QcCheckType; +import com.op.quality.service.IQcCheckTypeService; +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-12 + */ +@RestController +@RequestMapping("/checkType") +public class QcCheckTypeController extends BaseController { + @Autowired + private IQcCheckTypeService qcCheckTypeService; + + /** + * 查询检验节点维护列表 + */ + @RequiresPermissions("quality:checkType:list") + @GetMapping("/list") + public TableDataInfo list(QcCheckType qcCheckType) { + startPage(); + List list = qcCheckTypeService.selectQcCheckTypeList(qcCheckType); + return getDataTable(list); + } + + /** + * 导出检验节点维护列表 + */ + @RequiresPermissions("quality:checkType:export") + @Log(title = "检验节点维护", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, QcCheckType qcCheckType) { + List list = qcCheckTypeService.selectQcCheckTypeList(qcCheckType); + ExcelUtil util = new ExcelUtil(QcCheckType.class); + util.exportExcel(response, list, "检验节点维护数据"); + } + + /** + * 获取检验节点维护详细信息 + */ + @RequiresPermissions("quality:checkType:query") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") String id) { + return success(qcCheckTypeService.selectQcCheckTypeById(id)); + } + + /** + * 新增检验节点维护 + */ + @RequiresPermissions("quality:checkType:add") + @Log(title = "检验节点维护", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody QcCheckType qcCheckType) { + return toAjax(qcCheckTypeService.insertQcCheckType(qcCheckType)); + } + + /** + * 修改检验节点维护 + */ + @RequiresPermissions("quality:checkType:edit") + @Log(title = "检验节点维护", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody QcCheckType qcCheckType) { + return toAjax(qcCheckTypeService.updateQcCheckType(qcCheckType)); + } + + /** + * 删除检验节点维护 + */ + @RequiresPermissions("quality:checkType:remove") + @Log(title = "检验节点维护", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable String[] ids) { + return toAjax(qcCheckTypeService.deleteQcCheckTypeByIds(ids)); + } +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcUserMaterialController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcUserMaterialController.java new file mode 100644 index 000000000..1da543e7e --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcUserMaterialController.java @@ -0,0 +1,126 @@ +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.QcUserMaterial; +import com.op.quality.service.IQcUserMaterialService; +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-09 + */ +@RestController +@RequestMapping("/material") +public class QcUserMaterialController extends BaseController { + @Autowired + private IQcUserMaterialService qcUserMaterialService; + + /** + * 查询人员列表 + */ + @RequiresPermissions("quality:material:list") + @GetMapping("/userList") + public TableDataInfo userList(QcUserMaterial qcUserMaterial) { + startPage(); + List list = qcUserMaterialService.selectUserList(qcUserMaterial); + return getDataTable(list); + } + + /** + * 查询人员物料绑定列表 + */ + @GetMapping("/list") + public TableDataInfo list(QcUserMaterial qcUserMaterial) { + startPage(); + List list = qcUserMaterialService.selectQcUserMaterialList(qcUserMaterial); + return getDataTable(list); + } + + /** + * 导出人员物料绑定列表 + */ + @RequiresPermissions("quality:material:export") + @Log(title = "人员物料绑定", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, QcUserMaterial qcUserMaterial) { + List list = qcUserMaterialService.selectQcUserMaterialList(qcUserMaterial); + ExcelUtil util = new ExcelUtil(QcUserMaterial.class); + util.exportExcel(response, list, "人员物料绑定数据"); + } + + /** + * 获取人员物料绑定详细信息 + */ + @RequiresPermissions("quality:material:query") + @GetMapping(value = "/{userCode}") + public AjaxResult getInfo(@PathVariable("userCode") String userCode) { + return success(qcUserMaterialService.selectUserByUserCode(userCode)); + } + + /** + * 新增人员物料绑定 + */ + @RequiresPermissions("quality:material:add") + @Log(title = "人员物料绑定", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody QcUserMaterial qcUserMaterial) { + return toAjax(qcUserMaterialService.insertQcUserMaterial(qcUserMaterial)); + } + + /** + * 修改人员物料绑定 + */ + @RequiresPermissions("quality:material:edit") + @Log(title = "人员物料绑定", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody QcUserMaterial qcUserMaterial) { + return toAjax(qcUserMaterialService.updateQcUserMaterial(qcUserMaterial)); + } + + /** + * 删除人员物料绑定 + */ + @RequiresPermissions("quality:material:remove") + @Log(title = "人员物料绑定", businessType = BusinessType.DELETE) + @DeleteMapping("/{userCodes}") + public AjaxResult remove(@PathVariable String[] userCodes) { + return toAjax(qcUserMaterialService.deleteQcUserMaterialByUserCodes(userCodes)); + } + /** + * 穿梭框左侧 + */ + @GetMapping(value = "/getList") + public TableDataInfo getList(QcUserMaterial qcUserMaterial) { + startPage(); + List list = qcUserMaterialService.getList(qcUserMaterial); + return getDataTable(list); + } + + /** + * 穿梭框右侧 + */ + @GetMapping(value = "/getRightList") + public TableDataInfo getRightList(QcUserMaterial qcUserMaterial) { + startPage(); + List list = qcUserMaterialService.getRightList(qcUserMaterial); + return getDataTable(list); + } +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckType.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckType.java new file mode 100644 index 000000000..e6f76a14f --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckType.java @@ -0,0 +1,121 @@ +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_type + * + * @author Open Platform + * @date 2023-10-12 + */ +public class QcCheckType extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** id */ + private String id; + + /** 流程编号 */ + @Excel(name = "流程编号") + private String orderCode; + + /** 名称 */ + @Excel(name = "名称") + private String checkName; + + /** 类型编码 */ + @Excel(name = "类型编码") + private String typeCode; + + /** 类型名称 */ + @Excel(name = "类型名称") + private String typeName; + + /** 预留字段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 setOrderCode(String orderCode) { + this.orderCode = orderCode; + } + + public String getOrderCode() { + return orderCode; + } + public void setCheckName(String checkName) { + this.checkName = checkName; + } + + public String getCheckName() { + return checkName; + } + public void setTypeCode(String typeCode) { + this.typeCode = typeCode; + } + + public String getTypeCode() { + return typeCode; + } + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public String getTypeName() { + return typeName; + } + 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("order", getOrderCode()) + .append("checkName", getCheckName()) + .append("typeCode", getTypeCode()) + .append("typeName", getTypeName()) + .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/QcUserMaterial.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcUserMaterial.java new file mode 100644 index 000000000..f7e172c13 --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcUserMaterial.java @@ -0,0 +1,258 @@ +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; + +import java.util.List; + +/** + * 人员物料绑定对象 qc_user_material + * + * @author Open Platform + * @date 2023-10-09 + */ +public class QcUserMaterial extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** id */ + private String id; + + /** 员工编码 */ + @Excel(name = "员工编码") + private String userCode; + + /** 员工名称 */ + @Excel(name = "员工名称") + private String userName; + + /** 物料编码 */ + @Excel(name = "物料编码") + private String materialCode; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String materialName; + + /** 预留字段1 */ + @Excel(name = "预留字段1") + private String attr1; + + /** 预留字段2 */ + @Excel(name = "预留字段2") + private String attr2; + + /** 预留字段3 */ + @Excel(name = "预留字段3") + private String attr3; + + /** 预留字段4 */ + @Excel(name = "预留字段4") + private String attr4; + + /** 工厂编码 */ + @Excel(name = "工厂编码") + private String factoryCode; + + /** 删除标识1删除0正常 */ + private String delFlag; + + /** 编号 */ + private String userId; + /** 手机号 */ + private String phonenumber; + private String email; + private String materialNames; + /** 状态 */ + private String status; + + private String materialId; + + private String[] userCodes; + private String label; + private String key; + + private List selectedValues; + + public void setId(String id) { + this.id = id; + } + + public String getId() { + return id; + } + public void setUserCode(String userCode) { + this.userCode = userCode; + } + + public String getUserCode() { + return userCode; + } + public void setUserName(String userName) { + this.userName = userName; + } + + public String getUserName() { + return userName; + } + 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 setAttr2(String attr2) { + this.attr2 = attr2; + } + + public String getAttr2() { + return attr2; + } + public void setAttr3(String attr3) { + this.attr3 = attr3; + } + + public String getAttr3() { + return attr3; + } + public void setAttr4(String attr4) { + this.attr4 = attr4; + } + + public String getAttr4() { + return attr4; + } + 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 getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getPhonenumber() { + return phonenumber; + } + + public void setPhonenumber(String phonenumber) { + this.phonenumber = phonenumber; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getMaterialNames() { + return materialNames; + } + + public void setMaterialNames(String materialNames) { + this.materialNames = materialNames; + } + + public String getMaterialId() { + return materialId; + } + + public void setMaterialId(String materialId) { + this.materialId = materialId; + } + public String[] getUserCodes() { + return userCodes; + } + + public void setUserCodes(String[] userCodes) { + this.userCodes = userCodes; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public List getSelectedValues() { + return selectedValues; + } + + public void setSelectedValues(List selectedValues) { + this.selectedValues = selectedValues; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("userCode", getUserCode()) + .append("userName", getUserName()) + .append("materialCode", getMaterialCode()) + .append("materialName", getMaterialName()) + .append("attr1", getAttr1()) + .append("attr2", getAttr2()) + .append("attr3", getAttr3()) + .append("attr4", getAttr4()) + .append("userId", getUserId()) + .append("phonenumber", getPhonenumber()) + .append("status", getStatus()) + .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/mapper/QcCheckTypeMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTypeMapper.java new file mode 100644 index 000000000..a5a45573b --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTypeMapper.java @@ -0,0 +1,63 @@ +package com.op.quality.mapper; + +import java.util.List; + +import com.op.quality.domain.QcCheckType; +import org.apache.ibatis.annotations.Mapper; + +/** + * 检验节点维护Mapper接口 + * + * @author Open Platform + * @date 2023-10-12 + */ +@Mapper +public interface QcCheckTypeMapper { + /** + * 查询检验节点维护 + * + * @param id 检验节点维护主键 + * @return 检验节点维护 + */ + public QcCheckType selectQcCheckTypeById(String id); + + /** + * 查询检验节点维护列表 + * + * @param qcCheckType 检验节点维护 + * @return 检验节点维护集合 + */ + public List selectQcCheckTypeList(QcCheckType qcCheckType); + + /** + * 新增检验节点维护 + * + * @param qcCheckType 检验节点维护 + * @return 结果 + */ + public int insertQcCheckType(QcCheckType qcCheckType); + + /** + * 修改检验节点维护 + * + * @param qcCheckType 检验节点维护 + * @return 结果 + */ + public int updateQcCheckType(QcCheckType qcCheckType); + + /** + * 删除检验节点维护 + * + * @param id 检验节点维护主键 + * @return 结果 + */ + public int deleteQcCheckTypeById(String id); + + /** + * 批量删除检验节点维护 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteQcCheckTypeByIds(String[] ids); +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcUserMaterialMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcUserMaterialMapper.java new file mode 100644 index 000000000..bab9f45a7 --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcUserMaterialMapper.java @@ -0,0 +1,78 @@ +package com.op.quality.mapper; + +import java.util.List; + +import com.op.quality.domain.QcUserMaterial; +import org.apache.ibatis.annotations.Mapper; + +/** + * 人员物料绑定Mapper接口 + * + * @author Open Platform + * @date 2023-10-09 + */ +@Mapper +public interface QcUserMaterialMapper { + + /** + * 查询人员列表 + */ + public List selectUserList(QcUserMaterial qcUserMaterial); + /** + * 查询人员物料绑定 + * + * @param id 人员物料绑定主键 + * @return 人员物料绑定 + */ + public QcUserMaterial selectQcUserMaterialById(String id); + /** + * 查询人员物料绑定 + * + * @param userCode 人员编码 + * @return 人员物料绑定 + */ + public QcUserMaterial selectUserByUserCode(String userCode); + + /** + * 查询人员物料绑定列表 + * + * @param qcUserMaterial 人员物料绑定 + * @return 人员物料绑定集合 + */ + public List selectQcUserMaterialList(QcUserMaterial qcUserMaterial); + + /** + * 新增人员物料绑定 + * + * @param qcUserMaterial 人员物料绑定 + * @return 结果 + */ + public int insertQcUserMaterial(QcUserMaterial qcUserMaterial); + + /** + * 修改人员物料绑定 + * + * @param qcUserMaterial 人员物料绑定 + * @return 结果 + */ + public int updateQcUserMaterial(QcUserMaterial qcUserMaterial); + + /** + * 删除人员物料绑定 + * + * @param qcUserMaterial 人员物料绑定主键 + * @return 结果 + */ + public int deleteQcUserMaterialByUserCode(QcUserMaterial qcUserMaterial); + + /** + * 批量删除人员物料绑定 + * + * @param userCodes 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteQcUserMaterialByUserCodes(String[] userCodes); + + public List getUserMaterialListUndo(QcUserMaterial qcUserMaterial); + public List getUserMaterialListDo(QcUserMaterial qcUserMaterial); +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckTypeService.java b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckTypeService.java new file mode 100644 index 000000000..7067bb367 --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckTypeService.java @@ -0,0 +1,60 @@ +package com.op.quality.service; + +import java.util.List; +import com.op.quality.domain.QcCheckType; + +/** + * 检验节点维护Service接口 + * + * @author Open Platform + * @date 2023-10-12 + */ +public interface IQcCheckTypeService { + /** + * 查询检验节点维护 + * + * @param id 检验节点维护主键 + * @return 检验节点维护 + */ + public QcCheckType selectQcCheckTypeById(String id); + + /** + * 查询检验节点维护列表 + * + * @param qcCheckType 检验节点维护 + * @return 检验节点维护集合 + */ + public List selectQcCheckTypeList(QcCheckType qcCheckType); + + /** + * 新增检验节点维护 + * + * @param qcCheckType 检验节点维护 + * @return 结果 + */ + public int insertQcCheckType(QcCheckType qcCheckType); + + /** + * 修改检验节点维护 + * + * @param qcCheckType 检验节点维护 + * @return 结果 + */ + public int updateQcCheckType(QcCheckType qcCheckType); + + /** + * 批量删除检验节点维护 + * + * @param ids 需要删除的检验节点维护主键集合 + * @return 结果 + */ + public int deleteQcCheckTypeByIds(String[] ids); + + /** + * 删除检验节点维护信息 + * + * @param id 检验节点维护主键 + * @return 结果 + */ + public int deleteQcCheckTypeById(String id); +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcUserMaterialService.java b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcUserMaterialService.java new file mode 100644 index 000000000..04b41310a --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcUserMaterialService.java @@ -0,0 +1,78 @@ +package com.op.quality.service; + +import java.util.List; +import com.op.quality.domain.QcUserMaterial; + +/** + * 人员物料绑定Service接口 + * + * @author Open Platform + * @date 2023-10-09 + */ +public interface IQcUserMaterialService { + /** + * 查询人员列表 + * + * @param qcUserMaterial 人员物料绑定 + * @return 人员物料绑定集合 + */ + public List selectUserList(QcUserMaterial qcUserMaterial); + /** + * 查询人员物料绑定 + * + * @param userCode 人员物料绑定主键 + * @return 人员物料绑定 + */ + public QcUserMaterial selectQcUserMaterialById(String userCode); + /** + * 查询人员物料绑定 + * + * @param userCode 人员编码 + * @return 人员物料绑定 + */ + public QcUserMaterial selectUserByUserCode(String userCode); + + public List getList(QcUserMaterial qcUserMaterial); + + /** + * 查询人员物料绑定列表 + * + * @param qcUserMaterial 人员物料绑定 + * @return 人员物料绑定集合 + */ + public List selectQcUserMaterialList(QcUserMaterial qcUserMaterial); + + /** + * 新增人员物料绑定 + * + * @param qcUserMaterial 人员物料绑定 + * @return 结果 + */ + public int insertQcUserMaterial(QcUserMaterial qcUserMaterial); + + /** + * 修改人员物料绑定 + * + * @param qcUserMaterial 人员物料绑定 + * @return 结果 + */ + public int updateQcUserMaterial(QcUserMaterial qcUserMaterial); + + /** + * 批量删除人员物料绑定 + * + * @param userCodes 需要删除的人员物料绑定主键集合 + * @return 结果 + */ + public int deleteQcUserMaterialByUserCodes(String[] userCodes); + + /** + * 删除人员物料绑定信息 + * + * @param qcUserMaterial 人员物料绑定 + * @return 结果 + */ + public int deleteQcUserMaterialByUserCode(QcUserMaterial qcUserMaterial); + + public List getRightList(QcUserMaterial qcUserMaterial); +} 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 new file mode 100644 index 000000000..5ff9545d3 --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckTypeServiceImpl.java @@ -0,0 +1,113 @@ +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.QcCheckTypeMapper; +import com.op.quality.domain.QcCheckType; +import com.op.quality.service.IQcCheckTypeService; +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-12 + */ +@Service +public class QcCheckTypeServiceImpl implements IQcCheckTypeService { + @Autowired + private QcCheckTypeMapper qcCheckTypeMapper; + + /** + * 查询检验节点维护 + * + * @param id 检验节点维护主键 + * @return 检验节点维护 + */ + @Override + @DS("#header.poolName") + public QcCheckType selectQcCheckTypeById(String id) { + return qcCheckTypeMapper.selectQcCheckTypeById(id); + } + + /** + * 查询检验节点维护列表 + * + * @param qcCheckType 检验节点维护 + * @return 检验节点维护 + */ + @Override + @DS("#header.poolName") + public List selectQcCheckTypeList(QcCheckType qcCheckType) { + return qcCheckTypeMapper.selectQcCheckTypeList(qcCheckType); + } + + /** + * 新增检验节点维护 + * + * @param qcCheckType 检验节点维护 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int insertQcCheckType(QcCheckType qcCheckType) { + if (StringUtils.isNotBlank(qcCheckType.getCheckName())){ + qcCheckType.setId(IdUtils.fastSimpleUUID()); + qcCheckType.setCreateBy(SecurityUtils.getUsername()); + qcCheckType.setCreateTime(DateUtils.getNowDate()); + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + String key = "#header.poolName"; + qcCheckType.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_","")); + } + + return qcCheckTypeMapper.insertQcCheckType(qcCheckType); + } + + /** + * 修改检验节点维护 + * + * @param qcCheckType 检验节点维护 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int updateQcCheckType(QcCheckType qcCheckType) { + qcCheckType.setUpdateTime(DateUtils.getNowDate()); + qcCheckType.setUpdateBy(SecurityUtils.getUsername()); + return qcCheckTypeMapper.updateQcCheckType(qcCheckType); + } + + /** + * 批量删除检验节点维护 + * + * @param ids 需要删除的检验节点维护主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteQcCheckTypeByIds(String[] ids) { + return qcCheckTypeMapper.deleteQcCheckTypeByIds(ids); + } + + /** + * 删除检验节点维护信息 + * + * @param id 检验节点维护主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteQcCheckTypeById(String id) { + return qcCheckTypeMapper.deleteQcCheckTypeById(id); + } +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcUserMaterialServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcUserMaterialServiceImpl.java new file mode 100644 index 000000000..e369e4d71 --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcUserMaterialServiceImpl.java @@ -0,0 +1,167 @@ +package com.op.quality.service.serviceImpl; + +import java.util.Date; +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.QcUserMaterialMapper; +import com.op.quality.domain.QcUserMaterial; +import com.op.quality.service.IQcUserMaterialService; +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-09 + */ +@Service +public class QcUserMaterialServiceImpl implements IQcUserMaterialService { + @Autowired + private QcUserMaterialMapper qcUserMaterialMapper; + + @Override + public List selectUserList(QcUserMaterial qcUserMaterial) { + return qcUserMaterialMapper.selectUserList( qcUserMaterial); + } + + /** + * 查询人员物料绑定 + * + * @param userCode 人员物料绑定主键 + * @return 人员物料绑定 + */ + @Override + @DS("#header.poolName") + public QcUserMaterial selectQcUserMaterialById(String userCode) { + return qcUserMaterialMapper.selectQcUserMaterialById(userCode); + } + + @Override + public QcUserMaterial selectUserByUserCode(String userCode) { + return qcUserMaterialMapper.selectUserByUserCode(userCode); + } + + + /** + * 查询人员物料绑定列表 + * + * @param qcUserMaterial 人员物料绑定 + * @return 人员物料绑定 + */ + @Override + @DS("#header.poolName") + public List selectQcUserMaterialList(QcUserMaterial qcUserMaterial) { + return qcUserMaterialMapper.selectQcUserMaterialList(qcUserMaterial); + } + + /** + * 新增人员物料绑定 + * + * @param qcUserMaterial 人员物料绑定 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int insertQcUserMaterial(QcUserMaterial qcUserMaterial) { + Date now = DateUtils.getNowDate(); + if (StringUtils.isNotEmpty(qcUserMaterial.getUserCodes())) { + //删除之前的关联关系 + qcUserMaterialMapper.deleteQcUserMaterialByUserCodes(qcUserMaterial.getUserCodes()); + } + if (qcUserMaterial.getSelectedValues()!=null) { + QcUserMaterial qcUserMaterialDto = null; + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + String key = "#header.poolName"; + for (String userCode : qcUserMaterial.getUserCodes()) { + for (String materialCode : qcUserMaterial.getSelectedValues()) { + //查询物料编码对应的各种信息 + qcUserMaterialDto = new QcUserMaterial(); + qcUserMaterialDto.setId(IdUtils.fastSimpleUUID()); + qcUserMaterialDto.setCreateTime(now); + qcUserMaterialDto.setCreateBy(SecurityUtils.getUsername()); + qcUserMaterialDto.setUserCode(userCode); + qcUserMaterialDto.setUserName(qcUserMaterial.getUserName()); + qcUserMaterialDto.setMaterialCode(materialCode); + qcUserMaterialDto.setMaterialName(qcUserMaterial.getMaterialName()); + qcUserMaterialDto.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_","")); + qcUserMaterialMapper.insertQcUserMaterial(qcUserMaterialDto); + + } + } + + } + + return 1; + } + + /** + * 修改人员物料绑定 + * + * @param qcUserMaterial 人员物料绑定 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int updateQcUserMaterial(QcUserMaterial qcUserMaterial) { + qcUserMaterial.setUpdateTime(DateUtils.getNowDate()); + return qcUserMaterialMapper.updateQcUserMaterial(qcUserMaterial); + } + + /** + * 批量删除人员物料绑定 + * + * @param userCodes 需要删除的人员物料绑定主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteQcUserMaterialByUserCodes(String[] userCodes) { + return qcUserMaterialMapper.deleteQcUserMaterialByUserCodes(userCodes); + } + + /** + * 删除人员物料绑定信息 + * + * @param qcUserMaterial 人员物料绑定 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteQcUserMaterialByUserCode(QcUserMaterial qcUserMaterial) { + return qcUserMaterialMapper.deleteQcUserMaterialByUserCode(qcUserMaterial); + } + + @Override + @DS("#header.poolName") + public List getList(QcUserMaterial qcUserMaterial) { + + List dto = qcUserMaterialMapper.getUserMaterialListUndo(qcUserMaterial); + List selected = qcUserMaterialMapper.getUserMaterialListDo(qcUserMaterial); + dto.addAll(selected); + + dto.forEach(item -> { + item.setKey(item.getMaterialCode()); + }); + + return dto; + } + @Override + @DS("#header.poolName") + public List getRightList(QcUserMaterial qcUserMaterial) { + List selected = qcUserMaterialMapper.getUserMaterialListDo(qcUserMaterial); + selected.forEach(item -> { + item.setKey(item.getMaterialCode()); + }); + return selected; + } +} diff --git a/op-modules/op-quality/src/main/resources/mapper/QcCheckTypeMapper.xml b/op-modules/op-quality/src/main/resources/mapper/QcCheckTypeMapper.xml new file mode 100644 index 000000000..fd1a4aa94 --- /dev/null +++ b/op-modules/op-quality/src/main/resources/mapper/QcCheckTypeMapper.xml @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + select id, order_code, check_name, type_code, type_name, attr1, create_by, create_time, update_by, update_time, factory_code, del_flag from qc_check_type + + + + + + + + insert into qc_check_type + + id, + order_code, + check_name, + type_code, + type_name, + attr1, + create_by, + create_time, + update_by, + update_time, + factory_code, + del_flag, + + + #{id}, + #{orderCode}, + #{checkName}, + #{typeCode}, + #{typeName}, + #{attr1}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{factoryCode}, + #{delFlag}, + + + + + update qc_check_type + + order_code = #{orderCode}, + check_name = #{checkName}, + type_code = #{typeCode}, + type_name = #{typeName}, + 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_type where id = #{id} + + + + delete from qc_check_type where id in + + #{id} + + + \ No newline at end of file diff --git a/op-modules/op-quality/src/main/resources/mapper/QcUserMaterialMapper.xml b/op-modules/op-quality/src/main/resources/mapper/QcUserMaterialMapper.xml new file mode 100644 index 000000000..1fe10d2fb --- /dev/null +++ b/op-modules/op-quality/src/main/resources/mapper/QcUserMaterialMapper.xml @@ -0,0 +1,181 @@ + + + + + + + + + + + + + + + + + + + + + + + + + select id, user_code, user_name, material_code, material_name, attr1, attr2, attr3, attr4, + create_by, create_time, update_by, update_time, factory_code, del_flag from qc_user_material + + + + + + + + + + + + + + + + insert into qc_user_material + + id, + user_code, + user_name, + material_code, + material_name, + attr1, + attr2, + attr3, + attr4, + create_by, + create_time, + update_by, + update_time, + factory_code, + del_flag, + + + #{id}, + #{userCode}, + #{userName}, + #{materialCode}, + #{materialName}, + #{attr1}, + #{attr2}, + #{attr3}, + #{attr4}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{factoryCode}, + #{delFlag}, + + + + + update qc_user_material + + user_code = #{userCode}, + user_name = #{userName}, + material_code = #{materialCode}, + material_name = #{materialName}, + attr1 = #{attr1}, + attr2 = #{attr2}, + attr3 = #{attr3}, + attr4 = #{attr4}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + factory_code = #{factoryCode}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from qc_user_material where user_code = #{userCode} + + + + delete from qc_user_material where user_code in + + #{userCode} + + + \ No newline at end of file