qin 1 anno fa
parent
commit
fc54adc252
17 ha cambiato i file con 244 aggiunte e 736 eliminazioni
  1. 20 151
      src/main/java/com/poteviohealth/cgp/statistics/controller/OrderController.java
  2. 1 18
      src/main/java/com/poteviohealth/cgp/statistics/mapper/OrderMapper.java
  3. 0 10
      src/main/java/com/poteviohealth/cgp/statistics/model/Order.java
  4. 1 0
      src/main/java/com/poteviohealth/cgp/statistics/model/indto/DishesOrderWebInDTO.java
  5. 0 18
      src/main/java/com/poteviohealth/cgp/statistics/model/indto/OrderServiceWebInDTO.java
  6. 4 3
      src/main/java/com/poteviohealth/cgp/statistics/model/indto/PriceUploadDto.java
  7. 2 1
      src/main/java/com/poteviohealth/cgp/statistics/model/outdto/DishesOrderWebOutDTO.java
  8. 0 3
      src/main/java/com/poteviohealth/cgp/statistics/model/outdto/IntegralTrans.java
  9. 1 1
      src/main/java/com/poteviohealth/cgp/statistics/service/IDistinctionService.java
  10. 8 16
      src/main/java/com/poteviohealth/cgp/statistics/service/IOrderService.java
  11. 2 2
      src/main/java/com/poteviohealth/cgp/statistics/service/impl/DistinctionServiceImpl.java
  12. 83 219
      src/main/java/com/poteviohealth/cgp/statistics/service/impl/OrderServiceImpl.java
  13. 35 71
      src/main/java/com/poteviohealth/cgp/statistics/service/impl/WatermarkImgServiceImpl.java
  14. 27 89
      src/main/java/com/poteviohealth/cgp/statistics/utils/OssUtils.java
  15. 10 30
      src/main/resources/mapper/statistics/DistinctionMapper.xml
  16. 48 97
      src/main/resources/mapper/statistics/OrderMapper.xml
  17. 2 7
      src/main/resources/mapper/statistics/WatermarkImgMapper.xml

+ 20 - 151
src/main/java/com/poteviohealth/cgp/statistics/controller/OrderController.java

@@ -1,7 +1,6 @@
 package com.poteviohealth.cgp.statistics.controller;
 
 
-import com.beust.jcommander.internal.Lists;
 import com.google.common.collect.Maps;
 import com.poteviohealth.cgp.common.controller.BaseWebController;
 import com.poteviohealth.cgp.common.exception.BusinessException;
@@ -13,15 +12,14 @@ import com.poteviohealth.cgp.common.facade.log.OperationLog;
 import com.poteviohealth.cgp.common.facade.time.MethodTime;
 import com.poteviohealth.cgp.common.filter.TokenContext;
 import com.poteviohealth.cgp.common.filter.repeatSubmit.RepeatSubmit;
-import com.poteviohealth.cgp.common.integrated.customer.model.GoldSendPage;
 import com.poteviohealth.cgp.common.integrated.finance.model.CardAccTransRecharge;
 import com.poteviohealth.cgp.common.integrated.finance.model.MemberPlanDTO;
 import com.poteviohealth.cgp.common.integrated.finance.model.MemberPlanPageDTO;
 import com.poteviohealth.cgp.common.model.VaultsResponse;
-import com.poteviohealth.cgp.statistics.model.Distinction;
 import com.poteviohealth.cgp.statistics.model.indto.*;
-import com.poteviohealth.cgp.statistics.model.outdto.*;
-import com.poteviohealth.cgp.statistics.service.IDistinctionService;
+import com.poteviohealth.cgp.statistics.model.outdto.DishesOrderWebOutDTO;
+import com.poteviohealth.cgp.statistics.model.outdto.OrderCostWebOutDTO;
+import com.poteviohealth.cgp.statistics.model.outdto.OrderExcelDTO;
 import com.poteviohealth.cgp.statistics.service.IOrderService;
 import com.poteviohealth.cgp.statistics.service.IWatermarkImgService;
 import com.poteviohealth.cgp.statistics.utils.ExcelUtils2;
@@ -36,10 +34,6 @@ import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
 import java.util.List;
 import java.util.Map;
 
