Просмотр исходного кода

Accept Merge Request #18: (dev-wxl -> dev-minio)

Merge Request: 合并

Created By: @万新亮
Accepted By: @万新亮
URL: https://chuanghaikeji.coding.net/p/moxuanyunshangwaimai/d/backend/git/merge/18
万新亮 1 год назад
Родитель
Сommit
ce02ad7b4c
62 измененных файлов с 2863 добавлено и 396 удалено
  1. 41 0
      db/insert_241011.sql
  2. 18 0
      pom.xml
  3. 230 0
      src/main/java/com/sqx/common/utils/SftpUtil.java
  4. 11 5
      src/main/java/com/sqx/datasource/config/DynamicDataSourceConfig.java
  5. 15 15
      src/main/java/com/sqx/datasource/properties/DynamicDataSourceProperties.java
  6. 19 3
      src/main/java/com/sqx/modules/app/dao/UserMoneyDetailsDao.java
  7. 56 0
      src/main/java/com/sqx/modules/app/entity/UserMoneyDetails.java
  8. 33 0
      src/main/java/com/sqx/modules/app/service/UserMoneyDetailsService.java
  9. 122 6
      src/main/java/com/sqx/modules/app/service/impl/UserMoneyDetailsServiceImpl.java
  10. 11 8
      src/main/java/com/sqx/modules/datacentre/controller/DataCentreController.java
  11. 13 9
      src/main/java/com/sqx/modules/datacentre/dao/DataCentreDao.java
  12. 25 0
      src/main/java/com/sqx/modules/datacentre/query/DataCenterQuery.java
  13. 43 0
      src/main/java/com/sqx/modules/datacentre/query/ShopCenterQuery.java
  14. 10 4
      src/main/java/com/sqx/modules/datacentre/service/DataCentreService.java
  15. 55 24
      src/main/java/com/sqx/modules/datacentre/service/impl/DataCentreServiceImpl.java
  16. 5 4
      src/main/java/com/sqx/modules/errand/controller/TbIndentController.java
  17. 3 1
      src/main/java/com/sqx/modules/errand/dao/ErrandComplaintDao.java
  18. 7 6
      src/main/java/com/sqx/modules/errand/dao/TbIndentDao.java
  19. 3 2
      src/main/java/com/sqx/modules/errand/service/TbIndentService.java
  20. 17 16
      src/main/java/com/sqx/modules/errand/service/impl/TbIndentServiceImpl.java
  21. 262 0
      src/main/java/com/sqx/modules/exportExecl/controller/ExportExeclController.java
  22. 39 0
      src/main/java/com/sqx/modules/exportExecl/dto/AccountEntry.java
  23. 18 0
      src/main/java/com/sqx/modules/exportExecl/mapper/ExportJobMapper.java
  24. 66 0
      src/main/java/com/sqx/modules/exportExecl/model/ExportJob.java
  25. 118 0
      src/main/java/com/sqx/modules/exportExecl/model/ExportOrderVo.java
  26. 16 0
      src/main/java/com/sqx/modules/exportExecl/service/ExportJobService.java
  27. 20 0
      src/main/java/com/sqx/modules/exportExecl/service/impl/ExportJobServiceImpl.java
  28. 4 2
      src/main/java/com/sqx/modules/goods/controller/GoodsShopController.java
  29. 2 1
      src/main/java/com/sqx/modules/goods/service/GoodsShopService.java
  30. 12 9
      src/main/java/com/sqx/modules/goods/service/impl/GoodsShopServiceImpl.java
  31. 22 22
      src/main/java/com/sqx/modules/order/controller/OrderController.java
  32. 13 5
      src/main/java/com/sqx/modules/order/dao/AppOrderDao.java
  33. 19 0
      src/main/java/com/sqx/modules/order/entity/TbOrder.java
  34. 4 2
      src/main/java/com/sqx/modules/order/service/AppOrderService.java
  35. 41 26
      src/main/java/com/sqx/modules/order/service/impl/AppAppOrderServiceImpl.java
  36. 3 2
      src/main/java/com/sqx/modules/pay/controller/CashController.java
  37. 47 0
      src/main/java/com/sqx/modules/pay/controller/query/CashOutQueryDTO.java
  38. 36 2
      src/main/java/com/sqx/modules/pay/controller/query/WalletDetailQuery.java
  39. 4 3
      src/main/java/com/sqx/modules/pay/dao/CashOutDao.java
  40. 2 1
      src/main/java/com/sqx/modules/pay/service/CashOutService.java
  41. 10 9
      src/main/java/com/sqx/modules/pay/service/impl/CashOutServiceImpl.java
  42. 1 1
      src/main/java/com/sqx/modules/pay/vo/WalletDetailVO.java
  43. 53 33
      src/main/java/com/sqx/modules/printInfo/controller/PrintInfoController.java
  44. 19 0
      src/main/java/com/sqx/modules/printInfo/dao/PrintInfoDetailDao.java
  45. 41 0
      src/main/java/com/sqx/modules/printInfo/entity/PrintInfoDetail.java
  46. 111 0
      src/main/java/com/sqx/modules/printInfo/entity/eOrderStatus.java
  47. 22 0
      src/main/java/com/sqx/modules/printInfo/service/PrintInfoDetailService.java
  48. 50 0
      src/main/java/com/sqx/modules/printInfo/service/impl/PrintInfoDetailServiceImpl.java
  49. 7 0
      src/main/java/com/sqx/modules/shop/controller/app/ShopMoneyController.java
  50. 32 2
      src/main/java/com/sqx/modules/utils/excel/ExportExcelUtils.java
  51. 37 4
      src/main/java/com/sqx/modules/utils/fieYun/FeiYunUtils.java
  52. 5 0
      src/main/java/com/sqx/scheduler/config/SchedulerLock.java
  53. 287 0
      src/main/java/com/sqx/scheduler/export/ExportScheduler.java
  54. 39 0
      src/main/resources/application-dev.yml
  55. 39 0
      src/main/resources/application-prod.yml
  56. 144 63
      src/main/resources/mapper/dataCentre/dataCenterMapper.xml
  57. 12 6
      src/main/resources/mapper/errand/ErrandComplaintMapper.xml
  58. 72 36
      src/main/resources/mapper/errand/TbIndentMapper.xml
  59. 87 18
      src/main/resources/mapper/order/OrderMapper.xml
  60. 36 18
      src/main/resources/mapper/pay/CashDao.xml
  61. 6 0
      src/main/resources/mapper/printInfo/PrintInfoDetailDao.xml
  62. 268 28
      src/main/resources/mapper/userMoney/UserMoneyDetailsMapper.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;

+ 18 - 0
pom.xml

@@ -416,6 +416,24 @@
             <version>2.1.6</version>
             <version>2.1.6</version>
         </dependency>
         </dependency>
 
 
+        <!-- excel操作 -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>easyexcel</artifactId>
+            <version>3.1.1</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.jcraft</groupId>
+            <artifactId>jsch</artifactId>
+            <version>0.1.54</version>
+        </dependency>
+
+        <!--<dependency>-->
+        <!--<groupId>com.baidu.aip</groupId>-->
+        <!--            <artifactId>java-sdk</artifactId>-->
+        <!--            <version>4.11.3</version>-->
+        <!--</dependency>-->
         <!-- minio -->
         <!-- minio -->
         <dependency>
         <dependency>
             <groupId>io.minio</groupId>
             <groupId>io.minio</groupId>

+ 230 - 0
src/main/java/com/sqx/common/utils/SftpUtil.java

