| @@ -9,6 +9,7 @@ import com.iformall.domain.po.MallUserInfo; | |||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.shiro.UserSession; | import com.iformall.shiro.UserSession; | ||||
| import com.iformall.utils.IPUtil; | import com.iformall.utils.IPUtil; | ||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import org.apache.shiro.SecurityUtils; | import org.apache.shiro.SecurityUtils; | ||||
| import org.apache.shiro.session.Session; | import org.apache.shiro.session.Session; | ||||
| import org.springframework.web.bind.WebDataBinder; | import org.springframework.web.bind.WebDataBinder; | ||||
| @@ -74,6 +75,19 @@ public class BaseController { | |||||
| return tenantEntity; | 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() { | public String getIpAddr() { | ||||
| HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | ||||
| String ipaddress = IPUtil.getIpAddr(request); | String ipaddress = IPUtil.getIpAddr(request); | ||||
| @@ -22,7 +22,7 @@ public class WxAdminLogController extends BaseController { | |||||
| @PostMapping("pvlog") | @PostMapping("pvlog") | ||||
| public ResultData pvLog(@RequestBody WxAdminLog wxAdminLog) { | public ResultData pvLog(@RequestBody WxAdminLog wxAdminLog) { | ||||
| logger.debug("[" + getIpAddr() + "] WxAdminLogController::pvLog"); | logger.debug("[" + getIpAddr() + "] WxAdminLogController::pvLog"); | ||||
| wxAdminLog.updateTenantInfo(getTenantInfo()); | |||||
| wxAdminLog.updateTenantInfo(ifParentUpdateTenantInfo()); | |||||
| wxAdminLogService.saveLogCount(wxAdminLog); | wxAdminLogService.saveLogCount(wxAdminLog); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @@ -315,13 +315,13 @@ | |||||
| inner join wx_c_user cu1 on cu1.id = cubi.id | inner join wx_c_user cu1 on cu1.id = cubi.id | ||||
| where 1=1 | where 1=1 | ||||
| <if test="1 == reportType "> | <if test="1 == reportType "> | ||||
| and cubi.date_format(create_date, '%Y-%m-%d') <= reportTime | |||||
| and cubi.date_format(cubi.create_date, '%Y-%m-%d') <= cubi.reportTime | |||||
| </if> | </if> | ||||
| <if test="2 == reportType "> | <if test="2 == reportType "> | ||||
| and cubi.date_format(create_date, '%Y-%m') <= reportTime | |||||
| and cubi.date_format(cubi.create_date, '%Y-%m') <= cubi.reportTime | |||||
| </if> | </if> | ||||
| <if test="3 == reportType "> | <if test="3 == reportType "> | ||||
| and cubi.date_format(create_date, '%Y') <= reportTime | |||||
| and cubi.date_format(cubi.create_date, '%Y') <= cubi.reportTime | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId and '' != tenantId"> | <if test=" null != tenantId and '' != tenantId"> | ||||
| and cubi.`tenant_id` = #{tenantId} | and cubi.`tenant_id` = #{tenantId} | ||||
| @@ -15,47 +15,50 @@ | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `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` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| where 1 = 1 | where 1 = 1 | ||||
| <if test=" null != id "> | <if test=" null != id "> | ||||
| and `id` = #{id} | |||||
| and wlc.`id` = #{id} | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | |||||
| and `tenant_id` = #{tenantId} | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and wlc.`tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and wm.`parent_tenant_id` = #{parentTenantId} | |||||
| </if> | </if> | ||||
| <if test=" null != points "> | <if test=" null != points "> | ||||
| and `points` = #{points} | |||||
| and wlc.`points` = #{points} | |||||
| </if> | </if> | ||||
| <if test=" null != level "> | <if test=" null != level "> | ||||
| and `level` like concat('%', #{level},'%') | |||||
| and wlc.`level` like concat('%', #{level},'%') | |||||
| </if> | </if> | ||||
| <if test=" null != description "> | <if test=" null != description "> | ||||
| and `description` like concat('%', #{description},'%') | |||||
| and wlc.`description` like concat('%', #{description},'%') | |||||
| </if> | </if> | ||||
| <if test=" null != createDate "> | <if test=" null != createDate "> | ||||
| and `create_date` = #{createDate} | |||||
| and wlc.`create_date` = #{createDate} | |||||
| </if> | </if> | ||||
| <if test=" null != updateDate "> | <if test=" null != updateDate "> | ||||
| and `update_date` = #{updateDate} | |||||
| and wlc.`update_date` = #{updateDate} | |||||
| </if> | </if> | ||||
| <if test=" null != discountEnable "> | <if test=" null != discountEnable "> | ||||
| and `discount_enable` = #{discountEnable} | |||||
| and wlc.`discount_enable` = #{discountEnable} | |||||
| </if> | </if> | ||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | |||||
| and wlc.id in | |||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | ||||
| #{idItem} | #{idItem} | ||||
| </foreach> | </foreach> | ||||
| @@ -66,7 +69,8 @@ | |||||
| <select id="findList" parameterType="com.iformall.domain.po.WxLevelConfig" resultMap="BaseResultMap"> | <select id="findList" parameterType="com.iformall.domain.po.WxLevelConfig" resultMap="BaseResultMap"> | ||||
| select | select | ||||
| <include refid="allColumns"/> | <include refid="allColumns"/> | ||||
| from wx_level_config | |||||
| from wx_level_config wlc | |||||
| left join wx_mall wm on wm.tenant_id = wlc.tenant_id | |||||
| <include refid="dynamicWhereConditions"/> | <include refid="dynamicWhereConditions"/> | ||||
| </select> | </select> | ||||
| @@ -246,10 +246,10 @@ | |||||
| </select> | </select> | ||||
| <select id="notRentListMapAsPage" parameterType="com.iformall.domain.po.WxShop" resultType="hashmap"> | <select id="notRentListMapAsPage" parameterType="com.iformall.domain.po.WxShop" resultType="hashmap"> | ||||
| select s.id as id, s.tenant_id tenantId, s.parent_tenant_id parentTenantId, s.shop_number shopNumber,CONVERT(s.build_area,SIGNED)buildArea, | |||||
| select s.id as id, s.tenant_id tenantId, s.parent_tenant_id parentTenantId, s.shop_number shopNumber,CONVERT(s.build_area,SIGNED) buildArea, | |||||
| s.img_url imgUrl,CONVERT(s.operation_area,SIGNED) operationArea, | s.img_url imgUrl,CONVERT(s.operation_area,SIGNED) operationArea, | ||||
| s.status,b.building_name building,f.floor_name floor,s.manager,s.manager_phone managerPhone, | s.status,b.building_name building,f.floor_name floor,s.manager,s.manager_phone managerPhone, | ||||
| s.type,s.point_type pointType,s.addr,DATEDIFF(now(),s.create_date) freeDay,s.create_date as create_date | |||||
| s.type,s.point_type pointType,s.addr,DATEDIFF(now(),s.create_date) freeDay,s.create_date as createDate | |||||
| from wx_shop s | from wx_shop s | ||||
| left join wx_mall_building b on s.building=b.id | left join wx_mall_building b on s.building=b.id | ||||
| left join wx_mall_floor f on s.floor=f.id | left join wx_mall_floor f on s.floor=f.id | ||||