Browse Source

返工返修

master
qiezi 1 year ago
parent
commit
1821f14f07
  1. 6
      src/main/java/com/heai/modules/production/controller/DailyPlanController.java
  2. 1
      src/main/java/com/heai/modules/production/dao/SoScheduledListMapper.java
  3. 3
      src/main/java/com/heai/modules/production/service/DailyPlanService.java
  4. 5
      src/main/java/com/heai/modules/production/service/impl/DailyPlanServiceImpl.java
  5. 88
      src/main/resources/mapper/production/SoScheduledListMapper.xml

6
src/main/java/com/heai/modules/production/controller/DailyPlanController.java

@ -1056,6 +1056,12 @@ public class DailyPlanController {
PageUtils page = dailyPlanService.getLiuhuaView(data); PageUtils page = dailyPlanService.getLiuhuaView(data);
return R.ok().put("page", page); return R.ok().put("page", page);
} }
@PostMapping(value="/vulcanization")
@ResponseBody
public R queryVulcanizationList(@RequestBody LiuhuaViewData data){
List<LiuhuaViewData> list = dailyPlanService.queryVulcanizationList(data);
return R.ok().put("rows", list);
}
@PostMapping("/selectToolHist") @PostMapping("/selectToolHist")

1
src/main/java/com/heai/modules/production/dao/SoScheduledListMapper.java

