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

Merge commit '0be726bec85f907a53c48abe02391338eed52cf3' into release

release_toaliyun_real
luozukai 6 лет назад
Родитель
Сommit
469bce5e75
19 измененных файлов: 267 добавлений и 38 удалений
  1. +7
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/device/KwMerchantMeterController.java
  2. +22
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/device/KwMeterDataController.java
  3. +13
    -0
      mallinkAdmin/src/main/resources/db/migration/V201907101118__L_ADD_FLOW_DATA.sql
  4. +9
    -0
      mallinkService/src/main/java/com/iformall/domain/dto/KwMeterDataDto.java
  5. +5
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxBusiness.java
  6. +6
    -0
      mallinkService/src/main/java/com/iformall/enums/EnumMailMsgModel.java
  7. +2
    -0
      mallinkService/src/main/java/com/iformall/mapper/KwMeterDataMapper.java
  8. +0
    -4
      mallinkService/src/main/java/com/iformall/service/WxBusinessService.java
  9. +10
    -10
      mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java
  10. +33
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxBusinessServiceImpl.java
  11. +16
    -8
      mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java
  12. +0
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxPayOrderServiceImpl.java
  13. +2
    -0
      mallinkService/src/main/java/com/iformall/service/kw/KwMerchantMeterService.java
  14. +2
    -0
      mallinkService/src/main/java/com/iformall/service/kw/KwMeterDataService.java
  15. +10
    -0
      mallinkService/src/main/java/com/iformall/service/kw/impl/KwMerchantMeterServiceImpl.java
  16. +52
    -0
      mallinkService/src/main/java/com/iformall/service/kw/impl/KwMeterDataServiceImpl.java
  17. +0
    -10
      mallinkService/src/main/java/com/iformall/service/msg/impl/SendSmsServiceImpl.java
  18. +72
    -1
      mallinkService/src/main/resources/mapper/KwMeterDataMapper.xml
  19. +6
    -2
      mallinkService/src/main/resources/mapper/WxBusinessMapper.xml

+ 7
- 0
mallinkAdmin/src/main/java/com/iformall/controller/device/KwMerchantMeterController.java Просмотреть файл

@@ -6,10 +6,12 @@ import com.iformall.common.Result;
import com.iformall.common.ResultData;
import com.iformall.controller.base.BaseController;

import com.iformall.domain.dto.KwMeterDataDto;
import com.iformall.domain.po.KwMerchantMeter;
import com.iformall.enums.EnumMerchantMeterStatus;
import com.iformall.enums.EnumMerchantStatus;
import com.iformall.service.kw.KwMerchantMeterService;
import com.iformall.service.kw.KwMeterDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
@@ -31,6 +33,8 @@ public class KwMerchantMeterController extends BaseController {
@Autowired
private KwMerchantMeterService kwMerchantMeterService;

@Autowired
private KwMeterDataService kwMeterDataService;

@ApiOperation("设备列表")
@GetMapping("list")
@@ -89,4 +93,7 @@ public class KwMerchantMeterController extends BaseController {

return new ResultData();
}



}

+ 22
- 0
mallinkAdmin/src/main/java/com/iformall/controller/device/KwMeterDataController.java Просмотреть файл

@@ -2,6 +2,7 @@ package com.iformall.controller.device;

import com.iformall.annotation.SystemControllerLog;

import com.iformall.common.ErrorCode;
import com.iformall.common.Result;
import com.iformall.common.ResultData;
import com.iformall.controller.base.BaseController;
@@ -42,4 +43,25 @@ public class KwMeterDataController extends BaseController {
return new ResultData(kwMeterDataService.listVoAsPage(kwMeterDataDto, pageNum,pageSize));
}



@ApiOperation("获取电量")
@GetMapping("getMeterUsedPower")
public Result getMeterUsedPower(@ModelAttribute KwMeterDataDto kwMeterDataDto) {

if (kwMeterDataDto == null)
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR);
if (kwMeterDataDto.getMeterId() == null)
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR);

if (kwMeterDataDto.getStartTime() == null && kwMeterDataDto.getStartNumber() == null)
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR);

if (kwMeterDataDto.getEndTime() == null && kwMeterDataDto.getEndNumber() == null)
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR);

return new ResultData(kwMeterDataService.getMeterUsedPower(kwMeterDataDto));
}


}

+ 13
- 0
mallinkAdmin/src/main/resources/db/migration/V201907101118__L_ADD_FLOW_DATA.sql Просмотреть файл

