Browse Source

2025-11-17

订单产出标签报表
master
fengyuan_yang 2 months ago
parent
commit
647954d31d
  1. 55
      src/main/java/com/gaotao/modules/rollNoReview/data/SFDCRollsOutData.java
  2. 25
      src/main/resources/mapper/shopOrder/ProductionReportMapper.xml

55
src/main/java/com/gaotao/modules/rollNoReview/data/SFDCRollsOutData.java

@ -3,6 +3,7 @@ package com.gaotao.modules.rollNoReview.data;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.util.Date; import java.util.Date;
@ -62,6 +63,60 @@ public class SFDCRollsOutData {
private String partNo; private String partNo;
private String partDesc; private String partDesc;
private String spec; private String spec;
private Integer goodQty;
private Integer surfaceLossQty;
private Integer poorPerformanceQty;
private Integer defectQty;
private Integer totalQty;
private BigDecimal yieldRate;
public Integer getGoodQty() {
return goodQty;
}
public void setGoodQty(Integer goodQty) {
this.goodQty = goodQty;
}
public Integer getSurfaceLossQty() {
return surfaceLossQty;
}
public void setSurfaceLossQty(Integer surfaceLossQty) {
this.surfaceLossQty = surfaceLossQty;
}
public Integer getPoorPerformanceQty() {
return poorPerformanceQty;
}
public void setPoorPerformanceQty(Integer poorPerformanceQty) {
this.poorPerformanceQty = poorPerformanceQty;
}
public Integer getDefectQty() {
return defectQty;
}
public void setDefectQty(Integer defectQty) {
this.defectQty = defectQty;
}
public Integer getTotalQty() {
return totalQty;
}
public void setTotalQty(Integer totalQty) {
this.totalQty = totalQty;
}
public BigDecimal getYieldRate() {
return yieldRate;
}
public void setYieldRate(BigDecimal yieldRate) {
this.yieldRate = yieldRate;
}
public String getPartNo() { public String getPartNo() {
return partNo; return partNo;

25
src/main/resources/mapper/shopOrder/ProductionReportMapper.xml

@ -266,10 +266,33 @@
B.HistType, B.HistType,
a.partNo, a.partNo,
p.PartDescription AS partDesc, p.PartDescription AS partDesc,
p.Spec AS spec
p.Spec AS spec ,
a.partNo,
p.PartDescription,
p.Spec,
ISNULL(R.good_qty, 0) as goodQty,
ISNULL(R.surface_loss_qty, 0) as surfaceLossQty,
ISNULL(R.poor_performance_qty, 0) as poorPerformanceQty,
ISNULL(R.defect_qty, 0) as defectQty,
ISNULL(R.total_qty, 0) as totalQty,
round(isnull(yieldRate, 100), 2) as yieldRate
FROM SFDC_Rolls A FROM SFDC_Rolls A
LEFT JOIN SFDC_MaterialHist B ON A.Site = B.SITE AND A.OrderNo = B.OrderNo AND A.RollNo = B.StartFromRollNo LEFT JOIN SFDC_MaterialHist B ON A.Site = B.SITE AND A.OrderNo = B.OrderNo AND A.RollNo = B.StartFromRollNo
left join part p on a.site = p.site and a.partNo = p.partNo left join part p on a.site = p.site and a.partNo = p.partNo
LEFT JOIN (
select
site,
order_no,
roll_no,
seq_no,
SUM(good_qty) as good_qty,
SUM(surface_loss_qty) as surface_loss_qty,
SUM(poor_performance_qty) as poor_performance_qty,
SUM(defect_qty) as defect_qty,
SUM(total_qty) as total_qty,
CASE WHEN SUM(total_qty) = 0 THEN NULL ELSE 100.0 * SUM(good_qty) / SUM(total_qty) END AS yieldRate
from ProductionReport
GROUP BY Site,order_no,roll_no,seq_no) R on r.Site = a.site and r.roll_no = a.RollNo
<where> <where>
a.CreatedDate >= #{createdDate2} a.CreatedDate >= #{createdDate2}
<if test=" createdDate3 != null"> <if test=" createdDate3 != null">

Loading…
Cancel
Save