change - 发泡追溯报表

master
yinq 8 months ago
parent f3a52e3fa8
commit d0e058319c

@ -4,6 +4,8 @@ import com.aucma.common.core.controller.BaseController;
import com.aucma.common.core.domain.AjaxResult; import com.aucma.common.core.domain.AjaxResult;
import com.aucma.common.core.page.TableDataInfo; import com.aucma.common.core.page.TableDataInfo;
import com.aucma.report.domain.ProductTraceabilityReport;
import com.aucma.report.domain.boxTraceabilityReport;
import com.aucma.report.service.IProductionReportService; import com.aucma.report.service.IProductionReportService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -61,4 +63,17 @@ public class ProductionReportController extends BaseController {
} }
/**
*
* @param hashMap
* @return
*/
@GetMapping("/boxTraceabilityReport")
public TableDataInfo boxTraceabilityReport(@RequestParam(required = false) Map hashMap) {
startPage();
List<boxTraceabilityReport> list = productionReportService.boxTraceabilityReport(hashMap);
return getDataTable(list);
}
} }

@ -0,0 +1,181 @@
package com.aucma.report.domain;
import com.aucma.common.annotation.Excel;
import com.aucma.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
*
*
* @author Yinq
* @date 2024-03-15
*/
public class boxTraceabilityReport extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* SAP
*/
@Excel(name = "SAP订单编号")
@JsonProperty("ORDER_CODE")
private String ORDER_CODE;
/**
*
*/
@Excel(name = "销售订单编号")
@JsonProperty("SALEORDER_CODE")
private String SALEORDER_CODE;
/**
*
*/
@Excel(name = "销售订单行号")
@JsonProperty("SALEORDER_LINENUMBER")
private String SALEORDER_LINENUMBER;
/**
*
*/
@Excel(name = "物料编号")
@JsonProperty("MATERIAL_CODE")
private String MATERIAL_CODE;
/**
*
*/
@Excel(name = "产品型号")
@JsonProperty("MATERIAL_MODEL")
private String MATERIAL_MODEL;
/**
*
*/
@Excel(name = "订单数")
@JsonProperty("ORDER_AMOUNT")
private Long ORDER_AMOUNT;
/**
*
*/
@Excel(name = "泡前入库数")
@JsonProperty("BEFORE_NUMBER")
private Long BEFORE_NUMBER;
/**
* 线
*/
@Excel(name = "扫描下线数")
@JsonProperty("SCAN_NUMBER")
private Long SCAN_NUMBER;
/**
*
*/
@Excel(name = "差异数")
@JsonProperty("DIFF_NUMBER")
private Long DIFF_NUMBER;
/**
*
*/
@Excel(name = "报废数")
@JsonProperty("SCRAP_NUMBER")
private Long SCRAP_NUMBER;
public Long getDIFF_NUMBER() {
return DIFF_NUMBER;
}
public void setDIFF_NUMBER(Long DIFF_NUMBER) {
this.DIFF_NUMBER = DIFF_NUMBER;
}
public String getORDER_CODE() {
return ORDER_CODE;
}
public void setORDER_CODE(String ORDER_CODE) {
this.ORDER_CODE = ORDER_CODE;
}
public String getSALEORDER_LINENUMBER() {
return SALEORDER_LINENUMBER;
}
public void setSALEORDER_LINENUMBER(String SALEORDER_LINENUMBER) {
this.SALEORDER_LINENUMBER = SALEORDER_LINENUMBER;
}
public String getMATERIAL_CODE() {
return MATERIAL_CODE;
}
public void setMATERIAL_CODE(String MATERIAL_CODE) {
this.MATERIAL_CODE = MATERIAL_CODE;
}
public String getMATERIAL_MODEL() {
return MATERIAL_MODEL;
}
public void setMATERIAL_MODEL(String MATERIAL_MODEL) {
this.MATERIAL_MODEL = MATERIAL_MODEL;
}
public Long getORDER_AMOUNT() {
return ORDER_AMOUNT;
}
public void setORDER_AMOUNT(Long ORDER_AMOUNT) {
this.ORDER_AMOUNT = ORDER_AMOUNT;
}
public Long getBEFORE_NUMBER() {
return BEFORE_NUMBER;
}
public void setBEFORE_NUMBER(Long BEFORE_NUMBER) {
this.BEFORE_NUMBER = BEFORE_NUMBER;
}
public Long getSCAN_NUMBER() {
return SCAN_NUMBER;
}
public void setSCAN_NUMBER(Long SCAN_NUMBER) {
this.SCAN_NUMBER = SCAN_NUMBER;
}
public Long getSCRAP_NUMBER() {
return SCRAP_NUMBER;
}
public void setSCRAP_NUMBER(Long SCRAP_NUMBER) {
this.SCRAP_NUMBER = SCRAP_NUMBER;
}
public String getSALEORDER_CODE() {
return SALEORDER_CODE;
}
public void setSALEORDER_CODE(String SALEORDER_CODE) {
this.SALEORDER_CODE = SALEORDER_CODE;
}
@Override
public String toString() {
return "boxTraceabilityReport{" +
"ORDER_CODE='" + ORDER_CODE + '\'' +
", SALEORDER_CODE='" + SALEORDER_CODE + '\'' +
", ORDER_CODE='" + ORDER_CODE + '\'' +
", SALEORDER_LINENUMBER='" + SALEORDER_LINENUMBER + '\'' +
", MATERIAL_CODE='" + MATERIAL_CODE + '\'' +
", MATERIAL_MODEL='" + MATERIAL_MODEL + '\'' +
", ORDER_AMOUNT=" + ORDER_AMOUNT +
", BEFORE_NUMBER=" + BEFORE_NUMBER +
", SCAN_NUMBER=" + SCAN_NUMBER +
", SCRAP_NUMBER=" + SCRAP_NUMBER +
'}';
}
}

