Sfoglia il codice sorgente

[会员][新增]:增加绑车牌结构接口

release_toaliyun_real
hupeng 7 anni fa
parent
commit
ffc6fcb7a1
9 ha cambiato i file con 103 aggiunte e 17 eliminazioni
  1. +47
    -7
      mallinkAdmin/src/main/java/com/iformall/controller/WxUserStructureController.java
  2. +2
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxCUserBasicInfoMapper.java
  3. +1
    -6
      mallinkService/src/main/java/com/iformall/mapper/WxCUserCarMapper.java
  4. +7
    -0
      mallinkService/src/main/java/com/iformall/service/WxCUserBasicInfoService.java
  5. +7
    -0
      mallinkService/src/main/java/com/iformall/service/WxCUserCarService.java
  6. +7
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java
  7. +5
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCUserCarServiceImpl.java
  8. +13
    -1
      mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml
  9. +14
    -1
      mallinkService/src/main/resources/mapper/WxCUserCarMapper.xml

+ 47
- 7
mallinkAdmin/src/main/java/com/iformall/controller/WxUserStructureController.java Vedi File

@@ -3,16 +3,11 @@ package com.iformall.controller;
import com.github.pagehelper.PageInfo;
import com.iformall.common.ResultData;
import com.iformall.domain.dto.WxCUserBasicInfoDto;
import com.iformall.domain.po.WxCUser;
import com.iformall.domain.po.WxLevelConfig;
import com.iformall.domain.po.WxUserChannel;
import com.iformall.domain.po.*;
import com.iformall.domain.vo.UserStructureVo;
import com.iformall.enums.EnumAgeInfo;
import com.iformall.enums.EnumCUserBaseInfoSex;
import com.iformall.service.WxCUserBasicInfoService;
import com.iformall.service.WxCUserService;
import com.iformall.service.WxLevelConfigService;
import com.iformall.service.WxUserChannelService;
import com.iformall.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
@@ -45,6 +40,9 @@ public class WxUserStructureController extends BaseController {
@Autowired
private WxLevelConfigService wxLevelConfigService;

@Autowired
private WxCUserCarService wxCUserCarService;

@Autowired
private WxUserChannelService wxUserChannelService;

@@ -132,6 +130,48 @@ public class WxUserStructureController extends BaseController {
return new ResultData(levelList);
}

@ApiOperation("查询会员绑车牌结构")
@GetMapping("/findUserCarStructure")
public ResultData findCarLevelStructure(Date startTime, Date endTime) {

WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto();
dto.setTenantId(getTenantId());
dto.setStartTime(startTime);
dto.setEndTime(endTime);
List<Long> idList = wxCUserBasicInfoService.findIdList(dto);

WxCUserCar wxCUserCar = new WxCUserCar();

wxCUserCar.setTenantId(getTenantId());
wxCUserCar.setIds(idList); //注:countUser接口通过ids传递user_id list.
long userCountWithCar = wxCUserCarService.countUser(wxCUserCar);
Map userWithCar = new HashMap();
userWithCar.put("title","已绑定车牌");
userWithCar.put("count",userCountWithCar);


long userCountWithoutCar = idList.size()-userCountWithCar;

Map userWithoutCar = new HashMap();
userWithoutCar.put("title","未绑定车牌");
userWithoutCar.put("count",userCountWithoutCar);

NumberFormat nf = NumberFormat.getPercentInstance();
nf.setMinimumFractionDigits(2);

if(userCountWithoutCar + userCountWithCar>0) {
userWithCar.put("percentage",nf.format(userCountWithCar/new Double(userCountWithoutCar + userCountWithCar).doubleValue()));
userWithoutCar.put("percentage",nf.format(userCountWithoutCar/new Double(userCountWithoutCar + userCountWithCar).doubleValue()));
} else {
userWithCar.put("percentage","--");
userWithoutCar.put("percentage","--");
}

List<Map> list = new ArrayList<>();
list.add(userWithCar);
list.add(userWithoutCar);
return new ResultData(list);
}


/********************************会员数据**************************************/


+ 2
- 0
mallinkService/src/main/java/com/iformall/mapper/WxCUserBasicInfoMapper.java Vedi File

@@ -23,4 +23,6 @@ public interface WxCUserBasicInfoMapper extends CommonMapper<WxCUserBasicInfo, S

long findCount(WxCUserBasicInfoDto dto);

List<Long> findIdList(WxCUserBasicInfoDto dto);

}

