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

修改集团版字段

release_toaliyun_real
xhxu 5 лет назад
Родитель
Сommit
e56ec82e85
100 измененных файлов: 1013 добавлений и 562 удалений
  1. +1
    -1
      mallinkAdmin/src/main/java/com/iformall/config/MyBatisConfiguration.java
  2. +2
    -2
      mallinkAdmin/src/main/java/com/iformall/controller/base/BaseController.java
  3. +2
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/datatower/DataTowerController.java
  4. +1
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/datatower/WxChartDataController.java
  5. +2
    -2
      mallinkAdmin/src/main/java/com/iformall/controller/mem/WxCUserDataController.java
  6. +2
    -2
      mallinkAdmin/src/main/java/com/iformall/controller/mem/WxScoreRulesController.java
  7. +6
    -6
      mallinkAdmin/src/main/java/com/iformall/controller/msg/WxMsgValidationcodeController.java
  8. +6
    -6
      mallinkAdmin/src/main/java/com/iformall/controller/sys/HomeController.java
  9. +2
    -2
      mallinkAdmin/src/main/java/com/iformall/controller/sys/SysMenuController.java
  10. +2
    -2
      mallinkAdmin/src/main/java/com/iformall/controller/sys/UploadController.java
  11. +2
    -2
      mallinkAdmin/src/main/java/com/iformall/controller/sys/WechatLoginController.java
  12. +2
    -2
      mallinkAdmin/src/main/java/com/iformall/shiro/MyShiroRealm.java
  13. +1
    -1
      mallinkAdmin/src/main/java/com/iformall/shiro/UserSession.java
  14. +4
    -4
      mallinkAdmin/src/main/java/com/iformall/tenant/TenantInfoImpl.java
  15. +4
    -4
      mallinkAdmin/src/main/java/com/iformall/ueditor/upload/Uploader.java
  16. +450
    -0
      mallinkAdmin/src/main/resources/db/migration/V202006281647__GROUP_UPDATE_PARENT_TENANT_ID.sql
  17. +1
    -1
      mallinkBApi/src/main/java/com/iformall/config/MyBatisConfiguration.java
  18. +2
    -2
      mallinkBApi/src/main/java/com/iformall/controller/BaseController.java
  19. +2
    -2
      mallinkBApi/src/main/java/com/iformall/controller/UploadController.java
  20. +2
    -2
      mallinkBApi/src/main/java/com/iformall/controller/WxCouponSendController.java
  21. +4
    -4
      mallinkBApi/src/main/java/com/iformall/controller/WxInfoController.java
  22. +1
    -1
      mallinkBApi/src/main/java/com/iformall/controller/WxMerchantBUserController.java
  23. +3
    -3
      mallinkBApi/src/main/java/com/iformall/controller/WxMsgValidationcodeController.java
  24. +5
    -5
      mallinkBApi/src/main/java/com/iformall/tenant/TenantInfoImpl.java
  25. +1
    -1
      mallinkCApi/src/main/java/com/iformall/config/MyBatisConfiguration.java
  26. +4
    -4
      mallinkCApi/src/main/java/com/iformall/controller/BaseController.java
  27. +2
    -2
      mallinkCApi/src/main/java/com/iformall/controller/UploadController.java
  28. +2
    -2
      mallinkCApi/src/main/java/com/iformall/controller/WxMerchantController.java
  29. +12
    -12
      mallinkCApi/src/main/java/com/iformall/controller/WxUserGrantController.java
  30. +2
    -2
      mallinkCApi/src/main/java/com/iformall/interceptor/AuthorizationInterceptor.java
  31. +5
    -5
      mallinkCApi/src/main/java/com/iformall/tenant/TenantInfoImpl.java
  32. +3
    -3
      mallinkCallback/src/main/java/com/iformall/controller/callback/WxCarETCPCallBackController.java
  33. +1
    -1
      mallinkCallback/src/main/java/com/iformall/controller/callback/WxCarTJDCallBackController.java
  34. +6
    -6
      mallinkPosApi/src/main/java/com/iformall/service/impl/PosServiceImpl.java
  35. +4
    -4
      mallinkSchedule/src/main/java/com/iformall/schedule/BillNotificationSchedule.java
  36. +6
    -6
      mallinkSchedule/src/main/java/com/iformall/schedule/ChartDataSchedule.java
  37. +2
    -2
      mallinkSchedule/src/main/java/com/iformall/schedule/CouponSendSchedule.java
  38. +1
    -1
      mallinkService/src/main/java/com/iformall/domain/po/MallUserInfo.java
  39. +2
    -2
      mallinkService/src/main/java/com/iformall/domain/po/WxChartDataEntity.java
  40. +3
    -3
      mallinkService/src/main/java/com/iformall/domain/po/WxMall.java
  41. +6
    -6
      mallinkService/src/main/java/com/iformall/domain/po/base/BaseTenantEntity.java
  42. +6
    -6
      mallinkService/src/main/java/com/iformall/domain/po/base/TenantEntity.java
  43. +3
    -3
      mallinkService/src/main/java/com/iformall/domain/po/invest/InvestBaseEntity.java
  44. +5
    -5
      mallinkService/src/main/java/com/iformall/domain/po/msg/BaseMsg.java
  45. +2
    -2
      mallinkService/src/main/java/com/iformall/domain/po/msg/FmInsideCLoginMsg.java
  46. +2
    -2
      mallinkService/src/main/java/com/iformall/domain/po/msg/FmInsideCouponVerifyMsg.java
  47. +2
    -2
      mallinkService/src/main/java/com/iformall/domain/po/msg/FmInsideOrderSuccessMsg.java
  48. +2
    -2
      mallinkService/src/main/java/com/iformall/domain/po/msg/WxMsg.java
  49. +1
    -1
      mallinkService/src/main/java/com/iformall/mapper/KwMerchantMeterMapper.java
  50. +1
    -1
      mallinkService/src/main/java/com/iformall/mapper/PosMallConfigMapper.java
  51. +2
    -2
      mallinkService/src/main/java/com/iformall/mapper/WxBusinessMapper.java
  52. +1
    -1
      mallinkService/src/main/java/com/iformall/mapper/WxCampaignMapper.java
  53. +2
    -2
      mallinkService/src/main/java/com/iformall/mapper/WxCouponActionLogMapper.java
  54. +1
    -1
      mallinkService/src/main/java/com/iformall/mapper/WxCouponOrderMapper.java
  55. +1
    -1
      mallinkService/src/main/java/com/iformall/mapper/WxRentContractMapper.java
  56. +12
    -12
      mallinkService/src/main/java/com/iformall/service/impl/DataTowerServiceImpl.java
  57. +3
    -3
      mallinkService/src/main/java/com/iformall/service/impl/MallPermissionServiceImpl.java
  58. +25
    -25
      mallinkService/src/main/java/com/iformall/service/impl/MarkingDataReportServiceImpl.java
  59. +1
    -1
      mallinkService/src/main/java/com/iformall/service/impl/PosMallConfigServiceImpl.java
  60. +4
    -4
      mallinkService/src/main/java/com/iformall/service/impl/PushLimitServiceImpl.java
  61. +2
    -2
      mallinkService/src/main/java/com/iformall/service/impl/QrCodeServiceImpl.java
  62. +4
    -4
      mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java
  63. +4
    -4
      mallinkService/src/main/java/com/iformall/service/impl/WxBillDailyServiceImpl.java
  64. +2
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxBusinessServiceImpl.java
  65. +1
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxCampaignServiceImpl.java
  66. +48
    -48
      mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java
  67. +1
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponActionLogServiceImpl.java
  68. +3
    -3
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java
  69. +2
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java
  70. +5
    -5
      mallinkService/src/main/java/com/iformall/service/impl/WxMallServiceImpl.java
  71. +1
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxMsgServiceImpl.java
  72. +6
    -6
      mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java
  73. +4
    -4
      mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingOrderServiceImpl.java
  74. +1
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java
  75. +4
    -4
      mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java
  76. +1
    -1
      mallinkService/src/main/java/com/iformall/service/kw/impl/KwMerchantMeterServiceImpl.java
  77. +1
    -1
      mallinkService/src/main/java/com/iformall/utils/Constant.java
  78. +4
    -4
      mallinkService/src/main/resources/mapper/KwBoxCmdHistoryMapper.xml
  79. +4
    -4
      mallinkService/src/main/resources/mapper/KwBoxMapper.xml
  80. +14
    -14
      mallinkService/src/main/resources/mapper/KwMerchantMeterMapper.xml
  81. +5
    -5
      mallinkService/src/main/resources/mapper/KwMeterDataMapper.xml
  82. +4
    -4
      mallinkService/src/main/resources/mapper/KwMeterMapper.xml
  83. +4
    -4
      mallinkService/src/main/resources/mapper/MallResourceMapper.xml
  84. +4
    -4
      mallinkService/src/main/resources/mapper/MallRoleMapper.xml
  85. +6
    -6
      mallinkService/src/main/resources/mapper/MallRolePermissionMapper.xml
  86. +6
    -6
      mallinkService/src/main/resources/mapper/MallUserActionMapper.xml
  87. +8
    -8
      mallinkService/src/main/resources/mapper/MallUserInfoMapper.xml
  88. +4
    -4
      mallinkService/src/main/resources/mapper/PosCouponOrderVerifyMapper.xml
  89. +5
    -5
      mallinkService/src/main/resources/mapper/PosMallConfigMapper.xml
  90. +3
    -3
      mallinkService/src/main/resources/mapper/PosOrderMapper.xml
  91. +4
    -4
      mallinkService/src/main/resources/mapper/PosPayOrderMapper.xml
  92. +4
    -4
      mallinkService/src/main/resources/mapper/PushLimitMapper.xml
  93. +4
    -4
      mallinkService/src/main/resources/mapper/WxActivityJoinMapper.xml
  94. +4
    -4
      mallinkService/src/main/resources/mapper/WxActivityMapper.xml
  95. +4
    -4
      mallinkService/src/main/resources/mapper/WxAdminLogMapper.xml
  96. +4
    -4
      mallinkService/src/main/resources/mapper/WxBillActionMapper.xml
  97. +158
    -158
      mallinkService/src/main/resources/mapper/WxBillAllMapper.xml
  98. +3
    -3
      mallinkService/src/main/resources/mapper/WxBillDailyMapper.xml
  99. +15
    -15
      mallinkService/src/main/resources/mapper/WxBillDepositMapper.xml
  100. +5
    -5
      mallinkService/src/main/resources/mapper/WxBillOtherDepositMapper.xml

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