@@ -0,0 +1,13 @@
INSERT INTO `wx_msg_validationcode_model` (`id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`)
VALUES
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '456', 24, '审批通过通知', '', '<!DOCTYPE html>\n<html>\n\n<head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\">\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n <meta name=\"viewport\" content=\"initial-scale=1.0, user-scalable=no\" />\n <meta name=\"renderer\" content=\"webkit\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">\n <title>富茂审批邮件</title>\n <title></title>\n <script> document.documentElement.style.fontSize = document.documentElement.clientWidth / 7.5 + \'px\';</script>\n</head>\n\n<body>\n <div id=\"box\" style=\"padding:80px 20%;background:#E9E7E7;min-height:100vh;\">\n <header style=\"height:140px;width:100%;display:flex;background:rgba(31,47,62,1);border-radius:15px 15px 0px 0px;\">\n <img style=\"height:auto;width:292px;display:flex;align-self: center;justify-content: center;padding:0 40px;\" src=\"https://s3.cn-northwest-1.amazonaws.com.cn/iformall-net/cimg/changrong-logo.png\"/>\n </header>\n <div style=\"background:#fff;\">\n <div style=\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;padding:56px 55px 0;\">审批通过通知</div>\n <div style=\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);padding: 36px 55px;\">您申请的[{type}],[{name}]已经审批通过,请登录<a href=\"{page}\">{page}</a>跟进后续工作</div>\n </div>\n </div>\n</body>\n\n</html>', '2019-07-10 11:35:11', 0, 0, 500, 'http://202.165.179.86:8081/images/WechatIMG5130.png'),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '456', 26, '待办通知', '', '<!DOCTYPE html>\n<html>\n\n<head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\">\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n <meta name=\"viewport\" content=\"initial-scale=1.0, user-scalable=no\" />\n <meta name=\"renderer\" content=\"webkit\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">\n <title>富茂审批邮件</title>\n <title></title>\n <style>\n *{\n margin: 0;\n padding: 0;\n }\n </style>\n</head>\n\n<body>\n <div id=\"box\" style=\"padding:80px 20%;background:#E9E7E7;min-height:100vh;\">\n <header style=\"height:140px;width:100%;display:flex;background:rgba(31,47,62,1);border-radius:15px 15px 0px 0px;\">\n <img style=\"height:auto;width:292px;display:flex;align-self: center;justify-content: center;margin-left: 40px;\" src=\"{bg}\"/>\n </header>\n <content>\n <div style=\"background:#fff;\">\n <div style=\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;padding: 56px 55px 0;\">待办通知</div>\n <div style=\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);padding: 36px 55px 40px;\"><span>{name}</span><span>提交了一个营销申请待您审批,电脑登录</span><a href=\"{page}\" target=\"_blank\">{page}</a>查看您的待办</div>\n </div>\n <div style=\"height: auto;width: 100%;line-height: 40px; background: rgba(245,245,245,1);padding: 30px 0;\">\n <div style=\"overflow: hidden;\">\n <div style=\"float: left;font-size:18px;width:cale(20%-55px);font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\">申请时间:</div>\n <div style=\"float: left;font-size:18px;width:cale(80%-55px);font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);margin-left: 55px;\">{applyTime}</div>\n </div>\n <div style=\"overflow: hidden;\">\n <div style=\"float: left;font-size:18px;width:cale(20%-55px);font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\">申请进度:</div>\n <div style=\"float: left;width:cale(80%-55px);margin-left: 55px;\">\n \n {taskList}\n </div>\n </div>\n </div>\n <div style=\"background:#fff;\">\n <div style=\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;margin-top: 26px;padding: 56px 55px 0;\">遇到问题?</div>\n <div style=\"overflow: hidden;line-height: 60px;padding-bottom: 40px;\">\n <span style=\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\">请联系申请人:</span>\n <span style=\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);margin-left: 25px;\"><span>{linkName}</span><span style=\"margin-left: 16px; font-family:MicrosoftYaHei;font-weight:400;color:rgba(64,103,139,1);\">{linkPhone}</span></span>\n </div>\n </div>\n </content>\n </div>\n</body>\n\n</html>', '2019-07-10 11:37:33', 0, 0, 500, 'http://202.165.179.86:8081/images/WechatIMG5130.png'),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '456', 25, '审批通知', '', '<!DOCTYPE html>\n<html>\n\n<head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\">\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n <meta name=\"viewport\" content=\"initial-scale=1.0, user-scalable=no\" />\n <meta name=\"renderer\" content=\"webkit\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">\n <title>富茂审批邮件</title>\n <title></title>\n <script> document.documentElement.style.fontSize = document.documentElement.clientWidth / 7.5 + \'px\';</script>\n</head>\n\n<body>\n <div id=\"box\" style=\"padding:80px 20%;background:#E9E7E7;min-height:100vh;\">\n <header style=\"height:140px;width:100%;display:flex;background:rgba(31,47,62,1);border-radius:15px 15px 0px 0px;\">\n <img style=\"height:auto;width:292px;display:flex;align-self: center;justify-content: center;padding:0 40px;\" src=\"{bg}\"/>\n </header>\n <div style=\"background:#fff;\">\n <div style=\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;padding:56px 55px 0;\">审批通知</div>\n <div style=\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);padding: 36px 55px;\"><span>{userName}</span>同意[{type}][{name}]的审批,已呈送<span>{toUserName},</span>请登录<a href=\"{page}\">{page}</a>查看审批进度</div>\n </div>\n </div>\n</body>\n\n</html>', '2019-07-10 11:36:23', 0, 0, 500, 'http://202.165.179.86:8081/images/WechatIMG5130.png'),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '456', 27, '驳回通知', '', '<!DOCTYPE html>\n<html>\n\n<head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\">\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n <meta name=\"viewport\" content=\"initial-scale=1.0, user-scalable=no\" />\n <meta name=\"renderer\" content=\"webkit\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">\n <title>富茂审批邮件</title>\n <title></title>\n <style>\n *{\n margin: 0;\n padding: 0;\n }\n </style>\n</head>\n\n<body>\n <div id=\"box\" style=\"padding:80px 20%;background:#E9E7E7;min-height:100vh;\">\n <header style=\"height:140px;width:100%;display:flex;background:rgba(31,47,62,1);border-radius:15px 15px 0px 0px;\">\n <img style=\"height:auto;width:292px;display:flex;align-self: center;justify-content: center;margin-left: 40px;\" src=\"{bg}\"/>\n </header>\n <content>\n <div style=\"background:#fff;\">\n <div style=\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;padding: 56px 55px 0;\">审批通过通知</div>\n <div style=\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);padding:36px 55px 40px;\">您申请的[{type}],[{name}]被驳回,请登录<a href=\"{page}\">{page}</a>查看审批明细</div>\n </div>\n <div style=\"height: auto;width: 100%;line-height: 40px; background: rgba(245,245,245,1);padding: 30px 0;\">\n <div style=\"overflow: hidden;\">\n <span style=\"display: block;float: left; font-size:18px;width:80px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\">驳回人:</span>\n <span style=\"display: block;float: left; width:calc(100% - 240px);font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);margin-left: 55px;\">{name}</span>\n </div>\n <div style=\"overflow: hidden;\">\n <span style=\"display: block;float: left; font-size:18px;width:80px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\">驳回原因:</span>\n <span style=\"display: block;float: left;width:calc(100% - 240px); font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);margin-left: 55px;\">{remark}</span>\n </div>\n </div>\n <div style=\"background:#fff;\">\n <div style=\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;padding: 56px 55px 0;margin-top: 26px;\">遇到问题?</div>\n <div style=\"overflow: hidden;line-height: 60px;padding-bottom: 40px;\">\n <span style=\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\">请联系驳回人:</span>\n <span style=\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);margin-left: 25px;\"><span>{linkName}</span><span style=\"margin-left: 16px; font-family:MicrosoftYaHei;font-weight:400;color:rgba(64,103,139,1);\">{linkPhone}</span></span>\n </div>\n </div>\n </content>\n </div>\n</body>\n\n</html>', '2019-07-10 11:38:22', 0, 0, 500, 'http://202.165.179.86:8081/images/WechatIMG5130.png');

