change - 在制品查询明细功能、导出

master
yinq 7 months ago
parent 11b7689360
commit e62281134e

@ -97,6 +97,30 @@ public class ProductionReportController extends BaseController {
util.exportExcel(response, list, "清单率报表" );
}
/**
*
*/
@GetMapping("/WIPInquiryDetailReportList")
public TableDataInfo WIPInquiryDetailReportList(@RequestParam(required = false) Map hashMap) {
startPage();
List<WIPInquiryDetailReport> list = productionReportService.WIPInquiryDetailReportList(hashMap);
return getDataTable(list);
}
/**
*
* @param hashMap
* @return
*/
@PostMapping("/WIPInquiryDetailReportList/export")
public void WIPInquiryDetailReportListExport(HttpServletResponse response, @RequestParam(required = false) Map hashMap) {
hashMap.put("pageNum",null);
hashMap.put("pageSize",null);
List<WIPInquiryDetailReport> list = productionReportService.WIPInquiryDetailReportList(hashMap);
ExcelUtil<WIPInquiryDetailReport> util = new ExcelUtil<>(WIPInquiryDetailReport. class);
util.exportExcel(response, 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 WIPInquiryDetailReport extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 线
*/
@Excel(name = "产线编号")
@JsonProperty("PRODUCT_LINE_CODE")
private String PRODUCT_LINE_CODE;
/**
* 线
*/
@Excel(name = "产线名称")
@JsonProperty("PRODUCT_LINE_NAME")
private String PRODUCT_LINE_NAME;
/**
* SAP
*/
@Excel(name = "SAP订单编号")
@JsonProperty("ORDER_CODE")
private String ORDER_CODE;
/**
*
*/
@Excel(name = "物料编号")
@JsonProperty("MATERIAL_CODE")
private String MATERIAL_CODE;
/**
*
*/
@Excel(name = "物料名称")
@JsonProperty("MATERIAL_NAME")
private String MATERIAL_NAME;
/**
*
*/
@Excel(name = "产品编码")
@JsonProperty("PRODUCT_CODE")
private String PRODUCT_CODE;
/**
*
*/
@Excel(name = "产品名称")
@JsonProperty("PRODUCT_NAME")
private String PRODUCT_NAME;
/**
*
*/
@Excel(name = "箱体码")
@JsonProperty("MATERIAL_BARCODE")
private String MATERIAL_BARCODE;
/**
*
*/
@Excel(name = "最后扫描工位")
@JsonProperty("STATION_NAME")
private String STATION_NAME;
/**
*
*/
@Excel(name = "最后扫描时间")
@JsonProperty("COMPLETE_DATE")
private String COMPLETE_DATE;
public String getPRODUCT_LINE_CODE() {
return PRODUCT_LINE_CODE;
}
public void setPRODUCT_LINE_CODE(String PRODUCT_LINE_CODE) {
this.PRODUCT_LINE_CODE = PRODUCT_LINE_CODE;
}
public String getPRODUCT_LINE_NAME() {
return PRODUCT_LINE_NAME;
}
public void setPRODUCT_LINE_NAME(String PRODUCT_LINE_NAME) {
this.PRODUCT_LINE_NAME = PRODUCT_LINE_NAME;
}
public String getORDER_CODE() {
return ORDER_CODE;
}
public void setORDER_CODE(String ORDER_CODE) {
this.ORDER_CODE = ORDER_CODE;
}
public String getMATERIAL_CODE() {
return MATERIAL_CODE;
}
public void setMATERIAL_CODE(String MATERIAL_CODE) {
this.MATERIAL_CODE = MATERIAL_CODE;
}
public String getMATERIAL_NAME() {
return MATERIAL_NAME;
}
public void setMATERIAL_NAME(String MATERIAL_NAME) {
this.MATERIAL_NAME = MATERIAL_NAME;
}
public String getPRODUCT_CODE() {
return PRODUCT_CODE;
}
public void setPRODUCT_CODE(String PRODUCT_CODE) {
this.PRODUCT_CODE = PRODUCT_CODE;
}
public String getPRODUCT_NAME() {
return PRODUCT_NAME;
}
public void setPRODUCT_NAME(String PRODUCT_NAME) {
this.PRODUCT_NAME = PRODUCT_NAME;
}
public String getMATERIAL_BARCODE() {
return MATERIAL_BARCODE;
}
public void setMATERIAL_BARCODE(String MATERIAL_BARCODE) {
this.MATERIAL_BARCODE = MATERIAL_BARCODE;
}
public String getSTATION_NAME() {
return STATION_NAME;
}
public void setSTATION_NAME(String STATION_NAME) {
this.STATION_NAME = STATION_NAME;
}
public String getCOMPLETE_DATE() {
return COMPLETE_DATE;
}
public void setCOMPLETE_DATE(String COMPLETE_DATE) {
this.COMPLETE_DATE = COMPLETE_DATE;
}
@Override
public String toString() {
return "WIPInquiryDetailReport{" +
"PRODUCT_LINE_CODE='" + PRODUCT_LINE_CODE + '\'' +
", PRODUCT_LINE_NAME='" + PRODUCT_LINE_NAME + '\'' +
", ORDER_CODE='" + ORDER_CODE + '\'' +
", MATERIAL_CODE='" + MATERIAL_CODE + '\'' +
", MATERIAL_NAME='" + MATERIAL_NAME + '\'' +
", PRODUCT_CODE='" + PRODUCT_CODE + '\'' +
", PRODUCT_NAME='" + PRODUCT_NAME + '\'' +
", MATERIAL_BARCODE='" + MATERIAL_BARCODE + '\'' +
", STATION_NAME='" + STATION_NAME + '\'' +
", COMPLETE_DATE='" + COMPLETE_DATE + '\'' +
'}';
}
}

@ -66,9 +66,9 @@ public class WIPInquiryReport extends BaseEntity {
private String PRODUCT_NAME;
/**
*
*
*/
@Excel(name = "数量")
@Excel(name = "在制数量")
@JsonProperty("COMP_AMOUNT")
private Long COMP_AMOUNT;

@ -136,4 +136,11 @@ public interface GeneralReportMapper {
* @return
*/
List<BoxTurnoverTraceabilityDetailReport> boxTurnoverTraceabilityDetailReportList(Map hashMap);
/**
*
* @param hashMap
* @return
*/
List<WIPInquiryDetailReport> WIPInquiryDetailReportList(Map hashMap);
}

@ -70,4 +70,11 @@ public interface IProductionReportService
* @return
*/
List<BoxTurnoverTraceabilityDetailReport> boxTurnoverTraceabilityDetailReportList(Map hashMap);
/**
*
* @param hashMap
* @return
*/
List<WIPInquiryDetailReport> WIPInquiryDetailReportList(Map hashMap);
}

@ -99,4 +99,14 @@ public class ProductionReportServiceImpl implements IProductionReportService {
return reportMapper.boxTurnoverTraceabilityDetailReportList(hashMap);
}
/**
*
* @param hashMap
* @return
*/
@Override
public List<WIPInquiryDetailReport> WIPInquiryDetailReportList(Map hashMap) {
return reportMapper.WIPInquiryDetailReportList(hashMap);
}
}