@@ -0,0 +1,230 @@
+package com.sqx.common.utils;
+
+import org.apache.commons.io.IOUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import com.jcraft.jsch.*;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.io.*;
+import java.util.Properties;
+
+/**
+ * 类说明 sftp工具类
+ */
+@Component
+public class SftpUtil {
+    private transient Logger log = LoggerFactory.getLogger(this.getClass());
+
+    private ChannelSftp sftp;
+
+    private Session session;
+    /** SFTP 登录用户名*/
+    @Value("${sftp.username}")
+    private String username;
+    /** SFTP 登录密码*/
+    @Value("${sftp.password}")
+    private String password;
+    /** 私钥 */
+    private String privateKey;
+    /** SFTP 服务器地址IP地址*/
+    @Value("${sftp.host}")
+    private String host;
+    /** SFTP 端口*/
+    @Value("${sftp.port}")
+    private int port;
+
+
+    /**
+     * 构造基于密码认证的sftp对象
+     */
+    public SftpUtil(String username, String password, String host, int port) {
+        this.username = username;
+        this.password = password;
+        this.host = host;
+        this.port = port;
+    }
+
+    /**
+     * 构造基于秘钥认证的sftp对象
+     */
+    public SftpUtil(String username, String host, int port, String privateKey) {
+        this.username = username;
+        this.host = host;
+        this.port = port;
+        this.privateKey = privateKey;
+    }
+
+    public SftpUtil(){}
+
+
+    /**
+     * 连接sftp服务器
+     */
+    public void login(){
+        try {
+            JSch jsch = new JSch();
+            if (privateKey != null) {
+                jsch.addIdentity(privateKey);// 设置私钥
+            }
+
+            session = jsch.getSession(username, host, port);
+
+            if (password != null) {
+                session.setPassword(password);
+            }
+            Properties config = new Properties();
+            config.put("StrictHostKeyChecking", "no");
+
+            session.setConfig(config);
+            session.connect();
+
+            Channel channel = session.openChannel("sftp");
+            channel.connect();
+
+            sftp = (ChannelSftp) channel;
+        } catch (JSchException e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 关闭连接 server
+     */
+    public void logout(){
+        try{
+            if (sftp != null) {
+                if (sftp.isConnected()) {
+                    sftp.disconnect();
+                }
+            }
+            if (session != null) {
+                if (session.isConnected()) {
+                    session.disconnect();
+                }
+            }
+        }catch (Exception e){
+            log.error("sftp登出失败", e);
+        }
+    }
+
+
+    /**
+     * 将输入流的数据上传到sftp作为文件。文件完整路径=basePath+directory
+     * @param directory  上传到该目录
+     * @param sftpFileName  sftp端文件名
+     * @param input   输入流
+     */
+    public void upload(String directory, String sftpFileName, InputStream input) throws SftpException{
+        try {
+            String home = sftp.getHome();
+            sftp.cd(home);
+            //sftp.cd(basePath);
+            sftp.cd(directory);
+        } catch (SftpException e) {
+            //目录不存在,则创建文件夹
+            String [] dirs=directory.split("/");
+            String tempPath=sftp.getHome();
+            for(String dir:dirs){
+                if(null== dir || "".equals(dir)) continue;
+                tempPath+="/"+dir;
+                try{
+                    sftp.cd(tempPath);
+                }catch(SftpException ex){
+                    sftp.mkdir(tempPath);
+                    sftp.cd(tempPath);
+                }
+            }
+        }
+        sftp.put(input, sftpFileName);  //上传文件
+    }
+
+
+    /**
+     * 下载文件。
+     * @param directory 下载目录
+     * @param downloadFile 下载的文件
+     * @param saveFile 存在本地的路径
+     */
+    public void download(String directory, String downloadFile, File saveFile) throws SftpException, FileNotFoundException{
+        String home = sftp.getHome();
+        sftp.cd(home);
+        if (directory != null && !"".equals(directory)) {
+            sftp.cd(directory);
+        }
+        sftp.get(downloadFile, new FileOutputStream(saveFile));
+    }
+    /**
+     * 下载文件。
+     * @param directory 下载目录
+     * @param downloadFile 下载的文件
+     * @param outputStream 输出流
+     */
+    public void downloadStream(String directory, String downloadFile,OutputStream outputStream) throws SftpException, FileNotFoundException{
+        String home = sftp.getHome();
+        sftp.cd(home);
+        if (directory != null && !"".equals(directory)) {
+            sftp.cd(directory);
+        }
+        sftp.get(downloadFile,outputStream);
+    }
+
+    /**
+     * 下载文件
+     * @param directory 下载目录
+     * @param downloadFile 下载的文件名
+     * @return 字节数组
+     */
+    public byte[] download(String directory, String downloadFile) throws SftpException, IOException{
+        if (directory != null && !"".equals(directory)) {
+            sftp.cd(directory);
+        }
+        InputStream is = sftp.get(downloadFile);
+
+        byte[] fileData = IOUtils.toByteArray(is);
+
+        return fileData;
+    }
+
+
+    /**
+     * 删除文件
+     * @param directory 要删除文件所在目录
+     * @param deleteFile 要删除的文件
+     */
+    public void delete(String directory, String deleteFile) throws SftpException{
+        sftp.cd(directory);
+        sftp.rm(deleteFile);
+    }
+
+    public ChannelSftp getSftp() {
+        return sftp;
+    }
+
+    public boolean isConnected(){
+        return sftp.isConnected();
+    }
+
+    public boolean mkdir(String dir){
+        try{
+            sftp.mkdir(dir);
+            return true;
+        }catch (Exception e){
+            log.error("目录创建失败: ", e);
+            return false;
+        }
+    }
+
+    //上传文件测试
+    public static void main(String[] args) throws SftpException, IOException {
+        SftpUtil sftp = new SftpUtil("export", "Waimai2024#", "172.16.20.108", 22);
+        sftp.login();
+        File file = new File("E:\\chen\\Desktop\\fsdownload\\text.log");
+        InputStream is = new FileInputStream(file);
+
+        sftp.upload("/", "text.log", is);
+        sftp.download("/","test_sftp.jpg",file);
+        sftp.logout();
+    }
+}

+ 11 - 5
src/main/java/com/sqx/datasource/config/DynamicDataSourceConfig.java

@@ -2,7 +2,7 @@ package com.sqx.datasource.config;
 
 
 import com.alibaba.druid.pool.DruidDataSource;
 import com.alibaba.druid.pool.DruidDataSource;
 import com.sqx.datasource.properties.DataSourceProperties;
 import com.sqx.datasource.properties.DataSourceProperties;
-import com.sqx.datasource.properties.DynamicDataSourceProperties;
+//import com.sqx.datasource.properties.DynamicDataSourceProperties;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.context.properties.ConfigurationProperties;
 import org.springframework.boot.context.properties.ConfigurationProperties;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
@@ -16,16 +16,21 @@ import java.util.Map;
  * 配置多数据源
  * 配置多数据源
  */
  */
 @Configuration
 @Configuration
-@EnableConfigurationProperties(DynamicDataSourceProperties.class)
+//@EnableConfigurationProperties(DynamicDataSourceProperties.class)
 public class DynamicDataSourceConfig {
 public class DynamicDataSourceConfig {
-    @Autowired
-    private DynamicDataSourceProperties properties;
+//    @Autowired
+//    private DynamicDataSourceProperties properties;
 
 
     @Bean
     @Bean
     @ConfigurationProperties(prefix = "spring.datasource.druid")
     @ConfigurationProperties(prefix = "spring.datasource.druid")
     public DataSourceProperties dataSourceProperties() {
     public DataSourceProperties dataSourceProperties() {
         return new DataSourceProperties();
         return new DataSourceProperties();
     }
     }
+    @Bean
+    @ConfigurationProperties(prefix = "dynamic")
+    public DataSourceProperties getDatasource() {
+        return new DataSourceProperties();
+    }
 
 
     @Bean
     @Bean
     public DynamicDataSource dynamicDataSource(DataSourceProperties dataSourceProperties) {
     public DynamicDataSource dynamicDataSource(DataSourceProperties dataSourceProperties) {
@@ -40,7 +45,8 @@ public class DynamicDataSourceConfig {
     }
     }
 
 
     private Map<Object, Object> getDynamicDataSource(){
     private Map<Object, Object> getDynamicDataSource(){
-        Map<String, DataSourceProperties> dataSourcePropertiesMap = properties.getDatasource();
+        Map<String, DataSourceProperties> dataSourcePropertiesMap = new HashMap<>();
+        dataSourcePropertiesMap.put("dynamic",this.getDatasource());
         Map<Object, Object> targetDataSources = new HashMap<>(dataSourcePropertiesMap.size());
         Map<Object, Object> targetDataSources = new HashMap<>(dataSourcePropertiesMap.size());
         dataSourcePropertiesMap.forEach((k, v) -> {
         dataSourcePropertiesMap.forEach((k, v) -> {
             DruidDataSource druidDataSource = DynamicDataSourceFactory.buildDruidDataSource(v);
             DruidDataSource druidDataSource = DynamicDataSourceFactory.buildDruidDataSource(v);

+ 15 - 15
src/main/java/com/sqx/datasource/properties/DynamicDataSourceProperties.java

@@ -5,18 +5,18 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
 import java.util.LinkedHashMap;
 import java.util.LinkedHashMap;
 import java.util.Map;
 import java.util.Map;
 
 
-/**
- * 多数据源属性
- */
-@ConfigurationProperties(prefix = "dynamic")
-public class DynamicDataSourceProperties {
-    private Map<String, DataSourceProperties> datasource = new LinkedHashMap<>();
-
-    public Map<String, DataSourceProperties> getDatasource() {
-        return datasource;
-    }
-
-    public void setDatasource(Map<String, DataSourceProperties> datasource) {
-        this.datasource = datasource;
-    }
-}
+///**
+// * 多数据源属性
+// */
+//@ConfigurationProperties(prefix = "dynamic")
+//public class DynamicDataSourceProperties {
+//    private Map<String, DataSourceProperties> datasource = new LinkedHashMap<>();
+//
+//    public Map<String, DataSourceProperties> getDatasource() {
+//        return datasource;
+//    }
+//
+//    public void setDatasource(Map<String, DataSourceProperties> datasource) {
+//        this.datasource = datasource;
+//    }
+//}

+ 19 - 3
src/main/java/com/sqx/modules/app/dao/UserMoneyDetailsDao.java

@@ -3,24 +3,28 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.sqx.modules.app.entity.UserMoneyDetails;
 import com.sqx.modules.app.entity.UserMoneyDetails;
+import com.sqx.modules.exportExecl.dto.AccountEntry;
+import com.sqx.modules.pay.controller.query.CashOutQueryDTO;
 import com.sqx.modules.pay.controller.query.WalletDetailQuery;
 import com.sqx.modules.pay.controller.query.WalletDetailQuery;
+import com.sqx.modules.pay.vo.CashOutVO;
 import com.sqx.modules.pay.vo.WalletDetailVO;
 import com.sqx.modules.pay.vo.WalletDetailVO;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
+import java.util.List;
 
 
 @Mapper
 @Mapper
 public interface UserMoneyDetailsDao extends BaseMapper<UserMoneyDetails> {
 public interface UserMoneyDetailsDao extends BaseMapper<UserMoneyDetails> {
 
 
-    Double monthIncome(@Param("date") String date,@Param("userId") Long userId);
+    Double monthIncome(@Param("date") String date, @Param("userId") Long userId);
 
 
     Double selectMyProfit(Long userId);
     Double selectMyProfit(Long userId);
 
 
-    IPage<UserMoneyDetails> selectUserMoneyDetails(Page<UserMoneyDetails> pages,@Param("userId") Long userId, @Param("classify") Integer classify);
+    IPage<UserMoneyDetails> selectUserMoneyDetails(Page<UserMoneyDetails> pages, @Param("userId") Long userId, @Param("classify") Integer classify);
 
 
     IPage<UserMoneyDetails> selectPwCashDetails(Page<UserMoneyDetails> pages, @Param("userName") String userName, @Param("date") String date,
     IPage<UserMoneyDetails> selectPwCashDetails(Page<UserMoneyDetails> pages, @Param("userName") String userName, @Param("date") String date,
-                                                @Param("dateType") String dateType,@Param("zhifubao") String zhifubao, @Param("zhifubaoName") String zhifubaoName,
+                                                @Param("dateType") String dateType, @Param("zhifubao") String zhifubao, @Param("zhifubaoName") String zhifubaoName,
                                                 @Param("userId") Long userId);
                                                 @Param("userId") Long userId);
 
 
     IPage<UserMoneyDetails> selectShopCashDeposit(Page<UserMoneyDetails> pages, Long shopId, Integer classify);
     IPage<UserMoneyDetails> selectShopCashDeposit(Page<UserMoneyDetails> pages, Long shopId, Integer classify);
@@ -30,4 +34,16 @@ public interface UserMoneyDetailsDao extends BaseMapper<UserMoneyDetails> {
     IPage<WalletDetailVO> walletDetailList(@Param("page") Page<UserMoneyDetails> pages, @Param("query") WalletDetailQuery query);
     IPage<WalletDetailVO> walletDetailList(@Param("page") Page<UserMoneyDetails> pages, @Param("query") WalletDetailQuery query);
 
 
     BigDecimal walletDetailStatistics(@Param("query") WalletDetailQuery query);
     BigDecimal walletDetailStatistics(@Param("query") WalletDetailQuery query);
+
+    List<WalletDetailVO> excelWalletDetails(@Param("query") WalletDetailQuery query);
+
+    List<UserMoneyDetails> accountEntryManagementDetailsList(@Param("row") Integer row, @Param("limit") Integer limit, @Param("shopName") String shopName, @Param("shopPhone") String shopPhone,
+                                                             @Param("userPhone") String userPhone, @Param("couponName") String couponName,
+                                                             @Param("orderNumber") String orderNumber, @Param("startTime") String startTime, @Param("endTime") String endTime);
+
+    int accountEntryManagementDetailsCount(@Param("shopName") String shopName, @Param("shopPhone") String shopPhone,
+                                           @Param("userPhone") String userPhone, @Param("couponName") String couponName,
+                                           @Param("orderNumber") String orderNumber, @Param("startTime") String startTime, @Param("endTime") String endTime);
+
+    List<UserMoneyDetails> excelAccountEntry(@Param("query") AccountEntry query);
 }
 }

+ 56 - 0
src/main/java/com/sqx/modules/app/entity/UserMoneyDetails.java

@@ -78,5 +78,61 @@ public class UserMoneyDetails implements Serializable {
     @TableField(exist = false)
     @TableField(exist = false)
     private String userName;
     private String userName;
 
 
+    /**
+     * 店铺名称
+     */
+    @TableField(exist = false)
+    private String shopName;
+
+    /**
+     * 店铺手机号
+     */
+    @TableField(exist = false)
+    private String shopPhone;
+
+    /**
+     * 下单手机号
+     */
+    @TableField(exist = false)
+    private String userPhone;
+
+    /**
+     * 优惠活动名称
+     */
+    @TableField(exist = false)
+    private String couponName;
+
+    /**
+     * 活动优惠金额
+     */
+    @TableField(exist = false)
+    private BigDecimal activityDiscountAmount;
 
 
+
+    /**
+     * 优惠券优惠金额
+     */
+    @TableField(exist = false)
+    private BigDecimal couponMoney;
+
+    /**
+     * 跑腿费
+     */
+    @TableField(exist = false)
+    private BigDecimal errandMoney;
+
+    /**
+     * 订单号
+     */
+    @TableField(exist = false)
+    private BigDecimal orderNumber;
+
+    /**
+     * 订单id
+     */
+    /**
+     * 订单号
+     */
+    @TableField(exist = false)
+    private BigDecimal orderId;
 }
 }

+ 33 - 0
src/main/java/com/sqx/modules/app/service/UserMoneyDetailsService.java

@@ -4,7 +4,10 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.sqx.common.utils.PageUtils;
 import com.sqx.common.utils.PageUtils;
 import com.sqx.common.utils.Result;
 import com.sqx.common.utils.Result;
 import com.sqx.modules.app.entity.UserMoneyDetails;
 import com.sqx.modules.app.entity.UserMoneyDetails;
+import com.sqx.modules.exportExecl.dto.AccountEntry;
+import com.sqx.modules.pay.controller.query.CashOutQueryDTO;
 import com.sqx.modules.pay.controller.query.WalletDetailQuery;
 import com.sqx.modules.pay.controller.query.WalletDetailQuery;
+import com.sqx.modules.utils.excel.ExcelData;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 
 
@@ -29,4 +32,34 @@ public interface UserMoneyDetailsService extends IService<UserMoneyDetails> {
      * @return
      * @return
      */
      */
     BigDecimal walletDetailStatistics(WalletDetailQuery query);
     BigDecimal walletDetailStatistics(WalletDetailQuery query);
+
+    /**
+     * 钱包明细导出
+     * @param query
+     * @return
+     */
+    ExcelData excelWalletDetails(WalletDetailQuery query);
+
+    /**
+     * 入账管理
+     * @param page
+     * @param limit
+     * @param shopName
+     * @param shopPhone
+     * @param userPhone
+     * @param couponName
+     * @param orderNumber
+     * @param startTime
+     * @param endTime
+     * @return
+     */
+    PageUtils accountEntryManagementDetails(Integer page, Integer limit, String shopName, String shopPhone, String userPhone, String couponName, String orderNumber, String startTime, String endTime);
+
+    /**
+     * 入账管理导出
+     * @param query
+     * @return
+     */
+    ExcelData excelAccountEntry(AccountEntry query);
+
 }
 }

+ 122 - 6
src/main/java/com/sqx/modules/app/service/impl/UserMoneyDetailsServiceImpl.java

@@ -9,24 +9,34 @@ import com.sqx.common.utils.Result;
 import com.sqx.modules.app.dao.UserMoneyDetailsDao;
 import com.sqx.modules.app.dao.UserMoneyDetailsDao;
 import com.sqx.modules.app.entity.UserMoneyDetails;
 import com.sqx.modules.app.entity.UserMoneyDetails;
 import com.sqx.modules.app.service.UserMoneyDetailsService;
 import com.sqx.modules.app.service.UserMoneyDetailsService;
+import com.sqx.modules.exportExecl.dto.AccountEntry;
+import com.sqx.modules.pay.controller.query.CashOutQueryDTO;
 import com.sqx.modules.pay.controller.query.WalletDetailQuery;
 import com.sqx.modules.pay.controller.query.WalletDetailQuery;
+import com.sqx.modules.pay.vo.CashOutVO;
 import com.sqx.modules.pay.vo.WalletDetailVO;
 import com.sqx.modules.pay.vo.WalletDetailVO;
+import org.checkerframework.checker.units.qual.A;
+import org.springframework.beans.factory.annotation.Autowired;
+import com.sqx.modules.utils.excel.ExcelData;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
 
 
 @Service
 @Service
 public class UserMoneyDetailsServiceImpl extends ServiceImpl<UserMoneyDetailsDao, UserMoneyDetails> implements UserMoneyDetailsService {
 public class UserMoneyDetailsServiceImpl extends ServiceImpl<UserMoneyDetailsDao, UserMoneyDetails> implements UserMoneyDetailsService {
 
 
     @Override
     @Override
-    public Result queryUserMoneyDetails(Integer page, Integer limit, Long userId,Integer classify,Integer type) {
+    public Result queryUserMoneyDetails(Integer page, Integer limit, Long userId, Integer classify, Integer type) {
         IPage<UserMoneyDetails> page1 = new Page(page, limit);
         IPage<UserMoneyDetails> page1 = new Page(page, limit);
         QueryWrapper<UserMoneyDetails> queryWrapper = new QueryWrapper();
         QueryWrapper<UserMoneyDetails> queryWrapper = new QueryWrapper();
         queryWrapper.eq("user_id", userId);
         queryWrapper.eq("user_id", userId);
-        if(classify!=null){
+        if (classify != null) {
             queryWrapper.eq("classify", classify);
             queryWrapper.eq("classify", classify);
         }
         }
-        if(type!=null){
+        if (type != null) {
             queryWrapper.eq("type", type);
             queryWrapper.eq("type", type);
         }
         }
         queryWrapper.eq("state", 2);
         queryWrapper.eq("state", 2);
@@ -36,7 +46,7 @@ public class UserMoneyDetailsServiceImpl extends ServiceImpl<UserMoneyDetailsDao
 
 
     @Override
     @Override
     public Double monthIncome(String date, Long userId) {
     public Double monthIncome(String date, Long userId) {
-        return baseMapper.monthIncome(date,userId);
+        return baseMapper.monthIncome(date, userId);
     }
     }
 
 
     @Override
     @Override
@@ -44,10 +54,10 @@ public class UserMoneyDetailsServiceImpl extends ServiceImpl<UserMoneyDetailsDao
         IPage<UserMoneyDetails> page1 = new Page(page, limit);
         IPage<UserMoneyDetails> page1 = new Page(page, limit);
         QueryWrapper<UserMoneyDetails> queryWrapper = new QueryWrapper();
         QueryWrapper<UserMoneyDetails> queryWrapper = new QueryWrapper();
         queryWrapper.eq("shop_id", shopId);
         queryWrapper.eq("shop_id", shopId);
-        if(classify!=null){
+        if (classify != null) {
             queryWrapper.eq("classify", classify);
             queryWrapper.eq("classify", classify);
         }
         }
-        if(type!=null){
+        if (type != null) {
             queryWrapper.eq("type", type);
             queryWrapper.eq("type", type);
         }
         }
         queryWrapper.eq("state", 2);
         queryWrapper.eq("state", 2);
@@ -77,4 +87,110 @@ public class UserMoneyDetailsServiceImpl extends ServiceImpl<UserMoneyDetailsDao
         BigDecimal result = baseMapper.walletDetailStatistics(query);
         BigDecimal result = baseMapper.walletDetailStatistics(query);
         return result;
         return result;
     }
     }
+
+    @Override
+    public ExcelData excelWalletDetails(WalletDetailQuery query) {
+        List<WalletDetailVO> walletDetailVOS = baseMapper.excelWalletDetails(query);
+        ExcelData data = new ExcelData();
+        data.setName("保证金记录");
+        data.setTitles(WalletDetailExportTitle());
+        List<List<Object>> rows = new ArrayList<>();
+        for (WalletDetailVO walletDetailVO:walletDetailVOS ){
+            List<Object> row = new ArrayList<>();
+            row.add(walletDetailVO.getId());
+            row.add(walletDetailVO.getShopName());
+            row.add(walletDetailVO.getContent());
+            if ("1".equals(walletDetailVO.getType())){
+                row.add("充值");
+            }else if("2".equals(walletDetailVO.getType())){
+                row.add("提现");
+            }else{
+                row.add("");
+            }
+            row.add(walletDetailVO.getCreateTime());
+            row.add(walletDetailVO.getMoney());
+            rows.add(row);
+        }
+        data.setRows(rows);
+        return data;
+    }
+
+    private List<String> WalletDetailExportTitle() {
+        return Arrays.asList(
+                "编号",
+                "店铺名称",
+                "保证金金额",
+                "类别",
+                "提现时间",
+                "金额");
+    }
+
+
+    @Override
+    public PageUtils accountEntryManagementDetails(Integer page, Integer limit, String shopName, String shopPhone, String userPhone, String couponName, String orderNumber, String startTime, String endTime) {
+        IPage<UserMoneyDetails> iPage = new Page<>();
+        Integer row=(page-1)*limit;
+        List<UserMoneyDetails> userMoneyDetailsList = baseMapper.accountEntryManagementDetailsList(row,limit, shopName, shopPhone, userPhone, couponName, orderNumber, startTime, endTime);
+        int total = baseMapper.accountEntryManagementDetailsCount(shopName, shopPhone, userPhone, couponName, orderNumber, startTime, endTime);
+
+//        当前页数
+        iPage.setCurrent(page);
+//        每页显示数
+        iPage.setSize(limit);
+//        数据
+        iPage.setRecords(userMoneyDetailsList);
+//        总页数
+
+        iPage.setPages((int)Math.ceil((double)total/limit));
+//        总数
+        iPage.setTotal(total);
+        PageUtils pageUtils = new PageUtils(iPage);
+        List<?> list = pageUtils.getList();
+        System.out.println("list = " + list);
+        return pageUtils;
+    }
+
+    /**
+     * @param query
+     * @return
+     */
+    @Override
+    public ExcelData excelAccountEntry(AccountEntry query) {
+        List<UserMoneyDetails> userMoneyDetailsList = baseMapper.excelAccountEntry(query);
+        ExcelData data = new ExcelData();
+        data.setName("入账管理");
+        List<String> titleList=Arrays.asList(
+                "编号",
+                "店铺名称",
+                "店铺手机号",
+                "下单用户",
+                "用户手机号",
+                "标题",
+                "优惠活动标题",
+                "优惠活动金额",
+                "跑腿费",
+                "订单号",
+                "金额",
+                "创建时间");
+        data.setTitles(titleList);
+        List<List<Object>> rows = new ArrayList<>();
+        for (UserMoneyDetails userMoneyDetails:userMoneyDetailsList ){
+            List<Object> row = new ArrayList<>();
+            row.add(userMoneyDetails.getId());
+            row.add(userMoneyDetails.getShopName());
+            row.add(userMoneyDetails.getShopPhone());
+            row.add(userMoneyDetails.getUserName());
+            row.add(userMoneyDetails.getUserPhone());
+            row.add(userMoneyDetails.getTitle());
+            row.add(userMoneyDetails.getCouponName());
+            row.add(userMoneyDetails.getCouponMoney());
+            row.add(userMoneyDetails.getErrandMoney());
+            row.add(userMoneyDetails.getOrderNumber()+"");
+            row.add(userMoneyDetails.getMoney());
+            row.add(userMoneyDetails.getCreateTime());
+            rows.add(row);
+        }
+        data.setRows(rows);
+        return data;
+    }
 }
 }

+ 11 - 8
src/main/java/com/sqx/modules/datacentre/controller/DataCentreController.java

@@ -7,6 +7,8 @@ import com.sqx.modules.app.service.UserMoneyService;
 import com.sqx.modules.coupon.entity.TbCouponUser;
 import com.sqx.modules.coupon.entity.TbCouponUser;
 import com.sqx.modules.coupon.service.TbCouponService;
 import com.sqx.modules.coupon.service.TbCouponService;
 import com.sqx.modules.coupon.service.TbCouponUserService;
 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.datacentre.service.DataCentreService;
 import com.sqx.modules.errand.service.ErrandComplaintService;
 import com.sqx.modules.errand.service.ErrandComplaintService;
 import com.sqx.modules.integral.dao.UserIntegralDetailsDao;
 import com.sqx.modules.integral.dao.UserIntegralDetailsDao;
@@ -17,6 +19,7 @@ import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
+import javax.validation.Valid;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 
 
 @RestController
 @RestController
@@ -47,14 +50,14 @@ public class DataCentreController {
 
 
     @ApiOperation("任务分析")
     @ApiOperation("任务分析")
     @GetMapping(value = "selectOrderData")
     @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("任务详情分析")
     @ApiOperation("任务详情分析")
     @GetMapping(value = "/selectOrderAnalyze")
     @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("条件筛选所有用户")
     @ApiOperation("条件筛选所有用户")
@@ -172,16 +175,16 @@ public class DataCentreController {
 
 
     @ApiOperation("门店统计")
     @ApiOperation("门店统计")
     @GetMapping(value = "selectShopCenter")
     @GetMapping(value = "selectShopCenter")
-    public Result selectShopCenter(String date, String dateType, Integer page, Integer limit) {
+    public Result selectShopCenter(@Valid ShopCenterQuery query) {
 
 
-        return dataCentreService.selectShopCenter(date, dateType, page, limit);
+        return dataCentreService.selectShopCenter(query);
     }
     }
 
 
     @ApiOperation("用户统计")
     @ApiOperation("用户统计")
     @GetMapping(value = "selectUserCenter")
     @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")
     @GetMapping(value = "selectUserFeedback")

+ 13 - 9
src/main/java/com/sqx/modules/datacentre/dao/DataCentreDao.java

@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.sqx.modules.app.entity.UserEntity;
 import com.sqx.modules.app.entity.UserEntity;
 import com.sqx.modules.app.entity.UserMoneyDetails;
 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.Feedback;
 import com.sqx.modules.errand.entity.TbIndent;
 import com.sqx.modules.errand.entity.TbIndent;
 import com.sqx.modules.order.entity.TbOrder;
 import com.sqx.modules.order.entity.TbOrder;
@@ -13,6 +15,7 @@ import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
+import java.util.List;
 
 
 @Mapper
 @Mapper
 public interface DataCentreDao {
 public interface DataCentreDao {
@@ -33,7 +36,7 @@ public interface DataCentreDao {
 
 
     int findIndentCount(String format);
     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);
     int sumOrderMonth(Long userId, String date);
 
 
@@ -49,13 +52,13 @@ public interface DataCentreDao {
 
 
     IPage<TbIndent> rankingList(Page<TbIndent> pages, String address, String date, String dateType);
     IPage<TbIndent> rankingList(Page<TbIndent> pages, String address, String date, String dateType);
 
 
-    int selectNewShopCount(String date, String dateType);
+    int selectNewShopCount(@Param("query")ShopCenterQuery query);
 
 
-    IPage<TbOrder> selectRankingList(Page<TbOrder> pages, String date, String dateType);
+    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);
     IPage<Feedback> selectUserFeedback(Page<Feedback> pages, String userEmail);
 
 
@@ -87,12 +90,13 @@ public interface DataCentreDao {
 
 
     BigDecimal sumCashMoney(Long userId, String date);
     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);
 }
 }

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

@@ -0,0 +1,25 @@
+package com.sqx.modules.datacentre.query;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import com.sqx.common.query.PageQuery;
+
+@Data
+public class DataCenterQuery extends PageQuery {
+
+    @ApiModelProperty(value = "起始时间")
+    private String startTime;
+
+    @ApiModelProperty(value = "结束时间")
+    private String endTime;
+
+    @ApiModelProperty(value = "日期")
+    private String date;
+
+    @ApiModelProperty(value = "类型")
+    private String dateType;
+
+    @ApiModelProperty(value = "商铺id")
+    private Long shopId;
+}
+

+ 43 - 0
src/main/java/com/sqx/modules/datacentre/query/ShopCenterQuery.java

@@ -0,0 +1,43 @@
+package com.sqx.modules.datacentre.query;
+
+import com.sqx.common.query.PageQuery;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.util.StringUtils;
+
+import javax.validation.constraints.Pattern;
+
+@Data
+public class ShopCenterQuery extends DataCenterQuery {
+
+    @ApiModelProperty(value = "商铺主营类型id")
+    @Pattern(regexp = "^[0-9]*$", message = "商铺类型只能为数字")
+    private String shopType;
+
+    @ApiModelProperty(value = "商铺主营类型名称")
+    private String shopTypeName;
+
+    @ApiModelProperty(value = "登录人id")
+    private String userId;
+
+    public String toStrMessage() {
+        StringBuilder stringBuilder=new StringBuilder();
+        stringBuilder
+                .append(StringUtils.hasText(getStartTime())?"开始时间:"+getStartTime()+";":"")
+                .append(StringUtils.hasText(getEndTime())?"结束时间:"+getEndTime()+";":"")
+                .append(StringUtils.hasText(shopType)?"商铺类型编号:"+shopType+";":"")
+                .append(StringUtils.hasText(getDate())?"日期:"+getDate()+";":"")
+                .append(StringUtils.hasText(getDateType())?"查询类型:"+getDateType()+";":"");
+        return stringBuilder.toString();
+    }
+
+    public String toStrCode() {
+        return
+                ","+(getStartTime()==null?"":getStartTime())
+                +","+(getEndTime()==null?"":getEndTime())
+                +","+(shopType==null?"":shopType)
+                +","+(getDate()==null?"":getDate())
+                +","+(getDateType()==null?"":getDateType())
+                +",";
+    }
+}

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

@@ -1,18 +1,22 @@
 package com.sqx.modules.datacentre.service;
 package com.sqx.modules.datacentre.service;
 
 
 import com.sqx.common.utils.Result;
 import com.sqx.common.utils.Result;
+import com.sqx.modules.datacentre.query.DataCenterQuery;
+import com.sqx.modules.datacentre.query.ShopCenterQuery;
+import com.sqx.modules.pay.controller.query.CashOutQueryDTO;
+import com.sqx.modules.utils.excel.ExcelData;
 
 
 public interface DataCentreService {
 public interface DataCentreService {
 
 
     Result dataCentre();
     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 selectAllUser(Integer page, Integer limit, String userName, String phone);
 
 
     Result selectUserById(Long userId);
     Result selectUserById(Long userId);
 
 
-    Result selectOrderData(String date, String dateType);
+    Result selectOrderData(DataCenterQuery query);
 
 
     Result selectTopUpStatistics(String date, String dateType);
     Result selectTopUpStatistics(String date, String dateType);
 
 
@@ -24,9 +28,11 @@ public interface DataCentreService {
 
 
     Result rankingList(Integer page, Integer limit, String address, String date, String dateType);
     Result rankingList(Integer page, Integer limit, String address, String date, String dateType);
 
 
-    Result selectShopCenter(String date, String dateType, Integer page, Integer limit);
+    Result selectShopCenter(ShopCenterQuery query);
 
 
-    Result selectUserCenter(String date, String dateType);
+    ExcelData excelShopCenter(ShopCenterQuery queryDTO);
+
+    Result selectUserCenter(DataCenterQuery query);
 
 
     Result selectUserFeedback(String userEmail, Integer page, Integer limit);
     Result selectUserFeedback(String userEmail, Integer page, Integer limit);
 
 

+ 55 - 24
src/main/java/com/sqx/modules/datacentre/service/impl/DataCentreServiceImpl.java

@@ -16,16 +16,21 @@ import com.sqx.modules.common.service.CommonInfoService;
 import com.sqx.modules.coupon.dao.TbCouponUserDao;
 import com.sqx.modules.coupon.dao.TbCouponUserDao;
 import com.sqx.modules.coupon.entity.TbCouponUser;
 import com.sqx.modules.coupon.entity.TbCouponUser;
 import com.sqx.modules.datacentre.dao.DataCentreDao;
 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.datacentre.service.DataCentreService;
 import com.sqx.modules.errand.entity.Feedback;
 import com.sqx.modules.errand.entity.Feedback;
 import com.sqx.modules.errand.entity.TbIndent;
 import com.sqx.modules.errand.entity.TbIndent;
 import com.sqx.modules.order.dao.AppOrderDao;
 import com.sqx.modules.order.dao.AppOrderDao;
 import com.sqx.modules.order.entity.TbOrder;
 import com.sqx.modules.order.entity.TbOrder;
 import com.sqx.modules.pay.controller.app.AliPayController;
 import com.sqx.modules.pay.controller.app.AliPayController;
+import com.sqx.modules.pay.controller.query.WalletDetailQuery;
 import com.sqx.modules.pay.dao.PayDetailsDao;
 import com.sqx.modules.pay.dao.PayDetailsDao;
 import com.sqx.modules.pay.entity.CashOut;
 import com.sqx.modules.pay.entity.CashOut;
 import com.sqx.modules.pay.entity.PayDetails;
 import com.sqx.modules.pay.entity.PayDetails;
 import com.sqx.modules.pay.service.WxErrRiderService;
 import com.sqx.modules.pay.service.WxErrRiderService;
+import com.sqx.modules.pay.vo.WalletDetailVO;
+import com.sqx.modules.utils.excel.ExcelData;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -34,9 +39,7 @@ import org.springframework.transaction.annotation.Transactional;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
 import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.HashMap;
+import java.util.*;
 
 
 @Service
 @Service
 @Slf4j
 @Slf4j
@@ -95,9 +98,9 @@ public class DataCentreServiceImpl implements DataCentreService {
     }
     }
 
 
     @Override
     @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);
         return Result.success().put("data", pageUtils);
     }
     }
 
 
@@ -132,22 +135,22 @@ public class DataCentreServiceImpl implements DataCentreService {
     }
     }
 
 
     @Override
     @Override
-    public Result selectOrderData(String date, String dateType) {
+    public Result selectOrderData(DataCenterQuery query) {
         HashMap hashMap = new HashMap();
         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("sumMoney", sumMoney);
         hashMap.put("countOrder", countOrder);
         hashMap.put("countOrder", countOrder);
         hashMap.put("takeCount", takeCount);
         hashMap.put("takeCount", takeCount);
@@ -231,15 +234,15 @@ public class DataCentreServiceImpl implements DataCentreService {
     }
     }
 
 
     @Override
     @Override
-    public Result selectShopCenter(String date, String dateType, Integer page, Integer limit) {
+    public Result selectShopCenter(ShopCenterQuery query) {
         HashMap hashMap = new HashMap();
         HashMap hashMap = new HashMap();
         //新增门店数量
         //新增门店数量
-        int newShopCount = dataCentreDao.selectNewShopCount(date, dateType);
+        int newShopCount = dataCentreDao.selectNewShopCount(query);
         //门店收益排行榜
         //门店收益排行榜
-        Page<TbOrder> pages=new Page<>(page,limit);
-        IPage<TbOrder> tbOrderIPage = dataCentreDao.selectRankingList(pages, date, dateType);
-        for(int i = 0;i<limit;i++){
-            Integer a = ((page-1)*limit)+i+1;
+        Page<TbOrder> pages=new Page<>(query.getPage(),query.getLimit());
+        IPage<TbOrder> tbOrderIPage = dataCentreDao.selectRankingList(pages, query);
+        for(int i = 0;i<query.getLimit();i++){
+            Integer a = ((query.getPage()-1)*query.getLimit())+i+1;
             if(tbOrderIPage.getRecords().size()>i){
             if(tbOrderIPage.getRecords().size()>i){
                 tbOrderIPage.getRecords().get(i).setRank(a);
                 tbOrderIPage.getRecords().get(i).setRank(a);
             }
             }
@@ -251,10 +254,38 @@ public class DataCentreServiceImpl implements DataCentreService {
     }
     }
 
 
     @Override
     @Override
-    public Result selectUserCenter(String date, String dateType) {
+    public ExcelData excelShopCenter(ShopCenterQuery query) {
+        List<TbOrder> tbOrderList = dataCentreDao.excelShopCenter(query);
+        ExcelData data = new ExcelData();
+        data.setName("商家收益排行");
+        data.setTitles(WalletDetailExportTitle());
+        List<List<Object>> rows = new ArrayList<>();
+        for (TbOrder tbOrder:tbOrderList ){
+            List<Object> row = new ArrayList<>();
+            row.add(tbOrder.getShopId());
+            row.add(tbOrder.getShopName());
+            row.add(tbOrder.getShopTypeName());
+            row.add(tbOrder.getRank());
+            row.add(tbOrder.getShopMoney());
+            rows.add(row);
+        }
+        data.setRows(rows);
+        return data;
+    }
+
+    private List<String> WalletDetailExportTitle() {
+        return Arrays.asList(
+                "编号",
+                "店铺名称",
+                "商铺类型",
+                "排名",
+                "收益");
+    }
+    @Override
+    public Result selectUserCenter(DataCenterQuery query) {
         HashMap hashMap = new HashMap();
         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("allUserCount", userCount);
         hashMap.put("phoneUserCount", phoneUserCount);
         hashMap.put("phoneUserCount", phoneUserCount);
         return Result.success().put("data", hashMap);
         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.app.service.UserService;
 import com.sqx.modules.common.entity.CommonInfo;
 import com.sqx.modules.common.entity.CommonInfo;
 import com.sqx.modules.common.service.CommonInfoService;
 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.entity.TbIndent;
 import com.sqx.modules.errand.service.TbIndentService;
 import com.sqx.modules.errand.service.TbIndentService;
 import com.sqx.modules.order.entity.TbOrder;
 import com.sqx.modules.order.entity.TbOrder;
@@ -96,16 +97,16 @@ public class TbIndentController {
 
 
     @ApiOperation("任务分析")
     @ApiOperation("任务分析")
     @GetMapping(value = "taskAnalysis")
     @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("订单分析")
     @ApiOperation("订单分析")
     @GetMapping(value = "selectOrderByStatus")
     @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("骑手收入统计 完成订单数统计")
     @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.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.sqx.modules.datacentre.query.DataCenterQuery;
 import com.sqx.modules.errand.entity.ErrandComplaint;
 import com.sqx.modules.errand.entity.ErrandComplaint;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.util.List;
 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);
     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);
     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.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.sqx.modules.app.entity.UserEntity;
 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.dto.WaitForAcceptOrderQueryDTO;
 import com.sqx.modules.errand.entity.ErrandAddress;
 import com.sqx.modules.errand.entity.ErrandAddress;
 import com.sqx.modules.errand.entity.ErrandRedPacket;
 import com.sqx.modules.errand.entity.ErrandRedPacket;
@@ -91,15 +92,15 @@ public interface TbIndentDao extends BaseMapper<TbIndent> {
 
 
     void adminSoldOutIndent(String indentNumber);
     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();
     int findAllCount();
 
 
@@ -117,7 +118,7 @@ public interface TbIndentDao extends BaseMapper<TbIndent> {
 
 
     int findIndentCount(String format);
     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);
     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.PageUtils;
 import com.sqx.common.utils.Result;
 import com.sqx.common.utils.Result;
 import com.sqx.modules.app.entity.UserEntity;
 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.dto.*;
 import com.sqx.modules.errand.entity.ErrandAddress;
 import com.sqx.modules.errand.entity.ErrandAddress;
 import com.sqx.modules.errand.entity.ErrandEvaluate;
 import com.sqx.modules.errand.entity.ErrandEvaluate;
@@ -83,9 +84,9 @@ public interface TbIndentService extends IService<TbIndent> {
 
 
     Result findDataCenter();
     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);
     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.app.service.UserService;
 import com.sqx.modules.common.entity.CommonInfo;
 import com.sqx.modules.common.entity.CommonInfo;
 import com.sqx.modules.common.service.CommonInfoService;
 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.ErrandEvaluateDao;
 import com.sqx.modules.errand.dao.TbIndentDao;
 import com.sqx.modules.errand.dao.TbIndentDao;
 import com.sqx.modules.errand.dto.OrderRiderDeliveryDTO;
 import com.sqx.modules.errand.dto.OrderRiderDeliveryDTO;
@@ -1450,19 +1451,19 @@ public class TbIndentServiceImpl extends ServiceImpl<TbIndentDao, TbIndent> impl
     }
     }
 
 
     @Override
     @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();
         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("billMoney", billMoney);
         hashMap.put("receivingMoney", receivingMoney);
         hashMap.put("receivingMoney", receivingMoney);
         hashMap.put("billCount", billCount);
         hashMap.put("billCount", billCount);
@@ -1472,24 +1473,24 @@ public class TbIndentServiceImpl extends ServiceImpl<TbIndentDao, TbIndent> impl
     }
     }
 
 
     @Override
     @Override
-    public Result selectOrderByStatus(String date, String dateType) {
+    public Result selectOrderByStatus(DataCenterQuery query) {
         HashMap hashMap = new HashMap();
         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("i", i);
         hashMap.put("i1", i1);
         hashMap.put("i1", i1);
         hashMap.put("i2", i2);
         hashMap.put("i2", i2);

+ 262 - 0
src/main/java/com/sqx/modules/exportExecl/controller/ExportExeclController.java

@@ -0,0 +1,262 @@
+package com.sqx.modules.exportExecl.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jcraft.jsch.SftpException;
+import com.sqx.common.utils.PageUtils;
+import com.sqx.common.utils.Result;
+import com.sqx.common.utils.SftpUtil;
+import com.sqx.modules.common.service.CommonInfoService;
+import com.sqx.modules.datacentre.query.ShopCenterQuery;
+import com.sqx.modules.exportExecl.dto.AccountEntry;
+import com.sqx.modules.exportExecl.mapper.ExportJobMapper;
+import com.sqx.modules.exportExecl.model.ExportJob;
+import com.sqx.modules.exportExecl.service.ExportJobService;
+import com.sqx.modules.order.dao.AppOrderDao;
+import com.sqx.modules.pay.controller.query.CashOutQueryDTO;
+import com.sqx.modules.pay.controller.query.WalletDetailQuery;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.poi.util.IOUtils;
+import org.springframework.util.StringUtils;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.BufferedInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URLEncoder;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.Date;
+
+@Slf4j
+@Api(tags={"管理端-导出"})
+@RestController
+@RequestMapping("/admin/export")
+@RequiredArgsConstructor
+public class ExportExeclController {
+
+    private final AppOrderDao appOrderDao;
+
+    private final ExportJobService exportJobService;
+
+    private final CommonInfoService commonInfoService;
+
+    private final SftpUtil sftpUtil;
+
+    @GetMapping("excelOrder")
+    @ApiOperation("导出订单列表")
+    public Result excelOrder(Integer status, String phone, Long shopId, String userName,
+                             String orderNumber, Integer orderType, String shopName, String riderPhone,
+                             String startTime, String endTime, String userId, String payStartTime, String payEndTime) throws Exception{
+        Integer size = appOrderDao.excelAllOrderAdminCount( status, phone, shopId, userName, orderNumber, orderType,
+                shopName, riderPhone,startTime,endTime,payStartTime,payEndTime);
+        //可导出最大数量
+        String count=commonInfoService.findOne(431).getValue();
+        if(size>Integer.parseInt(count)){
+            return Result.error("导出总数不能超过"+Integer.parseInt(count)+",请添加筛选条件");
+        }
+        if(!StringUtils.hasText(userId)){
+            return Result.error("用户id不能为空");
+        }
+        StringBuffer stringBuffer=new StringBuffer();
+        if(status!=null){stringBuffer.append("状态:"+getState(status)+";");}
+        if(phone!=null&&!phone.trim().equals("")){stringBuffer.append("手机号:"+phone+";");}
+//        if(shopId!=null){stringBuffer.append(":"+shopId+";");}
+        if(userName!=null&&!userName.trim().equals("")){stringBuffer.append("昵称:"+userName+";");}
+        if(orderNumber!=null&&!orderNumber.trim().equals("")){stringBuffer.append("订单号:"+orderNumber+";");}
+        if(orderType!=null){stringBuffer.append("订单类型:"+(orderType==1?"到店取餐":(orderType==2?"骑手配送":"商家配送"))+";");}
+        if(shopName!=null&&!shopName.trim().equals("")){stringBuffer.append("商铺名称:"+shopName+";");}
+        if(riderPhone!=null&&!riderPhone.trim().equals("")){stringBuffer.append("骑手手机号:"+riderPhone+";");}
+        if(startTime!=null&&!startTime.trim().equals("")){stringBuffer.append("开始时间:"+startTime+";");}
+        if(endTime!=null&&!endTime.trim().equals("")){stringBuffer.append("结束时间:"+endTime+";");}
+        if(payStartTime!=null&&!payStartTime.trim().equals("")){stringBuffer.append("支付开始时间:"+payStartTime+";");}
+        if(payEndTime!=null&&!payEndTime.trim().equals("")){stringBuffer.append("支付结束时间:"+payEndTime+";");}
+
+        ExportJob exportJob =new ExportJob();
+        exportJob.setFlag(0);
+        exportJob.setFileType("order");
+        exportJob.setConditionDetail(stringBuffer.toString());
+        exportJob.setConditions(","+(status==null?"":status)+","+phone+","+(shopId==null?"":shopId)+","+userName+","+orderNumber+","
+                +(orderType==null?"":orderType)+","+shopName+","
+                +riderPhone+","+startTime+","+endTime+","+payStartTime+","+payEndTime);
+        LocalDateTime localDateTime = LocalDateTime.now();
+        String time=localDateTime.format(DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS"));
+        exportJob.setFileName((int) (Math.random() * 100) +time+"订单列表.xlsx");
+        exportJob.setUserId(userId);
+        exportJob.setCreateTime(new Date());
+        exportJob.setUpdateTime(new Date());
+        boolean a=exportJobService.save(exportJob);
+        if (a){
+            return Result.success("新增导出计划成功");
+        }else{
+            return Result.error("新增导出计划失败");
+        }
+    }
+    @GetMapping("excelRecharge")
+    @ApiOperation("导出充值记录")
+    public Result excelRecharge(String rechargeOrder, String acount,String userId) throws Exception{
+        if(!StringUtils.hasText(userId)){
+            return Result.error("用户id不能为空");
+        }
+        StringBuilder stringBuffer=new StringBuilder();
+        if(rechargeOrder!=null&&rechargeOrder!=""){stringBuffer.append("充值订单号:"+rechargeOrder+";");}
+        if(acount!=null&&acount!=""){stringBuffer.append("被充值账号:"+acount+";");}
+
+        ExportJob exportJob =this.buildExportJob("充值记录.xlsx","recharge", userId,stringBuffer.toString(),","+rechargeOrder+","+acount);
+        boolean a=exportJobService.save(exportJob);
+        if (a){
+            return Result.success("新增导出计划成功");
+        }else{
+            return Result.error("新增导出计划失败");
+        }
+    }
+
+    @GetMapping("excelPayouts")
+    @ApiOperation("提现管理导出")
+    public Result excelPayouts(CashOutQueryDTO queryDTO) throws Exception{
+        if(queryDTO.getUserId()==null){
+            return Result.error("用户id不能为空");
+        }
+        ExportJob exportJob =this.buildExportJob("提现管理.xlsx","payouts", String.valueOf(queryDTO.getUserId()),queryDTO.toStrMessage(),queryDTO.toStrCode());
+        boolean a=exportJobService.save(exportJob);
+        if (a){
+            return Result.success("新增提现管理导出计划成功");
+        }else{
+            return Result.error("新增提现管理导出计划失败");
+        }
+    }
+
+    @GetMapping("excelDeposit")
+    @ApiOperation("导出保证金记录")
+    public Result excelDeposit(WalletDetailQuery queryDTO) throws Exception{
+        if(!StringUtils.hasText(queryDTO.getUserId())){
+            return Result.error("用户id不能为空");
+        }
+        ExportJob exportJob =this.buildExportJob("保证金记录.xlsx","deposit",queryDTO.getUserId(),queryDTO.toStrMessage(),queryDTO.toStrCode());
+        boolean a=exportJobService.save(exportJob);
+        if (a){
+            return Result.success("新增保证金记录导出计划成功");
+        }else{
+            return Result.error("新增保证金记录导出计划失败");
+        }
+    }
+    //    任意文件读取/下载
+    @ApiOperation(value = "查询下载列表")
+    @GetMapping("listByUser")
+    public Result List(String userId,String state,String startTime,String endTime,Integer curretPage,Integer pageSize) throws IOException {
+
+        QueryWrapper queryWrapper=new QueryWrapper<ExportJob>();
+
+        queryWrapper.eq("user_id",userId);
+        if(StringUtils.hasText(state)){
+            queryWrapper.eq("flag",state);
+        }
+        if(StringUtils.hasText(startTime)){
+            queryWrapper.ge("create_time",startTime);
+        }
+        if(StringUtils.hasText(endTime)){
+            queryWrapper.le("create_time",endTime);
+        }
+        queryWrapper.orderByDesc("create_time");
+        IPage<ExportJob> iPage=exportJobService.page(new Page<>(curretPage,pageSize),queryWrapper);
+        PageUtils pageUtils = new PageUtils(iPage);
+        return Result.success().put("data", pageUtils);
+    }
+
+    //    任意文件读取/下载
+    @ApiOperation(value = "文件下载")
+    @GetMapping("readBuffer")
+    public void readbuffer(String filename,HttpServletResponse response) throws IOException {
+        if(filename.contains("..") || filename.contains("/")){
+            throw new IOException("文件名异常");
+        }
+        String value=commonInfoService.findOne(430).getValue()==null?"":commonInfoService.findOne(430).getValue();
+        sftpUtil.login();
+        try {
+            response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
+            // 下载文件的默认名称
+            response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(filename, "utf-8"));
+            sftpUtil.downloadStream(value,filename,response.getOutputStream());
+            log.info("文件下载成功");
+        }catch (IOException | SftpException e){
+            log.error(e.getMessage());
+            log.error("文件下载失败");
+        }finally {
+            if (sftpUtil.isConnected()){
+                sftpUtil.logout();
+            }
+        }
+    }
+
+    // '订单状态 0待结算 1待支付 2直接购买(未支付) 7商家待接单 8商家拒绝接单 6制作中  3待取餐/派送中 4已完成 5已取消 ',
+    private String getState(Integer state){
+        switch (state){
+            case 1: return "待支付";
+            case 2: return "未支付";
+            case 3: return "待取餐";
+            case 4: return "已完成";
+            case 5: return "已取消";
+            case 6: return "制作中";
+            case 7: return "商家待接单";
+            case 8: return "商家拒绝接单";
+            case 0: return "待结算";
+            default: return state+"";
+        }
+    }
+
+    //构建导出对象
+    private ExportJob buildExportJob(String fileName,String fileType,String userId,String condDetail,String condCode){
+        ExportJob exportJob=new ExportJob();
+        //设置为待导出
+        exportJob.setFlag(0);
+        exportJob.setFileType(fileType);
+        exportJob.setConditionDetail(condDetail);
+        exportJob.setConditions(condCode);
+        LocalDateTime localDateTime = LocalDateTime.now();
+        String time=localDateTime.format(DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS"));
+        exportJob.setFileName(time+fileName);
+        exportJob.setCreateTime(new Date());
+        exportJob.setUpdateTime(new Date());
+        exportJob.setUserId(userId);
+        return exportJob;
+    }
+
+    @GetMapping("excelShopCenter")
+    @ApiOperation("导出商户收益统计")
+    public Result excelShopCenter(ShopCenterQuery queryDTO) throws Exception{
+        if(!StringUtils.hasText(queryDTO.getUserId())){
+            return Result.error("用户id不能为空");
+        }
+        ExportJob exportJob =this.buildExportJob("商铺收益排行.xlsx","shopCenter",queryDTO.getUserId(),queryDTO.toStrMessage(),queryDTO.toStrCode());
+        boolean a=exportJobService.save(exportJob);
+        if (a){
+            return Result.success("新增商铺收益排行导出计划成功");
+        }else{
+            return Result.error("新增商铺收益排行导出计划失败");
+        }
+    }
+
+    @GetMapping("excelAccountEntry")
+    @ApiOperation("导出入账管理")
+    public Result excelAccountEntry(AccountEntry queryDTO) throws Exception{
+        if(!StringUtils.hasText(queryDTO.getUserId())){
+            return Result.error("用户id不能为空");
+        }
+        ExportJob exportJob =this.buildExportJob("入账管理.xlsx","accountEntry",queryDTO.getUserId(),queryDTO.toStrMessage(),queryDTO.toStrCode());
+        boolean a=exportJobService.save(exportJob);
+        if (a){
+            return Result.success("新增入账管理导出计划成功");
+        }else{
+            return Result.error("新增入账管理导出计划失败");
+        }
+    }
+}

+ 39 - 0
src/main/java/com/sqx/modules/exportExecl/dto/AccountEntry.java

@@ -0,0 +1,39 @@
+package com.sqx.modules.exportExecl.dto;
+
+import lombok.Data;
+import org.springframework.util.StringUtils;
+
+@Data
+public class AccountEntry {
+
+    private String shopName;
+    private String shopPhone;
+    private String userPhone;
+    private String couponName;
+    private String orderNumber;
+    private String startTime;
+    private String endTime;
+    private String userId;
+
+    public String toStrMessage() {
+        return (StringUtils.hasText(shopName) ? "商铺名称:" + shopName + ";" : "") +
+                (StringUtils.hasText(shopPhone) ? "商铺手机号:" + shopPhone + ";" : "") +
+                (StringUtils.hasText(userPhone) ? "用户手机号:" + userPhone + ";" : "") +
+                (StringUtils.hasText(couponName) ? "优惠活动:" + couponName + ";" : "") +
+                (StringUtils.hasText(orderNumber) ? "订单号:" + orderNumber + ";" : "") +
+                (StringUtils.hasText(startTime) ? "开始时间:" + startTime + ";" : "") +
+                (StringUtils.hasText(endTime) ? "结束时间:" + endTime + ";" : "");
+    }
+
+    public String toStrCode() {
+        return
+                ","+(shopName==null?"":shopName)
+                +","+(shopPhone==null?"":shopPhone)
+                +","+(userPhone==null?"":userPhone)
+                +","+(couponName==null?"":couponName)
+                +","+(orderNumber==null?"":orderNumber)
+                +","+(startTime==null?"":startTime)
+                +","+(endTime==null?"":endTime)
+                +",";
+    }
+}

+ 18 - 0
src/main/java/com/sqx/modules/exportExecl/mapper/ExportJobMapper.java

@@ -0,0 +1,18 @@
+package com.sqx.modules.exportExecl.mapper;
+
+import com.sqx.modules.exportExecl.model.ExportJob;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author wan
+ * @since 2024-09-25
+ */
+@Mapper
+public interface ExportJobMapper extends BaseMapper<ExportJob> {
+
+}

+ 66 - 0
src/main/java/com/sqx/modules/exportExecl/model/ExportJob.java

@@ -0,0 +1,66 @@
+package com.sqx.modules.exportExecl.model;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+
+import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author wan
+ * @since 2024-09-25
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="ExportJob对象", description="")
+public class ExportJob implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "export_id", type = IdType.AUTO)
+    private Integer exportId;
+
+    @ApiModelProperty(value = "文件名称")
+    private String fileName;
+
+    @ApiModelProperty(value = "文件类型")
+    private String fileType;
+
+    @ApiModelProperty(value = "用户id")
+    private String userId;
+
+    @ApiModelProperty(value = "创建时间")
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
+    private Date createTime;
+
+    @ApiModelProperty(value = "更新时间")
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
+    private Date updateTime;
+
+    @ApiModelProperty(value = "导出条件描述")
+    private String conditionDetail;
+
+    @ApiModelProperty(value = "导出条件")
+    private String conditions;
+
+    @ApiModelProperty(value = "文件大小")
+    private String fileSize;
+
+    @ApiModelProperty(value = "状态 0待导出 1导出已完成 2导出失败 -1 导出中")
+    private Integer flag;
+
+
+}

+ 118 - 0
src/main/java/com/sqx/modules/exportExecl/model/ExportOrderVo.java

@@ -0,0 +1,118 @@
+package com.sqx.modules.exportExecl.model;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import lombok.Data;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author wan
+ * @since 2024-07-22
+ */
+@Data
+public class ExportOrderVo {
+
+
+    @ColumnWidth(0)
+    @ExcelProperty(value = "编号" , index = 0)
+    private String orderId;
+    @ColumnWidth(1)
+    @ExcelProperty(value = "下单用户" , index = 0)
+    private String userName;
+
+    @ColumnWidth(2)
+    @ExcelProperty(value = "用户头像" , index = 0)
+    private String avatar;
+
+    @ColumnWidth(3)
+    @ExcelProperty(value = "手机号" , index = 0)
+    private String phone;
+
+    @ColumnWidth(4)
+    @ExcelProperty(value = "商铺信息" , index = 0)
+    private String shopDetail;
+
+    @ColumnWidth(5)
+    @ExcelProperty(value = "订单类型" , index = 0)
+    private String orderType;
+
+    @ColumnWidth(6)
+    @ExcelProperty(value = "配送信息" , index = 0)
+    private String identail;
+
+    @ColumnWidth(7)
+    @ExcelProperty(value = "骑手昵称" , index = 0)
+    private String riderNickName;
+
+    @ColumnWidth(8)
+    @ExcelProperty(value = "骑手电话" , index = 0)
+    private String riderPhone;
+
+    @ColumnWidth(9)
+    @ExcelProperty(value = "订单号" , index = 0)
+    private String orderNumber;
+
+    @ColumnWidth(10)
+    @ExcelProperty(value = "内容" , index = 0)
+    private String goodsDetail;
+
+    @ColumnWidth(11)
+    @ExcelProperty(value = "商品总价(元)" , index = 0)
+    private String sumPrice;
+
+    @ColumnWidth(12)
+    @ExcelProperty(value = "优惠金额(元)" , index = 0)
+    private String couponMoney;
+
+    @ColumnWidth(13)
+    @ExcelProperty(value = "参与活动名称" , index = 0)
+    private String activityTitle;
+
+    @ColumnWidth(14)
+    @ExcelProperty(value = "活动优惠金额(元)" , index = 0)
+    private String activityDiscountAmount;
+
+    @ColumnWidth(15)
+    @ExcelProperty(value = "打包费(元/个 具体按照数量计算)" , index = 0)
+    private String packMoney;
+
+    @ColumnWidth(16)
+    @ExcelProperty(value = "跑腿费(元)" , index = 0)
+    private String errandMoney;
+
+    @ColumnWidth(17)
+    @ExcelProperty(value = "支付金额(元)" , index = 0)
+    private String payMoney;
+
+    @ColumnWidth(18)
+    @ExcelProperty(value = "跑腿费说明" , index = 0)
+    private String errandMoneyIsShop;
+
+    @ColumnWidth(19)
+    @ExcelProperty(value = "订单备注" , index = 0)
+    private String remark;
+
+    @ColumnWidth(20)
+    @ExcelProperty(value = "支付时间" , index = 0)
+    private String payTime;
+
+    @ColumnWidth(21)
+    @ExcelProperty(value = "支付方式" , index = 0)
+    private String payType;
+
+    @ColumnWidth(22)
+    @ExcelProperty(value = "取餐号" , index = 0)
+    private String qucanhao;
+
+    @ColumnWidth(23)
+    @ExcelProperty(value = "状态" , index = 0)
+    private String orderCode;
+
+    @ColumnWidth(24)
+    @ExcelProperty(value = "是否转单" , index = 0)
+    private String isRider;
+
+}

+ 16 - 0
src/main/java/com/sqx/modules/exportExecl/service/ExportJobService.java

@@ -0,0 +1,16 @@
+package com.sqx.modules.exportExecl.service;
+
+import com.sqx.modules.exportExecl.model.ExportJob;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author wan
+ * @since 2024-09-25
+ */
+public interface ExportJobService extends IService<ExportJob> {
+
+}

+ 20 - 0
src/main/java/com/sqx/modules/exportExecl/service/impl/ExportJobServiceImpl.java

@@ -0,0 +1,20 @@
+package com.sqx.modules.exportExecl.service.impl;
+
+import com.sqx.modules.exportExecl.model.ExportJob;
+import com.sqx.modules.exportExecl.mapper.ExportJobMapper;
+import com.sqx.modules.exportExecl.service.ExportJobService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author wan
+ * @since 2024-09-25
+ */
+@Service
+public class ExportJobServiceImpl extends ServiceImpl<ExportJobMapper, ExportJob> implements ExportJobService {
+
+}

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

@@ -1,6 +1,7 @@
 package com.sqx.modules.goods.controller;
 package com.sqx.modules.goods.controller;
 
 
 import com.sqx.common.utils.Result;
 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.GoodsShop;
 import com.sqx.modules.goods.entity.GoodsShopRelevancy;
 import com.sqx.modules.goods.entity.GoodsShopRelevancy;
 import com.sqx.modules.goods.service.GoodsShopService;
 import com.sqx.modules.goods.service.GoodsShopService;
@@ -96,9 +97,9 @@ public class GoodsShopController {
 
 
     @ApiOperation("统计门店收入")
     @ApiOperation("统计门店收入")
     @GetMapping(value = "selectStoreData")
     @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("统计门店订单详情")
     @ApiOperation("统计门店订单详情")
@@ -124,6 +125,7 @@ public class GoodsShopController {
     @PostMapping("/updateGoodsShop")
     @PostMapping("/updateGoodsShop")
     public Result updateGoodsShop(@RequestBody GoodsShop goodsShop){
     public Result updateGoodsShop(@RequestBody GoodsShop goodsShop){
         goodsShop.setStatus(0);
         goodsShop.setStatus(0);
+        goodsShop.setIsSupplier(1);
         goodsShopService.updateById(goodsShop);
         goodsShopService.updateById(goodsShop);
         return Result.success();
         return Result.success();
     }
     }

+ 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.baomidou.mybatisplus.extension.service.IService;
 import com.sqx.common.utils.Result;
 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.GoodsShop;
 import com.sqx.modules.goods.entity.GoodsShopRelevancy;
 import com.sqx.modules.goods.entity.GoodsShopRelevancy;
 import com.sqx.modules.goods.vo.GoodsShopVo;
 import com.sqx.modules.goods.vo.GoodsShopVo;
@@ -28,7 +29,7 @@ public interface GoodsShopService extends IService<GoodsShop> {
 
 
     Result updateGoodsByShopId(GoodsShopRelevancy goodsShopRelevancy);
     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);
     Result selectStoreMessage(Long shopId, String startTime, String endTime, Integer page, Integer limit, String orderNumber);
 
 

+ 12 - 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.DataCentreDao;
 import com.sqx.modules.datacentre.dao.ShopAdminDao;
 import com.sqx.modules.datacentre.dao.ShopAdminDao;
 import com.sqx.modules.datacentre.entity.SysUserShop;
 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.GoodsShopDao;
 import com.sqx.modules.goods.dao.GoodsShopRelevancyDao;
 import com.sqx.modules.goods.dao.GoodsShopRelevancyDao;
 import com.sqx.modules.goods.entity.Goods;
 import com.sqx.modules.goods.entity.Goods;
@@ -358,22 +359,22 @@ public class GoodsShopServiceImpl extends ServiceImpl<GoodsShopDao, GoodsShop> i
     }
     }
 
 
     @Override
     @Override
-    public Result selectStoreData(Long shopId, String date, String dateType) {
+    public Result selectStoreData(DataCenterQuery query) {
         HashMap hashMap = new HashMap();
         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("takeCount", takeCount);
         hashMap.put("takeCount2", takeCount2);
         hashMap.put("takeCount2", takeCount2);
         hashMap.put("takeMoney", takeMoney);
         hashMap.put("takeMoney", takeMoney);
@@ -467,6 +468,8 @@ public class GoodsShopServiceImpl extends ServiceImpl<GoodsShopDao, GoodsShop> i
         goodsShopVo.setDistributionDistance(3000.00);
         goodsShopVo.setDistributionDistance(3000.00);
         GoodsShop shop = new GoodsShop();
         GoodsShop shop = new GoodsShop();
         BeanUtils.copyProperties(goodsShopVo, shop);
         BeanUtils.copyProperties(goodsShopVo, shop);
+//        默认不是供应商
+        shop.setIsSupplier(1);
         baseMapper.insert(shop);
         baseMapper.insert(shop);
         CommonInfo name = commonInfoService.findOne(12);
         CommonInfo name = commonInfoService.findOne(12);
         Msg byPhone = msgDao.findByPhone(goodsShopVo.getPhone());
         Msg byPhone = msgDao.findByPhone(goodsShopVo.getPhone());

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

@@ -26,7 +26,7 @@ import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
 import javax.validation.Valid;
 
 
 @Slf4j
 @Slf4j
-@Api(tags={"管理端-订单"})
+@Api(tags = {"管理端-订单"})
 @RestController
 @RestController
 @RequestMapping("/admin/order")
 @RequestMapping("/admin/order")
 public class OrderController extends AbstractController {
 public class OrderController extends AbstractController {
@@ -38,8 +38,8 @@ public class OrderController extends AbstractController {
 
 
     @ApiOperation("条件查询所有订单")
     @ApiOperation("条件查询所有订单")
     @GetMapping(value = "selectAllOrder")
     @GetMapping(value = "selectAllOrder")
-    public Result selectAllOrder(Integer page, Integer limit, Integer status, String phone, Long shopId, String userName, String orderNumber, Integer orderType,String shopName){
-        return appOrderService.selectAllOrder(page, limit, status, phone, shopId, userName, orderNumber, orderType,shopName);
+    public Result selectAllOrder(Integer page, Integer limit, Integer status, String phone, Long shopId, String userName, String orderNumber, Integer orderType, String shopName) {
+        return appOrderService.selectAllOrder(page, limit, status, phone, shopId, userName, orderNumber, orderType, shopName);
     }
     }
 
 
     @ApiOperation("条件查询所有订单(管理端)")
     @ApiOperation("条件查询所有订单(管理端)")
@@ -47,22 +47,22 @@ public class OrderController extends AbstractController {
     public Result selectAllOrderAdmin(Integer page, Integer limit, Integer status, String phone, Long shopId, String userName,
     public Result selectAllOrderAdmin(Integer page, Integer limit, Integer status, String phone, Long shopId, String userName,
                                       String orderNumber, String indentStatus, String reservationFlag,
                                       String orderNumber, String indentStatus, String reservationFlag,
                                       @ApiParam("1上门 2骑手配送 3商家配送 不传查所有") Integer orderType,
                                       @ApiParam("1上门 2骑手配送 3商家配送 不传查所有") Integer orderType,
-                                      String shopName, String riderPhone, String startTime, String endTime, String payStartTime, String payEndTime){
+                                      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);
         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,
-                           String orderNumber, Integer orderType,String shopName,String riderPhone,
-                           String startTime, String endTime, HttpServletResponse response) throws Exception{
-        ExcelData excelData = appOrderService.excelAllOrderAdmin(status, phone, shopId, userName, orderNumber, orderType, shopName, riderPhone, startTime, endTime);
-        ExportExcelUtils.exportExcel(response,"订单列表.xlsx",excelData);
-    }
+//    @GetMapping("excelOrder")
+//    @ApiOperation("导出卡密列表")
+//    public void excelOrder(Integer status, String phone, Long shopId, String userName,
+//                           String orderNumber, Integer orderType,String shopName,String riderPhone,
+//                           String startTime, String endTime, HttpServletResponse response) throws Exception{
+//        ExcelData excelData = appOrderService.excelAllOrderAdmin(status, phone, shopId, userName, orderNumber, orderType, shopName, riderPhone, startTime, endTime);
+//        ExportExcelUtils.exportExcel(response,"订单列表.xlsx",excelData);
+//    }
 
 
     @ApiOperation("完成订单")
     @ApiOperation("完成订单")
     @PostMapping(value = "accomplishOrder")
     @PostMapping(value = "accomplishOrder")
-    public Result accomplishOrder(@Valid OrderFinishByShopDTO orderFinishByShopDTO){
+    public Result accomplishOrder(@Valid OrderFinishByShopDTO orderFinishByShopDTO) {
         appOrderService.finishOrderByShop(orderFinishByShopDTO);
         appOrderService.finishOrderByShop(orderFinishByShopDTO);
 
 
         return Result.success();
         return Result.success();
@@ -70,7 +70,7 @@ public class OrderController extends AbstractController {
 
 
     @ApiOperation("添加送达照片")
     @ApiOperation("添加送达照片")
     @PostMapping(value = "add-receive-img/{orderId}")
     @PostMapping(value = "add-receive-img/{orderId}")
-    public Result addReceiveImg(@PathVariable Long orderId, @DecryptParam String img){
+    public Result addReceiveImg(@PathVariable Long orderId, @DecryptParam String img) {
         appOrderService.addReceiveImg(orderId, img);
         appOrderService.addReceiveImg(orderId, img);
 
 
         return Result.success();
         return Result.success();
@@ -78,43 +78,43 @@ public class OrderController extends AbstractController {
 
 
     @ApiOperation("管理订单")
     @ApiOperation("管理订单")
     @PostMapping(value = "updateOrder")
     @PostMapping(value = "updateOrder")
-    public Result updateOrder(@RequestBody TbOrder tborder){
+    public Result updateOrder(@RequestBody TbOrder tborder) {
 
 
         return appOrderService.updateOrder(tborder);
         return appOrderService.updateOrder(tborder);
     }
     }
 
 
     @ApiOperation("管理端退款")
     @ApiOperation("管理端退款")
     @PostMapping(value = "adminCancelOrder")
     @PostMapping(value = "adminCancelOrder")
-    public Result adminCancelOrder(Long orderId){
+    public Result adminCancelOrder(Long orderId) {
 
 
         return appOrderService.adminCancelOrder(orderId);
         return appOrderService.adminCancelOrder(orderId);
     }
     }
 
 
     @ApiOperation("商家回复评论")
     @ApiOperation("商家回复评论")
     @PostMapping(value = "shopReplyEvaluate")
     @PostMapping(value = "shopReplyEvaluate")
-    public Result shopReplyEvaluate(String orderNumber, String shopReplyMessage){
+    public Result shopReplyEvaluate(String orderNumber, String shopReplyMessage) {
 
 
         return appOrderService.shopReplyEvaluate(orderNumber, shopReplyMessage);
         return appOrderService.shopReplyEvaluate(orderNumber, shopReplyMessage);
     }
     }
 
 
     @ApiOperation("商家删除评论")
     @ApiOperation("商家删除评论")
     @PostMapping("/deleteEvaluate")
     @PostMapping("/deleteEvaluate")
-    public Result deleteEvaluate(Long evaluateId){
+    public Result deleteEvaluate(Long evaluateId) {
         evaluateService.removeById(evaluateId);
         evaluateService.removeById(evaluateId);
         return Result.success();
         return Result.success();
     }
     }
 
 
     @ApiOperation("打印票")
     @ApiOperation("打印票")
     @PostMapping(value = "/print")
     @PostMapping(value = "/print")
-    public Result print(Long orderId){
-        return appOrderService.print(orderId);
+    public Result print(Long orderId, Integer isAppend) {
+        return appOrderService.print(orderId, isAppend);
     }
     }
 
 
     @ApiOperation("获取用户评价列表")
     @ApiOperation("获取用户评价列表")
     @GetMapping(value = "getEvaluateList")
     @GetMapping(value = "getEvaluateList")
-    public Result getEvaluateList( Long userId, Evaluate evaluate, Integer page, Integer limit){
+    public Result getEvaluateList(Long userId, Evaluate evaluate, Integer page, Integer limit) {
         evaluate.setUserId(userId);
         evaluate.setUserId(userId);
-        return Result.success().put("data", appOrderService.getEvaluateList(evaluate,page,limit));
+        return Result.success().put("data", appOrderService.getEvaluateList(evaluate, page, limit));
     }
     }
 
 
 }
 }

+ 13 - 5
src/main/java/com/sqx/modules/order/dao/AppOrderDao.java

@@ -3,6 +3,8 @@ package com.sqx.modules.order.dao;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 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 com.sqx.modules.order.entity.TbOrder;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
@@ -23,17 +25,23 @@ public interface AppOrderDao extends BaseMapper<TbOrder> {
     IPage<TbOrder> selectOrder(Page<TbOrder> pages,@Param("status") Integer status,@Param("phone") String phone, @Param("shopId") Long shopId,
     IPage<TbOrder> selectOrder(Page<TbOrder> pages,@Param("status") Integer status,@Param("phone") String phone, @Param("shopId") Long shopId,
                                @Param("userName") String userName, @Param("orderNumber") String orderNumber,@Param("orderType") Integer orderType,@Param("shopName")String shopName);
                                @Param("userName") String userName, @Param("orderNumber") String orderNumber,@Param("orderType") Integer orderType,@Param("shopName")String shopName);
 
 
-
+    @DataSource("dynamic")
     IPage<TbOrder> selectAllOrderAdmin(Page<TbOrder> pages,@Param("status") Integer status,@Param("phone") String phone, @Param("shopId") Long shopId,
     IPage<TbOrder> selectAllOrderAdmin(Page<TbOrder> pages,@Param("status") Integer status,@Param("phone") String phone, @Param("shopId") Long shopId,
                                @Param("userName") String userName, @Param("orderNumber") String orderNumber,@Param("orderType") Integer orderType,
                                @Param("userName") String userName, @Param("orderNumber") String orderNumber,@Param("orderType") Integer orderType,
                                        @Param("shopName")String shopName,@Param("riderPhone") String riderPhone, @Param("indentStatus") String indentStatus, @Param("reservationFlag") String reservationFlag,
                                        @Param("shopName")String shopName,@Param("riderPhone") String riderPhone, @Param("indentStatus") String indentStatus, @Param("reservationFlag") String reservationFlag,
                                        @Param("startTime") String startTime,@Param("endTime") String endTime, @Param("payStartTime") String payStartTime, @Param("payEndTime") String payEndTime);
                                        @Param("startTime") String startTime,@Param("endTime") String endTime, @Param("payStartTime") String payStartTime, @Param("payEndTime") String payEndTime);
-
+    @DataSource("dynamic")
     List<TbOrder> excelAllOrderAdmin(@Param("status") Integer status,@Param("phone") String phone, @Param("shopId") Long shopId,
     List<TbOrder> excelAllOrderAdmin(@Param("status") Integer status,@Param("phone") String phone, @Param("shopId") Long shopId,
                                        @Param("userName") String userName, @Param("orderNumber") String orderNumber,
                                        @Param("userName") String userName, @Param("orderNumber") String orderNumber,
                                      @Param("orderType") Integer orderType,@Param("shopName")String shopName,
                                      @Param("orderType") Integer orderType,@Param("shopName")String shopName,
                                      @Param("riderPhone") String riderPhone,@Param("startTime") String startTime,
                                      @Param("riderPhone") String riderPhone,@Param("startTime") String startTime,
-                                     @Param("endTime") String endTime);
+                                     @Param("endTime") String endTime,@Param("payStartTime") String payStartTime,@Param("payEndTime") String payEndTime);
+    @DataSource("dynamic")
+    Integer excelAllOrderAdminCount(@Param("status") Integer status,@Param("phone") String phone, @Param("shopId") Long shopId,
+                                     @Param("userName") String userName, @Param("orderNumber") String orderNumber,
+                                     @Param("orderType") Integer orderType,@Param("shopName")String shopName,
+                                     @Param("riderPhone") String riderPhone,@Param("startTime") String startTime,
+                                     @Param("endTime") String endTime,@Param("payStartTime") String payStartTime,@Param("payEndTime") String payEndTime);
 
 
 
 
     IPage<TbOrder> selectOrderByAdmin(Page<TbOrder> pages,@Param("status") Integer status,@Param("phone") String phone,
     IPage<TbOrder> selectOrderByAdmin(Page<TbOrder> pages,@Param("status") Integer status,@Param("phone") String phone,
@@ -52,9 +60,9 @@ public interface AppOrderDao extends BaseMapper<TbOrder> {
 
 
     int deleteCouponByOrderId(@Param("orderId") Long orderId);
     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);
     int updateorderStatus(String date);
 
 

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

@@ -147,6 +147,9 @@ public class TbOrder implements Serializable {
     @ApiModelProperty("订单顺序号(当天)")
     @ApiModelProperty("订单顺序号(当天)")
     private String orderSequence;
     private String orderSequence;
 
 
+    @ApiModelProperty("打印状态  已打印:1 未打印:0")
+    private Integer isPrint;
+
     @ApiModelProperty("商铺名")
     @ApiModelProperty("商铺名")
     @TableField(exist = false)
     @TableField(exist = false)
     private String shopName;
     private String shopName;
@@ -175,6 +178,14 @@ public class TbOrder implements Serializable {
     @TableField(exist = false)
     @TableField(exist = false)
     private String shopPhone;
     private String shopPhone;
 
 
+    @ApiModelProperty("商铺主营类型")
+    @TableField(exist = false)
+    private String shopType;
+
+    @ApiModelProperty("商铺主营类型名称")
+    @TableField(exist = false)
+    private String shopTypeName;
+
     @TableField(exist = false)
     @TableField(exist = false)
     private List<OrderGoods> orderGoodsList;
     private List<OrderGoods> orderGoodsList;
 
 
@@ -255,5 +266,13 @@ public class TbOrder implements Serializable {
     @TableField(exist = false)
     @TableField(exist = false)
     private Integer isRider;
     private Integer isRider;
 
 
+    @TableField(exist = false)
+    @ApiModelProperty("导出商品详情")
+    private String detail;
+
+    @TableField(exist = false)
+    @ApiModelProperty("导出商品总价")
+    private Double sumPrice;
+
     public TbOrder() {}
     public TbOrder() {}
 }
 }

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

@@ -15,9 +15,11 @@ import java.util.List;
 
 
 public interface AppOrderService extends IService<TbOrder> {
 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);
     void insertOrder(Long userId, Long shopId, Long goodsId, Integer num, Long skuId, String skuMessage, Integer orderType);
 
 
-    Result print(Long orderId);
+    Result print(Long orderId, Integer isAppend);
 
 
     Result updateOrder(TbOrder order);
     Result updateOrder(TbOrder order);
 
 
@@ -34,7 +36,7 @@ public interface AppOrderService extends IService<TbOrder> {
 
 
     ExcelData excelAllOrderAdmin(Integer status, String phone, Long shopId,
     ExcelData excelAllOrderAdmin(Integer status, String phone, Long shopId,
                                  String userName, String orderNumber, Integer orderType, String shopName,
                                  String userName, String orderNumber, Integer orderType, String shopName,
-                                 String riderPhone, String startTime, String endTime);
+                                 String riderPhone, String startTime, String endTime,String payStartTime, String payEndTime);
 
 
     Result selectOrderByUserId(Long userId, String date, String dateType);
     Result selectOrderByUserId(Long userId, String date, String dateType);
 
 

+ 41 - 26
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.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 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.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 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);
     private static final DateTimeFormatter DTF = DateTimeFormatter.ofPattern(DateUtils.TIME_PATTERN1);
 
 
     @Override
     @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) {
     public void insertOrder(Long userId, Long shopId, Long goodsId, Integer num, Long skuId, String skuMessage, Integer orderType) {
         // 判断当前时间是否在店铺营业范围内
         // 判断当前时间是否在店铺营业范围内
         if (!isShopBusinessTime(shopId)) {
         if (!isShopBusinessTime(shopId)) {
@@ -646,7 +658,7 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
                         // 设置店铺名称
                         // 设置店铺名称
                         order.setShopName(goodsShop.getShopName());
                         order.setShopName(goodsShop.getShopName());
 
 
-                        FeiYunUtils.print(goodsShop.getSnCode(), null, order);
+                        FeiYunUtils.print(goodsShop.getSnCode(), null, order,null);
                     } catch (Exception e) {
                     } catch (Exception e) {
                         log.error("订单:{},小票打印失败,失败原因:{}", order.getOrderId(), e);
                         log.error("订单:{},小票打印失败,失败原因:{}", order.getOrderId(), e);
                     }
                     }
@@ -1300,14 +1312,14 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
     @Override
     @Override
     public ExcelData excelAllOrderAdmin(Integer status, String phone, Long shopId,
     public ExcelData excelAllOrderAdmin(Integer status, String phone, Long shopId,
                                         String userName, String orderNumber, Integer orderType, String shopName,
                                         String userName, String orderNumber, Integer orderType, String shopName,
-                                        String riderPhone, String startTime, String endTime) {
+                                        String riderPhone, String startTime, String endTime,String payStartTime, String payEndTime) {
         List<TbOrder> tbOrderIPage = appOrderDao.excelAllOrderAdmin( status, phone, shopId, userName, orderNumber, orderType,
         List<TbOrder> tbOrderIPage = appOrderDao.excelAllOrderAdmin( status, phone, shopId, userName, orderNumber, orderType,
-                shopName, riderPhone,startTime,endTime);
-        for (int i = 0; i < tbOrderIPage.size(); i++) {
-            List<OrderGoods> orderGoodsList = orderGoodsDao.selectList(new QueryWrapper<OrderGoods>()
-                    .eq("order_id", tbOrderIPage.get(i).getOrderId()));
-            tbOrderIPage.get(i).setOrderGoodsList(orderGoodsList);
-        }
+                shopName, riderPhone,startTime,endTime,payStartTime,payEndTime);
+//        for (int i = 0; i < tbOrderIPage.size(); i++) {
+//            List<OrderGoods> orderGoodsList = orderGoodsDao.selectList(new QueryWrapper<OrderGoods>()
+//                    .eq("order_id", tbOrderIPage.get(i).getOrderId()));
+//            tbOrderIPage.get(i).setOrderGoodsList(orderGoodsList);
+//        }
         ExcelData data = new ExcelData();
         ExcelData data = new ExcelData();
         data.setName("订单列表");
         data.setName("订单列表");
         List<String> titles = new ArrayList();
         List<String> titles = new ArrayList();
@@ -1334,10 +1346,12 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
                     .append("\n").append("店铺电话:").append(StringUtils.isNotBlank(order.getShopPhone())?order.getShopPhone():"")
                     .append("\n").append("店铺电话:").append(StringUtils.isNotBlank(order.getShopPhone())?order.getShopPhone():"")
                     .append("\n").append("店铺地址:").append(StringUtils.isNotBlank(order.getDetailedAddress())?order.getDetailedAddress():"");
                     .append("\n").append("店铺地址:").append(StringUtils.isNotBlank(order.getDetailedAddress())?order.getDetailedAddress():"");
             row.add(stringBuffer.toString());
             row.add(stringBuffer.toString());
-            if(order.getOrderType()!=null && order.getOrderType()==1){
+            if(order.getOrderTypeExtra()!=null && order.getOrderTypeExtra()==1){
                 row.add("到店取餐");
                 row.add("到店取餐");
-            }else if(order.getOrderType()!=null && order.getOrderType()==2){
+            }else if(order.getOrderTypeExtra()!=null && order.getOrderTypeExtra()==2){
                 row.add("外卖配送");
                 row.add("外卖配送");
+            }else if(order.getOrderTypeExtra()!=null && order.getOrderTypeExtra()==3){
+                row.add("商家配送");
             }else{
             }else{
                 row.add("");
                 row.add("");
             }
             }
@@ -1353,19 +1367,19 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
             row.add(order.getRiderNickName());
             row.add(order.getRiderNickName());
             row.add(order.getRiderPhone());
             row.add(order.getRiderPhone());
             row.add(order.getOrderNumber());
             row.add(order.getOrderNumber());
-            stringBuffer=new StringBuffer();
-            BigDecimal sumGoodsPrice=BigDecimal.ZERO;
-            List<OrderGoods> orderGoodsList = order.getOrderGoodsList();
-            for(int i=0;i<orderGoodsList.size();i++){
-                OrderGoods orderGoods = orderGoodsList.get(i);
-                stringBuffer.append(i + 1).append(". 商品名:").append(orderGoods.getGoodsName()).append(",数量:").append(orderGoods.getGoodsNum()).append(",规格:").append(orderGoods.getSkuMessage());
-                if(orderGoods.getGoodsPrice()!=null && orderGoods.getGoodsNum()!=null){
-                    BigDecimal goodsPrice = orderGoods.getGoodsPrice().multiply(BigDecimal.valueOf(orderGoods.getGoodsNum()));
-                    sumGoodsPrice=sumGoodsPrice.add(goodsPrice);
-                }
-            }
-            row.add(stringBuffer.toString());
-            row.add(sumGoodsPrice);
+//            stringBuffer=new StringBuffer();
+//            BigDecimal sumGoodsPrice=BigDecimal.ZERO;
+//            List<OrderGoods> orderGoodsList = order.getOrderGoodsList();
+//            for(int i=0;i<orderGoodsList.size();i++){
+//                OrderGoods orderGoods = orderGoodsList.get(i);
+//                stringBuffer.append(i + 1).append(". 商品名:").append(orderGoods.getGoodsName()).append(",数量:").append(orderGoods.getGoodsNum()).append(",规格:").append(orderGoods.getSkuMessage());
+//                if(orderGoods.getGoodsPrice()!=null && orderGoods.getGoodsNum()!=null){
+//                    BigDecimal goodsPrice = orderGoods.getGoodsPrice().multiply(BigDecimal.valueOf(orderGoods.getGoodsNum()));
+//                    sumGoodsPrice=sumGoodsPrice.add(goodsPrice);
+//                }
+//            }
+            row.add(order.getDetail());
+            row.add(order.getSumPrice());
             row.add(order.getCouponMoney());
             row.add(order.getCouponMoney());
             row.add(order.getActivityTitle());
             row.add(order.getActivityTitle());
             row.add(order.getActivityDiscountAmount());
             row.add(order.getActivityDiscountAmount());
@@ -1374,6 +1388,7 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
             row.add(order.getPayMoney());
             row.add(order.getPayMoney());
 
 
             row.add(order.getErrandMoneyIsShop());
             row.add(order.getErrandMoneyIsShop());
+            row.add(order.getRemark());
             row.add(order.getPayTime());
             row.add(order.getPayTime());
             //支付方式  1微信支付  2余额支付  3支付宝支付
             //支付方式  1微信支付  2余额支付  3支付宝支付
             if(order.getPayType()!=null && order.getPayType()==1){
             if(order.getPayType()!=null && order.getPayType()==1){
@@ -1570,7 +1585,7 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
     }
     }
 
 
     @Override
     @Override
-    public Result print(Long orderId) {
+    public Result print(Long orderId, Integer isAppend) {
         // 查询订单信息
         // 查询订单信息
         TbOrder tbOrder = selectOrderByIds(orderId);
         TbOrder tbOrder = selectOrderByIds(orderId);
         Long shopId = tbOrder.getShopId();
         Long shopId = tbOrder.getShopId();
@@ -1579,7 +1594,7 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
         GoodsShop goodsShop = goodsShopDao.selectById(shopId);
         GoodsShop goodsShop = goodsShopDao.selectById(shopId);
 
 
         if (StringUtils.isNotEmpty(goodsShop.getSnCode())) {
         if (StringUtils.isNotEmpty(goodsShop.getSnCode())) {
-            FeiYunUtils.print(goodsShop.getSnCode(), null, tbOrder);
+            FeiYunUtils.print(goodsShop.getSnCode(), null, tbOrder, isAppend);
         } else {
         } else {
             return Result.error("当前商家未绑定打印机!");
             return Result.error("当前商家未绑定打印机!");
         }
         }
@@ -1651,7 +1666,7 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
             // 如果是预约订单,则不再打印小票(订单支付的时候已经打印过了)
             // 如果是预约订单,则不再打印小票(订单支付的时候已经打印过了)
             if (!StrUtil.equals(tbOrder.getReservationFlag(), Constant.YES)) {
             if (!StrUtil.equals(tbOrder.getReservationFlag(), Constant.YES)) {
                 if (StringUtils.isNotEmpty(goodsShop.getSnCode())) {
                 if (StringUtils.isNotEmpty(goodsShop.getSnCode())) {
-                    FeiYunUtils.print(goodsShop.getSnCode(), null, tbOrder);
+                    FeiYunUtils.print(goodsShop.getSnCode(), null, tbOrder,null);
                 }
                 }
             }
             }
         } else if (order.getStatus() == 3) {
         } else if (order.getStatus() == 3) {

+ 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.app.service.UserService;
 import com.sqx.modules.common.entity.CommonInfo;
 import com.sqx.modules.common.entity.CommonInfo;
 import com.sqx.modules.common.service.CommonInfoService;
 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.entity.MessageInfo;
 import com.sqx.modules.message.service.MessageService;
 import com.sqx.modules.message.service.MessageService;
 import com.sqx.modules.pay.config.AliPayConstants;
 import com.sqx.modules.pay.config.AliPayConstants;
@@ -250,9 +251,9 @@ public class CashController {
 
 
     @ApiOperation("平台收入统计")
     @ApiOperation("平台收入统计")
     @GetMapping(value = "incomeStatistics")
     @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("充值统计")
     @ApiOperation("充值统计")

+ 47 - 0
src/main/java/com/sqx/modules/pay/controller/query/CashOutQueryDTO.java

@@ -4,6 +4,7 @@ import com.sqx.common.query.PageQuery;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.Data;
+import org.springframework.util.StringUtils;
 
 
 /**
 /**
  * 提现信息查询dto
  * 提现信息查询dto
@@ -37,4 +38,50 @@ public class CashOutQueryDTO extends PageQuery {
     private String startTime;
     private String startTime;
     @ApiModelProperty("查询结束时间")
     @ApiModelProperty("查询结束时间")
     private String endTime;
     private String endTime;
+
+    public String toStrCode() {
+        return
+//                ","+bankCardNo+
+//                ","+bankRealName+
+//                ","+openBank+
+                ","+(zhifubaoName==null?"":zhifubaoName)+
+                ","+(zhifubao==null?"":zhifubao)+
+                ","+(shopName==null?"":shopName)+
+//                ","+userId+
+                ","+(state==null?"":state)+
+//                ","+phone+
+                ","+(type==null?"":type)+
+//                ","+classify+
+                ","+(startTime==null?"":startTime)+
+                ","+(endTime==null?"":endTime)+",";
+    }
+    public String toStrMessage() {
+        StringBuffer stringBuffer=new StringBuffer();
+
+        stringBuffer
+//                .append(bankCardNo==null||bankCardNo==""?"":"银行卡号:"+bankCardNo+";")
+//                .append(bankRealName==null||bankRealName==""?"":"银行卡户主名称:"+bankRealName+";")
+//                .append(openBank==null||openBank==""?"":"银行卡开户行:"+openBank+";")
+                .append(zhifubaoName==null||zhifubaoName==""?"":"支付宝名称:"+zhifubaoName+";")
+                .append(zhifubao==null||zhifubao==""?"":"支付宝账号:"+zhifubao+";")
+                .append(shopName==null||shopName==""?"":"店铺名称:"+shopName+";")
+//                .append(phone==null||phone==""?"":"用户手机号:"+phone+";")
+//                .append(classify==null?"":"支付渠道:"+classify+";")
+                .append(startTime==null||startTime==""?"":"开始时间:"+startTime+";")
+                .append(endTime==null||endTime==""?"":"结束时间:"+endTime+";");
+        if(state!=null){
+            switch (state){
+                case 0: stringBuffer.append("状态:待转账;");break;
+                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();
+    }
 }
 }

+ 36 - 2
src/main/java/com/sqx/modules/pay/controller/query/WalletDetailQuery.java

@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.Data;
 import org.springframework.format.annotation.DateTimeFormat;
 import org.springframework.format.annotation.DateTimeFormat;
+import org.springframework.util.StringUtils;
 
 
 import java.util.Date;
 import java.util.Date;
 
 
@@ -26,9 +27,42 @@ public class WalletDetailQuery extends PageQuery {
 
 
     @ApiModelProperty("查询开始时间, 时间格式yyyy-MM-dd")
     @ApiModelProperty("查询开始时间, 时间格式yyyy-MM-dd")
     @DateTimeFormat(pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern = "yyyy-MM-dd")
-    private Date startTime;
+    private String startTime;
 
 
     @ApiModelProperty("查询截止时间, 时间格式yyyy-MM-dd")
     @ApiModelProperty("查询截止时间, 时间格式yyyy-MM-dd")
     @DateTimeFormat(pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern = "yyyy-MM-dd")
-    private Date endTime;
+    private String endTime;
+
+    @ApiModelProperty("登录人id")
+    private String userId;
+
+    public String toStrMessage() {
+        StringBuilder stringBuilder=new StringBuilder();
+        stringBuilder.append(!StringUtils.hasText(shopName)?"":"店铺名称:"+shopName+";")
+                .append(!StringUtils.hasText(startTime)?"":"开始时间:"+startTime+";")
+                .append(!StringUtils.hasText(endTime)?"":"截止时间:"+endTime+";");
+        if(StringUtils.hasText(type)){
+            switch (type){
+                case "1": stringBuilder.append("状态:充值;");break;
+                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;
+//            }
+//        }
+        return stringBuilder.toString();
+    }
+
+    public String toStrCode() {
+        return ","+(shopName==null?"":shopName)
+                +","+(type==null?"":type)
+                +","+(classify==null?"":classify)
+                +","+(startTime==null?"":startTime)
+                +","+(endTime==null?"":endTime)+",";
+    }
 }
 }

+ 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.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 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.controller.query.CashOutQueryDTO;
 import com.sqx.modules.pay.entity.CashOut;
 import com.sqx.modules.pay.entity.CashOut;
 import com.sqx.modules.pay.vo.CashOutVO;
 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 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);
     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.PageUtils;
 import com.sqx.common.utils.Result;
 import com.sqx.common.utils.Result;
 import com.sqx.modules.app.entity.UserEntity;
 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.controller.query.CashOutQueryDTO;
 import com.sqx.modules.pay.entity.CashOut;
 import com.sqx.modules.pay.entity.CashOut;
 import com.sqx.modules.utils.excel.ExcelData;
 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 statisticsMoney(String date, String dateType, Integer type);
 
 
-    Result incomeStatistics(String date, String dateType);
+    Result incomeStatistics(DataCenterQuery query);
 
 
     Result cashDepositMoney(Long userId);
     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.app.service.UserService;
 import com.sqx.modules.common.entity.CommonInfo;
 import com.sqx.modules.common.entity.CommonInfo;
 import com.sqx.modules.common.service.CommonInfoService;
 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.ErrandComplaintDao;
 import com.sqx.modules.errand.dao.TbIndentDao;
 import com.sqx.modules.errand.dao.TbIndentDao;
 import com.sqx.modules.errand.entity.ErrandComplaint;
 import com.sqx.modules.errand.entity.ErrandComplaint;
@@ -314,28 +315,28 @@ public class CashOutServiceImpl extends ServiceImpl<CashOutDao, CashOut> impleme
     }
     }
 
 
     @Override
     @Override
-    public Result incomeStatistics(String date, String dateType) {
+    public Result incomeStatistics(DataCenterQuery query) {
         HashMap hashMap = new HashMap();
         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 serviceSum = firstMoneySum.add(secondMoneySum).add(thirdMoneySum).add(fourthMoneySum).add(tcwmMoneySum);
         //总收入=服务费+保价费+扣除骑手保证金
         //总收入=服务费+保价费+扣除骑手保证金
         BigDecimal allSum = serviceSum.add(cargoInsurance).add(deductMoneySum);
         BigDecimal allSum = serviceSum.add(cargoInsurance).add(deductMoneySum);
         //骑手保证金收入
         //骑手保证金收入
-        BigDecimal cashDepositMoney = cashOutDao.cashDepositMoney(date, dateType);
+        BigDecimal cashDepositMoney = cashOutDao.cashDepositMoney(query);
 
 
         /*//平台总收入=总收入-商品费
         /*//平台总收入=总收入-商品费
         BigDecimal allMoneySum = cashOutDao.allMoneySum(date, dateType);
         BigDecimal allMoneySum = cashOutDao.allMoneySum(date, dateType);

+ 1 - 1
src/main/java/com/sqx/modules/pay/vo/WalletDetailVO.java

@@ -33,5 +33,5 @@ public class WalletDetailVO {
     private BigDecimal money;
     private BigDecimal money;
 
 
     @ApiModelProperty("创建时间")
     @ApiModelProperty("创建时间")
-    private Date createTime;
+    private String createTime;
 }
 }

+ 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.AppOrderService;
 import com.sqx.modules.order.service.impl.AppAppOrderServiceImpl;
 import com.sqx.modules.order.service.impl.AppAppOrderServiceImpl;
 import com.sqx.modules.printInfo.entity.*;
 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.PrintInfoService;
 import com.sqx.modules.printInfo.service.PrintInfoShopService;
 import com.sqx.modules.printInfo.service.PrintInfoShopService;
 import com.sqx.modules.utils.fieYun.FeiYunUtils;
 import com.sqx.modules.utils.fieYun.FeiYunUtils;
@@ -52,6 +53,27 @@ public class PrintInfoController {
     @Autowired
     @Autowired
     private GoodsShopService goodsShopService;
     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")
     @GetMapping("testPrintModel")
     @ApiOperation("获取打印信息列表")
     @ApiOperation("获取打印信息列表")
     public Result testPrintModel(Long orderId) {
     public Result testPrintModel(Long orderId) {
@@ -66,7 +88,7 @@ public class PrintInfoController {
         tbOrder.setCountOrder(3);
         tbOrder.setCountOrder(3);
 
 
         if (StringUtils.isNotEmpty(goodsShop.getSnCode())) {
         if (StringUtils.isNotEmpty(goodsShop.getSnCode())) {
-            FeiYunUtils.print(goodsShop.getSnCode(), null, tbOrder);
+            FeiYunUtils.print(goodsShop.getSnCode(), null, tbOrder, null);
         } else {
         } else {
             return Result.error("当前商家未绑定打印机!");
             return Result.error("当前商家未绑定打印机!");
         }
         }
@@ -95,8 +117,6 @@ public class PrintInfoController {
     }
     }
 
 
 
 
-
-
     @GetMapping("getPrintInfoList")
     @GetMapping("getPrintInfoList")
     @ApiOperation("获取打印信息列表")
     @ApiOperation("获取打印信息列表")
     public Result getPrintInfoList(Integer page, Integer limit) {
     public Result getPrintInfoList(Integer page, Integer limit) {
@@ -147,12 +167,12 @@ public class PrintInfoController {
         files.add("user_id");
         files.add("user_id");
         files.add("coupon_id");
         files.add("coupon_id");
         files.add("expect_delivery_time");
         files.add("expect_delivery_time");
-        if(!files.contains(printInfo.getPrintField())){
+        if (!files.contains(printInfo.getPrintField())) {
             return Result.error("无法新增非法字段");
             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("当前类型中已包含该字段");
             return Result.error("当前类型中已包含该字段");
         }
         }
 
 
@@ -197,12 +217,12 @@ public class PrintInfoController {
         files.add("user_id");
         files.add("user_id");
         files.add("coupon_id");
         files.add("coupon_id");
         files.add("expect_delivery_time");
         files.add("expect_delivery_time");
-        if(!files.contains(printInfo.getPrintField())){
+        if (!files.contains(printInfo.getPrintField())) {
             return Result.error("无法将数据更新为非法字段");
             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("当前类型中已包含该字段");
             return Result.error("当前类型中已包含该字段");
         }
         }
 
 
@@ -278,9 +298,9 @@ public class PrintInfoController {
                     detailData.setId(nowInfo.getId());
                     detailData.setId(nowInfo.getId());
                     detailData.setPrintField(nowInfo.getPrintField());
                     detailData.setPrintField(nowInfo.getPrintField());
                     detailData.setPrintName(nowInfo.getPrintName());
                     detailData.setPrintName(nowInfo.getPrintName());
-                    if(haves.contains(nowInfo.getPrintField())){
+                    if (haves.contains(nowInfo.getPrintField())) {
                         detailData.setIsCheck(1);
                         detailData.setIsCheck(1);
-                    }else{
+                    } else {
                         detailData.setIsCheck(0);
                         detailData.setIsCheck(0);
                     }
                     }
                     details.add(detailData);
                     details.add(detailData);
@@ -315,9 +335,9 @@ public class PrintInfoController {
                     detailData.setId(nowInfo.getId());
                     detailData.setId(nowInfo.getId());
                     detailData.setPrintField(nowInfo.getPrintField());
                     detailData.setPrintField(nowInfo.getPrintField());
                     detailData.setPrintName(nowInfo.getPrintName());
                     detailData.setPrintName(nowInfo.getPrintName());
-                    if(haves.contains(nowInfo.getPrintField())){
+                    if (haves.contains(nowInfo.getPrintField())) {
                         detailData.setIsCheck(1);
                         detailData.setIsCheck(1);
-                    }else{
+                    } else {
                         detailData.setIsCheck(0);
                         detailData.setIsCheck(0);
                     }
                     }
                     details.add(detailData);
                     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<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());
                 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();
                     PrintModelDetailResult detailData = new PrintModelDetailResult();
                     detailData.setId(nowInfo.getId());
                     detailData.setId(nowInfo.getId());
                     detailData.setPrintField(nowInfo.getPrintField());
                     detailData.setPrintField(nowInfo.getPrintField());
                     detailData.setPrintName(nowInfo.getPrintName());
                     detailData.setPrintName(nowInfo.getPrintName());
-                    if(haves.contains(nowInfo.getPrintField())){
+                    if (haves.contains(nowInfo.getPrintField())) {
                         detailData.setIsCheck(1);
                         detailData.setIsCheck(1);
-                    }else{
+                    } else {
                         detailData.setIsCheck(0);
                         detailData.setIsCheck(0);
                     }
                     }
                     data.getDetails().add(detailData);
                     data.getDetails().add(detailData);
@@ -376,9 +396,9 @@ public class PrintInfoController {
                     detailData.setId(nowInfo.getId());
                     detailData.setId(nowInfo.getId());
                     detailData.setPrintField(nowInfo.getPrintField());
                     detailData.setPrintField(nowInfo.getPrintField());
                     detailData.setPrintName(nowInfo.getPrintName());
                     detailData.setPrintName(nowInfo.getPrintName());
-                    if(haves.contains(nowInfo.getPrintField())){
+                    if (haves.contains(nowInfo.getPrintField())) {
                         detailData.setIsCheck(1);
                         detailData.setIsCheck(1);
-                    }else{
+                    } else {
                         detailData.setIsCheck(0);
                         detailData.setIsCheck(0);
                     }
                     }
                     details.add(detailData);
                     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<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());
                 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();
                     PrintModelDetailResult detailData = new PrintModelDetailResult();
                     detailData.setId(nowInfo.getId());
                     detailData.setId(nowInfo.getId());
                     detailData.setPrintField(nowInfo.getPrintField());
                     detailData.setPrintField(nowInfo.getPrintField());
                     detailData.setPrintName(nowInfo.getPrintName());
                     detailData.setPrintName(nowInfo.getPrintName());
-                    if(haves.contains(nowInfo.getPrintField())){
+                    if (haves.contains(nowInfo.getPrintField())) {
                         detailData.setIsCheck(1);
                         detailData.setIsCheck(1);
-                    }else{
+                    } else {
                         detailData.setIsCheck(0);
                         detailData.setIsCheck(0);
                     }
                     }
                     data.getDetails().add(detailData);
                     data.getDetails().add(detailData);
@@ -436,9 +456,9 @@ public class PrintInfoController {
                     detailData.setId(nowInfo.getId());
                     detailData.setId(nowInfo.getId());
                     detailData.setPrintField(nowInfo.getPrintField());
                     detailData.setPrintField(nowInfo.getPrintField());
                     detailData.setPrintName(nowInfo.getPrintName());
                     detailData.setPrintName(nowInfo.getPrintName());
-                    if(haves.contains(nowInfo.getPrintField())){
+                    if (haves.contains(nowInfo.getPrintField())) {
                         detailData.setIsCheck(1);
                         detailData.setIsCheck(1);
-                    }else{
+                    } else {
                         detailData.setIsCheck(0);
                         detailData.setIsCheck(0);
                     }
                     }
                     details.add(detailData);
                     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<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());
                 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();
                     PrintModelDetailResult detailData = new PrintModelDetailResult();
                     detailData.setId(nowInfo.getId());
                     detailData.setId(nowInfo.getId());
                     detailData.setPrintField(nowInfo.getPrintField());
                     detailData.setPrintField(nowInfo.getPrintField());
                     detailData.setPrintName(nowInfo.getPrintName());
                     detailData.setPrintName(nowInfo.getPrintName());
-                    if(haves.contains(nowInfo.getPrintField())){
+                    if (haves.contains(nowInfo.getPrintField())) {
                         detailData.setIsCheck(1);
                         detailData.setIsCheck(1);
-                    }else{
+                    } else {
                         detailData.setIsCheck(0);
                         detailData.setIsCheck(0);
                     }
                     }
                     data.getDetails().add(detailData);
                     data.getDetails().add(detailData);
@@ -495,9 +515,9 @@ public class PrintInfoController {
                     detailData.setId(nowInfo.getId());
                     detailData.setId(nowInfo.getId());
                     detailData.setPrintField(nowInfo.getPrintField());
                     detailData.setPrintField(nowInfo.getPrintField());
                     detailData.setPrintName(nowInfo.getPrintName());
                     detailData.setPrintName(nowInfo.getPrintName());
-                    if(haves.contains(nowInfo.getPrintField())){
+                    if (haves.contains(nowInfo.getPrintField())) {
                         detailData.setIsCheck(1);
                         detailData.setIsCheck(1);
-                    }else{
+                    } else {
                         detailData.setIsCheck(0);
                         detailData.setIsCheck(0);
                     }
                     }
                     details.add(detailData);
                     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<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());
                 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();
                     PrintModelDetailResult detailData = new PrintModelDetailResult();
                     detailData.setId(nowInfo.getId());
                     detailData.setId(nowInfo.getId());
                     detailData.setPrintField(nowInfo.getPrintField());
                     detailData.setPrintField(nowInfo.getPrintField());
                     detailData.setPrintName(nowInfo.getPrintName());
                     detailData.setPrintName(nowInfo.getPrintName());
-                    if(haves.contains(nowInfo.getPrintField())){
+                    if (haves.contains(nowInfo.getPrintField())) {
                         detailData.setIsCheck(1);
                         detailData.setIsCheck(1);
-                    }else{
+                    } else {
                         detailData.setIsCheck(0);
                         detailData.setIsCheck(0);
                     }
                     }
                     data.getDetails().add(detailData);
                     data.getDetails().add(detailData);
@@ -628,9 +648,9 @@ public class PrintInfoController {
     @GetMapping("testPrintInfo")
     @GetMapping("testPrintInfo")
     @ApiOperation("测试打印功能")
     @ApiOperation("测试打印功能")
     public Result testPrintInfo(String sn) {
     public Result testPrintInfo(String sn) {
-        log.info("进入打印:sn"+sn);
+        log.info("进入打印:sn" + sn);
         FeiYunUtils.testPrint(sn);
         FeiYunUtils.testPrint(sn);
-        log.info("打印结束:sn"+sn);
+        log.info("打印结束:sn" + sn);
         return Result.success();
         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();
+    }
+}

+ 7 - 0
src/main/java/com/sqx/modules/shop/controller/app/ShopMoneyController.java

@@ -180,4 +180,11 @@ public class ShopMoneyController extends AbstractController {
         return userMoneyDetailsService.selectShopCashDeposit(sysUserShop.getShopId(), page, limit, classify);
         return userMoneyDetailsService.selectShopCashDeposit(sysUserShop.getShopId(), page, limit, classify);
     }
     }
 
 
+    @GetMapping(value = "/accountEntryManagement")
+    @ApiOperation("入账管理")
+    public Result accountEntryManagement(Integer page, Integer limit,String shopName,String shopPhone,String userPhone,String couponName,String orderNumber,String startTime,String endTime){
+        PageUtils pageUtils = userMoneyDetailsService.accountEntryManagementDetails(page, limit, shopName, shopPhone, userPhone, couponName, orderNumber, startTime, endTime);
+        return Result.success().put("data", pageUtils);
+    }
+
 }
 }

+ 32 - 2
src/main/java/com/sqx/modules/utils/excel/ExportExcelUtils.java

@@ -1,13 +1,20 @@
 package com.sqx.modules.utils.excel;
 package com.sqx.modules.utils.excel;
 
 
+import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.ExcelWriter;
+import com.alibaba.excel.write.metadata.WriteSheet;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.xssf.usermodel.*;
 import org.apache.poi.xssf.usermodel.*;
 import org.apache.poi.xssf.usermodel.extensions.XSSFCellBorder;
 import org.apache.poi.xssf.usermodel.extensions.XSSFCellBorder;
 
 
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponse;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
 import java.io.OutputStream;
 import java.io.OutputStream;
 import java.net.URLEncoder;
 import java.net.URLEncoder;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
 
 
 /**
 /**
@@ -202,8 +209,31 @@ public class ExportExcelUtils {
         return new int[] { r, g, b };
         return new int[] { r, g, b };
     }
     }
 
 
+    public static void writeExcel2(ByteArrayOutputStream os,String fileName, ExcelData excelData) throws Exception {
+        // 文件输出位置
 
 
+        List<List<String>> headList=new ArrayList<>();
+        List<String> list=excelData.getTitles();
+        for (int i = 0; i < list.size(); i++) {
+            List<String> temList=new ArrayList<>();
+            temList.add(list.get(i));
+            headList.add(temList);
+        }
+        ExcelWriter excelWriter =null;
+        try {
 
 
-
-
+            excelWriter = EasyExcel.write(os).head(headList).build();
+            // 同一个sheet只要创建一次
+            WriteSheet writeSheet = EasyExcel.writerSheet("sheet1").build();
+            // 调用写入
+            excelWriter.write(excelData.getRows(), writeSheet);
+        } catch (Exception e) {
+            System.out.println("下载模板失败"+e.getMessage());
+        } finally {
+            // 关闭流
+            if (excelWriter != null) {
+                excelWriter.finish();
+            }
+        }
+    }
 }
 }

+ 37 - 4
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.alibaba.fastjson.JSONObject;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.ObjectMapper;
+import com.sqx.common.utils.Result;
 import com.sqx.modules.activity.service.ActivityService;
 import com.sqx.modules.activity.service.ActivityService;
 import com.sqx.modules.activity.vo.ActivityOrderVO;
 import com.sqx.modules.activity.vo.ActivityOrderVO;
 import com.sqx.modules.activity.vo.ActivityVO;
 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.goods.service.GoodsShopService;
 import com.sqx.modules.order.entity.OrderGoods;
 import com.sqx.modules.order.entity.OrderGoods;
 import com.sqx.modules.order.entity.TbOrder;
 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.entity.*;
+import com.sqx.modules.printInfo.service.PrintInfoDetailService;
 import com.sqx.modules.printInfo.service.PrintInfoService;
 import com.sqx.modules.printInfo.service.PrintInfoService;
 import com.sqx.modules.printInfo.service.PrintInfoShopService;
 import com.sqx.modules.printInfo.service.PrintInfoShopService;
 import com.sqx.modules.utils.fieYun.model.OrderForm;
 import com.sqx.modules.utils.fieYun.model.OrderForm;
@@ -60,6 +63,20 @@ public class FeiYunUtils {
 
 
     private static PrintInfoService printInfoService;
     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
     @Autowired
     public void setActivityService(ActivityService activityService) {
     public void setActivityService(ActivityService activityService) {
         FeiYunUtils.activityService = activityService;
         FeiYunUtils.activityService = activityService;
@@ -309,7 +326,7 @@ public class FeiYunUtils {
      * @return 成功:{"msg":"ok","ret":0,"data":"xxxxxxx_xxxxxxxx_xxxxxxxx","serverExecutedTime":5}
      * @return 成功:{"msg":"ok","ret":0,"data":"xxxxxxx_xxxxxxxx_xxxxxxxx","serverExecutedTime":5}
      * 失败:{"msg":"错误描述","ret":非0,"data":"null","serverExecutedTime":5}
      * 失败:{"msg":"错误描述","ret":非0,"data":"null","serverExecutedTime":5}
      */
      */
-    public static String print(String sn, Integer classify, TbOrder tbOrder) {
+    public static String print(String sn, Integer classify, TbOrder tbOrder, Integer isAppend) {
         try {
         try {
             //标签说明:
             //标签说明:
             //单标签:
             //单标签:
@@ -1493,7 +1510,7 @@ public class FeiYunUtils {
 
 
             String content = stringBuilder.toString();
             String content = stringBuilder.toString();
 
 
-            doRequest(sn, content);
+            doRequest(sn, content, tbOrder.getStatus(), isAppend,tbOrder.getOrderId());
 
 
         } catch (Exception e) {
         } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
@@ -1522,7 +1539,7 @@ public class FeiYunUtils {
             sb.append("<BR>");
             sb.append("<BR>");
             sb.append("<CUT>");
             sb.append("<CUT>");
 
 
-            doRequest(sn, sb.toString());
+            doRequest(sn, sb.toString(),5,null, tbOrder.getOrderId());
 
 
         } catch (Exception e) {
         } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
@@ -1531,7 +1548,7 @@ public class FeiYunUtils {
         return null;
         return null;
     }
     }
 
 
-    private static void doRequest(String sn, String content) {
+    private static void doRequest(String sn, String content, Integer status, Integer isAppend, Long orderId) {
         RequestConfig requestConfig = RequestConfig.custom()
         RequestConfig requestConfig = RequestConfig.custom()
                 .setSocketTimeout(30000)//读取超时
                 .setSocketTimeout(30000)//读取超时
                 .setConnectTimeout(30000)//连接超时
                 .setConnectTimeout(30000)//连接超时
@@ -1565,6 +1582,22 @@ public class FeiYunUtils {
                     result = EntityUtils.toString(httpentity);
                     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);
                 log.info("打印请求成功,打印机sn:{},打印内容:{},响应结果:{}", sn, content, result);
             } else {
             } else {
                 log.error("打印请求失败,响应码为:{}", stateCode);
                 log.error("打印请求失败,响应码为:{}", stateCode);

+ 5 - 0
src/main/java/com/sqx/scheduler/config/SchedulerLock.java

@@ -32,4 +32,9 @@ public interface SchedulerLock {
      * 跑腿订单自动推送锁
      * 跑腿订单自动推送锁
      */
      */
     String INDENT_AUTO_PUSH_LOCK = "wm:lock:indent:push";
     String INDENT_AUTO_PUSH_LOCK = "wm:lock:indent:push";
+
+    /**
+     * 导出锁
+     */
+    String EXPORT_LOCK = "export:lock";
 }
 }

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

@@ -0,0 +1,287 @@
+package com.sqx.scheduler.export;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.sqx.common.utils.SftpUtil;
+import com.sqx.modules.app.entity.RechargeRecord;
+import com.sqx.modules.app.service.RechargeRecordService;
+import com.sqx.modules.app.service.UserMoneyDetailsService;
+import com.sqx.modules.common.service.CommonInfoService;
+import com.sqx.modules.datacentre.query.ShopCenterQuery;
+import com.sqx.modules.datacentre.service.DataCentreService;
+import com.sqx.modules.exportExecl.dto.AccountEntry;
+import com.sqx.modules.exportExecl.model.ExportJob;
+import com.sqx.modules.exportExecl.service.ExportJobService;
+import com.sqx.modules.order.service.AppOrderService;
+import com.sqx.modules.pay.controller.query.CashOutQueryDTO;
+import com.sqx.modules.pay.controller.query.WalletDetailQuery;
+import com.sqx.modules.pay.service.CashOutService;
+import com.sqx.modules.utils.excel.ExcelData;
+import com.sqx.modules.utils.excel.ExportExcelUtils;
+import com.sqx.scheduler.config.SchedulerLock;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.redisson.api.RLock;
+import org.redisson.api.RedissonClient;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+import org.springframework.util.StringUtils;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * 优惠券定时任务
+ *
+ * @author : codingliang
+ * @date : 2024-09-09 12:22
+ */
+@Slf4j
+@Component
+@RequiredArgsConstructor
+@RequestMapping("/admin/aaaaaa")
+public class ExportScheduler {
+
+    private final CommonInfoService commonInfoService;
+    private final RedissonClient redissonClient;
+    private final RedisTemplate redisTemplate;
+    private final ExportJobService exportJobService;
+    private final AppOrderService appOrderService;
+    private final RechargeRecordService rechargeRecordService;
+    private final SftpUtil sftpUtil;
+    private final CashOutService cashOutService;
+    private final UserMoneyDetailsService userMoneyDetailsService;
+    private final DataCentreService dataCentreService;
+
+
+    /**
+     * 将所有超过失效时间的优惠券改为失效状态
+     * 每分钟运行一次
+     */
+    @Async
+    @Scheduled(cron = "18 */1 * * * ?", zone = "Asia/Shanghai")
+//    @GetMapping("excelOrder")
+    public void orderExport() throws Exception {
+        List<ExportJob> exportJobList=exportJobService.list(new QueryWrapper<ExportJob>()
+                .eq("flag",0).last("order by create_time limit 10"));
+        log.info("本次导出数据exportJobList==========="+exportJobList);
+        if (null == exportJobList ||exportJobList.isEmpty()){
+            return;
+        }
+        int runningCount =exportJobService.count(new QueryWrapper<ExportJob>().eq("flag",-1));
+        if (runningCount>=4){
+            //同时执行的任务超过4条,不再新增任务
+            return;
+        }
+        for(ExportJob exportJob:exportJobList){
+            long bgTime = System.currentTimeMillis();
+            String jobExecuteKey = SchedulerLock.EXPORT_LOCK + ":" + exportJob.getExportId();
+            String jobExecuteRedisKey = SchedulerLock.EXPORT_LOCK +":R:" + exportJob.getExportId();
+            RLock lock = redissonClient.getLock(jobExecuteKey);
+            if (lock.tryLock(0, 5, TimeUnit.SECONDS)) {
+                boolean isRedisKey = redisTemplate.hasKey(jobExecuteRedisKey);
+                //rediskey避免重复导出
+                if(isRedisKey){
+                    log.info(exportJob.getExportId()+"已执行,跳过");
+                    continue;
+                }
+                redisTemplate.opsForValue().set(jobExecuteRedisKey, "LOCK", 5, TimeUnit.MINUTES);
+                //设置为执行中
+                exportJob.setFlag(-1);
+                exportJob.setUpdateTime(new Date());
+                exportJobService.updateById(exportJob);
+                String fileName=exportJob.getFileName();
+                String fileType=exportJob.getFileType();
+                InputStream inputStream=null;
+                ByteArrayOutputStream os = new ByteArrayOutputStream();
+                try {
+                    ExcelData excelData=new ExcelData();
+                    if("order".equals(fileType)){
+                        excelData=getOrderExcelData(exportJob);
+                    }else if("recharge".equals(fileType)){
+                        excelData=getRechargeOrderExcelData(exportJob);
+                    }else if("payouts".equals(fileType)){
+                        excelData=getPayoutsExcelData(exportJob);
+                    }else if("deposit".equals(fileType)){
+                        excelData=getDepositExcelData(exportJob);
+                    }else if("shopCenter".equals(fileType)){
+                        excelData=getShopCenterExcelData(exportJob);
+                    }else if("accountEntry".equals(fileType)){
+                        excelData=getAccountEntryExcelData(exportJob);
+                    }else{
+                        continue;
+                    }
+                    String value=commonInfoService.findOne(430).getValue();
+                    ExportExcelUtils.writeExcel2(os,fileName,excelData);
+                    byte[] buffer = os.toByteArray();
+                    inputStream = new ByteArrayInputStream(buffer);
+                    double fileSize = os.size();
+                    double fileSizeKB = new BigDecimal(fileSize/1024).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); //转换单位为KB
+                    exportJob.setFileSize(String.valueOf(fileSizeKB));
+                    exportJob.setFlag(1);
+                    exportJob.setUpdateTime(new Date());
+                    sftpUtil.login();
+                    sftpUtil.upload(value,fileName,inputStream);
+                    exportJobService.updateById(exportJob);
+                } catch (Exception e) {
+                    exportJob.setUpdateTime(new Date());
+                    exportJob.setFlag(2);
+                    exportJobService.updateById(exportJob);
+                    log.error(e.toString());
+                } finally {
+                    try {
+                        if (lock.isLocked()) {
+                            lock.unlock();
+                        }
+                        if(os!=null){
+                            os.close();
+                        }
+                        if(inputStream!=null){
+                            inputStream.close();
+                        }
+                        if(sftpUtil.isConnected()){
+                            sftpUtil.logout();
+                        }
+                    } catch (RuntimeException re) {
+                        log.error("报表解锁失败");
+                    }
+                }
+            }
+            long edTime = System.currentTimeMillis();
+            log.info("执行:通用数据导出定时任务"+exportJob.getExportId()+"......执行任务完成,执行时长:{} s", (edTime - bgTime) / 1000);
+        }
+    }
+
+    //订单导出
+    private ExcelData getOrderExcelData(ExportJob exportJob){
+        String[] conditions=exportJob.getConditions().split(",",-1);
+        Integer status=null;
+        if(!"".equals(conditions[1])){
+            status= Integer.valueOf(conditions[1]);
+        }
+        String phone=conditions[2];
+        Long shopId=null;
+        if(!"".equals(conditions[3])){
+            shopId= Long.valueOf(conditions[3]);
+        }
+        String userName=conditions[4];
+        String orderNumber=conditions[5];
+
+        Integer orderType=null;
+        if(!"".equals(conditions[6])){
+            orderType= Integer.valueOf(conditions[6]);
+        }
+        String shopName=conditions[7];
+        String riderPhone=conditions[8];
+        String startTime=conditions[9];
+        String endTime=conditions[10];
+        String payStartTime=conditions[11];
+        String payEndTime=conditions[12];
+
+        return appOrderService.excelAllOrderAdmin(status, phone, shopId, userName, orderNumber, orderType, shopName, riderPhone, startTime, endTime,payStartTime,payEndTime);
+    }
+
+    //充值记录导出
+    private ExcelData getRechargeOrderExcelData(ExportJob exportJob){
+        String[] conditions=exportJob.getConditions().split(",",-1);
+        String rechargeOrder=conditions[1];
+        String acount=conditions[2];
+        QueryWrapper<RechargeRecord> qw=new QueryWrapper<RechargeRecord>();
+        if(StringUtils.hasText(rechargeOrder)){
+            qw.eq("order_no",rechargeOrder);
+        }
+        if(StringUtils.hasText(acount)){
+            qw.eq("user_phone",acount);
+        }
+        ExcelData data = new ExcelData();
+        data.setName("订单列表");
+        List<String> titles = new ArrayList<>();
+        titles.add("用户id");titles.add("编号");titles.add("充值金额");titles.add("充值前余额");
+        titles.add("充值后余额"); titles.add("被充值账号(手机号)");titles.add("被充值名称");titles.add("被充值昵称");
+        titles.add("被充值头像"); titles.add("更新时间");titles.add("充值时间");titles.add("充值人账号");
+        titles.add("备注");
+        data.setTitles(titles);
+        List<RechargeRecord> recordList=rechargeRecordService.list(qw);
+        List<List<Object>> rows = new ArrayList<>();
+        for (RechargeRecord record:recordList){
+            List<Object> row = new ArrayList<>();
+            row.add(record.getUserId());
+            row.add(record.getOrderNo());
+            row.add(record.getAmount());
+            row.add(record.getOldMoney());
+            row.add(record.getBalance());
+            row.add(record.getUserPhone());
+            row.add(record.getUserName());
+            row.add(record.getUserNick());
+            row.add(record.getUserAvatar());
+            row.add(record.getUpdateTime());
+            row.add(record.getCreateTime());
+            row.add(record.getAccount());
+            row.add(record.getRemark());
+            rows.add(row);
+        }
+        data.setRows(rows);
+        return data;
+    }
+
+    //提现管理导出
+    private ExcelData getPayoutsExcelData(ExportJob exportJob){
+        String[] conditions=exportJob.getConditions().split(",",-1);
+        CashOutQueryDTO queryDTO =new CashOutQueryDTO();
+        queryDTO.setZhifubaoName(conditions[1]);
+        queryDTO.setZhifubao(conditions[2]);
+        queryDTO.setShopName(conditions[3]);
+        if(!"".equals(conditions[4])){
+            queryDTO.setState(Integer.valueOf(conditions[4]));
+        }
+        queryDTO.setType(conditions[5]);
+        queryDTO.setStartTime(conditions[6]);
+        queryDTO.setEndTime(conditions[7]);
+        return cashOutService.excelPayDetails(queryDTO);
+    }
+
+    //导出保证金记录
+    private ExcelData getDepositExcelData(ExportJob exportJob){
+        String[] conditions=exportJob.getConditions().split(",",-1);
+        WalletDetailQuery queryDTO =new WalletDetailQuery();
+        queryDTO.setShopName(conditions[1]);
+        queryDTO.setType(conditions[2]);
+        queryDTO.setClassify(conditions[3]);
+        queryDTO.setStartTime(conditions[4]);
+        queryDTO.setEndTime(conditions[5]);
+
+        return userMoneyDetailsService.excelWalletDetails(queryDTO);
+    }
+
+    //导出商铺收益排行
+    private ExcelData getShopCenterExcelData(ExportJob exportJob){
+        String[] conditions=exportJob.getConditions().split(",",-1);
+        ShopCenterQuery query =new ShopCenterQuery();
+        query.setShopType(conditions[3]);
+        query.setStartTime(conditions[1]);
+        query.setEndTime(conditions[2]);
+        query.setDate(conditions[4]);
+        query.setDateType(conditions[5]);
+        return dataCentreService.excelShopCenter(query);
+    }
+    private ExcelData getAccountEntryExcelData(ExportJob exportJob) {
+        String[] conditions=exportJob.getConditions().split(",",-1);
+        AccountEntry query =new AccountEntry();
+        query.setShopName(conditions[1]);
+        query.setShopPhone(conditions[2]);
+        query.setUserPhone(conditions[3]);
+        query.setCouponName(conditions[4]);
+        query.setOrderNumber(conditions[5]);
+        query.setStartTime(conditions[6]);
+        query.setEndTime(conditions[7]);
+        return userMoneyDetailsService.excelAccountEntry(query);
+    }
+}

+ 39 - 0
src/main/resources/application-dev.yml

@@ -108,6 +108,45 @@ secure-api:
 
 
 mp:
 mp:
     temp: true
     temp: true
+sftp:
+    username: export
+    password: Waimai2024#
+    host: 172.16.20.108
+    port: 22
+
+dynamic:
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    url: jdbc:mysql://172.16.20.104:3306/tcwm2.5?useUnicode=true&characterEncoding=utf-8&useSSL=false&rewriteBatchedStatements=true&serverTimezone=CTT
+#    url: jdbc:mysql://172.16.20.108:3306/tcwm2.5?useUnicode=true&characterEncoding=utf-8&useSSL=false&rewriteBatchedStatements=true&serverTimezone=CTT
+    username: root
+    password: ch@2025.wm
+#    password: chuanghai@2024
+    initial-size: 15
+    max-active: 100
+    min-idle: 10
+    max-wait: 60000
+    pool-prepared-statements: true
+    max-pool-prepared-statement-per-connection-size: 20
+    time-between-eviction-runs-millis: 60000
+    min-evictable-idle-time-millis: 300000
+    #Oracle需要打开注释
+    #validation-query: SELECT 1 FROM DUAL
+    test-while-idle: true
+    test-on-borrow: false
+    test-on-return: false
+    stat-view-servlet:
+        enabled: true
+        url-pattern: /druid/*
+        #login-username: admin
+        #login-password: admin
+    filter:
+        stat:
+            log-slow-sql: true
+            slow-sql-millis: 1000
+            merge-sql: false
+        wall:
+            config:
+                multi-statement-allow: true
 
 
 # minio配置
 # minio配置
 minio:
 minio:

+ 39 - 0
src/main/resources/application-prod.yml

@@ -109,6 +109,45 @@ secure-api:
 
 
 mp:
 mp:
     temp: false
     temp: false
+sftp:
+    username: export
+    password: Waimai2024#
+    host: 172.16.20.105
+    port: 22
+#查询备用数据库
+dynamic:
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    url: jdbc:mysql://172.16.20.104:3306/tcwm2.5?useUnicode=true&characterEncoding=utf-8&useSSL=false&rewriteBatchedStatements=true&serverTimezone=CTT
+    #    url: jdbc:mysql://172.16.20.108:3306/tcwm2.5?useUnicode=true&characterEncoding=utf-8&useSSL=false&rewriteBatchedStatements=true&serverTimezone=CTT
+    username: root
+    password: ch@2025.wm
+    #    password: chuanghai@2024
+    initial-size: 15
+    max-active: 100
+    min-idle: 10
+    max-wait: 60000
+    pool-prepared-statements: true
+    max-pool-prepared-statement-per-connection-size: 20
+    time-between-eviction-runs-millis: 60000
+    min-evictable-idle-time-millis: 300000
+    #Oracle需要打开注释
+    #validation-query: SELECT 1 FROM DUAL
+    test-while-idle: true
+    test-on-borrow: false
+    test-on-return: false
+    stat-view-servlet:
+        enabled: true
+        url-pattern: /druid/*
+        #login-username: admin
+        #login-password: admin
+    filter:
+        stat:
+            log-slow-sql: true
+            slow-sql-millis: 1000
+            merge-sql: false
+        wall:
+            config:
+                multi-statement-allow: true
 
 
 # minio配置
 # minio配置
 minio:
 minio:

+ 144 - 63
src/main/resources/mapper/dataCentre/dataCenterMapper.xml

@@ -61,14 +61,20 @@
     <select id="selectPayOrderAnalyze" resultType="com.sqx.modules.order.entity.TbOrder">
     <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
         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
         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>
-        <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>
-        <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>
         </if>
         order by tor.pay_time desc
         order by tor.pay_time desc
     </select>
     </select>
@@ -186,14 +192,20 @@
 
 
     <select id="selectNewShopCount" resultType="int">
     <select id="selectNewShopCount" resultType="int">
         select count(*) from goods_shop where 1 = 1
         select count(*) from goods_shop 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>
-        <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>
-        <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.endTime != null and query.endTime != ''">
+            and create_time <![CDATA[<=]]> #{query.endTime}
+        </if>
+        <if test="query.startTime != null and query.startTime != ''">
+            and create_time >= #{query.startTime}
         </if>
         </if>
     </select>
     </select>
 
 
@@ -203,17 +215,50 @@
         @rank_num := @rank_num + 1 AS rankNum
         @rank_num := @rank_num + 1 AS rankNum
         FROM
         FROM
         ( SELECT @rank_num := 0 ) r,
         ( SELECT @rank_num := 0 ) r,
-        ( SELECT ifnull( sum( pay_money ), 0 ) AS shopMoney, tor.shop_id , u.shop_name
+        ( SELECT ifnull( sum( pay_money ), 0 ) AS shopMoney, tor.shop_id , u.shop_name,gp.id as shopType,gp.shop_type_name as shopTypeName
         FROM tb_order tor left join goods_shop u on tor.shop_id = u.shop_id
         FROM tb_order tor left join goods_shop u on tor.shop_id = u.shop_id
+        left join shop_type gp on  gp.id=u.shop_type_id
         WHERE tor.shop_id IS NOT NULL and tor.status = 4
         WHERE tor.shop_id IS NOT NULL and tor.status = 4
-        <if test="dateType=='day'">
-            and date_format(tor.pay_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
+        <if test="query.startTime != null and query.startTime !=''">
+            and tor.pay_time >= #{query.startTime}
         </if>
         </if>
-        <if test="dateType=='month'">
-            and date_format(tor.pay_time,'%Y-%m')=date_format(#{date},'%Y-%m')
+        <if test="query.endTime != null and query.endTime != ''">
+            and tor.pay_time <![CDATA[<=]]> #{query.endTime}
         </if>
         </if>
-        <if test="dateType=='year'">
-            and date_format(tor.pay_time,'%Y')=date_format(#{date},'%Y')
+        <if test="query.shopType != null and query.shopType != '' ">
+            and gp.id = #{query.shopType}
+        </if>
+        <if test="query.dateType=='day'">
+            and date_format(tor.pay_time,'%Y-%m-%d')=date_format(#{query.date},'%Y-%m-%d')
+        </if>
+        <if test="query.dateType=='month'">
+            and date_format(tor.pay_time,'%Y-%m')=date_format(#{query.date},'%Y-%m')
+        </if>
+        <if test="query.dateType=='year'">
+            and date_format(tor.pay_time,'%Y')=date_format(#{query.date},'%Y')
+        </if>
+        GROUP BY tor.shop_id ) a
+        ORDER BY shopMoney DESC
+    </select>
+
+    <select id="excelShopCenter" resultType="com.sqx.modules.order.entity.TbOrder">
+        SELECT
+        *,
+        @rank_num := @rank_num + 1 AS Rank
+        FROM
+        ( SELECT @rank_num := 0 ) r,
+        ( SELECT ifnull( sum( pay_money ), 0 ) AS shopMoney, tor.shop_id , u.shop_name,gp.id as shopType,gp.shop_type_name as shopTypeName
+        FROM tb_order tor left join goods_shop u on tor.shop_id = u.shop_id
+        left join shop_type gp on  gp.id=u.shop_type_id
+        WHERE tor.shop_id IS NOT NULL and tor.status = 4
+        <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>
+        <if test="query.shopType != null and query.shopType != '' ">
+            and gp.id = #{query.shopType}
         </if>
         </if>
         GROUP BY tor.shop_id ) a
         GROUP BY tor.shop_id ) a
         ORDER BY shopMoney DESC
         ORDER BY shopMoney DESC
@@ -221,27 +266,39 @@
 
 
     <select id="allUserCount" resultType="int">
     <select id="allUserCount" resultType="int">
         select count(*) from tb_user where status = 1
         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>
-        <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>
-        <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>
         </if>
     </select>
     </select>
 
 
     <select id="phoneUserCount" resultType="int">
     <select id="phoneUserCount" resultType="int">
         select count(*) from tb_user where status = 1 and phone is not null
         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>
-        <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>
-        <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>
         </if>
     </select>
     </select>
 
 
@@ -379,17 +436,23 @@
         select count(*) from tb_order
         select count(*) from tb_order
         where order_type = #{orderType}
         where order_type = #{orderType}
         and is_pay=1 and status in (0,3,4,7,6)
         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>
-        <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>
-        <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>
-        <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>
         </if>
     </select>
     </select>
 
 
@@ -397,49 +460,67 @@
         select ifnull(sum(pay_money), 0) from tb_order
         select ifnull(sum(pay_money), 0) from tb_order
         where order_type = #{orderType}
         where order_type = #{orderType}
         and is_pay=1 and status in (0,3,4,7,6)
         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>
-        <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>
-        <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>
-        <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>
         </if>
     </select>
     </select>
 
 
     <select id="cancelOrderCount" resultType="int">
     <select id="cancelOrderCount" resultType="int">
         select count(*) from tb_order where status = 5
         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>
-        <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>
-        <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>
-        <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>
         </if>
     </select>
     </select>
 
 
     <select id="cancelOrderMoney" resultType="java.math.BigDecimal">
     <select id="cancelOrderMoney" resultType="java.math.BigDecimal">
         select ifnull(sum(pay_money), 0) from tb_order where status = 5
         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>
-        <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>
-        <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>
-        <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>
         </if>
     </select>
     </select>
 
 

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

@@ -62,14 +62,20 @@
 
 
     <select id="deductMoneySum" resultType="java.math.BigDecimal">
     <select id="deductMoneySum" resultType="java.math.BigDecimal">
         select ifnull(sum(deduct_money), 0) from errand_complaint where 1 = 1
         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>
-        <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>
-        <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>
         </if>
         and complaint_state = 3
         and complaint_state = 3
     </select>
     </select>

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

@@ -516,54 +516,78 @@
 
 
     <select id="billMoney" resultType="java.math.BigDecimal">
     <select id="billMoney" resultType="java.math.BigDecimal">
         select ifnull(sum(indent_money),0) from tb_indent where indent_state in (2, 3, 4, 6)
         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>
-        <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>
-        <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>
         </if>
     </select>
     </select>
 
 
     <select id="receivingMoney" resultType="java.math.BigDecimal">
     <select id="receivingMoney" resultType="java.math.BigDecimal">
         select ifnull(sum(indent_money),0) from tb_indent where indent_state in (3, 4, 6)
         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>
-        <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>
-        <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>
         </if>
     </select>
     </select>
 
 
     <select id="billCount" resultType="int">
     <select id="billCount" resultType="int">
         select count(*) from tb_indent
         select count(*) from tb_indent
         where indent_state in (2, 3, 4, 6)
         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>
-        <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>
-        <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>
         </if>
     </select>
     </select>
 
 
     <select id="reveivingCount" resultType="int">
     <select id="reveivingCount" resultType="int">
         select count(*) from tb_indent where indent_state in (3, 4, 6)
         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>
-        <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>
-        <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>
         </if>
     </select>
     </select>
 
 
@@ -573,18 +597,24 @@
         left join tb_user t on s.user_id = t.user_id
         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
         left join tb_user u on s.rider_user_id = u.user_id
         where indent_state = "6"
         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>
-        <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>
-        <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>
         <if test="indentState!=null and indentState!=''">
         <if test="indentState!=null and indentState!=''">
             and s.indent_state = #{status}
             and s.indent_state = #{status}
         </if>
         </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
         order by s.create_time desc
     </select>
     </select>
 
 
@@ -647,14 +677,20 @@
         <if test="status!=null">
         <if test="status!=null">
             and indent_state = #{status}
             and indent_state = #{status}
         </if>
         </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>
-        <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>
-        <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>
         </if>
     </select>
     </select>
 
 

+ 87 - 18
src/main/resources/mapper/order/OrderMapper.xml

@@ -149,7 +149,7 @@
         shopPhone,
         shopPhone,
         tiu.nick_name as riderNickName,tiu.phone as riderPhone,ti.indent_id as indentId,ti.is_rider as isRider,
         tiu.nick_name as riderNickName,tiu.phone as riderPhone,ti.indent_id as indentId,ti.is_rider as isRider,
         ti.rider_user_id as riderUserId, tcu.money as couponMoney,
         ti.rider_user_id as riderUserId, tcu.money as couponMoney,
-        apr.discount_amount as activityDiscountAmount, ai.title activityTitle
+        apr.discount_amount as activityDiscountAmount, ai.title activityTitle,ogg.detail,ogg.sumPrice
         from tb_order tor
         from tb_order tor
         left join tb_user tu on tor.user_id = tu.user_id
         left join tb_user tu on tor.user_id = tu.user_id
         left join goods_shop gs on tor.shop_id = gs.shop_id
         left join goods_shop gs on tor.shop_id = gs.shop_id
@@ -158,6 +158,8 @@
         left join tb_coupon_user tcu on tor.coupon_id = tcu.id
         left join tb_coupon_user tcu on tor.coupon_id = tcu.id
         left join activity_part_record apr on apr.order_id = tor.order_id
         left join activity_part_record apr on apr.order_id = tor.order_id
         left join activity ai on ai.id = apr.activity_id
         left join activity ai on ai.id = apr.activity_id
+        left join (  select @a:=0,order_id ,group_concat(@a:=@a+1,".商品名:",goods_name,",数量:",goods_num,",规格:",sku_message) detail,sum(goods_num*goods_price) sumPrice  from order_goods og group by order_id
+        ) ogg on ogg.order_id =tor.order_id
         where 1 = 1
         where 1 = 1
         <if test="riderPhone!=null and riderPhone!=''">
         <if test="riderPhone!=null and riderPhone!=''">
             and tiu.phone =#{riderPhone}
             and tiu.phone =#{riderPhone}
@@ -184,7 +186,56 @@
             and tor.shop_id = #{shopId}
             and tor.shop_id = #{shopId}
         </if>
         </if>
         <if test="orderType!=null">
         <if test="orderType!=null">
-            and tor.order_type = #{orderType}
+            and tor.order_type_extra = #{orderType}
+        </if>
+        <if test="startTime!=null and startTime!=''">
+            and date_format(tor.create_time,'%Y-%m-%d') >= date_format(#{startTime},'%Y-%m-%d')
+        </if>
+        <if test="endTime!=null and endTime!='' ">
+            and date_format(tor.create_time,'%Y-%m-%d') &lt;= date_format(#{endTime},'%Y-%m-%d')
+        </if>
+        <if test="payStartTime != null and payStartTime != ''">
+            and date_format(tor.pay_time,'%Y-%m-%d') >= date_format(#{payStartTime},'%Y-%m-%d')
+        </if>
+        <if test="payEndTime != null and payEndTime != '' ">
+            and date_format(tor.pay_time,'%Y-%m-%d') &lt;= date_format(#{payEndTime},'%Y-%m-%d')
+        </if>
+        order by tor.pay_time desc, tor.create_time desc
+    </select>
+
+    <select id="excelAllOrderAdminCount" resultType="java.lang.Integer">
+        select count(1) from tb_order tor
+        left join tb_user tu on tor.user_id = tu.user_id
+        left join goods_shop gs on tor.shop_id = gs.shop_id
+        left join tb_indent ti on tor.order_id = ti.order_id
+        left join tb_user tiu on tiu.user_id = ti.rider_user_id
+        where 1 = 1
+        <if test="riderPhone!=null and riderPhone!=''">
+            and tiu.phone =#{riderPhone}
+        </if>
+        <if test="shopName!=null and shopName!=''">
+            and gs.shop_name like concat('%',#{shopName},'%')
+        </if>
+        <if test="userName!=null and userName!=''">
+            and tor.user_name like concat('%',#{userName},'%')
+        </if>
+        <if test="phone!=null and phone!=''">
+            and tor.phone like concat('%',#{phone},'%')
+        </if>
+        <if test="orderNumber!=null and orderNumber!=''">
+            and tor.order_number = #{orderNumber}
+        </if>
+        <if test="status!=null and status!=-1 and status!=1">
+            and tor.status = #{status}
+        </if>
+        <if test="status!=null and status==1">
+            and tor.status in (1,2)
+        </if>
+        <if test="shopId!=null">
+            and tor.shop_id = #{shopId}
+        </if>
+        <if test="orderType!=null">
+            and tor.order_type_extra = #{orderType}
         </if>
         </if>
         <if test="startTime!=null and startTime!=''">
         <if test="startTime!=null and startTime!=''">
             and date_format(tor.create_time,'%Y-%m-%d') >= date_format(#{startTime},'%Y-%m-%d')
             and date_format(tor.create_time,'%Y-%m-%d') >= date_format(#{startTime},'%Y-%m-%d')
@@ -192,6 +243,12 @@
         <if test="endTime!=null and endTime!='' ">
         <if test="endTime!=null and endTime!='' ">
             and date_format(tor.create_time,'%Y-%m-%d') &lt;= date_format(#{endTime},'%Y-%m-%d')
             and date_format(tor.create_time,'%Y-%m-%d') &lt;= date_format(#{endTime},'%Y-%m-%d')
         </if>
         </if>
+        <if test="payStartTime != null and payStartTime != ''">
+            and date_format(tor.pay_time,'%Y-%m-%d') >= date_format(#{payStartTime},'%Y-%m-%d')
+        </if>
+        <if test="payEndTime != null and payEndTime != '' ">
+            and date_format(tor.pay_time,'%Y-%m-%d') &lt;= date_format(#{payEndTime},'%Y-%m-%d')
+        </if>
         order by tor.pay_time desc, tor.create_time desc
         order by tor.pay_time desc, tor.create_time desc
     </select>
     </select>
 
 
@@ -307,33 +364,45 @@
 
 
     <select id="selectSumMoney" resultType="java.math.BigDecimal">
     <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)
         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>
-        <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>
-        <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>
-        <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>
         </if>
     </select>
     </select>
 
 
     <select id="selectCountOrder" resultType="int">
     <select id="selectCountOrder" resultType="int">
         select count(*) from tb_order where is_pay=1 and status in (0,3,4,7,6)
         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>
-        <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>
-        <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>
-        <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>
         </if>
     </select>
     </select>
 
 

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

@@ -189,42 +189,60 @@
 
 
     <select id="cargoInsurance" resultType="java.math.BigDecimal">
     <select id="cargoInsurance" resultType="java.math.BigDecimal">
         select ifnull(sum(cargo_insurance), 0) from tb_indent where 1 = 1
         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>
-        <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>
-        <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>
         </if>
         and indent_state =6
         and indent_state =6
     </select>
     </select>
 
 
     <select id="MoneySumByIndentType" resultType="java.math.BigDecimal">
     <select id="MoneySumByIndentType" resultType="java.math.BigDecimal">
         select ifnull(sum(platform_money), 0) from tb_indent where 1 = 1
         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>
-        <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>
-        <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>
         </if>
         and indent_state = 6 and indent_type = #{indentType}
         and indent_state = 6 and indent_type = #{indentType}
     </select>
     </select>
 
 
     <select id="cashDepositMoney" resultType="java.math.BigDecimal">
     <select id="cashDepositMoney" resultType="java.math.BigDecimal">
         select ifnull(sum(money), 0) from pay_details where 1 = 1
         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>
-        <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>
-        <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>
         </if>
         and type = 3 and state = 1
         and type = 3 and state = 1
     </select>
     </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>

+ 268 - 28
src/main/resources/mapper/userMoney/UserMoneyDetailsMapper.xml

@@ -3,16 +3,27 @@
 <mapper namespace="com.sqx.modules.app.dao.UserMoneyDetailsDao">
 <mapper namespace="com.sqx.modules.app.dao.UserMoneyDetailsDao">
 
 
     <select id="selectUserMoneyDetails" resultType="com.sqx.modules.app.entity.UserMoneyDetails">
     <select id="selectUserMoneyDetails" resultType="com.sqx.modules.app.entity.UserMoneyDetails">
-        select * from user_money_details where user_id = #{userId} and classify = #{classify} order by create_time desc
+        select *
+        from user_money_details
+        where user_id = #{userId}
+          and classify = #{classify}
+        order by create_time desc
     </select>
     </select>
 
 
     <select id="selectShopCashDeposit" resultType="com.sqx.modules.app.entity.UserMoneyDetails">
     <select id="selectShopCashDeposit" resultType="com.sqx.modules.app.entity.UserMoneyDetails">
-        select * from user_money_details where shop_id = #{shopId} and classify = #{classify}
+        select *
+        from user_money_details
+        where shop_id = #{shopId}
+          and classify = #{classify}
         order by create_time desc
         order by create_time desc
     </select>
     </select>
 
 
     <select id="selectShopCashDepositList" resultType="com.sqx.modules.app.entity.UserMoneyDetails">
     <select id="selectShopCashDepositList" resultType="com.sqx.modules.app.entity.UserMoneyDetails">
-        select * from user_money_details where shop_id = #{shopId} and classify = 2 order by create_time desc
+        select *
+        from user_money_details
+        where shop_id = #{shopId}
+          and classify = 2
+        order by create_time desc
     </select>
     </select>
 
 
     <sql id="walletQueryCondition">
     <sql id="walletQueryCondition">
@@ -29,48 +40,277 @@
                 and umd.classify = #{query.classify}
                 and umd.classify = #{query.classify}
             </if>
             </if>
 
 
-            <if test="query.startTime != null">
+            <if test="query.startTime != null and query.startTime != ''">
                 and umd.create_time >= #{query.startTime}
                 and umd.create_time >= #{query.startTime}
             </if>
             </if>
 
 
-            <if test="query.endTime != null">
+            <if test="query.endTime != null and query.endTime != ''">
                 and umd.create_time <![CDATA[<=]]> #{query.endTime}</if>
                 and umd.create_time <![CDATA[<=]]> #{query.endTime}</if>
         </where>
         </where>
     </sql>
     </sql>
 
 
     <select id="walletDetailList" resultType="com.sqx.modules.pay.vo.WalletDetailVO">
     <select id="walletDetailList" resultType="com.sqx.modules.pay.vo.WalletDetailVO">
         select
         select
-            umd.id,
-            gs.shop_name,
-            umd.title,
-            umd.content,
-            umd.type,
-            umd.classify,
-            umd.money,
-            umd.create_time
+        umd.id,
+        gs.shop_name,
+        umd.title,
+        umd.content,
+        umd.type,
+        umd.classify,
+        umd.money,
+        umd.create_time
+        from
+        user_money_details umd
+        left join goods_shop gs on gs.shop_id = umd.shop_id
+        <include refid="walletQueryCondition"></include>
+        order by umd.create_time desc
+    </select>
+
+    <select id="excelWalletDetails" resultType="com.sqx.modules.pay.vo.WalletDetailVO">
+        select
+        umd.id,
+        gs.shop_name,
+        umd.title,
+        umd.content,
+        umd.type,
+        umd.classify,
+        umd.money,
+        umd.create_time
         from
         from
-            user_money_details umd
-            left join goods_shop gs on gs.shop_id = umd.shop_id
+        user_money_details umd
+        left join goods_shop gs on gs.shop_id = umd.shop_id
         <include refid="walletQueryCondition"></include>
         <include refid="walletQueryCondition"></include>
         order by umd.create_time desc
         order by umd.create_time desc
     </select>
     </select>
 
 
     <select id="walletDetailStatistics" resultType="java.math.BigDecimal">
     <select id="walletDetailStatistics" resultType="java.math.BigDecimal">
         select
         select
-            sum(o.amount)
+        sum(o.amount)
         from
         from
-            (
-                select
-                    case
-                        when umd.type = 1 then umd.money
-                        else -umd.money
-                    end as amount
-                from
-                    user_money_details umd
-                left join goods_shop gs on gs.shop_id = umd.shop_id
-                <include refid="walletQueryCondition"></include>
-                order by umd.create_time desc
-            ) o
+        (
+        select
+        case
+        when umd.type = 1 then umd.money
+        else -umd.money
+        end as amount
+        from
+        user_money_details umd
+        left join goods_shop gs on gs.shop_id = umd.shop_id
+        <include refid="walletQueryCondition"></include>
+        order by umd.create_time desc
+        ) o
+    </select>
+
+    <select id="accountEntryManagementDetailsList" resultType="com.sqx.modules.app.entity.UserMoneyDetails">
+        SELECT
+        umd2.id,
+        umd2.orderNumber,
+        umd2.user_id as userId,
+        umd2.shop_id as shopId,
+        umd2.title,
+        umd2.content,
+        umd2.type,
+        umd2.classify,
+        umd2.money,
+        umd2.create_time as createTime,
+        umd2.state,
+        tbu.user_name as userName,
+        tbu.phone as userPhone,
+        gs.shop_name as shopName,
+        gs.phone as shopPhone,
+        tcu.coupon_name as couponName,
+        tcu.money as couponMoney,
+        apr.discount_amount as activityDiscountAmount,
+        tbo.errand_money as errandMoney
+        FROM
+        (
+        SELECT
+        RIGHT( umd.title, 18 ) AS orderNumber,
+        umd.id,
+        umd.user_id,
+        umd.shop_id,
+        umd.title,
+        umd.content,
+        umd.type,
+        umd.classify,
+        umd.money,
+        umd.create_time,
+        umd.state,
+        umd.children_id
+        FROM
+        `user_money_details` umd
+        WHERE
+        umd.type = 1
+        AND umd.classify = 3
+        AND umd.shop_id IS NOT NULL
+        AND umd.state=2
+        AND umd.title LIKE '商户订单收入' '%'
+        ) umd2
+        LEFT JOIN tb_order tbo on tbo.order_number=umd2.orderNumber
+        LEFT JOIN tb_user tbu on tbu.user_id=tbo.user_id
+        LEFT JOIN goods_shop gs on gs.shop_id=tbo.shop_id
+        LEFT JOIN tb_coupon_user tcu on tbo.coupon_id = tcu.id
+        LEFT JOIN activity_part_record apr on apr.order_id = tbo.order_id
+        where 1 = 1
+        <if test="shopName != null and shopName != ''">
+            and gs.shop_name like  concat("%", #{shopName}, "%")
+        </if>
+
+        <if test="shopPhone != null and shopPhone != ''">
+            and gs.phone= #{shopPhone}
+        </if>
+
+        <if test="userPhone != null and userPhone != ''">
+            and tbu.phone=#{userPhone}
+        </if>
+
+        <if test="couponName != null and couponName != ''">
+            and tcu.coupon_name like  concat("%", #{couponName}, "%")
+        </if>
+
+        <if test="orderNumber != null and orderNumber != ''">
+            and tbo.order_number = #{orderNumber}
+        </if>
+
+        <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
+            and umd2.create_time >= #{startTime} and #{endTime} >= umd2.create_time
+        </if>
+        ORDER BY umd2.id desc
+        LIMIT #{limit} OFFSET #{row}
+    </select>
+
+    <select id="accountEntryManagementDetailsCount" resultType="java.lang.Integer">
+        SELECT
+        count(*)
+        FROM
+        (
+        SELECT
+        RIGHT( umd.title, 18 ) AS orderNumber,
+        umd.id,
+        umd.user_id,
+        umd.shop_id,
+        umd.title,
+        umd.content,
+        umd.type,
+        umd.classify,
+        umd.money,
+        umd.create_time,
+        umd.state,
+        umd.children_id
+        FROM
+        `user_money_details` umd
+        WHERE
+        umd.type = 1
+        AND umd.classify = 3
+        AND umd.shop_id IS NOT NULL
+        AND umd.state=2
+        AND umd.title LIKE '商户订单收入' '%'
+        ) umd2
+        LEFT JOIN tb_order tbo on tbo.order_number=umd2.orderNumber
+        LEFT JOIN tb_user tbu on tbu.user_id=tbo.user_id
+        LEFT JOIN goods_shop gs on gs.shop_id=tbo.shop_id
+        LEFT JOIN tb_coupon_user tcu on tbo.coupon_id = tcu.id
+        LEFT JOIN activity_part_record apr on apr.order_id = tbo.order_id
+        where 1 = 1
+        <if test="shopName != null and shopName != ''">
+            and gs.shop_name like concat("%", #{shopName}, "%")
+        </if>
+
+        <if test="shopPhone != null and shopPhone != ''">
+            and gs.phone= #{shopPhone}
+        </if>
+
+        <if test="userPhone != null and userPhone != ''">
+            and tbu.phone=#{userPhone}
+        </if>
+
+        <if test="couponName != null and couponName != ''">
+            and tcu.coupon_name like concat("%", #{couponName}, "%")
+        </if>
+
+        <if test="orderNumber != null and orderNumber != ''">
+            and tbo.order_number = #{orderNumber}
+        </if>
+
+        <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
+            and umd2.create_time >= #{startTime} and #{endTime} >= umd2.create_time
+        </if>
+    </select>
+    <select id="excelAccountEntry" resultType="com.sqx.modules.app.entity.UserMoneyDetails">
+        SELECT
+        umd2.id,
+        umd2.orderNumber,
+        umd2.user_id as userId,
+        umd2.shop_id as shopId,
+        umd2.title,
+        umd2.content,
+        umd2.type,
+        umd2.classify,
+        umd2.money,
+        umd2.create_time as createTime,
+        umd2.state,
+        tbu.user_name as userName,
+        tbu.phone as userPhone,
+        gs.shop_name as shopName,
+        gs.phone as shopPhone,
+        tcu.coupon_name as couponName,
+        tcu.money as couponMoney,
+        apr.discount_amount as activityDiscountAmount,
+        tbo.errand_money as errandMoney
+        FROM
+        (
+        SELECT
+        RIGHT( umd.title, 18 ) AS orderNumber,
+        umd.id,
+        umd.user_id,
+        umd.shop_id,
+        umd.title,
+        umd.content,
+        umd.type,
+        umd.classify,
+        umd.money,
+        umd.create_time,
+        umd.state,
+        umd.children_id
+        FROM
+        `user_money_details` umd
+        WHERE
+        umd.type = 1
+        AND umd.classify = 3
+        AND umd.shop_id IS NOT NULL
+        AND umd.state=2
+        AND umd.title LIKE '商户订单收入' '%'
+        ) umd2
+        LEFT JOIN tb_order tbo on tbo.order_number=umd2.orderNumber
+        LEFT JOIN tb_user tbu on tbu.user_id=tbo.user_id
+        LEFT JOIN goods_shop gs on gs.shop_id=tbo.shop_id
+        LEFT JOIN tb_coupon_user tcu on tbo.coupon_id = tcu.id
+        LEFT JOIN activity_part_record apr on apr.order_id = tbo.order_id
+        where 1 = 1
+        <if test="query.shopName != null and query.shopName != ''">
+            and gs.shop_name like  concat("%", #{query.shopName}, "%")
+        </if>
+
+        <if test="query.shopPhone != null and query.shopPhone != ''">
+            and gs.phone= #{query.shopPhone}
+        </if>
+
+        <if test="query.userPhone != null and query.userPhone != ''">
+            and tbu.phone=#{query.userPhone}
+        </if>
+
+        <if test="query.couponName != null and query.couponName != ''">
+            and tcu.coupon_name like  concat("%", #{query.couponName}, "%")
+        </if>
+
+        <if test="query.orderNumber != null and query.orderNumber != ''">
+            and tbo.order_number = #{query.orderNumber}
+        </if>
+
+        <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''">
+            and umd2.create_time >= #{query.startTime} and #{query.endTime} >= umd2.create_time
+        </if>
+        ORDER BY umd2.id desc
     </select>
     </select>
 
 
 </mapper>
 </mapper>