diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/vo/MesDailyReportVo.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/vo/MesDailyReportVo.java index cf2fb73b..cecbce7b 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/domain/vo/MesDailyReportVo.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/vo/MesDailyReportVo.java @@ -18,7 +18,7 @@ public class MesDailyReportVo extends BaseEntity { @Excel(name = "车间编码") private String workshopName; @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "日期") + @Excel(name = "日期",dateFormat = "yyyy-MM-dd") private Date productDate;//工单日期 // sap @Excel(name = "产线编码") diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java index d682dee4..1bcc5383 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java @@ -468,10 +468,16 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService { .divide(new BigDecimal(dto.getQuantitySplit()),2,BigDecimal.ROUND_HALF_UP); dto.setCompleteRate(completeRate.toString()+"%"); //标准工时=母单数量*规格/产线标准效率 - BigDecimal workTimeStandard = new BigDecimal(realQua) - .multiply(new BigDecimal(dto.getSpec())) - .divide(dto.getEfficiency(),2,BigDecimal.ROUND_HALF_UP); - dto.setWorkTimeStandard(workTimeStandard.toString()); + BigDecimal workTimeStandard = BigDecimal.ZERO; + if(dto.getEfficiency() != null){ + workTimeStandard = new BigDecimal(realQua) + .multiply(new BigDecimal(dto.getSpec())) + .divide(dto.getEfficiency(),2,BigDecimal.ROUND_HALF_UP); + dto.setWorkTimeStandard(workTimeStandard.toString()); + }else{ + dto.setWorkTimeStandard("-"); + } + // 产线效率 标准工时/实际工时 BigDecimal productivity = workTimeStandard 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 0f19454a..91ef6450 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 @@ -14,6 +14,7 @@ import javax.servlet.http.HttpServletResponse; import com.op.common.core.domain.ExcelCol; import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.poi.ExcelMapUtil; +import com.op.quality.domain.QcCheckDetail; import com.op.quality.domain.QcCheckProject; import com.op.quality.domain.QcCheckType; import com.op.system.api.domain.quality.ChartDTO; @@ -540,4 +541,23 @@ public class QcStaticTableController extends BaseController { public List getTableHzNoOkDataSC(@RequestBody QcStaticTable qcStaticTable) { return qcStaticTableService.getTableHzNoOkDataSC(qcStaticTable); } + + + @Log(title = "来料检验结果明细", businessType = BusinessType.EXPORT) + @PostMapping("/exportIncomeDetail") + public void exportIncomeDetail(HttpServletResponse response, QcStaticTable qcStaticTable) { + List list = qcStaticTableService.exportIncomeDetail(qcStaticTable); + ExcelUtil util = new ExcelUtil(QcCheckDetail.class); + util.exportExcel(response, list, "检验结果明细"); + } + + @Log(title = "巡检检验结果明细", businessType = BusinessType.EXPORT) + @PostMapping("/exportXJDetail") + public void exportXJDetail(HttpServletResponse response, QcStaticTable qcStaticTable) { + List list = qcStaticTableService.exportXJDetail(qcStaticTable); + ExcelUtil util = new ExcelUtil(QcCheckDetail.class); + util.exportExcel(response, list, "巡检检验结果明细"); + } + + } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckDetail.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckDetail.java new file mode 100644 index 00000000..341ef0b8 --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckDetail.java @@ -0,0 +1,101 @@ +package com.op.quality.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.op.common.core.annotation.Excel; +import com.op.common.core.web.domain.BaseEntity; +import com.op.system.api.domain.quality.ChartDTO; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.HashMap; +import java.util.List; + +/** + * 质量系统报对象 明细 + * + * @author Open Platform + * @date 2024-8-27 + */ +public class QcCheckDetail extends BaseEntity { + @Excel(name = "单号") + private String orderNo; + @Excel(name = "单位编码") + private String supplierCode; + @Excel(name = "单位名称") + private String supplierName; + @Excel(name = "产品编码") + private String materialCode; + @Excel(name = "产品名称") + private String materialName; + @Excel(name = "检验结果",readConverterExp = "Y=合格,1=不合格") + private String checkResult; + @Excel(name = "缺陷描述") + private String className; + @Excel(name = "检验任务时间",dateFormat = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date incomeTime; + + public String getCheckResult() { + return checkResult; + } + + public void setCheckResult(String checkResult) { + this.checkResult = checkResult; + } + + public String getOrderNo() { + return orderNo; + } + + public void setOrderNo(String orderNo) { + this.orderNo = orderNo; + } + + public String getSupplierCode() { + return supplierCode; + } + + public void setSupplierCode(String supplierCode) { + this.supplierCode = supplierCode; + } + + public String getSupplierName() { + return supplierName; + } + + public void setSupplierName(String supplierName) { + this.supplierName = supplierName; + } + + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public String getClassName() { + return className; + } + + public void setClassName(String className) { + this.className = className; + } + + public Date getIncomeTime() { + return incomeTime; + } + + public void setIncomeTime(Date incomeTime) { + this.incomeTime = incomeTime; + } +} 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 7c39eb6d..782fd3bc 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.QcCheckDetail; import com.op.quality.domain.QcCheckType; import com.op.quality.domain.QcStaticTable; import com.op.system.api.domain.quality.FactoryDto; @@ -99,4 +100,8 @@ public interface QcStaticTableMapper { Map getNoOkPCNum(QcStaticTable qcStaticTable); List getTableHzNoOkDataSC(QcStaticTable qcStaticTable); + + List getIncomeDetail(QcStaticTable qcStaticTable); + + List getXJDetail(QcStaticTable qcStaticTable); } 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 e72c3456..1523b4c4 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 @@ -4,6 +4,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.op.quality.domain.QcCheckDetail; import com.op.quality.domain.QcCheckType; import com.op.quality.domain.QcStaticTable; import com.op.system.api.domain.quality.ChartSeriesDTO; @@ -62,4 +63,8 @@ public interface IQcStaticTableService { List getTableHzNoOkDataSC(QcStaticTable qcStaticTable); List getIncomeChartList(QcStaticTable qcStaticTable); + + List exportIncomeDetail(QcStaticTable qcStaticTable); + + List exportXJDetail(QcStaticTable qcStaticTable); } 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 f72755d3..8b430cae 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 @@ -795,6 +795,9 @@ public class QcCheckTaskIncomeServiceImpl implements String[] defectCodes = detail.getDefectCodes().split(","); String[] defectNames = detail.getDefectNames().split(","); String[] defectQualitys = detail.getDefectQualitys().split(","); + if(StringUtils.isBlank(detail.getClassTypeCodes())){ + detail.setClassTypeCodes(",");//为了防止前端不选缺陷描述 + } String[] classIds = detail.getClassTypeCodes().split(","); for(int d=0;d implements String[] defectCodes = detail.getDefectCodes().split(","); String[] defectNames = detail.getDefectNames().split(","); String[] defectQualitys = detail.getDefectQualitys().split(","); + if(StringUtils.isBlank(detail.getClassTypeCodes())){ + detail.setClassTypeCodes(",");//为了防止前端不选缺陷描述 + } String[] classIds = detail.getClassTypeCodes().split(","); for(int d=0;d exportIncomeDetail(QcStaticTable qcStaticTable) { + return qcStaticTableMapper.getIncomeDetail(qcStaticTable); + } + + @Override + @DS("#header.poolName") + public List exportXJDetail(QcStaticTable qcStaticTable) { + return qcStaticTableMapper.getXJDetail(qcStaticTable); + } + /** * 不良率 = (A类*1+B类*0.65+C类*0.35)/抽样总数 * 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 2dedd3c5..ca175a6b 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 @@ -797,4 +797,49 @@ group by t.class_name ) t0 order by noOkQuality desc + + diff --git a/op-modules/op-system/src/main/resources/mapper/system/SysUserMapper.xml b/op-modules/op-system/src/main/resources/mapper/system/SysUserMapper.xml index 6b316b1a..5ca38953 100644 --- a/op-modules/op-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/op-modules/op-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -81,10 +81,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND u.phonenumber like concat('%', #{phonenumber}, '%') - AND date_format(u.create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d') + and CONVERT(varchar(30),u.create_time, 120) >= CONVERT(varchar(30),#{params.beginTime}, 120) - AND date_format(u.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') + and CONVERT(varchar(30),u.create_time, 120) <= CONVERT(varchar(30),#{params.endTime}, 120) AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t