@ -1,6 +1,7 @@
package com.aucma.report.mapper; package com.aucma.report.mapper;
import com.aucma.report.domain.ProductTraceabilityReport; import com.aucma.report.domain.ProductTraceabilityReport;
import com.aucma.report.domain.boxTraceabilityReport;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -101,4 +102,11 @@ public interface GeneralReportMapper {
* @return * @return
*/ */
List<HashMap<String, Object>> productTraceabilityDetailList(Map hashMap); List<HashMap<String, Object>> productTraceabilityDetailList(Map hashMap);
/**
*
* @param hashMap
* @return
*/
List<boxTraceabilityReport> boxTraceabilityReport(Map hashMap);
} }

@ -1,6 +1,8 @@
package com.aucma.report.service; package com.aucma.report.service;
import com.aucma.report.domain.BasePdaRecord; import com.aucma.report.domain.BasePdaRecord;
import com.aucma.report.domain.ProductTraceabilityReport;
import com.aucma.report.domain.boxTraceabilityReport;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -43,5 +45,10 @@ public interface IProductionReportService
*/ */
List<HashMap<String, Object>> ScanOfflineRecordReportList(Map hashMap); List<HashMap<String, Object>> ScanOfflineRecordReportList(Map hashMap);
/**
*
* @param hashMap
* @return
*/
List<boxTraceabilityReport> boxTraceabilityReport(Map hashMap);
} }

@ -1,6 +1,7 @@
package com.aucma.report.service.impl; package com.aucma.report.service.impl;
import com.aucma.report.domain.BasePdaRecord; import com.aucma.report.domain.BasePdaRecord;
import com.aucma.report.domain.boxTraceabilityReport;
import com.aucma.report.mapper.GeneralReportMapper; import com.aucma.report.mapper.GeneralReportMapper;
import com.aucma.report.service.IProductionReportService; import com.aucma.report.service.IProductionReportService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -59,6 +60,15 @@ public class ProductionReportServiceImpl implements IProductionReportService {
return reportMapper.ScanOfflineRecordReportList(hashMap); return reportMapper.ScanOfflineRecordReportList(hashMap);
} }
/**
*
* @param hashMap
* @return
*/
@Override
public List<boxTraceabilityReport> boxTraceabilityReport(Map hashMap) {
return reportMapper.boxTraceabilityReport(hashMap);
}
} }

