修改 展示看板

master
wangh 4 years ago
parent b2a334b510
commit 6f290d5583

@ -38,10 +38,11 @@ public class AllBroadHTMLController {
}
//4 泡前库
@GetMapping("/beforeLibrary")
public String beforeLibrary() {
public String beForeLibrary() {
return "broad/beforeLibrary";
}
//6 智能工厂二楼终检位置
@GetMapping("/finalAssemblyProductionData")
public String finalAssemblyProduction() {
return "broad/finalAssemblyProductionData";

@ -13,7 +13,11 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* @author wanghao
@ -22,6 +26,7 @@ import java.util.List;
@Controller
@RequestMapping("/broad/fp")
@ApiOperation("发泡")
@ResponseBody
public class FPBroadController {
@Autowired
IBroadDataService service;
@ -30,14 +35,13 @@ public class FPBroadController {
@PostMapping("/selectOrderExecution")
@ApiOperation("订单执行、生产统计")
@ResponseBody
private String selectOrderExecution() {
return JSONArray.toJSONString(service.fp_selectOrderExecution());
}
@PostMapping("/selectOrderInfo")
@ApiOperation("中间生产数量统计")
@ResponseBody
private String selectProductionStatistics() {
return JSONObject.toJSONString(service.selectplanCompletion("1005"));
}
@ -48,11 +52,48 @@ public class FPBroadController {
private String selectDeviceStation() {
return JSONArray.toJSONString(service.fp_selectDeviceStation());
}
@PostMapping("/selectStationHourInfo")
@ResponseBody
@ApiOperation("生产统计数据")
private String fp_selectStationHourInfo() {
return JSONArray.toJSONString(service.fp_selectStationHourInfo());
}
private Map<String,String> map;
{
map=new HashMap<>();
map.put("A1","10.10.60.176");
map.put("A2","10.10.60.177");
map.put("B1","10.10.60.178");
map.put("B2","10.10.60.179");
}
@PostMapping("/selectDeviceState")
@ApiOperation("设备状态查询")
private String selectDeviceState(){
Set<String> strings = map.keySet();
for (String key:strings) {
Process p = null;
try {
p = Runtime.getRuntime().exec("/system/bin/ping -c 1 " + map.get(key));
int status = p.waitFor();
System.out.println(status);
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
String json=JSONObject.toJSONString(map);
return json;
}
}

@ -41,4 +41,10 @@ public interface BroadDataMapper {
List<DeviceStation> fp_selectDeviceStation();
List<FPStationHourInfo> fp_selectStationHourInfo();
///////////////////////////////////////////////////////////////////////////
// 6
///////////////////////////////////////////////////////////////////////////
// zz_()
}

@ -0,0 +1,9 @@
package com.ruoyi.system.service;
/**
* @author wanghao
* @date 2022/7/18 15:24
*/
public interface IBroadDruidService {
}

@ -0,0 +1,16 @@
package com.ruoyi.system.service.impl;
import com.ruoyi.system.mapper.BroadDataMapper;
import com.ruoyi.system.service.IBroadDruidService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @author wanghao
* @date 2022/7/18 15:25
*/
@Service
public class BroadDruidServiceImpl implements IBroadDruidService {
@Autowired
private BroadDataMapper mapper;
}

@ -89,14 +89,28 @@
</select>
<select id="selectOutputByTime" resultType="com.ruoyi.system.domain.BoxOutput">
select TO_CHAR(CREATION_DATE, 'hh24')||':30' as name ,Count(TASK_ID) as qty
from IMOS_LO_TASK_HISTORY
where detial_type_code = '1002'
and TASK_TYPE != 'O'
and TO_CHAR(CREATION_DATE, 'YYYY-MM-DD') = TO_CHAR(SYSDATE, 'YYYY-MM-DD')
and TO_CHAR(CREATION_DATE, 'hh24') > 7
group by TO_CHAR(CREATION_DATE, 'hh24')
order by name
-- select TO_CHAR(CREATION_DATE, 'hh24')||':30' as name ,Count(TASK_ID) as qty
-- from IMOS_LO_TASK_HISTORY
-- where detial_type_code = '1002'
-- and TASK_TYPE != 'O'
-- and TO_CHAR(CREATION_DATE, 'YYYY-MM-DD') = TO_CHAR(SYSDATE, 'YYYY-MM-DD')
-- and TO_CHAR(CREATION_DATE, 'hh24') > 7
-- group by TO_CHAR(CREATION_DATE, 'hh24')
-- order by name
select TO_CHAR(CREATION_DATE, 'hh24') || ':30' as name, Count(TASK_ID) as qty
from (
select CREATION_DATE, TASK_ID
from IMOS_LO_TASK_HISTORY
where detial_type_code = '1002'
and TASK_TYPE != 'O'
and CREATION_DATE between
to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '07:30:00', 'yyyy-MM-dd hh24:mi:ss')
and
to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '19:30:00', 'yyyy-MM-dd hh24:mi:ss')
)
group by TO_CHAR(CREATION_DATE, 'hh24')
order by name
</select>
@ -247,4 +261,36 @@
from IMOS_PR_FOAMING_MONITOR
order by to_number(STATION_NO)
</select>
<select id="" 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
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
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
union
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
union
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
</select>
</mapper>
Loading…
Cancel
Save