Merge remote-tracking branch 'origin/master'

master
夜笙歌 4 years ago
commit 58c711e6bf

@ -30,8 +30,7 @@ public class BoxBroadController {
@PostMapping("/planCompletion")
@ApiOperation("箱壳查询计划数量完成情况")
public String selectplanCompletion() {
BoxPlanCompletion completion = service.selectplanCompletion();
return JSONObject.toJSONString(completion);
return JSONObject.toJSONString(service.selectplanCompletion());
}
// 库存
@ -64,30 +63,34 @@ public class BoxBroadController {
return jsonInfo;
}
@PostMapping("/selectOutputByTime")
/* @PostMapping("/selectOutputByTime")
@ApiOperation("箱壳按小时查询产量")
public String selectOutputByTime() {
List<BoxOutput> info = service.selectOutputByTime();
BoxOutput boxOutput= info.get(0);
info.remove(0);
int qty = BroadDruidServiceImpl.selectNowXkOutPut();//实时的数量
if (info.isEmpty()){//只有7.30
boxOutput.setName("7:30");
boxOutput.setQty(qty);
}else {
BoxOutput boxOutputSize = info.get(info.size() - 1);
String hName=boxOutputSize.getName();
String newName=hName.substring(0,hName.indexOf(":"));
BoxOutput boxOutputNow=new BoxOutput();
boxOutputNow.setName((Integer.parseInt(newName)+1)+":30");
boxOutputNow.setQty(qty-boxOutputSize.getRecord_qty());
info.add(boxOutputNow);
Integer state=BroadDruidServiceImpl.selectTeamGroups();
if (state==0){
List<BoxOutput> info = service.selectOutputByTime();
}
String jsonInfo = JSONArray.toJSONString(info);
System.out.println("根据型号统计产量:" + jsonInfo);
return jsonInfo;
}
return JSONArray.toJSONString();
// BoxOutput boxOutput= info.get(0);
// info.remove(0);
// int qty = BroadDruidServiceImpl.selectNowXkOutPut();//实时的数量
// if (info.isEmpty()){//只有7.30
// boxOutput.setName("7:30");
// boxOutput.setQty(qty);
// }else {
// BoxOutput boxOutputSize = info.get(info.size() - 1);
// String hName=boxOutputSize.getName();
// String newName=hName.substring(0,hName.indexOf(":"));
// BoxOutput boxOutputNow=new BoxOutput();
//
// boxOutputNow.setName((Integer.parseInt(newName)+1)+":30");
// boxOutputNow.setQty(qty-boxOutputSize.getRecord_qty());
// info.add(boxOutputNow);
// }
// String jsonInfo = JSONArray.toJSONString(info);
// System.out.println("根据型号统计产量:" + jsonInfo);
// return jsonInfo;
}*/

@ -12,7 +12,7 @@ import java.util.List;
*/
@Repository
public interface BroadDataMapper {
BoxPlanCompletion selectplanCompletion();
List<BoxOutput> selectplanCompletion();
List<BoxStock> selectStock(String id);

@ -11,7 +11,7 @@ import java.util.List;
public interface IBroadDataService {
BoxPlanCompletion selectplanCompletion();
List<BoxOutput> selectplanCompletion();
List<BoxStock> selectStock(String id);

@ -24,7 +24,7 @@ public class BroadDataServiceImpl implements IBroadDataService
@Override
public BoxPlanCompletion selectplanCompletion() {
public List<BoxOutput> selectplanCompletion() {
return mapper.selectplanCompletion();
}

@ -11,42 +11,20 @@
</resultMap>
<select id="selectplanCompletion" resultType="com.ruoyi.system.domain.BoxPlanCompletion">
select
( select sum(PLAN_QTY) qty
<select id="selectplanCompletion" resultType="com.ruoyi.system.domain.BoxOutput">
select sum(PLAN_QTY) qty, '计划数量' as name
from imos_ta_material
where DISPLAY_FLAG = 1) AS planned_number,
nvl(sum(actual_qty), 0) AS quantity_number
from IMOS_PR_PLAN
where plan_date is not null
and process_code = 1002
and delete_flag = '0'
-- and to_char(plan_date, 'yyyy-MM-dd') = to_char(sysdate, 'yyyy-MM-dd')
and
to_date(START_TIME, 'yyyy-MM-dd hh24:mi:ss') &gt;
case
when to_char(sysdate, 'hh24') &gt; 7 and to_char(sysdate, 'hh24') &lt; 20 then to_date(
to_char(SYSDATE, 'yyyy-MM-dd') || '07:30:00',
'yyyy-MM-dd hh24:mi:ss')
when to_char(sysdate, 'hh24') &lt; 7 then to_date(to_char(SYSDATE - 1, 'yyyy-MM-dd') || '19:30:00',
'yyyy-MM-dd hh24:mi:ss')
else to_date(to_char(SYSDATE - 1, 'yyyy-MM-dd') || '19:30:00', 'yyyy-MM-dd hh24:mi:ss')
end
and to_date(START_TIME, 'yyyy-MM-dd hh24:mi:ss') &lt;
case
when to_char(sysdate, 'hh24') &gt; 7 and to_char(sysdate, 'hh24') &lt; 20 then to_date(
to_char(SYSDATE, 'yyyy-MM-dd') || '19:30:00',
'yyyy-MM-dd hh24:mi:ss')
when to_char(sysdate, 'hh24') &lt; 7 then to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '07:30:00',
'yyyy-MM-dd hh24:mi:ss')
else to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '24:00:00', 'yyyy-MM-dd hh24:mi:ss')
end
-- 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(plan_date, 'yyyy-MM-dd')
where DISPLAY_FLAG = 1
union
select sum(QTY3) as qty, '实际产量' as name
from IMOS.BASE_BOX_OUTPUT_RECORD xhq
left join (select * from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc) where ROWNUM = 1) wb
on 1 = 1
where xhq.CREATE_TIME 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 QTY3 > 0
</select>
<select id="selectStock" resultType="com.ruoyi.system.domain.BoxStock">
@ -75,44 +53,28 @@ to_date(START_TIME, 'yyyy-MM-dd hh24:mi:ss') &gt;
</select>
<select id="selectOutputByType" resultType="com.ruoyi.system.domain.BoxOutput">
select substr(MATERIAL_NAME,
case
when instr(MATERIAL_NAME, '/', 1, 1) = 0 then instr(MATERIAL_NAME, ',', 1, 1) + 1
else instr(MATERIAL_NAME, '/', 1, 1) + 1
end,
case
when instr(MATERIAL_NAME, ',', 1, 2) = 0 then Length(MATERIAL_NAME) + 1
else instr(MATERIAL_NAME, ',', 1, 2)
end
-
case
when instr(MATERIAL_NAME, '/', 1, 1) = 0 then instr(MATERIAL_NAME, ',', 1, 1) + 1
else instr(MATERIAL_NAME, '/', 1, 1) + 1
end) as name,
SUM(ACTUAL_QTY) as qty
from IMOS_PR_PLAN
where
to_date(START_TIME, 'yyyy-MM-dd hh24:mi:ss') &gt;
case
when to_char(sysdate, 'hh24') &gt; 7 and to_char(sysdate, 'hh24') &lt; 20 then to_date(
to_char(SYSDATE, 'yyyy-MM-dd') || '07:30:00',
'yyyy-MM-dd hh24:mi:ss')
when to_char(sysdate, 'hh24') &lt; 7 then to_date(to_char(SYSDATE - 1, 'yyyy-MM-dd') || '19:30:00',
'yyyy-MM-dd hh24:mi:ss')
else to_date(to_char(SYSDATE - 1, 'yyyy-MM-dd') || '19:30:00', 'yyyy-MM-dd hh24:mi:ss')
end
and to_date(START_TIME, 'yyyy-MM-dd hh24:mi:ss') &lt;
case
when to_char(sysdate, 'hh24') &gt; 7 and to_char(sysdate, 'hh24') &lt; 20 then to_date(
to_char(SYSDATE, 'yyyy-MM-dd') || '19:30:00',
'yyyy-MM-dd hh24:mi:ss')
when to_char(sysdate, 'hh24') &lt; 7 then to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '07:30:00',
'yyyy-MM-dd hh24:mi:ss')
else to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '24:00:00', 'yyyy-MM-dd hh24:mi:ss')
end
and PROCESS_CODE = 1002
and ACTUAL_QTY!=0
group by MATERIAL_NAME
select substr(name,
case
when instr(name, '/', 1, 1) = 0 then instr(name, ',', 1, 1) + 1
else instr(name, '/', 1, 1) + 1
end,
case
when instr(name, ',', 1, 2) = 0 then Length(name) + 1
else instr(name, ',', 1, 2)
end
-
case
when instr(name, '/', 1, 1) = 0 then instr(name, ',', 1, 1) + 1
else instr(name, '/', 1, 1) + 1
end) as name,
sum(QTY3)
from IMOS.BASE_BOX_OUTPUT_RECORD xhq
left join (select * from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc) where ROWNUM = 1) wb
on 1 = 1
where xhq.CREATE_TIME 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 QTY3 > 0
group by name
</select>
<select id="xk_selectStockOccupancy" resultType="com.ruoyi.system.domain.OrderInfo">
@ -154,33 +116,6 @@ to_date(START_TIME, 'yyyy-MM-dd hh24:mi:ss') &gt;
where xhq.CREATE_TIME 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
order by xhq.CREATE_TIME
-- 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 &gt;
-- case
-- when to_char(sysdate, 'hh24') &gt; 7 and to_char(sysdate, 'hh24') &lt; 20 then to_date(
-- to_char(SYSDATE, 'yyyy-MM-dd') || '07:30:00',
-- 'yyyy-MM-dd hh24:mi:ss')
-- when to_char(sysdate, 'hh24') &lt; 7 then to_date(to_char(SYSDATE - 1, 'yyyy-MM-dd') || '19:30:00',
-- 'yyyy-MM-dd hh24:mi:ss')
-- else to_date(to_char(SYSDATE - 1, 'yyyy-MM-dd') || '19:30:00', 'yyyy-MM-dd hh24:mi:ss')
-- end
-- and CREATION_DATE &lt;
-- case
-- when to_char(sysdate, 'hh24') &gt; 7 and to_char(sysdate, 'hh24') &lt; 20 then to_date(
-- to_char(SYSDATE, 'yyyy-MM-dd') || '19:30:00',
-- 'yyyy-MM-dd hh24:mi:ss')
-- when to_char(sysdate, 'hh24') &lt; 7 then to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '07:30:00',
-- 'yyyy-MM-dd hh24:mi:ss')
-- else to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '24:00:00', 'yyyy-MM-dd hh24:mi:ss')
-- end
-- )
-- group by TO_CHAR(CREATION_DATE, 'hh24')
-- order by name
</select>

Loading…
Cancel
Save