@@ -19,7 +19,7 @@ public class MyBatisConfiguration {
MultiTenancy multiTenancy = new MultiTenancy();
Properties properties = new Properties();
properties.setProperty("tenantIdColumn", "tenant_id");
properties.setProperty("subTenantIdColumn", "sub_tenant_id");
properties.setProperty("parentTenantIdColumn", "parent_tenant_id");
properties.setProperty("dialect", "mysql");
properties.setProperty("tenantInfo", "com.iformall.tenant.TenantInfoImpl");
multiTenancy.setProperties(properties);


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

@@ -66,10 +66,10 @@ public class BaseController {
public TenantEntity getTenantInfo(){
Session session = SecurityUtils.getSubject().getSession();
String tenantId = (String)session.getAttribute(UserSession.tenantId);
String subTenantId = (String)session.getAttribute(UserSession.subTenantId);
String parentTenantId = (String)session.getAttribute(UserSession.parentTenantId);
TenantEntity tenantEntity = new TenantEntity(){{
setTenantId(tenantId);
setSubTenantId(subTenantId);
setParentTenantId(parentTenantId);
}};
return tenantEntity;
}


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

@@ -3,9 +3,11 @@ package com.iformall.controller.datatower;
import com.iformall.annotation.SystemControllerLog;
import com.iformall.common.ResultData;
import com.iformall.controller.base.BaseController;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.service.DataTowerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -28,7 +30,6 @@ public class DataTowerController extends BaseController {
@SystemControllerLog(description = "数据塔台-查询运营")
public ResultData queryRunningPotal() {
logger.debug("[" + getIpAddr() + "] DataTowerController::queryRunningPotal");

Map<String, Object> data = dataTowerService.queryRunningPotal(getTenantInfo());

return new ResultData(data);


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

@@ -72,7 +72,7 @@ public class WxChartDataController extends BaseController {
logger.info("[" + getIpAddr() + "] WxChartDataController::queryData chart: " + chart);
TenantEntity tenantEntity = getTenantInfo();
params.put("tenantId",tenantEntity.getTenantId());
params.put("subTenantId", tenantEntity.getSubTenantId());
params.put("parentTenantId", tenantEntity.getParentTenantId());
ResultData data = wxChartDataService.queryData(params);
logger.info("[" + getIpAddr() + "] WxChartDataController::queryData chart: " + chart + " end");
return data;


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

@@ -170,8 +170,8 @@ public class WxCUserDataController extends BaseController {
params.put("startTime", startTime);
params.put("endTime", endTime);
params.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params.put("parentTenantId", tenantEntity.getParentTenantId());
}
MarkingCouponDataReportDto markingCouponDataReportDto = new MarkingCouponDataReportDto();
markingCouponDataReportDto.updateTenantInfo(tenantEntity);


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

@@ -43,7 +43,7 @@ public class WxScoreRulesController extends BaseController {
public ResultData add(@RequestBody WxScoreRules wxScoreRules) {
logger.debug("[" + getIpAddr() + "] WxScoreRulesController::add");
TenantEntity tenantEntity = getTenantInfo();
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "广场用户无此权限");
}
wxScoreRules.updateTenantInfo(tenantEntity);
@@ -72,7 +72,7 @@ public class WxScoreRulesController extends BaseController {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "creditLocked不能为空");
}
TenantEntity tenantEntity = getTenantInfo();
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "广场用户无此权限");
}
wxScoreRules.updateTenantInfo(tenantEntity);


+ 6
- 6
mallinkAdmin/src/main/java/com/iformall/controller/msg/WxMsgValidationcodeController.java Просмотреть файл

@@ -74,16 +74,16 @@ public class WxMsgValidationcodeController extends BaseController {
@GetMapping("sendvalidationcode")
@ApiImplicitParams({
@ApiImplicitParam(name = "tenantId", value = "租户ID", dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "subTenantId", value = "子租户ID", dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "parentTenantId", value = "父租户ID", dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "phone", value = "手机号", dataType = "String", paramType = "query", required = true),
@ApiImplicitParam(name = "type", value = "场景", dataType = "Integer", paramType = "query", required = true),
@ApiImplicitParam(name = "appid", value = "appid", dataType = "String", paramType = "query", required = true)})
public ResultData sendvalidationcode(String tenantId, String subTenantId, String phone, Integer type, String appid) {
public ResultData sendvalidationcode(String tenantId, String parentTenantId, String phone, Integer type, String appid) {
logger.debug("[" + getIpAddr() + "] WxMsgValidationcodeController::sendvalidationcode");
WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode();
wxMsgValidationcode.updateTenantInfo(new TenantEntity(){{
setTenantId(tenantId);
setSubTenantId(subTenantId);
setParentTenantId(parentTenantId);
}});
wxMsgValidationcode.setPhone(phone);
wxMsgValidationcode.setType(type);
@@ -94,17 +94,17 @@ public class WxMsgValidationcodeController extends BaseController {
@GetMapping("hasvalidationcode")
@ApiImplicitParams({
@ApiImplicitParam(name = "tenantId", value = "租户ID", dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "subTenantId", value = "子租户ID", dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "parentTenantId", value = "父租户ID", dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "phone", value = "手机号", dataType = "String", paramType = "query", required = true),
@ApiImplicitParam(name = "type", value = "场景", dataType = "Integer", paramType = "query", required = true),
@ApiImplicitParam(name = "code", value = "验证码", dataType = "String", paramType = "query", required = true),
@ApiImplicitParam(name = "appid", value = "appid", dataType = "String", paramType = "query", required = true)})
public ResultData hasvalidationcode(String tenantId, String subTenantId, String phone, Integer type, String code, String appid) {
public ResultData hasvalidationcode(String tenantId, String parentTenantId, String phone, Integer type, String code, String appid) {
logger.debug("[" + getIpAddr() + "] WxMsgValidationcodeController::hasvalidationcode");
WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode();
wxMsgValidationcode.updateTenantInfo(new TenantEntity(){{
setTenantId(tenantId);
setSubTenantId(subTenantId);
setParentTenantId(parentTenantId);
}});
wxMsgValidationcode.setPhone(phone);
wxMsgValidationcode.setType(type);


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

@@ -160,7 +160,7 @@ public class HomeController extends BaseController {
}
Map map = new HashMap();
if (mall.getGroupSupport().equals(EnumGroupSupport.SUPPORT.getCode()) &&
StringUtils.isBlank(info.getSubTenantId())) {
StringUtils.isBlank(info.getParentTenantId())) {
// 集团用户获取子商场
List<WxMall> mallList = mallService.getSubByParentTenantId(info.getTenantId());
map.put("subMalls", JSON.toJSONString(mallList));
@@ -193,12 +193,12 @@ public class HomeController extends BaseController {
}

@PostMapping("/selectMall")
@ApiOperation(value = "用户选中子广场及父广场", notes = "{\"tenantId\":\"string\",\"subTenantId\":\"string\"}")
@ApiOperation(value = "用户选中子广场及父广场", notes = "{\"tenantId\":\"string\",\"parentTenantId\":\"string\"}")
public ResultData selectMall(@RequestBody Map<String, String> map) {
logger.debug(map.toString());

String tenantId = map.get("tenantId");
String subTenantId = map.get("subTenantId");
String parentTenantId = map.get("parentTenantId");

if (StringUtils.isBlank(tenantId)) {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "tenantId不能为空");
@@ -208,10 +208,10 @@ public class HomeController extends BaseController {
if (userInfo.getTenantId().equalsIgnoreCase(tenantId)) {
Session session = SecurityUtils.getSubject().getSession();
session.setAttribute(UserSession.tenantId, tenantId);
if (StringUtils.isNotBlank(subTenantId)) {
session.setAttribute(UserSession.subTenantId, subTenantId);
if (StringUtils.isNotBlank(parentTenantId)) {
session.setAttribute(UserSession.parentTenantId, parentTenantId);
} else {
session.setAttribute(UserSession.subTenantId, null);
session.setAttribute(UserSession.parentTenantId, null);
}
}
return new ResultData();


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

@@ -74,8 +74,8 @@ public class SysMenuController extends BaseController {
MallUserInfo user = getUser();
if (user.checkGroupAdmin()) {
TenantEntity tenantEntity = getTenantInfo();
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
user.setSubTenantId(tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
user.setParentTenantId(tenantEntity.getParentTenantId());
}
}
List<MallPermission> menuList = mallPermissionService.getUserMenuList(user, 0L, false);


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

@@ -38,10 +38,10 @@ public class UploadController extends BaseController {
private QrCodeService qrCodeService;

private String getFileName(TenantEntity tenantEntity, String fileName) {
if (StringUtils.isBlank(tenantEntity.getSubTenantId())) {
if (StringUtils.isBlank(tenantEntity.getParentTenantId())) {
fileName = tenantEntity.getTenantId() + "/" + fileName;
} else {
fileName = tenantEntity.getTenantId() + "/" + tenantEntity.getSubTenantId() + "/" +fileName;
fileName = tenantEntity.getTenantId() + "/" + tenantEntity.getParentTenantId() + "/" +fileName;
}
return fileName;
}


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

@@ -460,8 +460,8 @@ public class WechatLoginController extends BaseController {
if(StringUtils.isBlank(userInfo.getTenantId())) {
userInfo.setTenantId(user.getTenantId());
}
if(StringUtils.isBlank(userInfo.getSubTenantId())) {
userInfo.setSubTenantId(user.getSubTenantId());
if(StringUtils.isBlank(userInfo.getParentTenantId())) {
userInfo.setParentTenantId(user.getParentTenantId());
}
if(userInfo.getId() == null && userInfo.getUsername() == null) {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);


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

@@ -66,8 +66,8 @@ public class MyShiroRealm extends AuthorizingRealm {
session.setAttribute(UserSession.userInfo, user);
session.setAttribute(UserSession.userId, user.getId());
session.setAttribute(UserSession.tenantId, user.getTenantId());
if (StringUtils.isNotBlank(user.getSubTenantId())) {
session.setAttribute(UserSession.subTenantId, user.getSubTenantId());
if (StringUtils.isNotBlank(user.getParentTenantId())) {
session.setAttribute(UserSession.parentTenantId, user.getParentTenantId());
}
return authenticationInfo;
}


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

@@ -8,6 +8,6 @@ public class UserSession {

public static String tenantId ="TENANT_ID";

public static String subTenantId ="SUB_TENANT_ID";
public static String parentTenantId ="PARENT_TENANT_ID";

}

+ 4
- 4
mallinkAdmin/src/main/java/com/iformall/tenant/TenantInfoImpl.java Просмотреть файл

@@ -23,14 +23,14 @@ public class TenantInfoImpl implements TenantInfo {
}

@Override
public String getSubTenantId() {
String subTenantId = null;
public String getParentTenantId() {
String parentTenantId = null;
try {
subTenantId = (String) SecurityUtils.getSubject().getSession().getAttribute(UserSession.subTenantId);
parentTenantId = (String) SecurityUtils.getSubject().getSession().getAttribute(UserSession.parentTenantId);
} catch (InvalidSessionException e) {
logger.error("InvalidSession: " + e.getMessage());
}
return subTenantId;
return parentTenantId;
}

@Override


+ 4
- 4
mallinkAdmin/src/main/java/com/iformall/ueditor/upload/Uploader.java Просмотреть файл

@@ -42,10 +42,10 @@ public class Uploader {
private AmazonS3 s3 = null;

private String getFileName(TenantEntity tenantEntity, String fileName) {
if (StringUtils.isBlank(tenantEntity.getSubTenantId())) {
if (StringUtils.isBlank(tenantEntity.getParentTenantId())) {
fileName = tenantEntity.getTenantId() + "/" + fileName;
} else {
fileName = tenantEntity.getTenantId() + "/" + tenantEntity.getSubTenantId() + "/" + fileName;
fileName = tenantEntity.getTenantId() + "/" + tenantEntity.getParentTenantId() + "/" + fileName;
}
return fileName;
}
@@ -81,10 +81,10 @@ public class Uploader {
MultipartFile multiReq= ((MultipartHttpServletRequest) this.request).getFile("upfile");
Session session = SecurityUtils.getSubject().getSession();
String tenantId = (String)session.getAttribute(UserSession.tenantId);
String subTenantId = (String)session.getAttribute(UserSession.subTenantId);
String parentTenantId = (String)session.getAttribute(UserSession.parentTenantId);
TenantEntity tenantEntity = new TenantEntity(){{
setTenantId(tenantId);
setSubTenantId(subTenantId);
setParentTenantId(parentTenantId);
}};
if (StringUtils.isBlank(tenantId)) {
logger.error("TENANT is null");


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

@@ -0,0 +1,450 @@


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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

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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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

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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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

+ 1
- 1
mallinkBApi/src/main/java/com/iformall/config/MyBatisConfiguration.java Просмотреть файл

@@ -14,7 +14,7 @@ public class MyBatisConfiguration {
MultiTenancy multiTenancy = new MultiTenancy();
Properties properties = new Properties();
properties.setProperty("tenantIdColumn", "tenant_id");
properties.setProperty("subTenantIdColumn", "sub_tenant_id");
properties.setProperty("parentTenantIdColumn", "parent_tenant_id");
properties.setProperty("dialect", "mysql");
properties.setProperty("tenantInfo", "com.iformall.tenant.TenantInfoImpl");
multiTenancy.setProperties(properties);


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

@@ -99,10 +99,10 @@ public class BaseController {
public TenantEntity getTenantInfo() {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String tenantId = (String) request.getAttribute(Constant.TENANT_ID);
String subTenantId = (String) request.getAttribute(Constant.SUB_TENANT_ID);
String parentTenantId = (String) request.getAttribute(Constant.PARENT_TENANT_ID);
TenantEntity tenantEntity = new TenantEntity() {{
setTenantId(tenantId);
setSubTenantId(subTenantId);
setParentTenantId(parentTenantId);
}};
return tenantEntity;
}


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

@@ -53,10 +53,10 @@ public class UploadController extends BaseController {
private AmazonS3 s3 = null;

private String getFileName(TenantEntity tenantEntity, String fileName) {
if (StringUtils.isBlank(tenantEntity.getSubTenantId())) {
if (StringUtils.isBlank(tenantEntity.getParentTenantId())) {
fileName = tenantEntity.getTenantId() + "/" + fileName;
} else {
fileName = tenantEntity.getTenantId() + "/" + tenantEntity.getSubTenantId() + "/" + fileName;
fileName = tenantEntity.getTenantId() + "/" + tenantEntity.getParentTenantId() + "/" + fileName;
}
return fileName;
}


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

@@ -138,8 +138,8 @@ public class WxCouponSendController extends BaseController {
}
TenantEntity tenantEntity = getTenantInfo();
params.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params.put("parentTenantId", tenantEntity.getParentTenantId());
}
params.put("channelType", channelType);
params.put("merchantId", getUser().getMerchantId());


+ 4
- 4
mallinkBApi/src/main/java/com/iformall/controller/WxInfoController.java Просмотреть файл

@@ -176,8 +176,8 @@ public class WxInfoController extends BaseController {
resultMap.put("token", token);
request.setAttribute(Constant.LOGIN_USER_KEY, oldUser.getId());
request.setAttribute(Constant.TENANT_ID, buUser.getTenantId());
if (StringUtils.isNotBlank(buUser.getSubTenantId())) {
request.setAttribute(Constant.SUB_TENANT_ID, buUser.getSubTenantId());
if (StringUtils.isNotBlank(buUser.getParentTenantId())) {
request.setAttribute(Constant.PARENT_TENANT_ID, buUser.getParentTenantId());
}

oldUser.setRegisterIp(ipaddress);
@@ -214,8 +214,8 @@ public class WxInfoController extends BaseController {
resultMap.put("token", token);
request.setAttribute(Constant.LOGIN_USER_KEY, newUser.getId());
request.setAttribute(Constant.TENANT_ID, buUser.getTenantId());
if (StringUtils.isNotBlank(buUser.getSubTenantId())) {
request.setAttribute(Constant.SUB_TENANT_ID, buUser.getSubTenantId());
if (StringUtils.isNotBlank(buUser.getParentTenantId())) {
request.setAttribute(Constant.PARENT_TENANT_ID, buUser.getParentTenantId());
}
}
return new ResultData(resultMap);


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

@@ -86,7 +86,7 @@ public class WxMerchantBUserController extends BaseController {
resultMap.put("creditLocked", EnumCreditLockedStatus.CLOSE.getCode());
}
resultMap.put("tenant_id",merchant.getTenantId());
resultMap.put("sub_tenant_id",merchant.getSubTenantId());
resultMap.put("parent_tenant_id",merchant.getParentTenantId());
resultMap.put("phone", user.getPhone());
resultMap.put("name", user.getName());
resultMap.put("merchant_name", merchant.getName());


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

@@ -80,16 +80,16 @@ public class WxMsgValidationcodeController extends BaseController {
@GetMapping("hasvalidationcode")
@ApiImplicitParams({
@ApiImplicitParam(name = "tenantId", value = "租户ID", dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "subTenantId", value = "子租户ID", dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "parentTenantId", value = "父租户ID", dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "phone", value = "手机号", dataType = "String", paramType = "query", required = true),
@ApiImplicitParam(name = "type", value = "场景", dataType = "Integer", paramType = "query", required = true),
@ApiImplicitParam(name = "code", value = "验证码", dataType = "String", paramType = "query", required = true),
@ApiImplicitParam(name = "appid", value = "appid", dataType = "String", paramType = "query", required = true)})
public ResultData hasvalidationcode(String tenantId, String subTenantId, String phone, Integer type, String code, String appid) {
public ResultData hasvalidationcode(String tenantId, String parentTenantId, String phone, Integer type, String code, String appid) {
WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode();
wxMsgValidationcode.updateTenantInfo(new TenantEntity(){{
setTenantId(tenantId);
setSubTenantId(subTenantId);
setParentTenantId(parentTenantId);
}});
wxMsgValidationcode.setPhone(phone);
wxMsgValidationcode.setType(EnumMsgModel.VALIDATION_CODE.getCode());


+ 5
- 5
mallinkBApi/src/main/java/com/iformall/tenant/TenantInfoImpl.java Просмотреть файл

@@ -27,16 +27,16 @@ public class TenantInfoImpl implements TenantInfo {
}

@Override
public String getSubTenantId() {
String subTenantId = null;
public String getParentTenantId() {
String parentTenantId = null;
try {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
subTenantId = (String) request.getAttribute(Constant.SUB_TENANT_ID);
return subTenantId;
parentTenantId = (String) request.getAttribute(Constant.PARENT_TENANT_ID);
return parentTenantId;
} catch (Exception e) {
logger.error(e.getMessage());
}
return subTenantId;
return parentTenantId;
}

@Override


+ 1
- 1
mallinkCApi/src/main/java/com/iformall/config/MyBatisConfiguration.java Просмотреть файл

@@ -14,7 +14,7 @@ public class MyBatisConfiguration {
MultiTenancy multiTenancy = new MultiTenancy();
Properties properties = new Properties();
properties.setProperty("tenantIdColumn", "tenant_id");
properties.setProperty("subTenantIdColumn", "sub_tenant_id");
properties.setProperty("parentTenantIdColumn", "parent_tenant_id");
properties.setProperty("dialect", "mysql");
properties.setProperty("tenantInfo", "com.iformall.tenant.TenantInfoImpl");
multiTenancy.setProperties(properties);


+ 4
- 4
mallinkCApi/src/main/java/com/iformall/controller/BaseController.java Просмотреть файл

@@ -79,10 +79,10 @@ public class BaseController {
public TenantEntity getTenantInfo() {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String tenantId = (String) request.getAttribute(Constant.TENANT_ID);
String subTenantId = (String) request.getAttribute(Constant.SUB_TENANT_ID);
String parentTenantId = (String) request.getAttribute(Constant.PARENT_TENANT_ID);
TenantEntity tenantEntity = new TenantEntity() {{
setTenantId(tenantId);
setSubTenantId(subTenantId);
setParentTenantId(parentTenantId);
}};
return tenantEntity;
}
@@ -106,8 +106,8 @@ public class BaseController {
if (user.getTenantId() == null) {
user.setTenantId(tenantEntity.getTenantId());
}
if (user.getSubTenantId() == null) {
user.setSubTenantId(tenantEntity.getSubTenantId());
if (user.getParentTenantId() == null) {
user.setParentTenantId(tenantEntity.getParentTenantId());
}
return user;
}


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

@@ -103,10 +103,10 @@ public class UploadController extends BaseController {
}

private String getFileName(TenantEntity tenantEntity, String fileName) {
if (StringUtils.isBlank(tenantEntity.getSubTenantId())) {
if (StringUtils.isBlank(tenantEntity.getParentTenantId())) {
fileName = tenantEntity.getTenantId() + "/" + fileName;
} else {
fileName = tenantEntity.getTenantId() + "/" + tenantEntity.getSubTenantId() + "/" + fileName;
fileName = tenantEntity.getTenantId() + "/" + tenantEntity.getParentTenantId() + "/" + fileName;
}
return fileName;
}


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

@@ -61,8 +61,8 @@ public class WxMerchantController extends BaseController {
HashMap<String, String> params = new HashMap<String, String>();
TenantEntity tenantEntity = getTenantInfo();
params.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params.put("parentTenantId", tenantEntity.getParentTenantId());
}
params.put("merchantCode", codeMD5);
WxMerchantVo wxMerchant = wxMerchantService.getMerchantInfo(params);


+ 12
- 12
mallinkCApi/src/main/java/com/iformall/controller/WxUserGrantController.java Просмотреть файл

@@ -266,8 +266,8 @@ public class WxUserGrantController extends BaseController {
// 老用户,给出来已选中的mall
if (mallList != null) {
WxMall selectedMall = null;
if (StringUtils.isNotBlank(oldUser.getSubTenantId())) {
final String lastSubTenant = oldUser.getSubTenantId();
if (StringUtils.isNotBlank(oldUser.getParentTenantId())) {
final String lastSubTenant = oldUser.getParentTenantId();
List<WxMall> selMallList = mallList.stream().filter(ml -> ml.getTenantId().equalsIgnoreCase(lastSubTenant)).collect(Collectors.toList());
if (selMallList.size() > 0) {
selectedMall = selMallList.get(0);
@@ -280,9 +280,9 @@ public class WxUserGrantController extends BaseController {
}
}
if (selectedMall != null) {
request.setAttribute(Constant.SUB_TENANT_ID, selectedMall.getTenantId());
request.setAttribute(Constant.PARENT_TENANT_ID, selectedMall.getTenantId());
resultMap.put("selectedMall", selectedMall.getTenantId());
oldUser.setSubTenantId(selectedMall.getTenantId());
oldUser.setParentTenantId(selectedMall.getTenantId());
}
}

@@ -361,9 +361,9 @@ public class WxUserGrantController extends BaseController {
WxMall firstMall = mallList.get(0);
if (firstMall != null) {
// 默认选中第一个mall, 或者经纬度最近的那个
request.setAttribute(Constant.SUB_TENANT_ID, firstMall.getTenantId());
request.setAttribute(Constant.PARENT_TENANT_ID, firstMall.getTenantId());
resultMap.put("selectedMall", firstMall.getTenantId());
newUser.setSubTenantId(firstMall.getTenantId());
newUser.setParentTenantId(firstMall.getTenantId());
}
}

@@ -376,26 +376,26 @@ public class WxUserGrantController extends BaseController {
}

@PostMapping("/selectMall")
@ApiOperation(value = "用户选中子广场", notes = "{\"tenantId\":\"string\",\"subTenantId\":\"string\"}")
@ApiOperation(value = "用户选中子广场", notes = "{\"tenantId\":\"string\",\"parentTenantId\":\"string\"}")
public ResultData selectMall(@RequestBody Map<String, String> map) {
logger.debug(map.toString());

String tenantId = map.get("tenantId");
String subTenantId = map.get("subTenantId");
String parentTenantId = map.get("parentTenantId");

if (StringUtils.isBlank(tenantId)) {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "tenantId不能为空");
}
if (StringUtils.isBlank(subTenantId)) {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "subTenantId不能为空");
if (StringUtils.isBlank(parentTenantId)) {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "parentTenantId不能为空");
}

WxCUser user = getUser();
if (user.getTenantId().equalsIgnoreCase(tenantId)) {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
request.setAttribute(Constant.TENANT_ID, tenantId);
request.setAttribute(Constant.SUB_TENANT_ID, subTenantId);
user.setSubTenantId(subTenantId);
request.setAttribute(Constant.PARENT_TENANT_ID, parentTenantId);
user.setParentTenantId(parentTenantId);
userTokenService.saveOrUpdate(user);
}



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

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

return true;


+ 5
- 5
mallinkCApi/src/main/java/com/iformall/tenant/TenantInfoImpl.java Просмотреть файл

@@ -27,16 +27,16 @@ public class TenantInfoImpl implements TenantInfo {
}

@Override
public String getSubTenantId() {
String subTenantId = null;
public String getParentTenantId() {
String parentTenantId = null;
try {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
subTenantId = (String) request.getAttribute(Constant.SUB_TENANT_ID);
return subTenantId;
parentTenantId = (String) request.getAttribute(Constant.PARENT_TENANT_ID);
return parentTenantId;
} catch (Exception e) {
logger.error(e.getMessage());
}
return subTenantId;
return parentTenantId;
}

@Override


+ 3
- 3
mallinkCallback/src/main/java/com/iformall/controller/callback/WxCarETCPCallBackController.java Просмотреть файл

@@ -326,8 +326,8 @@ public class WxCarETCPCallBackController extends BaseController {
if (StringUtils.isNotBlank(wxCarCmdLog.getTenantId())) {
map.put("tenantId", wxCarCmdLog.getTenantId());
}
if (StringUtils.isNotBlank(wxCarCmdLog.getSubTenantId())) {
map.put("subTenantId", wxCarCmdLog.getSubTenantId());
if (StringUtils.isNotBlank(wxCarCmdLog.getParentTenantId())) {
map.put("parentTenantId", wxCarCmdLog.getParentTenantId());
}
WxCarCmdLog carCmdLog = wxCarCmdLogService.getBySynId(map);
if(carCmdLog != null) {
@@ -357,7 +357,7 @@ public class WxCarETCPCallBackController extends BaseController {
List<WxCUserCar> userCarList = wxCUserCarService.getList(userCarQ);
boolean bFirst = true;
for (WxCUserCar userCar : userCarList) {
userCar.setSubTenantId(park.getSubTenantId());
userCar.setParentTenantId(park.getParentTenantId());
wxCouponSendService.sendCouponToUser(EnumCouponSendSendType.CAR_STOP, userCar);
WxCUser cUser = wxCUserService.getById(userCar.getCUserId());
if(cUser != null){


+ 1
- 1
mallinkCallback/src/main/java/com/iformall/controller/callback/WxCarTJDCallBackController.java Просмотреть файл

@@ -164,7 +164,7 @@ public class WxCarTJDCallBackController extends BaseController {
List<WxCUserCar> userCarList = wxCUserCarService.getList(userCarQ);
boolean bFirst = true;
for (WxCUserCar userCar : userCarList) {
userCar.setSubTenantId(park.getSubTenantId());
userCar.setParentTenantId(park.getParentTenantId());
wxCouponSendService.sendCouponToUser(EnumCouponSendSendType.CAR_STOP, userCar);
WxCUser cUser = wxCUserService.getById(userCar.getCUserId());
if(cUser != null){


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

@@ -120,10 +120,10 @@ public class PosServiceImpl implements PosService {
WxMerchant merchant = checkAndGetMerchant(orgUser.getMerchantId());
// check password
if (orgUser.getUserPwd().equalsIgnoreCase(password)) {
if (StringUtils.isBlank(orgUser.getSubTenantId())) {
if (StringUtils.isBlank(orgUser.getParentTenantId())) {
retMap.put(WxPayConstant.TENANT_ID, orgUser.getTenantId());
} else {
retMap.put(WxPayConstant.TENANT_ID, orgUser.getSubTenantId());
retMap.put(WxPayConstant.TENANT_ID, orgUser.getParentTenantId());
}
retMap.put(WxPayConstant.MALL_NAME, mall.getName());
retMap.put(WxPayConstant.MERCHANT_ID, String.valueOf(orgUser.getMerchantId()));
@@ -336,8 +336,8 @@ public class PosServiceImpl implements PosService {
if (!config.getCoupon().equals(EnumPosCouponEnableType.Disable.getCode())) {
Map<String, Object> coQ = new HashMap<>();
coQ.put("tenantId", tenantId);
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
coQ.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
coQ.put("parentTenantId", tenantEntity.getParentTenantId());
}
coQ.put("cUserId", user.getId());
coQ.put("merchantId", merchantId);
@@ -941,8 +941,8 @@ public class PosServiceImpl implements PosService {
if (!config.getCoupon().equals(EnumPosCouponEnableType.Disable.getCode())) {
Map<String, Object> coQ = new HashMap<>();
coQ.put("tenantId", tenantId);
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
coQ.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
coQ.put("parentTenantId", tenantEntity.getParentTenantId());
}
coQ.put("cUserId", user.getId());
coQ.put("merchantId", merchantId);


+ 4
- 4
mallinkSchedule/src/main/java/com/iformall/schedule/BillNotificationSchedule.java Просмотреть файл

@@ -55,7 +55,7 @@ public class BillNotificationSchedule {
List<Map<String, Object>> oweBillList = wxBillAllMapper.getOweBill();
for (Map<String, Object> bill : oweBillList) {
String tenantId = bill.get("tenantId").toString();
String subTenantId = bill.get("subTenantId").toString();
String parentTenantId = bill.get("parentTenantId").toString();
logger.info("欠缴账单:" + JSONObject.toJSONString(bill));
BigDecimal owe = (BigDecimal) bill.get("owe");
BigDecimal price = owe.divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN);
@@ -70,7 +70,7 @@ public class BillNotificationSchedule {
wxMsgRecord.setReceiver(phone);
wxMsgRecord.updateTenantInfo(new TenantEntity(){{
setTenantId(tenantId);
setSubTenantId(subTenantId);
setParentTenantId(parentTenantId);
}});
Map<String, String> map = new HashedMap();
map.put("price", price.toString());
@@ -86,7 +86,7 @@ public class BillNotificationSchedule {
List<Map<String, Object>> waitBillList = wxBillAllMapper.getWaitPayBill();
for (Map<String, Object> bill : waitBillList) {
String tenantId = bill.get("tenantId").toString();
String subTenantId = bill.get("subTenantId").toString();
String parentTenantId = bill.get("parentTenantId").toString();
logger.info("待缴账单账单:" + JSONObject.toJSONString(bill));

String receiveDate = bill.get("receiveDate").toString();
@@ -103,7 +103,7 @@ public class BillNotificationSchedule {
wxMsgRecord.setReceiver(phone);
wxMsgRecord.updateTenantInfo(new TenantEntity(){{
setTenantId(tenantId);
setSubTenantId(subTenantId);
setParentTenantId(parentTenantId);
}});
Map<String, String> map = new HashedMap();
map.put("price", price.toString());


+ 6
- 6
mallinkSchedule/src/main/java/com/iformall/schedule/ChartDataSchedule.java Просмотреть файл

@@ -81,8 +81,8 @@ public class ChartDataSchedule {
for (WxMall wxMall : wxMalls) {
TenantEntity tenantEntity = wxMall.getTenantInfo();
params.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params.put("subTenantId", wxMall.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params.put("parentTenantId", wxMall.getTenantId());
}
wxChartDataEntity.updateTenantInfo(tenantEntity);
wxChartDataEntity.setType(EnumChartType.CAR_OUT.getCode());
@@ -143,8 +143,8 @@ public class ChartDataSchedule {
for (WxMall wxMall : wxMalls) {
TenantEntity tenantEntity = wxMall.getTenantInfo();
params.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params.put("parentTenantId", tenantEntity.getParentTenantId());
}
wxChartDataEntity.updateTenantInfo(tenantEntity);
wxChartDataEntity.setType(EnumChartType.SALE_COUPON_PRICE.getCode());
@@ -177,8 +177,8 @@ public class ChartDataSchedule {
for (WxMall wxMall : wxMalls) {
TenantEntity tenantEntity = wxMall.getTenantInfo();
params.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params.put("parentTenantId", tenantEntity.getParentTenantId());
}

wxChartDataEntity.updateTenantInfo(tenantEntity);


+ 2
- 2
mallinkSchedule/src/main/java/com/iformall/schedule/CouponSendSchedule.java Просмотреть файл

@@ -161,8 +161,8 @@ public class CouponSendSchedule {
int sentCount = couponSendList.stream().map(cs -> {
Map params = new HashMap<String, Object>();
params.put("tenantId", cs.getTenantId());
if (StringUtils.isNotBlank(cs.getSubTenantId())) {
params.put("subTenantId", cs.getSubTenantId());
if (StringUtils.isNotBlank(cs.getParentTenantId())) {
params.put("parentTenantId", cs.getParentTenantId());
}
params.put("cUserId", cu.getId());
params.put("couponId", cs.getCouponId());


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

@@ -142,7 +142,7 @@ public class MallUserInfo extends TenantEntity {
if(StringUtils.isBlank(getTenantId())) {
return false;
}
if(StringUtils.isBlank(getSubTenantId()) &&
if(StringUtils.isBlank(getParentTenantId()) &&
isAdmin.equals(EnumUserAdmin.ADMIN.getCode())) {
return true;
}


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

@@ -24,8 +24,8 @@ public class WxChartDataEntity extends TenantEntity {
sb.append("WxChartDataEntity{")
.append("id=").append(id)
.append(", tenantId='").append(getTenantId()).append('\'');
if (getSubTenantId() != null) {
sb.append(", subTenantId='").append(getSubTenantId()).append('\'');
if (getParentTenantId() != null) {
sb.append(", parentTenantId='").append(getParentTenantId()).append('\'');
}
sb.append(", type=").append(type)
.append(", result='").append(result).append('\'')


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

@@ -133,16 +133,16 @@ public class WxMall extends BaseEntity {
} else {
TenantEntity mul = new TenantEntity();
mul.setTenantId(getParentTenantId());
mul.setSubTenantId(getTenantId());
mul.setParentTenantId(getTenantId());
return mul;
}
}

public void setTenantInfo(TenantEntity tenantInfo) {
if (StringUtils.isBlank(tenantInfo.getSubTenantId())) {
if (StringUtils.isBlank(tenantInfo.getParentTenantId())) {
setTenantId(tenantInfo.getTenantId());
} else {
setTenantId(tenantInfo.getSubTenantId());
setTenantId(tenantInfo.getParentTenantId());
setParentTenantId(tenantInfo.getTenantId());
}
}


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

@@ -17,8 +17,8 @@ public class BaseTenantEntity extends BaseEntity {
private String tenantId;

@TableField(exist = false)
@io.swagger.annotations.ApiModelProperty(value="子租户ID",name="subTenantId")
private String subTenantId;
@io.swagger.annotations.ApiModelProperty(value="父租户ID",name="parentTenantId")
private String parentTenantId;
@TableField(exist = false)
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
@@ -26,15 +26,15 @@ public class BaseTenantEntity extends BaseEntity {

public void updateTenantInfo(TenantEntity info) {
setTenantId(info.getTenantId());
if (StringUtils.isNotBlank(info.getSubTenantId())) {
setSubTenantId(info.getSubTenantId());
if (StringUtils.isNotBlank(info.getParentTenantId())) {
setParentTenantId(info.getParentTenantId());
}
}

public void updateTenantInfo(BaseTenantEntity info) {
setTenantId(info.getTenantId());
if (StringUtils.isNotBlank(info.getSubTenantId())) {
setSubTenantId(info.getSubTenantId());
if (StringUtils.isNotBlank(info.getParentTenantId())) {
setParentTenantId(info.getParentTenantId());
}
}



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

@@ -14,20 +14,20 @@ public class TenantEntity extends BaseEntity {
@io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId")
private String tenantId;

@io.swagger.annotations.ApiModelProperty(value="子租户ID",name="subTenantId")
private String subTenantId;
@io.swagger.annotations.ApiModelProperty(value="父租户ID",name="parentTenantId")
private String parentTenantId;

public void updateTenantInfo(TenantEntity info) {
setTenantId(info.getTenantId());
if (StringUtils.isNotBlank(info.getSubTenantId())) {
setSubTenantId(info.getSubTenantId());
if (StringUtils.isNotBlank(info.getParentTenantId())) {
setParentTenantId(info.getParentTenantId());
}
}

public void updateTenantInfo(BaseTenantEntity info) {
setTenantId(info.getTenantId());
if (StringUtils.isNotBlank(info.getSubTenantId())) {
setSubTenantId(info.getSubTenantId());
if (StringUtils.isNotBlank(info.getParentTenantId())) {
setParentTenantId(info.getParentTenantId());
}
}
}

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

@@ -34,11 +34,11 @@ public class InvestBaseEntity extends TenantEntity {
private String tenantId;

/**
* 租户ID
* 租户ID
*/
@io.swagger.annotations.ApiModelProperty(value = "子租户ID", name = "subTenantId")
@io.swagger.annotations.ApiModelProperty(value = "父租户ID", name = "parentTenantId")
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
private String subTenantId;
private String parentTenantId;

/**
* 创建时间


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

@@ -28,8 +28,8 @@ public class BaseMsg extends BaseEntity {
private String tenantId;

@TableField(exist = false)
@io.swagger.annotations.ApiModelProperty(value="子租户id",name="subTenantId")
private String subTenantId;
@io.swagger.annotations.ApiModelProperty(value="父租户id",name="parentTenantId")
private String parentTenantId;

@io.swagger.annotations.ApiModelProperty(value="唯一标识",name="uuid")
@TableField(exist = false)
@@ -57,18 +57,18 @@ public class BaseMsg extends BaseEntity {

public void updateTenantInfo(TenantEntity tenantEntity) {
setTenantId(tenantEntity.getTenantId());
setSubTenantId(tenantEntity.getSubTenantId());
setParentTenantId(tenantEntity.getParentTenantId());
}

public void updateTenantInfo(BaseTenantEntity tenantEntity) {
setTenantId(tenantEntity.getTenantId());
setSubTenantId(tenantEntity.getSubTenantId());
setParentTenantId(tenantEntity.getParentTenantId());
}

public TenantEntity getTenantInfo() {
return new TenantEntity() {{
setTenantId(tenantId);
setSubTenantId(subTenantId);
setParentTenantId(parentTenantId);
}};
}



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

@@ -12,8 +12,8 @@ public class FmInsideCLoginMsg extends BaseMsg{

@io.swagger.annotations.ApiModelProperty(value = "租户ID", name = "tenantId")
private String tenantId;
@io.swagger.annotations.ApiModelProperty(value="子租户id",name="subTenantId")
private String subTenantId;
@io.swagger.annotations.ApiModelProperty(value="父租户id",name="parentTenantId")
private String parentTenantId;
@io.swagger.annotations.ApiModelProperty(value = "用户ID", name = "cUserId")
private Long cUserId;



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

@@ -12,8 +12,8 @@ public class FmInsideCouponVerifyMsg extends BaseMsg{

@io.swagger.annotations.ApiModelProperty(value = "租户ID", name = "tenantId")
private String tenantId;
@io.swagger.annotations.ApiModelProperty(value="子租户id",name="subTenantId")
private String subTenantId;
@io.swagger.annotations.ApiModelProperty(value="父租户id",name="parentTenantId")
private String parentTenantId;
@io.swagger.annotations.ApiModelProperty(value = "券包ID", name = "couponOrderId")
private Long couponOrderId;
@io.swagger.annotations.ApiModelProperty(value = "B端用户ID", name = "bUserId")


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

@@ -11,8 +11,8 @@ public class FmInsideOrderSuccessMsg extends BaseMsg{

@io.swagger.annotations.ApiModelProperty(value = "租户ID", name = "tenantId")
private String tenantId;
@io.swagger.annotations.ApiModelProperty(value="子租户id",name="subTenantId")
private String subTenantId;
@io.swagger.annotations.ApiModelProperty(value="父租户id",name="parentTenantId")
private String parentTenantId;
@io.swagger.annotations.ApiModelProperty(value = "成功订单ID", name = "orderId")
private Long orderId;
@io.swagger.annotations.ApiModelProperty(value = "券ID", name = "couponId")


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

@@ -22,8 +22,8 @@ public class WxMsg extends BaseMsg {

@io.swagger.annotations.ApiModelProperty(value = "租户ID", name = "tenantId")
private String tenantId;
@io.swagger.annotations.ApiModelProperty(value="子租户ID",name="subTenantId")
private String subTenantId;
@io.swagger.annotations.ApiModelProperty(value="父租户ID",name="parentTenantId")
private String parentTenantId;
@io.swagger.annotations.ApiModelProperty(value = "模板id", name = "modelId")
private Long modelId;
@io.swagger.annotations.ApiModelProperty(value = "内容", name = "msg")


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

@@ -28,6 +28,6 @@ public interface KwMerchantMeterMapper extends CommonMapper<KwMerchantMeter, Lon
int unbindBatch(@Param("merchantId")Long merchantId);
int unbind(@Param("meterId")Long meterId);

List<MerchantMeterVo> getMerchantMeter(@Param("tenantId") String tenantId, @Param("subTenantId") String subTenantId);
List<MerchantMeterVo> getMerchantMeter(@Param("tenantId") String tenantId, @Param("parentTenantId") String parentTenantId);

}

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

@@ -11,7 +11,7 @@ public interface PosMallConfigMapper extends CommonMapper<PosMallConfig, Long> {
@Deprecated
PosMallConfig getByTenantId(String tenantId);

PosMallConfig getByTenantInfo(String tenantId, String subTenantId);
PosMallConfig getByTenantInfo(String tenantId, String parentTenantId);



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

@@ -11,8 +11,8 @@ public interface WxBusinessMapper extends CommonMapper<WxBusiness, String> {
List<WxBusiness> findList(WxBusiness wxBusiness);

List<WxBusiness> findListAll();
List<WxBusiness> findListForMerchant(@Param("tenantId") String tenantId, @Param("subTenantId") String subTenantId);
List<WxBusiness> findListForCoupon(@Param("tenantId") String tenantId, @Param("subTenantId") String subTenantId);
List<WxBusiness> findListForMerchant(@Param("tenantId") String tenantId, @Param("parentTenantId") String parentTenantId);
List<WxBusiness> findListForCoupon(@Param("tenantId") String tenantId, @Param("parentTenantId") String parentTenantId);


List<Map<String,Object>> businessDataList(WxBusiness wxBusiness);


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

@@ -14,7 +14,7 @@ public interface WxCampaignMapper extends CommonMapper<WxCampaign, Long> {

List<WxCampaign> findCList(WxCampaign wxCampaign);

int getMaxSortNum(String tenantId, String subTenantId);
int getMaxSortNum(String tenantId, String parentTenantId);

List<WxCampaign> queryNotify(WxCampaign wxCampaign);



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

@@ -33,10 +33,10 @@ public interface WxCouponActionLogMapper extends CommonMapper<WxCouponActionLog,
* @param endTime
* @return
*/
int getCountByDateLimit(@Param("tenantId")String tenantId,@Param("subTenantId")String subTenantId,@Param("startTime") Date startTime,@Param("endTime")Date endTime);
int getCountByDateLimit(@Param("tenantId")String tenantId,@Param("parentTenantId")String parentTenantId,@Param("startTime") Date startTime,@Param("endTime")Date endTime);


int getCountByChannelId(@Param("tenantId")String tenantId,@Param("subTenantId")String subTenantId,@Param("channelType") int channelType,@Param("channelId")Long channelId);
int getCountByChannelId(@Param("tenantId")String tenantId,@Param("parentTenantId")String parentTenantId,@Param("channelType") int channelType,@Param("channelId")Long channelId);

/**
* 每人每天最多可接收多少张券


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

@@ -65,7 +65,7 @@ public interface WxCouponOrderMapper extends CommonMapper<WxCouponOrder, Long> {
* @param endTime
* @return
*/
List<CUserDateAmountVo> queryPriceTotalGroup(@Param("tenantId")String tenantId, @Param("subTenantId")String subTenantId, @Param("startTime") Date startTime, @Param("endTime")Date endTime);
List<CUserDateAmountVo> queryPriceTotalGroup(@Param("tenantId")String tenantId, @Param("parentTenantId")String parentTenantId, @Param("startTime") Date startTime, @Param("endTime")Date endTime);


List<MarkingSceneDataVo> queryForSceneRepotyHistoryVerified(HashMap<String,Object> params);


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

@@ -63,7 +63,7 @@ public interface WxRentContractMapper extends CommonMapper<WxRentContract, Long>
List<WxRentContract> selectRentContractByShopIds(@Param("shopIds") Collection<Long> shopIds,
@Param("shopIdsRegexp") String shopIdsRegexp,
@Param("tenantId") String tenantId,
@Param("subTenantId") String subTenantId);
@Param("parentTenantId") String parentTenantId);

int hasContractNumber(WxRentContract wxRentContract);



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

@@ -110,8 +110,8 @@ public class DataTowerServiceImpl implements DataTowerService {
HashMap<String, Object> rentMap = new HashMap<>();
Map<String, Object> params = new HashMap<>();
params.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params.put("parentTenantId", tenantEntity.getParentTenantId());
}

Calendar instance = Calendar.getInstance();
@@ -183,8 +183,8 @@ public class DataTowerServiceImpl implements DataTowerService {
HashMap<String, Object> carMap = new HashMap<>();
HashMap<String, Object> paramsCar = new HashMap<>();
paramsCar.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
paramsCar.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
paramsCar.put("parentTenantId", tenantEntity.getParentTenantId());
}
paramsCar.put("cmdType", EnumCarCmd.CAR_ETCP_CALLBACK_PARK_IN.getCode());
String startdate = DateUtils.getTimeBefore(30, new Date());
@@ -428,8 +428,8 @@ public class DataTowerServiceImpl implements DataTowerService {
//租金
Map<String, Object> params = new HashMap<>();
params.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params.put("parentTenantId", tenantEntity.getParentTenantId());
}
Calendar instance = Calendar.getInstance();
instance.set(Calendar.DAY_OF_YEAR, 1);
@@ -494,8 +494,8 @@ public class DataTowerServiceImpl implements DataTowerService {
logger.info("停车-月统计-开始");
HashMap<String, Object> params = new HashMap<>();
params.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params.put("parentTenantId", tenantEntity.getParentTenantId());
}
params.put("cmdType", EnumCarCmd.CAR_ETCP_CALLBACK_PARK_IN.getCode());
String startdate = DateUtils.getTimeBefore(30, new Date());
@@ -531,8 +531,8 @@ public class DataTowerServiceImpl implements DataTowerService {
logger.info("停车-查询近一周的缴费车辆-开始");
HashMap<String, Object> weekParams = new HashMap<>();
weekParams.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
weekParams.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
weekParams.put("parentTenantId", tenantEntity.getParentTenantId());
}
String oneWeekStartdate = DateUtils.getTimeBefore(7, new Date());
String oneWeekEndDate = DateUtils.getTimeBefore(1, new Date());
@@ -704,8 +704,8 @@ public class DataTowerServiceImpl implements DataTowerService {
logger.info("停车-绑定车牌-开始");
Map<String,Object> carParams=new HashMap<>();
carParams.put("tenantId",tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
carParams.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
carParams.put("parentTenantId", tenantEntity.getParentTenantId());
}
carParams.put("startdate",DateUtils.getSystemTime("yyyy-MM-dd 00:00:00"));
carParams.put("enddate",DateUtils.getSystemTime("yyyy-MM-dd HH:mm:ss"));


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

@@ -78,10 +78,10 @@ public class MallPermissionServiceImpl implements MallPermissionService {
if(userInfo.isFmSuperAdmin() ||
userInfo.getIsAdmin().equals(EnumUserAdmin.ADMIN.getCode())) {
WxMall q = new WxMall() {{
if (StringUtils.isBlank(userInfo.getSubTenantId())) {
if (StringUtils.isBlank(userInfo.getParentTenantId())) {
setTenantId(userInfo.getTenantId());
} else {
setTenantId(userInfo.getSubTenantId());
setTenantId(userInfo.getParentTenantId());
setParentTenantId(userInfo.getTenantId());
}
}};
@@ -135,7 +135,7 @@ public class MallPermissionServiceImpl implements MallPermissionService {
} else if (userInfo.checkAdmin()) {
// 租户超管
WxMall q = new WxMall() {{
setTenantId(userInfo.getSubTenantId());
setTenantId(userInfo.getParentTenantId());
setParentTenantId(userInfo.getTenantId());
}};
String menus = wxMallMapper.queryMenusByTenantInfo(q);


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

@@ -107,8 +107,8 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService {
//couponData
HashMap<String, Object> params = new HashMap<>();
params.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params.put("parentTenantId", tenantEntity.getParentTenantId());
}
params.put("startTime", addDay(-30));
params.put("endTime", addDay(1));
@@ -149,9 +149,9 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService {
@Override
public Map<String, Object> getSceneData(TenantEntity tenantEntity) {
//今日营销投放券数
int todaySceneCount = wxCouponActionLogMapper.getCountByDateLimit(tenantEntity.getTenantId(), tenantEntity.getSubTenantId(), addDay(0), addDay(1));
int yesterdayCount = wxCouponActionLogMapper.getCountByDateLimit(tenantEntity.getTenantId(), tenantEntity.getSubTenantId(), addDay(-1), addDay(0));
int lastWeekCount = wxCouponActionLogMapper.getCountByDateLimit(tenantEntity.getTenantId(), tenantEntity.getSubTenantId(), addDay(-7), addDay(-6));
int todaySceneCount = wxCouponActionLogMapper.getCountByDateLimit(tenantEntity.getTenantId(), tenantEntity.getParentTenantId(), addDay(0), addDay(1));
int yesterdayCount = wxCouponActionLogMapper.getCountByDateLimit(tenantEntity.getTenantId(), tenantEntity.getParentTenantId(), addDay(-1), addDay(0));
int lastWeekCount = wxCouponActionLogMapper.getCountByDateLimit(tenantEntity.getTenantId(), tenantEntity.getParentTenantId(), addDay(-7), addDay(-6));

NumberFormat nf = NumberFormat.getPercentInstance();
nf.setMinimumFractionDigits(2);//控制保留小数点后几位,2:表示保留2位小数点
@@ -166,8 +166,8 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService {

HashMap<String, Object> params = new HashMap<>();
params.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params.put("parentTenantId", tenantEntity.getParentTenantId());
}
params.put("startTime", addDay(-30));
params.put("endTime", addDay(1));
@@ -178,8 +178,8 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService {
//停车发券被核销数
HashMap<String, Object> params1 = new HashMap<>();
params1.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params1.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params1.put("parentTenantId", tenantEntity.getParentTenantId());
}
params1.put("startTime", addDay(-30));
params1.put("endTime", addDay(1));
@@ -190,8 +190,8 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService {
//核销发券被核销数
HashMap<String, Object> params2 = new HashMap<>();
params2.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params2.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params2.put("parentTenantId", tenantEntity.getParentTenantId());
}
params2.put("startTime", addDay(-30));
params2.put("endTime", addDay(1));
@@ -202,8 +202,8 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService {
// B端刷卡支付被核销数
HashMap<String, Object> params3 = new HashMap<>();
params3.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params3.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params3.put("parentTenantId", tenantEntity.getParentTenantId());
}
params3.put("startTime", addDay(-30));
params3.put("endTime", addDay(1));
@@ -214,8 +214,8 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService {
// 购买发券被核销数
HashMap<String, Object> params4 = new HashMap<>();
params4.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params4.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params4.put("parentTenantId", tenantEntity.getParentTenantId());
}
params4.put("startTime", addDay(-30));
params4.put("endTime", addDay(1));
@@ -285,8 +285,8 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService {
public PageInfo<MarkingCouponDataReportVo> getCouponDataList(TenantEntity tenantEntity, MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageIndex, Integer pageSize) {
HashMap<String, Object> params = new HashMap<>();
params.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params.put("parentTenantId", tenantEntity.getParentTenantId());
}
if (markingCouponDataReportDto.getStartTime() != null)
params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(), 0));
@@ -329,7 +329,7 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService {

HashMap<String, Object> params = new HashMap<>();
params.put("tenantId", tenantEntity.getTenantId());
params.put("subTenantId", tenantEntity.getSubTenantId());
params.put("parentTenantId", tenantEntity.getParentTenantId());

if (markingCouponDataReportDto.getStartTime() != null) {
params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(), 0));
@@ -372,8 +372,8 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService {

params.clear();
params.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params.put("parentTenantId", tenantEntity.getParentTenantId());
}
if(markingCouponDataReportDto.getType().equals(EnumCouponSendSendType.CAR_STOP.getCode())){ //停车
//停车发券被核销数
@@ -426,8 +426,8 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService {

params.clear();
params.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params.put("parentTenantId", tenantEntity.getParentTenantId());
}
if(markingCouponDataReportDto.getType().equals(EnumCouponSendSendType.CAR_STOP.getCode())){ //停车
//获取车辆进场数
@@ -753,8 +753,8 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService {
//核销量
HashMap<String, Object> params2 = new HashMap<>();
params2.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params2.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params2.put("parentTenantId", tenantEntity.getParentTenantId());
}
if (markingCouponDataReportDto.getStartTime() != null)
params2.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0));
@@ -769,7 +769,7 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService {
//查询UV PV
HashMap<String, Object> params = new HashMap<>();
params.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params.put("tenantId", tenantEntity.getTenantId());
}
params.put("startTime", addDay(-30));


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

@@ -35,7 +35,7 @@ public class PosMallConfigServiceImpl implements PosMallConfigService {

@Override
public PosMallConfig getByTenantInfo(TenantEntity tenantEntity) {
PosMallConfig config = posMallConfigMapper.getByTenantInfo(tenantEntity.getTenantId(), tenantEntity.getSubTenantId());
PosMallConfig config = posMallConfigMapper.getByTenantInfo(tenantEntity.getTenantId(), tenantEntity.getParentTenantId());
return config;
}



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

@@ -41,8 +41,8 @@ public class PushLimitServiceImpl implements PushLimitService {
private String getKey(TenantEntity tenantEntity) {
StringBuilder sb = new StringBuilder();
sb.append(Constant.PUSH_LIMIT_KEY_PREV).append(tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
sb.append("-").append(tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
sb.append("-").append(tenantEntity.getParentTenantId());
}
return sb.toString();
}
@@ -168,8 +168,8 @@ public class PushLimitServiceImpl implements PushLimitService {
// 3. check 每人每天多少张券
Map params = new HashMap<String, Object>();
params.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params.put("parentTenantId", tenantEntity.getParentTenantId());
}
params.put("cUserId", cUserId);
int countForUser = wxCouponActionLogMapper.getCountByUser(params);


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

@@ -303,10 +303,10 @@ public class QrCodeServiceImpl implements QrCodeService {
}

private String getFileName(TenantEntity tenantEntity, String fn) {
if (StringUtils.isBlank(tenantEntity.getSubTenantId())) {
if (StringUtils.isBlank(tenantEntity.getParentTenantId())) {
fn = tenantEntity.getTenantId() + "/" + fn;
} else {
fn = tenantEntity.getTenantId() + "/" + tenantEntity.getSubTenantId() + "/" + fn;
fn = tenantEntity.getTenantId() + "/" + tenantEntity.getParentTenantId() + "/" + fn;
}
return fn;
}


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

@@ -1639,14 +1639,14 @@ public class WxBillAllServiceImpl implements WxBillAllService {
continue;
}
String tenantId = (String) mapList.get(0).get("tenantId");
String subTenantId = (String) mapList.get(0).get("subTenantId");
String parentTenantId = (String) mapList.get(0).get("parentTenantId");
String receiveDate = (String) mapList.get(0).get("receiveDate");
String manager = (String) mapList.get(0).get("manager");
String managerPhone = (String) mapList.get(0).get("managerPhone");

TenantEntity tenantEntity = new TenantEntity() {{
setTenantId(tenantId);
setSubTenantId(subTenantId);
setParentTenantId(parentTenantId);
}};

String billListStr = "";
@@ -1699,7 +1699,7 @@ public class WxBillAllServiceImpl implements WxBillAllService {
continue;
}
String tenantId = (String) mapList.get(0).get("tenantId");
String subTenantId = (String) mapList.get(0).get("subTenantId");
String parentTenantId = (String) mapList.get(0).get("parentTenantId");
String receiveDate = (String) mapList.get(0).get("receiveDate");
String manager = (String) mapList.get(0).get("manager");
String managerPhone = (String) mapList.get(0).get("managerPhone");
@@ -1707,7 +1707,7 @@ public class WxBillAllServiceImpl implements WxBillAllService {

TenantEntity tenantEntity = new TenantEntity() {{
setTenantId(tenantId);
setSubTenantId(subTenantId);
setParentTenantId(parentTenantId);
}};

String billListStr = "";


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

@@ -106,8 +106,8 @@ public class WxBillDailyServiceImpl implements WxBillDailyService {
public void updateWaidPayStatus(WxBillDaily record) {
Map<String, Object> params = new HashMap<>();
params.put("tenantId", record.getTenantId());
if (StringUtils.isNotBlank(record.getSubTenantId())) {
params.put("subTenantId", record.getSubTenantId());
if (StringUtils.isNotBlank(record.getParentTenantId())) {
params.put("parentTenantId", record.getParentTenantId());
}
params.put("waitPay", EnumBillDailyStatus.WAIT_PAY.getCode());
params.put("paid", EnumBillRentStatus.PAID.getCode());
@@ -124,8 +124,8 @@ public class WxBillDailyServiceImpl implements WxBillDailyService {
public void updateNotPaidStatus(WxBillDaily record) {
Map<String, Object> params = new HashMap<>();
params.put("tenantId", record.getTenantId());
if (StringUtils.isNotBlank(record.getSubTenantId())) {
params.put("subTenantId", record.getSubTenantId());
if (StringUtils.isNotBlank(record.getParentTenantId())) {
params.put("parentTenantId", record.getParentTenantId());
}
params.put("notPaid", EnumBillDailyStatus.NOT_PAID.getCode());
params.put("paid", EnumBillRentStatus.PAID.getCode());


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

@@ -54,9 +54,9 @@ public class WxBusinessServiceImpl implements WxBusinessService {
if (filter == null)
return wxBusinessMapper.findListAll();
else if (filter.equals(EnumBusinessFilter.FILTER_BY_COUPON.getCode()))
return wxBusinessMapper.findListForCoupon(tenantEntity.getTenantId(), tenantEntity.getSubTenantId());
return wxBusinessMapper.findListForCoupon(tenantEntity.getTenantId(), tenantEntity.getParentTenantId());
else if (filter.equals(EnumBusinessFilter.FILTER_BY_MERCHANT.getCode()))
return wxBusinessMapper.findListForMerchant(tenantEntity.getTenantId(), tenantEntity.getSubTenantId());
return wxBusinessMapper.findListForMerchant(tenantEntity.getTenantId(), tenantEntity.getParentTenantId());
else
return wxBusinessMapper.findListAll();
}


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

@@ -288,7 +288,7 @@ public class WxCampaignServiceImpl implements WxCampaignService {

@Override
public int getMaxSortNum(TenantEntity tenantEntity) {
return wxCampaignMapper.getMaxSortNum(tenantEntity.getTenantId(), tenantEntity.getSubTenantId());
return wxCampaignMapper.getMaxSortNum(tenantEntity.getTenantId(), tenantEntity.getParentTenantId());
}

@Override


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

@@ -100,7 +100,7 @@ public class WxChartServiceImpl implements WxChartDataService {
@Override
public ResultData queryData(Map<String, String> paramsMap) {
String tenantId = paramsMap.get("tenantId");
String subTenantId = paramsMap.get("subTenantId");
String parentTenantId = paramsMap.get("parentTenantId");
Integer chart = Integer.valueOf(paramsMap.get("chart"));
String startdate = paramsMap.get("startdate");
String enddate = paramsMap.get("enddate");
@@ -122,7 +122,7 @@ public class WxChartServiceImpl implements WxChartDataService {

TenantEntity tenantEntity = new TenantEntity() {{
setTenantId(tenantId);
setSubTenantId(subTenantId);
setParentTenantId(parentTenantId);
}};

//出租率
@@ -625,8 +625,8 @@ public class WxChartServiceImpl implements WxChartDataService {
}
Map<String,Object> query = new HashedMap();
query.put("tenantId",tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
query.put("subTenantId",tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
query.put("parentTenantId",tenantEntity.getParentTenantId());
}
query.put("id",paramsMap.get("id"));
query.put("buildingId",paramsMap.get("buildingId"));
@@ -647,8 +647,8 @@ public class WxChartServiceImpl implements WxChartDataService {

Map<String, Object> queryMap = new HashMap<>();
queryMap.put("tenantId",tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
queryMap.put("subTenantId",tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
queryMap.put("parentTenantId",tenantEntity.getParentTenantId());
}
queryMap.put("dateType",dateType);

@@ -757,8 +757,8 @@ public class WxChartServiceImpl implements WxChartDataService {
//绑定车牌
Map<String, Object> carParams = new HashMap<>();
carParams.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
carParams.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
carParams.put("parentTenantId", tenantEntity.getParentTenantId());
}
carParams.put("startdate", DateUtils.getSystemTime("yyyy-MM-dd 00:00:00"));
carParams.put("enddate", DateUtils.getSystemTime("yyyy-MM-dd HH:mm:ss"));
@@ -799,8 +799,8 @@ public class WxChartServiceImpl implements WxChartDataService {
String lastweek = DateUtils.getTimeBefore(7, new Date());
HashMap<String, Object> params = new HashMap<>();
params.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params.put("parentTenantId", tenantEntity.getParentTenantId());
}
params.put("cmdType", EnumCarCmd.CAR_ETCP_CALLBACK_PARK_IN.getCode());
params.put("startdate", systemTime + " 05:00:00");
@@ -871,8 +871,8 @@ public class WxChartServiceImpl implements WxChartDataService {
HashMap<String, Object> datamap = new HashMap<>();
HashMap<String, Object> params = new HashMap<>();
params.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params.put("parentTenantId", tenantEntity.getParentTenantId());
}
params.put("cmdType", EnumCarCmd.CAR_ETCP_CALLBACK_PARK_IN.getCode());
startdate = DateUtils.getTimeBefore(30, new Date());
@@ -948,8 +948,8 @@ public class WxChartServiceImpl implements WxChartDataService {
HashMap<String, Object> datamap = new HashMap<>();
HashMap<String, Object> weekParams = new HashMap<>();
weekParams.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
weekParams.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
weekParams.put("parentTenantId", tenantEntity.getParentTenantId());
}
String oneWeekStartdate = DateUtils.getTimeBefore(7, new Date());
String oneWeekEndDate = DateUtils.getTimeBefore(1, new Date());
@@ -969,8 +969,8 @@ public class WxChartServiceImpl implements WxChartDataService {
HashMap<String, Object> datamap = new HashMap<>();
HashMap<String, Object> weekParams = new HashMap<>();
weekParams.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
weekParams.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
weekParams.put("parentTenantId", tenantEntity.getParentTenantId());
}
String oneWeekStartdate = DateUtils.getTimeBefore(7, new Date());
String oneWeekEndDate = DateUtils.getTimeBefore(1, new Date());
@@ -1041,8 +1041,8 @@ public class WxChartServiceImpl implements WxChartDataService {
HashMap<String, Object> datamap = new HashMap<>();
HashMap<String, Object> weekParams = new HashMap<>();
weekParams.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
weekParams.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
weekParams.put("parentTenantId", tenantEntity.getParentTenantId());
}
String oneWeekStartdate = DateUtils.getTimeBefore(7, new Date());
String oneWeekEndDate = DateUtils.getTimeBefore(1, new Date());
@@ -1086,8 +1086,8 @@ public class WxChartServiceImpl implements WxChartDataService {
//查询UV PV
HashMap<String, Object> params = new HashMap<>();
params.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params.put("parentTenantId", tenantEntity.getParentTenantId());
}
params.put("startTime", addDay(-1));
params.put("endTime", addDay(1));
@@ -1151,9 +1151,9 @@ public class WxChartServiceImpl implements WxChartDataService {
*/
private ResultData getSaleSceneCount(TenantEntity tenantEntity) {
HashMap<String, Object> datamap = new HashMap<>();
int todaySceneCount = wxCouponActionLogMapper.getCountByDateLimit(tenantEntity.getTenantId(), tenantEntity.getSubTenantId(), addDay(0), addDay(1));
int yesterdayCount = wxCouponActionLogMapper.getCountByDateLimit(tenantEntity.getTenantId(), tenantEntity.getSubTenantId(), addDay(-1), addDay(0));
int lastWeekCount = wxCouponActionLogMapper.getCountByDateLimit(tenantEntity.getTenantId(), tenantEntity.getSubTenantId(), addDay(-7), addDay(-6));
int todaySceneCount = wxCouponActionLogMapper.getCountByDateLimit(tenantEntity.getTenantId(), tenantEntity.getParentTenantId(), addDay(0), addDay(1));
int yesterdayCount = wxCouponActionLogMapper.getCountByDateLimit(tenantEntity.getTenantId(), tenantEntity.getParentTenantId(), addDay(-1), addDay(0));
int lastWeekCount = wxCouponActionLogMapper.getCountByDateLimit(tenantEntity.getTenantId(), tenantEntity.getParentTenantId(), addDay(-7), addDay(-6));
NumberFormat nf = NumberFormat.getPercentInstance();
nf.setMinimumFractionDigits(2);//控制保留小数点后几位,2:表示保留2位小数点
String sceneDownDay = "--";
@@ -1180,8 +1180,8 @@ public class WxChartServiceImpl implements WxChartDataService {
String enddate;//查询UV PV
HashMap<String, Object> params = new HashMap<>();
params.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params.put("parentTenantId", tenantEntity.getParentTenantId());
}
params.put("startTime", addDay(-30));
params.put("endTime", addDay(1));
@@ -1222,8 +1222,8 @@ public class WxChartServiceImpl implements WxChartDataService {

HashMap<String, Object> params = new HashMap<>();
params.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params.put("parentTenantId", tenantEntity.getParentTenantId());
}
params.put("startTime", addDay(-30));
params.put("endTime", addDay(1));
@@ -1233,8 +1233,8 @@ public class WxChartServiceImpl implements WxChartDataService {
//停车发券被核销数
HashMap<String, Object> params1 = new HashMap<>();
params1.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params1.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params1.put("parentTenantId", tenantEntity.getParentTenantId());
}
params1.put("startTime", addDay(-30));
params1.put("endTime", addDay(1));
@@ -1245,8 +1245,8 @@ public class WxChartServiceImpl implements WxChartDataService {
//核销发券被核销数
HashMap<String, Object> params2 = new HashMap<>();
params2.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params2.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params2.put("parentTenantId", tenantEntity.getParentTenantId());
}
params2.put("startTime", addDay(-30));
params2.put("endTime", addDay(1));
@@ -1257,8 +1257,8 @@ public class WxChartServiceImpl implements WxChartDataService {
// B端刷卡支付被核销数
HashMap<String, Object> params3 = new HashMap<>();
params3.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params3.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params3.put("parentTenantId", tenantEntity.getParentTenantId());
}
params3.put("startTime", addDay(-30));
params3.put("endTime", addDay(1));
@@ -1269,8 +1269,8 @@ public class WxChartServiceImpl implements WxChartDataService {
// 购买发券被核销数
HashMap<String, Object> params4 = new HashMap<>();
params4.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params4.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params4.put("parentTenantId", tenantEntity.getParentTenantId());
}
params4.put("startTime", addDay(-30));
params4.put("endTime", addDay(1));
@@ -1520,7 +1520,7 @@ public class WxChartServiceImpl implements WxChartDataService {
Date eTime = c.getTime();
c.add(Calendar.DAY_OF_YEAR, -7);
Date sTime = c.getTime();
List<CUserDateAmountVo> datas = wxCouponOrderMapper.queryPriceTotalGroup(tenantEntity.getTenantId(), tenantEntity.getSubTenantId(), sTime, eTime);
List<CUserDateAmountVo> datas = wxCouponOrderMapper.queryPriceTotalGroup(tenantEntity.getTenantId(), tenantEntity.getParentTenantId(), sTime, eTime);
Map<String, Integer> dataMap = new HashMap<>();
for (CUserDateAmountVo v : datas) {
dataMap.put(v.getXTime(), v.getPrice());
@@ -1561,7 +1561,7 @@ public class WxChartServiceImpl implements WxChartDataService {
c.set(Calendar.SECOND, 0);
Date eTime = c.getTime();//明天0点
c.add(Calendar.DAY_OF_YEAR, -30);//三十天前
List<CUserDateAmountVo> datas = wxCouponOrderMapper.queryPriceTotalGroup(tenantEntity.getTenantId(), tenantEntity.getSubTenantId(), sTime, eTime);
List<CUserDateAmountVo> datas = wxCouponOrderMapper.queryPriceTotalGroup(tenantEntity.getTenantId(), tenantEntity.getParentTenantId(), sTime, eTime);
List<UserStructureVo> monthVos = new ArrayList<>();//周消费金额
Map<String, Integer> dataMap = new HashMap<>();
for (CUserDateAmountVo v : datas) {
@@ -1699,7 +1699,7 @@ public class WxChartServiceImpl implements WxChartDataService {
Date eTime = c.getTime();//明天0点
c.add(Calendar.DAY_OF_YEAR, -30);//三十天前
Date sTime = c.getTime();
List<CUserDateAmountVo> datas = wxCouponOrderMapper.queryPriceTotalGroup(tenantEntity.getTenantId(), tenantEntity.getSubTenantId(), sTime, eTime);
List<CUserDateAmountVo> datas = wxCouponOrderMapper.queryPriceTotalGroup(tenantEntity.getTenantId(), tenantEntity.getParentTenantId(), sTime, eTime);
Map<String, Integer> dataMap = new HashMap<>();
for (CUserDateAmountVo v : datas) {
dataMap.put(v.getXTime(), v.getPrice());
@@ -1838,8 +1838,8 @@ public class WxChartServiceImpl implements WxChartDataService {
//couponData
HashMap<String, Object> params = new HashMap<>();
params.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params.put("tenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params.put("tenantId", tenantEntity.getParentTenantId());
}
params.put("startTime", addDay(-30));
params.put("endTime", addDay(1));
@@ -2447,8 +2447,8 @@ public class WxChartServiceImpl implements WxChartDataService {
private ResultData getSaleGroupAnalysis(Map<String, String> paramsMap, TenantEntity tenantEntity, String startdate) {
Map<String, Object> params = new HashMap<>();
params.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params.put("parentTenantId", tenantEntity.getParentTenantId());
}
//默认时间本月第一天,截止到当天
Map<String, Object> result = new HashMap<>();
@@ -2590,7 +2590,7 @@ public class WxChartServiceImpl implements WxChartDataService {
//租金
Map<String, Object> params = new HashMap<>();
params.put("tenantId", tenantEntity.getTenantId());
params.put("subTenantId", tenantEntity.getSubTenantId());
params.put("parentTenantId", tenantEntity.getParentTenantId());
params.put("startdate", startdate + " 00:00:00");
params.put("enddate", enddate + " 23:59:59");
Map<String, Object> payinfo = wxBillRentMapper.queryPayInfo(params);
@@ -2677,7 +2677,7 @@ public class WxChartServiceImpl implements WxChartDataService {
HashMap<String, Object> datamap = new HashMap<>();
WxShop query = new WxShop();
String tenantId = paramMap.get("tenantId");
String subTenantId = paramMap.get("subTenantId");
String parentTenantId = paramMap.get("parentTenantId");
String building = paramMap.get("building");
String floor = paramMap.get("floor");
String business = paramMap.get("businessId");
@@ -2685,8 +2685,8 @@ public class WxChartServiceImpl implements WxChartDataService {
if (StringUtils.isNotEmpty(tenantId)) {
query.setTenantId(tenantId);
}
if (StringUtils.isNotEmpty(subTenantId)) {
query.setSubTenantId(subTenantId);
if (StringUtils.isNotEmpty(parentTenantId)) {
query.setParentTenantId(parentTenantId);
}
if (StringUtils.isNotEmpty(building)) {
query.setBuilding(Long.valueOf(building));
@@ -2767,8 +2767,8 @@ public class WxChartServiceImpl implements WxChartDataService {
//租金收缴率 ysje 应收金额 ssje 实收金额 zjsjl收缴率
Map<String, Object> params = new HashMap<>();
params.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params.put("parentTenantId", tenantEntity.getParentTenantId());
}
params.put("startdate", DateUtils.date2String(startDate,"yyyy-MM-dd") + " 00:00:00");
params.put("enddate", DateUtils.date2String(endDate,"yyyy-MM-dd") + " 23:59:59");


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

@@ -72,7 +72,7 @@ public class WxCouponActionLogServiceImpl implements WxCouponActionLogService {

@Override
public int getCountByChannelId(TenantEntity tenantEntity, int channelType, Long channelId) {
return wxCouponActionLogMapper.getCountByChannelId(tenantEntity.getTenantId(), tenantEntity.getSubTenantId(), channelType, channelId);
return wxCouponActionLogMapper.getCountByChannelId(tenantEntity.getTenantId(), tenantEntity.getParentTenantId(), channelType, channelId);
}

@Override


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

@@ -975,7 +975,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {

@Override
public List<CUserDateAmountVo> queryPriceTotalGroup(TenantEntity tenantEntity, Date startTime, Date endTime) {
return wxCouponOrderMapper.queryPriceTotalGroup(tenantEntity.getTenantId(), tenantEntity.getSubTenantId(), startTime, endTime);
return wxCouponOrderMapper.queryPriceTotalGroup(tenantEntity.getTenantId(), tenantEntity.getParentTenantId(), startTime, endTime);
}

@Override
@@ -1126,8 +1126,8 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {

Map<String, Object> coQ = new HashMap<>();
coQ.put("tenantId", user.getTenantId());
if (StringUtils.isNotBlank(user.getSubTenantId())) {
coQ.put("subTenantId", user.getSubTenantId());
if (StringUtils.isNotBlank(user.getParentTenantId())) {
coQ.put("parentTenantId", user.getParentTenantId());
}
coQ.put("cUserId", cUser.getId());
coQ.put("merchantId", user.getMerchantId());


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

@@ -458,8 +458,8 @@ public class WxFlowServiceImpl implements WxFlowService {
map.put("taskAssignee",flowModel.getFlow());
setSignAssignee(map,flowModel.getFlow());
map.put("tenantId",tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
map.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
map.put("parentTenantId", tenantEntity.getParentTenantId());
}

ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(flowModel.getFlowId(), map);


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

@@ -175,11 +175,11 @@ public class WxMallServiceImpl implements WxMallService {
}
// 不存在,从数据库中获取
WxMall q = new WxMall() {{
if (StringUtils.isBlank(tenantEntity.getSubTenantId())) {
if (StringUtils.isBlank(tenantEntity.getParentTenantId())) {
setTenantId(tenantEntity.getTenantId());
} else {
setTenantId(tenantEntity.getSubTenantId());
setParentTenantId(tenantEntity.getTenantId());
setTenantId(tenantEntity.getTenantId());
setParentTenantId(tenantEntity.getParentTenantId());
}
}};
WxMall mall = null;
@@ -297,8 +297,8 @@ public class WxMallServiceImpl implements WxMallService {
private String getRedisKeyByTenantInfo(TenantEntity tenantEntity) {
StringBuilder sb = new StringBuilder();
sb.append(Constant.TENANT_KEY_PREV).append(tenantEntity.getTenantId());
if (StringUtils.isBlank(tenantEntity.getSubTenantId())) {
sb.append("-").append(tenantEntity.getSubTenantId());
if (StringUtils.isBlank(tenantEntity.getParentTenantId())) {
sb.append("-").append(tenantEntity.getParentTenantId());
}
return sb.toString();
}


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

@@ -180,7 +180,7 @@ public class WxMsgServiceImpl implements WxMsgService {
public ResultData add(WxMsg wxMsg){
TenantEntity tenantEntity = new TenantEntity() {{
setTenantId(wxMsg.getTenantId());
setSubTenantId(wxMsg.getSubTenantId());
setParentTenantId(wxMsg.getParentTenantId());
}};
//不是草稿检验疲劳度
if (!wxMsg.getStatus().equals(EnumMsgStatus.MSG_STATUS_DRAFT.getCode())) {


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

@@ -1742,8 +1742,8 @@ public class WxOrderServiceImpl implements WxOrderService {
//全部商户个数
Map<String, Object> params = new HashMap<>();
params.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params.put("parentTenantId", tenantEntity.getParentTenantId());
}
String thirtyTime = DateUtils.getTimeBefore(29, new Date());
params.put("startdate", thirtyTime + " 00:00:00");
@@ -1790,8 +1790,8 @@ public class WxOrderServiceImpl implements WxOrderService {
//总数
Map<String, Object> params = new HashMap<>();
params.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params.put("parentTenantId", tenantEntity.getParentTenantId());
}
String thirtyTime = DateUtils.getTimeBefore(29, new Date());
params.put("startdate", thirtyTime + " 00:00:00");
@@ -1855,8 +1855,8 @@ public class WxOrderServiceImpl implements WxOrderService {
//总数
Map<String, Object> params = new HashMap<>();
params.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params.put("parentTenantId", tenantEntity.getParentTenantId());
}
String thirtyTime = DateUtils.getTimeBefore(29, new Date());
params.put("startdate", thirtyTime + " 00:00:00");


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

@@ -683,8 +683,8 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ
//全部商户个数
Map<String, Object> params = new HashMap<>();
params.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params.put("parentTenantId", tenantEntity.getParentTenantId());
}
String thirtyTime = DateUtils.getTimeBefore(29, new Date());
params.put("startdate", thirtyTime + " 00:00:00");
@@ -731,8 +731,8 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ
//全部分账总数
Map<String, Object> params = new HashMap<>();
params.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getSubTenantId())) {
params.put("subTenantId", tenantEntity.getSubTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params.put("parentTenantId", tenantEntity.getParentTenantId());
}
String thirtyTime = DateUtils.getTimeBefore(29, new Date());
params.put("startdate", thirtyTime + " 00:00:00");


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

@@ -2500,7 +2500,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {

@Override
public Map<Long, WxRentContract> selectRentContractByShopIds(Collection<Long> shopIds, String shopIdsRegexp, TenantEntity tenantEntity) {
List<WxRentContract> list = wxRentContractMapper.selectRentContractByShopIds(shopIds, shopIdsRegexp, tenantEntity.getTenantId(), tenantEntity.getSubTenantId());
List<WxRentContract> list = wxRentContractMapper.selectRentContractByShopIds(shopIds, shopIdsRegexp, tenantEntity.getTenantId(), tenantEntity.getParentTenantId());
List<String> shopIdArr = Arrays.asList(StringUtils.split(shopIdsRegexp,"|")) ;
Map<Long, WxRentContract> allShopContract = new HashMap<>();
for (WxRentContract wxRentContract : list) {


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

@@ -169,8 +169,8 @@ public class WxShopServiceImpl implements WxShopService {
public ResultData getShopList(TenantEntity tenantEntity, String shopNumber) {
Map<String,Object> params=new HashMap<>();
params.put("tenantId",tenantEntity.getTenantId());
if (tenantEntity.getSubTenantId() != null) {
params.put("subTenantId", tenantEntity.getSubTenantId());
if (tenantEntity.getParentTenantId() != null) {
params.put("parentTenantId", tenantEntity.getParentTenantId());
}
params.put("shopNumber",shopNumber);
List<Map<String,Object>> list=wxShopMapper.getShopList(params);
@@ -181,8 +181,8 @@ public class WxShopServiceImpl implements WxShopService {
public ResultData getMerchantShopByShopId(TenantEntity tenantEntity, String shopId) {
Map<String,Object> params=new HashMap<>();
params.put("tenantId",tenantEntity.getTenantId());
if (tenantEntity.getSubTenantId() != null) {
params.put("subTenantId",tenantEntity.getSubTenantId());
if (tenantEntity.getParentTenantId() != null) {
params.put("parentTenantId",tenantEntity.getParentTenantId());
}
params.put("shopId",shopId);
Map<String,Object> map=wxShopMapper.getMerchantShopByShopId(params);


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

@@ -90,7 +90,7 @@ public class KwMerchantMeterServiceImpl implements KwMerchantMeterService {

@Override
public List<MerchantMeterVo> getMerchantMeter(TenantEntity tenantEntity) {
return kwMerchantMeterMapper.getMerchantMeter(tenantEntity.getTenantId(), tenantEntity.getSubTenantId());
return kwMerchantMeterMapper.getMerchantMeter(tenantEntity.getTenantId(), tenantEntity.getParentTenantId());
}

}

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

@@ -24,7 +24,7 @@ public class Constant {
// C端token
public static final String LOGIN_USER_KEY = "LOGIN_USER_KEY";
public static final String TENANT_ID = "TENANT_ID";
public static final String SUB_TENANT_ID = "SUB_TENANT_ID";
public static final String PARENT_TENANT_ID = "PARENT_TENANT_ID";


public static final String adminPage = "https://admin.malls.iformall.com";


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

@@ -4,7 +4,7 @@
<resultMap id="BaseResultMap" type="com.iformall.domain.po.KwBoxCmdHistory">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="sub_tenant_id" jdbcType="VARCHAR" property="subTenantId" />
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
<result column="imei" jdbcType="VARCHAR" property="imei"/>
<result column="iccid" jdbcType="VARCHAR" property="iccid"/>
<result column="cmd" jdbcType="VARCHAR" property="cmd"/>
@@ -14,7 +14,7 @@
</resultMap>
<sql id="allColumns">
`id`,`tenant_id`,`sub_tenant_id`,`imei`,`iccid`,`content`,`info`,`device_time`,`create_time`
`id`,`tenant_id`,`parent_tenant_id`,`imei`,`iccid`,`content`,`info`,`device_time`,`create_time`
</sql>
<sql id="dynamicWhereConditions">
@@ -28,8 +28,8 @@
and `tenant_id` = #{tenantId}
</if>

<if test=" null != subTenantId ">
and `sub_tenant_id` = #{subTenantId}
<if test=" null != parentTenantId ">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != ids ">


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

@@ -4,7 +4,7 @@
<resultMap id="BaseResultMap" type="com.iformall.domain.po.KwBox">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="sub_tenant_id" jdbcType="VARCHAR" property="subTenantId" />
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
<result column="imei" jdbcType="BIGINT" property="imei"/>
<result column="iccid" jdbcType="VARCHAR" property="iccid"/>
<result column="place" jdbcType="VARCHAR" property="place"/>
@@ -24,7 +24,7 @@
</resultMap>
<sql id="allColumns">
`id`,`tenant_id`,`sub_tenant_id`,`imei`,`iccid`,`place`,`fw_version`,`hd_version`,`register_status`,`online_status`,`register_time`,
`id`,`tenant_id`,`parent_tenant_id`,`imei`,`iccid`,`place`,`fw_version`,`hd_version`,`register_status`,`online_status`,`register_time`,
`last_online_time`,`config`,`create_time`,`update_time`,`com_key`,`status`,`max_tag_num`
</sql>
@@ -39,8 +39,8 @@
and `tenant_id` = #{tenantId}
</if>

<if test=" null != subTenantId ">
and `sub_tenant_id` = #{subTenantId}
<if test=" null != parentTenantId ">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != imei ">


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

@@ -4,7 +4,7 @@
<resultMap id="BaseResultMap" type="com.iformall.domain.po.KwMerchantMeter">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="sub_tenant_id" jdbcType="VARCHAR" property="subTenantId" />
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
<result column="meter_id" jdbcType="BIGINT" property="meterId"/>
<result column="merchant_id" jdbcType="BIGINT" property="merchantId"/>
<result column="status" jdbcType="INTEGER" property="status"/>
@@ -14,7 +14,7 @@
</resultMap>
<sql id="allColumns">
`id`,`tenant_id`,`sub_tenant_id`,`meter_id`,`merchant_id`,`status`,`create_time`,`update_time`
`id`,`tenant_id`,`parent_tenant_id`,`meter_id`,`merchant_id`,`status`,`create_time`,`update_time`
</sql>
<sql id="dynamicWhereConditions">
@@ -28,8 +28,8 @@
and `tenant_id` = #{tenantId}
</if>

<if test=" null != subTenantId ">
and `sub_tenant_id` = #{subTenantId}
<if test=" null != parentTenantId ">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != merchantId ">
@@ -72,7 +72,7 @@
<resultMap id="BaseResultMapListVo" type="com.iformall.domain.vo.KwMerchantMeterVo">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="sub_tenant_id" jdbcType="VARCHAR" property="subTenantId" />
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
<result column="status" jdbcType="INTEGER" property="status"/>

<result column="name" jdbcType="VARCHAR" property="merchantName"/>
@@ -86,7 +86,7 @@
</resultMap>

<sql id="allColumnsVo">
`id`, `tenant_id`, `sub_tenant_id`, `merchant_id`, `status`, `name`, `link_phone`
`id`, `tenant_id`, `parent_tenant_id`, `merchant_id`, `status`, `name`, `link_phone`
</sql>

<select id="findVoList" parameterType="com.iformall.domain.dto.KwMerchantMeterDto" resultMap="BaseResultMapListVo">
@@ -97,8 +97,8 @@
<if test=" null != tenantId ">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != subTenantId ">
and `sub_tenant_id` = #{subTenantId}
<if test=" null != parentTenantId ">
and `parent_tenant_id` = #{parentTenantId}
</if>

<if test=" null != merchantId ">
@@ -141,7 +141,7 @@
<resultMap id="BaseResultMapVo" type="com.iformall.domain.vo.KwMerchantMeterVo">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="sub_tenant_id" jdbcType="VARCHAR" property="subTenantId" />
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
<result column="status" jdbcType="INTEGER" property="status"/>

<result column="name" jdbcType="VARCHAR" property="merchantName"/>
@@ -200,7 +200,7 @@

<resultMap id="DataVoResultMap" type="com.iformall.domain.vo.KwMerchantMeterDataVo">
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="sub_tenant_id" jdbcType="VARCHAR" property="subTenantId" />
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
<result column="totalPower" jdbcType="INTEGER" property="totalPower"/>
<result column="lastTotalPower" jdbcType="INTEGER" property="lastTotalPower"/>
<result column="usedPower" jdbcType="INTEGER" property="usedPower"/>
@@ -216,7 +216,7 @@

<select id="findDataVoList" parameterType="com.iformall.domain.dto.KwMerchantMeterDataDto" resultMap="DataVoResultMap">
select
temp.tenant_id, temp.sub_tenant_id,
temp.tenant_id, temp.parent_tenant_id,
<if test=" null != merchantId ">
mm.merchant_id as merchantId,
m.name as merchantName,
@@ -233,7 +233,7 @@
from
kw_merchant_meter mm,
(SELECT
tenant_id,sub_tenant_id,box_id,meter_id,
tenant_id,parent_tenant_id,box_id,meter_id,
min(last_device_time) as recordStartTime,
min(last_total_power) as lastTotalPower,
max(device_time) as recordEndTime,
@@ -241,7 +241,7 @@
sum(used_power) as usedPower
FROM kw_meter_data
<include refid="dynamicWhereConditionsVo"/>
group by tenant_id,sub_tenant_id,box_id,meter_id
group by tenant_id,parent_tenant_id,box_id,meter_id
) as temp,
wx_merchant m
where mm.status = 0
@@ -294,7 +294,7 @@
and m.id not in (
select merchant_id from wx_merchant_power_bill_config
where tenant_id=#{tenantId}
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>
)
</select>



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

@@ -4,7 +4,7 @@
<resultMap id="BaseResultMap" type="com.iformall.domain.po.KwMeterData">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="sub_tenant_id" jdbcType="VARCHAR" property="subTenantId" />
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
<result column="meter_id" jdbcType="BIGINT" property="meterId"/>
<result column="box_id" jdbcType="BIGINT" property="boxId"/>
<result column="address" jdbcType="VARCHAR" property="address"/>
@@ -17,7 +17,7 @@
</resultMap>
<sql id="allColumns">
`id`,`tenant_id`,`sub_tenant_id`,`meter_id`,`box_id`,`address`,`total_power`,`device_time`,`create_time`,`used_power`,`last_device_time`,`last_total_power`
`id`,`tenant_id`,`parent_tenant_id`,`meter_id`,`box_id`,`address`,`total_power`,`device_time`,`create_time`,`used_power`,`last_device_time`,`last_total_power`
</sql>
<sql id="dynamicWhereConditions">
@@ -94,7 +94,7 @@

<resultMap id="VoResultMap" type="com.iformall.domain.vo.KwMeterDataVo">
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="sub_tenant_id" jdbcType="VARCHAR" property="subTenantId" />
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
<result column="totalPower" jdbcType="INTEGER" property="totalPower"/>
<result column="lastTotalPower" jdbcType="INTEGER" property="lastTotalPower"/>
<result column="usedPower" jdbcType="INTEGER" property="usedPower"/>
@@ -145,7 +145,7 @@

<select id="findVoList" parameterType="com.iformall.domain.dto.KwMeterDataDto" resultMap="VoResultMap">
select
temp.tenant_id,temp.sub_tenant_id,
temp.tenant_id,temp.parent_tenant_id,
temp.reportTime,
<if test="4 != reportType ">
min(temp.recordStartTime) as recordStartTime,
@@ -156,7 +156,7 @@
sum(temp.usedPower) as usedPower
from
(SELECT
tenant_id,sub_tenant_id,box_id,meter_id,
tenant_id,parent_tenant_id,box_id,meter_id,
<if test=" null == reportType">
create_time as reportTime,
</if>


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

@@ -4,7 +4,7 @@
<resultMap id="BaseResultMap" type="com.iformall.domain.po.KwMeter">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="sub_tenant_id" jdbcType="VARCHAR" property="subTenantId" />
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
<result column="address" jdbcType="BIGINT" property="address"/>
<result column="brand" jdbcType="VARCHAR" property="brand"/>
<result column="place" jdbcType="VARCHAR" property="place"/>
@@ -24,7 +24,7 @@
</resultMap>
<sql id="allColumns">
`kw_meter`.`id`,`kw_meter`.`tenant_id`,`kw_meter`.`sub_tenant_id`,`kw_meter`.`address`,`kw_meter`.`brand`,`kw_meter`.`model`,
`kw_meter`.`id`,`kw_meter`.`tenant_id`,`kw_meter`.`parent_tenant_id`,`kw_meter`.`address`,`kw_meter`.`brand`,`kw_meter`.`model`,
`kw_meter`.`place`,`kw_meter`.`last_online_time`,`kw_meter`.`total_power`,`kw_meter`.`online_status`,
`kw_meter`.`config`,`kw_meter`.`create_time`,`kw_meter`.`update_time`,`kw_meter`.`box_id`,`kw_meter`.`status`,`kw_meter`.`bind_status`
</sql>
@@ -39,8 +39,8 @@
<if test=" null != tenantId ">
and `kw_meter`.`tenant_id` = #{tenantId}
</if>
<if test=" null != subTenantId ">
and `kw_meter`.`sub_tenant_id` = #{subTenantId}
<if test=" null != parentTenantId ">
and `kw_meter`.`parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != address">


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

@@ -4,14 +4,14 @@
<resultMap id="BaseResultMap" type="com.iformall.domain.po.MallResource">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
<result column="sub_tenant_id" jdbcType="VARCHAR" property="subTenantId" />
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
<result column="bucket" jdbcType="VARCHAR" property="bucket" />
<result column="s3_key" jdbcType="VARCHAR" property="s3Key" />
<result column="url" jdbcType="VARCHAR" property="url" />
</resultMap>
<sql id="allColumns">
`id`,`tenant_id`,`sub_tenant_id`,`bucket`,`key`,`url`
`id`,`tenant_id`,`parent_tenant_id`,`bucket`,`key`,`url`
</sql>

<sql id="dynamicWhereConditions">
@@ -22,8 +22,8 @@
<if test=" null != tenantId ">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != subTenantId ">
and `sub_tenant_id` = #{subTenantId}
<if test=" null != parentTenantId ">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != bucket ">
and `bucket` = #{bucket}


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

@@ -4,14 +4,14 @@
<resultMap id="BaseResultMap" type="com.iformall.domain.po.MallRole">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
<result column="sub_tenant_id" jdbcType="VARCHAR" property="subTenantId"/>
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="available" jdbcType="VARCHAR" property="available" />
<result column="description" jdbcType="VARCHAR" property="description" />
</resultMap>
<sql id="allColumns">
`id`,`tenant_id`,`sub_tenant_id`,`name`,`available`,`description`
`id`,`tenant_id`,`parent_tenant_id`,`name`,`available`,`description`
</sql>

<sql id="dynamicWhereConditions">
@@ -26,8 +26,8 @@
and `tenant_id` = #{tenantId}
</if>

<if test=" null != subTenantId ">
and `sub_tenant_id` = #{subTenantId}
<if test=" null != parentTenantId ">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != name and '' != name ">


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

@@ -4,13 +4,13 @@
<resultMap id="BaseResultMap" type="com.iformall.domain.po.MallRolePermission">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="sub_tenant_id" jdbcType="VARCHAR" property="subTenantId" />
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
<result column="permission_id" jdbcType="BIGINT" property="permissionId"/>
<result column="role_id" jdbcType="BIGINT" property="roleId"/>
</resultMap>

<sql id="allColumns">
`id`,`tenant_id`,`sub_tenant_id`,`permission_id`,`role_id`
`id`,`tenant_id`,`parent_tenant_id`,`permission_id`,`role_id`
</sql>

<sql id="dynamicWhereConditions">
@@ -24,8 +24,8 @@
and `tenant_id` = #{tenantId}
</if>

<if test=" null != subTenantId ">
and `sub_tenant_id` = #{subTenantId}
<if test=" null != parentTenantId ">
and `parent_tenant_id` = #{parentTenantId}
</if>

<if test=" null != permissionId ">
@@ -52,11 +52,11 @@
</select>

<insert id="insertBatch" parameterType="java.util.List">
insert into mall_role_permission (id, tenant_id, sub_tenant_id,permission_id, role_id) values
insert into mall_role_permission (id, tenant_id, parent_tenant_id,permission_id, role_id) values
<foreach collection="list" item="item" index="index" separator=",">
(#{item.id,jdbcType=BIGINT},
#{item.tenantId,jdbcType=VARCHAR},
#{item.subTenantId,jdbcType=VARCHAR},
#{item.parentTenantId,jdbcType=VARCHAR},
#{item.permissionId,jdbcType=BIGINT},
#{item.roleId,jdbcType=BIGINT})
</foreach>


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

@@ -4,7 +4,7 @@
<resultMap id="BaseResultMap" type="com.iformall.domain.po.MallUserAction">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
<result column="sub_tenant_id" jdbcType="VARCHAR" property="subTenantId" />
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="type" jdbcType="INTEGER" property="type" />
<result column="ip" jdbcType="VARCHAR" property="ip" />
@@ -13,7 +13,7 @@
</resultMap>
<sql id="allColumns">
`id`,`tenant_id`,`sub_tenant_id`,`user_id`,`type`,`ip`,`action_desc`,`action_time`
`id`,`tenant_id`,`parent_tenant_id`,`user_id`,`type`,`ip`,`action_desc`,`action_time`
</sql>

<sql id="dynamicWhereConditions">
@@ -24,8 +24,8 @@
<if test=" null != tenantId ">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != subTenantId ">
and `sub_tenant_id` = #{subTenantId}
<if test=" null != parentTenantId ">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != userId ">
and `user_id` = #{userId}
@@ -60,7 +60,7 @@
<resultMap id="VoBaseResultMap" type="com.iformall.domain.vo.MallUserActionVo">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
<result column="sub_tenant_id" jdbcType="VARCHAR" property="subTenantId" />
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="type" jdbcType="INTEGER" property="type" />
<result column="ip" jdbcType="VARCHAR" property="ip" />
@@ -70,7 +70,7 @@
</resultMap>

<sql id="allVoColumns">
mua.`id`,mua.`tenant_id`,mua.`sub_tenant_id`,mua.`user_id`,mua.`type`,mua.`ip`,mua.`action_desc`,mua.`action_time`,mui.`name`
mua.`id`,mua.`tenant_id`,mua.`parent_tenant_id`,mua.`user_id`,mua.`type`,mua.`ip`,mua.`action_desc`,mua.`action_time`,mui.`name`
</sql>

<sql id="dynamicVoWhereConditions">


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

@@ -4,7 +4,7 @@
<resultMap id="BaseResultMap" type="com.iformall.domain.po.MallUserInfo">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="sub_tenant_id" jdbcType="VARCHAR" property="subTenantId"/>
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
<result column="username" jdbcType="VARCHAR" property="username"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="password" jdbcType="VARCHAR" property="password"/>
@@ -21,11 +21,11 @@
</resultMap>

<sql id="allSafeColumns">
`id`,`tenant_id`,`sub_tenant_id`,`username`,`name`,`password`,`create_time`,`last_login_time`,`status`,`is_admin`,`invest_rule`,`nick_name`,`phone`,`web_open_id`,email
`id`,`tenant_id`,`parent_tenant_id`,`username`,`name`,`password`,`create_time`,`last_login_time`,`status`,`is_admin`,`invest_rule`,`nick_name`,`phone`,`web_open_id`,email
</sql>

<sql id="allColumns">
`id`,`tenant_id`,`sub_tenant_id`,`username`,`name`,`password`,`create_time`,`last_login_time`,`status`,`is_admin`,`invest_rule`,`nick_name`,`phone`,
`id`,`tenant_id`,`parent_tenant_id`,`username`,`name`,`password`,`create_time`,`last_login_time`,`status`,`is_admin`,`invest_rule`,`nick_name`,`phone`,
`bopen_id`,`web_open_id`,email
</sql>

@@ -39,8 +39,8 @@
and `tenant_id` = #{tenantId}
</if>

<if test=" null != subTenantId ">
and `sub_tenant_id` = #{subTenantId}
<if test=" null != parentTenantId ">
and `parent_tenant_id` = #{parentTenantId}
</if>

<if test=" null != username and ''!=username">
@@ -265,7 +265,7 @@
<resultMap id="VBaseResultMap" type="com.iformall.domain.vo.MallUserInfoVo">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="sub_tenant_id" jdbcType="VARCHAR" property="subTenantId"/>
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
<result column="username" jdbcType="VARCHAR" property="username"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="password" jdbcType="VARCHAR" property="password"/>
@@ -287,12 +287,12 @@
</resultMap>

<sql id="allSafeVColumns">
u.`id`,u.`tenant_id`,u.`sub_tenant_id`,u.`username`,u.`name`,u.`password`,u.`create_time`,u.`last_login_time`,u.`status`,u.`is_admin`,u.`invest_rule`,u.`nick_name`,u.`phone`,
u.`id`,u.`tenant_id`,u.`parent_tenant_id`,u.`username`,u.`name`,u.`password`,u.`create_time`,u.`last_login_time`,u.`status`,u.`is_admin`,u.`invest_rule`,u.`nick_name`,u.`phone`,
m.`name` as mall_name, m.`group` as mall_group, m.`img_url`, m.`img_url_h`,email
</sql>

<sql id="allVColumns">
u.`id`,u.`tenant_id`,u.`sub_tenant_id`,u.`username`,u.`name`,u.`password`,u.`create_time`,u.`last_login_time`,u.`status`,u.`is_admin`,u.`invest_rule`,u.`nick_name`,u.`phone`,
u.`id`,u.`tenant_id`,u.`parent_tenant_id`,u.`username`,u.`name`,u.`password`,u.`create_time`,u.`last_login_time`,u.`status`,u.`is_admin`,u.`invest_rule`,u.`nick_name`,u.`phone`,
u.`bopen_id`,u.`web_open_id`,
m.`name` as mall_name, m.`group` as mall_group, m.`img_url`, m.`img_url_h`,email
</sql>


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

@@ -4,7 +4,7 @@
<resultMap id="BaseResultMap" type="com.iformall.domain.po.PosCouponOrderVerify">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
<result column="sub_tenant_id" jdbcType="VARCHAR" property="subTenantId" />
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
<result column="coupon_order_id" jdbcType="BIGINT" property="couponOrderId" />
<result column="pos_order_id" jdbcType="BIGINT" property="posOrderId" />
<result column="state" jdbcType="INTEGER" property="state" />
@@ -13,7 +13,7 @@
</resultMap>
<sql id="allColumns">
`id`,`tenant_id`,`sub_tenant_id`,`coupon_order_id`,`pos_order_id`,`state`
`id`,`tenant_id`,`parent_tenant_id`,`coupon_order_id`,`pos_order_id`,`state`
</sql>

<sql id="dynamicWhereConditions">
@@ -24,8 +24,8 @@
<if test=" null != tenantId ">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != subTenantId ">
and `sub_tenant_id` = #{subTenantId}
<if test=" null != parentTenantId ">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != couponOrderId ">
and `coupon_order_id` = #{couponOrderId}


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

@@ -4,7 +4,7 @@
<resultMap id="BaseResultMap" type="com.iformall.domain.po.PosMallConfig">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
<result column="sub_tenant_id" jdbcType="VARCHAR" property="subTenantId" />
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
<result column="discount" jdbcType="INTEGER" property="discount" />
<result column="coupon" jdbcType="INTEGER" property="coupon" />
<result column="card" jdbcType="INTEGER" property="card" />
@@ -13,7 +13,7 @@
</resultMap>
<sql id="allColumns">
`id`,`tenant_id`,`sub_tenant_id`,`discount`,`coupon`,`card`,`create_date`,`update_date`
`id`,`tenant_id`,`parent_tenant_id`,`discount`,`coupon`,`card`,`create_date`,`update_date`
</sql>

<sql id="dynamicWhereConditions">
@@ -24,8 +24,8 @@
<if test=" null != tenantId ">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != subTenantId ">
and `sub_tenant_id` = #{subTenantId}
<if test=" null != parentTenantId ">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != discount ">
and `discount` = #{discount}
@@ -68,7 +68,7 @@
<include refid="allColumns"/>
from pos_mall_config
where 1=1 and `tenant_id` = #{tenantId}
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>
</select>


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

@@ -15,7 +15,7 @@
</resultMap>
<sql id="allColumns">
`id`,`tenant_id`,`sub_tenant_id`,`pos_order_no`,`type`,`order_status`,`bu_user_id`,`create_date`,`update_date`
`id`,`tenant_id`,`parent_tenant_id`,`pos_order_no`,`type`,`order_status`,`bu_user_id`,`create_date`,`update_date`
</sql>

<sql id="dynamicWhereConditions">
@@ -26,8 +26,8 @@
<if test=" null != tenantId ">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != subTenantId ">
and `sub_tenant_id` = #{subTenantId}
<if test=" null != parentTenantId ">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != posOrderNo ">
and `pos_order_no` like concat('%', #{posOrderNo},'%')


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

@@ -4,7 +4,7 @@
<resultMap id="BaseResultMap" type="com.iformall.domain.po.PosPayOrder">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
<result column="sub_tenant_id" jdbcType="VARCHAR" property="subTenantId" />
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="order_id" jdbcType="BIGINT" property="orderId" />
@@ -29,7 +29,7 @@
</resultMap>
<sql id="allColumns">
`id`,`tenant_id`,`sub_tenant_id`,`create_time`,`update_time`,`order_id`,`bu_user_id`,`type`,`pay_from`,`pay_amount`,`pay_time_start`,`pay_time_end`,`prepay_id`,`transaction_id`,`pay_vendor`,`pay_order_no`,`pay_order_status`,`share`,`share_amount`,`rate_amount`,`fail_reason`,`auth_code`,`open_id`,`pay_end_from`
`id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`order_id`,`bu_user_id`,`type`,`pay_from`,`pay_amount`,`pay_time_start`,`pay_time_end`,`prepay_id`,`transaction_id`,`pay_vendor`,`pay_order_no`,`pay_order_status`,`share`,`share_amount`,`rate_amount`,`fail_reason`,`auth_code`,`open_id`,`pay_end_from`
</sql>

<sql id="dynamicWhereConditions">
@@ -40,8 +40,8 @@
<if test=" null != tenantId ">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != subTenantId ">
and `sub_tenant_id` = #{subTenantId}
<if test=" null != parentTenantId ">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != createTime ">
and `create_time` = #{createTime}


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

@@ -4,7 +4,7 @@
<resultMap id="BaseResultMap" type="com.iformall.domain.po.PushLimit">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="sub_tenant_id" jdbcType="VARCHAR" property="subTenantId" />
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
<result column="msg_amount" jdbcType="INTEGER" property="msgAmount"/>
<result column="coupon_amount" jdbcType="INTEGER" property="couponAmount"/>
<result column="coupon_day" jdbcType="INTEGER" property="couponDay"/>
@@ -17,7 +17,7 @@
</resultMap>

<sql id="allColumns">
`id`,`tenant_id`,`sub_tenant_id`,`msg_amount`,`coupon_amount`,`coupon_day`,`time_enable`,`time_start`,`time_end`,`create_time`,`update_time`,`enable`
`id`,`tenant_id`,`parent_tenant_id`,`msg_amount`,`coupon_amount`,`coupon_day`,`time_enable`,`time_start`,`time_end`,`create_time`,`update_time`,`enable`
</sql>

<sql id="dynamicWhereConditions">
@@ -31,8 +31,8 @@
and `tenant_id` = #{tenantId}
</if>

<if test=" null != subTenantId ">
and `sub_tenant_id` = #{subTenantId}
<if test=" null != parentTenantId ">
and `parent_tenant_id` = #{parentTenantId}
</if>

<if test=" null != msgAmount ">


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

@@ -4,7 +4,7 @@
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxActivityJoin">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="sub_tenant_id" jdbcType="VARCHAR" property="subTenantId" />
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
<result column="user_id" jdbcType="BIGINT" property="userId"/>
<result column="activity_id" jdbcType="BIGINT" property="activityId"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
@@ -24,7 +24,7 @@
</resultMap>
<sql id="allColumns">
`id`,`tenant_id`,`sub_tenant_id`,`user_id`,`activity_id`,`name`,`nick_name`,`birthday`,`sex`,`phone`,
`id`,`tenant_id`,`parent_tenant_id`,`user_id`,`activity_id`,`name`,`nick_name`,`birthday`,`sex`,`phone`,
`address`,`answer`,`sign_in`,`status`,`create_time`,`update_time`,`img_url`,`send_msg`
</sql>
@@ -37,8 +37,8 @@
<if test=" null != tenantId ">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != subTenantId ">
and `sub_tenant_id` = #{subTenantId}
<if test=" null != parentTenantId ">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != name and ''!=name">
and `name` like concat('%', #{name},'%')


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

@@ -4,7 +4,7 @@
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxActivity">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="sub_tenant_id" jdbcType="VARCHAR" property="subTenantId" />
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
<result column="cover_img" jdbcType="VARCHAR" property="coverImg"/>
<result column="title" jdbcType="VARCHAR" property="title"/>
<result column="sub_title" jdbcType="VARCHAR" property="subTitle"/>
@@ -31,7 +31,7 @@
</resultMap>
<sql id="allColumns">
`id`,`tenant_id`,`sub_tenant_id`,`cover_img`,`title`,`sub_title`,`detail`,`html`,`person_limit`,`activity_start_time`,`activity_end_time`,
`id`,`tenant_id`,`parent_tenant_id`,`cover_img`,`title`,`sub_title`,`detail`,`html`,`person_limit`,`activity_start_time`,`activity_end_time`,
`use_credit`,`credit`,`type`,`status`,`start_time`,`end_time`,`question`,`is_expired`,`create_time`,`update_time`,`use_img`,
`img_detail`,`send_msg`,`selectques`
</sql>
@@ -47,8 +47,8 @@
and `tenant_id` = #{tenantId}
</if>

<if test=" null != subTenantId ">
and `sub_tenant_id` = #{subTenantId}
<if test=" null != parentTenantId ">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != title ">


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

@@ -4,7 +4,7 @@
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxAdminLog">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
<result column="sub_tenant_id" jdbcType="VARCHAR" property="subTenantId"/>
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
<result column="url" jdbcType="VARCHAR" property="url" />
<result column="action_date" jdbcType="VARCHAR" property="actionDate" />
<result column="type" jdbcType="INTEGER" property="type" />
@@ -12,7 +12,7 @@
</resultMap>
<sql id="allColumns">
`id`,`tenant_id`,`sub_tenant_id`,`url`,`action_date`,`type`,`count`
`id`,`tenant_id`,`parent_tenant_id`,`url`,`action_date`,`type`,`count`
</sql>

<sql id="dynamicWhereConditions">
@@ -26,8 +26,8 @@
<if test=" null != tenantId ">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != subTenantId ">
and `sub_tenant_id` = #{subTenantId}
<if test=" null != parentTenantId ">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != url ">


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

@@ -4,7 +4,7 @@
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxBillAction">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="sub_tenant_id" jdbcType="VARCHAR" property="subTenantId" />
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
<result column="bill_id" jdbcType="BIGINT" property="billId"/>
<result column="user_id" jdbcType="BIGINT" property="userId"/>
<result column="user_name" jdbcType="VARCHAR" property="userName"/>
@@ -17,7 +17,7 @@
</resultMap>
<sql id="allColumns">
`id`,`tenant_id`,`sub_tenant_id`,`bill_id`,`user_id`,`user_name`,`phone`,`action`,`details`,`createtime`,`updatetime`,`pay_date`
`id`,`tenant_id`,`parent_tenant_id`,`bill_id`,`user_id`,`user_name`,`phone`,`action`,`details`,`createtime`,`updatetime`,`pay_date`

</sql>
@@ -32,8 +32,8 @@
and `tenant_id` = #{tenantId}
</if>

<if test=" null != subTenantId ">
and `sub_tenant_id` = #{subTenantId}
<if test=" null != parentTenantId ">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != action ">


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

@@ -6,7 +6,7 @@
<resultMap id="allVoResultMap" type="com.iformall.domain.vo.WxBillAllVo">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="tenantId" jdbcType="VARCHAR" property="tenantId" />
<result column="subTenantId" jdbcType="VARCHAR" property="subTenantId" />
<result column="parentTenantId" jdbcType="VARCHAR" property="parentTenantId" />
<result column="merchantId" jdbcType="INTEGER" property="merchantId" />
<result column="shopId" jdbcType="INTEGER" property="shopId" />

@@ -51,7 +51,7 @@
<select id="list" parameterType="com.iformall.domain.vo.WxBillAll" resultMap="allVoResultMap">

select
bill.id,bill.tenant_id tenantId,bill.sub_tenant_id subTenantId,bill.merchant_id merchantId,bill.shop_id shopId,
bill.id,bill.tenant_id tenantId,bill.parent_tenant_id parentTenantId,bill.merchant_id merchantId,bill.shop_id shopId,
bill.bill_type_value billTypeValue,bill.bill_type billType,bill.need_pay needPay,
bill.receive_pay receivePay,bill.pay,bill.owe,bill.receive_date receiveDate,
bill.pay_date payDate,expired_day expiredDay,bill.status,bill.starttime,
@@ -59,62 +59,62 @@
s.shop_number shopNumber, s.manager, s.manager_phone managerPhone,bill.shop_info
shopInfo,bill.comments,bill.price_detail,updatetime,bill.freeze,bill.late_pay_price,bill.service_charge_pay
from (
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'租金' name,1 bill_type_value,'租金'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'租金' name,1 bill_type_value,'租金'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,starttime,
endtime,rent_shop_type,case when shop_info is null then '[]' else shop_info end shop_info,comments,''
price_detail,updatetime,freeze,ifnull(late_pay_price,0) late_pay_price,service_charge_pay
from wx_bill_rent
where tenant_id=#{tenantId}
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>
and is_preview = 0
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,starttime,
endtime,rent_shop_type,shop_info,NULL comments,'' price_detail,updatetime,freeze,0
late_pay_price,0 service_charge_pay
from wx_bill_rent_deposit
where tenant_id=#{tenantId}
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'物业费' name,3 bill_type_value,'物业费'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'物业费' name,3 bill_type_value,'物业费'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,starttime,
endtime,rent_shop_type,case when shop_info is null then '[]' else shop_info end shop_info,comments,''
price_detail,updatetime,freeze,ifnull(late_pay_price,0) late_pay_price,service_charge_pay
from wx_bill_property
where tenant_id=#{tenantId}
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>
and is_preview = 0
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'物业押金' name,4 bill_type_value,'物业押金'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'物业押金' name,4 bill_type_value,'物业押金'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,starttime,
endtime,rent_shop_type,shop_info,NULL comments,'' price_detail,updatetime,freeze,0
late_pay_price,0 service_charge_pay
from wx_bill_property_deposit
where tenant_id=#{tenantId}
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,case when type=1 then '水费' when type=2 then '电费' else '空调费' end name,
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,case when type=1 then '水费' when type=2 then '电费' else '空调费' end name,
case when type=1 then 5 when type=2 then 6 else 9 end bill_type_value,
case when type=1 then '水费' when type=2 then '电费' else '空调费' end bill_type,0 as
need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,starttime,endtime,
rent_shop_type,'[]' shop_info, NULL comments,price_detail,updatetime,freeze,0 late_pay_price,service_charge_pay
from wx_bill_daily where tenant_id=#{tenantId}
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,name,7 bill_type_value,concat('其他费用-',name) as bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,name,7 bill_type_value,concat('其他费用-',name) as bill_type,0 as
need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,starttime,endtime,
rent_shop_type,'[]' shop_info,comments,'' price_detail,updatetime,freeze,0 late_pay_price,service_charge_pay
from wx_bill_other
where tenant_id=#{tenantId}
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,comments as name,8 bill_type_value,concat('其他押金-',comments) as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,comments as name,8 bill_type_value,concat('其他押金-',comments) as
bill_type,0 as
need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,starttime,endtime,
rent_shop_type,'[]' shop_info,comments,'' price_detail,updatetime,freeze,0 late_pay_price,service_charge_pay
from wx_bill_other_deposit
where tenant_id=#{tenantId}
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>
) bill
left join wx_merchant m on bill.merchant_id=m.id
left join wx_shop s on bill.shop_id=s.id
@@ -122,8 +122,8 @@
<if test=" null != tenantId ">
and bill.tenant_id=#{tenantId}
</if>
<if test=" null != subTenantId ">
and bill.sub_tenant_id=#{subTenantId}
<if test=" null != parentTenantId ">
and bill.parent_tenant_id=#{parentTenantId}
</if>
<if test=" null != month and ''!=month">
and date_format(bill.receive_date,'%Y-%m')=#{month}
@@ -163,41 +163,41 @@

select count(bill.id) owncount,IFNULL(sum(bill.owe),0) owe from (
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,1 bill_type_value,'租金'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,1 bill_type_value,'租金'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_rent where is_preview = 0
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,2 bill_type_value,'租赁押金'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,2 bill_type_value,'租赁押金'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from
wx_bill_rent_deposit
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,3 bill_type_value,'物业费'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,3 bill_type_value,'物业费'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from
wx_bill_property where is_preview = 0
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,4 bill_type_value,'物业押金'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,4 bill_type_value,'物业押金'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from
wx_bill_property_deposit
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,5 bill_type_value,'水费' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,5 bill_type_value,'水费' bill_type,0 as
need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_daily where
type=1
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,6 bill_type_value,'电费' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,6 bill_type_value,'电费' bill_type,0 as
need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_daily where
type=2
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,9 bill_type_value,'空调费' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,9 bill_type_value,'空调费' bill_type,0 as
need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_daily where
type=3
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,7 bill_type_value,'其他费用' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,7 bill_type_value,'其他费用' bill_type,0 as
need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_other
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,8 bill_type_value,'其他押金' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,8 bill_type_value,'其他押金' bill_type,0 as
need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_other_deposit
) bill
where bill.tenant_id=#{tenantId}
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
where (bill.tenant_id=#{tenantId} or bill.parent_tenant_id=#{tenantId})
<!--<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>-->
and bill.status=#{status}
<if test=" null != starttime and null!= endtime ">
and bill.receive_date between #{starttime} and #{endtime}
@@ -220,41 +220,41 @@
<select id="queryPaidInfo" parameterType="com.iformall.domain.vo.WxBillAll" resultType="hashmap">
select count(bill.id) paycount,IFNULL(sum(bill.pay),0) pay from (
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,1 bill_type_value,'租金'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,1 bill_type_value,'租金'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_rent where is_preview = 0
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,2 bill_type_value,'租赁押金'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,2 bill_type_value,'租赁押金'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from
wx_bill_rent_deposit
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,3 bill_type_value,'物业费'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,3 bill_type_value,'物业费'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from
wx_bill_property where is_preview = 0
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,4 bill_type_value,'物业押金'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,4 bill_type_value,'物业押金'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from
wx_bill_property_deposit
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,5 bill_type_value,'水费' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,5 bill_type_value,'水费' bill_type,0 as
need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_daily where
type=1
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,6 bill_type_value,'电费' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,6 bill_type_value,'电费' bill_type,0 as
need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_daily where
type=2
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,9 bill_type_value,'空调费' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,9 bill_type_value,'空调费' bill_type,0 as
need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_daily where
type=3
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,7 bill_type_value,'其他费用' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,7 bill_type_value,'其他费用' bill_type,0 as
need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_other
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,8 bill_type_value,'其他押金' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,8 bill_type_value,'其他押金' bill_type,0 as
need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_other_deposit
) bill
where bill.tenant_id=#{tenantId}
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
where (bill.tenant_id=#{tenantId} or bill.parent_tenant_id=#{tenantId})
<!--<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>-->
and bill.status=#{status}
<if test=" null != starttime and null!= endtime ">
and bill.receive_date between #{starttime} and #{endtime}
@@ -271,168 +271,168 @@
<select id="listData" resultType="hashmap" parameterType="com.iformall.domain.vo.WxBillAll">
select bill.settle_number,bill.id,bill.merchant_id merchantId,bill.shop_id shopId,bill.bill_type_value billTypeValue,bill.bill_type billType,bill.need_pay needPay,
bill.receive_pay receivePay,bill.pay,bill.owe,bill.receive_date receiveDate,bill.pay_date payDate,DATEDIFF(now(),bill.receive_date) expiredDay,bill.status,
bill.tenant_id tenantId,bill.sub_tenant_id subTenantId,m.name merchantName,s.shop_number shopNumber,bill.starttime,bill.endtime,bill.name,pb.pay_bill_status payBillStatus,
bill.tenant_id tenantId,bill.parent_tenant_id parentTenantId,m.name merchantName,s.shop_number shopNumber,bill.starttime,bill.endtime,bill.name,pb.pay_bill_status payBillStatus,
pb.pay_time_end tradeTime,pb.transaction_id transactionId,pb.pay_amount payAmount,bill.rent_shop_type
rentShopType,bill.price_detail priceDetail,bill.freeze,bill.late_pay_price latePayPrice,bill.service_charge_pay
serviceChargePay from (
select '' settle_number,id,merchant_id,shop_id,tenant_id,sub_tenant_id,'租金' name,1 bill_type_value,'租金'
select '' settle_number,id,merchant_id,shop_id,tenant_id,parent_tenant_id,'租金' name,1 bill_type_value,'租金'
bill_type,need_pay,receive_pay,pay,(receive_pay+service_charge_pay+ifnull(late_pay_price,0)-pay)
owe,receive_date,pay_date,expired_day,status,starttime,endtime,rent_shop_type,''
price_detail,freeze,ifnull(late_pay_price,0) late_pay_price,service_charge_pay
from wx_bill_rent
where is_preview = 0
and tenant_id=#{tenantId}
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>
and rent_contract_id in (select id from wx_rent_contract where status in (2,3,4))
union all
select '' settle_number,id,merchant_id,shop_id,tenant_id,sub_tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金'
select '' settle_number,id,merchant_id,shop_id,tenant_id,parent_tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金'
bill_type,need_pay,receive_pay,pay,(receive_pay-pay)
owe,receive_date,pay_date,expired_day,status,starttime,endtime,rent_shop_type,''
price_detail,freeze,0 late_pay_price,0 service_charge_pay
from wx_bill_rent_deposit
where tenant_id=#{tenantId}
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>
and rent_contract_id in (select id from wx_rent_contract
where status in (2,3,4))
union all
select '' settle_number,id,merchant_id,shop_id,tenant_id,sub_tenant_id,'物业费' name,3 bill_type_value,'物业费'
select '' settle_number,id,merchant_id,shop_id,tenant_id,parent_tenant_id,'物业费' name,3 bill_type_value,'物业费'
bill_type,need_pay,receive_pay,pay,(receive_pay+service_charge_pay+ifnull(late_pay_price,0)-pay)
owe,receive_date,pay_date,expired_day,status,starttime,endtime,rent_shop_type,''
price_detail,freeze,ifnull(late_pay_price,0) late_pay_price,service_charge_pay
from wx_bill_property
where is_preview = 0
and tenant_id=#{tenantId}
<if test=" null != subTenantId "> and sub_tenant_id=#{subTenantId}</if>
<if test=" null != parentTenantId "> and parent_tenant_id=#{parentTenantId}</if>
and property_contract_id in (select id from
wx_property_contract
where status in(2,3,4))
union all
select '' settle_number,id,merchant_id,shop_id,tenant_id,sub_tenant_id,'物业押金' name,4 bill_type_value,'物业押金'
select '' settle_number,id,merchant_id,shop_id,tenant_id,parent_tenant_id,'物业押金' name,4 bill_type_value,'物业押金'
bill_type,need_pay,receive_pay,pay,(receive_pay-pay)
owe,receive_date,pay_date,expired_day,status,starttime,endtime,rent_shop_type,''
price_detail,freeze,0 late_pay_price,0 service_charge_pay
from wx_bill_property_deposit
where tenant_id=#{tenantId}
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>
and property_contract_id in (select id from
wx_property_contract where status in
(2,3,4))
union all
select '' settle_number,id,merchant_id,shop_id,tenant_id,sub_tenant_id,case when type=1 then '水费' when type=2 then '电费' else '空调费' end name,
select '' settle_number,id,merchant_id,shop_id,tenant_id,parent_tenant_id,case when type=1 then '水费' when type=2 then '电费' else '空调费' end name,
case when type=1 then 5 when type=2 then 6 else 9 end bill_type_value,
case when type=1 then '水费' when type=2 then '电费' else '空调费' end bill_type, 0 as need_pay,receive_pay,
pay,(receive_pay+service_charge_pay-pay) owe,receive_date,pay_date,expired_day,status,starttime,endtime,
rent_shop_type,price_detail,freeze,0 late_pay_price,service_charge_pay
from wx_bill_daily where tenant_id=#{tenantId}
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>
union all
select '' settle_number,id,merchant_id,shop_id,tenant_id,sub_tenant_id,name,7 bill_type_vaue,'其他费用' bill_type,0 as
select '' settle_number,id,merchant_id,shop_id,tenant_id,parent_tenant_id,name,7 bill_type_vaue,'其他费用' bill_type,0 as
need_pay,receive_pay,pay,(receive_pay+service_charge_pay-pay) owe,receive_date,pay_date,expired_day,status,''
starttime,'' endtime,rent_shop_type,''
price_detail,freeze,0 late_pay_price,service_charge_pay
from wx_bill_other where tenant_id=#{tenantId}
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>
union all
select '' settle_number,id,merchant_id,shop_id,tenant_id,sub_tenant_id,comments as name,8 bill_type_value,'其他押金' bill_type,0 as
select '' settle_number,id,merchant_id,shop_id,tenant_id,parent_tenant_id,comments as name,8 bill_type_value,'其他押金' bill_type,0 as
need_pay,receive_pay,pay,(receive_pay+service_charge_pay-pay) owe,receive_date,pay_date,expired_day,status,''
starttime,'' endtime,rent_shop_type,''
price_detail,freeze,0 late_pay_price,service_charge_pay
from wx_bill_other_deposit where tenant_id=#{tenantId}
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>

union all
select s.settle_number,s.id,s.merchant_id,'' shop_id,s.tenant_id,sub_tenant_id,'结算单' name, 10 bill_type_value,'结算单' bill_type,0 need_pay,
select s.settle_number,s.id,s.merchant_id,'' shop_id,s.tenant_id,parent_tenant_id,'结算单' name, 10 bill_type_value,'结算单' bill_type,0 need_pay,
((select IFNULL(sum(bill.owe),0) from wx_bill_settle_bill bb left join
(select id,merchant_id,shop_id,tenant_id,sub_tenant_id,1 bill_type_value,'租金'
(select id,merchant_id,shop_id,tenant_id,parent_tenant_id,1 bill_type_value,'租金'
bill_type,need_pay,receive_pay,pay,(receive_pay+service_charge_pay+ifnull(late_pay_price,0)-pay)
owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_rent where is_preview = 0
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,2 bill_type_value,'租赁押金'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,2 bill_type_value,'租赁押金'
bill_type,need_pay,receive_pay,pay,(receive_pay-pay)
owe,receive_date,pay_date,expired_day,status,rent_shop_type from
wx_bill_rent_deposit
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,3 bill_type_value,'物业费'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,3 bill_type_value,'物业费'
bill_type,need_pay,receive_pay,pay,(receive_pay+service_charge_pay+ifnull(late_pay_price,0)-pay)
owe,receive_date,pay_date,expired_day,status,rent_shop_type from
wx_bill_property where is_preview = 0
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,4 bill_type_value,'物业押金'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,4 bill_type_value,'物业押金'
bill_type,need_pay,receive_pay,pay,(receive_pay-pay)
owe,receive_date,pay_date,expired_day,status,rent_shop_type from
wx_bill_property_deposit
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,5 bill_type_value,'水费' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,5 bill_type_value,'水费' bill_type,0 as
need_pay,receive_pay,pay,(receive_pay+service_charge_pay-pay)
owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_daily where
type=1
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,6 bill_type_value,'电费' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,6 bill_type_value,'电费' bill_type,0 as
need_pay,receive_pay,pay,(receive_pay+service_charge_pay-pay)
owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_daily where
type=2
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,9 bill_type_value,'空调费' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,9 bill_type_value,'空调费' bill_type,0 as
need_pay,receive_pay,pay,(receive_pay+service_charge_pay-pay)
owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_daily where
type=3
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,7 bill_type_value,'其他费用' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,7 bill_type_value,'其他费用' bill_type,0 as
need_pay,receive_pay,pay,(receive_pay+service_charge_pay-pay)
owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_other
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,8 bill_type_value,'其他押金' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,8 bill_type_value,'其他押金' bill_type,0 as
need_pay,receive_pay,pay,(receive_pay+service_charge_pay-pay)
owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_other_deposit
union all
select id,id merchant_id,'' shop_id,tenant_id,sub_tenant_id,10 bill_type_value,'补贴' bill_type,0 as
select id,id merchant_id,'' shop_id,tenant_id,parent_tenant_id,10 bill_type_value,'补贴' bill_type,0 as
need_pay,subsidy receive_pay,0 pay,0 owe,'' receive_date,'' pay_date,'' expired_day,status,'' rent_shop_type from wx_merchant_subsidy
) bill
on(bb.bill_id=bill.id) where bb.settle_id = s.id and bb.type=0)
-
(select IFNULL(sum(bill.owe),0) from wx_bill_settle_bill bb left join
(select id,merchant_id,shop_id,tenant_id,sub_tenant_id,1 bill_type_value,'租金'
(select id,merchant_id,shop_id,tenant_id,parent_tenant_id,1 bill_type_value,'租金'
bill_type,need_pay,receive_pay,pay,(receive_pay+service_charge_pay+ifnull(late_pay_price,0)-pay)
owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_rent where is_preview = 0
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,2 bill_type_value,'租赁押金'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,2 bill_type_value,'租赁押金'
bill_type,need_pay,receive_pay,pay,(receive_pay-pay)
owe,receive_date,pay_date,expired_day,status,rent_shop_type from
wx_bill_rent_deposit
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,3 bill_type_value,'物业费'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,3 bill_type_value,'物业费'
bill_type,need_pay,receive_pay,pay,(receive_pay+service_charge_pay+ifnull(late_pay_price,0)-pay)
owe,receive_date,pay_date,expired_day,status,rent_shop_type from
wx_bill_property where is_preview = 0
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,4 bill_type_value,'物业押金'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,4 bill_type_value,'物业押金'
bill_type,need_pay,receive_pay,pay,(receive_pay-pay)
owe,receive_date,pay_date,expired_day,status,rent_shop_type from
wx_bill_property_deposit
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,5 bill_type_value,'水费' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,5 bill_type_value,'水费' bill_type,0 as
need_pay,receive_pay,pay,(receive_pay+service_charge_pay-pay)
owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_daily where
type=1
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,6 bill_type_value,'电费' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,6 bill_type_value,'电费' bill_type,0 as
need_pay,receive_pay,pay,(receive_pay+service_charge_pay-pay)
owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_daily where
type=2
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,9 bill_type_value,'空调费' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,9 bill_type_value,'空调费' bill_type,0 as
need_pay,receive_pay,pay,(receive_pay+service_charge_pay-pay)
owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_daily where
type=3
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,7 bill_type_value,'其他费用' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,7 bill_type_value,'其他费用' bill_type,0 as
need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_other
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,8 bill_type_value,'其他押金' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,8 bill_type_value,'其他押金' bill_type,0 as
need_pay,receive_pay,pay,(receive_pay+service_charge_pay-pay)
owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_other_deposit
union all
select id,id merchant_id,'' shop_id,tenant_id,sub_tenant_id,10 bill_type_value,'补贴' bill_type,0 as
select id,id merchant_id,'' shop_id,tenant_id,parent_tenant_id,10 bill_type_value,'补贴' bill_type,0 as
need_pay,subsidy receive_pay,0 pay,subsidy owe,'' receive_date,'' pay_date,'' expired_day,status,'' rent_shop_type from wx_merchant_subsidy
) bill
on(bb.bill_id=bill.id) where bb.settle_id = s.id and bb.type=1
@@ -442,7 +442,7 @@
status,'' starttime,'' endtime,'' rent_shop_type,'' price_detail, 0 freeze,
0 late_pay_price,0 service_charge_pay
from wx_bill_settle s where s.tenant_id=#{tenantId}
<if test=" null != subTenantId "> and s.`sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and s.`parent_tenant_id` = #{parentTenantId} </if>
and s.status >0

) bill
@@ -457,8 +457,8 @@
<if test=" null != tenantId ">
and bill.tenant_id=#{tenantId}
</if>
<if test=" null != subTenantId ">
and bill.sub_tenant_id=#{subTenantId}
<if test=" null != parentTenantId ">
and bill.parent_tenant_id=#{parentTenantId}
</if>
<if test=" null != merchantId ">
and bill.merchant_id=#{merchantId}
@@ -493,195 +493,195 @@
<select id="getWaitPayBill" resultType="hashmap">
select bill.tenant_id tenantId,bill.sub_tenant_id subTenantId,bill.merchant_id merchantId,m.name merchantName,bill.receive_date receiveDate,
select bill.tenant_id tenantId,bill.parent_tenant_id parentTenantId,bill.merchant_id merchantId,m.name merchantName,bill.receive_date receiveDate,
bill.need_pay needPay,m.link_phone linkPhone,app.appname,m.email,bill.bill_type billType from (
select bill.bill_type,bill.tenant_id,sub_tenant_id,bill.merchant_id,bill.receive_date,ifnull(sum(need_pay),0) need_pay from (
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'租金' name,1 bill_type_value,'租金'
select bill.bill_type,bill.tenant_id,parent_tenant_id,bill.merchant_id,bill.receive_date,ifnull(sum(need_pay),0) need_pay from (
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'租金' name,1 bill_type_value,'租金'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_rent where is_preview = 0
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_rent_deposit
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'物业费' name,3 bill_type_value,'物业费'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'物业费' name,3 bill_type_value,'物业费'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_property where is_preview = 0
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'物业押金' name,4 bill_type_value,'物业押金'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'物业押金' name,4 bill_type_value,'物业押金'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_property_deposit
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'水费' name,5 bill_type_value,'水费' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'水费' name,5 bill_type_value,'水费' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_daily where type=1
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'电费' name,6 bill_type_value,'电费' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'电费' name,6 bill_type_value,'电费' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_daily where type=2
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'空调费' name,9 bill_type_value,'空调费' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'空调费' name,9 bill_type_value,'空调费' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_daily where type=3
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,name,7 bill_type_value,'其他费用' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,name,7 bill_type_value,'其他费用' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_other
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,name,8 bill_type_value,'其他押金' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,name,8 bill_type_value,'其他押金' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_other_deposit
) bill
where bill.status not in(3,5,6)
group by bill.tenant_id,bill.sub_tenant_id,bill.merchant_id,bill.receive_date) bill
group by bill.tenant_id,bill.parent_tenant_id,bill.merchant_id,bill.receive_date) bill
left join wx_merchant m on bill.merchant_id=m.id
left join (select tenant_id,sub_tenant_id,`name` appname from wx_appinfo app where type=1) app on bill.tenant_id=app.tenant_id
left join (select tenant_id,parent_tenant_id,`name` appname from wx_appinfo app where type=1) app on bill.tenant_id=app.tenant_id
where m.status=1 and DATEDIFF(bill.receive_date,now())=m.bill_setting
</select>
<select id="getOweBill" resultType="hashmap">
select bill.tenant_id tenantId,bill.sub_tenant_id subTenantId,bill.merchant_id merchantId,m.name merchantName,bill.owe,m.link_phone linkPhone,app.appname from (
select bill.tenant_id,bill.sub_tenant_id,bill.merchant_id,sum(owe) owe from (
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'租金' name,1 bill_type_value,'租金'
select bill.tenant_id tenantId,bill.parent_tenant_id parentTenantId,bill.merchant_id merchantId,m.name merchantName,bill.owe,m.link_phone linkPhone,app.appname from (
select bill.tenant_id,bill.parent_tenant_id,bill.merchant_id,sum(owe) owe from (
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'租金' name,1 bill_type_value,'租金'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_rent where is_preview = 0
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_rent_deposit
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'物业费' name,3 bill_type_value,'物业费'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'物业费' name,3 bill_type_value,'物业费'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_property where is_preview = 0
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'物业押金' name,4 bill_type_value,'物业押金'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'物业押金' name,4 bill_type_value,'物业押金'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_property_deposit
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'水费' name,5 bill_type_value,'水费' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'水费' name,5 bill_type_value,'水费' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_daily where type=1
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'电费' name,6 bill_type_value,'电费' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'电费' name,6 bill_type_value,'电费' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_daily where type=2
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'空调费' name,9 bill_type_value,'空调费' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'空调费' name,9 bill_type_value,'空调费' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_daily where type=3
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,name,7 bill_type_value,'其他费用' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,name,7 bill_type_value,'其他费用' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_other
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,name,8 bill_type_value,'其他押金' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,name,8 bill_type_value,'其他押金' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_other_deposit
) bill
where DATEDIFF(bill.receive_date,now())&lt;0 and bill.status not in(3,5,6)
group by bill.tenant_id,bill.sub_tenant_id,bill.merchant_id) bill
group by bill.tenant_id,bill.parent_tenant_id,bill.merchant_id) bill
left join wx_merchant m on bill.merchant_id=m.id
left join (select tenant_id,sub_tenant_id,`name` appname from wx_appinfo app where type=1) app on bill.tenant_id=app.tenant_id
left join (select tenant_id,parent_tenant_id,`name` appname from wx_appinfo app where type=1) app on bill.tenant_id=app.tenant_id
where m.status=1
</select>

<select id="getWaitPayBillForEmail" resultType="hashmap">
select bill.tenant_id tenantId,bill.sub_tenant_id subTenantId,bill.merchant_id merchantId,m.name merchantName,bill.receive_date receiveDate,
select bill.tenant_id tenantId,bill.parent_tenant_id parentTenantId,bill.merchant_id merchantId,m.name merchantName,bill.receive_date receiveDate,
bill.need_pay needPay,m.link_phone linkPhone,app.appname,m.email,bill.bill_type billType,ws.manager,ws.manager_phone managerPhone from (
select bill.bill_type,bill.tenant_id,bill.sub_tenant_id,bill.merchant_id,bill.receive_date,ifnull(sum(need_pay),0) need_pay from (
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'租金' name,1 bill_type_value,'租金'
select bill.bill_type,bill.tenant_id,bill.parent_tenant_id,bill.merchant_id,bill.receive_date,ifnull(sum(need_pay),0) need_pay from (
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'租金' name,1 bill_type_value,'租金'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_rent where is_preview = 0
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_rent_deposit
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'物业费' name,3 bill_type_value,'物业费'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'物业费' name,3 bill_type_value,'物业费'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_property where is_preview = 0
union
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'物业押金' name,4 bill_type_value,'物业押金'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'物业押金' name,4 bill_type_value,'物业押金'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_property_deposit
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'水费' name,5 bill_type_value,'水费' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'水费' name,5 bill_type_value,'水费' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_daily where type=1
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'电费' name,6 bill_type_value,'电费' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'电费' name,6 bill_type_value,'电费' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_daily where type=2
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'空调费' name,9 bill_type_value,'空调费' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'空调费' name,9 bill_type_value,'空调费' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_daily where type=3
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,name,7 bill_type_value,'其他费用' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,name,7 bill_type_value,'其他费用' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_other
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,name,8 bill_type_value,'其他押金' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,name,8 bill_type_value,'其他押金' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_other_deposit
) bill
where bill.status not in(3,5,6)
group by bill.tenant_id,bill.sub_tenant_id,bill.merchant_id,bill.receive_date,bill.bill_type
group by bill.tenant_id,bill.parent_tenant_id,bill.merchant_id,bill.receive_date,bill.bill_type
) bill
left join wx_merchant m on bill.merchant_id=m.id
left join (select tenant_id,sub_tenant_id,`name` appname from wx_appinfo app where type=1) app on bill.tenant_id=app.tenant_id
left join (select tenant_id,parent_tenant_id,`name` appname from wx_appinfo app where type=1) app on bill.tenant_id=app.tenant_id
left join wx_merchant_shop wms on wms.merchant_id = m.id
left join wx_shop ws on wms.shop_id = ws.id
where m.status=1 and DATEDIFF(bill.receive_date,now())=m.bill_setting
</select>

<select id="getOweBillForEmail" resultType="hashmap">
select bill.tenant_id tenantId,bill.sub_tenant_id, subTenantId,bill.merchant_id merchantId,bill.bill_type billType,bill.owe owe,m.link_phone managerPhone,m.`link_person` manager,m.email,app.appname,bill.receive_date receiveDate
select bill.tenant_id tenantId,bill.parent_tenant_id, parentTenantId,bill.merchant_id merchantId,bill.bill_type billType,bill.owe owe,m.link_phone managerPhone,m.`link_person` manager,m.email,app.appname,bill.receive_date receiveDate
,DATEDIFF(now(),bill.receive_date) expiredDay from (
select bill.tenant_id,bill.sub_tenant_id,bill.merchant_id,bill.bill_type,sum(owe) owe,bill.receive_date,bill.expired_day from (
select bill.tenant_id,bill.parent_tenant_id,bill.merchant_id,bill.bill_type,sum(owe) owe,bill.receive_date,bill.expired_day from (

select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'租金' name,1 bill_type_value,'租金'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'租金' name,1 bill_type_value,'租金'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_rent where is_preview = 0
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_rent_deposit
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'物业费' name,3 bill_type_value,'物业费'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'物业费' name,3 bill_type_value,'物业费'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_property where is_preview = 0
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'物业押金' name,4 bill_type_value,'物业押金'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'物业押金' name,4 bill_type_value,'物业押金'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_property_deposit
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'水费' name,5 bill_type_value,'水费' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'水费' name,5 bill_type_value,'水费' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_daily where type=1
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'电费' name,6 bill_type_value,'电费' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'电费' name,6 bill_type_value,'电费' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_daily where type=2
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'空调费' name,9 bill_type_value,'空调费' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'空调费' name,9 bill_type_value,'空调费' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_daily where type=3
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,name,7 bill_type_value,'其他费用' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,name,7 bill_type_value,'其他费用' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_other
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,name,8 bill_type_value,'其他押金' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,name,8 bill_type_value,'其他押金' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_other_deposit

) bill
where DATEDIFF(bill.receive_date,now())&lt;0 and bill.status not in(3,5,6)
group by bill.tenant_id,bill.sub_tenant_id,bill.merchant_id,bill.bill_type) bill
group by bill.tenant_id,bill.parent_tenant_id,bill.merchant_id,bill.bill_type) bill
left join wx_merchant m on bill.merchant_id=m.id
left join (select tenant_id,sub_tenant_id,`name` appname from wx_appinfo app where type=1) app on bill.tenant_id=app.tenant_id
left join (select tenant_id,parent_tenant_id,`name` appname from wx_appinfo app where type=1) app on bill.tenant_id=app.tenant_id
where m.status=1
</select>

@@ -702,7 +702,7 @@
</sql>

<select id="getOweBillAsPage" parameterType="com.iformall.domain.vo.WxBillAll" resultType="hashmap">
select bill.tenant_id tenantId,bill.sub_tenant_id subTenantId,bill.merchant_id merchantId,m.name merchantName,bill.bill_type billType,
select bill.tenant_id tenantId,bill.parent_tenant_id parentTenantId,bill.merchant_id merchantId,m.name merchantName,bill.bill_type billType,
m.link_phone managerPhone,m.`link_person` manager,m.email,
bill.receive_date receiveDate,DATEDIFF(now(),bill.receive_date) expiredDay,

@@ -770,66 +770,66 @@
max(case oweList.bill_type when '其他费用' then oweList.serviceChargePay else 0 end) otherServiceChargePay
from(
select bill.tenant_id,bill.sub_tenant_id,bill.merchant_id,bill.bill_type,sum(owe)
select bill.tenant_id,bill.parent_tenant_id,bill.merchant_id,bill.bill_type,sum(owe)
owe,bill.receive_date,bill.expired_day,sum(bill.receive_pay) receive_pay,sum(bill.pay)
pay,sum(ifnull(bill.late_pay_price,0)) latePayPrice,sum(bill.service_charge_pay) serviceChargePay from (

select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'租金' name,1 bill_type_value,'租金'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'租金' name,1 bill_type_value,'租金'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d')
receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type,late_pay_price,service_charge_pay from wx_bill_rent where tenant_id = #{tenantId}
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>
and is_preview = 0
<include refid="getOweBillAsPageConditions"/>
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'物业费' name,3 bill_type_value,'物业费'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'物业费' name,3 bill_type_value,'物业费'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type,late_pay_price,service_charge_pay from wx_bill_property where tenant_id = #{tenantId}
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>
and is_preview = 0
<include refid="getOweBillAsPageConditions"/>
union all
select res.id,res.merchant_id,res.shop_id,res.tenant_id,res.sub_tenant_id,res.name,res.bill_type_value,res.bill_type,res.need_pay,
select res.id,res.merchant_id,res.shop_id,res.tenant_id,res.parent_tenant_id,res.name,res.bill_type_value,res.bill_type,res.need_pay,
res.receive_pay,res.pay,res.owe
owe,res.receive_date,res.pay_date,res.expired_day,res.status,res.starttime,res.endtime,res.rent_shop_type,0
late_pay_price,0 service_charge_pay from(
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'欠缴押金' name,2 bill_type_value,'欠缴押金'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'欠缴押金' name,2 bill_type_value,'欠缴押金'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type,service_charge_pay from wx_bill_rent_deposit where tenant_id = #{tenantId}
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>
<include refid="getOweBillAsPageConditions"/>
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'欠缴押金' name,4 bill_type_value,'欠缴押金'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'欠缴押金' name,4 bill_type_value,'欠缴押金'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type,0 service_charge_pay from wx_bill_property_deposit where tenant_id = #{tenantId}
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>
<include refid="getOweBillAsPageConditions"/>
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'欠缴押金' name,8 bill_type_value,'欠缴押金' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'欠缴押金' name,8 bill_type_value,'欠缴押金' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,
pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type,service_charge_pay
from wx_bill_other_deposit where tenant_id = #{tenantId}
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>
<include refid="getOweBillAsPageConditions"/>
) res
union all
select res.id,res.merchant_id,res.shop_id,res.tenant_id,res.sub_tenant_id,res.name,res.bill_type_value,res.bill_type,res.need_pay,
select res.id,res.merchant_id,res.shop_id,res.tenant_id,res.parent_tenant_id,res.name,res.bill_type_value,res.bill_type,res.need_pay,
res.receive_pay,res.pay,res.owe
owe,res.receive_date,res.pay_date,res.expired_day,res.status,res.starttime,res.endtime,res.rent_shop_type,0
late_pay_price,service_charge_pay from(
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'其他费用' name,5 bill_type_value,'其他费用' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'其他费用' name,5 bill_type_value,'其他费用' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,
expired_day,status,'' starttime,'' endtime,rent_shop_type,service_charge_pay
from wx_bill_daily where tenant_id = #{tenantId}
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>
and type in(1,2,3)
<include refid="getOweBillAsPageConditions"/>
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'其他费用' name,7 bill_type_value,'其他费用' bill_type,0 as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'其他费用' name,7 bill_type_value,'其他费用' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,
expired_day,status,'' starttime,'' endtime,rent_shop_type,service_charge_pay
from wx_bill_other where tenant_id = #{tenantId}
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>
<include refid="getOweBillAsPageConditions"/>
) res

@@ -842,7 +842,7 @@
) bill
left join wx_merchant m on bill.merchant_id=m.id
where m.tenant_id = #{tenantId}
<if test=" null != subTenantId "> and m.`sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and m.`parent_tenant_id` = #{parentTenantId} </if>
<if test=" null != merchantName and '' != merchantName">and m.name like concat('%', #{merchantName},'%')</if>
<if test=" null != sortColumns"> order by ${sortColumns} </if>
<if test=" null == sortColumns"> order by totalOwe desc </if>
@@ -851,7 +851,7 @@
<select id="getReceiveAndPayBillAsPage" parameterType="com.iformall.domain.vo.WxBillAll" resultType="hashmap">

select tt.* from (
select m.tenant_id,m.sub_tenant_id,m.id,m.name,ws.shop_number shopNumber,ws.type,m.link_person linkPerson,m.link_phone linkPhone,
select m.tenant_id,m.parent_tenant_id,m.id,m.name,ws.shop_number shopNumber,ws.type,m.link_person linkPerson,m.link_phone linkPhone,
xb.title business,rc.rental_start_date rentalStartDate,rc.rental_end_date rentalEndDate,rc.rent_shop_type,
ifnull(round(
(select sum(bill.receive_pay)+sum(bill.late_pay_price)+sum(bill.receivePay) from (
@@ -951,7 +951,7 @@
) tt where 1=1

<if test=" null != tenantId"> and tt.tenant_id = #{tenantId} </if>
<if test=" null != subTenantId "> and tt.`sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and tt.`parent_tenant_id` = #{parentTenantId} </if>
<if test=" null != merchantId"> and tt.id = #{merchantId} </if>
<if test=" null != merchantName and ''!=merchantName">and tt.name like concat('%', #{merchantName},'%')</if>
<if test=" null != rentShopType"> and tt.rent_shop_type = #{rentShopType} </if>
@@ -967,26 +967,26 @@
<select id="allDepositList" parameterType="com.iformall.domain.vo.WxBillAll" resultMap="allVoResultMap">
select bill.*
from (
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'租赁押金' name,2 billTypeValue,'租赁押金'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'租赁押金' name,2 billTypeValue,'租赁押金'
billType,need_pay,receive_pay receivePay,pay,owe,receive_date receiveDate,pay_date,expired_day,status,freeze,0
late_pay_price,0
service_charge_pay
from wx_bill_rent_deposit where tenant_id=#{tenantId}
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,'物业押金' name,4 billTypeValue,'物业押金'
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,'物业押金' name,4 billTypeValue,'物业押金'
billType,need_pay,receive_pay receivePay,pay,owe,receive_date receiveDate,pay_date,expired_day,status,freeze,0
late_pay_price,0
service_charge_pay
from wx_bill_property_deposit where tenant_id=#{tenantId}
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>
union all
select id,merchant_id,shop_id,tenant_id,sub_tenant_id,comments as name,8 billTypeValue,concat('其他押金-',comments) as
select id,merchant_id,shop_id,tenant_id,parent_tenant_id,comments as name,8 billTypeValue,concat('其他押金-',comments) as
billType,0 as need_pay,receive_pay receivePay,pay,owe,receive_date
receiveDate,pay_date,expired_day,status,freeze,0
late_pay_price,service_charge_pay
from wx_bill_other_deposit where tenant_id=#{tenantId}
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>
) bill
where 1=1
<if test=" null != freeze"> and bill.freeze = #{freeze} </if>


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

@@ -10,7 +10,7 @@
<result column="createtime" jdbcType="TIMESTAMP" property="createtime" />
<result column="expired_day" jdbcType="INTEGER" property="expiredDay" />
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
<result column="sub_tenant_id" jdbcType="VARCHAR" property="subTenantId" />
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
<result column="owe" jdbcType="BIGINT" property="owe"/>
<result column="status" jdbcType="INTEGER" property="status" />
<result column="is_del" jdbcType="INTEGER" property="isDel" />
@@ -34,7 +34,7 @@
<sql id="allColumns">
`id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`,`expired_day`,
`tenant_id`,`sub_tenant_id`,`owe`,`status`,`is_del`,`merchant_id`,`user_id`,`shop_id`,`updatetime`,`type`,
`tenant_id`,`parent_tenant_id`,`owe`,`status`,`is_del`,`merchant_id`,`user_id`,`shop_id`,`updatetime`,`type`,
`rent_shop_type`,`pay_way`,`price_detail`,`starttime`,`endtime`,freeze,build_way,service_charge_pay
</sql>

@@ -48,7 +48,7 @@
<if test=" null != createtime "> and `createtime` = #{createtime} </if>
<if test=" null != expiredDay "> and `expired_day` = #{expiredDay} </if>
<if test=" null != tenantId "> and `tenant_id` = #{tenantId} </if>
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>
<if test=" null != owe "> and `owe` = #{owe} </if>
<if test=" null != status "> and `status` = #{status} </if>
<if test=" null != isDel "> and `is_del` = #{isDel} </if>


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

@@ -4,7 +4,7 @@
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxBillDeposit">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
<result column="sub_tenant_id" jdbcType="VARCHAR" property="subTenantId" />
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
<result column="rent_contract_id" jdbcType="BIGINT" property="rentContractId" />
<result column="receive_pay" jdbcType="BIGINT" property="receivePay"/>
<result column="pay" jdbcType="BIGINT" property="pay"/>
@@ -31,7 +31,7 @@
</resultMap>

<sql id="allColumns">
`id`,`tenant_id`,`sub_tenant_id`,`rent_contract_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`,
`id`,`tenant_id`,`parent_tenant_id`,`rent_contract_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`,
`expired_day`,`owe`,`status`,`is_del`,`need_pay`,`merchant_id`,`user_id`,`shop_id`,`updatetime`,
`rent_shop_type`,`return_price`,`pay_way`,service_charge_pay
</sql>
@@ -40,7 +40,7 @@
where 1 = 1
<if test=" null != id "> and `id` = #{id} </if>
<if test=" null != tenantId "> and `tenant_id` = #{tenantId} </if>
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>
<if test=" null != rentContractId "> and `rent_contract_id` = #{rentContractId} </if>
<if test=" null != receivePay "> and `receive_pay` = #{receivePay} </if>
<if test=" null != pay "> and `pay` = #{pay} </if>
@@ -84,7 +84,7 @@
<if test=" null != merchantId ">and br.`merchant_id` = #{merchantId}</if>
<if test=" null != merchantName and ''!=merchantName ">and m.`name` like concat('%',#{merchantName},'%')</if>
<if test=" null != tenantId ">and br.`tenant_id` = #{tenantId}</if>
<if test=" null != subTenantId "> and br.`sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and br.`parent_tenant_id` = #{parentTenantId} </if>
<if test=" null != status ">and br.`status` = #{status}</if>
<if test=" null != isDel ">and br.`is_del` = #{isDel}</if>
<if test=" null != rentShopType ">and br.`rent_shop_type` = #{rentShopType}</if>
@@ -95,11 +95,11 @@
</select>

<select id="queryPayInfo" resultType="hashmap" parameterType="hashmap">
select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id,sub_tenant_id from wx_bill_rent_deposit
select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id,parent_tenant_id from wx_bill_rent_deposit
where tenant_id=#{tenantId}
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>
and date_format(receive_date,'%Y-%m')=#{receiveDate}
group by tenant_id,sub_tenant_id
group by tenant_id,parent_tenant_id
</select>

<select id="queryPayInfoAllTotal" resultType="hashmap" parameterType="hashmap">
@@ -107,17 +107,17 @@
(
select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_rent_deposit
where tenant_id=#{tenantId}
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>
and receive_date between #{startdate} and #{enddate}
union all
select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_property_deposit
where tenant_id=#{tenantId}
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>
and receive_date between #{startdate} and #{enddate}
union all
select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_other_deposit
where tenant_id=#{tenantId}
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>
and receive_date between #{startdate} and #{enddate}
) res
</select>
@@ -127,17 +127,17 @@
(
select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_rent_deposit
where status = 1 and tenant_id=#{tenantId}
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>
and receive_date between #{startdate} and #{enddate}
union all
select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_property_deposit
where status = 1 and tenant_id=#{tenantId}
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>
and receive_date between #{startdate} and #{enddate}
union all
select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_other_deposit
where status = 1 and tenant_id=#{tenantId}
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>
and receive_date between #{startdate} and #{enddate}
) res
</select>
@@ -145,7 +145,7 @@
<update id="updateNotPaidStatus" parameterType="hashmap">
update wx_bill_rent_deposit set status=#{notPaid},expired_day=DATEDIFF(now(),receive_date)
where tenant_id=#{tenantId}
<if test=" null != subTenantId "> and `sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and `parent_tenant_id` = #{parentTenantId} </if>
and status!=#{paid} and status!=5 and DATEDIFF(now(),receive_date)>0
</update>

@@ -154,7 +154,7 @@
select a.id from (select br.id,rc.receive_period,br.rent_contract_id,br.receive_date from wx_bill_rent_deposit br
left join wx_rent_contract rc on br.rent_contract_id=rc.id
where br.tenant_id=#{tenantId}
<if test=" null != subTenantId "> and br.`sub_tenant_id` = #{subTenantId} </if>
<if test=" null != parentTenantId "> and br.`parent_tenant_id` = #{parentTenantId} </if>
and br.status!=#{paid} and br.status!=5 and now() &lt; br.receive_date
and DATE_ADD(now(),INTERVAL 1 MONTH)>br.receive_date) a)
</update>


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

@@ -4,7 +4,7 @@
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxBillOtherDeposit">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="sub_tenant_id" jdbcType="VARCHAR" property="subTenantId" />
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
<result column="receive_pay" jdbcType="BIGINT" property="receivePay"/>
<result column="pay" jdbcType="BIGINT" property="pay"/>
<result column="receive_date" jdbcType="TIMESTAMP" property="receiveDate"/>
@@ -33,7 +33,7 @@
</resultMap>
<sql id="allColumns">
`id`,`tenant_id`,`sub_tenant_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`,`expired_day`,
`id`,`tenant_id`,`parent_tenant_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`,`expired_day`,
`owe`,`status`,`is_del`,`merchant_id`,`user_id`,`shop_id`,`updatetime`,`name`,`comments`,
`rent_shop_type`,`return_price`,`pay_way`,`starttime`,`endtime`,freeze,service_charge_pay
</sql>
@@ -42,7 +42,7 @@
where 1 = 1
<if test=" null != id ">and `id` = #{id}</if>
<if test=" null != tenantId ">and `tenant_id` = #{tenantId}</if>
<if test=" null != subTenantId ">and `sub_tenant_id` = #{subTenantId}</if>
<if test=" null != parentTenantId ">and `parent_tenant_id` = #{parentTenantId}</if>
<if test=" null != receivePay ">and `receive_pay` = #{receivePay}</if>
<if test=" null != pay ">and `pay` = #{pay}</if>
<if test=" null != receiveDate ">and `receive_date` = #{receiveDate}</if>
@@ -104,14 +104,14 @@
<update id="updateNotPaidStatus" parameterType="hashmap">
update wx_bill_other_deposit set status=#{notPaid},expired_day=DATEDIFF(now(),receive_date)
where tenant_id=#{tenantId}
<if test=" null != subTenantId ">and `sub_tenant_id` = #{subTenantId}</if>
<if test=" null != parentTenantId ">and `parent_tenant_id` = #{parentTenantId}</if>
and status!=#{paid} and status!=5 and DATEDIFF(now(),receive_date)>0
</update>
<update id="updateWaitPayStatus" parameterType="hashmap">
update wx_bill_other_deposit set status=#{waitPay}
where tenant_id=#{tenantId}
<if test=" null != subTenantId ">and `sub_tenant_id` = #{subTenantId}</if>
<if test=" null != parentTenantId ">and `parent_tenant_id` = #{parentTenantId}</if>
and status!=5
and status!=#{paid} and DATEDIFF(now(),receive_date) &lt;=0
</update>


Некоторые файлы не были показаны из-за большого количества измененных файлов

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