| @@ -5,11 +5,10 @@ import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.WxBusiness; | |||
| import com.iformall.domain.po.WxSubBusiness; | |||
| import com.iformall.domain.vo.WxBusinessDataVo; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| import com.iformall.service.ExcelService; | |||
| import com.iformall.service.WxBusinessService; | |||
| import com.iformall.service.WxSubBusinessService; | |||
| import com.iformall.utils.DateUtils; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| @@ -33,8 +32,6 @@ public class WxBusinessController extends BaseController { | |||
| @Autowired | |||
| private WxBusinessService wxBusinessService; | |||
| @Autowired | |||
| private WxSubBusinessService wxSubBusinessService; | |||
| @Autowired | |||
| private ExcelService excelService; | |||
| @@ -49,10 +46,15 @@ public class WxBusinessController extends BaseController { | |||
| @ApiOperation("子业态表接口") | |||
| @GetMapping("listSub") | |||
| @SystemControllerLog(description = "子业态") | |||
| public ResultData listSub(@ModelAttribute WxSubBusiness wxSubBusiness) { | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "businessId", value = "页数", dataType = "int", paramType = "query", required = true)}) | |||
| public ResultData listSub(Integer businessId) { | |||
| logger.debug("[" + getIpAddr() + "] WxBusinessController::getList"); | |||
| final List<WxSubBusiness> busList = wxSubBusinessService.findList(wxSubBusiness); | |||
| WxBusiness bq = new WxBusiness(); | |||
| bq.setFinalTenantId(this.getTenantInfo().getFinalTenantId()); | |||
| bq.setIsDel(EnumYesOrNo.NO.getCode()); | |||
| bq.setParentId(businessId); | |||
| final List<WxBusiness> busList = wxBusinessService.findList(bq); | |||
| return new ResultData(busList); | |||
| } | |||
| @@ -27,6 +27,10 @@ public class WxBusiness extends TenantEntityWithoutFinalTenantId { | |||
| private Date updateDate; | |||
| @io.swagger.annotations.ApiModelProperty(value="是否内置EnumYesOrNo",name="isSystem") | |||
| private Integer isSystem; | |||
| @io.swagger.annotations.ApiModelProperty(value="父编码",name="parentId") | |||
| private Integer parentId; | |||
| @io.swagger.annotations.ApiModelProperty(value="是否删除EnumYesOrNo",name="isDel") | |||
| private Integer isDel; | |||
| @TableField(exist = false) | |||
| @@ -222,9 +222,9 @@ public class WxMerchant extends TenantEntity { | |||
| // return EnumBusiness.getEnumMessage(businessId); | |||
| // } | |||
| public String getSubBusinessName() { | |||
| return EnumSubBusiness.getEnumMessage(subBusinessId); | |||
| } | |||
| // public String getSubBusinessName() { | |||
| // return EnumSubBusiness.getEnumMessage(subBusinessId); | |||
| // } | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value="单价",name="price") | |||
| @@ -1,35 +0,0 @@ | |||
| package com.iformall.domain.po; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import java.util.Date; | |||
| @TableName(value = "wx_sub_business") | |||
| @Data | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxSubBusiness extends BaseEntity { | |||
| private static final long serialVersionUID = 1L; | |||
| protected Integer id; | |||
| @io.swagger.annotations.ApiModelProperty(value="子业态名",name="title") | |||
| private String title; | |||
| @io.swagger.annotations.ApiModelProperty(value="业态ID",name="businessId") | |||
| private Integer businessId; | |||
| @io.swagger.annotations.ApiModelProperty(value="业态名",name="businessTitle") | |||
| private String businessTitle; | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||
| private Date createDate; | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||
| private Date updateDate; | |||
| } | |||
| @@ -2,7 +2,6 @@ package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.TtGoodsCategory; | |||
| import com.iformall.domain.po.WxSubBusiness; | |||
| import java.util.List; | |||
| @@ -1,14 +0,0 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxSubBusiness; | |||
| import java.util.List; | |||
| public interface WxSubBusinessMapper extends CommonMapper<WxSubBusiness, String> { | |||
| List<WxSubBusiness> findList(WxSubBusiness wxSubBusiness); | |||
| List<WxSubBusiness> findListAll(); | |||
| } | |||
| @@ -1,44 +0,0 @@ | |||
| package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.WxSubBusiness; | |||
| import java.util.List; | |||
| public interface WxSubBusinessService { | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @param record | |||
| * @param pageIndex | |||
| * @param pageSize | |||
| * @return | |||
| */ | |||
| PageInfo<WxSubBusiness> listAsPage(WxSubBusiness record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 根据实体查询列表 | |||
| * | |||
| * @param record | |||
| * @return | |||
| */ | |||
| List<WxSubBusiness> findList(WxSubBusiness record); | |||
| /** | |||
| * 查询全部列表 | |||
| * | |||
| * @return | |||
| */ | |||
| List<WxSubBusiness> findListAll(); | |||
| /** | |||
| * 根据Id获得实体 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| WxSubBusiness getById(Integer id); | |||
| } | |||
| @@ -44,8 +44,6 @@ public class WxCUserTagsServiceHelper{ | |||
| @Autowired | |||
| WxCardSpendMapper wxCardSpendMapper; | |||
| @Autowired | |||
| WxSubBusinessMapper wxSubBusinessMapper; | |||
| @Autowired | |||
| WxCUserBasicChildMapper wxCUserBasicChildMapper; | |||
| @Autowired | |||
| WxCouponMapper wxCouponMapper; | |||
| @@ -1,47 +0,0 @@ | |||
| package com.iformall.service.impl; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxBusiness; | |||
| import com.iformall.domain.po.WxSubBusiness; | |||
| import com.iformall.mapper.WxBusinessMapper; | |||
| import com.iformall.mapper.WxSubBusinessMapper; | |||
| import com.iformall.service.WxBusinessService; | |||
| import com.iformall.service.WxSubBusinessService; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import java.util.List; | |||
| @Service | |||
| public class WxSubBusinessServiceImpl implements WxSubBusinessService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| WxSubBusinessMapper wxSubBusinessMapper; | |||
| @Override | |||
| public PageInfo<WxSubBusiness> listAsPage(WxSubBusiness record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxSubBusinessMapper.findList(record)); | |||
| } | |||
| @Override | |||
| public List<WxSubBusiness> findList(WxSubBusiness record) { | |||
| return wxSubBusinessMapper.findList(record); | |||
| } | |||
| @Override | |||
| public List<WxSubBusiness> findListAll() { | |||
| return wxSubBusinessMapper.findListAll(); | |||
| } | |||
| @Override | |||
| public WxSubBusiness getById(Integer id) { | |||
| return wxSubBusinessMapper.selectById(id); | |||
| } | |||
| } | |||
| @@ -9,10 +9,12 @@ | |||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | |||
| <result column="final_tenant_id" jdbcType="VARCHAR" property="finalTenantId" /> | |||
| <result column="is_system" jdbcType="INTEGER" property="isSystem" /> | |||
| <result column="parent_id" jdbcType="INTEGER" property="parentId" /> | |||
| <result column="is_del" jdbcType="INTEGER" property="isDel" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`title`,`type`,`create_date`,`update_date`,`final_tenant_id`,`is_system` | |||
| `id`,`title`,`type`,`create_date`,`update_date`,`final_tenant_id`,`is_system`,`parent_id`,`is_del` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -45,6 +47,14 @@ | |||
| <if test=" null != isSystem "> | |||
| and `is_system` = #{isSystem} | |||
| </if> | |||
| <if test=" null != parentId "> | |||
| and `parent_id` = #{parentId} | |||
| </if> | |||
| <if test=" null != isDel "> | |||
| and `is_del` = #{isDel} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| @@ -1,62 +0,0 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.WxSubBusinessMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxSubBusiness"> | |||
| <id column="id" jdbcType="INTEGER" property="id" /> | |||
| <result column="title" jdbcType="VARCHAR" property="title" /> | |||
| <result column="business_id" jdbcType="INTEGER" property="businessId" /> | |||
| <result column="business_title" jdbcType="VARCHAR" property="businessTitle" /> | |||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | |||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`title`,`business_id`,`business_title`,`create_date`,`update_date` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != title "> | |||
| and `title` like concat('%', #{title},'%') | |||
| </if> | |||
| <if test=" null != businessId "> | |||
| and `business_id` = #{businessId} | |||
| </if> | |||
| <if test=" null != businessTitle "> | |||
| and `business_title` like concat('%', #{businessTitle},'%') | |||
| </if> | |||
| <if test=" null != createDate "> | |||
| and `create_date` = #{createDate} | |||
| </if> | |||
| <if test=" null != updateDate "> | |||
| and `update_date` = #{updateDate} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxSubBusiness" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> from wx_sub_business | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| <select id="findListAll" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> from wx_sub_business | |||
| order by create_date asc | |||
| </select> | |||
| </mapper> | |||
| @@ -5,11 +5,9 @@ import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.WxBusiness; | |||
| import com.iformall.domain.po.WxSubBusiness; | |||
| import com.iformall.domain.vo.WxBusinessDataVo; | |||
| import com.iformall.service.ExcelService; | |||
| import com.iformall.service.WxBusinessService; | |||
| import com.iformall.service.WxSubBusinessService; | |||
| import com.iformall.utils.DateUtils; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| @@ -33,8 +31,6 @@ public class WxBusinessController extends BaseController { | |||
| @Autowired | |||
| private WxBusinessService wxBusinessService; | |||
| @Autowired | |||
| private WxSubBusinessService wxSubBusinessService; | |||
| @Autowired | |||
| private ExcelService excelService; | |||
| @@ -47,15 +43,6 @@ public class WxBusinessController extends BaseController { | |||
| return new ResultData(busList); | |||
| } | |||
| @ApiOperation("子业态表接口") | |||
| @GetMapping("listSub") | |||
| @SystemControllerLog(description = "子业态") | |||
| public ResultData listSub(@ModelAttribute WxSubBusiness wxSubBusiness) { | |||
| logger.debug("[" + getIpAddr() + "] WxBusinessController::getList"); | |||
| final List<WxSubBusiness> busList = wxSubBusinessService.findList(wxSubBusiness); | |||
| return new ResultData(busList); | |||
| } | |||
| @ApiOperation("业态分析接口") | |||
| @GetMapping("businessDataList") | |||
| @SystemControllerLog(description = "业态分析接口") | |||