不良率综合统计报表

master
zhaoxiaolin 1 year ago
parent 969897968c
commit ba9216c14a

@ -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.QcCheckProject;
import com.op.quality.domain.QcCheckType;
import com.op.system.api.domain.quality.ChartDTO;
import com.op.system.api.domain.quality.ChartSeriesDTO;
@ -233,6 +234,12 @@ public class QcStaticTableController extends BaseController {
public List<QcCheckType> getCheckTypeList(@PathVariable("typeCode") String typeCode) {
return qcStaticTableService.getCheckTypeList(typeCode);
}
@GetMapping("/getSupplierList/{typeCode}")
public List<QcStaticTable> getSupplierList(@PathVariable("typeCode") String typeCode) {
return qcStaticTableService.getSupplierList(typeCode);
}
/**
*
*/
@ -290,4 +297,20 @@ public class QcStaticTableController extends BaseController {
return getDataTable(list);
}
@PostMapping("/exportProduceAnalysis")
public void exportProduceAnalysis(HttpServletResponse response, 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);
}
List<QcStaticTable> list = qcStaticTableService.getQmsRateTable(qcStaticTable);
ExcelUtil<QcStaticTable> util = new ExcelUtil<QcStaticTable>(QcStaticTable.class);
util.exportExcel(response, list, "质检不良统计");
}
}

@ -21,10 +21,10 @@ public class QcStaticTable extends BaseEntity {
private String supplierId;
@Excel(name = "供应商编号")
@Excel(name = "单位编码")
private String supplierCode;
@Excel(name = "供应商名称")
@Excel(name = "单位名称")
private String supplierName;
private List<String> supplierCodes;
@ -36,19 +36,34 @@ public class QcStaticTable extends BaseEntity {
private int noOkBatchs;
private int nums;
private int okNums;
private int noOkNums;
private String typeCode;
private String checkResult;
private String noOkBatchRate;
private String noOkNumRate;
private String ymArrayStart;
private String ymArrayEnd;
private List<String> legendData;
private List<String> xAxis;
private List<ChartDTO> series;
@Excel(name = "订单编码")
private String orderNo;
@Excel(name = "批次")
private String incomeBatchNo;
@Excel(name = "产品编码")
private String materialCode;
@Excel(name = "产品名称")
private String materialName;
@Excel(name = "数量")
private String quality;
@Excel(name = "单位")
private String unit;
@Excel(name = "抽样数量")
private String sampleQuality;
@Excel(name = "不良数量")
private int noOkNums;
@Excel(name = "不良比例")
private String noOkNumRate;
private BigDecimal aNoOkquality;
private BigDecimal bNoOkquality;
private BigDecimal cNoOkquality;
@ -59,10 +74,7 @@ public class QcStaticTable extends BaseEntity {
private String recordId;
private String checkNo;
private String orderNo;
private String incomeBatchNo;
private String quality;
private String unit;
@JsonFormat(pattern = "yyyy-MM-dd")
private Date incomeTime;
private String checkManCode;

@ -56,4 +56,10 @@ public interface QcStaticTableMapper {
List<QcStaticTable> getQmsRateTable(QcStaticTable qcStaticTable);
List<QcCheckType> getCheckTypeList(String typeCode);
List<QcStaticTable> getSupplier();
List<QcStaticTable> getLocList();
List<QcStaticTable> getWorkcenter();
}

@ -41,4 +41,6 @@ public interface IQcStaticTableService {
List<QcStaticTable> getQmsRateTable(QcStaticTable qcStaticTable);
List<QcCheckType> getCheckTypeList(String typeCode);
List<QcStaticTable> getSupplierList(String typeCode);
}

@ -354,6 +354,23 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
return qcStaticTableMapper.getCheckTypeList(typeCode);
}
@Override
@DS("#header.poolName")
public List<QcStaticTable> getSupplierList(String typeCode) {
List<QcStaticTable> dtos = null;
if("produce".equals(typeCode)){
//工作中心
dtos = qcStaticTableMapper.getWorkcenter();
}else if("product".equals(typeCode)){
//仓库
dtos = qcStaticTableMapper.getLocList();
}else if("material".equals(typeCode)){
//供应商
dtos = qcStaticTableMapper.getSupplier();
}
return dtos;
}
private List<String> getHourProductionTitle(QcStaticTable qcStaticTable) {
// 返回的日期集合

@ -212,4 +212,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from qc_check_type
where del_flag = '0' and type_code= #{typeCode}
</select>
<select id="getSupplier" resultType="com.op.quality.domain.QcStaticTable">
select supplier_code supplierCode,
zh_desc supplierName
from base_supplier where del_flag = '0'
</select>
<select id="getLocList" resultType="com.op.quality.domain.QcStaticTable">
select warehouse_code supplierCode,
warehouse_name supplierName
from base_warehouse
where del_flag = '0' and active_flag = '1'
</select>
<select id="getWorkcenter" resultType="com.op.quality.domain.QcStaticTable">
select factory_name supplierName,
factory_code supplierCode
from sys_factory where f_type = 'c'
</select>
</mapper>

Loading…
Cancel
Save