@ -281,7 +281,7 @@
ORDER BY RATE ORDER BY RATE
</select> </select>
<select id="productTraceabilityReportList" resultType="ProductTraceabilityReport" parameterType="java.util.HashMap"> <select id="productTraceabilityReportList" resultType="com.aucma.report.domain.ProductTraceabilityReport" parameterType="java.util.HashMap">
SELECT PL.PRODUCT_LINE_CODE, SELECT PL.PRODUCT_LINE_CODE,
PL.PRODUCT_LINE_NAME, PL.PRODUCT_LINE_NAME,
BO.ORDER_CODE, BO.ORDER_CODE,
@ -334,4 +334,39 @@
ORDER BY PL.EXECUTION_SORT, RQI.INSPECTOR_TIME ORDER BY PL.EXECUTION_SORT, RQI.INSPECTOR_TIME
</select> </select>
<select id="boxTraceabilityReport" resultType="com.aucma.report.domain.boxTraceabilityReport" parameterType="java.util.HashMap">
SELECT BO.ORDER_CODE,
BO.SALEORDER_CODE,
BO.SALEORDER_LINENUMBER,
BO.MATERIAL_CODE,
BM.MATERIAL_SPECIFICATIONS MATERIAL_MODEL,
BO.ORDER_AMOUNT,
NVL(OM.BEFORE_NUMBER, 0) BEFORE_NUMBER,
NVL(OL.SCAN_NUMBER, 0) SCAN_NUMBER,
NVL(OM.BEFORE_NUMBER - OL.SCAN_NUMBER, 0) DIFF_NUMBER,
NVL(BF.SCRAP_NUMBER, 0) SCRAP_NUMBER
FROM BASE_ORDERINFO BO
JOIN BASE_MATERIALINFO BM ON BM.MATERIAL_CODE = BO.MATERIAL_CODE AND bm.DISPO IN ('100')
JOIN (SELECT BC.ORDER_CODE, COUNT(*) BEFORE_NUMBER
FROM RECORD_INSTORE IE
JOIN C##AUCMA_SCADA.PRINT_BARCODE BC ON BC.MATERIAL_BARCODE = IE.MATERIAL_CODE
WHERE IE.STORE_CODE = 'PQK-001'
<if test="beginBeginTime != null and beginBeginTime != '' and endBeginTime != null and endBeginTime != ''">
AND TO_CHAR(IE.IN_STORE_TIME, 'YYYY-MM-DD HH24:MI:SS') BETWEEN #{beginBeginTime} AND #{endBeginTime}
</if>
GROUP BY BC.ORDER_CODE) OM ON OM.ORDER_CODE = BO.ORDER_CODE
LEFT JOIN (SELECT SUBSTR(PRODUCT_ORDER_NO, -8) ORDER_CODE, COUNT(*) SCAN_NUMBER
FROM C##AUCMA_SCADA.PRODUCT_OFFLINE
GROUP BY SUBSTR(PRODUCT_ORDER_NO, -8)) OL ON OL.ORDER_CODE = BO.ORDER_CODE
LEFT JOIN (SELECT ORDER_CODE, SUM(SCRAP_NUMBER) SCRAP_NUMBER
FROM (
SELECT BC.ORDER_CODE,
QI.BAR_CODE,
MAX(CASE WHEN QI.PROCESS_RESULT = '报废重做' THEN 1 ELSE 0 END) SCRAP_NUMBER
FROM REPORT_QUALITY_INSPECTION QI
JOIN C##AUCMA_SCADA.PRINT_BARCODE BC ON BC.MATERIAL_BARCODE = QI.BAR_CODE
GROUP BY BC.ORDER_CODE, QI.BAR_CODE)
GROUP BY ORDER_CODE) BF ON BF.ORDER_CODE = BO.ORDER_CODE
</select>
</mapper> </mapper>

Loading…
Cancel
Save