修改 总装

master
wangh 4 years ago
parent a0e00b2e5e
commit f884b41107

@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.ruoyi.system.domain.*; import com.ruoyi.system.domain.*;
import com.ruoyi.system.service.IBroadDataService; import com.ruoyi.system.service.IBroadDataService;
import com.ruoyi.system.service.IBroadDruidService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -23,6 +24,8 @@ import java.util.List;
public class BoxBroadController { public class BoxBroadController {
@Autowired @Autowired
private IBroadDataService service; private IBroadDataService service;
@Autowired
private IBroadDruidService BroadDruidServiceImpl;
@PostMapping("/planCompletion") @PostMapping("/planCompletion")
@ApiOperation("箱壳查询计划数量完成情况") @ApiOperation("箱壳查询计划数量完成情况")
@ -65,8 +68,10 @@ public class BoxBroadController {
@ApiOperation("箱壳按小时查询产量") @ApiOperation("箱壳按小时查询产量")
public String selectOutputByTime() { public String selectOutputByTime() {
List<BoxOutput> info = service.selectOutputByTime(); List<BoxOutput> info = service.selectOutputByTime();
BoxOutput info1 = service.selectOutputByTimeDY(); int qty = BroadDruidServiceImpl.selectNowXkOutPut();
info.add(info1);
BoxOutput boxOutput=info.get(info.size()-1);
boxOutput.setQty(qty+boxOutput.getQty());
String jsonInfo = JSONArray.toJSONString(info); String jsonInfo = JSONArray.toJSONString(info);
System.out.println("根据型号统计产量:" + jsonInfo); System.out.println("根据型号统计产量:" + jsonInfo);
return jsonInfo; return jsonInfo;

@ -13,4 +13,6 @@ public interface IBroadDruidService {
int selectTeamGroups(); int selectTeamGroups();
List<BoxOutput> zz_selectLossInfo(); List<BoxOutput> zz_selectLossInfo();
int selectNowXkOutPut();
} }

@ -22,9 +22,15 @@ public class BroadDruidServiceImpl implements IBroadDruidService {
public void createWork(){ public void createWork(){
BoxOutput boxOutput=mapper.selectNowXkOutPut(); BoxOutput boxOutput=mapper.selectNowXkOutPut();
int nowOut=boxOutput.getQty(); int nowOut=boxOutput.getQty();
int qty=mapper.selectXK_H_QTY(); int qty=mapper.selectXK_H_QTY(); //上一条
int zsQty=mapper.selectNowXkOutPut1(); int zsQty=mapper.selectNowXkOutPut1();
mapper.insertXK_H_QTY(boxOutput.getName(),nowOut,nowOut-qty,zsQty); int cha=nowOut-qty;
mapper.insertXK_H_QTY(boxOutput.getName(),zsQty,cha<0?0:cha,zsQty);
}
@Override
public int selectNowXkOutPut() {
return mapper.selectNowXkOutPut1();
} }
@Override @Override

@ -437,13 +437,14 @@
<select id="selectNowXkOutPut" resultType="com.ruoyi.system.domain.BoxOutput"> <select id="selectNowXkOutPut" resultType="com.ruoyi.system.domain.BoxOutput">
select (TO_CHAR(SYSDATE, 'hh24') || ':30') as name, select (TO_CHAR(SYSDATE, 'hh24') || ':30') as name,
nvl(sum(actual_qty), 0) as qty nvl(sum(actual_qty), 0) as qty
from IMOS.IMOS_PR_PLAN from IMOS.IMOS_PR_PLAN xhq
where plan_date is not null left join (select * from haiwei.BASE_DAY_WBTIME where ROWNUM = 1 order by CREATE_TIME desc) wb on 1 = 1
and process_code = 1002 where xhq.CREATION_DATE between case when sysdate &lt;= wb.W_END then W_START else W_END end
and delete_flag = '0' and case when sysdate &lt;= wb.W_END then W_END else B_END end
and (to_char(plan_date, 'yyyy-MM-dd') = to_char(sysdate, 'yyyy-MM-dd') or and plan_date is not null
to_char(plan_date, 'yyyy-MM-dd') = to_char(sysdate-1, 'yyyy-MM-dd')) and process_code = 1002
and delete_flag = '0'
</select> </select>
<select id="selectNowXkOutPut1" resultType="int"> <select id="selectNowXkOutPut1" resultType="int">
@ -482,7 +483,7 @@
</select> </select>
<select id="selectXK_H_QTY" resultType="int"> <select id="selectXK_H_QTY" resultType="int">
select * from ( select nvl(QTY, 0) from XK_H_QTY order by CREATE_TIME desc) where ROWNUM=1 select * from ( select nvl(ZS_C, 0) from haiwei.XK_H_QTY order by CREATE_TIME desc) where ROWNUM=1
</select> </select>
<insert id="insertXK_H_QTY"> <insert id="insertXK_H_QTY">

Loading…
Cancel
Save