| @@ -473,8 +473,6 @@ public class WxRentContractController extends WxContractBaseController { | |||||
| /** | /** | ||||
| * 终止 | * 终止 | ||||
| * @param id | |||||
| * @param status | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| @PostMapping("endContract") | @PostMapping("endContract") | ||||
| @@ -669,10 +667,10 @@ public class WxRentContractController extends WxContractBaseController { | |||||
| if (null == wxRentContract) wxRentContract = new WxRentContract(); | if (null == wxRentContract) wxRentContract = new WxRentContract(); | ||||
| wxRentContract.updateTenantInfo(getTenantInfo()); | wxRentContract.updateTenantInfo(getTenantInfo()); | ||||
| //正常状态, 物业合同 | //正常状态, 物业合同 | ||||
| if (1 == validStatus) { | |||||
| if (validStatus != null && 1 == validStatus) { | |||||
| wxRentContract.setStatuss(EnumRentContractStatus.getValidStatus()); | wxRentContract.setStatuss(EnumRentContractStatus.getValidStatus()); | ||||
| //续签的合同,包括正常到期 | //续签的合同,包括正常到期 | ||||
| }else if (2== validStatus) { | |||||
| }else if (validStatus != null && 2== validStatus) { | |||||
| List<Integer> statuss = EnumRentContractStatus.getValidStatus(); | List<Integer> statuss = EnumRentContractStatus.getValidStatus(); | ||||
| statuss.add(EnumRentContractStatus.OUT_DATE.getCode()); | statuss.add(EnumRentContractStatus.OUT_DATE.getCode()); | ||||
| wxRentContract.setStatuss(statuss); | wxRentContract.setStatuss(statuss); | ||||
| @@ -71,7 +71,7 @@ public class WxMsgController extends BaseController { | |||||
| logger.debug("[" + getIpAddr() + "] WxMsgController::list"); | logger.debug("[" + getIpAddr() + "] WxMsgController::list"); | ||||
| if (null == wxTemplateMsg) wxTemplateMsg = new WxTemplateMsg(); | if (null == wxTemplateMsg) wxTemplateMsg = new WxTemplateMsg(); | ||||
| wxTemplateMsg.updateTenantInfo(getTenantInfo()); | wxTemplateMsg.updateTenantInfo(getTenantInfo()); | ||||
| final PageInfo<WxTemplateMsg> page = wxTemplateMsgService.listAsPage(wxTemplateMsg, pageNum, pageSize); | |||||
| final PageInfo<WxTemplateMsg> page = wxTemplateMsgService.listAsPageForMiniApp(wxTemplateMsg, pageNum, pageSize); | |||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -91,6 +91,21 @@ public class WxMsgController extends BaseController { | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @ApiOperation("推送模板") | |||||
| @PostMapping("pushTemp") | |||||
| @SystemControllerLog(description = "moban tuisong") | |||||
| public ResultData pushTemp(@RequestBody WxTemplateMsg wxTemplateMsg) { | |||||
| logger.debug("[" + getIpAddr() + "] WxMsgController::tuisong"); | |||||
| if(wxTemplateMsg.getId() == null){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | |||||
| wxTemplateMsg.updateTenantInfo(getTenantInfo()); | |||||
| // if(null == wxTemplateMsg.getOnOff()){ | |||||
| // wxTemplateMsg.setOnOff(1); | |||||
| // } | |||||
| return wxTemplateMsgService.pushTemp(wxTemplateMsg); | |||||
| } | |||||
| @ApiOperation("新增接口") | @ApiOperation("新增接口") | ||||
| @PostMapping("add") | @PostMapping("add") | ||||
| @SystemControllerLog(description = "标签短信-新增") | @SystemControllerLog(description = "标签短信-新增") | ||||
| @@ -113,6 +128,9 @@ public class WxMsgController extends BaseController { | |||||
| @SystemControllerLog(description = "标签短信-删除") | @SystemControllerLog(description = "标签短信-删除") | ||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| logger.debug("[" + getIpAddr() + "] WxMsgController::delete"); | logger.debug("[" + getIpAddr() + "] WxMsgController::delete"); | ||||
| if(id == null){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | |||||
| wxMsgService.deleteById(id); | wxMsgService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @@ -0,0 +1,299 @@ | |||||
| ALTER TABLE `wx_c_user_0` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_1` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_2` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_3` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_4` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_5` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_6` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_7` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_8` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_9` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_10` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_11` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_12` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_13` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_14` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_15` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_16` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_17` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_18` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_19` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_20` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_21` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_22` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_23` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_24` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_25` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_26` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_27` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_28` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_29` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_30` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_31` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_32` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_33` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_34` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_35` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_36` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_37` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_38` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_39` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_40` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_41` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_42` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_43` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_44` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_45` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_46` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_47` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_48` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_49` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_50` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_51` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_52` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_53` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_54` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_55` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_56` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_57` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_58` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_59` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_60` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_61` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_62` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_63` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_64` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_65` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_66` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_67` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_68` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_69` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_70` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_71` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_72` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_73` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_74` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_75` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_76` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_77` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_78` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_79` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_80` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_81` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_82` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_83` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_84` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_85` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_86` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_87` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_88` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_89` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_90` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_91` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_92` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_93` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_94` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_95` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_96` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_97` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_98` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| ALTER TABLE `wx_c_user_99` | |||||
| ADD COLUMN `msg_count` int(11) NOT NULL DEFAULT 0 COMMENT '订阅标识' AFTER `login_count`; | |||||
| @@ -0,0 +1,18 @@ | |||||
| --加商户收银数据采集菜单 | |||||
| INSERT INTO `mall_permission`(`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) VALUES (209, '商户收银数据采集', 2, 'Y', NULL, 1, NULL, NULL, 'numericalGather', 'icon-shouyintai', 0, 205); | |||||
| --销售类型加权限 | |||||
| update mall_sale_type set menus = '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 50, 101, 102, 103, 104, 105, 106, 107, 108, 201, 202, 203, 204, 205, 206, 209, 211, 212, 221, 222, 251, 299, 300, 301, 302, 303, 304, 305, 306, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 651, 661, 662, 663, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 712, 713, 901, 902, 903, 931, 932, 951, 952, 961, 962, 963, 965, 966, 967, 968, 1001, 1002, 1003, 1004]' where id=1; | |||||
| update mall_sale_type set menus = '[1, 2, 4, 5, 6, 7, 8, 9, 10, 50, 101, 102, 103, 104, 105, 106, 107, 201, 202, 203, 204, 205, 209, 211, 212, 221, 222, 251, 409, 410, 411, 416, 418, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 651, 661, 662, 663, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 712, 713, 901, 902, 903, 931, 932, 951, 961]' where id=2; | |||||
| update mall_sale_type set menus = '[2, 4, 5, 6, 7, 10, 50, 201, 202, 205, 211, 212, 221, 222, 251, 409, 410, 411, 416, 418, 501, 502, 503, 504, 505, 506, 507, 508, 511, 512, 513, 521, 522, 523, 531, 532, 533, 591, 592, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 621, 622, 623, 624, 625, 626, 641, 642, 643, 644, 645, 646, 651, 661, 662, 663, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 712, 713, 901, 902, 903, 931, 932]' where id=3; | |||||
| --所有广场管理员角色加权限 | |||||
| INSERT INTO `mall_role_permission`(`id`, `tenant_id`, `parent_tenant_id`, `permission_id`, `role_id`) | |||||
| select CEILING(RAND()*90000000000+10000000000) ,mui.tenant_id,mui.parent_tenant_id,209,mur.role_id | |||||
| from mall_user_info mui | |||||
| left join mall_user_role mur on mui.id = mur.uid | |||||
| where mui.is_admin = 1 and mur.role_id is not null GROUP BY mur.role_id; | |||||
| @@ -0,0 +1,40 @@ | |||||
| package com.iformall.controller; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.WxTemplateMsg; | |||||
| import com.iformall.service.WxTemplateMsgService; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| /** | |||||
| * @author gongbiao | |||||
| */ | |||||
| @RestController | |||||
| @RequestMapping("/api/wxMsg") | |||||
| public class WxMsgController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| WxTemplateMsgService wxTemplateMsgService; | |||||
| @ApiOperation("模板分页列表接口") | |||||
| @GetMapping("templateList") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData templateList(@ModelAttribute WxTemplateMsg wxTemplateMsg, Integer pageNum, Integer pageSize) { | |||||
| logger.debug("[" + getIpAddr() + "] WxMsgController::list"); | |||||
| if (null == wxTemplateMsg) wxTemplateMsg = new WxTemplateMsg(); | |||||
| wxTemplateMsg.updateTenantInfo(getTenantInfo()); | |||||
| final PageInfo<WxTemplateMsg> page = wxTemplateMsgService.listAsPageForMiniApp(wxTemplateMsg, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| } | |||||
| @@ -1021,4 +1021,13 @@ public class WxUserGrantController extends BaseController { | |||||
| return new ResultData(result); | return new ResultData(result); | ||||
| } | } | ||||
| @PostMapping("/updateMsg") | |||||
| @ApiOperation(value = "updateMsg", notes = "{\"id\":\"string\"}") | |||||
| public ResultData updateMsg() { | |||||
| WxCUser user = getWxCUser(); | |||||
| wxCUserService.updateMsgCount(user); | |||||
| return new ResultData(); | |||||
| } | |||||
| } | } | ||||
| @@ -54,15 +54,15 @@ public class MsgSendingSchedule { | |||||
| logger.info("将要发送的短信列表:" + JSONArray.toJSONString(list)); | logger.info("将要发送的短信列表:" + JSONArray.toJSONString(list)); | ||||
| for (WxMsg msg : list) { | for (WxMsg msg : list) { | ||||
| //sendmsg(msg); | //sendmsg(msg); | ||||
| wxMsg.setStatus(EnumMsgStatus.MSG_STATUS_SENDED.getCode()); | |||||
| msg.setStatus(EnumMsgStatus.MSG_STATUS_SENDED.getCode()); | |||||
| if(wxMsg.getWay() == EnumSendWay.TAG.getCode()){ | if(wxMsg.getWay() == EnumSendWay.TAG.getCode()){ | ||||
| msg.setMsgType(EnumMsgRecordType.SMS_CALLBACK.getCode()); | msg.setMsgType(EnumMsgRecordType.SMS_CALLBACK.getCode()); | ||||
| msg.setReceiver(msg.getPhones()); | msg.setReceiver(msg.getPhones()); | ||||
| mqBaseProducer.sendMessage(msg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(),null); | mqBaseProducer.sendMessage(msg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(),null); | ||||
| }else if(wxMsg.getWay() == EnumSendWay.APPINFOR.getCode()){ | |||||
| WxMsgService.batchSendAppinfo(wxMsg); | |||||
| }else if(msg.getWay() == EnumSendWay.APPINFOR.getCode()){ | |||||
| WxMsgService.batchSendAppinfo(msg); | |||||
| } | } | ||||
| wxMsgMapper.updateById(wxMsg); | |||||
| wxMsgMapper.updateById(msg); | |||||
| } | } | ||||
| logger.info("sendmsg定时任务结束"); | logger.info("sendmsg定时任务结束"); | ||||
| @@ -359,6 +359,7 @@ public enum ErrorCode{ | |||||
| TEMPLATE_NOT_FOUND(12090, "模板不存在"), | TEMPLATE_NOT_FOUND(12090, "模板不存在"), | ||||
| TEMPLATE_FORMID_NOT_FOUND(12091, "formId不存在"), | TEMPLATE_FORMID_NOT_FOUND(12091, "formId不存在"), | ||||
| TEMPLATE_DATA_ERROR(12092, "数据格式错误"), | TEMPLATE_DATA_ERROR(12092, "数据格式错误"), | ||||
| TEMPLATE_ADD_ERROR(12093, "添加模板错误"), | |||||
| /** | /** | ||||
| * | * | ||||
| @@ -83,11 +83,13 @@ public class WxMsg extends BaseMsg { | |||||
| public void updateTenantInfo(TenantEntity tenantEntity) { | public void updateTenantInfo(TenantEntity tenantEntity) { | ||||
| setTenantId(tenantEntity.getTenantId()); | setTenantId(tenantEntity.getTenantId()); | ||||
| setParentTenantId(tenantEntity.getParentTenantId()); | |||||
| } | } | ||||
| public TenantEntity getTenantInfo() { | public TenantEntity getTenantInfo() { | ||||
| return new TenantEntity() {{ | return new TenantEntity() {{ | ||||
| setTenantId(tenantId); | setTenantId(tenantId); | ||||
| setParentTenantId(parentTenantId); | |||||
| }}; | }}; | ||||
| } | } | ||||
| } | } | ||||
| @@ -7,16 +7,16 @@ public enum EnumTemplateType { | |||||
| // 1-核销成功消息, 2-核销失败消息 | // 1-核销成功消息, 2-核销失败消息 | ||||
| VERIFY_SUCCESS(1, "核销成功消息"), // 小程序 | |||||
| VERIFY_FAIL(2, "核销失败消息"), // 小程序 | |||||
| PRESS_SUCCESS(3, "砍价成功消息"), // 小程序 | |||||
| VERIFY_SUCCESS(1, "核销成功消息",""), // 小程序(作废) | |||||
| VERIFY_FAIL(2, "核销失败消息",""), // 小程序(作废) | |||||
| PRESS_SUCCESS(3, "砍价成功消息",""), // 小程序(作废) | |||||
| ACTIVITY_REMIND(4, "活动开始提醒"), // 小程序 | |||||
| LIVE_REMIND(5, "直播开播提醒"), // 小程序 | |||||
| ACTIVITY_REMIND(4, "活动开始提醒","386"), // 小程序 | |||||
| LIVE_REMIND(5, "直播开播提醒","8501"), // 小程序 | |||||
| AUDIT_MESSAGE(101, "公众号审核结果通知"), // 公众号 | |||||
| VERIFY_RESULT(102, "公众号卡券核销通知"), // 公众号 | |||||
| GIFT_MESSAGE(103, "公众号购票成功通知"), // 公众号 | |||||
| AUDIT_MESSAGE(101, "公众号审核结果通知",""), // 公众号 | |||||
| VERIFY_RESULT(102, "公众号卡券核销通知",""), // 公众号 | |||||
| GIFT_MESSAGE(103, "公众号购票成功通知",""), // 公众号 | |||||
| ; | ; | ||||
| public static EnumTemplateType getEnum(Integer code) { | public static EnumTemplateType getEnum(Integer code) { | ||||
| @@ -30,10 +30,12 @@ public enum EnumTemplateType { | |||||
| private Integer code; | private Integer code; | ||||
| private String message; | private String message; | ||||
| private String tid; | |||||
| EnumTemplateType(Integer code, String message) { | |||||
| EnumTemplateType(Integer code, String message, String tid) { | |||||
| this.code = code; | this.code = code; | ||||
| this.message = message; | this.message = message; | ||||
| this.tid = tid; | |||||
| } | } | ||||
| public Integer getCode() { | public Integer getCode() { | ||||
| @@ -43,4 +45,8 @@ public enum EnumTemplateType { | |||||
| public String getMessage() { | public String getMessage() { | ||||
| return message; | return message; | ||||
| } | } | ||||
| public String getTid() { | |||||
| return tid; | |||||
| } | |||||
| } | } | ||||
| @@ -34,4 +34,10 @@ public interface WxCUserMapper extends CommonMapper<WxCUser, Long> { | |||||
| void updateUserId(WxCUser user); | void updateUserId(WxCUser user); | ||||
| void delForUserIdOnly(@Param("id")Long id, @Param("userId")Long userId,@Param("tenantId")String tenantId); | void delForUserIdOnly(@Param("id")Long id, @Param("userId")Long userId,@Param("tenantId")String tenantId); | ||||
| List<String> listOpenId(WxCUser record); | |||||
| void updateMsgCount(WxCUser user); | |||||
| void updateMsgCountDown(@Param("tenantId")String tenantId, @Param("openId")String openId); | |||||
| } | } | ||||
| @@ -8,4 +8,5 @@ public interface WxTemplateMsgMapper extends CommonMapper<WxTemplateMsg, Long> { | |||||
| List<WxTemplateMsg> findList(WxTemplateMsg wxTemplateMsg); | List<WxTemplateMsg> findList(WxTemplateMsg wxTemplateMsg); | ||||
| List<WxTemplateMsg> findListForMiniApp(WxTemplateMsg record); | |||||
| } | } | ||||
| @@ -23,6 +23,8 @@ public interface WxCUserService { | |||||
| */ | */ | ||||
| PageInfo<WxCUser> listAsPage(WxCUser record, Integer pageIndex, Integer pageSize); | PageInfo<WxCUser> listAsPage(WxCUser record, Integer pageIndex, Integer pageSize); | ||||
| PageInfo<String> listOpenIdAsPage(WxCUser record, Integer pageIndex, Integer pageSize); | |||||
| /** | /** | ||||
| * 根据Id获得实体 | * 根据Id获得实体 | ||||
| * | * | ||||
| @@ -143,4 +145,6 @@ public interface WxCUserService { | |||||
| void updateUserId(WxCUser user); | void updateUserId(WxCUser user); | ||||
| void delForUserIdOnly(Long id, Long userId, String tenantId); | void delForUserIdOnly(Long id, Long userId, String tenantId); | ||||
| void updateMsgCount(WxCUser user); | |||||
| } | } | ||||
| @@ -1,6 +1,7 @@ | |||||
| package com.iformall.service; | package com.iformall.service; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.WxTemplateMsg; | import com.iformall.domain.po.WxTemplateMsg; | ||||
| import java.util.List; | import java.util.List; | ||||
| @@ -56,12 +57,9 @@ public interface WxTemplateMsgService { | |||||
| * @param id | * @param id | ||||
| */ | */ | ||||
| void deleteById(Long id); | void deleteById(Long id); | ||||
| ResultData pushTemp(WxTemplateMsg wxTemplateMsg); | |||||
| PageInfo<WxTemplateMsg> listAsPageForMiniApp(WxTemplateMsg wxTemplateMsg, Integer pageNum, Integer pageSize); | |||||
| } | } | ||||
| @@ -62,6 +62,11 @@ public class WxCUserServiceImpl implements WxCUserService { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCUserMapper.findList(record)); | return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCUserMapper.findList(record)); | ||||
| } | } | ||||
| @Override | |||||
| public PageInfo<String> listOpenIdAsPage(WxCUser record, Integer pageIndex, Integer pageSize) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCUserMapper.listOpenId(record)); | |||||
| } | |||||
| @Override | @Override | ||||
| public WxCUser getById(Long id,String tenantId) { | public WxCUser getById(Long id,String tenantId) { | ||||
| return wxCUserMapper.selectById(id,tenantId); | return wxCUserMapper.selectById(id,tenantId); | ||||
| @@ -360,5 +365,9 @@ public class WxCUserServiceImpl implements WxCUserService { | |||||
| wxCUserMapper.delForUserIdOnly(id,userId,tenantId); | wxCUserMapper.delForUserIdOnly(id,userId,tenantId); | ||||
| } | } | ||||
| @Override | |||||
| public void updateMsgCount(WxCUser user) { | |||||
| wxCUserMapper.updateMsgCount(user); | |||||
| } | |||||
| } | } | ||||
| @@ -28,6 +28,7 @@ import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.scheduling.annotation.Async; | import org.springframework.scheduling.annotation.Async; | ||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| import java.text.DateFormat; | |||||
| import java.util.*; | import java.util.*; | ||||
| import java.util.stream.Collectors; | import java.util.stream.Collectors; | ||||
| @@ -74,6 +75,9 @@ public class WxMsgServiceImpl implements WxMsgService { | |||||
| @Autowired | @Autowired | ||||
| WxAppinfoService wxAppinfoService; | WxAppinfoService wxAppinfoService; | ||||
| @Autowired | |||||
| WxCUserService wxCUserService; | |||||
| @Override | @Override | ||||
| public PageInfo<WxMsg> listAsPage(WxMsg record, Integer pageIndex, Integer pageSize) { | public PageInfo<WxMsg> listAsPage(WxMsg record, Integer pageIndex, Integer pageSize) { | ||||
| PageHelper.startPage(pageIndex, pageSize); | PageHelper.startPage(pageIndex, pageSize); | ||||
| @@ -128,6 +132,8 @@ public class WxMsgServiceImpl implements WxMsgService { | |||||
| //是否立即发送 | //是否立即发送 | ||||
| if (wxMsg.getIsright().equals(EnumMsgSend.MSG_SEND_IMMEDIATELY.getCode())) { | if (wxMsg.getIsright().equals(EnumMsgSend.MSG_SEND_IMMEDIATELY.getCode())) { | ||||
| wxMsg.setStatus(EnumMsgStatus.MSG_STATUS_SENDED.getCode()); | wxMsg.setStatus(EnumMsgStatus.MSG_STATUS_SENDED.getCode()); | ||||
| String systemTime = DateUtils.getSystemTime("yyyy-MM-dd HH:mm:ss"); | |||||
| wxMsg.setSendtime(systemTime); | |||||
| if(wxMsg.getWay() == EnumSendWay.TAG.getCode()){ | if(wxMsg.getWay() == EnumSendWay.TAG.getCode()){ | ||||
| if (wxMsg.getExpectSendNumber().intValue() > 1000) { | if (wxMsg.getExpectSendNumber().intValue() > 1000) { | ||||
| batchSendMsg(wxMsg, wxMsgConfig, null); | batchSendMsg(wxMsg, wxMsgConfig, null); | ||||
| @@ -368,9 +374,18 @@ public class WxMsgServiceImpl implements WxMsgService { | |||||
| smartAppMsg.setAppId(cAppInfo.getAppId()); | smartAppMsg.setAppId(cAppInfo.getAppId()); | ||||
| WxTemplateMsg wxTemplateMsg = wxTemplateMsgMapper.selectById(wxMsg.getModelId()); | WxTemplateMsg wxTemplateMsg = wxTemplateMsgMapper.selectById(wxMsg.getModelId()); | ||||
| // if(1 == wxTemplateMsg.getOnOff().intValue()){ | |||||
| // logger.error("订阅消息模板关闭。"); | |||||
| // return; | |||||
| // } | |||||
| smartAppMsg.setTemplateType(wxTemplateMsg.getType()); | smartAppMsg.setTemplateType(wxTemplateMsg.getType()); | ||||
| JSONObject customParam = JSON.parseObject(wxMsg.getMsg()); | JSONObject customParam = JSON.parseObject(wxMsg.getMsg()); | ||||
| String goToPage = customParam.getString("goToPage"); | |||||
| if(StringUtils.isBlank(goToPage)){ | |||||
| goToPage = "pages/index/index?type=in";//默认首页 | |||||
| } | |||||
| smartAppMsg.setGotopage(goToPage); | |||||
| if(wxTemplateMsg.getType() == EnumTemplateType.ACTIVITY_REMIND.getCode()){ | if(wxTemplateMsg.getType() == EnumTemplateType.ACTIVITY_REMIND.getCode()){ | ||||
| /** | /** | ||||
| * 活动名称:{{thing13.DATA}} | * 活动名称:{{thing13.DATA}} | ||||
| @@ -404,21 +419,48 @@ public class WxMsgServiceImpl implements WxMsgService { | |||||
| } | } | ||||
| if(StringUtils.isNotBlank(wxMsg.getPhones())){ | if(StringUtils.isNotBlank(wxMsg.getPhones())){ | ||||
| String[] split = wxMsg.getPhones().split(","); | |||||
| for (String s:split) { | |||||
| smartAppMsg.setTo(s); | |||||
| mqBaseProducer.sendMessage(smartAppMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||||
| } | |||||
| smartAppMsg.setTo(wxMsg.getPhones()); | |||||
| mqBaseProducer.sendMessage(smartAppMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||||
| // String[] split = wxMsg.getPhones().split(","); | |||||
| // int length = split.length; | |||||
| // int extra = length % 1000; | |||||
| // int extracount = extra > 0 ? (length / 1000 + 1) : (length / 1000); | |||||
| // int index = extracount - 1; | |||||
| // for (int i = 0; i < extracount; i++) { | |||||
| // if (extra > 0 && i == index) { | |||||
| // List<String> phoneList = Arrays.asList(split).subList(i * 1000, length); | |||||
| // String phones = StringUtils.join(phoneList, ","); | |||||
| // smartAppMsg.setTo(phones); | |||||
| // mqBaseProducer.sendMessage(smartAppMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||||
| // } else { | |||||
| // List<String> phoneList = Arrays.asList(split).subList(i * 1000, (i + 1) * 1000); | |||||
| // String phones = StringUtils.join(phoneList, ","); | |||||
| // smartAppMsg.setTo(phones); | |||||
| // mqBaseProducer.sendMessage(smartAppMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||||
| // } | |||||
| // } | |||||
| }else{ | }else{ | ||||
| WxCUser wxCUserQ = new WxCUser(); | WxCUser wxCUserQ = new WxCUser(); | ||||
| wxCUserQ.updateTenantInfo(tenantEntity); | wxCUserQ.updateTenantInfo(tenantEntity); | ||||
| List<WxCUser> list = wxCUserMapper.findList(wxCUserQ); | |||||
| wxMsg.setExpectSendNumber(list.size()); | |||||
| for (WxCUser u:list) { | |||||
| smartAppMsg.setTo(u.getOpenId()); | |||||
| mqBaseProducer.sendMessage(smartAppMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||||
| PageInfo<String> openIdPage = wxCUserService.listOpenIdAsPage(wxCUserQ, 1, 1000); | |||||
| wxMsg.setExpectSendNumber((int) openIdPage.getTotal()); | |||||
| if(openIdPage.getTotal() == 0){ | |||||
| return; | |||||
| } | |||||
| String phones = StringUtils.join(openIdPage.getList(), ","); | |||||
| smartAppMsg.setTo(phones); | |||||
| mqBaseProducer.sendMessage(smartAppMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||||
| if(openIdPage.getPages() > 1){ | |||||
| for(int i=2;i<=openIdPage.getPages();i++){ | |||||
| openIdPage = wxCUserService.listOpenIdAsPage(wxCUserQ, i, 1000); | |||||
| phones = StringUtils.join(openIdPage.getList(), ","); | |||||
| smartAppMsg.setTo(phones); | |||||
| mqBaseProducer.sendMessage(smartAppMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -1,12 +1,24 @@ | |||||
| package com.iformall.service.impl; | package com.iformall.service.impl; | ||||
| import cn.binarywang.wx.miniapp.api.WxMaService; | |||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||
| import com.github.pagehelper.PageHelper; | import com.github.pagehelper.PageHelper; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.google.common.collect.Lists; | |||||
| import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.IdWorker; | import com.iformall.common.IdWorker; | ||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.WxAppinfo; | |||||
| import com.iformall.domain.po.WxTemplateMsg; | import com.iformall.domain.po.WxTemplateMsg; | ||||
| import com.iformall.enums.EnumPayWay; | |||||
| import com.iformall.enums.EnumTemplateType; | |||||
| import com.iformall.mapper.WxTemplateMsgMapper; | import com.iformall.mapper.WxTemplateMsgMapper; | ||||
| import com.iformall.service.WxAppinfoService; | |||||
| import com.iformall.service.WxTemplateMsgService; | import com.iformall.service.WxTemplateMsgService; | ||||
| import com.iformall.service.wechat.FmOpenService; | |||||
| import com.iformall.utils.MaUtil; | |||||
| import me.chanjar.weixin.common.error.WxErrorException; | |||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -22,25 +34,28 @@ public class WxTemplateMsgServiceImpl implements WxTemplateMsgService { | |||||
| @Autowired | @Autowired | ||||
| WxTemplateMsgMapper wxTemplateMsgMapper; | WxTemplateMsgMapper wxTemplateMsgMapper; | ||||
| @Autowired | |||||
| private boolean isFmOpen; | |||||
| @Autowired | |||||
| private WxAppinfoService wxAppinfoService; | |||||
| @Autowired | |||||
| private FmOpenService openService; | |||||
| @Override | @Override | ||||
| public void wxTemplateMsgInit(String tenantId) { | public void wxTemplateMsgInit(String tenantId) { | ||||
| WxTemplateMsg wxTemplateMsg = new WxTemplateMsg(); | WxTemplateMsg wxTemplateMsg = new WxTemplateMsg(); | ||||
| wxTemplateMsg.setTenantId(tenantId); | wxTemplateMsg.setTenantId(tenantId); | ||||
| wxTemplateMsg.setTemplateId(""); | wxTemplateMsg.setTemplateId(""); | ||||
| wxTemplateMsg.setType(1); | |||||
| wxTemplateMsg.setCustomParam("{\"index\":[\"keyword1\",\"keyword2\",\"keyword3\",\"keyword4\",\"keyword5\",\"keyword6\",\"keyword7\"]," + | |||||
| "\"keyword1\":\"可抵{keyword1}元\",\"keyword2\":\"{keyword2}\",\"keyword3\":\"{keyword3}\",\"keyword4\":\"{keyword4}\"," + | |||||
| "\"keyword5\":\"{keyword5}元\",\"keyword6\":\"{keyword6}\",\"keyword7\":\"猜也猜不到的优惠,只有幸运的人才能看到,就是你," + | |||||
| "{keyword7}\\n☟☟☟☟☟☟☟\\n☞ 快看看 ☜\\n☝︎☝︎☝︎☝︎☝︎☝︎☝︎\\n\",\"emphasis\":\"keyword1.DATA\"}"); | |||||
| wxTemplateMsg.setType(EnumTemplateType.ACTIVITY_REMIND.getCode()); | |||||
| wxTemplateMsg.setCustomParam("{\"index\": [\"thing13\", \"date5\", \"thing12\", \"thing1\", \"thing11\"], \"emphasis\": \"\"}"); | |||||
| wxTemplateMsg.setCreateDate(new Date()); | wxTemplateMsg.setCreateDate(new Date()); | ||||
| wxTemplateMsg.setUpdateDate(new Date()); | wxTemplateMsg.setUpdateDate(new Date()); | ||||
| wxTemplateMsgMapper.insert(wxTemplateMsg); | wxTemplateMsgMapper.insert(wxTemplateMsg); | ||||
| wxTemplateMsg.setId(null); | wxTemplateMsg.setId(null); | ||||
| wxTemplateMsg.setType(2); | |||||
| wxTemplateMsg.setCustomParam("{\"index\":[\"keyword1\",\"keyword2\",\"keyword3\",\"keyword4\"],\"keyword1\":\"可抵{keyword1}元\"," + | |||||
| "\"keyword2\":\"{keyword2}\",\"keyword3\":\"{keyword3}\",\"keyword4\":\"猜也猜不到的优惠,只有幸运的人才能看到,就是你," + | |||||
| "{keyword4}\\n☟☟☟☟☟☟☟\\n☞ 快看看 ☜\\n☝︎☝︎☝︎☝︎☝︎☝︎☝︎\\n\",\"emphasis\":\"keyword1.DATA\"}"); | |||||
| wxTemplateMsg.setType(EnumTemplateType.LIVE_REMIND.getCode()); | |||||
| wxTemplateMsg.setCustomParam("{\"index\": [\"thing1\", \"date3\", \"thing4\", \"thing5\"], \"emphasis\": \"\"}"); | |||||
| wxTemplateMsgMapper.insert(wxTemplateMsg); | wxTemplateMsgMapper.insert(wxTemplateMsg); | ||||
| } | } | ||||
| @@ -85,12 +100,51 @@ public class WxTemplateMsgServiceImpl implements WxTemplateMsgService { | |||||
| public void deleteById(Long id) { | public void deleteById(Long id) { | ||||
| wxTemplateMsgMapper.deleteById(id); | wxTemplateMsgMapper.deleteById(id); | ||||
| } | } | ||||
| @Override | |||||
| public ResultData pushTemp(WxTemplateMsg wxTemplateMsg) { | |||||
| WxTemplateMsg byId = this.getById(wxTemplateMsg.getId()); | |||||
| if(byId == null){ | |||||
| return new ResultData(ErrorCode.TEMPLATE_NOT_FOUND); | |||||
| } | |||||
| WxAppinfo appinfo = wxAppinfoService.getCAppInfo(wxTemplateMsg, EnumPayWay.PAY_WAY_WECHAT); | |||||
| WxMaService wxMaService = null; | |||||
| if(isFmOpen) { | |||||
| wxMaService = openService.getWxOpenComponentService().getWxMaServiceByAppid(appinfo.getAppId()); | |||||
| } else { | |||||
| WxAppinfo appInfo = wxAppinfoService.getByAppId(appinfo.getAppId()); | |||||
| wxMaService = MaUtil.getWeappService(appInfo); | |||||
| } | |||||
| String s = ""; | |||||
| if(byId.getType() == EnumTemplateType.ACTIVITY_REMIND.getCode()){ | |||||
| try { | |||||
| s = wxMaService.getSubscribeService().addTemplate(EnumTemplateType.ACTIVITY_REMIND.getTid(), | |||||
| Lists.newArrayList(13, 5, 12, 1, 11), EnumTemplateType.ACTIVITY_REMIND.getMessage()); | |||||
| } catch (WxErrorException e) { | |||||
| return new ResultData(ErrorCode.TEMPLATE_ADD_ERROR); | |||||
| } | |||||
| }else if(byId.getType() == EnumTemplateType.LIVE_REMIND.getCode()){ | |||||
| try { | |||||
| s = wxMaService.getSubscribeService().addTemplate(EnumTemplateType.LIVE_REMIND.getTid(), | |||||
| Lists.newArrayList(1, 3, 4, 5),EnumTemplateType.LIVE_REMIND.getMessage()); | |||||
| } catch (WxErrorException e) { | |||||
| return new ResultData(ErrorCode.TEMPLATE_ADD_ERROR); | |||||
| } | |||||
| } | |||||
| if(StringUtils.isBlank(s)){ | |||||
| return new ResultData(ErrorCode.TEMPLATE_ADD_ERROR); | |||||
| } | |||||
| wxTemplateMsg.setTemplateId(s); | |||||
| this.saveOrUpdate(wxTemplateMsg); | |||||
| return new ResultData(); | |||||
| } | |||||
| @Override | |||||
| public PageInfo<WxTemplateMsg> listAsPageForMiniApp(WxTemplateMsg record, Integer pageIndex, Integer pageSize) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxTemplateMsgMapper.findListForMiniApp(record)); | |||||
| } | |||||
| } | } | ||||
| @@ -110,8 +110,6 @@ public class SendCallBackSmsServiceImpl implements MsgSendService { | |||||
| EnumVerifyCode.NO.getCode().toString(), modelId, | EnumVerifyCode.NO.getCode().toString(), modelId, | ||||
| null,wxMsgModel.getModelCode(),outId,wxMsgConfig.getSmsChannel()); | null,wxMsgModel.getModelCode(),outId,wxMsgConfig.getSmsChannel()); | ||||
| JSONObject jsonObjectResult = JSONObject.parseObject(result); | JSONObject jsonObjectResult = JSONObject.parseObject(result); | ||||
| String ret = jsonObjectResult.get("ret").toString(); | String ret = jsonObjectResult.get("ret").toString(); | ||||
| String batchNo = jsonObjectResult.get("data").toString(); | String batchNo = jsonObjectResult.get("data").toString(); | ||||
| @@ -2,8 +2,6 @@ package com.iformall.service.msg.impl; | |||||
| import cn.binarywang.wx.miniapp.api.WxMaService; | import cn.binarywang.wx.miniapp.api.WxMaService; | ||||
| import cn.binarywang.wx.miniapp.bean.WxMaSubscribeMessage; | import cn.binarywang.wx.miniapp.bean.WxMaSubscribeMessage; | ||||
| import cn.binarywang.wx.miniapp.bean.WxMaTemplateData; | |||||
| import cn.binarywang.wx.miniapp.bean.WxMaTemplateMessage; | |||||
| import cn.binarywang.wx.miniapp.constant.WxMaConstants; | import cn.binarywang.wx.miniapp.constant.WxMaConstants; | ||||
| import com.alibaba.fastjson.JSON; | import com.alibaba.fastjson.JSON; | ||||
| import com.alibaba.fastjson.JSONArray; | import com.alibaba.fastjson.JSONArray; | ||||
| @@ -14,17 +12,20 @@ import com.iformall.domain.po.WxTemplateMsg; | |||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.po.msg.BaseMsg; | import com.iformall.domain.po.msg.BaseMsg; | ||||
| import com.iformall.domain.po.msg.SmartAppMsg; | import com.iformall.domain.po.msg.SmartAppMsg; | ||||
| import com.iformall.mapper.WxCUserMapper; | |||||
| import com.iformall.mapper.WxTemplateMsgMapper; | import com.iformall.mapper.WxTemplateMsgMapper; | ||||
| import com.iformall.service.WxAppinfoService; | import com.iformall.service.WxAppinfoService; | ||||
| import com.iformall.service.msg.MsgSendService; | import com.iformall.service.msg.MsgSendService; | ||||
| import com.iformall.service.wechat.FmOpenService; | import com.iformall.service.wechat.FmOpenService; | ||||
| import com.iformall.utils.MaUtil; | import com.iformall.utils.MaUtil; | ||||
| import me.chanjar.weixin.common.error.WxErrorException; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import java.util.Arrays; | |||||
| import java.util.List; | import java.util.List; | ||||
| /** | /** | ||||
| @@ -45,11 +46,16 @@ public class SendSmartAppMsgServiceImpl implements MsgSendService { | |||||
| @Autowired | @Autowired | ||||
| private FmOpenService openService; | private FmOpenService openService; | ||||
| @Autowired | |||||
| private WxCUserMapper wxCUserMapper; | |||||
| @Override | @Override | ||||
| public void send(BaseMsg baseMsg) throws Exception{ | public void send(BaseMsg baseMsg) throws Exception{ | ||||
| SmartAppMsg smartAppMsg = (SmartAppMsg)baseMsg; | SmartAppMsg smartAppMsg = (SmartAppMsg)baseMsg; | ||||
| TenantEntity tenantEntity = smartAppMsg.getTenantInfo(); | |||||
| TenantEntity tenantEntity = new TenantEntity(); | |||||
| tenantEntity.setTenantId(smartAppMsg.getTenantId()); | |||||
| tenantEntity.setParentTenantId(smartAppMsg.getParentTenantId()); | |||||
| WxTemplateMsg msg = null; | WxTemplateMsg msg = null; | ||||
| WxMaSubscribeMessage subscribeMessage; | WxMaSubscribeMessage subscribeMessage; | ||||
| @@ -67,7 +73,7 @@ public class SendSmartAppMsgServiceImpl implements MsgSendService { | |||||
| WxTemplateMsg msgQ = new WxTemplateMsg(); | WxTemplateMsg msgQ = new WxTemplateMsg(); | ||||
| msgQ.updateTenantInfo(tenantEntity); | msgQ.updateTenantInfo(tenantEntity); | ||||
| msgQ.setType(smartAppMsg.getTemplateType()); | msgQ.setType(smartAppMsg.getTemplateType()); | ||||
| List<WxTemplateMsg> list = wxTemplateMsgMapper.selectList(new QueryWrapper(msgQ)); | |||||
| List<WxTemplateMsg> list = wxTemplateMsgMapper.findList(msgQ); | |||||
| if (list.size() > 0) { | if (list.size() > 0) { | ||||
| msg = list.get(0); | msg = list.get(0); | ||||
| } | } | ||||
| @@ -112,16 +118,28 @@ public class SendSmartAppMsgServiceImpl implements MsgSendService { | |||||
| // .build(); | // .build(); | ||||
| // wxMaService.getMsgService().sendTemplateMsg(templateMessage); | // wxMaService.getMsgService().sendTemplateMsg(templateMessage); | ||||
| subscribeMessage = WxMaSubscribeMessage.builder() | |||||
| .templateId(msg.getTemplateId()) | |||||
| .toUser(smartAppMsg.getTo()) | |||||
| .lang(WxMaConstants.MiniprogramLang.ZH_CN) | |||||
| .miniprogramState(WxMaConstants.MiniprogramState.FORMAL) | |||||
| .page(smartAppMsg.getGotopage()) | |||||
| .data(dataTempList) | |||||
| .build(); | |||||
| String[] split = smartAppMsg.getTo().split(","); | |||||
| for (String to:split) { | |||||
| try { | |||||
| subscribeMessage = WxMaSubscribeMessage.builder() | |||||
| .templateId(msg.getTemplateId()) | |||||
| .toUser(to) | |||||
| .page(smartAppMsg.getGotopage()) | |||||
| .lang(WxMaConstants.MiniprogramLang.ZH_CN) | |||||
| .miniprogramState(WxMaConstants.MiniprogramState.FORMAL) | |||||
| .page(smartAppMsg.getGotopage()) | |||||
| .data(dataTempList) | |||||
| .build(); | |||||
| wxMaService.getMsgService().sendSubscribeMsg(subscribeMessage); | |||||
| wxCUserMapper.updateMsgCountDown(tenantEntity.getTenantId(),to); | |||||
| } catch (Exception e) { | |||||
| logger.error("openId:"+to+"-----发送订阅消息失败"); | |||||
| } | |||||
| } | |||||
| wxMaService.getMsgService().sendSubscribeMsg(subscribeMessage); | |||||
| } | } | ||||
| } | } | ||||
| @@ -67,6 +67,7 @@ public class AliyunSMS implements SMSExcutor { | |||||
| */ | */ | ||||
| public Result sendSms(SMS sms) { | public Result sendSms(SMS sms) { | ||||
| if (null == sms || StringUtils.isBlank(sms.getTemplateCode())) { | if (null == sms || StringUtils.isBlank(sms.getTemplateCode())) { | ||||
| log.error("发送短信----模板code 为 null"); | |||||
| return null; | return null; | ||||
| } | } | ||||
| IAcsClient acsClient = getClient(); | IAcsClient acsClient = getClient(); | ||||
| @@ -230,6 +230,43 @@ | |||||
| <include refid="dynamicWhereConditions"/> | <include refid="dynamicWhereConditions"/> | ||||
| </select> | </select> | ||||
| <select id="listOpenId" parameterType="com.iformall.domain.po.WxCUser" resultType="String"> | |||||
| select open_id from wx_c_user where msg_count > 0 | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| </select> | |||||
| <update id="updateMsgCount" parameterType="com.iformall.domain.po.WxCUser"> | |||||
| update wx_c_user set msg_count = msg_count+2 | |||||
| where 1=1 | |||||
| <if test=" null != id "> | |||||
| and `id` = #{id} | |||||
| </if> | |||||
| <if test=" null != openId "> | |||||
| and `open_id` = #{openId} | |||||
| </if> | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| </update> | |||||
| <update id="updateMsgCountDown"> | |||||
| update wx_c_user set msg_count = msg_count-1 | |||||
| where msg_count > 0 | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| and `open_id` = #{openId} | |||||
| </update> | |||||
| <select id="findByOpenId" parameterType="com.iformall.domain.po.WxCUser" resultMap="BaseResultMap"> | <select id="findByOpenId" parameterType="com.iformall.domain.po.WxCUser" resultMap="BaseResultMap"> | ||||
| select <include refid="allColumns"/> from wx_c_user | select <include refid="allColumns"/> from wx_c_user | ||||
| where `app_id` = #{appId} and `open_id` = #{openId} | where `app_id` = #{appId} and `open_id` = #{openId} | ||||
| @@ -22,7 +22,7 @@ | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| distinct cc.`id`,cc.`tenant_id`,cc.`parent_tenant_id`,cc.`coupon_id`,cc.`coupon_status`,cc.`type`,cc.`title`,cc.`target_ad`,cc.`business`,cc.`sub_business`,cc.`begin_time`,cc.`end_time`,cc.`status`,cc.`create_date`,cc.`update_date`,cc.`sub_target_id`,cc.qr_code | |||||
| distinct cc.`id`,cc.`tenant_id`,cc.`parent_tenant_id`,cc.`coupon_id`,cc.`coupon_status`,cc.`type`,cc.`title`,cc.`target_ad`,cc.`business`,cc.`sub_business`,cc.`show_begin_time`,cc.`begin_time`,cc.`end_time`,cc.`status`,cc.`create_date`,cc.`update_date`,cc.`sub_target_id`,cc.qr_code | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -175,6 +175,7 @@ | |||||
| <result column="title" jdbcType="VARCHAR" property="title" /> | <result column="title" jdbcType="VARCHAR" property="title" /> | ||||
| <result column="target_ad" jdbcType="INTEGER" property="targetAd" /> | <result column="target_ad" jdbcType="INTEGER" property="targetAd" /> | ||||
| <result column="business" jdbcType="VARCHAR" property="business" /> | <result column="business" jdbcType="VARCHAR" property="business" /> | ||||
| <result column="show_begin_time" jdbcType="TIMESTAMP" property="showBeginTime" /> | |||||
| <result column="sub_business" jdbcType="INTEGER" property="subBusiness" /> | <result column="sub_business" jdbcType="INTEGER" property="subBusiness" /> | ||||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | ||||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | ||||
| @@ -224,7 +224,7 @@ | |||||
| </select> | </select> | ||||
| <select id="couponDataList" resultType="com.iformall.domain.vo.MarkingCouponDataReportVo" parameterType="hashmap"> | <select id="couponDataList" resultType="com.iformall.domain.vo.MarkingCouponDataReportVo" parameterType="hashmap"> | ||||
| SELECT createTime,couponId,sum(couponCount),sum(couponUserCount),sum(verifyCount),sum(verifyUserCount) | |||||
| SELECT createTime,couponId,sum(couponCount) couponCount,sum(couponUserCount) couponUserCount,sum(verifyCount) verifyCount,sum(verifyUserCount) verifyUserCount | |||||
| from (<foreach collection="tenantEntitys" item="tenantEntity" index="index" separator="union all"> | from (<foreach collection="tenantEntitys" item="tenantEntity" index="index" separator="union all"> | ||||
| SELECT * from view_coupon_data${tenantEntity.shardTableSuffix} WHERE `tenant_id` = #{tenantEntity.tenantId} | SELECT * from view_coupon_data${tenantEntity.shardTableSuffix} WHERE `tenant_id` = #{tenantEntity.tenantId} | ||||
| </foreach>) view_coupon_data | </foreach>) view_coupon_data | ||||
| @@ -253,7 +253,7 @@ | |||||
| </select> | </select> | ||||
| <select id="touchUsersReportList" resultType="com.iformall.domain.vo.TouchUsersReportVo" parameterType="com.iformall.domain.dto.MarkingCouponDataReportDto"> | <select id="touchUsersReportList" resultType="com.iformall.domain.vo.TouchUsersReportVo" parameterType="com.iformall.domain.dto.MarkingCouponDataReportDto"> | ||||
| SELECT xTime, sum(pv), sum(uv), sum(couponCount), sum(userCount), sum(verifyCount), sum(verifyUserCount) | |||||
| SELECT xTime, sum(pv) pv, sum(uv) uv, sum(couponCount) couponCount, sum(userCount) userCount, sum(verifyCount) verifyCount, sum(verifyUserCount) verifyUserCount | |||||
| FROM (<foreach collection="tenantEntitys" item="tenantEntity" index="index" separator="union all"> | FROM (<foreach collection="tenantEntitys" item="tenantEntity" index="index" separator="union all"> | ||||
| SELECT * from view_touch_user${tenantEntity.shardTableSuffix} WHERE `tenant_id` = #{tenantEntity.tenantId} | SELECT * from view_touch_user${tenantEntity.shardTableSuffix} WHERE `tenant_id` = #{tenantEntity.tenantId} | ||||
| </foreach>) view_touch_user | </foreach>) view_touch_user | ||||
| @@ -6,6 +6,8 @@ | |||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | ||||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> | <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> | ||||
| <result column="template_id" jdbcType="VARCHAR" property="templateId"/> | <result column="template_id" jdbcType="VARCHAR" property="templateId"/> | ||||
| <result column="custom_param" jdbcType="VARCHAR" property="customParam"/> | |||||
| <result column="type" jdbcType="INTEGER" property="type"/> | <result column="type" jdbcType="INTEGER" property="type"/> | ||||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/> | <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/> | ||||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> | <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> | ||||
| @@ -13,7 +15,7 @@ | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`parent_tenant_id`,`template_id`,`type`,`create_date`,`update_date`,`on_off` | |||||
| `id`,`tenant_id`,`parent_tenant_id`,`template_id`,`type`,`custom_param`,`create_date`,`update_date`,`on_off` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -64,5 +66,13 @@ | |||||
| <include refid="dynamicWhereConditions"/> | <include refid="dynamicWhereConditions"/> | ||||
| </select> | </select> | ||||
| <select id="findListForMiniApp" parameterType="com.iformall.domain.po.WxTemplateMsg" resultMap="BaseResultMap"> | |||||
| select | |||||
| <include refid="allColumns"/> | |||||
| from wx_template_msg | |||||
| <include refid="dynamicWhereConditions"/> | |||||
| and `type` > 3 and `type` < 100 | |||||
| </select> | |||||
| </mapper> | </mapper> | ||||