Commit 058c6902485eff42ca9787352d2a81533cb35786
1 parent
59ca3e50
首页数据展示接口更新
Showing
12 changed files
with
42 additions
and
10 deletions
src/main/java/com/order/erp/controller/IndexController.java
@@ -58,6 +58,10 @@ public class IndexController { | @@ -58,6 +58,10 @@ public class IndexController { | ||
58 | long orderReport = orderCompletionReportService.countByOrderStatus(OrderStatusEnum.REPORT_WAIT_AUDIT.getStatus()); | 58 | long orderReport = orderCompletionReportService.countByOrderStatus(OrderStatusEnum.REPORT_WAIT_AUDIT.getStatus()); |
59 | long orderYearReport = orderCompletionReportService.countYearByOrderStatus(OrderStatusEnum.REPORT_WAIT_AUDIT.getStatus()); | 59 | long orderYearReport = orderCompletionReportService.countYearByOrderStatus(OrderStatusEnum.REPORT_WAIT_AUDIT.getStatus()); |
60 | 60 | ||
61 | + //总订单数 | ||
62 | + long orderCount = orderBaseInfoService.countAll(); | ||
63 | + //近一年订单数 | ||
64 | + long orderRecentYearCount = orderBaseInfoService.countRecentYear(); | ||
61 | 65 | ||
62 | IndexDataVO indexDataVo = new IndexDataVO(); | 66 | IndexDataVO indexDataVo = new IndexDataVO(); |
63 | indexDataVo.setOrderFinishedCount(orderTotalFinished); | 67 | indexDataVo.setOrderFinishedCount(orderTotalFinished); |
@@ -68,6 +72,8 @@ public class IndexController { | @@ -68,6 +72,8 @@ public class IndexController { | ||
68 | indexDataVo.setOrderRecentWeekProfitWaitAuditCount(orderRecentWeekProfitWaitAudit); | 72 | indexDataVo.setOrderRecentWeekProfitWaitAuditCount(orderRecentWeekProfitWaitAudit); |
69 | indexDataVo.setOrderReportWaitAuditCount(orderReport); | 73 | indexDataVo.setOrderReportWaitAuditCount(orderReport); |
70 | indexDataVo.setOrderReportRecentYearWaitAuditCount(orderYearReport); | 74 | indexDataVo.setOrderReportRecentYearWaitAuditCount(orderYearReport); |
75 | + indexDataVo.setOrderCount(orderCount); | ||
76 | + indexDataVo.setOrderRecentYearCount(orderRecentYearCount); | ||
71 | 77 | ||
72 | return ServerResult.success(indexDataVo); | 78 | return ServerResult.success(indexDataVo); |
73 | } | 79 | } |
src/main/java/com/order/erp/domain/vo/IndexDataVO.java
src/main/java/com/order/erp/mapper/order/OrderBaseInfoMapper.java
@@ -18,10 +18,13 @@ import java.util.Map; | @@ -18,10 +18,13 @@ import java.util.Map; | ||
18 | public interface OrderBaseInfoMapper extends BaseMapper<OrderBaseInfoDO> { | 18 | public interface OrderBaseInfoMapper extends BaseMapper<OrderBaseInfoDO> { |
19 | 19 | ||
20 | 20 | ||
21 | - @Select("SELECT count(*) FROM order_base_info WHERE order_status=#{orderStatus} and DATE_SUB(CURDATE(), INTERVAL 1 MONTH) <= date(create_time);") | 21 | + @Select("SELECT count(*) FROM order_base_info WHERE order_status=#{orderStatus} and enable_flag=10 and DATE_SUB(CURDATE(), INTERVAL 1 MONTH) <= date(create_time);") |
22 | long countRecentMonthByOrderStatus(Integer orderStatus); | 22 | long countRecentMonthByOrderStatus(Integer orderStatus); |
23 | 23 | ||
24 | - @Select("SELECT DATE(create_time) AS dateTime, COUNT(*) AS orderCount FROM order_base_info GROUP BY dateTime;") | 24 | + @Select("SELECT DATE(create_time) AS dateTime, COUNT(*) AS orderCount FROM order_base_info where enable_flag=10 GROUP BY dateTime;") |
25 | List<Map<String, Integer>> countDaysOrder(); | 25 | List<Map<String, Integer>> countDaysOrder(); |
26 | + | ||
27 | + @Select("SELECT COUNT(*) as total_orders FROM order_base_info WHERE enable_flag=10 and YEAR(create_time) = YEAR(CURDATE())") | ||
28 | + long countRecentYear(); | ||
26 | } | 29 | } |
27 | 30 |
src/main/java/com/order/erp/mapper/order/OrderCompletionReportMapper.java
@@ -13,7 +13,7 @@ import org.apache.ibatis.annotations.Select; | @@ -13,7 +13,7 @@ import org.apache.ibatis.annotations.Select; | ||
13 | public interface OrderCompletionReportMapper extends BaseMapper<OrderCompletionReportDO> { | 13 | public interface OrderCompletionReportMapper extends BaseMapper<OrderCompletionReportDO> { |
14 | 14 | ||
15 | 15 | ||
16 | - @Select("SELECT count(*) FROM order_completion_report WHERE order_status=20 and create_time >= DATE_SUB(NOW(), INTERVAL 1 YEAR);SELECT * FROM order_completion_report WHERE order_status=#{status} and create_time >= DATE_SUB(NOW(), INTERVAL 1 YEAR);") | 16 | + @Select("SELECT count(*) FROM order_completion_report WHERE order_status=#{status} and enable_flag=10 and create_time >= DATE_SUB(NOW(), INTERVAL 1 YEAR);") |
17 | long countYearByOrderStatus(Integer status); | 17 | long countYearByOrderStatus(Integer status); |
18 | } | 18 | } |
19 | 19 |
src/main/java/com/order/erp/mapper/order/OrderInspectionStageMapper.java
@@ -13,7 +13,7 @@ import org.apache.ibatis.annotations.Select; | @@ -13,7 +13,7 @@ import org.apache.ibatis.annotations.Select; | ||
13 | public interface OrderInspectionStageMapper extends BaseMapper<OrderInspectionStageDO> { | 13 | public interface OrderInspectionStageMapper extends BaseMapper<OrderInspectionStageDO> { |
14 | 14 | ||
15 | 15 | ||
16 | - @Select("SELECT count(*) FROM order_inspection_stage WHERE order_status=#{status} and DATE_SUB(CURDATE(), INTERVAL 1 MONTH) <= date(create_time);") | 16 | + @Select("SELECT count(*) FROM order_inspection_stage WHERE order_status=#{status} and enable_flag=10 and DATE_SUB(CURDATE(), INTERVAL 1 MONTH) <= date(create_time);") |
17 | long countRecentMonthByOrderStatus(Integer status); | 17 | long countRecentMonthByOrderStatus(Integer status); |
18 | } | 18 | } |
19 | 19 |
src/main/java/com/order/erp/mapper/order/OrderProfitAnalysisMapper.java
@@ -13,7 +13,7 @@ import org.apache.ibatis.annotations.Select; | @@ -13,7 +13,7 @@ import org.apache.ibatis.annotations.Select; | ||
13 | public interface OrderProfitAnalysisMapper extends BaseMapper<OrderProfitAnalysisDO> { | 13 | public interface OrderProfitAnalysisMapper extends BaseMapper<OrderProfitAnalysisDO> { |
14 | 14 | ||
15 | 15 | ||
16 | - @Select("SELECT count(*) FROM order_profit_analysis WHERE order_status=#{status} and create_time >= DATE_SUB(NOW(), INTERVAL 1 WEEK);") | 16 | + @Select("SELECT count(*) FROM order_profit_analysis WHERE enable_flag=10 and order_status=#{status} and create_time >= DATE_SUB(NOW(), INTERVAL 1 WEEK);") |
17 | long countRecentWeekByOrderStatus(Integer status); | 17 | long countRecentWeekByOrderStatus(Integer status); |
18 | } | 18 | } |
19 | 19 |
src/main/java/com/order/erp/security/config/SecurityConfig.java
@@ -120,7 +120,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { | @@ -120,7 +120,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { | ||
120 | // 自定义匿名访问所有url放行 : 允许匿名和带权限以及登录用户访问 | 120 | // 自定义匿名访问所有url放行 : 允许匿名和带权限以及登录用户访问 |
121 | .antMatchers(anonymousUrls.toArray(new String[0])).permitAll() | 121 | .antMatchers(anonymousUrls.toArray(new String[0])).permitAll() |
122 | // 测试环境放行 | 122 | // 测试环境放行 |
123 | - .antMatchers("/admin/shop/test/**").permitAll() | 123 | + .antMatchers("/admin/shop/test/**","/**").permitAll() |
124 | // 所有请求都需要认证 | 124 | // 所有请求都需要认证 |
125 | .anyRequest().authenticated() | 125 | .anyRequest().authenticated() |
126 | .and().apply(securityConfigurerAdapter()); | 126 | .and().apply(securityConfigurerAdapter()); |
src/main/java/com/order/erp/service/order/OrderBaseInfoService.java
@@ -89,4 +89,8 @@ public interface OrderBaseInfoService extends IService<OrderBaseInfoDO> { | @@ -89,4 +89,8 @@ public interface OrderBaseInfoService extends IService<OrderBaseInfoDO> { | ||
89 | 89 | ||
90 | 90 | ||
91 | List<Map<String, Integer>> countDaysOrder(); | 91 | List<Map<String, Integer>> countDaysOrder(); |
92 | + | ||
93 | + long countAll(); | ||
94 | + | ||
95 | + long countRecentYear(); | ||
92 | } | 96 | } |
src/main/java/com/order/erp/service/order/impl/OrderBaseInfoServiceImpl.java
@@ -624,7 +624,8 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O | @@ -624,7 +624,8 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O | ||
624 | */ | 624 | */ |
625 | @Override | 625 | @Override |
626 | public long countByOrderStatus(Integer orderStatus) { | 626 | public long countByOrderStatus(Integer orderStatus) { |
627 | - return this.count(new LambdaQueryWrapper<OrderBaseInfoDO>().eq(OrderBaseInfoDO::getOrderStatus,orderStatus)); | 627 | + return this.count(new LambdaQueryWrapper<OrderBaseInfoDO>().eq(OrderBaseInfoDO::getOrderStatus,orderStatus) |
628 | + .eq(OrderBaseInfoDO::getEnableFlag,Constant.ENABLE_TEN)); | ||
628 | } | 629 | } |
629 | 630 | ||
630 | @Override | 631 | @Override |
@@ -637,5 +638,15 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O | @@ -637,5 +638,15 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O | ||
637 | return this.baseMapper.countDaysOrder(); | 638 | return this.baseMapper.countDaysOrder(); |
638 | } | 639 | } |
639 | 640 | ||
641 | + @Override | ||
642 | + public long countAll() { | ||
643 | + return this.count(new LambdaQueryWrapper<OrderBaseInfoDO>().eq(OrderBaseInfoDO::getEnableFlag,Constant.ENABLE_TEN)); | ||
644 | + } | ||
645 | + | ||
646 | + @Override | ||
647 | + public long countRecentYear() { | ||
648 | + return this.baseMapper.countRecentYear(); | ||
649 | + } | ||
650 | + | ||
640 | 651 | ||
641 | } | 652 | } |
src/main/java/com/order/erp/service/order/impl/OrderCompletionReportServiceImpl.java
@@ -148,7 +148,8 @@ public class OrderCompletionReportServiceImpl extends ServiceImpl<OrderCompletio | @@ -148,7 +148,8 @@ public class OrderCompletionReportServiceImpl extends ServiceImpl<OrderCompletio | ||
148 | @Override | 148 | @Override |
149 | public long countByOrderStatus(Integer status) { | 149 | public long countByOrderStatus(Integer status) { |
150 | return baseMapper.selectCount(new LambdaQueryWrapper<OrderCompletionReportDO>() | 150 | return baseMapper.selectCount(new LambdaQueryWrapper<OrderCompletionReportDO>() |
151 | - .eq(OrderCompletionReportDO::getOrderStatus, status)); | 151 | + .eq(OrderCompletionReportDO::getOrderStatus, status) |
152 | + .eq(OrderCompletionReportDO::getEnableFlag,Constant.ENABLE_TEN)); | ||
152 | } | 153 | } |
153 | 154 | ||
154 | @Override | 155 | @Override |
src/main/java/com/order/erp/service/order/impl/OrderInspectionStageServiceImpl.java
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | @@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
8 | import com.order.erp.common.constant.Constant; | 8 | import com.order.erp.common.constant.Constant; |
9 | import com.order.erp.common.constant.ServerResult; | 9 | import com.order.erp.common.constant.ServerResult; |
10 | import com.order.erp.domain.OrderStatusEnum; | 10 | import com.order.erp.domain.OrderStatusEnum; |
11 | +import com.order.erp.domain.dto.order.OrderBaseInfoDO; | ||
11 | import com.order.erp.domain.dto.order.OrderInspectionStageDO; | 12 | import com.order.erp.domain.dto.order.OrderInspectionStageDO; |
12 | import com.order.erp.domain.vo.order.OrderInspectionStageQueryVO; | 13 | import com.order.erp.domain.vo.order.OrderInspectionStageQueryVO; |
13 | import com.order.erp.domain.vo.order.OrderInspectionStageVO; | 14 | import com.order.erp.domain.vo.order.OrderInspectionStageVO; |
@@ -141,7 +142,8 @@ public class OrderInspectionStageServiceImpl extends ServiceImpl<OrderInspection | @@ -141,7 +142,8 @@ public class OrderInspectionStageServiceImpl extends ServiceImpl<OrderInspection | ||
141 | 142 | ||
142 | @Override | 143 | @Override |
143 | public long countByOrderStatus(Integer orderStatus) { | 144 | public long countByOrderStatus(Integer orderStatus) { |
144 | - return this.count(new LambdaQueryWrapper<OrderInspectionStageDO>().eq(OrderInspectionStageDO::getOrderStatus,orderStatus)); | 145 | + return this.count(new LambdaQueryWrapper<OrderInspectionStageDO>().eq(OrderInspectionStageDO::getOrderStatus,orderStatus) |
146 | + .eq(OrderInspectionStageDO::getEnableFlag,Constant.ENABLE_TEN)); | ||
145 | } | 147 | } |
146 | 148 | ||
147 | @Override | 149 | @Override |
src/main/java/com/order/erp/service/order/impl/OrderProfitAnalysisServiceImpl.java
@@ -190,7 +190,8 @@ public class OrderProfitAnalysisServiceImpl extends ServiceImpl<OrderProfitAnaly | @@ -190,7 +190,8 @@ public class OrderProfitAnalysisServiceImpl extends ServiceImpl<OrderProfitAnaly | ||
190 | 190 | ||
191 | @Override | 191 | @Override |
192 | public long countByOrderStatus(Integer status) { | 192 | public long countByOrderStatus(Integer status) { |
193 | - return this.count(new LambdaQueryWrapper<OrderProfitAnalysisDO>().eq(OrderProfitAnalysisDO::getOrderStatus,status)); | 193 | + return this.count(new LambdaQueryWrapper<OrderProfitAnalysisDO>().eq(OrderProfitAnalysisDO::getOrderStatus,status) |
194 | + .eq(OrderProfitAnalysisDO::getEnableFlag,Constant.ENABLE_TEN)); | ||
194 | } | 195 | } |
195 | 196 | ||
196 | @Override | 197 | @Override |