mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
禅道bug#1704修复、生产端分析页所有时间区间都适配开始000000~结束235959
This commit is contained in:
+9
-1
@@ -13,8 +13,8 @@ import co.elastic.clients.elasticsearch.core.SearchResponse;
|
|||||||
import co.elastic.clients.util.NamedValue;
|
import co.elastic.clients.util.NamedValue;
|
||||||
import com.cf.imes.framework.common.enums.OrderStatusEnum;
|
import com.cf.imes.framework.common.enums.OrderStatusEnum;
|
||||||
import com.cf.imes.framework.common.enums.StatisticsUnit;
|
import com.cf.imes.framework.common.enums.StatisticsUnit;
|
||||||
|
import com.cf.imes.framework.common.util.date.LocalDateTimeUtils;
|
||||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
|
|
||||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderGoodsPlateRespVO;
|
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderGoodsPlateRespVO;
|
||||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderStatisticsAreaRespVO;
|
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderStatisticsAreaRespVO;
|
||||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderStatisticsReqVO;
|
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderStatisticsReqVO;
|
||||||
@@ -118,6 +118,7 @@ public class OrderStatisticsServiceImpl implements OrderStatisticsService {
|
|||||||
// 所有的日期集合
|
// 所有的日期集合
|
||||||
List<String> dateList = getDateList(reqVO);
|
List<String> dateList = getDateList(reqVO);
|
||||||
|
|
||||||
|
reqVO.setCreateTimeForQry(LocalDateTimeUtils.generateTimeSection(reqVO.getCreateTime()));
|
||||||
// 查询订单状态统计数据
|
// 查询订单状态统计数据
|
||||||
List<OrderStatisticsStatusRespVO> orderStatusRespVOS = orderStatisticsMapper.selectOrderStatusCountGroupBy(reqVO);
|
List<OrderStatisticsStatusRespVO> orderStatusRespVOS = orderStatisticsMapper.selectOrderStatusCountGroupBy(reqVO);
|
||||||
|
|
||||||
@@ -167,9 +168,12 @@ public class OrderStatisticsServiceImpl implements OrderStatisticsService {
|
|||||||
// 所有的日期集合
|
// 所有的日期集合
|
||||||
List<String> dateList = getDateList(reqVO);
|
List<String> dateList = getDateList(reqVO);
|
||||||
|
|
||||||
|
reqVO.setCreateTimeForQry(LocalDateTimeUtils.generateTimeSection(reqVO.getCreateTime()));
|
||||||
|
// 查询订单单量
|
||||||
Map<String, List<OrderStatisticsStatusRespVO>> orderRespMap = orderStatisticsMapper.selectOrderCountGroupByOrderDate(reqVO).stream()
|
Map<String, List<OrderStatisticsStatusRespVO>> orderRespMap = orderStatisticsMapper.selectOrderCountGroupByOrderDate(reqVO).stream()
|
||||||
.sorted(Comparator.naturalOrder())
|
.sorted(Comparator.naturalOrder())
|
||||||
.collect(Collectors.groupingBy(OrderStatisticsStatusRespVO::getDate, LinkedHashMap::new, Collectors.toList()));
|
.collect(Collectors.groupingBy(OrderStatisticsStatusRespVO::getDate, LinkedHashMap::new, Collectors.toList()));
|
||||||
|
// 查询排单单量
|
||||||
Map<String, List<OrderPlanStatisticsCountRespVO>> planRespMap = planMapper.selectPlanCountGroupByCreateTime(reqVO).stream()
|
Map<String, List<OrderPlanStatisticsCountRespVO>> planRespMap = planMapper.selectPlanCountGroupByCreateTime(reqVO).stream()
|
||||||
.sorted(Comparator.naturalOrder())
|
.sorted(Comparator.naturalOrder())
|
||||||
.collect(Collectors.groupingBy(OrderPlanStatisticsCountRespVO::getDate, LinkedHashMap::new, Collectors.toList()));
|
.collect(Collectors.groupingBy(OrderPlanStatisticsCountRespVO::getDate, LinkedHashMap::new, Collectors.toList()));
|
||||||
@@ -220,6 +224,7 @@ public class OrderStatisticsServiceImpl implements OrderStatisticsService {
|
|||||||
// 所有的日期集合
|
// 所有的日期集合
|
||||||
List<String> dateList = getDateList(reqVO);
|
List<String> dateList = getDateList(reqVO);
|
||||||
|
|
||||||
|
reqVO.setCreateTimeForQry(LocalDateTimeUtils.generateTimeSection(reqVO.getCreateTime()));
|
||||||
Map<String, List<OrderStatisticsAreaRespVO>> orderRespMap = orderStatisticsMapper.selectOrderAreaGroupByOrderDate(reqVO).stream()
|
Map<String, List<OrderStatisticsAreaRespVO>> orderRespMap = orderStatisticsMapper.selectOrderAreaGroupByOrderDate(reqVO).stream()
|
||||||
.sorted(Comparator.naturalOrder())
|
.sorted(Comparator.naturalOrder())
|
||||||
.collect(Collectors.groupingBy(OrderStatisticsAreaRespVO::getDate, LinkedHashMap::new, Collectors.toList()));
|
.collect(Collectors.groupingBy(OrderStatisticsAreaRespVO::getDate, LinkedHashMap::new, Collectors.toList()));
|
||||||
@@ -269,6 +274,7 @@ public class OrderStatisticsServiceImpl implements OrderStatisticsService {
|
|||||||
// 所有的日期集合
|
// 所有的日期集合
|
||||||
List<String> dateList = getDateList(reqVO);
|
List<String> dateList = getDateList(reqVO);
|
||||||
|
|
||||||
|
reqVO.setCreateTimeForQry(LocalDateTimeUtils.generateTimeSection(reqVO.getCreateTime()));
|
||||||
// 查询时间段内数量最多的小板,列出数量前10的goods_id
|
// 查询时间段内数量最多的小板,列出数量前10的goods_id
|
||||||
List<String> topTenCountGoodsId = orderPlateStatisticsMapper.selectPlateCountList(reqVO).stream()
|
List<String> topTenCountGoodsId = orderPlateStatisticsMapper.selectPlateCountList(reqVO).stream()
|
||||||
.map(OrderGoodsPlateRespVO::getGoodsId)
|
.map(OrderGoodsPlateRespVO::getGoodsId)
|
||||||
@@ -342,6 +348,7 @@ public class OrderStatisticsServiceImpl implements OrderStatisticsService {
|
|||||||
// 所有的日期集合
|
// 所有的日期集合
|
||||||
List<String> dateList = getDateList(reqVO);
|
List<String> dateList = getDateList(reqVO);
|
||||||
|
|
||||||
|
reqVO.setCreateTimeForQry(LocalDateTimeUtils.generateTimeSection(reqVO.getCreateTime()));
|
||||||
// 查询时间段内面积最多的小板,列出前10面积的goods_id
|
// 查询时间段内面积最多的小板,列出前10面积的goods_id
|
||||||
List<String> topTenCountGoodsId = orderPlateStatisticsMapper.selectPlateAreaList(reqVO).stream()
|
List<String> topTenCountGoodsId = orderPlateStatisticsMapper.selectPlateAreaList(reqVO).stream()
|
||||||
.map(OrderGoodsPlateRespVO::getGoodsId)
|
.map(OrderGoodsPlateRespVO::getGoodsId)
|
||||||
@@ -415,6 +422,7 @@ public class OrderStatisticsServiceImpl implements OrderStatisticsService {
|
|||||||
// 所有的日期集合
|
// 所有的日期集合
|
||||||
List<String> dateList = getDateList(reqVO);
|
List<String> dateList = getDateList(reqVO);
|
||||||
|
|
||||||
|
reqVO.setCreateTimeForQry(LocalDateTimeUtils.generateTimeSection(reqVO.getCreateTime()));
|
||||||
// 查询满足时间条件的最大用量材质编号
|
// 查询满足时间条件的最大用量材质编号
|
||||||
List<String> goodsCodes = planMapper.selectPlanGoodsTopTen(reqVO);
|
List<String> goodsCodes = planMapper.selectPlanGoodsTopTen(reqVO);
|
||||||
|
|
||||||
|
|||||||
+5
-6
@@ -15,7 +15,7 @@
|
|||||||
,CONCAT(YEAR(o.order_date), '-', MONTH(o.order_date)) as date
|
,CONCAT(YEAR(o.order_date), '-', MONTH(o.order_date)) as date
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@WEEK.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@WEEK.getValue()">
|
||||||
,CONCAT(YEAR(o.order_date), '-', MONTH(o.order_date), '-', WEEK(o.order_date, 1)) AS date
|
,CONCAT(YEAR(o.order_date), '-', MONTH(o.order_date), '-', FLOOR((DayOfMonth(o.order_date)-1)/7)+1) AS date
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@DAY.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@DAY.getValue()">
|
||||||
,CONCAT(YEAR(o.order_date), '-', MONTH(o.order_date), '-', DAY(o.order_date)) as date
|
,CONCAT(YEAR(o.order_date), '-', MONTH(o.order_date), '-', DAY(o.order_date)) as date
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
count(o.id) as orderCount
|
count(o.id) as orderCount
|
||||||
<include refid="dateFormat"/>
|
<include refid="dateFormat"/>
|
||||||
from orders o
|
from orders o
|
||||||
where o.order_date between #{req.createTime[0]} and DATE_FORMAT(STR_TO_DATE(CONCAT(DATE_FORMAT(#{req.createTime[1]}, '%Y-%m-%d'), ' 23:59:59'), '%Y-%m-%d %H:%i:%s'), '%Y-%m-%d %H:%i:%s')
|
where o.order_date between #{req.createTimeForQry[0]} and #{req.createTimeForQry[1]}
|
||||||
and o.deleted = 0
|
and o.deleted = 0
|
||||||
group by orderStatus, date;
|
group by orderStatus, date;
|
||||||
</select>
|
</select>
|
||||||
@@ -38,18 +38,17 @@
|
|||||||
select count(o.id) as orderCount
|
select count(o.id) as orderCount
|
||||||
<include refid="dateFormat"/>
|
<include refid="dateFormat"/>
|
||||||
from orders o
|
from orders o
|
||||||
where o.order_date between #{req.createTime[0]} and DATE_FORMAT(STR_TO_DATE(CONCAT(DATE_FORMAT(#{req.createTime[1]}, '%Y-%m-%d'), ' 23:59:59'), '%Y-%m-%d %H:%i:%s'), '%Y-%m-%d %H:%i:%s')
|
where o.order_date between #{req.createTimeForQry[0]} and #{req.createTimeForQry[1]}
|
||||||
and o.deleted = 0
|
and o.deleted = 0
|
||||||
group by date;
|
group by date;
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectOrderAreaGroupByOrderDate"
|
<select id="selectOrderAreaGroupByOrderDate"
|
||||||
resultType="com.cf.imes.module.executor.controller.admin.order.vo.order.OrderStatisticsAreaRespVO">
|
resultType="com.cf.imes.module.executor.controller.admin.order.vo.order.OrderStatisticsAreaRespVO">
|
||||||
select sum(op.area) as areaSum
|
select sum(o.area) as areaSum
|
||||||
<include refid="dateFormat"/>
|
<include refid="dateFormat"/>
|
||||||
from orders o
|
from orders o
|
||||||
join order_plate op on op.order_id = o.id
|
where o.order_date between #{req.createTimeForQry[0]} and #{req.createTimeForQry[1]}
|
||||||
where o.order_date between #{req.createTime[0]} and DATE_FORMAT(STR_TO_DATE(CONCAT(DATE_FORMAT(#{req.createTime[1]}, '%Y-%m-%d'), ' 23:59:59'), '%Y-%m-%d %H:%i:%s'), '%Y-%m-%d %H:%i:%s')
|
|
||||||
and o.deleted = 0
|
and o.deleted = 0
|
||||||
group by date;
|
group by date;
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
+5
-7
@@ -63,14 +63,14 @@
|
|||||||
,CONCAT(YEAR(p.create_time), '-', MONTH(p.create_time), '-', DAY(p.create_time)) as date
|
,CONCAT(YEAR(p.create_time), '-', MONTH(p.create_time), '-', DAY(p.create_time)) as date
|
||||||
</if>
|
</if>
|
||||||
from order_plan p
|
from order_plan p
|
||||||
where p.create_time between #{req.createTime[0]} and #{req.createTime[1]}
|
where p.create_time between #{req.createTimeForQry[0]} and #{req.createTimeForQry[1]}
|
||||||
and p.deleted = 0
|
and p.deleted = 0
|
||||||
group by date;
|
group by date;
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectPlanAreaGroupByCreateTime"
|
<select id="selectPlanAreaGroupByCreateTime"
|
||||||
resultType="com.cf.imes.module.executor.controller.admin.plan.vo.OrderPlanStatisticsAreaRespVO">
|
resultType="com.cf.imes.module.executor.controller.admin.plan.vo.OrderPlanStatisticsAreaRespVO">
|
||||||
select sum(op.area) areaSum
|
select sum(p.plate_area) areaSum
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@QUARTER.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@QUARTER.getValue()">
|
||||||
,CONCAT(YEAR(p.create_time), '-', QUARTER(p.create_time)) as date
|
,CONCAT(YEAR(p.create_time), '-', QUARTER(p.create_time)) as date
|
||||||
</if>
|
</if>
|
||||||
@@ -84,9 +84,7 @@
|
|||||||
,CONCAT(YEAR(p.create_time), '-', MONTH(p.create_time), '-', DAY(p.create_time)) as date
|
,CONCAT(YEAR(p.create_time), '-', MONTH(p.create_time), '-', DAY(p.create_time)) as date
|
||||||
</if>
|
</if>
|
||||||
from order_plan p
|
from order_plan p
|
||||||
join order_goods g on g.plan_id = p.id
|
where p.create_time between #{req.createTimeForQry[0]} and #{req.createTimeForQry[1]}
|
||||||
join order_plate op on op.goods_id = g.id
|
|
||||||
where p.create_time between #{req.createTime[0]} and #{req.createTime[1]}
|
|
||||||
and p.deleted = 0
|
and p.deleted = 0
|
||||||
group by date;
|
group by date;
|
||||||
</select>
|
</select>
|
||||||
@@ -356,7 +354,7 @@
|
|||||||
WHERE deleted = false
|
WHERE deleted = false
|
||||||
AND optimize_goods_id IS NOT NULL
|
AND optimize_goods_id IS NOT NULL
|
||||||
AND optimize_goods_id != ''
|
AND optimize_goods_id != ''
|
||||||
AND optimize_time BETWEEN #{req.createTime[0]} AND #{req.createTime[1]}
|
AND optimize_time between #{req.createTimeForQry[0]} and #{req.createTimeForQry[1]}
|
||||||
GROUP BY optimize_goods_id
|
GROUP BY optimize_goods_id
|
||||||
ORDER BY totalScheduledBoardNum DESC
|
ORDER BY totalScheduledBoardNum DESC
|
||||||
LIMIT 10
|
LIMIT 10
|
||||||
@@ -384,7 +382,7 @@
|
|||||||
|
|
||||||
FROM order_plan p
|
FROM order_plan p
|
||||||
WHERE p.deleted = false
|
WHERE p.deleted = false
|
||||||
AND p.optimize_time BETWEEN #{req.createTime[0]} AND #{req.createTime[1]}
|
AND p.optimize_time between #{req.createTimeForQry[0]} and #{req.createTimeForQry[1]}
|
||||||
AND p.optimize_goods_id IN
|
AND p.optimize_goods_id IN
|
||||||
<foreach collection="goodsCodes" item="goodsCode" open="(" separator="," close=")">
|
<foreach collection="goodsCodes" item="goodsCode" open="(" separator="," close=")">
|
||||||
#{goodsCode}
|
#{goodsCode}
|
||||||
|
|||||||
+4
-4
@@ -8,7 +8,7 @@
|
|||||||
left join order_plate a ON g.id = a.goods_id and a.deleted = 0
|
left join order_plate a ON g.id = a.goods_id and a.deleted = 0
|
||||||
join orders o ON o.id = a.order_id and o.deleted = 0
|
join orders o ON o.id = a.order_id and o.deleted = 0
|
||||||
where g.deleted = 0
|
where g.deleted = 0
|
||||||
and o.order_date between #{req.createTime[0]} and #{req.createTime[1]}
|
and o.order_date between #{req.createTimeForQry[0]} and #{req.createTimeForQry[1]}
|
||||||
group by g.goods_id
|
group by g.goods_id
|
||||||
order by orderCount desc
|
order by orderCount desc
|
||||||
limit 10;
|
limit 10;
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
LEFT JOIN order_plate a ON g.id = a.goods_id and a.deleted = 0
|
LEFT JOIN order_plate a ON g.id = a.goods_id and a.deleted = 0
|
||||||
JOIN orders o ON o.id = a.order_id and o.deleted = 0
|
JOIN orders o ON o.id = a.order_id and o.deleted = 0
|
||||||
WHERE g.deleted = 0
|
WHERE g.deleted = 0
|
||||||
AND o.order_date BETWEEN #{req.createTime[0]} AND #{req.createTime[1]}
|
AND o.order_date between #{req.createTimeForQry[0]} and #{req.createTimeForQry[1]}
|
||||||
and g.goods_id in
|
and g.goods_id in
|
||||||
<foreach item="goodsId" collection="goodsIds" open="(" separator="," close=")">
|
<foreach item="goodsId" collection="goodsIds" open="(" separator="," close=")">
|
||||||
#{goodsId}
|
#{goodsId}
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
left join order_plate a ON g.id = a.goods_id and a.deleted = 0
|
left join order_plate a ON g.id = a.goods_id and a.deleted = 0
|
||||||
left join orders o ON o.id = a.order_id and o.deleted = 0
|
left join orders o ON o.id = a.order_id and o.deleted = 0
|
||||||
where g.deleted = 0
|
where g.deleted = 0
|
||||||
and o.order_date between #{req.createTime[0]} and #{req.createTime[1]}
|
and o.order_date between #{req.createTimeForQry[0]} and #{req.createTimeForQry[1]}
|
||||||
group by g.goods_id
|
group by g.goods_id
|
||||||
order by orderArea desc
|
order by orderArea desc
|
||||||
limit 10;
|
limit 10;
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
LEFT JOIN order_plate a ON g.id = a.goods_id and a.deleted = 0
|
LEFT JOIN order_plate a ON g.id = a.goods_id and a.deleted = 0
|
||||||
LEFT JOIN orders o ON o.id = a.order_id and o.deleted = 0
|
LEFT JOIN orders o ON o.id = a.order_id and o.deleted = 0
|
||||||
WHERE g.deleted = 0
|
WHERE g.deleted = 0
|
||||||
AND o.order_date BETWEEN #{req.createTime[0]} AND #{req.createTime[1]}
|
AND o.order_date between #{req.createTimeForQry[0]} and #{req.createTimeForQry[1]}
|
||||||
and g.goods_id in
|
and g.goods_id in
|
||||||
<foreach item="goodsId" collection="goodsIds" open="(" separator="," close=")">
|
<foreach item="goodsId" collection="goodsIds" open="(" separator="," close=")">
|
||||||
#{goodsId}
|
#{goodsId}
|
||||||
|
|||||||
Reference in New Issue
Block a user