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

Merge branch 'aliyun_real_xhxu' of https://git.youlane.cn/server/formallProject into aliyun_real_xhxu

release_toaliyun_real
xiaohanzi 5 лет назад
Родитель
Сommit
1f79f60f9a
63 измененных файлов: 1172 добавлений и 197 удалений
  1. +537
    -2
      mallinkAdmin/src/main/java/com/iformall/controller/basic/WxProjectConfigController.java
  2. +2
    -2
      mallinkAdmin/src/main/java/com/iformall/controller/sys/MallRoleController.java
  3. +1
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/sys/MallUserInfoController.java
  4. +1
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/sys/SysMenuController.java
  5. +7
    -0
      mallinkAdmin/src/main/resources/db/migration/V202007131031__GROUP__ADD_001.sql
  6. +3
    -0
      mallinkBApi/src/main/java/com/iformall/interceptor/AuthorizationInterceptor.java
  7. +2
    -2
      mallinkService/src/main/java/com/iformall/domain/po/WxUserVisit.java
  8. +1
    -5
      mallinkService/src/main/java/com/iformall/mapper/WxMallFloorMapper.java
  9. +2
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxMallMapper.java
  10. +2
    -5
      mallinkService/src/main/java/com/iformall/mapper/WxPayAccountBillMapper.java
  11. +2
    -5
      mallinkService/src/main/java/com/iformall/mapper/WxPayAccountMapper.java
  12. +4
    -0
      mallinkService/src/main/java/com/iformall/service/WxCouponSendConfigService.java
  13. +20
    -0
      mallinkService/src/main/java/com/iformall/service/WxFlowConfigService.java
  14. +1
    -0
      mallinkService/src/main/java/com/iformall/service/WxMallFloorService.java
  15. +1
    -0
      mallinkService/src/main/java/com/iformall/service/WxMallService.java
  16. +5
    -1
      mallinkService/src/main/java/com/iformall/service/WxMsgValidationcodeModelService.java
  17. +2
    -7
      mallinkService/src/main/java/com/iformall/service/WxPayAccountBillService.java
  18. +2
    -7
      mallinkService/src/main/java/com/iformall/service/WxPayAccountService.java
  19. +30
    -0
      mallinkService/src/main/java/com/iformall/service/WxProjectConfigService.java
  20. +2
    -2
      mallinkService/src/main/java/com/iformall/service/WxQuestionService.java
  21. +4
    -0
      mallinkService/src/main/java/com/iformall/service/WxTemplateMsgService.java
  22. +20
    -0
      mallinkService/src/main/java/com/iformall/service/WxWiWideInfoService.java
  23. +6
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponSendConfigServiceImpl.java
  24. +29
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxFlowConfigServiceImpl.java
  25. +7
    -5
      mallinkService/src/main/java/com/iformall/service/impl/WxMallFloorServiceImpl.java
  26. +15
    -10
      mallinkService/src/main/java/com/iformall/service/impl/WxMallServiceImpl.java
  27. +25
    -20
      mallinkService/src/main/java/com/iformall/service/impl/WxMsgValidationcodeModelServiceImpl.java
  28. +7
    -8
      mallinkService/src/main/java/com/iformall/service/impl/WxPayAccountBillServiceImpl.java
  29. +7
    -8
      mallinkService/src/main/java/com/iformall/service/impl/WxPayAccountServiceImpl.java
  30. +127
    -13
      mallinkService/src/main/java/com/iformall/service/impl/WxProjectConfigServiceImpl.java
  31. +11
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxQuestionServiceImpl.java
  32. +6
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxTemplateMsgServiceImpl.java
  33. +40
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxWiWideInfoServiceImpl.java
  34. +4
    -1
      mallinkService/src/main/resources/mapper/KwMerchantMeterMapper.xml
  35. +12
    -3
      mallinkService/src/main/resources/mapper/KwMeterDataMapper.xml
  36. +20
    -8
      mallinkService/src/main/resources/mapper/MallUserInfoMapper.xml
  37. +4
    -1
      mallinkService/src/main/resources/mapper/WxActivityJoinMapper.xml
  38. +2
    -2
      mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml
  39. +2
    -2
      mallinkService/src/main/resources/mapper/WxBillRentMapper.xml
  40. +6
    -1
      mallinkService/src/main/resources/mapper/WxBillSettleBillMapper.xml
  41. +5
    -6
      mallinkService/src/main/resources/mapper/WxBuserMapper.xml
  42. +9
    -3
      mallinkService/src/main/resources/mapper/WxCUserFromBMapper.xml
  43. +17
    -8
      mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml
  44. +14
    -5
      mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml
  45. +5
    -2
      mallinkService/src/main/resources/mapper/WxCouponSendMapper.xml
  46. +4
    -1
      mallinkService/src/main/resources/mapper/WxCreditHistoryMapper.xml
  47. +1
    -14
      mallinkService/src/main/resources/mapper/WxDataRuleTargetMapper.xml
  48. +5
    -3
      mallinkService/src/main/resources/mapper/WxGameActionLogMapper.xml
  49. +5
    -0
      mallinkService/src/main/resources/mapper/WxMallFloorMapper.xml
  50. +9
    -0
      mallinkService/src/main/resources/mapper/WxMallMapper.xml
  51. +4
    -1
      mallinkService/src/main/resources/mapper/WxMerchantMapper.xml
  52. +4
    -1
      mallinkService/src/main/resources/mapper/WxMerchantSubsidyMapper.xml
  53. +8
    -6
      mallinkService/src/main/resources/mapper/WxMsgCallbackMapper.xml
  54. +13
    -3
      mallinkService/src/main/resources/mapper/WxMsgLimitMapper.xml
  55. +5
    -2
      mallinkService/src/main/resources/mapper/WxMsgModelMapper.xml
  56. +8
    -2
      mallinkService/src/main/resources/mapper/WxOrderMapper.xml
  57. +6
    -3
      mallinkService/src/main/resources/mapper/WxOrderPressMapper.xml
  58. +8
    -2
      mallinkService/src/main/resources/mapper/WxPayAccountBillMapper.xml
  59. +14
    -3
      mallinkService/src/main/resources/mapper/WxPayAccountMapper.xml
  60. +6
    -1
      mallinkService/src/main/resources/mapper/WxPayOrderMapper.xml
  61. +7
    -1
      mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml
  62. +6
    -0
      mallinkService/src/main/resources/mapper/WxShopMapper.xml
  63. +28
    -7
      mallinkService/src/main/resources/mapper/WxUserVisitMapper.xml

+ 537
- 2
mallinkAdmin/src/main/java/com/iformall/controller/basic/WxProjectConfigController.java Просмотреть файл

@@ -1,23 +1,87 @@
package com.iformall.controller.basic;

import com.github.pagehelper.PageInfo;
import com.iformall.annotation.SystemControllerLog;
import com.iformall.common.ErrorCode;
import com.iformall.common.ResultData;
import com.iformall.controller.base.BaseController;
import com.iformall.service.WxProjectConfigService;
import com.iformall.domain.po.*;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.vo.WxWeappInfo;
import com.iformall.enums.EnumGroupSupport;
import com.iformall.enums.EnumUserAdmin;
import com.iformall.service.*;
import com.iformall.shiro.PasswordHelper;
import com.iformall.sms.EnumSMSChannel;
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.util.Assert;
import org.springframework.web.bind.annotation.*;

import java.util.*;

@RestController
@RequestMapping("wxProjectConfig")
public class WxProjectConfigController extends BaseController {
private final Logger logger = LoggerFactory.getLogger(this.getClass());

@Autowired
private WxProjectConfigService wxProjectConfigService;
WxProjectConfigService wxProjectConfigService;

@Autowired
WxCouponSendConfigService wxCouponSendConfigService;

@Autowired
WxMallService wxMallService;

@Autowired
WxPayAccountService wxPayAccountService;

@Autowired
WxPayAccountBillService wxPayAccountBillService;

@Autowired
MallUserInfoService userInfoService;

@Autowired
WxAppinfoService wxAppinfoService;

@Autowired
WxMsgConfigService wxMsgConfigService;

@Autowired
WxParkService wxParkService;

@Autowired
WxWiWideInfoService wxWiWideInfoService;

@Autowired
WxAuthorizerInfoService wxAuthorizerInfoService;

@Autowired
WxScoreRulesService wxScoreRulesService;

@Autowired
WxTemplateMsgService wxTemplateMsgService;

@Autowired
WxQuestionService wxQuestionService;

@Autowired
WxMsgValidationcodeModelService wxMsgValidationcodeModelService;

@Autowired
WxFlowConfigService wxFlowConfigService;

@Autowired
WxMallBuildingService wxMallBuildingService;

@Autowired
MallUserInfoService mallUserInfoService;


@ApiOperation("添加商场基础数据")
@GetMapping(value = "/init/{id}")
@@ -35,4 +99,475 @@ public class WxProjectConfigController extends BaseController {
}


@ApiOperation("查询商场集团列表")
@GetMapping(value = "/mallList")
@SystemControllerLog(description = "商场基础数据")
public ResultData getMallList(@ModelAttribute WxMall wxMall, Integer pageNum, Integer pageSize) {
logger.debug("[" + getIpAddr() + "] WxProjectConfigController::getMallList");
try {
if(wxMall == null){
wxMall = new WxMall();
}
PageInfo<WxMall> page = wxMallService.listAsPage(wxMall, pageNum, pageSize);
return new ResultData(page);
}catch (Exception e){
logger.error(e.getMessage(),e);
return new ResultData(ErrorCode.SYS_SERVER_ERROR);
}

}

@ApiOperation("添加修改商场集团")
@PostMapping("/init/mall")
@SystemControllerLog(description = "商场集团-更新")
public ResultData initMall(@RequestBody WxMall wxMall) {
logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initMall");
try {
//集团版
if(wxMall.getSaleType().equals(100)){
wxMall.setGroupSupport(EnumGroupSupport.SUPPORT.getCode());
}else{
wxMall.setGroupSupport(EnumGroupSupport.SUPPORT.getCode());
}
if(StringUtils.isBlank(wxMall.getBusinessHours())){
wxMall.setBusinessHours("[]");
}
if(StringUtils.isBlank(wxMall.getIntroduction())){
wxMall.setIntroduction("");
}
if(StringUtils.isBlank(wxMall.getImg())){
wxMall.setImg("");
}
wxProjectConfigService.initMall(wxMall);

return new ResultData();
}catch (Exception e){
logger.error(e.getMessage(),e);
return new ResultData(ErrorCode.SYS_SERVER_ERROR);
}
}

@ApiOperation("添加修改商场楼座信息")
@PostMapping("/init/building")
@SystemControllerLog(description = "商场楼座-更新")
public ResultData initBuilding(@RequestBody List<WxMallBuilding> wxMallBuildings) {
logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initBuilding");
try {
if(wxMallBuildings == null || wxMallBuildings.size() == 0){
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
}
for (WxMallBuilding wxMallBuilding:wxMallBuildings) {
if(StringUtils.isBlank(wxMallBuilding.getTenantId())){
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
}
}
wxProjectConfigService.initBuilding(wxMallBuildings);

return new ResultData();
}catch (Exception e){
logger.error(e.getMessage(),e);
return new ResultData(ErrorCode.SYS_SERVER_ERROR);
}
}

@ApiOperation("添加修改特殊商户号信息")
@PostMapping("/init/payAccount")
@SystemControllerLog(description = "特殊商户号-更新")
public ResultData initPayAccount(@RequestBody WxPayAccount wxPayAccount) {
logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initPayAccount");
try {
if(StringUtils.isBlank(wxPayAccount.getTenantId())){
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
}
WxPayAccount getByTenantId = wxPayAccountService.getByTenantId(wxPayAccount.getTenantId());
if(wxPayAccount.getId() != null && (getByTenantId == null || !getByTenantId.getId().equals(wxPayAccount.getId()))){
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR);
}
if(wxPayAccount.getId() == null && getByTenantId != null){
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR);
}

if(StringUtils.isBlank(wxPayAccount.getNotifyUrl())){
wxPayAccount.setNotifyUrl("https://admin.malls.iformall.com/wxPay/notify");
}
if(StringUtils.isBlank(wxPayAccount.getCertPath())){
wxPayAccount.setCertPath("/opt/iformall/service/apiclient_cert.p12");
}
if(wxPayAccount.getType() == null){
wxPayAccount.setType(1);//0:普通商户模式, 1:服务商模式(默认服务商模式)
}
if(wxPayAccount.getShare() == null){
wxPayAccount.setShare(0);//0: 未分账,1:分账(默认不分账)
}

wxProjectConfigService.initPayAccount(wxPayAccount);

return new ResultData();
}catch (Exception e){
logger.error(e.getMessage(),e);
return new ResultData(ErrorCode.SYS_SERVER_ERROR);
}
}

@ApiOperation("添加修改小程序信息")
@PostMapping("/init/appinfo")
@SystemControllerLog(description = "小程序信息-更新")
public ResultData initAppinfo(@RequestBody WxAppinfo wxAppinfo) {
logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initAppinfo");
try {
if(StringUtils.isBlank(wxAppinfo.getTenantId())){
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
}
if(wxAppinfo.getId() == null){
WxPayAccount byTenantId = wxPayAccountService.getByTenantId(wxAppinfo.getTenantId());
if(byTenantId != null){
wxAppinfo.setPayId(byTenantId.getId());
}
WxPayAccountBill billByTenantId = wxPayAccountBillService.getByTenantId(wxAppinfo.getTenantId());
if(billByTenantId != null){
wxAppinfo.setPayBillId(billByTenantId.getId());
}
}

wxAppinfoService.saveOrUpdate(wxAppinfo);

return new ResultData();
}catch (Exception e){
logger.error(e.getMessage(),e);
return new ResultData(ErrorCode.SYS_SERVER_ERROR);
}
}

