Browse Source

2026-03-10

订单产出标签统计增加数据汇总
master
fengyuan_yang 7 months ago
parent
commit
8acbf7f64e
  1. 3
      src/main/java/com/gaotao/modules/shopOrder/controller/ProductionReportController.java
  2. 2
      src/main/java/com/gaotao/modules/shopOrder/dao/ProductionReportMapper.java
  3. 5
      src/main/java/com/gaotao/modules/shopOrder/service/Impl/ProductionReportServiceImpl.java
  4. 2
      src/main/java/com/gaotao/modules/shopOrder/service/ProductionReportService.java
  5. 2
      src/main/resources/mapper/pms/QcMapper.xml
  6. 70
      src/main/resources/mapper/shopOrder/ProductionReportMapper.xml

3
src/main/java/com/gaotao/modules/shopOrder/controller/ProductionReportController.java

@ -189,9 +189,12 @@ public class ProductionReportController {
List<SFDCRollsOutData> result = productionReportService.searchSfdcRollsReport(indata);
// 查询总数
int total = productionReportService.searchSfdcRollsReportCount(indata);
// 查询汇总数据
SFDCRollsOutData summary = productionReportService.searchSfdcRollsReportSummary(indata);
map.put("success", true);
map.put("rows", result);
map.put("total", total);
map.put("summary", summary);
} catch (Exception e) {
map.put("success", false);
map.put("msg", e.getMessage());

2
src/main/java/com/gaotao/modules/shopOrder/dao/ProductionReportMapper.java

@ -148,5 +148,7 @@ public interface ProductionReportMapper {
int searchSfdcRollsReportCount(SFDCRollsOutData indata);
SFDCRollsOutData searchSfdcRollsReportSummary(SFDCRollsOutData indata);
void updateSfdcRollsAttribute(SFDCRollsOutData data);
}

5
src/main/java/com/gaotao/modules/shopOrder/service/Impl/ProductionReportServiceImpl.java

@ -189,6 +189,11 @@ public class ProductionReportServiceImpl implements ProductionReportService {
return count;
}
@Override
public SFDCRollsOutData searchSfdcRollsReportSummary(SFDCRollsOutData indata) {
return productionReportMapper.searchSfdcRollsReportSummary(indata);
}
@Override
public void updateSfdcRollsAttribute(List<SFDCRollsOutData> indata) {
for (SFDCRollsOutData data : indata) {

2
src/main/java/com/gaotao/modules/shopOrder/service/ProductionReportService.java

@ -118,6 +118,8 @@ public interface ProductionReportService {
int searchSfdcRollsReportCount(SFDCRollsOutData indata);
SFDCRollsOutData searchSfdcRollsReportSummary(SFDCRollsOutData indata);
void updateSfdcRollsAttribute(List<SFDCRollsOutData> indata);
/**

2
src/main/resources/mapper/pms/QcMapper.xml

@ -3952,7 +3952,7 @@
<where>
B.SITE IS NULL
AND A.status_tb = 0
and ISNULL(public_flag,'N') = 'Y'
and ISNULL(public_flag,'N') = 'N'
<if test="params.site != null and params.site != ''">
AND A.site = #{params.site}
</if>

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

@ -445,6 +445,76 @@
</if>
</select>
<!-- 查询订单产出标签汇总数据 -->
<select id="searchSfdcRollsReportSummary" resultType="com.gaotao.modules.rollNoReview.data.SFDCRollsOutData">
SELECT
ISNULL(SUM(A.RollQty), 0) AS rollQty,
ISNULL(SUM(ISNULL(R.good_qty, 0)), 0) AS goodQty,
ISNULL(SUM(ISNULL(R.surface_loss_qty, 0)), 0) AS surfaceLossQty,
ISNULL(SUM(ISNULL(R.poor_performance_qty, 0)), 0) AS poorPerformanceQty,
ISNULL(SUM(ISNULL(R.defect_qty, 0)), 0) AS defectQty,
ISNULL(SUM(ISNULL(R.total_qty, 0)), 0) AS totalQty
FROM SFDC_Rolls A
LEFT JOIN (SELECT OrderNo,SeqNo,ItemNo,StartDate, ReportDate,Reportedby,HistType,SITE,StartFromRollNo,RollNo ,ROW_NUMBER() OVER (PARTITION BY SITE, OrderNo, StartFromRollNo ORDER BY ReportDate DESC, SeqNo ASC) AS rn FROM SFDC_MaterialHist) B ON A.Site = B.SITE AND A.OrderNo = B.OrderNo AND A.RollNo = B.StartFromRollNo AND B.rn = 1
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
from ProductionReport
GROUP BY Site,order_no,roll_no,seq_no) R on r.Site = a.site and r.roll_no = a.RollNo
<where>
ISNULL(A.VirtualNewRollFlag,'Y') = 'N'
AND a.site in (select site from AccessSite where userID = #{userName})
<if test=" createdDate2 != null">
AND CONVERT(varchar(10), a.CreatedDate, 120) >= #{createdDate2}
</if>
<if test=" createdDate3 != null">
AND #{createdDate3} >= CONVERT(varchar(10), a.CreatedDate, 120)
</if>
<if test=" orderNo != null and orderNo != ''">
AND A.OrderNo like '%'+#{orderNo}+'%'
</if>
<if test=" createdOpsSeqNo != null and createdOpsSeqNo != '' and createdOpsSeqNo != 0">
AND CAST(A.CreatedOpsSeqNo AS VARCHAR) like '%'+CAST(#{createdOpsSeqNo} AS VARCHAR)+'%'
</if>
<if test=" createdOpsItemNo != null and createdOpsItemNo != '' and createdOpsItemNo != 0">
AND CAST(A.CreatedOpsItemNo AS VARCHAR) like '%'+CAST(#{createdOpsItemNo} AS VARCHAR)+'%'
</if>
<if test=" consumeOrderNo != null and consumeOrderNo != ''">
AND B.OrderNo like '%'+#{consumeOrderNo}+'%'
</if>
<if test=" consumeSeqNo != null and consumeSeqNo != ''">
AND CAST(B.SeqNo AS VARCHAR) like '%'+#{consumeSeqNo}+'%'
</if>
<if test=" consumeItemNo != null and consumeItemNo != ''">
AND CAST(B.ItemNo AS VARCHAR) like '%'+#{consumeItemNo}+'%'
</if>
<if test=" partNo != null and partNo != ''">
AND A.partNo like '%'+#{partNo}+'%'
</if>
<if test=" partDesc != null and partDesc != ''">
AND p.PartDescription like '%'+#{partDesc}+'%'
</if>
<if test=" spec != null and spec != ''">
AND p.Spec like '%'+#{spec}+'%'
</if>
<if test=" rollNo != null and rollNo != ''">
AND A.RollNo like '%'+#{rollNo}+'%'
</if>
<if test=" rollType != null and rollType != ''">
AND A.RollType = #{rollType}
</if>
</where>
</select>
<!-- 查询订单产出标签总数 -->
<select id="searchSfdcRollsReportCount" resultType="int">
SELECT COUNT(*)

Loading…
Cancel
Save