Преглед на файлове

Merge branch 'dev-lzl' of https://e.coding.net/chuanghaikeji/moxuanyunshangwaimai/backend into dev-lzl

liu преди 1 година
родител
ревизия
f61ce8687f
променени са 40 файла, в които са добавени 823 реда и са изтрити 308 реда
  1. 41 0
      db/insert_241011.sql
  2. 7 6
      src/main/java/com/sqx/modules/datacentre/controller/DataCentreController.java
  3. 8 7
      src/main/java/com/sqx/modules/datacentre/dao/DataCentreDao.java
  4. 3 0
      src/main/java/com/sqx/modules/datacentre/query/DataCenterQuery.java
  5. 3 3
      src/main/java/com/sqx/modules/datacentre/service/DataCentreService.java
  6. 16 15
      src/main/java/com/sqx/modules/datacentre/service/impl/DataCentreServiceImpl.java
  7. 5 4
      src/main/java/com/sqx/modules/errand/controller/TbIndentController.java
  8. 3 1
      src/main/java/com/sqx/modules/errand/dao/ErrandComplaintDao.java
  9. 7 6
      src/main/java/com/sqx/modules/errand/dao/TbIndentDao.java
  10. 3 2
      src/main/java/com/sqx/modules/errand/service/TbIndentService.java
  11. 17 16
      src/main/java/com/sqx/modules/errand/service/impl/TbIndentServiceImpl.java
  12. 3 2
      src/main/java/com/sqx/modules/goods/controller/GoodsShopController.java
  13. 2 1
      src/main/java/com/sqx/modules/goods/service/GoodsShopService.java
  14. 10 9
      src/main/java/com/sqx/modules/goods/service/impl/GoodsShopServiceImpl.java
  15. 1 1
      src/main/java/com/sqx/modules/order/controller/OrderController.java
  16. 3 2
      src/main/java/com/sqx/modules/order/dao/AppOrderDao.java
  17. 3 0
      src/main/java/com/sqx/modules/order/entity/TbOrder.java
  18. 2 0
      src/main/java/com/sqx/modules/order/service/AppOrderService.java
  19. 12 0
      src/main/java/com/sqx/modules/order/service/impl/AppAppOrderServiceImpl.java
  20. 3 2
      src/main/java/com/sqx/modules/pay/controller/CashController.java
  21. 7 6
      src/main/java/com/sqx/modules/pay/controller/query/CashOutQueryDTO.java
  22. 8 7
      src/main/java/com/sqx/modules/pay/controller/query/WalletDetailQuery.java
  23. 4 3
      src/main/java/com/sqx/modules/pay/dao/CashOutDao.java
  24. 2 1
      src/main/java/com/sqx/modules/pay/service/CashOutService.java
  25. 10 9
      src/main/java/com/sqx/modules/pay/service/impl/CashOutServiceImpl.java
  26. 53 33
      src/main/java/com/sqx/modules/printInfo/controller/PrintInfoController.java
  27. 19 0
      src/main/java/com/sqx/modules/printInfo/dao/PrintInfoDetailDao.java
  28. 41 0
      src/main/java/com/sqx/modules/printInfo/entity/PrintInfoDetail.java
  29. 111 0
      src/main/java/com/sqx/modules/printInfo/entity/eOrderStatus.java
  30. 22 0
      src/main/java/com/sqx/modules/printInfo/service/PrintInfoDetailService.java
  31. 50 0
      src/main/java/com/sqx/modules/printInfo/service/impl/PrintInfoDetailServiceImpl.java
  32. 94 42
      src/main/java/com/sqx/modules/utils/fieYun/FeiYunUtils.java
  33. 3 3
      src/main/java/com/sqx/scheduler/export/ExportScheduler.java
  34. 1 1
      src/main/resources/application.yml
  35. 92 50
      src/main/resources/mapper/dataCentre/dataCenterMapper.xml
  36. 12 6
      src/main/resources/mapper/errand/ErrandComplaintMapper.xml
  37. 72 36
      src/main/resources/mapper/errand/TbIndentMapper.xml
  38. 28 16
      src/main/resources/mapper/order/OrderMapper.xml
  39. 36 18
      src/main/resources/mapper/pay/CashDao.xml
  40. 6 0
      src/main/resources/mapper/printInfo/PrintInfoDetailDao.xml

+ 41 - 0
db/insert_241011.sql