@@ -63,8 +57,6 @@ public class OrderController extends BaseWebController {
     private OssUtils ossUtils;
     @Resource
     private IWatermarkImgService watermarkImgService;
-    @Resource
-    private IDistinctionService distinctionService;
 
     @PostMapping(value = "/orderServiceExport")
     @ApiOperation(httpMethod = "POST", value = "工单Excel导出")
@@ -72,10 +64,10 @@ public class OrderController extends BaseWebController {
     @MethodTime
     public void orderServiceExport(HttpServletResponse resp, @RequestBody OrderServiceWebInDTO orderServiceWebInDTO){
         String key ="orderServiceExport";
-           String error =  this.checkExcelExport(key);
+        String error =  this.checkExcelExport(key);
         try {
             if ("".equals(error)) {
-            orgConstrainService.fillOrgParams(orderServiceWebInDTO);
+                orgConstrainService.fillOrgParams(orderServiceWebInDTO);
                 List<OrderExcelDTO> list = orderService.orderExcel(orderServiceWebInDTO);
                 ExcelUtils2.easyDownload("classpath:excel/order_service.xlsx", Maps.newHashMap(), list,  "", resp);
             }else{
@@ -159,6 +151,7 @@ public class OrderController extends BaseWebController {
         }
     }
 
+
     @PostMapping(value = "/orderExport")
     @ApiOperation(httpMethod = "POST", value = "订单Excel导出")
     public void orderExport(HttpServletResponse resp,@RequestBody OrderWebInDTO orderWebInDTO){
@@ -166,66 +159,10 @@ public class OrderController extends BaseWebController {
         String error =  this.checkExcelExport(key);
         try{
             if ("".equals(error)) {
-        String templateLocation = "classpath:excel/order.xlsx";
-        String filename = "";
-        Map<String, Object> data = Maps.newHashMap();
-        List<OrderExcelDTO> list = orderService.excelList(orderWebInDTO);
-        ExcelUtils2.easyDownload(templateLocation,data , list, filename, resp);
-            }else{
-                throw new BusinessException(error);
-            }
-        }catch (Exception e){
-            e.printStackTrace();
-            throw new BusinessException(e.getMessage());
-        }finally {
-            if(cacheService.exists(key)){
-                if(cacheService.get(key).equals(TokenContext.cureWebUser().getUserId().toString())){
-                    cacheService.del(key);
-                }
-            }
-        }
-    }
-
-    @PostMapping(value = "/goldSendExport")
-    @ApiOperation(httpMethod = "POST", value = "高龄津贴发放Excel导出")
-    public void goldSendExport(HttpServletResponse resp,@RequestBody GoldSendPage page){
-        String key ="goldSendExport";
-        String error =  this.checkExcelExport(key);
-        try{
-            if ("".equals(error)) {
-                String templateLocation = "classpath:excel/goldSend.xlsx";
+                String templateLocation = "classpath:excel/order.xlsx";
                 String filename = "";
                 Map<String, Object> data = Maps.newHashMap();
-                orgConstrainService.fillOrgParams(page);
-                List<GoldSendExcelDTO> list = orderService.excelGoldSendList(page);
-                ExcelUtils2.easyDownload(templateLocation,data , list, filename, resp);
-            }else{
-                throw new BusinessException(error);
-            }
-        }catch (Exception e){
-            e.printStackTrace();
-            throw new BusinessException(e.getMessage());
-        }finally {
-            if(cacheService.exists(key)){
-                if(cacheService.get(key).equals(TokenContext.cureWebUser().getUserId().toString())){
-                    cacheService.del(key);
-                }
-            }
-        }
-    }
-
-    @PostMapping(value = "/goldSendBankExport")
-    @ApiOperation(httpMethod = "POST", value = "高龄津贴发放Excel导出")
-    public void goldSendBankExport(HttpServletResponse resp,@RequestBody GoldSendPage page){
-        String key ="goldSendBankExport";
-        String error =  this.checkExcelExport(key);
-        try{
-            if ("".equals(error)) {
-                String templateLocation = "classpath:excel/goldSendBank.xlsx";
-                String filename = "";
-                Map<String, Object> data = Maps.newHashMap();
-                orgConstrainService.fillOrgParams(page);
-                List<GoldSendBankExcelDTO> list = orderService.excelGoldSendBankList(page);
+                List<OrderExcelDTO> list = orderService.excelList(orderWebInDTO);
                 ExcelUtils2.easyDownload(templateLocation,data , list, filename, resp);
             }else{
                 throw new BusinessException(error);
@@ -263,64 +200,14 @@ public class OrderController extends BaseWebController {
     @ApiOperation(value = "阿里云图片上传")
     @MethodTime
     @ResponseBody
-    public VaultsResponse<DistinctionDTO> uploadArrayFile(@RequestParam("file") MultipartFile file,@RequestParam("orderId") Long orderId,@RequestParam("uidList") List<String> uidList){
-       /* log.info(orderId);
+    public VaultsResponse<String> uploadArrayFile(@RequestParam("file") MultipartFile file,@RequestParam("orderId") Long orderId){
+        log.info(orderId);
         VaultsResponse<String> vaultsResponse = ossUtils.uploadOneFile(file,orderId);
         log.info(vaultsResponse.getData());
-        return vaultsResponse;*/
-
-        //图片检查
-        try {
-            InputStream inputStream = file.getInputStream();
-            DistinctionDTO dto;
-            Integer pos = file.getOriginalFilename().lastIndexOf('.');
-            String suffix = "";
-            if (pos != -1) {
-                suffix = file.getOriginalFilename().substring(pos);
-            }
-            File tempFile = File.createTempFile("temp_", suffix);
-            file.transferTo(tempFile);
-            if(suffix.indexOf("mp4") != -1){
-                //视频处理
-                //先压缩视频再处理
-                if(file.getSize() /1024L/1024L >3L){
-                    File tempFile2 =  ossUtils.compressVideo(tempFile);
-                    File imageFile = ossUtils.generateCover(tempFile2);
-                    dto = distinctionService.checkImg(imageFile,orderId,uidList);
-                    if(dto.getOrderId() ==null){
-                        VaultsResponse<String> vaultsResponse = ossUtils.uploadOneFile(file,orderId,new FileInputStream(tempFile2));
-                        dto.setUrl(vaultsResponse.getData());
-                    }
-                    imageFile.delete();
-                     tempFile2.delete();
-                }else{
-                    File imageFile = ossUtils.generateCover(tempFile);
-                    dto = distinctionService.checkImg(imageFile,orderId,uidList);
-                    if(dto.getOrderId() ==null){
-                        VaultsResponse<String> vaultsResponse = ossUtils.uploadOneFile(file,orderId,inputStream);
-                        dto.setUrl(vaultsResponse.getData());
-                    }
-                    imageFile.delete();
-                }
-
-
-            }else{
-                //图片处理
-                dto = distinctionService.checkImg(tempFile,orderId,uidList);
-                if(dto.getOrderId() ==null){
-                    VaultsResponse<String> vaultsResponse = ossUtils.uploadOneFile(file,orderId,inputStream);
-                    dto.setUrl(vaultsResponse.getData());
-                }
-            }
-
-            tempFile.delete();
-
-            return VaultsResponse.success(dto);
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-        return VaultsResponse.failed();
-
+       /* if(vaultsResponse.validate()){
+            return orderService.updateOrderUrl(list);
+        }*/
+        return vaultsResponse;
     }
 
     @PostMapping("/orderFile")
@@ -330,29 +217,11 @@ public class OrderController extends BaseWebController {
     @MethodTime
     public VaultsResponse orderFile(@RequestBody List<PriceUploadDto> list) {
         //处理水印
-       VaultsResponse<List<PriceUploadDto>> vaultsResponse = watermarkImgService.printingWatermark(list);
-       if(!vaultsResponse.validate()){
-           return vaultsResponse;
-       }
-        list = vaultsResponse.getData();
-       //处理图片指纹
-        List<Distinction> distinctionList = Lists.newArrayList();
-        for (PriceUploadDto priceUploadDto : list) {
-            if(priceUploadDto.getUid() == null){
-                continue;
-            }
-            Distinction distinction = new Distinction();
-            distinction.setOperatorId(TokenContext.cureOperatorId());
-            distinction.setSupplierId(TokenContext.curSupplierId());
-            distinction.setStationId(TokenContext.curStationId());
-            distinction.setOrderId(priceUploadDto.getOrderId());
-            distinction.setUrl(priceUploadDto.getUrl());
-            distinction.setUid(priceUploadDto.getUid());
-            distinctionList.add(distinction);
-        }
-        if(!distinctionList.isEmpty()){
-            distinctionService.insertBatch(distinctionList);
+        VaultsResponse<List<PriceUploadDto>> vaultsResponse = watermarkImgService.printingWatermark(list);
+        if(!vaultsResponse.validate()){
+            return vaultsResponse;
         }
+        list = vaultsResponse.getData();
         //处理照片
         watermarkImgService.updateOrderUrl(list);
 
@@ -387,6 +256,7 @@ public class OrderController extends BaseWebController {
         }
     }
 
+
     @PostMapping(value = "/transRechargeExcel")
     @ApiOperation(httpMethod = "POST", value = "账户充值Excel导出")
     @RepeatSubmit
@@ -422,6 +292,5 @@ public class OrderController extends BaseWebController {
             }
         }
     }
-
-
 }
+

+ 1 - 18
src/main/java/com/poteviohealth/cgp/statistics/mapper/OrderMapper.java

@@ -237,23 +237,6 @@ public interface OrderMapper extends BaseMapper<Order>{
     LinkedList<CardAccTransRecharge> transRechargeExcel(@Param(Constants.WRAPPER) Wrapper wrapper,@Param("queryParam") CardWebInDTO var2, @Param("dbName")String dbName, @Param("start")Integer start);
 
 
-    @SqlParser(filter = true)
-    int goldSendListSize(@Param("yearTime") Integer yearTime,@Param(Constants.WRAPPER) Wrapper wrapper, @Param("dbName") String dbName);
-
-    /**
-     * excel
-     * @param wrapper
-     * @return
-     */
-    @SqlParser(filter=true)
-    LinkedList<GoldSendExcelDTO> goldSendList(@Param("yearTime") Integer yearTime,@Param(Constants.WRAPPER) Wrapper wrapper,@Param("dbName") String dbName, @Param("start")Integer start);
-
-    /**
-     * excel
-     * @param wrapper
-     * @return
-     */
-    @SqlParser(filter=true)
-    LinkedList<GoldSendBankExcelDTO> goldSendBankList(@Param("yearTime") Integer yearTime,@Param(Constants.WRAPPER) Wrapper wrapper,@Param("dbName") String dbName, @Param("start")Integer start);
 
 }
+

+ 0 - 10
src/main/java/com/poteviohealth/cgp/statistics/model/Order.java

@@ -97,14 +97,8 @@ public class Order extends BaseEntity {
     private Integer pointStation;
     @ApiModelProperty(value = "积分发放数")
     private Long pointGrant;
-    @ApiModelProperty(value = "文明积分发放数")
-    private Long pointGrantWm;
-    @ApiModelProperty(value = "银龄积分发放数")
-    private Long pointGrantYl;
     @ApiModelProperty(value = "积分兑换数")
     private Long pointExchange;
-    @ApiModelProperty(value = "文明积分兑换数")
-    private Long pointExchangeWm;
     @ApiModelProperty(value = "积分会员统计")
     private String memberListData;
     @ApiModelProperty(value = "积分商户统计")
@@ -115,10 +109,6 @@ public class Order extends BaseEntity {
     private String goodsData2;
     @ApiModelProperty(value = "月度积分统计")
     private String pointMonthData;
-    @ApiModelProperty(value = "月度文明积分统计")
-    private String pointMonthDataWm;
-    @ApiModelProperty(value = "月度银龄积分统计")
-    private String pointMonthDataYl;
     @ApiModelProperty(value = "交易次数统计")
     private String pointCountData;
     @ApiModelProperty(value = "积分商品个数统计")

+ 1 - 0
src/main/java/com/poteviohealth/cgp/statistics/model/indto/DishesOrderWebInDTO.java

@@ -55,3 +55,4 @@ public class DishesOrderWebInDTO extends OrgPageQuery {
     @ApiModelProperty(value = "堂食标志:0.非,1.是")
     private Integer eatIn;
 }
+

+ 0 - 18
src/main/java/com/poteviohealth/cgp/statistics/model/indto/OrderServiceWebInDTO.java

@@ -128,22 +128,4 @@ public class OrderServiceWebInDTO extends OrgPageQuery {
     @ApiModelProperty(value="精确查找联系电话")
     private String phone;
 
-    @ApiModelProperty(value="客户Id")
-    private Long customerId;
-
-    @ApiModelProperty(value = "区域id", name = "countryId")
-    private Integer countryId;
-
-    @ApiModelProperty(value = "街道id", name = "streetId")
-    private Integer streetId;
-
-    @ApiModelProperty(value = "社区id", name = "communityId")
-    private Integer communityId;
-
-    @ApiModelProperty(value="抽查状态:0:未抽查;1:已抽查")
-    private Integer reviewStatus;
-
-    @ApiModelProperty(value="卡类别名称")
-    private String cards;
-
 }

+ 4 - 3
src/main/java/com/poteviohealth/cgp/statistics/model/indto/PriceUploadDto.java

@@ -28,15 +28,15 @@ public class PriceUploadDto {
     @ApiModelProperty(value="水印时间")
     private String date;
 
+    @ApiModelProperty(value="图片")
+    private String base64;
+
     @ApiModelProperty(value="上传后的地址")
     private String url;
 
     @ApiModelProperty(value="类型")
     private String type;
 
-    @ApiModelProperty(value="指纹")
-    private String uid;
-
     @ApiModelProperty(value = "打卡经度")
     private Double punchLongitude;
     @ApiModelProperty(value = "打卡纬度")
@@ -44,3 +44,4 @@ public class PriceUploadDto {
     @ApiModelProperty(value = "打卡地址")
     private String punchAddress;
 }
+

+ 2 - 1
src/main/java/com/poteviohealth/cgp/statistics/model/outdto/DishesOrderWebOutDTO.java

@@ -9,7 +9,7 @@ import lombok.Data;
  * @Date 2019/7/16 19:08
  * @Param 订单DTO
  * @return
-**/
+ **/
 @Data
 @ApiModel(value="订单列表查询出参")
 public class DishesOrderWebOutDTO {
@@ -71,3 +71,4 @@ public class DishesOrderWebOutDTO {
     @ApiModelProperty(value = "堂食标志:0.非,1.是")
     private String eatInStr;
 }
+

+ 0 - 3
src/main/java/com/poteviohealth/cgp/statistics/model/outdto/IntegralTrans.java

@@ -58,7 +58,4 @@ public class IntegralTrans {
     @ApiModelProperty("街道")
     private Integer streetId;
 
-    @ApiModelProperty("备注")
-    private String remark;
-
 }

+ 1 - 1
src/main/java/com/poteviohealth/cgp/statistics/service/IDistinctionService.java

@@ -14,7 +14,7 @@ import java.util.List;
  */
 public interface IDistinctionService extends IBaseService<Distinction> {
 
-    DistinctionDTO checkImg(File file, Long orderId, List<String> uidList);
+    //DistinctionDTO checkImg(File file, Long orderId, List<String> uidList);
     void insertBatch(List<Distinction> list);
 
     List<FingerParams> getFinishOrderList();

+ 8 - 16
src/main/java/com/poteviohealth/cgp/statistics/service/IOrderService.java

@@ -1,13 +1,18 @@
 package com.poteviohealth.cgp.statistics.service;
 
-import com.poteviohealth.cgp.common.integrated.customer.model.GoldSendPage;
 import com.poteviohealth.cgp.common.integrated.finance.model.CardAccTransRecharge;
 import com.poteviohealth.cgp.common.integrated.finance.model.MemberPlanDTO;
 import com.poteviohealth.cgp.common.integrated.finance.model.MemberPlanPageDTO;
 import com.poteviohealth.cgp.common.service.IBaseService;
 import com.poteviohealth.cgp.statistics.model.Order;
+import com.poteviohealth.cgp.statistics.model.indto.DishesOrderWebInDTO;
+import com.poteviohealth.cgp.statistics.model.indto.OrderCostWebInDTO;
+import com.poteviohealth.cgp.statistics.model.indto.OrderServiceWebInDTO;
+import com.poteviohealth.cgp.statistics.model.indto.OrderWebInDTO;
 import com.poteviohealth.cgp.statistics.model.indto.*;
-import com.poteviohealth.cgp.statistics.model.outdto.*;
+import com.poteviohealth.cgp.statistics.model.outdto.DishesOrderWebOutDTO;
+import com.poteviohealth.cgp.statistics.model.outdto.OrderCostWebOutDTO;
+import com.poteviohealth.cgp.statistics.model.outdto.OrderExcelDTO;
 
 import java.util.List;
 
@@ -58,18 +63,5 @@ public interface IOrderService extends IBaseService<Order> {
      * @return
      */
     List<MemberPlanDTO> pageCardExcel(MemberPlanPageDTO dto);
-
-    /**
-     * excel导出
-     * @param page
-     * @return
-     */
-    List<GoldSendExcelDTO> excelGoldSendList(GoldSendPage page);
-
-    /**
-     * excel导出
-     * @param page
-     * @return
-     */
-    List<GoldSendBankExcelDTO> excelGoldSendBankList(GoldSendPage page);
 }
+

+ 2 - 2
src/main/java/com/poteviohealth/cgp/statistics/service/impl/DistinctionServiceImpl.java

@@ -41,7 +41,7 @@ public class DistinctionServiceImpl extends BaseServiceImpl<DistinctionMapper, D
     @Value("${sync.dbName}")
     private String dbName;
 
-    @Override
+  /*  @Override
     public DistinctionDTO checkImg(File file, Long orderId, List<String> uidList){
         DistinctionDTO dto = new DistinctionDTO();
         String uid = FingerImage.readImagePix(file);
@@ -99,7 +99,7 @@ public class DistinctionServiceImpl extends BaseServiceImpl<DistinctionMapper, D
         }
        return dto;
     }
-
+*/
     @Override
     public void insertBatch(List<Distinction> list) {
         final int SIZE = 64;

+ 83 - 219
src/main/java/com/poteviohealth/cgp/statistics/service/impl/OrderServiceImpl.java

@@ -8,7 +8,14 @@ import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.poteviohealth.cgp.common.filter.TokenContext;
 import com.poteviohealth.cgp.common.integrated.ListParams;
-import com.poteviohealth.cgp.common.integrated.customer.model.*;
+import com.poteviohealth.cgp.common.integrated.customer.model.CustomerServiceParams;
+import com.poteviohealth.cgp.common.integrated.customer.model.CustomerSubsidyDTO;
+import com.poteviohealth.cgp.common.integrated.customer.model.SubsidyCustomerFace;
+import com.poteviohealth.cgp.common.integrated.customer.model.SubsidyCustomerJsonFace;
+import com.poteviohealth.cgp.common.integrated.finance.model.MemberListData;
+import com.poteviohealth.cgp.common.integrated.finance.model.MemberPlanDTO;
+import com.poteviohealth.cgp.common.integrated.finance.model.MemberPlanPageDTO;
+import com.poteviohealth.cgp.common.integrated.finance.model.MonthData;
 import com.poteviohealth.cgp.common.integrated.finance.model.*;
 import com.poteviohealth.cgp.common.integrated.order.model.OrderStatisticsData;
 import com.poteviohealth.cgp.common.integrated.order.model.PayAccount;
@@ -20,6 +27,10 @@ import com.poteviohealth.cgp.statistics.constant.enums.OrderConstantEnum;
 import com.poteviohealth.cgp.statistics.mapper.OrderMapper;
 import com.poteviohealth.cgp.statistics.model.Order;
 import com.poteviohealth.cgp.statistics.model.WatermarkImg;
+import com.poteviohealth.cgp.statistics.model.indto.DishesOrderWebInDTO;
+import com.poteviohealth.cgp.statistics.model.indto.OrderCostWebInDTO;
+import com.poteviohealth.cgp.statistics.model.indto.OrderServiceWebInDTO;
+import com.poteviohealth.cgp.statistics.model.indto.OrderWebInDTO;
 import com.poteviohealth.cgp.statistics.model.indto.*;
 import com.poteviohealth.cgp.statistics.model.outdto.*;
 import com.poteviohealth.cgp.statistics.service.IOrderService;
@@ -74,20 +85,20 @@ public class OrderServiceImpl extends BaseServiceImpl<OrderMapper, Order> implem
                         order.setTreePath(areaDTO.getTreePath());
                         order.setSourceLevel(areaDTO.getLevel());
                         Integer size = 0;
-                       switch (order.getSourceLevel()){
-                           case 1:
-                               size =4;
-                               break;
-                           case 2:
-                               size =6;
-                               break;
-                           case 3:
-                               size =9;
-                               break;
-                       }
-                       if(StringUtils.isNotEmpty(areaDTO.getRegionAreaCode())){
-                           order.setRegionAreaCode(areaDTO.getRegionAreaCode().substring(0,size));
-                       }
+                        switch (order.getSourceLevel()){
+                            case 1:
+                                size =4;
+                                break;
+                            case 2:
+                                size =6;
+                                break;
+                            case 3:
+                                size =9;
+                                break;
+                        }
+                        if(StringUtils.isNotEmpty(areaDTO.getRegionAreaCode())){
+                            order.setRegionAreaCode(areaDTO.getRegionAreaCode().substring(0,size));
+                        }
 
                         newOrderList.add(order);
                     }
@@ -157,58 +168,58 @@ public class OrderServiceImpl extends BaseServiceImpl<OrderMapper, Order> implem
     @Override
     public List<OrderExcelDTO> orderExcel(OrderServiceWebInDTO dto) {
         try {
-        Integer operatorId = TokenContext.cureOperatorId();
-        QueryWrapper queryWrapper = orderServiceQuery(dto, "o.");
-        int count;
-        if (null != dto.getProductIds()) {
-            queryWrapper.eq("od.product_id", dto.getProductIds());
-            count = baseMapper.orderPageListAllSize(queryWrapper,dbName,operatorId);
-        }else{
-            QueryWrapper<Order> queryWrapper2 = orderServiceQuery(dto, "o.");
-            count = baseMapper.orderPageListSize(queryWrapper2,dbName,operatorId);
-        }
-        //每页10000条,计算总页数
-        int maxPage = (int) Math.ceil(count/10000.0);
-        int start = 0;
-        LinkedList<OrderExcelDTO> list = Lists.newLinkedList();
-        for (int i = 0; i < maxPage; i++) {
-            LinkedList<OrderExcelDTO> findList = baseMapper.orderExcel(queryWrapper,dbName,operatorId,start);
-            start = findList.getLast().getId();
-            list.addAll(findList);
-        }
+            Integer operatorId = TokenContext.cureOperatorId();
+            QueryWrapper queryWrapper = orderServiceQuery(dto, "o.");
+            int count;
+            if (null != dto.getProductIds()) {
+                queryWrapper.eq("od.product_id", dto.getProductIds());
+                count = baseMapper.orderPageListAllSize(queryWrapper,dbName,operatorId);
+            }else{
+                QueryWrapper<Order> queryWrapper2 = orderServiceQuery(dto, "o.");
+                count = baseMapper.orderPageListSize(queryWrapper2,dbName,operatorId);
+            }
+            //每页10000条,计算总页数
+            int maxPage = (int) Math.ceil(count/10000.0);
+            int start = 0;
+            LinkedList<OrderExcelDTO> list = Lists.newLinkedList();
+            for (int i = 0; i < maxPage; i++) {
+                LinkedList<OrderExcelDTO> findList = baseMapper.orderExcel(queryWrapper,dbName,operatorId,start);
+                start = findList.getLast().getId();
+                list.addAll(findList);
+            }
 
-        for (OrderExcelDTO orderExcelDTO : list) {
-            for (OrderConstantEnum.OrderStatus status : EnumUtils.getEnumList(OrderConstantEnum.OrderStatus.class)) {
-                if (status.getCode().toString().equals(orderExcelDTO.getOrderStatus())) {
-                    orderExcelDTO.setOrderStatus(status.getDisplay());
-                    break;
+            for (OrderExcelDTO orderExcelDTO : list) {
+                for (OrderConstantEnum.OrderStatus status : EnumUtils.getEnumList(OrderConstantEnum.OrderStatus.class)) {
+                    if (status.getCode().toString().equals(orderExcelDTO.getOrderStatus())) {
+                        orderExcelDTO.setOrderStatus(status.getDisplay());
+                        break;
+                    }
                 }
-            }
 
-            for (OrderConstantEnum.PayStyle status : EnumUtils.getEnumList(OrderConstantEnum.PayStyle.class)) {
-                if (status.getCode().toString().equals(orderExcelDTO.getPayStyle())) {
-                    orderExcelDTO.setPayStyle(status.getDisplay());
-                    break;
+                for (OrderConstantEnum.PayStyle status : EnumUtils.getEnumList(OrderConstantEnum.PayStyle.class)) {
+                    if (status.getCode().toString().equals(orderExcelDTO.getPayStyle())) {
+                        orderExcelDTO.setPayStyle(status.getDisplay());
+                        break;
+                    }
                 }
-            }
 
-            for (OrderConstantEnum.PayStatus status : EnumUtils.getEnumList(OrderConstantEnum.PayStatus.class)) {
-                if (status.getCode().toString().equals(orderExcelDTO.getPayStatus())) {
-                    orderExcelDTO.setPayStatus(status.getDisplay());
-                    break;
+                for (OrderConstantEnum.PayStatus status : EnumUtils.getEnumList(OrderConstantEnum.PayStatus.class)) {
+                    if (status.getCode().toString().equals(orderExcelDTO.getPayStatus())) {
+                        orderExcelDTO.setPayStatus(status.getDisplay());
+                        break;
+                    }
                 }
-            }
 
-            for (OrderConstantEnum.OrderStyle status : EnumUtils.getEnumList(OrderConstantEnum.OrderStyle.class)) {
-                if (status.getCode().toString().equals(orderExcelDTO.getOrderStyle())) {
-                    orderExcelDTO.setOrderStyle(status.getDisplay());
-                    break;
+                for (OrderConstantEnum.OrderStyle status : EnumUtils.getEnumList(OrderConstantEnum.OrderStyle.class)) {
+                    if (status.getCode().toString().equals(orderExcelDTO.getOrderStyle())) {
+                        orderExcelDTO.setOrderStyle(status.getDisplay());
+                        break;
+                    }
                 }
+                orderExcelDTO.setPayAccount(getPayAccountString(orderExcelDTO.getPayAccount()));
+                orderExcelDTO.setStationOrGroupName(StringUtils.isNotEmpty(orderExcelDTO.getGroupLeaderName())?orderExcelDTO.getGroupLeaderName():orderExcelDTO.getServiceStationName());
             }
-            orderExcelDTO.setPayAccount(getPayAccountString(orderExcelDTO.getPayAccount()));
-            orderExcelDTO.setStationOrGroupName(StringUtils.isNotEmpty(orderExcelDTO.getGroupLeaderName())?orderExcelDTO.getGroupLeaderName():orderExcelDTO.getServiceStationName());
-        }
-        //ForkJoinPool pool = new ForkJoinPool();
+            //ForkJoinPool pool = new ForkJoinPool();
 
            /* OrderExcelTask task = new OrderExcelTask(1,maxPage,queryWrapper, operatorId, dbName,baseMapper);
             Future<List<OrderExcelDTO>> future = pool.submit(task);
@@ -236,7 +247,7 @@ public class OrderServiceImpl extends BaseServiceImpl<OrderMapper, Order> implem
                 count = baseMapper.orderPageListAllSize(queryWrapper,dbName,operatorId);
             }else{*/
             int  count = baseMapper.orderPageListSize(queryWrapper,dbName,operatorId);
-          //  }
+            //  }
             //每页10000条,计算总页数
             int maxPage = (int) Math.ceil(count/10000.0);
             int start = 0;
@@ -316,88 +327,6 @@ public class OrderServiceImpl extends BaseServiceImpl<OrderMapper, Order> implem
         }
     }
 
-    @Override
-    public List<GoldSendExcelDTO> excelGoldSendList(GoldSendPage vo) {
-        try {
-            QueryWrapper queryWrapper = getQueryWrapper(vo);
-            int  count = baseMapper.goldSendListSize(vo.getYearTime(),queryWrapper,dbName);
-            //每页10000条,计算总页数
-            int maxPage = (int) Math.ceil(count/10000.0);
-            int start = 0;
-            LinkedList<GoldSendExcelDTO> list = Lists.newLinkedList();
-            for (int i = 0; i < maxPage; i++) {
-                LinkedList<GoldSendExcelDTO> findList = baseMapper.goldSendList(vo.getYearTime(),queryWrapper,dbName,start);
-                start = findList.getLast().getId();
-                list.addAll(findList);
-            }
-            return list;
-        }catch (Exception e){
-            e.printStackTrace();
-            throw new BuilderException("数据导出失败,请重新操作");
-        }
-
-    }
-
-    private QueryWrapper getQueryWrapper(GoldSendPage vo) {
-        QueryWrapper queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("d.operator_id", TokenContext.cureOperatorId());
-        if(StringUtils.isNotEmpty(vo.getSendTime())){
-            queryWrapper.eq("send_time", vo.getSendTime());
-        }
-        if(StringUtils.isNotEmpty(vo.getExpectTime())){
-            queryWrapper.eq("expect_time", vo.getExpectTime());
-        }
-        if(StringUtils.isNotEmpty(vo.getIdNumber())){
-            queryWrapper.eq("d.id_number", vo.getIdNumber());
-        }
-        if(StringUtils.isNotEmpty(vo.getName())){
-            queryWrapper.eq("d.name", vo.getName());
-        }
-        if(vo.getGoldType() != null){
-            queryWrapper.eq("d.gold_type", vo.getGoldType());
-        }
-        if(vo.getSendType() != null){
-            queryWrapper.eq("d.send_type", vo.getSendType());
-        }
-        if(vo.getIsDelete() != null){
-            queryWrapper.eq("d.is_delete", vo.getIsDelete());
-        }
-
-        if(vo.getCountryId() != null){
-            queryWrapper.eq("d.country_id", vo.getCountryId());
-        }
-
-        if(vo.getStreetId() != null){
-            queryWrapper.eq("d.street_id", vo.getStreetId());
-        }
-
-        if(vo.getCommunityId() != null){
-            queryWrapper.eq("d.community_id", vo.getCommunityId());
-        }
-        return queryWrapper;
-    }
-
-    @Override
-    public List<GoldSendBankExcelDTO> excelGoldSendBankList(GoldSendPage page) {
-        try {
-            QueryWrapper queryWrapper = getQueryWrapper(page);
-            int  count = baseMapper.goldSendListSize(page.getYearTime(),queryWrapper,dbName);
-            //每页10000条,计算总页数
-            int maxPage = (int) Math.ceil(count/10000.0);
-            int start = 0;
-            LinkedList<GoldSendBankExcelDTO> list = Lists.newLinkedList();
-            for (int i = 0; i < maxPage; i++) {
-                LinkedList<GoldSendBankExcelDTO> findList = baseMapper.goldSendBankList(page.getYearTime(),queryWrapper,dbName,start);
-                start = findList.getLast().getId();
-                list.addAll(findList);
-            }
-            return list;
-        }catch (Exception e){
-            e.printStackTrace();
-            throw new BuilderException("数据导出失败,请重新操作");
-        }
-    }
-
     private QueryWrapper cardQueryWrapper(MemberPlanPageDTO dto){
         QueryWrapper<WatermarkImg> queryWrapper = new QueryWrapper();
         queryWrapper.eq("d.operator_id",TokenContext.cureOperatorId());
@@ -462,12 +391,16 @@ public class OrderServiceImpl extends BaseServiceImpl<OrderMapper, Order> implem
             String val = "";
             for (String s : dto.getPayAccountStr().split(",")) {
                 if("1".equals(s)){
+                    val+="助餐账户,";
                     val+="补贴,";
                 }else if("2".equals(s)){
+                    val+="积分账户,";
                     val+="积分,";
                 }else if("3".equals(s)){
+                    val+="储值账户,";
                     val+="账户,";
                 }else if("4".equals(s)){
+                    val+="现金支付,";
                     val+="现金,";
                 }
             }
@@ -583,7 +516,7 @@ public class OrderServiceImpl extends BaseServiceImpl<OrderMapper, Order> implem
         if(orderWebInDTO.getCostStatus() != null){
             orderQueryWrapper.eq( "o.cost_status",orderWebInDTO.getCostStatus());
         }
-       // orderQueryWrapper.orderByDesc("o.order_cost_id");
+        // orderQueryWrapper.orderByDesc("o.order_cost_id");
 
         return orderQueryWrapper;
     }
@@ -708,9 +641,6 @@ public class OrderServiceImpl extends BaseServiceImpl<OrderMapper, Order> implem
         if (StringUtils.isNotEmpty(orderServiceWebInDTO.getSearchValueOrderCode())) {
             orderQueryWrapper.eq(prefix + "sn", orderServiceWebInDTO.getSearchValueOrderCode());
         }
-        if (StringUtils.isNotBlank(orderServiceWebInDTO.getCards())) {
-            orderQueryWrapper.like(prefix + "card_names", orderServiceWebInDTO.getCards());
-        }
         if (null != orderServiceWebInDTO.getOrderStatus()) {
             if(orderServiceWebInDTO.getOrderStatus().equals(17)){
                 //已回访
@@ -738,38 +668,6 @@ public class OrderServiceImpl extends BaseServiceImpl<OrderMapper, Order> implem
         if (StringUtils.isNotEmpty(orderServiceWebInDTO.getReviewReason())) {
             orderQueryWrapper.likeRight(prefix + "review_reason",orderServiceWebInDTO.getReviewReason());
         }
-        if(orderServiceWebInDTO.getCountryId() != null){
-            orderQueryWrapper.eq(prefix + "country_id", orderServiceWebInDTO.getCountryId());
-        }
-        if(orderServiceWebInDTO.getStreetId() != null){
-            orderQueryWrapper.eq(prefix + "street_id", orderServiceWebInDTO.getStreetId());
-        }
-        if(orderServiceWebInDTO.getCommunityId() != null){
-            orderQueryWrapper.eq(prefix + "community_id", orderServiceWebInDTO.getCommunityId());
-        }
-
-        if(orderServiceWebInDTO.getReviewStatus() != null){
-
-            String roles = "";
-            List<String> authList = TokenContext.cureWebUser().getAuthorities();
-            if(authList.contains("10")){
-                roles = "10";
-            }else if(authList.contains("11")){
-                roles = "11";
-            }else if(authList.contains("12")){
-                roles = "12";
-            }
-            if(!"".equals(roles)){
-                if(orderServiceWebInDTO.getReviewStatus().equals(1)){
-                    orderQueryWrapper.like(prefix + "review_government_role", roles);
-                }else{
-                    String val = roles;
-                    orderQueryWrapper.and(wr->wr.isNull(prefix + "review_government_role").or().notLike(prefix + "review_government_role",val));
-                    orderQueryWrapper.eq(prefix + "order_status", 6);
-                }
-            }
-        }
-
         if(orderServiceWebInDTO.getStationId() != null && orderServiceWebInDTO.getSource() != null){
             switch (orderServiceWebInDTO.getSource()){
                 case 0:
@@ -1216,7 +1114,7 @@ public class OrderServiceImpl extends BaseServiceImpl<OrderMapper, Order> implem
                         }else if (order.getSourceLevel().equals(3) ){
                             sum = serviceCustomerList.stream().filter(s->s.getStreetId().equals(order.getAreaId()) && StringUtils.isNotEmpty(s.getCustomerTypeId()) && s.getCustomerTypeId().contains(","+face.getAreaId().toString()+",")).mapToLong(s->s.getCustomerNum()).sum();
                         }
-                     }
+                    }
                     id.add(face.getAreaId().toString());
                     title.add(face.getTitle());
                     total.add(face.getTotal());
@@ -1354,13 +1252,6 @@ public class OrderServiceImpl extends BaseServiceImpl<OrderMapper, Order> implem
             face.setGrantNum(grantSum);
             Long exchangeSum = dataList.stream().filter(t -> t.getTransType().equals("1")).mapToLong(t -> t.getAmount()).sum();
             face.setExchangeNum(exchangeSum);
-
-            Long grantWmSum = dataList.stream().filter(t -> t.getTransType().equals("0") && t.getRemark().contains("文明积分")).mapToLong(t -> t.getAmount()).sum();
-            face.setGrantNumWm(grantWmSum);
-            Long grantYlSum = dataList.stream().filter(t -> t.getTransType().equals("0") && t.getRemark().contains("银龄积分")).mapToLong(t -> t.getAmount()).sum();
-            face.setGrantNumYl(grantYlSum);
-            Long exchangeWmSum = dataList.stream().filter(t -> t.getTransType().equals("1") && t.getRemark().contains("文明积分")).mapToLong(t -> t.getAmount()).sum();
-            face.setExchangeNumWm(exchangeWmSum);
             List<MonthData> goodsList = Lists.newArrayList();
             Map<Integer, List<IntegralTrans>> maps = dataList.stream().filter(i -> i.getParentId() != null).collect(Collectors.groupingBy(IntegralTrans::getParentId));
             for (Integer categoryId : maps.keySet()) {
@@ -1383,15 +1274,13 @@ public class OrderServiceImpl extends BaseServiceImpl<OrderMapper, Order> implem
             if (!goodsList.isEmpty()) {
                 face.setPointGoodsData2(goodsList);
             }
-            face.setPointMonthData(addMonth(dataList, 0,""));
-            face.setPointMonthDataWm(addMonth(dataList, 0,"文明积分"));
-            face.setPointMonthDataYl(addMonth(dataList, 0,"银龄积分"));
-            face.setPointCountData(addMonth(dataList, 1,""));
+            face.setPointMonthData(addMonth(dataList, 0));
+            face.setPointCountData(addMonth(dataList, 1));
             returnList.add(face);
         }
     }
 
-    private List<MonthData> addMonth(List<IntegralTrans> transList,Integer type,String remark){
+    private List<MonthData> addMonth(List<IntegralTrans> transList,Integer type){
         Date endDate = new Date();
         Calendar calendar = Calendar.getInstance();
         calendar.setTime(com.poteviohealth.cgp.common.utils.DateUtils.getLastDayOfMonth(endDate));
@@ -1414,14 +1303,10 @@ public class OrderServiceImpl extends BaseServiceImpl<OrderMapper, Order> implem
                     data.setAddValue(0L);
                     data.setUseValue(0L);
                 }else{
-                    if(StringUtils.isNotEmpty(remark)){
-                        data.setAddValue(transList.stream().filter(c->c.getBuildTime().after(calendar2.getTime()) && c.getBuildTime().before(com.poteviohealth.cgp.common.utils.DateUtils.getLastDayOfMonth(calendar2.getTime())) && c.getTransType().equals("0") && c.getRemark().contains(remark)).mapToLong(c->c.getAmount()).sum());
-                        data.setUseValue(transList.stream().filter(c->c.getBuildTime().after(calendar2.getTime()) && c.getBuildTime().before(com.poteviohealth.cgp.common.utils.DateUtils.getLastDayOfMonth(calendar2.getTime())) && c.getTransType().equals("1") && c.getRemark().contains(remark)).mapToLong(c->c.getAmount()).sum());
-                    }else{
-                        data.setAddValue(transList.stream().filter(c->c.getBuildTime().after(calendar2.getTime()) && c.getBuildTime().before(com.poteviohealth.cgp.common.utils.DateUtils.getLastDayOfMonth(calendar2.getTime())) && c.getTransType().equals("0")).mapToLong(c->c.getAmount()).sum());
-                        data.setUseValue(transList.stream().filter(c->c.getBuildTime().after(calendar2.getTime()) && c.getBuildTime().before(com.poteviohealth.cgp.common.utils.DateUtils.getLastDayOfMonth(calendar2.getTime())) && c.getTransType().equals("1")).mapToLong(c->c.getAmount()).sum());
-                    }
+                    data.setAddValue(transList.stream().filter(c->c.getBuildTime().after(calendar2.getTime()) && c.getBuildTime().before(com.poteviohealth.cgp.common.utils.DateUtils.getLastDayOfMonth(calendar2.getTime())) && c.getTransType().equals("0")).mapToLong(c->c.getAmount()).sum());
+                    data.setUseValue(transList.stream().filter(c->c.getBuildTime().after(calendar2.getTime()) && c.getBuildTime().before(com.poteviohealth.cgp.common.utils.DateUtils.getLastDayOfMonth(calendar2.getTime())) && c.getTransType().equals("1")).mapToLong(c->c.getAmount()).sum());
                 }
+
             }else {
                 if (transList.isEmpty()) {
                     data.setAddValue(0L);
@@ -1452,40 +1337,18 @@ public class OrderServiceImpl extends BaseServiceImpl<OrderMapper, Order> implem
                 if(subsidyCustomerFace.getGrantNum() != null){
                     order.setPointGrant(subsidyCustomerFace.getGrantNum());
                 }
-                if(order.getPointGrantWm() == null){
-                    order.setPointGrantWm(0L);
-                }
-                if(subsidyCustomerFace.getGrantNumWm() != null){
-                    order.setPointGrantWm(subsidyCustomerFace.getGrantNumWm());
-                }
-                if(order.getPointGrantYl() == null){
-                    order.setPointGrantYl(0L);
-                }
-                if(subsidyCustomerFace.getGrantNumYl() != null){
-                    order.setPointGrantYl(subsidyCustomerFace.getGrantNumYl());
-                }
                 if(order.getPointExchange() == null){
                     order.setPointExchange(0L);
                 }
                 if(subsidyCustomerFace.getExchangeNum() != null){
                     order.setPointExchange(subsidyCustomerFace.getExchangeNum());
                 }
-                if(order.getPointExchangeWm() == null){
-                    order.setPointExchangeWm(0L);
-                }
-                if(subsidyCustomerFace.getExchangeNumWm() != null){
-                    order.setPointExchangeWm(subsidyCustomerFace.getExchangeNumWm());
-                }
 
                 order.setPointGoodsData2(JSONObject.toJSONString(subsidyCustomerFace.getPointGoodsData2()));
 
                 order.setPointCountData(JSONObject.toJSONString(subsidyCustomerFace.getPointCountData()));
 
                 order.setPointMonthData(JSONObject.toJSONString(subsidyCustomerFace.getPointMonthData()));
-
-                order.setPointMonthDataWm(JSONObject.toJSONString(subsidyCustomerFace.getPointMonthDataWm()));
-
-                order.setPointMonthDataYl(JSONObject.toJSONString(subsidyCustomerFace.getPointMonthDataYl()));
             }
         }
     }
@@ -1867,3 +1730,4 @@ public class OrderServiceImpl extends BaseServiceImpl<OrderMapper, Order> implem
         }
     }
 }
+

+ 35 - 71
src/main/java/com/poteviohealth/cgp/statistics/service/impl/WatermarkImgServiceImpl.java

@@ -1,18 +1,13 @@
 package com.poteviohealth.cgp.statistics.service.impl;
 
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.google.common.collect.Lists;
 import com.poteviohealth.cgp.common.filter.TokenContext;
 import com.poteviohealth.cgp.common.model.VaultsResponse;
 import com.poteviohealth.cgp.common.service.impl.BaseServiceImpl;
-import com.poteviohealth.cgp.common.utils.CgpTool;
 import com.poteviohealth.cgp.statistics.mapper.WatermarkImgMapper;
-import com.poteviohealth.cgp.statistics.model.Distinction;
 import com.poteviohealth.cgp.statistics.model.WatermarkImg;
-import com.poteviohealth.cgp.statistics.model.indto.OrderRecordDto;
 import com.poteviohealth.cgp.statistics.model.indto.PriceUploadDto;
 import com.poteviohealth.cgp.statistics.model.outdto.OrderImageDTO;
-import com.poteviohealth.cgp.statistics.service.IDistinctionService;
 import com.poteviohealth.cgp.statistics.service.IWatermarkImgService;
 import com.poteviohealth.cgp.statistics.utils.OssUtils;
 import com.poteviohealth.cgp.statistics.utils.Watermark;
@@ -23,7 +18,6 @@ import org.springframework.stereotype.Service;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
-import java.util.Arrays;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -39,8 +33,6 @@ public class WatermarkImgServiceImpl extends BaseServiceImpl<WatermarkImgMapper,
     private String dbName;
     @Resource
     private OssUtils ossUtils;
-    @Resource
-    private IDistinctionService distinctionService;
 
     @Override
     public VaultsResponse updateOrderUrl(List<PriceUploadDto> list) {
@@ -50,23 +42,13 @@ public class WatermarkImgServiceImpl extends BaseServiceImpl<WatermarkImgMapper,
         for (PriceUploadDto dto : list) {
             orderId = dto.getOrderId();
             if(StringUtils.isNotEmpty(dto.getUrl())){
-                if(dto.getIndex() <=6){
+                if(dto.getIndex() <=3){
                     startUrl.add(dto.getUrl());
                 }else{
                     endUrl.add(dto.getUrl());
                 }
             }
         }
-
-        OrderImageDTO dto = baseMapper.getOrderUrl(TokenContext.cureOperatorId(),dbName, orderId);
-        String orgVal = "";
-        if(StringUtils.isNotEmpty(dto.getStartUrl())){
-            orgVal = dto.getStartUrl()+",";
-        }
-        if(StringUtils.isNotEmpty(dto.getEndUrl())){
-            orgVal += dto.getEndUrl();
-        }
-
         String nowVal = "";
         String start = "";
         if(!startUrl.isEmpty()){
@@ -79,6 +61,15 @@ public class WatermarkImgServiceImpl extends BaseServiceImpl<WatermarkImgMapper,
             end = endUrl.stream().map(String::valueOf).collect(Collectors.joining(","));
             nowVal +=end;
         }
+
+        OrderImageDTO dto = baseMapper.getOrderUrl(TokenContext.cureOperatorId(),dbName, orderId);
+        String orgVal = "";
+        if(StringUtils.isNotBlank(dto.getStartUrl())){
+            orgVal = dto.getStartUrl()+",";
+        }
+        if(StringUtils.isNotBlank(dto.getEndUrl())){
+            orgVal += dto.getEndUrl();
+        }
         WatermarkImg wi = new WatermarkImg();
         wi.setUid(orderId.toString());
         wi.setOriginalImg(orgVal);
@@ -86,60 +77,33 @@ public class WatermarkImgServiceImpl extends BaseServiceImpl<WatermarkImgMapper,
         this.save(wi);
         if(orderId != null){
             baseMapper.updateOrderUrl(TokenContext.cureOperatorId(),start ,end , dbName, orderId);
-            //保存操作记录
-            OrderRecordDto orderDto = new OrderRecordDto();
-            orderDto.setOrderRecordId(CgpTool.generateKey());
-            orderDto.setOrderId(orderId);
-            orderDto.setOperatorId(TokenContext.cureOperatorId());
-            orderDto.setOrderOperator(TokenContext.cureWebUser().getName());
-            orderDto.setOrderRole("后台站长");
-            orderDto.setOrderStatus("后台上传照片");
-            baseMapper.saveOrderRecord(orderDto,dbName);
-
-            if(StringUtils.isNotEmpty(orgVal)){
-               List<String> nowList = Arrays.asList( nowVal.split(","));
-                for (String s : orgVal.split(",")) {
-                    if(!nowList.contains(s)){
-                        QueryWrapper<Distinction> queryWrapper = new QueryWrapper<>();
-                        queryWrapper.eq("url", s);
-                        queryWrapper.eq("order_id", orderId);
-                        distinctionService.remove(queryWrapper);
-                    }
-                }
-            }
         }
         return VaultsResponse.success();
-    }
+     }
 
-    @Override
-    public VaultsResponse<List<PriceUploadDto>> printingWatermark(List<PriceUploadDto> list) {
-        for (PriceUploadDto dto : list) {
-            if(StringUtils.isBlank(dto.getDate()) || StringUtils.isBlank(dto.getUrl()) ||StringUtils.isBlank(dto.getType()) || dto.getType().contains("video")){
-                continue;
-            }
-                String uid = (dto.getUrl().split("/")[dto.getUrl().split("/").length-1]).split("\\.")[0];
-                WatermarkImg watermarkImg = this.getEntityByBeanId("uid",uid );
-                if(watermarkImg != null){
-                    dto.setUrl(watermarkImg.getOriginalImg());
-                }
-                MultipartFile image = Watermark.createPrice(dto);
-                VaultsResponse vaultsResponse = ossUtils.uploadOneFile(image,dto.getOrderId());
-                if(!vaultsResponse.validate()){
-                    return VaultsResponse.failed("水印处理失败");
+            @Override
+            public VaultsResponse<List<PriceUploadDto>> printingWatermark(List<PriceUploadDto> list) {
+                for (PriceUploadDto dto : list) {
+                    if(StringUtils.isBlank(dto.getDate()) || StringUtils.isBlank(dto.getUrl()) ||StringUtils.isBlank(dto.getType()) || dto.getType().contains("video")){
+                        continue;
+                    }
+                    String uid = (dto.getUrl().split("/")[dto.getUrl().split("/").length-1]).split("\\.")[0];
+                    WatermarkImg watermarkImg = this.getEntityByBeanId("uid",uid );
+                    if(watermarkImg != null){
+                        dto.setUrl(watermarkImg.getOriginalImg());
+                    }
+                    MultipartFile image = Watermark.createPrice(dto);
+                    VaultsResponse vaultsResponse = ossUtils.uploadOneFile(image,dto.getOrderId());
+                    if(!vaultsResponse.validate()){
+                        return VaultsResponse.failed("水印处理失败");
+                    }
+                    WatermarkImg newWi = new WatermarkImg();
+                    newWi.setNowImg(vaultsResponse.getData().toString());
+                    newWi.setOriginalImg(dto.getUrl());
+                    newWi.setUid((newWi.getNowImg().split("/")[newWi.getNowImg().split("/").length-1]).split("\\.")[0]);
+                    this.save(newWi);
+                    dto.setUrl(newWi.getNowImg());
                 }
-                WatermarkImg newWi = new WatermarkImg();
-                newWi.setNowImg(vaultsResponse.getData().toString());
-                newWi.setOriginalImg(dto.getUrl());
-                newWi.setUid((newWi.getNowImg().split("/")[newWi.getNowImg().split("/").length-1]).split("\\.")[0]);
-                this.save(newWi);
-                dto.setUrl(newWi.getNowImg());
+                return VaultsResponse.success(list);
             }
-        return VaultsResponse.success(list);
-    }
-
-    public static void main(String[] args) {
-        String url = "https://ptsubsidy.oss-cn-beijing.aliyuncs.com/yqaa/S123N-FAD786CB-AFB3-402C-9FD0-953838D74E8E.jpg";
-        String val = url.split("/")[url.split("/").length-1];
-        System.out.println(val.split("\\.")[0]);
-    }
-}
+        }

+ 27 - 89
src/main/java/com/poteviohealth/cgp/statistics/utils/OssUtils.java

@@ -4,16 +4,15 @@ import com.aliyun.oss.OSS;
 import com.aliyun.oss.OSSClientBuilder;
 import com.poteviohealth.cgp.common.model.VaultsResponse;
 import com.poteviohealth.cgp.common.utils.CgpTool;
-import com.poteviohealth.cgp.common.utils.FingerImage;
 import lombok.extern.log4j.Log4j2;
-import org.apache.commons.io.FileUtils;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.mock.web.MockMultipartFile;
 import org.springframework.stereotype.Component;
 import org.springframework.web.multipart.MultipartFile;
 
 import java.io.File;
+import java.io.FileInputStream;
 import java.io.IOException;
-import java.io.InputStream;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 
@@ -34,25 +33,13 @@ public class OssUtils {
     @Value("${aliyun.oss.endpoint}")
     private String endPoint;
 
-    @Value("${aliyun.oss.internetpoint}")
-    private String internetpoint;
-
     @Value("${aliyun.oss.bucketName}")
     private String bucketName;
 
     @Value("${aliyun.oss.dir}")
     private String dir;
-    public VaultsResponse<String> uploadOneFile(MultipartFile dto, Long orderId) {
-        try {
-            return uploadOneFile(dto,orderId,dto.getInputStream());
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-        return null;
-    }
 
-
-    public VaultsResponse<String> uploadOneFile(MultipartFile dto, Long orderId,InputStream inputStream) {
+    public VaultsResponse<String> uploadOneFile(MultipartFile dto,Long orderId) {
         // 创建OSSClient实例。
 
         log.info("开始上传===");
@@ -60,21 +47,32 @@ public class OssUtils {
         try {
             log.info("fileName==="+dto.getOriginalFilename());
             //设置文件名
-                Integer pos = dto.getOriginalFilename().lastIndexOf('.');
-                String suffix = "";
-                if (pos != -1) {
-                    suffix = dto.getOriginalFilename().substring(pos);
-                }
+            Integer pos = dto.getOriginalFilename().lastIndexOf('.');
+            String suffix = "";
+            if (pos != -1) {
+                suffix = dto.getOriginalFilename().substring(pos);
+            }
 
             SimpleDateFormat format = new SimpleDateFormat("yyMM");
             String dirStr = dir+format.format(new Date());
-                String fileName = dirStr+"/S"+orderId+"N-"+ CgpTool.generateUUID() +suffix;
-                // 创建PutObject请求。
-                ossClient.putObject(bucketName, fileName, inputStream);
-                String url = "https://" + bucketName + "." + internetpoint + "/" + fileName;
-                // System.out.println(url);
+            String fileName = dirStr+"/S"+orderId+"N-"+ CgpTool.generateUUID() +suffix;
+            // 创建PutObject请求。
+            log.info("Size=="+dto.getSize()/1024L/1024L);
+            if(suffix.indexOf("mp4") != -1 && (dto.getSize() /1024L/1024L >3L)){
+                File tempFile = File.createTempFile("temp_", ".mp4");
+                dto.transferTo(tempFile);
+                File outFile =  this.compressVideo(tempFile);
+                dto = new MockMultipartFile(outFile.getName(), new FileInputStream(outFile));
+                tempFile.delete();
+                outFile.delete();
+            }
+
+            ossClient.putObject(bucketName, fileName, dto.getInputStream());
+
+            String url = "https://" + bucketName + "." + endPoint + "/" + fileName;
+            // System.out.println(url);
             log.info("结束上传===");
-               return VaultsResponse.success(url);
+            return VaultsResponse.success(url);
 
         } catch (Exception e) {
             e.printStackTrace();
@@ -94,7 +92,7 @@ public class OssUtils {
          * 比如文件路径为:http://edu-czf.oss-cn-guangzhou.aliyuncs.com/2022/08/abc.jpg",
          * 则完整路径就是:2022/08/abc.jpg
          */
-        int begin = ("https://" + bucketName + "." + internetpoint + "/").length(); //找到文件路径的开始下标
+        int begin = ("https://" + bucketName + "." + endPoint + "/").length(); //找到文件路径的开始下标
         String deleteUrl = fileUrl.substring(begin);
 
         try {
@@ -137,65 +135,5 @@ public class OssUtils {
         return null;
     }
 
-    /**
-     * 获取指定的视频文件后进行封面截图为jpg
-     */
-    public File generateCover(File inputFile) {
-        log.info("视频截图开始==="+inputFile.getName());
-        try {
-            // 创建ProcessBuilder对象
-            log.info("输入路径==="+inputFile.getAbsolutePath());
-            // 截图保存位置
-            String outName = "out"+CgpTool.generateUUID()+".jpg";
-            String command = "ffmpeg -sseof -1 -i " + inputFile.getAbsolutePath() + "  -vframes  1 "+ outName;
-            log.info("封面截图方式==="+command);
-            ProcessBuilder  pb = new ProcessBuilder("ffmpeg","-sseof","-1","-i",inputFile.getAbsolutePath(),"-vframes","1",outName);
-            pb.redirectErrorStream(true);
-            pb.redirectOutput(ProcessBuilder.Redirect.INHERIT);
-            Process process = pb.start();
-            process.waitFor();
-            log.info("封面截图完成===");
-            return new File(outName);
-        } catch (IOException e) {
-            e.printStackTrace();
-        } catch (InterruptedException e){
-            e.printStackTrace();
-        }
-
-        return null;
-    }
-
-    /**
-     * 获取文件
-     * @param fileUrl
-     * @return
-     */
-    public String getFileFinger(String fileUrl) {
-
-        // 创建OSSClient实例。
-        OSS ossClient = new OSSClientBuilder().build(endPoint, accessKeyId, secretAccessKey);
-
-        try {
-            String url = fileUrl.replace("https://ptsubsidy.oss-cn-beijing.aliyuncs.com/", "");
-            InputStream inputStream = ossClient.getObject(bucketName, url).getObjectContent();
-            if(url.indexOf("mp4") != -1){
-                File tempFile = File.createTempFile("temp_", ".mp4");
-                FileUtils.copyInputStreamToFile(inputStream, tempFile);
-                File file = this.generateCover(tempFile);
-                tempFile.delete();
-                String val = FingerImage.readImagePix(file);
-                file.delete();
-                return val;
-            }
-
-            return FingerImage.readImagePix(inputStream);
-        } catch (Exception e) {
-            e.printStackTrace();
-            return null;
-        } finally {
-            if (ossClient != null) {
-                ossClient.shutdown();
-            }
-        }
-    }
 }
+

+ 10 - 30
src/main/resources/mapper/statistics/DistinctionMapper.xml

@@ -12,36 +12,16 @@
         where yn = 0
         and operator_id = #{operatorId}
         and upload_date >= #{date}
-        and
-        <if test="uid1 != '' ">
-            BIT_COUNT(uid1 ^ b#{uid1} )+
-        </if>
-        <if test="uid2 != '' ">
-            BIT_COUNT(uid2 ^ b#{uid2} )+
-        </if>
-        <if test="uid3 != '' ">
-            BIT_COUNT(uid3 ^ b#{uid3} )+
-        </if>
-        <if test="uid4 != '' ">
-            BIT_COUNT(uid4 ^ b#{uid4} )+
-        </if>
-        <if test="uid5 != '' ">
-            BIT_COUNT(uid5 ^ b#{uid5} )+
-        </if>
-        <if test="uid6 != '' ">
-            BIT_COUNT(uid6 ^ b#{uid6} )+
-        </if>
-        <if test="uid7 != '' ">
-            BIT_COUNT(uid7 ^ b#{uid7} )+
-        </if>
-        <if test="uid8 != '' ">
-            BIT_COUNT(uid8 ^ b#{uid8} )+
-        </if>
-        <if test="uid9 != '' ">
-            BIT_COUNT(uid9 ^ b#{uid9} )+
-        </if>
-        0
-            &lt;= #{dCount} LIMIT 1
+        and uid1 = b#{uid1}
+        and uid2 = b#{uid2}
+        and uid3 = b#{uid3}
+        and uid4 = b#{uid4}
+        and uid5 = b#{uid5}
+        and uid6 = b#{uid6}
+        and uid7 = b#{uid7}
+        and uid8 = b#{uid8}
+        and uid9 = b#{uid9}
+        LIMIT 1
     </select>
     <select id="getFinishOrderList" resultType="com.poteviohealth.cgp.common.integrated.statistics.model.FingerParams">
         select o.order_id as orderId,o.supplier_id as supplierId,o.operator_id as operatorId,o.station_id as stationId,od.start_url as startUrl,od.end_url as endUrl

+ 48 - 97
src/main/resources/mapper/statistics/OrderMapper.xml

@@ -3,15 +3,7 @@
 <mapper namespace="com.poteviohealth.cgp.statistics.mapper.OrderMapper">
     <select id="integralTransList" resultType="com.poteviohealth.cgp.statistics.model.outdto.IntegralTrans">
         SELECT
-            IFNULL(
-                    c.now_city_id,(
-                SELECT
-                    p.address_city_id
-                FROM
-                    ${dbName}_common.f_operator p
-                WHERE
-                    p.id = c.operator_id
-            )) AS cityId,
+            IFNULL(c.now_city_id,p.address_city_id) AS cityId,
             c.now_country_id AS countryId,
             c.now_street_id AS streetId,
             od.product_category_id AS productCategoryId,
@@ -19,14 +11,14 @@
             g.full_name AS fullName,
             t.trans_type AS transType,
             t.amount AS amount,
-            t.remark as remark,
             t.build_time AS buildTime
         FROM
             ${dbName}_finance.c_card_acc_trans t
                 LEFT JOIN ${dbName}_finance.c_card_acc_detail d ON t.detail_id = d.id
-                LEFT JOIN ${dbName}_order.o_order_detail_${operatorId} od ON od.order_detail_id = t.trans_id
+                LEFT JOIN ${dbName}_order.o_order_detail_${operatorId} od ON CAST(od.order_detail_id AS VARCHAR(255)) = t.trans_id
                 LEFT JOIN ${dbName}_customer.c_customer_subsidy_${operatorId} c ON c.subsidy_customer_id = d.subsidy_customer_id
                 LEFT JOIN ${dbName}_common.f_category g ON g.id = od.product_category_id
+            left join ${dbName}_common.f_operator p on p.id = d.operator_id
         WHERE
             d.yn = 0
           AND t.yn = 0
@@ -38,21 +30,14 @@
         SELECT
             c.age AS age,
             c.sex AS sex,
-            IFNULL(
-                    c.now_city_id,(
-                SELECT
-                    p.address_city_id
-                FROM
-                    ${dbName}_common.f_operator p
-                WHERE
-                    p.id = c.operator_id
-            )) AS cityId,
+            IFNULL(c.now_city_id,p.address_city_id) AS cityId,
             c.now_country_id AS countryId,
             c.now_street_id AS streetId,
             d.created_date AS createdDate
         FROM
             ${dbName}_finance.c_card_acc_detail d
-                LEFT JOIN ${dbName}_customer.c_customer_subsidy_${operatorId} c ON c.subsidy_customer_id = d.subsidy_customer_id
+            LEFT JOIN ${dbName}_customer.c_customer_subsidy_${operatorId} c ON c.subsidy_customer_id = d.subsidy_customer_id
+            left join ${dbName}_common.f_operator p on p.id = d.operator_id
         WHERE
             d.yn = 0
           AND d.ENABLE = 1
@@ -61,7 +46,7 @@
 
     <select id="areaList" resultType="com.poteviohealth.cgp.common.integrated.partner.model.AreaDTO">
         select id,parent as parentId,name,tree_path, region_area_code,
-               (LENGTH(tree_path) - LENGTH(replace(tree_path,',','')))-1 as `level`
+               (LENGTH(tree_path) - LENGTH(replace(tree_path,',','')))-1 as level
         from ${dbName}_common.f_area
         where yn = 0
         and parent is not null
@@ -82,7 +67,7 @@
 
     <select id="supplierStationList" resultType="com.poteviohealth.cgp.statistics.model.outdto.SupplierStation">
         select id,city,country,street from ${dbName}_common.f_supplier_station
-        where yn = 0 and `level` >=2 and status = 1 and type = 1 and LENGTH(region_code) = 12
+        where yn = 0 and level >=2 and status = 1 and type = 1 and LENGTH(region_code) = 12
     </select>
 
     <select id="employeeList" resultType="com.poteviohealth.cgp.statistics.model.outdto.Employee">
@@ -104,24 +89,26 @@
         SELECT
             c.subsidy_customer_id as subsidyCustomerId,
             c.customer_id as customerId,
-            IFNULL(c.now_city_id,(select p.address_city_id from ${dbName}_common.f_operator p where p.id = c.operator_id)) as nowCityId,
-            IFNULL(c.now_city_name,(select p.address_city_name from ${dbName}_common.f_operator p where p.id = c.operator_id)) as nowCityName,
+            IFNULL(c.now_city_id,p.address_city_id) as nowCityId,
+            IFNULL(c.now_city_name,p.address_city_name) as nowCityName,
             c.now_country_id as nowCountryId,
             c.now_country_name as nowCountryName,
             c.now_street_id as nowStreetId,
             c.now_street_name as nowStreetName,
             c.customer_sign_id as customerSignId,
-            CONCAT_WS( ',', cs.customer_type_id ) as customerTypeId,
-            CONCAT_WS(',',cs.customer_type) as customerType,
+            WM_CONCAT(cs.customer_type_id ) as customerTypeId,
+            WM_CONCAT(cs.customer_type) as customerType,
             c.age as age,
             c.sex as sex,
-            if(sum(IF( d.service_tags like '%1%' , 1, 0 ) )>0,1,0) as category
+            if(sum(IF( d.settlement = 1, 1, 0 ) )>0,1,0) as category
         FROM
             ${dbName}_finance.c_card_acc_detail d
            ,${dbName}_customer.c_customer_subsidy_${operatorId} c
            ,${dbName}_customer.c_customer_subsidy_supplier_${operatorId} cs
+           ,${dbName}_common.f_operator p
         where c.subsidy_customer_id = d.subsidy_customer_id
           and cs.subsidy_customer_id = c.subsidy_customer_id
+          and p.id = d.operator_id
           and c.yn = 0 AND d.yn = 0 AND cs.yn = 0
           and cs.customer_type_id is not null
           and cs.enabled = 1
@@ -131,37 +118,39 @@
     <select id="orderServiceCustomerList"
             resultType="com.poteviohealth.cgp.common.integrated.customer.model.CustomerServiceParams">
         SELECT
-            IFNULL(c.now_city_id,(select p.address_city_id from ${dbName}_common.f_operator p where p.id = c.operator_id)) as cityId,
+            IFNULL(c.now_city_id,p.address_city_id) as cityId,
             IFNULL(c.now_country_id,-1) AS countryId,
             IFNULL(c.now_street_id,-1) AS streetId,
             count(DISTINCT c.customer_id) as customerNum,
-            CONCAT(',',CONCAT_WS( ',', csp.customer_type_id ),',') as customerTypeId
+            CONCAT(',',WM_CONCAT(DISTINCT csp.customer_type_id ),',') as customerTypeId
         FROM
             ${dbName}_customer.c_customer_subsidy_${operatorId} c
                 join (select subsidy_customer_id,customer_type_id from  ${dbName}_customer.c_customer_subsidy_supplier_${operatorId} where yn =0 and enabled = 1 group by subsidy_customer_id) csp
                      on c.subsidy_customer_id = csp.subsidy_customer_id
                 LEFT JOIN ${dbName}_order.o_order_${operatorId} o ON o.customer_id = c.customer_id
+            left join ${dbName}_common.f_operator p on p.id = c.operator_id
         WHERE
             o.order_status = 6
           AND o.order_type = 2
           and c.yn =0
           and o.yn = 0
-        GROUP BY c.now_street_id,CONCAT_WS(',',csp.customer_type_id);
+        GROUP BY c.now_street_id
     </select>
 
     <select id="getSubsidyCustomerMealList" resultType="com.poteviohealth.cgp.statistics.model.outdto.Customer">
-        select IFNULL(now_city_id,(select p.address_city_id from ${dbName}_common.f_operator p where p.id = operator_id)) as nowCityId,
-               IFNULL(now_country_id,-1) AS nowCountryId,
-               IFNULL(now_street_id,-1) AS nowStreetId
-        from ${dbName}_customer.c_customer_subsidy_${operatorId}
-         where yn = 0 and meal_date is not null
+        select IFNULL(c.now_city_id,p.address_city_id) as nowCityId,
+               IFNULL(c.now_country_id,-1) AS nowCountryId,
+               IFNULL(c.now_street_id,-1) AS nowStreetId
+        from ${dbName}_customer.c_customer_subsidy_${operatorId} c
+        left join ${dbName}_common.f_operator p on p.id = c.operator_id
+         where c.yn = 0 and c.meal_date is not null
     </select>
 
     <select id="queryOrderIntegrationData"
             resultType="com.poteviohealth.cgp.statistics.model.outdto.OrderIntegrationData">
         SELECT o.order_id as orderId,o.city_id as cityId,o.country_id as countryId,o.street_id as streetId,o.visit_status as visitStatus
-                ,o.customer_id as  customerId,o.finish_time as  finishTime,od.product_category_id as productCategoryId
-                FROM ${dbName}_order.o_order_${operatorId} o,${dbName}_order.o_order_detail_${operatorId} od
+             ,o.customer_id as  customerId,o.finish_time as  finishTime,od.product_category_id as productCategoryId
+        FROM ${dbName}_order.o_order_${operatorId} o,${dbName}_order.o_order_detail_${operatorId} od
         where o.order_id = od.order_id
           and o.yn= 0
           and o.order_status = 6
@@ -286,13 +275,13 @@
             o.card_names as cardNameStr
         FROM
             ${dbName}_order.o_order_${operatorId} o
-            left join ${dbName}_order.o_order_detail_${operatorId} od on o.order_id = od.order_id and od.yn=0
+                left join ${dbName}_order.o_order_detail_${operatorId} od on o.order_id = od.order_id and od.yn=0
         WHERE
             o.yn=0
-            and o.id > #{start}
+          and o.id > #{start}
           and ${ew.sqlSegment}
-            order by o.id
-        limit 10000
+        order by o.id
+            limit 10000
     </select>
 
     <select id="orderPageListSize" resultType="java.lang.Integer">
@@ -334,7 +323,8 @@
             fund_price,
             '已支付' as payStatusStr,
             pay_account as payAccountStr,
-            service_station_name,
+            service_station_name
+                service_station_name,
             street_name as streetName,
             country_name as countryName,
             case when source_id = 1 then '刷脸' when source_id = 2 then '手机号' else '' end as sourceStr,
@@ -399,13 +389,13 @@
         select count(d.id)
         from ${dbName}_finance.c_card_acc_detail d
         <if test="queryParam.stationIds.size()>0">
-        left join (SELECT d.id,
-        SUBSTRING_INDEX( SUBSTRING_INDEX( d.station_ids, ',', b.id + 1 ), ',', -1 ) AS stationId
-        FROM ${dbName}_finance.c_card_acc_detail d INNER JOIN t_number b ON b.id &lt;(
-        LENGTH( d.station_ids ) - LENGTH( REPLACE(d.station_ids,',','') )  +  1
-        )
-        where d.yn = 0 and d.type = 1 and d.station_ids != '' and  ${ew.sqlSegment}  ) a
-        on d.id = a.id
+            left join (SELECT d.id,
+            SUBSTRING_INDEX( SUBSTRING_INDEX( d.station_ids, ',', b.id + 1 ), ',', -1 ) AS stationId
+            FROM ${dbName}_finance.c_card_acc_detail d INNER JOIN t_number b ON b.id &lt;(
+            LENGTH( d.station_ids ) - LENGTH( REPLACE(d.station_ids,',','') )  +  1
+            )
+            where d.yn = 0 and d.type = 1 and d.station_ids != '' and  ${ew.sqlSegment}  ) a
+            on d.id = a.id
         </if>
         where d.yn = 0 and d.type = 1 and d.station_ids != ''
         <if test="queryParam.stationIds.size()>0">
@@ -422,13 +412,13 @@
         case when d.enable =1 then '启用' else '停用' end as enabled,TRUNCATE(d.balance/100,2) as balance
         from ${dbName}_finance.c_card_acc_detail d
         <if test="queryParam.stationIds.size()>0">
-        left join (SELECT d.id,
-        SUBSTRING_INDEX( SUBSTRING_INDEX( d.station_ids, ',', b.id + 1 ), ',', -1 ) AS stationId
-        FROM ${dbName}_finance.c_card_acc_detail d INNER JOIN t_number b ON b.id &lt;(
-        LENGTH( d.station_ids ) - LENGTH( REPLACE(d.station_ids,',','') )  +  1
-        )
-        where d.yn = 0 and d.type = 1 and d.station_ids != '' and  ${ew.sqlSegment}  ) a
-        on d.id = a.id
+            left join (SELECT d.id,
+            SUBSTRING_INDEX( SUBSTRING_INDEX( d.station_ids, ',', b.id + 1 ), ',', -1 ) AS stationId
+            FROM ${dbName}_finance.c_card_acc_detail d INNER JOIN t_number b ON b.id &lt;(
+            LENGTH( d.station_ids ) - LENGTH( REPLACE(d.station_ids,',','') )  +  1
+            )
+            where d.yn = 0 and d.type = 1 and d.station_ids != '' and  ${ew.sqlSegment}  ) a
+            on d.id = a.id
         </if>
         where d.yn = 0 and d.type = 1 and d.station_ids != ''
         and d.id > #{start}
@@ -507,43 +497,4 @@
         order by t.id
         limit 10000
     </select>
-
-    <select id="goldSendListSize" resultType="int">
-        select count(*)
-        from ${dbName}_customer.c_gold_send_${yearTime} d where d.yn = 0
-        and  ${ew.sqlSegment}
-    </select>
-
-    <select id="goldSendList" resultType="com.poteviohealth.cgp.statistics.model.outdto.GoldSendExcelDTO">
-        select d.id, d.expect_time as sendMonth,
-        d.name,
-        d.id_number,
-        TRUNCATE(d.money/100,2) as moneyStr,
-        d.country_name,
-        d.street_name,
-        d.community_name,
-        d.bank_name,
-        d.bank_card,
-        d.bank_holder,
-        case when d.gold_type = 0 then '80-89周岁'
-             when d.gold_type = 1 then '90-99周岁'
-             when d.gold_type = 2 then '100周岁以上' end as goldTypeStr
-        from ${dbName}_customer.c_gold_send_${yearTime} d
-        where d.yn = 0
-        and d.id > #{start}
-        and  ${ew.sqlSegment}
-        order by d.id
-        limit 10000
-    </select>
-
-    <select id="goldSendBankList" resultType="com.poteviohealth.cgp.statistics.model.outdto.GoldSendBankExcelDTO">
-        select d.id,d.name,d.id_number,'1' as idNumberType,TRUNCATE(d.money/100,2) as moneyStr,d.area_code,d.link_mobile,
-               d.now_address,d.bank_code,d.bank_card,d.bank_holder
-        from ${dbName}_customer.c_gold_send_${yearTime} d
-        where d.yn = 0
-          and d.id > #{start}
-          and  ${ew.sqlSegment}
-        order by d.id
-            limit 10000
-    </select>
-</mapper>
+</mapper>

+ 2 - 7
src/main/resources/mapper/statistics/WatermarkImgMapper.xml

@@ -5,12 +5,7 @@
         update  ${dbName}_order.o_order_detail_${operatorId} set start_url=#{startUrl},end_url=#{endUrl} where order_id = #{orderId}
     </update>
     <select id="getOrderUrl" resultType="com.poteviohealth.cgp.statistics.model.outdto.OrderImageDTO">
+        select start_url,end_url from ${dbName}_order.o_order_detail_${operatorId} where order_id = #{orderId}
         select IFNULL(start_url,'') AS startUrl,IFNULL(end_url,'') AS endUrl from ${dbName}_order.o_order_detail_${operatorId} where order_id = #{orderId}
     </select>
-
-    <insert id="saveOrderRecord">
-        INSERT INTO ${dbName}_order.o_order_record_${dto.operatorId}
-        (`order_record_id`, `created_date`, `modified_date`, `operator_id`, `order_id`, `order_operator`, `order_role`, `order_status`, `remark`, `yn`)
-        VALUES (#{dto.orderRecordId}, NOW(),NOW(),#{dto.operatorId},#{dto.orderId},#{dto.orderOperator},#{dto.orderRole},#{dto.orderStatus}, NULL, 0);
-    </insert>
-</mapper>
+</mapper>