From 65310962f0c7c98b1912b3b14ca4e4d538325923 Mon Sep 17 00:00:00 2001 From: wangh <123456> Date: Thu, 21 Jul 2022 16:54:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E6=80=BB=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/broad/ZZJXBroadController.java | 17 +++++--- .../ruoyi/system/mapper/BroadDataMapper.java | 11 ++--- .../system/service/IBroadDataService.java | 2 + .../system/service/IBroadDruidService.java | 6 +++ .../service/impl/BroadDruidServiceImpl.java | 9 +++++ .../mapper/system/BroadDataMapper.xml | 40 +++++++++++-------- 6 files changed, 59 insertions(+), 26 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/broad/ZZJXBroadController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/broad/ZZJXBroadController.java index 02ccf61..1df886a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/broad/ZZJXBroadController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/broad/ZZJXBroadController.java @@ -22,26 +22,33 @@ import java.util.Set; * @date 2022/7/14 9:49 */ @Controller -@RequestMapping("/broad/fp") +@RequestMapping("/broad/zz") @ApiOperation("总装") @ResponseBody public class ZZJXBroadController { @Autowired IBroadDataService service; @Autowired - IBroadDruidService iBroadDruidService; + IBroadDruidService BroadDruidServiceImpl; @PostMapping("/selectProductInByTeam/{id}") @ApiOperation("成品入库统计-当班") - private String selectProductInByTeam(@PathVariable("id")int id) { + private String selectProductInByTeam(@PathVariable("id") int id) { - if (id==0){ + if (id == 0) { return JSONArray.toJSONString(service.zz_selectProductInByTeam()); - }else { + } else { return JSONArray.toJSONString(service.zz_selectProductInByDay()); } } + @PostMapping("/selectLossInfo") + @ApiOperation("查询Loss和分布") + private String selectLossInfo() { + return JSONArray.toJSONString(BroadDruidServiceImpl.zz_selectLossInfo()); + } + + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BroadDataMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BroadDataMapper.java index c4eaa63..da75089 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BroadDataMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BroadDataMapper.java @@ -59,14 +59,15 @@ public interface BroadDataMapper { void insertXK_H_QTY(@Param("name") String name,@Param("nowOut") int nowOut,@Param("cha") int cha,@Param("zs") int zsQty); int selectTeamGroups(); - + /////////////////////////////////////////////////////////////////////////// + // 6// zz_() + /////////////////////////////////////////////////////////////////////////// List zz_selectProductInByTeam(); List zz_selectProductInByDay(); + List zz_selectLossInfo(); - /////////////////////////////////////////////////////////////////////////// - // 6 - /////////////////////////////////////////////////////////////////////////// -// zz_() + void insertTimp1(); + void deleteTimp1(); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IBroadDataService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IBroadDataService.java index 336ffaa..7049e9d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/IBroadDataService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IBroadDataService.java @@ -53,4 +53,6 @@ public interface IBroadDataService { List zz_selectProductInByTeam(); List zz_selectProductInByDay(); + + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IBroadDruidService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IBroadDruidService.java index a7ef442..589eb5a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/IBroadDruidService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IBroadDruidService.java @@ -1,5 +1,9 @@ package com.ruoyi.system.service; +import com.ruoyi.system.domain.BoxOutput; + +import java.util.List; + /** * @author wanghao * @date 2022/7/18 15:24 @@ -7,4 +11,6 @@ package com.ruoyi.system.service; public interface IBroadDruidService { int selectTeamGroups(); + + List zz_selectLossInfo(); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BroadDruidServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BroadDruidServiceImpl.java index 2279d52..3a283a4 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BroadDruidServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BroadDruidServiceImpl.java @@ -7,6 +7,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.stereotype.Service; +import java.util.List; + /** * @author wanghao * @date 2022/7/18 15:25 @@ -29,4 +31,11 @@ public class BroadDruidServiceImpl implements IBroadDruidService { public int selectTeamGroups() { return mapper.selectTeamGroups(); } + + @Override + public List zz_selectLossInfo() { + mapper.deleteTimp1(); + mapper.insertTimp1(); + return mapper.zz_selectLossInfo(); + } } diff --git a/ruoyi-system/src/main/resources/mapper/system/BroadDataMapper.xml b/ruoyi-system/src/main/resources/mapper/system/BroadDataMapper.xml index 3c6dc70..52666dc 100644 --- a/ruoyi-system/src/main/resources/mapper/system/BroadDataMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/BroadDataMapper.xml @@ -369,33 +369,41 @@ on ta.name = ipr.MATERIAL_NAME order by to_number(STATION_NO) + + delete from haiwei.temp1 + + + insert into haiwei.temp1 ( + select row_number() over (order by PRODUCTION_DATE) as row_number, + PRODUCTION_DATE as day, + (select * from (select RHYTHM from haiwei.BASE_RHYTHM where ROWNUM=1 order by ID desc )) as rhy + from IMOS.IMOS_PR_PRODUCT_BARCODE ippb + left join (select * from haiwei.BASE_DAY_WBTIME where ROWNUM = 1 order by CREATE_TIME desc) wb on 1 = 1 + where ippb.PRODUCTION_DATE between case when sysdate <= wb.W_END then W_START else W_END end + and case when sysdate < = wb.W_END then W_END else B_END end + and DETIAL_TYPE_CODE = '1004' + ) + - - + select ROUND(sum(ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - 20) / 60, 2) as qty, 1 as name from temp1 t1 left join TEMP1 t2 on t1.row_numbre = t2.row_numbre + 1 where ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - 20 > 0 union - select count(1) as qty, 2 as name + select count(1) as qty, 2 as name from temp1 t1 left join TEMP1 t2 on t1.row_numbre = t2.row_numbre + 2 - where ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - 20 > 0 and ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - 20 <=180 + where ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - 20 > 0 + and ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - 20 <= 180 union - select count(1) as qty, 3 as name + select count(1) as qty, 3 as name from temp1 t1 left join TEMP1 t2 on t1.row_numbre = t2.row_numbre + 2 - where ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - 20 > 180 and ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - 20 <=600 + where ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - 20 > 180 + and ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - 20 <= 600 union - select count(1) as qty, 4 as name + select count(1) as qty, 4 as name from temp1 t1 left join TEMP1 t2 on t1.row_numbre = t2.row_numbre + 2 where ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - 20 > 600