Browse Source

Merge branches 'develop' and 'develop' of http://git.elinkit.com.cn:7070/r/epmet-cloud into develop

dev
jianjun 4 years ago
parent
commit
bda1d1a0de
  1. 7
      epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.10__add_icuserchangetype_dict.sql
  2. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeDetailedDTO.java
  3. 5
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeDetailedEntity.java
  4. 9
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  5. 16
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java
  6. 3
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.24__alter_change_detailed.sql

7
epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.10__add_icuserchangetype_dict.sql

@ -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');

5
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeDetailedDTO.java

@ -49,6 +49,11 @@ public class IcUserChangeDetailedDTO implements Serializable {
*/
private String icUserChangeRecordId;
/**
* 组织的所有上级Id
*/
private String pids;
/**
* 组织Id
*/

5
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeDetailedEntity.java

@ -46,6 +46,11 @@ public class IcUserChangeDetailedEntity extends BaseEpmetEntity {
*/
private String icUserChangeRecordId;
/**
* 组织的所有上级Id
*/
private String pids;
/**
* 组织Id
*/

9
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

@ -40,6 +40,7 @@ import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
@ -254,6 +255,10 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
if (!resultList.success()) {
throw new RuntimeException("人员新增,获取客户居民类别预警配置表数据失败");
}
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(map.get("AGENCY_ID"));
if (null == agencyInfo) {
throw new EpmetException(String.format("查询组织信息失败%s", map.get("AGENCY_ID")));
}
IcUserChangeDetailedEntity outEntity = null;
for (IcResiCategoryWarnConfigDTO cf : resultList.getData()) {
if (map.containsKey(cf.getColumnName()) && "1".equals(map.get(cf.getColumnName()))) {
@ -261,6 +266,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
outEntity = new IcUserChangeDetailedEntity();
outEntity.setCustomerId(tokenDto.getCustomerId());
outEntity.setIcUserChangeRecordId(icUserChangeRecordId);
outEntity.setPids(agencyInfo.getPids());
outEntity.setAgencyId(map.get("AGENCY_ID"));
outEntity.setGridId(map.get("GRID_ID"));
outEntity.setNeighborHoodId(map.get("VILLAGE_ID"));
@ -399,6 +405,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
//变更明细里边存修改后的新值,是就存1否就存-1
categoryEntity = new IcUserChangeDetailedEntity();
categoryEntity.setCustomerId(tokenDto.getCustomerId());
categoryEntity.setPids(entity.getPids());
categoryEntity.setAgencyId(entity.getAgencyId());
categoryEntity.setGridId(map.containsKey("GRID_ID") ? map.get("GRID_ID") : entity.getGridId());
categoryEntity.setNeighborHoodId(map.containsKey("VILLAGE_ID") ? map.get("VILLAGE_ID") : entity.getVillageId());
@ -1127,7 +1134,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
throw new EpmetException("查询房屋信息失败...");
}
List<HouseInfoDTO> houseInfos = houseInfosResult.getData();
userList.forEach(u -> houseInfos.stream().filter(h -> h.getHomeId().equals(u.getHomeId())).forEach(h -> u.setFamily(h.getNeighborHoodName()+h.getBuildingName()+h.getUnitName()+h.getHouseName())));
userList.forEach(u -> houseInfos.stream().filter(h -> h.getHomeId().equals(u.getHomeId())).forEach(h -> u.setFamily(h.getAllName())));
result.setList(userList);
return result;
}

16
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java

@ -19,8 +19,11 @@ package com.epmet.service.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IcResiUserDao;
import com.epmet.dao.IcUserTransferRecordDao;
@ -231,12 +234,24 @@ public class IcUserTransferRecordServiceImpl extends BaseServiceImpl<IcUserTrans
List<IcUserChangeDetailedEntity> list = new ArrayList<>();
IcUserChangeDetailedEntity outEntity = null;
IcUserChangeDetailedEntity inEntity = null;
AgencyInfoCache oldAgencyInfo = CustomerOrgRedis.getAgencyInfo(resiUserDTO.getAgencyId());
if (null == oldAgencyInfo) {
throw new EpmetException(String.format("查询组织信息失败%s", resiUserDTO.getAgencyId()));
}
AgencyInfoCache newAgencyInfo = new AgencyInfoCache();
if ("in".equals(formDTO.getType())) {
newAgencyInfo = CustomerOrgRedis.getAgencyInfo(formDTO.getNewAgencyId());
if (null == newAgencyInfo) {
throw new EpmetException(String.format("查询组织信息失败%s", formDTO.getNewAgencyId()));
}
}
for (IcResiCategoryWarnConfigDTO cf : configList) {
if ("1".equals(map.get(cf.getColumnName()))) {
//迁出
outEntity = new IcUserChangeDetailedEntity();
outEntity.setCustomerId(formDTO.getCustomerId());
outEntity.setIcUserChangeRecordId(icUserChangeRecordId);
outEntity.setPids(oldAgencyInfo.getPids());
outEntity.setAgencyId(resiUserDTO.getAgencyId());
outEntity.setGridId(resiUserDTO.getGridId());
outEntity.setNeighborHoodId(resiUserDTO.getVillageId());
@ -254,6 +269,7 @@ public class IcUserTransferRecordServiceImpl extends BaseServiceImpl<IcUserTrans
inEntity = new IcUserChangeDetailedEntity();
inEntity.setCustomerId(formDTO.getCustomerId());
inEntity.setIcUserChangeRecordId(icUserChangeRecordId);
inEntity.setPids(newAgencyInfo.getPids());
inEntity.setAgencyId(formDTO.getNewAgencyId());
inEntity.setGridId(formDTO.getNewGridId());
inEntity.setNeighborHoodId(formDTO.getNewNeighborHoodId());

3
epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.24__alter_change_detailed.sql

@ -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…
Cancel
Save