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 17aaa5bf..81c22991 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 @@ -11,6 +11,7 @@ import java.util.stream.Collectors; import javax.servlet.http.HttpServletResponse; import com.op.common.core.utils.DateUtils; +import com.op.quality.domain.QcCheckType; import com.op.system.api.domain.quality.ChartDTO; import com.op.system.api.domain.quality.ChartSeriesDTO; import com.op.system.api.domain.quality.FactoryDto; @@ -228,6 +229,10 @@ public class QcStaticTableController extends BaseController { return qcStaticTableService.getWorkcenterList(factoryDto); } + @GetMapping("/getCheckTypeList/{typeCode}") + public List getCheckTypeList(@PathVariable("typeCode") String typeCode) { + return qcStaticTableService.getCheckTypeList(typeCode); + } /** * 巡检记录报表 */ @@ -266,4 +271,23 @@ public class QcStaticTableController extends BaseController { ChartSeriesDTO dto = qcStaticTableService.getXJChartData(qcStaticTable); return dto; } + + /**质检不良率统计**/ + @RequiresPermissions("quality:qcProduceAnalysis:list") + @GetMapping("/getQmsRateTable") + public TableDataInfo getQmsRateTable(QcStaticTable qcStaticTable) { + //默认时间范围T 00:00:00~T+1 00:00:00 + if(StringUtils.isEmpty(qcStaticTable.getYmArrayStart())){ + LocalDate date = LocalDate.now(); + DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + String ymStr = dtf.format(date); + qcStaticTable.setYmArrayStart(ymStr); + qcStaticTable.setYmArrayEnd(ymStr); + } + + startPage(); + List list = qcStaticTableService.getQmsRateTable(qcStaticTable); + return getDataTable(list); + } + } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcStaticTable.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcStaticTable.java index 66155a45..a230152f 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcStaticTable.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcStaticTable.java @@ -86,6 +86,15 @@ public class QcStaticTable extends BaseEntity { private String column200210; private String startDateStr; private String endDateStr; + private String checkType; + + public String getCheckType() { + return checkType; + } + + public void setCheckType(String checkType) { + this.checkType = checkType; + } public String getStartDateStr() { return startDateStr; diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcStaticTableMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcStaticTableMapper.java index d6dea4e3..17afffb6 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcStaticTableMapper.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcStaticTableMapper.java @@ -3,6 +3,7 @@ package com.op.quality.mapper; import java.util.List; import java.util.Map; +import com.op.quality.domain.QcCheckType; import com.op.quality.domain.QcStaticTable; import com.op.system.api.domain.quality.FactoryDto; import org.apache.ibatis.annotations.MapKey; @@ -51,4 +52,8 @@ public interface QcStaticTableMapper { List getLegendData(QcStaticTable qcStaticTable); @MapKey("ymdms") Map getXJMapData(QcStaticTable qcStaticTable); + + List getQmsRateTable(QcStaticTable qcStaticTable); + + List getCheckTypeList(String typeCode); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcStaticTableService.java b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcStaticTableService.java index e769347c..17196687 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcStaticTableService.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcStaticTableService.java @@ -3,6 +3,7 @@ package com.op.quality.service; import java.util.List; import java.util.Map; +import com.op.quality.domain.QcCheckType; import com.op.quality.domain.QcStaticTable; import com.op.system.api.domain.quality.ChartSeriesDTO; import com.op.system.api.domain.quality.FactoryDto; @@ -36,4 +37,8 @@ public interface IQcStaticTableService { List getXJCheckTableDetail(QcStaticTable qcStaticTable); ChartSeriesDTO getXJChartData(QcStaticTable qcStaticTable); + + List getQmsRateTable(QcStaticTable qcStaticTable); + + List getCheckTypeList(String typeCode); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcStaticTableServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcStaticTableServiceImpl.java index d7071724..7d9de927 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcStaticTableServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcStaticTableServiceImpl.java @@ -4,15 +4,11 @@ import java.math.BigDecimal; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; -import java.time.LocalDate; -import java.time.format.DateTimeFormatter; import java.util.*; import java.util.stream.Collectors; - import com.baomidou.dynamic.datasource.annotation.DS; -import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.StringUtils; -import com.op.quality.domain.QcCheckTaskIncome; +import com.op.quality.domain.QcCheckType; import com.op.system.api.domain.quality.ChartDTO; import com.op.system.api.domain.quality.ChartSeriesDTO; import com.op.system.api.domain.quality.FactoryDto; @@ -319,6 +315,45 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService { return seriesDTO; } + @Override + @DS("#header.poolName") + public List getQmsRateTable(QcStaticTable qcStaticTable) { + List dtos = qcStaticTableMapper.getQmsRateTable(qcStaticTable); + for(QcStaticTable dto:dtos){ + if(StringUtils.isEmpty(dto.getOrderNo())){ + dto.setOrderNo("-"); + } + if(StringUtils.isEmpty(dto.getIncomeBatchNo())){ + dto.setIncomeBatchNo("-"); + } + if(StringUtils.isEmpty(dto.getMaterialCode())){ + dto.setMaterialCode("-"); + } + if(StringUtils.isEmpty(dto.getMaterialCode())){ + dto.setMaterialCode("-"); + } + if(StringUtils.isEmpty(dto.getMaterialName())){ + dto.setMaterialName("-"); + } + + if(StringUtils.isNotBlank(dto.getSampleQuality())&&!"0.00".equals(dto.getSampleQuality())){ + BigDecimal noOkRate = new BigDecimal(dto.getNoOkNums()) + .multiply(new BigDecimal(100)) + .divide(new BigDecimal(dto.getSampleQuality()),2,BigDecimal.ROUND_HALF_UP); + dto.setNoOkNumRate(noOkRate.toString()+"%"); + }else{ + dto.setNoOkNumRate("-"); + } + } + return dtos; + } + + @Override + @DS("#header.poolName") + public List getCheckTypeList(String typeCode) { + return qcStaticTableMapper.getCheckTypeList(typeCode); + } + private List getHourProductionTitle(QcStaticTable qcStaticTable) { // 返回的日期集合 @@ -349,4 +384,6 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService { return dayHours; } + + } diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcStaticTableMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcStaticTableMapper.xml index 1078b7ab..ce0a96b8 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcStaticTableMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcStaticTableMapper.xml @@ -182,4 +182,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and qct.material_code like concat('%',#{materialCode},'%') group by qct.supplier_code,qct.supplier_name,CONVERT(VARCHAR(2), qct.check_time, 108) + +