/**
* 这里添加多个用户会生成多套角色
*/
@ApiOperation("添加修改商场后台管理帐号")
@PostMapping("/init/userInfo")
@SystemControllerLog(description = "商场后台管理帐号-更新")
public ResultData initUserInfo(@RequestBody MallUserInfo userInfo) {
logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initUserInfo");
try {
if(StringUtils.isBlank(userInfo.getTenantId())){
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
}
if(StringUtils.isBlank(userInfo.getUsername())){
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
}
if(StringUtils.isBlank(userInfo.getPhone())){
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
}
boolean bChangedPhone = false;
if(userInfo.getId() == null){
if(userInfoService.cntByUserName(userInfo.getUsername()) > 0){
return new ResultData(ErrorCode.USER_NAME_IS_FOUND.getCode(),"用户名已存在");
}
if(userInfoService.cntByUserPhone(userInfo.getPhone()) > 0){
return new ResultData(ErrorCode.USER_PHONE_IS_FOUND.getCode(),"手机号已存在");
}
Assert.notNull(userInfo.getPassword(), "密码不能为空");
PasswordHelper passwordHelper = new PasswordHelper();
passwordHelper.encryptPassword(userInfo);
userInfo.setIsAdmin(EnumUserAdmin.ADMIN.getCode());

wxProjectConfigService.initUserInfo(userInfo);
}else{
MallUserInfo oldUser = userInfoService.getById(userInfo.getId());
if (!oldUser.getUsername().equals(userInfo.getUsername())) {
if(userInfoService.cntByUserName(userInfo.getUsername()) > 0){
return new ResultData(ErrorCode.USER_NAME_IS_FOUND.getCode(),"用户名已存在");
}
}
if (!oldUser.getPhone().equals(userInfo.getPhone())) {
if(userInfoService.cntByUserPhone(userInfo.getPhone()) > 0){
return new ResultData(ErrorCode.USER_PHONE_IS_FOUND.getCode(),"手机号已存在");
}
bChangedPhone = true;
}
if (StringUtils.isNotBlank(userInfo.getPassword()) && userInfo.getPassword().length() > 0) {
PasswordHelper passwordHelper = new PasswordHelper();
passwordHelper.encryptPassword(userInfo);
}
userInfo.setIsAdmin(EnumUserAdmin.ADMIN.getCode());
userInfoService.saveOrUpdate(userInfo);

if(bChangedPhone) {
// 手机号修改,清除bopen_id, 清除web_open_id
userInfoService.cleanAllOpenId(userInfo);
}
}
return new ResultData();
}catch (Exception e){
logger.error(e.getMessage(),e);
return new ResultData(ErrorCode.SYS_SERVER_ERROR);
}
}

@ApiOperation("添加修改商场短信配置")
@PostMapping("/init/msgConfig")
@SystemControllerLog(description = "商场后短信配置-更新")
public ResultData initMsgConfig(@RequestBody WxMsgConfig wxMsgConfig) {
logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initMsgConfig");
try {
if(StringUtils.isBlank(wxMsgConfig.getTenantId())){
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
}
if(StringUtils.isBlank(wxMsgConfig.getAppid())){
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
}
if(wxMsgConfig.getSmsChannel() == null){
wxMsgConfig.setSmsChannel(EnumSMSChannel.WIWIDE.getCode());
}
if(wxMsgConfig.getSmsChannel() == EnumSMSChannel.WIWIDE.getCode()){
wxMsgConfig.setSecret("7305150347587283553aa8898e7dbf20");
wxMsgConfig.setPublickey("MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAvh8j/zagfxQdnSh5OIic\\r" +
"\\nMzN+MuRuWQJPjgu4Gza4+gX3j5Ln2xNDBOTjpwyuLBjh/JcBd1cGO3lAaKCwcaix\\r" +
"\\nsmhTq56wVXXUMgDiAChu4ud8FSvRc8G8tdZAirKVAIi3NW+/pYgpWBs/0wnF8hz4\\r" +
"\\n8no4pyJHl9Jc1LH3VNIMz8vqzKUPc4ack4pFUXlcNj6C+sBlaurmI4/vwLqNxBGs\\r" +
"\\n7/zyM7dv6oy3DSU/Y1qBArM1YPjfL2dNun8rmtPgJvlPwXqA7uoHPwQ2Ym3aUn59\\r" +
"\\npkS7QI6IE8uuqNkfSte8BXLd2nIqPLFxLYLDmdll7eoyRblHcHqAYSj8stK6StC7\\r" +
"\\nDNryNKEjTEwbgf9trUI0uvF1pfgTy2gpclnY69FtD/m0+FvLyorMq+nmBqYMjka5\\r" +
"\\nK0txDQJPOa7gsi//uXd/cJW2SAXY9MSO1AfMi8Xq/YKRQzN9FW5iapskXFHca7uX\\r" +
"\\ng5NhH7flr6DW+QInFlpoN6WIEAuDF1aj4O49Ikm3WxwhTqnvEkdSCfivpYQkp9Sh\\r" +
"\\n4kQ/SQdxuT7VX+Nz6k+uMx2z4cySk33bHi0KoHbA9QFGg/54Qd0+eU4qZnd4mrgh\\r" +
"\\nhH7/QQhL7Z9eF1U5UPrsHq2Vq3rEnN+tYQ26AuKeU8vzTxBrC/SxC6C/SMFt3f/Y\\r" +
"\\nnuFh1UnNJZleZwyQt+ZdGO0CAwEAAQ==");
wxMsgConfig.setBid("465565");
wxMsgConfig.setAccount("15626593768");
wxMsgConfig.setNotifyurl("https://admin.malls.iformall.com/wxMsgCallback/receivemsg/" + wxMsgConfig.getTenantId());
wxMsgConfig.setModelnotifyurl("https://admin.malls.iformall.com/wxMsgCallback/receivemodel/" + wxMsgConfig.getTenantId());
wxMsgConfig.setVerifynotifyurl("https://admin.malls.iformall.com/wxMsgCallback/receiveverifymodel/" + wxMsgConfig.getTenantId());
}
if(wxMsgConfig.getTotal() == null){
wxMsgConfig.setTotal((long) 100000);
}
wxMsgConfig.setRecharge((long) 0);
wxMsgConfig.setRemains(wxMsgConfig.getTotal());
wxMsgConfig.setReminderstatus(0);
wxMsgConfigService.saveOrUpdate(wxMsgConfig);
return new ResultData();
}catch (Exception e){
logger.error(e.getMessage(),e);
return new ResultData(ErrorCode.SYS_SERVER_ERROR);
}
}

@ApiOperation("添加修改停车场配置")
@PostMapping("/init/park")
@SystemControllerLog(description = "商场停车场配置-更新")
public ResultData initPark(@RequestBody WxPark wxPark) {
logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initPark");
try {
if(StringUtils.isBlank(wxPark.getTenantId())){
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
}
if(StringUtils.isBlank(wxPark.getAddr())){
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
}
if(wxPark.getNumber() == null){
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
}
if(StringUtils.isBlank(wxPark.getVendorParams())){
wxPark.setVendorParams("{}");
}
if(wxPark.getVendorType() == null){
wxPark.setVendorType(0);
}
if(StringUtils.isBlank(wxPark.getParkId())){
wxPark.setParkId("0");
}
if(StringUtils.isBlank(wxPark.getStopFee())){
wxPark.setStopFee("");
}
if(wxPark.getEntryExit() == null){
wxPark.setEntryExit(1);
}
wxParkService.saveOrUpdate(wxPark);
return new ResultData();
}catch (Exception e){
logger.error(e.getMessage(),e);
return new ResultData(ErrorCode.SYS_SERVER_ERROR);
}
}

@ApiOperation("添加修改迈外迪信息")
@PostMapping("/init/wiwidi")
@SystemControllerLog(description = "迈外迪信息配置-更新")
public ResultData initWiwidi(@RequestBody WxWiWideInfo wxWiWideInfo) {
logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initPark");
try {
if(StringUtils.isBlank(wxWiWideInfo.getTenantId())){
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
}
wxWiWideInfoService.saveOrUpdate(wxWiWideInfo);
return new ResultData();
}catch (Exception e){
logger.error(e.getMessage(),e);
return new ResultData(ErrorCode.SYS_SERVER_ERROR);
}
}

@ApiOperation("添加修改微信公众账号的基本信息")
@PostMapping("/init/authorizer")
@SystemControllerLog(description = "微信公众账号的基本信息-更新")
public ResultData initAuthorizer(@RequestBody WxAuthorizerInfo wxAuthorizerInfo) {
logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initAuthorizer");
try {
if(StringUtils.isBlank(wxAuthorizerInfo.getTenantId())){
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
}
if(wxAuthorizerInfo.getAuthorizationStatus() == null){
wxAuthorizerInfo.setAuthorizationStatus(0);//授权状态,0为已授权,1为已取消授权
wxAuthorizerInfo.setAuthTime(new Date());
}
if(wxAuthorizerInfo.getBaseStatus() == null){
wxAuthorizerInfo.setBaseStatus(0);//微信基础版本设置状态,0为已设置,1为设置失败
wxAuthorizerInfo.setBaseTime(new Date());
}
if(wxAuthorizerInfo.getDomainStatus() == null){
wxAuthorizerInfo.setDomainStatus(0);//服务器域名设置状态,0为已设置,1为设置失败
wxAuthorizerInfo.setDomainTime(new Date());
}
if(wxAuthorizerInfo.getWebdomainStatus() == null){
wxAuthorizerInfo.setWebdomainStatus(0);//服务器业务域名设置状态,0为已设置,1为设置失败
wxAuthorizerInfo.setWebdomainTime(new Date());
}
if(StringUtils.isNotBlank(wxAuthorizerInfo.getCurrentVersion())
&& wxAuthorizerInfo.getReleaseTime() != null){
wxAuthorizerInfo.setReleaseTime(new Date());
}
if(StringUtils.isNotBlank(wxAuthorizerInfo.getOpenAppid())
&& wxAuthorizerInfo.getBindOpenTime() != null){
wxAuthorizerInfo.setBindOpenTime(new Date());
}
if(StringUtils.isBlank(wxAuthorizerInfo.getRefreshToken())){
wxAuthorizerInfo.setRefreshToken("");
}
if(StringUtils.isBlank(wxAuthorizerInfo.getAccessToken())){
wxAuthorizerInfo.setAccessToken("");
}
wxAuthorizerInfoService.saveOrUpdate(wxAuthorizerInfo);
return new ResultData();
}catch (Exception e){
logger.error(e.getMessage(),e);
return new ResultData(ErrorCode.SYS_SERVER_ERROR);
}
}

@ApiOperation("查询商场基础数据")
@GetMapping(value = "/getinit/{id}")
@SystemControllerLog(description = "商场基础数据")
public ResultData getinit(@PathVariable Long id) {
logger.debug("[" + getIpAddr() + "] WxProjectConfigController::getinit");
try {
Map<String, Object> map = new HashMap<String, Object>();
WxMall wxMall = wxMallService.getById(id);
map.put("wxMall",wxMall);
List<WxMall> subWxMall = wxMallService.getSubByParentTenantId(wxMall.getTenantId());
map.put("subWxMall",subWxMall);
WxCouponSendConfig wxCouponSendConfig = new WxCouponSendConfig(){{
setTenantId(wxMall.getTenantId());
}};
List<WxCouponSendConfig> wxCouponSendConfigList = wxCouponSendConfigService.findList(wxCouponSendConfig);
map.put("wxCouponSendConfigList",wxCouponSendConfigList);
WxScoreRules wxScoreRules = new WxScoreRules(){{
setTenantId(wxMall.getTenantId());
}};
List<WxScoreRules> wxScoreRulesList = wxScoreRulesService.findList(wxScoreRules);
map.put("wxScoreRulesList",wxScoreRulesList);
WxTemplateMsg wxTemplateMsg = new WxTemplateMsg(){{
setTenantId(wxMall.getTenantId());
}};
List<WxTemplateMsg> wxTemplateMsgList = wxTemplateMsgService.findList(wxTemplateMsg);
map.put("wxTemplateMsgList",wxTemplateMsgList);
WxQuestion wxQuestion = new WxQuestion(){{
setTenantId(wxMall.getTenantId());
}};
List<WxQuestion> wxQuestionList = wxQuestionService.findList(wxQuestion);
map.put("wxQuestionList",wxQuestionList);
WxMsgValidationcodeModel wxMsgValidationcodeModel = new WxMsgValidationcodeModel(){{
setTenantId(wxMall.getTenantId());
}};
List<WxMsgValidationcodeModel> wxMsgValidationcodeModelList = wxMsgValidationcodeModelService.findList(wxMsgValidationcodeModel);
map.put("wxMsgValidationcodeModelList",wxMsgValidationcodeModelList);
WxFlowConfig wxFlowConfig = new WxFlowConfig(){{
setTenantId(wxMall.getTenantId());
}};
List<WxFlowConfig> wxFlowConfigList = wxFlowConfigService.findList(wxFlowConfig);
map.put("wxFlowConfigList",wxFlowConfigList);
TenantEntity tenantEntity = new TenantEntity() {{
setTenantId(wxMall.getTenantId());
}};
ResultData wxMallBuildingFloorList = wxMallBuildingService.getBuildingFloorList(tenantEntity);
map.put("wxMallBuildingFloorList",wxMallBuildingFloorList);
WxPayAccount wxPayAccount = wxPayAccountService.getByTenantId(wxMall.getTenantId());
map.put("wxPayAccount",wxPayAccount);
WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(wxMall.getTenantId());
map.put("wxPayAccountBill",wxPayAccountBill);
WxAppinfo wxAppinfo = new WxAppinfo() {{
setTenantId(wxMall.getTenantId());
}};
List<WxAppinfo> wxAppinfoList = wxAppinfoService.getList(wxAppinfo);
map.put("wxAppinfoList",wxAppinfoList);
MallUserInfo mallUserInfo = new MallUserInfo() {{
setTenantId(wxMall.getTenantId());
}};
List<MallUserInfo> mallUserInfoList = mallUserInfoService.findList(mallUserInfo);
map.put("mallUserInfoList",mallUserInfoList);
WxMsgConfig wxMsgConfig = new WxMsgConfig() {{
setTenantId(wxMall.getTenantId());
}};
WxMsgConfig wxMsgConfigObject = wxMsgConfigService.findObject(wxMsgConfig);
map.put("wxMsgConfig",wxMsgConfigObject);
WxPark wxPark = new WxPark(){{
setTenantId(wxMall.getTenantId());
}};
WxPark wxParkObj = wxParkService.getByObj(wxPark);
map.put("wxPark",wxParkObj);
WxWiWideInfo wxWiWideInfo = new WxWiWideInfo(){{
setTenantId(wxMall.getTenantId());
}};
WxWiWideInfo wxWiWideInfoObject = wxWiWideInfoService.findObject(wxWiWideInfo);
map.put("wxWiWideInfo",wxWiWideInfoObject);
WxWeappInfo wxWeappInfo = new WxWeappInfo(){{
setTenantId(wxMall.getTenantId());
}};
List<WxWeappInfo> wxAuthorizerInfoList = wxAuthorizerInfoService.getList(wxWeappInfo);
map.put("wxAuthorizerInfoList",wxAuthorizerInfoList);

return new ResultData(map);
}catch (Exception e){
logger.error(e.getMessage(),e);
return new ResultData(ErrorCode.SYS_SERVER_ERROR);
}
}

