Merge remote-tracking branch 'origin/master'

master
夜笙歌 3 years ago
commit 5c362dd108

@ -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());
}
}

@ -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<BoxOutput> zz_selectProductInByTeam();
List<BoxOutput> zz_selectProductInByDay();
List<BoxOutput> zz_selectLossInfo();
///////////////////////////////////////////////////////////////////////////
// 6
///////////////////////////////////////////////////////////////////////////
// zz_()
void insertTimp1();
void deleteTimp1();
}

@ -53,4 +53,6 @@ public interface IBroadDataService {
List<BoxOutput> zz_selectProductInByTeam();
List<BoxOutput> zz_selectProductInByDay();
}

@ -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<BoxOutput> zz_selectLossInfo();
}

@ -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<BoxOutput> zz_selectLossInfo() {
mapper.deleteTimp1();
mapper.insertTimp1();
return mapper.zz_selectLossInfo();
}
}

@ -369,33 +369,41 @@
on ta.name = ipr.MATERIAL_NAME
order by to_number(STATION_NO)
</select>
<insert id="deleteTimp1">
delete from haiwei.temp1
</insert>
<insert id="insertTimp1">
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 &lt;= wb.W_END then W_START else W_END end
and case when sysdate &lt; = wb.W_END then W_END else B_END end
and DETIAL_TYPE_CODE = '1004'
)
</insert>
<select id="QQ" resultType="com.ruoyi.system.domain.BoxOutput">
insert into temp1 (
select row_number() over (order by CREATION_DATE) as row_number,
CREATION_DATE as day
from IMOS.IMOS_LO_TASK_HISTORY
where to_char(CREATION_DATE, 'yyyy-MM-dd') = to_char(sysdate, 'yyyy-MM-dd')
and TASK_TYPE = 'I')
select ROUND(sum(ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - 20) / 60,2) as qty, 1 as name
<select id="zz_selectLossInfo" resultType="com.ruoyi.system.domain.BoxOutput">
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 &gt; 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 &gt; 0 and ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - 20 &lt;=180
where ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - 20 &gt; 0
and ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - 20 &lt;= 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 &gt; 180 and ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - 20 &lt;=600
where ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - 20 &gt; 180
and ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - 20 &lt;= 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 &gt; 600

Loading…
Cancel
Save