@@ -0,0 +1,41 @@
+/*
+ Navicat Premium Data Transfer
+
+ Source Server         : 外卖测试108
+ Source Server Type    : MySQL
+ Source Server Version : 50744
+ Source Host           : 172.16.20.108:3306
+ Source Schema         : tcwm2.5
+
+ Target Server Type    : MySQL
+ Target Server Version : 50744
+ File Encoding         : 65001
+
+ Date: 11/10/2024 11:13:33
+*/
+
+SET NAMES utf8mb4;
+SET FOREIGN_KEY_CHECKS = 0;
+
+-- ----------------------------
+-- Table structure for print_info_detail
+-- ----------------------------
+DROP TABLE IF EXISTS `print_info_detail`;
+CREATE TABLE `print_info_detail`  (
+  `id` int(20) NOT NULL AUTO_INCREMENT COMMENT '打印信息id',
+  `order_no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '订单编号',
+  `order_status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '打印时订单状态',
+  `is_append` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '打印状态是否补打',
+  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+  `delete_flag` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '删除标识;0未删除、1已删除',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 27 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
+
+SET FOREIGN_KEY_CHECKS = 1;
+
+
+ALTER TABLE `tcwm2.5`.`tb_order`
+ADD COLUMN `is_print` int(32) NULL COMMENT '打印状态  已打印:1 未打印:0' AFTER `order_sequence`;
+
+
+update tb_order set is_print = 0;

+ 7 - 6
src/main/java/com/sqx/modules/datacentre/controller/DataCentreController.java

@@ -8,6 +8,7 @@ import com.sqx.modules.app.service.UserMoneyService;
 import com.sqx.modules.coupon.entity.TbCouponUser;
 import com.sqx.modules.coupon.service.TbCouponService;
 import com.sqx.modules.coupon.service.TbCouponUserService;
+import com.sqx.modules.datacentre.query.DataCenterQuery;
 import com.sqx.modules.datacentre.query.ShopCenterQuery;
 import com.sqx.modules.datacentre.service.DataCentreService;
 import com.sqx.modules.errand.service.ErrandComplaintService;
@@ -50,14 +51,14 @@ public class DataCentreController {
 
     @ApiOperation("任务分析")
     @GetMapping(value = "selectOrderData")
-    public Result selectOrderData(String date, String dateType) {
-        return dataCentreService.selectOrderData(date, dateType);
+    public Result selectOrderData(DataCenterQuery query) {
+        return dataCentreService.selectOrderData(query);
     }
 
     @ApiOperation("任务详情分析")
     @GetMapping(value = "/selectOrderAnalyze")
-    public Result selectPayOrderAnalyze(Integer page, Integer limit, String date, String dateType) {
-        return dataCentreService.selectPayOrderAnalyze(page, limit, date, dateType);
+    public Result selectPayOrderAnalyze(DataCenterQuery query) {
+        return dataCentreService.selectPayOrderAnalyze(query);
     }
 
     @ApiOperation("条件筛选所有用户")
@@ -182,9 +183,9 @@ public class DataCentreController {
 
     @ApiOperation("用户统计")
     @GetMapping(value = "selectUserCenter")
-    public Result selectUserCenter(String date, String dateType) {
+    public Result selectUserCenter(DataCenterQuery query) {
 
-        return dataCentreService.selectUserCenter(date, dateType);
+        return dataCentreService.selectUserCenter(query);
     }
 
     @GetMapping(value = "selectUserFeedback")

+ 8 - 7
src/main/java/com/sqx/modules/datacentre/dao/DataCentreDao.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.sqx.modules.app.entity.UserEntity;
 import com.sqx.modules.app.entity.UserMoneyDetails;
+import com.sqx.modules.datacentre.query.DataCenterQuery;
 import com.sqx.modules.datacentre.query.ShopCenterQuery;
 import com.sqx.modules.errand.entity.Feedback;
 import com.sqx.modules.errand.entity.TbIndent;
@@ -35,7 +36,7 @@ public interface DataCentreDao {
 
     int findIndentCount(String format);
 
-    IPage<TbOrder> selectPayOrderAnalyze(Page<TbOrder> pages, String date, String dateType);
+    IPage<TbOrder> selectPayOrderAnalyze(Page<TbOrder> pages, @Param("query") DataCenterQuery query);
 
     int sumOrderMonth(Long userId, String date);
 
@@ -55,9 +56,9 @@ public interface DataCentreDao {
 
     IPage<TbOrder> selectRankingList(Page<TbOrder> pages, @Param("query")ShopCenterQuery query);
 
-    int allUserCount(String date, String dateType);
+    int allUserCount(@Param("query") DataCenterQuery query);
 
-    int phoneUserCount(String date, String dateType);
+    int phoneUserCount(@Param("query") DataCenterQuery query);
 
     IPage<Feedback> selectUserFeedback(Page<Feedback> pages, String userEmail);
 
@@ -89,13 +90,13 @@ public interface DataCentreDao {
 
     BigDecimal sumCashMoney(Long userId, String date);
 
-    int selectTakeCount(Integer orderType,Long shopId, String date, String dateType);
+    int selectTakeCount(Integer orderType,@Param("query") DataCenterQuery query);
 
-    BigDecimal selectTakeMoney(Integer orderType,Long shopId, String date, String dateType);
+    BigDecimal selectTakeMoney(Integer orderType,@Param("query") DataCenterQuery query);
 
-    int cancelOrderCount(Long shopId, String date, String dateType);
+    int cancelOrderCount(@Param("query") DataCenterQuery query);
 
-    BigDecimal cancelOrderMoney(Long shopId, String date, String dateType);
+    BigDecimal cancelOrderMoney(@Param("query") DataCenterQuery query);
 
     List<TbOrder> excelShopCenter(@Param("query")ShopCenterQuery query);
 }

+ 3 - 0
src/main/java/com/sqx/modules/datacentre/query/DataCenterQuery.java

@@ -18,5 +18,8 @@ public class DataCenterQuery extends PageQuery {
 
     @ApiModelProperty(value = "类型")
     private String dateType;
+
+    @ApiModelProperty(value = "商铺id")
+    private Long shopId;
 }
 

+ 3 - 3
src/main/java/com/sqx/modules/datacentre/service/DataCentreService.java

@@ -11,13 +11,13 @@ public interface DataCentreService {
 
     Result dataCentre();
 
-    Result selectPayOrderAnalyze(Integer page, Integer limit, String date, String dateType);
+    Result selectPayOrderAnalyze(DataCenterQuery query);
 
     Result selectAllUser(Integer page, Integer limit, String userName, String phone);
 
     Result selectUserById(Long userId);
 
-    Result selectOrderData(String date, String dateType);
+    Result selectOrderData(DataCenterQuery query);
 
     Result selectTopUpStatistics(String date, String dateType);
 
@@ -33,7 +33,7 @@ public interface DataCentreService {
 
     ExcelData excelShopCenter(ShopCenterQuery queryDTO);
 
-    Result selectUserCenter(String date, String dateType);
+    Result selectUserCenter(DataCenterQuery query);
 
     Result selectUserFeedback(String userEmail, Integer page, Integer limit);
 

+ 16 - 15
src/main/java/com/sqx/modules/datacentre/service/impl/DataCentreServiceImpl.java

@@ -16,6 +16,7 @@ import com.sqx.modules.common.service.CommonInfoService;
 import com.sqx.modules.coupon.dao.TbCouponUserDao;
 import com.sqx.modules.coupon.entity.TbCouponUser;
 import com.sqx.modules.datacentre.dao.DataCentreDao;
+import com.sqx.modules.datacentre.query.DataCenterQuery;
 import com.sqx.modules.datacentre.query.ShopCenterQuery;
 import com.sqx.modules.datacentre.service.DataCentreService;
 import com.sqx.modules.errand.entity.Feedback;
@@ -97,9 +98,9 @@ public class DataCentreServiceImpl implements DataCentreService {
     }
 
     @Override
-    public Result selectPayOrderAnalyze(Integer page, Integer limit, String date, String dateType) {
-        Page<TbOrder> pages=new Page<>(page,limit);
-        PageUtils pageUtils = new PageUtils(dataCentreDao.selectPayOrderAnalyze(pages, date, dateType));
+    public Result selectPayOrderAnalyze(DataCenterQuery query) {
+        Page<TbOrder> pages=new Page<>(query.getPage(),query.getLimit());
+        PageUtils pageUtils = new PageUtils(dataCentreDao.selectPayOrderAnalyze(pages, query));
         return Result.success().put("data", pageUtils);
     }
 
@@ -134,22 +135,22 @@ public class DataCentreServiceImpl implements DataCentreService {
     }
 
     @Override
-    public Result selectOrderData(String date, String dateType) {
+    public Result selectOrderData(DataCenterQuery query) {
         HashMap hashMap = new HashMap();
-        BigDecimal sumMoney = appOrderDao.selectSumMoney(date, dateType,null);
-        int countOrder = appOrderDao.selectCountOrder(date, dateType,null);
+        BigDecimal sumMoney = appOrderDao.selectSumMoney(query);
+        int countOrder = appOrderDao.selectCountOrder(query);
         //到店订单数
-        int takeCount = dataCentreDao.selectTakeCount(1, null, date, dateType);
+        int takeCount = dataCentreDao.selectTakeCount(1, query);
         //外卖订单数
-        int takeCount2 = dataCentreDao.selectTakeCount(2, null, date, dateType);
+        int takeCount2 = dataCentreDao.selectTakeCount(2, query);
         //到店订单金额
-        BigDecimal takeMoney = dataCentreDao.selectTakeMoney(1, null, date, dateType);
+        BigDecimal takeMoney = dataCentreDao.selectTakeMoney(1, query);
         //外卖订单金额
-        BigDecimal takeMoney1 = dataCentreDao.selectTakeMoney(2, null, date, dateType);
+        BigDecimal takeMoney1 = dataCentreDao.selectTakeMoney(2, query);
         //退款订单数
-        int cancelOrderCount = dataCentreDao.cancelOrderCount(null, date, dateType);
+        int cancelOrderCount = dataCentreDao.cancelOrderCount(query);
         //退款金额
-        BigDecimal cancelOrderMoney = dataCentreDao.cancelOrderMoney(null, date, dateType);
+        BigDecimal cancelOrderMoney = dataCentreDao.cancelOrderMoney(query);
         hashMap.put("sumMoney", sumMoney);
         hashMap.put("countOrder", countOrder);
         hashMap.put("takeCount", takeCount);
@@ -281,10 +282,10 @@ public class DataCentreServiceImpl implements DataCentreService {
                 "收益");
     }
     @Override
-    public Result selectUserCenter(String date, String dateType) {
+    public Result selectUserCenter(DataCenterQuery query) {
         HashMap hashMap = new HashMap();
-        int userCount = dataCentreDao.allUserCount(date, dateType);
-        int phoneUserCount = dataCentreDao.phoneUserCount(date, dateType);
+        int userCount = dataCentreDao.allUserCount(query);
+        int phoneUserCount = dataCentreDao.phoneUserCount(query);
         hashMap.put("allUserCount", userCount);
         hashMap.put("phoneUserCount", phoneUserCount);
         return Result.success().put("data", hashMap);

+ 5 - 4
src/main/java/com/sqx/modules/errand/controller/TbIndentController.java

@@ -6,6 +6,7 @@ import com.sqx.modules.app.entity.UserEntity;
 import com.sqx.modules.app.service.UserService;
 import com.sqx.modules.common.entity.CommonInfo;
 import com.sqx.modules.common.service.CommonInfoService;
+import com.sqx.modules.datacentre.query.DataCenterQuery;
 import com.sqx.modules.errand.entity.TbIndent;
 import com.sqx.modules.errand.service.TbIndentService;
 import com.sqx.modules.order.entity.TbOrder;
@@ -96,16 +97,16 @@ public class TbIndentController {
 
     @ApiOperation("任务分析")
     @GetMapping(value = "taskAnalysis")
-    public Result taskAnalysis(String dateType, String date, Integer page, Integer limit, String indentState){
+    public Result taskAnalysis(DataCenterQuery query, String indentState){
 
-        return tbIndentService.taskAnalysis(dateType, date, page, limit, indentState);
+        return tbIndentService.taskAnalysis(query, indentState);
     }
 
     @ApiOperation("订单分析")
     @GetMapping(value = "selectOrderByStatus")
-    public Result selectOrderByStatus(String date, String dateType){
+    public Result selectOrderByStatus(DataCenterQuery query){
 
-        return tbIndentService.selectOrderByStatus(date, dateType);
+        return tbIndentService.selectOrderByStatus(query);
     }
 
     @ApiOperation("骑手收入统计 完成订单数统计")

+ 3 - 1
src/main/java/com/sqx/modules/errand/dao/ErrandComplaintDao.java

@@ -3,8 +3,10 @@ package com.sqx.modules.errand.dao;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.sqx.modules.datacentre.query.DataCenterQuery;
 import com.sqx.modules.errand.entity.ErrandComplaint;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 import java.math.BigDecimal;
 import java.util.List;
@@ -18,7 +20,7 @@ public interface ErrandComplaintDao extends BaseMapper<ErrandComplaint> {
 
     IPage<ErrandComplaint> findAllComplaint(Page<ErrandComplaint> pages, Long userId, Integer illegalId, Integer complaintState, String indentNumber);
 
-    BigDecimal deductMoneySum(String date, String dateType);
+    BigDecimal deductMoneySum(@Param("query") DataCenterQuery query);
 
     List<ErrandComplaint> selectComplaintList(Long userId);
 

+ 7 - 6
src/main/java/com/sqx/modules/errand/dao/TbIndentDao.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.sqx.modules.app.entity.UserEntity;
+import com.sqx.modules.datacentre.query.DataCenterQuery;
 import com.sqx.modules.errand.dto.WaitForAcceptOrderQueryDTO;
 import com.sqx.modules.errand.entity.ErrandAddress;
 import com.sqx.modules.errand.entity.ErrandRedPacket;
@@ -91,15 +92,15 @@ public interface TbIndentDao extends BaseMapper<TbIndent> {
 
     void adminSoldOutIndent(String indentNumber);
 
-    BigDecimal billMoney(@Param("dateType")String dateType, @Param("date") String date);
+    BigDecimal billMoney(@Param("query") DataCenterQuery query);
 
-    BigDecimal receivingMoney(@Param("dateType")String dateType, @Param("date") String date);
+    BigDecimal receivingMoney(@Param("query") DataCenterQuery query) ;
 
-    int billCount(@Param("dateType")String dateType, @Param("date") String date);
+    int billCount(@Param("query") DataCenterQuery query);
 
-    int reveivingCount(@Param("dateType")String dateType, @Param("date") String date);
+    int reveivingCount(@Param("query") DataCenterQuery query);
 
-    IPage<TbIndent> taskAnalysisMoney(Page<TbIndent> pages, @Param("dateType") String dateType, @Param("date") String date,@Param("indentState") String status);
+    IPage<TbIndent> taskAnalysisMoney(Page<TbIndent> pages,@Param("query") DataCenterQuery query,@Param("indentState") String status);
 
     int findAllCount();
 
@@ -117,7 +118,7 @@ public interface TbIndentDao extends BaseMapper<TbIndent> {
 
     int findIndentCount(String format);
 
-    int selectOrderByStatus(String date, String dateType, Integer status);
+    int selectOrderByStatus(@Param("query") DataCenterQuery query, Integer status);
 
     BigDecimal findAdminIncomeday(Long userId, String date, String dateType);
 

+ 3 - 2
src/main/java/com/sqx/modules/errand/service/TbIndentService.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.sqx.common.utils.PageUtils;
 import com.sqx.common.utils.Result;
 import com.sqx.modules.app.entity.UserEntity;
+import com.sqx.modules.datacentre.query.DataCenterQuery;
 import com.sqx.modules.errand.dto.*;
 import com.sqx.modules.errand.entity.ErrandAddress;
 import com.sqx.modules.errand.entity.ErrandEvaluate;
@@ -83,9 +84,9 @@ public interface TbIndentService extends IService<TbIndent> {
 
     Result findDataCenter();
 
-    Result taskAnalysis(String dateType, String date, Integer page, Integer limit, String indentState);
+    Result taskAnalysis(DataCenterQuery query, String indentState);
 
-    Result selectOrderByStatus(String date, String dateType);
+    Result selectOrderByStatus(DataCenterQuery query);
 
     Result findIncome(Long userId, String date, String dateType, Integer page, Integer limit);
 

+ 17 - 16
src/main/java/com/sqx/modules/errand/service/impl/TbIndentServiceImpl.java

@@ -24,6 +24,7 @@ import com.sqx.modules.app.service.UserMoneyDetailsService;
 import com.sqx.modules.app.service.UserService;
 import com.sqx.modules.common.entity.CommonInfo;
 import com.sqx.modules.common.service.CommonInfoService;
+import com.sqx.modules.datacentre.query.DataCenterQuery;
 import com.sqx.modules.errand.dao.ErrandEvaluateDao;
 import com.sqx.modules.errand.dao.TbIndentDao;
 import com.sqx.modules.errand.dto.OrderRiderDeliveryDTO;
@@ -1436,19 +1437,19 @@ public class TbIndentServiceImpl extends ServiceImpl<TbIndentDao, TbIndent> impl
     }
 
     @Override
-    public Result taskAnalysis(String dateType, String date, Integer page, Integer limit, String indentState) {
+    public Result taskAnalysis(DataCenterQuery query, String indentState) {
         HashMap hashMap = new HashMap();
         //发单总金额
-        BigDecimal billMoney = tbIndentDao.billMoney(dateType, date);
+        BigDecimal billMoney = tbIndentDao.billMoney(query);
         //接单总金额
-        BigDecimal receivingMoney = tbIndentDao.receivingMoney(dateType, date);
+        BigDecimal receivingMoney = tbIndentDao.receivingMoney(query);
         //发单数量
-        int billCount = tbIndentDao.billCount(dateType, date);
+        int billCount = tbIndentDao.billCount(query);
         //接单数量
-        int reveivingCount = tbIndentDao.reveivingCount(dateType, date);
+        int reveivingCount = tbIndentDao.reveivingCount(query);
         //任务收入分析
-        Page<TbIndent> pages = new Page<>(page, limit);
-        PageUtils taskAnalysisMoney = new PageUtils(baseMapper.taskAnalysisMoney(pages, dateType, date, indentState));
+        Page<TbIndent> pages = new Page<>(query.getPage(), query.getLimit());
+        PageUtils taskAnalysisMoney = new PageUtils(baseMapper.taskAnalysisMoney(pages, query, indentState));
         hashMap.put("billMoney", billMoney);
         hashMap.put("receivingMoney", receivingMoney);
         hashMap.put("billCount", billCount);
@@ -1458,24 +1459,24 @@ public class TbIndentServiceImpl extends ServiceImpl<TbIndentDao, TbIndent> impl
     }
 
     @Override
-    public Result selectOrderByStatus(String date, String dateType) {
+    public Result selectOrderByStatus(DataCenterQuery query) {
         HashMap hashMap = new HashMap();
         //全部
-        int i = tbIndentDao.selectOrderByStatus(date, dateType, null);
+        int i = tbIndentDao.selectOrderByStatus(query, null);
         // 付款
-        int i1 = tbIndentDao.selectOrderByStatus(date, dateType, 2);
+        int i1 = tbIndentDao.selectOrderByStatus(query, 2);
         // 接单
-        int i2 = tbIndentDao.selectOrderByStatus(date, dateType, 3);
+        int i2 = tbIndentDao.selectOrderByStatus(query, 3);
         // 进行中
-        int i3 = tbIndentDao.selectOrderByStatus(date, dateType, 4);
+        int i3 = tbIndentDao.selectOrderByStatus(query, 4);
         // 已完成
-        int i4 = tbIndentDao.selectOrderByStatus(date, dateType, 6);
+        int i4 = tbIndentDao.selectOrderByStatus(query, 6);
         //用户已取消
-        int i5 = tbIndentDao.selectOrderByStatus(date, dateType, 8);
+        int i5 = tbIndentDao.selectOrderByStatus(query, 8);
         //骑手已取消
-        int i6 = tbIndentDao.selectOrderByStatus(date, dateType, 9);
+        int i6 = tbIndentDao.selectOrderByStatus(query, 9);
         //平台取消
-        int i7 = tbIndentDao.selectOrderByStatus(date, dateType, 10);
+        int i7 = tbIndentDao.selectOrderByStatus(query, 10);
         hashMap.put("i", i);
         hashMap.put("i1", i1);
         hashMap.put("i2", i2);

+ 3 - 2
src/main/java/com/sqx/modules/goods/controller/GoodsShopController.java

@@ -1,6 +1,7 @@
 package com.sqx.modules.goods.controller;
 
 import com.sqx.common.utils.Result;
+import com.sqx.modules.datacentre.query.DataCenterQuery;
 import com.sqx.modules.goods.entity.GoodsShop;
 import com.sqx.modules.goods.entity.GoodsShopRelevancy;
 import com.sqx.modules.goods.service.GoodsShopService;
@@ -96,9 +97,9 @@ public class GoodsShopController {
 
     @ApiOperation("统计门店收入")
     @GetMapping(value = "selectStoreData")
-    public Result selectStoreData(Long shopId, String date, String dateType){
+    public Result selectStoreData(DataCenterQuery query){
 
-        return goodsShopService.selectStoreData(shopId, date, dateType);
+        return goodsShopService.selectStoreData(query);
     }
 
     @ApiOperation("统计门店订单详情")

+ 2 - 1
src/main/java/com/sqx/modules/goods/service/GoodsShopService.java

@@ -2,6 +2,7 @@ package com.sqx.modules.goods.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.sqx.common.utils.Result;
+import com.sqx.modules.datacentre.query.DataCenterQuery;
 import com.sqx.modules.goods.entity.GoodsShop;
 import com.sqx.modules.goods.entity.GoodsShopRelevancy;
 import com.sqx.modules.goods.vo.GoodsShopVo;
@@ -28,7 +29,7 @@ public interface GoodsShopService extends IService<GoodsShop> {
 
     Result updateGoodsByShopId(GoodsShopRelevancy goodsShopRelevancy);
 
-    Result selectStoreData(Long shopId, String date, String dateType);
+    Result selectStoreData(DataCenterQuery query);
 
     Result selectStoreMessage(Long shopId, String startTime, String endTime, Integer page, Integer limit, String orderNumber);
 

+ 10 - 9
src/main/java/com/sqx/modules/goods/service/impl/GoodsShopServiceImpl.java

@@ -22,6 +22,7 @@ import com.sqx.modules.common.service.CommonInfoService;
 import com.sqx.modules.datacentre.dao.DataCentreDao;
 import com.sqx.modules.datacentre.dao.ShopAdminDao;
 import com.sqx.modules.datacentre.entity.SysUserShop;
+import com.sqx.modules.datacentre.query.DataCenterQuery;
 import com.sqx.modules.goods.dao.GoodsShopDao;
 import com.sqx.modules.goods.dao.GoodsShopRelevancyDao;
 import com.sqx.modules.goods.entity.Goods;
@@ -358,22 +359,22 @@ public class GoodsShopServiceImpl extends ServiceImpl<GoodsShopDao, GoodsShop> i
     }
 
     @Override
-    public Result selectStoreData(Long shopId, String date, String dateType) {
+    public Result selectStoreData(DataCenterQuery query) {
         HashMap hashMap = new HashMap();
-        BigDecimal sumMoney = appOrderDao.selectSumMoney(date, dateType,shopId);
-        int countOrder = appOrderDao.selectCountOrder(date, dateType,shopId);
+        BigDecimal sumMoney = appOrderDao.selectSumMoney(query);
+        int countOrder = appOrderDao.selectCountOrder(query);
         //到店订单数
-        int takeCount = dataCentreDao.selectTakeCount(1, shopId, date, dateType);
+        int takeCount = dataCentreDao.selectTakeCount(1,query);
         //外卖订单数
-        int takeCount2 = dataCentreDao.selectTakeCount(2, shopId, date, dateType);
+        int takeCount2 = dataCentreDao.selectTakeCount(2,query);
         //到店订单金额
-        BigDecimal takeMoney = dataCentreDao.selectTakeMoney(1, shopId, date, dateType);
+        BigDecimal takeMoney = dataCentreDao.selectTakeMoney(1,query);
         //外卖订单金额
-        BigDecimal takeMoney1 = dataCentreDao.selectTakeMoney(2, shopId, date, dateType);
+        BigDecimal takeMoney1 = dataCentreDao.selectTakeMoney(2,query);
         //退款订单数
-        int cancelOrderCount = dataCentreDao.cancelOrderCount(shopId, date, dateType);
+        int cancelOrderCount = dataCentreDao.cancelOrderCount(query);
         //退款金额
-        BigDecimal cancelOrderMoney = dataCentreDao.cancelOrderMoney(shopId, date, dateType);
+        BigDecimal cancelOrderMoney = dataCentreDao.cancelOrderMoney(query);
         hashMap.put("takeCount", takeCount);
         hashMap.put("takeCount2", takeCount2);
         hashMap.put("takeMoney", takeMoney);

+ 1 - 1
src/main/java/com/sqx/modules/order/controller/OrderController.java

@@ -50,7 +50,7 @@ public class OrderController extends AbstractController {
                                       String shopName, String riderPhone, String startTime, String endTime, String payStartTime, String payEndTime) {
         return appOrderService.selectAllOrderAdmin(page, limit, status, phone, shopId, userName, orderNumber, orderType, shopName, riderPhone, indentStatus, reservationFlag, startTime, endTime, payStartTime, payEndTime);
     }
-    
+
 //    @GetMapping("excelOrder")
 //    @ApiOperation("导出卡密列表")
 //    public void excelOrder(Integer status, String phone, Long shopId, String userName,

+ 3 - 2
src/main/java/com/sqx/modules/order/dao/AppOrderDao.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.sqx.datasource.annotation.DataSource;
+import com.sqx.modules.datacentre.query.DataCenterQuery;
 import com.sqx.modules.order.entity.TbOrder;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
@@ -59,9 +60,9 @@ public interface AppOrderDao extends BaseMapper<TbOrder> {
 
     int deleteCouponByOrderId(@Param("orderId") Long orderId);
 
-    BigDecimal selectSumMoney(@Param("date") String date,@Param("dateType") String dateType,@Param("shopId") Long shopId);
+    BigDecimal selectSumMoney(@Param("query") DataCenterQuery query);
 
-    int selectCountOrder(@Param("date") String date,@Param("dateType") String dateType,@Param("shopId") Long shopId);
+    int selectCountOrder(@Param("query") DataCenterQuery query);
 
     int updateorderStatus(String date);
 

+ 3 - 0
src/main/java/com/sqx/modules/order/entity/TbOrder.java

@@ -147,6 +147,9 @@ public class TbOrder implements Serializable {
     @ApiModelProperty("订单顺序号(当天)")
     private String orderSequence;
 
+    @ApiModelProperty("打印状态  已打印:1 未打印:0")
+    private Integer isPrint;
+
     @ApiModelProperty("商铺名")
     @TableField(exist = false)
     private String shopName;

+ 2 - 0
src/main/java/com/sqx/modules/order/service/AppOrderService.java

@@ -15,6 +15,8 @@ import java.util.List;
 
 public interface AppOrderService extends IService<TbOrder> {
 
+    int updateOrderPrint(Long OrderId);
+
     void insertOrder(Long userId, Long shopId, Long goodsId, Integer num, Long skuId, String skuMessage, Integer orderType);
 
     Result print(Long orderId, Integer isAppend);

+ 12 - 0
src/main/java/com/sqx/modules/order/service/impl/AppAppOrderServiceImpl.java

@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -176,6 +177,17 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
     private static final DateTimeFormatter DTF = DateTimeFormatter.ofPattern(DateUtils.TIME_PATTERN1);
 
     @Override
+    public int updateOrderPrint(Long orderId) {
+        UpdateWrapper wrapper = new UpdateWrapper<>();
+        wrapper.eq("order_id", orderId);
+        wrapper.set("is_print",1);
+        int result = appOrderDao.update(null, wrapper);
+        return result;
+    }
+
+
+
+    @Override
     public void insertOrder(Long userId, Long shopId, Long goodsId, Integer num, Long skuId, String skuMessage, Integer orderType) {
         // 判断当前时间是否在店铺营业范围内
         if (!isShopBusinessTime(shopId)) {

+ 3 - 2
src/main/java/com/sqx/modules/pay/controller/CashController.java

@@ -21,6 +21,7 @@ import com.sqx.modules.app.service.UserMoneyDetailsService;
 import com.sqx.modules.app.service.UserService;
 import com.sqx.modules.common.entity.CommonInfo;
 import com.sqx.modules.common.service.CommonInfoService;
+import com.sqx.modules.datacentre.query.DataCenterQuery;
 import com.sqx.modules.message.entity.MessageInfo;
 import com.sqx.modules.message.service.MessageService;
 import com.sqx.modules.pay.config.AliPayConstants;
@@ -250,9 +251,9 @@ public class CashController {
 
     @ApiOperation("平台收入统计")
     @GetMapping(value = "incomeStatistics")
-    public Result incomeStatistics(String date, String dateType){
+    public Result incomeStatistics(DataCenterQuery query){
 
-        return cashOutService.incomeStatistics(date, dateType);
+        return cashOutService.incomeStatistics(query);
     }
 
     @ApiOperation("充值统计")

+ 7 - 6
src/main/java/com/sqx/modules/pay/controller/query/CashOutQueryDTO.java

@@ -79,12 +79,13 @@ public class CashOutQueryDTO extends PageQuery {
                 case 2: stringBuffer.append("状态:已拒绝;");break;
             }
         }
-        if(StringUtils.hasText(type)){
-            switch (type){
-                case "1": stringBuffer.append("状态:用户提现;");break;
-                case "2": stringBuffer.append("状态:退保证金;");break;
-            }
-        }
+        //不展示默认查询条件
+//        if(StringUtils.hasText(type)){
+//            switch (type){
+//                case "1": stringBuffer.append("状态:用户提现;");break;
+//                case "2": stringBuffer.append("状态:退保证金;");break;
+//            }
+//        }
         return stringBuffer.toString();
     }
 }

+ 8 - 7
src/main/java/com/sqx/modules/pay/controller/query/WalletDetailQuery.java

@@ -47,13 +47,14 @@ public class WalletDetailQuery extends PageQuery {
                 case "2": stringBuilder.append("状态:提现;");break;
             }
         }
-        if(StringUtils.hasText(classify)){
-            switch (classify){
-                case "1": stringBuilder.append("明细类别:骑手保证金;");break;
-                case "2": stringBuilder.append("明细类别:商户保证金;");break;
-                case "3": stringBuilder.append("明细类别:钱包明细;");break;
-            }
-        }
+        //不展示默认条件
+//        if(StringUtils.hasText(classify)){
+//            switch (classify){
+//                case "1": stringBuilder.append("明细类别:骑手保证金;");break;
+//                case "2": stringBuilder.append("明细类别:商户保证金;");break;
+//                case "3": stringBuilder.append("明细类别:钱包明细;");break;
+//            }
+//        }
         return stringBuilder.toString();
     }
 

+ 4 - 3
src/main/java/com/sqx/modules/pay/dao/CashOutDao.java

@@ -3,6 +3,7 @@ package com.sqx.modules.pay.dao;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.sqx.modules.datacentre.query.DataCenterQuery;
 import com.sqx.modules.pay.controller.query.CashOutQueryDTO;
 import com.sqx.modules.pay.entity.CashOut;
 import com.sqx.modules.pay.vo.CashOutVO;
@@ -49,11 +50,11 @@ public interface CashOutDao extends BaseMapper<CashOut> {
 
     BigDecimal cashDepositMoneySum(@Param("date") String date, @Param("dateType") String dateType);
 
-    BigDecimal cargoInsurance(String date, String dateType);
+    BigDecimal cargoInsurance(@Param("query") DataCenterQuery query);
 
-    BigDecimal MoneySumByIndentType(String date, String dateType, String indentType);
+    BigDecimal MoneySumByIndentType(@Param("query") DataCenterQuery query, String indentType);
 
-    BigDecimal cashDepositMoney(String date, String dateType);
+    BigDecimal cashDepositMoney(@Param("query") DataCenterQuery query);
 
     IPage<CashOutVO> selectCashOutList(@Param("page") IPage<CashOut> pages, @Param("params") CashOutQueryDTO queryDTO);
 

+ 2 - 1
src/main/java/com/sqx/modules/pay/service/CashOutService.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.sqx.common.utils.PageUtils;
 import com.sqx.common.utils.Result;
 import com.sqx.modules.app.entity.UserEntity;
+import com.sqx.modules.datacentre.query.DataCenterQuery;
 import com.sqx.modules.pay.controller.query.CashOutQueryDTO;
 import com.sqx.modules.pay.entity.CashOut;
 import com.sqx.modules.utils.excel.ExcelData;
@@ -39,7 +40,7 @@ public interface CashOutService extends IService<CashOut> {
 
     Result statisticsMoney(String date, String dateType, Integer type);
 
-    Result incomeStatistics(String date, String dateType);
+    Result incomeStatistics(DataCenterQuery query);
 
     Result cashDepositMoney(Long userId);
 

+ 10 - 9
src/main/java/com/sqx/modules/pay/service/impl/CashOutServiceImpl.java

@@ -19,6 +19,7 @@ import com.sqx.modules.app.service.UserMoneyDetailsService;
 import com.sqx.modules.app.service.UserService;
 import com.sqx.modules.common.entity.CommonInfo;
 import com.sqx.modules.common.service.CommonInfoService;
+import com.sqx.modules.datacentre.query.DataCenterQuery;
 import com.sqx.modules.errand.dao.ErrandComplaintDao;
 import com.sqx.modules.errand.dao.TbIndentDao;
 import com.sqx.modules.errand.entity.ErrandComplaint;
@@ -314,28 +315,28 @@ public class CashOutServiceImpl extends ServiceImpl<CashOutDao, CashOut> impleme
     }
 
     @Override
-    public Result incomeStatistics(String date, String dateType) {
+    public Result incomeStatistics(DataCenterQuery query) {
         HashMap hashMap = new HashMap();
         //扣除骑手保证金收入
-        BigDecimal deductMoneySum = errandComplaintDao.deductMoneySum(date, dateType);
+        BigDecimal deductMoneySum = errandComplaintDao.deductMoneySum(query);
         //保价费收入
-        BigDecimal cargoInsurance = cashOutDao.cargoInsurance(date, dateType);
+        BigDecimal cargoInsurance = cashOutDao.cargoInsurance(query);
         //帮我送收入
-        BigDecimal firstMoneySum = cashOutDao.MoneySumByIndentType(date, dateType, "1");
+        BigDecimal firstMoneySum = cashOutDao.MoneySumByIndentType(query, "1");
         //帮我取收入
-        BigDecimal secondMoneySum = cashOutDao.MoneySumByIndentType(date, dateType, "2");
+        BigDecimal secondMoneySum = cashOutDao.MoneySumByIndentType(query, "2");
         //帮我买收入
-        BigDecimal thirdMoneySum = cashOutDao.MoneySumByIndentType(date, dateType, "3");
+        BigDecimal thirdMoneySum = cashOutDao.MoneySumByIndentType(query, "3");
         //同城服务收入
-        BigDecimal fourthMoneySum = cashOutDao.MoneySumByIndentType(date, dateType, "4");
+        BigDecimal fourthMoneySum = cashOutDao.MoneySumByIndentType(query, "4");
         //同城外卖收入
-        BigDecimal tcwmMoneySum = cashOutDao.MoneySumByIndentType(date, dateType, "5");
+        BigDecimal tcwmMoneySum = cashOutDao.MoneySumByIndentType(query, "5");
         //服务费=四项总收入
         BigDecimal serviceSum = firstMoneySum.add(secondMoneySum).add(thirdMoneySum).add(fourthMoneySum).add(tcwmMoneySum);
         //总收入=服务费+保价费+扣除骑手保证金
         BigDecimal allSum = serviceSum.add(cargoInsurance).add(deductMoneySum);
         //骑手保证金收入
-        BigDecimal cashDepositMoney = cashOutDao.cashDepositMoney(date, dateType);
+        BigDecimal cashDepositMoney = cashOutDao.cashDepositMoney(query);
 
         /*//平台总收入=总收入-商品费
         BigDecimal allMoneySum = cashOutDao.allMoneySum(date, dateType);

+ 53 - 33
src/main/java/com/sqx/modules/printInfo/controller/PrintInfoController.java

@@ -12,6 +12,7 @@ import com.sqx.modules.order.entity.TbOrder;
 import com.sqx.modules.order.service.AppOrderService;
 import com.sqx.modules.order.service.impl.AppAppOrderServiceImpl;
 import com.sqx.modules.printInfo.entity.*;
+import com.sqx.modules.printInfo.service.PrintInfoDetailService;
 import com.sqx.modules.printInfo.service.PrintInfoService;
 import com.sqx.modules.printInfo.service.PrintInfoShopService;
 import com.sqx.modules.utils.fieYun.FeiYunUtils;
@@ -52,6 +53,27 @@ public class PrintInfoController {
     @Autowired
     private GoodsShopService goodsShopService;
 
+    @Autowired
+    private PrintInfoDetailService printInfoDetailService;
+
+    @GetMapping("getOrderPrintDetailList")
+    @ApiOperation("获取订单打印记录列表")
+    public Result getPrintInfoList(Integer page, Integer limit, Long orderId) {
+        //region 参数判断
+        if(page == null){
+            return Result.error("当前页不能为空!");
+        }
+        if(limit == null){
+            return Result.error("一页数据条数不能为空!");
+        }
+        if(orderId == null){
+            return Result.error("订单ID不能为空!");
+        }
+        //endregion
+
+        return printInfoDetailService.selectPrintInfoDetailList(page, limit, orderId);
+    }
+
     @GetMapping("testPrintModel")
     @ApiOperation("获取打印信息列表")
     public Result testPrintModel(Long orderId) {
@@ -66,7 +88,7 @@ public class PrintInfoController {
         tbOrder.setCountOrder(3);
 
         if (StringUtils.isNotEmpty(goodsShop.getSnCode())) {
-            FeiYunUtils.print(goodsShop.getSnCode(), null, tbOrder,null);
+            FeiYunUtils.print(goodsShop.getSnCode(), null, tbOrder, null);
         } else {
             return Result.error("当前商家未绑定打印机!");
         }
@@ -95,8 +117,6 @@ public class PrintInfoController {
     }
 
 
-
-
     @GetMapping("getPrintInfoList")
     @ApiOperation("获取打印信息列表")
     public Result getPrintInfoList(Integer page, Integer limit) {
@@ -147,12 +167,12 @@ public class PrintInfoController {
         files.add("user_id");
         files.add("coupon_id");
         files.add("expect_delivery_time");
-        if(!files.contains(printInfo.getPrintField())){
+        if (!files.contains(printInfo.getPrintField())) {
             return Result.error("无法新增非法字段");
         }
 
-        int existCount = printInfoService.existInfo(printInfo.getTypeId(),printInfo.getPrintField());
-        if(existCount > 0){
+        int existCount = printInfoService.existInfo(printInfo.getTypeId(), printInfo.getPrintField());
+        if (existCount > 0) {
             return Result.error("当前类型中已包含该字段");
         }
 
@@ -197,12 +217,12 @@ public class PrintInfoController {
         files.add("user_id");
         files.add("coupon_id");
         files.add("expect_delivery_time");
-        if(!files.contains(printInfo.getPrintField())){
+        if (!files.contains(printInfo.getPrintField())) {
             return Result.error("无法将数据更新为非法字段");
         }
 
-        PrintInfo existData = printInfoService.existInfoData(printInfo.getTypeId(),printInfo.getPrintField());
-        if(existData != null && existData.getId().intValue() != printInfo.getId().intValue()){
+        PrintInfo existData = printInfoService.existInfoData(printInfo.getTypeId(), printInfo.getPrintField());
+        if (existData != null && existData.getId().intValue() != printInfo.getId().intValue()) {
             return Result.error("当前类型中已包含该字段");
         }
 
@@ -278,9 +298,9 @@ public class PrintInfoController {
                     detailData.setId(nowInfo.getId());
                     detailData.setPrintField(nowInfo.getPrintField());
                     detailData.setPrintName(nowInfo.getPrintName());
-                    if(haves.contains(nowInfo.getPrintField())){
+                    if (haves.contains(nowInfo.getPrintField())) {
                         detailData.setIsCheck(1);
-                    }else{
+                    } else {
                         detailData.setIsCheck(0);
                     }
                     details.add(detailData);
@@ -315,9 +335,9 @@ public class PrintInfoController {
                     detailData.setId(nowInfo.getId());
                     detailData.setPrintField(nowInfo.getPrintField());
                     detailData.setPrintName(nowInfo.getPrintName());
-                    if(haves.contains(nowInfo.getPrintField())){
+                    if (haves.contains(nowInfo.getPrintField())) {
                         detailData.setIsCheck(1);
-                    }else{
+                    } else {
                         detailData.setIsCheck(0);
                     }
                     details.add(detailData);
@@ -342,14 +362,14 @@ public class PrintInfoController {
                 List<Integer> detailIds = (data.getDetails() != null && data.getDetails().size() > 0) ? data.getDetails().stream().map(PrintModelDetailResult::getId).distinct().collect(Collectors.toList()) : new ArrayList<>();
 
                 List<PrintInfo> nowInfos = infos.stream().filter(e -> e.getTypeId().intValue() == ePrintStatu.Base.getValue() && !detailIds.contains(e.getId())).collect(Collectors.toList());
-                for (PrintInfo nowInfo:nowInfos) {
+                for (PrintInfo nowInfo : nowInfos) {
                     PrintModelDetailResult detailData = new PrintModelDetailResult();
                     detailData.setId(nowInfo.getId());
                     detailData.setPrintField(nowInfo.getPrintField());
                     detailData.setPrintName(nowInfo.getPrintName());
-                    if(haves.contains(nowInfo.getPrintField())){
+                    if (haves.contains(nowInfo.getPrintField())) {
                         detailData.setIsCheck(1);
-                    }else{
+                    } else {
                         detailData.setIsCheck(0);
                     }
                     data.getDetails().add(detailData);
@@ -376,9 +396,9 @@ public class PrintInfoController {
                     detailData.setId(nowInfo.getId());
                     detailData.setPrintField(nowInfo.getPrintField());
                     detailData.setPrintName(nowInfo.getPrintName());
-                    if(haves.contains(nowInfo.getPrintField())){
+                    if (haves.contains(nowInfo.getPrintField())) {
                         detailData.setIsCheck(1);
-                    }else{
+                    } else {
                         detailData.setIsCheck(0);
                     }
                     details.add(detailData);
@@ -402,14 +422,14 @@ public class PrintInfoController {
                 List<Integer> detailIds = (data.getDetails() != null && data.getDetails().size() > 0) ? data.getDetails().stream().map(PrintModelDetailResult::getId).distinct().collect(Collectors.toList()) : new ArrayList<>();
 
                 List<PrintInfo> nowInfos = infos.stream().filter(e -> e.getTypeId().intValue() == ePrintStatu.Good.getValue() && !detailIds.contains(e.getId())).collect(Collectors.toList());
-                for (PrintInfo nowInfo:nowInfos) {
+                for (PrintInfo nowInfo : nowInfos) {
                     PrintModelDetailResult detailData = new PrintModelDetailResult();
                     detailData.setId(nowInfo.getId());
                     detailData.setPrintField(nowInfo.getPrintField());
                     detailData.setPrintName(nowInfo.getPrintName());
-                    if(haves.contains(nowInfo.getPrintField())){
+                    if (haves.contains(nowInfo.getPrintField())) {
                         detailData.setIsCheck(1);
-                    }else{
+                    } else {
                         detailData.setIsCheck(0);
                     }
                     data.getDetails().add(detailData);
@@ -436,9 +456,9 @@ public class PrintInfoController {
                     detailData.setId(nowInfo.getId());
                     detailData.setPrintField(nowInfo.getPrintField());
                     detailData.setPrintName(nowInfo.getPrintName());
-                    if(haves.contains(nowInfo.getPrintField())){
+                    if (haves.contains(nowInfo.getPrintField())) {
                         detailData.setIsCheck(1);
-                    }else{
+                    } else {
                         detailData.setIsCheck(0);
                     }
                     details.add(detailData);
@@ -462,14 +482,14 @@ public class PrintInfoController {
                 List<Integer> detailIds = (data.getDetails() != null && data.getDetails().size() > 0) ? data.getDetails().stream().map(PrintModelDetailResult::getId).distinct().collect(Collectors.toList()) : new ArrayList<>();
 
                 List<PrintInfo> nowInfos = infos.stream().filter(e -> e.getTypeId().intValue() == ePrintStatu.Pay.getValue() && !detailIds.contains(e.getId())).collect(Collectors.toList());
-                for (PrintInfo nowInfo:nowInfos) {
+                for (PrintInfo nowInfo : nowInfos) {
                     PrintModelDetailResult detailData = new PrintModelDetailResult();
                     detailData.setId(nowInfo.getId());
                     detailData.setPrintField(nowInfo.getPrintField());
                     detailData.setPrintName(nowInfo.getPrintName());
-                    if(haves.contains(nowInfo.getPrintField())){
+                    if (haves.contains(nowInfo.getPrintField())) {
                         detailData.setIsCheck(1);
-                    }else{
+                    } else {
                         detailData.setIsCheck(0);
                     }
                     data.getDetails().add(detailData);
@@ -495,9 +515,9 @@ public class PrintInfoController {
                     detailData.setId(nowInfo.getId());
                     detailData.setPrintField(nowInfo.getPrintField());
                     detailData.setPrintName(nowInfo.getPrintName());
-                    if(haves.contains(nowInfo.getPrintField())){
+                    if (haves.contains(nowInfo.getPrintField())) {
                         detailData.setIsCheck(1);
-                    }else{
+                    } else {
                         detailData.setIsCheck(0);
                     }
                     details.add(detailData);
@@ -521,14 +541,14 @@ public class PrintInfoController {
                 List<Integer> detailIds = (data.getDetails() != null && data.getDetails().size() > 0) ? data.getDetails().stream().map(PrintModelDetailResult::getId).distinct().collect(Collectors.toList()) : new ArrayList<>();
 
                 List<PrintInfo> nowInfos = infos.stream().filter(e -> e.getTypeId().intValue() == ePrintStatu.User.getValue() && !detailIds.contains(e.getId())).collect(Collectors.toList());
-                for (PrintInfo nowInfo:nowInfos) {
+                for (PrintInfo nowInfo : nowInfos) {
                     PrintModelDetailResult detailData = new PrintModelDetailResult();
                     detailData.setId(nowInfo.getId());
                     detailData.setPrintField(nowInfo.getPrintField());
                     detailData.setPrintName(nowInfo.getPrintName());
-                    if(haves.contains(nowInfo.getPrintField())){
+                    if (haves.contains(nowInfo.getPrintField())) {
                         detailData.setIsCheck(1);
-                    }else{
+                    } else {
                         detailData.setIsCheck(0);
                     }
                     data.getDetails().add(detailData);
@@ -628,9 +648,9 @@ public class PrintInfoController {
     @GetMapping("testPrintInfo")
     @ApiOperation("测试打印功能")
     public Result testPrintInfo(String sn) {
-        log.info("进入打印:sn"+sn);
+        log.info("进入打印:sn" + sn);
         FeiYunUtils.testPrint(sn);
-        log.info("打印结束:sn"+sn);
+        log.info("打印结束:sn" + sn);
         return Result.success();
     }
 }

+ 19 - 0
src/main/java/com/sqx/modules/printInfo/dao/PrintInfoDetailDao.java

@@ -0,0 +1,19 @@
+package com.sqx.modules.printInfo.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.sqx.modules.printInfo.entity.PrintInfo;
+import com.sqx.modules.printInfo.entity.PrintInfoDetail;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author www.javacoder.top
+ * @since 2022-11-04
+ */
+@Mapper
+public interface PrintInfoDetailDao extends BaseMapper<PrintInfoDetail> {
+
+}

+ 41 - 0
src/main/java/com/sqx/modules/printInfo/entity/PrintInfoDetail.java

@@ -0,0 +1,41 @@
+package com.sqx.modules.printInfo.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author www.javacoder.top
+ * @since 2022-11-04
+ */
+@Data
+public class PrintInfoDetail implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty("主键id")
+    private Integer id;
+
+    @ApiModelProperty("订单id")
+    private Long orderId;
+
+    @ApiModelProperty("打印时订单状态")
+    private String orderStatus;
+
+    @ApiModelProperty("打印状态是否补打")
+    private String isAppend;
+
+    @ApiModelProperty("创建时间")
+    private String createTime;
+
+    @ApiModelProperty("是否删除(0:未删除;1:删除)")
+    private Integer deleteFlag;
+}

+ 111 - 0
src/main/java/com/sqx/modules/printInfo/entity/eOrderStatus.java

@@ -0,0 +1,111 @@
+package com.sqx.modules.printInfo.entity;
+
+/**
+ * @Author: binguo
+ * @Date: 2023/7/26 星期三 14:55
+ * @Description: com.repair.model.enumModel
+ * @Version: 1.0
+ * 订单状态
+ * 0待结算
+ * 1待支付
+ * 2直接购买(未支付)
+ * 3待取餐/派送中
+ * 4已完成
+ * 5已取消
+ * 6制作中
+ * 7商家待接单
+ * 8商家拒绝接单
+ */
+public enum eOrderStatus {
+    Pending(0),//待结算
+    Pendpay(1),//待支付
+    Unpaid(2),//直接购买(未支付)
+    Waiting(3),//待取餐/派送中
+    Completed(4),//已完成
+    Cancelled(5),//已取消
+    Making(6),//制作中
+    Pendorder(7),//商家待接单
+    Refuse(8);//商家拒绝接单
+
+    private int value;
+
+    eOrderStatus(int value){
+        this.value = value;
+    }
+
+    public int getValue() {
+        return value;
+    }
+    public static eOrderStatus valueOf(int value) {
+        switch (value) {
+            case 0:
+                return eOrderStatus.Pending;
+            case 1:
+                return eOrderStatus.Pendpay;
+            case 2:
+                return eOrderStatus.Unpaid;
+            case 3:
+                return eOrderStatus.Waiting;
+            case 4:
+                return eOrderStatus.Completed;
+            case 5:
+                return eOrderStatus.Cancelled;
+            case 6:
+                return eOrderStatus.Making;
+            case 7:
+                return eOrderStatus.Pendorder;
+            case 8:
+                return eOrderStatus.Refuse;
+            default:
+                return null;
+        }
+    }
+    public static String stringOf(Integer value) {
+        switch (value) {
+            case 0:
+                return "待结算";
+            case 1:
+                return "待支付";
+            case 2:
+                return "直接购买(未支付)";
+            case 3:
+                return "待取餐/派送中";
+            case 4:
+                return "已完成";
+            case 5:
+                return "已取消";
+            case 6:
+                return "制作中";
+            case 7:
+                return "商家待接单";
+            case 8:
+                return "商家拒绝接单";
+            default:
+                return null;
+        }
+    }
+    public static Integer integerOf(String value) {
+        switch (value) {
+            case "待结算":
+                return 0;
+            case "待支付":
+                return 1;
+            case "直接购买(未支付)":
+                return 2;
+            case "待取餐/派送中":
+                return 3;
+            case "已完成":
+                return 4;
+            case "已取消":
+                return 5;
+            case "制作中":
+                return 6;
+            case "商家待接单":
+                return 7;
+            case "商家拒绝接单":
+                return 8;
+            default:
+                return null;
+        }
+    }
+}

+ 22 - 0
src/main/java/com/sqx/modules/printInfo/service/PrintInfoDetailService.java

@@ -0,0 +1,22 @@
+package com.sqx.modules.printInfo.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.sqx.common.utils.Result;
+import com.sqx.modules.printInfo.entity.PrintInfo;
+import com.sqx.modules.printInfo.entity.PrintInfoDetail;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 服务类
+ * </p>
+ *
+ * @author www.javacoder.top
+ * @since 2022-11-04
+ */
+public interface PrintInfoDetailService extends IService<PrintInfoDetail> {
+    Result selectPrintInfoDetailList(Integer page, Integer limit, Long orderId);
+
+    Result insertPrintInfoDetail(PrintInfoDetail printInfoDetail);
+}

+ 50 - 0
src/main/java/com/sqx/modules/printInfo/service/impl/PrintInfoDetailServiceImpl.java

@@ -0,0 +1,50 @@
+package com.sqx.modules.printInfo.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.sqx.common.utils.PageUtils;
+import com.sqx.common.utils.Result;
+import com.sqx.modules.app.entity.UserMoneyDetails;
+import com.sqx.modules.printInfo.dao.PrintInfoDao;
+import com.sqx.modules.printInfo.dao.PrintInfoDetailDao;
+import com.sqx.modules.printInfo.entity.PrintInfo;
+import com.sqx.modules.printInfo.entity.PrintInfoDetail;
+import com.sqx.modules.printInfo.service.PrintInfoDetailService;
+import com.sqx.modules.printInfo.service.PrintInfoService;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * <p>
+ * 服务实现类
+ * </p>
+ *
+ * @author www.javacoder.top
+ * @since 2022-11-04
+ */
+@Service
+public class PrintInfoDetailServiceImpl extends ServiceImpl<PrintInfoDetailDao, PrintInfoDetail> implements PrintInfoDetailService {
+
+    @Override
+    public Result selectPrintInfoDetailList(Integer page, Integer limit, Long orderId) {
+        Page<PrintInfoDetail> pages = new Page<>(page, limit);
+        QueryWrapper<PrintInfoDetail> queryWrapper = new QueryWrapper();
+        queryWrapper.eq("order_id", orderId).orderByDesc("create_time");
+        PageUtils pageUtils = new PageUtils(baseMapper.selectPage(pages,queryWrapper));
+        return Result.success().put("data", pageUtils);
+    }
+
+    @Override
+    public Result insertPrintInfoDetail(PrintInfoDetail printInfoDetail) {
+        String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
+        printInfoDetail.setCreateTime(format);
+        printInfoDetail.setDeleteFlag(0);
+        int result = baseMapper.insert(printInfoDetail);
+        return result > 0 ? Result.success() :  Result.error();
+    }
+}

+ 94 - 42
src/main/java/com/sqx/modules/utils/fieYun/FeiYunUtils.java

@@ -2,6 +2,7 @@ package com.sqx.modules.utils.fieYun;
 
 import com.alibaba.fastjson.JSONObject;
 import com.fasterxml.jackson.databind.ObjectMapper;
+import com.sqx.common.utils.Result;
 import com.sqx.modules.activity.service.ActivityService;
 import com.sqx.modules.activity.vo.ActivityOrderVO;
 import com.sqx.modules.activity.vo.ActivityVO;
@@ -15,7 +16,9 @@ import com.sqx.modules.goods.entity.GoodsShop;
 import com.sqx.modules.goods.service.GoodsShopService;
 import com.sqx.modules.order.entity.OrderGoods;
 import com.sqx.modules.order.entity.TbOrder;
+import com.sqx.modules.order.service.AppOrderService;
 import com.sqx.modules.printInfo.entity.*;
+import com.sqx.modules.printInfo.service.PrintInfoDetailService;
 import com.sqx.modules.printInfo.service.PrintInfoService;
 import com.sqx.modules.printInfo.service.PrintInfoShopService;
 import com.sqx.modules.utils.fieYun.model.OrderForm;
@@ -60,6 +63,20 @@ public class FeiYunUtils {
 
     private static PrintInfoService printInfoService;
 
+    private static AppOrderService appOrderService;
+
+    private static PrintInfoDetailService printInfoDetailService;
+
+    @Autowired
+    public void setPrintInfoDetailService(PrintInfoDetailService printInfoDetailService) {
+        FeiYunUtils.printInfoDetailService = printInfoDetailService;
+    }
+
+    @Autowired
+    public void setAppOrderService(AppOrderService appOrderService) {
+        FeiYunUtils.appOrderService = appOrderService;
+    }
+
     @Autowired
     public void setActivityService(ActivityService activityService) {
         FeiYunUtils.activityService = activityService;
@@ -948,7 +965,14 @@ public class FeiYunUtils {
                 }
                 //endregion
                 if (goods_name_start != null) {
-                    stringBuilder.append(goods_name_start).append("名称").append(goods_name_end).append("     ");
+                    //长度十个字
+                    stringBuilder.append(goods_name_start).append("名称").append(goods_name_end);
+                    if (sum_money_start != null) {
+                        stringBuilder.append("     ");
+                    } else {
+                        stringBuilder.append("        ");
+                    }
+
                 }
 
                 if (goods_price_start != null) {
@@ -980,7 +1004,19 @@ public class FeiYunUtils {
                         name = orderGoods.getGoodsName();
                     }
                     stringBuilder.append(goods_name_start).append(name).append(goods_name_end);
-                    stringBuilder.append("    ");
+
+                    StringBuilder space = new StringBuilder();
+                    if (sum_money_start != null) {
+                        for (int len = (name.length() - 1); len < 7; len++) {
+                            space.append(" ");
+                        }
+                    }else{
+                        for (int len = (name.length() - 1); len < 10; len++) {
+                            space.append(" ");
+                        }
+                    }
+
+                    stringBuilder.append(space.toString());
                     stringBuilder.append(goods_price_start).append(orderGoods.getGoodsPrice()).append(goods_price_end);
                     if (orderGoods.getGoodsPrice().doubleValue() < 10) {
                         stringBuilder.append("    ");
@@ -1493,7 +1529,7 @@ public class FeiYunUtils {
 
             String content = stringBuilder.toString();
 
-            doRequest(sn, content, tbOrder.getStatus(), isAppend);
+            doRequest(sn, content, tbOrder.getStatus(), isAppend, tbOrder.getOrderId());
 
         } catch (Exception e) {
             e.printStackTrace();
@@ -1506,7 +1542,7 @@ public class FeiYunUtils {
     /**
      * 小票机打印订单接口
      *
-     * @param sn       打印机编号
+     * @param sn 打印机编号
      * @return 成功:{"msg":"ok","ret":0,"data":"xxxxxxx_xxxxxxxx_xxxxxxxx","serverExecutedTime":5}
      * 失败:{"msg":"错误描述","ret":非0,"data":"null","serverExecutedTime":5}
      */
@@ -1522,7 +1558,7 @@ public class FeiYunUtils {
             sb.append("<BR>");
             sb.append("<CUT>");
 
-            doRequest(sn, sb.toString(),5,null);
+            doRequest(sn, sb.toString(), 5, null, tbOrder.getOrderId());
 
         } catch (Exception e) {
             e.printStackTrace();
@@ -1531,7 +1567,7 @@ public class FeiYunUtils {
         return null;
     }
 
-    private static void doRequest(String sn, String content, Integer status, Integer isAppend) {
+    private static void doRequest(String sn, String content, Integer status, Integer isAppend, Long orderId) {
         RequestConfig requestConfig = RequestConfig.custom()
                 .setSocketTimeout(30000)//读取超时
                 .setConnectTimeout(30000)//连接超时
@@ -1565,6 +1601,22 @@ public class FeiYunUtils {
                     result = EntityUtils.toString(httpentity);
                 }
 
+                //region 添加订单打印状态
+                int updateData = appOrderService.updateOrderPrint(orderId);
+                if (updateData <= 0) {
+                    log.error("更新订单打印状态失败,订单ID为:{}", orderId);
+                }
+
+                PrintInfoDetail pid = new PrintInfoDetail();
+                pid.setOrderStatus(eOrderStatus.stringOf(status));
+                pid.setOrderId(orderId);
+                pid.setIsAppend(isAppend == null ? "否" : (isAppend.intValue() == 1 ? "是" : "否"));
+                Result detailResult = printInfoDetailService.insertPrintInfoDetail(pid);
+                if ((int) detailResult.get("code") != 0) {
+                    log.error("记录打印数据失败,订单ID为:" + orderId + ";是否补打:" + isAppend);
+                }
+                //endregion
+
                 log.info("打印请求成功,打印机sn:{},打印内容:{},响应结果:{}", sn, content, result);
             } else {
                 log.error("打印请求失败,响应码为:{}", stateCode);
@@ -2067,36 +2119,36 @@ public class FeiYunUtils {
 
 
     /**
-     *    飞鹅技术支持-2020-03-25
-     *    #########################################################################################################
-     *    一,纯数字条件下:
-     *        58mm打印机最大支持28位纯数字,80mm打印机最大支持46位纯数字,超出无效
-     *
-     *        26-28位数字条形码,在数字中不可以出现2个及以上连续的0存在
-     *        23-25位数字条形码,在数字中不可以出现3个及以上连续的0存在
-     *        21-22位数字条形码,在数字中不可以出现4个及以上连续的0存在
-     *        19-20位数字条形码,在数字中不可以出现6个及以上连续的0存在
-     *        17-18位数字条形码,在数字中不可以出现8个及以上连续的0存在
-     *        15-16位数字条形码,在数字中不可以出现10个及以上连续的0存在
-     *        少于或等于14位数字的条形码,0的数量没有影响
-     *    #########################################################################################################
-     *    二,非纯数字混合条件下:
-     *        58mm打印机最大支持14位字符,80mm打印机最大支持23位字符,超出无效
-     *
-     *        支持数字,大小写字母,特殊字符例如:  !@#$%^&*()-=+_
-     *    #########################################################################################################
-     *    把条形码函数返回值,调用飞鹅云打印接口发给打印机打印
+     * 飞鹅技术支持-2020-03-25
+     * #########################################################################################################
+     * 一,纯数字条件下:
+     * 58mm打印机最大支持28位纯数字,80mm打印机最大支持46位纯数字,超出无效
+     * <p>
+     * 26-28位数字条形码,在数字中不可以出现2个及以上连续的0存在
+     * 23-25位数字条形码,在数字中不可以出现3个及以上连续的0存在
+     * 21-22位数字条形码,在数字中不可以出现4个及以上连续的0存在
+     * 19-20位数字条形码,在数字中不可以出现6个及以上连续的0存在
+     * 17-18位数字条形码,在数字中不可以出现8个及以上连续的0存在
+     * 15-16位数字条形码,在数字中不可以出现10个及以上连续的0存在
+     * 少于或等于14位数字的条形码,0的数量没有影响
+     * #########################################################################################################
+     * 二,非纯数字混合条件下:
+     * 58mm打印机最大支持14位字符,80mm打印机最大支持23位字符,超出无效
+     * <p>
+     * 支持数字,大小写字母,特殊字符例如:  !@#$%^&*()-=+_
+     * #########################################################################################################
+     * 把条形码函数返回值,调用飞鹅云打印接口发给打印机打印
      */
     private static String getDigitBarCode(String input) {
         String chr = "";
         String laststr = "";
-        byte[] codeB = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39 }; // 匹配字符集B
-        byte[] codeC = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+        byte[] codeB = {0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39}; // 匹配字符集B
+        byte[] codeC = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
                 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20,
                 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31,
                 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42,
                 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53,
-                0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, 0x60, 0x61, 0x62, 0x63 }; // 匹配字符集C
+                0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, 0x60, 0x61, 0x62, 0x63}; // 匹配字符集C
         int length = input.length();
         byte[] b = new byte[100];
         b[0] = 0x1b;
@@ -2117,7 +2169,7 @@ public class FeiYunUtils {
         b[15] = (byte) (length + 2); // 得出条形码长度
         b[16] = 0x7b;
         b[17] = 0x42;
-        boolean result=input.matches("[0-9]+");//判断是否为纯数字
+        boolean result = input.matches("[0-9]+");//判断是否为纯数字
         if (length > 14 && result == true) {
             b[17] = 0x43;
             int j = 0;
@@ -2131,18 +2183,18 @@ public class FeiYunUtils {
                 j = j + 2;
                 if (iindex == 0) {
                     chr = "";
-                    if(b[key + i - 1] == '0' && b[key + i - 2] == '0') {
+                    if (b[key + i - 1] == '0' && b[key + i - 2] == '0') {
                         b[key + i] = codeB[0];
-                        b[key + i+1] = codeB[0];
-                        key+=1;
-                    }else {
-                        if(b[key + i-1] == 'C' && b[key + i-2] == '{' ){//判断前面的为字符集C时转换字符集B
+                        b[key + i + 1] = codeB[0];
+                        key += 1;
+                    } else {
+                        if (b[key + i - 1] == 'C' && b[key + i - 2] == '{') {//判断前面的为字符集C时转换字符集B
                             b[key + i - 2] = 0x7b;
                             b[key + i - 1] = 0x42;
                             b[key + i] = codeB[0];
                             b[key + i + 1] = codeB[0];
                             key += 1;
-                        }else{
+                        } else {
                             b[key + i] = 0x7b;
                             b[key + i + 1] = 0x42;
                             b[key + i + 2] = codeB[0];
@@ -2157,19 +2209,19 @@ public class FeiYunUtils {
                         b[key + i + 1] = 0x43;
                         b[key + i + 2] = codeC[iindex];
                         key += 2;
-                    }else {
+                    } else {
                         chr = "";
                         b[key + i] = codeC[iindex];
-                        if(iindex == 48) chr = "chr";//判断chr(48)等于0的情况
+                        if (iindex == 48) chr = "chr";//判断chr(48)等于0的情况
                     }
                 }
             }
             int lastKey = getLastIndex(b);
             if (length % 2 > 0) {
                 int lastnum = Integer.valueOf(input.substring(input.length() - 1)); // 取得字符串的最后一个数字
-                if(b[lastKey] == '0' && b[lastKey-1] == '0'){//判断前面的为字符集B,此时不需要转换字符集
+                if (b[lastKey] == '0' && b[lastKey - 1] == '0') {//判断前面的为字符集B,此时不需要转换字符集
                     b[lastKey + 1] = codeB[lastnum];
-                }else{
+                } else {
                     b[lastKey + 1] = 0x7b;
                     b[lastKey + 2] = 0x42;
                     b[lastKey + 3] = codeB[lastnum];
@@ -2183,14 +2235,14 @@ public class FeiYunUtils {
             str = new String(b);
             laststr = str;
 
-            String Last_two = input.substring(input.length()-2,input.length());
+            String Last_two = input.substring(input.length() - 2, input.length());
             int Last_two_int = 0;
             Last_two_int = Integer.valueOf(Last_two);
-            if(Last_two_int > 32) {
+            if (Last_two_int > 32) {
                 laststr = laststr.trim().substring(1);
             }
         } else { // 1-14位数字的条形码进来这个区间
-            b[15] = (byte) (length+2);
+            b[15] = (byte) (length + 2);
             laststr = new String(b);
             laststr = laststr.substring(0, 18);
             laststr += input;

+ 3 - 3
src/main/java/com/sqx/scheduler/export/ExportScheduler.java

@@ -71,11 +71,11 @@ public class ExportScheduler {
      * 每分钟运行一次
      */
     @Async
-//    @Scheduled(cron = "18 */1 * * * ?", zone = "Asia/Shanghai")
-    @GetMapping("excelOrder")
+    @Scheduled(cron = "18 */1 * * * ?", zone = "Asia/Shanghai")
+//    @GetMapping("excelOrder")
     public void orderExport() throws Exception {
         List<ExportJob> exportJobList=exportJobService.list(new QueryWrapper<ExportJob>()
-                .eq("flag",3).last("order by create_time limit 10"));
+                .eq("flag",0).last("order by create_time limit 10"));
         log.info("本次导出数据exportJobList==========="+exportJobList);
         if (null == exportJobList ||exportJobList.isEmpty()){
             return;

+ 1 - 1
src/main/resources/application.yml

@@ -19,7 +19,7 @@ spring:
     allow-circular-references: true
   # 环境 dev|test|prod
   profiles:
-    active: dev
+    active: prod
   # jackson时间格式化
   jackson:
     time-zone: GMT+8

+ 92 - 50
src/main/resources/mapper/dataCentre/dataCenterMapper.xml

@@ -61,14 +61,20 @@
     <select id="selectPayOrderAnalyze" resultType="com.sqx.modules.order.entity.TbOrder">
         select tor.*, gs.shop_name as shopName from tb_order tor left join goods_shop gs on tor.shop_id = gs.shop_id
         where tor.is_pay = 1
-        <if test="dateType=='day'">
-            and date_format(tor.pay_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
+        <if test="query.dateType=='day'">
+            and date_format(tor.pay_time,'%Y-%m-%d')=date_format(#{query.date},'%Y-%m-%d')
         </if>
-        <if test="dateType=='month'">
-            and date_format(tor.pay_time,'%Y-%m')=date_format(#{date},'%Y-%m')
+        <if test="query.dateType=='month'">
+            and date_format(tor.pay_time,'%Y-%m')=date_format(#{query.date},'%Y-%m')
         </if>
-        <if test="dateType=='year'">
-            and date_format(tor.pay_time,'%Y')=date_format(#{date},'%Y')
+        <if test="query.dateType=='year'">
+            and date_format(tor.pay_time,'%Y')=date_format(#{query.date},'%Y')
+        </if>
+        <if test="query.startTime!=null and query.startTime!=''">
+            and tor.pay_time>=#{query.startTime}
+        </if>
+        <if test="query.endTime!=null and query.endTime!=''">
+            and tor.pay_time <![CDATA[<=]]> #{query.endTime}
         </if>
         order by tor.pay_time desc
     </select>
@@ -268,27 +274,39 @@
 
     <select id="allUserCount" resultType="int">
         select count(*) from tb_user where status = 1
-        <if test="dateType=='day'">
-            and date_format(create_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
+        <if test="query.dateType=='day'">
+            and date_format(create_time,'%Y-%m-%d')=date_format(#{query.date},'%Y-%m-%d')
         </if>
-        <if test="dateType=='month'">
-            and date_format(create_time,'%Y-%m')=date_format(#{date},'%Y-%m')
+        <if test="query.dateType=='month'">
+            and date_format(create_time,'%Y-%m')=date_format(#{query.date},'%Y-%m')
         </if>
-        <if test="dateType=='year'">
-            and date_format(create_time,'%Y')=date_format(#{date},'%Y')
+        <if test="query.dateType=='year'">
+            and date_format(create_time,'%Y')=date_format(#{query.date},'%Y')
+        </if>
+        <if test="query.startTime!=null and query.startTime!=''">
+            and create_time>=#{query.startTime}
+        </if>
+        <if test="query.endTime!=null and query.endTime!=''">
+            and create_time <![CDATA[<=]]> #{query.endTime}
         </if>
     </select>
 
     <select id="phoneUserCount" resultType="int">
         select count(*) from tb_user where status = 1 and phone is not null
-        <if test="dateType=='day'">
-            and date_format(create_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
+        <if test="query.dateType=='day'">
+            and date_format(create_time,'%Y-%m-%d')=date_format(#{query.date},'%Y-%m-%d')
         </if>
-        <if test="dateType=='month'">
-            and date_format(create_time,'%Y-%m')=date_format(#{date},'%Y-%m')
+        <if test="query.dateType=='month'">
+            and date_format(create_time,'%Y-%m')=date_format(#{query.date},'%Y-%m')
         </if>
-        <if test="dateType=='year'">
-            and date_format(create_time,'%Y')=date_format(#{date},'%Y')
+        <if test="query.dateType=='year'">
+            and date_format(create_time,'%Y')=date_format(#{query.date},'%Y')
+        </if>
+        <if test="query.startTime!=null and query.startTime!=''">
+            and create_time>=#{query.startTime}
+        </if>
+        <if test="query.endTime!=null and query.endTime!=''">
+            and create_time <![CDATA[<=]]> #{query.endTime}
         </if>
     </select>
 
@@ -426,17 +444,23 @@
         select count(*) from tb_order
         where order_type = #{orderType}
         and is_pay=1 and status in (0,3,4,7,6)
-        <if test="shopId!=null">
-            and shop_id = #{shopId}
+        <if test="query.shopId!=null">
+            and shop_id = #{query.shopId}
         </if>
-        <if test="dateType=='day'">
-            and date_format(pay_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
+        <if test="query.dateType=='day'">
+            and date_format(pay_time,'%Y-%m-%d')=date_format(#{query.date},'%Y-%m-%d')
         </if>
-        <if test="dateType=='month'">
-            and date_format(pay_time,'%Y-%m')=date_format(#{date},'%Y-%m')
+        <if test="query.dateType=='month'">
+            and date_format(pay_time,'%Y-%m')=date_format(#{query.date},'%Y-%m')
         </if>
-        <if test="dateType=='year'">
-            and date_format(pay_time,'%Y')=date_format(#{date},'%Y')
+        <if test="query.dateType=='year'">
+            and date_format(pay_time,'%Y')=date_format(#{query.date},'%Y')
+        </if>
+        <if test="query.startTime!=null and query.startTime!=''">
+            and pay_time>=#{query.startTime}
+        </if>
+        <if test="query.endTime!=null and query.endTime!=''">
+            and pay_time <![CDATA[<=]]> #{query.endTime}
         </if>
     </select>
 
@@ -444,49 +468,67 @@
         select ifnull(sum(pay_money), 0) from tb_order
         where order_type = #{orderType}
         and is_pay=1 and status in (0,3,4,7,6)
-        <if test="shopId!=null">
-            and shop_id = #{shopId}
+        <if test="query.shopId!=null">
+            and shop_id = #{query.shopId}
         </if>
-        <if test="dateType=='day'">
-            and date_format(pay_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
+        <if test="query.dateType=='day'">
+            and date_format(pay_time,'%Y-%m-%d')=date_format(#{query.date},'%Y-%m-%d')
         </if>
-        <if test="dateType=='month'">
-            and date_format(pay_time,'%Y-%m')=date_format(#{date},'%Y-%m')
+        <if test="query.dateType=='month'">
+            and date_format(pay_time,'%Y-%m')=date_format(#{query.date},'%Y-%m')
         </if>
-        <if test="dateType=='year'">
-            and date_format(pay_time,'%Y')=date_format(#{date},'%Y')
+        <if test="query.dateType=='year'">
+            and date_format(pay_time,'%Y')=date_format(#{query.date},'%Y')
+        </if>
+        <if test="query.startTime!=null and query.startTime!=''">
+            and pay_time>=#{query.startTime}
+        </if>
+        <if test="query.endTime!=null and query.endTime!=''">
+            and pay_time <![CDATA[<=]]> #{query.endTime}
         </if>
     </select>
 
     <select id="cancelOrderCount" resultType="int">
         select count(*) from tb_order where status = 5
-        <if test="shopId!=null">
-            and shop_id = #{shopId}
+        <if test="query.shopId!=null">
+            and shop_id = #{query.shopId}
         </if>
-        <if test="dateType=='day'">
-            and date_format(create_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
+        <if test="query.dateType=='day'">
+            and date_format(create_time,'%Y-%m-%d')=date_format(#{query.date},'%Y-%m-%d')
         </if>
-        <if test="dateType=='month'">
-            and date_format(create_time,'%Y-%m')=date_format(#{date},'%Y-%m')
+        <if test="query.dateType=='month'">
+            and date_format(create_time,'%Y-%m')=date_format(#{query.date},'%Y-%m')
         </if>
-        <if test="dateType=='year'">
-            and date_format(create_time,'%Y')=date_format(#{date},'%Y')
+        <if test="query.dateType=='year'">
+            and date_format(create_time,'%Y')=date_format(#{query.date},'%Y')
+        </if>
+        <if test="query.startTime!=null and query.startTime!=''">
+            and create_time>=#{query.startTime}
+        </if>
+        <if test="query.endTime!=null and query.endTime!=''">
+            and create_time <![CDATA[<=]]> #{query.endTime}
         </if>
     </select>
 
     <select id="cancelOrderMoney" resultType="java.math.BigDecimal">
         select ifnull(sum(pay_money), 0) from tb_order where status = 5
-        <if test="shopId!=null">
-            and shop_id = #{shopId}
+        <if test="query.shopId!=null">
+            and shop_id = #{query.shopId}
         </if>
-        <if test="dateType=='day'">
-            and date_format(create_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
+        <if test="query.dateType=='day'">
+            and date_format(create_time,'%Y-%m-%d')=date_format(#{query.date},'%Y-%m-%d')
         </if>
-        <if test="dateType=='month'">
-            and date_format(create_time,'%Y-%m')=date_format(#{date},'%Y-%m')
+        <if test="query.dateType=='month'">
+            and date_format(create_time,'%Y-%m')=date_format(#{query.date},'%Y-%m')
         </if>
-        <if test="dateType=='year'">
-            and date_format(create_time,'%Y')=date_format(#{date},'%Y')
+        <if test="query.dateType=='year'">
+            and date_format(create_time,'%Y')=date_format(#{query.date},'%Y')
+        </if>
+        <if test="query.startTime!=null and query.startTime!=''">
+            and create_time>=#{query.startTime}
+        </if>
+        <if test="query.endTime!=null and query.endTime!=''">
+            and create_time <![CDATA[<=]]> #{query.endTime}
         </if>
     </select>
 

+ 12 - 6
src/main/resources/mapper/errand/ErrandComplaintMapper.xml

@@ -62,14 +62,20 @@
 
     <select id="deductMoneySum" resultType="java.math.BigDecimal">
         select ifnull(sum(deduct_money), 0) from errand_complaint where 1 = 1
-        <if test="dateType=='day'">
-            and date_format(complaint_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
+        <if test="query.dateType=='day'">
+            and date_format(complaint_time,'%Y-%m-%d')=date_format(#{query.date},'%Y-%m-%d')
         </if>
-        <if test="dateType=='month'">
-            and date_format(complaint_time,'%Y-%m')=date_format(#{date},'%Y-%m')
+        <if test="query.dateType=='month'">
+            and date_format(complaint_time,'%Y-%m')=date_format(#{query.date},'%Y-%m')
         </if>
-        <if test="dateType=='year'">
-            and date_format(complaint_time,'%Y')=date_format(#{date},'%Y')
+        <if test="query.dateType=='year'">
+            and date_format(complaint_time,'%Y')=date_format(#{query.date},'%Y')
+        </if>
+        <if test="query.startTime!=null and query.startTime!=''">
+            and complaint_time>=#{query.startTime}
+        </if>
+        <if test="query.endTime!=null and query.endTime!=''">
+            and complaint_time <![CDATA[<=]]> #{query.endTime}
         </if>
         and complaint_state = 3
     </select>

+ 72 - 36
src/main/resources/mapper/errand/TbIndentMapper.xml

@@ -516,54 +516,78 @@
 
     <select id="billMoney" resultType="java.math.BigDecimal">
         select ifnull(sum(indent_money),0) from tb_indent where indent_state in (2, 3, 4, 6)
-        <if test="dateType=='day'">
-            and date_format(create_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
+        <if test="query.dateType=='day'">
+            and date_format(create_time,'%Y-%m-%d')=date_format(#{query.date},'%Y-%m-%d')
         </if>
-        <if test="dateType=='month'">
-            and date_format(create_time,'%Y-%m')=date_format(#{date},'%Y-%m')
+        <if test="query.dateType=='month'">
+            and date_format(create_time,'%Y-%m')=date_format(#{query.date},'%Y-%m')
         </if>
-        <if test="dateType=='year'">
-            and date_format(create_time,'%Y')=date_format(#{date},'%Y')
+        <if test="query.dateType=='year'">
+            and date_format(create_time,'%Y')=date_format(#{query.date},'%Y')
+        </if>
+        <if test="query.startTime!=null and query.startTime!=''">
+            and create_time>=#{query.startTime}
+        </if>
+        <if test="query.endTime!=null and query.endTime!=''">
+            and create_time <![CDATA[<=]]> #{query.endTime}
         </if>
     </select>
 
     <select id="receivingMoney" resultType="java.math.BigDecimal">
         select ifnull(sum(indent_money),0) from tb_indent where indent_state in (3, 4, 6)
-        <if test="dateType=='day'">
-            and date_format(create_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
+        <if test="query.dateType=='day'">
+            and date_format(create_time,'%Y-%m-%d')=date_format(#{query.date},'%Y-%m-%d')
         </if>
-        <if test="dateType=='month'">
-            and date_format(create_time,'%Y-%m')=date_format(#{date},'%Y-%m')
+        <if test="query.dateType=='month'">
+            and date_format(create_time,'%Y-%m')=date_format(#{query.date},'%Y-%m')
         </if>
-        <if test="dateType=='year'">
-            and date_format(create_time,'%Y')=date_format(#{date},'%Y')
+        <if test="query.dateType=='year'">
+            and date_format(create_time,'%Y')=date_format(#{query.date},'%Y')
+        </if>
+        <if test="query.startTime!=null and query.startTime!=''">
+            and create_time>=#{query.startTime}
+        </if>
+        <if test="query.endTime!=null and query.endTime!=''">
+            and create_time <![CDATA[<=]]> #{query.endTime}
         </if>
     </select>
 
     <select id="billCount" resultType="int">
         select count(*) from tb_indent
         where indent_state in (2, 3, 4, 6)
-        <if test="dateType=='day'">
-            and date_format(create_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
+        <if test="query.dateType=='day'">
+            and date_format(create_time,'%Y-%m-%d')=date_format(#{query.date},'%Y-%m-%d')
         </if>
-        <if test="dateType=='month'">
-            and date_format(create_time,'%Y-%m')=date_format(#{date},'%Y-%m')
+        <if test="query.dateType=='month'">
+            and date_format(create_time,'%Y-%m')=date_format(#{query.date},'%Y-%m')
         </if>
-        <if test="dateType=='year'">
-            and date_format(create_time,'%Y')=date_format(#{date},'%Y')
+        <if test="query.dateType=='year'">
+            and date_format(create_time,'%Y')=date_format(#{query.date},'%Y')
+        </if>
+        <if test="query.startTime!=null and query.startTime!=''">
+            and create_time>=#{query.startTime}
+        </if>
+        <if test="query.endTime!=null and query.endTime!=''">
+            and create_time <![CDATA[<=]]> #{query.endTime}
         </if>
     </select>
 
     <select id="reveivingCount" resultType="int">
         select count(*) from tb_indent where indent_state in (3, 4, 6)
-        <if test="dateType=='day'">
-            and date_format(create_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
+        <if test="query.dateType=='day'">
+            and date_format(create_time,'%Y-%m-%d')=date_format(#{query.date},'%Y-%m-%d')
         </if>
-        <if test="dateType=='month'">
-            and date_format(create_time,'%Y-%m')=date_format(#{date},'%Y-%m')
+        <if test="query.dateType=='month'">
+            and date_format(create_time,'%Y-%m')=date_format(#{query.date},'%Y-%m')
         </if>
-        <if test="dateType=='year'">
-            and date_format(create_time,'%Y')=date_format(#{date},'%Y')
+        <if test="query.dateType=='year'">
+            and date_format(create_time,'%Y')=date_format(#{query.date},'%Y')
+        </if>
+        <if test="query.startTime!=null and query.startTime!=''">
+            and create_time>=#{query.startTime}
+        </if>
+        <if test="query.endTime!=null and query.endTime!=''">
+            and create_time <![CDATA[<=]]> #{query.endTime}
         </if>
     </select>
 
@@ -573,18 +597,24 @@
         left join tb_user t on s.user_id = t.user_id
         left join tb_user u on s.rider_user_id = u.user_id
         where indent_state = "6"
-        <if test="dateType=='day'">
-            and date_format(s.create_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
+        <if test="query.dateType=='day'">
+            and date_format(s.create_time,'%Y-%m-%d')=date_format(#{query.date},'%Y-%m-%d')
         </if>
-        <if test="dateType=='month'">
-            and date_format(s.create_time,'%Y-%m')=date_format(#{date},'%Y-%m')
+        <if test="query.dateType=='month'">
+            and date_format(s.create_time,'%Y-%m')=date_format(#{query.date},'%Y-%m')
         </if>
-        <if test="dateType=='year'">
-            and date_format(s.create_time,'%Y')=date_format(#{date},'%Y')
+        <if test="query.dateType=='year'">
+            and date_format(s.create_time,'%Y')=date_format(#{query.date},'%Y')
         </if>
         <if test="indentState!=null and indentState!=''">
             and s.indent_state = #{status}
         </if>
+        <if test="query.startTime!=null and query.startTime!=''">
+            and s.create_time>=#{query.startTime}
+        </if>
+        <if test="query.endTime!=null and query.endTime!=''">
+            and s.create_time <![CDATA[<=]]> #{query.endTime}
+        </if>
         order by s.create_time desc
     </select>
 
@@ -647,14 +677,20 @@
         <if test="status!=null">
             and indent_state = #{status}
         </if>
-        <if test="dateType=='day'">
-            and date_format(create_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
+        <if test="query.dateType=='day'">
+            and date_format(create_time,'%Y-%m-%d')=date_format(#{query.date},'%Y-%m-%d')
         </if>
-        <if test="dateType=='month'">
-            and date_format(create_time,'%Y-%m')=date_format(#{date},'%Y-%m')
+        <if test="query.dateType=='month'">
+            and date_format(create_time,'%Y-%m')=date_format(#{query.date},'%Y-%m')
         </if>
-        <if test="dateType=='year'">
-            and date_format(create_time,'%Y')=date_format(#{date},'%Y')
+        <if test="query.dateType=='year'">
+            and date_format(create_time,'%Y')=date_format(#{query.date},'%Y')
+        </if>
+        <if test="query.startTime!=null and query.startTime!=''">
+            and create_time>=#{query.startTime}
+        </if>
+        <if test="query.endTime!=null and query.endTime!=''">
+            and create_time <![CDATA[<=]]> #{query.endTime}
         </if>
     </select>
 

+ 28 - 16
src/main/resources/mapper/order/OrderMapper.xml

@@ -364,33 +364,45 @@
 
     <select id="selectSumMoney" resultType="java.math.BigDecimal">
         select ifnull(sum(pay_money), 0) from tb_order where is_pay=1 and status in (0,3,4,7,6)
-        <if test="shopId!=null">
-            and shop_id=#{shopId}
+        <if test="query.shopId!=null">
+            and shop_id=#{query.shopId}
         </if>
-        <if test="dateType=='day'">
-            and date_format(pay_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
+        <if test="query.dateType=='day'">
+            and date_format(pay_time,'%Y-%m-%d')=date_format(#{query.date},'%Y-%m-%d')
         </if>
-        <if test="dateType=='month'">
-            and date_format(pay_time,'%Y-%m')=date_format(#{date},'%Y-%m')
+        <if test="query.dateType=='month'">
+            and date_format(pay_time,'%Y-%m')=date_format(#{query.date},'%Y-%m')
         </if>
-        <if test="dateType=='year'">
-            and date_format(pay_time,'%Y')=date_format(#{date},'%Y')
+        <if test="query.dateType=='year'">
+            and date_format(pay_time,'%Y')=date_format(#{query.date},'%Y')
+        </if>
+        <if test="query.startTime!=null and query.startTime!=''">
+            and pay_time>=#{query.startTime}
+        </if>
+        <if test="query.endTime!=null and query.endTime!=''">
+            and pay_time <![CDATA[<=]]> #{query.endTime}
         </if>
     </select>
 
     <select id="selectCountOrder" resultType="int">
         select count(*) from tb_order where is_pay=1 and status in (0,3,4,7,6)
-        <if test="shopId!=null">
-            and shop_id=#{shopId}
+        <if test="query.shopId!=null">
+            and shop_id=#{query.shopId}
         </if>
-        <if test="dateType=='day'">
-            and date_format(pay_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
+        <if test="query.dateType=='day'">
+            and date_format(pay_time,'%Y-%m-%d')=date_format(#{query.date},'%Y-%m-%d')
         </if>
-        <if test="dateType=='month'">
-            and date_format(pay_time,'%Y-%m')=date_format(#{date},'%Y-%m')
+        <if test="query.dateType=='month'">
+            and date_format(pay_time,'%Y-%m')=date_format(#{query.date},'%Y-%m')
         </if>
-        <if test="dateType=='year'">
-            and date_format(pay_time,'%Y')=date_format(#{date},'%Y')
+        <if test="query.dateType=='year'">
+            and date_format(pay_time,'%Y')=date_format(#{query.date},'%Y')
+        </if>
+        <if test="query.startTime!=null and query.startTime!=''">
+            and pay_time>=#{query.startTime}
+        </if>
+        <if test="query.endTime!=null and query.endTime!=''">
+            and pay_time <![CDATA[<=]]> #{query.endTime}
         </if>
     </select>
 

+ 36 - 18
src/main/resources/mapper/pay/CashDao.xml

@@ -189,42 +189,60 @@
 
     <select id="cargoInsurance" resultType="java.math.BigDecimal">
         select ifnull(sum(cargo_insurance), 0) from tb_indent where 1 = 1
-        <if test="dateType=='day'">
-            and date_format(create_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
+        <if test="query.dateType=='day'">
+            and date_format(create_time,'%Y-%m-%d')=date_format(#{query.date},'%Y-%m-%d')
         </if>
-        <if test="dateType=='month'">
-            and date_format(create_time,'%Y-%m')=date_format(#{date},'%Y-%m')
+        <if test="query.dateType=='month'">
+            and date_format(create_time,'%Y-%m')=date_format(#{query.date},'%Y-%m')
         </if>
-        <if test="dateType=='year'">
-            and date_format(create_time,'%Y')=date_format(#{date},'%Y')
+        <if test="query.dateType=='year'">
+            and date_format(create_time,'%Y')=date_format(#{query.date},'%Y')
+        </if>
+        <if test="query.startTime!=null and query.startTime!=''">
+            and create_time>=#{query.startTime}
+        </if>
+        <if test="query.endTime!=null and query.endTime!=''">
+            and create_time <![CDATA[<=]]> #{query.endTime}
         </if>
         and indent_state =6
     </select>
 
     <select id="MoneySumByIndentType" resultType="java.math.BigDecimal">
         select ifnull(sum(platform_money), 0) from tb_indent where 1 = 1
-        <if test="dateType=='day'">
-            and date_format(create_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
+        <if test="query.dateType=='day'">
+            and date_format(create_time,'%Y-%m-%d')=date_format(#{query.date},'%Y-%m-%d')
         </if>
-        <if test="dateType=='month'">
-            and date_format(create_time,'%Y-%m')=date_format(#{date},'%Y-%m')
+        <if test="query.dateType=='month'">
+            and date_format(create_time,'%Y-%m')=date_format(#{query.date},'%Y-%m')
         </if>
-        <if test="dateType=='year'">
-            and date_format(create_time,'%Y')=date_format(#{date},'%Y')
+        <if test="query.dateType=='year'">
+            and date_format(create_time,'%Y')=date_format(#{query.date},'%Y')
+        </if>
+        <if test="query.startTime!=null and query.startTime!=''">
+            and create_time>=#{query.startTime}
+        </if>
+        <if test="query.endTime!=null and query.endTime!=''">
+            and create_time <![CDATA[<=]]> #{query.endTime}
         </if>
         and indent_state = 6 and indent_type = #{indentType}
     </select>
 
     <select id="cashDepositMoney" resultType="java.math.BigDecimal">
         select ifnull(sum(money), 0) from pay_details where 1 = 1
-        <if test="dateType=='day'">
-            and date_format(create_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
+        <if test="query.dateType=='day'">
+            and date_format(create_time,'%Y-%m-%d')=date_format(#{query.date},'%Y-%m-%d')
         </if>
-        <if test="dateType=='month'">
-            and date_format(create_time,'%Y-%m')=date_format(#{date},'%Y-%m')
+        <if test="query.dateType=='month'">
+            and date_format(create_time,'%Y-%m')=date_format(#{query.date},'%Y-%m')
         </if>
-        <if test="dateType=='year'">
-            and date_format(create_time,'%Y')=date_format(#{date},'%Y')
+        <if test="query.dateType=='year'">
+            and date_format(create_time,'%Y')=date_format(#{query.date},'%Y')
+        </if>
+        <if test="query.startTime!=null and query.startTime!=''">
+            and create_time>=#{query.startTime}
+        </if>
+        <if test="query.endTime!=null and query.endTime!=''">
+            and create_time <![CDATA[<=]]> #{query.endTime}
         </if>
         and type = 3 and state = 1
     </select>

+ 6 - 0
src/main/resources/mapper/printInfo/PrintInfoDetailDao.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.sqx.modules.printInfo.dao.PrintInfoDao">
+
+
+</mapper>