Browse Source
# Conflicts: # epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java # epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.javamaster
24 changed files with 653 additions and 13 deletions
@ -0,0 +1,110 @@ |
|||
package com.epmet.dataaggre.dto.epmetuser; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
/** |
|||
* 人员类别分析 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-01-17 |
|||
*/ |
|||
@Data |
|||
public class FactIcuserCategoryAnalysisDailyDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键(人员类别分析表) |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 预警配置ID |
|||
*/ |
|||
private String configId; |
|||
|
|||
/** |
|||
* 类别列名,对个数据太麻烦了,在这个表存一下 |
|||
*/ |
|||
private String columnName; |
|||
|
|||
/** |
|||
* 当前数据是截止到XXX的:yyyyMMdd |
|||
*/ |
|||
private String dateId; |
|||
|
|||
/** |
|||
* 网格id或者组织id |
|||
*/ |
|||
private String orgId; |
|||
|
|||
/** |
|||
* grid或者agency |
|||
*/ |
|||
private String orgType; |
|||
|
|||
/** |
|||
* orgid的上级 |
|||
*/ |
|||
private String pid; |
|||
|
|||
/** |
|||
* orgid的所有上级 |
|||
*/ |
|||
private String pids; |
|||
|
|||
/** |
|||
* 当前类别总人数 |
|||
*/ |
|||
private Integer total; |
|||
|
|||
/** |
|||
* 较上月迁出 |
|||
*/ |
|||
private Integer qcIncr; |
|||
|
|||
/** |
|||
* 较上月迁入 |
|||
*/ |
|||
private Integer qrIncr; |
|||
|
|||
/** |
|||
* 删除标识 0.未删除 1.已删除 |
|||
*/ |
|||
private Integer delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,37 @@ |
|||
package com.epmet.dataaggre.dto.epmetuser.form; |
|||
|
|||
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
|||
import lombok.Data; |
|||
import org.hibernate.validator.constraints.Length; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 人员类别分析 入参 |
|||
*/ |
|||
@Data |
|||
public class IcUserCategoryFormDTO implements Serializable { |
|||
private static final long serialVersionUID = 2834180692632036316L; |
|||
|
|||
public interface AddUserInternalGroup { |
|||
} |
|||
|
|||
public interface AddUserShowGroup extends CustomerClientShowGroup { |
|||
} |
|||
|
|||
@NotBlank(message = "请选择查看某个组织或网格", groups = AddUserShowGroup.class) |
|||
private String orgId; |
|||
|
|||
@NotBlank(message = "orgType不能为空", groups = AddUserInternalGroup.class) |
|||
private String orgType; |
|||
|
|||
@NotBlank(message = "dateId不能为空", groups = AddUserInternalGroup.class) |
|||
@Length(min = 8, max = 8, message = "dateId格式:yyyyMMdd", groups = AddUserInternalGroup.class) |
|||
private String dateId; |
|||
|
|||
|
|||
@NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) |
|||
private String customerId; |
|||
|
|||
} |
@ -0,0 +1,50 @@ |
|||
package com.epmet.dataaggre.dto.epmetuser.result; |
|||
|
|||
|
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 人员类别分析-返参DTO |
|||
*/ |
|||
@Data |
|||
public class IcUserCategoryResultDTO implements Serializable { |
|||
private static final long serialVersionUID = -2150403803220667018L; |
|||
|
|||
/** |
|||
* 居民类别配置主键 |
|||
*/ |
|||
// @JsonIgnore
|
|||
private String configId; |
|||
/** |
|||
* 当前类别对应的列名 |
|||
*/ |
|||
private String categoryKey; |
|||
/** |
|||
* 类别名称 |
|||
*/ |
|||
private String categoryName; |
|||
/** |
|||
* 类别图标 |
|||
*/ |
|||
private String dataIcon; |
|||
|
|||
|
|||
|
|||
/** |
|||
* 当前类别下总人数 |
|||
*/ |
|||
private Integer total=0; |
|||
|
|||
/** |
|||
* 桥上月迁入 |
|||
*/ |
|||
private Integer immigration=0; |
|||
|
|||
/** |
|||
* 较上月迁出 |
|||
*/ |
|||
private Integer emigration=0; |
|||
} |
@ -0,0 +1,42 @@ |
|||
package com.epmet.dataaggre.controller; |
|||
|
|||
|
|||
import com.epmet.commons.tools.annotation.LoginUser; |
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.dataaggre.dto.epmetuser.form.IcUserCategoryFormDTO; |
|||
import com.epmet.dataaggre.dto.epmetuser.result.IcUserCategoryResultDTO; |
|||
import com.epmet.dataaggre.service.epmetuser.EpmetUserService; |
|||
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; |
|||
|
|||
import java.util.List; |
|||
|
|||
@RestController |
|||
@RequestMapping("icuser") |
|||
public class IcUserController { |
|||
|
|||
@Autowired |
|||
private EpmetUserService epmetUserService; |
|||
|
|||
|
|||
/** |
|||
* 【人员类别分析】-各类别人数 |
|||
* |
|||
* @param tokenDto |
|||
* @param formDTO |
|||
* @return |
|||
*/ |
|||
@PostMapping("category-data") |
|||
public Result<List<IcUserCategoryResultDTO>> queryIcUserCategoryData(@LoginUser TokenDto tokenDto, @RequestBody IcUserCategoryFormDTO formDTO) { |
|||
formDTO.setCustomerId(tokenDto.getCustomerId()); |
|||
ValidatorUtils.validateEntity(formDTO, IcUserCategoryFormDTO.AddUserShowGroup.class, IcUserCategoryFormDTO.AddUserInternalGroup.class); |
|||
return new Result<List<IcUserCategoryResultDTO>>().ok(epmetUserService.queryIcUserCategoryData(formDTO)); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,34 @@ |
|||
package com.epmet.task; |
|||
|
|||
import com.alibaba.fastjson.JSON; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.dto.extract.form.IcUserCategoryAnalysisDailyFormDTO; |
|||
import com.epmet.feign.DataStatisticalOpenFeignClient; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
|
|||
@Slf4j |
|||
@Component("icUserCategoryAnalysisTask") |
|||
public class IcUserCategoryAnalysisTask implements ITask { |
|||
|
|||
@Autowired |
|||
private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; |
|||
|
|||
@Override |
|||
public void run(String params) { |
|||
log.info("icUserCategoryAnalysisTask定时任务正在执行,参数为:{}", params); |
|||
IcUserCategoryAnalysisDailyFormDTO formDTO = new IcUserCategoryAnalysisDailyFormDTO(); |
|||
if (StringUtils.isNotBlank(params)) { |
|||
formDTO = JSON.parseObject(params, IcUserCategoryAnalysisDailyFormDTO.class); |
|||
} |
|||
Result result = dataStatisticalOpenFeignClient.statUserCategoryDaily(formDTO); |
|||
if (result.success()) { |
|||
log.info("icUserCategoryAnalysisTask定时任务正在执行定时任务执行成功"); |
|||
} else { |
|||
log.warn("icUserCategoryAnalysisTask定时任务正在执行定时任务执行失败:" + result.getMsg()); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,42 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
|||
import lombok.Data; |
|||
import org.hibernate.validator.constraints.Length; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.NotNull; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 数字社区-人员类别分析 入参DTO |
|||
* 某个类别的迁入、迁出、新增、类别列表 |
|||
*/ |
|||
@Data |
|||
public class IcUsercategoryAnalysisFormDTO implements Serializable { |
|||
public interface AddUserInternalGroup {} |
|||
public interface AddUserShowGroup extends CustomerClientShowGroup {} |
|||
@NotBlank(message = "请选择查看某个人员类别",groups =AddUserShowGroup.class ) |
|||
private String categoryKey; |
|||
|
|||
@NotBlank(message = "dateId不能为空",groups =AddUserInternalGroup.class ) |
|||
@Length(min = 8, max = 8,message = "dateId格式:yyyyMMdd",groups =AddUserInternalGroup.class) |
|||
private String dateId; |
|||
|
|||
private String type; |
|||
|
|||
@NotNull(message = "页码pageNo不能为空",groups =AddUserInternalGroup.class ) |
|||
private Integer pageNo; |
|||
@NotNull(message = "页量pageSize不能为空",groups =AddUserInternalGroup.class ) |
|||
private Integer pageSize; |
|||
|
|||
@NotBlank(message = "请选择查看某个组织或网格",groups =AddUserShowGroup.class ) |
|||
private String orgId; |
|||
@NotBlank(message = "orgType不能为空",groups =AddUserInternalGroup.class ) |
|||
private String orgType; |
|||
|
|||
private String startDate; |
|||
private String endDate; |
|||
|
|||
} |
|||
|
@ -0,0 +1,33 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 人员类别分析 |
|||
* 列表返参 |
|||
*/ |
|||
@Data |
|||
public class IcUsercategoryAnalysisResultDTO implements Serializable { |
|||
private static final long serialVersionUID = 8071180665763717817L; |
|||
private String icUserId; |
|||
private String name; |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
|||
private Date changeTime; |
|||
private String typeName; |
|||
private String type; |
|||
private String gridName; |
|||
private String address; |
|||
|
|||
// @JsonIgnore
|
|||
private String buildingId; |
|||
// @JsonIgnore
|
|||
private String gridId; |
|||
// @JsonIgnore
|
|||
private Integer value; |
|||
// @JsonIgnore
|
|||
private String fieldName; |
|||
} |
Loading…
Reference in new issue