diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/base/BaseController.java b/mallinkAdmin/src/main/java/com/iformall/controller/base/BaseController.java
index 4a155946c..ee3e4aa6c 100644
--- a/mallinkAdmin/src/main/java/com/iformall/controller/base/BaseController.java
+++ b/mallinkAdmin/src/main/java/com/iformall/controller/base/BaseController.java
@@ -9,6 +9,7 @@ import com.iformall.domain.po.MallUserInfo;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.shiro.UserSession;
import com.iformall.utils.IPUtil;
+import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;
import org.springframework.web.bind.WebDataBinder;
@@ -74,6 +75,19 @@ public class BaseController {
return tenantEntity;
}
+ /**
+ * 处理集团新增修改所需租户信息
+ * ifParentUpdateTenantInfo
+ */
+ public TenantEntity ifParentUpdateTenantInfo() {
+ TenantEntity info = this.getTenantInfo();
+ if(StringUtils.isBlank(info.getTenantId())){
+ info.setTenantId(info.getParentTenantId());
+ info.setParentTenantId(null);
+ }
+ return info;
+ }
+
public String getIpAddr() {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String ipaddress = IPUtil.getIpAddr(request);
diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/sys/WxAdminLogController.java b/mallinkAdmin/src/main/java/com/iformall/controller/sys/WxAdminLogController.java
index 68e9ca110..f4613cd31 100644
--- a/mallinkAdmin/src/main/java/com/iformall/controller/sys/WxAdminLogController.java
+++ b/mallinkAdmin/src/main/java/com/iformall/controller/sys/WxAdminLogController.java
@@ -22,7 +22,7 @@ public class WxAdminLogController extends BaseController {
@PostMapping("pvlog")
public ResultData pvLog(@RequestBody WxAdminLog wxAdminLog) {
logger.debug("[" + getIpAddr() + "] WxAdminLogController::pvLog");
- wxAdminLog.updateTenantInfo(getTenantInfo());
+ wxAdminLog.updateTenantInfo(ifParentUpdateTenantInfo());
wxAdminLogService.saveLogCount(wxAdminLog);
return new ResultData();
}
diff --git a/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml b/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml
index 6c59e1e2e..a00fccd3d 100644
--- a/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml
+++ b/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml
@@ -315,13 +315,13 @@
inner join wx_c_user cu1 on cu1.id = cubi.id
where 1=1
- and cubi.date_format(create_date, '%Y-%m-%d') <= reportTime
+ and cubi.date_format(cubi.create_date, '%Y-%m-%d') <= cubi.reportTime
- and cubi.date_format(create_date, '%Y-%m') <= reportTime
+ and cubi.date_format(cubi.create_date, '%Y-%m') <= cubi.reportTime
- and cubi.date_format(create_date, '%Y') <= reportTime
+ and cubi.date_format(cubi.create_date, '%Y') <= cubi.reportTime
and cubi.`tenant_id` = #{tenantId}
diff --git a/mallinkService/src/main/resources/mapper/WxLevelConfigMapper.xml b/mallinkService/src/main/resources/mapper/WxLevelConfigMapper.xml
index af9b0654c..19558a0ca 100644
--- a/mallinkService/src/main/resources/mapper/WxLevelConfigMapper.xml
+++ b/mallinkService/src/main/resources/mapper/WxLevelConfigMapper.xml
@@ -15,47 +15,50 @@
- `id`, `tenant_id`, `points`, `level`, `description`, `create_date`, `update_date`, `discount_enable`, `capability`,`scale`
+ wlc.`id`, wlc.`tenant_id`, wlc.`points`, wlc.`level`, wlc.`description`, wlc.`create_date`, wlc.`update_date`, wlc.`discount_enable`, wlc.`capability`,wlc.`scale`
where 1 = 1
- and `id` = #{id}
+ and wlc.`id` = #{id}
-
- and `tenant_id` = #{tenantId}
+
+ and wlc.`tenant_id` = #{tenantId}
+
+
+ and wm.`parent_tenant_id` = #{parentTenantId}
- and `points` = #{points}
+ and wlc.`points` = #{points}
- and `level` like concat('%', #{level},'%')
+ and wlc.`level` like concat('%', #{level},'%')
- and `description` like concat('%', #{description},'%')
+ and wlc.`description` like concat('%', #{description},'%')
- and `create_date` = #{createDate}
+ and wlc.`create_date` = #{createDate}
- and `update_date` = #{updateDate}
+ and wlc.`update_date` = #{updateDate}
- and `discount_enable` = #{discountEnable}
+ and wlc.`discount_enable` = #{discountEnable}
- and id in
+ and wlc.id in
#{idItem}
@@ -66,7 +69,8 @@
diff --git a/mallinkService/src/main/resources/mapper/WxShopMapper.xml b/mallinkService/src/main/resources/mapper/WxShopMapper.xml
index fab151fcc..e50fdb8e8 100644
--- a/mallinkService/src/main/resources/mapper/WxShopMapper.xml
+++ b/mallinkService/src/main/resources/mapper/WxShopMapper.xml
@@ -246,10 +246,10 @@