| @@ -1,10 +1,14 @@ | |||||
| package com.iformall.controller.contract; | package com.iformall.controller.contract; | ||||
| import com.iformall.annotation.SystemControllerLog; | import com.iformall.annotation.SystemControllerLog; | ||||
| import com.iformall.annotation.UserDataRuleAnnotation; | |||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.po.*; | |||||
| import com.iformall.domain.po.MallUserInfo; | |||||
| import com.iformall.domain.po.WxBillProperty; | |||||
| import com.iformall.domain.po.WxMerchant; | |||||
| import com.iformall.domain.po.WxPropertyContract; | |||||
| import com.iformall.enums.EnumIsPreview; | import com.iformall.enums.EnumIsPreview; | ||||
| import com.iformall.enums.EnumRentStartType; | import com.iformall.enums.EnumRentStartType; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| @@ -38,7 +42,8 @@ public class WxPropertyContractController extends BaseController { | |||||
| private Logger logger = LoggerFactory.getLogger(WxPropertyContractController.class); | private Logger logger = LoggerFactory.getLogger(WxPropertyContractController.class); | ||||
| @GetMapping("list") | |||||
| @UserDataRuleAnnotation("property_contract_list") | |||||
| @GetMapping("/list") | |||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | ||||
| @@ -1,22 +1,23 @@ | |||||
| package com.iformall.controller.contract; | package com.iformall.controller.contract; | ||||
| import com.iformall.annotation.SystemControllerLog; | import com.iformall.annotation.SystemControllerLog; | ||||
| import com.iformall.annotation.UserDataRuleAnnotation; | |||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.IdWorker; | |||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.enums.EnumBillAction; | |||||
| import com.iformall.enums.EnumFromType; | import com.iformall.enums.EnumFromType; | ||||
| import com.iformall.enums.EnumIsPreview; | import com.iformall.enums.EnumIsPreview; | ||||
| import com.iformall.enums.EnumRentStartType; | import com.iformall.enums.EnumRentStartType; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.WxBillActionMapper; | |||||
| import com.iformall.mapper.WxBillPropertyMapper; | import com.iformall.mapper.WxBillPropertyMapper; | ||||
| import com.iformall.mapper.WxBillRentMapper; | import com.iformall.mapper.WxBillRentMapper; | ||||
| import com.iformall.mapper.WxRentContractMapper; | import com.iformall.mapper.WxRentContractMapper; | ||||
| import com.iformall.service.*; | |||||
| import com.iformall.service.WxBillRentService; | |||||
| import com.iformall.service.WxMerchantService; | |||||
| import com.iformall.service.WxPayAccountBillService; | |||||
| import com.iformall.service.WxRentContractService; | |||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| @@ -28,9 +29,11 @@ import org.springframework.web.bind.annotation.*; | |||||
| import javax.servlet.http.HttpServletRequest; | import javax.servlet.http.HttpServletRequest; | ||||
| import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
| import java.math.BigDecimal; | |||||
| import java.text.SimpleDateFormat; | import java.text.SimpleDateFormat; | ||||
| import java.util.*; | |||||
| import java.util.Date; | |||||
| import java.util.HashMap; | |||||
| import java.util.List; | |||||
| import java.util.Map; | |||||
| /** | /** | ||||
| * @author gongbiao | * @author gongbiao | ||||
| @@ -88,7 +91,8 @@ public class WxRentContractController extends BaseController { | |||||
| return new ResultData(map); | return new ResultData(map); | ||||
| } | } | ||||
| @GetMapping("list") | |||||
| @UserDataRuleAnnotation("rent_contract_list") | |||||
| @GetMapping("/list") | |||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | ||||
| @@ -2,6 +2,7 @@ package com.iformall.controller.contract; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.annotation.SystemControllerLog; | import com.iformall.annotation.SystemControllerLog; | ||||
| import com.iformall.annotation.UserDataRuleAnnotation; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.po.MallUserInfo; | import com.iformall.domain.po.MallUserInfo; | ||||
| @@ -27,7 +28,8 @@ public class WxRentPropertyContractController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxRentPropertyContractService wxRentPropertyContractService; | private WxRentPropertyContractService wxRentPropertyContractService; | ||||
| @GetMapping("list") | |||||
| @UserDataRuleAnnotation("rent_property_contract_list") | |||||
| @GetMapping("/list") | |||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | ||||
| @@ -2,6 +2,7 @@ package com.iformall.controller.datatower; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.annotation.SystemControllerLog; | import com.iformall.annotation.SystemControllerLog; | ||||
| import com.iformall.annotation.UserDataRuleAnnotation; | |||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| @@ -31,6 +32,7 @@ public class WxMerchantTradeDailyController extends BaseController { | |||||
| private WxMerchantTradeDailyService wxMerchantTradeDailyService; | private WxMerchantTradeDailyService wxMerchantTradeDailyService; | ||||
| @UserDataRuleAnnotation("merchant_trade") | |||||
| @ApiOperation("获得解单列表") | @ApiOperation("获得解单列表") | ||||
| @GetMapping("/list") | @GetMapping("/list") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @@ -93,9 +93,11 @@ public class UserDataRuleAspect { | |||||
| if (targetSet.contains(value)) { | if (targetSet.contains(value)) { | ||||
| //得到方法的参数 | //得到方法的参数 | ||||
| Object[] args = joinPoint.getArgs(); | Object[] args = joinPoint.getArgs(); | ||||
| BaseEntity baseEntity = (BaseEntity) args[0]; | |||||
| baseEntity.setFloorForRule(buildingFloor); | |||||
| baseEntity.setBusinessForRule(businessForRule); | |||||
| if (args[0] instanceof BaseEntity) { | |||||
| BaseEntity baseEntity = (BaseEntity) args[0]; | |||||
| baseEntity.setFloorForRule(buildingFloor); | |||||
| baseEntity.setBusinessForRule(businessForRule); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| @@ -0,0 +1,36 @@ | |||||
| package com.iformall.enums; | |||||
| /** | |||||
| * @author gongbiao | |||||
| */ | |||||
| public enum EnumUserDataRuleType { | |||||
| ALL(1, "系统全部数据"), | |||||
| FLOOR_BUSINESS(2, "楼层及业态数据"),; | |||||
| public static EnumUserDataRuleType getEnum(Integer code) { | |||||
| for (EnumUserDataRuleType value : values()) { | |||||
| if (value.getCode().equals(code)) { | |||||
| return value; | |||||
| } | |||||
| } | |||||
| return null; | |||||
| } | |||||
| private Integer code; | |||||
| private String message; | |||||
| EnumUserDataRuleType(Integer code, String message) { | |||||
| this.code = code; | |||||
| this.message = message; | |||||
| } | |||||
| public Integer getCode() { | |||||
| return code; | |||||
| } | |||||
| public String getMessage() { | |||||
| return message; | |||||
| } | |||||
| } | |||||
| @@ -2,6 +2,7 @@ package com.iformall.service.impl; | |||||
| import com.iformall.common.IdWorker; | import com.iformall.common.IdWorker; | ||||
| import com.iformall.domain.po.WxUserDataRule; | import com.iformall.domain.po.WxUserDataRule; | ||||
| import com.iformall.enums.EnumUserDataRuleType; | |||||
| import com.iformall.mapper.WxUserDataRuleMapper; | import com.iformall.mapper.WxUserDataRuleMapper; | ||||
| import com.iformall.service.WxUserDataRuleService; | import com.iformall.service.WxUserDataRuleService; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| @@ -31,8 +32,13 @@ public class WxUserDataRuleServiceImpl implements WxUserDataRuleService { | |||||
| record.setUpdateTime(date); | record.setUpdateTime(date); | ||||
| wxUserDataRuleMapper.insertSelective(record); | wxUserDataRuleMapper.insertSelective(record); | ||||
| } else { | } else { | ||||
| record.setUpdateTime(date); | |||||
| wxUserDataRuleMapper.updateByPrimaryKeySelective(record); | |||||
| if (EnumUserDataRuleType.ALL.getCode().equals(record.getType())) { | |||||
| wxUserDataRuleMapper.deleteByPrimaryKey(record.getId()); | |||||
| } else { | |||||
| record.setUpdateTime(date); | |||||
| wxUserDataRuleMapper.updateByPrimaryKeySelective(record); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| @@ -63,6 +63,7 @@ | |||||
| #{idItem} | #{idItem} | ||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | <if test=" null != sortColumns"> order by ${sortColumns} </if> | ||||
| <if test=" null == sortColumns"> order by report_date desc </if> | <if test=" null == sortColumns"> order by report_date desc </if> | ||||
| </sql> | </sql> | ||||
| @@ -142,7 +143,22 @@ | |||||
| and mtd.report_date >= date_format(#{startTime},'%Y-%m-%d') | and mtd.report_date >= date_format(#{startTime},'%Y-%m-%d') | ||||
| and mtd.report_date <= date_format(#{endTime},'%Y-%m-%d') | and mtd.report_date <= date_format(#{endTime},'%Y-%m-%d') | ||||
| </if> | </if> | ||||
| <if test="(null != floorForRule and '' != floorForRule) or (null != businessForRule and '' != businessForRule)"> | |||||
| and mtd.merchant_id in( | |||||
| select ms.merchant_id from (select merchant_id,shop_id from wx_merchant_shop where is_del=0) ms | |||||
| inner join wx_merchant m on ms.merchant_id = m.id | |||||
| inner join wx_shop s on s.id=ms.shop_id | |||||
| where m.tenant_id=#{tenantId} and s.is_del=0 | |||||
| <if test=" null != businessForRule "> | |||||
| and m.business_id in (${businessForRule}) | |||||
| </if> | |||||
| <if test=" null != floorForRule "> | |||||
| and s.`floor` in (${floorForRule}) | |||||
| </if> | |||||
| ) | |||||
| </if> | |||||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | <if test=" null != sortColumns"> order by ${sortColumns} </if> | ||||
| </select> | </select> | ||||
| @@ -143,6 +143,20 @@ | |||||
| <if test=" null != building and ''!= building">and b.id = #{building}</if> | <if test=" null != building and ''!= building">and b.id = #{building}</if> | ||||
| <if test=" null != floor and ''!= floor">and f.id = #{floor}</if> | <if test=" null != floor and ''!= floor">and f.id = #{floor}</if> | ||||
| <if test=" null != operationType ">and `operation_type` = #{operationType}</if> | <if test=" null != operationType ">and `operation_type` = #{operationType}</if> | ||||
| <if test="(null != floorForRule and '' != floorForRule) or (null != businessForRule and '' != businessForRule)"> | |||||
| and rc.merchant_id in( | |||||
| select ms.merchant_id from (select merchant_id,shop_id from wx_merchant_shop where is_del=0) ms | |||||
| inner join wx_merchant m on ms.merchant_id = m.id | |||||
| inner join wx_shop s on s.id=ms.shop_id | |||||
| where m.tenant_id=#{tenantId} and s.is_del=0 | |||||
| <if test=" null != businessForRule "> | |||||
| and m.business_id in (${businessForRule}) | |||||
| </if> | |||||
| <if test=" null != floorForRule "> | |||||
| and s.`floor` in (${floorForRule}) | |||||
| </if> | |||||
| ) | |||||
| </if> | |||||
| </where> | </where> | ||||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | <if test=" null != sortColumns"> order by ${sortColumns} </if> | ||||
| @@ -171,6 +171,20 @@ | |||||
| <if test=" null != building and ''!= building">and b.id = #{building}</if> | <if test=" null != building and ''!= building">and b.id = #{building}</if> | ||||
| <if test=" null != floor and ''!= floor">and f.id = #{floor}</if> | <if test=" null != floor and ''!= floor">and f.id = #{floor}</if> | ||||
| <if test=" null != operationType ">and `operation_type` = #{operationType}</if> | <if test=" null != operationType ">and `operation_type` = #{operationType}</if> | ||||
| <if test="(null != floorForRule and '' != floorForRule) or (null != businessForRule and '' != businessForRule)"> | |||||
| and rc.merchant_id in( | |||||
| select ms.merchant_id from (select merchant_id,shop_id from wx_merchant_shop where is_del=0) ms | |||||
| inner join wx_merchant m on ms.merchant_id = m.id | |||||
| inner join wx_shop s on s.id=ms.shop_id | |||||
| where m.tenant_id=#{tenantId} and s.is_del=0 | |||||
| <if test=" null != businessForRule "> | |||||
| and m.business_id in (${businessForRule}) | |||||
| </if> | |||||
| <if test=" null != floorForRule "> | |||||
| and s.`floor` in (${floorForRule}) | |||||
| </if> | |||||
| ) | |||||
| </if> | |||||
| </where> | </where> | ||||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | <if test=" null != sortColumns"> order by ${sortColumns} </if> | ||||
| <if test=" null == sortColumns"> order by rc.createtime desc,rc.id desc </if> | <if test=" null == sortColumns"> order by rc.createtime desc,rc.id desc </if> | ||||