| @@ -37,7 +37,7 @@ public class MarkingDataReportController extends BaseController { | |||||
| @SystemControllerLog(description = "券数据-查询券数据") | @SystemControllerLog(description = "券数据-查询券数据") | ||||
| public ResultData findCouponData() { | public ResultData findCouponData() { | ||||
| logger.debug("[" + getIpAddr() + "] MarkingDataReportController::findCouponData"); | logger.debug("[" + getIpAddr() + "] MarkingDataReportController::findCouponData"); | ||||
| return new ResultData(markingDataReportService.getCouponData(getTenantId())); | |||||
| return new ResultData(markingDataReportService.getCouponData(getTenantInfo())); | |||||
| } | } | ||||
| @ApiOperation("查询券数据列表") | @ApiOperation("查询券数据列表") | ||||
| @@ -48,7 +48,7 @@ public class MarkingDataReportController extends BaseController { | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | ||||
| public ResultData findCouponDataList(@ModelAttribute MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageNum, Integer pageSize) { | public ResultData findCouponDataList(@ModelAttribute MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageNum, Integer pageSize) { | ||||
| logger.debug("[" + getIpAddr() + "] MarkingDataReportController::findCouponDataList"); | logger.debug("[" + getIpAddr() + "] MarkingDataReportController::findCouponDataList"); | ||||
| return new ResultData(markingDataReportService.getCouponDataList(getTenantId(), markingCouponDataReportDto, pageNum, pageSize)); | |||||
| return new ResultData(markingDataReportService.getCouponDataList(getTenantInfo(), markingCouponDataReportDto, pageNum, pageSize)); | |||||
| } | } | ||||
| @ApiOperation("查询场景投放券数据") | @ApiOperation("查询场景投放券数据") | ||||
| @@ -56,7 +56,7 @@ public class MarkingDataReportController extends BaseController { | |||||
| @SystemControllerLog(description = "券数据-查询场景投放券数据") | @SystemControllerLog(description = "券数据-查询场景投放券数据") | ||||
| public ResultData findSceneData() { | public ResultData findSceneData() { | ||||
| logger.debug("[" + getIpAddr() + "] MarkingDataReportController::findSceneData"); | logger.debug("[" + getIpAddr() + "] MarkingDataReportController::findSceneData"); | ||||
| return new ResultData(markingDataReportService.getSceneData(getTenantId())); | |||||
| return new ResultData(markingDataReportService.getSceneData(getTenantInfo())); | |||||
| } | } | ||||
| @ApiOperation("查询场景营销数据列表") | @ApiOperation("查询场景营销数据列表") | ||||
| @@ -67,7 +67,7 @@ public class MarkingDataReportController extends BaseController { | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | ||||
| public ResultData findSceneDataList(@ModelAttribute MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageNum, Integer pageSize) { | public ResultData findSceneDataList(@ModelAttribute MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageNum, Integer pageSize) { | ||||
| logger.debug("[" + getIpAddr() + "] MarkingDataReportController::findSceneDataList"); | logger.debug("[" + getIpAddr() + "] MarkingDataReportController::findSceneDataList"); | ||||
| return new ResultData(markingDataReportService.getSceneDataList(getTenantId(), markingCouponDataReportDto, pageNum, pageSize)); | |||||
| return new ResultData(markingDataReportService.getSceneDataList(getTenantInfo(), markingCouponDataReportDto, pageNum, pageSize)); | |||||
| } | } | ||||
| @ApiOperation("查询触达用户数数据") | @ApiOperation("查询触达用户数数据") | ||||
| @@ -75,7 +75,7 @@ public class MarkingDataReportController extends BaseController { | |||||
| @SystemControllerLog(description = "券数据-查询触达用户数数据") | @SystemControllerLog(description = "券数据-查询触达用户数数据") | ||||
| public ResultData touchUsersData() { | public ResultData touchUsersData() { | ||||
| logger.debug("[" + getIpAddr() + "] MarkingDataReportController::touchUsersData"); | logger.debug("[" + getIpAddr() + "] MarkingDataReportController::touchUsersData"); | ||||
| return new ResultData(markingDataReportService.getTouchUsersReportData(getTenantId())); | |||||
| return new ResultData(markingDataReportService.getTouchUsersReportData(getTenantInfo())); | |||||
| } | } | ||||
| @ApiOperation("查询触达用户数数据列表") | @ApiOperation("查询触达用户数数据列表") | ||||
| @@ -86,7 +86,7 @@ public class MarkingDataReportController extends BaseController { | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | ||||
| public ResultData touchUsersDataList(@ModelAttribute MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageNum, Integer pageSize) { | public ResultData touchUsersDataList(@ModelAttribute MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageNum, Integer pageSize) { | ||||
| logger.debug("[" + getIpAddr() + "] MarkingDataReportController::touchUsersDataList"); | logger.debug("[" + getIpAddr() + "] MarkingDataReportController::touchUsersDataList"); | ||||
| return new ResultData(markingDataReportService.getTouchUsersReportList(getTenantId(), markingCouponDataReportDto, pageNum, pageSize)); | |||||
| return new ResultData(markingDataReportService.getTouchUsersReportList(getTenantInfo(), markingCouponDataReportDto, pageNum, pageSize)); | |||||
| } | } | ||||
| @ApiOperation("触达用户数数据导出") | @ApiOperation("触达用户数数据导出") | ||||
| @@ -29,7 +29,7 @@ public class WxBusinessController extends BaseController { | |||||
| @ApiOperation("业态全列表接口") | @ApiOperation("业态全列表接口") | ||||
| @GetMapping("listAll") | @GetMapping("listAll") | ||||
| public ResultData listAll(Integer filter) { | public ResultData listAll(Integer filter) { | ||||
| return new ResultData(wxBusinessService.findListAll(getTenantId(),filter)); | |||||
| return new ResultData(wxBusinessService.findListAll(getTenantInfo(),filter)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -2,6 +2,7 @@ package com.iformall.service; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.domain.po.MallRolePermission; | import com.iformall.domain.po.MallRolePermission; | ||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import java.util.List; | import java.util.List; | ||||
| @@ -54,7 +55,7 @@ public interface MallRolePermissionService { | |||||
| * @param roleId | * @param roleId | ||||
| * @param perId | * @param perId | ||||
| */ | */ | ||||
| void savePermissions(String tenantId,Long roleId, Long[] perId); | |||||
| void savePermissions(TenantEntity tenantEntity, Long roleId, Long[] perId); | |||||
| @@ -2,6 +2,7 @@ package com.iformall.service; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.domain.po.MallUserAction; | import com.iformall.domain.po.MallUserAction; | ||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.domain.vo.MallUserActionVo; | import com.iformall.domain.vo.MallUserActionVo; | ||||
| public interface MallUserActionService { | public interface MallUserActionService { | ||||
| @@ -31,7 +32,15 @@ public interface MallUserActionService { | |||||
| */ | */ | ||||
| void saveOrUpdate(MallUserAction record); | void saveOrUpdate(MallUserAction record); | ||||
| void saveActionInfo(String tenantId, Integer actionType, String ipAddress, Long userId, String actionDesc); | |||||
| /** | |||||
| * 保存用户操作 | |||||
| * @param tenantEntity | |||||
| * @param actionType | |||||
| * @param ipAddress | |||||
| * @param userId | |||||
| * @param actionDesc | |||||
| */ | |||||
| void saveActionInfo(TenantEntity tenantEntity, Integer actionType, String ipAddress, Long userId, String actionDesc); | |||||
| /** | /** | ||||
| * 根据Id删除实体 | * 根据Id删除实体 | ||||
| @@ -3,6 +3,7 @@ package com.iformall.service; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.domain.dto.MarkingCouponDataReportDto; | import com.iformall.domain.dto.MarkingCouponDataReportDto; | ||||
| import com.iformall.domain.dto.WxOrderReportDto; | import com.iformall.domain.dto.WxOrderReportDto; | ||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.domain.vo.*; | import com.iformall.domain.vo.*; | ||||
| import javax.servlet.http.HttpServletRequest; | import javax.servlet.http.HttpServletRequest; | ||||
| @@ -14,19 +15,19 @@ import java.util.Map; | |||||
| * Created by syf on 2018/8/28. | * Created by syf on 2018/8/28. | ||||
| */ | */ | ||||
| public interface MarkingDataReportService { | public interface MarkingDataReportService { | ||||
| Map<String,Object> getCouponData(String tenantId); | |||||
| Map<String,Object> getCouponData(TenantEntity tenantEntity); | |||||
| Map<String,Object> getSceneData(String tenantId); | |||||
| Map<String,Object> getSceneData(TenantEntity tenantEntity); | |||||
| Map<String,Object> getSceneDataHistory(String tenantId,String startDate,String endDate); | |||||
| Map<String,Object> getSceneDataHistory(TenantEntity tenantEntity, String startDate, String endDate); | |||||
| PageInfo<MarkingCouponDataReportVo> getCouponDataList(String tenantId, MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageIndex, Integer pageSize); | |||||
| PageInfo<MarkingCouponDataReportVo> getCouponDataList(TenantEntity tenantEntity, MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageIndex, Integer pageSize); | |||||
| PageInfo<MarkingSceneDataVo> getSceneDataList(String tenantId, MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageIndex, Integer pageSize); | |||||
| PageInfo<MarkingSceneDataVo> getSceneDataList(TenantEntity tenantEntity, MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageIndex, Integer pageSize); | |||||
| PageInfo<TouchUsersReportVo> getTouchUsersReportList(String tenantId, MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageIndex, Integer pageSize); | |||||
| PageInfo<TouchUsersReportVo> getTouchUsersReportList(TenantEntity tenantEntity, MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageIndex, Integer pageSize); | |||||
| List<TouchUsersReportVo> getTouchUsersReportData(String tenantId); | |||||
| List<TouchUsersReportVo> getTouchUsersReportData(TenantEntity tenantEntity); | |||||
| @@ -2,7 +2,7 @@ package com.iformall.service; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxBrand; | |||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.domain.po.WxBusiness; | import com.iformall.domain.po.WxBusiness; | ||||
| import java.io.Serializable; | import java.io.Serializable; | ||||
| @@ -35,7 +35,7 @@ public interface WxBusinessService { | |||||
| * | * | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| List<WxBusiness> findListAll(String tenantId, Integer filter); | |||||
| List<WxBusiness> findListAll(TenantEntity tenantEntity, Integer filter); | |||||
| /** | /** | ||||
| * 根据Id获得实体 | * 根据Id获得实体 | ||||
| @@ -48,7 +48,6 @@ public interface WxBusinessService { | |||||
| List<WxBusiness> getByIds(Collection<? extends Serializable> ids); | List<WxBusiness> getByIds(Collection<? extends Serializable> ids); | ||||
| List<Map<String,Object>> businessDataList(WxBusiness wxBusiness,Long userid); | List<Map<String,Object>> businessDataList(WxBusiness wxBusiness,Long userid); | ||||
| ResultData devoteList(WxBusiness wxBusiness,Integer pageNum, Integer pageSize); | ResultData devoteList(WxBusiness wxBusiness,Integer pageNum, Integer pageSize); | ||||
| @@ -1,8 +1,11 @@ | |||||
| package com.iformall.service; | package com.iformall.service; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.domain.po.WxMall; | import com.iformall.domain.po.WxMall; | ||||
| import java.util.List; | |||||
| public interface WxMallService { | public interface WxMallService { | ||||
| /** | /** | ||||
| @@ -45,12 +48,18 @@ public interface WxMallService { | |||||
| void deleteById(Long id); | void deleteById(Long id); | ||||
| /** | /** | ||||
| * 根据tenant Id查寻 | |||||
| * | |||||
| * @param id | |||||
| * 根据TenantId查询 | |||||
| * @param tenantEntity | |||||
| * @return | |||||
| */ | */ | ||||
| WxMall getByTenantInfo(TenantEntity tenantEntity); | |||||
| WxMall getByTenantInfoExt(TenantEntity tenantEntity); | |||||
| @Deprecated | |||||
| WxMall getByTenantId(String id); | WxMall getByTenantId(String id); | ||||
| @Deprecated | |||||
| WxMall getByTenantIdExt(String id); | WxMall getByTenantIdExt(String id); | ||||
| @@ -5,6 +5,7 @@ import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.IdWorker; | import com.iformall.common.IdWorker; | ||||
| import com.iformall.domain.po.MallRolePermission; | import com.iformall.domain.po.MallRolePermission; | ||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.MallRolePermissionMapper; | import com.iformall.mapper.MallRolePermissionMapper; | ||||
| import com.iformall.service.MallRolePermissionService; | import com.iformall.service.MallRolePermissionService; | ||||
| @@ -59,7 +60,7 @@ public class MallRolePermissionServiceImpl implements MallRolePermissionService | |||||
| @Override | @Override | ||||
| public void savePermissions(String tenantId, Long roleId, Long[] perId) { | |||||
| public void savePermissions(TenantEntity tenantEntity, Long roleId, Long[] perId) { | |||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| // 删除old | // 删除old | ||||
| mallUserRolePermissionMapper.deleteByRoleId(roleId); | mallUserRolePermissionMapper.deleteByRoleId(roleId); | ||||
| @@ -69,7 +70,7 @@ public class MallRolePermissionServiceImpl implements MallRolePermissionService | |||||
| MallRolePermission permission = new MallRolePermission(); | MallRolePermission permission = new MallRolePermission(); | ||||
| permission.setId(idWorker.nextId()); | permission.setId(idWorker.nextId()); | ||||
| permission.setPermissionId(pId); | permission.setPermissionId(pId); | ||||
| permission.setTenantId(tenantId); | |||||
| permission.updateTenantInfo(tenantEntity); | |||||
| permission.setRoleId(roleId); | permission.setRoleId(roleId); | ||||
| mallRolePermissionList.add(permission); | mallRolePermissionList.add(permission); | ||||
| } | } | ||||
| @@ -3,6 +3,7 @@ package com.iformall.service.impl; | |||||
| import com.github.pagehelper.PageHelper; | import com.github.pagehelper.PageHelper; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.domain.po.MallUserAction; | import com.iformall.domain.po.MallUserAction; | ||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.domain.vo.MallUserActionVo; | import com.iformall.domain.vo.MallUserActionVo; | ||||
| import com.iformall.mapper.MallUserActionMapper; | import com.iformall.mapper.MallUserActionMapper; | ||||
| import com.iformall.service.MallUserActionService; | import com.iformall.service.MallUserActionService; | ||||
| @@ -41,11 +42,11 @@ public class MallUserActionServiceImpl implements MallUserActionService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public void saveActionInfo(String tenantId, Integer actionType, String ipAddress, Long userId, String actionDesc) { | |||||
| public void saveActionInfo(TenantEntity tenantEntity, Integer actionType, String ipAddress, Long userId, String actionDesc) { | |||||
| MallUserAction record = new MallUserAction(); | MallUserAction record = new MallUserAction(); | ||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| record.setId(idWorker.nextId()); | record.setId(idWorker.nextId()); | ||||
| record.setTenantId(tenantId); | |||||
| record.updateTenantInfo(tenantEntity); | |||||
| record.setType(actionType); | record.setType(actionType); | ||||
| record.setIp(ipAddress); | record.setIp(ipAddress); | ||||
| record.setUserId(userId); | record.setUserId(userId); | ||||
| @@ -6,6 +6,7 @@ import com.iformall.domain.dto.MarkingCouponDataReportDto; | |||||
| import com.iformall.domain.dto.WxOrderReportDto; | import com.iformall.domain.dto.WxOrderReportDto; | ||||
| import com.iformall.domain.po.WxCoupon; | import com.iformall.domain.po.WxCoupon; | ||||
| import com.iformall.domain.po.WxCouponOrder; | import com.iformall.domain.po.WxCouponOrder; | ||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.domain.vo.*; | import com.iformall.domain.vo.*; | ||||
| import com.iformall.enums.EnumCarCmd; | import com.iformall.enums.EnumCarCmd; | ||||
| import com.iformall.enums.EnumCouponSendSendType; | import com.iformall.enums.EnumCouponSendSendType; | ||||
| @@ -77,11 +78,11 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| //取的当月券数据 | //取的当月券数据 | ||||
| @Override | @Override | ||||
| public Map<String, Object> getCouponData(String tenantId) { | |||||
| public Map<String, Object> getCouponData(TenantEntity tenantEntity) { | |||||
| //今日领取券数 | //今日领取券数 | ||||
| //查询coupon order表 | //查询coupon order表 | ||||
| WxCouponOrder wxCouponOrder = new WxCouponOrder(); | WxCouponOrder wxCouponOrder = new WxCouponOrder(); | ||||
| wxCouponOrder.setTenantId(tenantId); | |||||
| wxCouponOrder.updateTenantInfo(tenantEntity); | |||||
| wxCouponOrder.setStartTime(addDay(0)); | wxCouponOrder.setStartTime(addDay(0)); | ||||
| wxCouponOrder.setEndTime(addDay(1)); | wxCouponOrder.setEndTime(addDay(1)); | ||||
| int todayCouponCount = wxCouponOrderMapper.findCount(wxCouponOrder); | int todayCouponCount = wxCouponOrderMapper.findCount(wxCouponOrder); | ||||
| @@ -105,7 +106,7 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| //couponData | //couponData | ||||
| HashMap<String, Object> params = new HashMap<>(); | HashMap<String, Object> params = new HashMap<>(); | ||||
| params.put("tenantId", tenantId); | |||||
| params.put("tenantId", tenantEntity.getTenantId()); | |||||
| params.put("startTime", addDay(-30)); | params.put("startTime", addDay(-30)); | ||||
| params.put("endTime", addDay(1)); | params.put("endTime", addDay(1)); | ||||
| List<MarkingCouponDataReportVo> couponDatalist = wxCouponOrderMapper.couponDataMap(params); | List<MarkingCouponDataReportVo> couponDatalist = wxCouponOrderMapper.couponDataMap(params); | ||||
| @@ -143,11 +144,11 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| @Override | @Override | ||||
| public Map<String, Object> getSceneData(String tenantId) { | |||||
| public Map<String, Object> getSceneData(TenantEntity tenantEntity) { | |||||
| //今日营销投放券数 | //今日营销投放券数 | ||||
| int todaySceneCount = wxCouponActionLogMapper.getCountByDateLimit(tenantId, addDay(0), addDay(1)); | |||||
| int yesterdayCount = wxCouponActionLogMapper.getCountByDateLimit(tenantId, addDay(-1), addDay(0)); | |||||
| int lastWeekCount = wxCouponActionLogMapper.getCountByDateLimit(tenantId, addDay(-7), addDay(-6)); | |||||
| int todaySceneCount = wxCouponActionLogMapper.getCountByDateLimit(tenantEntity.getTenantId(), addDay(0), addDay(1)); | |||||
| int yesterdayCount = wxCouponActionLogMapper.getCountByDateLimit(tenantEntity.getTenantId(), addDay(-1), addDay(0)); | |||||
| int lastWeekCount = wxCouponActionLogMapper.getCountByDateLimit(tenantEntity.getTenantId(), addDay(-7), addDay(-6)); | |||||
| NumberFormat nf = NumberFormat.getPercentInstance(); | NumberFormat nf = NumberFormat.getPercentInstance(); | ||||
| nf.setMinimumFractionDigits(2);//控制保留小数点后几位,2:表示保留2位小数点 | nf.setMinimumFractionDigits(2);//控制保留小数点后几位,2:表示保留2位小数点 | ||||
| @@ -161,7 +162,7 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| } | } | ||||
| HashMap<String, Object> params = new HashMap<>(); | HashMap<String, Object> params = new HashMap<>(); | ||||
| params.put("tenantId", tenantId); | |||||
| params.put("tenantId", tenantEntity.getTenantId()); | |||||
| params.put("startTime", addDay(-30)); | params.put("startTime", addDay(-30)); | ||||
| params.put("endTime", addDay(1)); | params.put("endTime", addDay(1)); | ||||
| //停车发券数 停车发券被核销数 核销发券数 核销发券被核销数 | //停车发券数 停车发券被核销数 核销发券数 核销发券被核销数 | ||||
| @@ -170,7 +171,7 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| //停车发券被核销数 | //停车发券被核销数 | ||||
| HashMap<String, Object> params1 = new HashMap<>(); | HashMap<String, Object> params1 = new HashMap<>(); | ||||
| params1.put("tenantId", tenantId); | |||||
| params1.put("tenantId", tenantEntity.getTenantId()); | |||||
| params1.put("startTime", addDay(-30)); | params1.put("startTime", addDay(-30)); | ||||
| params1.put("endTime", addDay(1)); | params1.put("endTime", addDay(1)); | ||||
| params1.put("channelType", EnumCouponSendSendType.CAR_STOP.getCode());//停车 | params1.put("channelType", EnumCouponSendSendType.CAR_STOP.getCode());//停车 | ||||
| @@ -179,7 +180,7 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| //核销发券被核销数 | //核销发券被核销数 | ||||
| HashMap<String, Object> params2 = new HashMap<>(); | HashMap<String, Object> params2 = new HashMap<>(); | ||||
| params2.put("tenantId", tenantId); | |||||
| params2.put("tenantId", tenantEntity.getTenantId()); | |||||
| params2.put("startTime", addDay(-30)); | params2.put("startTime", addDay(-30)); | ||||
| params2.put("endTime", addDay(1)); | params2.put("endTime", addDay(1)); | ||||
| params2.put("channelType", EnumCouponSendSendType.COUPON_VERIFY.getCode());//核销 | params2.put("channelType", EnumCouponSendSendType.COUPON_VERIFY.getCode());//核销 | ||||
| @@ -188,7 +189,7 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| // B端刷卡支付被核销数 | // B端刷卡支付被核销数 | ||||
| HashMap<String, Object> params3 = new HashMap<>(); | HashMap<String, Object> params3 = new HashMap<>(); | ||||
| params3.put("tenantId", tenantId); | |||||
| params3.put("tenantId", tenantEntity.getTenantId()); | |||||
| params3.put("startTime", addDay(-30)); | params3.put("startTime", addDay(-30)); | ||||
| params3.put("endTime", addDay(1)); | params3.put("endTime", addDay(1)); | ||||
| params3.put("channelType", EnumCouponSendSendType.B_MICROPAY.getCode());//B端刷卡支付 | params3.put("channelType", EnumCouponSendSendType.B_MICROPAY.getCode());//B端刷卡支付 | ||||
| @@ -197,7 +198,7 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| // 购买发券被核销数 | // 购买发券被核销数 | ||||
| HashMap<String, Object> params4 = new HashMap<>(); | HashMap<String, Object> params4 = new HashMap<>(); | ||||
| params4.put("tenantId", tenantId); | |||||
| params4.put("tenantId", tenantEntity.getTenantId()); | |||||
| params4.put("startTime", addDay(-30)); | params4.put("startTime", addDay(-30)); | ||||
| params4.put("endTime", addDay(1)); | params4.put("endTime", addDay(1)); | ||||
| params4.put("channelType", EnumCouponSendSendType.C_ORDER.getCode());//买券 | params4.put("channelType", EnumCouponSendSendType.C_ORDER.getCode());//买券 | ||||
| @@ -262,9 +263,9 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public PageInfo<MarkingCouponDataReportVo> getCouponDataList(String tenantId, MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageIndex, Integer pageSize) { | |||||
| public PageInfo<MarkingCouponDataReportVo> getCouponDataList(TenantEntity tenantEntity, MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageIndex, Integer pageSize) { | |||||
| HashMap<String, Object> params = new HashMap<>(); | HashMap<String, Object> params = new HashMap<>(); | ||||
| params.put("tenantId", tenantId); | |||||
| params.put("tenantId", tenantEntity.getTenantId()); | |||||
| if (markingCouponDataReportDto.getStartTime() != null) | if (markingCouponDataReportDto.getStartTime() != null) | ||||
| params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(), 0)); | params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(), 0)); | ||||
| if (markingCouponDataReportDto.getEndTime() != null) | if (markingCouponDataReportDto.getEndTime() != null) | ||||
| @@ -283,7 +284,7 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| } | } | ||||
| List<Long> couponIds = couponDatalist.stream().map(p->p.getCouponId()).distinct().collect(Collectors.toList()); | List<Long> couponIds = couponDatalist.stream().map(p->p.getCouponId()).distinct().collect(Collectors.toList()); | ||||
| WxCoupon wxCoupon = new WxCoupon(); | WxCoupon wxCoupon = new WxCoupon(); | ||||
| wxCoupon.setTenantId(tenantId); | |||||
| wxCoupon.updateTenantInfo(tenantEntity); | |||||
| wxCoupon.setIds(couponIds); | wxCoupon.setIds(couponIds); | ||||
| List<WxCoupon> wxCoupons = wxCouponMapper.findList(wxCoupon); | List<WxCoupon> wxCoupons = wxCouponMapper.findList(wxCoupon); | ||||
| Map<Long,WxCoupon> map = wxCoupons.stream().collect(Collectors.toMap(WxCoupon::getId, p -> p)); | Map<Long,WxCoupon> map = wxCoupons.stream().collect(Collectors.toMap(WxCoupon::getId, p -> p)); | ||||
| @@ -299,13 +300,13 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public PageInfo<MarkingSceneDataVo> getSceneDataList(String tenantId, MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageIndex, Integer pageSize) { | |||||
| public PageInfo<MarkingSceneDataVo> getSceneDataList(TenantEntity tenantEntity, MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageIndex, Integer pageSize) { | |||||
| MarkingCouponDataReportDto queryDto = new MarkingCouponDataReportDto(); | MarkingCouponDataReportDto queryDto = new MarkingCouponDataReportDto(); | ||||
| org.springframework.beans.BeanUtils.copyProperties(markingCouponDataReportDto, queryDto); | org.springframework.beans.BeanUtils.copyProperties(markingCouponDataReportDto, queryDto); | ||||
| queryDto.setTenantId(tenantId); | |||||
| queryDto.updateTenantInfo(tenantEntity); | |||||
| HashMap<String, Object> params = new HashMap<>(); | HashMap<String, Object> params = new HashMap<>(); | ||||
| params.put("tenantId", tenantId); | |||||
| params.put("tenantId", tenantEntity.getTenantId()); | |||||
| if (markingCouponDataReportDto.getStartTime() != null) { | if (markingCouponDataReportDto.getStartTime() != null) { | ||||
| params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(), 0)); | params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(), 0)); | ||||
| @@ -346,10 +347,10 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| Map<String, Integer> countMap = new HashMap<>(); | Map<String, Integer> countMap = new HashMap<>(); | ||||
| params.clear(); | |||||
| params.put("tenantId", tenantEntity.getTenantId()); | |||||
| if(markingCouponDataReportDto.getType().equals(EnumCouponSendSendType.CAR_STOP.getCode())){ //停车 | if(markingCouponDataReportDto.getType().equals(EnumCouponSendSendType.CAR_STOP.getCode())){ //停车 | ||||
| //停车发券被核销数 | //停车发券被核销数 | ||||
| params.clear(); | |||||
| params.put("tenantId", tenantId); | |||||
| if (markingCouponDataReportDto.getStartTime() != null) | if (markingCouponDataReportDto.getStartTime() != null) | ||||
| params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); | params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); | ||||
| if (markingCouponDataReportDto.getEndTime() != null) | if (markingCouponDataReportDto.getEndTime() != null) | ||||
| @@ -359,8 +360,6 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| countMap = list1.stream().collect(Collectors.toMap(MarkingSceneDataReportVo::getXTime, p -> p.getTempCount())); | countMap = list1.stream().collect(Collectors.toMap(MarkingSceneDataReportVo::getXTime, p -> p.getTempCount())); | ||||
| } else if(markingCouponDataReportDto.getType().equals(EnumCouponSendSendType.B_MICROPAY.getCode())){ // B端刷卡支付 | } else if(markingCouponDataReportDto.getType().equals(EnumCouponSendSendType.B_MICROPAY.getCode())){ // B端刷卡支付 | ||||
| //B端刷卡发券 被核销数 | //B端刷卡发券 被核销数 | ||||
| params.clear(); | |||||
| params.put("tenantId", tenantId); | |||||
| if (markingCouponDataReportDto.getStartTime() != null) | if (markingCouponDataReportDto.getStartTime() != null) | ||||
| params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); | params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); | ||||
| if (markingCouponDataReportDto.getEndTime() != null) | if (markingCouponDataReportDto.getEndTime() != null) | ||||
| @@ -370,8 +369,6 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| countMap = list2.stream().collect(Collectors.toMap(MarkingSceneDataReportVo::getXTime, p -> p.getTempCount())); | countMap = list2.stream().collect(Collectors.toMap(MarkingSceneDataReportVo::getXTime, p -> p.getTempCount())); | ||||
| } else if (markingCouponDataReportDto.getType().equals(EnumCouponSendSendType.COUPON_VERIFY.getCode())){ | } else if (markingCouponDataReportDto.getType().equals(EnumCouponSendSendType.COUPON_VERIFY.getCode())){ | ||||
| //核销发券被核销数 | //核销发券被核销数 | ||||
| params.clear(); | |||||
| params.put("tenantId", tenantId); | |||||
| if (markingCouponDataReportDto.getStartTime() != null) | if (markingCouponDataReportDto.getStartTime() != null) | ||||
| params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); | params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); | ||||
| if (markingCouponDataReportDto.getEndTime() != null) | if (markingCouponDataReportDto.getEndTime() != null) | ||||
| @@ -381,8 +378,6 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| countMap = list3.stream().collect(Collectors.toMap(MarkingSceneDataReportVo::getXTime, p -> p.getTempCount())); | countMap = list3.stream().collect(Collectors.toMap(MarkingSceneDataReportVo::getXTime, p -> p.getTempCount())); | ||||
| } else if (markingCouponDataReportDto.getType().equals(EnumCouponSendSendType.C_ORDER.getCode())){ | } else if (markingCouponDataReportDto.getType().equals(EnumCouponSendSendType.C_ORDER.getCode())){ | ||||
| //购买发数 | //购买发数 | ||||
| params.clear(); | |||||
| params.put("tenantId", tenantId); | |||||
| if (markingCouponDataReportDto.getStartTime() != null) | if (markingCouponDataReportDto.getStartTime() != null) | ||||
| params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); | params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); | ||||
| if (markingCouponDataReportDto.getEndTime() != null) | if (markingCouponDataReportDto.getEndTime() != null) | ||||
| @@ -392,8 +387,6 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| countMap = list4.stream().collect(Collectors.toMap(MarkingSceneDataReportVo::getXTime, p -> p.getTempCount())); | countMap = list4.stream().collect(Collectors.toMap(MarkingSceneDataReportVo::getXTime, p -> p.getTempCount())); | ||||
| } else if (markingCouponDataReportDto.getType().equals(EnumCouponSendSendType.MERCHANT.getCode())){ | } else if (markingCouponDataReportDto.getType().equals(EnumCouponSendSendType.MERCHANT.getCode())){ | ||||
| //购买发数 | //购买发数 | ||||
| params.clear(); | |||||
| params.put("tenantId", tenantId); | |||||
| if (markingCouponDataReportDto.getStartTime() != null) | if (markingCouponDataReportDto.getStartTime() != null) | ||||
| params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); | params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); | ||||
| if (markingCouponDataReportDto.getEndTime() != null) | if (markingCouponDataReportDto.getEndTime() != null) | ||||
| @@ -405,10 +398,10 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| Map<String, Integer> triggerCountMap = new HashMap<>(); | Map<String, Integer> triggerCountMap = new HashMap<>(); | ||||
| params.clear(); | |||||
| params.put("tenantId", tenantEntity.getTenantId()); | |||||
| if(markingCouponDataReportDto.getType().equals(EnumCouponSendSendType.CAR_STOP.getCode())){ //停车 | if(markingCouponDataReportDto.getType().equals(EnumCouponSendSendType.CAR_STOP.getCode())){ //停车 | ||||
| //获取车辆进场数 | //获取车辆进场数 | ||||
| params.clear(); | |||||
| params.put("tenantId", tenantId); | |||||
| if (markingCouponDataReportDto.getStartTime() != null) | if (markingCouponDataReportDto.getStartTime() != null) | ||||
| params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); | params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); | ||||
| if (markingCouponDataReportDto.getEndTime() != null) | if (markingCouponDataReportDto.getEndTime() != null) | ||||
| @@ -419,8 +412,6 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| triggerCountMap = markingSceneDataVos.stream().collect(Collectors.toMap(MarkingSceneDataVo::getXtime, p -> p.getTriggerCount())); | triggerCountMap = markingSceneDataVos.stream().collect(Collectors.toMap(MarkingSceneDataVo::getXtime, p -> p.getTriggerCount())); | ||||
| } else if(markingCouponDataReportDto.getType().equals(EnumCouponSendSendType.B_MICROPAY.getCode())){ // B端刷卡支付发券 | } else if(markingCouponDataReportDto.getType().equals(EnumCouponSendSendType.B_MICROPAY.getCode())){ // B端刷卡支付发券 | ||||
| //获取B端刷卡数 | //获取B端刷卡数 | ||||
| params.clear(); | |||||
| params.put("tenantId", tenantId); | |||||
| if (markingCouponDataReportDto.getStartTime() != null) | if (markingCouponDataReportDto.getStartTime() != null) | ||||
| params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); | params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); | ||||
| if (markingCouponDataReportDto.getEndTime() != null) | if (markingCouponDataReportDto.getEndTime() != null) | ||||
| @@ -430,8 +421,6 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| triggerCountMap = markingSceneDataVos.stream().collect(Collectors.toMap(MarkingSceneDataVo::getXtime, p -> p.getTriggerCount())); | triggerCountMap = markingSceneDataVos.stream().collect(Collectors.toMap(MarkingSceneDataVo::getXtime, p -> p.getTriggerCount())); | ||||
| } else if (markingCouponDataReportDto.getType().equals(EnumCouponSendSendType.COUPON_VERIFY.getCode())) { | } else if (markingCouponDataReportDto.getType().equals(EnumCouponSendSendType.COUPON_VERIFY.getCode())) { | ||||
| //获取核销数 | //获取核销数 | ||||
| params.clear(); | |||||
| params.put("tenantId", tenantId); | |||||
| if (markingCouponDataReportDto.getStartTime() != null) | if (markingCouponDataReportDto.getStartTime() != null) | ||||
| params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); | params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); | ||||
| if (markingCouponDataReportDto.getEndTime() != null) | if (markingCouponDataReportDto.getEndTime() != null) | ||||
| @@ -440,8 +429,6 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| triggerCountMap = markingSceneDataVos.stream().collect(Collectors.toMap(MarkingSceneDataVo::getXtime, p -> p.getTriggerCount())); | triggerCountMap = markingSceneDataVos.stream().collect(Collectors.toMap(MarkingSceneDataVo::getXtime, p -> p.getTriggerCount())); | ||||
| }else if (markingCouponDataReportDto.getType().equals(EnumCouponSendSendType.C_ORDER.getCode())) { | }else if (markingCouponDataReportDto.getType().equals(EnumCouponSendSendType.C_ORDER.getCode())) { | ||||
| //购买发券数 | //购买发券数 | ||||
| params.clear(); | |||||
| params.put("tenantId", tenantId); | |||||
| if (markingCouponDataReportDto.getStartTime() != null) | if (markingCouponDataReportDto.getStartTime() != null) | ||||
| params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); | params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); | ||||
| if (markingCouponDataReportDto.getEndTime() != null) | if (markingCouponDataReportDto.getEndTime() != null) | ||||
| @@ -450,8 +437,6 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| triggerCountMap = markingSceneDataVos.stream().collect(Collectors.toMap(MarkingSceneDataVo::getXtime, p -> p.getTriggerCount())); | triggerCountMap = markingSceneDataVos.stream().collect(Collectors.toMap(MarkingSceneDataVo::getXtime, p -> p.getTriggerCount())); | ||||
| }else if (markingCouponDataReportDto.getType().equals(EnumCouponSendSendType.MERCHANT.getCode())) { | }else if (markingCouponDataReportDto.getType().equals(EnumCouponSendSendType.MERCHANT.getCode())) { | ||||
| //购买发券数 | //购买发券数 | ||||
| params.clear(); | |||||
| params.put("tenantId", tenantId); | |||||
| if (markingCouponDataReportDto.getStartTime() != null) | if (markingCouponDataReportDto.getStartTime() != null) | ||||
| params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); | params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); | ||||
| if (markingCouponDataReportDto.getEndTime() != null) | if (markingCouponDataReportDto.getEndTime() != null) | ||||
| @@ -475,11 +460,11 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public Map<String, Object> getSceneDataHistory(String tenantId,String startDate, String endDate) { | |||||
| public Map<String, Object> getSceneDataHistory(TenantEntity tenantEntity, String startDate, String endDate) { | |||||
| Map<String ,Object> result = new HashedMap(); | Map<String ,Object> result = new HashedMap(); | ||||
| MarkingCouponDataReportDto markingCouponDataReportDto = new MarkingCouponDataReportDto(); | MarkingCouponDataReportDto markingCouponDataReportDto = new MarkingCouponDataReportDto(); | ||||
| markingCouponDataReportDto.setTenantId(tenantId); | |||||
| markingCouponDataReportDto.updateTenantInfo(tenantEntity); | |||||
| Date starttime = DateUtils.stringToDate(startDate); | Date starttime = DateUtils.stringToDate(startDate); | ||||
| markingCouponDataReportDto.setStartTime(starttime); | markingCouponDataReportDto.setStartTime(starttime); | ||||
| @@ -723,9 +708,9 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| @Override | @Override | ||||
| public PageInfo<TouchUsersReportVo> getTouchUsersReportList(String tenantId, MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageIndex, Integer pageSize) { | |||||
| public PageInfo<TouchUsersReportVo> getTouchUsersReportList(TenantEntity tenantEntity, MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageIndex, Integer pageSize) { | |||||
| //查询UV PV | //查询UV PV | ||||
| markingCouponDataReportDto.setTenantId(tenantId); | |||||
| markingCouponDataReportDto.updateTenantInfo(tenantEntity); | |||||
| if (markingCouponDataReportDto.getStartTime() != null) | if (markingCouponDataReportDto.getStartTime() != null) | ||||
| markingCouponDataReportDto.setStartTime(convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); | markingCouponDataReportDto.setStartTime(convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); | ||||
| if (markingCouponDataReportDto.getEndTime() != null) | if (markingCouponDataReportDto.getEndTime() != null) | ||||
| @@ -738,7 +723,7 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| //获取核销人数 | //获取核销人数 | ||||
| //核销量 | //核销量 | ||||
| HashMap<String, Object> params2 = new HashMap<>(); | HashMap<String, Object> params2 = new HashMap<>(); | ||||
| params2.put("tenantId", tenantId); | |||||
| params2.put("tenantId", tenantEntity.getTenantId()); | |||||
| if (markingCouponDataReportDto.getStartTime() != null) | if (markingCouponDataReportDto.getStartTime() != null) | ||||
| params2.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); | params2.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); | ||||
| if (markingCouponDataReportDto.getEndTime() != null) | if (markingCouponDataReportDto.getEndTime() != null) | ||||
| @@ -748,10 +733,10 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public List<TouchUsersReportVo> getTouchUsersReportData(String tenantId){ | |||||
| public List<TouchUsersReportVo> getTouchUsersReportData(TenantEntity tenantEntity){ | |||||
| //查询UV PV | //查询UV PV | ||||
| HashMap<String, Object> params = new HashMap<>(); | HashMap<String, Object> params = new HashMap<>(); | ||||
| params.put("tenantId", tenantId); | |||||
| params.put("tenantId", tenantEntity.getTenantId()); | |||||
| params.put("startTime", addDay(-30)); | params.put("startTime", addDay(-30)); | ||||
| params.put("endTime", addDay(1)); | params.put("endTime", addDay(1)); | ||||
| List<TouchUsersReportVo> wxUserVisitList = wxUserVisitMapper.touchUsersReportData(params); | List<TouchUsersReportVo> wxUserVisitList = wxUserVisitMapper.touchUsersReportData(params); | ||||
| @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||||
| import com.github.pagehelper.PageHelper; | import com.github.pagehelper.PageHelper; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.domain.po.WxBusiness; | import com.iformall.domain.po.WxBusiness; | ||||
| import com.iformall.domain.po.WxPropertyContract; | import com.iformall.domain.po.WxPropertyContract; | ||||
| import com.iformall.domain.po.WxRentContract; | import com.iformall.domain.po.WxRentContract; | ||||
| @@ -49,13 +50,13 @@ public class WxBusinessServiceImpl implements WxBusinessService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public List<WxBusiness> findListAll(String tenantId, Integer filter) { | |||||
| public List<WxBusiness> findListAll(TenantEntity tenantEntity, Integer filter) { | |||||
| if (filter == null) | if (filter == null) | ||||
| return wxBusinessMapper.findListAll(); | return wxBusinessMapper.findListAll(); | ||||
| else if (filter.equals(EnumBusinessFilter.FILTER_BY_COUPON.getCode())) | else if (filter.equals(EnumBusinessFilter.FILTER_BY_COUPON.getCode())) | ||||
| return wxBusinessMapper.findListForCoupon(tenantId); | |||||
| return wxBusinessMapper.findListForCoupon(tenantEntity.getTenantId()); | |||||
| else if (filter.equals(EnumBusinessFilter.FILTER_BY_MERCHANT.getCode())) | else if (filter.equals(EnumBusinessFilter.FILTER_BY_MERCHANT.getCode())) | ||||
| return wxBusinessMapper.findListForMerchant(tenantId); | |||||
| return wxBusinessMapper.findListForMerchant(tenantEntity.getTenantId()); | |||||
| else | else | ||||
| return wxBusinessMapper.findListAll(); | return wxBusinessMapper.findListAll(); | ||||
| } | } | ||||
| @@ -88,7 +89,7 @@ public class WxBusinessServiceImpl implements WxBusinessService { | |||||
| dbRent.getStatus().equals(EnumRentContractStatus.CONTRACT_END.getCode()) || | dbRent.getStatus().equals(EnumRentContractStatus.CONTRACT_END.getCode()) || | ||||
| dbRent.getStatus().equals(EnumRentContractStatus.CONTRACT_TERMINATE.getCode()) || | dbRent.getStatus().equals(EnumRentContractStatus.CONTRACT_TERMINATE.getCode()) || | ||||
| dbRent.getStatus().equals(EnumRentContractStatus.INVALID.getCode())) { | dbRent.getStatus().equals(EnumRentContractStatus.INVALID.getCode())) { | ||||
| System.out.println("rent rentInfo is null:{}" + dbRent.getId()); | |||||
| logger.warn("rent rentInfo is null-1: " + dbRent.getId()); | |||||
| continue; | continue; | ||||
| } | } | ||||
| Long price = dbRent.getPrice(); | Long price = dbRent.getPrice(); | ||||
| @@ -109,7 +110,7 @@ public class WxBusinessServiceImpl implements WxBusinessService { | |||||
| dbRent.getStatus().equals(EnumRentContractStatus.CONTRACT_END.getCode()) || | dbRent.getStatus().equals(EnumRentContractStatus.CONTRACT_END.getCode()) || | ||||
| dbRent.getStatus().equals(EnumRentContractStatus.CONTRACT_TERMINATE.getCode()) || | dbRent.getStatus().equals(EnumRentContractStatus.CONTRACT_TERMINATE.getCode()) || | ||||
| dbRent.getStatus().equals(EnumRentContractStatus.INVALID.getCode())) { | dbRent.getStatus().equals(EnumRentContractStatus.INVALID.getCode())) { | ||||
| System.out.println("property rentInfo is null:{}" + dbRent.getId()); | |||||
| logger.warn("property rentInfo is null-2:" + dbRent.getId()); | |||||
| continue; | continue; | ||||
| } | } | ||||
| logger.info("业态分析>>>>>>>>>>>>>>>>>>物业合同ID:" + dbRent.getId()); | logger.info("业态分析>>>>>>>>>>>>>>>>>>物业合同ID:" + dbRent.getId()); | ||||
| @@ -1,7 +1,9 @@ | |||||
| package com.iformall.service.impl; | package com.iformall.service.impl; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||||
| import com.github.pagehelper.PageHelper; | import com.github.pagehelper.PageHelper; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.domain.po.WxMall; | import com.iformall.domain.po.WxMall; | ||||
| import com.iformall.domain.po.WxMallBuilding; | import com.iformall.domain.po.WxMallBuilding; | ||||
| import com.iformall.domain.po.WxMallFloor; | import com.iformall.domain.po.WxMallFloor; | ||||
| @@ -117,6 +119,72 @@ public class WxMallServiceImpl implements WxMallService { | |||||
| } | } | ||||
| } | } | ||||
| @Override | |||||
| public WxMall getByTenantInfo(TenantEntity tenantEntity) { | |||||
| StringBuilder sb = new StringBuilder(); | |||||
| sb.append(Constant.TENANT_KEY_PREV).append(tenantEntity.getTenantId()); | |||||
| String key = sb.toString(); | |||||
| ValueOperations<String, WxMall> operations = mallRedisTemplate.opsForValue(); | |||||
| // 缓存 | |||||
| boolean hasKey = mallRedisTemplate.hasKey(key); | |||||
| if(hasKey) { | |||||
| // 从缓存获取用户信息 | |||||
| WxMall mall = operations.get(key); | |||||
| return mall; | |||||
| } | |||||
| // 不存在,从数据库中获取 | |||||
| WxMall q = new WxMall() {{ | |||||
| setTenantId(tenantEntity.getTenantId()); | |||||
| }}; | |||||
| WxMall mall = null; | |||||
| try { | |||||
| mall = wxMallMapper.selectOne(new QueryWrapper<>(q)); | |||||
| } catch (Exception e) { | |||||
| logger.error(e.getMessage()); | |||||
| } | |||||
| // 插入缓存 | |||||
| if (mall != null) { | |||||
| operations.set(key, mall, 3600, TimeUnit.SECONDS); | |||||
| } | |||||
| return mall; | |||||
| } | |||||
| @Override | |||||
| public WxMall getByTenantInfoExt(TenantEntity tenantEntity) { | |||||
| WxMall mall = getByTenantInfo(tenantEntity); | |||||
| if (mall == null) { | |||||
| return null; | |||||
| } | |||||
| WxMallBuilding wxMallBuilding = new WxMallBuilding() {{ | |||||
| updateTenantInfo(tenantEntity); | |||||
| }}; | |||||
| List<WxMallBuilding> buildings = wxMallBuildingMapper.findList(wxMallBuilding); | |||||
| List<WxMallBuilding> wxMallBuildings = buildings.stream().map(b -> { | |||||
| WxMallBuilding tempb = new WxMallBuilding(); | |||||
| tempb.setId(b.getId()); | |||||
| tempb.setName(b.getName()); | |||||
| return tempb; | |||||
| }).collect(Collectors.toList()); | |||||
| for(WxMallBuilding building:wxMallBuildings){ | |||||
| WxMallFloor wxMallFloor = new WxMallFloor(); | |||||
| wxMallFloor.setBuildingId(building.getId()); | |||||
| List<WxMallFloor> wxMallFloors = wxMallFloorMapper.findList(wxMallFloor).stream().map(f -> { | |||||
| WxMallFloor tempf = new WxMallFloor(); | |||||
| tempf.setId(f.getId()); | |||||
| tempf.setFloorName(f.getFloorName()); | |||||
| tempf.setTotalArea(f.getTotalArea()); | |||||
| tempf.setOperatingArea(f.getOperatingArea()); | |||||
| return tempf; | |||||
| }).collect(Collectors.toList()); | |||||
| building.setFloors(wxMallFloors); | |||||
| } | |||||
| mall.setBuildings(wxMallBuildings); | |||||
| return mall; | |||||
| } | |||||
| @Override | @Override | ||||
| public WxMall getByTenantId(String id) { | public WxMall getByTenantId(String id) { | ||||
| String key = Constant.MALL_KEY_PREV + String.valueOf(id); | String key = Constant.MALL_KEY_PREV + String.valueOf(id); | ||||
| @@ -145,7 +145,7 @@ public class HomeController extends BaseController { | |||||
| if(isLogin) { | if(isLogin) { | ||||
| MallUserInfo info = (MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute(UserSession.userInfo); | MallUserInfo info = (MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute(UserSession.userInfo); | ||||
| info.protectInfos(); | info.protectInfos(); | ||||
| mallUserActionService.saveActionInfo(info.getTenantId(), EnumMallUserAction.CONTROLLER.getCode(), ipaddress, info.getId(), "用户登录"); | |||||
| mallUserActionService.saveActionInfo(info, EnumMallUserAction.CONTROLLER.getCode(), ipaddress, info.getId(), "用户登录"); | |||||
| WxMall mall = mallService.getByTenantId(info.getTenantId()); | WxMall mall = mallService.getByTenantId(info.getTenantId()); | ||||
| if(mall == null) { | if(mall == null) { | ||||
| @@ -239,7 +239,7 @@ public class HomeController extends BaseController { | |||||
| MallUserInfo info = (MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute(UserSession.userInfo); | MallUserInfo info = (MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute(UserSession.userInfo); | ||||
| info.protectInfos(); | info.protectInfos(); | ||||
| mallUserActionService.saveActionInfo(info.getTenantId(), EnumMallUserAction.CONTROLLER.getCode(), ipaddress, info.getId(), "用户登录"); | |||||
| mallUserActionService.saveActionInfo(info, EnumMallUserAction.CONTROLLER.getCode(), ipaddress, info.getId(), "用户登录"); | |||||
| WxMall mall = mallService.getByTenantId(info.getTenantId()); | WxMall mall = mallService.getByTenantId(info.getTenantId()); | ||||
| if (mall == null) { | if (mall == null) { | ||||
| @@ -339,7 +339,7 @@ public class HomeController extends BaseController { | |||||
| MallUserInfo info = (MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute(UserSession.userInfo); | MallUserInfo info = (MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute(UserSession.userInfo); | ||||
| info.protectInfos(); | info.protectInfos(); | ||||
| mallUserActionService.saveActionInfo(info.getTenantId(), EnumMallUserAction.CONTROLLER.getCode(), ipaddress, info.getId(), "用户手机号登录"); | |||||
| mallUserActionService.saveActionInfo(info, EnumMallUserAction.CONTROLLER.getCode(), ipaddress, info.getId(), "用户手机号登录"); | |||||
| WxMall mall = mallService.getByTenantId(info.getTenantId()); | WxMall mall = mallService.getByTenantId(info.getTenantId()); | ||||
| if (mall == null) { | if (mall == null) { | ||||
| @@ -10,6 +10,7 @@ import com.iformall.domain.po.MallRole; | |||||
| import com.iformall.domain.po.MallRolePermission; | import com.iformall.domain.po.MallRolePermission; | ||||
| import com.iformall.domain.po.MallUserInfo; | import com.iformall.domain.po.MallUserInfo; | ||||
| import com.iformall.domain.po.MallUserRole; | import com.iformall.domain.po.MallUserRole; | ||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.enums.EnumUserAdmin; | import com.iformall.enums.EnumUserAdmin; | ||||
| import com.iformall.service.MallRolePermissionService; | import com.iformall.service.MallRolePermissionService; | ||||
| import com.iformall.service.MallRoleService; | import com.iformall.service.MallRoleService; | ||||
| @@ -111,12 +112,11 @@ public class MallRoleController extends BaseController { | |||||
| if(currentUser.getIsAdmin().equals(EnumUserAdmin.Normal.getCode())) { | if(currentUser.getIsAdmin().equals(EnumUserAdmin.Normal.getCode())) { | ||||
| return new ResultData(ErrorCode.USER_NOT_ADMIN.getCode(), "只有系统管理员才能保存角色"); | return new ResultData(ErrorCode.USER_NOT_ADMIN.getCode(), "只有系统管理员才能保存角色"); | ||||
| } | } | ||||
| String tenantId = currentUser.getTenantId(); | |||||
| int count = checkUnique(sysRole.getName(), tenantId); | |||||
| int count = checkUnique(sysRole.getName(), currentUser); | |||||
| if (sysRole.getId() == null && count > 0) { | if (sysRole.getId() == null && count > 0) { | ||||
| return new ResultData(ResultData.ERROR, "角色名已存在"); | return new ResultData(ResultData.ERROR, "角色名已存在"); | ||||
| } | } | ||||
| sysRole.setTenantId(tenantId); | |||||
| sysRole.updateTenantInfo(currentUser); | |||||
| sysRoleService.saveOrUpdate(sysRole); | sysRoleService.saveOrUpdate(sysRole); | ||||
| // SysRolePermissionService.deleteById(id); | // SysRolePermissionService.deleteById(id); | ||||
| if (StringUtils.isNoneBlank(sysRole.getMenus())) { | if (StringUtils.isNoneBlank(sysRole.getMenus())) { | ||||
| @@ -124,7 +124,7 @@ public class MallRoleController extends BaseController { | |||||
| for (String mId : sysRole.getMenus().split(",")) { | for (String mId : sysRole.getMenus().split(",")) { | ||||
| mIds.add(Long.valueOf(mId)); | mIds.add(Long.valueOf(mId)); | ||||
| } | } | ||||
| sysRolePermissionService.savePermissions(tenantId, sysRole.getId(), mIds.toArray(new Long[]{})); | |||||
| sysRolePermissionService.savePermissions(currentUser, sysRole.getId(), mIds.toArray(new Long[]{})); | |||||
| } | } | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @@ -140,7 +140,7 @@ public class MallRoleController extends BaseController { | |||||
| return new ResultData(ErrorCode.USER_NOT_ADMIN.getCode(), "只有系统管理员才能添加角色"); | return new ResultData(ErrorCode.USER_NOT_ADMIN.getCode(), "只有系统管理员才能添加角色"); | ||||
| } | } | ||||
| Assert.notNull(sysRole.getName(), "角色名不能为空"); | Assert.notNull(sysRole.getName(), "角色名不能为空"); | ||||
| Assert.isTrue(checkUnique(sysRole.getName(), currentUser.getTenantId())>0, "重复的角色名"); | |||||
| Assert.isTrue(checkUnique(sysRole.getName(), currentUser)>0, "重复的角色名"); | |||||
| sysRoleService.saveOrUpdate(sysRole); | sysRoleService.saveOrUpdate(sysRole); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @@ -156,7 +156,7 @@ public class MallRoleController extends BaseController { | |||||
| return new ResultData(ErrorCode.USER_NOT_ADMIN.getCode(), "只有系统管理员才能更新角色"); | return new ResultData(ErrorCode.USER_NOT_ADMIN.getCode(), "只有系统管理员才能更新角色"); | ||||
| } | } | ||||
| if (sysRole.getName() != null) { | if (sysRole.getName() != null) { | ||||
| Assert.isTrue(checkUnique(sysRole.getName(), currentUser.getTenantId())>1, "角色名已存在"); | |||||
| Assert.isTrue(checkUnique(sysRole.getName(), currentUser)>1, "角色名已存在"); | |||||
| } | } | ||||
| sysRoleService.saveOrUpdate(sysRole); | sysRoleService.saveOrUpdate(sysRole); | ||||
| // Assert.notNull(sysRole.getName(), "角色名不能为空"); | // Assert.notNull(sysRole.getName(), "角色名不能为空"); | ||||
| @@ -184,10 +184,10 @@ public class MallRoleController extends BaseController { | |||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| private int checkUnique(String name, String tenantId) { | |||||
| private int checkUnique(String name, TenantEntity tenantEntity) { | |||||
| MallRole role = new MallRole(); | MallRole role = new MallRole(); | ||||
| role.setName(name); | role.setName(name); | ||||
| role.setTenantId(tenantId); | |||||
| role.updateTenantInfo(tenantEntity); | |||||
| return sysRoleService.countList(role); | return sysRoleService.countList(role); | ||||
| } | } | ||||
| @@ -33,7 +33,7 @@ public class WxBusinessController extends BaseController { | |||||
| @SystemControllerLog(description = "业态-全列表") | @SystemControllerLog(description = "业态-全列表") | ||||
| public ResultData listAll() { | public ResultData listAll() { | ||||
| logger.debug("[" + getIpAddr() + "] WxBusinessController::getList"); | logger.debug("[" + getIpAddr() + "] WxBusinessController::getList"); | ||||
| final List<WxBusiness> busList = wxBusinessService.findListAll(getTenantId(),null); | |||||
| final List<WxBusiness> busList = wxBusinessService.findListAll(getTenantInfo(),null); | |||||
| return new ResultData(busList); | return new ResultData(busList); | ||||
| } | } | ||||