12 changed files with 500 additions and 1 deletions
@ -0,0 +1,27 @@ |
|||
package com.epmet.user.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 按日、按月查询注册用户数(参与用户数)增量折线图 入参 |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 12:57 |
|||
*/ |
|||
@Data |
|||
public class UserIncrTrendFormDTO implements Serializable { |
|||
/** |
|||
* reg:注册居民 parti:参与用户,如果值为null,默认为reg |
|||
*/ |
|||
@NotBlank(message = "regOrPartiFlag不能为空") |
|||
private String regOrPartiFlag; |
|||
|
|||
/** |
|||
* day:日维度 | month:月维度 | (周、季、年)… |
|||
*/ |
|||
@NotBlank(message = "type不能为空") |
|||
private String type; |
|||
} |
@ -0,0 +1,22 @@ |
|||
package com.epmet.user.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 各机关注册用户数入参DTO |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 12:47 |
|||
*/ |
|||
@Data |
|||
public class UserSubAgencyFormDTO implements Serializable { |
|||
private static final long serialVersionUID = -4558978951554887536L; |
|||
/** |
|||
* reg:注册居民 parti:参与用户,如果值为null,默认为reg |
|||
*/ |
|||
@NotBlank(message = "regOrPartiFlag不能为空") |
|||
private String regOrPartiFlag; |
|||
} |
@ -0,0 +1,22 @@ |
|||
package com.epmet.user.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 直属网格注册用户数 入参DTO |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 12:52 |
|||
*/ |
|||
@Data |
|||
public class UserSubGridFormDTO implements Serializable { |
|||
private static final long serialVersionUID = -1815903503939673149L; |
|||
/** |
|||
* reg:注册居民 parti:参与用户,如果值为null,默认为reg |
|||
*/ |
|||
@NotBlank(message = "regOrPartiFlag不能为空") |
|||
private String regOrPartiFlag; |
|||
} |
@ -0,0 +1,23 @@ |
|||
package com.epmet.user.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 用户汇总信息 入参DTO |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 12:31 |
|||
*/ |
|||
@Data |
|||
public class UserSummaryInfoFormDTO implements Serializable { |
|||
private static final long serialVersionUID = -1802471335671321322L; |
|||
|
|||
/** |
|||
* reg:注册居民 parti:参与用户,如果值为null,默认为reg |
|||
*/ |
|||
@NotBlank(message = "regOrPartiFlag不能为空") |
|||
private String regOrPartiFlag; |
|||
} |
@ -0,0 +1,30 @@ |
|||
package com.epmet.user.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 按日、按月查询注册用户数(参与用户数)增量折线图 返参 |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 13:17 |
|||
*/ |
|||
@Data |
|||
public class UserIncrTrendResultDTO implements Serializable { |
|||
/** |
|||
* 日期如果按日查询返回yyyy-MM-dd,如果按月返回yyyy-MM |
|||
*/ |
|||
private String date; |
|||
|
|||
/** |
|||
* 居民、党员、热心居民返回中文描述 |
|||
*/ |
|||
private String type; |
|||
|
|||
/** |
|||
* 增量值 |
|||
*/ |
|||
private Integer value; |
|||
|
|||
} |
@ -0,0 +1,34 @@ |
|||
package com.epmet.user.result; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 各机关注册用户数入参DTO |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 12:49 |
|||
*/ |
|||
@Data |
|||
public class UserSubAgencyResultDTO implements Serializable { |
|||
private static final long serialVersionUID = 3038896791082755087L; |
|||
/** |
|||
* 辽阳路街道 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 数值 |
|||
*/ |
|||
private Integer value; |
|||
|
|||
/** |
|||
* 类型:居民、党员、热心居民 |
|||
*/ |
|||
private String type; |
|||
|
|||
@JsonIgnore |
|||
private String agencyId; |
|||
} |
@ -0,0 +1,35 @@ |
|||
package com.epmet.user.result; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 直属网格注册用户数 返参DTO |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 12:54 |
|||
*/ |
|||
@Data |
|||
public class UserSubGridResultDTO implements Serializable { |
|||
private static final long serialVersionUID = -7432747804212305863L; |
|||
|
|||
/** |
|||
* 网格名称:eg:第一网格 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 数值 |
|||
*/ |
|||
private Integer value; |
|||
|
|||
/** |
|||
* 类型:居民、党员、热心居民 |
|||
*/ |
|||
private String type; |
|||
|
|||
@JsonIgnore |
|||
private String gridId; |
|||
} |
@ -0,0 +1,54 @@ |
|||
package com.epmet.user.result; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 用户汇总信息 返参DTO |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 12:34 |
|||
*/ |
|||
@Data |
|||
public class UserSummaryInfoResultDTO implements Serializable { |
|||
private static final long serialVersionUID = -4270726421611289755L; |
|||
/** |
|||
* 数据更新至yyyy.MM.dd |
|||
*/ |
|||
private String currentDate; |
|||
|
|||
/** |
|||
* 注册居民数 |
|||
*/ |
|||
private Integer regTotal; |
|||
|
|||
/** |
|||
* 参与用户数 |
|||
*/ |
|||
private Integer partiTotal; |
|||
|
|||
/** |
|||
* 党员数 |
|||
*/ |
|||
private Integer partymemberTotal; |
|||
|
|||
/** |
|||
* 党员占比 |
|||
*/ |
|||
private String partymemberProportion; |
|||
|
|||
/** |
|||
* 热心居民数 |
|||
*/ |
|||
private String warmHeartedTotal; |
|||
|
|||
/** |
|||
* 热心居民占比 |
|||
*/ |
|||
private String warmHeartedProportion; |
|||
|
|||
@JsonIgnore |
|||
private String id; |
|||
} |
@ -0,0 +1,88 @@ |
|||
package com.epmet.module.user.controller; |
|||
|
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.module.user.service.UserService; |
|||
import com.epmet.user.form.UserIncrTrendFormDTO; |
|||
import com.epmet.user.form.UserSubAgencyFormDTO; |
|||
import com.epmet.user.form.UserSubGridFormDTO; |
|||
import com.epmet.user.form.UserSummaryInfoFormDTO; |
|||
import com.epmet.user.result.UserIncrTrendResultDTO; |
|||
import com.epmet.user.result.UserSubAgencyResultDTO; |
|||
import com.epmet.user.result.UserSubGridResultDTO; |
|||
import com.epmet.user.result.UserSummaryInfoResultDTO; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
/** |
|||
* 组织能力用户相关接口入口 |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 13:22 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("user") |
|||
public class UserController { |
|||
@Autowired |
|||
private UserService userService; |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @return com.epmet.commons.tools.utils.Result<com.epmet.user.result.UserSummaryInfoResultDTO> |
|||
* @author yinzuomei |
|||
* @description 用户汇总信息查询 |
|||
* @Date 2020/6/22 13:27 |
|||
**/ |
|||
@PostMapping("summaryinfo") |
|||
public Result<UserSummaryInfoResultDTO> summaryInfo(@RequestBody UserSummaryInfoFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO); |
|||
UserSummaryInfoResultDTO userSummaryInfoResultDTO = userService.summaryInfo(formDTO); |
|||
return new Result<UserSummaryInfoResultDTO>().ok(userSummaryInfoResultDTO); |
|||
} |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @return com.epmet.commons.tools.utils.Result<com.epmet.user.result.UserSubAgencyResultDTO> |
|||
* @author yinzuomei |
|||
* @description 直属机关柱状图查询 |
|||
* @Date 2020/6/22 13:30 |
|||
**/ |
|||
@PostMapping("subagency") |
|||
public Result<UserSubAgencyResultDTO> subAgency(@RequestBody UserSubAgencyFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO); |
|||
UserSubAgencyResultDTO userSubAgencyResultDTO = userService.subAgency(formDTO); |
|||
return new Result<UserSubAgencyResultDTO>().ok(userSubAgencyResultDTO); |
|||
} |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @return com.epmet.commons.tools.utils.Result<com.epmet.user.result.UserSubGridResultDTO> |
|||
* @author yinzuomei |
|||
* @description 直属网格柱状图查询 |
|||
* @Date 2020/6/22 13:33 |
|||
**/ |
|||
@PostMapping("subgrid") |
|||
public Result<UserSubGridResultDTO> subGrid(@RequestBody UserSubGridFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO); |
|||
UserSubGridResultDTO userSubGridResultDTO = userService.subGrid(formDTO); |
|||
return new Result<UserSubGridResultDTO>().ok(userSubGridResultDTO); |
|||
} |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @return com.epmet.commons.tools.utils.Result<com.epmet.user.result.UserIncrTrendResultDTO> |
|||
* @author yinzuomei |
|||
* @description 按日、按月查询注册用户数(参与用户数)增量折线图 |
|||
* @Date 2020/6/22 13:36 |
|||
**/ |
|||
@PostMapping("incrtrend") |
|||
public Result<UserIncrTrendResultDTO> incrTrend(@RequestBody UserIncrTrendFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO); |
|||
UserIncrTrendResultDTO userIncrTrendResultDTO = userService.incrTrend(formDTO); |
|||
return new Result<UserIncrTrendResultDTO>().ok(userIncrTrendResultDTO); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,54 @@ |
|||
package com.epmet.module.user.service; |
|||
|
|||
import com.epmet.user.form.UserIncrTrendFormDTO; |
|||
import com.epmet.user.form.UserSubAgencyFormDTO; |
|||
import com.epmet.user.form.UserSubGridFormDTO; |
|||
import com.epmet.user.form.UserSummaryInfoFormDTO; |
|||
import com.epmet.user.result.UserIncrTrendResultDTO; |
|||
import com.epmet.user.result.UserSubAgencyResultDTO; |
|||
import com.epmet.user.result.UserSubGridResultDTO; |
|||
import com.epmet.user.result.UserSummaryInfoResultDTO; |
|||
|
|||
/** |
|||
* 组织能力用户相关接口 |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 13:23 |
|||
*/ |
|||
public interface UserService { |
|||
/** |
|||
* @param formDTO |
|||
* @return com.epmet.user.result.UserSummaryInfoResultDTO |
|||
* @author yinzuomei |
|||
* @description 用户汇总信息查询 |
|||
* @Date 2020/6/22 13:41 |
|||
**/ |
|||
UserSummaryInfoResultDTO summaryInfo(UserSummaryInfoFormDTO formDTO); |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @return com.epmet.user.result.UserSubAgencyResultDTO |
|||
* @author yinzuomei |
|||
* @description 直属机关柱状图查询 |
|||
* @Date 2020/6/22 13:42 |
|||
**/ |
|||
UserSubAgencyResultDTO subAgency(UserSubAgencyFormDTO formDTO); |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @return com.epmet.user.result.UserSubGridResultDTO |
|||
* @author yinzuomei |
|||
* @description 直属网格柱状图查询 |
|||
* @Date 2020/6/22 13:42 |
|||
**/ |
|||
UserSubGridResultDTO subGrid(UserSubGridFormDTO formDTO); |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @return com.epmet.user.result.UserIncrTrendResultDTO |
|||
* @author yinzuomei |
|||
* @description 按日、按月查询注册用户数(参与用户数)增量折线图 |
|||
* @Date 2020/6/22 13:42 |
|||
**/ |
|||
UserIncrTrendResultDTO incrTrend(UserIncrTrendFormDTO formDTO); |
|||
} |
@ -0,0 +1,110 @@ |
|||
package com.epmet.module.user.service.impl; |
|||
|
|||
import com.epmet.commons.tools.exception.RenException; |
|||
import com.epmet.commons.tools.security.user.LoginUserUtil; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.dto.form.LoginUserDetailsFormDTO; |
|||
import com.epmet.dto.result.LoginUserDetailsResultDTO; |
|||
import com.epmet.feign.EpmetUserOpenFeignClient; |
|||
import com.epmet.module.user.service.UserService; |
|||
import com.epmet.user.form.UserIncrTrendFormDTO; |
|||
import com.epmet.user.form.UserSubAgencyFormDTO; |
|||
import com.epmet.user.form.UserSubGridFormDTO; |
|||
import com.epmet.user.form.UserSummaryInfoFormDTO; |
|||
import com.epmet.user.result.UserIncrTrendResultDTO; |
|||
import com.epmet.user.result.UserSubAgencyResultDTO; |
|||
import com.epmet.user.result.UserSubGridResultDTO; |
|||
import com.epmet.user.result.UserSummaryInfoResultDTO; |
|||
import org.apache.commons.lang.StringUtils; |
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* 组织能力用户相关接口 |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 13:23 |
|||
*/ |
|||
@Service |
|||
public class UserServiceImpl implements UserService { |
|||
private static final Logger logger = LoggerFactory.getLogger(UserServiceImpl.class); |
|||
@Autowired |
|||
private LoginUserUtil loginUserUtil; |
|||
@Autowired |
|||
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
|||
|
|||
/** |
|||
* @return java.lang.String |
|||
* @param |
|||
* @author yinzuomei |
|||
* @description 查询当前用户直属机关单位id |
|||
* @Date 2020/6/22 14:19 |
|||
**/ |
|||
public String getMyAgency(){ |
|||
LoginUserDetailsFormDTO loginUserDetailsFormDTO=new LoginUserDetailsFormDTO(); |
|||
loginUserDetailsFormDTO.setApp(loginUserUtil.getLoginUserApp()); |
|||
loginUserDetailsFormDTO.setClient(loginUserUtil.getLoginUserClient()); |
|||
loginUserDetailsFormDTO.setUserId(loginUserUtil.getLoginUserId()); |
|||
Result<LoginUserDetailsResultDTO> result=epmetUserOpenFeignClient.getLoginUserDetails(loginUserDetailsFormDTO); |
|||
if(!result.success()){ |
|||
throw new RenException("查询用户所属组织信息失败"); |
|||
} |
|||
if(result.success()){ |
|||
if (null == result.getData() || StringUtils.isBlank(result.getData().getAgencyId())) { |
|||
throw new RenException("查询用户所属组织信息失败"); |
|||
} |
|||
} |
|||
return result.getData().getAgencyId(); |
|||
} |
|||
/** |
|||
* @param formDTO |
|||
* @return com.epmet.user.result.UserSummaryInfoResultDTO |
|||
* @author yinzuomei |
|||
* @description 用户汇总信息查询 |
|||
* @Date 2020/6/22 13:41 |
|||
**/ |
|||
@Override |
|||
public UserSummaryInfoResultDTO summaryInfo(UserSummaryInfoFormDTO formDTO) { |
|||
String myAgencyId=this.getMyAgency(); |
|||
//TODO
|
|||
return null; |
|||
} |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @return com.epmet.user.result.UserSubAgencyResultDTO |
|||
* @author yinzuomei |
|||
* @description 直属机关柱状图查询 |
|||
* @Date 2020/6/22 13:42 |
|||
**/ |
|||
@Override |
|||
public UserSubAgencyResultDTO subAgency(UserSubAgencyFormDTO formDTO) { |
|||
return null; |
|||
} |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @return com.epmet.user.result.UserSubGridResultDTO |
|||
* @author yinzuomei |
|||
* @description 直属网格柱状图查询 |
|||
* @Date 2020/6/22 13:42 |
|||
**/ |
|||
@Override |
|||
public UserSubGridResultDTO subGrid(UserSubGridFormDTO formDTO) { |
|||
return null; |
|||
} |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @return com.epmet.user.result.UserIncrTrendResultDTO |
|||
* @author yinzuomei |
|||
* @description 按日、按月查询注册用户数(参与用户数)增量折线图 |
|||
* @Date 2020/6/22 13:42 |
|||
**/ |
|||
@Override |
|||
public UserIncrTrendResultDTO incrTrend(UserIncrTrendFormDTO formDTO) { |
|||
return null; |
|||
} |
|||
} |
Loading…
Reference in new issue