李天标 3 年 前
コミット
2493e81c6b
34 ファイル変更3368 行追加28 行削除
  1. 16 10
      pom.xml
  2. 21 0
      src/main/java/com/szwl/controller/TAreaController.java
  3. 624 16
      src/main/java/com/szwl/controller/TOrderController.java
  4. 8 0
      src/main/java/com/szwl/feign/SzwlFeign.java
  5. 16 0
      src/main/java/com/szwl/mapper/TAreaMapper.java
  6. 9 0
      src/main/java/com/szwl/mapper/TOrderMapper.java
  7. 23 0
      src/main/java/com/szwl/mapper/xml/TAreaMapper.xml
  8. 81 0
      src/main/java/com/szwl/mapper/xml/TOrderMapper.xml
  9. 152 0
      src/main/java/com/szwl/model/bean/OrderDaoChuDTO.java
  10. 201 0
      src/main/java/com/szwl/model/bean/OrderVo.java
  11. 48 0
      src/main/java/com/szwl/model/entity/TArea.java
  12. 31 0
      src/main/java/com/szwl/model/excel/AdminStatisticsTarget.java
  13. 133 0
      src/main/java/com/szwl/model/excel/AlarmRecordTarget.java
  14. 120 0
      src/main/java/com/szwl/model/excel/CoinOrderTarget.java
  15. 49 0
      src/main/java/com/szwl/model/excel/CoinStaticsTarget.java
  16. 107 0
      src/main/java/com/szwl/model/excel/OrderByAdminTarget.java
  17. 123 0
      src/main/java/com/szwl/model/excel/OrderByClientidTarget.java
  18. 52 0
      src/main/java/com/szwl/model/excel/OrderStaticsTarget.java
  19. 175 0
      src/main/java/com/szwl/model/excel/OrderTarget.java
  20. 54 0
      src/main/java/com/szwl/model/excel/ProductStaticTarget.java
  21. 110 0
      src/main/java/com/szwl/model/excel/PromoCodeTarget.java
  22. 119 0
      src/main/java/com/szwl/model/excel/ShandeMchCompanyListTarget.java
  23. 91 0
      src/main/java/com/szwl/model/excel/ShandeMchListTarget.java
  24. 396 0
      src/main/java/com/szwl/model/query/Filter.java
  25. 152 0
      src/main/java/com/szwl/model/query/Order.java
  26. 270 0
      src/main/java/com/szwl/model/query/Pageable.java
  27. 4 1
      src/main/java/com/szwl/model/query/StatisticsParam.java
  28. 16 0
      src/main/java/com/szwl/service/TAreaService.java
  29. 6 0
      src/main/java/com/szwl/service/TCoinOrderService.java
  30. 13 0
      src/main/java/com/szwl/service/TOrderService.java
  31. 20 0
      src/main/java/com/szwl/service/impl/TAreaServiceImpl.java
  32. 26 0
      src/main/java/com/szwl/service/impl/TCoinOrderServiceImpl.java
  33. 101 0
      src/main/java/com/szwl/service/impl/TOrderServiceImpl.java
  34. 1 1
      src/test/java/com/szwl/AutoGeneratorTests.java

+ 16 - 10
pom.xml

@@ -203,6 +203,12 @@
 			<artifactId>gexin-rp-sdk-http</artifactId>
 			<version>4.0.1.9</version>
 		</dependency>
+		<!-- 导出Excel -->
+		<dependency>
+			<groupId>cn.afterturn</groupId>
+			<artifactId>easypoi-base</artifactId>
+			<version>RELEASE</version>
+		</dependency>
 	</dependencies>
 
 	<build>
@@ -217,16 +223,16 @@
 		</plugins>
 	</build>
 	<repositories>
-		<repository>
-			<id>nexus</id>
-			<url>http://www.redouble.store:1888/repository/maven-public/</url>
-			<releases>
-				<enabled>true</enabled>
-			</releases>
-			<snapshots>
-				<enabled>false</enabled>
-			</snapshots>
-		</repository>
+		<!--<repository>-->
+			<!--<id>nexus</id>-->
+			<!--<url>http://www.redouble.store:1888/repository/maven-public/</url>-->
+			<!--<releases>-->
+				<!--<enabled>true</enabled>-->
+			<!--</releases>-->
+			<!--<snapshots>-->
+				<!--<enabled>false</enabled>-->
+			<!--</snapshots>-->
+		<!--</repository>-->
 		<!-- 个推 -->
 		<repository>
 			<id>getui-nexus</id>

+ 21 - 0
src/main/java/com/szwl/controller/TAreaController.java

@@ -0,0 +1,21 @@
+package com.szwl.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author wuhs
+ * @since 2022-07-12
+ */
+@RestController
+@RequestMapping("/tArea")
+public class TAreaController {
+
+}
+

+ 624 - 16
src/main/java/com/szwl/controller/TOrderController.java

@@ -1,9 +1,12 @@
 package com.szwl.controller;
 
 
+import cn.afterturn.easypoi.excel.ExcelExportUtil;
+import cn.afterturn.easypoi.excel.entity.ExportParams;
 import cn.com.crbank.ommo.bean.ResultMessage;
 import cn.com.crbank.ommo.esclient.ElasticsearchRunner;
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -11,11 +14,21 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.szwl.feign.SzwlFeign;
 import com.szwl.feign.bean.TAdminParam;
 import com.szwl.model.bean.ChartColumn;
+import com.szwl.model.bean.OrderDaoChuDTO;
+import com.szwl.model.bean.OrderVo;
+import com.szwl.model.bo.JsonMessage;
 import com.szwl.model.bo.R;
 import com.szwl.model.bo.ResponseModel;
 import com.szwl.model.entity.*;
+import com.szwl.model.excel.CoinOrderTarget;
+import com.szwl.model.excel.OrderByAdminTarget;
+import com.szwl.model.excel.OrderByClientidTarget;
+import com.szwl.model.excel.OrderTarget;
+import com.szwl.model.query.Filter;
+import com.szwl.model.query.Pageable;
 import com.szwl.model.query.StatisticsParam;
 import com.szwl.model.utils.FgObjectUtil;
+import com.szwl.service.TAreaService;
 import com.szwl.service.TCoinOrderService;
 import com.szwl.service.TOrderService;
 import com.szwl.service.es.EsTEquipmentService;