+ 1
- 6
mallinkService/src/main/java/com/iformall/mapper/WxCUserCarMapper.java Vedi File

@@ -8,10 +8,5 @@ public interface WxCUserCarMapper extends CommonMapper<WxCUserCar, Long> {

List<WxCUserCar> findList(WxCUserCar wxCUserCar);
Integer countList(WxCUserCar wxCUserCar);

Integer countUser(WxCUserCar wxCUserCar);
}

+ 7
- 0
mallinkService/src/main/java/com/iformall/service/WxCUserBasicInfoService.java Vedi File

@@ -98,6 +98,13 @@ public interface WxCUserBasicInfoService {
*/
long findCountByScore(WxCUserBasicInfoDto dto);

/**
* 查找id列表
*
* @param dto
* @return
*/
List<Long> findIdList(WxCUserBasicInfoDto dto);

void exportData(HttpServletRequest request, HttpServletResponse response, String tenantId);



+ 7
- 0
mallinkService/src/main/java/com/iformall/service/WxCUserCarService.java Vedi File

@@ -33,6 +33,13 @@ public interface WxCUserCarService {
*/
Integer countUserCar(WxCUserCar record);

/**
* 根据实体查询count
*
* @param record
* @return
*/
Integer countUser(WxCUserCar record);
/**
* 根据实体查询
*


+ 7
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java Vedi File

@@ -128,13 +128,11 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService {
wxCUserBasicInfoMapper.deleteByPrimaryKey(id);
}


@Override
public long findCountBySex(WxCUserBasicInfoDto dto) {
return wxCUserBasicInfoMapper.findCountBySex(dto);
}


@Override
public long findCountByAge(WxCUserBasicInfoDto dto) {
return wxCUserBasicInfoMapper.findCountByAge(dto);
@@ -145,6 +143,13 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService {
return wxCUserBasicInfoMapper.findCountByScore(dto);
}

@Override
public List<Long> findIdList(WxCUserBasicInfoDto dto)
{
return wxCUserBasicInfoMapper.findIdList(dto);
}


@Override
public void exportData(HttpServletRequest request, HttpServletResponse response, String tenantId) {
WxCUserBasicInfo basicInfoQ = new WxCUserBasicInfo();


+ 5
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxCUserCarServiceImpl.java Vedi File

@@ -35,6 +35,11 @@ public class WxCUserCarServiceImpl implements WxCUserCarService {
return wxCUserCarMapper.countList(record);
}

@Override
public Integer countUser(WxCUserCar record) {
return wxCUserCarMapper.countUser(record);
}

@Override
public WxCUserCar getOne(WxCUserCar record) {
List<WxCUserCar> userCarList = wxCUserCarMapper.findList(record);


+ 13
- 1
mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml Vedi File

@@ -193,5 +193,17 @@
and tenant_id =#{tenantId}
</if>
</select>

<select id="findIdList" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long">
select id from wx_c_user_basic_info where 1=1
<if test=" null != startTime ">
and create_date &gt;= #{startTime}
</if>
<if test=" null != endTime">
and create_date &lt; #{endTime}
</if>
<if test="null != tenantId">
and tenant_id =#{tenantId}
</if>
</select>
</mapper>

+ 14
- 1
mallinkService/src/main/resources/mapper/WxCUserCarMapper.xml Vedi File

@@ -76,5 +76,18 @@
select count(*) from wx_c_user_car
<include refid="dynamicWhereConditions" />
</select>

<select id="countUser" parameterType="com.iformall.domain.po.WxCUserCar" resultType="java.lang.Integer">
select count(DISTINCT c_user_id) from wx_c_user_car
where 1=1
<if test=" null != tenantId ">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != ids ">
and c_user_id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
#{idItem}
</foreach>
</if>
</select>
</mapper>

Caricamento…
Annulla
Salva