diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckUnqualifiedController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckUnqualifiedController.java new file mode 100644 index 00000000..1c65f21f --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckUnqualifiedController.java @@ -0,0 +1,123 @@ +package com.op.quality.controller; + +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.op.common.core.utils.DateUtils; +import org.apache.commons.lang.StringUtils; +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.QcCheckUnqualified; +import com.op.quality.service.IQcCheckUnqualifiedService; +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-31 + */ +@RestController +@RequestMapping("/unqualified") +public class QcCheckUnqualifiedController extends BaseController { + @Autowired + private IQcCheckUnqualifiedService qcCheckUnqualifiedService; + + /** + * 查询不合格处理列表 + */ + @RequiresPermissions("quality:unqualified:list") + @GetMapping("/list") + public TableDataInfo list(QcCheckUnqualified qcCheckUnqualified) { + startPage(); + + //默认时间范围T 00:00:00~T+1 00:00:00 + if(StringUtils.isEmpty(qcCheckUnqualified.getCheckTimeStart())){ + qcCheckUnqualified.setCheckTimeStart(DateUtils.getDate()+" 00:00:00");//start + LocalDate date = LocalDate.now(); + LocalDate dateEnd = date.plusDays(1); + DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + String dateEndStr = dtf.format(dateEnd)+" 00:00:00"; + qcCheckUnqualified.setCheckTimeEnd(dateEndStr);//end + } + qcCheckUnqualified.setDelFlag("0"); + List list = qcCheckUnqualifiedService.selectQcCheckUnqualifiedList(qcCheckUnqualified); + return getDataTable(list); + } + + /** + * 导出不合格处理列表 + */ + @RequiresPermissions("quality:unqualified:export") + @Log(title = "不合格处理", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, QcCheckUnqualified qcCheckUnqualified) { + //默认时间范围T 00:00:00~T+1 00:00:00 + if(StringUtils.isEmpty(qcCheckUnqualified.getCheckTimeStart())){ + qcCheckUnqualified.setCheckTimeStart(DateUtils.getDate()+" 00:00:00");//start + LocalDate date = LocalDate.now(); + LocalDate dateEnd = date.plusDays(1); + DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + String dateEndStr = dtf.format(dateEnd)+" 00:00:00"; + qcCheckUnqualified.setCheckTimeEnd(dateEndStr);//end + } + qcCheckUnqualified.setDelFlag("0"); + List list = qcCheckUnqualifiedService.selectQcCheckUnqualifiedList(qcCheckUnqualified); + ExcelUtil util = new ExcelUtil(QcCheckUnqualified.class); + util.exportExcel(response, list, "不合格处理数据"); + } + + /** + * 获取不合格处理详细信息 + */ + @RequiresPermissions("quality:unqualified:query") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") String id) { + return success(qcCheckUnqualifiedService.selectQcCheckUnqualifiedById(id)); + } + + /** + * 新增不合格处理 + */ + @RequiresPermissions("quality:unqualified:add") + @Log(title = "不合格处理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody QcCheckUnqualified qcCheckUnqualified) { + return toAjax(qcCheckUnqualifiedService.insertQcCheckUnqualified(qcCheckUnqualified)); + } + + /** + * 修改不合格处理 + */ + @RequiresPermissions("quality:unqualified:edit") + @Log(title = "不合格处理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody QcCheckUnqualified qcCheckUnqualified) { + return toAjax(qcCheckUnqualifiedService.updateQcCheckUnqualified(qcCheckUnqualified)); + } + + /** + * 删除不合格处理 + */ + @RequiresPermissions("quality:unqualified:remove") + @Log(title = "不合格处理", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable String[] ids) { + return toAjax(qcCheckUnqualifiedService.deleteQcCheckUnqualifiedByIds(ids)); + } +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckUnqualifiedDetailController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckUnqualifiedDetailController.java new file mode 100644 index 00000000..7c47f959 --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckUnqualifiedDetailController.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.QcCheckUnqualifiedDetail; +import com.op.quality.service.IQcCheckUnqualifiedDetailService; +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-31 + */ +@RestController +@RequestMapping("/unqualityDetail") +public class QcCheckUnqualifiedDetailController extends BaseController { + @Autowired + private IQcCheckUnqualifiedDetailService qcCheckUnqualifiedDetailService; + + /** + * 查询不合格处理详情列表 + */ + //@RequiresPermissions("unqualityDetail:unqualityDetail:list") + @GetMapping("/list") + public TableDataInfo list(QcCheckUnqualifiedDetail qcCheckUnqualifiedDetail) { + startPage(); + List list = qcCheckUnqualifiedDetailService.selectQcCheckUnqualifiedDetailList(qcCheckUnqualifiedDetail); + return getDataTable(list); + } + + /** + * 导出不合格处理详情列表 + */ + //@RequiresPermissions("unqualityDetail:unqualityDetail:export") + @Log(title = "不合格处理详情", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, QcCheckUnqualifiedDetail qcCheckUnqualifiedDetail) { + List list = qcCheckUnqualifiedDetailService.selectQcCheckUnqualifiedDetailList(qcCheckUnqualifiedDetail); + ExcelUtil util = new ExcelUtil(QcCheckUnqualifiedDetail.class); + util.exportExcel(response, list, "不合格处理详情数据"); + } + + /** + * 获取不合格处理详情详细信息 + */ + //@RequiresPermissions("unqualityDetail:unqualityDetail:query") + @GetMapping(value = "/{recordId}") + public AjaxResult getInfo(@PathVariable("recordId") String recordId) { + return success(qcCheckUnqualifiedDetailService.selectQcCheckUnqualifiedDetailByRecordId(recordId)); + } + + /** + * 新增不合格处理详情 + */ + //@RequiresPermissions("unqualityDetail:unqualityDetail:add") + @Log(title = "不合格处理详情", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody QcCheckUnqualifiedDetail qcCheckUnqualifiedDetail) { + return toAjax(qcCheckUnqualifiedDetailService.insertQcCheckUnqualifiedDetail(qcCheckUnqualifiedDetail)); + } + + /** + * 修改不合格处理详情 + */ + //@RequiresPermissions("unqualityDetail:unqualityDetail:edit") + @Log(title = "不合格处理详情", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody QcCheckUnqualifiedDetail qcCheckUnqualifiedDetail) { + return toAjax(qcCheckUnqualifiedDetailService.updateQcCheckUnqualifiedDetail(qcCheckUnqualifiedDetail)); + } + + /** + * 删除不合格处理详情 + */ + //@RequiresPermissions("unqualityDetail:unqualityDetail:remove") + @Log(title = "不合格处理详情", businessType = BusinessType.DELETE) + @DeleteMapping("/{recordIds}") + public AjaxResult remove(@PathVariable String[] recordIds) { + return toAjax(qcCheckUnqualifiedDetailService.deleteQcCheckUnqualifiedDetailByRecordIds(recordIds)); + } +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckUnqualified.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckUnqualified.java new file mode 100644 index 00000000..efbd9d4a --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckUnqualified.java @@ -0,0 +1,187 @@ +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_unqualified + * + * @author Open Platform + * @date 2023-10-31 + */ +public class QcCheckUnqualified extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** id */ + private String id; + + /** 归属任务编码 */ + @Excel(name = "归属任务编码") + private String taskId; + + /** 0未处理 */ + @Excel(name = "0未处理") + private String status; + + /** 下一节点编码 */ + @Excel(name = "下一节点编码") + private String nextNodeCode; + + /** 下一节点名称 */ + @Excel(name = "下一节点名称") + private String nextNodeName; + + /** 预留字段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 checkTimeStart; + private String checkTimeEnd; + + private String type; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getCheckTimeStart() { + return checkTimeStart; + } + + public void setCheckTimeStart(String checkTimeStart) { + this.checkTimeStart = checkTimeStart; + } + + public String getCheckTimeEnd() { + return checkTimeEnd; + } + + public void setCheckTimeEnd(String checkTimeEnd) { + this.checkTimeEnd = checkTimeEnd; + } + + public void setId(String id) { + this.id = id; + } + + public String getId() { + return id; + } + public void setTaskId(String taskId) { + this.taskId = taskId; + } + + public String getTaskId() { + return taskId; + } + public void setStatus(String status) { + this.status = status; + } + + public String getStatus() { + return status; + } + public void setNextNodeCode(String nextNodeCode) { + this.nextNodeCode = nextNodeCode; + } + + public String getNextNodeCode() { + return nextNodeCode; + } + public void setNextNodeName(String nextNodeName) { + this.nextNodeName = nextNodeName; + } + + public String getNextNodeName() { + return nextNodeName; + } + 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; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("taskId", getTaskId()) + .append("status", getStatus()) + .append("nextNodeCode", getNextNodeCode()) + .append("nextNodeName", getNextNodeName()) + .append("remark", getRemark()) + .append("attr1", getAttr1()) + .append("attr2", getAttr2()) + .append("attr3", getAttr3()) + .append("attr4", getAttr4()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("factoryCode", getFactoryCode()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckUnqualifiedDetail.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckUnqualifiedDetail.java new file mode 100644 index 00000000..1a812431 --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckUnqualifiedDetail.java @@ -0,0 +1,182 @@ +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_unqualified_detail + * + * @author Open Platform + * @date 2023-10-31 + */ +public class QcCheckUnqualifiedDetail extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** id */ + private String recordId; + + /** 归属任务编码 */ + @Excel(name = "归属任务编码") + private String unqualifiedId; + + /** 顺序 */ + @Excel(name = "顺序") + private String sort; + + /** 处理人编码 */ + @Excel(name = "处理人编码") + private String dowithCode; + + /** 处理人名称 */ + @Excel(name = "处理人名称") + private String dowithName; + + /** 处理意见 */ + @Excel(name = "处理意见") + private String dowithRemark; + + /** Y合格N不合格 */ + @Excel(name = "Y合格N不合格") + private String status; + + /** 预留字段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; + + public void setRecordId(String recordId) { + this.recordId = recordId; + } + + public String getRecordId() { + return recordId; + } + public void setUnqualifiedId(String unqualifiedId) { + this.unqualifiedId = unqualifiedId; + } + + public String getUnqualifiedId() { + return unqualifiedId; + } + public void setSort(String sort) { + this.sort = sort; + } + + public String getSort() { + return sort; + } + public void setDowithCode(String dowithCode) { + this.dowithCode = dowithCode; + } + + public String getDowithCode() { + return dowithCode; + } + public void setDowithName(String dowithName) { + this.dowithName = dowithName; + } + + public String getDowithName() { + return dowithName; + } + public void setDowithRemark(String dowithRemark) { + this.dowithRemark = dowithRemark; + } + + public String getDowithRemark() { + return dowithRemark; + } + 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 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; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("recordId", getRecordId()) + .append("unqualifiedId", getUnqualifiedId()) + .append("sort", getSort()) + .append("dowithCode", getDowithCode()) + .append("dowithName", getDowithName()) + .append("dowithRemark", getDowithRemark()) + .append("status", getStatus()) + .append("remark", getRemark()) + .append("attr1", getAttr1()) + .append("attr2", getAttr2()) + .append("attr3", getAttr3()) + .append("attr4", getAttr4()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("factoryCode", getFactoryCode()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckUnqualifiedDetailMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckUnqualifiedDetailMapper.java new file mode 100644 index 00000000..bb710b2c --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckUnqualifiedDetailMapper.java @@ -0,0 +1,63 @@ +package com.op.quality.mapper; + +import java.util.List; + +import com.op.quality.domain.QcCheckUnqualifiedDetail; +import org.apache.ibatis.annotations.Mapper; + +/** + * 不合格处理详情Mapper接口 + * + * @author Open Platform + * @date 2023-10-31 + */ +@Mapper +public interface QcCheckUnqualifiedDetailMapper { + /** + * 查询不合格处理详情 + * + * @param recordId 不合格处理详情主键 + * @return 不合格处理详情 + */ + public QcCheckUnqualifiedDetail selectQcCheckUnqualifiedDetailByRecordId(String recordId); + + /** + * 查询不合格处理详情列表 + * + * @param qcCheckUnqualifiedDetail 不合格处理详情 + * @return 不合格处理详情集合 + */ + public List selectQcCheckUnqualifiedDetailList(QcCheckUnqualifiedDetail qcCheckUnqualifiedDetail); + + /** + * 新增不合格处理详情 + * + * @param qcCheckUnqualifiedDetail 不合格处理详情 + * @return 结果 + */ + public int insertQcCheckUnqualifiedDetail(QcCheckUnqualifiedDetail qcCheckUnqualifiedDetail); + + /** + * 修改不合格处理详情 + * + * @param qcCheckUnqualifiedDetail 不合格处理详情 + * @return 结果 + */ + public int updateQcCheckUnqualifiedDetail(QcCheckUnqualifiedDetail qcCheckUnqualifiedDetail); + + /** + * 删除不合格处理详情 + * + * @param recordId 不合格处理详情主键 + * @return 结果 + */ + public int deleteQcCheckUnqualifiedDetailByRecordId(String recordId); + + /** + * 批量删除不合格处理详情 + * + * @param recordIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteQcCheckUnqualifiedDetailByRecordIds(String[] recordIds); +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckUnqualifiedMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckUnqualifiedMapper.java new file mode 100644 index 00000000..21de6735 --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckUnqualifiedMapper.java @@ -0,0 +1,63 @@ +package com.op.quality.mapper; + +import java.util.List; + +import com.op.quality.domain.QcCheckUnqualified; +import org.apache.ibatis.annotations.Mapper; + +/** + * 不合格处理Mapper接口 + * + * @author Open Platform + * @date 2023-10-31 + */ +@Mapper +public interface QcCheckUnqualifiedMapper { + /** + * 查询不合格处理 + * + * @param id 不合格处理主键 + * @return 不合格处理 + */ + public QcCheckUnqualified selectQcCheckUnqualifiedById(String id); + + /** + * 查询不合格处理列表 + * + * @param qcCheckUnqualified 不合格处理 + * @return 不合格处理集合 + */ + public List selectQcCheckUnqualifiedList(QcCheckUnqualified qcCheckUnqualified); + + /** + * 新增不合格处理 + * + * @param qcCheckUnqualified 不合格处理 + * @return 结果 + */ + public int insertQcCheckUnqualified(QcCheckUnqualified qcCheckUnqualified); + + /** + * 修改不合格处理 + * + * @param qcCheckUnqualified 不合格处理 + * @return 结果 + */ + public int updateQcCheckUnqualified(QcCheckUnqualified qcCheckUnqualified); + + /** + * 删除不合格处理 + * + * @param id 不合格处理主键 + * @return 结果 + */ + public int deleteQcCheckUnqualifiedById(String id); + + /** + * 批量删除不合格处理 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteQcCheckUnqualifiedByIds(String[] ids); +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckUnqualifiedDetailService.java b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckUnqualifiedDetailService.java new file mode 100644 index 00000000..1e05d689 --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckUnqualifiedDetailService.java @@ -0,0 +1,60 @@ +package com.op.quality.service; + +import java.util.List; +import com.op.quality.domain.QcCheckUnqualifiedDetail; + +/** + * 不合格处理详情Service接口 + * + * @author Open Platform + * @date 2023-10-31 + */ +public interface IQcCheckUnqualifiedDetailService { + /** + * 查询不合格处理详情 + * + * @param recordId 不合格处理详情主键 + * @return 不合格处理详情 + */ + public QcCheckUnqualifiedDetail selectQcCheckUnqualifiedDetailByRecordId(String recordId); + + /** + * 查询不合格处理详情列表 + * + * @param qcCheckUnqualifiedDetail 不合格处理详情 + * @return 不合格处理详情集合 + */ + public List selectQcCheckUnqualifiedDetailList(QcCheckUnqualifiedDetail qcCheckUnqualifiedDetail); + + /** + * 新增不合格处理详情 + * + * @param qcCheckUnqualifiedDetail 不合格处理详情 + * @return 结果 + */ + public int insertQcCheckUnqualifiedDetail(QcCheckUnqualifiedDetail qcCheckUnqualifiedDetail); + + /** + * 修改不合格处理详情 + * + * @param qcCheckUnqualifiedDetail 不合格处理详情 + * @return 结果 + */ + public int updateQcCheckUnqualifiedDetail(QcCheckUnqualifiedDetail qcCheckUnqualifiedDetail); + + /** + * 批量删除不合格处理详情 + * + * @param recordIds 需要删除的不合格处理详情主键集合 + * @return 结果 + */ + public int deleteQcCheckUnqualifiedDetailByRecordIds(String[] recordIds); + + /** + * 删除不合格处理详情信息 + * + * @param recordId 不合格处理详情主键 + * @return 结果 + */ + public int deleteQcCheckUnqualifiedDetailByRecordId(String recordId); +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckUnqualifiedService.java b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckUnqualifiedService.java new file mode 100644 index 00000000..962b39e7 --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckUnqualifiedService.java @@ -0,0 +1,60 @@ +package com.op.quality.service; + +import java.util.List; +import com.op.quality.domain.QcCheckUnqualified; + +/** + * 不合格处理Service接口 + * + * @author Open Platform + * @date 2023-10-31 + */ +public interface IQcCheckUnqualifiedService { + /** + * 查询不合格处理 + * + * @param id 不合格处理主键 + * @return 不合格处理 + */ + public QcCheckUnqualified selectQcCheckUnqualifiedById(String id); + + /** + * 查询不合格处理列表 + * + * @param qcCheckUnqualified 不合格处理 + * @return 不合格处理集合 + */ + public List selectQcCheckUnqualifiedList(QcCheckUnqualified qcCheckUnqualified); + + /** + * 新增不合格处理 + * + * @param qcCheckUnqualified 不合格处理 + * @return 结果 + */ + public int insertQcCheckUnqualified(QcCheckUnqualified qcCheckUnqualified); + + /** + * 修改不合格处理 + * + * @param qcCheckUnqualified 不合格处理 + * @return 结果 + */ + public int updateQcCheckUnqualified(QcCheckUnqualified qcCheckUnqualified); + + /** + * 批量删除不合格处理 + * + * @param ids 需要删除的不合格处理主键集合 + * @return 结果 + */ + public int deleteQcCheckUnqualifiedByIds(String[] ids); + + /** + * 删除不合格处理信息 + * + * @param id 不合格处理主键 + * @return 结果 + */ + public int deleteQcCheckUnqualifiedById(String id); +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java index c3b3639d..ba238891 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java @@ -48,6 +48,9 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService { @Autowired private QcCheckTaskWarehousingMapper qcCheckTaskWarehousingMapper; + @Autowired + private QcCheckUnqualifiedMapper qcCheckUnqualifiedMapper; + /** * 查询来料检验 * @@ -225,16 +228,18 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService { if(CollectionUtils.isEmpty(projects)){ result = "Y";//合格 }else{ - result = "N";//合格 + result = "N";//不合格 } int n = 0; + String unQuaType = ""; String recordId = qcCheckTaskIncome.getRecordId(); if("material".equals(qcCheckTaskIncome.getTypeCode())){ qcCheckTaskIncome.setCheckStatus("2"); qcCheckTaskIncome.setCheckResult(result); qcCheckTaskIncome.setCheckTime(DateUtils.getNowDate()); n = qcCheckTaskIncomeMapper.updateQcCheckTaskIncome(qcCheckTaskIncome); + unQuaType = "material"; }else if("produce".equals(qcCheckTaskIncome.getTypeCode())){ QcCheckTaskProduce qcCheckTaskProduce = new QcCheckTaskProduce(); qcCheckTaskProduce.setCheckStatus("2"); @@ -242,6 +247,7 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService { qcCheckTaskProduce.setCheckResult(result); qcCheckTaskProduce.setCheckTime(DateUtils.getNowDate()); n = qcCheckTaskProduceMapper.updateQcCheckTaskProduce(qcCheckTaskProduce); + unQuaType = "produce"; }else if("product".equals(qcCheckTaskIncome.getTypeCode())){ QcCheckTaskWarehousing warehousing = new QcCheckTaskWarehousing(); warehousing.setCheckStatus("2"); @@ -249,8 +255,20 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService { warehousing.setCheckResult(result); warehousing.setCheckTime(DateUtils.getNowDate()); n = qcCheckTaskWarehousingMapper.updateQcCheckTaskWarehousing(warehousing); + unQuaType = "product"; } + //不合格处理 + if("N".equals(result)){ + QcCheckUnqualified unqualified = new QcCheckUnqualified(); + unqualified.setTaskId(qcCheckTaskIncome.getRecordId()); + unqualified.setCreateTime(DateUtils.getNowDate()); + unqualified.setCreateBy(qcCheckTaskIncome.getUpdateBy()); + unqualified.setType(unQuaType); + /**qc_check_unqualified**/ + qcCheckUnqualifiedMapper.insertQcCheckUnqualified(unqualified); + } + return n ; } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckUnqualifiedDetailServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckUnqualifiedDetailServiceImpl.java new file mode 100644 index 00000000..c1b1ae18 --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckUnqualifiedDetailServiceImpl.java @@ -0,0 +1,89 @@ +package com.op.quality.service.impl; + +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.QcCheckUnqualifiedDetailMapper; +import com.op.quality.domain.QcCheckUnqualifiedDetail; +import com.op.quality.service.IQcCheckUnqualifiedDetailService; + +/** + * 不合格处理详情Service业务层处理 + * + * @author Open Platform + * @date 2023-10-31 + */ +@Service +public class QcCheckUnqualifiedDetailServiceImpl implements IQcCheckUnqualifiedDetailService { + @Autowired + private QcCheckUnqualifiedDetailMapper qcCheckUnqualifiedDetailMapper; + + /** + * 查询不合格处理详情 + * + * @param recordId 不合格处理详情主键 + * @return 不合格处理详情 + */ + @Override + public QcCheckUnqualifiedDetail selectQcCheckUnqualifiedDetailByRecordId(String recordId) { + return qcCheckUnqualifiedDetailMapper.selectQcCheckUnqualifiedDetailByRecordId(recordId); + } + + /** + * 查询不合格处理详情列表 + * + * @param qcCheckUnqualifiedDetail 不合格处理详情 + * @return 不合格处理详情 + */ + @Override + public List selectQcCheckUnqualifiedDetailList(QcCheckUnqualifiedDetail qcCheckUnqualifiedDetail) { + return qcCheckUnqualifiedDetailMapper.selectQcCheckUnqualifiedDetailList(qcCheckUnqualifiedDetail); + } + + /** + * 新增不合格处理详情 + * + * @param qcCheckUnqualifiedDetail 不合格处理详情 + * @return 结果 + */ + @Override + public int insertQcCheckUnqualifiedDetail(QcCheckUnqualifiedDetail qcCheckUnqualifiedDetail) { + qcCheckUnqualifiedDetail.setCreateTime(DateUtils.getNowDate()); + return qcCheckUnqualifiedDetailMapper.insertQcCheckUnqualifiedDetail(qcCheckUnqualifiedDetail); + } + + /** + * 修改不合格处理详情 + * + * @param qcCheckUnqualifiedDetail 不合格处理详情 + * @return 结果 + */ + @Override + public int updateQcCheckUnqualifiedDetail(QcCheckUnqualifiedDetail qcCheckUnqualifiedDetail) { + qcCheckUnqualifiedDetail.setUpdateTime(DateUtils.getNowDate()); + return qcCheckUnqualifiedDetailMapper.updateQcCheckUnqualifiedDetail(qcCheckUnqualifiedDetail); + } + + /** + * 批量删除不合格处理详情 + * + * @param recordIds 需要删除的不合格处理详情主键 + * @return 结果 + */ + @Override + public int deleteQcCheckUnqualifiedDetailByRecordIds(String[] recordIds) { + return qcCheckUnqualifiedDetailMapper.deleteQcCheckUnqualifiedDetailByRecordIds(recordIds); + } + + /** + * 删除不合格处理详情信息 + * + * @param recordId 不合格处理详情主键 + * @return 结果 + */ + @Override + public int deleteQcCheckUnqualifiedDetailByRecordId(String recordId) { + return qcCheckUnqualifiedDetailMapper.deleteQcCheckUnqualifiedDetailByRecordId(recordId); + } +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckUnqualifiedServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckUnqualifiedServiceImpl.java new file mode 100644 index 00000000..adb2181b --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckUnqualifiedServiceImpl.java @@ -0,0 +1,97 @@ +package com.op.quality.service.impl; + +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.QcCheckUnqualifiedMapper; +import com.op.quality.domain.QcCheckUnqualified; +import com.op.quality.service.IQcCheckUnqualifiedService; + +/** + * 不合格处理Service业务层处理 + * + * @author Open Platform + * @date 2023-10-31 + */ +@Service +public class QcCheckUnqualifiedServiceImpl implements IQcCheckUnqualifiedService { + @Autowired + private QcCheckUnqualifiedMapper qcCheckUnqualifiedMapper; + + /** + * 查询不合格处理 + * + * @param id 不合格处理主键 + * @return 不合格处理 + */ + @Override + @DS("#header.poolName") + public QcCheckUnqualified selectQcCheckUnqualifiedById(String id) { + return qcCheckUnqualifiedMapper.selectQcCheckUnqualifiedById(id); + } + + /** + * 查询不合格处理列表 + * + * @param qcCheckUnqualified 不合格处理 + * @return 不合格处理 + */ + @Override + @DS("#header.poolName") + public List selectQcCheckUnqualifiedList(QcCheckUnqualified qcCheckUnqualified) { + return qcCheckUnqualifiedMapper.selectQcCheckUnqualifiedList(qcCheckUnqualified); + } + + /** + * 新增不合格处理 + * + * @param qcCheckUnqualified 不合格处理 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int insertQcCheckUnqualified(QcCheckUnqualified qcCheckUnqualified) { + qcCheckUnqualified.setCreateTime(DateUtils.getNowDate()); + return qcCheckUnqualifiedMapper.insertQcCheckUnqualified(qcCheckUnqualified); + } + + /** + * 修改不合格处理 + * + * @param qcCheckUnqualified 不合格处理 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int updateQcCheckUnqualified(QcCheckUnqualified qcCheckUnqualified) { + qcCheckUnqualified.setUpdateTime(DateUtils.getNowDate()); + return qcCheckUnqualifiedMapper.updateQcCheckUnqualified(qcCheckUnqualified); + } + + /** + * 批量删除不合格处理 + * + * @param ids 需要删除的不合格处理主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteQcCheckUnqualifiedByIds(String[] ids) { + return qcCheckUnqualifiedMapper.deleteQcCheckUnqualifiedByIds(ids); + } + + /** + * 删除不合格处理信息 + * + * @param id 不合格处理主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteQcCheckUnqualifiedById(String id) { + return qcCheckUnqualifiedMapper.deleteQcCheckUnqualifiedById(id); + } +} diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckUnqualifiedDetailMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckUnqualifiedDetailMapper.xml new file mode 100644 index 00000000..b820252c --- /dev/null +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckUnqualifiedDetailMapper.xml @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + select record_id, unqualified_id, sort, dowith_code, dowith_name, dowith_remark, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, factory_code, del_flag from qc_check_unqualified_detail + + + + + + + + insert into qc_check_unqualified_detail + + record_id, + unqualified_id, + sort, + dowith_code, + dowith_name, + dowith_remark, + status, + remark, + attr1, + attr2, + attr3, + attr4, + create_by, + create_time, + update_by, + update_time, + factory_code, + del_flag, + + + #{recordId}, + #{unqualifiedId}, + #{sort}, + #{dowithCode}, + #{dowithName}, + #{dowithRemark}, + #{status}, + #{remark}, + #{attr1}, + #{attr2}, + #{attr3}, + #{attr4}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{factoryCode}, + #{delFlag}, + + + + + update qc_check_unqualified_detail + + unqualified_id = #{unqualifiedId}, + sort = #{sort}, + dowith_code = #{dowithCode}, + dowith_name = #{dowithName}, + dowith_remark = #{dowithRemark}, + status = #{status}, + remark = #{remark}, + 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 record_id = #{recordId} + + + + delete from qc_check_unqualified_detail where record_id = #{recordId} + + + + delete from qc_check_unqualified_detail where record_id in + + #{recordId} + + + \ No newline at end of file diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckUnqualifiedMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckUnqualifiedMapper.xml new file mode 100644 index 00000000..763ace6a --- /dev/null +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckUnqualifiedMapper.xml @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + select id, task_id, status, next_node_code, next_node_name, remark, + attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, factory_code, del_flag + from qc_check_unqualified + + + + + + + + insert into qc_check_unqualified + + id, + task_id, + status, + type, + next_node_code, + next_node_name, + remark, + attr1, + attr2, + attr3, + attr4, + create_by, + create_time, + update_by, + update_time, + factory_code, + del_flag, + + + #{id}, + #{taskId}, + #{status}, + #{type}, + #{nextNodeCode}, + #{nextNodeName}, + #{remark}, + #{attr1}, + #{attr2}, + #{attr3}, + #{attr4}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{factoryCode}, + #{delFlag}, + + + + + update qc_check_unqualified + + task_id = #{taskId}, + status = #{status}, + next_node_code = #{nextNodeCode}, + next_node_name = #{nextNodeName}, + remark = #{remark}, + 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_check_unqualified where id = #{id} + + + + delete from qc_check_unqualified where id in + + #{id} + + +