Kaynağa Gözat

//会员卡 商圈相关——2

release_toaliyun_real
xhxu 3 yıl önce
ebeveyn
işleme
8b6582d886
45 değiştirilmiş dosya ile 1352 ekleme ve 148 silme
  1. +1
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/basic/WxMerchantController.java
  2. +1
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/mem/WxCUserBasicInfoController.java
  3. +10
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/mem/WxCreditHistoryController.java
  4. +4
    -0
      mallinkAdmin/src/main/resources/db/migration/V2022101100001__add_pay_account.sql
  5. +19
    -0
      mallinkAdmin/src/main/resources/db/migration/V2022101100002__add_sale_type.sql
  6. +400
    -0
      mallinkAdmin/src/main/resources/db/migration/V2022101100003__add_wxcuser.sql
  7. +54
    -0
      mallinkCApi/src/main/java/com/iformall/controller/WxBusinessCircleController.java
  8. +24
    -14
      mallinkCallback/src/main/java/com/iformall/controller/callback/WxBusinessOrderController.java
  9. +15
    -4
      mallinkCallback/src/main/java/com/iformall/controller/callback/WxMemberCardController.java
  10. +46
    -9
      mallinkMQConsumer/src/main/java/com/iformall/mq/MqBaseConsumer.java
  11. +1
    -1
      mallinkPublicApi/src/main/java/com/iformall/controller/UserBasicInfoController.java
  12. +1
    -1
      mallinkService/src/main/java/com/iformall/config/BaseMyBatisConfiguration.java
  13. +9
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxCUser.java
  14. +1
    -1
      mallinkService/src/main/java/com/iformall/domain/po/WxCUserBasicInfo.java
  15. +14
    -11
      mallinkService/src/main/java/com/iformall/domain/po/WxMemberCard.java
  16. +23
    -0
      mallinkService/src/main/java/com/iformall/domain/po/msg/AfterAddCreditMsg.java
  17. +21
    -0
      mallinkService/src/main/java/com/iformall/domain/po/msg/AfterAddScoreMsg.java
  18. +19
    -0
      mallinkService/src/main/java/com/iformall/domain/po/msg/AfterCarInOutMsg.java
  19. +22
    -0
      mallinkService/src/main/java/com/iformall/domain/po/msg/SyncMemberCardMsg.java
  20. +6
    -6
      mallinkService/src/main/java/com/iformall/enums/EnumBusinessCircleAuthorizeState.java
  21. +6
    -0
      mallinkService/src/main/java/com/iformall/enums/EnumMsgRecordType.java
  22. +3
    -1
      mallinkService/src/main/java/com/iformall/mapper/WxCUserMapper.java
  23. +3
    -1
      mallinkService/src/main/java/com/iformall/mapper/WxCreditHistoryMapper.java
  24. +2
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxMemberCardMapper.java
  25. +7
    -0
      mallinkService/src/main/java/com/iformall/service/WxBusinessCircleOrderService.java
  26. +1
    -1
      mallinkService/src/main/java/com/iformall/service/WxCUserBasicInfoService.java
  27. +2
    -0
      mallinkService/src/main/java/com/iformall/service/WxCUserService.java
  28. +4
    -1
      mallinkService/src/main/java/com/iformall/service/WxCreditHistoryService.java
  29. +10
    -7
      mallinkService/src/main/java/com/iformall/service/WxMemberCardService.java
  30. +2
    -2
      mallinkService/src/main/java/com/iformall/service/impl/AliBusinessCircleOrderServiceImpl.java
  31. +62
    -5
      mallinkService/src/main/java/com/iformall/service/impl/WxBusinessCircleOrderServiceImpl.java
  32. +3
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java
  33. +5
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCUserServiceImpl.java
  34. +16
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCarCmdLogServiceImpl.java
  35. +23
    -5
      mallinkService/src/main/java/com/iformall/service/impl/WxCreditHistoryServiceImpl.java
  36. +133
    -48
      mallinkService/src/main/java/com/iformall/service/impl/WxMemberCardServiceImpl.java
  37. +3
    -3
      mallinkService/src/main/java/com/iformall/service/impl/WxThirdPartyOrdersServiceImpl.java
  38. +115
    -0
      mallinkService/src/main/java/com/iformall/service/msg/impl/AfterAddCreditMsgServiceImpl.java
  39. +63
    -0
      mallinkService/src/main/java/com/iformall/service/msg/impl/AfterAddScoreMsgServiceImpl.java
  40. +110
    -0
      mallinkService/src/main/java/com/iformall/service/msg/impl/AfterCarInOutMsgServiceImpl.java
  41. +0
    -2
      mallinkService/src/main/java/com/iformall/service/msg/impl/FmInsideCLoginMsgServiceImpl.java
  42. +38
    -0
      mallinkService/src/main/java/com/iformall/service/msg/impl/SyncMemberCardMsgServiceImpl.java
  43. +23
    -1
      mallinkService/src/main/resources/mapper/WxCUserMapper.xml
  44. +10
    -0
      mallinkService/src/main/resources/mapper/WxCreditHistoryMapper.xml
  45. +17
    -21
      mallinkService/src/main/resources/mapper/WxMemberCardMapper.xml

+ 1
- 1
mallinkAdmin/src/main/java/com/iformall/controller/basic/WxMerchantController.java Dosyayı Görüntüle

@@ -407,7 +407,7 @@ public class WxMerchantController extends BaseController {
}
WxPayAccount payAcount = payAccountService.getById(appInfo.getPayId());
if(payAcount == null){
return new ResultData(ErrorCode.APP_ID_NOT_FOUND);
return new ResultData(ErrorCode.API_KEY_NOT_FOUND);
}
if(anEnum.equals(AppAddSubMerchantUrlType.improt_URL)){
return wxProfitSharingReceiverService.getTtReceiverImprotURL(merchant,appInfo.getAppId(),payAcount.getApiKey());


+ 1
- 1
mallinkAdmin/src/main/java/com/iformall/controller/mem/WxCUserBasicInfoController.java Dosyayı Görüntüle

@@ -197,7 +197,7 @@ public class WxCUserBasicInfoController extends BaseController {
updateLevelParam(wxCUserBasicInfo);
}
}
wxCUserBasicInfo.undateFinalTenantId(getTenantInfo());
wxCUserBasicInfo.updateFinalTenantId(getTenantInfo());
wxCUserBasicInfo.setSortColumns(BaseEntity.SortField.wcubiActiveTime_DESC);
PageInfo<WxCUserBasicInfo> page = wxCUserBasicInfoService.listAsPage(wxCUserBasicInfo, pageNum, pageSize);



+ 10
- 0
mallinkAdmin/src/main/java/com/iformall/controller/mem/WxCreditHistoryController.java Dosyayı Görüntüle

@@ -172,6 +172,16 @@ public class WxCreditHistoryController extends BaseController {
return new ResultData(Result.SUCCESS);
}

@ApiOperation("积分清零计划 刷新商圈积分")
@PostMapping("syncClearCredit")
@SystemControllerLog(description = "刷新商圈积分")
@TenantIgnore
public ResultData syncClearCredit() {
logger.debug("[" + getIpAddr() + "] WxCreditHistoryController::syncClearCredit");
wxCreditHistoryService.syncClearCredit(getTenantInfo());
return new ResultData(Result.SUCCESS);
}

