增加 定时删除无用数据

master
wangh 3 years ago
parent b3968972cd
commit 287fd25b1a

@ -37,7 +37,8 @@ public class ZZJXBroadController {
private String selectProductInByTeam(@PathVariable("id") int id) {
if (id == 0) {
int tag = service.zz_countNightProductIn();
// int tag = service.zz_countNightProductIn();
int tag = service.zz_countNightProductInTag();
if (tag > 0) {
return JSONArray.toJSONString(service.zz_selectProductInByTeamNight());
}

@ -28,8 +28,17 @@ public class BaseProductQty extends BaseEntity
/** 目标数量 */
@Excel(name = "目标数量")
private Long qty;
private Long qtyB;
public void setId(Long id)
public Long getQtyB() {
return qtyB;
}
public void setQtyB(Long qtyB) {
this.qtyB = qtyB;
}
public void setId(Long id)
{
this.id = id;
}

@ -119,4 +119,6 @@ public interface BroadDataMapper {
void deleteWorkTime();
void deleteBoxOutput();
int zz_countNightProductInTag();
}

@ -79,7 +79,7 @@ public interface IBroadDataService {
List<MTKBeen> mtk_sselectQATop3();
int zz_countNightProductInTag();
List<BoxOutput> zz_selectLossInfo(int state);
List<BoxOutput> mtk_selectQAZD();
@ -98,4 +98,6 @@ public interface IBroadDataService {
List<BoxOutput> pqk_selectProductInStore();
}

@ -161,6 +161,11 @@ public class BroadDataServiceImpl implements IBroadDataService
return mapper.zz_countNightProductIn();
}
@Override
public int zz_countNightProductInTag() {
return mapper.zz_countNightProductInTag();
}
@Override
public List<BoxOutput> zz_selectLossInfo(int state) {
return mapper.zz_selectLossInfo( state);

@ -10,10 +10,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="qty" column="qty" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="qtyB" column="qty_b" />
</resultMap>
<sql id="selectBaseProductQtyVo">
select id, day, qty, create_time, create_by from base_product_qty
select id, day, qty,qty_b, create_time, create_by from base_product_qty
</sql>
<select id="countDay" resultType="integer">
select count(1) from base_product_qty where day=#{day}
@ -41,6 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="id != null">id,</if>
<if test="day != null">day,</if>
<if test="qty != null">qty,</if>
<if test="qtyB != null">qty_b,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if>
</trim>
@ -48,6 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="id != null">#{id},</if>
<if test="day != null">#{day},</if>
<if test="qty != null">#{qty},</if>
<if test="qtyB != null">#{qtyB},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
</trim>
@ -58,6 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="SET" suffixOverrides=",">
<if test="day != null">day = #{day},</if>
<if test="qty != null">qty = #{qty},</if>
<if test="qtyB != null">qty_b = #{qtyB},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
</trim>

@ -573,15 +573,78 @@ where DAY between (TRUNC(sysdate, 'D') + 1) and (TRUNC(sysdate, 'D') + 7)
from haiwei.BASE_PRODUCT_QTY
where DAY between (TRUNC(sysdate, 'D') + 1) and (TRUNC(sysdate, 'D') + 7)
union
select to_char(PRODUCTION_DATE, 'MM-dd') as code, count(1) as qty, '产量' as name
from IMOS.IMOS_PR_PRODUCT_BARCODE
where to_char(PRODUCTION_DATE, 'yyyy-MM-dd') in
(
select to_char(DAY, 'yyyy-MM-dd')
from haiwei.BASE_PRODUCT_QTY
where DAY between (TRUNC(sysdate, 'D') + 1) and (TRUNC(sysdate, 'D') + 7)
)
group by to_char(PRODUCTION_DATE, 'MM-dd')
select wb.day as code, count(1) as qty, '产量' as name
from IMOS.IMOS_PR_PRODUCT_BARCODE ba
left join (select to_char(bpq.DAY, 'MM-dd') as day, W_START, B_END
from haiwei.BASE_PRODUCT_QTY bpq
left join haiwei.BASE_DAY_WBTIME wb on to_char(bpq.DAY, 'yyyy-MM-dd') = wb.CREATE_DAY
where DAY = (TRUNC(sysdate, 'D') + 1)
) wb on 1=1
where PRODUCTION_DATE between W_START and B_END
group by wb.day
union
select wb.day as code, count(1) as qty, '产量' as name
from IMOS.IMOS_PR_PRODUCT_BARCODE ba
left join (select to_char(bpq.DAY, 'MM-dd') as day, W_START, B_END
from haiwei.BASE_PRODUCT_QTY bpq
left join haiwei.BASE_DAY_WBTIME wb on to_char(bpq.DAY, 'yyyy-MM-dd') = wb.CREATE_DAY
where DAY = (TRUNC(sysdate, 'D') + 2)
) wb on 1=1
where PRODUCTION_DATE between W_START and B_END
group by wb.day
union
select wb.day as code, count(1) as qty, '产量' as name
from IMOS.IMOS_PR_PRODUCT_BARCODE ba
left join (select to_char(bpq.DAY, 'MM-dd') as day, W_START, B_END
from haiwei.BASE_PRODUCT_QTY bpq
left join haiwei.BASE_DAY_WBTIME wb on to_char(bpq.DAY, 'yyyy-MM-dd') = wb.CREATE_DAY
where DAY = (TRUNC(sysdate, 'D') + 3)
) wb on 1=1
where PRODUCTION_DATE between W_START and B_END
group by wb.day
union
select wb.day as code, count(1) as qty, '产量' as name
from IMOS.IMOS_PR_PRODUCT_BARCODE ba
left join (select to_char(bpq.DAY, 'MM-dd') as day, W_START, B_END
from haiwei.BASE_PRODUCT_QTY bpq
left join haiwei.BASE_DAY_WBTIME wb on to_char(bpq.DAY, 'yyyy-MM-dd') = wb.CREATE_DAY
where DAY = (TRUNC(sysdate, 'D') + 4)
) wb on 1=1
where PRODUCTION_DATE between W_START and B_END
group by wb.day
union
select wb.day as code, count(1) as qty, '产量' as name
from IMOS.IMOS_PR_PRODUCT_BARCODE ba
left join (select to_char(bpq.DAY, 'MM-dd') as day, W_START, B_END
from haiwei.BASE_PRODUCT_QTY bpq
left join haiwei.BASE_DAY_WBTIME wb on to_char(bpq.DAY, 'yyyy-MM-dd') = wb.CREATE_DAY
where DAY = (TRUNC(sysdate, 'D') + 5)
) wb on 1=1
where PRODUCTION_DATE between W_START and B_END
group by wb.day
union
select wb.day as code, count(1) as qty, '产量' as name
from IMOS.IMOS_PR_PRODUCT_BARCODE ba
left join (select to_char(bpq.DAY, 'MM-dd') as day, W_START, B_END
from haiwei.BASE_PRODUCT_QTY bpq
left join haiwei.BASE_DAY_WBTIME wb on to_char(bpq.DAY, 'yyyy-MM-dd') = wb.CREATE_DAY
where DAY = (TRUNC(sysdate, 'D') + 6)
) wb on 1=1
where PRODUCTION_DATE between W_START and B_END
group by wb.day
union
select wb.day as code, count(1) as qty, '产量' as name
from IMOS.IMOS_PR_PRODUCT_BARCODE ba
left join (select to_char(bpq.DAY, 'MM-dd') as day, W_START, B_END
from haiwei.BASE_PRODUCT_QTY bpq
left join haiwei.BASE_DAY_WBTIME wb on to_char(bpq.DAY, 'yyyy-MM-dd') = wb.CREATE_DAY
where DAY = (TRUNC(sysdate, 'D') + 7)
) wb on 1=1
where PRODUCTION_DATE between W_START and B_END
group by wb.day
</select>
<select id="zhou_selectQaInfo" resultType="com.ruoyi.system.domain.BoxOutput">
@ -1349,14 +1412,34 @@ where 600 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
-- from haiwei.BASE_PRODUCT_QTY
-- where DAY between (TRUNC(sysdate, 'D') + 1) and (TRUNC(sysdate, 'D') + 7)
-- union
select sum(QTY) as qty, '进度目标' as name
from haiwei.BASE_PRODUCT_QTY
-- select sum(QTY) as qty, '进度目标' as name
-- from haiwei.BASE_PRODUCT_QTY
-- where to_char(DAY, 'yyyy-MM-dd') = to_char(sysdate, 'yyyy-MM-dd')
select case
when sysdate &lt; W_END then QTY
else
case when QTY_B = 0 then QTY else QTY_B end end as qty,
'进度目标' as name
from haiwei.BASE_PRODUCT_QTY bqty
left join (select * from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc) where ROWNUM = 1) wb
on 1 = 1
where to_char(DAY, 'yyyy-MM-dd') = to_char(sysdate, 'yyyy-MM-dd')
union
select count(1) as qty,'实际' as name
from IMOS.IMOS_PR_PRODUCT_BARCODE
where to_char(PRODUCTION_DATE, 'yyyy-MM-dd') = to_char(sysdate, 'yyyy-MM-dd')
</select>
<select id="zz_countNightProductInTag" resultType="integer">
select case
when sysdate &lt; W_END then 0
else QTY_B
end as qty
from haiwei.BASE_PRODUCT_QTY bqty
left join (select * from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc) where ROWNUM = 1) wb
on 1 = 1
where to_char(DAY, 'yyyy-MM-dd') = to_char(sysdate, 'yyyy-MM-dd')
</select>
<select id="zz_selectInStoreOrderInfo" resultType="com.ruoyi.system.domain.OrderInfo">
select ippi.ORDER_NO as plan_code,

@ -17,11 +17,18 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">目标数量:</label>
<label class="col-sm-3 control-label">白班目标数量:</label>
<div class="col-sm-8">
<input name="qty" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">夜班目标数量:</label>
<div class="col-sm-8">
<input name="qtyB" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />

@ -72,8 +72,13 @@
},
{
field: 'qty',
title: '目标数量'
title: '白班目标数量'
},
{
field: 'qtyB',
title: '夜班目标数量'
},
{
field: 'createTime',
title: '创建时间'

@ -18,11 +18,18 @@
<!-- </div>-->
<!-- </div>-->
<div class="form-group">
<label class="col-sm-3 control-label">目标数量:</label>
<label class="col-sm-3 control-label">白班目标数量:</label>
<div class="col-sm-8">
<input name="qty" th:field="*{qty}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">夜班目标数量:</label>
<div class="col-sm-8">
<input name="qtyB" th:field="*{qtyB}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />

Loading…
Cancel
Save