@@ -23,13 +36,22 @@ import com.szwl.service.es.EsTOrderService;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.time.DateUtils;
+import org.apache.poi.ss.usermodel.Workbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
+import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.net.URLEncoder;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 import java.util.Optional;
@@ -49,6 +71,8 @@ public class TOrderController {
     @Autowired
     TOrderService orderService;
     @Autowired
+    TAreaService areaService;
+    @Autowired
     EsTOrderService esTOrderService;
     @Autowired
     EsTEquipmentService esTEquipmentService;
@@ -57,7 +81,7 @@ public class TOrderController {
     @Autowired
     SzwlFeign szwlFeign;
     @GetMapping("/pageOrder")
-    public ResponseModel<IPage<?>> pageAd(String adminId,String adminType,String type,String userName,String payType,String productNo,String clientId,String dateType, Date stratDate, Date endDate, long current, long size ) {
+    public ResponseModel<IPage<?>> pageOrder(String adminId,String adminType,String type,String userName,String payType,String productNo,String clientId,String dateType, Date stratDate, Date endDate, long current, long size ) {
         //判断当前账号状态
         TAdmin admin = R.getDataIfSuccess(szwlFeign.getAdmin(adminId));
         //类型
@@ -254,6 +278,7 @@ public class TOrderController {
         }
         return "0";
     }
+    @ApiOperation(value = "获取首页数据统计")
     @PostMapping("/getStatistics")
     public ResponseEntity<?> getStatistics(@RequestBody StatisticsParam param) {
         //  判断是否为外国
@@ -267,6 +292,12 @@ public class TOrderController {
                 TEquipment equipment = R.getDataIfSuccess(szwlFeign.findById(param.getEquipmentId()));
                 param.setClientId(equipment.getClientId());
             }
+            if(StringUtils.isNotEmpty(param.getClientId())){
+                //补全clientId
+                TEquipment tEquipment = R.getDataIfSuccess(szwlFeign.findEquipmentByClientId(param.getClientId()));
+                param.setClientId(tEquipment.getClientId());
+                param.setClientId(tEquipment.getClientId());
+            }
         }else {
             if(admin.getType()==2){
                 //商家
@@ -274,15 +305,65 @@ public class TOrderController {
                     //查机器
                     TEquipment equipment = R.getDataIfSuccess(szwlFeign.findById(param.getEquipmentId()));
                     param.setClientId(equipment.getClientId());
+
+                }
+                if(StringUtils.isNotEmpty(param.getClientId())){
+                    param.setAdminId(null);
+                    //判断是否是这个商家的
+                    TEquipment tEquipment = R.getDataIfSuccess(szwlFeign.findEquipmentByClientId(param.getClientId()));
+                    if(tEquipment.getAdminId().toString().equals(admin.getId().toString())){
+                        param.setClientId(tEquipment.getClientId());
+                        param.setEquipmentId(String.valueOf(tEquipment.getId()));
+                    }
                 }
             }
             if(admin.getType()==3){
                 //子账户只能查相对的机器的订单
-                if(param.getEquipmentId()==null){
-                    //找出相对的clientId集合
+                //商家子账户
+                if(param.getEquipmentId()!=null){
+                    //查机器
+                    TEquipment equipment = R.getDataIfSuccess(szwlFeign.findById(param.getEquipmentId()));
+                    param.setClientId(equipment.getClientId());
 
-                }else {
+                }else{
+                    TAdminEquipment adminEquipment = R.getDataIfSuccess(szwlFeign.getClientIdList(String.valueOf(admin.getId())));
+                    if(adminEquipment.getType().equals("0")){
+                        TAdmin admin1 = R.getDataIfSuccess(szwlFeign.getAdmin(String.valueOf(admin.getParentId())));
+                        param.setAdminId(admin1.getId().toString());
+                    }else {
+                        List<String> list = R.getDataIfSuccess(szwlFeign.getClientIds(param.getAdminId()));
+                        param.setClientIds(list);
+                    }
+                }
+                if(StringUtils.isNotEmpty(param.getClientId())){
+                    param.setAdminId(null);
+                    //判断是否是这个子账号的
+                    TEquipment tEquipment = R.getDataIfSuccess(szwlFeign.findEquipmentByClientId(param.getClientId()));
+
+                    TAdminEquipment adminEquipment = R.getDataIfSuccess(szwlFeign.getClientIdList(String.valueOf(admin.getId())));
+                    if(adminEquipment.getType().equals("0")){
+                        TAdmin admin1 = R.getDataIfSuccess(szwlFeign.getAdmin(String.valueOf(admin.getParentId())));
+                        if(tEquipment.getAdminId().toString().equals(admin1.getId())){
+                            param.setAdminId(null);
+                            param.setClientId(tEquipment.getClientId());
+                            param.setEquipmentId(String.valueOf(tEquipment.getId()));
+                        }
+                    }else {
+                        int i = 0;
+                        List<String> list = R.getDataIfSuccess(szwlFeign.getClientIds(param.getAdminId()));
+                        if(list.size()>0){
+                            for(String clientID:list){
+                                if(clientID.equals(tEquipment.getClientId())){
+                                    i++;
+                                }
+                            }
+                        }
+                        if(i>0){
+                            param.setClientId(tEquipment.getClientId());
+                            param.setEquipmentId(String.valueOf(tEquipment.getId()));
+                        }
 
+                    }
                 }
             }
 
@@ -368,6 +449,7 @@ public class TOrderController {
      * @param param
      * @return
      */
+    @ApiOperation(value = "机器销售排行统计")
     @PostMapping("/getEquipmentStatistics")
     public ResponseEntity<?> getEquipmentStatistics(@RequestBody StatisticsParam param) {
         //  判断是否为外国
@@ -375,10 +457,41 @@ public class TOrderController {
         log.info("param:{}", param);
         FgObjectUtil.objectNullOrEmptySel(param, "chartType$");
         ChartColumn chartColumn = new ChartColumn();
-//        if(StringUtils.isNotEmpty(param.getIfForeign())&&param.getIfForeign().equals("1")){
-//            //国外查MYSQL
-//            chartColumn = tOrderService.getEquipmentStatistics(param);
-//        }else{
+        if(StringUtils.isNotEmpty(param.getIfForeign())&&param.getIfForeign().equals("1")){
+            //国外
+//            chartColumn = orderService.getEquipmentStatistics(param);
+            chartColumn = esTEquipmentService.getEquipmentStatistics(param);
+        }else{
+            //查去年的数据找数据库
+            String endDate = param.getEndDate();
+            String toYear = "2022-01-01 00:00:00";
+            Date date = new Date();
+            Date year = new Date();
+            SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            try {
+                //使用SimpleDateFormat的parse()方法生成Date
+                date = sf.parse(endDate);
+                year = sf.parse(toYear);
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+            if(date.getTime()<year.getTime()){
+                chartColumn  = orderService.getEquipmentStatistics(param);
+            }else {
+                if (ElasticsearchRunner.ES_RUNNING) {
+                    try {
+                        // 查es
+                        chartColumn = esTEquipmentService.getEquipmentStatistics(param);
+                    }catch (Exception e){
+                        log.error("使用es 查询发生错误:{}",e);
+                        // 查 mysql
+//                    chartColumn  = tOrderService.getStatistics(param);
+                    }
+                }else{
+                    // 查 mysql
+//                chartColumn  = tOrderService.getStatistics(param);
+                }
+            }
 //            if (ElasticsearchRunner.ES_RUNNING) {
 //                try {
 //                    // 查es
@@ -392,15 +505,15 @@ public class TOrderController {
 //                // 查 mysql
 ////                chartColumn = tOrderService.getEquipmentStatistics(param);
 //            }
-//        }
-        try {
-            // 查es
-            chartColumn = esTEquipmentService.getEquipmentStatistics(param);
-        }catch (Exception e){
-            log.error("使用es 查询发生错误:{}",e);
-            // 查 mysql
-//                    chartColumn = tOrderService.getEquipmentStatistics(param);
         }
+//        try {
+//            // 查es
+//            chartColumn = esTEquipmentService.getEquipmentStatistics(param);
+//        }catch (Exception e){
+//            log.error("使用es 查询发生错误:{}",e);
+//            // 查 mysql
+////                    chartColumn = tOrderService.getEquipmentStatistics(param);
+//        }
 //        if (ElasticsearchRunner.ES_RUNNING) {
 //            try {
 //                // 查es
@@ -422,5 +535,500 @@ public class TOrderController {
                         .setData(chartColumn)
                         .setMessage("SUCCESS"));
     }
+
+    //查询线上订单
+    @ApiOperation(value = "查询线上订单")
+    @RequestMapping(value = "/findOrder", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
+    @ResponseBody
+    public Object findOrder(String clientId, String sn, String productName, String status, Date begin, Date end, Pageable pageable) {
+
+        LambdaQueryWrapper<TOrder> query = Wrappers.lambdaQuery();
+        if (StringUtils.isNotEmpty(sn)) {
+            query.like(TOrder::getSn,sn);
+        }
+        if (StringUtils.isNotEmpty(productName)) {
+            query.like(TOrder::getProductName,productName);
+        }
+        if (StringUtils.isNotEmpty(status)) {
+            if(status.equals("unpay")){
+                query.eq(TOrder::getStatus,0);
+            }
+            if(status.equals("pay")){
+                query.eq(TOrder::getStatus,1);
+            }
+            if(status.equals("refund")){
+                query.eq(TOrder::getStatus,3);
+            }
+        }
+        if (begin != null && end != null) {
+            query.gt(TOrder::getCreateDate,begin);
+            query.lt(TOrder::getCreateDate,end);
+        }
+        query.like(TOrder::getClientId,clientId);
+
+        int size = pageable.getPageSize();
+        int current = pageable.getPageNumber();
+        Page<TOrder> page = new Page<>(current, size, true);
+        IPage<TOrder> iPage = orderService.page(page, query);
+        long total = page.getTotal();
+        List<TOrder> content = iPage.getRecords();
+//        List<Order> content = page.getContent();
+        ArrayList<OrderVo> orderVos = new ArrayList<>();
+        for (TOrder order : content) {
+            OrderVo orderVo = new OrderVo();
+            orderVo.setSn(order.getSn());
+            orderVo.setProductName(order.getProductName());
+            orderVo.setPrice(order.getPrice());
+            orderVo.setTrxNo(order.getTrxNo());
+            orderVo.setRefundTrxNo(order.getRefundTrxNo());
+            orderVo.setRefundAmount(order.getRefundAmount());
+            orderVo.setPayDate(order.getPayDate());
+            orderVo.setRefundDate(order.getRefundDate());
+            if(order.getStatus()==0){
+                orderVo.setStatus(OrderVo.Status.unpay);
+            }
+            if(order.getStatus()==1){
+                orderVo.setStatus(OrderVo.Status.pay);
+            }
+            if(order.getStatus()==3){
+                orderVo.setStatus(OrderVo.Status.refund);
+            }
+            orderVo.setCreateDate(order.getCreateDate());
+            orderVo.setFrp_code(order.getFrpCode());
+            orderVos.add(orderVo);
+        }
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("total", total);
+        jsonObject.put("orders", com.gexin.fastjson.JSON.toJSONString(orderVos));
+        return jsonObject.toJSONString();
+    }
+
+    /**
+     * 订单数据导出
+     */
+    @ApiOperation(value = "订单数据导出-查询")
+    @RequestMapping(value = "/orderSelect", method = RequestMethod.GET)
+    public String orderSelect(String type, String clientId, String username, String beginEndDate, long current, long size) {
+        if(size>50){
+            return "error";
+        }
+        JSONObject jsonObject = new JSONObject();
+
+        if (!StringUtils.isEmpty(beginEndDate)) {
+            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            Date begin = null;
+            Date end = null;
+            Long adminId = null;
+            try {
+                begin = simpleDateFormat.parse(beginEndDate.split(" - ")[0].trim());
+                end = simpleDateFormat.parse(beginEndDate.split(" - ")[1].trim());
+                long time = end.getTime() - begin.getTime();
+                if(time>31*24*60*60*1000l){
+                    return "error";
+                }
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+            if(!StringUtils.isEmpty(username)){
+                TAdmin admin = R.getDataIfSuccess(szwlFeign.getAdminByUsername(username));
+                adminId = admin.getId();
+            }
+            List<OrderDaoChuDTO> OrderDaoChuDTOList =orderService.orderDaoChu(begin,end,adminId,clientId,type,current,size);
+            for(OrderDaoChuDTO orderDaoChuDTO: OrderDaoChuDTOList){
+                String adminId1 = orderDaoChuDTO.getAdminId().toString();
+                TAdmin admin = R.getDataIfSuccess(szwlFeign.getAdmin(adminId1));
+                if(admin==null){
+                    continue;
+                }
+                orderDaoChuDTO.setPhone(admin.getPhone());
+                orderDaoChuDTO.setUsername(admin.getUsername());
+                orderDaoChuDTO.setName(admin.getName());
+                if(!StringUtils.isEmpty(type)&&type.equals("2")){
+                    //商户为单位
+                    TAdmin parent = R.getDataIfSuccess(szwlFeign.getAdmin(String.valueOf(admin.getParentId())));
+                    orderDaoChuDTO.setLastUsername(parent.getUsername());
+                    TArea area = areaService.getById(admin.getAreaId());
+                    if(area!=null){
+                        orderDaoChuDTO.setAddress(area.getFullName());
+                    }
+                    List<String> stringList = R.getDataIfSuccess(szwlFeign.getClientIds(String.valueOf(admin.getId())));
+                    orderDaoChuDTO.setEquipmentTotal(String.valueOf(stringList.size()));
+                }else {
+                    //设备为单位
+                    TEquipment equipment = R.getDataIfSuccess(szwlFeign.findEquipmentByClientId(String.valueOf(orderDaoChuDTO.getClientId())));
+                    if(equipment!=null){
+                        if(StringUtils.isNotEmpty(equipment.getFullName())){
+                            orderDaoChuDTO.setAddress(equipment.getFullName());
+                        }
+                        orderDaoChuDTO.setEquipmentType(equipment.getEquimentType());
+                        orderDaoChuDTO.setCreateDate(equipment.getCreateDate());
+                    }
+                }
+            }
+            jsonObject.put("OrderDaoChuDTOList", OrderDaoChuDTOList);
+        }
+        if(!StringUtils.isEmpty(type)&&type.equals("2")){
+            IPage<TAdmin> iPage = R.getDataIfSuccess(szwlFeign.pageAdmin2(current, size));
+
+        }else {
+            IPage<TEquipment> page =  R.getDataIfSuccess(szwlFeign.pageEquipment2(current, size));
+            jsonObject.put("page", page);
+        }
+
+        return jsonObject.toJSONString();
+    }
+
+    /**
+     * 订单数据导出
+     */
+    @ApiOperation(value = "订单数据导出-导出")
+    @RequestMapping(value = "/orderExport", method = RequestMethod.GET)
+    public Object orderExport(HttpServletResponse response, String type, String clientId, String username, String beginEndDate, long current, long size) {
+        if(size>500){
+            return JsonMessage.success("页数过大");
+        }
+        if (!StringUtils.isEmpty(beginEndDate)) {
+            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            Date begin = null;
+            Date end = null;
+            Long adminId = null;
+            try {
+                begin = simpleDateFormat.parse(beginEndDate.split(" - ")[0].trim());
+                end = simpleDateFormat.parse(beginEndDate.split(" - ")[1].trim());
+                long time = end.getTime() - begin.getTime();
+                if(time>31*24*60*60*1000l){
+                    return JsonMessage.success("时间跨度过长");
+                }
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+            if(!StringUtils.isEmpty(username)){
+                TAdmin admin = R.getDataIfSuccess(szwlFeign.getAdminByUsername(username));
+                adminId = admin.getId();
+            }
+            List<OrderDaoChuDTO> OrderDaoChuDTOList =orderService.orderDaoChu(begin,end,adminId,clientId,type,current,size);
+            for(OrderDaoChuDTO orderDaoChuDTO: OrderDaoChuDTOList){
+                Long adminId1 = Long.valueOf(orderDaoChuDTO.getAdminId().toString());
+                TAdmin admin = R.getDataIfSuccess(szwlFeign.getAdmin(adminId1.toString()));
+                if(admin==null){
+                    continue;
+                }
+                orderDaoChuDTO.setPhone(admin.getPhone());
+                orderDaoChuDTO.setUsername(admin.getUsername());
+                orderDaoChuDTO.setName(admin.getName());
+                if(!StringUtils.isEmpty(type)&&type.equals("2")){
+                    //商户为单位
+                    TAdmin parent = R.getDataIfSuccess(szwlFeign.getAdmin(String.valueOf(admin.getParentId())));
+                    orderDaoChuDTO.setLastUsername(parent.getUsername());
+                    TArea area = areaService.getById(admin.getAreaId());
+                    if(area!=null){
+                        orderDaoChuDTO.setAddress(area.getFullName());
+                    }
+                    List<String> stringList = R.getDataIfSuccess(szwlFeign.getClientIds(String.valueOf(admin.getId())));
+                    orderDaoChuDTO.setEquipmentTotal(String.valueOf(stringList.size()));
+                }else {
+                    //设备为单位
+                    TEquipment equipment = R.getDataIfSuccess(szwlFeign.findEquipmentByClientId(String.valueOf(orderDaoChuDTO.getClientId())));
+                    if(equipment!=null){
+                        if(StringUtils.isNotEmpty(equipment.getFullName())){
+                            orderDaoChuDTO.setAddress(equipment.getFullName());
+                        }
+                        orderDaoChuDTO.setEquipmentType(equipment.getEquimentType());
+                        orderDaoChuDTO.setCreateDate(equipment.getCreateDate());
+                    }
+                }
+            }
+            ExportParams exportParams = new ExportParams("订单记录", "sheet1");
+            Workbook workbook = null;
+            if(!StringUtils.isEmpty(type)&&type.equals("2")){
+                List<OrderByAdminTarget> orderByAdminTargetList = new ArrayList<>();
+                for(OrderDaoChuDTO orderDaoChuDTO: OrderDaoChuDTOList){
+                    OrderByAdminTarget orderByAdminTarget = new OrderByAdminTarget();
+                    orderByAdminTarget.setUsername(orderDaoChuDTO.getUsername());
+                    orderByAdminTarget.setAddress(orderDaoChuDTO.getAddress());
+                    orderByAdminTarget.setEquipmentTotal(orderDaoChuDTO.getEquipmentTotal());
+                    orderByAdminTarget.setLastUsername(orderDaoChuDTO.getLastUsername());
+                    orderByAdminTarget.setPhone(orderDaoChuDTO.getPhone());
+                    orderByAdminTarget.setPriceTotal(orderDaoChuDTO.getPriceTotal());
+                    orderByAdminTarget.setName(orderDaoChuDTO.getName());
+                    orderByAdminTargetList.add(orderByAdminTarget);
+                }
+                workbook = ExcelExportUtil.exportExcel(exportParams, OrderByAdminTarget.class, orderByAdminTargetList);
+            }else {
+                List<OrderByClientidTarget> orderByClientidTargetList = new ArrayList<>();
+                for(OrderDaoChuDTO orderDaoChuDTO: OrderDaoChuDTOList){
+                    OrderByClientidTarget orderByClientidTarget = new OrderByClientidTarget();
+                    orderByClientidTarget.setAddress(orderDaoChuDTO.getAddress());
+                    orderByClientidTarget.setClientId(orderDaoChuDTO.getClientId());
+                    orderByClientidTarget.setCreateDate(orderDaoChuDTO.getCreateDate());
+                    orderByClientidTarget.setEquipmentType(orderDaoChuDTO.getEquipmentType());
+                    orderByClientidTarget.setName(orderDaoChuDTO.getName());
+                    orderByClientidTarget.setPhone(orderDaoChuDTO.getPhone());
+                    orderByClientidTarget.setPriceTotal(orderDaoChuDTO.getPriceTotal());
+                    orderByClientidTarget.setUsername(orderDaoChuDTO.getUsername());
+                    orderByClientidTargetList.add(orderByClientidTarget);
+                }
+                workbook = ExcelExportUtil.exportExcel(exportParams, OrderByClientidTarget.class, orderByClientidTargetList);
+            }
+            if (workbook != null) {
+                OutputStream os = null;
+                try {
+                    os = response.getOutputStream();
+                    SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
+                    response.setContentType("application/vnd.ms-excel;charset=utf-8");
+                    response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("订单记录数据导出" + format.format(new Date()) + ".xls", "UTF-8"));
+                    workbook.write(os);
+                    return JsonMessage.success("导出成功");
+                } catch (Exception e) {
+                    e.printStackTrace();
+                    return JsonMessage.success("导出错误");
+                } finally {
+                    try {
+                        os.close();
+                        workbook.close();
+                    } catch (IOException e) {
+                        e.printStackTrace();
+                    }
+                }
+            }
+        }
+        return JsonMessage.success("导出成功");
+    }
+
+    @RequestMapping(value = "/onlineExport", method = RequestMethod.GET)
+    public Object onlineExport(HttpServletResponse response, String adminId,String adminType,String type,String userName,String payType,String productNo,String clientId,String dateType, Date stratDate, Date endDate, long current, long size) {
+        //判断当前账号状态
+        TAdmin admin = R.getDataIfSuccess(szwlFeign.getAdmin(adminId));
+        //类型
+        //0,线上
+        if(type.equals("0")){
+            LambdaQueryWrapper<TOrder> query = Wrappers.lambdaQuery();
+            //adminType="all"时,代表查全部下级  子账户没有这个权限  公司人员默认查所有人
+            if(StringUtils.isNotEmpty(adminType)){
+                if(admin.getIsAdmined().equals("0")&&admin.getType()>1){
+                    if(admin.getType()>1){
+                        if(adminType.equals("all")){
+                            //查找所有下级
+                            List<Long> admidIdList = R.getDataIfSuccess(szwlFeign.getAdminIdList(adminId));
+                            query.in(TOrder::getAdminId,admidIdList);
+                        }
+                    }
+                }else{
+                    if(admin.getType()>1){
+                        //登录账户为子账户 不查下级 只查对应机器的订单
+                        TAdminEquipment adminEquipment = R.getDataIfSuccess(szwlFeign.getClientIdList(String.valueOf(admin.getParentId())));
+                        if(adminEquipment.getType().equals("0")){
+                            //全部机器
+                            TAdmin upAdmin = R.getDataIfSuccess(szwlFeign.getAdmin(String.valueOf(admin.getParentId())));
+                            query.eq(TOrder::getAdminId,upAdmin.getId());
+                        }else {
+                            String equipmentIds = adminEquipment.getEquipmentIds();
+                            List<String> equipmentIdList = JSON.parseArray(equipmentIds, String.class);
+                            query.in(TOrder::getClientId,equipmentIdList);
+                        }
+                    }
+                }
+
+            }else {
+                //判断当前账号状态 公司还是商家
+                if(admin.getType()>1){
+                    //商家 判断是否子账户
+                    if(admin.getIsAdmined().equals("0")){
+                        //商家自己
+                        query.eq(TOrder::getAdminId,adminId);
+                    }else {
+                        //商家 子账户
+                        //登录账户为子账户 不查下级 只查对应机器的订单
+                        TAdminEquipment adminEquipment = R.getDataIfSuccess(szwlFeign.getClientIdList(String.valueOf(admin.getParentId())));
+                        if(adminEquipment.getType().equals("0")){
+                            //全部机器
+                            TAdmin upAdmin = R.getDataIfSuccess(szwlFeign.getAdmin(String.valueOf(admin.getParentId())));
+                            query.eq(TOrder::getAdminId,upAdmin.getId());
+                        }else {
+                            String equipmentIds = adminEquipment.getEquipmentIds();
+                            List<String> equipmentIdList = JSON.parseArray(equipmentIds, String.class);
+                            query.in(TOrder::getClientId,equipmentIdList);
+                        }
+                    }
+                }
+            }
+            if(StringUtils.isNotEmpty(userName)){
+                TAdmin admin1 = R.getDataIfSuccess(szwlFeign.getAdminByUsername(userName));
+                query.eq(TOrder::getAdminId,admin1.getId());
+            }
+            if(StringUtils.isNotEmpty(payType)){
+                query.eq(TOrder::getFrpCode,payType);
+            }
+            if(StringUtils.isNotEmpty(productNo)){
+                query.eq(TOrder::getProductNo,productNo);
+            }
+            if(StringUtils.isNotEmpty(clientId)){
+                TEquipment equipment = R.getDataIfSuccess(szwlFeign.findEquipmentByClientId(clientId));
+                //判断机器是否属于这个登陆账号
+                if(admin.getType()>1){
+                    //商家
+                    if(equipment.getAdminId().toString().equals(admin.getId().toString())){
+                        query.eq(TOrder::getEquipmentId,equipment.getId());
+                    }
+                }else {
+                    query.eq(TOrder::getEquipmentId,equipment.getId());
+                }
+            }
+            if(StringUtils.isNotEmpty(dateType)){
+                if(dateType.equals("0")){
+                    //创建时间
+                    if(stratDate!=null&&endDate!=null){
+                        query.gt(TOrder::getCreateDate,stratDate);
+                        query.lt(TOrder::getCreateDate,endDate);
+                    }
+                }
+                if(dateType.equals("1")){
+                    //退款时间
+                    if(stratDate!=null&&endDate!=null){
+                        query.gt(TOrder::getRefundDate,stratDate);
+                        query.lt(TOrder::getRefundDate,endDate);
+                    }
+                }
+            }
+            Page<TOrder> page = new Page<>(current, size, true);
+            IPage<TOrder> iPage = orderService.page(page, query);
+            List<TOrder> list = iPage.getRecords();
+            List<OrderTarget> orderTargetList = orderService.findById(admin, list);
+            ExportParams exportParams = new ExportParams("订单记录", "sheet1");
+            Workbook workbook = ExcelExportUtil.exportExcel(exportParams, OrderTarget.class, orderTargetList);
+
+            if (workbook != null) {
+                OutputStream os = null;
+                try {
+                    os = response.getOutputStream();
+                    SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
+                    response.setContentType("application/vnd.ms-excel;charset=utf-8");
+                    response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("订单记录数据导出" + format.format(new Date()) + ".xls", "UTF-8"));
+                    workbook.write(os);
+                    return JsonMessage.success("导出成功");
+                } catch (Exception e) {
+                    e.printStackTrace();
+                    return JsonMessage.success("导出错误");
+                } finally {
+                    try {
+                        os.close();
+                        workbook.close();
+                    } catch (IOException e) {
+                        e.printStackTrace();
+                    }
+                }
+            }
+        };
+
+        //1,线下
+        if(type.equals("1")){
+            LambdaQueryWrapper<TCoinOrder> query = Wrappers.lambdaQuery();
+            //adminType="all"时,代表查全部下级  子账户没有这个权限  公司人员默认查所有人
+            if(StringUtils.isNotEmpty(adminType)){
+                if(admin.getIsAdmined().equals("0")&&admin.getType()>1){
+                    if(admin.getType()>1){
+                        if(adminType.equals("all")){
+                            //查找所有下级
+                            List<Long> admidIdList = R.getDataIfSuccess(szwlFeign.getAdminIdList(adminId));
+                            query.in(TCoinOrder::getAdminId,admidIdList);
+                        }
+                    }
+                }else{
+                    if(admin.getType()>1){
+                        //登录账户为子账户 不查下级 只查对应机器的订单
+                        TAdminEquipment adminEquipment = R.getDataIfSuccess(szwlFeign.getClientIdList(String.valueOf(admin.getParentId())));
+                        if(adminEquipment.getType().equals("0")){
+                            //全部机器
+                            TAdmin upAdmin = R.getDataIfSuccess(szwlFeign.getAdmin(String.valueOf(admin.getParentId())));
+                            query.eq(TCoinOrder::getAdminId,upAdmin.getId());
+                        }else {
+                            String equipmentIds = adminEquipment.getEquipmentIds();
+                            List<String> equipmentIdList = JSON.parseArray(equipmentIds, String.class);
+                            query.in(TCoinOrder::getClientId,equipmentIdList);
+                        }
+                    }
+                }
+
+            }else {
+                //判断当前账号状态 公司还是商家
+                if(admin.getType()>1){
+                    //商家 判断是否子账户
+                    if(admin.getIsAdmined().equals("0")){
+                        //商家自己
+                        query.eq(TCoinOrder::getAdminId,adminId);
+                    }else {
+                        //商家 子账户
+                        //登录账户为子账户 不查下级 只查对应机器的订单
+                        TAdminEquipment adminEquipment = R.getDataIfSuccess(szwlFeign.getClientIdList(String.valueOf(admin.getParentId())));
+                        if(adminEquipment.getType().equals("0")){
+                            //全部机器
+                            TAdmin upAdmin = R.getDataIfSuccess(szwlFeign.getAdmin(String.valueOf(admin.getParentId())));
+                            query.eq(TCoinOrder::getAdminId,upAdmin.getId());
+                        }else {
+                            String equipmentIds = adminEquipment.getEquipmentIds();
+                            List<String> equipmentIdList = JSON.parseArray(equipmentIds, String.class);
+                            query.in(TCoinOrder::getClientId,equipmentIdList);
+                        }
+                    }
+                }
+            }
+            if(StringUtils.isNotEmpty(userName)){
+                TAdmin admin1 = R.getDataIfSuccess(szwlFeign.getAdminByUsername(userName));
+                query.eq(TCoinOrder::getAdminId,admin1.getId());
+            }
+            if(StringUtils.isNotEmpty(payType)){
+                query.eq(TCoinOrder::getPayType,payType);
+            }
+            if(StringUtils.isNotEmpty(productNo)){
+                query.eq(TCoinOrder::getProductNo,productNo);
+            }
+            if(StringUtils.isNotEmpty(clientId)){
+                TEquipment equipment = R.getDataIfSuccess(szwlFeign.findEquipmentByClientId(clientId));
+                //判断机器是否属于这个登陆账号
+                if(admin.getType()>1){
+                    //商家
+                    if(equipment.getAdminId().toString().equals(admin.getId().toString())){
+                        query.eq(TCoinOrder::getClientId,equipment.getClientId());
+                    }
+                }else {
+                    query.eq(TCoinOrder::getClientId,equipment.getClientId());
+                }
+            }
+            if(stratDate!=null&&endDate!=null){
+                query.gt(TCoinOrder::getPayDate,stratDate);
+                query.lt(TCoinOrder::getPayDate,endDate);
+            }
+            Page<TCoinOrder> page = new Page<>(current, size, true);
+            IPage<TCoinOrder> iPage = coinOrderService.page(page, query);
+            List<TCoinOrder> list = iPage.getRecords();
+            List<CoinOrderTarget> coinOrderTargets = coinOrderService.findByCoinOrder(admin,list);
+            ExportParams exportParams = new ExportParams("线下订单记录", "sheet1");
+            Workbook workbook = ExcelExportUtil.exportExcel(exportParams, CoinOrderTarget.class, coinOrderTargets);
+
+            if (workbook != null) {
+                OutputStream os = null;
+                try {
+                    os = response.getOutputStream();
+                    SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
+                    response.setContentType("application/vnd.ms-excel;charset=utf-8");
+                    response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("线下订单记录数据导出" + format.format(new Date()) + ".xls", "UTF-8"));
+                    workbook.write(os);
+                    return JsonMessage.success("导出成功");
+                } catch (Exception e) {
+                    e.printStackTrace();
+                    return JsonMessage.success("导出错误");
+                } finally {
+                    try {
+                        os.close();
+                        workbook.close();
+                    } catch (IOException e) {
+                        e.printStackTrace();
+                    }
+                }
+            }
+        }
+
+        return JsonMessage.success("导出错误");
+    }
 }
 

+ 8 - 0
src/main/java/com/szwl/feign/SzwlFeign.java

@@ -1,5 +1,6 @@
 package com.szwl.feign;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.szwl.feign.bean.TAdminParam;
 import com.szwl.model.bo.ResponseModel;
 import com.szwl.model.entity.TAdmin;
@@ -9,6 +10,7 @@ import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
 
 import java.util.List;
 
@@ -26,10 +28,16 @@ public interface SzwlFeign {
     ResponseModel<TAdmin>  getAdmin(String id);
     @GetMapping("/tEquipment/getClientIdList")
     ResponseModel<TAdminEquipment>  getClientIdList(String adminId);
+    @GetMapping("/tEquipment/getClientIds")
+    ResponseModel<List<String>>  getClientIds(String adminId);
     @GetMapping("/tEquipment/findEquipmentByClientId")
     ResponseModel<TEquipment> findEquipmentByClientId(String clientId);
     @PostMapping("/tEquipment/getEquipmentByNameAndId")
     ResponseModel<TEquipment> getEquipmentByNameAndId(@RequestBody TEquipment equipment);
     @PostMapping("/tEquipment/findById")
     ResponseModel<TEquipment> findById(String id);
+    @GetMapping("/tAdmin/pageAdmin2")
+    ResponseModel<IPage<TAdmin>>  pageAdmin2(@RequestParam(value = "current") long current, @RequestParam(value = "size") long size);
+    @GetMapping("/tEquipment/pageEquipment2")
+    ResponseModel<IPage<TEquipment>>  pageEquipment2(@RequestParam(value = "current") long current, @RequestParam(value = "size") long size);
 }

+ 16 - 0
src/main/java/com/szwl/mapper/TAreaMapper.java

@@ -0,0 +1,16 @@
+package com.szwl.mapper;
+
+import com.szwl.model.entity.TArea;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author wuhs
+ * @since 2022-07-12
+ */
+public interface TAreaMapper extends BaseMapper<TArea> {
+
+}

+ 9 - 0
src/main/java/com/szwl/mapper/TOrderMapper.java

@@ -1,10 +1,13 @@
 package com.szwl.mapper;
 
 import com.szwl.model.bean.ChartBean;
+import com.szwl.model.bean.OrderDaoChuDTO;
 import com.szwl.model.entity.TOrder;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.szwl.model.query.Pageable;
 import com.szwl.model.query.StatisticsParam;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -21,4 +24,10 @@ public interface TOrderMapper extends BaseMapper<TOrder> {
     public List<ChartBean> getWeekStatistics(StatisticsParam param);
     public List<ChartBean> getMonthStatistics(StatisticsParam param);
     public List<ChartBean> getYearStatistics(StatisticsParam param);
+
+    List<ChartBean> getProductNameStatistics(StatisticsParam param);
+
+    List<ChartBean> getEquipmentStatistics(StatisticsParam param);
+
+    List<OrderDaoChuDTO> orderDaoChu(Date begin, Date end, Long adminId, String clientId, String type, long current, long size);
 }

+ 23 - 0
src/main/java/com/szwl/mapper/xml/TAreaMapper.xml

@@ -0,0 +1,23 @@
+<?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.szwl.mapper.TAreaMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.szwl.model.entity.TArea">
+        <id column="id" property="id" />
+        <result column="create_date" property="createDate" />
+        <result column="modify_date" property="modifyDate" />
+        <result column="orders" property="orders" />
+        <result column="full_name" property="fullName" />
+        <result column="name" property="name" />
+        <result column="tree_path" property="treePath" />
+        <result column="parent" property="parent" />
+        <result column="code" property="code" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, create_date, modify_date, orders, full_name, name, tree_path, parent, code
+    </sql>
+
+</mapper>

+ 81 - 0
src/main/java/com/szwl/mapper/xml/TOrderMapper.xml

@@ -70,6 +70,9 @@
         <if test="adminIds != null and adminIds !=''">
             and a.admin_id in #{adminIds}
         </if>
+        <if test="ifForeign != null and ifForeign ==1 and clientIds.size()>0">
+            and a.client_id in #{clientIds}
+        </if>
         <if test="equipmentId != null and equipmentId !=''">
             <if test="ifForeign != null and ifForeign ==0"> -- 国内用户
                 and a.equipment_id= #{equipmentId} -- 设备id
@@ -128,6 +131,9 @@
         <if test="adminIds != null and adminIds !=''">
             and a.admin_id in #{adminIds}
         </if>
+        <if test="ifForeign != null and ifForeign ==1 and clientIds.size()>0">
+            and a.client_id in #{clientIds}
+        </if>
         <if test="equipmentId != null and equipmentId !=''">
             <if test="ifForeign != null and ifForeign ==0"> -- 国内用户
                 and a.equipment_id= #{equipmentId} -- 设备id
@@ -175,6 +181,9 @@
         <if test="adminIds != null and adminIds !=''">
             and a.admin_id in #{adminIds}
         </if>
+        <if test="ifForeign != null and ifForeign ==1 and clientIds.size()>0">
+            and a.client_id in #{clientIds}
+        </if>
         <if test="equipmentId != null and equipmentId !=''">
             <if test="ifForeign != null and ifForeign ==0"> -- 国内用户
                 and a.equipment_id= #{equipmentId} -- 设备id
@@ -234,6 +243,9 @@
         <if test="adminIds != null and adminIds !=''">
             and a.admin_id in #{adminIds}
         </if>
+        <if test="ifForeign != null and ifForeign ==1 and clientIds.size()>0">
+            and a.client_id in #{clientIds}
+        </if>
         <if test="equipmentId != null and equipmentId !=''">
             <if test="ifForeign != null and ifForeign ==0"> -- 国内用户
                 and a.equipment_id= #{equipmentId} -- 设备id
@@ -257,5 +269,74 @@
             group by DATE_FORMAT( a.pay_date,'%m')) tab2 on tab1.categorie = tab2.categorie
         </if>
     </select>
+    <!-- 统计 机器花型销售排行-->
+    <select id="getProductNameStatistics" resultType="com.szwl.model.bean.ChartBean">
+        select product_name as categorie,count(1) as saleNum,sum(a.price) as salePrice
+        <if test="ifForeign != null and ifForeign ==0"> -- 国内用户
+            from t_order a
+            where a.status='1'
+            AND a.create_date >= STR_TO_DATE(CONCAT(#{startDate},' 00:00:00'),'%Y/%m/%d %H:%i:%s')
+            <![CDATA[ AND a.create_date <= STR_TO_DATE(CONCAT(#{endDate},' 23:59:59'),'%Y/%m/%d %H:%i:%s') ]]>
+        </if>
+        <if test="ifForeign != null and ifForeign ==1"> -- 国外用户
+            from  t_coin_order a
+            where 1=1
+            AND a.pay_date >= STR_TO_DATE(CONCAT(#{startDate},' 00:00:00'),'%Y/%m/%d %H:%i:%s')
+            <![CDATA[ AND a.pay_date <= STR_TO_DATE(CONCAT(#{endDate},' 23:59:59'),'%Y/%m/%d %H:%i:%s') ]]>
+        </if>
+        <if test="adminId != null and adminId !=''">
+            and a.admin_id= #{adminId} -- 订单所属商家id
+        </if>
+        group by a.product_name
+        order by salePrice desc
+        limit 30
+    </select>
+    <!-- 统计 机器销售排行-->
+    <select id="getEquipmentStatistics" resultType="com.szwl.model.bean.ChartBean">
+        select a.client_id as categorie,count(1) as saleNum,sum(a.price) as salePrice
+        <if test="ifForeign != null and ifForeign ==0"> -- 国内用户
+            from t_order a
+            where  a.status='1'
+        </if>
+        <if test="ifForeign != null and ifForeign ==1"> -- 国外用户
+            from  t_coin_order a
+            where 1=1
+        </if>
+        <if test="adminId != null and adminId !=''">
+            and a.admin_id= #{adminId} -- 订单所属商家id
+        </if>
+        <if test="ifForeign != null and ifForeign ==0"> -- 国内用户
+            AND a.create_date >= STR_TO_DATE(CONCAT(#{startDate},' 00:00:00'),'%Y/%m/%d %H:%i:%s')
+            <![CDATA[ AND a.create_date <= STR_TO_DATE(CONCAT(#{endDate},' 23:59:59'),'%Y/%m/%d %H:%i:%s') ]]>
+        </if>
+        <if test="ifForeign != null and ifForeign ==1"> -- 国外用户
+            AND a.pay_date >= STR_TO_DATE(CONCAT(#{startDate},' 00:00:00'),'%Y/%m/%d %H:%i:%s')
+            <![CDATA[ AND a.pay_date <= STR_TO_DATE(CONCAT(#{endDate},' 23:59:59'),'%Y/%m/%d %H:%i:%s') ]]>
+        </if>
+        group by a.client_id
+        order by salePrice desc
+        limit 30
+    </select>
+    <select id="orderDaoChu" resultType="com.szwl.model.bean.OrderDaoChuDTO">
+        select sum(price) AS priceTotal,admin_id AS adminId,client_id AS clientId
+         FROM  t_order  where 1=1
+        <if test="adminId != null and adminId !=''">
+            and admin_id= #{adminId} -- 订单所属商家id
+        </if>
+        <if test="clientId != null and clientId !=''">
+            and client_id = #{clientId}
+        </if>
+        and status = 1
+        and create_date >= STR_TO_DATE(CONCAT(#{begin},' 00:00:00'),'%Y/%m/%d %H:%i:%s')
+        <![CDATA[ and create_date <= STR_TO_DATE(CONCAT(#{end},' 23:59:59'),'%Y/%m/%d %H:%i:%s') ]]>
+        <if test="type != null and type !='' and type==2">
+            group by adminId
+        </if>
+        <if test="type != null and type !='' and type==1">
+            group by clientId
+        </if>
+        order by priceTotal desc
+        limit #{current} , #{size}
+    </select>
 
 </mapper>

+ 152 - 0
src/main/java/com/szwl/model/bean/OrderDaoChuDTO.java

@@ -0,0 +1,152 @@
+package com.szwl.model.bean;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Date;
+
+/**
+ * 订单daochu
+ */
+public class OrderDaoChuDTO {
+
+    /**
+     *
+     */
+
+    private String username;
+
+    /**
+     *
+     */
+    private String name;
+
+    /**
+     *
+     */
+    private String phone;
+
+    /**
+     *
+     */
+    private String address;
+
+    /**
+     *
+     */
+    private String clientId;
+
+    private BigInteger adminId;
+    /**
+     *
+     */
+    private String equipmentType;
+
+    /**
+     *
+     */
+    private Date createDate;
+
+    /**
+     *
+     */
+    private String equipmentTotal;
+
+    /**
+     *
+     */
+    private String lastUsername;
+
+
+    /**
+     * 销售总金额
+     */
+    private BigDecimal priceTotal;
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public String getClientId() {
+        return clientId;
+    }
+
+    public void setClientId(String clientId) {
+        this.clientId = clientId;
+    }
+
+    public String getEquipmentType() {
+        return equipmentType;
+    }
+
+    public void setEquipmentType(String equipmentType) {
+        this.equipmentType = equipmentType;
+    }
+
+    public Date getCreateDate() {
+        return createDate;
+    }
+
+    public void setCreateDate(Date createDate) {
+        this.createDate = createDate;
+    }
+
+    public String getEquipmentTotal() {
+        return equipmentTotal;
+    }
+
+    public void setEquipmentTotal(String equipmentTotal) {
+        this.equipmentTotal = equipmentTotal;
+    }
+
+    public String getLastUsername() {
+        return lastUsername;
+    }
+
+    public void setLastUsername(String lastUsername) {
+        this.lastUsername = lastUsername;
+    }
+
+    public BigDecimal getPriceTotal() {
+        return priceTotal;
+    }
+
+    public void setPriceTotal(BigDecimal priceTotal) {
+        this.priceTotal = priceTotal;
+    }
+
+    public BigInteger getAdminId() {
+        return adminId;
+    }
+
+    public void setAdminId(BigInteger adminId) {
+        this.adminId = adminId;
+    }
+}

+ 201 - 0
src/main/java/com/szwl/model/bean/OrderVo.java

@@ -0,0 +1,201 @@
+package com.szwl.model.bean;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+public class OrderVo {
+
+    /**
+     * 订单编号
+     */
+    private String sn;
+
+    /**
+     * 花型名称
+     */
+    private String productName;
+
+
+    /**
+     * 价格
+     */
+    private BigDecimal price;
+
+    /**
+     * 支付时间
+     */
+    private Date payDate;
+
+    /**
+     * 退款时间
+     */
+    private Date refundDate;
+
+    /**
+     * 支付流水号
+     */
+    private String trxNo;
+
+    /**
+     * 退款流水号
+     */
+    private String refundTrxNo;
+
+    /**
+     * 退款金额
+     */
+    private BigDecimal refundAmount;
+
+
+    /**
+     * 支付方式
+     */
+    private String frp_code;
+
+    public enum Status {
+
+        /**
+         * 未支付
+         */
+        unpay,
+
+        /**
+         * 已支付
+         */
+        pay,
+
+        /**
+         * 退款中:短暂状态
+         */
+        applyRefund,
+
+        /**
+         * 已退款
+         */
+        refund;
+
+        private static Map<String, Status> map = new HashMap<>();
+
+        static {
+            map.put("未支付", unpay);
+            map.put("已支付", pay);
+            map.put("退款中", applyRefund);
+            map.put("已退款", refund);
+        }
+
+        public static Status forValue(String value) {
+            return map.get(value);
+        }
+
+        @JsonValue
+        public String toValue() {
+            for (Map.Entry<String, Status> entry : map.entrySet()) {
+                if (entry.getValue() == this) {
+                    return entry.getKey();
+                }
+            }
+
+            return "";
+        }
+
+    }
+
+    /**
+     * 状态
+     */
+    private Status status;
+
+    private Date createDate;
+
+    public Date getCreateDate() {
+        return createDate;
+    }
+
+    public void setCreateDate(Date createDate) {
+        this.createDate = createDate;
+    }
+
+    public String getSn() {
+        return sn;
+    }
+
+    public void setSn(String sn) {
+        this.sn = sn;
+    }
+
+    public String getProductName() {
+        return productName;
+    }
+
+    public void setProductName(String productName) {
+        this.productName = productName;
+    }
+
+    public BigDecimal getPrice() {
+        return price;
+    }
+
+    public void setPrice(BigDecimal price) {
+        this.price = price;
+    }
+
+    public Date getPayDate() {
+        return payDate;
+    }
+
+    public void setPayDate(Date payDate) {
+        this.payDate = payDate;
+    }
+
+    public Date getRefundDate() {
+        return refundDate;
+    }
+
+    public void setRefundDate(Date refundDate) {
+        this.refundDate = refundDate;
+    }
+
+    public String getTrxNo() {
+        return trxNo;
+    }
+
+    public void setTrxNo(String trxNo) {
+        this.trxNo = trxNo;
+    }
+
+    public String getRefundTrxNo() {
+        return refundTrxNo;
+    }
+
+    public void setRefundTrxNo(String refundTrxNo) {
+        this.refundTrxNo = refundTrxNo;
+    }
+
+    public BigDecimal getRefundAmount() {
+        return refundAmount;
+    }
+
+    public void setRefundAmount(BigDecimal refundAmount) {
+        this.refundAmount = refundAmount;
+    }
+
+    public Status getStatus() {
+        return status;
+    }
+
+    public void setStatus(Status status) {
+        this.status = status;
+    }
+
+    public String getFrp_code() {
+        return frp_code;
+    }
+
+    public void setFrp_code(String frp_code) {
+        this.frp_code = frp_code;
+    }
+}

+ 48 - 0
src/main/java/com/szwl/model/entity/TArea.java

@@ -0,0 +1,48 @@
+package com.szwl.model.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.io.Serializable;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author wuhs
+ * @since 2022-07-12
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="TArea对象", description="")
+public class TArea implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    private Date createDate;
+
+    private Date modifyDate;
+
+    private Integer orders;
+
+    @ApiModelProperty(value = "地址全称;")
+    private String fullName;
+
+    private String name;
+
+    private String treePath;
+
+    private Long parent;
+
+    private String code;
+
+
+}

+ 31 - 0
src/main/java/com/szwl/model/excel/AdminStatisticsTarget.java

@@ -0,0 +1,31 @@
+package com.szwl.model.excel;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+
+import java.math.BigInteger;
+
+//导出商家增长统计
+public class AdminStatisticsTarget {
+    @Excel(name = "时间", width = 20.0D)
+    private String sTime;
+
+    @Excel(name = "总数", width = 20.0D)
+    private BigInteger totalNumber;
+
+    public String getsTime() {
+        return sTime;
+    }
+
+    public void setsTime(String sTime) {
+        this.sTime = sTime;
+    }
+
+    public BigInteger getTotalNumber() {
+        return totalNumber;
+    }
+
+    public void setTotalNumber(BigInteger totalNumber) {
+        this.totalNumber = totalNumber;
+    }
+
+}

+ 133 - 0
src/main/java/com/szwl/model/excel/AlarmRecordTarget.java

@@ -0,0 +1,133 @@
+package com.szwl.model.excel;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import cn.afterturn.easypoi.excel.annotation.ExcelTarget;
+import com.szwl.model.entity.TAlarmRecord;
+
+import java.text.SimpleDateFormat;
+
+@ExcelTarget("AlarmRecord")
+public class AlarmRecordTarget {
+
+    @Excel(name = "创建时间", width = 20.0D)
+    private String createDate;
+    /**
+     * 设备唯一码
+     */
+    @Excel(name = "设备唯一码", width = 20.0D)
+    private String clientId;
+
+    /**
+     * 设备名称
+     */
+    @Excel(name = "设备名称")
+    private String name;
+
+
+    /**
+     * 所属商家级别
+     */
+    @Excel(name = "所属商家级别")
+    private String adminLevel;
+
+    /**
+     * 冗余字段
+     * 所属商家
+     */
+    @Excel(name = "所属商家")
+    private String adminUserName;
+
+
+    /**
+     * 报警内容
+     */
+    @Excel(name = "报警内容")
+    private String alarmContent;
+
+    /**
+     * 备注
+     */
+    @Excel(name = "备注")
+    private String remark;
+
+    /**
+     * 发生时间
+     */
+    @Excel(name = "发生时间", width = 20.0D)
+    private String occurrenceTime;
+
+    public String getCreateDate() {
+        return createDate;
+    }
+
+    public void setCreateDate(String createDate) {
+        this.createDate = createDate;
+    }
+
+    public String getClientId() {
+        return clientId;
+    }
+
+    public void setClientId(String clientId) {
+        this.clientId = clientId;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getAdminLevel() {
+        return adminLevel;
+    }
+
+    public void setAdminLevel(String adminLevel) {
+        this.adminLevel = adminLevel;
+    }
+
+    public String getAdminUserName() {
+        return adminUserName;
+    }
+
+    public void setAdminUserName(String adminUserName) {
+        this.adminUserName = adminUserName;
+    }
+
+    public String getAlarmContent() {
+        return alarmContent;
+    }
+
+    public void setAlarmContent(String alarmContent) {
+        this.alarmContent = alarmContent;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public String getOccurrenceTime() {
+        return occurrenceTime;
+    }
+
+    public void setOccurrenceTime(String occurrenceTime) {
+        this.occurrenceTime = occurrenceTime;
+    }
+
+    public AlarmRecordTarget(TAlarmRecord alarmRecord) {
+        this.createDate = new SimpleDateFormat("yyyy年MM月dd日 HH时mm分ss秒").format(alarmRecord.getCreateDate());
+        this.clientId = alarmRecord.getClientId();
+        this.name = alarmRecord.getName();
+        this.adminLevel = alarmRecord.getAdminLevel();
+        this.adminUserName = alarmRecord.getAdminUserName();
+        this.alarmContent = alarmRecord.getAlarmContent();
+        this.remark = alarmRecord.getRemark();
+        this.occurrenceTime = new SimpleDateFormat("yyyy年MM月dd日 HH时mm分ss秒").format(alarmRecord.getOccurrenceTime());
+    }
+}

+ 120 - 0
src/main/java/com/szwl/model/excel/CoinOrderTarget.java

@@ -0,0 +1,120 @@
+package com.szwl.model.excel;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+public class CoinOrderTarget {
+
+    /**
+     * 订单编号
+     */
+    @Excel(name = "订单编号", width = 20.0D)
+    private String sn;
+    /**
+     * 花型名称
+     */
+    @Excel(name = "花型名称", width = 20.0D)
+    private String productName;
+
+    /**
+     * 所属商家
+     */
+    @Excel(name = "所属商家", width = 20.0D)
+    private String name;
+
+    /**
+     * 设备唯一码
+     */
+    @Excel(name = "设备唯一码", width = 20.0D)
+    private String clientId;
+
+    /**
+     * 支付时间
+     */
+    @Excel(name = "支付时间", width = 20.0D)
+    private Date payDate;
+
+    /**
+     * 状态
+     */
+    @Excel(name = "状态", width = 20.0D)
+    private String status;
+
+    /**
+     * 支付方式
+     */
+    @Excel(name = "支付方式", width = 20.0D)
+    private String frp_code;
+
+    /**
+     * 价格
+     */
+    @Excel(name = "价格", width = 20.0D)
+    private BigDecimal price;
+
+    public String getSn() {
+        return sn;
+    }
+
+    public void setSn(String sn) {
+        this.sn = sn;
+    }
+
+    public String getProductName() {
+        return productName;
+    }
+
+    public void setProductName(String productName) {
+        this.productName = productName;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getClientId() {
+        return clientId;
+    }
+
+    public void setClientId(String clientId) {
+        this.clientId = clientId;
+    }
+
+    public Date getPayDate() {
+        return payDate;
+    }
+
+    public void setPayDate(Date payDate) {
+        this.payDate = payDate;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getFrp_code() {
+        return frp_code;
+    }
+
+    public void setFrp_code(String frp_code) {
+        this.frp_code = frp_code;
+    }
+
+    public BigDecimal getPrice() {
+        return price;
+    }
+
+    public void setPrice(BigDecimal price) {
+        this.price = price;
+    }
+}

+ 49 - 0
src/main/java/com/szwl/model/excel/CoinStaticsTarget.java

@@ -0,0 +1,49 @@
+package com.szwl.model.excel;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+
+public class CoinStaticsTarget {
+
+
+    @Excel(name = "时间", width = 20.0D)
+    private String sTime;
+
+    /**
+     * 销售个数
+     */
+    @Excel(name = "销售个数")
+    private BigInteger totalNumber;
+
+    /**
+     * 销售总金额
+     */
+    @Excel(name = "销售总金额")
+    private BigDecimal totalPrice;
+
+    public String getsTime() {
+        return sTime;
+    }
+
+    public void setsTime(String sTime) {
+        this.sTime = sTime;
+    }
+
+    public BigInteger getTotalNumber() {
+        return totalNumber;
+    }
+
+    public void setTotalNumber(BigInteger totalNumber) {
+        this.totalNumber = totalNumber;
+    }
+
+    public BigDecimal getTotalPrice() {
+        return totalPrice;
+    }
+
+    public void setTotalPrice(BigDecimal totalPrice) {
+        this.totalPrice = totalPrice;
+    }
+}

+ 107 - 0
src/main/java/com/szwl/model/excel/OrderByAdminTarget.java

@@ -0,0 +1,107 @@
+package com.szwl.model.excel;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+
+import java.math.BigDecimal;
+
+//订单导出
+public class OrderByAdminTarget {
+
+    /**
+     *
+     */
+    @Excel(name = "账号", width = 20.0D)
+    private String username;
+
+    /**
+     *
+     */
+    @Excel(name = "商家", width = 20.0D)
+    private String name;
+
+    /**
+     *
+     */
+    @Excel(name = "电话", width = 20.0D)
+    private String phone;
+
+    /**
+     *
+     */
+    @Excel(name = "地址", width = 20.0D)
+    private String address;
+
+    /**
+     *
+     */
+    @Excel(name = "机器总数", width = 20.0D)
+    private String equipmentTotal;
+
+    /**
+     *
+     */
+    @Excel(name = "上级账号", width = 20.0D)
+    private String lastUsername;
+
+    /**
+     * 销售总金额
+     */
+    @Excel(name = "销售总金额", width = 20.0D)
+    private BigDecimal priceTotal;
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public String getEquipmentTotal() {
+        return equipmentTotal;
+    }
+
+    public void setEquipmentTotal(String equipmentTotal) {
+        this.equipmentTotal = equipmentTotal;
+    }
+
+    public String getLastUsername() {
+        return lastUsername;
+    }
+
+    public void setLastUsername(String lastUsername) {
+        this.lastUsername = lastUsername;
+    }
+
+    public BigDecimal getPriceTotal() {
+        return priceTotal;
+    }
+
+    public void setPriceTotal(BigDecimal priceTotal) {
+        this.priceTotal = priceTotal;
+    }
+}

+ 123 - 0
src/main/java/com/szwl/model/excel/OrderByClientidTarget.java

@@ -0,0 +1,123 @@
+package com.szwl.model.excel;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+//订单导出
+public class OrderByClientidTarget {
+
+    /**
+     *
+     */
+    @Excel(name = "账号", width = 20.0D)
+    private String username;
+
+    /**
+     *
+     */
+    @Excel(name = "商家", width = 20.0D)
+    private String name;
+
+    /**
+     *
+     */
+    @Excel(name = "电话", width = 20.0D)
+    private String phone;
+
+    /**
+     *
+     */
+    @Excel(name = "地址", width = 20.0D)
+    private String address;
+
+    /**
+     *
+     */
+    @Excel(name = "设备编码", width = 30.0D)
+    private String clientId;
+
+    /**
+     *
+     */
+    @Excel(name = "机型", width = 20.0D)
+    private String equipmentType;
+
+    /**
+     *
+     */
+    @Excel(name = "创建时间", width = 20.0D)
+    private Date createDate;
+
+
+    /**
+     * 销售总金额
+     */
+    @Excel(name = "销售总金额", width = 20.0D)
+    private BigDecimal priceTotal;
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public String getClientId() {
+        return clientId;
+    }
+
+    public void setClientId(String clientId) {
+        this.clientId = clientId;
+    }
+
+    public String getEquipmentType() {
+        return equipmentType;
+    }
+
+    public void setEquipmentType(String equipmentType) {
+        this.equipmentType = equipmentType;
+    }
+
+    public Date getCreateDate() {
+        return createDate;
+    }
+
+    public void setCreateDate(Date createDate) {
+        this.createDate = createDate;
+    }
+
+    public BigDecimal getPriceTotal() {
+        return priceTotal;
+    }
+
+    public void setPriceTotal(BigDecimal priceTotal) {
+        this.priceTotal = priceTotal;
+    }
+}

+ 52 - 0
src/main/java/com/szwl/model/excel/OrderStaticsTarget.java

@@ -0,0 +1,52 @@
+package com.szwl.model.excel;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+
+public class OrderStaticsTarget {
+
+    /**
+     * 时间
+     */
+    @Excel(name = "时间", width = 20.0D)
+    private String sTime;
+
+
+    /**
+     * 销售总金额
+     */
+    @Excel(name = "销售总金额")
+    private BigDecimal totalPrice;
+
+    /**
+     * 销售个数
+     */
+    @Excel(name = "销售个数")
+    private BigInteger totalNumber;
+
+    public String getsTime() {
+        return sTime;
+    }
+
+    public void setsTime(String sTime) {
+        this.sTime = sTime;
+    }
+
+    public BigDecimal getTotalPrice() {
+        return totalPrice;
+    }
+
+    public void setTotalPrice(BigDecimal totalPrice) {
+        this.totalPrice = totalPrice;
+    }
+
+    public BigInteger getTotalNumber() {
+        return totalNumber;
+    }
+
+    public void setTotalNumber(BigInteger totalNumber) {
+        this.totalNumber = totalNumber;
+    }
+}

+ 175 - 0
src/main/java/com/szwl/model/excel/OrderTarget.java

@@ -0,0 +1,175 @@
+package com.szwl.model.excel;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+//订单导出
+public class OrderTarget {
+
+    /**
+     * 订单编号
+     */
+    @Excel(name = "订单编号", width = 20.0D)
+    private String sn;
+
+    /**
+     * 花型名称
+     */
+    @Excel(name = "花型名称", width = 20.0D)
+    private String productName;
+
+
+    /**
+     * 价格
+     */
+    @Excel(name = "价格", width = 20.0D)
+    private BigDecimal price;
+
+    /**
+     * 设备唯一码
+     */
+    @Excel(name = "设备唯一码", width = 20.0D)
+    private String clientId;
+
+    /**
+     * 所属商家
+     */
+    @Excel(name = "所属商家", width = 20.0D)
+    private String name;
+
+    /**
+     * 支付时间
+     */
+    @Excel(name = "支付时间", width = 20.0D)
+    private Date payDate;
+
+    /**
+     * 退款时间
+     */
+    @Excel(name = "退款时间", width = 20.0D)
+    private Date refundDate;
+
+
+    /**
+     * 状态
+     */
+    @Excel(name = "状态", width = 20.0D)
+    private String status;
+
+    /**
+     * 支付方式
+     */
+    @Excel(name = "支付方式", width = 20.0D)
+    private String frp_code;
+
+    /**
+     * 支付方式
+     */
+    @Excel(name = "一级分账比例", width = 20.0D)
+    private String agencyProportion;
+
+    @Excel(name = "二级分账比例", width = 20.0D)
+    private String merchantProportion;
+
+    @Excel(name = "三级分账比例", width = 20.0D)
+    private String personageProportion;
+
+    public String getAgencyProportion() {
+        return agencyProportion;
+    }
+
+    public void setAgencyProportion(String agencyProportion) {
+        this.agencyProportion = agencyProportion;
+    }
+
+    public String getMerchantProportion() {
+        return merchantProportion;
+    }
+
+    public void setMerchantProportion(String merchantProportion) {
+        this.merchantProportion = merchantProportion;
+    }
+
+    public String getPersonageProportion() {
+        return personageProportion;
+    }
+
+    public void setPersonageProportion(String personageProportion) {
+        this.personageProportion = personageProportion;
+    }
+
+    public String getSn() {
+        return sn;
+    }
+
+    public void setSn(String sn) {
+        this.sn = sn;
+    }
+
+    public String getProductName() {
+        return productName;
+    }
+
+    public void setProductName(String productName) {
+        this.productName = productName;
+    }
+
+    public BigDecimal getPrice() {
+        return price;
+    }
+
+    public void setPrice(BigDecimal price) {
+        this.price = price;
+    }
+
+    public String getClientId() {
+        return clientId;
+    }
+
+    public void setClientId(String clientId) {
+        this.clientId = clientId;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Date getPayDate() {
+        return payDate;
+    }
+
+    public void setPayDate(Date payDate) {
+        this.payDate = payDate;
+    }
+
+    public Date getRefundDate() {
+        return refundDate;
+    }
+
+    public void setRefundDate(Date refundDate) {
+        this.refundDate = refundDate;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getFrp_code() {
+        return frp_code;
+    }
+
+    public void setFrp_code(String frp_code) {
+        this.frp_code = frp_code;
+    }
+
+}

+ 54 - 0
src/main/java/com/szwl/model/excel/ProductStaticTarget.java

@@ -0,0 +1,54 @@
+package com.szwl.model.excel;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import cn.afterturn.easypoi.excel.annotation.ExcelTarget;
+
+import java.math.BigInteger;
+
+/**
+ * 花型统计导出
+ */
+@ExcelTarget("ProductStatic")
+public class ProductStaticTarget {
+
+    /**
+     * 商品名称
+     */
+    @Excel(name = "商品名称")
+    private String productName;
+
+    /**
+     * 销售个数
+     */
+    @Excel(name = "销售个数")
+    private BigInteger totalNumber;
+    /**
+     * 开始日期
+     */
+    @Excel(name = "时间", width = 30.0D)
+    private String staticTime;
+
+    public String getProductName() {
+        return productName;
+    }
+
+    public void setProductName(String productName) {
+        this.productName = productName;
+    }
+
+    public BigInteger getTotalNumber() {
+        return totalNumber;
+    }
+
+    public void setTotalNumber(BigInteger totalNumber) {
+        this.totalNumber = totalNumber;
+    }
+
+    public String getStaticTime() {
+        return staticTime;
+    }
+
+    public void setStaticTime(String staticTime) {
+        this.staticTime = staticTime;
+    }
+}

+ 110 - 0
src/main/java/com/szwl/model/excel/PromoCodeTarget.java

@@ -0,0 +1,110 @@
+package com.szwl.model.excel;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+
+import java.util.Date;
+
+//订单导出
+public class PromoCodeTarget {
+
+    /**
+     * 优惠码
+     */
+    @Excel(name = "优惠码", width = 20.0D)
+    private Long code;
+
+    /**
+     * 商家id
+     */
+    @Excel(name = "商家id", width = 20.0D)
+    private String adminId;
+
+
+    /**
+     * 所属商家
+     */
+    @Excel(name = "所属商家", width = 20.0D)
+    private String userName;
+
+    /**
+     * 添加时间
+     */
+    @Excel(name = "添加时间", width = 20.0D)
+    private Date createDate;
+
+
+
+    /**
+     * 状态
+     */
+    @Excel(name = "状态", width = 20.0D)
+    private String isUse;
+
+    /**
+     * 使用时间
+     */
+    @Excel(name = "使用时间", width = 20.0D)
+    private String useDate;
+
+    /**
+     * 使用机器
+     */
+    @Excel(name = "使用机器", width = 20.0D)
+    private String useBy;
+
+    public Long getCode() {
+        return code;
+    }
+
+    public void setCode(Long code) {
+        this.code = code;
+    }
+
+    public String getAdminId() {
+        return adminId;
+    }
+
+    public void setAdminId(String adminId) {
+        this.adminId = adminId;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public Date getCreateDate() {
+        return createDate;
+    }
+
+    public void setCreateDate(Date createDate) {
+        this.createDate = createDate;
+    }
+
+    public String getIsUse() {
+        return isUse;
+    }
+
+    public void setIsUse(String isUse) {
+        this.isUse = isUse;
+    }
+
+    public String getUseDate() {
+        return useDate;
+    }
+
+    public void setUseDate(String useDate) {
+        this.useDate = useDate;
+    }
+
+    public String getUseBy() {
+        return useBy;
+    }
+
+    public void setUseBy(String useBy) {
+        this.useBy = useBy;
+    }
+}

+ 119 - 0
src/main/java/com/szwl/model/excel/ShandeMchCompanyListTarget.java

@@ -0,0 +1,119 @@
+package com.szwl.model.excel;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+
+//订单导出
+public class ShandeMchCompanyListTarget {
+
+    /**
+     *
+     */
+    @Excel(name = "序号(选填)", width = 20.0D)
+    private String no;
+
+    /**
+     *
+     */
+    @Excel(name = "收款方名称(必填)", width = 35.0D)
+    private String bankName;
+
+    /**
+     *
+     */
+    @Excel(name = "收款方对公银行账号(必填)", width = 35.0D)
+    private String bankNo;
+
+    /**
+     *收款方账户联行号(必填)
+     */
+    @Excel(name = "收款方账户联行号(必填)", width = 30.0D)
+    private String bankChannelNo;
+
+    /**
+     *收款方账户联行号(必填)
+     */
+    @Excel(name = "收款方账户开户行(必填,精确到支行)", width = 40.0D)
+    private String bankChannelName;
+
+    /**
+     *
+     */
+    @Excel(name = "金额(必填,单位:元)", width = 20.0D)
+    private String settleableBalance;
+
+    /**
+     *
+     */
+    @Excel(name = "附言(选填)", width = 20.0D)
+    private String zengyan;
+
+    /**
+     *
+     */
+    @Excel(name = "收款人手机号(选填)", width = 20.0D)
+    private String phone;
+
+    public String getNo() {
+        return no;
+    }
+
+    public void setNo(String no) {
+        this.no = no;
+    }
+
+    public String getBankName() {
+        return bankName;
+    }
+
+    public void setBankName(String bankName) {
+        this.bankName = bankName;
+    }
+
+    public String getBankNo() {
+        return bankNo;
+    }
+
+    public void setBankNo(String bankNo) {
+        this.bankNo = bankNo;
+    }
+
+    public String getSettleableBalance() {
+        return settleableBalance;
+    }
+
+    public void setSettleableBalance(String settleableBalance) {
+        this.settleableBalance = settleableBalance;
+    }
+
+    public String getZengyan() {
+        return zengyan;
+    }
+
+    public void setZengyan(String zengyan) {
+        this.zengyan = zengyan;
+    }
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public String getBankChannelNo() {
+        return bankChannelNo;
+    }
+
+    public void setBankChannelNo(String bankChannelNo) {
+        this.bankChannelNo = bankChannelNo;
+    }
+
+    public String getBankChannelName() {
+        return bankChannelName;
+    }
+
+    public void setBankChannelName(String bankChannelName) {
+        this.bankChannelName = bankChannelName;
+    }
+}

+ 91 - 0
src/main/java/com/szwl/model/excel/ShandeMchListTarget.java

@@ -0,0 +1,91 @@
+package com.szwl.model.excel;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+
+//订单导出
+public class ShandeMchListTarget {
+
+    /**
+     *
+     */
+    @Excel(name = "序号(选填)", width = 20.0D)
+    private String no;
+
+    /**
+     *
+     */
+    @Excel(name = "收款方名称(必填)", width = 30.0D)
+    private String bankName;
+
+    /**
+     *
+     */
+    @Excel(name = "收款方杉德宝账号(必填)", width = 30.0D)
+    private String bankNo;
+
+    /**
+     *
+     */
+    @Excel(name = "金额(必填,单位:元)", width = 20.0D)
+    private String settleableBalance;
+
+    /**
+     *
+     */
+    @Excel(name = "转账附言(选填)", width = 20.0D)
+    private String zengyan;
+
+    /**
+     *
+     */
+    @Excel(name = "收款人手机号(选填)", width = 20.0D)
+    private String phone;
+
+    public String getNo() {
+        return no;
+    }
+
+    public void setNo(String no) {
+        this.no = no;
+    }
+
+    public String getBankName() {
+        return bankName;
+    }
+
+    public void setBankName(String bankName) {
+        this.bankName = bankName;
+    }
+
+    public String getBankNo() {
+        return bankNo;
+    }
+
+    public void setBankNo(String bankNo) {
+        this.bankNo = bankNo;
+    }
+
+    public String getSettleableBalance() {
+        return settleableBalance;
+    }
+
+    public void setSettleableBalance(String settleableBalance) {
+        this.settleableBalance = settleableBalance;
+    }
+
+    public String getZengyan() {
+        return zengyan;
+    }
+
+    public void setZengyan(String zengyan) {
+        this.zengyan = zengyan;
+    }
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+}

+ 396 - 0
src/main/java/com/szwl/model/query/Filter.java

@@ -0,0 +1,396 @@
+/*
+ * 
+ * 
+ * 
+ */
+package com.szwl.model.query;
+
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+
+import java.io.Serializable;
+
+/**
+ * 筛选
+ *
+ *
+ *
+ */
+public class Filter implements Serializable {
+
+    private static final long serialVersionUID = -8712382358441065075L;
+
+
+
+    /**
+     * 运算符
+     */
+    public enum Operator {
+
+        /** 等于 */
+        eq,
+
+        /** 不等于 */
+        ne,
+
+        /** 大于 */
+        gt,
+
+        /** 小于 */
+        lt,
+
+        /** 大于等于 */
+        ge,
+        geDate,
+        /** 小于等于 */
+        le,
+        leDate,
+        /** 相似 */
+        like,
+
+        /** 包含 */
+        in,
+
+        /** 为Null */
+        isNull,
+
+        /** 不为Null */
+        isNotNull;
+
+        /**
+         * 从String中获取Operator
+         *
+         * @param value
+         *            值
+         * @return String对应的operator
+         */
+        public static Operator fromString(String value) {
+            return Operator.valueOf(value.toLowerCase());
+        }
+    }
+
+    /** 默认是否忽略大小写 */
+    private static final boolean DEFAULT_IGNORE_CASE = false;
+
+    /** 属性 */
+    private String property;
+
+    /** 运算符 */
+    private Operator operator;
+
+    /** 值 */
+    private Object value;
+
+    /** 是否忽略大小写 */
+    private Boolean ignoreCase = DEFAULT_IGNORE_CASE;
+
+    /**
+     * 初始化一个新创建的Filter对象
+     */
+    public Filter() {
+    }
+
+    /**
+     * 初始化一个新创建的Filter对象
+     *
+     * @param property
+     *            属性
+     * @param operator
+     *            运算符
+     * @param value
+     *            值
+     */
+    public Filter(String property, Operator operator, Object value) {
+        this.property = property;
+        this.operator = operator;
+        this.value = value;
+    }
+
+    /**
+     * 初始化一个新创建的Filter对象
+     *
+     * @param property
+     *            属性
+     * @param operator
+     *            运算符
+     * @param value
+     *            值
+     * @param ignoreCase
+     *            忽略大小写
+     */
+    public Filter(String property, Operator operator, Object value, boolean ignoreCase) {
+        this.property = property;
+        this.operator = operator;
+        this.value = value;
+        this.ignoreCase = ignoreCase;
+    }
+
+    /**
+     * 返回等于筛选
+     *
+     * @param property
+     *            属性
+     * @param value
+     *            值
+     * @return 等于筛选
+     */
+    public static Filter eq(String property, Object value) {
+        return new Filter(property, Operator.eq, value);
+    }
+
+    /**
+     * 返回等于筛选
+     *
+     * @param property
+     *            属性
+     * @param value
+     *            值
+     * @param ignoreCase
+     *            忽略大小写
+     * @return 等于筛选
+     */
+    public static Filter eq(String property, Object value, boolean ignoreCase) {
+        return new Filter(property, Operator.eq, value, ignoreCase);
+    }
+
+    /**
+     * 返回不等于筛选
+     *
+     * @param property
+     *            属性
+     * @param value
+     *            值
+     * @return 不等于筛选
+     */
+    public static Filter ne(String property, Object value) {
+        return new Filter(property, Operator.ne, value);
+    }
+
+    /**
+     * 返回不等于筛选
+     *
+     * @param property
+     *            属性
+     * @param value
+     *            值
+     * @param ignoreCase
+     *            忽略大小写
+     * @return 不等于筛选
+     */
+    public static Filter ne(String property, Object value, boolean ignoreCase) {
+        return new Filter(property, Operator.ne, value, ignoreCase);
+    }
+
+    /**
+     * 返回大于筛选
+     *
+     * @param property
+     *            属性
+     * @param value
+     *            值
+     * @return 大于筛选
+     */
+    public static Filter gt(String property, Object value) {
+        return new Filter(property, Operator.gt, value);
+    }
+
+    /**
+     * 返回小于筛选
+     *
+     * @param property
+     *            属性
+     * @param value
+     *            值
+     * @return 小于筛选
+     */
+    public static Filter lt(String property, Object value) {
+        return new Filter(property, Operator.lt, value);
+    }
+
+    /**
+     * 返回大于等于筛选
+     *
+     * @param property
+     *            属性
+     * @param value
+     *            值
+     * @return 大于等于筛选
+     */
+    public static Filter ge(String property, Object value) {
+        return new Filter(property, Operator.ge, value);
+    }
+
+    public static Filter geDate(String property, Object value) {
+        return new Filter(property, Operator.geDate, value);
+    }
+    /**
+     * 返回小于等于筛选
+     *
+     * @param property
+     *            属性
+     * @param value
+     *            值
+     * @return 小于等于筛选
+     */
+    public static Filter le(String property, Object value) {
+        return new Filter(property, Operator.le, value);
+    }
+    public static Filter leDate(String property, Object value) {
+        return new Filter(property, Operator.leDate, value);
+    }
+
+    /**
+     * 返回相似筛选
+     *
+     * @param property
+     *            属性
+     * @param value
+     *            值
+     * @return 相似筛选
+     */
+    public static Filter like(String property, Object value) {
+        return new Filter(property, Operator.like, value);
+    }
+
+    /**
+     * 返回包含筛选
+     *
+     * @param property
+     *            属性
+     * @param value
+     *            值
+     * @return 包含筛选
+     */
+    public static Filter in(String property, Object value) {
+        return new Filter(property, Operator.in, value);
+    }
+
+    /**
+     * 返回为Null筛选
+     *
+     * @param property
+     *            属性
+     * @return 为Null筛选
+     */
+    public static Filter isNull(String property) {
+        return new Filter(property, Operator.isNull, null);
+    }
+
+    /**
+     * 返回不为Null筛选
+     *
+     * @param property
+     *            属性
+     * @return 不为Null筛选
+     */
+    public static Filter isNotNull(String property) {
+        return new Filter(property, Operator.isNotNull, null);
+    }
+
+    /**
+     * 返回忽略大小写筛选
+     *
+     * @return 忽略大小写筛选
+     */
+    public Filter ignoreCase() {
+        this.ignoreCase = true;
+        return this;
+    }
+
+    /**
+     * 获取属性
+     *
+     * @return 属性
+     */
+    public String getProperty() {
+        return property;
+    }
+
+    /**
+     * 设置属性
+     *
+     * @param property
+     *            属性
+     */
+    public void setProperty(String property) {
+        this.property = property;
+    }
+
+    /**
+     * 获取运算符
+     *
+     * @return 运算符
+     */
+    public Operator getOperator() {
+        return operator;
+    }
+
+    /**
+     * 设置运算符
+     *
+     * @param operator
+     *            运算符
+     */
+    public void setOperator(Operator operator) {
+        this.operator = operator;
+    }
+
+    /**
+     * 获取值
+     *
+     * @return 值
+     */
+    public Object getValue() {
+        return value;
+    }
+
+    /**
+     * 设置值
+     *
+     * @param value
+     *            值
+     */
+    public void setValue(Object value) {
+        this.value = value;
+    }
+
+    /**
+     * 获取是否忽略大小写
+     *
+     * @return 是否忽略大小写
+     */
+    public Boolean getIgnoreCase() {
+        return ignoreCase;
+    }
+
+    /**
+     * 设置是否忽略大小写
+     *
+     * @param ignoreCase
+     *            是否忽略大小写
+     */
+    public void setIgnoreCase(Boolean ignoreCase) {
+        this.ignoreCase = ignoreCase;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        if (this == obj) {
+            return true;
+        }
+        Filter other = (Filter) obj;
+        return new EqualsBuilder().append(getProperty(), other.getProperty()).append(getOperator(), other.getOperator()).append(getValue(), other.getValue()).isEquals();
+    }
+
+    @Override
+    public int hashCode() {
+        return new HashCodeBuilder(17, 37).append(getProperty()).append(getOperator()).append(getValue()).toHashCode();
+    }
+
+}

+ 152 - 0
src/main/java/com/szwl/model/query/Order.java

@@ -0,0 +1,152 @@
+/*
+ * 
+ * 
+ * 
+ */
+package com.szwl.model.query;
+
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+
+import java.io.Serializable;
+
+/**
+ * 排序
+ */
+public class Order implements Serializable {
+
+    private static final long serialVersionUID = -3078342809727773232L;
+
+    /**
+     * 方向
+     */
+    public enum Direction {
+
+        /**
+         * 递增
+         */
+        asc,
+
+        /**
+         * 递减
+         */
+        desc;
+
+        /**
+         * 从String中获取Direction
+         *
+         * @param value 值
+         * @return String对应的Direction
+         */
+        public static Direction fromString(String value) {
+            return Direction.valueOf(value.toLowerCase());
+        }
+    }
+
+    /**
+     * 默认方向
+     */
+    private static final Direction DEFAULT_DIRECTION = Direction.desc;
+
+    /**
+     * 属性
+     */
+    private String property;
+
+    /**
+     * 方向
+     */
+    private Direction direction = DEFAULT_DIRECTION;
+
+    /**
+     * 初始化一个新创建的Order对象
+     */
+    public Order() {
+    }
+
+    /**
+     * @param property  属性
+     * @param direction 方向
+     */
+    public Order(String property, Direction direction) {
+        this.property = property;
+        this.direction = direction;
+    }
+
+    /**
+     * 返回递增排序
+     *
+     * @param property 属性
+     * @return 递增排序
+     */
+    public static Order asc(String property) {
+        return new Order(property, Direction.asc);
+    }
+
+    /**
+     * 返回递减排序
+     *
+     * @param property 属性
+     * @return 递减排序
+     */
+    public static Order desc(String property) {
+        return new Order(property, Direction.desc);
+    }
+
+    /**
+     * 获取属性
+     *
+     * @return 属性
+     */
+    public String getProperty() {
+        return property;
+    }
+
+    /**
+     * 设置属性
+     *
+     * @param property 属性
+     */
+    public void setProperty(String property) {
+        this.property = property;
+    }
+
+    /**
+     * 获取方向
+     *
+     * @return 方向
+     */
+    public Direction getDirection() {
+        return direction;
+    }
+
+    /**
+     * 设置方向
+     *
+     * @param direction 方向
+     */
+    public void setDirection(Direction direction) {
+        this.direction = direction;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        if (this == obj) {
+            return true;
+        }
+        Order other = (Order) obj;
+        return new EqualsBuilder().append(getProperty(), other.getProperty()).append(getDirection(), other.getDirection()).isEquals();
+    }
+
+    @Override
+    public int hashCode() {
+        return new HashCodeBuilder(17, 37).append(getProperty()).append(getDirection()).toHashCode();
+    }
+
+}

+ 270 - 0
src/main/java/com/szwl/model/query/Pageable.java

@@ -0,0 +1,270 @@
+/*
+ * 
+ * 
+ * 
+ */
+package com.szwl.model.query;
+
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 分页信息
+ */
+public class Pageable implements Serializable {
+
+    private static final long serialVersionUID = -3930180379790344299L;
+
+    /**
+     * 默认页码
+     */
+    private static final int DEFAULT_PAGE_NUMBER = 1;
+
+    /**
+     * 默认每页记录数
+     */
+    private static final int DEFAULT_PAGE_SIZE = 20;
+
+    /**
+     * 最大每页记录数
+     */
+    private static final int MAX_PAGE_SIZE = 1000;
+
+    /**
+     * 页码
+     */
+    private int pageNumber = DEFAULT_PAGE_NUMBER;
+
+    /**
+     * 每页记录数
+     */
+    private int pageSize = DEFAULT_PAGE_SIZE;
+
+    /**
+     * 搜索属性
+     */
+    private String searchProperty;
+
+    /**
+     * 搜索值
+     */
+    private String searchValue;
+
+    /**
+     * 排序属性
+     */
+    private String orderProperty;
+
+    /**
+     * 排序方向
+     */
+    private Order.Direction orderDirection;
+
+    /**
+     * 筛选
+     */
+    private List<Filter> filters = new ArrayList<Filter>();
+
+    /**
+     * 排序
+     */
+    private List<Order> orders = new ArrayList<Order>();
+
+    /**
+     * 初始化一个新创建的Pageable对象
+     */
+    public Pageable() {
+    }
+
+    /**
+     * 初始化一个新创建的Pageable对象
+     *
+     * @param pageNumber 页码
+     * @param pageSize   每页记录数
+     */
+    public Pageable(Integer pageNumber, Integer pageSize) {
+        if (pageNumber != null && pageNumber >= 1) {
+            this.pageNumber = pageNumber;
+        }
+        if (pageSize != null && pageSize >= 1 && pageSize <= MAX_PAGE_SIZE) {
+            this.pageSize = pageSize;
+        }
+    }
+
+    /**
+     * 获取页码
+     *
+     * @return 页码
+     */
+    public int getPageNumber() {
+        return pageNumber;
+    }
+
+    /**
+     * 设置页码
+     *
+     * @param pageNumber 页码
+     */
+    public void setPageNumber(int pageNumber) {
+        if (pageNumber < 1) {
+            pageNumber = DEFAULT_PAGE_NUMBER;
+        }
+        this.pageNumber = pageNumber;
+    }
+
+    /**
+     * 获取每页记录数
+     *
+     * @return 每页记录数
+     */
+    public int getPageSize() {
+        return pageSize;
+    }
+
+    /**
+     * 设置每页记录数
+     *
+     * @param pageSize 每页记录数
+     */
+    public void setPageSize(int pageSize) {
+        if (pageSize < 1 || pageSize > MAX_PAGE_SIZE) {
+            pageSize = DEFAULT_PAGE_SIZE;
+        }
+        this.pageSize = pageSize;
+    }
+
+    /**
+     * 获取搜索属性
+     *
+     * @return 搜索属性
+     */
+    public String getSearchProperty() {
+        return searchProperty;
+    }
+
+    /**
+     * 设置搜索属性
+     *
+     * @param searchProperty 搜索属性
+     */
+    public void setSearchProperty(String searchProperty) {
+        this.searchProperty = searchProperty;
+    }
+
+    /**
+     * 获取搜索值
+     *
+     * @return 搜索值
+     */
+    public String getSearchValue() {
+        return searchValue;
+    }
+
+    /**
+     * 设置搜索值
+     *
+     * @param searchValue 搜索值
+     */
+    public void setSearchValue(String searchValue) {
+        this.searchValue = searchValue;
+    }
+
+    /**
+     * 获取排序属性
+     *
+     * @return 排序属性
+     */
+    public String getOrderProperty() {
+        return orderProperty;
+    }
+
+    /**
+     * 设置排序属性
+     *
+     * @param orderProperty 排序属性
+     */
+    public void setOrderProperty(String orderProperty) {
+        this.orderProperty = orderProperty;
+    }
+
+    /**
+     * 获取排序方向
+     *
+     * @return 排序方向
+     */
+    public Order.Direction getOrderDirection() {
+        return orderDirection;
+    }
+
+    /**
+     * 设置排序方向
+     *
+     * @param orderDirection 排序方向
+     */
+    public void setOrderDirection(Order.Direction orderDirection) {
+        this.orderDirection = orderDirection;
+    }
+
+    /**
+     * 获取筛选
+     *
+     * @return 筛选
+     */
+    public List<Filter> getFilters() {
+        if(filters==null) return new ArrayList<>();
+        return filters;
+    }
+
+    /**
+     * 设置筛选
+     *
+     * @param filters 筛选
+     */
+    public void setFilters(List<Filter> filters) {
+        this.filters = filters;
+    }
+
+    /**
+     * 获取排序
+     *
+     * @return 排序
+     */
+    public List<Order> getOrders() {
+        return orders;
+    }
+
+    /**
+     * 设置排序
+     *
+     * @param orders 排序
+     */
+    public void setOrders(List<Order> orders) {
+        this.orders = orders;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        if (this == obj) {
+            return true;
+        }
+        Pageable other = (Pageable) obj;
+        return new EqualsBuilder().append(getPageNumber(), other.getPageNumber()).append(getPageSize(), other.getPageSize()).append(getSearchProperty(), other.getSearchProperty()).append(getSearchValue(), other.getSearchValue()).append(getOrderProperty(), other.getOrderProperty()).append(getOrderDirection(), other.getOrderDirection()).append(getFilters(), other.getFilters())
+                .append(getOrders(), other.getOrders()).isEquals();
+    }
+
+    @Override
+    public int hashCode() {
+        return new HashCodeBuilder(17, 37).append(getPageNumber()).append(getPageSize()).append(getSearchProperty()).append(getSearchValue()).append(getOrderProperty()).append(getOrderDirection()).append(getFilters()).append(getOrders()).toHashCode();
+    }
+
+}

+ 4 - 1
src/main/java/com/szwl/model/query/StatisticsParam.java

@@ -41,6 +41,9 @@ public class StatisticsParam {
     @ApiModelProperty(value="")
     private List<Long> adminIds;
 
+    @ApiModelProperty(value="")
+    private List<String> ClientIds;
+
     @ApiModelProperty(value="开始日期")
     private String startDate;
 
@@ -53,7 +56,7 @@ public class StatisticsParam {
     @ApiModelProperty(value="支付类型")
     private String payType;
 
-    @ApiModelProperty(value="统计类型")
+    @ApiModelProperty(value="统计类型,0:销售额统计,1:花型统计")
     private String changeType;
 
     @ApiModelProperty(value="是否外国")

+ 16 - 0
src/main/java/com/szwl/service/TAreaService.java

@@ -0,0 +1,16 @@
+package com.szwl.service;
+
+import com.szwl.model.entity.TArea;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author wuhs
+ * @since 2022-07-12
+ */
+public interface TAreaService extends IService<TArea> {
+
+}

+ 6 - 0
src/main/java/com/szwl/service/TCoinOrderService.java

@@ -1,7 +1,11 @@
 package com.szwl.service;
 
+import com.szwl.model.entity.TAdmin;
 import com.szwl.model.entity.TCoinOrder;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.szwl.model.excel.CoinOrderTarget;
+
+import java.util.List;
 
 /**
  * <p>
@@ -13,4 +17,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface TCoinOrderService extends IService<TCoinOrder> {
 
+
+    List<CoinOrderTarget> findByCoinOrder(TAdmin admin, List<TCoinOrder> list);
 }

+ 13 - 0
src/main/java/com/szwl/service/TOrderService.java

@@ -1,10 +1,17 @@
 package com.szwl.service;
 
 import com.szwl.model.bean.ChartColumn;
+import com.szwl.model.bean.OrderDaoChuDTO;
+import com.szwl.model.entity.TAdmin;
 import com.szwl.model.entity.TOrder;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.szwl.model.excel.OrderTarget;
+import com.szwl.model.query.Pageable;
 import com.szwl.model.query.StatisticsParam;
 
+import java.util.Date;
+import java.util.List;
+
 /**
  * <p>
  *  服务类
@@ -16,4 +23,10 @@ import com.szwl.model.query.StatisticsParam;
 public interface TOrderService extends IService<TOrder> {
 
     ChartColumn getStatistics(StatisticsParam param);
+
+    ChartColumn getEquipmentStatistics(StatisticsParam param);
+
+    List<OrderDaoChuDTO> orderDaoChu(Date begin, Date end, Long adminId, String clientId, String type, long current, long size);
+
+    List<OrderTarget> findById(TAdmin admin, List<TOrder> list);
 }

+ 20 - 0
src/main/java/com/szwl/service/impl/TAreaServiceImpl.java

@@ -0,0 +1,20 @@
+package com.szwl.service.impl;
+
+import com.szwl.model.entity.TArea;
+import com.szwl.mapper.TAreaMapper;
+import com.szwl.service.TAreaService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author wuhs
+ * @since 2022-07-12
+ */
+@Service
+public class TAreaServiceImpl extends ServiceImpl<TAreaMapper, TArea> implements TAreaService {
+
+}

+ 26 - 0
src/main/java/com/szwl/service/impl/TCoinOrderServiceImpl.java

@@ -1,11 +1,16 @@
 package com.szwl.service.impl;
 
+import com.szwl.model.entity.TAdmin;
 import com.szwl.model.entity.TCoinOrder;
 import com.szwl.mapper.TCoinOrderMapper;
+import com.szwl.model.excel.CoinOrderTarget;
 import com.szwl.service.TCoinOrderService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * <p>
  * 线下支付订单 服务实现类
@@ -17,4 +22,25 @@ import org.springframework.stereotype.Service;
 @Service
 public class TCoinOrderServiceImpl extends ServiceImpl<TCoinOrderMapper, TCoinOrder> implements TCoinOrderService {
 
+    @Override
+    public List<CoinOrderTarget> findByCoinOrder(TAdmin admin, List<TCoinOrder> coinOrders) {
+        ArrayList<CoinOrderTarget> list = new ArrayList<>();
+        for (TCoinOrder coinOrder : coinOrders) {
+            CoinOrderTarget coinOrderTarget = new CoinOrderTarget();
+            coinOrderTarget.setSn(coinOrder.getSn());
+            coinOrderTarget.setProductName(coinOrder.getProductName());
+            coinOrderTarget.setClientId(coinOrder.getClientId());
+            coinOrderTarget.setName(admin.getUsername());
+            coinOrderTarget.setPrice(coinOrder.getPrice());
+            coinOrderTarget.setPayDate(coinOrder.getCreateDate());
+            coinOrderTarget.setStatus("已支付");
+            if (coinOrder.getPayType() == 0) {
+                coinOrderTarget.setFrp_code("无需支付");
+            } else {
+                coinOrderTarget.setFrp_code("投币支付");
+            }
+            list.add(coinOrderTarget);
+        }
+        return list;
+    }
 }

+ 101 - 0
src/main/java/com/szwl/service/impl/TOrderServiceImpl.java

@@ -1,17 +1,29 @@
 package com.szwl.service.impl;
 
+import com.szwl.exception.MyException;
+import com.szwl.feign.SzwlFeign;
 import com.szwl.model.bean.ChartBean;
 import com.szwl.model.bean.ChartColumn;
+import com.szwl.model.bean.OrderDaoChuDTO;
 import com.szwl.model.bo.ChartType;
+import com.szwl.model.bo.R;
+import com.szwl.model.entity.TAdmin;
+import com.szwl.model.entity.TEquipment;
 import com.szwl.model.entity.TOrder;
 import com.szwl.mapper.TOrderMapper;
+import com.szwl.model.excel.OrderTarget;
+import com.szwl.model.query.Pageable;
 import com.szwl.model.query.StatisticsParam;
 import com.szwl.service.TOrderService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.math.BigDecimal;
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -26,6 +38,9 @@ import java.util.List;
 public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> implements TOrderService {
     @Autowired
     TOrderMapper tOrderMapper;
+    @Autowired
+    SzwlFeign szwlFeign;
+    //首页统计
     @Override
     public ChartColumn getStatistics(StatisticsParam param) {
         List<ChartBean> list = new ArrayList<>();
@@ -53,4 +68,90 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
         ChartColumn chartColumn = new ChartColumn(list);
         return chartColumn;
     }
+
+    //机器排行统计
+    @Override
+    public ChartColumn getEquipmentStatistics(StatisticsParam param) {
+        List<ChartBean> list = new ArrayList<>();
+        String msg = "";
+        if (ChartType.day.toString().equals(param.getChartType())) {
+            msg = "日统计";
+        }
+        if (ChartType.week.toString().equals(param.getChartType())) {
+            msg = "周统计";
+        }
+        if (ChartType.month.toString().equals(param.getChartType())) {
+            msg = "月统计";
+        }
+        if (ChartType.year.toString().equals(param.getChartType())) {
+            msg = "年统计";
+        }
+        if("1".equals(param.getChangeType())){
+            // 花型统计
+            list = tOrderMapper.getProductNameStatistics(param);
+        }else{
+            list = tOrderMapper.getEquipmentStatistics(param);
+            if(list.size()>0){
+                for(ChartBean chartBean:list){
+                    String categorie = chartBean.getCategorie();
+                    TEquipment tEquipment = R.getDataIfSuccess(szwlFeign.findEquipmentByClientId(param.getClientId()));
+                    if(StringUtils.isNotEmpty(tEquipment.getName())){
+                        chartBean.setCategorie(tEquipment.getName());
+                    }else {
+                        chartBean.setCategorie(categorie.substring(categorie.length()-6,categorie.length()));
+                    }
+                }
+            }
+        }
+        if (CollectionUtils.isEmpty(list)) {
+            throw new MyException("获取" + msg + "数据为空");
+        }
+        ChartColumn chartColumn = new ChartColumn(list);
+        return chartColumn;
+    }
+
+    @Override
+    public List<OrderDaoChuDTO> orderDaoChu(Date begin, Date end, Long adminId, String clientId, String type, long current, long size) {
+        return tOrderMapper.orderDaoChu(begin,end,adminId,clientId,type,current,size);
+    }
+
+    @Override
+    public List<OrderTarget> findById(TAdmin admin, List<TOrder> list) {
+
+
+        List<OrderTarget> list1 = new ArrayList<>();
+        for (TOrder order : list) {
+            if(!order.getProductName().equals("优惠码")){
+                OrderTarget orderTarget = new OrderTarget();
+                orderTarget.setSn(order.getSn());
+                orderTarget.setProductName(order.getProductName());
+                orderTarget.setPrice(order.getPrice());
+                orderTarget.setClientId(order.getClientId());
+                orderTarget.setName(admin.getUsername());
+                orderTarget.setPayDate(order.getPayDate());
+                orderTarget.setRefundDate(order.getRefundDate());
+                orderTarget.setStatus(String.valueOf(order.getStatus()));
+                orderTarget.setAgencyProportion(String.valueOf(order.getAgencyProportion()));
+                orderTarget.setMerchantProportion(String.valueOf(order.getMerchantProportion()));
+                orderTarget.setPersonageProportion(String.valueOf(order.getPersonageProportion()));
+                if ("WEIXIN_NATIVE".equals(order.getFrpCode())) {
+                    orderTarget.setFrp_code("微信主扫支付");
+                } else if("ALIPAY_NATIVE".equals(order.getFrpCode())){
+                    orderTarget.setFrp_code("支付宝主扫支付");
+                }else if("WEIXIN_CARD".equals(order.getFrpCode())){
+                    orderTarget.setFrp_code("微信被扫支付");
+                }else if("ALIPAY_CARD".equals(order.getFrpCode())){
+                    orderTarget.setFrp_code("支付宝被扫支付");
+                }else {
+                    orderTarget.setFrp_code(order.getFrpCode());
+                }
+                if(StringUtils.isEmpty(orderTarget.getFrp_code())){
+                    orderTarget.setFrp_code(order.getFrpCode());
+                }
+                list1.add(orderTarget);
+            }
+        }
+        return list1;
+    }
+
 }

+ 1 - 1
src/test/java/com/szwl/AutoGeneratorTests.java

@@ -47,7 +47,7 @@ class AutoGeneratorTests {
 		strategyConfig
 //				.setCapitalMode(true)//设置全局大写命名
 				.setInclude(new String[]{
-						"t_coin_order","t_order"
+						""
 				})//只会生成该表
 				.setEntityLombokModel(true)//实体类生成之后自动添加lombok注解
 				.setNaming(NamingStrategy.underline_to_camel)//数据库表映射到实体的命名策略