检验明细结果导出

master
zhaoxiaolin 7 months ago
parent 442fb1831f
commit cf85447bdb

@ -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 = "产线编码")

@ -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

@ -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<QcStaticTable> getTableHzNoOkDataSC(@RequestBody QcStaticTable qcStaticTable) {
return qcStaticTableService.getTableHzNoOkDataSC(qcStaticTable);
}
@Log(title = "来料检验结果明细", businessType = BusinessType.EXPORT)
@PostMapping("/exportIncomeDetail")
public void exportIncomeDetail(HttpServletResponse response, QcStaticTable qcStaticTable) {
List<QcCheckDetail> list = qcStaticTableService.exportIncomeDetail(qcStaticTable);
ExcelUtil<QcCheckDetail> util = new ExcelUtil<QcCheckDetail>(QcCheckDetail.class);
util.exportExcel(response, list, "检验结果明细");
}
@Log(title = "巡检检验结果明细", businessType = BusinessType.EXPORT)
@PostMapping("/exportXJDetail")
public void exportXJDetail(HttpServletResponse response, QcStaticTable qcStaticTable) {
List<QcCheckDetail> list = qcStaticTableService.exportXJDetail(qcStaticTable);
ExcelUtil<QcCheckDetail> util = new ExcelUtil<QcCheckDetail>(QcCheckDetail.class);
util.exportExcel(response, list, "巡检检验结果明细");
}
}

@ -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;
}
}

@ -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<String, QcStaticTable> getNoOkPCNum(QcStaticTable qcStaticTable);
List<QcStaticTable> getTableHzNoOkDataSC(QcStaticTable qcStaticTable);
List<QcCheckDetail> getIncomeDetail(QcStaticTable qcStaticTable);
List<QcCheckDetail> getXJDetail(QcStaticTable qcStaticTable);
}

@ -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<QcStaticTable> getTableHzNoOkDataSC(QcStaticTable qcStaticTable);
List<QcStaticTable> getIncomeChartList(QcStaticTable qcStaticTable);
List<QcCheckDetail> exportIncomeDetail(QcStaticTable qcStaticTable);
List<QcCheckDetail> exportXJDetail(QcStaticTable qcStaticTable);
}

@ -795,6 +795,9 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> 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<defectCodes.length;d++){
defect = new QcCheckTaskDefect();
@ -926,6 +929,9 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> 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<defectCodes.length;d++){
defect = new QcCheckTaskDefect();

@ -14,9 +14,7 @@ import java.util.stream.Collectors;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.StringUtils;
import com.op.quality.domain.BaseFile;
import com.op.quality.domain.QcCheckTaskDetail;
import com.op.quality.domain.QcCheckType;
import com.op.quality.domain.*;
import com.op.quality.mapper.QMSFileMapper;
import com.op.system.api.domain.quality.ChartDTO;
import com.op.system.api.domain.quality.ChartSeriesDTO;
@ -24,7 +22,6 @@ import com.op.system.api.domain.quality.FactoryDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.quality.mapper.QcStaticTableMapper;
import com.op.quality.domain.QcStaticTable;
import com.op.quality.service.IQcStaticTableService;
import org.springframework.util.CollectionUtils;
@ -179,6 +176,18 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
return tabledtos;
}
@Override
@DS("#header.poolName")
public List<QcCheckDetail> exportIncomeDetail(QcStaticTable qcStaticTable) {
return qcStaticTableMapper.getIncomeDetail(qcStaticTable);
}
@Override
@DS("#header.poolName")
public List<QcCheckDetail> exportXJDetail(QcStaticTable qcStaticTable) {
return qcStaticTableMapper.getXJDetail(qcStaticTable);
}
/**
* = (A*1+B*0.65+C*0.35)/
*

@ -797,4 +797,49 @@
group by t.class_name
) t0 order by noOkQuality desc
</select>
<select id="getIncomeDetail" resultType="com.op.quality.domain.QcCheckDetail">
select qct.income_time incomeTime,
qct.order_no orderNo,
qct.check_result checkResult,
qct.supplier_code supplierCode,
qct.supplier_name supplierName,
qct.material_code materialCode,
qct.material_name materialName,
qct.remark_code classCode,
qdtc.class_name className
from qc_check_task qct
left join qc_defect_type_class qdtc on qct.remark_code = qdtc.id
where qct.check_type = #{checkType} and qct.check_status = '2'
and qdtc.del_flag = '0' and qct.del_flag = '0'
<if test="ymdms == 'yyyy'">
and CONVERT(varchar(4),qct.create_time, 120) = #{incomeTimeStr}
</if>
<if test="ymdms == 'mm'">
and CONVERT(varchar(7),qct.create_time, 120) = #{incomeTimeStr}
</if>
<if test="ymdms == 'mm'">
and CONVERT(varchar(10),qct.create_time, 120) = #{incomeTimeStr}
</if>
</select>
<select id="getXJDetail" resultType="com.op.quality.domain.QcCheckDetail">
select
qct.income_time incomeTime,
qct.order_no orderNo,
qct.check_result checkResult,
qct.supplier_code supplierCode,
qct.supplier_name supplierName,
qct.material_code materialCode,
qct.material_name materialName,
qdtc.id classCode,
qdtc.class_name className
from qc_check_task qct
left join qc_check_task_defect qctd on qctd.belong_to = qct.record_id
left join qc_defect_type_class qdtc on qctd.class_id = qdtc.id
where qct.check_type = #{checkType} and qct.check_status = '2'
<if test="ymdms == 'yyyy'">and CONVERT(varchar(4),qct.create_time, 120) = #{incomeTimeStr}</if>
<if test="ymdms == 'mm'">and CONVERT(varchar(7),qct.create_time, 120) = #{incomeTimeStr}</if>
<if test="ymdms == 'dd'"> and CONVERT(varchar(10),qct.create_time, 120) = #{incomeTimeStr}</if>
and qct.del_flag = '0' and qdtc.del_flag = '0' and qctd.del_flag = '0'
order by qct.order_no,qct.income_time
</select>
</mapper>

@ -81,10 +81,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND u.phonenumber like concat('%', #{phonenumber}, '%')
</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND date_format(u.create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
and CONVERT(varchar(30),u.create_time, 120) >= CONVERT(varchar(30),#{params.beginTime}, 120)
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND date_format(u.create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
and CONVERT(varchar(30),u.create_time, 120) &lt;= CONVERT(varchar(30),#{params.endTime}, 120)
</if>
<if test="deptId != null and deptId != 0">
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t

Loading…
Cancel
Save