@ApiOperation("门店排行榜")
@GetMapping("merchantCreditRanking")
@ApiImplicitParams({


+ 4
- 0
mallinkAdmin/src/main/resources/db/migration/V2022101100001__add_pay_account.sql Dosyayı Görüntüle

@@ -0,0 +1,4 @@
ALTER TABLE `mallink`.`wx_pay_account`
ADD COLUMN `business_type` smallint(2) COMMENT '商圈版本' AFTER `merchant_cert_pem_path`,
ADD COLUMN `brandid` varchar(50) COMMENT '商圈品牌ID' AFTER `business_type`,
ADD COLUMN `card_id` varchar(50) COMMENT '商圈会员卡ID' AFTER `brandid`;

+ 19
- 0
mallinkAdmin/src/main/resources/db/migration/V2022101100002__add_sale_type.sql Dosyayı Görüntüle

@@ -0,0 +1,19 @@

INSERT INTO `mallink`.`mall_sale_type`(`id`, `name`, `type`, `period`, `menus`) VALUES (103500103610, '金茂合同全能版+抖音', 10, 12, '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 50, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 201, 202, 203, 204, 205, 206, 209, 211, 212, 221, 222, 223, 251, 299, 300, 307, 308, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 420, 421, 422, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 514, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 647, 651, 661, 662, 663, 664, 665, 666, 671, 672, 673, 674, 675, 676, 680, 681, 682, 683, 684, 685, 687, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 712, 713, 714, 901, 902, 903, 904, 905, 906, 907, 908, 910, 931, 932, 951, 952, 961, 962, 963, 965, 966, 967, 968, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 5310, 5320, 6611, 60701, 60702]');
INSERT INTO `mallink`.`mall_sale_type`(`id`, `name`, `type`, `period`, `menus`) VALUES (12, '尊享全能版+抖音', 12, 12, '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 50, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 201, 202, 203, 204, 205, 206, 209, 211, 212, 221, 222, 223, 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, 420, 421, 422, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 514, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 647, 651, 661, 662, 663, 664, 665, 666, 671, 672, 673, 674, 675, 676, 680, 681, 682, 683, 684, 685, 687, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 712, 713, 714, 901, 902, 903, 904, 905, 906, 907, 908, 910, 931, 932, 951, 952, 961, 962, 963, 965, 966, 967, 968, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 5310, 5320, 6611, 60701, 60702]');


INSERT INTO `mallink`.`mall_permission`(`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) VALUES (615, '抖音CPS佣金', 6, 'Y', NULL, 0, NULL, NULL, NULL, 'icon-jifen', 0, 602);
INSERT INTO `mallink`.`mall_permission`(`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) VALUES (61501, '通用佣金', 615, 'Y', NULL, 1, NULL, NULL, 'commonPlan', NULL, 0, 61501);
INSERT INTO `mallink`.`mall_permission`(`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) VALUES (61502, '定向佣金', 615, 'Y', NULL, 1, NULL, NULL, 'orientedPlan', NULL, 0, 61502);



UPDATE `mallink`.`mall_sale_type` SET `menus` = '[1, 2, 4, 5, 6, 50, 105, 110, 201, 205, 202, 211, 212, 221, 222, 223, 251, 409, 410, 411, 416, 500, 502, 504, 505, 506, 507, 508, 511, 512, 521, 522, 523, 591, 592, 595, 601, 602, 605, 606, 610, 615, 622, 647, 676, 680, 711, 901, 902, 904, 907, 5310, 5320, 61501, 61502]' WHERE `id` = 11;
UPDATE `mallink`.`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, 109, 110, 201, 202, 203, 204, 205, 206, 209, 211, 212, 221, 222, 223, 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, 420, 421, 422, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 514, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 647, 651, 661, 662, 663, 664, 665, 666, 671, 672, 673, 674, 675, 676, 680, 681, 682, 683, 684, 685, 687, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 712, 713, 714, 901, 902, 903, 904, 905, 906, 907, 908, 910, 931, 932, 951, 952, 961, 962, 963, 965, 966, 967, 968, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 5310, 5320, 6611, 60701, 60702, 61501, 61502]' WHERE `id` = 12;
UPDATE `mallink`.`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, 109, 110, 201, 202, 203, 204, 205, 206, 209, 211, 212, 221, 222, 223, 251, 299, 300, 307, 308, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 420, 421, 422, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 514, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 647, 651, 661, 662, 663, 664, 665, 666, 671, 672, 673, 674, 675, 676, 680, 681, 682, 683, 684, 685, 687, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 712, 713, 714, 901, 902, 903, 904, 905, 906, 907, 908, 910, 931, 932, 951, 952, 961, 962, 963, 965, 966, 967, 968, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 5310, 5320, 6611, 60701, 60702, 61501, 61502]' WHERE `id` = 103500103610;






+ 400
- 0
mallinkAdmin/src/main/resources/db/migration/V2022101100003__add_wxcuser.sql Dosyayı Görüntüle

@@ -0,0 +1,400 @@
ALTER TABLE `mallink`.`wx_c_user_0`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_1`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_2`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_3`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_4`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_5`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_6`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_7`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_8`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_9`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_10`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_11`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_12`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_13`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_14`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_15`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_16`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_17`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_18`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_19`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_20`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_21`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_22`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_23`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_24`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_25`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_26`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_27`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_28`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_29`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_30`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_31`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_32`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_33`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_34`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_35`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_36`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_37`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_38`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_39`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_40`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_41`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_42`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_43`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_44`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_45`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_46`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_47`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_48`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_49`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_50`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_51`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_52`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_53`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_54`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_55`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_56`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_57`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_58`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_59`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_60`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_61`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_62`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_63`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_64`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_65`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_66`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_67`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_68`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_69`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_70`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_71`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_72`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_73`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_74`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_75`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_76`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_77`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_78`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_79`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_80`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_81`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_82`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_83`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_84`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_85`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_86`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_87`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_88`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_89`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_90`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_91`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_92`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_93`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_94`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_95`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_96`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_97`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_98`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;
ALTER TABLE `mallink`.`wx_c_user_99`
ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`,
ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`,
ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`;

+ 54
- 0
mallinkCApi/src/main/java/com/iformall/controller/WxBusinessCircleController.java Dosyayı Görüntüle

@@ -0,0 +1,54 @@
package com.iformall.controller;

import com.iformall.annotation.RedisCache;
import com.iformall.common.ErrorCode;
import com.iformall.common.Result;
import com.iformall.common.ResultData;
import com.iformall.domain.po.*;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.enums.EnumAppPlat;
import com.iformall.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/api/circle")
@Api(description = "业态查询接口")
public class WxBusinessCircleController extends BaseController {

private final Logger logger = LoggerFactory.getLogger(this.getClass());

@Autowired
WxBusinessCircleOrderService wxBusinessCircleOrderService;

@ApiOperation("获取商圈授权状态")
@GetMapping("/getAuthorizeState")
@RedisCache
public ResultData getAuthorizeState() {
logger.debug("[" + getIpAddr() + "] WxBusinessCircleController::getAuthorizeState");
CUser user = getCUser();
if(!EnumAppPlat.WX.equals(user.getAppPlat())){
return new ResultData(ErrorCode.SYS_METHOD_NOT_SUPPORT.getCode(),"平台不支持此请求");
}
ResultData resultData = wxBusinessCircleOrderService.syncauthorizeState(getTenantInfo(), user.getOpenId());
return resultData;
}

@ApiOperation("获取商圈有未提交的积分")
@GetMapping("/getPointsCommitStatus")
public ResultData getPointsCommitStatus() {
logger.debug("[" + getIpAddr() + "] WxBusinessCircleController::getPointsCommitStatus");
CUser user = getCUser();
if(!EnumAppPlat.WX.equals(user.getAppPlat())){
return new ResultData(ErrorCode.SYS_METHOD_NOT_SUPPORT.getCode(),"平台不支持此请求");
}
return wxBusinessCircleOrderService.getPointsCommitStatus(getTenantInfo(), user.getOpenId());
}

}

+ 24
- 14
mallinkCallback/src/main/java/com/iformall/controller/callback/WxBusinessOrderController.java Dosyayı Görüntüle

@@ -5,24 +5,17 @@ import com.github.binarywang.wxpay.bean.businesscircle.MemberCardAuthorizeNotify
import com.github.binarywang.wxpay.bean.businesscircle.PaidResult;
import com.github.binarywang.wxpay.bean.businesscircle.RefundResult;
import com.github.binarywang.wxpay.bean.ecommerce.SignatureHeader;
import com.github.binarywang.wxpay.bean.membercard.MemberCardActivateResult;
import com.github.binarywang.wxpay.bean.membercard.MemberCardNotifyData;
import com.github.binarywang.wxpay.exception.WxPayException;
import com.github.binarywang.wxpay.service.WxPayService;
import com.iformall.controller.base.BaseController;
import com.iformall.domain.po.WxAppinfo;
import com.iformall.domain.po.WxBusinessCircleOrder;
import com.iformall.domain.po.WxMemberCard;
import com.iformall.domain.po.WxPayAccount;
import com.iformall.domain.po.*;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.enums.*;
import com.iformall.exception.MallinkException;
import com.iformall.interceptor.BodyReaderHttpServletRequestWrapper;
import com.iformall.pay.WxPayConstant;
import com.iformall.service.*;
import com.iformall.utils.MaUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.web.servlet.ShiroHttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -35,6 +28,7 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
@@ -62,6 +56,9 @@ public class WxBusinessOrderController extends BaseController {
@Autowired
WxMemberCardService wxMemberCardService;

@Autowired
WxCUserService wxCUserService;

@Autowired
MaUtil maUtil;

@@ -99,8 +96,12 @@ public class WxBusinessOrderController extends BaseController {
String body = this.getBody(request);
logger.info("商圈授权通知---body{}"+body);
WxAppinfo cAppInfo = wxAppinfoService.getCAppInfoFromRedis(tenantId, EnumAppPlat.WX);
if(cAppInfo == null){
resultMap.put("code","FAIL");
return resultMap;
}
WxPayAccount payAccount = wxPayAccountService.getByIdFromRedis(cAppInfo.getPayId());
if(cAppInfo == null || payAccount == null){
if(payAccount == null){
resultMap.put("code","FAIL");
return resultMap;
}
@@ -115,22 +116,31 @@ public class WxBusinessOrderController extends BaseController {
logger.info("商圈授权通知---解密结果{}"+result.toString());

WxMemberCard memberCard = new WxMemberCard();
memberCard.updateTenantInfo(tenantEntity);
memberCard.setAppId(cAppInfo.getAppId());
memberCard.setTenantId(tenantEntity.getTenantId());
memberCard.setParentTenantId(tenantEntity.getParentTenantId());
memberCard.updateFinalTenantId(tenantEntity);
memberCard.setCardId(payAccount.getCardId());
memberCard.setCardCode(result.getCode());
memberCard.setOpenId(result.getOpenid());

if(WxPayConstant.REGISTERED_MODE.equals(result.getAuthType())){
memberCard.setUserCardStatus(EnumMemberCardStatus.EFFECTIVE.getCode());
memberCard.setAuthorizeState(EnumMemberCardAuthorizeState.UNAUTHORIZED.getCode());
wxMemberCardService.saveorupdateByCode(memberCard);

wxMemberCardService.sendSyncMemberCardMsg(tenantEntity,memberCard.getCardId(),memberCard.getCardCode());
resultMap.put("code","SUCCESS");
return resultMap;
}else if(WxPayConstant.REGISTERED_AND_AUTHORIZATION_MODE.equals(result.getAuthType())){
memberCard.setUserCardStatus(EnumMemberCardStatus.EFFECTIVE.getCode());
memberCard.setAuthorizeState(EnumMemberCardAuthorizeState.AUTHORIZED.getCode());
wxMemberCardService.saveorupdateByCode(memberCard);

WxCUser updCuser = new WxCUser();
updCuser.updateTenantInfo(tenantEntity);
updCuser.setOpenId(result.getOpenid());
updCuser.setAuthorizeState(EnumBusinessCircleAuthorizeState.AUTHORIZED.getCode());
updCuser.setAuthorizeTime(new Date());
wxCUserService.updateAuthorizeStateByOpenId(updCuser);

wxMemberCardService.sendSyncMemberCardMsg(tenantEntity,memberCard.getCardId(),memberCard.getCardCode());
resultMap.put("code","SUCCESS");
return resultMap;
}


+ 15
- 4
mallinkCallback/src/main/java/com/iformall/controller/callback/WxMemberCardController.java Dosyayı Görüntüle

@@ -95,8 +95,12 @@ public class WxMemberCardController extends BaseController {
String body = this.getBody(request);
logger.info("微信会员卡通知---body{}"+body);
WxAppinfo cAppInfo = wxAppinfoService.getCAppInfoFromRedis(tenantId, EnumAppPlat.WX);
if(cAppInfo == null){
resultMap.put("code","FAIL");
return resultMap;
}
WxPayAccount payAccount = wxPayAccountService.getByIdFromRedis(cAppInfo.getPayId());
if(cAppInfo == null || payAccount == null){
if(payAccount == null){
resultMap.put("code","FAIL");
return resultMap;
}
@@ -110,8 +114,9 @@ public class WxMemberCardController extends BaseController {
logger.info("微信会员卡通知---解密结果{}"+result.toString());

WxMemberCard memberCard = new WxMemberCard();
memberCard.updateTenantInfo(tenantEntity);
memberCard.setAppId(cAppInfo.getAppId());
memberCard.setTenantId(tenantEntity.getTenantId());
memberCard.setParentTenantId(tenantEntity.getParentTenantId());
memberCard.updateFinalTenantId(tenantEntity);
memberCard.setCardId(result.getCardId());
memberCard.setCardCode(result.getCode());
memberCard.setOpenId(result.getOpenid());
@@ -122,6 +127,8 @@ public class WxMemberCardController extends BaseController {
memberCard.setActivateScene(EnumMemberCardActivateScene.getEnum(result.getActivateScene()).getCode());
// memberCard.setOuterStr(result.getOuterStr());
wxMemberCardService.saveorupdateByCode(memberCard);

wxMemberCardService.sendSyncMemberCardMsg(tenantEntity,memberCard.getCardId(),memberCard.getCardCode());
resultMap.put("code","SUCCESS");
return resultMap;
}else if(WxPayConstant.USER_VIEW_MEMBERCARD.equals(result.getEventType())){
@@ -131,9 +138,13 @@ public class WxMemberCardController extends BaseController {
memberCard.setUpdateDate(sdf.parse(result.getEventTime()));
memberCard.setUserCardStatus(EnumMemberCardStatus.DELETE.getCode());
wxMemberCardService.delUserCardStatusByCode(memberCard);

wxMemberCardService.sendSyncMemberCardMsg(tenantEntity,memberCard.getCardId(),memberCard.getCardCode());
resultMap.put("code","SUCCESS");
return resultMap;
}else if(WxPayConstant.USER_MODIFY_INFORMATION.equals(result.getEventType())){//todo 暂未同步会员卡信息
}else if(WxPayConstant.USER_MODIFY_INFORMATION.equals(result.getEventType())){

wxMemberCardService.sendSyncMemberCardMsg(tenantEntity,memberCard.getCardId(),memberCard.getCardCode());
resultMap.put("code","SUCCESS");
return resultMap;
}


+ 46
- 9
mallinkMQConsumer/src/main/java/com/iformall/mq/MqBaseConsumer.java Dosyayı Görüntüle

@@ -31,6 +31,14 @@ public class MqBaseConsumer {
@Autowired
private SendWeappUniformMsgServiceImpl sendWeappUniformMsgService;
@Autowired
private AfterAddCreditMsgServiceImpl afterAddCreditMsgService;
@Autowired
private AfterAddScoreMsgServiceImpl afterAddScoreMsgService;
@Autowired
private AfterCarInOutMsgServiceImpl afterCarInOutMsgService;
@Autowired
private SyncMemberCardMsgServiceImpl syncMemberCardMsgService;
@Autowired
private FmInsideOrderSuccessMsgServiceImpl fmInsideOrderSuccessMsgService;
@Autowired
private FmInsideCouponVerifyMsgServiceImpl fmInsideCouponVerifyMsgService;
@@ -79,40 +87,69 @@ public class MqBaseConsumer {
//短信
WxMsgRecord msg = (WxMsgRecord)JsonUtil.readValue(message,WxMsgRecord.class);
sendSmsService.send(msg);
} else if(EnumMsgRecordType.SMS_CALLBACK.getCode().equals(baseMsg.getMsgType())){
}
else if(EnumMsgRecordType.SMS_CALLBACK.getCode().equals(baseMsg.getMsgType())){
//业务短信
WxMsg msg = (WxMsg)JsonUtil.readValue(message,WxMsg.class);
sendCallBackSmsService.send(msg);
} else if(EnumMsgRecordType.EMAIL.getCode().equals(baseMsg.getMsgType())){
}
else if(EnumMsgRecordType.EMAIL.getCode().equals(baseMsg.getMsgType())){
//邮件
MailMsg msg = (MailMsg)JsonUtil.readValue(message,MailMsg.class);
sendEmailService.send(msg);
// } else if(EnumMsgRecordType.SMART_APP.getCode().equals(baseMsg.getMsgType())){
} else if(EnumMsgRecordType.SMART_APP_TO.getCode().equals(baseMsg.getMsgType())){
}
else if(EnumMsgRecordType.SMART_APP_TO.getCode().equals(baseMsg.getMsgType())){
//微信小程序-订阅消息
SmartAppMsg msg = (SmartAppMsg)JsonUtil.readValue(message,SmartAppMsg.class);
sendSmartAppMsgService.send(msg);
} else if(EnumMsgRecordType.PUBLIC.getCode().equals(baseMsg.getMsgType())) {
}
else if(EnumMsgRecordType.PUBLIC.getCode().equals(baseMsg.getMsgType())) {
//公众号-模板消息
MpAppMsg msg = (MpAppMsg)JsonUtil.readValue(message,MpAppMsg.class);
sendMpMsgService.send(msg);
} else if(EnumMsgRecordType.SMART_APP_UNIFORM.getCode().equals(baseMsg.getMsgType())) {
}
else if(EnumMsgRecordType.SMART_APP_UNIFORM.getCode().equals(baseMsg.getMsgType())) {
//微信小程序-统一消息
AppUniformMsg msg = (AppUniformMsg)JsonUtil.readValue(message,AppUniformMsg.class);
sendWeappUniformMsgService.send(msg);
} else if(EnumMsgRecordType.INSIDE_ORDER_SUCCESS.getCode().equals(baseMsg.getMsgType())) {
}
else if(EnumMsgRecordType.SYNC_MEMBER_CARD.getCode().equals(baseMsg.getMsgType())) {
//微信商圈同步会员
SyncMemberCardMsg msg = (SyncMemberCardMsg)JsonUtil.readValue(message,SyncMemberCardMsg.class);
syncMemberCardMsgService.send(msg);
}
else if(EnumMsgRecordType.AFTER_ADD_CREDIT.getCode().equals(baseMsg.getMsgType())) {
//积分变更后
AfterAddCreditMsg msg = (AfterAddCreditMsg)JsonUtil.readValue(message,AfterAddCreditMsg.class);
afterAddCreditMsgService.send(msg);
}
else if(EnumMsgRecordType.AFTER_ADD_SCORE.getCode().equals(baseMsg.getMsgType())) {
//成长值变更后
AfterAddScoreMsg msg = (AfterAddScoreMsg)JsonUtil.readValue(message,AfterAddScoreMsg.class);
afterAddScoreMsgService.send(msg);
}
else if(EnumMsgRecordType.AFTER_CAR_IN_OR_OUT.getCode().equals(baseMsg.getMsgType())) {
//车辆入场,出场后
AfterCarInOutMsg msg = (AfterCarInOutMsg)JsonUtil.readValue(message,AfterCarInOutMsg.class);
afterCarInOutMsgService.send(msg);
}
else if(EnumMsgRecordType.INSIDE_ORDER_SUCCESS.getCode().equals(baseMsg.getMsgType())) {
// 内部消息 - 下订单成功
FmInsideOrderSuccessMsg msg = (FmInsideOrderSuccessMsg)JsonUtil.readValue(message,FmInsideOrderSuccessMsg.class);
fmInsideOrderSuccessMsgService.send(msg);
} else if(EnumMsgRecordType.INSIDE_COUPON_VERIFY.getCode().equals(baseMsg.getMsgType())) {
}
else if(EnumMsgRecordType.INSIDE_COUPON_VERIFY.getCode().equals(baseMsg.getMsgType())) {
// 内部消息 - 券核销
FmInsideCouponVerifyMsg msg = (FmInsideCouponVerifyMsg)JsonUtil.readValue(message,FmInsideCouponVerifyMsg.class);
fmInsideCouponVerifyMsgService.send(msg);
} else if(EnumMsgRecordType.INSIDE_ORDER_REFUND.getCode().equals(baseMsg.getMsgType())){
}
else if(EnumMsgRecordType.INSIDE_ORDER_REFUND.getCode().equals(baseMsg.getMsgType())){
//内部消息 - 退款申请成功
FmInsideOrderRefundMsg msg = (FmInsideOrderRefundMsg) JsonUtil.readValue(message,FmInsideOrderRefundMsg.class);
fmInsideOrderRefundMsgService.send(msg);
} else if(EnumMsgRecordType.INSIDE_C_LOGIN.getCode().equals(baseMsg.getMsgType())) {
}
else if(EnumMsgRecordType.INSIDE_C_LOGIN.getCode().equals(baseMsg.getMsgType())) {
// 内部消息 - c端登录
FmInsideCLoginMsg msg = (FmInsideCLoginMsg)JsonUtil.readValue(message,FmInsideCLoginMsg.class);
fmInsideCLoginMsgService.send(msg);


+ 1
- 1
mallinkPublicApi/src/main/java/com/iformall/controller/UserBasicInfoController.java Dosyayı Görüntüle

@@ -68,7 +68,7 @@ public class UserBasicInfoController extends BaseController {

TenantEntity tenantEntity = getTenantInfo();

WxCUserBasicInfo userBasicInfo = wxCUserBasicInfoService.registerByPhone(tenantEntity, phone,nickName,sex,avatarUrl);
WxCUserBasicInfo userBasicInfo = wxCUserBasicInfoService.registerByPhone(tenantEntity, phone,nickName,null,sex,avatarUrl);

this.setLevel(userBasicInfo,tenantEntity);



+ 1
- 1
mallinkService/src/main/java/com/iformall/config/BaseMyBatisConfiguration.java Dosyayı Görüntüle

@@ -90,7 +90,7 @@ public class BaseMyBatisConfiguration {
shardingList.add(ttCUserSharding);

ShardingSphere wxMemberCardSharding = new ShardingSphere();
wxMemberCardSharding.setColumn("tenant_id");
wxMemberCardSharding.setColumn("final_tenant_id");
wxMemberCardSharding.setTableName("wx_member_card");
wxMemberCardSharding.setCount(100);
wxMemberCardSharding.setRule(EnumShardingRule.HASH.getCode());


+ 9
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxCUser.java Dosyayı Görüntüle

@@ -25,6 +25,15 @@ public class WxCUser extends CUser {
appPlat = EnumAppPlat.WX;
}

@io.swagger.annotations.ApiModelProperty(value="EnumBusinessCircleAuthorizeState 授权商圈快速积分状态",name="authorizeState")
private Integer authorizeState;

@io.swagger.annotations.ApiModelProperty(value="授权时间",name="authorizeTime")
private Date authorizeTime;

@io.swagger.annotations.ApiModelProperty(value="取消授权时间",name="deauthorizeTime")
private Date deauthorizeTime;

public String createToken(Date currentDate,String tenantId) {
if(StringUtils.isBlank(tenantId)){
tenantId = "1";


+ 1
- 1
mallinkService/src/main/java/com/iformall/domain/po/WxCUserBasicInfo.java Dosyayı Görüntüle

@@ -237,7 +237,7 @@ public class WxCUserBasicInfo extends TenantEntityWithoutFinalTenantId {
return Objects.hash(this.phone);
}
public void undateFinalTenantId(TenantEntity tenantEntity){
public void updateFinalTenantId(TenantEntity tenantEntity){
// setTenantId(tenantEntity.getTenantId());
// setParentTenantId(tenantEntity.getParentTenantId());
setFinalTenantId(tenantEntity.getTenantId());


+ 14
- 11
mallinkService/src/main/java/com/iformall/domain/po/WxMemberCard.java Dosyayı Görüntüle

@@ -2,9 +2,11 @@ package com.iformall.domain.po;

import com.baomidou.mybatisplus.annotation.TableName;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.po.base.TenantEntityWithoutFinalTenantId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.apache.commons.lang3.StringUtils;

import java.util.Date;

@@ -12,7 +14,10 @@ import java.util.Date;
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class WxMemberCard extends TenantEntity {
public class WxMemberCard extends TenantEntityWithoutFinalTenantId {

@io.swagger.annotations.ApiModelProperty(value="如果是集团版的,存集团版的tenantId,如果是商场,则存商场",name="sex")
private String finalTenantId;

protected Long id;

@@ -79,16 +84,14 @@ public class WxMemberCard extends TenantEntity {
@io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate")
private Date createDate;

@io.swagger.annotations.ApiModelProperty(value="",name="appId")
private String appId;

@io.swagger.annotations.ApiModelProperty(value="EnumMemberCardAuthorizeState 授权商圈快速积分状态",name="authorizeState")
private Integer authorizeState;

@io.swagger.annotations.ApiModelProperty(value="授权时间",name="authorizeTime")
private Date authorizeTime;
@io.swagger.annotations.ApiModelProperty(value="",name="userId")
private Long userId;

@io.swagger.annotations.ApiModelProperty(value="取消授权时间",name="deauthorizeTime")
private Date deauthorizeTime;
public void updateFinalTenantId(TenantEntity tenantEntity){
setFinalTenantId(tenantEntity.getTenantId());
if(StringUtils.isNotBlank(tenantEntity.getParentTenantId())){
setFinalTenantId(tenantEntity.getParentTenantId());
}
}

}

+ 23
- 0
mallinkService/src/main/java/com/iformall/domain/po/msg/AfterAddCreditMsg.java Dosyayı Görüntüle

@@ -0,0 +1,23 @@
package com.iformall.domain.po.msg;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.util.List;

/**
*
*/
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class AfterAddCreditMsg extends BaseMsg {

private static final long serialVersionUID = -1l;

@io.swagger.annotations.ApiModelProperty(value="会员ID",name="basicUserId")
private Long basicUserId;
@io.swagger.annotations.ApiModelProperty(value="积分变动ID",name="creditHistoryId")
private Long creditHistoryId;
}

+ 21
- 0
mallinkService/src/main/java/com/iformall/domain/po/msg/AfterAddScoreMsg.java Dosyayı Görüntüle

@@ -0,0 +1,21 @@
package com.iformall.domain.po.msg;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
*
*/
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class AfterAddScoreMsg extends BaseMsg {

private static final long serialVersionUID = -1l;

@io.swagger.annotations.ApiModelProperty(value="会员ID",name="basicUserId")
private Long basicUserId;
@io.swagger.annotations.ApiModelProperty(value="成长值变动ID",name="scoreHistoryId")
private Long scoreHistoryId;
}

+ 19
- 0
mallinkService/src/main/java/com/iformall/domain/po/msg/AfterCarInOutMsg.java Dosyayı Görüntüle

@@ -0,0 +1,19 @@
package com.iformall.domain.po.msg;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
*
*/
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class AfterCarInOutMsg extends BaseMsg {

private static final long serialVersionUID = -1l;

@io.swagger.annotations.ApiModelProperty(value="停车记录ID",name="carCmdLogId")
private Long carCmdLogId;
}

+ 22
- 0
mallinkService/src/main/java/com/iformall/domain/po/msg/SyncMemberCardMsg.java Dosyayı Görüntüle

@@ -0,0 +1,22 @@
package com.iformall.domain.po.msg;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
*
*/
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class SyncMemberCardMsg extends BaseMsg {

private static final long serialVersionUID = -1l;

@io.swagger.annotations.ApiModelProperty(value="",name="cardId")
private String cardId;
@io.swagger.annotations.ApiModelProperty(value="",name="code")
private String code;

}

mallinkService/src/main/java/com/iformall/enums/EnumMemberCardAuthorizeState.java → mallinkService/src/main/java/com/iformall/enums/EnumBusinessCircleAuthorizeState.java Dosyayı Görüntüle

@@ -3,7 +3,7 @@ package com.iformall.enums;
/**
* .
*/
public enum EnumMemberCardAuthorizeState {
public enum EnumBusinessCircleAuthorizeState {

//UNAUTHORIZED:未授权
//AUTHORIZED:已授权
@@ -13,16 +13,16 @@ public enum EnumMemberCardAuthorizeState {
DEAUTHORIZED(2, "DEAUTHORIZED"),
;

public static EnumMemberCardAuthorizeState getEnum(Integer code) {
for (EnumMemberCardAuthorizeState value : values()) {
public static EnumBusinessCircleAuthorizeState getEnum(Integer code) {
for (EnumBusinessCircleAuthorizeState value : values()) {
if (value.getCode().equals(code)) {
return value;
}
}
return null;
}
public static EnumMemberCardAuthorizeState getEnum(String message) {
for (EnumMemberCardAuthorizeState value : values()) {
public static EnumBusinessCircleAuthorizeState getEnum(String message) {
for (EnumBusinessCircleAuthorizeState value : values()) {
if (value.getMessage().equals(message)) {
return value;
}
@@ -33,7 +33,7 @@ public enum EnumMemberCardAuthorizeState {
private Integer code;
private String message;

EnumMemberCardAuthorizeState(Integer code, String message) {
EnumBusinessCircleAuthorizeState(Integer code, String message) {
this.code = code;
this.message = message;
}

+ 6
- 0
mallinkService/src/main/java/com/iformall/enums/EnumMsgRecordType.java Dosyayı Görüntüle

@@ -13,6 +13,12 @@ public enum EnumMsgRecordType {
SYSTEM(6, "系统通知"),
SMART_APP_UNIFORM(7, "小程序统一消息"),
WEBSOCKET_APP(8, "小程序websocket"),

SYNC_MEMBER_CARD(10,"微信商圈同步会员"),
AFTER_ADD_CREDIT(11,"积分变更后"),
AFTER_ADD_SCORE(12,"成长值变更后"),
AFTER_CAR_IN_OR_OUT(13,"车辆入场,出场后"),

INSIDE_ORDER_SUCCESS(100, "下订单成功"),
INSIDE_COUPON_VERIFY(101, "券核销"),
INSIDE_C_LOGIN(102, "C端用户登录"),//内部消息,加积分等


+ 3
- 1
mallinkService/src/main/java/com/iformall/mapper/WxCUserMapper.java Dosyayı Görüntüle

@@ -40,9 +40,11 @@ public interface WxCUserMapper extends CommonMapper<WxCUser, Long> {

// void updateMsgCountDown(@Param("tenantId")String tenantId, @Param("openId")String openId);

List<String> findOpenIdList(@Param("userId")Long userId, @Param("tenantId")String tenantId);
String findOpenId(@Param("userId")Long userId, @Param("tenantId")String tenantId);

List<String> findTokenList(@Param("id")Long id,@Param("userId")Long userId, @Param("tenantId")String tenantId);

List<UserStructureVo> findCountData(WxCUserBasicInfoDto dto);

void updateAuthorizeStateByOpenId(WxCUser updCuser);
}

+ 3
- 1
mallinkService/src/main/java/com/iformall/mapper/WxCreditHistoryMapper.java Dosyayı Görüntüle

@@ -12,7 +12,7 @@ import java.util.List;

public interface WxCreditHistoryMapper extends CommonMapper<WxCreditHistory, Long>{

WxCreditHistory selectById(@Param("id")Long id,@Param("tenantId")String tenantId);
WxCreditHistory selectById(@Param("id")Long id,@Param("tenantId")String finalTenantId);
List<WxCreditHistory> findList(WxCreditHistory wxCreditHistory);

@@ -51,4 +51,6 @@ public interface WxCreditHistoryMapper extends CommonMapper<WxCreditHistory, Lon
List<WxCreditHistory> findAddList(WxCreditHistory chaddq);

List<WxCreditHistory> findLesList(WxCreditHistory chlesq);

List<WxCreditHistory> getIsMemberCarAndClearCredit(WxCreditHistory record);
}

+ 2
- 0
mallinkService/src/main/java/com/iformall/mapper/WxMemberCardMapper.java Dosyayı Görüntüle

@@ -14,4 +14,6 @@ public interface WxMemberCardMapper extends CommonMapper<WxMemberCard, Long> {
Long getIdByCode(WxMemberCard record);

int updateByOpenId(WxMemberCard record);

WxMemberCard getByCode(WxMemberCard record);
}

+ 7
- 0
mallinkService/src/main/java/com/iformall/service/WxBusinessCircleOrderService.java Dosyayı Görüntüle

@@ -62,6 +62,11 @@ public interface WxBusinessCircleOrderService {

Integer sumCircleRefundAmount(BusinessCircleBase circleOrder);

/**
* 同步授权快速积分
*/
ResultData syncauthorizeState(TenantEntity tenantEntity,String openid);

/**
* 查询待积分状态
*/
@@ -75,4 +80,6 @@ public interface WxBusinessCircleOrderService {
*/
ResultData syncParkings(TenantEntity tenantEntity,String openId,String plate_number,String state,Date time);

void sendSyncParkingsMsg(TenantEntity tenantEntity,Long carCmdLogId);

}

+ 1
- 1
mallinkService/src/main/java/com/iformall/service/WxCUserBasicInfoService.java Dosyayı Görüntüle

@@ -169,7 +169,7 @@ public interface WxCUserBasicInfoService {

void cuserOldToNew(Long oldCuserId, Long newCuserId,TenantEntity tenantinfo);

WxCUserBasicInfo registerByPhone(TenantEntity tenantEntity, String phone, String nickName, Integer sex, String avatarUrl);
WxCUserBasicInfo registerByPhone(TenantEntity tenantEntity, String phone, String nickName,String name, Integer sex, String avatarUrl);

int addCredit(Long userId, TenantEntity tenantInfo, EnumScoreType wechatPhone);



+ 2
- 0
mallinkService/src/main/java/com/iformall/service/WxCUserService.java Dosyayı Görüntüle

@@ -136,4 +136,6 @@ public interface WxCUserService {
void delForUserIdOnly(Long id, Long userId, String tenantId);

void updateMsgCount(WxCUser user);

void updateAuthorizeStateByOpenId(WxCUser updCuser);
}

+ 4
- 1
mallinkService/src/main/java/com/iformall/service/WxCreditHistoryService.java Dosyayı Görüntüle

@@ -40,7 +40,7 @@ public interface WxCreditHistoryService {
* @param id
* @return
*/
WxCreditHistory getById(Long id,String tenantId);
WxCreditHistory getById(Long id,String finalTenantId);

/**
* 添加积分时,需要校验用户以及手机号是否存在
@@ -76,6 +76,8 @@ public interface WxCreditHistoryService {

void clearCreditByYear(WxCreditHistory wxCreditHistory);

void syncClearCredit(TenantEntity tenantInfo);

void exportData(HttpServletRequest request, HttpServletResponse response, WxCreditHistory wxCreditHistory);

ResultData getCreditSummary(WxCreditHistory wxCreditHistory);
@@ -89,4 +91,5 @@ public interface WxCreditHistoryService {
long getIncrementCreditAmount(WxCreditHistory wxCreditHistory);
PageInfo<WxCreditHistoryVo> findListMorePage(WxCreditHistory wxCreditHistory,Integer pageIndex, Integer pageSize);

}

+ 10
- 7
mallinkService/src/main/java/com/iformall/service/WxMemberCardService.java Dosyayı Görüntüle

@@ -17,6 +17,8 @@ public interface WxMemberCardService {
*/
PageInfo<WxMemberCard> listAsPage(WxMemberCard record, Integer pageIndex, Integer pageSize);

ResultData saveorupdate(WxMemberCard record);

ResultData saveorupdateByCode(WxMemberCard record);

ResultData delUserCardStatusByCode(WxMemberCard record);
@@ -26,22 +28,23 @@ public interface WxMemberCardService {
*/
ResultData syncMemberCard(TenantEntity tenantEntity,String card_id,String code);

void sendSyncMemberCardMsg(TenantEntity tenantEntity,String card_id,String code);

/**
* 同步会员卡等级
* need_inform_level 是否发送等级变更通知
*/
ResultData syncMemberCardLevel(TenantEntity tenantEntity,String card_id,String code,
ResultData syncMemberCardLevel(TenantEntity tenantEntity,String card_id,String code,String markid,
String level,Boolean need_inform_level);

void sendsyncMemberCardLevelMsg(TenantEntity tenantEntity,Long baseUserId,Long scoreHistoryId);

/**
* 更新会员卡积分
*/
ResultData syncMemberCardBonus(TenantEntity tenantEntity,String card_id,String code,
Integer bonus_value,Boolean need_inform_bonus);
ResultData syncMemberCardBonus(TenantEntity tenantEntity,String card_id,String code,String markid,
int before_bonus_value,int bonus_value,Boolean need_inform_bonus);

/**
* 同步授权快速积分
*/
ResultData syncauthorizeState(TenantEntity tenantEntity,String openid);
void sendsyncMemberCardBonusMsg(TenantEntity tenantEntity,Long baseUserId,Long creditHistoryId);

}

+ 2
- 2
mallinkService/src/main/java/com/iformall/service/impl/AliBusinessCircleOrderServiceImpl.java Dosyayı Görüntüle

@@ -149,7 +149,7 @@ public class AliBusinessCircleOrderServiceImpl implements AliBusinessCircleOrder
}

}else if(record.getCUserPhone() != null) {
WxCUserBasicInfo byPhone = wxCUserBasicInfoService.registerByPhone(record, record.getCUserPhone(), null, null, null);
WxCUserBasicInfo byPhone = wxCUserBasicInfoService.registerByPhone(record, record.getCUserPhone(), null,null, null, null);
if (byPhone != null) {
record.setCUserId(byPhone.getId());
record.setCUserNickName(byPhone.getNickName());
@@ -162,7 +162,7 @@ public class AliBusinessCircleOrderServiceImpl implements AliBusinessCircleOrder
AliPayCUser aliUser = aliPayCUserService.getByAliPayUserId(userQ);
if(aliUser != null){
// WxCUserBasicInfo infoByPhone = wxCUserBasicInfoService.findInfoByPhone(aliUser, aliUser.getPhone());
WxCUserBasicInfo infoByPhone = wxCUserBasicInfoService.registerByPhone(aliUser, aliUser.getPhone(),aliUser.getName(),null,null);
WxCUserBasicInfo infoByPhone = wxCUserBasicInfoService.registerByPhone(aliUser, aliUser.getPhone(),aliUser.getName(),null,null,null);
if(infoByPhone != null ){
record.setCUserId(infoByPhone.getId());
record.setCUserNickName(infoByPhone.getNickName());


+ 62
- 5
mallinkService/src/main/java/com/iformall/service/impl/WxBusinessCircleOrderServiceImpl.java Dosyayı Görüntüle

@@ -1,5 +1,6 @@
package com.iformall.service.impl;

import com.github.binarywang.wxpay.bean.businesscircle.MemberCardAuthorizeResult;
import com.github.binarywang.wxpay.bean.businesscircle.ParkingNotifyRequest;
import com.github.binarywang.wxpay.bean.businesscircle.PointsCommitStatusResult;
import com.github.binarywang.wxpay.exception.WxPayException;
@@ -11,9 +12,12 @@ import com.iformall.common.IdWorker;
import com.iformall.common.ResultData;
import com.iformall.domain.po.*;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.po.msg.AfterAddCreditMsg;
import com.iformall.domain.po.msg.AfterCarInOutMsg;
import com.iformall.enums.*;
import com.iformall.exception.MallinkException;
import com.iformall.mapper.WxBusinessCircleOrderMapper;
import com.iformall.mq.MqBaseProducer;
import com.iformall.service.*;
import com.iformall.utils.DateUtils;
import com.iformall.utils.MaUtil;
@@ -72,6 +76,9 @@ public class WxBusinessCircleOrderServiceImpl implements WxBusinessCircleOrderSe
@Autowired
WxPayAccountService wxPayAccountService;

@Autowired
MqBaseProducer mqBaseProducer;

@Autowired
MaUtil maUtil;

@@ -170,7 +177,7 @@ public class WxBusinessCircleOrderServiceImpl implements WxBusinessCircleOrderSe
}
}
if(record.getCUserId() == null){
WxCUserBasicInfo byPhone = wxCUserBasicInfoService.registerByPhone(record, record.getCUserPhone(),null,null,null);
WxCUserBasicInfo byPhone = wxCUserBasicInfoService.registerByPhone(record, record.getCUserPhone(),null,null,null,null);
if(byPhone != null){
record.setCUserNickName(byPhone.getNickName());
record.setCUserPhone(byPhone.getPhone());
@@ -406,12 +413,49 @@ public class WxBusinessCircleOrderServiceImpl implements WxBusinessCircleOrderSe
}

@Override
public ResultData getPointsCommitStatus(TenantEntity tenantEntity, String openId) {
public ResultData syncauthorizeState(TenantEntity tenantEntity, String openid) {
WxAppinfo cAppInfo = wxAppinfoService.getCAppInfoFromRedis(tenantEntity.getTenantId(), EnumAppPlat.WX);
if(cAppInfo == null){
return new ResultData(ErrorCode.APP_ID_NOT_FOUND);
}
WxPayAccount payAccount = wxPayAccountService.getByIdFromRedis(cAppInfo.getPayId());
if(cAppInfo == null || payAccount == null){
if(payAccount == null){
return new ResultData(ErrorCode.API_KEY_NOT_FOUND);
}
if(!EnumBusinessType.BUSINESS_3.getCode().equals(payAccount.getBusinessType())){
return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"未开通商圈或不支持此项操作");
}
try {
WxPayService wxPayService = maUtil.getWxPayService(cAppInfo, payAccount);
MemberCardAuthorizeResult authorizations = wxPayService.getBusinessCircleService().getAuthorizations(openid);
EnumBusinessCircleAuthorizeState authorizeState = EnumBusinessCircleAuthorizeState.getEnum(authorizations.getAuthorizeState());
if(!EnumBusinessCircleAuthorizeState.UNAUTHORIZED.equals(authorizeState)){
WxCUser updCuser = new WxCUser();
updCuser.updateTenantInfo(tenantEntity);
updCuser.setOpenId(authorizations.getOpenid());
updCuser.setAuthorizeState(authorizeState.getCode());
String formaStr = "yyyy-MM-dd'T'HH:mm:ss'+'mm:ss";
updCuser.setAuthorizeTime(DateUtils.stringToDate(authorizations.getAuthorizeTime(),formaStr));
updCuser.setDeauthorizeTime(DateUtils.stringToDate(authorizations.getDeauthorizeTime(),formaStr));
wxCUserService.updateAuthorizeStateByOpenId(updCuser);
}
return new ResultData(authorizeState);
} catch (WxPayException e) {
e.printStackTrace();
return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),e.getMessage());
}
}

@Override
public ResultData getPointsCommitStatus(TenantEntity tenantEntity, String openId) {
WxAppinfo cAppInfo = wxAppinfoService.getCAppInfoFromRedis(tenantEntity.getTenantId(), EnumAppPlat.WX);
if(cAppInfo == null){
return new ResultData(ErrorCode.APP_ID_NOT_FOUND);
}
WxPayAccount payAccount = wxPayAccountService.getByIdFromRedis(cAppInfo.getPayId());
if(payAccount == null){
return new ResultData(ErrorCode.API_KEY_NOT_FOUND);
}
if(!EnumBusinessType.BUSINESS_3.getCode().equals(payAccount.getBusinessType())){
return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"未开通商圈或不支持此项操作");
}
@@ -429,10 +473,13 @@ public class WxBusinessCircleOrderServiceImpl implements WxBusinessCircleOrderSe
public ResultData syncParkings(TenantEntity tenantEntity, String openId, String plate_number, String state, Date time) {

WxAppinfo cAppInfo = wxAppinfoService.getCAppInfoFromRedis(tenantEntity.getTenantId(), EnumAppPlat.WX);
WxPayAccount payAccount = wxPayAccountService.getByIdFromRedis(cAppInfo.getPayId());
if(cAppInfo == null || payAccount == null){
if(cAppInfo == null){
return new ResultData(ErrorCode.APP_ID_NOT_FOUND);
}
WxPayAccount payAccount = wxPayAccountService.getByIdFromRedis(cAppInfo.getPayId());
if(payAccount == null){
return new ResultData(ErrorCode.API_KEY_NOT_FOUND);
}
if(!EnumBusinessType.BUSINESS_3.getCode().equals(payAccount.getBusinessType())){
return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"未开通商圈或不支持此项操作");
}
@@ -454,5 +501,15 @@ public class WxBusinessCircleOrderServiceImpl implements WxBusinessCircleOrderSe
}
}

@Override
public void sendSyncParkingsMsg(TenantEntity tenantEntity, Long carCmdLogId) {
//停车出入场通知 todo
// AfterCarInOutMsg msg = new AfterCarInOutMsg();
// msg.updateTenantInfo(tenantEntity);
// msg.setMsgType(EnumMsgRecordType.AFTER_ADD_CREDIT.getCode());
// msg.setCarCmdLogId(carCmdLogId);
// mqBaseProducer.sendMessage(msg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode());
}


}

+ 3
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java Dosyayı Görüntüle

@@ -672,7 +672,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc


@Override
public WxCUserBasicInfo registerByPhone(TenantEntity tenantEntity, String phone, String nickName, Integer sex, String avatarUrl) {
public WxCUserBasicInfo registerByPhone(TenantEntity tenantEntity, String phone, String nickName,String name, Integer sex, String avatarUrl) {
if (StringUtils.isBlank(phone))
return null;

@@ -682,6 +682,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc
basicInfo.setTenantId("," + tenantEntity.getTenantId() + ",");
basicInfo.setFinalTenantId(tenantEntity.getFinalTenantId());
basicInfo.setPhone(phone);
basicInfo.setName(name);
basicInfo.setNickName(nickName);
basicInfo.setSex(sex);
basicInfo.setAvatarUrl(avatarUrl);
@@ -690,6 +691,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc
WxCUserBasicInfo wxCUserBasicInfo = new WxCUserBasicInfo();
wxCUserBasicInfo.setId(basicInfo.getId());
wxCUserBasicInfo.setFinalTenantId(basicInfo.getFinalTenantId());
wxCUserBasicInfo.setName(name);
wxCUserBasicInfo.setNickName(nickName);
wxCUserBasicInfo.setSex(sex);
wxCUserBasicInfo.setAvatarUrl(avatarUrl);


+ 5
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxCUserServiceImpl.java Dosyayı Görüntüle

@@ -346,4 +346,9 @@ public class WxCUserServiceImpl implements WxCUserService {
wxCUserMapper.updateMsgCount(user);
}

@Override
public void updateAuthorizeStateByOpenId(WxCUser updCuser) {
wxCUserMapper.updateAuthorizeStateByOpenId(updCuser);
}

}

+ 16
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxCarCmdLogServiceImpl.java Dosyayı Görüntüle

@@ -4,8 +4,10 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.iformall.domain.po.WxCarCmdLog;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.enums.EnumCarCmd;
import com.iformall.mapper.WxCarCmdLogMapper;
import com.iformall.mapper.WxMallMapper;
import com.iformall.service.WxBusinessCircleOrderService;
import com.iformall.service.WxCarCmdLogService;
import com.iformall.service.WxMallService;
import org.apache.commons.lang3.StringUtils;
@@ -31,6 +33,9 @@ public class WxCarCmdLogServiceImpl implements WxCarCmdLogService {
@Autowired
WxMallService wxMallService;

@Autowired
WxBusinessCircleOrderService wxBusinessCircleOrderService;


@Override
public PageInfo<WxCarCmdLog> listAsPage(WxCarCmdLog record, Integer pageIndex, Integer pageSize) {
@@ -49,11 +54,22 @@ public class WxCarCmdLogServiceImpl implements WxCarCmdLogService {
final IdWorker idWorker = IdWorker.get();
record.setId(idWorker.nextId());
wxCarCmdLogMapper.insert(record);
this.afterCarInOrOut(record);
} else {
wxCarCmdLogMapper.updateById(record);
}
}

private void afterCarInOrOut(WxCarCmdLog record){
if(StringUtils.isBlank(record.getPlateNumber())){
return;
}
if(EnumCarCmd.getCarIn().contains(record.getCmdType())
|| EnumCarCmd.getCarOut().contains(record.getCmdType())){
wxBusinessCircleOrderService.sendSyncParkingsMsg(record,record.getId());
}
}

@Override
public void deleteById(Long id,String tenantId) {
wxCarCmdLogMapper.deleteById(id,tenantId);


+ 23
- 5
mallinkService/src/main/java/com/iformall/service/impl/WxCreditHistoryServiceImpl.java Dosyayı Görüntüle

@@ -18,6 +18,7 @@ import com.iformall.exception.MallinkException;
import com.iformall.mapper.*;
import com.iformall.service.*;
import com.iformall.utils.CreditUtil;
import com.iformall.utils.DateUtils;
import com.iformall.utils.RedisLock;
import com.iformall.utils.UserUtil;
import lombok.extern.slf4j.Slf4j;
@@ -98,6 +99,9 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService {
@Autowired
private WxTemplateMsgService wxTemplateMsgService;

@Autowired
private WxMemberCardService wxMemberCardService;

@Override
public void clearCreditByYear() {
WxScoreRules wxScoreRules = new WxScoreRules();
@@ -121,6 +125,20 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService {

}

@Override
public void syncClearCredit(TenantEntity tenantInfo) {
WxCreditHistory creditHistoryQ = new WxCreditHistory();
creditHistoryQ.setTenantId(tenantInfo.getFinalTenantId());
creditHistoryQ.setCreditType(EnumScoreType.CLEAN_CREDIT.getCode());
String beforeYesterday = DateUtils.getTimeBefore(2, new Date());
Date date = DateUtils.stringToDate(beforeYesterday);
creditHistoryQ.setStartTime(date);
List<WxCreditHistory> list = wxCreditHistoryMapper.getIsMemberCarAndClearCredit(creditHistoryQ);
for (WxCreditHistory history:list) {
wxMemberCardService.sendsyncMemberCardBonusMsg(tenantInfo,history.getCUserId(),history.getId());
}
}

@Override
public void exportData(HttpServletRequest request, HttpServletResponse response, WxCreditHistory wxCreditHistory) {
PageInfo<WxCreditHistoryVo> wxCreditHistoryVoList = findListMorePage(wxCreditHistory,0,50000);
@@ -546,8 +564,8 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService {
// }

@Override
public WxCreditHistory getById(Long id,String tenantId) {
return wxCreditHistoryMapper.selectById(id,tenantId);
public WxCreditHistory getById(Long id,String finalTenantId) {
return wxCreditHistoryMapper.selectById(id,finalTenantId);
}

@Override
@@ -646,15 +664,15 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService {
temp.setType(EnumTemplateType.CREDIT_UPD_REMIND.getCode());
temp = wxTemplateMsgService.getByObj(temp);
if(temp.getId() != null){
List<String> openIds = wxCUserMapper.findOpenIdList(wxCUserBasicInfo.getId(),tenantId);
if(openIds != null && openIds.size() > 0){
String openId = wxCUserMapper.findOpenId(wxCUserBasicInfo.getId(),tenantId);
if(StringUtils.isNotBlank(openId)){
WxMsg msg = new WxMsg();
// msg.updateTenantInfo(record);
msg.setTenantId(tenantId);
// msg.setWay(EnumSendWay.APPINFOR.getCode());
// msg.setIsright(EnumMsgSend.MSG_SEND_IMMEDIATELY.getCode());
// msg.setStatus(EnumMsgStatus.MSG_STATUS_NOT_SEND.getCode());
msg.setPhones(String.join(",", openIds));
msg.setPhones(openId);
msg.setModelId(temp.getId());
Map<String,String> map = new HashMap<>();
map.put("character_string1",record.getCreditNum().toString());


+ 133
- 48
mallinkService/src/main/java/com/iformall/service/impl/WxMemberCardServiceImpl.java Dosyayı Görüntüle

@@ -14,8 +14,13 @@ import com.iformall.common.IdWorker;
import com.iformall.common.ResultData;
import com.iformall.domain.po.*;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.po.msg.AfterAddCreditMsg;
import com.iformall.domain.po.msg.AfterAddScoreMsg;
import com.iformall.domain.po.msg.FmInsideCLoginMsg;
import com.iformall.domain.po.msg.SyncMemberCardMsg;
import com.iformall.enums.*;
import com.iformall.mapper.WxMemberCardMapper;
import com.iformall.mq.MqBaseProducer;
import com.iformall.service.*;
import com.iformall.utils.DateUtils;
import com.iformall.utils.MaUtil;
@@ -25,6 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

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

@Service
public class WxMemberCardServiceImpl implements WxMemberCardService {
@@ -40,6 +46,12 @@ public class WxMemberCardServiceImpl implements WxMemberCardService {
@Autowired
WxPayAccountService wxPayAccountService;

@Autowired
WxCUserBasicInfoService wxCUserBasicInfoService;

@Autowired
private MqBaseProducer mqBaseProducer;

@Autowired
MaUtil maUtil;

@@ -48,6 +60,22 @@ public class WxMemberCardServiceImpl implements WxMemberCardService {
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxMemberCardMapper.findList(record));
}

@Override
public ResultData saveorupdate(WxMemberCard record) {
Date now = new Date();
if(record.getId() == null){
final IdWorker idWorker = IdWorker.get();
record.setId(idWorker.nextId());
record.setCreateDate(now);
record.setUpdateDate(now);
wxMemberCardMapper.insert(record);
}else{
record.setUpdateDate(now);
wxMemberCardMapper.updateById(record);
}
return new ResultData();
}

@Override
public ResultData saveorupdateByCode(WxMemberCard record) {
Long id = wxMemberCardMapper.getIdByCode(record);
@@ -84,10 +112,13 @@ public class WxMemberCardServiceImpl implements WxMemberCardService {
@Override
public ResultData syncMemberCard(TenantEntity tenantEntity, String card_id, String code) {
WxAppinfo cAppInfo = wxAppinfoService.getCAppInfoFromRedis(tenantEntity.getTenantId(), EnumAppPlat.WX);
WxPayAccount payAccount = wxPayAccountService.getByIdFromRedis(cAppInfo.getPayId());
if(cAppInfo == null || payAccount == null){
if(cAppInfo == null){
return new ResultData(ErrorCode.APP_ID_NOT_FOUND);
}
WxPayAccount payAccount = wxPayAccountService.getByIdFromRedis(cAppInfo.getPayId());
if(payAccount == null){
return new ResultData(ErrorCode.API_KEY_NOT_FOUND);
}
if(!EnumBusinessType.BUSINESS_3.getCode().equals(payAccount.getBusinessType())){
return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"未开通商圈或不支持此项操作");
}
@@ -95,7 +126,9 @@ public class WxMemberCardServiceImpl implements WxMemberCardService {
WxPayService wxPayService = maUtil.getWxPayService(cAppInfo, payAccount);
MemberCardResult memberCard = wxPayService.getMemberCardService().getMemberCard(card_id, code);
WxMemberCard record = new WxMemberCard();
record.updateTenantInfo(tenantEntity);
record.setTenantId(tenantEntity.getTenantId());
record.setParentTenantId(tenantEntity.getParentTenantId());
record.updateFinalTenantId(tenantEntity);
record.setCardId(card_id);
record.setCardCode(code);
record.setOpenId(memberCard.getOpenid());
@@ -109,9 +142,8 @@ public class WxMemberCardServiceImpl implements WxMemberCardService {
if(enumMemberCardStatus != null){
record.setUserCardStatus(enumMemberCardStatus.getCode());
}
if(memberCard.getUserInformation() != null){
record.setUserInformation(JSON.toJSONString(memberCard.getUserInformation()));
}
record.setUserInformation(JSON.toJSONString(memberCard.getUserInformation()));

record.setBonusValue(memberCard.getBonusValue());
if(memberCard.getServiceModules() != null){
record.setServiceModules(JSON.toJSONString(memberCard.getServiceModules()));
@@ -121,7 +153,52 @@ public class WxMemberCardServiceImpl implements WxMemberCardService {
if(memberCard.getGuide() != null){
record.setGuide(JSON.toJSONString(memberCard.getGuide()));
}
this.saveorupdateByCode(record);

MemberCardResult.UserInformation userInformation = memberCard.getUserInformation();
List<MemberCardResult.CommonField> commonFieldList = userInformation.getCommonFieldList();
String phone = null, name = null, avatarUrl = null;
Integer sex = null;
for (MemberCardResult.CommonField commonField:commonFieldList) {
/**
* 平台提供了一些通用的开卡字段供开发者选用
* USER_FORM_FLAG_MOBILE:手机号
* USER_FORM_FLAG_SEX:性别
* USER_FORM_FLAG_NAME:姓名
* USER_FORM_FLAG_BIRTHDAY:生日
* USER_FORM_FLAG_ADDRESS:地址
* USER_FORM_FLAG_EMAIL:邮箱
* USER_FORM_FLAG_CITY:城市
*/
if("USER_FORM_FLAG_MOBILE".equals(commonField.getName())){
phone = commonField.getValue();
}else if("USER_FORM_FLAG_SEX".equals(commonField.getName())){
if("男".equals(commonField.getValue())){
sex = 1;
}else if("女".equals(commonField.getValue())){
sex = 2;
}else{
sex = 0;
}
}else if("USER_FORM_FLAG_NAME".equals(commonField.getName())){
name = commonField.getValue();
}
}
WxCUserBasicInfo basicInfo = wxCUserBasicInfoService.registerByPhone(tenantEntity, phone, null,name, sex, avatarUrl);

WxMemberCard old = wxMemberCardMapper.getByCode(record);
if(old == null){
record.setUserId(basicInfo.getId());
}else{
record.setId(old.getId());
if(!basicInfo.getId().equals(old.getUserId())){
record.setUserId(basicInfo.getId());;
}
}
this.saveorupdate(record);
if(record.getUserId() != null){
this.sendsyncMemberCardBonusMsg(tenantEntity,record.getUserId(),null);
this.sendsyncMemberCardLevelMsg(tenantEntity,record.getUserId(),null);
}
return new ResultData();
} catch (WxPayException e) {
e.printStackTrace();
@@ -130,13 +207,26 @@ public class WxMemberCardServiceImpl implements WxMemberCardService {
}

@Override
public ResultData syncMemberCardLevel(TenantEntity tenantEntity, String card_id, String code,
public void sendSyncMemberCardMsg(TenantEntity tenantEntity, String card_id, String code) {
SyncMemberCardMsg msg = new SyncMemberCardMsg();
msg.updateTenantInfo(tenantEntity);
msg.setMsgType(EnumMsgRecordType.SYNC_MEMBER_CARD.getCode());
msg.setCardId(card_id);
msg.setCode(code);
mqBaseProducer.sendMessage(msg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode());
}

@Override
public ResultData syncMemberCardLevel(TenantEntity tenantEntity, String card_id, String code,String markid,
String level, Boolean need_inform_level) {
WxAppinfo cAppInfo = wxAppinfoService.getCAppInfoFromRedis(tenantEntity.getTenantId(), EnumAppPlat.WX);
WxPayAccount payAccount = wxPayAccountService.getByIdFromRedis(cAppInfo.getPayId());
if(cAppInfo == null || payAccount == null){
if(cAppInfo == null){
return new ResultData(ErrorCode.APP_ID_NOT_FOUND);
}
WxPayAccount payAccount = wxPayAccountService.getByIdFromRedis(cAppInfo.getPayId());
if(payAccount == null){
return new ResultData(ErrorCode.API_KEY_NOT_FOUND);
}
if(!EnumBusinessType.BUSINESS_3.getCode().equals(payAccount.getBusinessType())){
return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"未开通商圈或不支持此项操作");
}
@@ -144,10 +234,12 @@ public class WxMemberCardServiceImpl implements WxMemberCardService {
WxPayService wxPayService = maUtil.getWxPayService(cAppInfo, payAccount);
MemberCardUpdRequest request = new MemberCardUpdRequest();
request.setLevel(level);
request.setOutRequestNo(getOutRequestNo());
request.setOutRequestNo(markid);
request.setNeedInformLevel(need_inform_level);

wxPayService.getMemberCardService().updMemberCard(card_id,code,request);

this.sendSyncMemberCardMsg(tenantEntity,card_id,code);
return new ResultData();
} catch (WxPayException e) {
e.printStackTrace();
@@ -156,23 +248,41 @@ public class WxMemberCardServiceImpl implements WxMemberCardService {
}

@Override
public ResultData syncMemberCardBonus(TenantEntity tenantEntity, String card_id, String code,
Integer bonus_value, Boolean need_inform_bonus) {
public void sendsyncMemberCardLevelMsg(TenantEntity tenantEntity, Long baseUserId, Long scoreHistoryId) {
//todo 暂不推送等级给商圈
// AfterAddScoreMsg msg = new AfterAddScoreMsg();
// msg.updateTenantInfo(tenantEntity);
// msg.setMsgType(EnumMsgRecordType.AFTER_ADD_SCORE.getCode());
// msg.setBasicUserId(baseUserId);
// msg.setScoreHistoryId(scoreHistoryId);
// mqBaseProducer.sendMessage(msg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode());
}

@Override
public ResultData syncMemberCardBonus(TenantEntity tenantEntity, String card_id, String code,String markid,
int before_bonus_value,int bonus_value, Boolean need_inform_bonus) {
WxAppinfo cAppInfo = wxAppinfoService.getCAppInfoFromRedis(tenantEntity.getTenantId(), EnumAppPlat.WX);
WxPayAccount payAccount = wxPayAccountService.getByIdFromRedis(cAppInfo.getPayId());
if(cAppInfo == null || payAccount == null){
if(cAppInfo == null){
return new ResultData(ErrorCode.APP_ID_NOT_FOUND);
}
WxPayAccount payAccount = wxPayAccountService.getByIdFromRedis(cAppInfo.getPayId());
if(payAccount == null){
return new ResultData(ErrorCode.API_KEY_NOT_FOUND);
}
if(!EnumBusinessType.BUSINESS_3.getCode().equals(payAccount.getBusinessType())){
return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"未开通商圈或不支持此项操作");
}
try {
WxPayService wxPayService = maUtil.getWxPayService(cAppInfo, payAccount);
MemberCardRightsRequest request = new MemberCardRightsRequest();
request.setBeforeBonusValue(before_bonus_value);
request.setBonusValue(bonus_value);
request.setOutRequestNo(getOutRequestNo());
request.setAddBonusValue(bonus_value - before_bonus_value);
request.setOutRequestNo(markid);
request.setNeedInformBonus(need_inform_bonus);
wxPayService.getMemberCardService().setMemberCardRights(card_id,code,request);

this.sendSyncMemberCardMsg(tenantEntity,card_id,code);
return new ResultData();
} catch (WxPayException e) {
e.printStackTrace();
@@ -180,39 +290,14 @@ public class WxMemberCardServiceImpl implements WxMemberCardService {
}
}

private String getOutRequestNo(){
final IdWorker idWorker = IdWorker.get();
String dateStr = DateUtils.date2String(new Date(), "yyyyMMddHHmmss");
String id = Long.toString(idWorker.nextId());
return dateStr+"_"+id;
}

@Override
public ResultData syncauthorizeState(TenantEntity tenantEntity, String openid) {
WxAppinfo cAppInfo = wxAppinfoService.getCAppInfoFromRedis(tenantEntity.getTenantId(), EnumAppPlat.WX);
WxPayAccount payAccount = wxPayAccountService.getByIdFromRedis(cAppInfo.getPayId());
if(cAppInfo == null || payAccount == null){
return new ResultData(ErrorCode.APP_ID_NOT_FOUND);
}
if(!EnumBusinessType.BUSINESS_3.getCode().equals(payAccount.getBusinessType())){
return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"未开通商圈或不支持此项操作");
}
try {
WxPayService wxPayService = maUtil.getWxPayService(cAppInfo, payAccount);
MemberCardAuthorizeResult authorizations = wxPayService.getBusinessCircleService().getAuthorizations(openid);
WxMemberCard record = new WxMemberCard();
record.updateTenantInfo(tenantEntity);
record.setOpenId(authorizations.getOpenid());
record.setAuthorizeState(EnumMemberCardAuthorizeState.getEnum(authorizations.getAuthorizeState()).getCode());
String formaStr = "yyyy-MM-dd'T'HH:mm:ss'+'mm:ss";
record.setAuthorizeTime(DateUtils.stringToDate(authorizations.getAuthorizeTime(),formaStr));
record.setDeauthorizeTime(DateUtils.stringToDate(authorizations.getDeauthorizeTime(),formaStr));
wxMemberCardMapper.updateByOpenId(record);
return new ResultData(record);
} catch (WxPayException e) {
e.printStackTrace();
return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),e.getMessage());
}
public void sendsyncMemberCardBonusMsg(TenantEntity tenantEntity, Long baseUserId, Long creditHistoryId) {
AfterAddCreditMsg msg = new AfterAddCreditMsg();
msg.updateTenantInfo(tenantEntity);
msg.setMsgType(EnumMsgRecordType.AFTER_ADD_CREDIT.getCode());
msg.setBasicUserId(baseUserId);
msg.setCreditHistoryId(creditHistoryId);
mqBaseProducer.sendMessage(msg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode());
}

}

+ 3
- 3
mallinkService/src/main/java/com/iformall/service/impl/WxThirdPartyOrdersServiceImpl.java Dosyayı Görüntüle

@@ -160,7 +160,7 @@ public class WxThirdPartyOrdersServiceImpl implements WxThirdPartyOrdersService
basicInfo = wxCUserBasicInfoService.getById(userId, record.getFinalTenantId());
}
if(basicInfo == null && StringUtils.isNotBlank(record.getUserPhone())){
basicInfo = wxCUserBasicInfoService.registerByPhone(record, record.getUserPhone(),null,null,null);
basicInfo = wxCUserBasicInfoService.registerByPhone(record, record.getUserPhone(),null,null,null,null);
}

if(basicInfo != null){
@@ -377,7 +377,7 @@ public class WxThirdPartyOrdersServiceImpl implements WxThirdPartyOrdersService
basicInfo = wxCUserBasicInfoService.getById(userId, record.getFinalTenantId());
}
if(basicInfo == null){
basicInfo = wxCUserBasicInfoService.registerByPhone(record, record.getUserPhone(),null,null,null);
basicInfo = wxCUserBasicInfoService.registerByPhone(record, record.getUserPhone(),null,null,null,null);
}
if(basicInfo == null){
logger.error("--第三方积分订单--未找到用户---userId="+record.getUserNumber());
@@ -562,7 +562,7 @@ public class WxThirdPartyOrdersServiceImpl implements WxThirdPartyOrdersService
basicInfo = wxCUserBasicInfoService.getById(userId, record.getFinalTenantId());
}
if(basicInfo == null){
basicInfo = wxCUserBasicInfoService.registerByPhone(record, record.getUserPhone(),null,null,null);
basicInfo = wxCUserBasicInfoService.registerByPhone(record, record.getUserPhone(),null,null,null,null);
}
if(basicInfo == null){
logger.error("--第三方积分变动--未找到用户---userId="+record.getUserNumber());


+ 115
- 0
mallinkService/src/main/java/com/iformall/service/msg/impl/AfterAddCreditMsgServiceImpl.java Dosyayı Görüntüle

@@ -0,0 +1,115 @@
package com.iformall.service.msg.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.iformall.common.ResultData;
import com.iformall.domain.po.*;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.po.msg.AfterAddCreditMsg;
import com.iformall.domain.po.msg.AppUniformMsg;
import com.iformall.domain.po.msg.BaseMsg;
import com.iformall.enums.EnumAppPlat;
import com.iformall.enums.EnumBusinessType;
import com.iformall.enums.EnumMemberCardStatus;
import com.iformall.mapper.*;
import com.iformall.service.WxAppinfoService;
import com.iformall.service.WxCUserService;
import com.iformall.service.WxMemberCardService;
import com.iformall.service.WxPayAccountService;
import com.iformall.service.msg.MsgSendService;
import com.iformall.service.wechat.FmOpenService;
import org.apache.commons.lang3.StringUtils;
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.List;

/**
*
*/
@Service
public class AfterAddCreditMsgServiceImpl implements MsgSendService {

private final Logger logger = LoggerFactory.getLogger(this.getClass());

@Autowired
private WxAppinfoService wxAppinfoService;

@Autowired
private WxPayAccountService wxPayAccountService;

@Autowired
private WxMemberCardService wxMemberCardService;

@Autowired
private WxCUserBasicInfoMapper wxCUserBasicInfoMapper;

@Autowired
private WxCUserMapper wxCUserMapper;

@Autowired
private WxMemberCardMapper wxMemberCardMapper;

@Autowired
private WxCreditHistoryMapper wxCreditHistoryMapper;


@Override
public void send(BaseMsg baseMsg) throws Exception{
AfterAddCreditMsg afterAddCreditMsg = (AfterAddCreditMsg)baseMsg;

TenantEntity tenantEntity = new TenantEntity();
tenantEntity.setTenantId(afterAddCreditMsg.getTenantId());
tenantEntity.setParentTenantId(afterAddCreditMsg.getParentTenantId());

//微信商圈同步会员积分
WxAppinfo cAppInfo = wxAppinfoService.getCAppInfoFromRedis(tenantEntity.getTenantId(), EnumAppPlat.WX);
if(cAppInfo == null){
logger.error("未找到微信C端小程序");
return;
}
WxPayAccount payAccount = wxPayAccountService.getByIdFromRedis(cAppInfo.getPayId());
if(payAccount == null){
logger.error("未找到微信支付配置");
return;
}
if(!EnumBusinessType.BUSINESS_3.getCode().equals(payAccount.getBusinessType())){
logger.error("未找到商圈配置或商圈版本不支持");
return;
}

WxMemberCard memberCardQ = new WxMemberCard();
memberCardQ.updateFinalTenantId(tenantEntity);
memberCardQ.setUserId(afterAddCreditMsg.getBasicUserId());
memberCardQ.setUserCardStatus(EnumMemberCardStatus.EFFECTIVE.getCode());
List<WxMemberCard> memberCards = wxMemberCardMapper.findList(memberCardQ);
if(memberCards == null || memberCards.isEmpty()){
logger.error("该用户未授权商圈"+afterAddCreditMsg.getBasicUserId());
return;
}
String markid = null;
Integer before_bonus_value = 0,bonus_value = 0;

if(afterAddCreditMsg.getCreditHistoryId() == null){
WxCUserBasicInfo basicInfo = wxCUserBasicInfoMapper.selectById(afterAddCreditMsg.getBasicUserId(), tenantEntity.getFinalTenantId());
markid = basicInfo.getId().toString();
bonus_value = basicInfo.getCredit();
}else{
WxCreditHistory wxCreditHistory = wxCreditHistoryMapper.selectById(afterAddCreditMsg.getCreditHistoryId(), tenantEntity.getFinalTenantId());
markid = wxCreditHistory.getId().toString();
before_bonus_value = wxCreditHistory.getCreditAmount()-wxCreditHistory.getCreditNum();
bonus_value = wxCreditHistory.getCreditAmount();
}

for(int i = 0;i < memberCards.size();i++){
WxMemberCard memberCard = memberCards.get(i);
markid = markid + "_" + i;
ResultData resultData = wxMemberCardService.syncMemberCardBonus(tenantEntity, memberCard.getCardId(), memberCard.getCardCode(), markid,
before_bonus_value, bonus_value, null);
logger.info(tenantEntity.getTenantId()+"--"+memberCard.getUserId()+"--微信商圈同步会员积分{}"+resultData.message);
}

}
}

+ 63
- 0
mallinkService/src/main/java/com/iformall/service/msg/impl/AfterAddScoreMsgServiceImpl.java Dosyayı Görüntüle

@@ -0,0 +1,63 @@
package com.iformall.service.msg.impl;

import com.iformall.domain.po.WxAppinfo;
import com.iformall.domain.po.WxPayAccount;
import com.iformall.domain.po.WxTemplateMsg;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.po.msg.AfterAddCreditMsg;
import com.iformall.domain.po.msg.AfterAddScoreMsg;
import com.iformall.domain.po.msg.BaseMsg;
import com.iformall.enums.EnumAppPlat;
import com.iformall.enums.EnumBusinessType;
import com.iformall.mapper.WxAppinfoMapper;
import com.iformall.service.WxAppinfoService;
import com.iformall.service.WxPayAccountService;
import com.iformall.service.msg.MsgSendService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
*
*/
@Service
public class AfterAddScoreMsgServiceImpl implements MsgSendService {

private final Logger logger = LoggerFactory.getLogger(this.getClass());

@Autowired
private WxAppinfoService wxAppinfoService;

@Autowired
private WxPayAccountService wxPayAccountService;


@Override
public void send(BaseMsg baseMsg) throws Exception{
AfterAddScoreMsg afterAddScoreMsg = (AfterAddScoreMsg)baseMsg;

TenantEntity tenantEntity = new TenantEntity();
tenantEntity.setTenantId(afterAddScoreMsg.getTenantId());
tenantEntity.setParentTenantId(afterAddScoreMsg.getParentTenantId());

//微信商圈同步会员等级 todo
WxAppinfo cAppInfo = wxAppinfoService.getCAppInfoFromRedis(tenantEntity.getTenantId(), EnumAppPlat.WX);
if(cAppInfo == null){
logger.error("未找到微信C端小程序");
return;
}
WxPayAccount payAccount = wxPayAccountService.getByIdFromRedis(cAppInfo.getPayId());
if(payAccount == null){
logger.error("未找到微信支付配置");
return;
}
if(!EnumBusinessType.BUSINESS_3.getCode().equals(payAccount.getBusinessType())){
logger.error("未找到商圈配置或商圈版本不支持");
return;
}


}
}

+ 110
- 0
mallinkService/src/main/java/com/iformall/service/msg/impl/AfterCarInOutMsgServiceImpl.java Dosyayı Görüntüle

@@ -0,0 +1,110 @@
package com.iformall.service.msg.impl;

import com.iformall.common.ResultData;
import com.iformall.domain.po.*;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.po.msg.AfterAddScoreMsg;
import com.iformall.domain.po.msg.AfterCarInOutMsg;
import com.iformall.domain.po.msg.BaseMsg;
import com.iformall.enums.EnumAppPlat;
import com.iformall.enums.EnumBusinessType;
import com.iformall.enums.EnumCarCmd;
import com.iformall.mapper.WxAppinfoMapper;
import com.iformall.mapper.WxCUserMapper;
import com.iformall.mapper.WxCarCmdLogMapper;
import com.iformall.pay.WxPayConstant;
import com.iformall.service.*;
import com.iformall.service.msg.MsgSendService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
*
*/
@Service
public class AfterCarInOutMsgServiceImpl implements MsgSendService {

private final Logger logger = LoggerFactory.getLogger(this.getClass());

@Autowired
private WxAppinfoService wxAppinfoService;

@Autowired
private WxPayAccountService wxPayAccountService;

@Autowired
private WxBusinessCircleOrderService wxBusinessCircleOrderService;

@Autowired
private WxCUserCarService wxCUserCarService;

@Autowired
private WxCUserMapper wxCUserMapper;

@Autowired
private WxCarCmdLogMapper wxCarCmdLogMapper;


@Override
public void send(BaseMsg baseMsg) throws Exception{
AfterCarInOutMsg afterCarInOutMsg = (AfterCarInOutMsg)baseMsg;

TenantEntity tenantEntity = new TenantEntity();
tenantEntity.setTenantId(afterCarInOutMsg.getTenantId());
tenantEntity.setParentTenantId(afterCarInOutMsg.getParentTenantId());

//微信商圈同步停车状态
WxAppinfo cAppInfo = wxAppinfoService.getCAppInfoFromRedis(tenantEntity.getTenantId(), EnumAppPlat.WX);
if(cAppInfo == null){
logger.error("未找到微信C端小程序");
return;
}
WxPayAccount payAccount = wxPayAccountService.getByIdFromRedis(cAppInfo.getPayId());
if(payAccount == null){
logger.error("未找到微信支付配置");
return;
}
if(!EnumBusinessType.BUSINESS_3.getCode().equals(payAccount.getBusinessType())){
logger.error("未找到商圈配置或商圈版本不支持");
return;
}

WxCarCmdLog wxCarCmdLog = wxCarCmdLogMapper.selectById(afterCarInOutMsg.getCarCmdLogId(), tenantEntity.getTenantId());
if(wxCarCmdLog == null || StringUtils.isBlank(wxCarCmdLog.getPlateNumber())){
logger.error("未找到停车记录");
return;
}

String state = null;
if(EnumCarCmd.getCarIn().contains(wxCarCmdLog.getCmdType())){
state = WxPayConstant.CAR_IN;
}else if(EnumCarCmd.getCarOut().contains(wxCarCmdLog.getCmdType())){
state = WxPayConstant.CAR_OUT;
}else{
logger.error("不是出入场记录"+wxCarCmdLog.getId());
return;
}

String plateNumber = wxCarCmdLog.getPlateNumber();
WxCUserCar userCarQ = new WxCUserCar();
userCarQ.updateTenantInfo(tenantEntity);
userCarQ.setCarNumber(plateNumber);
WxCUserCar userCar = wxCUserCarService.getOnlyOne(userCarQ);
if(userCar == null){
logger.error("车牌未找到用户{}"+plateNumber);
return;
}
String openId = wxCUserMapper.findOpenId(userCar.getCUserId(), tenantEntity.getTenantId());
if(StringUtils.isBlank(openId)){
logger.error("车牌未找到用户{}"+plateNumber);
return;
}
ResultData resultData = wxBusinessCircleOrderService.syncParkings(tenantEntity, openId, plateNumber, state, wxCarCmdLog.getCreateDate());

logger.info(tenantEntity.getTenantId()+"--"+plateNumber+"--微信商圈同步停车记录{}"+resultData.message);

}
}

+ 0
- 2
mallinkService/src/main/java/com/iformall/service/msg/impl/FmInsideCLoginMsgServiceImpl.java Dosyayı Görüntüle

@@ -33,8 +33,6 @@ public class FmInsideCLoginMsgServiceImpl implements MsgSendService {
@Autowired
private CUserServiceFactory cuserFactory;

private BasicCUserService basicCUserService;

@Autowired
private WxCUserFromService wxCUserFromService;



+ 38
- 0
mallinkService/src/main/java/com/iformall/service/msg/impl/SyncMemberCardMsgServiceImpl.java Dosyayı Görüntüle

@@ -0,0 +1,38 @@
package com.iformall.service.msg.impl;

import com.iformall.common.ResultData;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.po.msg.BaseMsg;
import com.iformall.domain.po.msg.SyncMemberCardMsg;
import com.iformall.service.WxMemberCardService;
import com.iformall.service.msg.MsgSendService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
*
*/
@Service
public class SyncMemberCardMsgServiceImpl implements MsgSendService {

private final Logger logger = LoggerFactory.getLogger(this.getClass());

@Autowired
private WxMemberCardService wxMemberCardService;


@Override
public void send(BaseMsg baseMsg) throws Exception{
SyncMemberCardMsg syncMemberCardMsg = (SyncMemberCardMsg)baseMsg;

TenantEntity tenantEntity = new TenantEntity();
tenantEntity.setTenantId(syncMemberCardMsg.getTenantId());
tenantEntity.setParentTenantId(syncMemberCardMsg.getParentTenantId());

ResultData resultData = wxMemberCardService.syncMemberCard(tenantEntity, syncMemberCardMsg.getCardId(), syncMemberCardMsg.getCode());
logger.info(tenantEntity.getTenantId()+"--"+syncMemberCardMsg.getCode()+"--微信商圈同步会员卡{}"+resultData.message);

}
}

+ 23
- 1
mallinkService/src/main/resources/mapper/WxCUserMapper.xml Dosyayı Görüntüle

@@ -48,6 +48,9 @@
<result column="credit" jdbcType="INTEGER" property="credit"/>
<result column="active_time" jdbcType="TIMESTAMP" property="activeTime"/>
<result column="qr_code" jdbcType="VARCHAR" property="qrCode"/>
<result column="authorize_state" jdbcType="INTEGER" property="authorizeState"/>
<result column="authorize_time" jdbcType="TIMESTAMP" property="authorizeTime"/>
<result column="deauthorize_time" jdbcType="TIMESTAMP" property="deauthorizeTime"/>
</resultMap>

<sql id="allColumns">
@@ -58,7 +61,8 @@
`login_count`, `extra_info`, `is_subscribe`,
`open_app_id`,
`mp_open_id`,`mp_app_id`,`mp_subscribe`,`mp_subscribe_time`,`mp_subscribe_scene`,
`subs_open_id`,`subs_app_id`,`subs_subscribe`,`subs_subscribe_time`,`subs_subscribe_scene`,`credit`,`active_time`,`qr_code`
`subs_open_id`,`subs_app_id`,`subs_subscribe`,`subs_subscribe_time`,`subs_subscribe_scene`,`credit`,`active_time`,`qr_code`,
`authorize_state`,`authorize_time`, `deauthorize_time`
</sql>

<sql id="dynamicWhereConditions">
@@ -215,6 +219,10 @@
and `credit` = #{credit}
</if>

<if test=" null != authorizeState ">
and `authorize_state` = #{authorizeState}
</if>

<if test=" null != ids ">
and id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
@@ -445,4 +453,18 @@
<select id="findOpenIdList" parameterType="hashmap" resultType="String" >
select open_id from wx_c_user where user_id=#{userId} and tenant_id = #{tenantId}
</select>

<update id="updateAuthorizeStateByOpenId" parameterType="com.iformall.domain.po.WxCUser">
update wx_c_user
set `authorize_state` = #{authorizeState}
<if test=" null != authorizeTime">
,`authorize_time` = #{authorizeTime}
</if>
<if test=" null != deauthorizeTime">
,`deauthorize_time` = #{deauthorizeTime}
</if>
WHERE `tenant_id` = #{tenantId}
and `open_id` = #{openId}
and `authorize_state` != #{authorizeState}
</update>
</mapper>

+ 10
- 0
mallinkService/src/main/resources/mapper/WxCreditHistoryMapper.xml Dosyayı Görüntüle

@@ -216,6 +216,16 @@
{call user_credit_clear(#{cutOffDate},#{finalTableIndex})}
</update>

<select id="getIsMemberCarAndClearCredit" parameterType="com.iformall.domain.po.WxCreditHistory" resultMap="BaseResultMap">
select <include refid="allColumns" />
from wx_credit_history
where `tenant_id` = #{tenantId}
and `credit_type` = #{creditType}
and create_date &gt;= #{startTime}
and `c_user_id` in
(select user_id from wx_member_card where `final_tenant_id` = #{finalTenantId} )
</select>

<select id="merchantCreditAdd" parameterType="com.iformall.domain.po.WxCreditHistory" resultType="com.iformall.domain.vo.MerchantCreditRankingVo">
select credit.merchant_id merchantId,sum(credit.credit_num) sumAddCredit
from wx_credit_history credit


+ 17
- 21
mallinkService/src/main/resources/mapper/WxMemberCardMapper.xml Dosyayı Görüntüle

@@ -5,6 +5,7 @@
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
<result column="final_tenant_id" jdbcType="VARCHAR" property="finalTenantId"/>
<result column="card_id" jdbcType="VARCHAR" property="cardId"/>
<result column="card_code" jdbcType="VARCHAR" property="cardCode"/>
<result column="activate_scene" jdbcType="INTEGER" property="activateScene"/>
@@ -26,21 +27,18 @@
<result column="guide" jdbcType="VARCHAR" property="guide"/>
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
<result column="app_id" jdbcType="VARCHAR" property="appId"/>
<result column="authorize_state" jdbcType="INTEGER" property="authorizeState"/>
<result column="authorize_time" jdbcType="TIMESTAMP" property="authorizeTime"/>
<result column="deauthorize_time" jdbcType="TIMESTAMP" property="deauthorizeTime"/>
<result column="user_id" jdbcType="BIGINT" property="userId"/>
</resultMap>

<sql id="allColumns">
`id`,`tenant_id`,`parent_tenant_id`,`card_id`,`card_code`,`activate_scene`,`outer_str`,`open_id`,`union_id`,
`membership_number`,`level`,`nickname`,`head_image_url`,`background_picture_url`,`balance`,
`user_card_status`,`user_information`,`bonus_value`,`service_modules`,`member_price_word`,`fapiao_jump_word`,
`guide`,`update_date`,`create_date`,`app_id`,`authorize_state`,`authorize_time`, `deauthorize_time`
`guide`,`update_date`,`create_date`,`user_id`
</sql>

<sql id="dynamicWhereConditions">
where 1 = 1
where `final_tenant_id` = #{finalTenantId}

<if test=" null != id ">
and `id` = #{id}
@@ -85,12 +83,8 @@
and `user_card_status` = #{userCardStatus}
</if>

<if test=" null != appId and '' != appId">
and `app_id` = #{appId}
</if>

<if test=" null != authorizeState ">
and `authorize_state` = #{authorizeState}
<if test=" null != userId ">
and `user_id` = #{userId}
</if>

<if test=" null != ids ">
@@ -109,25 +103,27 @@
<include refid="dynamicWhereConditions"/>
</select>

<select id="getByCode" parameterType="com.iformall.domain.po.WxMemberCard" resultMap="BaseResultMap">
select
<include refid="allColumns"/>
from wx_member_card
where `final_tenant_id` = #{finalTenantId}
and `card_id` = #{cardId}
and `card_code` = #{cardCode}
</select>

<select id="getIdByCode" parameterType="com.iformall.domain.po.WxMemberCard" resultType="Long">
select id from wx_member_card
where `tenant_id` = #{tenantId}
where `final_tenant_id` = #{finalTenantId}
and `card_id` = #{cardId}
and `card_code` = #{cardCode}
</select>

<update id="deleteByCode" parameterType="com.iformall.domain.po.WxMemberCard">
update wx_member_card set `user_card_status` = #{userCardStatus},`update_date` = #{updateDate}
WHERE `tenant_id` = #{tenantId}
WHERE `final_tenant_id` = #{finalTenantId}
and `card_id` = #{cardId}
and `card_code` = #{cardCode}
and `open_id` = #{openId}
</update>

<update id="updateByOpenId" parameterType="com.iformall.domain.po.WxMemberCard">
update wx_member_card set `authorize_state` = #{authorizeState},`authorize_time` = #{authorizeTime},`deauthorize_time` = #{deauthorizeTime}
WHERE `tenant_id` = #{tenantId}
and `open_id` = #{openId}
</update>

</mapper>

Yükleniyor…
İptal
Kaydet