Browse Source
# Conflicts: # epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.javamaster
85 changed files with 2625 additions and 83 deletions
@ -0,0 +1,7 @@ |
|||||
|
INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1483355574648180737', 'ic_user_change_type', '人员变动类型', '操作类型名称【add:新增 category:类别 in:迁入 out:迁出】', 17, 0, 0, '1', '2022-01-18 16:28:23', '1', '2022-01-18 16:28:42'); |
||||
|
|
||||
|
|
||||
|
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1483355968996642817', 1483355574648180737, '迁出', 'out', '0', '操作类型名称【add:新增 category:类别 in:迁入 out:迁出】', 4, 0, 0, '1', '2022-01-18 16:29:57', '1', '2022-01-18 16:29:57'); |
||||
|
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1483355899824181249', 1483355574648180737, '迁入', 'in', '0', '操作类型名称【add:新增 category:类别 in:迁入 out:迁出】', 3, 0, 0, '1', '2022-01-18 16:29:41', '1', '2022-01-18 16:29:41'); |
||||
|
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1483355832321052673', 1483355574648180737, '类别', 'category', '0', '操作类型名称【add:新增 category:类别 in:迁入 out:迁出】', 2, 0, 0, '1', '2022-01-18 16:29:25', '1', '2022-01-18 16:29:25'); |
||||
|
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1483355752541196290', 1483355574648180737, '新增', 'add', '0', '操作类型名称【add:新增 category:类别 in:迁入 out:迁出】', 1, 0, 0, '1', '2022-01-18 16:29:05', '1', '2022-01-18 16:29:05'); |
@ -0,0 +1,72 @@ |
|||||
|
package com.epmet.commons.tools.enums; |
||||
|
|
||||
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
||||
|
|
||||
|
import java.util.Objects; |
||||
|
|
||||
|
/** |
||||
|
* @author Administrator |
||||
|
*/ |
||||
|
|
||||
|
public enum DateEnum { |
||||
|
/** |
||||
|
* 月份相关枚举 |
||||
|
*/ |
||||
|
JAN("01", "1月"), |
||||
|
FEB("02", "2月"), |
||||
|
MAR("03", "3月"), |
||||
|
APR("04", "4月"), |
||||
|
MAY("05", "5月"), |
||||
|
JUN("06", "6月"), |
||||
|
JUL("07", "7月"), |
||||
|
AUG("08", "8月"), |
||||
|
SEP("09", "9月"), |
||||
|
OCT("10", "10月"), |
||||
|
NOV("11", "11月"), |
||||
|
DEC("12", "12月"), |
||||
|
/** |
||||
|
* 季度相关枚举 |
||||
|
*/ |
||||
|
Q1("Q1", "第一季度"), |
||||
|
Q2("Q2", "第二季度"), |
||||
|
Q3("Q3", "第三季度"), |
||||
|
Q4("Q4", "第四季度"), |
||||
|
|
||||
|
|
||||
|
UN_KNOWN("0", "未知"); |
||||
|
|
||||
|
private String code; |
||||
|
private String name; |
||||
|
|
||||
|
|
||||
|
DateEnum(String code, String name) { |
||||
|
this.code = code; |
||||
|
this.name = name; |
||||
|
} |
||||
|
|
||||
|
public static String getName(String code) { |
||||
|
DateEnum[] dateEnums = values(); |
||||
|
for (DateEnum dateEnum : dateEnums) { |
||||
|
if (Objects.equals(dateEnum.getCode(), code)) { |
||||
|
return dateEnum.getName(); |
||||
|
} |
||||
|
} |
||||
|
return EpmetErrorCode.SERVER_ERROR.getMsg(); |
||||
|
} |
||||
|
|
||||
|
public String getCode() { |
||||
|
return code; |
||||
|
} |
||||
|
|
||||
|
public void setCode(String code) { |
||||
|
this.code = code; |
||||
|
} |
||||
|
|
||||
|
public String getName() { |
||||
|
return name; |
||||
|
} |
||||
|
|
||||
|
public void setName(String name) { |
||||
|
this.name = name; |
||||
|
} |
||||
|
} |
@ -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,18 @@ |
|||||
|
package com.epmet.dto.customize; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
|
||||
|
|
||||
|
@Data |
||||
|
public class IcResiCategoryConfigDTO implements Serializable { |
||||
|
private String configId; |
||||
|
/** |
||||
|
* 列名 |
||||
|
*/ |
||||
|
private String columnName; |
||||
|
|
||||
|
private String itemLabel; |
||||
|
} |
@ -0,0 +1,32 @@ |
|||||
|
package com.epmet.dto.extract.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import org.hibernate.validator.constraints.Length; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 数字社区-人员类别分析,按天计算,入参 |
||||
|
* 以下参数都可以为空 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcUserCategoryAnalysisDailyFormDTO implements Serializable { |
||||
|
public interface AddUserInternalGroup { |
||||
|
} |
||||
|
|
||||
|
private String customerId; |
||||
|
@Length(max = 8, message = "日期格式:yyyyMMdd", groups = AddUserInternalGroup.class) |
||||
|
private String dateId; |
||||
|
|
||||
|
/** |
||||
|
* 开始时间 |
||||
|
*/ |
||||
|
@Length(max = 8, message = "开始日期日期格式:yyyyMMdd", groups = AddUserInternalGroup.class) |
||||
|
private String startDate; |
||||
|
/** |
||||
|
* 结束时间 |
||||
|
*/ |
||||
|
@Length(max = 8, message = "截止日期格式:yyyyMMdd", groups = AddUserInternalGroup.class) |
||||
|
private String endDate; |
||||
|
|
||||
|
} |
@ -0,0 +1,12 @@ |
|||||
|
package com.epmet.dto.user.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
@Data |
||||
|
public class OrgIcUserTotalDTO implements Serializable { |
||||
|
private String orgId; |
||||
|
private Integer total; |
||||
|
private String columnName; |
||||
|
} |
@ -0,0 +1,76 @@ |
|||||
|
package com.epmet.controller; |
||||
|
|
||||
|
|
||||
|
import com.epmet.commons.tools.constant.NumConstant; |
||||
|
import com.epmet.commons.tools.utils.DateUtils; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.dto.extract.form.IcUserCategoryAnalysisDailyFormDTO; |
||||
|
import com.epmet.service.stats.DimCustomerService; |
||||
|
import com.epmet.service.stats.FactIcuserCategoryAnalysisDailyService; |
||||
|
import org.apache.commons.collections4.CollectionUtils; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
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.time.LocalDate; |
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description 数字社区相关统计任务可以放这,目前只有人员类别分析 |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2022/01/17 |
||||
|
* @Version 1.0 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("ic") |
||||
|
public class IcController { |
||||
|
|
||||
|
@Autowired |
||||
|
private FactIcuserCategoryAnalysisDailyService userCategoryAnalysisDailyService; |
||||
|
@Autowired |
||||
|
private DimCustomerService dimCustomerService; |
||||
|
|
||||
|
/** |
||||
|
* 数字社区-基础信息-人员类别分析-每个类别的人员总数、较上月迁入迁出人数 |
||||
|
* 说明:安调统计,截止到当前dateId的党员总数;+30:迁入党员+之前的居民在本月内变更为党员身份的;-10:在本月丢失党员身份的人+迁出的人 |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("/user/category-analysis-daily") |
||||
|
public Result statUserCategoryDaily(@RequestBody IcUserCategoryAnalysisDailyFormDTO formDTO) { |
||||
|
ValidatorUtils.validateEntity(formDTO, IcUserCategoryAnalysisDailyFormDTO.AddUserInternalGroup.class); |
||||
|
List<String> customerIds = new ArrayList<>(); |
||||
|
if (StringUtils.isNotBlank(formDTO.getCustomerId())) { |
||||
|
customerIds.add(formDTO.getCustomerId()); |
||||
|
} else { |
||||
|
//未指定客户,则查询dim_customer表
|
||||
|
customerIds = dimCustomerService.selectCustomerIdPage(NumConstant.ONE, NumConstant.ONE_THOUSAND); |
||||
|
} |
||||
|
if (CollectionUtils.isNotEmpty(customerIds)) { |
||||
|
customerIds.forEach(customerId -> { |
||||
|
if (StringUtils.isNotBlank(formDTO.getStartDate()) && StringUtils.isNotBlank(formDTO.getEndDate())) { |
||||
|
//[a,b]yyyyMMdd
|
||||
|
List<String> daysBetween = DateUtils.getDaysBetween(formDTO.getStartDate(), formDTO.getEndDate()); |
||||
|
daysBetween.forEach(dateId -> { |
||||
|
//计算网格维度的数据
|
||||
|
userCategoryAnalysisDailyService.statUserCategoryGridDaily(customerId, dateId); |
||||
|
}); |
||||
|
} else if (StringUtils.isNotBlank(formDTO.getDateId())) { |
||||
|
//计算网格维度的数据
|
||||
|
userCategoryAnalysisDailyService.statUserCategoryGridDaily(customerId, formDTO.getDateId()); |
||||
|
} else { |
||||
|
//计算网格维度的数据
|
||||
|
//当前时间的前一天yyyyMMdd
|
||||
|
String dateId = LocalDate.now().minusDays(NumConstant.ONE).toString().replace("-", ""); |
||||
|
userCategoryAnalysisDailyService.statUserCategoryGridDaily(customerId, dateId); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,14 @@ |
|||||
|
package com.epmet.dao.customize; |
||||
|
|
||||
|
|
||||
|
import com.epmet.dto.customize.IcResiCategoryConfigDTO; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Mapper |
||||
|
public interface IcResiCategoryStatsConfigDao { |
||||
|
|
||||
|
|
||||
|
List<IcResiCategoryConfigDTO> queryDataColumn(String customerId); |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.epmet.dao.stats; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.entity.stats.FactIcuserCategoryAnalysisDailyEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
/** |
||||
|
* 人员类别分析 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-01-17 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface FactIcuserCategoryAnalysisDailyDao extends BaseDao<FactIcuserCategoryAnalysisDailyEntity> { |
||||
|
|
||||
|
int limitDelete(@Param("customerId")String customerId, |
||||
|
@Param("dateId")String dateId, |
||||
|
@Param("orgType")String orgType); |
||||
|
} |
@ -0,0 +1,74 @@ |
|||||
|
package com.epmet.entity.stats; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
/** |
||||
|
* 人员类别分析 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-01-17 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("fact_icuser_category_analysis_daily") |
||||
|
public class FactIcuserCategoryAnalysisDailyEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 客户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,0 +1,22 @@ |
|||||
|
package com.epmet.service.customize; |
||||
|
|
||||
|
|
||||
|
import com.epmet.dto.customize.IcResiCategoryConfigDTO; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 居民类别配置表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-04 |
||||
|
*/ |
||||
|
public interface IcResiCategoryStatsConfigService { |
||||
|
|
||||
|
/** |
||||
|
* 返回用于数据分析的列名+居民类别配置表的id |
||||
|
* @param customerId |
||||
|
* @return |
||||
|
*/ |
||||
|
List<IcResiCategoryConfigDTO> queryDataColumn(String customerId); |
||||
|
} |
@ -0,0 +1,40 @@ |
|||||
|
package com.epmet.service.customize.impl; |
||||
|
|
||||
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
||||
|
import com.epmet.constant.DataSourceConstant; |
||||
|
import com.epmet.dao.customize.IcResiCategoryStatsConfigDao; |
||||
|
import com.epmet.dto.customize.IcResiCategoryConfigDTO; |
||||
|
import com.epmet.service.customize.IcResiCategoryStatsConfigService; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 居民类别配置表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-04 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@DataSource(DataSourceConstant.OPER_CUSTOMIZE) |
||||
|
@Service |
||||
|
public class IcResiCategoryStatsConfigServiceImpl implements IcResiCategoryStatsConfigService{ |
||||
|
|
||||
|
@Autowired |
||||
|
private IcResiCategoryStatsConfigDao baseDao; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 返回用于数据分析的列名+居民类别配置表的id |
||||
|
* |
||||
|
* @param customerId |
||||
|
* @return |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<IcResiCategoryConfigDTO> queryDataColumn(String customerId) { |
||||
|
return baseDao.queryDataColumn(customerId); |
||||
|
} |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.epmet.service.stats; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.BaseService; |
||||
|
import com.epmet.entity.stats.FactIcuserCategoryAnalysisDailyEntity; |
||||
|
|
||||
|
/** |
||||
|
* 人员类别分析 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-01-17 |
||||
|
*/ |
||||
|
public interface FactIcuserCategoryAnalysisDailyService extends BaseService<FactIcuserCategoryAnalysisDailyEntity> { |
||||
|
/** |
||||
|
* 数字社区-基础信息-人员类别分析-每个类别的人员总数、较上月迁入迁出人数 |
||||
|
* 网格 |
||||
|
* @param customerId |
||||
|
* @param dateId |
||||
|
*/ |
||||
|
void statUserCategoryGridDaily(String customerId, String dateId); |
||||
|
} |
@ -0,0 +1,198 @@ |
|||||
|
package com.epmet.service.stats.impl; |
||||
|
|
||||
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
||||
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.epmet.commons.tools.constant.NumConstant; |
||||
|
import com.epmet.commons.tools.enums.OrgTypeEnum; |
||||
|
import com.epmet.constant.DataSourceConstant; |
||||
|
import com.epmet.dao.stats.FactIcuserCategoryAnalysisDailyDao; |
||||
|
import com.epmet.dto.customize.IcResiCategoryConfigDTO; |
||||
|
import com.epmet.dto.user.result.OrgIcUserTotalDTO; |
||||
|
import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; |
||||
|
import com.epmet.entity.stats.FactIcuserCategoryAnalysisDailyEntity; |
||||
|
import com.epmet.service.customize.IcResiCategoryStatsConfigService; |
||||
|
import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService; |
||||
|
import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; |
||||
|
import com.epmet.service.stats.FactIcuserCategoryAnalysisDailyService; |
||||
|
import com.epmet.service.user.UserService; |
||||
|
import com.google.common.collect.Lists; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.apache.commons.collections4.CollectionUtils; |
||||
|
import org.apache.commons.collections4.MapUtils; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
/** |
||||
|
* 人员类别分析 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-01-17 |
||||
|
*/ |
||||
|
@Service |
||||
|
@Slf4j |
||||
|
@DataSource(DataSourceConstant.STATS) |
||||
|
public class FactIcuserCategoryAnalysisDailyServiceImpl extends BaseServiceImpl<FactIcuserCategoryAnalysisDailyDao, FactIcuserCategoryAnalysisDailyEntity> implements FactIcuserCategoryAnalysisDailyService { |
||||
|
|
||||
|
@Autowired |
||||
|
private IcResiCategoryStatsConfigService icResiCategoryStatsConfigService; |
||||
|
@Autowired |
||||
|
private ScreenCustomerAgencyService agencyService; |
||||
|
@Autowired |
||||
|
private ScreenCustomerGridService gridService; |
||||
|
@Autowired |
||||
|
private UserService userService; |
||||
|
|
||||
|
/** |
||||
|
* 数字社区-基础信息-人员类别分析-每个类别的人员总数、较上月迁入迁出人数 |
||||
|
* |
||||
|
* @param customerId |
||||
|
* @param dateId |
||||
|
*/ |
||||
|
@Override |
||||
|
public void statUserCategoryGridDaily(String customerId, String dateId) { |
||||
|
//查询出所有用语数据分析的类别column_name,没有则不计算
|
||||
|
List<IcResiCategoryConfigDTO> columnList = icResiCategoryStatsConfigService.queryDataColumn(customerId); |
||||
|
if (CollectionUtils.isEmpty(columnList)) { |
||||
|
return; |
||||
|
} |
||||
|
//所有网格查询出来
|
||||
|
List<ScreenCustomerGridEntity> gridDTOList = gridService.getByCustomerId(customerId); |
||||
|
if (CollectionUtils.isEmpty(gridDTOList)) { |
||||
|
return; |
||||
|
} |
||||
|
//网格维度、组织维度初始好数据
|
||||
|
List<FactIcuserCategoryAnalysisDailyEntity> initList = constructInitValue(customerId, dateId, gridDTOList, columnList); |
||||
|
if (CollectionUtils.isEmpty(initList)) { |
||||
|
return; |
||||
|
} |
||||
|
//当这3个数都为0的时候不插入数据库了
|
||||
|
List<FactIcuserCategoryAnalysisDailyEntity> insertList = initList.stream().filter(entity -> (null != entity.getTotal() && entity.getTotal() > 0) |
||||
|
|| (null != entity.getQcIncr() && entity.getQcIncr() > 0) |
||||
|
|| (null != entity.getQrIncr() && entity.getQrIncr() > 0)).collect(Collectors.toList()); |
||||
|
//删除旧数据
|
||||
|
clearOldDatas(customerId, dateId, OrgTypeEnum.GRID.getCode()); |
||||
|
// 批量插入数据
|
||||
|
Lists.partition(insertList, NumConstant.ONE_HUNDRED).forEach(list -> { |
||||
|
insertBatch(list); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除旧数据 |
||||
|
* |
||||
|
* @param customerId |
||||
|
* @param dateId |
||||
|
* @param orgType grid、agency |
||||
|
*/ |
||||
|
private void clearOldDatas(String customerId, String dateId, String orgType) { |
||||
|
int deleteNum; |
||||
|
do { |
||||
|
//每次删除1000条
|
||||
|
deleteNum = baseDao.limitDelete(customerId, dateId, orgType); |
||||
|
} while (deleteNum != NumConstant.ZERO); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param customerId |
||||
|
* @param dateId yyyyMMdd |
||||
|
* @param gridDTOList 当前客户下所有的网格 |
||||
|
* @param columnList 所有需要分析的类别对应的ic_resi_user的列名,目前只有18类 |
||||
|
* @return |
||||
|
*/ |
||||
|
private List<FactIcuserCategoryAnalysisDailyEntity> constructInitValue(String customerId, String dateId, List<ScreenCustomerGridEntity> gridDTOList, List<IcResiCategoryConfigDTO> columnList) { |
||||
|
List<FactIcuserCategoryAnalysisDailyEntity> list = new ArrayList<>(); |
||||
|
|
||||
|
//1、total
|
||||
|
// 查询明细ic_user_change_detailed变更明细表,各个网格的各个分类的总人数
|
||||
|
Map<String, List<OrgIcUserTotalDTO>> totalMapList = userService.calGridIcUserTotal(customerId, dateId); |
||||
|
|
||||
|
String monthId = dateId.substring(NumConstant.ZERO, NumConstant.SIX); |
||||
|
String startDate = monthId.concat("01"); |
||||
|
String endDate = dateId; |
||||
|
|
||||
|
//2、迁入+30:eg:dateId:20211226, [20211201,20211226],类别sum值=1的
|
||||
|
Map<String, List<OrgIcUserTotalDTO>> qrList = userService.calGridIcUserIncr(customerId, startDate, endDate, "qr"); |
||||
|
|
||||
|
//3、迁出 -10 :eg:dateId:20211226, [20211201,20211226],类别sum值 !=1的
|
||||
|
Map<String, List<OrgIcUserTotalDTO>> qcList = userService.calGridIcUserIncr(customerId, startDate, endDate, "qc"); |
||||
|
|
||||
|
for (IcResiCategoryConfigDTO config : columnList) { |
||||
|
gridDTOList.forEach(grid -> { |
||||
|
FactIcuserCategoryAnalysisDailyEntity gridData = new FactIcuserCategoryAnalysisDailyEntity(); |
||||
|
gridData.setCustomerId(customerId); |
||||
|
gridData.setConfigId(config.getConfigId()); |
||||
|
gridData.setColumnName(config.getColumnName()); |
||||
|
gridData.setDateId(dateId); |
||||
|
gridData.setOrgId(grid.getGridId()); |
||||
|
gridData.setOrgType(OrgTypeEnum.GRID.getCode()); |
||||
|
gridData.setPid(StringUtils.isNotBlank(grid.getParentAgencyId()) ? grid.getParentAgencyId() : NumConstant.ZERO_STR); |
||||
|
gridData.setPids(grid.getAllParentIds()); |
||||
|
|
||||
|
//截止到目前累计值
|
||||
|
boolean totalZeroFlag = true; |
||||
|
if (MapUtils.isNotEmpty(totalMapList) && totalMapList.containsKey(grid.getGridId())) { |
||||
|
//当前网格下,有的类别
|
||||
|
List<OrgIcUserTotalDTO> crrentGrid = totalMapList.get(grid.getGridId()); |
||||
|
if (CollectionUtils.isNotEmpty(crrentGrid)) { |
||||
|
//各个类别对应的数
|
||||
|
Map<String, Integer> categoryTotalMap = crrentGrid.stream().collect(Collectors.toMap(OrgIcUserTotalDTO::getColumnName, OrgIcUserTotalDTO::getTotal, (key1, key2) -> key2)); |
||||
|
if (MapUtils.isNotEmpty(categoryTotalMap) && categoryTotalMap.containsKey(config.getColumnName())) { |
||||
|
totalZeroFlag = false; |
||||
|
gridData.setTotal(categoryTotalMap.get(config.getColumnName())); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
if (totalZeroFlag) { |
||||
|
gridData.setTotal(NumConstant.ZERO); |
||||
|
} |
||||
|
|
||||
|
//较上月迁入
|
||||
|
boolean incrZeroFlag = true; |
||||
|
if (MapUtils.isNotEmpty(qrList) && qrList.containsKey(grid.getGridId())) { |
||||
|
//当前网格下,有的类别
|
||||
|
List<OrgIcUserTotalDTO> crrentGrid = qrList.get(grid.getGridId()); |
||||
|
if (CollectionUtils.isNotEmpty(crrentGrid)) { |
||||
|
//各个类别对应的数
|
||||
|
Map<String, Integer> categoryTotalMap = crrentGrid.stream().collect(Collectors.toMap(OrgIcUserTotalDTO::getColumnName, OrgIcUserTotalDTO::getTotal, (key1, key2) -> key2)); |
||||
|
if (MapUtils.isNotEmpty(categoryTotalMap) && categoryTotalMap.containsKey(config.getColumnName())) { |
||||
|
incrZeroFlag = false; |
||||
|
gridData.setQrIncr(categoryTotalMap.get(config.getColumnName())); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
if (incrZeroFlag) { |
||||
|
gridData.setQrIncr(NumConstant.ZERO); |
||||
|
} |
||||
|
|
||||
|
// 较上月迁出:
|
||||
|
boolean qcZeroFlag = true; |
||||
|
if (MapUtils.isNotEmpty(qcList) && qcList.containsKey(grid.getGridId())) { |
||||
|
//当前网格下,有的类别
|
||||
|
List<OrgIcUserTotalDTO> crrentGridQc = qcList.get(grid.getGridId()); |
||||
|
if (CollectionUtils.isNotEmpty(crrentGridQc)) { |
||||
|
//各个类别对应的数
|
||||
|
Map<String, Integer> categoryTotalMap = crrentGridQc.stream().collect(Collectors.toMap(OrgIcUserTotalDTO::getColumnName, OrgIcUserTotalDTO::getTotal, (key1, key2) -> key2)); |
||||
|
if (MapUtils.isNotEmpty(categoryTotalMap) && categoryTotalMap.containsKey(config.getColumnName())) { |
||||
|
qcZeroFlag = false; |
||||
|
gridData.setQcIncr(categoryTotalMap.get(config.getColumnName())); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
if (qcZeroFlag) { |
||||
|
gridData.setQcIncr(NumConstant.ZERO); |
||||
|
} |
||||
|
|
||||
|
list.add(gridData); |
||||
|
}); |
||||
|
} |
||||
|
return list; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
<?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.epmet.dao.customize.IcResiCategoryStatsConfigDao"> |
||||
|
|
||||
|
<select id="queryDataColumn" parameterType="java.lang.String" resultType="com.epmet.dto.customize.IcResiCategoryConfigDTO"> |
||||
|
SELECT |
||||
|
m.COLUMN_NAME as columnName, |
||||
|
c.id as configId, |
||||
|
m.LABEL as itemLabel |
||||
|
FROM |
||||
|
ic_form_item m |
||||
|
INNER JOIN ic_resi_category_stats_config c ON ( m.CUSTOMER_ID = c.CUSTOMER_ID AND m.COLUMN_NAME = c.COLUMN_NAME AND c.DEL_FLAG = '0' ) |
||||
|
WHERE |
||||
|
m.DEL_FLAG = '0' |
||||
|
AND m.DATA_ANALYSE = '1' |
||||
|
AND m.CUSTOMER_ID = #{customerId} |
||||
|
ORDER BY |
||||
|
m.SORT ASC |
||||
|
</select> |
||||
|
|
||||
|
|
||||
|
</mapper> |
@ -0,0 +1,13 @@ |
|||||
|
<?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.epmet.dao.stats.FactIcuserCategoryAnalysisDailyDao"> |
||||
|
|
||||
|
<delete id="limitDelete" parameterType="map"> |
||||
|
delete from fact_icuser_category_analysis_daily |
||||
|
where CUSTOMER_ID = #{customerId} |
||||
|
and date_id=#{dateId} |
||||
|
and org_type=#{orgType} |
||||
|
limit 1000 |
||||
|
</delete> |
||||
|
</mapper> |
@ -0,0 +1,115 @@ |
|||||
|
package com.epmet.dto; |
||||
|
|
||||
|
import com.epmet.commons.tools.validator.group.AddGroup; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 联建单位完成情况 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-01-17 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcPartyUnitCompletionDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 主键 |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 客户id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 组织ID |
||||
|
*/ |
||||
|
private String agencyId; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String pids; |
||||
|
|
||||
|
/** |
||||
|
* 单位ID |
||||
|
*/ |
||||
|
@NotNull(message = "单位ID不能为空",groups = AddGroup.class) |
||||
|
private String unitId; |
||||
|
|
||||
|
/** |
||||
|
* 类型 monthly月度,quarter季度 |
||||
|
*/ |
||||
|
@NotNull(message = "类型不能为空",groups = AddGroup.class) |
||||
|
private String type; |
||||
|
|
||||
|
/** |
||||
|
* 评分 百分制 |
||||
|
*/ |
||||
|
@NotNull(message = "评分不能为空",groups = AddGroup.class) |
||||
|
private String score; |
||||
|
|
||||
|
/** |
||||
|
* 完成情况1已完成,0未完成 |
||||
|
*/ |
||||
|
@NotNull(message = "完成情况不能为空",groups = AddGroup.class) |
||||
|
private String status; |
||||
|
|
||||
|
/** |
||||
|
* 年份 |
||||
|
*/ |
||||
|
@NotNull(message = "年份不能为空",groups = AddGroup.class) |
||||
|
private String year; |
||||
|
|
||||
|
/** |
||||
|
* 月或季度 |
||||
|
*/ |
||||
|
@NotNull(message = "月或季度",groups = AddGroup.class) |
||||
|
private String monthQuarter; |
||||
|
|
||||
|
private String monthQuarterName; |
||||
|
|
||||
|
/** |
||||
|
* 时间 |
||||
|
*/ |
||||
|
private String recordDate; |
||||
|
|
||||
|
/** |
||||
|
* 删除标识 0未删除、1已删除 |
||||
|
*/ |
||||
|
private String delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
} |
@ -0,0 +1,18 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2022/1/17 15:46 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class CompletionFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 4925867264241549310L; |
||||
|
private String unitId; |
||||
|
private Integer pageNo = 1; |
||||
|
private Integer pageSize = 10; |
||||
|
} |
@ -0,0 +1,40 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2022/1/18 9:34 |
||||
|
*/ |
||||
|
@NoArgsConstructor |
||||
|
@Data |
||||
|
public class PointRecordFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -5200348821951188343L; |
||||
|
/** |
||||
|
* 服务方类型:社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit |
||||
|
*/ |
||||
|
private String serviceType; |
||||
|
/** |
||||
|
* 服务方ID |
||||
|
*/ |
||||
|
private String serviceId; |
||||
|
/** |
||||
|
* 开始时间 |
||||
|
*/ |
||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
|
private Date startTime; |
||||
|
/** |
||||
|
* 结束时间 |
||||
|
*/ |
||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
|
private Date endTime; |
||||
|
private Integer pageNo = 1; |
||||
|
private Integer pageSize = 10; |
||||
|
private String customerId; |
||||
|
} |
@ -0,0 +1,44 @@ |
|||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonIgnore; |
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2022/1/18 9:30 |
||||
|
*/ |
||||
|
@NoArgsConstructor |
||||
|
@Data |
||||
|
public class PointRecordDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 8562346042241117055L; |
||||
|
/** |
||||
|
* 需求类型 |
||||
|
*/ |
||||
|
@JsonIgnore |
||||
|
private String categoryCode; |
||||
|
private String categoryName; |
||||
|
/** |
||||
|
* 需求人 |
||||
|
*/ |
||||
|
private String demandUserName; |
||||
|
/** |
||||
|
* 需求内容 |
||||
|
*/ |
||||
|
private String content; |
||||
|
/** |
||||
|
* 发放积分时间 |
||||
|
*/ |
||||
|
private String pointTime; |
||||
|
/** |
||||
|
* 评价 |
||||
|
*/ |
||||
|
private String score; |
||||
|
/** |
||||
|
* 积分 |
||||
|
*/ |
||||
|
private String point; |
||||
|
} |
@ -0,0 +1,21 @@ |
|||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2022/1/18 9:28 |
||||
|
*/ |
||||
|
@NoArgsConstructor |
||||
|
@Data |
||||
|
public class PointRecordResultDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -2359756064125925616L; |
||||
|
private Integer totalPoint; |
||||
|
private PageData<PointRecordDTO> page; |
||||
|
|
||||
|
} |
@ -0,0 +1,50 @@ |
|||||
|
package com.epmet.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.commons.tools.validator.group.AddGroup; |
||||
|
import com.epmet.commons.tools.validator.group.DefaultGroup; |
||||
|
import com.epmet.dto.IcPartyUnitCompletionDTO; |
||||
|
import com.epmet.dto.form.CompletionFormDTO; |
||||
|
import com.epmet.service.IcPartyUnitCompletionService; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 联建单位完成情况 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-01-17 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("icpartyunitcompletion") |
||||
|
public class IcPartyUnitCompletionController { |
||||
|
|
||||
|
@Autowired |
||||
|
private IcPartyUnitCompletionService icPartyUnitCompletionService; |
||||
|
|
||||
|
@PostMapping("list") |
||||
|
public Result<PageData<IcPartyUnitCompletionDTO>> page(@RequestBody CompletionFormDTO formDTO){ |
||||
|
PageData<IcPartyUnitCompletionDTO> page = icPartyUnitCompletionService.page(formDTO); |
||||
|
return new Result<PageData<IcPartyUnitCompletionDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@PostMapping("save") |
||||
|
public Result save(@RequestBody IcPartyUnitCompletionDTO dto){ |
||||
|
//效验数据
|
||||
|
if (StringUtils.isBlank(dto.getUnitId())) { |
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
} |
||||
|
icPartyUnitCompletionService.save(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PostMapping("delete") |
||||
|
public Result delete(@RequestBody IcPartyUnitCompletionDTO dto){ |
||||
|
icPartyUnitCompletionService.delete(dto.getId()); |
||||
|
return new Result(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,16 @@ |
|||||
|
package com.epmet.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.entity.IcPartyUnitCompletionEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
/** |
||||
|
* 联建单位完成情况 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-01-17 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface IcPartyUnitCompletionDao extends BaseDao<IcPartyUnitCompletionEntity> { |
||||
|
|
||||
|
} |
@ -0,0 +1,71 @@ |
|||||
|
package com.epmet.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
/** |
||||
|
* 联建单位完成情况 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-01-17 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("ic_party_unit_completion") |
||||
|
public class IcPartyUnitCompletionEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 客户id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 组织ID |
||||
|
*/ |
||||
|
private String agencyId; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String pids; |
||||
|
|
||||
|
/** |
||||
|
* 单位ID |
||||
|
*/ |
||||
|
private String unitId; |
||||
|
|
||||
|
/** |
||||
|
* 类型 monthly月度,quarter季度 |
||||
|
*/ |
||||
|
private String type; |
||||
|
|
||||
|
/** |
||||
|
* 评分 百分制 |
||||
|
*/ |
||||
|
private String score; |
||||
|
|
||||
|
/** |
||||
|
* 完成情况1已完成,0未完成 |
||||
|
*/ |
||||
|
private String status; |
||||
|
|
||||
|
/** |
||||
|
* 年份 |
||||
|
*/ |
||||
|
private String year; |
||||
|
|
||||
|
/** |
||||
|
* 月或季度 |
||||
|
*/ |
||||
|
private String monthQuarter; |
||||
|
|
||||
|
/** |
||||
|
* 时间 |
||||
|
*/ |
||||
|
private String recordDate; |
||||
|
|
||||
|
} |
@ -0,0 +1,46 @@ |
|||||
|
package com.epmet.service; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.BaseService; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.dto.IcPartyUnitCompletionDTO; |
||||
|
import com.epmet.dto.form.CompletionFormDTO; |
||||
|
import com.epmet.entity.IcPartyUnitCompletionEntity; |
||||
|
|
||||
|
/** |
||||
|
* 联建单位完成情况 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-01-17 |
||||
|
*/ |
||||
|
public interface IcPartyUnitCompletionService extends BaseService<IcPartyUnitCompletionEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param formDTO |
||||
|
* @return PageData<IcPartyUnitCompletionDTO> |
||||
|
* @author generator |
||||
|
* @date 2022-01-17 |
||||
|
*/ |
||||
|
PageData<IcPartyUnitCompletionDTO> page(CompletionFormDTO formDTO); |
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-01-17 |
||||
|
*/ |
||||
|
void save(IcPartyUnitCompletionDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 删除 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-01-17 |
||||
|
*/ |
||||
|
void delete(String id); |
||||
|
} |
@ -0,0 +1,86 @@ |
|||||
|
package com.epmet.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.epmet.commons.tools.constant.NumConstant; |
||||
|
import com.epmet.commons.tools.enums.DateEnum; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.ConvertUtils; |
||||
|
import com.epmet.dao.IcPartyUnitCompletionDao; |
||||
|
import com.epmet.dto.IcPartyUnitCompletionDTO; |
||||
|
import com.epmet.dto.IcPartyUnitDTO; |
||||
|
import com.epmet.dto.form.CompletionFormDTO; |
||||
|
import com.epmet.entity.IcPartyUnitCompletionEntity; |
||||
|
import com.epmet.service.IcPartyUnitCompletionService; |
||||
|
import com.epmet.service.IcPartyUnitService; |
||||
|
import com.github.pagehelper.PageHelper; |
||||
|
import com.github.pagehelper.PageInfo; |
||||
|
import org.apache.commons.collections4.CollectionUtils; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.util.Collections; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 联建单位完成情况 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-01-17 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class IcPartyUnitCompletionServiceImpl extends BaseServiceImpl<IcPartyUnitCompletionDao, IcPartyUnitCompletionEntity> implements IcPartyUnitCompletionService { |
||||
|
|
||||
|
@Resource |
||||
|
private IcPartyUnitService icPartyUnitService; |
||||
|
|
||||
|
@Override |
||||
|
public PageData<IcPartyUnitCompletionDTO> page(CompletionFormDTO formDTO) { |
||||
|
if (StringUtils.isBlank(formDTO.getUnitId())) { |
||||
|
return new PageData<>(Collections.emptyList(), NumConstant.ZERO); |
||||
|
} |
||||
|
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); |
||||
|
LambdaQueryWrapper<IcPartyUnitCompletionEntity> wrapper = new LambdaQueryWrapper<>(); |
||||
|
wrapper.eq(IcPartyUnitCompletionEntity::getUnitId, formDTO.getUnitId()); |
||||
|
wrapper.orderByDesc(IcPartyUnitCompletionEntity::getCreatedTime); |
||||
|
List<IcPartyUnitCompletionEntity> list = baseDao.selectList(wrapper); |
||||
|
PageInfo<IcPartyUnitCompletionEntity> pageInfo = new PageInfo<>(list); |
||||
|
List<IcPartyUnitCompletionDTO> dtoList = ConvertUtils.sourceToTarget(list, IcPartyUnitCompletionDTO.class); |
||||
|
|
||||
|
if(CollectionUtils.isNotEmpty(dtoList)) { |
||||
|
dtoList.forEach(item -> { |
||||
|
item.setMonthQuarterName(DateEnum.getName(item.getMonthQuarter())); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
return new PageData<>(dtoList, pageInfo.getTotal()); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void save(IcPartyUnitCompletionDTO dto) { |
||||
|
IcPartyUnitCompletionEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyUnitCompletionEntity.class); |
||||
|
if (StringUtils.isNotBlank(dto.getYear()) && StringUtils.isNotBlank(dto.getMonthQuarter())) { |
||||
|
entity.setRecordDate(dto.getYear().concat(dto.getMonthQuarter())); |
||||
|
} |
||||
|
if(StringUtils.isBlank(dto.getId())) { |
||||
|
IcPartyUnitDTO unity = icPartyUnitService.get(dto.getUnitId()); |
||||
|
entity.setCustomerId(unity.getCustomerId()); |
||||
|
entity.setAgencyId(unity.getAgencyId()); |
||||
|
entity.setPids(unity.getPids()); |
||||
|
insert(entity); |
||||
|
} else { |
||||
|
updateById(entity); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delete(String id) { |
||||
|
// 逻辑删除(@TableLogic 注解)
|
||||
|
baseDao.deleteById(id); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,22 @@ |
|||||
|
CREATE TABLE `ic_party_unit_completion` |
||||
|
( |
||||
|
`ID` varchar(64) NOT NULL COMMENT '主键', |
||||
|
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', |
||||
|
`AGENCY_ID` varchar(64) NOT NULL COMMENT '组织ID', |
||||
|
`PIDS` varchar(255) NOT NULL, |
||||
|
`UNIT_ID` varchar(64) NOT NULL COMMENT '单位ID', |
||||
|
`TYPE` varchar(10) NOT NULL COMMENT '类型 monthly月度,quarter季度', |
||||
|
`SCORE` varchar(5) NOT NULL COMMENT '评分 百分制', |
||||
|
`STATUS` varchar(1) NOT NULL COMMENT '完成情况1已完成,0未完成', |
||||
|
`YEAR` varchar(4) NOT NULL COMMENT '年份', |
||||
|
`MONTH_QUARTER` varchar(4) NOT NULL COMMENT '月或季度', |
||||
|
`RECORD_DATE` varchar(12) NOT NULL COMMENT '时间', |
||||
|
`DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', |
||||
|
`REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', |
||||
|
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', |
||||
|
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间', |
||||
|
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', |
||||
|
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', |
||||
|
PRIMARY KEY (`ID`) USING BTREE |
||||
|
) ENGINE = InnoDB |
||||
|
DEFAULT CHARSET = utf8mb4 COMMENT ='联建单位完成情况'; |
@ -0,0 +1,27 @@ |
|||||
|
<?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.epmet.dao.IcPartyUnitCompletionDao"> |
||||
|
|
||||
|
<resultMap type="com.epmet.entity.IcPartyUnitCompletionEntity" id="icPartyUnitCompletionMap"> |
||||
|
<result property="id" column="ID"/> |
||||
|
<result property="customerId" column="CUSTOMER_ID"/> |
||||
|
<result property="agencyId" column="AGENCY_ID"/> |
||||
|
<result property="pids" column="PIDS"/> |
||||
|
<result property="unitId" column="UNIT_ID"/> |
||||
|
<result property="type" column="TYPE"/> |
||||
|
<result property="score" column="SCORE"/> |
||||
|
<result property="status" column="STATUS"/> |
||||
|
<result property="year" column="YEAR"/> |
||||
|
<result property="monthQuarter" column="MONTH_QUARTER"/> |
||||
|
<result property="recordDate" column="RECORD_DATE"/> |
||||
|
<result property="delFlag" column="DEL_FLAG"/> |
||||
|
<result property="revision" column="REVISION"/> |
||||
|
<result property="createdBy" column="CREATED_BY"/> |
||||
|
<result property="createdTime" column="CREATED_TIME"/> |
||||
|
<result property="updatedBy" column="UPDATED_BY"/> |
||||
|
<result property="updatedTime" column="UPDATED_TIME"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
|
||||
|
</mapper> |
@ -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; |
||||
|
} |
@ -0,0 +1,96 @@ |
|||||
|
|
||||
|
ALTER TABLE `ic_resi_user` |
||||
|
ADD COLUMN `STATUS` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '用户状态【0:正常 1:转出】' AFTER `JTXX_REMAKES`; |
||||
|
|
||||
|
ALTER TABLE `ic_resi_user` |
||||
|
DROP INDEX `customer_idcard_unique`; |
||||
|
|
||||
|
CREATE TABLE `ic_user_transfer_record` ( |
||||
|
`ID` varchar(64) NOT NULL COMMENT '唯一标识', |
||||
|
`IC_USER_ID` varchar(64) NOT NULL COMMENT '被调动人Id【ic_resi_user表id】', |
||||
|
`OPERATOR_ID` varchar(64) NOT NULL COMMENT '调动(工作)人员Id【customer_staff表userId】', |
||||
|
`IC_USER_NAME` varchar(64) NOT NULL COMMENT '被调动人名称【ic_resi_user表name】', |
||||
|
`OPERATOR_NAME` varchar(64) NOT NULL COMMENT '调动(工作)人员名称【customer_staff表real_name】', |
||||
|
`OLD_CUSTOMER_ID` varchar(64) NOT NULL COMMENT '调动前客户Id', |
||||
|
`NEW_CUSTOMER_ID` varchar(64) DEFAULT NULL COMMENT '调动后客户Id', |
||||
|
`OLD_AGENCY_ID` varchar(64) DEFAULT NULL COMMENT '调动前组织Id', |
||||
|
`NEW_AGENCY_ID` varchar(64) DEFAULT NULL COMMENT '调动后组织Id', |
||||
|
`OLD_AGENCY_NAME` varchar(64) DEFAULT NULL COMMENT '调动前组织名称', |
||||
|
`NEW_AGENCY_NAME` varchar(255) DEFAULT NULL COMMENT '调动后组织名称', |
||||
|
`OLD_GRID_ID` varchar(64) DEFAULT NULL COMMENT '调动前网格Id', |
||||
|
`NEW_GRID_ID` varchar(64) DEFAULT NULL COMMENT '调动后网格Id', |
||||
|
`OLD_GRID_NAME` varchar(255) DEFAULT NULL COMMENT '调动前网格名称', |
||||
|
`NEW_GRID_NAME` varchar(255) DEFAULT NULL COMMENT '调动后网格名称', |
||||
|
`OLD_NEIGHBOR_HOOD_ID` varchar(64) DEFAULT NULL COMMENT '调动前小区Id', |
||||
|
`NEW_NEIGHBOR_HOOD_ID` varchar(64) DEFAULT NULL COMMENT '调动后小区Id', |
||||
|
`OLD_NEIGHBOR_HOOD_NAME` varchar(255) DEFAULT NULL COMMENT '调动前小区名称', |
||||
|
`NEW_NEIGHBOR_HOOD_NAME` varchar(255) DEFAULT NULL COMMENT '调动后小区名称', |
||||
|
`OLD_BUILDING_ID` varchar(64) DEFAULT NULL COMMENT '调动前楼栋Id', |
||||
|
`NEW_BUILDING_ID` varchar(64) DEFAULT NULL COMMENT '调动后楼栋Id', |
||||
|
`OLD_BUILDING_NAME` varchar(255) DEFAULT NULL COMMENT '调动前楼栋名称', |
||||
|
`NEW_BUILDING_NAME` varchar(255) DEFAULT NULL COMMENT '调动后楼栋名称', |
||||
|
`OLD_BUILDING_UNIT_ID` varchar(64) DEFAULT NULL COMMENT '调动前单元Id', |
||||
|
`NEW_BUILDING_UNIT_ID` varchar(64) DEFAULT NULL COMMENT '调动后单元Id', |
||||
|
`OLD_BUILDING_UNIT_NAME` varchar(255) DEFAULT NULL COMMENT '调动前单元名称', |
||||
|
`NEW_BUILDING_UNIT_NAME` varchar(255) DEFAULT NULL COMMENT '调动后单元名称', |
||||
|
`OLD_HOUSE_ID` varchar(64) DEFAULT NULL COMMENT '调动前房屋Id', |
||||
|
`NEW_HOUSE_ID` varchar(64) DEFAULT NULL COMMENT '调动后房屋Id', |
||||
|
`OLD_HOUSE_NAME` varchar(255) DEFAULT NULL COMMENT '调动前房屋名称', |
||||
|
`NEW_HOUSE_NAME` varchar(255) DEFAULT NULL COMMENT '调动后房屋名称', |
||||
|
`TRANSFER_TIME` datetime NOT NULL COMMENT '调动时间', |
||||
|
`REMARK` varchar(512) DEFAULT NULL COMMENT '备注说明', |
||||
|
`DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标识', |
||||
|
`REVISION` int(10) NOT NULL COMMENT '乐观锁', |
||||
|
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', |
||||
|
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间', |
||||
|
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', |
||||
|
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', |
||||
|
PRIMARY KEY (`ID`) USING BTREE |
||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='居民调动记录表'; |
||||
|
|
||||
|
CREATE TABLE `ic_user_change_record` ( |
||||
|
`ID` varchar(64) NOT NULL COMMENT '唯一标识', |
||||
|
`IC_USER_TRANSFER_RECORD_ID` varchar(64) DEFAULT NULL COMMENT '调动表Id【只有调动记录此列才有值】', |
||||
|
`CUSTOMER_ID` varchar(64) DEFAULT NULL COMMENT '当前所属客户Id[迁出客户的此列没值]', |
||||
|
`OPERATOR_ID` varchar(64) NOT NULL COMMENT '操作人Id【customer_staff表userId】', |
||||
|
`IC_USER_ID` varchar(64) NOT NULL COMMENT '被操作人Id【ic_resi_user表id】', |
||||
|
`OPERATOR_NAME` varchar(64) NOT NULL COMMENT '操作人名称【customer_staff表real_name】', |
||||
|
`IC_USER_NAME` varchar(64) NOT NULL COMMENT '被操作人名称【ic_resi_user表name】', |
||||
|
`TYPE` varchar(64) NOT NULL COMMENT '操作类型【add:新增 category:类别 transfer:调动】', |
||||
|
`TYPE_NAME` varchar(64) NOT NULL COMMENT '操作类型名称【add:新增 category:类别 transfer:调动】', |
||||
|
`BEFORE_CHANGE_NAME` varchar(512) DEFAULT NULL COMMENT '变更前文字描述', |
||||
|
`AFTER_CHANGE_NAME` varchar(512) DEFAULT NULL COMMENT '变更后文字描述', |
||||
|
`CHANGE_TIME` datetime NOT NULL COMMENT '调整时间', |
||||
|
`REMARK` varchar(512) DEFAULT NULL COMMENT '备注说明', |
||||
|
`DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标识', |
||||
|
`REVISION` int(10) NOT NULL COMMENT '乐观锁', |
||||
|
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', |
||||
|
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间', |
||||
|
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', |
||||
|
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', |
||||
|
PRIMARY KEY (`ID`) USING BTREE |
||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='居民变更记录表'; |
||||
|
|
||||
|
CREATE TABLE `ic_user_change_detailed` ( |
||||
|
`ID` varchar(64) NOT NULL COMMENT '唯一标识', |
||||
|
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', |
||||
|
`IC_USER_CHANGE_RECORD_ID` varchar(64) NOT NULL COMMENT '变更记录表主键【ic_user_change_record.id】', |
||||
|
`AGENCY_ID` varchar(64) NOT NULL COMMENT '组织Id', |
||||
|
`GRID_ID` varchar(64) NOT NULL COMMENT '网格Id', |
||||
|
`NEIGHBOR_HOOD_ID` varchar(64) NOT NULL COMMENT '小区Id', |
||||
|
`BUILDING_ID` varchar(64) NOT NULL COMMENT '楼栋Id', |
||||
|
`BUILDING_UNIT_ID` varchar(64) NOT NULL COMMENT '单元Id', |
||||
|
`HOUSE_ID` varchar(64) NOT NULL COMMENT '房屋Id', |
||||
|
`IC_USER_ID` varchar(64) NOT NULL COMMENT '变更人Id', |
||||
|
`TYPE` varchar(255) NOT NULL COMMENT '操作类型【add:新增 category:类别 in:迁入 out:迁出】', |
||||
|
`TYPE_NAME` varchar(255) NOT NULL COMMENT '操作类型名称【add:新增 category:类别 in:迁入 out:迁出】', |
||||
|
`FIELD_NAME` varchar(64) NOT NULL COMMENT '字段名【18类对应的ic_resi_user表字段名】', |
||||
|
`VALUE` int(3) NOT NULL COMMENT '当前类别的值', |
||||
|
`DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标识', |
||||
|
`REVISION` int(10) NOT NULL COMMENT '乐观锁', |
||||
|
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', |
||||
|
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间', |
||||
|
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', |
||||
|
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', |
||||
|
PRIMARY KEY (`ID`) USING BTREE |
||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='变更明细表\r\n[一条变更记录对应多条人员类别数据]'; |
@ -0,0 +1,3 @@ |
|||||
|
ALTER TABLE `ic_user_change_detailed` |
||||
|
ADD COLUMN `PIDS` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT ''组织的所有上级Id'' AFTER `IC_USER_CHANGE_RECORD_ID`; |
||||
|
|
Loading…
Reference in new issue