@ -87,26 +87,32 @@
BO.MATERIAL_NAME PRODUCT_NAME,
COUNT(*) COMP_AMOUNT
FROM (
SELECT PB.ORDER_CODE, VMC.MATERIAL_BARCODE, BM.MATERIAL_CODE, BM.MATERIAL_NAME
SELECT PB.ORDER_CODE,
BM.MATERIAL_CODE,
BM.MATERIAL_NAME,
VMC.MATERIAL_BARCODE,
MAX(BE.EXECUTION_SORT) EXECUTION_SORT,
MAX(COMPLETE_DATE) COMPLETE_DATE
FROM C##AUCMA_SCADA.MATERIAL_COMPLETION VMC
LEFT JOIN BASE_PRODUCTLINE BP ON BP.PRODUCT_LINE_CODE = VMC.STATION_NAME
LEFT JOIN C##AUCMA_SCADA.PRINT_BARCODE PB ON VMC.MATERIAL_BARCODE = PB.MATERIAL_BARCODE AND PRINT_BARTYPE = 1
LEFT JOIN C##AUCMA_SCADA.PRODUCT_OFFLINE PO ON PO.BOX_CODE = PB.MATERIAL_BARCODE
JOIN RECORD_INSTORE IE ON IE.STORE_CODE = 'PQK-001' AND VMC.MATERIAL_BARCODE = IE.BARCODE_CODE
LEFT JOIN BASE_PRODUCTLINE BE ON BE.PRODUCT_LINE_CODE = VMC.STATION_NAME
LEFT JOIN C##AUCMA_SCADA.PRINT_BARCODE PB
ON PRINT_BARTYPE = 1 AND VMC.MATERIAL_BARCODE = PB.MATERIAL_BARCODE
LEFT JOIN BASE_MATERIALINFO BM ON BM.MATERIAL_CODE = PB.MATERIAL_CODE
LEFT JOIN C##AUCMA_SCADA.PRODUCT_OFFLINE PO ON PO.BOX_CODE = PB.MATERIAL_BARCODE
WHERE PB.MATERIAL_BARCODE IS NOT NULL
AND PO.BOX_CODE IS NULL
AND VMC.COMPLETE_DATE > (SYSDATE - 3)
-- AND VMC.COMPLETE_DATE > (SYSDATE - 7)
<if test="beginStationCode != null and beginStationCode != ''">
AND BP.EXECUTION_SORT >= #{beginStationCode}
AND BE.EXECUTION_SORT >= #{beginStationCode}
</if>
<if test="endStationCode != null and endStationCode != ''">
AND #{endStationCode} > BP.EXECUTION_SORT
AND #{endStationCode} > BE.EXECUTION_SORT
</if>
GROUP BY PB.ORDER_CODE, VMC.MATERIAL_BARCODE, BM.MATERIAL_CODE, BM.MATERIAL_NAME
GROUP BY PB.ORDER_CODE, BM.MATERIAL_CODE, BM.MATERIAL_NAME, VMC.MATERIAL_BARCODE
) SD
LEFT JOIN BASE_ORDERINFO BO ON BO.ORDER_CODE = SD.ORDER_CODE
LEFT JOIN BASE_PRODUCTLINE B2 ON B2.WORK_CENTER_CODE = BO.WORK_CENTER_CODE
LEFT JOIN BASE_MATERIALINFO BM ON BM.MATERIAL_CODE = BO.MATERIAL_CODE
<where>
<if test="productLineCode != null and productLineCode != ''">
AND B2.PRODUCT_LINE_CODE = #{productLineCode}
@ -608,4 +614,61 @@
ORDER BY MC.COMPLETE_DATE
</select>
<select id="WIPInquiryDetailReportList" resultType="com.aucma.report.domain.WIPInquiryDetailReport"
parameterType="java.util.HashMap">
SELECT B2.PRODUCT_LINE_CODE,
B2.PRODUCT_LINE_NAME,
SD.ORDER_CODE,
SD.MATERIAL_CODE,
SD.MATERIAL_NAME,
BO.MATERIAL_CODE PRODUCT_CODE,
BO.MATERIAL_NAME PRODUCT_NAME,
SD.MATERIAL_BARCODE,
ST.PRODUCT_LINE_NAME STATION_NAME,
SD.COMPLETE_DATE
FROM (
SELECT PB.ORDER_CODE,
BM.MATERIAL_CODE,
BM.MATERIAL_NAME,
VMC.MATERIAL_BARCODE,
MAX(BE.EXECUTION_SORT) EXECUTION_SORT,
TO_CHAR(MAX(COMPLETE_DATE), 'YYYY-MM-DD HH24:MI:SS') COMPLETE_DATE
FROM C##AUCMA_SCADA.MATERIAL_COMPLETION VMC
JOIN RECORD_INSTORE IE ON IE.STORE_CODE = 'PQK-001' AND VMC.MATERIAL_BARCODE = IE.BARCODE_CODE
LEFT JOIN BASE_PRODUCTLINE BE ON BE.PRODUCT_LINE_CODE = VMC.STATION_NAME
LEFT JOIN C##AUCMA_SCADA.PRINT_BARCODE PB
ON PRINT_BARTYPE = 1 AND VMC.MATERIAL_BARCODE = PB.MATERIAL_BARCODE
LEFT JOIN BASE_MATERIALINFO BM ON BM.MATERIAL_CODE = PB.MATERIAL_CODE
LEFT JOIN C##AUCMA_SCADA.PRODUCT_OFFLINE PO ON PO.BOX_CODE = PB.MATERIAL_BARCODE
WHERE PB.MATERIAL_BARCODE IS NOT NULL
AND PO.BOX_CODE IS NULL
-- AND VMC.COMPLETE_DATE > (SYSDATE - 7)
<if test="beginStationCode != null and beginStationCode != ''">
AND BE.EXECUTION_SORT >= #{beginStationCode}
</if>
<if test="endStationCode != null and endStationCode != ''">
AND #{endStationCode} > BE.EXECUTION_SORT
</if>
GROUP BY PB.ORDER_CODE, BM.MATERIAL_CODE, BM.MATERIAL_NAME, VMC.MATERIAL_BARCODE
) SD
LEFT JOIN BASE_ORDERINFO BO ON BO.ORDER_CODE = SD.ORDER_CODE
LEFT JOIN BASE_PRODUCTLINE B2 ON B2.WORK_CENTER_CODE = BO.WORK_CENTER_CODE
LEFT JOIN BASE_PRODUCTLINE ST ON ST.EXECUTION_SORT = SD.EXECUTION_SORT
<where>
<if test="productLineCode != null and productLineCode != ''">
AND B2.PRODUCT_LINE_CODE = #{productLineCode}
</if>
<if test="ORDER_CODE != null and ORDER_CODE != ''">
and SD.ORDER_CODE = #{ORDER_CODE}
</if>
<if test="PRODUCT_CODE != null and PRODUCT_CODE != ''">
and BO.MATERIAL_CODE = #{PRODUCT_CODE}
</if>
<if test="PRODUCT_NAME != null and PRODUCT_NAME != ''">
and BO.MATERIAL_NAME like concat(concat('%', #{PRODUCT_NAME}), '%')
</if>
</where>
ORDER BY SD.COMPLETE_DATE
</select>
</mapper>

Loading…
Cancel
Save