diff --git a/src/main/java/com/heai/common/aop/RepeatSubmitAspect.java b/src/main/java/com/heai/common/aop/RepeatSubmitAspect.java
index b8277b9..c6060e4 100644
--- a/src/main/java/com/heai/common/aop/RepeatSubmitAspect.java
+++ b/src/main/java/com/heai/common/aop/RepeatSubmitAspect.java
@@ -60,7 +60,7 @@ public class RepeatSubmitAspect {
caches.put(key, key);
}else {
HttpServletResponse response = attributes.getResponse();
- throw new RuntimeException("请勿重复提交!");
+ throw new RuntimeException("请勿重复提交!等待十秒后再次操作。");
//response.sendError(500, "重复提交!");
//return response;
}
diff --git a/src/main/java/com/heai/modules/production/entity/SfdcCancel.java b/src/main/java/com/heai/modules/production/entity/SfdcCancel.java
index 9109876..c26230f 100644
--- a/src/main/java/com/heai/modules/production/entity/SfdcCancel.java
+++ b/src/main/java/com/heai/modules/production/entity/SfdcCancel.java
@@ -24,6 +24,7 @@ public class SfdcCancel {
private String defectCode;
private Double defectQty;
private String workCenterNo;
+ private String scrapFlag;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date reportDate;
diff --git a/src/main/java/com/heai/modules/production/service/impl/DailyPlanServiceImpl.java b/src/main/java/com/heai/modules/production/service/impl/DailyPlanServiceImpl.java
index 5e31b2b..cbcf38b 100644
--- a/src/main/java/com/heai/modules/production/service/impl/DailyPlanServiceImpl.java
+++ b/src/main/java/com/heai/modules/production/service/impl/DailyPlanServiceImpl.java
@@ -708,6 +708,13 @@ public class DailyPlanServiceImpl implements DailyPlanService {
reportData.setStrQty(inData.getQtyApprove());
reportData.setWeight(inData.getApproveWeight());
reportData.setRemark(inData.getRemark());
+ if("Y".equals(inData.getClosedFlag())){
+ SOScheduledRoutingOutData closeData=new SOScheduledRoutingOutData();
+ closeData.setSite(inData.getSite());
+ closeData.setSeqNo(inData.getSeqNo());
+ dailyPlanMapper.closeSchedule(closeData);
+ }
+
return R.ok().put("msg","操作成功!").put("transData",transData).put("badData",badData).put("reportData",reportData);
}
@Override
diff --git a/src/main/resources/mapper/production/DailyPlanMapper.xml b/src/main/resources/mapper/production/DailyPlanMapper.xml
index 8683672..9a27e20 100644
--- a/src/main/resources/mapper/production/DailyPlanMapper.xml
+++ b/src/main/resources/mapper/production/DailyPlanMapper.xml
@@ -1096,6 +1096,9 @@
and b.RepairSOFlag like #{repairSOFlag}
+
+ and case when a.ReportQty!=0 then Round((a.ReportQty-a.ApproveQty)*100/a.ReportQty,2) else 0 end >a.c_sys_scrap_rate
+
order by a.ReportDate desc
@@ -1321,21 +1324,37 @@
where ReportedManfTime>12 and a.AssJobSeqNo is not null
union all
- select site 工厂编码,SeqNo 派工单号,开工时间,null as 报工时间,null as 上道报工时间,null as 开工间隔
- ,null as 生产时间,领料重量,[48小时报工重量],null as 完成率,'报工重量不足' as 备注
- from
- (
- select a1.site,a1.SeqNo,a1.PreviousSeqNo,a1.开工时间,a1.S_ScheduledDate,isnull(a3.QtyApprove*dbo.Get_Part_NetWeight(a3.Site,a3.partNo)/1000.0,0) 领料重量,sum(ApproveQty*dbo.Get_Part_NetWeight(a1.Site,a1.partNo)/1000.0) as [48小时报工重量]
- from
- (select a.site,a.partNo, a.SeqNo,a.PreviousSeqNo,min(b.EventTime) as 开工时间,a.S_ScheduledDate
- from SOScheduledRouting a left join SFDC_TimeHist b on a.SeqNo=b.SeqNo and a.site=b.site and b.EventDesc='开始生产'
- where a.PreviousSeqNo is not null and b.EventTime is not null and a.scheduleType='生产订单派工单'
- group by a.site,a.SeqNo,a.PreviousSeqNo,a.S_ScheduledDate,a.partNo) a1
- left join SOScheduledRouting a3 on a1.PreviousSeqNo=a3.SeqNo and a1.Site=a3.Site
- left join sfdc a2 on a1.Site=a2.Site and a1.SeqNo=a2.AssJobSeqNo
- where a2.StatisticDate is not null and 48>=DATEDIFF(HOUR, 开工时间, a2.StatisticDate)
- group by a1.site,a1.SeqNo,a1.PreviousSeqNo,a1.开工时间,a1.S_ScheduledDate,a3.QtyApprove,a3.Site,a3.partNo) as a11
- where 领料重量>[48小时报工重量]
+
+ select 工厂编码,派工单号,开工时间,报工时间,上道报工时间,DATEDIFF(HOUR, 开工时间, 报工时间) as 开工间隔,生产时间,领料重量,[48小时报工重量],完成率,备注
+
+ from (
+ select a.site 工厂编码,a.SeqNo 派工单号,min(EventTime) as 开工时间,a.LastReportDate 报工时间,null as 上道报工时间,null as 开工间隔,
+ null 生产时间,null as 领料重量,null as [48小时报工重量],null as 完成率, '完工不及时' as 备注
+
+ from SOScheduledRouting a left join SFDC_TimeHist b on a.Site=b.Site and a.SeqNo=b.SeqNo and EventDesc='开始生产'
+ where a.ClosedFlag='Y'
+ GROUP BY a.site,a.SeqNo,a.LastReportDate
+
+ ) aaaaaa
+
+
+ where DATEDIFF(HOUR, 开工时间, 报工时间) >48
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
union all
select site 工厂编码,SeqNo 派工单号, null as 开工时间,null as 报工时间,null as上道报工时间,null as 开工间隔,
@@ -1370,7 +1389,9 @@
and dbo.Get_Part_SpecDesc(r2.site,r2.partNo) like #{query.partDesc}
-
+
+ and 备注 like #{query.remark}
+