@ApiOperation("集团新增修改子广场")
@PostMapping("/init/submall")
@SystemControllerLog(description = "子广场-更新")
public ResultData initSubmall(@RequestBody WxMall wxMall) {
logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initSubmall");
try {
if(StringUtils.isBlank(wxMall.getTenantId())){
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
}
if(StringUtils.isBlank(wxMall.getParentTenantId())){
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
}
WxMall parentWxMall = wxMallService.getById(Long.parseLong(wxMall.getParentTenantId()));
if(parentWxMall == null || parentWxMall.getSaleType() != 100
|| !parentWxMall.equals(EnumGroupSupport.SUPPORT.getCode())
|| StringUtils.isNotBlank(parentWxMall.getParentTenantId())){
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR);
}
String[] tenantIds = wxMall.getTenantId().split(",");
wxProjectConfigService.initSubmall(wxMall.getParentTenantId(),tenantIds);

return new ResultData();
}catch (Exception e){
logger.error(e.getMessage(),e);
return new ResultData(ErrorCode.SYS_SERVER_ERROR);
}
}


}

+ 2
- 2
mallinkAdmin/src/main/java/com/iformall/controller/sys/MallRoleController.java Просмотреть файл

@@ -52,7 +52,7 @@ public class MallRoleController extends BaseController {
@SystemControllerLog(description = "用户管理-role列表")
public ResultData list(MallRole sysRole, Integer pageNum, Integer pageSize) {
logger.debug("[" + getIpAddr() + "] MallRoleController::list");
sysRole.updateTenantInfo(getTenantInfo());
sysRole.updateTenantInfo(ifParentUpdateTenantInfo());
sysRole.setSortColumns(BaseEntity.SortField.Id_DESC);
final PageInfo<MallRole> page = sysRoleService.listAsPage(sysRole, pageNum, pageSize);
for (MallRole r : page.getList()) {
@@ -84,7 +84,7 @@ public class MallRoleController extends BaseController {
MallRole role = sysRoleService.getById(sysRole.getId());
MallRolePermission p = new MallRolePermission();
p.setRoleId(role.getId());
p.updateTenantInfo(getTenantInfo());
p.updateTenantInfo(ifParentUpdateTenantInfo());
List<MallRolePermission> pers = sysRolePermissionService.getList(p);
String menus = "";
for (MallRolePermission rp : pers) {


+ 1
- 1
mallinkAdmin/src/main/java/com/iformall/controller/sys/MallUserInfoController.java Просмотреть файл

@@ -70,7 +70,7 @@ public class MallUserInfoController extends BaseController {
public ResultData listAsPage(MallUserInfo userInfo, Integer pageNum, Integer pageSize) {
logger.debug("[" + getIpAddr() + "] MallUserInfoController::listAsPage");

userInfo.updateTenantInfo(getTenantInfo());
userInfo.updateTenantInfo(ifParentUpdateTenantInfo());
userInfo.setSortColumns(BaseEntity.SortField.CreateTime_DESC,BaseEntity.SortField.Id_DESC);
final PageInfo<MallUserInfo> page = userInfoService.listAsPage(userInfo, pageNum, pageSize);
for (MallUserInfo u : page.getList()) {


+ 1
- 1
mallinkAdmin/src/main/java/com/iformall/controller/sys/SysMenuController.java Просмотреть файл

@@ -73,7 +73,7 @@ public class SysMenuController extends BaseController {
logger.debug("[" + getIpAddr() + "] MallPermissionController::list");
MallUserInfo user = getUser();
if (user.checkGroupAdmin()) {
TenantEntity tenantEntity = getTenantInfo();
TenantEntity tenantEntity = ifParentUpdateTenantInfo();
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
user.setParentTenantId(tenantEntity.getParentTenantId());
}


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

@@ -1,6 +1,13 @@
ALTER TABLE `wx_c_user_basic_info`
ADD COLUMN `parent_tenant_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID' AFTER `tenant_id`;

ALTER TABLE `wx_buser`
ADD COLUMN `parent_tenant_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID' AFTER `tenant_id`;

ALTER TABLE `wx_mall`
ADD COLUMN `live_support` SMALLINT(1) DEFAULT '0' COMMENT '是否支持直播(0-不支持,1-支持)';

ALTER TABLE `wx_user_visit`
ADD COLUMN `parent_tenant_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID' AFTER `tenant_id`;

CREATE OR REPLACE ALGORITHM = UNDEFINED DEFINER = `root`@`%` SQL SECURITY DEFINER VIEW `mallink`.`view_touch_user` AS select date_format(`u`.`day_date`,'%Y-%m-%d') AS `xTime`,`u`.`tenant_id` AS `tenant_id`,`u`.`parent_tenant_id` AS `parent_tenant_id`,`u`.`visit_pv` AS `pv`,`u`.`visit_uv` AS `uv`,ifnull(`o`.`couponCount`,0) AS `couponCount`,ifnull(`o`.`userCount`,0) AS `userCount`,ifnull(`v`.`verifyCount`,0) AS `verifyCount`,ifnull(`v`.`verifyUserCount`,0) AS `verifyUserCount` from ((`mallink`.`wx_user_visit` `u` left join (select `mallink`.`wx_coupon_order`.`tenant_id` AS `tenant_id`,date_format(`mallink`.`wx_coupon_order`.`create_date`,'%Y-%m-%d') AS `xTime`,count(distinct `mallink`.`wx_coupon_order`.`c_user_id`) AS `userCount`,count(0) AS `couponCount` from `mallink`.`wx_coupon_order` group by `xTime`,`mallink`.`wx_coupon_order`.`tenant_id`) `o` on(((date_format(`u`.`day_date`,'%Y-%m-%d') = `o`.`xTime`) and (`o`.`tenant_id` = `u`.`tenant_id`)))) left join (select `mallink`.`wx_coupon_order`.`tenant_id` AS `tenant_id`,date_format(`mallink`.`wx_coupon_order`.`update_date`,'%Y-%m-%d') AS `xTime`,count(0) AS `verifyCount`,count(distinct `mallink`.`wx_coupon_order`.`c_user_id`) AS `verifyUserCount` from `mallink`.`wx_coupon_order` where (`mallink`.`wx_coupon_order`.`coupon_order_status` = 1) group by `xTime`,`mallink`.`wx_coupon_order`.`tenant_id`) `v` on(((date_format(`u`.`day_date`,'%Y-%m-%d') = `v`.`xTime`) and (`v`.`tenant_id` = `u`.`tenant_id`))));

+ 3
- 0
mallinkBApi/src/main/java/com/iformall/interceptor/AuthorizationInterceptor.java Просмотреть файл

@@ -67,6 +67,9 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter {
//设置userId到request里,后续根据userId,获取用户信息
request.setAttribute(Constant.LOGIN_USER_KEY, wxBuser.getId());
request.setAttribute(Constant.TENANT_ID, wxBuser.getTenantId());
if (StringUtils.isNotBlank(wxBuser.getParentTenantId())) {
request.setAttribute(Constant.PARENT_TENANT_ID, wxBuser.getParentTenantId());
}

//如果是要不需要自动设置tenantI信息


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

@@ -1,7 +1,7 @@
package com.iformall.domain.po;

import com.baomidou.mybatisplus.annotation.TableName;
import com.iformall.domain.po.base.BaseTenantEntity;
import com.iformall.domain.po.base.TenantEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

@@ -10,7 +10,7 @@ import java.util.*;
@TableName(value = "wx_user_visit")
@Data
@EqualsAndHashCode(callSuper = true)
public class WxUserVisit extends BaseTenantEntity {
public class WxUserVisit extends TenantEntity {

protected Long id;



+ 1
- 5
mallinkService/src/main/java/com/iformall/mapper/WxMallFloorMapper.java Просмотреть файл

@@ -7,10 +7,6 @@ import com.iformall.domain.po.WxMallFloor;
public interface WxMallFloorMapper extends CommonMapper<WxMallFloor, String> {

List<WxMallFloor> findList(WxMallFloor wxMallFloor);

int deleteByBuildingId(Long buildingId);
}

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

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

import com.iformall.common.CommonMapper;
import com.iformall.domain.po.WxMall;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@@ -17,4 +18,5 @@ public interface WxMallMapper extends CommonMapper<WxMall, Long> {

String queryMenusByTenantInfo(WxMall wxMall);

void undateSubmall(@Param(value = "parentTenantId")String parentTenantId, @Param(value = "tenantIds")String[] tenantIds);
}

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

@@ -11,10 +11,7 @@ import java.util.List;
public interface WxPayAccountBillMapper extends CommonMapper<WxPayAccountBill, Long> {

List<WxPayAccountBill> findList(WxPayAccountBill wxPayAccount);


WxPayAccountBill getByTenantId(String tenantId);
}

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

@@ -7,10 +7,7 @@ import com.iformall.domain.po.WxPayAccount;
public interface WxPayAccountMapper extends CommonMapper<WxPayAccount, Long> {

List<WxPayAccount> findList(WxPayAccount wxPayAccount);


WxPayAccount getByTenantId(String tenantId);
}

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

@@ -3,6 +3,8 @@ package com.iformall.service;
import com.github.pagehelper.PageInfo;
import com.iformall.domain.po.WxCouponSendConfig;

import java.util.List;

public interface WxCouponSendConfigService {

/**
@@ -21,6 +23,8 @@ public interface WxCouponSendConfigService {
* @return
*/
PageInfo<WxCouponSendConfig> listAsPage(WxCouponSendConfig record, Integer pageIndex, Integer pageSize);

List<WxCouponSendConfig> findList(WxCouponSendConfig record);
/**
* 根据Id获得实体


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

@@ -0,0 +1,20 @@
package com.iformall.service;

import com.iformall.domain.po.WxFlowConfig;

import java.util.List;

/**
*
* wx_flow_config
*/
public interface WxFlowConfigService {

/**
* 查询列表
*
* @param record
*/
List<WxFlowConfig> findList(WxFlowConfig record);

}

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

@@ -42,4 +42,5 @@ public interface WxMallFloorService {

ResultData getFloorList(TenantEntity tenantEntity, Long buildingId);

void deleteByBuildingId(Long buildingId);
}

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

@@ -79,4 +79,5 @@ public interface WxMallService {
*/
List<WxMall> getSubByParentTenantId(String parentTenantId);

void undateSubmall(String parentTenantId, String[] tenantIds);
}

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

@@ -5,6 +5,8 @@ import com.iformall.common.ResultData;
import com.iformall.domain.po.WxMsgValidationcodeModel;
import com.iformall.domain.po.WxProjectConfig;

import java.util.List;

public interface WxMsgValidationcodeModelService {

/**
@@ -13,7 +15,7 @@ public interface WxMsgValidationcodeModelService {
* @param tenantId
* @return
*/
void wxMsgValidationcodeModelInit(String tenantId, WxProjectConfig wxProjectConfig);
void wxMsgValidationcodeModelInit(String tenantId, String signature,String emailBgImg);

/**
* 根据实体查询分页列表
@@ -24,6 +26,8 @@ public interface WxMsgValidationcodeModelService {
* @return
*/
PageInfo<WxMsgValidationcodeModel> listAsPage(WxMsgValidationcodeModel record, Integer pageIndex, Integer pageSize);

List<WxMsgValidationcodeModel> findList(WxMsgValidationcodeModel record);
/**
* 根据Id获得实体


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

@@ -55,12 +55,7 @@ public interface WxPayAccountBillService {
* @param id
*/
void deleteById(Long id);


WxPayAccountBill getByTenantId(String tenantId);
}

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

@@ -47,12 +47,7 @@ public interface WxPayAccountService {
* @param id
*/
void deleteById(Long id);


WxPayAccount getByTenantId(String te);
}

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

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


import com.iformall.domain.po.*;

import java.util.List;

public interface WxProjectConfigService {

/**
@@ -10,4 +14,30 @@ public interface WxProjectConfigService {
*/
void initProjectConfig(Long id);

/**
* 初始化新增修改wxmall
* @param wxMall
*/
void initMall(WxMall wxMall);

/**
* 初始化新增修改wxMallBuilding
* @param wxMallBuildings
*/
void initBuilding(List<WxMallBuilding> wxMallBuildings);

/**
* 初始化新增修改wxPayAccount
* @param wxPayAccount
*/
void initPayAccount(WxPayAccount wxPayAccount);

/**
* 初始化新增userInfo
* @param userInfo
*/
void initUserInfo(MallUserInfo userInfo);

void initSubmall(String parentTenantId, String[] tenantIds);

}

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

@@ -13,10 +13,10 @@ public interface WxQuestionService {
* wx_question 初始化
*
* @param tenantId
* @param questionJson
* @param
* @return
*/
void wxQuestionInit(String tenantId, String questionJson);
void wxQuestionInit(String tenantId);

/**
* 根据实体查询分页列表


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

@@ -3,6 +3,8 @@ package com.iformall.service;
import com.github.pagehelper.PageInfo;
import com.iformall.domain.po.WxTemplateMsg;

import java.util.List;

public interface WxTemplateMsgService {

/**
@@ -22,6 +24,8 @@ public interface WxTemplateMsgService {
* @return
*/
PageInfo<WxTemplateMsg> listAsPage(WxTemplateMsg record, Integer pageIndex, Integer pageSize);

List<WxTemplateMsg> findList(WxTemplateMsg record);
/**
* 根据Id获得实体


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

@@ -0,0 +1,20 @@
package com.iformall.service;

import com.iformall.domain.po.WxWiWideInfo;

/**
*
* 迈外迪信息
*/
public interface WxWiWideInfoService {

/**
* 保存或更新实体
*
* @param record
*/
void saveOrUpdate(WxWiWideInfo record);

WxWiWideInfo findObject(WxWiWideInfo record);

}

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

@@ -13,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

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


@Service
@@ -45,6 +46,11 @@ public class WxCouponSendConfigServiceImpl implements WxCouponSendConfigService
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponSendConfigMapper.findList(record));
}

@Override
public List<WxCouponSendConfig> findList(WxCouponSendConfig record) {
return wxCouponSendConfigMapper.findList(record);
}

@Override
public WxCouponSendConfig getById(Long id) {
return wxCouponSendConfigMapper.selectById(id);


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

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

import com.iformall.common.IdWorker;
import com.iformall.domain.po.WxFlowConfig;
import com.iformall.domain.po.WxWiWideInfo;
import com.iformall.mapper.WxFlowConfigMapper;
import com.iformall.mapper.WxWiwideInfoMapper;
import com.iformall.service.WxFlowConfigService;
import com.iformall.service.WxWiWideInfoService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WxFlowConfigServiceImpl implements WxFlowConfigService {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
WxFlowConfigMapper wxFlowConfigMapper;


@Override
public List<WxFlowConfig> findList(WxFlowConfig record) {
return wxFlowConfigMapper.findList(record);
}
}

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

@@ -58,9 +58,11 @@ public class WxMallFloorServiceImpl implements WxMallFloorService {
List<WxMallFloor> list = wxMallFloorMapper.findList(wxMallFloor);
return new ResultData(list);
}

@Override
public void deleteByBuildingId(Long buildingId) {
wxMallFloorMapper.deleteByBuildingId(buildingId);
}


}

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

@@ -109,16 +109,16 @@ public class WxMallServiceImpl implements WxMallService {

@Override
public int save(WxMall record) {
if (record.getId() == null) {
//record.setId(UUID.randomUUID().toString().replaceAll("-", ""));
final IdWorker idWorker = IdWorker.get();
Long id = idWorker.nextId();
record.setId(id);
}
if(StringUtils.isBlank(record.getTenantId())) {
record.setTenantId(String.valueOf(record.getId()));
}
// if (record.getId() == null) {
// //record.setId(UUID.randomUUID().toString().replaceAll("-", ""));
// final IdWorker idWorker = IdWorker.get();
// Long id = idWorker.nextId();
// record.setId(id);
// }
//
// if(StringUtils.isBlank(record.getTenantId())) {
// record.setTenantId(String.valueOf(record.getId()));
// }

int ret = wxMallMapper.insert(record);

@@ -294,6 +294,11 @@ public class WxMallServiceImpl implements WxMallService {
return mallList;
}

@Override
public void undateSubmall(String parentTenantId, String[] tenantIds) {
wxMallMapper.undateSubmall(parentTenantId, tenantIds);
}

private String getRedisKeyByTenantInfo(TenantEntity tenantEntity) {
StringBuilder sb = new StringBuilder();
sb.append(Constant.TENANT_KEY_PREV).append(tenantEntity.getTenantId());


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

@@ -37,48 +37,48 @@ public class WxMsgValidationcodeModelServiceImpl implements WxMsgValidationcodeM
WxMsgConfigMapper wxMsgConfigMapper;

@Override
public void wxMsgValidationcodeModelInit(String tenantId, WxProjectConfig wxProjectConfig) {
public void wxMsgValidationcodeModelInit(String tenantId, String signature, String emailBgImg) {
DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String nowTimestr = format.format(new Date());
final IdWorker idWorker = IdWorker.get();
String initSql = "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`) values " +
" ( '" + idWorker.nextId() + "', '" + tenantId + "', '2', '代办通知', '" + wxProjectConfig.getName() + "', '{userName}提交了一个合同待您审批,电脑登陆{page} 查看您的待办。', '" + nowTimestr + "', '1', '0', '226', null)," +
" ( '" + idWorker.nextId() + "', '" + tenantId + "', '3', '审批通知', '" + wxProjectConfig.getName() + "', '{userName}同意编号{contract}的合同审批,已呈送至{toUserName},登录{page}查看审批进度。', '" + nowTimestr + "', '1', '0', '227', null)," +
" ( '" + idWorker.nextId() + "', '" + tenantId + "', '4', '通过审批通知', '" + wxProjectConfig.getName() + "', '编号{contract}的合同已通过审批,请登录{page} 跟进后续工作。', '" + nowTimestr + "', '1', '0', '228', null)," +
" ( '" + idWorker.nextId() + "', '" + tenantId + "', '5', '驳回通知', '" + wxProjectConfig.getName() + "', '编号{contract}的合同审批被驳回,请登录{page} 查看审批明细。', '" + nowTimestr + "', '1', '0', '229', null)," +
" ( '" + idWorker.nextId() + "', '" + tenantId + "', '6', '验证码', '" + wxProjectConfig.getName() + "', '{s6}(动态验证码),请在1分钟内填写', '" + nowTimestr + "', '1', '1', '115', null)," +
" ( '" + idWorker.nextId() + "', '" + tenantId + "', '7', '账单待缴模板', '" + wxProjectConfig.getName() + "', '您当期的待缴账单为{price}元,截止日期为{date} ,请登录{app}小程序查看账单并交费。', '" + nowTimestr + "', '1', '0', null, null)," +
" ( '" + idWorker.nextId() + "', '" + tenantId + "', '8', '账单欠缴模板', '" + wxProjectConfig.getName() + "', '截止今日您的账单共计欠缴{price}元,请登录{app}小程序查看账单并交费。', '" + nowTimestr + "', '1', '0', null, null)," +
" ( '" + idWorker.nextId() + "', '" + tenantId + "', '9', '场景投放', '" + wxProjectConfig.getName() + "', '亲爱的vip,悄悄地送您一张{title},请到{app}微信小程序中使用吧!', '" + nowTimestr + "', '1', '0', null, null)," +
" ( '" + idWorker.nextId() + "', '" + tenantId + "', '11', '商户分账账户新增通知商户', '" + wxProjectConfig.getName() + "', '您于{time}提交了{merchant}商户的收款账户[{account}]绑定,后续销售分成及营销补贴将存入该账户', '" + nowTimestr + "', '1', '0', null, null)," +
" ( '" + idWorker.nextId() + "', '" + tenantId + "', '13', '商户分账账户变更通知商户', '" + wxProjectConfig.getName() + "', '您于{time}将{merchant}商户的收款账户变更为[{account}],后续销售分成及营销补贴将存入该账户', '" + nowTimestr + "', '1', '0', null, null)," +
" ( '" + idWorker.nextId() + "', '" + tenantId + "', '14', '商户分账账户不使用回执', '" + wxProjectConfig.getName() + "', '商管已同意[{account}]作为{merchant}商户的收款账户。后续的销售分成及营销补贴将存入此账户', '" + nowTimestr + "', '1', '0', null, null)," +
" ( '" + idWorker.nextId() + "', '" + tenantId + "', '15', '商户分账账户使用回执', '" + wxProjectConfig.getName() + "', '商管拒绝将[{account}]作为{merchant}商户的收款账户。如有疑问请联系商管', '" + nowTimestr + "', '1', '0', null, null)," +
" ( '" + idWorker.nextId() + "', '" + tenantId + "', '16', '商户分账账户删除提醒', '" + wxProjectConfig.getName() + "', '{merchant}商户的收款账户[{account}]于{time}取消绑定,营销活动与销售分成将无法正常进行,请尽快绑定新收款账户', '" + nowTimestr + "', '1', '0', null, null);" +
" ( '" + idWorker.nextId() + "', '" + tenantId + "', '2', '代办通知', '" + signature + "', '{userName}提交了一个合同待您审批,电脑登陆{page} 查看您的待办。', '" + nowTimestr + "', '1', '0', '226', null)," +
" ( '" + idWorker.nextId() + "', '" + tenantId + "', '3', '审批通知', '" + signature + "', '{userName}同意编号{contract}的合同审批,已呈送至{toUserName},登录{page}查看审批进度。', '" + nowTimestr + "', '1', '0', '227', null)," +
" ( '" + idWorker.nextId() + "', '" + tenantId + "', '4', '通过审批通知', '" + signature + "', '编号{contract}的合同已通过审批,请登录{page} 跟进后续工作。', '" + nowTimestr + "', '1', '0', '228', null)," +
" ( '" + idWorker.nextId() + "', '" + tenantId + "', '5', '驳回通知', '" + signature + "', '编号{contract}的合同审批被驳回,请登录{page} 查看审批明细。', '" + nowTimestr + "', '1', '0', '229', null)," +
" ( '" + idWorker.nextId() + "', '" + tenantId + "', '6', '验证码', '" + signature + "', '{s6}(动态验证码),请在1分钟内填写', '" + nowTimestr + "', '1', '1', '115', null)," +
" ( '" + idWorker.nextId() + "', '" + tenantId + "', '7', '账单待缴模板', '" + signature + "', '您当期的待缴账单为{price}元,截止日期为{date} ,请登录{app}小程序查看账单并交费。', '" + nowTimestr + "', '1', '0', null, null)," +
" ( '" + idWorker.nextId() + "', '" + tenantId + "', '8', '账单欠缴模板', '" + signature + "', '截止今日您的账单共计欠缴{price}元,请登录{app}小程序查看账单并交费。', '" + nowTimestr + "', '1', '0', null, null)," +
" ( '" + idWorker.nextId() + "', '" + tenantId + "', '9', '场景投放', '" + signature + "', '亲爱的vip,悄悄地送您一张{title},请到{app}微信小程序中使用吧!', '" + nowTimestr + "', '1', '0', null, null)," +
" ( '" + idWorker.nextId() + "', '" + tenantId + "', '11', '商户分账账户新增通知商户', '" + signature + "', '您于{time}提交了{merchant}商户的收款账户[{account}]绑定,后续销售分成及营销补贴将存入该账户', '" + nowTimestr + "', '1', '0', null, null)," +
" ( '" + idWorker.nextId() + "', '" + tenantId + "', '13', '商户分账账户变更通知商户', '" + signature + "', '您于{time}将{merchant}商户的收款账户变更为[{account}],后续销售分成及营销补贴将存入该账户', '" + nowTimestr + "', '1', '0', null, null)," +
" ( '" + idWorker.nextId() + "', '" + tenantId + "', '14', '商户分账账户不使用回执', '" + signature + "', '商管已同意[{account}]作为{merchant}商户的收款账户。后续的销售分成及营销补贴将存入此账户', '" + nowTimestr + "', '1', '0', null, null)," +
" ( '" + idWorker.nextId() + "', '" + tenantId + "', '15', '商户分账账户使用回执', '" + signature + "', '商管拒绝将[{account}]作为{merchant}商户的收款账户。如有疑问请联系商管', '" + nowTimestr + "', '1', '0', null, null)," +
" ( '" + idWorker.nextId() + "', '" + tenantId + "', '16', '商户分账账户删除提醒', '" + signature + "', '{merchant}商户的收款账户[{account}]于{time}取消绑定,营销活动与销售分成将无法正常进行,请尽快绑定新收款账户', '" + nowTimestr + "', '1', '0', null, null);" +
"insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`)" +
"values ( '" + idWorker.nextId() + "', '" + tenantId + "', '10', '审批通过通知', '富茂', " +
" '<!DOCTYPE html>\\n<html>\\n\\n<head>\\n <meta charset=\\\"utf-8\\\">\\n <meta name=\\\"viewport\\\" content=\\\"width=device-width,initial-scale=1.0\\\">\\n <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=utf-8\\\" />\\n <meta name=\\\"viewport\\\" content=\\\"initial-scale=1.0, user-scalable=no\\\" />\\n <meta name=\\\"renderer\\\" content=\\\"webkit\\\">\\n <meta http-equiv=\\\"X-UA-Compatible\\\" content=\\\"IE=edge,chrome=1\\\">\\n <title>富茂审批邮件</title>\\n <title></title>\\n <script> document.documentElement.style.fontSize = document.documentElement.clientWidth / 7.5 + \\'px\\';</script>\\n</head>\\n\\n<body>\\n <div id=\\\"box\\\" style=\\\"padding:80px 20%;background:#E9E7E7;min-height:100vh;\\\">\\n <header style=\\\"height:140px;width:100%;display:flex;background:rgba(31,47,62,1);border-radius:15px 15px 0px 0px;\\\">\\n <img style=\\\"height:auto;width:292px;display:flex;align-self: center;justify-content: center;padding:0 40px;\\\" src=\\\"https://s3.cn-northwest-1.amazonaws.com.cn/iformall-net/cimg/changrong-logo.png\\\"/>\\n </header>\\n <div style=\\\"background:#fff;\\\">\\n <div style=\\\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;padding:56px 55px 0;\\\">审批通过通知</div>\\n <div style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);padding: 36px 55px;\\\">编号<span>{contract}</span>的{bustype}已经审批通过,请登录<a href=\\\"{page}\\\">{page}</a>跟进后续工作</div>\\n </div>\\n </div>\\n</body>\\n\\n</html>', " +
" '" + nowTimestr + "', '1', null, '500', '" + wxProjectConfig.getImgUrlH() + "');" +
" '" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "');" +
"insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`)" +
"values ( '" + idWorker.nextId() + "', '" + tenantId + "', '11', '待缴账单通知', '富茂', " +
" '<!DOCTYPE html>\\n<html>\\n\\n<head>\\n <meta charset=\\\"utf-8\\\">\\n <meta name=\\\"viewport\\\" content=\\\"width=device-width,initial-scale=1.0\\\">\\n <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=utf-8\\\" />\\n <meta name=\\\"viewport\\\" content=\\\"initial-scale=1.0, user-scalable=no\\\" />\\n <meta name=\\\"renderer\\\" content=\\\"webkit\\\">\\n <meta http-equiv=\\\"X-UA-Compatible\\\" content=\\\"IE=edge,chrome=1\\\">\\n <title>富茂审批邮件</title>\\n <title></title>\\n <style>\\n *{\\n margin: 0;\\n padding: 0;\\n }\\n </style>\\n</head>\\n\\n<body>\\n <div id=\\\"box\\\" style=\\\"padding:80px 20%;background:#E9E7E7;min-height:100vh;\\\">\\n <header style=\\\"height:140px;width:100%;display:flex;background:rgba(31,47,62,1);border-radius:15px 15px 0px 0px;\\\">\\n <img style=\\\"height:auto;width:292px;display:flex;align-self: center;justify-content: center;margin-left: 40px;\\\" src=\\\"{bg}\\\"/>\\n </header>\\n <content>\\n <div style=\\\"background: #fff;padding-bottom: 40px;\\\">\\n <div style=\\\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;padding-top: 56px;padding-left: 55px;\\\">待缴账单通知</div>\\n <div style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);padding:36px 55px 0;\\\">您当前的待缴账单为<span style=\\\"font-weight:400;color:rgba(200,89,98,1);margin:0 10px;\\\">{price}</span>元,截止日期为<span>{date}</span>请登录<span>您的商户端</span>小程序查看账单并缴费</div>\\n </div>\\n <div style=\\\"height: auto;width: 100%;line-height: 40px; background: rgba(245,245,245,1);padding: 30px 0;\\\">\\n <div style=\\\"overflow: hidden;\\\">\\n <span style=\\\"display: block; font-size:18px;width:80px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\\\">租金账单</span>\\n <div style=\\\"margin: 0 5%;width:90%;overflow: hidden;\\\">\\n <div style=\\\"width: 33.3%;float: left;height: 60px;line-height: 60px;text-align: center;font-family:MicrosoftYaHei;color:rgba(85,85,85,1);\\\">账单类型</div>\\n <div style=\\\"width: 33.3%;float: left;height: 60px;line-height: 60px;text-align: center;font-family:MicrosoftYaHei;color:rgba(85,85,85,1);\\\">账单金额(元)</div>\\n <div style=\\\"width: 33.3%;float: left;height: 60px;line-height: 60px;text-align: center;font-family:MicrosoftYaHei;color:rgba(85,85,85,1);\\\">缴费时间</div>\\n </div>\\n {billList}\\n </div>\\n </div>\\n <div style=\\\"background: #fff;\\\">\\n <div style=\\\"font-size:26px;font-family:MicrosoftYaHei-Bold; font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;margin-top: 26px;margin-left: 55px;padding-top: 56px;\\\">遇到问题?</div>\\n <div style=\\\"overflow: hidden;line-height: 60px;padding-bottom: 40px;\\\">\\n <span style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\\\">请联系商管负责人:</span>\\n <span style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);margin-left: 25px;\\\"><span>{linkName}</span><span style=\\\"margin-left: 16px; font-family:MicrosoftYaHei;font-weight:400;color:rgba(64,103,139,1);\\\">{linkPhone}</span></span>\\n </div>\\n </div>\\n </content>\\n </div>\\n</body>\\n\\n</html>'," +
" '" + nowTimestr + "', '1', null, '500', '" + wxProjectConfig.getImgUrlH() + "');" +
" '" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "');" +
"insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`)" +
"values ( '" + idWorker.nextId() + "', '" + tenantId + "', '12', '审批通知', '富茂', " +
"'<!DOCTYPE html>\\n<html>\\n\\n<head>\\n <meta charset=\\\"utf-8\\\">\\n <meta name=\\\"viewport\\\" content=\\\"width=device-width,initial-scale=1.0\\\">\\n <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=utf-8\\\" />\\n <meta name=\\\"viewport\\\" content=\\\"initial-scale=1.0, user-scalable=no\\\" />\\n <meta name=\\\"renderer\\\" content=\\\"webkit\\\">\\n <meta http-equiv=\\\"X-UA-Compatible\\\" content=\\\"IE=edge,chrome=1\\\">\\n <title>富茂审批邮件</title>\\n <title></title>\\n <script> document.documentElement.style.fontSize = document.documentElement.clientWidth / 7.5 + \\'px\\';</script>\\n</head>\\n\\n<body>\\n <div id=\\\"box\\\" style=\\\"padding:80px 20%;background:#E9E7E7;min-height:100vh;\\\">\\n <header style=\\\"height:140px;width:100%;display:flex;background:rgba(31,47,62,1);border-radius:15px 15px 0px 0px;\\\">\\n <img style=\\\"height:auto;width:292px;display:flex;align-self: center;justify-content: center;padding:0 40px;\\\" src=\\\"{bg}\\\"/>\\n </header>\\n <div style=\\\"background:#fff;\\\">\\n <div style=\\\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;padding:56px 55px 0;\\\">审批通知</div>\\n <div style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);padding: 36px 55px;\\\"><span>{userName}</span>同意编号<span>{contract}</span>的{bustype}审批,已呈送<span>{toUserName},</span>请登录<a href=\\\"{page}\\\">{page}</a>查看审批进度</div>\\n </div>\\n </div>\\n</body>\\n\\n</html>', " +
"'" + nowTimestr + "', '1', null, '500', '" + wxProjectConfig.getImgUrlH() + "');" +
"'" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "');" +
"insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`)" +
"values ( '" + idWorker.nextId() + "', '" + tenantId + "', '13', '欠缴账单通知', '富茂', " +
" '<!DOCTYPE html>\\n<html>\\n\\n<head>\\n <meta charset=\\\"utf-8\\\">\\n <meta name=\\\"viewport\\\" content=\\\"width=device-width,initial-scale=1.0\\\">\\n <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=utf-8\\\" />\\n <meta name=\\\"viewport\\\" content=\\\"initial-scale=1.0, user-scalable=no\\\" />\\n <meta name=\\\"renderer\\\" content=\\\"webkit\\\">\\n <meta http-equiv=\\\"X-UA-Compatible\\\" content=\\\"IE=edge,chrome=1\\\">\\n <title>富茂审批邮件</title>\\n <title></title>\\n <style>\\n *{\\n margin: 0;\\n padding: 0;\\n }\\n </style>\\n</head>\\n\\n<body>\\n <div id=\\\"box\\\" style=\\\"padding:80px 20%;background:#E9E7E7;min-height:100vh;\\\">\\n <header style=\\\"height:140px;width:100%;display:flex;background:rgba(31,47,62,1);border-radius:15px 15px 0px 0px;\\\">\\n <img style=\\\"height:auto;width:292px;display:flex;align-self: center;justify-content: center;margin-left: 40px;\\\" src=\\\"{bg}\\\"/>\\n </header>\\n <content>\\n <div style=\\\"background: #fff;padding-bottom: 40px;\\\">\\n <div style=\\\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;padding: 56px 55px 0;\\\">欠缴账单通知</div>\\n <div style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);padding: 36px 55px 0;\\\">您当前的欠缴账单为<span style=\\\"font-weight:400;color:rgba(200,89,98,1);margin:0 10px;\\\">{price}</span>元,截止日期为<span>{date}</span>请登录<span>您的商户端</span>小程序查看账单并缴费</div>\\n </div>\\n <div style=\\\"height: auto;width: 100%;line-height: 40px; background: rgba(245,245,245,1);padding: 30px 0;\\\">\\n <div style=\\\"overflow: hidden;\\\">\\n <span style=\\\"display: block; font-size:18px;width:80px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\\\">租金账单</span>\\n <div style=\\\"margin: 0 5%;width:90%;overflow: hidden;font-size:14px;\\\">\\n <div style=\\\"width: 25%;float: left;height: 60px;line-height: 60px;text-align: center;font-family:MicrosoftYaHei;color:rgba(85,85,85,1);\\\">账单类型</div>\\n <div style=\\\"width: 25%;float: left;height: 60px;line-height: 60px;text-align: center;font-family:MicrosoftYaHei;color:rgba(85,85,85,1);\\\">账单金额(元)</div>\\n <div style=\\\"width: 25%;float: left;height: 60px;line-height: 60px;text-align: center;font-family:MicrosoftYaHei;color:rgba(85,85,85,1);\\\">缴费时间</div>\\n <div style=\\\"width: 25%;float: left;height: 60px;line-height: 60px;text-align: center;font-family:MicrosoftYaHei;color:rgba(85,85,85,1);\\\">逾期天数</div>\\n </div>\\n {billList}\\n </div>\\n </div>\\n <div style=\\\"background:#fff;\\\">\\n <div style=\\\"font-size:26px;font-family:MicrosoftYaHei-Bold; font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;margin-top: 26px;margin-left: 55px;padding-top: 56px;\\\">遇到问题?</div>\\n <div style=\\\"overflow: hidden;line-height: 60px;padding-bottom: 40px;\\\">\\n <span style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\\\">请联系商管负责人:</span>\\n <span style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);margin-left: 25px;\\\"><span>{linkName}</span><span style=\\\"margin-left: 16px; font-family:MicrosoftYaHei;font-weight:400;color:rgba(64,103,139,1);\\\">{linkPhone}</span></span>\\n </div>\\n </div>\\n </content>\\n </div>\\n</body>\\n\\n</html>'," +
"'" + nowTimestr + "', '1', null, '500', '" + wxProjectConfig.getImgUrlH() + "');" +
"'" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "');" +
"insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`)" +
" values ( '" + idWorker.nextId() + "', '" + tenantId + "', '14', '待办通知', '富茂'," +
" '<!DOCTYPE html>\\n<html>\\n\\n<head>\\n <meta charset=\\\"utf-8\\\">\\n <meta name=\\\"viewport\\\" content=\\\"width=device-width,initial-scale=1.0\\\">\\n <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=utf-8\\\" />\\n <meta name=\\\"viewport\\\" content=\\\"initial-scale=1.0, user-scalable=no\\\" />\\n <meta name=\\\"renderer\\\" content=\\\"webkit\\\">\\n <meta http-equiv=\\\"X-UA-Compatible\\\" content=\\\"IE=edge,chrome=1\\\">\\n <title>富茂审批邮件</title>\\n <title></title>\\n <style>\\n *{\\n margin: 0;\\n padding: 0;\\n }\\n </style>\\n</head>\\n\\n<body>\\n <div id=\\\"box\\\" style=\\\"padding:80px 20%;background:#E9E7E7;min-height:100vh;\\\">\\n <header style=\\\"height:140px;width:100%;display:flex;background:rgba(31,47,62,1);border-radius:15px 15px 0px 0px;\\\">\\n <img style=\\\"height:auto;width:292px;display:flex;align-self: center;justify-content: center;margin-left: 40px;\\\" src=\\\"{bg}\\\"/>\\n </header>\\n <content>\\n <div style=\\\"background:#fff;\\\">\\n <div style=\\\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;padding: 56px 55px 0;\\\">待办通知</div>\\n <div style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);padding: 36px 55px 40px;\\\"><span>{name}</span><span>提交了一个{bustype}待您审批,电脑登录</span><a href=\\\"{page}\\\" target=\\\"_blank\\\">{page}</a>查看您的待办</div>\\n </div>\\n <div style=\\\"height: auto;width: 100%;line-height: 40px; background: rgba(245,245,245,1);padding: 30px 0;\\\">\\n <div style=\\\"overflow: hidden;\\\">\\n <div style=\\\"float: left;font-size:18px;width:cale(20%-55px);font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\\\">申请时间:</div>\\n <div style=\\\"float: left;font-size:18px;width:cale(80%-55px);font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);margin-left: 55px;\\\">{applyTime}</div>\\n </div>\\n <div style=\\\"overflow: hidden;\\\">\\n <div style=\\\"float: left;font-size:18px;width:cale(20%-55px);font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\\\">申请进度:</div>\\n <div style=\\\"float: left;width:cale(80%-55px);margin-left: 55px;\\\">\\n \\n {taskList}\\n </div>\\n </div>\\n </div>\\n <div style=\\\"background:#fff;\\\">\\n <div style=\\\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;margin-top: 26px;padding: 56px 55px 0;\\\">遇到问题?</div>\\n <div style=\\\"overflow: hidden;line-height: 60px;padding-bottom: 40px;\\\">\\n <span style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\\\">请联系申请人:</span>\\n <span style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);margin-left: 25px;\\\"><span>{linkName}</span><span style=\\\"margin-left: 16px; font-family:MicrosoftYaHei;font-weight:400;color:rgba(64,103,139,1);\\\">{linkPhone}</span></span>\\n </div>\\n </div>\\n </content>\\n </div>\\n</body>\\n\\n</html>'," +
" '" + nowTimestr + "', '1', null, '500', '" + wxProjectConfig.getImgUrlH() + "');" +
" '" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "');" +
"insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`)" +
" values ( '" + idWorker.nextId() + "', '" + tenantId + "', '15', '驳回通知', '富茂', " +
" '<!DOCTYPE html>\\n<html>\\n\\n<head>\\n <meta charset=\\\"utf-8\\\">\\n <meta name=\\\"viewport\\\" content=\\\"width=device-width,initial-scale=1.0\\\">\\n <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=utf-8\\\" />\\n <meta name=\\\"viewport\\\" content=\\\"initial-scale=1.0, user-scalable=no\\\" />\\n <meta name=\\\"renderer\\\" content=\\\"webkit\\\">\\n <meta http-equiv=\\\"X-UA-Compatible\\\" content=\\\"IE=edge,chrome=1\\\">\\n <title>富茂审批邮件</title>\\n <title></title>\\n <style>\\n *{\\n margin: 0;\\n padding: 0;\\n }\\n </style>\\n</head>\\n\\n<body>\\n <div id=\\\"box\\\" style=\\\"padding:80px 20%;background:#E9E7E7;min-height:100vh;\\\">\\n <header style=\\\"height:140px;width:100%;display:flex;background:rgba(31,47,62,1);border-radius:15px 15px 0px 0px;\\\">\\n <img style=\\\"height:auto;width:292px;display:flex;align-self: center;justify-content: center;margin-left: 40px;\\\" src=\\\"{bg}\\\"/>\\n </header>\\n <content>\\n <div style=\\\"background:#fff;\\\">\\n <div style=\\\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;padding: 56px 55px 0;\\\">审批通过通知</div>\\n <div style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);padding:36px 55px 40px;\\\">编号<span>{contract}</span>的{bustype}审批被驳回,请登录<a href=\\\"{page}\\\">{page}</a>查看审批明细</div>\\n </div>\\n <div style=\\\"height: auto;width: 100%;line-height: 40px; background: rgba(245,245,245,1);padding: 30px 0;\\\">\\n <div style=\\\"overflow: hidden;\\\">\\n <span style=\\\"display: block;float: left; font-size:18px;width:80px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\\\">驳回人:</span>\\n <span style=\\\"display: block;float: left; width:calc(100% - 240px);font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);margin-left: 55px;\\\">{name}</span>\\n </div>\\n <div style=\\\"overflow: hidden;\\\">\\n <span style=\\\"display: block;float: left; font-size:18px;width:80px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\\\">驳回原因:</span>\\n <span style=\\\"display: block;float: left;width:calc(100% - 240px); font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);margin-left: 55px;\\\">{remark}</span>\\n </div>\\n </div>\\n <div style=\\\"background:#fff;\\\">\\n <div style=\\\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;padding: 56px 55px 0;margin-top: 26px;\\\">遇到问题?</div>\\n <div style=\\\"overflow: hidden;line-height: 60px;padding-bottom: 40px;\\\">\\n <span style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\\\">请联系驳回人:</span>\\n <span style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);margin-left: 25px;\\\"><span>{linkName}</span><span style=\\\"margin-left: 16px; font-family:MicrosoftYaHei;font-weight:400;color:rgba(64,103,139,1);\\\">{linkPhone}</span></span>\\n </div>\\n </div>\\n </content>\\n </div>\\n</body>\\n\\n</html>'," +
" '" + nowTimestr + "', '1', null, '500', '" + wxProjectConfig.getImgUrlH() + "');";
" '" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "');";
wxMsgValidationcodeModelMapper.wxMsgValidationcodeModelInit(initSql);
}

@@ -87,6 +87,11 @@ public class WxMsgValidationcodeModelServiceImpl implements WxMsgValidationcodeM
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxMsgValidationcodeModelMapper.findList(record));
}

@Override
public List<WxMsgValidationcodeModel> findList(WxMsgValidationcodeModel record) {
return wxMsgValidationcodeModelMapper.findList(record);
}

@Override
public WxMsgValidationcodeModel getById(String id) {
return wxMsgValidationcodeModelMapper.selectById(id);


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

@@ -83,12 +83,11 @@ public class WxPayAccountBillServiceImpl implements WxPayAccountBillService {
public void deleteById(Long id) {
wxPayAccountBillMapper.deleteById(id);
}

@Override
public WxPayAccountBill getByTenantId(String tenantId) {
return wxPayAccountBillMapper.getByTenantId(tenantId);
}


}

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

@@ -65,12 +65,11 @@ public class WxPayAccountServiceImpl implements WxPayAccountService {
public void deleteById(Long id) {
wxPayAccountMapper.deleteById(id);
}

@Override
public WxPayAccount getByTenantId(String tenantId) {
return wxPayAccountMapper.getByTenantId(tenantId);
}


}

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

@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
import com.iformall.domain.po.*;
import com.iformall.mapper.*;
import com.iformall.service.*;
import com.iformall.utils.Constant;
import com.iformall.utils.PasswordHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -30,6 +31,8 @@ public class WxProjectConfigServiceImpl implements WxProjectConfigService {
@Autowired
WxMallBuildingService wxMallBuildingService;
@Autowired
WxMallFloorService wxMallFloorService;
@Autowired
WxPayAccountService wxPayAccountService;
@Autowired
WxPayAccountBillService wxPayAccountBillService;
@@ -42,6 +45,12 @@ public class WxProjectConfigServiceImpl implements WxProjectConfigService {
@Autowired
MallRoleService mallRoleService;
@Autowired
MallUserRoleService mallUserRoleService;
@Autowired
MallPermissionService mallPermissionService;
@Autowired
MallRolePermissionService mallRolePermissionService;
@Autowired
WxMsgConfigService wxMsgConfigService;
@Autowired
WxParkService wxParkService;
@@ -55,6 +64,8 @@ public class WxProjectConfigServiceImpl implements WxProjectConfigService {
WxMsgValidationcodeModelService wxMsgValidationcodeModelService;
@Autowired
WxFlowService wxFlowService;
@Autowired
MallUserInfoService userInfoService;

@Override
@Transactional
@@ -102,21 +113,10 @@ public class WxProjectConfigServiceImpl implements WxProjectConfigService {
//# wuguoqiang@iformall.com

// # 19. wx_question
logger.info("wx_question---------------------init--start");
String questionJson = "[{\"flag\": \"single\", \"title\": \"请问您的职业是?\", \"answers\": [{\"id\": \"59\", \"name\": \"学生\"}, {\"id\": \"60\", \"name\": \"上班族\"}, {\"id\": \"61\", \"name\": \"企业高管\"}, {\"id\": \"62\", \"name\": \"个体户\"}, {\"id\": \"63\", \"name\": \"自由职业\"}, {\"id\": \"64\", \"name\": \"其他\"}]},"
+ "{\"flag\": \"single\", \"title\": \"请问您目前的学历是?\", \"answers\": [{\"id\": \"34\", \"name\": \"高中\"}, {\"id\": \"35\", \"name\": \"大专\"}, {\"id\": \"36\", \"name\": \"本科\"}, {\"id\": \"37\", \"name\": \"硕士及以上\"}, {\"id\": \"38\", \"name\": \"博士及以上\"}]},"
+ "{\"flag\": \"single\", \"title\": \"请问您是如何到达商场的?\", \"answers\": [{\"id\": \"127\", \"name\": \"走路\"}, {\"id\": \"128\", \"name\": \"乘车\"}]},"
+ "{\"flag\": \"single\", \"title\": \"请问您和父母一起居住吗?\", \"answers\": [{\"id\": \"65\", \"name\": \"不是,我已租房\"}, {\"id\": \"66\", \"name\": \"是,我已购房\"}, {\"id\": \"67\", \"name\": \"不是,我和室友住宿舍\"}]},"
+ "{\"flag\": \"multi\", \"title\": \"请问您的孩子愿意与您一起?\", \"answers\": [{\"id\": \"57\", \"name\": \"逛街\"}, {\"id\": \"57\", \"name\": \"玩乐\"}, {\"id\": \"57\", \"name\": \"阅读\"}, {\"id\": \"55\", \"name\": \"我还没有宝宝\"}]},"
+ "{\"flag\": \"single\", \"title\": \"主人,您结婚了吗?\", \"answers\": [{\"id\": \"56\", \"name\": \"结婚啦\"}, {\"id\": \"55\", \"name\": \"还没有哦\"}]},"
+ "{\"flag\": \"single\", \"title\": \"您是?\", \"answers\": [{\"id\": \"42\", \"name\": \"贫下中农\"}, {\"id\": \"43\", \"name\": \"小康家庭\"}, {\"id\": \"44\", \"name\": \"中产家庭\"}, {\"id\": \"45\", \"name\": \"富裕家庭\"}]},"
+ "{\"flag\": \"single\", \"title\": \"请问您是?\", \"answers\": [{\"id\": \"104\", \"name\": \"实惠型消费\"}, {\"id\": \"105\", \"name\": \"享乐型消费\"}, {\"id\": \"106\", \"name\": \"品质型消费\"}]},"
+ "{\"flag\": \"multi\", \"title\": \"请问您喜欢哪种口味的食物?\", \"answers\": [{\"id\": \"92\", \"name\": \"轻餐\"}, {\"id\": \"93\", \"name\": \"小吃快餐\"}, {\"id\": \"94\", \"name\": \"西餐\"}, {\"id\": \"95\", \"name\": \"日料中餐甜点\"}, {\"id\": \"96\", \"name\": \"火锅\"}]},"
+ "{\"flag\": \"multi\", \"title\": \"请问您的爱好是?\", \"answers\": [{\"id\": \"121\", \"name\": \"时尚\"}, {\"id\": \"122\", \"name\": \"旅游\"}, {\"id\": \"123\", \"name\": \"运动\"}, {\"id\": \"124\", \"name\": \"电玩\"}, {\"id\": \"125\", \"name\": \"看书\"}, {\"id\": \"126\", \"name\": \"其他\"}]}]";
wxQuestionService.wxQuestionInit(tenantId,questionJson);
wxQuestionService.wxQuestionInit(tenantId);

//# 20. wx_msg_validationcode_model, 数据重新一下
wxMsgValidationcodeModelService.wxMsgValidationcodeModelInit(tenantId, wxProjectConfig);
wxMsgValidationcodeModelService.wxMsgValidationcodeModelInit(tenantId, wxProjectConfig.getName(), wxProjectConfig.getImgUrlH());
//wx_flow_config
wxFlowService.wxFlowConfigInit(tenantId);
//初始化成功 删除标记
@@ -129,5 +129,119 @@ public class WxProjectConfigServiceImpl implements WxProjectConfigService {

}

@Override
@Transactional
public void initMall(WxMall wxMall) {
if(wxMall.getId() == null){
wxMall.setTenantId("-1");
wxMallService.save(wxMall);
wxMall.setTenantId(wxMall.getId().toString());
// 2. wx_coupon_send_config
wxCouponSendConfigService.wxCouponSendConfigInit(wxMall.getTenantId());
//# 积分成长值设置wx_score_rules
wxScoreRulesService.wxScoreRulesInit(wxMall.getTenantId());
//# 17. wx_template_msg
//# 设置核销成功通知,核销失败通知
wxTemplateMsgService.wxTemplateMsgInit(wxMall.getTenantId());
// # 19. wx_question
wxQuestionService.wxQuestionInit(wxMall.getTenantId());
//# 20. wx_msg_validationcode_model, 数据重新一下
wxMsgValidationcodeModelService.wxMsgValidationcodeModelInit(wxMall.getTenantId(), wxMall.getName(), wxMall.getImgUrlH());
//wx_flow_config
wxFlowService.wxFlowConfigInit(wxMall.getTenantId());
}
wxMallService.update(wxMall);
}

@Override
@Transactional
public void initBuilding(List<WxMallBuilding> wxMallBuildings) {
for (WxMallBuilding wxMallBuilding:wxMallBuildings) {
wxMallBuilding.setMallId(Long.parseLong(wxMallBuilding.getTenantId()));
if(wxMallBuilding.getFloors() != null && wxMallBuilding.getFloors().size() > 0){
wxMallBuilding.setFloorNumber(wxMallBuilding.getFloors().size());
wxMallBuildingService.saveOrUpdate(wxMallBuilding);
for (WxMallFloor wxMallFloor:wxMallBuilding.getFloors()) {
wxMallFloor.setTenantId(wxMallBuilding.getTenantId());
wxMallFloor.setParentTenantId(wxMallBuilding.getParentTenantId());
wxMallFloor.setMallId(Long.parseLong(wxMallBuilding.getTenantId()));
wxMallFloor.setBuildingId(wxMallBuilding.getId());
wxMallFloor.setBackgroundImg(Constant.floor_back_img);
wxMallFloorService.saveOrUpdate(wxMallFloor);
}
}else{
wxMallBuilding.setFloorNumber(0);
wxMallBuildingService.saveOrUpdate(wxMallBuilding);
wxMallFloorService.deleteByBuildingId(wxMallBuilding.getId());
}
}
}

@Override
@Transactional
public void initPayAccount(WxPayAccount wxPayAccount) {
wxPayAccountService.saveOrUpdate(wxPayAccount);
WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(wxPayAccount.getTenantId());
if(wxPayAccountBill == null){
wxPayAccountBill = new WxPayAccountBill();
wxPayAccountBill.setTenantId(wxPayAccount.getTenantId());
}
wxPayAccountBill.setMchId(wxPayAccount.getMchId());
wxPayAccountBill.setSubMchId(wxPayAccount.getSubMchId());
wxPayAccountBill.setApiKey(wxPayAccount.getApiKey());
wxPayAccountBill.setNotifyUrl(wxPayAccount.getNotifyUrl());
wxPayAccountBill.setCertPath(wxPayAccount.getCertPath());
wxPayAccountBill.setType(wxPayAccount.getType());
wxPayAccountBill.setShare(!(wxPayAccount.getShare() == 0));
wxPayAccountBill.setRate(wxPayAccount.getRate());
wxPayAccountBill.setRealRate(wxPayAccount.getRealRate());
wxPayAccountBillService.saveOrUpdate(wxPayAccountBill);
WxAppinfo wxAppinfo = new WxAppinfo();
wxAppinfo.setTenantId(wxPayAccount.getTenantId());
List<WxAppinfo> list = wxAppinfoService.getList(wxAppinfo);
if(list != null && list.size() > 0){
for (WxAppinfo wa:list) {
wa.setPayId(wxPayAccount.getId());
wa.setPayBillId(wxPayAccountBill.getId());
wxAppinfoService.saveOrUpdate(wa);
}
}
}

@Override
@Transactional
public void initUserInfo(MallUserInfo userInfo) {
userInfoService.saveOrUpdate(userInfo);
//创建角色
MallRole mallRole = new MallRole();
mallRole.setTenantId(userInfo.getTenantId());
mallRole.setName("系统管理员");
mallRole.setAvailable("0");
mallRoleService.saveOrUpdate(mallRole);
//给角色赋权限
MallPermission mallPermission=new MallPermission();
List<MallPermission> list = mallPermissionService.getList(mallPermission);
for(MallPermission m : list){
MallRolePermission mallRolePermission = new MallRolePermission();
mallRolePermission.setTenantId(userInfo.getTenantId());
mallRolePermission.setRoleId(mallRole.getId());
mallRolePermission.setPermissionId(m.getId());
mallRolePermissionService.saveOrUpdate(mallRolePermission);
}
//给帐号加角色
MallUserRole mallUserRole = new MallUserRole();
mallUserRole.setUid(userInfo.getId());
mallUserRole.setRoleId(mallRole.getId());
mallUserRoleService.saveOrUpdate(mallUserRole);
}

@Override
public void initSubmall(String parentTenantId, String[] tenantIds) {
wxMallService.undateSubmall(parentTenantId,tenantIds);
/**
* 初始化数据
*/
}


}

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

@@ -34,7 +34,17 @@ public class WxQuestionServiceImpl implements WxQuestionService {
WxQuestionLogMapper wxQuestionLogMapper;

@Override
public void wxQuestionInit(String tenantId, String questionJson) {
public void wxQuestionInit(String tenantId) {
String questionJson = "[{\"flag\": \"single\", \"title\": \"请问您的职业是?\", \"answers\": [{\"id\": \"59\", \"name\": \"学生\"}, {\"id\": \"60\", \"name\": \"上班族\"}, {\"id\": \"61\", \"name\": \"企业高管\"}, {\"id\": \"62\", \"name\": \"个体户\"}, {\"id\": \"63\", \"name\": \"自由职业\"}, {\"id\": \"64\", \"name\": \"其他\"}]},"
+ "{\"flag\": \"single\", \"title\": \"请问您目前的学历是?\", \"answers\": [{\"id\": \"34\", \"name\": \"高中\"}, {\"id\": \"35\", \"name\": \"大专\"}, {\"id\": \"36\", \"name\": \"本科\"}, {\"id\": \"37\", \"name\": \"硕士及以上\"}, {\"id\": \"38\", \"name\": \"博士及以上\"}]},"
+ "{\"flag\": \"single\", \"title\": \"请问您是如何到达商场的?\", \"answers\": [{\"id\": \"127\", \"name\": \"走路\"}, {\"id\": \"128\", \"name\": \"乘车\"}]},"
+ "{\"flag\": \"single\", \"title\": \"请问您和父母一起居住吗?\", \"answers\": [{\"id\": \"65\", \"name\": \"不是,我已租房\"}, {\"id\": \"66\", \"name\": \"是,我已购房\"}, {\"id\": \"67\", \"name\": \"不是,我和室友住宿舍\"}]},"
+ "{\"flag\": \"multi\", \"title\": \"请问您的孩子愿意与您一起?\", \"answers\": [{\"id\": \"57\", \"name\": \"逛街\"}, {\"id\": \"57\", \"name\": \"玩乐\"}, {\"id\": \"57\", \"name\": \"阅读\"}, {\"id\": \"55\", \"name\": \"我还没有宝宝\"}]},"
+ "{\"flag\": \"single\", \"title\": \"主人,您结婚了吗?\", \"answers\": [{\"id\": \"56\", \"name\": \"结婚啦\"}, {\"id\": \"55\", \"name\": \"还没有哦\"}]},"
+ "{\"flag\": \"single\", \"title\": \"您是?\", \"answers\": [{\"id\": \"42\", \"name\": \"贫下中农\"}, {\"id\": \"43\", \"name\": \"小康家庭\"}, {\"id\": \"44\", \"name\": \"中产家庭\"}, {\"id\": \"45\", \"name\": \"富裕家庭\"}]},"
+ "{\"flag\": \"single\", \"title\": \"请问您是?\", \"answers\": [{\"id\": \"104\", \"name\": \"实惠型消费\"}, {\"id\": \"105\", \"name\": \"享乐型消费\"}, {\"id\": \"106\", \"name\": \"品质型消费\"}]},"
+ "{\"flag\": \"multi\", \"title\": \"请问您喜欢哪种口味的食物?\", \"answers\": [{\"id\": \"92\", \"name\": \"轻餐\"}, {\"id\": \"93\", \"name\": \"小吃快餐\"}, {\"id\": \"94\", \"name\": \"西餐\"}, {\"id\": \"95\", \"name\": \"日料中餐甜点\"}, {\"id\": \"96\", \"name\": \"火锅\"}]},"
+ "{\"flag\": \"multi\", \"title\": \"请问您的爱好是?\", \"answers\": [{\"id\": \"121\", \"name\": \"时尚\"}, {\"id\": \"122\", \"name\": \"旅游\"}, {\"id\": \"123\", \"name\": \"运动\"}, {\"id\": \"124\", \"name\": \"电玩\"}, {\"id\": \"125\", \"name\": \"看书\"}, {\"id\": \"126\", \"name\": \"其他\"}]}]";
WxQuestion wxQuestion = new WxQuestion();
wxQuestion.setTenantId(tenantId);
JSONArray jsonObject = JSON.parseArray(questionJson);


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

@@ -13,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

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

@Service
public class WxTemplateMsgServiceImpl implements WxTemplateMsgService {
@@ -48,6 +49,11 @@ public class WxTemplateMsgServiceImpl implements WxTemplateMsgService {
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxTemplateMsgMapper.findList(record));
}

@Override
public List<WxTemplateMsg> findList(WxTemplateMsg record) {
return wxTemplateMsgMapper.findList(record);
}

@Override
public WxTemplateMsg getById(Long id) {
return wxTemplateMsgMapper.selectById(id);


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

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

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.iformall.common.IdWorker;
import com.iformall.domain.po.WxWiWideInfo;
import com.iformall.mapper.WxWiwideInfoMapper;
import com.iformall.service.WxWiWideInfoService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WxWiWideInfoServiceImpl implements WxWiWideInfoService {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
WxWiwideInfoMapper wxWiwideInfoMapper;


@Override
public void saveOrUpdate(WxWiWideInfo record) {
if (record.getId() == null) {
//record.setId(UUID.randomUUID().toString().replaceAll("-", ""));
final IdWorker idWorker = IdWorker.get();
record.setId(idWorker.nextId());
wxWiwideInfoMapper.insert(record);
} else {
wxWiwideInfoMapper.updateById(record);
}
}

@Override
public WxWiWideInfo findObject(WxWiWideInfo record) {
return wxWiwideInfoMapper.selectOne(new QueryWrapper(record));
}

}

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

@@ -175,9 +175,12 @@
<sql id="dynamicWhereConditionsVo">
where 1 = 1

<if test=" null != tenantId ">
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>

<if test=" null != boxId ">
and `box_id` = #{boxId}


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

@@ -27,9 +27,12 @@
and `id` = #{id}
</if>

<if test=" null != tenantId ">
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>

<if test=" null != boxId ">
and `box_id` = #{boxId}
@@ -106,9 +109,12 @@
<sql id="dynamicWhereConditionsVo">
where 1 = 1

<if test=" null != tenantId ">
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>

<if test=" null != boxId ">
and `box_id` = #{boxId}
@@ -232,9 +238,12 @@
tenant_id
FROM kw_meter_data
where 1 = 1
<if test=" null != tenantId ">
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != meterId ">
and `meter_id` = #{meterId}
</if>


+ 20
- 8
mallinkService/src/main/resources/mapper/MallUserInfoMapper.xml Просмотреть файл

@@ -152,8 +152,11 @@
<include refid="allSafeColumns"/>
from mall_user_info
where 1=1
<if test=" null != tenantId ">
and `tenant_id`=#{tenantId}
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != bopenId ">
and `bopen_id`=#{bopenId}
@@ -174,8 +177,11 @@
update mall_user_info
set `web_open_id` = null
where 1=1
<if test=" null != tenantId ">
and `tenant_id`=#{tenantId}
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != username ">
and username=#{username}
@@ -189,8 +195,11 @@
update mall_user_info
set `web_open_id` = null, `bopen_id` = null
where 1=1
<if test=" null != tenantId ">
and `tenant_id`=#{tenantId}
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != username ">
and username=#{username}
@@ -205,8 +214,11 @@
<include refid="allColumns"/>
from mall_user_info
where 1=1
<if test=" null != tenantId ">
and `tenant_id`=#{tenantId}
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != phone ">
and `phone`=#{phone}


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

@@ -83,9 +83,12 @@
select a.id,a.cover_img,a.title,a.activity_start_time,a.activity_end_time,aj.`status`
from wx_activity_join aj left join wx_activity a on aj.activity_id=a.id
where aj.user_id=#{userId}
<if test=" null != tenantId ">
<if test=" null != tenantId and '' != tenantId">
and aj.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and aj.`parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != statusStr and ''!=statusStr">
and aj.`status` in (${statusStr}) and a.`status`=2
</if>


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

@@ -278,7 +278,7 @@
</select>

<update id="insertBillAction">
insert into wx_bill_action(id,user_name,`action`,bill_id,details,tenant_id)
insert into wx_bill_action(id,user_name,`action`,bill_id,details,tenant_id,parent_tenant_id)
select
(select unix_timestamp(now()) + CEILING(RAND()*90000+10000) + CEILING(RAND()*90000+10000) + CEILING(RAND()*90000+10000)) id
,'系统端' user_name,7 `action`,b.id bill_id,
@@ -292,7 +292,7 @@
b.owe * (c.late_pay_ratio) /10000
,2)
)
,'元') details,b.tenant_id
,'元') details,b.tenant_id,b.parent_tenant_id
from wx_bill_property b left join wx_property_contract c on(b.`property_contract_id`=c.id)
where c.late_pay_ratio >0
and DATEDIFF(now(), date_add(b.receive_date,interval(c.late_pay_day) day)) >0


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

@@ -279,7 +279,7 @@
</select>

<update id="insertBillAction">
insert into wx_bill_action(id,user_name,`action`,bill_id,details,tenant_id)
insert into wx_bill_action(id,user_name,`action`,bill_id,details,tenant_id,parent_tenant_id)
select
(select unix_timestamp(now()) + CEILING(RAND()*90000+10000) + CEILING(RAND()*90000+10000)+ CEILING(RAND()*90000+10000) ) id
,'系统端' user_name,7 `action`,b.id bill_id,
@@ -293,7 +293,7 @@
b.owe * (c.late_pay_ratio) /10000
,2)
)
,'元') details,b.tenant_id
,'元') details,b.tenant_id,b.parent_tenant_id
from wx_bill_rent b left join wx_rent_contract c on(b.rent_contract_id=c.id)
where c.late_pay_ratio >0
and DATEDIFF(now(), date_add(b.receive_date,interval(c.late_pay_day) day)) >0


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

@@ -28,7 +28,12 @@
<sql id="dynamicWhereConditions">
where 1=1
<if test=" null != id ">and `id` = #{id}</if>
<if test=" null != tenantId ">and `tenant_id` = #{tenantId}</if>
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>

<if test=" null != ids ">
and id in


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

@@ -66,13 +66,12 @@
<if test=" null != id ">
and `id` = #{id}
</if>
<if test=" null != tenantId ">
and `tenant_id`= #{tenantId}
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId ">
and `parent_tenant_id`= #{parentTenantId}
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != openId ">


+ 9
- 3
mallinkService/src/main/resources/mapper/WxCUserFromBMapper.xml Просмотреть файл

@@ -4,6 +4,7 @@
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCUserFromB">
<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="merchant_id" jdbcType="INTEGER" property="merchantId" />
<result column="b_user_id" jdbcType="BIGINT" property="bUserId" />
<result column="c_user_id" jdbcType="BIGINT" property="cUserId" />
@@ -16,13 +17,18 @@
</resultMap>
<sql id="allColumns">
`id`,`tenant_id`,`merchant_id`,`b_user_id`,`c_user_id`,`info`,`create_time`,`update_time`,`openid`,`app_id`
`id`,`tenant_id`,`parent_tenant_id`,`merchant_id`,`b_user_id`,`c_user_id`,`info`,`create_time`,`update_time`,`openid`,`app_id`
</sql>

<sql id="dynamicWhereConditions">
where 1 = 1
<if test=" null != id "> and `id` = #{id} </if>
<if test=" null != tenantId "> and `tenant_id` = #{tenantId} </if>
<if test=" null != id "> and `id` = #{id} </if>
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != merchantId "> and `merchant_id` = #{merchantId} </if>
<if test=" null != bUserId "> and `b_user_id` = #{bUserId} </if>
<if test=" null != cUserId "> and `c_user_id` = #{cUserId} </if>


+ 17
- 8
mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml Просмотреть файл

@@ -124,18 +124,24 @@
update wx_coupon_channel
set status=#{status}, update_date=#{updateDate}
where coupon_id=#{couponId}
<if test=" null != tenantId ">
and tenant_id = #{tenantId}
</if>
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
</update>

<update id="updateEndTimeByCouponId" parameterType="com.iformall.domain.po.WxCouponChannel">
update wx_coupon_channel
set end_time = #{endTime}
where coupon_id=#{couponId}
<if test=" null != tenantId ">
and tenant_id = #{tenantId}
</if>
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
</update>

<sql id="CouponChannelVoColumns">
@@ -214,8 +220,11 @@
<if test="status != null">
and cc.status=#{status}
</if>
<if test=" null != tenantId ">
and cc.tenant_id = #{tenantId}
<if test=" null != tenantId and '' != tenantId">
and cc.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and cc.`parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != sortColumns"> order by ${sortColumns} </if>
</select>


+ 14
- 5
mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml Просмотреть файл

@@ -226,12 +226,18 @@
<select id="touchUsersReportList" resultType="com.iformall.domain.vo.TouchUsersReportVo" parameterType="com.iformall.domain.dto.MarkingCouponDataReportDto">
SELECT xTime, tenant_id, pv, uv, couponCount, userCount, verifyCount, verifyUserCount
FROM view_touch_user
WHERE view_touch_user.tenant_id=#{tenantId}
WHERE 1=1
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test="startTime != null">
and view_touch_user.xTime &gt;= DATE_FORMAT(#{startTime},'%Y-%m-%d')
and xTime &gt;= DATE_FORMAT(#{startTime},'%Y-%m-%d')
</if>
<if test="endTime != null">
and view_touch_user.xTime &lt;= DATE_FORMAT(#{endTime},'%Y-%m-%d')
and xTime &lt;= DATE_FORMAT(#{endTime},'%Y-%m-%d')
</if>
GROUP BY xTime
order by xTime desc
@@ -852,8 +858,11 @@
left join wx_shop s on ms.shop_id=s.id
left join wx_coupon_merchant cm on ms.merchant_id=cm.merchant_id
where ms.is_del=0 and s.building=#{building}
<if test=" null != tenantId ">
and ms.tenant_id=#{tenantId}
<if test=" null != tenantId and '' != tenantId">
and ms.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and ms.`parent_tenant_id` = #{parentTenantId}
</if>
<if test="null!=floor">
and s.floor=#{floor}


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

@@ -145,8 +145,11 @@
<update id="updateStatusByCouponId" parameterType="com.iformall.domain.po.WxCouponChannel">
update wx_coupon_send set status=#{status}
where coupon_id=#{couponId}
<if test=" null != tenantId ">
and tenant_id = #{tenantId}
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
</update>



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

@@ -198,9 +198,12 @@
select count(0)
from wx_credit_history
where 1=1
<if test=" null != tenantId ">
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != cUserId ">
and `c_user_id` = #{cUserId}
</if>


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

@@ -3,8 +3,6 @@
<mapper namespace="com.iformall.mapper.WxDataRuleTargetMapper">
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxDataRuleTarget">
<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="parent" jdbcType="BIGINT" property="parent"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="tag" jdbcType="VARCHAR" property="tag"/>
@@ -13,7 +11,7 @@
</resultMap>
<sql id="allColumns">
`id`,`tenant_id`,`parent_tenant_id`,`parent`,`name`,`tag`,`create_time`,`update_time`
`id`,`parent`,`name`,`tag`,`create_time`,`update_time`
</sql>
<sql id="dynamicWhereConditions">
@@ -23,17 +21,6 @@
and `id` = #{id}
</if>
<if test=" null != tenantId ">
and `tenant_id` = #{tenantId}
</if>

<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != name ">
and `name` like concat('%',#{name},'%')
</if>


+ 5
- 3
mallinkService/src/main/resources/mapper/WxGameActionLogMapper.xml Просмотреть файл

@@ -85,9 +85,11 @@

</if>

<if test=" null != tenantId ">
and `tenant_id` = #{tenantId}

<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>

<if test=" null != gameId ">


+ 5
- 0
mallinkService/src/main/resources/mapper/WxMallFloorMapper.xml Просмотреть файл

@@ -73,4 +73,9 @@
</select>


<delete id="deleteByBuildingId">
delete from wx_mall_floor where building_id=#{buildingId}
</delete>


</mapper>

+ 9
- 0
mallinkService/src/main/resources/mapper/WxMallMapper.xml Просмотреть файл

@@ -180,6 +180,15 @@
and m.`parent_tenant_id` = #{parentTenantId}
</if>
</select>
<update id="undateSubmall">
update wx_mall set parent_tenant_id = null where parent_tenant_id = #{parentTenantId} ;
update wx_mall set parent_tenant_id = #{parentTenantId} where tenant_id in
<foreach collection="tenantIds" item="item" index="index" open="("
separator="," close=")">
#{item}
</foreach>
</update>





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

@@ -295,9 +295,12 @@
FROM wx_merchant m
left join wx_business bu on bu.id = m.business_id
<where>
<if test=" null != tenantId ">
<if test=" null != tenantId and '' != tenantId">
and m.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and m.`parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != status ">
and m.`status` = #{status}
</if>


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

@@ -250,9 +250,12 @@
ms.create_date create_date,ms.subsidy subsidy,ms.real_subsidy,ms.status,ms.freeze
from wx_merchant_subsidy ms left join wx_merchant m on ms.merchant_id=m.id
where 1=1
<if test=" null != tenantId ">
<if test=" null != tenantId and '' != tenantId">
and ms.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and ms.`parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != orderId ">
and ms.`order_id` = #{orderId}
</if>


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

@@ -30,12 +30,14 @@
<if test=" null != id ">
and `id` = #{id}
</if>
<if test=" null != tenantId ">
and `tenant_id` = #{tenantId}
</if>
</if>

<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != batchNo ">
and `batch_no` like concat('%', #{batchNo},'%')


+ 13
- 3
mallinkService/src/main/resources/mapper/WxMsgLimitMapper.xml Просмотреть файл

@@ -23,8 +23,11 @@
and `id` = #{id}
</if>

<if test=" null != tenantId ">
and `tenant_id`=#{tenantId}
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>

<if test=" null != type ">
@@ -63,7 +66,14 @@
</select>

<update id="updateLimitNum" parameterType="com.iformall.domain.po.WxMsgLimit">
update wx_msg_limit set limit_num = limit_num - 1 where `id` = #{id} and `tenant_id` = #{tenantId} and limit_num > 0
update wx_msg_limit set limit_num = limit_num - 1 where `id` = #{id}
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
and limit_num > 0
</update>

<delete id="delLimitNum" parameterType="com.iformall.domain.po.WxMsgLimit">


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

@@ -82,8 +82,11 @@
<if test=" null != modelId">
and `model_id` = #{modelId}
</if>
<if test=" null != tenantId ">
and `tenant_id`=#{tenantId}
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
limit 1
</select>


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

@@ -237,9 +237,12 @@
update wx_order set order_status=#{orderStatus}
where product_id=#{productId}
and press_end_date is not null and order_status in (6,7)
<if test=" null != tenantId ">
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
</update>
<update id="updateOrderGroupStatusByCouponId" parameterType="com.iformall.domain.po.WxOrder">
@@ -502,9 +505,12 @@
LEFT JOIN wx_c_user cu on cu.id = o.c_user_id
LEFT JOIN wx_c_user_basic_info cubi on cubi.id = o.c_user_id
where o.order_status = '0' and o.`type` = 1
<if test=" null != tenantId ">
<if test=" null != tenantId and '' != tenantId">
and o.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and o.`parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != merchantId ">
and bu.`merchant_id` = #{merchantId}
</if>


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

@@ -20,9 +20,12 @@
<if test=" null != id ">
and `id` = #{id}
</if>
<if test=" null != tenantId ">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != orderId ">
and `order_id` = #{orderId}
</if>


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

@@ -77,12 +77,18 @@
<if test=" null != sortColumns">order by ${sortColumns}</if>
</sql>

<select id="findList" parameterType="com.iformall.domain.po.WxPayAccount" resultMap="BaseResultMap">
<select id="findList" parameterType="com.iformall.domain.po.WxPayAccountBill" resultMap="BaseResultMap">
select
<include refid="allColumns"/>
from wx_pay_account
from wx_pay_account_bill
<include refid="dynamicWhereConditions"/>
</select>

<select id="getByTenantId" resultMap="BaseResultMap">
select
<include refid="allColumns"/>
from wx_pay_account_bill where `tenant_id` = #{tenantId}
</select>


</mapper>

+ 14
- 3
mallinkService/src/main/resources/mapper/WxPayAccountMapper.xml Просмотреть файл

@@ -3,6 +3,8 @@
<mapper namespace="com.iformall.mapper.WxPayAccountMapper">
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxPayAccount">
<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="mch_id" jdbcType="VARCHAR" property="mchId"/>
<result column="sub_mch_id" jdbcType="VARCHAR" property="subMchId"/>
<result column="api_key" jdbcType="VARCHAR" property="apiKey"/>
@@ -15,14 +17,17 @@
</resultMap>

<sql id="allColumns">
`id`,`mch_id`,`sub_mch_id`,`api_key`,`notify_url`,`cert_path`,`type`,`share`,`rate`,`real_rate`
`id`,`tenant_id`,`parent_tenant_id`,`mch_id`,`sub_mch_id`,`api_key`,`notify_url`,`cert_path`,`type`,`share`,`rate`,`real_rate`
</sql>

<sql id="dynamicWhereConditions">
where 1 = 1

<if test=" null != id ">
and `id` = #{id}
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>

<if test=" null != mchId ">
@@ -72,5 +77,11 @@
<include refid="dynamicWhereConditions"/>
</select>

<select id="getByTenantId" resultMap="BaseResultMap">
select
<include refid="allColumns"/>
from wx_pay_account where `tenant_id` = #{tenantId}
</select>


</mapper>

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

@@ -173,7 +173,12 @@
<include refid="allColumns"/>
from wx_pay_order
where 1=1
<if test=" null != tenantId "> and `tenant_id` = #{tenantId} </if>
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
and order_id in (
select id from wx_order where `tenant_id` = #{tenantId} and type = 1 and order_status = 0
);


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

@@ -130,7 +130,13 @@
left join wx_mall_building b on s.building=b.id
left join wx_brand br on rc.brand=br.id
<where>
<if test=" null != tenantId ">rc.tenant_id=#{tenantId}</if>

<if test=" null != tenantId and '' != tenantId">
and rc.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and rc.`parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != merchantName and merchantName!=''">and rc.`merchant_name` like
concat('%',#{merchantName},'%')


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

@@ -565,6 +565,12 @@

<select id="getCountByWxShop" parameterType="com.iformall.domain.po.WxShop" resultType="Long">
select count(*) from wx_shop w where w.is_del=0
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test="null != type">
and `type`=#{type}
</if>


+ 28
- 7
mallinkService/src/main/resources/mapper/WxUserVisitMapper.xml Просмотреть файл

@@ -4,6 +4,7 @@
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxUserVisit">
<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="ref_date" jdbcType="VARCHAR" property="refDate" />
<result column="day_date" jdbcType="TIMESTAMP" property="dayDate" />
<result column="session_cnt" jdbcType="INTEGER" property="sessionCnt" />
@@ -18,7 +19,7 @@
</resultMap>
<sql id="allColumns">
`id`,`tenant_id`,`ref_date`,`day_date`,`session_cnt`,`visit_pv`,`visit_uv`,`visit_uv_new`,`stay_time_uv`,`stay_time_session`,`visit_depth`,`app_id`,`create_date`
`id`,`tenant_id`,`parent_tenant_id`,`ref_date`,`day_date`,`session_cnt`,`visit_pv`,`visit_uv`,`visit_uv_new`,`stay_time_uv`,`stay_time_session`,`visit_depth`,`app_id`,`create_date`
</sql>

<sql id="dynamicWhereConditions">
@@ -28,9 +29,11 @@
and `id` = #{id}
</if>
<if test=" null != tenantId ">
and `tenant_id` =#{tenantId}

<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != refDate ">
@@ -107,7 +110,13 @@
parameterType="com.iformall.domain.dto.MarkingCouponDataReportDto">
SELECT DATE_FORMAT(day_date,'%Y-%m-%d') as xTime,visit_pv as pv,visit_uv as uv
from wx_user_visit
where tenant_id=#{tenantId}
where 1=1
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test="startTime != null">
and day_date &gt;= #{startTime}
</if>
@@ -122,7 +131,13 @@
<select id="touchUsersReportData" resultType="com.iformall.domain.vo.TouchUsersReportVo" parameterType="hashmap">
SELECT DATE_FORMAT(day_date,'%m/%d') as xTime,visit_pv as pv,visit_uv as uv
from wx_user_visit
where tenant_id=#{tenantId}
where 1=1
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test="startTime != null">
and day_date &gt;= #{startTime}
</if>
@@ -133,7 +148,13 @@
</select>

<select id="queryVisitUv" resultType="Long" parameterType="hashmap">
select count(visit_uv) from wx_user_visit where tenant_id=#{tenantId}
select count(visit_uv) from wx_user_visit where 1=1
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test="startTime != null">
and day_date &gt;= #{startTime}
</if>


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