INSERT INTO `wx_msg_validationcode_model` (`id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`)
VALUES
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '789', 24, '审批通过通知', '', '<!DOCTYPE html>\n<html>\n\n<head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\">\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n <meta name=\"viewport\" content=\"initial-scale=1.0, user-scalable=no\" />\n <meta name=\"renderer\" content=\"webkit\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">\n <title>富茂审批邮件</title>\n <title></title>\n <script> document.documentElement.style.fontSize = document.documentElement.clientWidth / 7.5 + \'px\';</script>\n</head>\n\n<body>\n <div id=\"box\" style=\"padding:80px 20%;background:#E9E7E7;min-height:100vh;\">\n <header style=\"height:140px;width:100%;display:flex;background:rgba(31,47,62,1);border-radius:15px 15px 0px 0px;\">\n <img style=\"height:auto;width:292px;display:flex;align-self: center;justify-content: center;padding:0 40px;\" src=\"https://s3.cn-northwest-1.amazonaws.com.cn/iformall-net/cimg/changrong-logo.png\"/>\n </header>\n <div style=\"background:#fff;\">\n <div style=\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;padding:56px 55px 0;\">审批通过通知</div>\n <div style=\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);padding: 36px 55px;\">您申请的[{type}],[{name}]已经审批通过,请登录<a href=\"{page}\">{page}</a>跟进后续工作</div>\n </div>\n </div>\n</body>\n\n</html>', '2019-07-10 11:35:11', 0, 0, 500, 'http://202.165.179.86:8081/images/WechatIMG5130.png'),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '789', 26, '待办通知', '', '<!DOCTYPE html>\n<html>\n\n<head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\">\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n <meta name=\"viewport\" content=\"initial-scale=1.0, user-scalable=no\" />\n <meta name=\"renderer\" content=\"webkit\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">\n <title>富茂审批邮件</title>\n <title></title>\n <style>\n *{\n margin: 0;\n padding: 0;\n }\n </style>\n</head>\n\n<body>\n <div id=\"box\" style=\"padding:80px 20%;background:#E9E7E7;min-height:100vh;\">\n <header style=\"height:140px;width:100%;display:flex;background:rgba(31,47,62,1);border-radius:15px 15px 0px 0px;\">\n <img style=\"height:auto;width:292px;display:flex;align-self: center;justify-content: center;margin-left: 40px;\" src=\"{bg}\"/>\n </header>\n <content>\n <div style=\"background:#fff;\">\n <div style=\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;padding: 56px 55px 0;\">待办通知</div>\n <div style=\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);padding: 36px 55px 40px;\"><span>{name}</span><span>提交了一个营销申请待您审批,电脑登录</span><a href=\"{page}\" target=\"_blank\">{page}</a>查看您的待办</div>\n </div>\n <div style=\"height: auto;width: 100%;line-height: 40px; background: rgba(245,245,245,1);padding: 30px 0;\">\n <div style=\"overflow: hidden;\">\n <div style=\"float: left;font-size:18px;width:cale(20%-55px);font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\">申请时间:</div>\n <div style=\"float: left;font-size:18px;width:cale(80%-55px);font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);margin-left: 55px;\">{applyTime}</div>\n </div>\n <div style=\"overflow: hidden;\">\n <div style=\"float: left;font-size:18px;width:cale(20%-55px);font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\">申请进度:</div>\n <div style=\"float: left;width:cale(80%-55px);margin-left: 55px;\">\n \n {taskList}\n </div>\n </div>\n </div>\n <div style=\"background:#fff;\">\n <div style=\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;margin-top: 26px;padding: 56px 55px 0;\">遇到问题?</div>\n <div style=\"overflow: hidden;line-height: 60px;padding-bottom: 40px;\">\n <span style=\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\">请联系申请人:</span>\n <span style=\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);margin-left: 25px;\"><span>{linkName}</span><span style=\"margin-left: 16px; font-family:MicrosoftYaHei;font-weight:400;color:rgba(64,103,139,1);\">{linkPhone}</span></span>\n </div>\n </div>\n </content>\n </div>\n</body>\n\n</html>', '2019-07-10 11:37:33', 0, 0, 500, 'http://202.165.179.86:8081/images/WechatIMG5130.png'),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '789', 25, '审批通知', '', '<!DOCTYPE html>\n<html>\n\n<head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\">\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n <meta name=\"viewport\" content=\"initial-scale=1.0, user-scalable=no\" />\n <meta name=\"renderer\" content=\"webkit\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">\n <title>富茂审批邮件</title>\n <title></title>\n <script> document.documentElement.style.fontSize = document.documentElement.clientWidth / 7.5 + \'px\';</script>\n</head>\n\n<body>\n <div id=\"box\" style=\"padding:80px 20%;background:#E9E7E7;min-height:100vh;\">\n <header style=\"height:140px;width:100%;display:flex;background:rgba(31,47,62,1);border-radius:15px 15px 0px 0px;\">\n <img style=\"height:auto;width:292px;display:flex;align-self: center;justify-content: center;padding:0 40px;\" src=\"{bg}\"/>\n </header>\n <div style=\"background:#fff;\">\n <div style=\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;padding:56px 55px 0;\">审批通知</div>\n <div style=\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);padding: 36px 55px;\"><span>{userName}</span>同意[{type}][{name}]的审批,已呈送<span>{toUserName},</span>请登录<a href=\"{page}\">{page}</a>查看审批进度</div>\n </div>\n </div>\n</body>\n\n</html>', '2019-07-10 11:36:23', 0, 0, 500, 'http://202.165.179.86:8081/images/WechatIMG5130.png'),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '789', 27, '驳回通知', '', '<!DOCTYPE html>\n<html>\n\n<head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\">\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n <meta name=\"viewport\" content=\"initial-scale=1.0, user-scalable=no\" />\n <meta name=\"renderer\" content=\"webkit\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">\n <title>富茂审批邮件</title>\n <title></title>\n <style>\n *{\n margin: 0;\n padding: 0;\n }\n </style>\n</head>\n\n<body>\n <div id=\"box\" style=\"padding:80px 20%;background:#E9E7E7;min-height:100vh;\">\n <header style=\"height:140px;width:100%;display:flex;background:rgba(31,47,62,1);border-radius:15px 15px 0px 0px;\">\n <img style=\"height:auto;width:292px;display:flex;align-self: center;justify-content: center;margin-left: 40px;\" src=\"{bg}\"/>\n </header>\n <content>\n <div style=\"background:#fff;\">\n <div style=\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;padding: 56px 55px 0;\">审批通过通知</div>\n <div style=\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);padding:36px 55px 40px;\">您申请的[{type}],[{name}]被驳回,请登录<a href=\"{page}\">{page}</a>查看审批明细</div>\n </div>\n <div style=\"height: auto;width: 100%;line-height: 40px; background: rgba(245,245,245,1);padding: 30px 0;\">\n <div style=\"overflow: hidden;\">\n <span style=\"display: block;float: left; font-size:18px;width:80px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\">驳回人:</span>\n <span style=\"display: block;float: left; width:calc(100% - 240px);font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);margin-left: 55px;\">{name}</span>\n </div>\n <div style=\"overflow: hidden;\">\n <span style=\"display: block;float: left; font-size:18px;width:80px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\">驳回原因:</span>\n <span style=\"display: block;float: left;width:calc(100% - 240px); font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);margin-left: 55px;\">{remark}</span>\n </div>\n </div>\n <div style=\"background:#fff;\">\n <div style=\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;padding: 56px 55px 0;margin-top: 26px;\">遇到问题?</div>\n <div style=\"overflow: hidden;line-height: 60px;padding-bottom: 40px;\">\n <span style=\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\">请联系驳回人:</span>\n <span style=\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);margin-left: 25px;\"><span>{linkName}</span><span style=\"margin-left: 16px; font-family:MicrosoftYaHei;font-weight:400;color:rgba(64,103,139,1);\">{linkPhone}</span></span>\n </div>\n </div>\n </content>\n </div>\n</body>\n\n</html>', '2019-07-10 11:38:22', 0, 0, 500, 'http://202.165.179.86:8081/images/WechatIMG5130.png');

