diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTaskIncomeController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTaskIncomeController.java index 29382fe7..91c07a4e 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTaskIncomeController.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTaskIncomeController.java @@ -1,11 +1,18 @@ 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 com.op.common.security.utils.SecurityUtils; import com.op.quality.domain.QcBomComponent; +import com.op.quality.domain.QcCheckTaskDetail; import com.op.quality.domain.QcSupplier; +import com.op.system.api.domain.SysRole; import com.op.system.api.domain.SysUser; +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; @@ -43,6 +50,22 @@ public class QcCheckTaskIncomeController extends BaseController { @RequiresPermissions("quality:qcIncome:list") @GetMapping("/list") public TableDataInfo list(QcCheckTaskIncome qcCheckTaskIncome) { + + //默认时间范围T 00:00:00~T+1 00:00:00 + if(StringUtils.isEmpty(qcCheckTaskIncome.getIncomeTimeStart())){ + qcCheckTaskIncome.setIncomeTimeStart(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"; + qcCheckTaskIncome.setIncomeTimeEnd(dateEndStr);//end + } + + if(StringUtils.isEmpty(qcCheckTaskIncome.getCheckTimeStart())){ + qcCheckTaskIncome.setCheckTimeStart(qcCheckTaskIncome.getIncomeTimeStart());//start + qcCheckTaskIncome.setCheckTimeEnd(qcCheckTaskIncome.getIncomeTimeStart());//end + } + startPage(); List list = qcCheckTaskIncomeService.selectQcCheckTaskIncomeList(qcCheckTaskIncome); return getDataTable(list); @@ -55,6 +78,22 @@ public class QcCheckTaskIncomeController extends BaseController { @Log(title = "来料检验", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, QcCheckTaskIncome qcCheckTaskIncome) { + + //默认时间范围T 00:00:00~T+1 00:00:00 + if(StringUtils.isEmpty(qcCheckTaskIncome.getIncomeTimeStart())){ + qcCheckTaskIncome.setIncomeTimeStart(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"; + qcCheckTaskIncome.setIncomeTimeEnd(dateEndStr);//end + } + + if(StringUtils.isEmpty(qcCheckTaskIncome.getCheckTimeStart())){ + qcCheckTaskIncome.setCheckTimeStart(qcCheckTaskIncome.getIncomeTimeStart());//start + qcCheckTaskIncome.setCheckTimeEnd(qcCheckTaskIncome.getIncomeTimeStart());//end + } + List list = qcCheckTaskIncomeService.selectQcCheckTaskIncomeList(qcCheckTaskIncome); ExcelUtil util = new ExcelUtil(QcCheckTaskIncome.class); util.exportExcel(response, list, "来料检验数据"); @@ -131,4 +170,53 @@ public class QcCheckTaskIncomeController extends BaseController { return getDataTable(list); } + /** + * 状态修改 + */ + @PutMapping("/changeIncomeStatus") + public AjaxResult changeIncomeStatus(@RequestBody QcCheckTaskIncome qcCheckTaskIncome) { + qcCheckTaskIncome.setUpdateBy(SecurityUtils.getUsername()); + qcCheckTaskIncome.setUpdateTime(DateUtils.getNowDate()); + return toAjax(qcCheckTaskIncomeService.updateIncomeStatus(qcCheckTaskIncome)); + } + + /** + * 检验项目弹窗列表 + * @param + * @return + */ + @GetMapping("/getCkeckProjectList") + public TableDataInfo getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail) { + startPage(); + List list = qcCheckTaskIncomeService.getCkeckProjectList(qcCheckTaskDetail); + return getDataTable(list); + } + + /** + * 合格不合格 + */ + @PutMapping("/changeCheckDetailStatus") + public AjaxResult changeCheckDetailStatus(@RequestBody QcCheckTaskDetail qcCheckTaskDetail) { + qcCheckTaskDetail.setUpdateBy(SecurityUtils.getUsername()); + qcCheckTaskDetail.setUpdateTime(DateUtils.getNowDate()); + return toAjax(qcCheckTaskIncomeService.changeCheckDetailStatus(qcCheckTaskDetail)); + } + + /** + * 测量值提交 + */ + @PutMapping("/commitActualValue") + public AjaxResult commitActualValue(@RequestBody QcCheckTaskDetail qcCheckTaskDetail) { + qcCheckTaskDetail.setUpdateBy(SecurityUtils.getUsername()); + qcCheckTaskDetail.setUpdateTime(DateUtils.getNowDate()); + return toAjax(qcCheckTaskIncomeService.commitActualValue(qcCheckTaskDetail)); + } + /**检测结果提交**/ + @PutMapping("/commitCheckResult") + public AjaxResult commitCheckResult(@RequestBody QcCheckTaskIncome qcCheckTaskIncome) { + qcCheckTaskIncome.setUpdateBy(SecurityUtils.getUsername()); + qcCheckTaskIncome.setUpdateTime(DateUtils.getNowDate()); + return toAjax(qcCheckTaskIncomeService.commitCheckResult(qcCheckTaskIncome)); + } + } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcMaterialGroupController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcMaterialGroupController.java index 89df4a14..06835b43 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcMaterialGroupController.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcMaterialGroupController.java @@ -99,7 +99,17 @@ public class QcMaterialGroupController extends BaseController { @RequiresPermissions("quality:materialGroup:remove") @Log(title = "物料组", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable String[] ids) { - return toAjax(qcMaterialGroupService.deleteQcMaterialGroupByIds(ids)); + public AjaxResult remove(@PathVariable String id) { + QcMaterialGroup parent = new QcMaterialGroup(); + parent.setId(id); + List children = qcMaterialGroupService.getMaterialChildrenList(parent); + boolean hasRule = qcMaterialGroupService.validationData(id); + if (!children.isEmpty()) { + return AjaxResult.error("此节点下含有子节点,请先删除子节点"); + }else if (hasRule){ + return AjaxResult.error("此节点含有检验规则,请先删除检验规则"); + } else { + return toAjax(qcMaterialGroupService.deleteQcMaterialGroupById(id)); + } } } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcMaterialGroupDetailController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcMaterialGroupDetailController.java index 3e7c287d..35e11ec7 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcMaterialGroupDetailController.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcMaterialGroupDetailController.java @@ -2,6 +2,8 @@ package com.op.quality.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; + +import com.op.quality.domain.QcMaterialGroup; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -91,7 +93,14 @@ public class QcMaterialGroupDetailController extends BaseController { @RequiresPermissions("quality:materialGroupDetail:remove") @Log(title = "物料组成员", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable String[] ids) { - return toAjax(qcMaterialGroupDetailService.deleteQcMaterialGroupDetailByIds(ids)); + public AjaxResult remove(@PathVariable String id) { + QcMaterialGroupDetail groupDetail = qcMaterialGroupDetailService.selectQcMaterialGroupDetailById(id); + boolean hasRule = qcMaterialGroupDetailService.validationData(groupDetail.getMaterialCode()); + if (hasRule) { + return AjaxResult.error("此节点含有检验规则,请先删除检验规则"); + }else { + return toAjax(qcMaterialGroupDetailService.deleteQcMaterialGroupDetailById(id)); + } + } } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTaskDetail.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTaskDetail.java index 7d8a9379..4cd7fd0c 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTaskDetail.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTaskDetail.java @@ -1,6 +1,8 @@ package com.op.quality.domain; import java.math.BigDecimal; +import java.util.List; + import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.op.common.core.annotation.Excel; @@ -52,7 +54,7 @@ public class QcCheckTaskDetail extends BaseEntity { /** 实际值 */ @Excel(name = "实际值") - private BigDecimal actualValue; + private String actualValue; /** Y合格N不合格 */ @Excel(name = "Y合格N不合格") @@ -82,6 +84,7 @@ public class QcCheckTaskDetail extends BaseEntity { private String delFlag; private String projectId; + private String projectNo; private Integer sort; private String standardValue; @@ -89,6 +92,23 @@ public class QcCheckTaskDetail extends BaseEntity { private BigDecimal downDiff; private BigDecimal sample; private Integer sampleNum; + private List actualValues; + + public List getActualValues() { + return actualValues; + } + + public void setActualValues(List actualValues) { + this.actualValues = actualValues; + } + + public String getProjectNo() { + return projectNo; + } + + public void setProjectNo(String projectNo) { + this.projectNo = projectNo; + } public String getStandardValue() { return standardValue; @@ -210,11 +230,11 @@ public class QcCheckTaskDetail extends BaseEntity { public String getCheckStandard() { return checkStandard; } - public void setActualValue(BigDecimal actualValue) { + public void setActualValue(String actualValue) { this.actualValue = actualValue; } - public BigDecimal getActualValue() { + public String getActualValue() { return actualValue; } public void setStatus(String status) { diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTaskIncome.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTaskIncome.java index ac38a453..fec78b45 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTaskIncome.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTaskIncome.java @@ -91,19 +91,19 @@ public class QcCheckTaskIncome extends BaseEntity { private String status; /** 预留字段1 */ - @Excel(name = "预留字段1") + //@Excel(name = "预留字段1") private String attr1; /** 预留字段2 */ - @Excel(name = "预留字段2") + //@Excel(name = "预留字段2") private String attr2; /** 预留字段3 */ - @Excel(name = "预留字段3") + //@Excel(name = "预留字段3") private String attr3; /** 预留字段4 */ - @Excel(name = "预留字段4") + //@Excel(name = "预留字段4") private String attr4; /** 工厂编码 */ @@ -113,6 +113,43 @@ public class QcCheckTaskIncome extends BaseEntity { /** 删除标识1删除0正常 */ private String delFlag; + private String incomeTimeStart; + private String incomeTimeEnd; + private String checkTimeStart; + private String checkTimeEnd; + + public String getIncomeTimeStart() { + return incomeTimeStart; + } + + public void setIncomeTimeStart(String incomeTimeStart) { + this.incomeTimeStart = incomeTimeStart; + } + + public String getIncomeTimeEnd() { + return incomeTimeEnd; + } + + public void setIncomeTimeEnd(String incomeTimeEnd) { + this.incomeTimeEnd = incomeTimeEnd; + } + + 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 setRecordId(String recordId) { this.recordId = recordId; } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTypeProject.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTypeProject.java index a3d8cc53..f5094d7a 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTypeProject.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTypeProject.java @@ -21,6 +21,11 @@ public class QcCheckTypeProject extends BaseEntity { /** 检验项目id */ @Excel(name = "检验项目id") private String projectId; + /** 检验规则名称 */ + @Excel(name = "检验规则名称") + private String ruleName; + /** 规则方式*/ + private String propertyCode; /** 检验节点id */ @Excel(name = "检验节点id") @@ -175,11 +180,28 @@ public class QcCheckTypeProject extends BaseEntity { return materialCode; } + public String getRuleName() { + return ruleName; + } + + public void setRuleName(String ruleName) { + this.ruleName = ruleName; + } + + public String getPropertyCode() { + return propertyCode; + } + + public void setPropertyCode(String propertyCode) { + this.propertyCode = propertyCode; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("id", getId()) .append("projectId", getProjectId()) + .append("ruleName", getRuleName()) .append("typeId", getTypeId()) .append("standardValue", getStandardValue()) .append("upperDiff", getUpperDiff()) diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTaskDetailMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTaskDetailMapper.java index a1fe8ccd..78d402e3 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTaskDetailMapper.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTaskDetailMapper.java @@ -3,6 +3,7 @@ package com.op.quality.mapper; import java.util.List; import com.op.quality.domain.QcCheckTaskDetail; +import com.op.quality.domain.QcCheckTaskIncome; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -62,5 +63,7 @@ public interface QcCheckTaskDetailMapper { */ public int deleteQcCheckTaskDetailByRecordIds(String[] recordIds); - int addBatch(@Param("list") List items); + public int addBatch(@Param("list") List items); + + List getProjectStatus(String belongTo); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTaskIncomeMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTaskIncomeMapper.java index 86577d85..71fb885f 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTaskIncomeMapper.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTaskIncomeMapper.java @@ -3,6 +3,7 @@ package com.op.quality.mapper; import java.util.List; import com.op.quality.domain.QcBomComponent; +import com.op.quality.domain.QcCheckTaskDetail; import com.op.quality.domain.QcCheckTaskIncome; import com.op.quality.domain.QcSupplier; import com.op.system.api.domain.SysUser; @@ -71,4 +72,6 @@ public interface QcCheckTaskIncomeMapper { public List getQcListUser(SysUser sysUser); int getTodayMaxNum(QcCheckTaskIncome qcCheckTaskIncome); + + List getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcMaterialGroupDetailMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcMaterialGroupDetailMapper.java index 27070497..421feea7 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcMaterialGroupDetailMapper.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcMaterialGroupDetailMapper.java @@ -62,4 +62,6 @@ public interface QcMaterialGroupDetailMapper { public int deleteQcMaterialGroupDetailByIds(String[] ids); public QcMaterialGroupDetail getGroupByMaterial(String materialCode); + + public List validationData(String materialCode); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcMaterialGroupMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcMaterialGroupMapper.java index 31405898..7ba8a55e 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcMaterialGroupMapper.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcMaterialGroupMapper.java @@ -62,4 +62,6 @@ public interface QcMaterialGroupMapper { public int deleteQcMaterialGroupByIds(String[] ids); public List getMaterialChildrenList(QcMaterialGroup qcMaterialGroup); + + public List validationData(String id); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckTaskIncomeService.java b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckTaskIncomeService.java index ea17af8f..56d51a20 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckTaskIncomeService.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckTaskIncomeService.java @@ -3,6 +3,7 @@ package com.op.quality.service; import java.util.List; import com.op.quality.domain.QcBomComponent; +import com.op.quality.domain.QcCheckTaskDetail; import com.op.quality.domain.QcCheckTaskIncome; import com.op.quality.domain.QcSupplier; import com.op.system.api.domain.SysUser; @@ -67,4 +68,14 @@ public interface IQcCheckTaskIncomeService { public List getQcListSupplier(QcSupplier qcSupplier); public List getQcListUser(SysUser sysUser); + + int updateIncomeStatus(QcCheckTaskIncome qcCheckTaskIncome); + + List getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail); + + int changeCheckDetailStatus(QcCheckTaskDetail qcCheckTaskDetail); + + int commitActualValue(QcCheckTaskDetail qcCheckTaskDetail); + + int commitCheckResult(QcCheckTaskIncome qcCheckTaskIncome); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcMaterialGroupDetailService.java b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcMaterialGroupDetailService.java index 86583899..6a4c1cce 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcMaterialGroupDetailService.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcMaterialGroupDetailService.java @@ -57,4 +57,6 @@ public interface IQcMaterialGroupDetailService { * @return 结果 */ public int deleteQcMaterialGroupDetailById(String id); + + public boolean validationData(String id); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcMaterialGroupService.java b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcMaterialGroupService.java index e3dd2ffb..1ed5f635 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcMaterialGroupService.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcMaterialGroupService.java @@ -67,4 +67,6 @@ public interface IQcMaterialGroupService { * @return 结果 */ public int deleteQcMaterialGroupById(String id); + + public boolean validationData(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 35d83c42..9ed1ca73 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 @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; +import com.alibaba.fastjson2.JSONArray; import com.baomidou.dynamic.datasource.annotation.DS; import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.uuid.IdUtils; @@ -82,17 +83,19 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService { String liushuiStr = String.format("%04d", liushuiNum); String createBy = SecurityUtils.getUsername(); + Date nowDate= DateUtils.getNowDate(); //获取当前所选工厂 HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); String key = "#header.poolName"; String factoryCode = request.getHeader(key.substring(8)).replace("ds_",""); qcCheckTaskIncome.setCheckNo(bpDD+liushuiStr); - qcCheckTaskIncome.setCreateTime(DateUtils.getNowDate()); /**qc_check_task_income**/ String beLongId = IdUtils.fastSimpleUUID(); qcCheckTaskIncome.setRecordId(beLongId); + qcCheckTaskIncome.setFactoryCode(factoryCode); + qcCheckTaskIncome.setCreateTime(nowDate); qcCheckTaskIncomeMapper.insertQcCheckTaskIncome(qcCheckTaskIncome); /**取检测项**/ @@ -115,7 +118,6 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService { if(CollectionUtils.isEmpty(items)){ return 0;//没有找到检测项目 } - Date nowDate= DateUtils.getNowDate(); for(QcCheckTaskDetail item:items){ item.setRecordId(IdUtils.fastSimpleUUID()); @@ -123,6 +125,7 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService { item.setCreateTime(nowDate); item.setCreateBy(createBy); item.setFactoryCode(factoryCode); + item.setStatus("Y"); } return qcCheckTaskDetailMapper.addBatch(items); } @@ -182,4 +185,44 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService { return qcCheckTaskIncomeMapper.getQcListUser(sysUser); } + @Override + @DS("#header.poolName") + public int updateIncomeStatus(QcCheckTaskIncome qcCheckTaskIncome) { + return qcCheckTaskIncomeMapper.updateQcCheckTaskIncome(qcCheckTaskIncome); + } + + @Override + @DS("#header.poolName") + public List getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail) { + return qcCheckTaskIncomeMapper.getCkeckProjectList(qcCheckTaskDetail); + } + + @Override + @DS("#header.poolName") + public int changeCheckDetailStatus(QcCheckTaskDetail qcCheckTaskDetail) { + return qcCheckTaskDetailMapper.updateQcCheckTaskDetail(qcCheckTaskDetail); + } + + @Override + @DS("#header.poolName") + public int commitActualValue(QcCheckTaskDetail qcCheckTaskDetail) { + String actualValue = JSONArray.toJSONString(qcCheckTaskDetail.getActualValues()); + qcCheckTaskDetail.setActualValue(actualValue); + return qcCheckTaskDetailMapper.updateQcCheckTaskDetail(qcCheckTaskDetail); + } + + @Override + @DS("#header.poolName") + public int commitCheckResult(QcCheckTaskIncome qcCheckTaskIncome) { + //遍历检测项目 + List projects= qcCheckTaskDetailMapper.getProjectStatus(qcCheckTaskIncome.getRecordId()); + if(CollectionUtils.isEmpty(projects)){ + qcCheckTaskIncome.setCheckResult("Y");//合格 + }else{ + qcCheckTaskIncome.setCheckResult("N");//不合格 + } + qcCheckTaskIncome.setCheckTime(DateUtils.getNowDate()); + return qcCheckTaskIncomeMapper.updateQcCheckTaskIncome(qcCheckTaskIncome); + } + } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckTypeProjectServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckTypeProjectServiceImpl.java index fe9c2c5d..b1ecb32a 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckTypeProjectServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckTypeProjectServiceImpl.java @@ -4,11 +4,18 @@ import java.util.List; import com.baomidou.dynamic.datasource.annotation.DS; import com.op.common.core.utils.DateUtils; +import com.op.common.core.utils.uuid.IdUtils; +import com.op.common.security.utils.SecurityUtils; +import org.apache.catalina.security.SecurityUtil; 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; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; /** * 物料检验项目维护Service业务层处理 @@ -54,7 +61,12 @@ public class QcCheckTypeProjectServiceImpl implements IQcCheckTypeProjectService @Override @DS("#header.poolName") public int insertQcCheckTypeProject(QcCheckTypeProject qcCheckTypeProject) { + qcCheckTypeProject.setId(IdUtils.fastSimpleUUID()); + qcCheckTypeProject.setCreateBy(SecurityUtils.getUsername()); qcCheckTypeProject.setCreateTime(DateUtils.getNowDate()); + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + String key = "#header.poolName"; + qcCheckTypeProject.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_","")); return qcCheckTypeProjectMapper.insertQcCheckTypeProject(qcCheckTypeProject); } @@ -67,6 +79,7 @@ public class QcCheckTypeProjectServiceImpl implements IQcCheckTypeProjectService @Override @DS("#header.poolName") public int updateQcCheckTypeProject(QcCheckTypeProject qcCheckTypeProject) { + qcCheckTypeProject.setUpdateBy(SecurityUtils.getUsername()); qcCheckTypeProject.setUpdateTime(DateUtils.getNowDate()); return qcCheckTypeProjectMapper.updateQcCheckTypeProject(qcCheckTypeProject); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcMaterialGroupDetailServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcMaterialGroupDetailServiceImpl.java index 06d7504d..8ee3d17f 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcMaterialGroupDetailServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcMaterialGroupDetailServiceImpl.java @@ -105,4 +105,9 @@ public class QcMaterialGroupDetailServiceImpl implements IQcMaterialGroupDetailS public int deleteQcMaterialGroupDetailById(String id) { return qcMaterialGroupDetailMapper.deleteQcMaterialGroupDetailById(id); } + + @Override + public boolean validationData(String materialCode) { + return qcMaterialGroupDetailMapper.validationData(materialCode).size() > 0; + } } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcMaterialGroupServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcMaterialGroupServiceImpl.java index 43f012aa..c6466dcc 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcMaterialGroupServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcMaterialGroupServiceImpl.java @@ -173,6 +173,11 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService { return qcMaterialGroupMapper.deleteQcMaterialGroupById(id); } + @Override + public boolean validationData(String id) { + return qcMaterialGroupMapper.validationData(id).size() > 0; + } + private boolean hasChild(List list, QcMaterialGroup t) { return getChildList(list, t).size() > 0 ? true : false; } diff --git a/op-modules/op-quality/src/main/resources/mapper/QcCheckProjectMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckProjectMapper.xml similarity index 100% rename from op-modules/op-quality/src/main/resources/mapper/QcCheckProjectMapper.xml rename to op-modules/op-quality/src/main/resources/mapper/quality/QcCheckProjectMapper.xml diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskDetailMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskDetailMapper.xml index daa06564..926fec64 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskDetailMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskDetailMapper.xml @@ -30,7 +30,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select record_id, belong_to, order_num, rule_name, property_code, check_mode, check_tool, unit_code, check_standard, actual_value, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, factory_code, del_flag from qc_check_task_detail + select record_id, belong_to, order_num, rule_name, property_code, check_mode, check_tool, unit_code, check_standard, + actual_value, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, + factory_code, del_flag + from qc_check_task_detail + - + insert into qc_check_task_detail record_id, @@ -113,7 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" insert into qc_check_task_detail( record_id,belong_to, - project_id,rule_name,order_num, + project_id,project_no,rule_name,order_num, property_code,check_mode, check_tool,unit_code, check_standard,actual_value, @@ -123,7 +132,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ( #{item.recordId},#{item.belongTo}, - #{item.projectId},#{item.ruleName},#{item.sort}, + #{item.projectId},#{item.projectNo},#{item.ruleName},#{item.sort}, #{item.propertyCode},#{item.checkMode}, #{item.checkTool},#{item.unitCode}, #{item.checkStandard},#{item.actualValue}, diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskIncomeMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskIncomeMapper.xml index 8d0d75a6..d4309ebf 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskIncomeMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskIncomeMapper.xml @@ -64,6 +64,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and attr3 = #{attr3} and attr4 = #{attr4} and factory_code = #{factoryCode} + and CONVERT(varchar(30),income_time, 120) >= #{incomeTimeStart} + and #{incomeTimeEnd} > CONVERT(varchar(30),income_time, 120) + and CONVERT(varchar(30),check_time, 120) >= #{checkTimeStart} + and #{checkTimeEnd} > CONVERT(varchar(30),check_time, 120) @@ -101,6 +105,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" from qc_check_task_income where CONVERT(varchar(10),create_time, 120) = CONVERT(varchar(10),GETDATE(), 120) + insert into qc_check_task_income diff --git a/op-modules/op-quality/src/main/resources/mapper/QcCheckTypeMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTypeMapper.xml similarity index 100% rename from op-modules/op-quality/src/main/resources/mapper/QcCheckTypeMapper.xml rename to op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTypeMapper.xml diff --git a/op-modules/op-quality/src/main/resources/mapper/QcCheckTypeProjectMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTypeProjectMapper.xml similarity index 74% rename from op-modules/op-quality/src/main/resources/mapper/QcCheckTypeProjectMapper.xml rename to op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTypeProjectMapper.xml index dc40731c..71f587bc 100644 --- a/op-modules/op-quality/src/main/resources/mapper/QcCheckTypeProjectMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTypeProjectMapper.xml @@ -22,35 +22,81 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + - 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 + 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, sample_num from qc_check_type_project + select + id, + create_by, + create_time + from qc_check_type_project + where material_code = #{materialCode} + diff --git a/op-modules/op-quality/src/main/resources/mapper/QcMaterialGroupMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcMaterialGroupMapper.xml similarity index 96% rename from op-modules/op-quality/src/main/resources/mapper/QcMaterialGroupMapper.xml rename to op-modules/op-quality/src/main/resources/mapper/quality/QcMaterialGroupMapper.xml index 84871491..a90f283a 100644 --- a/op-modules/op-quality/src/main/resources/mapper/QcMaterialGroupMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcMaterialGroupMapper.xml @@ -107,4 +107,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{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/quality/QcUserMaterialMapper.xml similarity index 100% rename from op-modules/op-quality/src/main/resources/mapper/QcUserMaterialMapper.xml rename to op-modules/op-quality/src/main/resources/mapper/quality/QcUserMaterialMapper.xml