@ -192,6 +192,7 @@ public interface SoScheduledListMapper {
*/ */
IPage<LiuhuaViewData> getLiuhuaView(Page<LiuhuaViewData> page, @Param("query") LiuhuaViewData inData); IPage<LiuhuaViewData> getLiuhuaView(Page<LiuhuaViewData> page, @Param("query") LiuhuaViewData inData);
List<LiuhuaViewData> queryVulcanizationList(@Param("query") LiuhuaViewData inData);
IPage<SfdcTimeHistSOSData> getSfdcTimeHistQuery(Page<SfdcTimeHistSOSData> page, @Param("query") SOScheduledRoutingOutData inData); IPage<SfdcTimeHistSOSData> getSfdcTimeHistQuery(Page<SfdcTimeHistSOSData> page, @Param("query") SOScheduledRoutingOutData inData);

3
src/main/java/com/heai/modules/production/service/DailyPlanService.java

@ -754,6 +754,9 @@ public interface DailyPlanService {
List<OrderViewData> getOrderView(OrderViewData inData); List<OrderViewData> getOrderView(OrderViewData inData);
PageUtils getLiuhuaView(LiuhuaViewData inData); PageUtils getLiuhuaView(LiuhuaViewData inData);
List<LiuhuaViewData> queryVulcanizationList(LiuhuaViewData inData);
/** /**
* 查询shopOrder * 查询shopOrder
* @param dailyPlanInData * @param dailyPlanInData

5
src/main/java/com/heai/modules/production/service/impl/DailyPlanServiceImpl.java

@ -2033,6 +2033,11 @@ public class DailyPlanServiceImpl implements DailyPlanService {
new Page<LiuhuaViewData>(inData.getPage(), inData.getLimit()), inData); new Page<LiuhuaViewData>(inData.getPage(), inData.getLimit()), inData);
return new PageUtils(resultList); return new PageUtils(resultList);
} }
@Override
public List<LiuhuaViewData> queryVulcanizationList(LiuhuaViewData inData){
return this.soScheduledListMapper.queryVulcanizationList(inData);
}
@Override @Override
public ShopOrderData selectShopOrder(DailyPlanInData dailyPlanInData) { public ShopOrderData selectShopOrder(DailyPlanInData dailyPlanInData) {
// if (!StringUtils.hasText(dailyPlanInData.getSite())){ // if (!StringUtils.hasText(dailyPlanInData.getSite())){

88
src/main/resources/mapper/production/SoScheduledListMapper.xml

@ -224,27 +224,19 @@
Round(a.QtyRequired, 2) QtyRequired, Round(a.QtyRequired, 2) QtyRequired,
Round(a.QtyReported, 2) QtyReported, Round(a.QtyReported, 2) QtyReported,
Round(a.QtyApprove, 2) QtyApprove, Round(a.QtyApprove, 2) QtyApprove,
Convert(varchar(20), Convert(DECIMAL(20, 1), a.QtyReported * 100 / a.QtyRequired)) +
'%' as liuhuaWancheng,
Convert(varchar(20), Convert(DECIMAL(20, 1), a.QtyReported * 100 / a.QtyRequired)) +'%' as liuhuaWancheng,
dbo.Get_seqNo_firstReportTime(a.site, a.SeqNo) firstReportDate2, dbo.Get_seqNo_firstReportTime(a.site, a.SeqNo) firstReportDate2,
S_ScheduledDate as ScheduledDate, S_ScheduledDate as ScheduledDate,
S_ShiftNo as shiftNo, S_ShiftNo as shiftNo,
dbo.Get_OperatorDesc(a.site, a.operatorId) as operatorDesc, dbo.Get_OperatorDesc(a.site, a.operatorId) as operatorDesc,
a.partNo, a.partNo,
dbo.Get_Part_SpecDesc(a.site, a.partNo) partSpec, dbo.Get_Part_SpecDesc(a.site, a.partNo) partSpec,
Convert(varchar(20), Round(isnull(dbo.Get_liuhuaView_wanchenglv(a.site, a.SeqNo, '修边'), 0), 3)) +
'%' as xiubianWancheng,
Convert(varchar(20), Round(isnull(dbo.Get_liuhuaView_wanchenglv(a.site, a.SeqNo, '烘烤'), 0), 3)) +
'%' as hongkaoWancheng,
Convert(varchar(20), Round(isnull(dbo.Get_liuhuaView_wanchenglv(a.site, a.SeqNo, '检验'), 0), 3)) +
'%' as jianyanWancheng,
Convert(varchar(20), Round(isnull(dbo.Get_liuhuaView_wanchenglv(a.site, a.SeqNo, '加工'), 0), 3)) +
'%' as jiagongWancheng,
Convert(varchar(20), Round(isnull(dbo.Get_liuhuaView_wanchenglv(a.site, a.SeqNo, '包装'), 0), 3)) +
'%' as baozhuangWancheng,
(select Convert(DECIMAL(20, 2),
sum(f.QtyApprove * dbo.Get_SPBOMQtyAssembly(f.site, f.orderNo)) * 100.0 /
a.QtyReported)
Convert(varchar(20), Round(isnull(dbo.Get_liuhuaView_wanchenglv(a.site, a.SeqNo, '修边'), 0), 3)) +'%' as xiubianWancheng,
Convert(varchar(20), Round(isnull(dbo.Get_liuhuaView_wanchenglv(a.site, a.SeqNo, '烘烤'), 0), 3)) +'%' as hongkaoWancheng,
Convert(varchar(20), Round(isnull(dbo.Get_liuhuaView_wanchenglv(a.site, a.SeqNo, '检验'), 0), 3)) +'%' as jianyanWancheng,
Convert(varchar(20), Round(isnull(dbo.Get_liuhuaView_wanchenglv(a.site, a.SeqNo, '加工'), 0), 3)) +'%' as jiagongWancheng,
Convert(varchar(20), Round(isnull(dbo.Get_liuhuaView_wanchenglv(a.site, a.SeqNo, '包装'), 0), 3)) +'%' as baozhuangWancheng,
(select Convert(DECIMAL(20, 2),sum(f.QtyApprove * dbo.Get_SPBOMQtyAssembly(f.site, f.orderNo)) * 100.0 /a.QtyReported)
from SOScheduledRouting f from SOScheduledRouting f
where f.materSeqNo = a.SeqNo where f.materSeqNo = a.SeqNo
and dbo.Get_ProductionLineDesc(f.site, dbo.Get_WorkCenter_ProLineNo(f.site, f.S_WorkCenterNo)) like and dbo.Get_ProductionLineDesc(f.site, dbo.Get_WorkCenter_ProLineNo(f.site, f.S_WorkCenterNo)) like
@ -252,14 +244,10 @@
and f.QtyReported > 0) as liuhuahegelv and f.QtyReported > 0) as liuhuahegelv
, ,
z.TillTime as liuhuaTime, z.TillTime as liuhuaTime,
dbo.Get_liuhuaView_gongxu_firstReportTime(a.site, a.SeqNo, '修边') as xiubianTime
,
dbo.Get_liuhuaView_gongxu_firstReportTime(a.site, a.SeqNo, '烘烤') as hongkaoTime
,
dbo.Get_liuhuaView_gongxu_firstReportTime(a.site, a.SeqNo, '检验') as jianyanTime
,
dbo.Get_liuhuaView_gongxu_firstReportTime(a.site, a.SeqNo, '加工') as jiagongTime
,
dbo.Get_liuhuaView_gongxu_firstReportTime(a.site, a.SeqNo, '修边') as xiubianTime,
dbo.Get_liuhuaView_gongxu_firstReportTime(a.site, a.SeqNo, '烘烤') as hongkaoTime,
dbo.Get_liuhuaView_gongxu_firstReportTime(a.site, a.SeqNo, '检验') as jianyanTime,
dbo.Get_liuhuaView_gongxu_firstReportTime(a.site, a.SeqNo, '加工') as jiagongTime,
dbo.Get_liuhuaView_gongxu_firstReportTime(a.site, a.SeqNo, '包装') as baozhuangTime dbo.Get_liuhuaView_gongxu_firstReportTime(a.site, a.SeqNo, '包装') as baozhuangTime
from SOScheduledRouting a from SOScheduledRouting a
left join shoporder b on a.site = b.site and a.orderNo = b.orderNo left join shoporder b on a.site = b.site and a.orderNo = b.orderNo
@ -271,7 +259,7 @@
and a.partNo like #{query.partNo} and a.partNo like #{query.partNo}
</if> </if>
<if test="query.site != null and query.site != ''"> <if test="query.site != null and query.site != ''">
and site=#{query.site}
and a.site=#{query.site}
</if> </if>
<if test="query.seqNo != null "> <if test="query.seqNo != null ">
and a.seqNo like #{query.seqNo} and a.seqNo like #{query.seqNo}
@ -288,9 +276,6 @@
<if test="query.endDate != null "> <if test="query.endDate != null ">
AND #{query.endDate} >= DATEADD(dd, -1, a.S_ScheduledDate) AND #{query.endDate} >= DATEADD(dd, -1, a.S_ScheduledDate)
</if> </if>
<if test="query.firstReportDate2Flag != null and query.firstReportDate2Flag != '' and query.firstReportDate2Flag == 'Y'.toString()">
and GETDATE() >= dbo.Get_seqNo_firstReportTime(a.site, a.SeqNo)
</if>
<if test="query.operatorDesc != null and query.operatorDesc != '' "> <if test="query.operatorDesc != null and query.operatorDesc != '' ">
and dbo.Get_OperatorDesc(a.site,a.operatorId) like #{query.operatorDesc} and dbo.Get_OperatorDesc(a.site,a.operatorId) like #{query.operatorDesc}
</if> </if>
@ -345,4 +330,53 @@
order by a.EventTime order by a.EventTime
</select> </select>
<select id="queryVulcanizationList" resultType="com.heai.modules.production.entity.LiuhuaViewData">
select a.site,
a.orderNo,
a.SeqNo,
Round(a.QtyRequired, 2) QtyRequired,
Round(a.QtyReported, 2) QtyReported,
Round(a.QtyApprove, 2) QtyApprove,
Convert(varchar(20), Convert(DECIMAL(20, 1), a.QtyReported * 100 / a.QtyRequired)) +'%' as liuhuaWancheng,
dbo.Get_seqNo_firstReportTime(a.site, a.SeqNo) firstReportDate2,
S_ScheduledDate as ScheduledDate,
S_ShiftNo as shiftNo,
dbo.Get_OperatorDesc(a.site, a.operatorId) as operatorDesc,
a.partNo,
dbo.Get_Part_SpecDesc(a.site, a.partNo) partSpec,
Convert(varchar(20), Round(isnull(dbo.Get_liuhuaView_wanchenglv(a.site, a.SeqNo, '修边'), 0), 3)) +'%' as xiubianWancheng,
Convert(varchar(20), Round(isnull(dbo.Get_liuhuaView_wanchenglv(a.site, a.SeqNo, '烘烤'), 0), 3)) +'%' as hongkaoWancheng,
Convert(varchar(20), Round(isnull(dbo.Get_liuhuaView_wanchenglv(a.site, a.SeqNo, '检验'), 0), 3)) +'%' as jianyanWancheng,
Convert(varchar(20), Round(isnull(dbo.Get_liuhuaView_wanchenglv(a.site, a.SeqNo, '加工'), 0), 3)) +'%' as jiagongWancheng,
Convert(varchar(20), Round(isnull(dbo.Get_liuhuaView_wanchenglv(a.site, a.SeqNo, '包装'), 0), 3)) +'%' as baozhuangWancheng,
(select Convert(DECIMAL(20, 2),sum(f.QtyApprove * dbo.Get_SPBOMQtyAssembly(f.site, f.orderNo)) * 100.0 /a.QtyReported)
from SOScheduledRouting f
where f.materSeqNo = a.SeqNo
and dbo.Get_ProductionLineDesc(f.site, dbo.Get_WorkCenter_ProLineNo(f.site, f.S_WorkCenterNo)) like
'%检验%'
and f.QtyReported > 0) as liuhuahegelv
,
z.TillTime as liuhuaTime,
dbo.Get_liuhuaView_gongxu_firstReportTime(a.site, a.SeqNo, '修边') as xiubianTime,
dbo.Get_liuhuaView_gongxu_firstReportTime(a.site, a.SeqNo, '烘烤') as hongkaoTime,
dbo.Get_liuhuaView_gongxu_firstReportTime(a.site, a.SeqNo, '检验') as jianyanTime,
dbo.Get_liuhuaView_gongxu_firstReportTime(a.site, a.SeqNo, '加工') as jiagongTime,
dbo.Get_liuhuaView_gongxu_firstReportTime(a.site, a.SeqNo, '包装') as baozhuangTime
from SOScheduledRouting a
left join shoporder b on a.site = b.site and a.orderNo = b.orderNo
left join SFDC_TimeHist z on a.site = z.Site and a.SeqNo = z.SeqNo and z.HistSeqNo = 1
<where>
AND a.scheduleType = '日计划派工单'
and a.QtyReported > 0
<if test="query.firstReportDate2Flag != null and query.firstReportDate2Flag != '' and query.firstReportDate2Flag == 'Y'.toString()">
and GETDATE() >= dbo.Get_seqNo_firstReportTime(a.site, a.SeqNo)
and (dbo.Get_SoScheduleRouting_CloseFlag(a.site, a.SeqNo, N'修边') = 'N'
or dbo.Get_SoScheduleRouting_CloseFlag(a.site, a.SeqNo, N'烘烤') = 'N'
or dbo.Get_SoScheduleRouting_CloseFlag(a.site, a.SeqNo, N'检验') = 'N'
or dbo.Get_SoScheduleRouting_CloseFlag(a.site, a.SeqNo, N'加工') = 'N')
</if>
</where>
</select>
</mapper> </mapper>
Loading…
Cancel
Save