+ 9
- 0
mallinkService/src/main/java/com/iformall/domain/dto/KwMeterDataDto.java Просмотреть файл

@@ -48,6 +48,15 @@ public class KwMeterDataDto extends BaseEntity {

private Integer reportType;

@io.swagger.annotations.ApiModelProperty(value = "开始电量", name = "startNumber")
private Integer startNumber;

@io.swagger.annotations.ApiModelProperty(value = "结束电量", name = "endNumber")
private Integer endNumber;

@io.swagger.annotations.ApiModelProperty(value = "商户ID", name = "merchantId")
private Long merchantId;

public static enum Field {
Id_ASC("`id` ASC"),
Id_DESC("`id` DESC"),


+ 5
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxBusiness.java Просмотреть файл

@@ -41,6 +41,11 @@ public class WxBusiness implements Serializable {
@Transient
private String tenantId;

@Transient
private Integer limitStart;
@Transient
private Integer limitEnd;

public static enum Field
{
Id_ASC("`id` ASC"),Id_DESC("`id` DESC")


+ 6
- 0
mallinkService/src/main/java/com/iformall/enums/EnumMailMsgModel.java Просмотреть файл

@@ -11,6 +11,12 @@ public enum EnumMailMsgModel {
MAIL_BILL_OWE(13, "欠缴账单通知"),
MAIL_ASSIGNEE_NODIFY(14, "代办通知"),
MAIL_REJECT_NODIFY(15, "驳回通知"),

//卷
MAIL_C_PASS_NODIFY(24, "审批通过通知"),
MAIL_C_APPLY_NODIFY(25, "审批通知"),
MAIL_C_ASSIGNEE_NODIFY(26, "代办通知"),
MAIL_C_REJECT_NODIFY(27, "驳回通知"),
;

public static EnumMailMsgModel getEnum(Integer code) {


+ 2
- 0
mallinkService/src/main/java/com/iformall/mapper/KwMeterDataMapper.java Просмотреть файл

@@ -12,4 +12,6 @@ public interface KwMeterDataMapper extends CommonMapper<KwMeterData, Long> {
List<KwMeterData> findList(KwMeterData param);

List<KwMeterDataVo> findVoList(KwMeterDataDto param);

List<KwMeterDataVo> getPower(KwMeterDataDto param);
}

+ 0
- 4
mallinkService/src/main/java/com/iformall/service/WxBusinessService.java Просмотреть файл

@@ -3,10 +3,6 @@ package com.iformall.service;
import com.github.pagehelper.PageInfo;
import com.iformall.common.ResultData;
import com.iformall.domain.po.WxBusiness;
import org.springframework.web.bind.annotation.ModelAttribute;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

public interface WxBusinessService {


+ 10
- 10
mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java Просмотреть файл

@@ -985,7 +985,7 @@ public class WxBillAllServiceImpl implements WxBillAllService {
rent.setPayDate(bill.getPayDate());
rent.setReceiveDate(bill.getReceiveDate());
wxBillRentMapper.updateByPrimaryKey(rent);
addActionImport(rent.getId(), bill.getPayWay(), bill.getPayDate(), user);
addActionImport(rent.getId(), bill.getPayWay(), bill.getPayDate(), user, bill.getPayStr());
}
} else if (billType.equals(EnumBillExcelTemplate.SHOP_PROPERTY.getCode()) || billType.equals(EnumBillExcelTemplate.POINT_PROPERTY.getCode())) {
WxBillProperty propertyQuery = new WxBillProperty();
@@ -1010,7 +1010,7 @@ public class WxBillAllServiceImpl implements WxBillAllService {
property.setPayDate(bill.getPayDate());
property.setReceiveDate(bill.getReceiveDate());
wxBillPropertyMapper.updateByPrimaryKey(property);
addActionImport(property.getId(), bill.getPayWay(), bill.getPayDate(), user);
addActionImport(property.getId(), bill.getPayWay(), bill.getPayDate(), user, bill.getPayStr());
}
} else if (billType.equals(EnumBillExcelTemplate.DAILY.getCode())) {
WxBillDaily dailyQuery = new WxBillDaily();
@@ -1040,7 +1040,7 @@ public class WxBillAllServiceImpl implements WxBillAllService {
daily.setPayDate(bill.getPayDate());
daily.setReceiveDate(bill.getReceiveDate());
wxBillDailyMapper.updateByPrimaryKey(daily);
addActionImport(daily.getId(), bill.getPayWay(), bill.getPayDate(), user);
addActionImport(daily.getId(), bill.getPayWay(), bill.getPayDate(), user, bill.getPayStr());
}
} else {
WxMerchantShop wxMerchantShop = new WxMerchantShop();
@@ -1071,7 +1071,7 @@ public class WxBillAllServiceImpl implements WxBillAllService {
daily.setStarttime(bill.getStarttime());
daily.setEndtime(bill.getEndtime());
wxBillDailyMapper.insertSelective(daily);
addActionImport(daily.getId(), bill.getPayWay(), bill.getPayDate(), user);
addActionImport(daily.getId(), bill.getPayWay(), bill.getPayDate(), user, bill.getPayStr());
}
}
} else if (billType.equals(EnumBillExcelTemplate.OTHER.getCode())) {
@@ -1095,7 +1095,7 @@ public class WxBillAllServiceImpl implements WxBillAllService {
other.setPayDate(bill.getPayDate());
other.setReceiveDate(bill.getReceiveDate());
wxBillOtherMapper.updateByPrimaryKey(other);
addActionImport(other.getId(), bill.getPayWay(), bill.getPayDate(), user);
addActionImport(other.getId(), bill.getPayWay(), bill.getPayDate(), user, bill.getPayStr());
}
} else {
WxMerchantShop wxMerchantShop = new WxMerchantShop();
@@ -1127,7 +1127,7 @@ public class WxBillAllServiceImpl implements WxBillAllService {
other.setStarttime(bill.getStarttime());
other.setEndtime(bill.getEndtime());
wxBillOtherMapper.insertSelective(other);
addActionImport(other.getId(), bill.getPayWay(), bill.getPayDate(), user);
addActionImport(other.getId(), bill.getPayWay(), bill.getPayDate(), user, bill.getPayStr());
}
}
} else if (billType.equals(EnumBillExcelTemplate.OTHER_DEPOSIT.getCode())) {
@@ -1149,7 +1149,7 @@ public class WxBillAllServiceImpl implements WxBillAllService {
otherDeposit.setPayDate(bill.getPayDate());
otherDeposit.setReceiveDate(bill.getReceiveDate());
wxBillOtherDepositMapper.updateByPrimaryKey(otherDeposit);
addActionImport(otherDeposit.getId(), bill.getPayWay(), bill.getPayDate(), user);
addActionImport(otherDeposit.getId(), bill.getPayWay(), bill.getPayDate(), user, bill.getPayStr());
}
} else {
WxMerchantShop wxMerchantShop = new WxMerchantShop();
@@ -1182,7 +1182,7 @@ public class WxBillAllServiceImpl implements WxBillAllService {
otherDeposit.setStarttime(bill.getStarttime());
otherDeposit.setEndtime(bill.getEndtime());
wxBillOtherDepositMapper.insertSelective(otherDeposit);
addActionImport(otherDeposit.getId(), bill.getPayWay(), bill.getPayDate(), user);
addActionImport(otherDeposit.getId(), bill.getPayWay(), bill.getPayDate(), user, bill.getPayStr());
}
}
} else {
@@ -1193,11 +1193,11 @@ public class WxBillAllServiceImpl implements WxBillAllService {
stringRedisTemplate.expire(importKey, 10, TimeUnit.SECONDS);
}

public void addActionImport(Long billId, String payWay, Date payDate, MallUserInfo user) {
public void addActionImport(Long billId, String payWay, Date payDate, MallUserInfo user, String pay) {
WxBillAction wxBillAction = new WxBillAction();
wxBillAction.setBillId(billId);
String details = StringUtils.isEmpty(payWay) ? "其他缴费" : payWay + "缴费";
wxBillAction.setDetails(details);
wxBillAction.setDetails(details + pay + "元");
wxBillAction.setAction(EnumBillAction.IMPORT_PAY.getCode());
wxBillAction.setPayDate(payDate);
wxBillActionService.modifyBill(wxBillAction, user);


+ 33
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxBusinessServiceImpl.java Просмотреть файл

@@ -4,9 +4,11 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.iformall.common.ResultData;
import com.iformall.domain.po.WxBusiness;
import com.iformall.domain.po.WxCoupon;
import com.iformall.enums.EnumBusinessFilter;
import com.iformall.mapper.WxBusinessMapper;
import com.iformall.service.WxBusinessService;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -14,7 +16,9 @@ import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Service
public class WxBusinessServiceImpl implements WxBusinessService {
@@ -59,7 +63,35 @@ public class WxBusinessServiceImpl implements WxBusinessService {

@Override
public ResultData devoteList(WxBusiness wxBusiness, Integer pageNum, Integer pageSize) {
return new ResultData(PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> wxBusinessMapper.devoteList(wxBusiness)));
wxBusiness.setLimitStart(0);
wxBusiness.setLimitEnd(Integer.MAX_VALUE);
List totalList = wxBusinessMapper.devoteList(wxBusiness);
if(CollectionUtils.isEmpty(totalList)){
PageHelper.startPage(pageNum, pageSize);
PageInfo<List<Map<String,Object>>> pageInfo = new PageInfo(new ArrayList());
pageInfo.setPages(0);
pageInfo.setTotal(0);
PageHelper.clearPage();
return new ResultData(pageInfo);
}

int total = totalList.size();
int pages;
if(total % pageSize == 0){
pages = total / pageSize;
}else{
pages = total / pageSize +1;
}
wxBusiness.setLimitStart((pageNum -1) * pageSize);
wxBusiness.setLimitEnd(pageSize);
List<Map<String,Object>> list = wxBusinessMapper.devoteList(wxBusiness);

PageHelper.startPage(pageNum, pageSize);
PageInfo<List<Map<String,Object>>> pageInfo = new PageInfo(list);
pageInfo.setPages(pages);
pageInfo.setTotal(total);
PageHelper.clearPage();
return new ResultData(pageInfo);
}

}

+ 16
- 8
mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java Просмотреть файл

@@ -444,8 +444,10 @@ public class WxFlowServiceImpl implements WxFlowService {
msgReplaceMap.put("bustype","账单");
msgReplaceMap.put("contract", businessId.toString());
}else if(isCoupon(flowType)){
msgReplaceMap.put("bustype","有价券");
msgReplaceMap.put("contract",businessId.toString());
mailMsg.setModelType(EnumMailMsgModel.MAIL_C_ASSIGNEE_NODIFY.getCode());
WxCoupon wxCoupon = this.wxCouponMapper.selectByPrimaryKey(businessId);
msgReplaceMap.put("type",EnumCouponType.getEnum(wxCoupon.getType()).getMessage());
msgReplaceMap.put("name",wxCoupon.getTitle());
}
mailMsg.setDynamicContentMap(msgReplaceMap);
mqBaseProducer.sendMessage(mailMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode());
@@ -893,8 +895,10 @@ public class WxFlowServiceImpl implements WxFlowService {
msgReplaceMap.put("bustype","账单");
msgReplaceMap.put("contract", businessId.toString());
}else if(isCoupon(flowType)){
msgReplaceMap.put("bustype","有价券");
msgReplaceMap.put("contract",businessId.toString());
mailMsg.setModelType(EnumMailMsgModel.MAIL_C_APPLY_NODIFY.getCode());
WxCoupon wxCoupon = this.wxCouponMapper.selectByPrimaryKey(businessId);
msgReplaceMap.put("type",EnumCouponType.getEnum(wxCoupon.getType()).getMessage());
msgReplaceMap.put("name",wxCoupon.getTitle());
}
mailMsg.setDynamicContentMap(msgReplaceMap);
mqBaseProducer.sendMessage(mailMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode());
@@ -949,8 +953,10 @@ public class WxFlowServiceImpl implements WxFlowService {
msgReplaceMap.put("bustype","账单");
msgReplaceMap.put("contract", businessId.toString());
}else if(isCoupon(flowType)){
msgReplaceMap.put("bustype","有价券");
msgReplaceMap.put("contract",businessId.toString());
mailMsg.setModelType(EnumMailMsgModel.MAIL_C_PASS_NODIFY.getCode());
WxCoupon wxCoupon = this.wxCouponMapper.selectByPrimaryKey(businessId);
msgReplaceMap.put("type",EnumCouponType.getEnum(wxCoupon.getType()).getMessage());
msgReplaceMap.put("name",wxCoupon.getTitle());
}
mailMsg.setDynamicContentMap(msgReplaceMap);
mqBaseProducer.sendMessage(mailMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode());
@@ -1102,8 +1108,10 @@ public class WxFlowServiceImpl implements WxFlowService {
msgReplaceMap.put("bustype","账单");
msgReplaceMap.put("contract", businessId.toString());
}else if(isCoupon(flowType)){
msgReplaceMap.put("bustype","有价券");
msgReplaceMap.put("contract",businessId.toString());
mailMsg.setModelType(EnumMailMsgModel.MAIL_C_REJECT_NODIFY.getCode());
WxCoupon wxCoupon = this.wxCouponMapper.selectByPrimaryKey(businessId);
msgReplaceMap.put("type",EnumCouponType.getEnum(wxCoupon.getType()).getMessage());
msgReplaceMap.put("name",wxCoupon.getTitle());
}
mailMsg.setDynamicContentMap(msgReplaceMap);
mqBaseProducer.sendMessage(mailMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode());


+ 0
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxPayOrderServiceImpl.java Просмотреть файл

@@ -1270,8 +1270,6 @@ public class WxPayOrderServiceImpl implements WxPayOrderService {
userQ.setAppId(appinfo.getAppId());
WxCUser user1 = wxCUserMapper.findByOpenId(userQ);
if (user1 == null) {
final IdWorker idWorker = IdWorker.get();
userQ.setId(idWorker.nextId());
userQ.setCreateDate(curDate);
userQ.setUpdateDate(curDate);
if ("N".equalsIgnoreCase(isSubscribe)) {


+ 2
- 0
mallinkService/src/main/java/com/iformall/service/kw/KwMerchantMeterService.java Просмотреть файл

@@ -7,6 +7,7 @@ import com.iformall.domain.po.KwMerchantMeter;
import com.iformall.domain.vo.KwMerchantMeterVo;



import java.util.List;

public interface KwMerchantMeterService {
@@ -48,4 +49,5 @@ public interface KwMerchantMeterService {
List<KwMerchantMeterVo> findListVo(KwMerchantMeter record);
int selectCount(KwMerchantMeter record);
int unbindBatch(KwMerchantMeter record);

}

+ 2
- 0
mallinkService/src/main/java/com/iformall/service/kw/KwMeterDataService.java Просмотреть файл

@@ -18,4 +18,6 @@ public interface KwMeterDataService {
List<KwMeterData> findList(KwMeterData kwMeterData);

int save(List<KwMeterData> recordList);

KwMeterDataVo getMeterUsedPower(KwMeterDataDto dto);
}

+ 10
- 0
mallinkService/src/main/java/com/iformall/service/kw/impl/KwMerchantMeterServiceImpl.java Просмотреть файл

@@ -2,17 +2,24 @@ package com.iformall.service.kw.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.iformall.common.ErrorCode;
import com.iformall.common.IdWorker;
import com.iformall.common.ResultData;
import com.iformall.domain.dto.KwMeterDataDto;
import com.iformall.domain.po.KwMerchantMeter;
import com.iformall.domain.vo.KwMerchantMeterVo;
import com.iformall.domain.vo.KwMeterDataVo;
import com.iformall.enums.EnumMerchantMeterStatus;
import com.iformall.exception.MallinkException;
import com.iformall.mapper.KwMerchantMeterMapper;
import com.iformall.mapper.KwMeterDataMapper;
import com.iformall.service.kw.KwMerchantMeterService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@@ -24,6 +31,9 @@ public class KwMerchantMeterServiceImpl implements KwMerchantMeterService {
@Autowired
KwMerchantMeterMapper kwMerchantMeterMapper;

@Autowired
KwMeterDataMapper kwMeterDataMapper;

@Override
public PageInfo<KwMerchantMeterVo> listAsPage(KwMerchantMeter record, Integer pageIndex, Integer pageSize) {
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> kwMerchantMeterMapper.findListVo(record));


+ 52
- 0
mallinkService/src/main/java/com/iformall/service/kw/impl/KwMeterDataServiceImpl.java Просмотреть файл

@@ -2,18 +2,24 @@ package com.iformall.service.kw.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.iformall.common.ErrorCode;
import com.iformall.common.IdWorker;
import com.iformall.common.Result;
import com.iformall.common.ResultData;
import com.iformall.domain.dto.KwMeterDataDto;
import com.iformall.domain.po.KwMeterData;
import com.iformall.domain.vo.KwMeterDataVo;
import com.iformall.mapper.KwMeterDataMapper;
import com.iformall.service.kw.KwMeterDataService;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;

import java.util.Date;
import java.util.List;


@@ -49,4 +55,50 @@ public class KwMeterDataServiceImpl implements KwMeterDataService {
return kwMeterDataMapper.insertList(recordList);
}

@Override
public KwMeterDataVo getMeterUsedPower(KwMeterDataDto dto)
{
KwMeterDataVo usedPower = new KwMeterDataVo();
usedPower.setMeterId(dto.getMeterId());
usedPower.setTenantId(dto.getTenantId());
usedPower.setReportTime(new Date().toString());
if (dto.getStartTime() != null) {
KwMeterDataDto param = new KwMeterDataDto();
param.setTenantId(dto.getTenantId());
param.setMeterId(dto.getMeterId());
param.setReportType(dto.getReportType());
param.setStartTime(dto.getStartTime());
List<KwMeterDataVo> startPower = kwMeterDataMapper.getPower(param);

if (startPower.size() > 0) {
usedPower.setRecordStartTime(startPower.get(0).getRecordStartTime());
usedPower.setLastTotalPower(startPower.get(0).getTotalPower());
}
}
if (dto.getEndTime() != null) {
KwMeterDataDto param = new KwMeterDataDto();
param.setTenantId(dto.getTenantId());
param.setMeterId(dto.getMeterId());
param.setReportType(dto.getReportType());
param.setEndTime(dto.getEndTime());
List<KwMeterDataVo> endPower = kwMeterDataMapper.getPower(param);

if (endPower.size() > 0) {
usedPower.setRecordEndTime(endPower.get(0).getRecordEndTime());
usedPower.setTotalPower(endPower.get(0).getTotalPower());
}
}
if (usedPower.getLastTotalPower()==null)
usedPower.setLastTotalPower(dto.getStartNumber());
if (usedPower.getTotalPower()==null)
usedPower.setTotalPower(dto.getEndNumber());

if (usedPower.getLastTotalPower()==null || usedPower.getTotalPower() == null)
return null;

usedPower.setUsedPower(usedPower.getTotalPower() - usedPower.getLastTotalPower());

return usedPower;
}

}

+ 0
- 10
mallinkService/src/main/java/com/iformall/service/msg/impl/SendSmsServiceImpl.java Просмотреть файл

@@ -90,16 +90,6 @@ public class SendSmsServiceImpl implements MsgSendService {
wxMsgValidationcode.setCode(record.getDynamicContentMap().get("s6"));
}

// 检查是否超限
WxMsgLimit msgLimit = new WxMsgLimit();
msgLimit.setTenantId(record.getTenantId());
msgLimit.setType(EnumMsgLimitType.SMS_VALID.getCode());
msgLimit.setLimitId(phone);
if(wxMsgLimitService.checkIsLimit(msgLimit)) {
logger.error("用户短信超限:" + phone);
return;
}

String notifyUrl = wxMsgConfig.getNotifyurl();
Integer modelId = wxMsgValidationcodeModel.getModelId();
String result = WiwideUtil.sendMsg(secret, bid, publickey, phone, signature, msg, notifyUrl, EnumVerifyCode.YES.getCode().toString(), modelId);


+ 72
- 1
mallinkService/src/main/resources/mapper/KwMeterDataMapper.xml Просмотреть файл

@@ -130,7 +130,7 @@
sum(used_power) as usedPower
FROM kw_meter_data
where
<include refid="dynamicWhereConditions"/>
<include refid="dynamicWhereConditionsVo"/>
group by reportTime,meter_id
) as temp
group by
@@ -145,4 +145,75 @@
order by reportTime desc
</select>

<select id="getPower" parameterType="com.iformall.domain.dto.KwMeterDataDto" resultMap="VoResultMap">
SELECT
tenant_id,box_id,meter_id,
<if test=" null == reportType">
create_time as reportTime,
</if>
<if test=" null != reportType and 1 == reportType ">
date_format(create_time, '%Y-%m-%d %H:00') as reportTime,
</if>
<if test=" null != reportType and 2 == reportType ">
date_format(create_time, '%Y-%m-%d') as reportTime,
</if>
<if test=" null != reportType and 3 == reportType ">
date_format(create_time, '%Y-%m') as reportTime,
</if>
<if test=" null != startTime">
min(device_time) as recordStartTime,
min(total_power) as totalPower
</if>
<if test=" null != endTime">
max(device_time) as recordEndTime,
max(total_power) as totalPower
</if>
FROM kw_meter_data
where 1 = 1
<if test=" null != tenantId ">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != meterId ">
and `meter_id` = #{meterId}
</if>
<if test=" null != address ">
and `address` = #{address}
</if>

<if test=" null != startTime">
<if test=" null == reportType">
and create_time = #{startTime}
</if>
<if test=" null != reportType and 1 == reportType ">
and date_format(create_time, '%Y-%m-%d %H:00') = date_format(#{startTime}, '%Y-%m-%d %H:00')
</if>
<if test=" null != reportType and 2 == reportType ">
and date_format(create_time, '%Y-%m-%d') = date_format(#{startTime}, '%Y-%m-%d')
</if>
<if test=" null != reportType and 3 == reportType ">
and date_format(create_time, '%Y-%m') = date_format(#{startTime}, '%Y-%m')
</if>
</if>

<if test=" null != endTime">
<if test=" null == reportType">
and create_time = #{endTime}
</if>
<if test=" null != reportType and 1 == reportType ">
and date_format(create_time, '%Y-%m-%d %H:00') = date_format(#{endTime}, '%Y-%m-%d %H:00')
</if>
<if test=" null != reportType and 2 == reportType ">
and date_format(create_time, '%Y-%m-%d') = date_format(#{endTime}, '%Y-%m-%d')
</if>
<if test=" null != reportType and 3 == reportType ">
and date_format(create_time, '%Y-%m') = date_format(#{endTime}, '%Y-%m')
</if>
</if>

group by reportTime
<if test=" null != meterId ">
,meter_id
</if>
</select>

</mapper>

+ 6
- 2
mallinkService/src/main/resources/mapper/WxBusinessMapper.xml Просмотреть файл

@@ -163,7 +163,7 @@
round(
(select if(sum(mtd.trade_amt) is null,0,sum(mtd.trade_amt))
from wx_merchant m
left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = 9 and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate})
left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = #{id} and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate})
/
(select if(sum(ws.operation_area) is null,0,sum(ws.operation_area))
from wx_merchant m
@@ -178,7 +178,7 @@
round(
(select if(sum(mtd.trade_amt) is null,0,sum(mtd.trade_amt))
from wx_merchant m
left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = 9 and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate})
left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = #{id} and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate})
/
(select if(sum(ws.operation_area) is null,0,sum(ws.operation_area))
from wx_merchant m
@@ -198,6 +198,10 @@
and mtd.create_date between #{startdate} and #{enddate}
group by m.id
order by devoteRate desc

<if test="null != limitStart and null != limitEnd">
limit #{limitStart},#{limitEnd}
</if>
</select>

</mapper>

Загрузка…
Отмена
Сохранить