From 47318ca385c104f1db48e8f97affb816b3e0ada1 Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Mon, 11 Dec 2023 12:04:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=A8=E9=87=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../QcCheckReportIncomeController.java | 7 +-- .../QcCheckTypeProjectController.java | 11 +++++ .../controller/QcStaticTableController.java | 9 ++++ .../op/quality/controller/QuaController.java | 12 ++--- .../com/op/quality/domain/QcCheckProject.java | 37 ++++++++++++++ .../quality/mapper/QcCheckProjectMapper.java | 15 +++--- .../mapper/QcCheckReportIncomeMapper.java | 5 +- .../mapper/QcCheckTypeProjectMapper.java | 5 ++ .../service/IQcCheckProjectService.java | 14 +++--- .../service/IQcCheckReportIncomeService.java | 1 + .../service/IQcCheckTypeProjectService.java | 19 ++++--- .../impl/QcCheckReportIncomeServiceImpl.java | 1 + .../impl/QcCheckTaskIncomeServiceImpl.java | 5 +- .../impl/QcCheckTypeProjectServiceImpl.java | 25 ++++++++++ .../impl/QcMaterialGroupServiceImpl.java | 4 +- .../service/impl/QcProCheckServiceImpl.java | 2 +- .../mapper/quality/QcCheckProjectMapper.xml | 8 ++- .../quality/QcCheckTypeProjectMapper.xml | 49 +++++++++++++++++-- 18 files changed, 184 insertions(+), 45 deletions(-) diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckReportIncomeController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckReportIncomeController.java index 80182e83..b9a1d728 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckReportIncomeController.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckReportIncomeController.java @@ -9,10 +9,7 @@ import com.op.common.log.annotation.Log; import com.op.common.log.enums.BusinessType; import com.op.common.security.annotation.RequiresPermissions; import com.op.common.security.utils.SecurityUtils; -import com.op.quality.domain.QcBomComponent; -import com.op.quality.domain.QcCheckTaskDetail; -import com.op.quality.domain.QcCheckReportIncome; -import com.op.quality.domain.QcSupplier; +import com.op.quality.domain.*; import com.op.quality.service.IQcCheckReportIncomeService; import com.op.system.api.domain.SysUser; import org.apache.commons.lang.StringUtils; @@ -49,7 +46,7 @@ public class QcCheckReportIncomeController extends BaseController { LocalDate date = LocalDate.now(); LocalDate dateEnd = date.plusDays(1); DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd"); - String dateEndStr = dtf.format(dateEnd)+" 00:00:00"; + String dateEndStr = dtf.format(dateEnd)+" 23:59:59"; qcCheckReportIncome.setCheckTimeEnd(dateEndStr);//end } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTypeProjectController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTypeProjectController.java index ce30450f..bab92760 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTypeProjectController.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTypeProjectController.java @@ -3,6 +3,7 @@ package com.op.quality.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; +import com.op.quality.domain.QcCheckProject; import com.op.quality.domain.QcMaterialGroup; import com.op.quality.service.IQcMaterialGroupService; import org.springframework.beans.factory.annotation.Autowired; @@ -105,5 +106,15 @@ public class QcCheckTypeProjectController extends BaseController { public AjaxResult changeStatus(@RequestBody QcCheckTypeProject qcCheckTypeProject) { return toAjax(qcCheckTypeProjectService.changeStatus(qcCheckTypeProject)); } + @GetMapping("/getProjectInfoList") + public TableDataInfo getProjectInfoList(QcCheckProject qcCheckProject) { + startPage(); + List list = qcCheckTypeProjectService.getProjectInfoList(qcCheckProject); + return getDataTable(list); + } + @PostMapping("/submitProjects") + public AjaxResult submitProjects(@RequestBody List typeProjects) { + return toAjax(qcCheckTypeProjectService.submitProjects(typeProjects)); + } } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcStaticTableController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcStaticTableController.java index c863f96f..1db2db04 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcStaticTableController.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcStaticTableController.java @@ -138,6 +138,15 @@ public class QcStaticTableController extends BaseController { String key = keyPre+ymd; QcStaticTable mdata = seriesdtos.get(key); if(mdata != null){ + if(mdata.getaNoOkquality()==null){ + mdata.setaNoOkquality(new BigDecimal("0")); + } + if(mdata.getbNoOkquality()==null){ + mdata.setbNoOkquality(new BigDecimal("0")); + } + if(mdata.getcNoOkquality()==null){ + mdata.setcNoOkquality(new BigDecimal("0")); + } BigDecimal defectRate = (mdata.getaNoOkquality().add(mdata.getbNoOkquality()).multiply(new BigDecimal("0.65")) .add(mdata.getcNoOkquality()).multiply(new BigDecimal(0.35))) .divide(new BigDecimal(mdata.getSampleQuality())) diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QuaController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QuaController.java index 08608f66..03afa953 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/controller/QuaController.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QuaController.java @@ -234,7 +234,7 @@ public class QuaController extends BaseController { */ @GetMapping("/pdaMaterialTree") public AjaxResult pdaMaterialTree(QcMaterialGroup materialGroup) { - DynamicDataSourceContextHolder.push("ds_"+materialGroup.getFactoryCode()); + DynamicDataSourceContextHolder.push(materialGroup.getFactoryCode()); return success(qcMaterialGroupService.selectQcMaterialTreeList(materialGroup)); } @@ -244,7 +244,7 @@ public class QuaController extends BaseController { @GetMapping("/getCheckTypeProjectList") public TableDataInfo list(QcCheckTypeProject qcCheckTypeProject) { - DynamicDataSourceContextHolder.push("ds_"+qcCheckTypeProject.getFactoryCode()); + DynamicDataSourceContextHolder.push(qcCheckTypeProject.getFactoryCode()); startPage(); List list = qcMaterialGroupService.getCheckTypeProjectList(qcCheckTypeProject); return getDataTable(list); @@ -252,7 +252,7 @@ public class QuaController extends BaseController { @GetMapping("/getUnqualifiedList") public TableDataInfo getUnqualifiedList(QcCheckUnqualified qcCheckUnqualified) { - DynamicDataSourceContextHolder.push("ds_"+qcCheckUnqualified.getFactoryCode()); + DynamicDataSourceContextHolder.push(qcCheckUnqualified.getFactoryCode()); startPage(); qcCheckUnqualified.setDelFlag("0"); List list = qcCheckUnqualifiedService.selectQcCheckUnqualifiedList(qcCheckUnqualified); @@ -262,7 +262,7 @@ public class QuaController extends BaseController { /**获取来料工单列表**/ @GetMapping("/getLLWorkOrder") public TableDataInfo getLLWorkOrder(QcCheckTaskIncome qcCheckTaskIncome) { - DynamicDataSourceContextHolder.push("ds_"+qcCheckTaskIncome.getFactoryCode()); + DynamicDataSourceContextHolder.push(qcCheckTaskIncome.getFactoryCode()); startPage(); List list = qcCheckTaskIncomeService.getLLWorkOrder(qcCheckTaskIncome); return getDataTable(list); @@ -270,7 +270,7 @@ public class QuaController extends BaseController { /**获取生产工单列表**/ @GetMapping("/getWorkOrder") public TableDataInfo getWorkOrder(QcCheckTaskIncome qcCheckTaskIncome) { - DynamicDataSourceContextHolder.push("ds_"+qcCheckTaskIncome.getFactoryCode()); + DynamicDataSourceContextHolder.push(qcCheckTaskIncome.getFactoryCode()); startPage(); List list = qcCheckTaskIncomeService.getWorkOrder(qcCheckTaskIncome); return getDataTable(list); @@ -278,7 +278,7 @@ public class QuaController extends BaseController { @PutMapping("/getBatchList") public List getBatchList(@RequestBody QcCheckTaskIncome qcCheckTaskIncome) { - DynamicDataSourceContextHolder.push("ds_"+qcCheckTaskIncome.getFactoryCode()); + DynamicDataSourceContextHolder.push(qcCheckTaskIncome.getFactoryCode()); return qcCheckTaskIncomeService.getBatchList(qcCheckTaskIncome); } } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckProject.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckProject.java index e01a6f67..141dea06 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckProject.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckProject.java @@ -57,6 +57,43 @@ public class QcCheckProject extends BaseEntity { private String judge; + private String defectLevel; + private String materialCode; + private String typeCode; + private String groupId; + + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public String getGroupId() { + return groupId; + } + + public void setGroupId(String groupId) { + this.groupId = groupId; + } + + public String getTypeCode() { + return typeCode; + } + + public void setTypeCode(String typeCode) { + this.typeCode = typeCode; + } + + public String getDefectLevel() { + return defectLevel; + } + + public void setDefectLevel(String defectLevel) { + this.defectLevel = defectLevel; + } + public String getJudge() { return judge; } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckProjectMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckProjectMapper.java index 7e7be901..7a1c30d6 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckProjectMapper.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckProjectMapper.java @@ -7,7 +7,7 @@ import org.apache.ibatis.annotations.Mapper; /** * 检验项目维护Mapper接口 - * + * * @author Open Platform * @date 2023-10-13 */ @@ -15,7 +15,7 @@ import org.apache.ibatis.annotations.Mapper; public interface QcCheckProjectMapper { /** * 查询检验项目维护 - * + * * @param id 检验项目维护主键 * @return 检验项目维护 */ @@ -23,7 +23,7 @@ public interface QcCheckProjectMapper { /** * 查询检验项目维护列表 - * + * * @param qcCheckProject 检验项目维护 * @return 检验项目维护集合 */ @@ -31,7 +31,7 @@ public interface QcCheckProjectMapper { /** * 新增检验项目维护 - * + * * @param qcCheckProject 检验项目维护 * @return 结果 */ @@ -39,7 +39,7 @@ public interface QcCheckProjectMapper { /** * 修改检验项目维护 - * + * * @param qcCheckProject 检验项目维护 * @return 结果 */ @@ -47,7 +47,7 @@ public interface QcCheckProjectMapper { /** * 删除检验项目维护 - * + * * @param id 检验项目维护主键 * @return 结果 */ @@ -55,11 +55,12 @@ public interface QcCheckProjectMapper { /** * 批量删除检验项目维护 - * + * * @param ids 需要删除的数据主键集合 * @return 结果 */ public int deleteQcCheckProjectByIds(String[] ids); public QcCheckProject selectSerialNumber(); + } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckReportIncomeMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckReportIncomeMapper.java index 7c6e169d..ec72b606 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckReportIncomeMapper.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckReportIncomeMapper.java @@ -1,9 +1,6 @@ package com.op.quality.mapper; -import com.op.quality.domain.QcBomComponent; -import com.op.quality.domain.QcCheckReportIncome; -import com.op.quality.domain.QcCheckTaskDetail; -import com.op.quality.domain.QcSupplier; +import com.op.quality.domain.*; import com.op.system.api.domain.SysUser; import org.apache.ibatis.annotations.Mapper; diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTypeProjectMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTypeProjectMapper.java index 15c7b8f3..8b7f3a76 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTypeProjectMapper.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTypeProjectMapper.java @@ -3,11 +3,13 @@ package com.op.quality.mapper; import java.util.List; import java.util.Map; +import com.op.quality.domain.QcCheckProject; import com.op.quality.domain.QcCheckTaskDetail; import com.op.quality.domain.QcCheckTypeProject; import com.op.system.api.domain.SysDictData; import org.apache.ibatis.annotations.MapKey; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 物料检验项目维护Mapper接口 @@ -72,4 +74,7 @@ public interface QcCheckTypeProjectMapper { List getCheckTypeProjectList(QcCheckTypeProject qcCheckTypeProject); @MapKey("dictValue") Map getDictMap(SysDictData sysDictData); + List getProjectInfoList(QcCheckProject qcCheckProject); + + int insertQcCheckTypeProjects(@Param("list") List typeProjects); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckProjectService.java b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckProjectService.java index c928bc11..0f399923 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckProjectService.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckProjectService.java @@ -5,14 +5,14 @@ import com.op.quality.domain.QcCheckProject; /** * 检验项目维护Service接口 - * + * * @author Open Platform * @date 2023-10-13 */ public interface IQcCheckProjectService { /** * 查询检验项目维护 - * + * * @param id 检验项目维护主键 * @return 检验项目维护 */ @@ -20,7 +20,7 @@ public interface IQcCheckProjectService { /** * 查询检验项目维护列表 - * + * * @param qcCheckProject 检验项目维护 * @return 检验项目维护集合 */ @@ -28,7 +28,7 @@ public interface IQcCheckProjectService { /** * 新增检验项目维护 - * + * * @param qcCheckProject 检验项目维护 * @return 结果 */ @@ -36,7 +36,7 @@ public interface IQcCheckProjectService { /** * 修改检验项目维护 - * + * * @param qcCheckProject 检验项目维护 * @return 结果 */ @@ -44,7 +44,7 @@ public interface IQcCheckProjectService { /** * 批量删除检验项目维护 - * + * * @param ids 需要删除的检验项目维护主键集合 * @return 结果 */ @@ -52,7 +52,7 @@ public interface IQcCheckProjectService { /** * 删除检验项目维护信息 - * + * * @param id 检验项目维护主键 * @return 结果 */ diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckReportIncomeService.java b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckReportIncomeService.java index 7206e83b..1c1c937e 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckReportIncomeService.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckReportIncomeService.java @@ -71,4 +71,5 @@ public interface IQcCheckReportIncomeService { List getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail); public List getPrintData(QcCheckReportIncome qcCheckReportIncome); + } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckTypeProjectService.java b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckTypeProjectService.java index f2f751eb..aeffa6f9 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckTypeProjectService.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckTypeProjectService.java @@ -1,18 +1,20 @@ package com.op.quality.service; import java.util.List; + +import com.op.quality.domain.QcCheckProject; import com.op.quality.domain.QcCheckTypeProject; /** * 物料检验项目维护Service接口 - * + * * @author Open Platform * @date 2023-10-17 */ public interface IQcCheckTypeProjectService { /** * 查询物料检验项目维护 - * + * * @param id 物料检验项目维护主键 * @return 物料检验项目维护 */ @@ -20,7 +22,7 @@ public interface IQcCheckTypeProjectService { /** * 查询物料检验项目维护列表 - * + * * @param qcCheckTypeProject 物料检验项目维护 * @return 物料检验项目维护集合 */ @@ -28,7 +30,7 @@ public interface IQcCheckTypeProjectService { /** * 新增物料检验项目维护 - * + * * @param qcCheckTypeProject 物料检验项目维护 * @return 结果 */ @@ -36,7 +38,7 @@ public interface IQcCheckTypeProjectService { /** * 修改物料检验项目维护 - * + * * @param qcCheckTypeProject 物料检验项目维护 * @return 结果 */ @@ -44,7 +46,7 @@ public interface IQcCheckTypeProjectService { /** * 批量删除物料检验项目维护 - * + * * @param ids 需要删除的物料检验项目维护主键集合 * @return 结果 */ @@ -52,7 +54,7 @@ public interface IQcCheckTypeProjectService { /** * 删除物料检验项目维护信息 - * + * * @param id 物料检验项目维护主键 * @return 结果 */ @@ -61,4 +63,7 @@ public interface IQcCheckTypeProjectService { * 状态修改 */ public int changeStatus(QcCheckTypeProject qcCheckTypeProject); + List getProjectInfoList(QcCheckProject qcCheckProject); + + int submitProjects(List typeProjects); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportIncomeServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportIncomeServiceImpl.java index 7cec9cea..48e93eba 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportIncomeServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportIncomeServiceImpl.java @@ -196,6 +196,7 @@ public class QcCheckReportIncomeServiceImpl implements IQcCheckReportIncomeServi } @Override + @DS("#header.poolName") public List getPrintData(QcCheckReportIncome qcCheckReportIncome) { return null; } 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 4b21103b..ff07a171 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 @@ -321,7 +321,7 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService { @Override public int commitCheckResults(List details) { - DynamicDataSourceContextHolder.push("ds_"+details.get(0).getFactoryCode()); + DynamicDataSourceContextHolder.push(details.get(0).getFactoryCode()); Date nowTime = DateUtils.getNowDate(); String factoryCode = details.get(0).getFactoryCode(); String updateBy = details.get(0).getUpdateBy(); @@ -341,8 +341,9 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService { QcCheckTaskIncome qcCheckTask = new QcCheckTaskIncome(); qcCheckTask.setUpdateBy(updateBy); qcCheckTask.setRecordId(belongId); - qcCheckTask.setCheckResult("2");//检测状态0待检测1检测中2检测完成 + qcCheckTask.setCheckStatus("2");//检测状态0待检测1检测中2检测完成 qcCheckTask.setUpdateTime(nowTime); + qcCheckTask.setCheckTime(nowTime); qcCheckTask.setCheckResult(result);//检验结果Y合格 N不合格 /**qc_check_task**/ n = qcCheckTaskIncomeMapper.updateQcCheckTask(qcCheckTask); diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTypeProjectServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTypeProjectServiceImpl.java index d0999d1c..64cb7814 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTypeProjectServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTypeProjectServiceImpl.java @@ -1,5 +1,6 @@ package com.op.quality.service.impl; +import java.util.Date; import java.util.List; import java.util.Map; @@ -8,6 +9,7 @@ import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.uuid.IdUtils; import com.op.common.security.utils.SecurityUtils; +import com.op.quality.domain.QcCheckProject; import com.op.system.api.domain.SysDictData; import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -131,4 +133,27 @@ public class QcCheckTypeProjectServiceImpl implements IQcCheckTypeProjectService qcCheckTypeProject.setUpdateTime(DateUtils.getNowDate()); return qcCheckTypeProjectMapper.updateQcCheckTypeProject(qcCheckTypeProject); } + + @Override + @DS("#header.poolName") + public List getProjectInfoList(QcCheckProject qcCheckProject) { + return qcCheckTypeProjectMapper.getProjectInfoList(qcCheckProject); + } + + @Override + @DS("#header.poolName") + public int submitProjects(List typeProjects) { + int m = 0; + Date nowTime = DateUtils.getNowDate(); + String createBy = SecurityUtils.getUsername(); + for(QcCheckTypeProject typeProject:typeProjects){ + typeProject.setId(IdUtils.fastSimpleUUID()); + typeProject.setCreateBy(createBy); + typeProject.setCreateTime(nowTime); + } + m = qcCheckTypeProjectMapper.insertQcCheckTypeProjects(typeProjects); + return m; + } + + } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcMaterialGroupServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcMaterialGroupServiceImpl.java index 6dcdabe5..013988ee 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcMaterialGroupServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcMaterialGroupServiceImpl.java @@ -194,7 +194,9 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService { Map dictMap = qcCheckTypeProjectMapper.getDictMap(sData); if(dictMap != null){ for(QcCheckTypeProject dto:dtos){ - dto.setUnit(dictMap.get(dto.getUnit()).getDictLabel()); + if(StringUtils.isNotBlank(dto.getUnit())){ + dto.setUnit(dictMap.get(dto.getUnit()).getDictLabel()); + } } } return dtos; diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcProCheckServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcProCheckServiceImpl.java index 183e628f..b3ce675d 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcProCheckServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcProCheckServiceImpl.java @@ -126,7 +126,7 @@ public class QcProCheckServiceImpl implements QcProCheckService { @Override public List getCheckTaskDetailList(QcCheckTaskDetail qcCheckTaskDetail) { - DynamicDataSourceContextHolder.push("ds_"+qcCheckTaskDetail.getFactoryCode()); + DynamicDataSourceContextHolder.push(qcCheckTaskDetail.getFactoryCode()); return qcCheckTaskIncomeMapper.getCkeckProjectList(qcCheckTaskDetail); } diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckProjectMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckProjectMapper.xml index 2a8c2f3a..5ee4c824 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckProjectMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckProjectMapper.xml @@ -22,13 +22,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + select id, order_num, rule_name, property_code, check_mode, check_tool, unit_code, check_standard, attr1, create_by, create_time, update_by, update_time, factory_code, del_flag,sample_plan, - judge + judge,defect_level from qc_check_project @@ -74,6 +75,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" del_flag, sample_plan, judge, + defect_level, + #{id}, @@ -93,6 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{delFlag}, #{samplePlan}, #{judge}, + #{defectLevel}, @@ -115,6 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" del_flag = #{delFlag}, sample_plan = #{samplePlan}, judge = #{judge}, + defect_level = #{defectLevel}, where id = #{id} @@ -135,4 +140,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" FROM qc_check_project WHERE CONVERT(varchar(10),create_time, 120) = CONVERT(varchar(10),GETDATE(), 120) + diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTypeProjectMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTypeProjectMapper.xml index f7f78a07..c62ff584 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTypeProjectMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTypeProjectMapper.xml @@ -152,8 +152,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" SELECT ctp.id, ctp.project_id projectId, - cp.rule_name ruleName, - cp.property_code propertyCode, + qcp.rule_name ruleName, + qcp.property_code propertyCode, ctp.type_id typeId, ct.check_name, ctp.standard_value standardValue, @@ -166,11 +166,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" qcp.check_tool checkTool, qcp.check_mode checkMode FROM qc_check_type_project ctp - LEFT JOIN qc_check_project cp ON ctp.project_id = cp.id + LEFT JOIN qc_check_project qcp ON ctp.project_id = qcp.id left join qc_check_type ct on ct.id = ctp.type_id left join base_product p on p.product_code = ctp.material_code - AND ctp.del_flag = '0' AND cp.del_flag = '0' + AND ctp.del_flag = '0' AND qcp.del_flag = '0' and ctp.group_id = #{groupId} order by ctp.type_id @@ -231,6 +231,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{sort}, + + insert into qc_check_type_project( + id,project_id,project_no,type_id, + standard_value,upper_diff,down_diff,unit, + sample,sort, + create_by,create_time, + group_id,material_code,property_code + )values + + ( + #{item.id},#{item.projectId},#{item.projectNo},#{item.typeId}, + #{item.standardValue},#{item.upperDiff},#{item.downDiff},#{item.unit}, + #{item.sample},#{item.sort}, + #{item.createBy},#{item.createTime}, + #{item.groupId},#{item.materialCode},#{item.propertyCode} + ) + + update qc_check_type_project @@ -270,4 +288,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{id} +