diff --git a/doc/epmet-cloud.md b/doc/epmet-cloud.md index 28dfe7ff08..9017656602 100644 --- a/doc/epmet-cloud.md +++ b/doc/epmet-cloud.md @@ -13,4 +13,11 @@ PS:目前正在测试通过负载均衡器和本地环境变量实现动态修 ``` 如何安装本地jar到本地仓库: -mvn install:install-file -DgroupId=com.inspurcloud -DartifactId=oss -D version=1.1.8 -Dpackaging=jar -Dfile=inspur-cloud-oss-sdk-1.1.8.jar \ No newline at end of file +mvn install:install-file -DgroupId=com.inspurcloud -DartifactId=oss -D version=1.1.8 -Dpackaging=jar -Dfile=inspur-cloud-oss-sdk-1.1.8.jar + + +## 私有化部署 +##### 需要开放哪些域名 + +- epmet-cloud.elinkservice.cn 微信交互代理 +- dysmsapi.aliyuncs.com 阿里云短信 \ No newline at end of file diff --git a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/EpmetAdminOpenFeignClient.java b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/EpmetAdminOpenFeignClient.java index 59eb1e1e40..3999b45089 100644 --- a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/EpmetAdminOpenFeignClient.java +++ b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/EpmetAdminOpenFeignClient.java @@ -105,4 +105,13 @@ public interface EpmetAdminOpenFeignClient { @PostMapping("/sys/dict/data/dictDataList/{dictType}") Result> dictDataList(@PathVariable("dictType") String dictType); + + /** + * 字典下拉框 + * 根据dictType查询字典 + * @param dictType + * @return + */ + @PostMapping("/sys/dict/data/dictOption/{dictType}") + public Result> getDictOption(@PathVariable("dictType")String dictType); } diff --git a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/fallback/EpmetAdminOpenFeignClientFallback.java b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/fallback/EpmetAdminOpenFeignClientFallback.java index 98e7e7f0f0..0184d2a100 100644 --- a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/fallback/EpmetAdminOpenFeignClientFallback.java +++ b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/fallback/EpmetAdminOpenFeignClientFallback.java @@ -65,4 +65,16 @@ public class EpmetAdminOpenFeignClientFallback implements EpmetAdminOpenFeignCli public Result> dictDataList(String dictType) { return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "dictDataList", dictType); } + + /** + * 字典下拉框 + * 根据dictType查询字典 + * + * @param dictType + * @return + */ + @Override + public Result> getDictOption(String dictType) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "getDictOption", dictType); + } } diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java index ce18026bf8..1a51f32c0e 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java @@ -20,6 +20,7 @@ import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.SysDictDataDTO; import com.epmet.service.SysDictDataService; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -118,6 +119,18 @@ public class SysDictDataController { return new Result>().ok(sysDictDataService.getNationOption()); } + /** + * 字典下拉框接口 + * @param dictType + * @return + */ + @PostMapping("dictOption/{dictType}") + public Result> getDictOption(@PathVariable("dictType")String dictType) { + if(StringUtils.isBlank(dictType)){ + return new Result<>(); + } + return new Result>().ok(sysDictDataService.getDictOption(dictType)); + } /** * @Description 人员关系 * @Param diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/SysDictDataService.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/SysDictDataService.java index 6277ab6d2f..52de66b46d 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/SysDictDataService.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/SysDictDataService.java @@ -92,4 +92,6 @@ public interface SysDictDataService extends BaseService { List dictListTree(String dictType); List getDictDataList(String dictType); + + List getDictOption(String dictType); } diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/SysDictDataServiceImpl.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/SysDictDataServiceImpl.java index 9a9abeb5e5..211089537d 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/SysDictDataServiceImpl.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/SysDictDataServiceImpl.java @@ -23,17 +23,18 @@ import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.TreeUtils; import com.epmet.dao.SysDictDataDao; +import com.epmet.dao.SysDictTypeDao; import com.epmet.dto.SysDictDataDTO; import com.epmet.entity.SysDictDataEntity; +import com.epmet.entity.SysDictTypeEntity; import com.epmet.service.SysDictDataService; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; /** @@ -43,6 +44,9 @@ import java.util.stream.Collectors; */ @Service public class SysDictDataServiceImpl extends BaseServiceImpl implements SysDictDataService { + @Autowired + private SysDictTypeDao sysDictTypeDao; + @Autowired private RedisUtils redisUtils; @@ -270,6 +274,9 @@ public class SysDictDataServiceImpl extends BaseServiceImpl dictMap(String dictType) { List resultDTOList = baseDao.selectDictList(dictType); + if(CollectionUtils.isEmpty(resultDTOList)){ + return new HashMap<>(); + } return resultDTOList.stream().collect(Collectors.toMap(DictListResultDTO::getValue, DictListResultDTO::getLabel)); } @@ -284,4 +291,28 @@ public class SysDictDataServiceImpl extends BaseServiceImpl getDictOption(String dictType) { + LambdaQueryWrapper queryWrapper=new LambdaQueryWrapper<>(); + queryWrapper.eq(SysDictTypeEntity::getDictType,dictType); + SysDictTypeEntity sysDictTypeEntity=sysDictTypeDao.selectOne(queryWrapper); + if(null==sysDictTypeEntity){ + return new ArrayList<>(); + } + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(SysDictDataEntity::getDictTypeId,sysDictTypeEntity.getId() ); + wrapper.orderByAsc(SysDictDataEntity::getSort); + List list = baseDao.selectList(wrapper); + return list.stream().map(item -> { + OptionResultDTO dto = new OptionResultDTO(); + dto.setValue(item.getDictValue()); + dto.setLabel(item.getDictLabel()); + return dto; + }).collect(Collectors.toList()); + } } diff --git a/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.27__add_dict_for_langchao.sql b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.27__add_dict_for_langchao.sql new file mode 100644 index 0000000000..6e17ec0ce3 --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.27__add_dict_for_langchao.sql @@ -0,0 +1,103 @@ +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 ('1654829394234654722', 'yt_Householder_relationship_type', '与户主关系', '【烟台需求】居民信息-与户主关系(60)', 0, 0, 0, '1', '2023-05-06 20:44:07', '1', '2023-05-07 08:49:11'); +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 ('1655017423142338562', 'yt_household_category', '户别', '【烟台需求】居住信息', 0, 0, 0, '1', '2023-05-07 09:11:17', '1', '2023-05-07 09:11:17'); +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 ('1654803329994932225', 'yt_id_card_type', '证件类型', '【烟台需求】居民信息:证件类型;因烟台需求增加', 0, 0, 0, '1', '2023-05-06 19:00:33', '1', '2023-05-06 19:20:52'); +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 ('1655017027942432770', 'yt_is_now_live', '是否现居住', '【烟台需求】居住信息', 0, 0, 0, '1', '2023-05-07 09:09:43', '1', '2023-05-07 09:09:43'); +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 ('1654808342884466689', 'yt_key_point_user_type', '重点人群', '【烟台需求】:居民信息-重点人群', 0, 0, 0, '1', '2023-05-06 19:20:28', '1', '2023-05-06 19:21:01'); +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 ('1654813824277757953', 'yt_politics_status', '政治面貌', '【烟台需求】居民信息-政治面貌', 0, 0, 0, '1', '2023-05-06 19:42:15', '1', '2023-05-06 19:42:15'); +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 ('1654809078326312962', 'yt_population_type', '人口类型', '【烟台需求】居民信息-人口类型', 0, 0, 0, '1', '2023-05-06 19:23:24', '1', '2023-05-06 19:23:24'); + + +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 ('1654837838383628290', 1654829394234654722, '弟', 'di', '0', '', 47, 0, 0, '1', '2023-05-06 21:17:41', '1', '2023-05-06 21:17: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 ('1654837906998247426', 1654829394234654722, '弟媳', 'dixi', '0', '', 48, 0, 0, '1', '2023-05-06 21:17:57', '1', '2023-05-06 21:17: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 ('1654838406774734850', 1654829394234654722, '独生女', 'dushegnnv', '0', '', 15, 0, 0, '1', '2023-05-06 21:19:56', '1', '2023-05-06 21:19:56'); +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 ('1654831181419200514', 1654829394234654722, '长子', 'eldest_son', '0', '', 7, 0, 0, '1', '2023-05-06 20:51:14', '1', '2023-05-06 20:51:14'); +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 ('1654838530770944002', 1654829394234654722, '二女', 'ernv', '0', '', 15, 0, 0, '1', '2023-05-06 21:20:26', '1', '2023-05-06 21:20:26'); +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 ('1654832115159351297', 1654829394234654722, '五子', 'five_son', '0', '', 11, 0, 0, '1', '2023-05-06 20:54:56', '1', '2023-05-06 20:58:20'); +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 ('1654831817560899585', 1654829394234654722, '四子', 'fourth_son', '0', '', 10, 0, 0, '1', '2023-05-06 20:53:45', '1', '2023-05-06 20:58:10'); +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 ('1654835876648927233', 1654829394234654722, '父母', 'fumu', '0', '', 25, 0, 0, '1', '2023-05-06 21:09:53', '1', '2023-05-06 21:09:53'); +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 ('1654835969879916545', 1654829394234654722, '父亲', 'fuqin', '0', '', 26, 0, 0, '1', '2023-05-06 21:10:15', '1', '2023-05-06 21:10:15'); +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 ('1654836121109741570', 1654829394234654722, '公公', 'gonggong', '0', '', 28, 0, 0, '1', '2023-05-06 21:10:51', '1', '2023-05-06 21:10:51'); +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 ('1654829713467326465', 1654829394234654722, '户主', 'householder', '0', '', 0, 0, 0, '1', '2023-05-06 20:45:24', '1', '2023-05-06 20:46:46'); +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 ('1654830288644816898', 1654829394234654722, '夫', 'hubby', '0', '', 3, 0, 0, '1', '2023-05-06 20:47:41', '1', '2023-05-06 20:47: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 ('1654836063958155265', 1654829394234654722, '母亲', 'muqin', '0', '', 27, 0, 0, '1', '2023-05-06 21:10:38', '1', '2023-05-06 21:10:38'); +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 ('1654838316743999489', 1654829394234654722, '女', 'nv', '0', '', 15, 0, 0, '1', '2023-05-06 21:19:35', '1', '2023-05-06 21:19:35'); +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 ('1654834501059821570', 1654829394234654722, '女婿', 'nvxu', '0', '', 13, 0, 0, '1', '2023-05-06 21:04:25', '1', '2023-05-06 21:04: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 ('1654830916922195970', 1654829394234654722, '独生子', 'only_child', '0', '', 6, 0, 0, '1', '2023-05-06 20:50:11', '1', '2023-05-06 20:50:11'); +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 ('1654837022348230657', 1654829394234654722, '配偶的祖父母或外祖父母', 'peigoudezhufumu', '0', '', 39, 0, 0, '1', '2023-05-06 21:14:26', '1', '2023-05-06 21:14:26'); +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 ('1654837542756499457', 1654829394234654722, '配偶的曾祖父母', 'peioudezengzhufuwu', '0', '', 42, 0, 0, '1', '2023-05-06 21:16:30', '1', '2023-05-06 21:16:30'); +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 ('1654836180257816578', 1654829394234654722, '婆婆', 'popo', '0', '', 29, 0, 0, '1', '2023-05-06 21:11:05', '1', '2023-05-06 21:11:05'); +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 ('1654837996081070082', 1654829394234654722, '迁出或死亡', 'qianchuhuosiwagn', '0', '', 49, 0, 0, '1', '2023-05-06 21:18:18', '1', '2023-05-06 21:18:18'); +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 ('1654834610833145857', 1654829394234654722, '其他儿子', 'qitaerzi', '0', '', 14, 0, 0, '1', '2023-05-06 21:04:51', '1', '2023-05-06 21:05:24'); +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 ('1654836584563556354', 1654829394234654722, '其他父母关系', 'qitafumuguanxi', '0', '', 34, 0, 0, '1', '2023-05-06 21:12:42', '1', '2023-05-06 21:12: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 ('1654835786156818433', 1654829394234654722, '其他孙子或外孙子', 'qitasunzi', '0', '', 24, 0, 0, '1', '2023-05-06 21:09:31', '1', '2023-05-06 21:09:31'); +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 ('1654837613787037697', 1654829394234654722, '其他祖父母或外祖父母关系', 'qitazhufumu', '0', '', 43, 0, 0, '1', '2023-05-06 21:16:47', '1', '2023-05-06 21:16:47'); +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 ('1654838597863030785', 1654829394234654722, '三女', 'sannv', '0', '', 15, 0, 0, '1', '2023-05-06 21:20:42', '1', '2023-05-06 21:20: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 ('1654837786110017537', 1654829394234654722, '嫂', 'sao', '0', '', 46, 0, 0, '1', '2023-05-06 21:17:28', '1', '2023-05-06 21:17:28'); +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 ('1654831393202192386', 1654829394234654722, '次子', 'second_son', '0', '', 8, 0, 0, '1', '2023-05-06 20:52:04', '1', '2023-05-06 20:52:04'); +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 ('1654838660240719873', 1654829394234654722, '四女', 'sinv', '0', '', 15, 0, 0, '1', '2023-05-06 21:20:57', '1', '2023-05-06 21:20: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 ('1654830757131796482', 1654829394234654722, '子', 'son', '0', '', 5, 0, 0, '1', '2023-05-06 20:49:32', '1', '2023-05-06 20:49:32'); +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 ('1654829941117370370', 1654829394234654722, '配偶', 'spouse', '0', '', 1, 0, 0, '1', '2023-05-06 20:46:18', '1', '2023-05-06 20:46:58'); +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 ('1654835172760829953', 1654829394234654722, '孙女', 'sunnv', '0', '', 17, 0, 0, '1', '2023-05-06 21:07:05', '1', '2023-05-06 21:07:05'); +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 ('1654835574851977217', 1654829394234654722, '孙女婿或外孙女婿', 'sunnvxu', '0', '', 21, 0, 0, '1', '2023-05-06 21:08:41', '1', '2023-05-06 21:08: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 ('1654835098777501697', 1654829394234654722, '孙子', 'sunzi', '0', '', 16, 0, 0, '1', '2023-05-06 21:06:48', '1', '2023-05-06 21:06:48'); +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 ('1654834879696420865', 1654829394234654722, '孙子、孙女或外孙子、 外孙女', 'szsnhwszwsn', '0', '', 15, 0, 0, '1', '2023-05-06 21:05:55', '1', '2023-05-06 21:06:05'); +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 ('1654831637797224450', 1654829394234654722, '三子', 'third_son', '0', '', 9, 0, 0, '1', '2023-05-06 20:53:02', '1', '2023-05-06 20:57:59'); +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 ('1654835238154223617', 1654829394234654722, '外孙女', 'waisunnv', '0', '', 18, 0, 0, '1', '2023-05-06 21:07:21', '1', '2023-05-06 21:07:21'); +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 ('1654835506849726465', 1654829394234654722, '外媳妇或外孙媳妇', 'waisunxifu', '0', '', 20, 0, 0, '1', '2023-05-06 21:08:25', '1', '2023-05-06 21:08: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 ('1654835316738703362', 1654829394234654722, '外孙子', 'waisunzi', '0', '', 19, 0, 0, '1', '2023-05-06 21:07:40', '1', '2023-05-06 21:07:40'); +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 ('1654836879225995265', 1654829394234654722, '外祖父', 'waizhufu', '0', '', 37, 0, 0, '1', '2023-05-06 21:13:52', '1', '2023-05-06 21:13:52'); +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 ('1654836936633434114', 1654829394234654722, '外祖母', 'waizhumu', '0', '', 38, 0, 0, '1', '2023-05-06 21:14:06', '1', '2023-05-06 21:14:06'); +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 ('1654830377236905985', 1654829394234654722, '妻', 'wife', '0', '', 4, 0, 0, '1', '2023-05-06 20:48:02', '1', '2023-05-06 20:48:09'); +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 ('1654837736759836673', 1654829394234654722, '兄', 'xiong', '0', '', 45, 0, 0, '1', '2023-05-06 21:17:16', '1', '2023-05-06 21:17:16'); +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 ('1654837671941062658', 1654829394234654722, '兄弟姐妹', 'xiongdijiemei', '0', '', 44, 0, 0, '1', '2023-05-06 21:17:01', '1', '2023-05-06 21:17:01'); +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 ('1654836453831294978', 1654829394234654722, '养父或继父', 'yangfuhuojifu', '0', '', 32, 0, 0, '1', '2023-05-06 21:12:11', '1', '2023-05-06 21:12:11'); +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 ('1654836517219811330', 1654829394234654722, '养母或继母', 'yangmuhuojimu', '0', '', 33, 0, 0, '1', '2023-05-06 21:12:26', '1', '2023-05-06 21:12:26'); +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 ('1654836243453394945', 1654829394234654722, '岳父', 'yuefu', '0', '', 30, 0, 0, '1', '2023-05-06 21:11:20', '1', '2023-05-06 21:11:31'); +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 ('1654836362152198145', 1654829394234654722, '岳母', 'yuemu', '0', '', 31, 0, 0, '1', '2023-05-06 21:11:49', '1', '2023-05-06 21:11:49'); +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 ('1654834368284934145', 1654829394234654722, '养子或继子', 'yzhjz', '0', '', 12, 0, 0, '1', '2023-05-06 21:03:53', '1', '2023-05-06 21:04:02'); +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 ('1654835725985333249', 1654829394234654722, '曾孙女或曾外孙女', 'zengsunnv', '0', '', 23, 0, 0, '1', '2023-05-06 21:09:17', '1', '2023-05-06 21:09:17'); +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 ('1654835645924458497', 1654829394234654722, '曾孙子或曾外孙子', 'zengsunzi', '0', '', 22, 0, 0, '1', '2023-05-06 21:08:58', '1', '2023-05-06 21:08:58'); +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 ('1654837100391645185', 1654829394234654722, '曾祖父', 'zengzhufu', '0', '', 40, 0, 0, '1', '2023-05-06 21:14:45', '1', '2023-05-06 21:14:45'); +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 ('1654837458128027649', 1654829394234654722, '曾祖母', 'zengzhumu', '0', '', 41, 0, 0, '1', '2023-05-06 21:16:10', '1', '2023-05-06 21:16:10'); +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 ('1654838466149302273', 1654829394234654722, '长女', 'zhangnv', '0', '', 15, 0, 0, '1', '2023-05-06 21:20:10', '1', '2023-05-06 21:20:10'); +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 ('1654836710568837121', 1654829394234654722, '祖父', 'zhufu', '0', '', 35, 0, 0, '1', '2023-05-06 21:13:12', '1', '2023-05-06 21:13:12'); +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 ('1654836785378443265', 1654829394234654722, '祖母', 'zhumu', '0', '', 36, 0, 0, '1', '2023-05-06 21:13:30', '1', '2023-05-06 21:13:30'); +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 ('1654836652540641281', 1654829394234654722, '祖母或外祖母', 'zhumuhuowaizhumu', '0', '', 34, 0, 0, '1', '2023-05-06 21:12:58', '1', '2023-05-06 21:12:58'); +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 ('1655017525068120065', 1655017423142338562, '家庭户', 'jiatinghu', '0', '家庭户', 1, 0, 0, '1', '2023-05-07 09:11:41', '1', '2023-05-07 09:12:12'); +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 ('1655017594743898113', 1655017423142338562, '集体户', 'jitihu', '0', '集体户', 2, 0, 0, '1', '2023-05-07 09:11:58', '1', '2023-05-07 09:11:58'); +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 ('1655017720258445313', 1655017423142338562, '空挂户', 'kongguahu', '0', '空挂户', 3, 0, 0, '1', '2023-05-07 09:12:28', '1', '2023-05-07 09:12:28'); +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 ('1655017773593214977', 1655017423142338562, '团结户', 'tuanjiehu', '0', '团结户', 4, 0, 0, '1', '2023-05-07 09:12:41', '1', '2023-05-07 09:12: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 ('1654803510186426370', 1654803329994932225, '身份证号', '1', '0', '身份证号', 1, 0, 0, '1', '2023-05-06 19:01:16', '1', '2023-05-06 19:05:20'); +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 ('1654803553832353793', 1654803329994932225, '护照', '2', '0', '护照', 2, 0, 0, '1', '2023-05-06 19:01:27', '1', '2023-05-06 19:01:27'); +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 ('1654803595087527937', 1654803329994932225, '港澳通行证', '3', '0', '港澳通行证', 3, 0, 0, '1', '2023-05-06 19:01:36', '1', '2023-05-06 19:01:36'); +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 ('1654803649835778049', 1654803329994932225, '军人证', '4', '0', '军人证', 4, 0, 0, '1', '2023-05-06 19:01:50', '1', '2023-05-06 19:01:50'); +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 ('1654803737236684802', 1654803329994932225, '其他', '6', '0', '其他', 6, 0, 0, '1', '2023-05-06 19:02:10', '1', '2023-05-06 19:02:10'); +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 ('1654803693234241537', 1654803329994932225, '台胞证', '5', '0', '台胞证', 5, 0, 0, '1', '2023-05-06 19:02:00', '1', '2023-05-06 19:02:00'); +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 ('1655017197153239042', 1655017027942432770, '否', '0', '0', '否', 2, 0, 0, '1', '2023-05-07 09:10:23', '1', '2023-05-07 09:10:23'); +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 ('1655017153138212865', 1655017027942432770, '是', '1', '0', '是', 1, 0, 0, '1', '2023-05-07 09:10:13', '1', '2023-05-07 09:10:13'); +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 ('1654808917751578626', 1654808342884466689, '监管对象', 'jianguanduixiang', '0', '监管对象', 4, 0, 0, '1', '2023-05-06 19:22:46', '1', '2023-05-06 19:22:46'); +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 ('1654808584195358722', 1654808342884466689, '否', 'no', '0', '', 1, 0, 0, '1', '2023-05-06 19:21:26', '1', '2023-05-06 20:15:33'); +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 ('1654808858024689665', 1654808342884466689, '视线对象', 'shixianduixiang', '0', '', 3, 0, 0, '1', '2023-05-06 19:22:31', '1', '2023-05-06 19:22:31'); +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 ('1654808655167176705', 1654808342884466689, '重点人员', 'zhongdianrenyuan', '0', '', 2, 0, 0, '1', '2023-05-06 19:21:43', '1', '2023-05-06 19:21:43'); +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 ('1654815948533350402', 1654813824277757953, '九三学社社员', 'jsxssy', '0', '九三学社社员', 11, 0, 0, '1', '2023-05-06 19:50:42', '1', '2023-05-06 19:50: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 ('1654814620180496385', 1654813824277757953, '群众', 'qunzhong', '0', '群众', 1, 0, 0, '1', '2023-05-06 19:45:25', '1', '2023-05-06 19:45: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 ('1654816041563013121', 1654813824277757953, '台湾民主自治同盟盟员', 'twmzzztmmy', '0', '台湾民主自治同盟盟员', 12, 0, 0, '1', '2023-05-06 19:51:04', '1', '2023-05-06 19:51:04'); +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 ('1654816151323754497', 1654813824277757953, '无党派民主人士', 'wdpmzrs', '0', '无党派民主人士', 13, 0, 0, '1', '2023-05-06 19:51:30', '1', '2023-05-06 19:51:30'); +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 ('1654814740867399682', 1654813824277757953, '中国共产党党员', 'zggcddy', '0', '中国共产党党员', 2, 0, 0, '1', '2023-05-06 19:45:54', '1', '2023-05-06 19:45:54'); +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 ('1654814827379113986', 1654813824277757953, '中国共产党预备党员', 'zggcdybdy', '0', '中国共产党预备党员', 3, 0, 0, '1', '2023-05-06 19:46:14', '1', '2023-05-06 19:46:14'); +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 ('1654814930802262018', 1654813824277757953, '中国共产主义青年团团员', 'zggczyqntty', '0', '中国共产主义青年团团员', 4, 0, 0, '1', '2023-05-06 19:46:39', '1', '2023-05-06 19:46:39'); +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 ('1654815140559405057', 1654813824277757953, '中国国民党革命委员会会员', 'zggmdgmwyhhy', '0', '中国国民党革命委员会会员', 5, 0, 0, '1', '2023-05-06 19:47:29', '1', '2023-05-06 19:47:29'); +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 ('1654815461771788290', 1654813824277757953, '中国民主促进会会员', 'zgmzcjhhy', '0', '中国民主促进会会员', 8, 0, 0, '1', '2023-05-06 19:48:46', '1', '2023-05-06 19:48:46'); +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 ('1654815380884635650', 1654813824277757953, '中国民主建国会会员', 'zgmzghhy', '0', '中国民主建国会会员', 7, 0, 0, '1', '2023-05-06 19:48:26', '1', '2023-05-06 19:48:26'); +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 ('1654815285199978497', 1654813824277757953, '中国民主同盟盟员', 'zgmztmmy', '0', '中国民主同盟盟员', 6, 0, 0, '1', '2023-05-06 19:48:04', '1', '2023-05-06 19:48:04'); +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 ('1654815553366999041', 1654813824277757953, '中国农工民主党党员', 'zgngmzddy', '0', '中国农工民主党党员', 9, 0, 0, '1', '2023-05-06 19:49:08', '1', '2023-05-06 19:49:08'); +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 ('1654815880791146497', 1654813824277757953, '中国致公党党员', 'zgzgddy', '0', '中国致公党党员', 10, 0, 0, '1', '2023-05-06 19:50:26', '1', '2023-05-06 19:50:26'); +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 ('1654813111699062786', 1654809078326312962, '常住人口', 'changzhurenkou', '0', '常住人口', 2, 0, 0, '1', '2023-05-06 19:39:25', '1', '2023-05-06 19:39: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 ('1654813223993163777', 1654809078326312962, '户籍常住人口', 'hujichangzhurenkou', '0', '户籍常住人口', 3, 0, 0, '1', '2023-05-06 19:39:52', '1', '2023-05-06 19:39:52'); +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 ('1654812924658270210', 1654809078326312962, '户籍人口', 'hujirenkou', '0', '户籍人口', 1, 0, 0, '1', '2023-05-06 19:38:41', '1', '2023-05-06 19:38: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 ('1654813508635410433', 1654809078326312962, '境外人口', 'jingwairenkou', '0', '境外人口', 7, 0, 0, '1', '2023-05-06 19:41:00', '1', '2023-05-06 19:41:00'); +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 ('1654813451265720321', 1654809078326312962, '空挂人口', 'kongguarenkou', '0', '空挂人口', 6, 0, 0, '1', '2023-05-06 19:40:46', '1', '2023-05-06 19:40:46'); +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 ('1654813283262873601', 1654809078326312962, '流动人口', 'liudongrenkou', '0', '流动人口', 4, 0, 0, '1', '2023-05-06 19:40:06', '1', '2023-05-06 19:40:06'); +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 ('1654813676109774849', 1654809078326312962, '其他', 'other', '0', '其他', 9, 0, 0, '1', '2023-05-06 19:41:40', '1', '2023-05-06 19:41:40'); +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 ('1654813338686406658', 1654809078326312962, '外出人口', 'waichurenkou', '0', '外出人口', 5, 0, 0, '1', '2023-05-06 19:40:20', '1', '2023-05-06 19:40:20'); +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 ('1654813576394391553', 1654809078326312962, '未落户人口', 'weiluohurenkou', '0', '未落户人口', 8, 0, 0, '1', '2023-05-06 19:41:16', '1', '2023-05-06 19:41:16'); diff --git a/epmet-admin/epmet-admin-server/src/main/resources/logback-spring.xml b/epmet-admin/epmet-admin-server/src/main/resources/logback-spring.xml index 3d27fa4d07..2b7d942e79 100644 --- a/epmet-admin/epmet-admin-server/src/main/resources/logback-spring.xml +++ b/epmet-admin/epmet-admin-server/src/main/resources/logback-spring.xml @@ -3,7 +3,8 @@ - + + diff --git a/epmet-auth/src/main/resources/logback-spring.xml b/epmet-auth/src/main/resources/logback-spring.xml index 3ddc774384..10e7129112 100644 --- a/epmet-auth/src/main/resources/logback-spring.xml +++ b/epmet-auth/src/main/resources/logback-spring.xml @@ -3,7 +3,8 @@ - + + diff --git a/epmet-cloud-generator/src/main/resources/application.yml b/epmet-cloud-generator/src/main/resources/application.yml index 86b39b69c8..186ba27276 100644 --- a/epmet-cloud-generator/src/main/resources/application.yml +++ b/epmet-cloud-generator/src/main/resources/application.yml @@ -9,7 +9,7 @@ spring: type: com.alibaba.druid.pool.DruidDataSource #MySQL配置 driverClassName: com.mysql.jdbc.Driver - url: jdbc:mysql://118.190.150.119:43306/epmet_gov_org?useUnicode=true&characterEncoding=UTF-8&useSSL=false + url: jdbc:mysql://192.168.1.140:3306/epmet_gov_org?useUnicode=true&characterEncoding=UTF-8&useSSL=false username: root password: root #oracle配置 diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/CustomerStaffInfoCacheResult.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/CustomerStaffInfoCacheResult.java index 81c74a4c38..6e9944c316 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/CustomerStaffInfoCacheResult.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/CustomerStaffInfoCacheResult.java @@ -22,6 +22,15 @@ public class CustomerStaffInfoCacheResult implements Serializable { */ private String agencyId; + /** + * agencyId的上级 + */ + private String pid; + /** + * 工作人员所属组织的org_id_path + */ + private String orgIdPath; + /** * 工作人员所属组织ID的pids */ diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java index a07838684d..fe487d3631 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java @@ -34,6 +34,10 @@ public enum DictTypeEnum { TRAFFIC_TYPE("traffic_type", "交通方式", 36), SOJOURN_HISTORY("sojourn_history", "7天内旅居史情况", 37), TRIP_DATA_TYPE("trip_data_type", "行程记录类型", 39), + YT_KEY_POINT_USER_TYPE("yt_key_point_user_type","重点人群",40), + YT_POPULATION_TYPE("yt_population_type","人口类型",41), + YT_POLITICS_STATUS("yt_politics_status","政治面貌",42), + YT_ID_CARD_TYPE("yt_id_card_type","证件类型",43), ; private final String code; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoCache.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoCache.java index bb5526afe6..a80ba6e727 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoCache.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoCache.java @@ -21,7 +21,14 @@ public class CustomerStaffInfoCache implements Serializable { * 工作人员所属组织ID */ private String agencyId; - + /** + * agencyId的上级 + */ + private String pid; + /** + * 工作人员所属组织的org_id_path + */ + private String orgIdPath; /** * 工作人员所属组织ID的pids */ diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java index 8ddbea5066..f13ecd1297 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java @@ -22,6 +22,8 @@ import org.joda.time.format.DateTimeFormatter; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; +import java.time.Instant; +import java.time.LocalDateTime; import java.time.ZoneId; import java.util.*; @@ -1112,4 +1114,39 @@ public class DateUtils { cal.setTime(date); return str.contains(String.valueOf(cal.get(Calendar.DAY_OF_WEEK))); } + + /** + * @description: java.time.LocalDate转Date + * @param localDate: + * @return + * @author: WangXianZhang + * @date: 2023/5/4 3:00 PM + */ + public static Date localDate2Date(java.time.LocalDate localDate) { + Instant instant = localDate.atStartOfDay().atZone(ZoneId.systemDefault()).toInstant(); + return Date.from(instant); + } + + /** + * @description: java.time.LocalDateTime转Date + * @param localDate: + * @return + * @author: WangXianZhang + * @date: 2023/5/4 3:00 PM + */ + public static Date localDateTime2Date(java.time.LocalDateTime localDate) { + Instant instant = localDate.atZone(ZoneId.systemDefault()).toInstant(); + return Date.from(instant); + } + + /** + * @description: date转化为DateTime + * @param date: + * @return + * @author: WangXianZhang + * @date: 2023/5/4 3:04 PM + */ + public static java.time.LocalDateTime date2LocalDateTime(Date date) { + return LocalDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault()); + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IdCardRegexUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IdCardRegexUtils.java index ff1f0b0549..78c061b395 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IdCardRegexUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IdCardRegexUtils.java @@ -10,6 +10,7 @@ import lombok.NoArgsConstructor; import java.time.DateTimeException; import java.time.LocalDate; import java.time.Period; +import java.util.Date; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -56,6 +57,7 @@ public class IdCardRegexUtils { private String birthdayDay; private String sex; private Integer age; + private LocalDate birthday; } /** @@ -122,17 +124,18 @@ public class IdCardRegexUtils { String month = matcher.group("month"); String day = matcher.group("day"); String sex = matcher.group("sex"); + LocalDate birthday; // ------- 年龄Start---------- Integer age; try { - LocalDate birthday = LocalDate.of(Integer.parseInt(year), Integer.parseInt(month), Integer.parseInt(day)); + birthday = LocalDate.of(Integer.parseInt(year), Integer.parseInt(month), Integer.parseInt(day)); age = Period.between(birthday, LocalDate.now()).getYears(); } catch (DateTimeException e) { throw new EpmetException("身份证号解析年龄失败:" + ExceptionUtils.getErrorStackTrace(e)); } // ------- 年龄End---------- - return new ParsedContent(year, month, day, sex, age); + return new ParsedContent(year, month, day, sex, age, birthday); } // 其他类型暂时不可解析 diff --git a/epmet-gateway/src/main/resources/logback-spring.xml b/epmet-gateway/src/main/resources/logback-spring.xml index 1e050e9686..652ce500c4 100644 --- a/epmet-gateway/src/main/resources/logback-spring.xml +++ b/epmet-gateway/src/main/resources/logback-spring.xml @@ -3,7 +3,8 @@ - + + diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/CustomerStaffDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/CustomerStaffDTO.java index dec7a89cc7..61df5ba791 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/CustomerStaffDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/CustomerStaffDTO.java @@ -134,4 +134,39 @@ public class CustomerStaffDTO implements Serializable { */ private String password; + /** + * 烟台用:当前登录用户 + */ + private String currentUserId; + + /** + * 烟台需求:党组织职务 + */ + private String partyPosition; + + /** + * 烟台需求:村居委员职务 + */ + private String viliagePosition; + + /** + * 烟台需求:工作职责 + */ + private String duty; + + /** + * 烟台需求:备注 + */ + private String remark; + /** + * 文化程度 + */ + private String culture; + /** + * 身份证 + */ + private String idCard; + + + } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/CustomerStaffResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/CustomerStaffResultDTO.java index 3269ebcb26..0bc9203d45 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/CustomerStaffResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/CustomerStaffResultDTO.java @@ -20,7 +20,14 @@ public class CustomerStaffResultDTO implements Serializable { * 工作人员所属组织ID */ private String agencyId; - + /** + * agencyId的上级 + */ + private String pid; + /** + * 工作人员所属组织的org_id_path + */ + private String orgIdPath; /** * 工作人员所属组织ID的pids */ diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/StaffDetailV2FormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/StaffDetailV2FormDTO.java index ea1763af18..5e75cbdeab 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/StaffDetailV2FormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/StaffDetailV2FormDTO.java @@ -48,4 +48,43 @@ public class StaffDetailV2FormDTO implements Serializable { private List szsqRoles; private String customerId; + /** + * 烟台用:当前登录用户 + */ + private String currentUserId; + + /** + * 烟台需求:党组织职务 + */ + private String partyPosition; + + /** + * 烟台需求:村居委员职务 + */ + private String viliagePosition; + + /** + * 烟台需求:工作职责 + */ + private String duty; + + /** + * 烟台需求:备注 + */ + private String remark; + /** + * 文化程度 + */ + private String culture; + /** + * 身份证 + */ + private String idCard; + + /** + * 居住地址 + */ + private String address; + + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java index 24d9c5a738..2498606f80 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java @@ -268,7 +268,7 @@ public class EpmetUserController { * remark: */ @PostMapping("getStaffInfo/{staffId}") - public Result getStaffInfo(@PathVariable(name = "staffId") String staffId){ + public Result getStaffInfo(@PathVariable(name = "staffId") String staffId){ return new Result().ok(epmetUserService.getStaffInfo(staffId)); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java index 75f863dd58..0a6f640a1f 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java @@ -18,10 +18,7 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; import com.epmet.commons.tools.redis.common.bean.IcResiUserInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; -import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.commons.tools.utils.IpUtils; -import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.*; import com.epmet.constant.BadgeConstant; import com.epmet.constant.NeighborhoodConstant; import com.epmet.constant.OrgInfoConstant; @@ -650,6 +647,9 @@ public class EpmetUserServiceImpl implements EpmetUserService { } result.setStaffId(staffEntity.getUserId()); result.setAgencyId(agencyDTO.getId()); + //新增pid,orgIdPath + result.setPid(agencyDTO.getPid()); + result.setOrgIdPath(PidUtils.convertPid2OrgIdPath(agencyDTO.getId(),agencyDTO.getPids())); result.setAgencyName(agencyDTO.getOrganizationName()); result.setAgencyPIds(agencyDTO.getPids()); result.setLevel(agencyDTO.getLevel()); @@ -723,6 +723,14 @@ public class EpmetUserServiceImpl implements EpmetUserService { formDTO.setPageNo(pageIndex); //1.分页查询排好序的工作人员Id列表【原本1/2步可以用一个sql,但涉及2需要按1的顺序排序,sql复杂且效率低,所以拆开】 LinkedList staffIds = customerStaffDao.selectOrderRole(formDTO); + if (staffIds!=null && formDTO.getStaffIds()!=null){ + formDTO.getStaffIds().forEach( + staffId->{ + if (!staffIds.contains(staffId)){ + staffIds.add(staffId); + } + }); + } //2.批量查询工作人员信息,按传入顺序排序 if(CollectionUtils.isEmpty(staffIds)){ return new ArrayList<>(); diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/logback-spring.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/logback-spring.xml index c639482221..d1cb010d4f 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/logback-spring.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/logback-spring.xml @@ -3,7 +3,8 @@ - + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml b/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml index 86de057fc6..53c7e59c69 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml @@ -3,7 +3,8 @@ - + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml index 7d2b7648a3..c320f80c0d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml @@ -3,7 +3,8 @@ - + + diff --git a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/logback-spring.xml b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/logback-spring.xml index 280e9f4bb2..c639444cee 100644 --- a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/logback-spring.xml +++ b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/logback-spring.xml @@ -3,7 +3,8 @@ - + + diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java index 204845c1fb..f35891c2a5 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java @@ -83,4 +83,19 @@ public interface ImportTaskConstants { * 未做核酸比对 */ String IC_NAT_COMPARE_RECORD="ic_nat_compare_record"; + + /** + * 物业表:ic_property_management + */ + String IC_PROPERTY_MANAGEMENT="ic_property_management"; + + /** + * 楼长单元长 + */ + String COMMUNITY_BUILDING_MANAGER="community_building_manager"; + + /** + * 客户 + */ + String BIZ_TYPE_CUSTOMER_STAFF="customer_staff"; } diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/logback-spring.xml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/logback-spring.xml index dbd4fe85bb..9102439017 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/resources/logback-spring.xml +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/logback-spring.xml @@ -3,7 +3,8 @@ - + + diff --git a/epmet-module/epmet-demo/epmet-demo-server/src/main/resources/logback-spring.xml b/epmet-module/epmet-demo/epmet-demo-server/src/main/resources/logback-spring.xml index 1b8b94ba78..4f79c1b027 100644 --- a/epmet-module/epmet-demo/epmet-demo-server/src/main/resources/logback-spring.xml +++ b/epmet-module/epmet-demo/epmet-demo-server/src/main/resources/logback-spring.xml @@ -3,7 +3,8 @@ - + + diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/logback-spring.xml b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/logback-spring.xml index 8f428f8d5f..aa0f9f0a7b 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/logback-spring.xml +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/logback-spring.xml @@ -3,7 +3,8 @@ - + + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/logback-spring.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/logback-spring.xml index b03ee98c4c..2239f625db 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/logback-spring.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/logback-spring.xml @@ -3,7 +3,8 @@ - + + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml index 89f8764a30..05bcf1ad4b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml @@ -40,7 +40,7 @@ AND sr.SERVICE_TIME_END #{serviceTimeEnd} - ORDER BY sr.CREATED_TIME DESC + ORDER BY sr.SERVICE_TIME_START DESC,sr.SERVICE_TIME_END DESC diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/resources/logback-spring.xml b/epmet-module/epmet-job/epmet-job-server/src/main/resources/logback-spring.xml index 36cbaf8d12..999b42342b 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/resources/logback-spring.xml +++ b/epmet-module/epmet-job/epmet-job-server/src/main/resources/logback-spring.xml @@ -3,7 +3,8 @@ - + + diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/OrganizationMessageFormDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/OrganizationMessageFormDTO.java new file mode 100644 index 0000000000..cc42aa46ba --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/OrganizationMessageFormDTO.java @@ -0,0 +1,52 @@ +package com.epmet.dto; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.Valid; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import java.io.Serializable; +import java.util.List; + + +/** + * 组织发布消息(烟台) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-04 + */ +@Data +public class OrganizationMessageFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + public interface AddShowGroup extends CustomerClientShowGroup { + } + /** + * 发布渠道:0:专属app + */ + @NotBlank(message = "发布渠道不能为空", groups = {AddShowGroup.class}) + private String publishDitch; + + /** + * 消息内容;最多输入500 + */ + @NotBlank(message = "内容不能为空", groups = {AddShowGroup.class}) + @Length(max = 500, message = "内容输入500字", groups = {AddShowGroup.class}) + private String content; + + @Valid + @NotEmpty(message = "发布范围不能为空", groups = {AddShowGroup.class}) + private List rangeList; + + /** + * 客户Id + */ + private String customerId; + /** + * 发布人staffId + */ + private String publishStaffId; +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/OrganizationMessagePublishRangeDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/OrganizationMessagePublishRangeDTO.java new file mode 100644 index 0000000000..2b51910c48 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/OrganizationMessagePublishRangeDTO.java @@ -0,0 +1,63 @@ +package com.epmet.dto; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * 消息发布范围(烟台) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-04 + */ +@Data +public class OrganizationMessagePublishRangeDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 消息id:organization_message.id + */ + private String messageId; + + /** + * 组织或者网格id + */ + @NotBlank(message = "orgId不能为空",groups = {OrganizationMessageFormDTO.AddShowGroup.class}) + private String orgId; + + /** + * 组织:agency;网格:grid + */ + @NotBlank(message = "orgType不能为空",groups = {OrganizationMessageFormDTO.AddShowGroup.class}) + private String orgType; + + /** + * org_id的父级 + */ + private String pid; + + /** + * org_id的全路径,包含org_id + */ + private String orgIdPath; + + /** + * 组织名称或者网格名称;如果是网格名称,存储的是XXX社区-XX网格 + */ + private String orgName; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/OrganizationMessagePageFormDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/OrganizationMessagePageFormDTO.java new file mode 100644 index 0000000000..1e5b23d884 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/OrganizationMessagePageFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +/** + * @Description 烟台消息管理,列表查询入参 + * @Author yzm + * @Date 2023/5/4 16:05 + */ +@Data +public class OrganizationMessagePageFormDTO extends PageFormDTO { + /** + * 发布渠道:0:专属app + */ + private String publishDitch; + /** + * 发布范围,组织id或者网格id + */ + private String orgId; + /** + * yyyy-MM-dd + */ + private String startDate; + /** + * yyyy-MM-dd + */ + private String endDate; +} + diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/OrganizationMessageResultDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/OrganizationMessageResultDTO.java new file mode 100644 index 0000000000..94b89ded76 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/OrganizationMessageResultDTO.java @@ -0,0 +1,84 @@ +package com.epmet.dto.result; + +import com.epmet.dto.OrganizationMessagePublishRangeDTO; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * @Description 烟台消息管理,列表查询 + * @Author yzm + * @Date 2023/5/4 16:06 + */ +@Data +public class OrganizationMessageResultDTO { + /** + * 消息id + */ + private String messageId; + + /** + * 发布渠道:0:专属app + */ + private String publishDitch; + + /** + * 消息内容;最多输入500 + */ + private String content; + /** + * 发布范围 + */ + private String publishRangeName; + + /** + * 发布时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date publishTime; + + /** + * 发布人staffId + */ + private String publishStaffId; + + /** + * 发布人姓名 + */ + private String publishStaffName; + + /** + * 发布人所属组织id + */ + private String publishOrgId; + + /** + * org_id_path + */ + private String publishOrgIdPath; + + /** + * 发布人所属组织名称 + */ + private String publishOrgName; + + /** + * 发送结果 + */ + private String sendMsgRes; + /** + * 共发送出多少条消息 + */ + private Integer totalReceiver; + + /** + * 发送完成时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date finishSendTime; + + private List rangeList; +} + diff --git a/epmet-module/epmet-message/epmet-message-server/pom.xml b/epmet-module/epmet-message/epmet-message-server/pom.xml index 53336db181..e900c8ba1a 100644 --- a/epmet-module/epmet-message/epmet-message-server/pom.xml +++ b/epmet-module/epmet-message/epmet-message-server/pom.xml @@ -101,11 +101,6 @@ flyway-core - - com.epmet - epmet-user-client - 2.0.0 - com.epmet epmet-third-client diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/OrganizationMessageController.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/OrganizationMessageController.java new file mode 100644 index 0000000000..fac7d6d6d2 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/OrganizationMessageController.java @@ -0,0 +1,76 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.page.PageData; +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.dto.OrganizationMessageFormDTO; +import com.epmet.dto.form.OrganizationMessagePageFormDTO; +import com.epmet.dto.result.OrganizationMessageResultDTO; +import com.epmet.service.OrganizationMessageService; +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 2023-05-04 + */ +@RestController +@RequestMapping("organization/message") +public class OrganizationMessageController { + + @Autowired + private OrganizationMessageService organizationMessageService; + + /** + * 列表查询 + * + * @param formDTO + * @return + */ + @PostMapping("list") + public Result> pageList(@RequestBody OrganizationMessagePageFormDTO formDTO) { + return new Result>().ok(organizationMessageService.pageList(formDTO.getPageNo(), formDTO.getPageSize(), + formDTO.getPublishDitch(), + formDTO.getOrgId(), + formDTO.getStartDate(), + formDTO.getEndDate())); + } + + /** + * 查询消息详情 + * + * @param messageId + * @return + */ + @PostMapping("detail/{messageId}") + public Result getDetail(@PathVariable("messageId") String messageId) { + if (StringUtils.isBlank(messageId)) { + return new Result<>(); + } + return new Result().ok(organizationMessageService.getDetail(messageId)); + } + + /** + * 发布消息 + * + * @param formDTO + * @return 返回消息id + */ + @PostMapping("publish") + public Result publish(@LoginUser TokenDto tokenDto, @RequestBody OrganizationMessageFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setPublishStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, OrganizationMessageFormDTO.AddShowGroup.class); + String messageId=organizationMessageService.publish(formDTO); + // 发送消息 发布范围下有哪些网格,网格下所有的注册居民,每人发送一条消息 + organizationMessageService.sendUserMsg(messageId,formDTO.getContent(),formDTO.getPublishStaffId(),formDTO.getRangeList(),formDTO.getCustomerId()); + return new Result().ok(messageId); + } + +} diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/OrganizationMessageDao.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/OrganizationMessageDao.java new file mode 100644 index 0000000000..f13e230f0c --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/OrganizationMessageDao.java @@ -0,0 +1,36 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.OrganizationMessageResultDTO; +import com.epmet.entity.OrganizationMessageEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 组织发布消息(烟台) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-04 + */ +@Mapper +public interface OrganizationMessageDao extends BaseDao { + + /** + * + * @param staffOrgIdPath 工作人员所属组织的orgIdPath + * @param publishDitch 发布渠道;0:专属app + * @param orgId 发布范围,组织id或者网格id + * @param startDate yyyy-MM-dd + * @param endDate yyyy-MM-dd + * @return + */ + List pageList(@Param("customerId")String customerId, + @Param("staffOrgIdPath") String staffOrgIdPath, + @Param("publishDitch")String publishDitch, + @Param("orgId")String orgId, + @Param("startDate")String startDate, + @Param("endDate")String endDate, + @Param("messageId")String messageId); +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/OrganizationMessagePublishRangeDao.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/OrganizationMessagePublishRangeDao.java new file mode 100644 index 0000000000..94a9a65100 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/OrganizationMessagePublishRangeDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.OrganizationMessagePublishRangeEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 消息发布范围(烟台) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-04 + */ +@Mapper +public interface OrganizationMessagePublishRangeDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/OrganizationMessageEntity.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/OrganizationMessageEntity.java new file mode 100644 index 0000000000..15c07c0851 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/OrganizationMessageEntity.java @@ -0,0 +1,82 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 组织发布消息(烟台) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-04 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("organization_message") +public class OrganizationMessageEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 发布渠道:0:专属app + */ + private String publishDitch; + + /** + * 消息内容;最多输入500 + */ + private String content; + + /** + * 发布人staffId + */ + private String publishStaffId; + + /** + * 发布人姓名 + */ + private String publishStaffName; + + /** + * 发布人所属组织id + */ + private String publishOrgId; + + /** + * org_id_path + */ + private String publishOrgIdPath; + + /** + * 发布人所属组织名称 + */ + private String publishOrgName; + + /** + * 发布时间 + */ + private Date publishTime; + /** + * 发送结果 + * sending发送中;failed失败;success成功 + */ + private String sendMsgRes; + /** + * 共发送出多少条消息 + */ + private Integer totalReceiver; + + /** + * 发送完成时间 + */ + private Date finishSendTime; +} diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/OrganizationMessagePublishRangeEntity.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/OrganizationMessagePublishRangeEntity.java new file mode 100644 index 0000000000..5080cfe16f --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/OrganizationMessagePublishRangeEntity.java @@ -0,0 +1,56 @@ +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 2023-05-04 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("organization_message_publish_range") +public class OrganizationMessagePublishRangeEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 消息id:organization_message.id + */ + private String messageId; + + /** + * 组织或者网格id + */ + private String orgId; + + /** + * 组织:agency;网格:grid + */ + private String orgType; + + /** + * org_id的父级 + */ + private String pid; + + /** + * org_id的全路径,包含org_id + */ + private String orgIdPath; + + /** + * 组织名称或者网格名称;如果是网格名称,存储的是XXX社区-XX网格 + */ + private String orgName; + +} diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/OrganizationMessageService.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/OrganizationMessageService.java new file mode 100644 index 0000000000..8932b557b4 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/OrganizationMessageService.java @@ -0,0 +1,47 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.OrganizationMessageFormDTO; +import com.epmet.dto.OrganizationMessagePublishRangeDTO; +import com.epmet.dto.result.OrganizationMessageResultDTO; +import com.epmet.entity.OrganizationMessageEntity; + +import java.util.List; + +/** + * 组织发布消息(烟台) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-04 + */ +public interface OrganizationMessageService extends BaseService { + + /** + * 分页列表 + * @param pageNo + * @param pageSize + * @param publishDitch 发布渠道;0:专属app + * @param orgId 发布范围,组织id或者网格id + * @param startDate yyyy-MM-dd + * @param endDate yyyy-MM-dd + * @return + */ + PageData pageList(Integer pageNo, Integer pageSize, String publishDitch, String orgId, String startDate, String endDate); + + /** + * 查询详情 + * @param messageId + * @return + */ + OrganizationMessageResultDTO getDetail(String messageId); + + /** + * 发布消息 + * @param formDTO + * @return 返回消息id + */ + String publish(OrganizationMessageFormDTO formDTO); + + void sendUserMsg(String messageId, String content, String publishStaffId, List rangeList, String customerId); +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/OrganizationMessageServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/OrganizationMessageServiceImpl.java new file mode 100644 index 0000000000..65580da84c --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/OrganizationMessageServiceImpl.java @@ -0,0 +1,219 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.commons.tools.constant.Constant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.enums.OrgTypeEnum; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.page.PageData; +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.utils.*; +import com.epmet.dao.OrganizationMessageDao; +import com.epmet.dao.OrganizationMessagePublishRangeDao; +import com.epmet.dao.UserMessageDao; +import com.epmet.dto.OrganizationMessageFormDTO; +import com.epmet.dto.OrganizationMessagePublishRangeDTO; +import com.epmet.dto.RegisterRelationDTO; +import com.epmet.dto.form.RegisterRelationPageFormDTO; +import com.epmet.dto.result.OrganizationMessageResultDTO; +import com.epmet.entity.OrganizationMessageEntity; +import com.epmet.entity.OrganizationMessagePublishRangeEntity; +import com.epmet.entity.UserMessageEntity; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.service.OrganizationMessageService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; +import java.util.List; + +/** + * 组织发布消息(烟台) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-04 + */ +@Slf4j +@Service +public class OrganizationMessageServiceImpl extends BaseServiceImpl implements OrganizationMessageService { + @Autowired + private OrganizationMessagePublishRangeDao organizationMessagePublishRangeDao; + @Autowired + private UserMessageDao userMessageDao; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + + /** + * 分页列表 + * + * @param pageNo + * @param pageSize + * @param publishDitch 发布渠道;0:专属app + * @param orgId 发布范围,组织id或者网格id + * @param startDate yyyy-MM-dd + * @param endDate yyyy-MM-dd + * @return + */ + @Override + public PageData pageList(Integer pageNo, Integer pageSize, String publishDitch, String orgId, String startDate, String endDate) { + CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), EpmetRequestHolder.getLoginUserId()); + if (null == staffInfoCacheResult) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "customerId:" + EpmetRequestHolder.getLoginUserCustomerId() + "staffId:" + EpmetRequestHolder.getLoginUserId(), "获取工作人员信息异常"); + } + String staffOrgIdPath = PidUtils.convertPid2OrgIdPath(staffInfoCacheResult.getAgencyId(), staffInfoCacheResult.getAgencyPIds()); + PageHelper.startPage(pageNo, pageSize); + List list = baseDao.pageList(EpmetRequestHolder.getLoginUserCustomerId(),staffOrgIdPath, publishDitch, orgId, startDate, endDate,null); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal(),pageSize); + } + + /** + * 查询详情 + * + * @param messageId + * @return + */ + @Override + public OrganizationMessageResultDTO getDetail(String messageId) { + List list = baseDao.pageList(EpmetRequestHolder.getLoginUserCustomerId(),null, null, null, null, null,messageId); + if(CollectionUtils.isNotEmpty(list)){ + OrganizationMessageResultDTO resultDTO=list.get(NumConstant.ZERO); + LambdaQueryWrapper queryWrapper=new LambdaQueryWrapper<>(); + queryWrapper.eq(OrganizationMessagePublishRangeEntity::getMessageId,messageId) + .orderByAsc(OrganizationMessagePublishRangeEntity::getCreatedTime); + List rangeList=organizationMessagePublishRangeDao.selectList(queryWrapper); + resultDTO.setRangeList(ConvertUtils.sourceToTarget(rangeList,OrganizationMessagePublishRangeDTO.class)); + return resultDTO; + } + return null; + } + + /** + * 发布消息 + * + * @param formDTO + * @return 返回消息id + */ + @Transactional(rollbackFor = Exception.class) + @Override + public String publish(OrganizationMessageFormDTO formDTO) { + OrganizationMessageEntity messageEntity = ConvertUtils.sourceToTarget(formDTO, OrganizationMessageEntity.class); + CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getPublishStaffId()); + messageEntity.setPublishStaffName(staffInfoCacheResult.getRealName()); + messageEntity.setPublishOrgId(staffInfoCacheResult.getAgencyId()); + messageEntity.setPublishOrgIdPath(PidUtils.convertPid2OrgIdPath(staffInfoCacheResult.getAgencyId(), staffInfoCacheResult.getAgencyPIds())); + messageEntity.setPublishOrgName(staffInfoCacheResult.getAgencyName()); + messageEntity.setPublishTime(new Date()); + messageEntity.setSendMsgRes("sending"); + baseDao.insert(messageEntity); + for (OrganizationMessagePublishRangeDTO dto : formDTO.getRangeList()) { + OrganizationMessagePublishRangeEntity rangeEntity = new OrganizationMessagePublishRangeEntity(); + rangeEntity.setCustomerId(messageEntity.getCustomerId()); + rangeEntity.setMessageId(messageEntity.getId()); + rangeEntity.setOrgId(dto.getOrgId()); + rangeEntity.setOrgType(dto.getOrgType()); + if (OrgTypeEnum.GRID.getCode().equals(dto.getOrgType())) { + GridInfoCache gridInfoCache = CustomerOrgRedis.getGridInfo(dto.getOrgId()); + rangeEntity.setPid(gridInfoCache.getPid()); + rangeEntity.setOrgIdPath(PidUtils.convertPid2OrgIdPath(dto.getOrgId(), gridInfoCache.getPids())); + rangeEntity.setOrgName(gridInfoCache.getGridNamePath()); + } else { + //if (OrgTypeEnum.AGENCY.getCode().equals(dto.getOrgType())) + AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(dto.getOrgId()); + rangeEntity.setPid(agencyInfoCache.getPid()); + rangeEntity.setOrgIdPath(PidUtils.convertPid2OrgIdPath(dto.getOrgId(), agencyInfoCache.getPids())); + rangeEntity.setOrgName(agencyInfoCache.getOrganizationName()); + } + dto.setPid(rangeEntity.getPid()); + dto.setOrgIdPath(rangeEntity.getOrgIdPath()); + organizationMessagePublishRangeDao.insert(rangeEntity); + } + String messageId = messageEntity.getId(); + return messageId; + } + + + @Async + @Override + public void sendUserMsg(String messageId, String content, String publishStaffId,List rangeList, String customerId) { + String result = "success"; + int totalMsg = NumConstant.ZERO; + try { + for (OrganizationMessagePublishRangeDTO rangeDto : rangeList) { + RegisterRelationPageFormDTO pageFormDTO=new RegisterRelationPageFormDTO(); + pageFormDTO.setCustomerId(customerId); + pageFormDTO.setFirstRegister(NumConstant.ONE_STR); + pageFormDTO.setPageNo(NumConstant.ONE); + pageFormDTO.setPageSize(NumConstant.TWO); + // pageFormDTO.setPageSize(NumConstant.ONE_THOUSAND); + if (OrgTypeEnum.GRID.getCode().equals(rangeDto.getOrgType())) { + // 查询该网格下的注册居民 + pageFormDTO.setGridId(rangeDto.getOrgId()); + } else { + // 查询该组织下的注册居民 + pageFormDTO.setAgencyIdPath(rangeDto.getOrgIdPath()); + } + List list=null; + do { + Result> regRes = epmetUserOpenFeignClient.pageQueryRegisterUser(pageFormDTO); + list = regRes.getData().getList(); + for (RegisterRelationDTO regUser : list) { + LambdaQueryWrapper queryWrapper=new LambdaQueryWrapper(); + queryWrapper.eq(UserMessageEntity::getCustomerId,customerId) + .eq(UserMessageEntity::getTargetId,messageId) + .eq(UserMessageEntity::getUserId,regUser.getUserId()); + UserMessageEntity origin=userMessageDao.selectOne(queryWrapper); + if(null==origin){ + UserMessageEntity userMessageEntity = new UserMessageEntity(); + userMessageEntity.setCustomerId(customerId); + userMessageEntity.setGridId(regUser.getGridId()); + userMessageEntity.setUserId(regUser.getUserId()); + userMessageEntity.setApp(AppClientConstant.APP_RESI); + userMessageEntity.setTitle("您有一条社区消息!"); + userMessageEntity.setMessageContent(content); + userMessageEntity.setReadFlag(Constant.UNREAD); + userMessageEntity.setReferer(StrConstant.EPMETY_STR); + userMessageEntity.setMessageType("organization_message"); + userMessageEntity.setTargetId(messageId); + userMessageEntity.setCreatedBy(publishStaffId); + userMessageEntity.setUpdatedBy(publishStaffId); + userMessageDao.insert(userMessageEntity); + totalMsg += 1; + } + } + pageFormDTO.setPageNo(pageFormDTO.getPageNo() + NumConstant.ONE); + } while (CollectionUtils.isNotEmpty(list) && list.size() == pageFormDTO.getPageSize()); + } + } catch (Exception e) { + log.error(String.format("messageId:%s,发送消息异常:%s", messageId, ExceptionUtils.getErrorStackTrace(e))); + result = "failed"; + } finally { + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.eq(OrganizationMessageEntity::getId, messageId) + .set(OrganizationMessageEntity::getSendMsgRes, result) + .set(OrganizationMessageEntity::getTotalReceiver, totalMsg) + .set(OrganizationMessageEntity::getFinishSendTime,new Date()) + .set(OrganizationMessageEntity::getUpdatedTime,new Date()); + baseDao.update(null, updateWrapper); + } + } + + +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/resources/logback-spring.xml b/epmet-module/epmet-message/epmet-message-server/src/main/resources/logback-spring.xml index 338e0b9495..ddb20915c4 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/resources/logback-spring.xml +++ b/epmet-module/epmet-message/epmet-message-server/src/main/resources/logback-spring.xml @@ -3,7 +3,8 @@ - + + diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/OrganizationMessageDao.xml b/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/OrganizationMessageDao.xml new file mode 100644 index 0000000000..4c7b8d1140 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/OrganizationMessageDao.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/OrganizationMessagePublishRangeDao.xml b/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/OrganizationMessagePublishRangeDao.xml new file mode 100644 index 0000000000..18e02ac73f --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/OrganizationMessagePublishRangeDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/logback-spring.xml b/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/logback-spring.xml index 8a71d1a810..d18ef07d28 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/logback-spring.xml +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/logback-spring.xml @@ -3,7 +3,8 @@ - + + diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/logback-spring.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/logback-spring.xml index e279b43303..81366ebe09 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/logback-spring.xml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/logback-spring.xml @@ -3,7 +3,8 @@ - + + diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/logback-spring.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/logback-spring.xml index f8e2164fb7..70dde2e876 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/logback-spring.xml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/logback-spring.xml @@ -3,7 +3,8 @@ - + + diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/logback-spring.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/logback-spring.xml index 9070f33f63..521b890c6c 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/resources/logback-spring.xml +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/logback-spring.xml @@ -3,7 +3,8 @@ - + + diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/resources/logback-spring.xml b/epmet-module/gov-grid/gov-grid-server/src/main/resources/logback-spring.xml index b54d66f380..d0e5f2b64c 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/resources/logback-spring.xml +++ b/epmet-module/gov-grid/gov-grid-server/src/main/resources/logback-spring.xml @@ -3,7 +3,8 @@ - + + diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/logback-spring.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/logback-spring.xml index 26e92fef88..d31ef9d410 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/logback-spring.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/logback-spring.xml @@ -3,7 +3,8 @@ - + + diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/resources/logback-spring.xml b/epmet-module/gov-mine/gov-mine-server/src/main/resources/logback-spring.xml index 33466c3178..31d1a8af02 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/resources/logback-spring.xml +++ b/epmet-module/gov-mine/gov-mine-server/src/main/resources/logback-spring.xml @@ -3,7 +3,8 @@ - + + diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcBuildingDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcBuildingDTO.java index 52567226eb..a16516edc1 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcBuildingDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcBuildingDTO.java @@ -96,6 +96,16 @@ public class IcBuildingDTO implements Serializable { */ private String buildingLeaderMobile; + /** + * 烟台需求:楼长身份证号 + */ + private String buildingLeaderIdCard; + + /** + * 烟台需求:类型:0楼长;1单元长 + */ + private String buildingLeaderType; + /** * 中心点位:经度 */ @@ -156,4 +166,5 @@ public class IcBuildingDTO implements Serializable { */ private Integer realPerson; + } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java index cdbf65c799..e47d6914f1 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java @@ -170,4 +170,13 @@ public class IcHouseDTO implements Serializable { * 加密后的房主身份证 */ private String showOwnerIdCard; + + /** + * 所在楼层 + */ + private String floor; + /** + * 面积 + */ + private String area; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcNeighborHoodDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcNeighborHoodDTO.java index 8e39699670..66c41f6342 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcNeighborHoodDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcNeighborHoodDTO.java @@ -165,4 +165,20 @@ public class IcNeighborHoodDTO implements Serializable { */ private String buildingName; + /** + * 烟台需求:自然村/小区 + */ + private String viliageType; + /** + * 烟台需求:面积 + */ + private String area; + /** + * 烟台需求:开放类型 + */ + private String openType; + /** + * 烟台需求:建筑年代 + */ + private String buildYear; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPropertyManagementDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPropertyManagementDTO.java index a276e36387..18de590a92 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPropertyManagementDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPropertyManagementDTO.java @@ -17,10 +17,14 @@ package com.epmet.dto; +import com.alibaba.excel.annotation.ExcelIgnore; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; import lombok.Data; import java.io.Serializable; import java.util.Date; +import java.util.List; /** @@ -37,48 +41,85 @@ public class IcPropertyManagementDTO implements Serializable { /** * 物业id */ + @ExcelIgnore private String id; /** * 物业名称 */ + @ExcelProperty(value = "物业名称") + @ColumnWidth(30) private String name; /** * 客户id */ + @ExcelIgnore private String customerId; + /** + * 烟台需求:物业联系人姓名 + */ + @ExcelProperty(value = "物业联系人") + @ColumnWidth(30) + private String contactName; + + /** + * 烟台需求:物业联系人电话 + */ + @ExcelProperty(value = "联系电话") + @ColumnWidth(30) + private String contactMobile; + + /** + * 关联的小区数量 + */ + @ExcelIgnore + private Integer totalNeighborHood; + + /** + * 导出时候用 + * 该物业关联的小区 + */ + @ExcelProperty(value = "关联小区") + @ColumnWidth(60) + private String neighborHoodNames; + + @ExcelIgnore + List neighborHoodList; + /** * 删除标识 0未删除、1已删除 */ + @ExcelIgnore private String delFlag; /** * 乐观锁 */ + @ExcelIgnore private Integer revision; /** * 创建人 */ + @ExcelIgnore private String createdBy; /** * 创建时间 */ + @ExcelIgnore private Date createdTime; /** * 更新人 */ + @ExcelIgnore private String updatedBy; /** * 更新时间 */ + @ExcelIgnore private Date updatedTime; - /** - * 关联的小区数量 - */ - private Integer totalNeighborHood; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/ImportGeneralDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/ImportGeneralDTO.java index df0f6b0530..d617ad39dd 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/ImportGeneralDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/ImportGeneralDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto; +import com.alibaba.excel.annotation.ExcelProperty; import com.epmet.commons.tools.constant.NumConstant; import lombok.Data; @@ -183,4 +184,48 @@ public class ImportGeneralDTO implements Serializable { */ private Boolean buildingUpdateStatus = false; private Boolean neighborHoodUpdateStatus = false; + + /** + * 烟台需求:自然村/小区 + */ + private String viliageType; + + /** + * 烟台需求:自然村/小区 + */ + private String viliageTypeName; + /** + * 烟台需求:面积 + */ + private String area; + /** + * 烟台需求:开放类型 + */ + private String openType; + + /** + * 烟台需求:开放类型 + */ + private String openTypeName; + /** + * 烟台需求:建筑年代 + */ + private String buildYear; + + /** + * 所在楼层 + */ + private String floor; + + private String buildingLeaderIdCard; + + private String buildingLeaderType; + + private String buildingLeaderTypeNum; + + + private String propertyUserName; + + private String propertyUserMobile; + } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyV2FormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyV2FormDTO.java index 63bf3c6e55..1427330c53 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyV2FormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyV2FormDTO.java @@ -124,4 +124,30 @@ public class AddAgencyV2FormDTO implements Serializable { */ @Length(max = 500,message ="最多输入500字",groups =DefaultUserShowGroup.class ) private String remark; + + /** + * 村居/社区书记姓名 + */ + private String secretaryName; + /** + * 村居/社区书记电话 + */ + private String secretaryMobile; + /** + * 值班电话 + */ + private String dutyMobile; + /** + * 统一社会信用代码 + */ + private String unifiedSocialCreditCode; + /** + * 统一社会信用代码证书(图片附件) + */ + private String unifiedSocialCreditCodeCertificate; + + /** + * 详细地址 + */ + private String fullAddress; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddStaffV2FromDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddStaffV2FromDTO.java index 7bc3b93076..4250c5ca61 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddStaffV2FromDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddStaffV2FromDTO.java @@ -78,4 +78,38 @@ public class AddStaffV2FromDTO implements Serializable { * 烟台用:当前登录用户 */ private String currentUserId; + + /** + * 烟台需求:党组织职务 + */ + private String partyPosition; + + /** + * 烟台需求:村居委员职务 + */ + private String viliagePosition; + + /** + * 烟台需求:工作职责 + */ + private String duty; + + /** + * 烟台需求:备注 + */ + private String remark; + /** + * 文化程度 + */ + private String culture; + /** + * 身份证 + */ + private String idCard; + + /** + * 居住地址 + */ + private String address; + } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java index 2d0da966d0..af4e9a36e2 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java @@ -113,4 +113,30 @@ public class EditAgencyFormDTO implements Serializable { @Length(max = 500,message = "最多输入500字",groups =DefaultUserShowGroup.class ) private String remark; + + /** + * 村居/社区书记姓名 + */ + private String secretaryName; + /** + * 村居/社区书记电话 + */ + private String secretaryMobile; + /** + * 值班电话 + */ + private String dutyMobile; + /** + * 统一社会信用代码 + */ + private String unifiedSocialCreditCode; + /** + * 统一社会信用代码证书(图片附件) + */ + private String unifiedSocialCreditCodeCertificate; + + /** + * 详细地址 + */ + private String fullAddress; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingAddFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingAddFormDTO.java index cafecc1f1b..d4c2af991b 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingAddFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingAddFormDTO.java @@ -150,5 +150,9 @@ public class IcBulidingAddFormDTO implements Serializable { */ private Integer realPerson; + private String buildingLeaderType; + + private String buildingLeaderIdCard; + } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseAddFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseAddFormDTO.java index aa4e6a999b..11d5ce0295 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseAddFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseAddFormDTO.java @@ -112,5 +112,13 @@ public class IcHouseAddFormDTO implements Serializable { * 房屋可编辑编码 */ private String coding; + /** + * 所在楼层 + */ + private String floor; + /** + * 面积 + */ + private String area; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodAddFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodAddFormDTO.java index 854462c6e1..f975c75048 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodAddFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodAddFormDTO.java @@ -113,6 +113,21 @@ public class IcNeighborHoodAddFormDTO extends PageFormDTO { * 实有楼栋数 */ private Integer realBuilding; - + /** + * 烟台需求:自然村/小区 + */ + private String viliageType; + /** + * 烟台需求:面积 + */ + private String area; + /** + * 烟台需求:开放类型 + */ + private String openType; + /** + * 烟台需求:建筑年代 + */ + private String buildYear; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPropertyManagementFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPropertyManagementFormDTO.java index bbc2cd7152..0b3f3ea9b4 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPropertyManagementFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPropertyManagementFormDTO.java @@ -17,17 +17,18 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.dto.form.PageFormDTO; 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; +import java.util.List; @Data -public class IcPropertyManagementFormDTO implements Serializable { +public class IcPropertyManagementFormDTO extends PageFormDTO implements Serializable { private static final long serialVersionUID = 1L; @@ -40,8 +41,8 @@ public class IcPropertyManagementFormDTO implements Serializable { public interface UpdateShowGroup extends CustomerClientShowGroup { } - public interface PageGroup extends CustomerClientShowGroup { - } + // public interface PageGroup extends CustomerClientShowGroup { + // } @NotBlank(message = "物业id不能为空", groups = {DeleteGroup.class, UpdateShowGroup.class}) private String id; @@ -52,11 +53,24 @@ public class IcPropertyManagementFormDTO implements Serializable { @Length(max = 50, message = "物业名称不能超过50个字", groups = {AddShowGroup.class}) private String name; - private String customerId; + /** + * 烟台需求:物业联系人姓名 + */ + @Length(max = 30, message = "物业联系人不能超过30个字", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String contactName; + + /** + * 烟台需求:物业联系人电话 + */ + @Length(max = 30, message = "联系电话不能超过30个字",groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String contactMobile; + + /** + * 管理小区id + */ + private List neighborHoodIdList; + - @NotNull(message = "pageNo不能为空", groups = PageGroup.class) - private Integer pageNo; - @NotNull(message = "pageSize不能为空", groups = PageGroup.class) - private Integer pageSize; + private String customerId; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitFromDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitFromDTO.java index f39bde7aab..a3ecf0f06f 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitFromDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitFromDTO.java @@ -74,4 +74,37 @@ public class StaffSubmitFromDTO implements Serializable { * 社会自组织: community_org */ private String deptType; + + /** + * 烟台需求:党组织职务 + */ + private String partyPosition; + + /** + * 烟台需求:村居委员职务 + */ + private String viliagePosition; + + /** + * 烟台需求:工作职责 + */ + private String duty; + + /** + * 烟台需求:备注 + */ + private String remark; + /** + * 文化程度 + */ + private String culture; + /** + * 身份证 + */ + private String idCard; + + /** + * 居住地址 + */ + private String address; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/ChooseGridFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/ChooseGridFormDTO.java new file mode 100644 index 0000000000..29e4de2b75 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/ChooseGridFormDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.form.yt; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +/** + * @Description + * @Author yzm + * @Date 2023/4/19 14:13 + */ +@Data +public class ChooseGridFormDTO extends PageFormDTO { + /** + * 客户id + */ + private String customerId; + + /** + * 组织id + */ + private String agencyId; + + /** + * 网格id + */ + private String gridId; + + /** + * 楼栋名 + */ + private String buildingName; +} + diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/CommunityBuildingManagerPageFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/CommunityBuildingManagerPageFormDTO.java new file mode 100644 index 0000000000..f4fd8bbbda --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/CommunityBuildingManagerPageFormDTO.java @@ -0,0 +1,80 @@ +package com.epmet.dto.form.yt; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +/** + * @Description + * @Author yzm + * @Date 2023/5/6 13:53 + */ +@Data +public class CommunityBuildingManagerPageFormDTO extends PageFormDTO { + // start + private String customerId; + private String staffId; + /** + * 工作人员所属组织的org_id_path + * 列表数据应查询本组织及下级 + * 网格的全路径,包含网格id + */ + private String orgIdPath; + // end + + + /** + * 姓名 + */ + private String name; + + /** + * 联系电话 + */ + private String phone; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 类型:0楼长;1单元长 + */ + private String type; + + /** + * 所属区县id;取名字关联customer_agency + */ + private String districtId; + + /** + * 所属街道id;取名字关联customer_agency + */ + private String streetId; + + /** + * 所属社区id;取名字关联customer_agency + */ + private String communityId; + + /** + * 所属网格id;取名字关联customer_grid + */ + private String gridId; + + /** + * 所属小区id + */ + private String viliageId; + + /** + * 所属楼栋id + */ + private String buildingId; + + /** + * 所属单元id; 单元长时必填此列 + */ + private String unitId; +} + diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/CommunityLoginFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/CommunityLoginFormDTO.java index 5fc00d0691..6ca6168fa4 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/CommunityLoginFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/CommunityLoginFormDTO.java @@ -1,10 +1,12 @@ package com.epmet.dto.form.yt; import com.epmet.commons.tools.dto.form.PageFormDTO; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; +import javax.validation.constraints.NotBlank; import java.util.Date; /** @@ -14,9 +16,14 @@ import java.util.Date; */ @Data public class CommunityLoginFormDTO extends PageFormDTO { + public interface StreetTotalShowGroup extends CustomerClientShowGroup { + } + + /** * 所选择的组织id */ + @NotBlank(message = "请选择区县",groups = StreetTotalShowGroup.class) private String orgId; /** @@ -37,5 +44,11 @@ public class CommunityLoginFormDTO extends PageFormDTO { @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss") private Date endDate; + + /** + * exclude_zero:不展示登录次数为0的社区 + * all:全部展示 + */ + private String dataRange; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java index f95c6349a4..7ca182856f 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java @@ -137,4 +137,30 @@ public class AgencysResultDTO implements Serializable { private String remark; private String coordinates; + + /** + * 村居/社区书记姓名 + */ + private String secretaryName; + /** + * 村居/社区书记电话 + */ + private String secretaryMobile; + /** + * 值班电话 + */ + private String dutyMobile; + /** + * 统一社会信用代码 + */ + private String unifiedSocialCreditCode; + /** + * 统一社会信用代码证书(图片附件) + */ + private String unifiedSocialCreditCodeCertificate; + + /** + * 详细地址 + */ + private String fullAddress; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityBuildingManagerDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityBuildingManagerDTO.java new file mode 100644 index 0000000000..8022d3334c --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityBuildingManagerDTO.java @@ -0,0 +1,115 @@ +package com.epmet.dto.result; + +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; + + +/** + * 楼长单元长信息表(烟台) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-06 + */ +@Data +public class CommunityBuildingManagerDTO implements Serializable { + + private static final long serialVersionUID = -2526419541953300212L; + public interface AddShowGroup extends CustomerClientShowGroup { + } + + public interface UpdateShowGroup extends CustomerClientShowGroup { + } + /** + * 主键(烟台需求) + */ + @NotBlank(message ="id不能为空" ,groups = {UpdateShowGroup.class}) + private String id; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 姓名 + */ + @Length(max = 50,message = "姓名最多输入50字",groups = {AddShowGroup.class,UpdateShowGroup.class}) + @NotBlank(message ="姓名不能为空" ,groups = {AddShowGroup.class,UpdateShowGroup.class}) + private String name; + + /** + * 联系电话 + */ + @Length(max = 50,message = "联系电话最多输入50字",groups = {AddShowGroup.class,UpdateShowGroup.class}) + @NotBlank(message ="联系电话不能为空" ,groups = {AddShowGroup.class,UpdateShowGroup.class}) + private String phone; + + /** + * 身份证号 + */ + @Length(max = 50,message = "身份证号最多输入50字",groups = {AddShowGroup.class,UpdateShowGroup.class}) + @NotBlank(message ="身份证号不能为空" ,groups = {AddShowGroup.class,UpdateShowGroup.class}) + private String idCard; + + /** + * 类型:0楼长;1单元长 + */ + @NotBlank(message ="类型不能为空" ,groups = {AddShowGroup.class,UpdateShowGroup.class}) + private String type; + private String typeName; + + /** + * 所属区县id;取名字关联customer_agency + */ + @NotBlank(message ="所属区县不能为空" ,groups = {AddShowGroup.class,UpdateShowGroup.class}) + private String districtId; + + /** + * 所属街道id;取名字关联customer_agency + */ + @NotBlank(message ="所属街道不能为空" ,groups = {AddShowGroup.class,UpdateShowGroup.class}) + private String streetId; + + /** + * 所属社区id;取名字关联customer_agency + */ + @NotBlank(message ="所属社区不能为空" ,groups = {AddShowGroup.class,UpdateShowGroup.class}) + private String communityId; + + /** + * 所属网格id;取名字关联customer_grid + */ + @NotBlank(message ="所属网格不能为空" ,groups = {AddShowGroup.class,UpdateShowGroup.class}) + private String gridId; + private String gridName; + + /** + * 网格的全路径,包含网格id + */ + private String orgIdPath; + + /** + * 所属小区id + */ + @NotBlank(message ="所属小区不能为空" ,groups = {AddShowGroup.class,UpdateShowGroup.class}) + private String viliageId; + private String viliageName; + + /** + * 所属楼栋id + */ + @NotBlank(message ="楼栋不能为空" ,groups = {AddShowGroup.class,UpdateShowGroup.class}) + private String buildingId; + private String buildingName; + + /** + * 所属单元id + */ + private String unitId; + private String unitName; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcBulidingDetailDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcBulidingDetailDTO.java index 10e8e09477..590be5782d 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcBulidingDetailDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcBulidingDetailDTO.java @@ -121,4 +121,16 @@ public class IcBulidingDetailDTO implements Serializable { */ private Integer realPerson; + /** + * 烟台需求:楼长身份证号 + */ + private String buildingLeaderIdCard; + + /** + * 烟台需求:类型:0楼长;1单元长 + */ + private String buildingLeaderType; + + private String buildingLeaderTypeName; + } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcHouseListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcHouseListResultDTO.java index 03346cb6fc..940d85b4a4 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcHouseListResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcHouseListResultDTO.java @@ -89,5 +89,9 @@ public class IcHouseListResultDTO implements Serializable { */ private String houseCode; + private String area; + + private String floor; + } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcNeighborHoodDetailDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcNeighborHoodDetailDTO.java index 2ed20afbfa..11bcd918c8 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcNeighborHoodDetailDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcNeighborHoodDetailDTO.java @@ -107,5 +107,24 @@ public class IcNeighborHoodDetailDTO { * 二维码地址 */ private String qrcodeUrl; + + private String viliageTypeName; + + private String area; + + private String openTypeName; + + private String buildYear; + + /** + * 烟台需求:自然村/小区 + */ + private String viliageType; + + /** + * 烟台需求:开放类型 + */ + private String openType; + } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcNeighborHoodResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcNeighborHoodResultDTO.java index d775552bbf..112ace5fbf 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcNeighborHoodResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcNeighborHoodResultDTO.java @@ -28,4 +28,12 @@ public class IcNeighborHoodResultDTO extends PageFormDTO { private String propertyId; private String agencyName; private String longitude; + + private String viliageTypeName; + + private String area; + + private String openTypeName; + + private String buildYear; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInitResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInitResultDTO.java index 87b641b564..90e325a2f1 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInitResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInitResultDTO.java @@ -55,4 +55,33 @@ public class StaffInitResultDTO implements Serializable { * xxx-xxx */ private String agencyName; + + + /** + * 烟台需求:党组织职务 + */ + private String partyPosition; + + /** + * 烟台需求:村居委员职务 + */ + private String viliagePosition; + + /** + * 烟台需求:工作职责 + */ + private String duty; + + /** + * 烟台需求:备注 + */ + private String remark; + /** + * 文化程度 + */ + private String culture; + + private String address; + + } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/CommunityBuildingManagerResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/CommunityBuildingManagerResultDTO.java new file mode 100644 index 0000000000..791c4d80da --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/CommunityBuildingManagerResultDTO.java @@ -0,0 +1,137 @@ +package com.epmet.dto.result.yt; + +import com.alibaba.excel.annotation.ExcelIgnore; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.Data; + +import java.io.Serializable; + + +/** + * 楼长单元长信息表(烟台) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-06 + */ +@Data +public class CommunityBuildingManagerResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键(烟台需求) + */ + @ExcelIgnore + private String id; + + /** + * 客户Id customer.id + */ + @ExcelIgnore + private String customerId; + + /** + * 姓名 + */ + @ExcelProperty(value = "姓名") + @ColumnWidth(20) + private String name; + + /** + * 联系电话 + */ + @ExcelProperty(value = "联系电话") + @ColumnWidth(25) + private String phone; + + /** + * 身份证号 + */ + @ExcelProperty(value = "身份证号") + @ColumnWidth(30) + private String idCard; + + /** + * 类型:0楼长;1单元长 + */ + @ExcelIgnore + private String type; + + @ExcelProperty(value = "类型") + @ColumnWidth(20) + private String typeName; + + /** + * 所属区县id;取名字关联customer_agency + */ + @ExcelIgnore + private String districtId; + @ExcelProperty(value = "所属区市") + @ColumnWidth(30) + private String districtName; + /** + * 所属街道id;取名字关联customer_agency + */ + @ExcelIgnore + private String streetId; + @ExcelProperty(value = "所属镇街") + @ColumnWidth(30) + private String streetName; + + /** + * 所属社区id;取名字关联customer_agency + */ + @ExcelIgnore + private String communityId; + @ExcelProperty(value = "所属社区") + @ColumnWidth(30) + private String communityName; + + /** + * 所属网格id;取名字关联customer_grid + */ + @ExcelIgnore + private String gridId; + @ExcelProperty(value = "所属网格") + @ColumnWidth(30) + private String gridName; + + /** + * 网格的全路径,包含网格id + */ + @ExcelIgnore + private String orgIdPath; + + /** + * 所属小区id + */ + @ExcelIgnore + private String viliageId; + @ExcelProperty(value = "所属小区") + @ColumnWidth(30) + private String viliageName; + + /** + * 所属楼栋id + */ + @ExcelIgnore + private String buildingId; + @ExcelProperty(value = "楼栋") + @ColumnWidth(20) + private String buildingName; + + /** + * 所属单元id; 单元长时必填此列 + */ + @ExcelIgnore + private String unitId; + /** + * 所属单元id; 单元长时必填此列 + */ + @ExcelProperty(value = "单元") + @ColumnWidth(20) + private String unitName; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/CommunityLoginResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/CommunityLoginResultDTO.java index e1cb00a765..a8c1e4fb76 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/CommunityLoginResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/CommunityLoginResultDTO.java @@ -1,5 +1,8 @@ package com.epmet.dto.result.yt; +import com.alibaba.excel.annotation.ExcelIgnore; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; import lombok.Data; /** @@ -12,26 +15,36 @@ public class CommunityLoginResultDTO { /** * 组织id */ + @ExcelIgnore private String agencyId; /** * 组织名称 */ + @ColumnWidth(20) + @ExcelProperty(value = "社区名称") private String agencyName; /** * 组织级别(社区级:community, 乡(镇、街道)级:street, 区县级: district, 市级: city 省级:province) */ + @ExcelIgnore private String agencyLevel; /** * 所属街道名称; */ + @ColumnWidth(20) + @ExcelProperty(value = "所属街道") private String streetName; /** * 所属区县名称; */ + @ColumnWidth(20) + @ExcelProperty(value = "所属区县") private String districtName; /** * 登录次数 */ + @ColumnWidth(20) + @ExcelProperty(value = "登录次数") private Integer count; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CommunityBuildingManagerController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CommunityBuildingManagerController.java new file mode 100644 index 0000000000..379af23a48 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CommunityBuildingManagerController.java @@ -0,0 +1,275 @@ +package com.epmet.controller; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.write.metadata.WriteSheet; +import com.alibaba.excel.write.metadata.style.WriteCellStyle; +import com.alibaba.excel.write.style.HorizontalCellStyleStrategy; +import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.feign.ResultDataResolver; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.FileUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.constants.ImportTaskConstants; +import com.epmet.dto.form.yt.CommunityBuildingManagerPageFormDTO; +import com.epmet.dto.result.CommunityBuildingManagerDTO; +import com.epmet.dto.result.ImportTaskCommonResultDTO; +import com.epmet.dto.result.yt.CommunityBuildingManagerResultDTO; +import com.epmet.service.CommunityBuildingManagerService; +import com.epmet.utils.ImportTaskUtils; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.io.IOUtils; +import org.apache.poi.ss.usermodel.IndexedColors; +import org.apache.poi.ss.usermodel.VerticalAlignment; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpHeaders; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintWriter; +import java.net.URLEncoder; +import java.nio.file.Path; +import java.util.Date; +import java.util.List; +import java.util.UUID; + + +/** + * 楼长单元长信息表(烟台) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-06 + */ +@Slf4j +@RestController +@RequestMapping("communityBuildingManager") +public class CommunityBuildingManagerController implements ResultDataResolver { + + @Autowired + private CommunityBuildingManagerService communityBuildingManagerService; + + /** + * 列表分页查询 + * @param formDTO + * @return + */ + @RequestMapping("page") + public Result> page(@LoginUser TokenDto tokenDto, @RequestBody CommunityBuildingManagerPageFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + PageData page = communityBuildingManagerService.page(formDTO); + return new Result>().ok(page); + } + + /** + * 查看详情 + * @param id + * @return + */ + @RequestMapping(value = "detail/{id}",method = {RequestMethod.POST}) + public Result get(@PathVariable("id") String id){ + CommunityBuildingManagerResultDTO data = communityBuildingManagerService.get(id); + return new Result().ok(data); + } + + /** + * 新增楼长/单元长 + * 同步到具体的楼栋 + * @param dto + * @return + */ + @NoRepeatSubmit + @PostMapping("save") + public Result save(@LoginUser TokenDto tokenDto,@RequestBody CommunityBuildingManagerDTO dto){ + dto.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(dto, CommunityBuildingManagerDTO.AddShowGroup.class); + /* //类型:0楼长;1单元长 + if("1".equals(dto.getType())&& StringUtils.isBlank(dto.getUnitId())){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"单元长必须选择所属单元","单元长必须选择所属单元"); + }*/ + communityBuildingManagerService.save(dto); + return new Result(); + } + + /** + * 编辑楼长/单元长 + * 同步到具体的楼栋 + * @param dto + * @return + */ + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody CommunityBuildingManagerDTO dto){ + ValidatorUtils.validateEntity(dto, CommunityBuildingManagerDTO.UpdateShowGroup.class); + /* //类型:0楼长;1单元长 + if("1".equals(dto.getType())&& StringUtils.isBlank(dto.getUnitId())){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"单元长必须选择所属单元","单元长必须选择所属单元"); + }*/ + communityBuildingManagerService.update(dto); + return new Result(); + } + + /** + * 批量删除楼长/单元长 + * 同时清空楼栋表里的信息 + * @param ids + * @return + */ + @PostMapping("delete") + public Result delete(@RequestBody List ids){ + if(!CollectionUtils.isEmpty(ids)){ + communityBuildingManagerService.delete(ids); + } + return new Result(); + } + + /** + * 楼长单元长-下载导入模板 + * @param response + * @throws IOException + */ + @RequestMapping(value = "download-tem", method = {RequestMethod.GET, RequestMethod.POST}) + public void downloadTemplate(HttpServletResponse response) throws IOException { + response.setCharacterEncoding("UTF-8"); + response.addHeader(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, "Content-Disposition"); + //response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.ms-excel"); + response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode("楼长单元长导入模版", "UTF-8") + ".xlsx"); + + InputStream is = this.getClass().getClassLoader().getResourceAsStream("excel/yantai/community_building_manager_import_temp.xlsx"); + try { + ServletOutputStream os = response.getOutputStream(); + IOUtils.copy(is, os); + } finally { + if (is != null) { + is.close(); + } + } + } + + /** + * 楼长单元长-列表导出 + * + * @param tokenDto + * @param formDTO + * @param response + * @return + * @throws IOException + */ + @PostMapping("export") + public void exportCommunityBuildingManager(@LoginUser TokenDto tokenDto, @RequestBody CommunityBuildingManagerPageFormDTO formDTO, HttpServletResponse response) throws IOException { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + ExcelWriter excelWriter = null; + formDTO.setPageNo(NumConstant.ONE); + formDTO.setPageSize(NumConstant.TEN_THOUSAND); + try { + String fileName = "楼长单元长列表导出" + DateUtils.format(new Date()) + ".xlsx"; + WriteCellStyle headWriteCellStyle = new WriteCellStyle(); + headWriteCellStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex()); + WriteCellStyle contentWriteCellStyle = new WriteCellStyle(); + contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER); + HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle); + FreezeAndFilter writeHandler = new FreezeAndFilter(); + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), CommunityBuildingManagerResultDTO.class) + .registerWriteHandler(horizontalCellStyleStrategy) + .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) + .registerWriteHandler(writeHandler).build(); + WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build(); + PageData data = null; + do { + data = communityBuildingManagerService.page(formDTO); + formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE); + excelWriter.write(data.getList(), writeSheet); + } while (org.apache.commons.collections4.CollectionUtils.isNotEmpty(data.getList()) && data.getList().size() == formDTO.getPageSize()); + } catch (EpmetException e) { + response.reset(); + response.setCharacterEncoding("UTF-8"); + response.setHeader("content-type", "application/json; charset=UTF-8"); + PrintWriter printWriter = response.getWriter(); + Result result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), e.getMsg()); + printWriter.write(JSON.toJSONString(result)); + printWriter.close(); + } catch (Exception e) { + log.error("楼长单元长导出异常export exception", e); + } finally { + if (excelWriter != null) { + excelWriter.finish(); + } + } + } + + /** + * 导入excel + * + * @return + */ + @PostMapping("import") + public Result importExcel(@LoginUser TokenDto tokenDto,@RequestPart("file") MultipartFile file) { + // 只有社区级账号可以导入 + communityBuildingManagerService.checkImportPermission(tokenDto.getCustomerId(),tokenDto.getUserId()); + + // 1.暂存文件 + String originalFilename = file.getOriginalFilename(); + String extName = originalFilename.substring(originalFilename.lastIndexOf(".")); + + Path fileSavePath; + try { + Path importPath = FileUtils.getAndCreateDirUnderEpmetFilesDir(ImportTaskConstants.COMMUNITY_BUILDING_MANAGER, "import"); + fileSavePath = importPath.resolve(UUID.randomUUID().toString().concat(extName)); + } catch (IOException e) { + String errorMsg = ExceptionUtils.getErrorStackTrace(e); + log.error("【楼长单元长导入】创建临时存储文件失败:{}", errorMsg); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "文件上传失败", "文件上传失败"); + } + + InputStream is = null; + FileOutputStream os = null; + + try { + is = file.getInputStream(); + os = new FileOutputStream(fileSavePath.toString()); + IOUtils.copy(is, os); + } catch (Exception e) { + log.error(ImportTaskConstants.COMMUNITY_BUILDING_MANAGER + "表 importExcel exception", e); + } finally { + org.apache.poi.util.IOUtils.closeQuietly(is); + org.apache.poi.util.IOUtils.closeQuietly(os); + } + + // 2.生成导入任务记录 + ImportTaskCommonResultDTO rstData = getResultDataOrThrowsException( + ImportTaskUtils.createImportTask(originalFilename, ImportTaskConstants.COMMUNITY_BUILDING_MANAGER), + ServiceConstant.EPMET_COMMON_SERVICE, + EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), + "楼长单元长导入excel错误", + "楼长单元长导入excel错误"); + + // 3.执行导入 + communityBuildingManagerService.execAsyncExcelImport(fileSavePath, rstData.getTaskId()); + return new Result(); + } + + + + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index e0d4f9f644..fad4233d80 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -19,6 +19,9 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.commons.tools.enums.OrgLevelEnum; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; @@ -41,6 +44,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; @@ -530,14 +534,14 @@ public class CustomerAgencyController { /** * @Description: 返回下级数量统计 - * @param agencyId: + * @param dto: * @Return com.epmet.commons.tools.utils.Result> * @Author: lichao * @Date: 2023/4/7 14:48 */ - @GetMapping("getAgencyCountList") - public Result> getAgencyCountList(@RequestParam String agencyId){ - return new Result>().ok(customerAgencyService.getAgencyCountList(agencyId)); + @PostMapping("getAgencyCountList") + public Result> getAgencyCountList(@RequestBody CommunityCountCensusFormDTO dto){ + return new Result>().ok(customerAgencyService.getAgencyCountList(dto)); } /** @@ -564,4 +568,54 @@ public class CustomerAgencyController { return new Result>().ok(customerAgencyService.getCommunityList(dto)); } + /** + * 返回区县列表 + * @param tokenDto + * @return + */ + @PostMapping("districtList") + public Result> districtList(@LoginUser TokenDto tokenDto){ + Map params=new HashMap<>(); + params.put("CUSTOMER_ID",tokenDto.getCustomerId()); + params.put("LEVEL",OrgLevelEnum.DISTRICT.getCode()); + params.put("PID",null); + return new Result>().ok(customerAgencyService.list(params)); + } + + /** + * 返回街道列表,必传区县 + * @param tokenDto + * @param districtId + * @return + */ + @PostMapping("streetList/{districtId}") + public Result> streetList(@LoginUser TokenDto tokenDto,@PathVariable("districtId")String districtId){ + if(StringUtils.isBlank(districtId)){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"districtId为空","请先选择区县"); + } + Map params=new HashMap<>(); + params.put("CUSTOMER_ID",tokenDto.getCustomerId()); + params.put("LEVEL",OrgLevelEnum.STREET.getCode()); + params.put("PID",districtId); + return new Result>().ok(customerAgencyService.list(params)); + } + + /** + * 返回社区列表,街道必传 + * @param tokenDto + * @param streetId + * @return + */ + @PostMapping("communityList/{streetId}") + public Result> communityList(@LoginUser TokenDto tokenDto,@PathVariable("streetId")String streetId){ + if(StringUtils.isBlank(streetId)){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"streetId为空","请先选择街道"); + } + Map params=new HashMap<>(); + params.put("CUSTOMER_ID",tokenDto.getCustomerId()); + params.put("LEVEL",OrgLevelEnum.COMMUNITY.getCode()); + params.put("PID",streetId); + return new Result>().ok(customerAgencyService.list(params)); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java index da70a814b7..c3c22a644e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java @@ -2,32 +2,60 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.RequirePermission; +import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.enums.RequirePermissionEnum; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.EpmetRequestHolder; +import com.epmet.commons.tools.utils.FileUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.constants.ImportTaskConstants; +import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; +import com.epmet.feign.EpmetCommonServiceOpenFeignClient; +import com.epmet.service.CustomerAgencyService; import com.epmet.service.CustomerStaffAgencyService; import com.epmet.service.DepartmentService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.io.IOUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpHeaders; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.URLEncoder; +import java.nio.file.Path; import java.util.List; +import java.util.UUID; /** * 部门 * * @author sun */ +@Slf4j @RestController @RequestMapping("department") -public class DepartmentController { +public class DepartmentController implements ResultDataResolver { @Autowired private DepartmentService departmentService; @Autowired private CustomerStaffAgencyService customerStaffAgencyService; + @Autowired + private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; + @Autowired + private CustomerAgencyService customerAgencyService; /** * 添加部门人员 @@ -198,6 +226,88 @@ public class DepartmentController { return new Result().ok(departmentService.notSyncDept(formDTO)); } + /** + * 部门导入模板,来源于烟台需求 + * @param response + * @throws IOException + */ + @RequestMapping(value = "yantai/download-tem", method = {RequestMethod.GET, RequestMethod.POST}) + public void downloadTemplate(HttpServletResponse response) throws IOException { + response.setCharacterEncoding("UTF-8"); + response.addHeader(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, "Content-Disposition"); + //response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.ms-excel"); + response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode("部门导入模版", "UTF-8") + ".xlsx"); + + InputStream is = this.getClass().getClassLoader().getResourceAsStream("excel/yantai/yantai_dept_import_tem.xlsx"); + try { + ServletOutputStream os = response.getOutputStream(); + IOUtils.copy(is, os); + } finally { + if (is != null) { + is.close(); + } + } + } + + /** + * 部门导入,来源于烟台需求 + * @param agencyId + * @param file + * @return + */ + @PostMapping("yantai/import") + public Result importExcel(@RequestParam(value = "agencyId",required = true)String agencyId, @RequestPart("file") MultipartFile file) { + CustomerAgencyDTO customerAgencyDTO=customerAgencyService.get(agencyId); + if (null == customerAgencyDTO) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "组织不存在,agencyId" + agencyId, "只有组织才可以导入部门"); + } + + // 1.暂存文件 + String originalFilename = file.getOriginalFilename(); + String extName = originalFilename.substring(originalFilename.lastIndexOf(".")); + + Path fileSavePath; + try { + Path importPath = FileUtils.getAndCreateDirUnderEpmetFilesDir("customer_dept", "import"); + fileSavePath = importPath.resolve(UUID.randomUUID().toString().concat(extName)); + } catch (IOException e) { + String errorMsg = ExceptionUtils.getErrorStackTrace(e); + log.error("【部门导入】创建临时存储文件失败:{}", errorMsg); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "文件上传失败", "文件上传失败"); + } + + InputStream is = null; + FileOutputStream os = null; + + try { + is = file.getInputStream(); + os = new FileOutputStream(fileSavePath.toString()); + IOUtils.copy(is, os); + } catch (Exception e) { + log.error("method exception", e); + } finally { + org.apache.poi.util.IOUtils.closeQuietly(is); + org.apache.poi.util.IOUtils.closeQuietly(os); + } + + // 2.生成导入任务记录 + ImportTaskCommonFormDTO importTaskForm = new ImportTaskCommonFormDTO(); + importTaskForm.setOperatorId(EpmetRequestHolder.getLoginUserId()); + importTaskForm.setBizType(ImportTaskConstants.BIZ_TYPE_IC_ENTERPRISE); + importTaskForm.setOriginFileName(originalFilename); + + ImportTaskCommonResultDTO rstData = getResultDataOrThrowsException(commonServiceOpenFeignClient.createImportTask(importTaskForm), + ServiceConstant.EPMET_COMMON_SERVICE, + EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), + "excel导入部门错误", + "部门导入失败"); + // 3.执行导入 + departmentService.execAsyncExcelImport(fileSavePath, rstData.getTaskId(),agencyId,originalFilename); + return new Result(); + } + + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcEnterpriseController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcEnterpriseController.java index ab66b5aa4f..2df8e63140 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcEnterpriseController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcEnterpriseController.java @@ -147,7 +147,7 @@ public class IcEnterpriseController implements ResultDataResolver { formDTO.setPageNo(NumConstant.ONE); formDTO.setPageSize(NumConstant.TEN_THOUSAND); try { - String fileName = "企事业单位" + DateUtils.format(new Date()) + ".xlsx"; + String fileName = "九小场所" + DateUtils.format(new Date()) + ".xlsx"; // 头的策略 WriteCellStyle headWriteCellStyle = new WriteCellStyle(); // 背景设置为红色 @@ -178,7 +178,7 @@ public class IcEnterpriseController implements ResultDataResolver { printWriter.write(JSON.toJSONString(result)); printWriter.close(); } catch (Exception e) { - log.error("企事业单位导出异常export exception", e); + log.error("九小场所巡查导出异常export exception", e); } finally { if (excelWriter != null) { excelWriter.finish(); @@ -223,7 +223,7 @@ public class IcEnterpriseController implements ResultDataResolver { response.addHeader(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, "Content-Disposition"); //response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.ms-excel"); response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode("企事业单位导入模板", "UTF-8") + ".xlsx"); + response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode("九小场所巡查导入模版", "UTF-8") + ".xlsx"); InputStream is = this.getClass().getClassLoader().getResourceAsStream("excel/enterprise_patrol_import_tem.xlsx"); try { diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java index 43b2d4bd60..2e39b1f211 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java @@ -40,6 +40,7 @@ import com.epmet.dto.form.IcNeighborHoodAddFormDTO; import com.epmet.dto.form.ImportInfoFormDTO; import com.epmet.dto.form.ImportTaskCommonFormDTO; import com.epmet.dto.form.NeighborHoodOptionFormDTO; +import com.epmet.dto.form.yt.ChooseGridFormDTO; import com.epmet.dto.result.BuildingResultDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; @@ -173,6 +174,21 @@ public class IcNeighborHoodController { return new Result>().ok(list); } + /** + * 入参:gridId、agencyId + * 返回当前组织及下级下的所有小区 + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("neighborhood-options-yantai") + public Result> queryNeighborHoodOptionsYanTai(@LoginUser TokenDto tokenDto, @RequestBody NeighborHoodOptionFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + List list=icNeighborHoodService.queryNeighborHoodOptionsYanTai(formDTO); + return new Result>().ok(list); + } + /** * 获取用户组织下小区列表 * @@ -183,8 +199,10 @@ public class IcNeighborHoodController { * @date 2022/8/19 15:56 */ @PostMapping("neighborhoodlist") - public Result> getNeighborhoodList(@LoginUser TokenDto tokenDto, @RequestBody IcNeighborHoodDTO dto) { - return new Result>().ok(icNeighborHoodService.getNeighborhoodList(tokenDto, dto)); + public Result> getNeighborhoodList(@LoginUser TokenDto tokenDto, @RequestBody ChooseGridFormDTO dto) { + ValidatorUtils.validateEntity(dto, ChooseGridFormDTO.AddUserInternalGroup.class); + dto.setCustomerId(tokenDto.getCustomerId()); + return new Result>().ok(icNeighborHoodService.getNeighborhoodList(dto)); } /** diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PropertyManagementController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PropertyManagementController.java index ba24389143..c6bfacb04e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PropertyManagementController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PropertyManagementController.java @@ -17,24 +17,55 @@ package com.epmet.controller; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.write.metadata.WriteSheet; +import com.alibaba.excel.write.metadata.style.WriteCellStyle; +import com.alibaba.excel.write.style.HorizontalCellStyleStrategy; +import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; +import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.FileUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.constants.ImportTaskConstants; import com.epmet.dto.IcPropertyManagementDTO; import com.epmet.dto.form.IcPropertyManagementFormDTO; import com.epmet.dto.result.IcPropertyManagementResultDTO; +import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.service.PropertyManagementService; +import com.epmet.utils.ImportTaskUtils; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.ss.usermodel.IndexedColors; +import org.apache.poi.ss.usermodel.VerticalAlignment; 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 org.springframework.http.HttpHeaders; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintWriter; +import java.net.URLEncoder; +import java.nio.file.Path; +import java.util.*; /** @@ -43,19 +74,21 @@ import java.util.Map; * @author generator generator@elink-cn.com * @since v1.0.0 2021-10-25 */ +@Slf4j @RestController @RequestMapping("propertymanagement") -public class PropertyManagementController { +public class PropertyManagementController implements ResultDataResolver { @Autowired private PropertyManagementService propertyManagementService; + /** - * 分页查询物业列表 + * 物业管理-分页查询物业列表 */ @PostMapping("page") public Result> page(@RequestBody IcPropertyManagementFormDTO formDTO){ - ValidatorUtils.validateEntity(formDTO,IcPropertyManagementFormDTO.PageGroup.class); - return new Result>().ok(propertyManagementService.page(formDTO.getPageNo(),formDTO.getPageSize(),formDTO.getName())); + return new Result>().ok(propertyManagementService.page(formDTO.getPageNo(),formDTO.getPageSize(),formDTO.getName(), + formDTO.getContactName(),formDTO.getContactMobile())); } /** @@ -68,7 +101,7 @@ public class PropertyManagementController { } /** - * 新增物业 + * 物业管理-新增物业 * 新增小区页面,添加小区也调用此接口 * @param tokenDTO * @param formDTO @@ -84,6 +117,11 @@ public class PropertyManagementController { return new Result().ok(map); } + /** + * 物业管理-修改 + * @param formDTO + * @return + */ @PostMapping("update") public Result update(@RequestBody IcPropertyManagementFormDTO formDTO){ //效验数据 @@ -92,12 +130,178 @@ public class PropertyManagementController { return new Result(); } + /** + * 物业管理-删除 + * @param formDTO + * @return + */ @PostMapping("delete") public Result delete(@RequestBody IcPropertyManagementFormDTO formDTO){ //效验数据 ValidatorUtils.validateEntity(formDTO, IcPropertyManagementFormDTO.DeleteGroup.class); - propertyManagementService.delete(formDTO); + propertyManagementService.delete(formDTO.getId()); + return new Result(); + } + + /** + * 物业管理-批量删除 + * + * @param ids + * @return 返回失败的id列表 + */ + @PostMapping("delete-batch") + public Result> deleteBatch(@RequestBody List ids) { + if (CollectionUtils.isNotEmpty(ids)) { + List failedIdList = propertyManagementService.deleteBatch(ids); + if(CollectionUtils.isEmpty(failedIdList)){ + return new Result<>(); + } + Result result = new Result>().ok(failedIdList); + result.setMsg("部门物业删除失败"); + result.setCode(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode()); + return result; + } + return new Result(); + } + + /** + * 物业管理-下载导入模板 + * @param response + * @throws IOException + */ + @RequestMapping(value = "download-tem", method = {RequestMethod.GET, RequestMethod.POST}) + public void downloadTemplate(HttpServletResponse response) throws IOException { + response.setCharacterEncoding("UTF-8"); + response.addHeader(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, "Content-Disposition"); + //response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.ms-excel"); + response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode("物业管理导入模版", "UTF-8") + ".xlsx"); + + InputStream is = this.getClass().getClassLoader().getResourceAsStream("excel/yantai/ic_property_management_temp.xlsx"); + try { + ServletOutputStream os = response.getOutputStream(); + IOUtils.copy(is, os); + } finally { + if (is != null) { + is.close(); + } + } + } + + + /** + * 物业管理-列表导出 + * + * @param tokenDto + * @param formDTO + * @param response + * @return + * @throws IOException + */ + @PostMapping("export") + public void exportIcPropertyManagement(@LoginUser TokenDto tokenDto, @RequestBody IcPropertyManagementFormDTO formDTO, HttpServletResponse response) throws IOException { + formDTO.setCustomerId(tokenDto.getCustomerId()); + ExcelWriter excelWriter = null; + formDTO.setPageNo(NumConstant.ONE); + formDTO.setPageSize(NumConstant.TEN_THOUSAND); + try { + String fileName = "物业管理" + DateUtils.format(new Date()) + ".xlsx"; + WriteCellStyle headWriteCellStyle = new WriteCellStyle(); + headWriteCellStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex()); + WriteCellStyle contentWriteCellStyle = new WriteCellStyle(); + contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER); + HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle); + FreezeAndFilter writeHandler = new FreezeAndFilter(); + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcPropertyManagementDTO.class) + .registerWriteHandler(horizontalCellStyleStrategy) + .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) + .registerWriteHandler(writeHandler).build(); + WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build(); + PageData data = null; + do { + data = propertyManagementService.page(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getName(), formDTO.getContactName(), formDTO.getContactMobile()); + formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE); + excelWriter.write(data.getList(), writeSheet); + } while (CollectionUtils.isNotEmpty(data.getList()) && data.getList().size() == formDTO.getPageSize()); + } catch (EpmetException e) { + response.reset(); + response.setCharacterEncoding("UTF-8"); + response.setHeader("content-type", "application/json; charset=UTF-8"); + PrintWriter printWriter = response.getWriter(); + Result result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), e.getMsg()); + printWriter.write(JSON.toJSONString(result)); + printWriter.close(); + } catch (Exception e) { + log.error("物业管理导出异常export exception", e); + } finally { + if (excelWriter != null) { + excelWriter.finish(); + } + } + } + + /** + * 获取物业详情 + * + * @param id + * @return + */ + @PostMapping("detail/{id}") + public Result getDetail(@PathVariable("id") String id) { + if (StringUtils.isBlank(id)) { + return new Result<>(); + } + return new Result().ok(propertyManagementService.getDetail(id)); + } + + /** + * 导入excel + * + * @return + */ + @PostMapping("import") + public Result importExcel(@RequestPart("file") MultipartFile file) { + // 1.暂存文件 + String originalFilename = file.getOriginalFilename(); + String extName = originalFilename.substring(originalFilename.lastIndexOf(".")); + + Path fileSavePath; + try { + Path importPath = FileUtils.getAndCreateDirUnderEpmetFilesDir(ImportTaskConstants.IC_PROPERTY_MANAGEMENT, "import"); + fileSavePath = importPath.resolve(UUID.randomUUID().toString().concat(extName)); + } catch (IOException e) { + String errorMsg = ExceptionUtils.getErrorStackTrace(e); + log.error("【物业管理导入】创建临时存储文件失败:{}", errorMsg); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "文件上传失败", "文件上传失败"); + } + + InputStream is = null; + FileOutputStream os = null; + + try { + is = file.getInputStream(); + os = new FileOutputStream(fileSavePath.toString()); + IOUtils.copy(is, os); + } catch (Exception e) { + log.error(ImportTaskConstants.IC_PROPERTY_MANAGEMENT + "表 importExcel exception", e); + } finally { + org.apache.poi.util.IOUtils.closeQuietly(is); + org.apache.poi.util.IOUtils.closeQuietly(os); + } + + // 2.生成导入任务记录 + ImportTaskCommonResultDTO rstData = getResultDataOrThrowsException( + ImportTaskUtils.createImportTask(originalFilename, ImportTaskConstants.IC_PROPERTY_MANAGEMENT), + ServiceConstant.EPMET_COMMON_SERVICE, + EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), + "物业管理导入excel错误", + "物业管理导入excel错误"); + + // 3.执行导入 + propertyManagementService.execAsyncExcelImport(fileSavePath, rstData.getTaskId()); return new Result(); } + + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java index bcc8e2f55e..1495e595a0 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java @@ -5,31 +5,54 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.RequirePermission; import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.enums.RequirePermissionEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.EpmetRequestHolder; +import com.epmet.commons.tools.utils.FileUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.constants.ImportTaskConstants; import com.epmet.dto.form.*; import com.epmet.dto.result.*; +import com.epmet.feign.EpmetCommonServiceOpenFeignClient; +import com.epmet.remote.EpmetUserRemoteService; import com.epmet.service.StaffService; +import com.epmet.utils.ImportTaskUtils; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.URLEncoder; +import java.nio.file.Path; import java.util.List; +import java.util.UUID; /** * 组织结构-工作人员 * @author zhaoqifeng * @date 2020/4/23 17:59 */ +@Slf4j @RestController @RequestMapping("staff") -public class StaffController { +public class StaffController implements ResultDataResolver { @Autowired private StaffService staffService; + @Autowired + private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient; /** * 组织首页-工作人员列表 * @param fromDTO @@ -225,6 +248,54 @@ public class StaffController { return staffService.addStaffV2(fromDTO); } + @PostMapping("staffimport") + public Result buildingImportExcel(@RequestParam("file") MultipartFile file,@RequestParam("orgType") String orgType,@RequestParam("orgId") String orgId){ + + String userId = EpmetRequestHolder.getHeader(AppClientConstant.USER_ID); + + // 1.暂存文件 + String originalFilename = file.getOriginalFilename(); + String extName = originalFilename.substring(originalFilename.lastIndexOf(".")); + + Path fileSavePath; + try { + Path importPath = FileUtils.getAndCreateDirUnderEpmetFilesDir("staff", "import"); + fileSavePath = importPath.resolve(UUID.randomUUID().toString().concat(extName)); + } catch (IOException e) { + String errorMsg = ExceptionUtils.getErrorStackTrace(e); + log.error("【核酸检测导入】创建临时存储文件失败:{}", errorMsg); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "文件上传失败", "文件上传失败"); + } + + InputStream is = null; + FileOutputStream os = null; + + try { + is = file.getInputStream(); + os = new FileOutputStream(fileSavePath.toString()); + IOUtils.copy(is, os); + } catch (Exception e) { + log.error("method exception", e); + } finally { + org.apache.poi.util.IOUtils.closeQuietly(is); + org.apache.poi.util.IOUtils.closeQuietly(os); + } + + // 2.生成导入任务记录 + ImportTaskCommonResultDTO rstData = getResultDataOrThrowsException( + ImportTaskUtils.createImportTask(originalFilename, ImportTaskConstants.BIZ_TYPE_CUSTOMER_STAFF), + ServiceConstant.EPMET_COMMON_SERVICE, + EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), + "excel导入客户信息错误", + "导入客户信息失败"); + + // 3.执行导入 + staffService.execAsyncExcelImport(fileSavePath, rstData.getTaskId(),orgType,orgId); + + return new Result(); + + } + /** * 【通讯录】人员添加-平阴 * @author zhy @@ -251,4 +322,34 @@ public class StaffController { return new Result>().ok(staffService.staffOrgList(tokenDto)); } + /** + * 下载工作人员导入excel模板 + * + * @return + */ + @PostMapping("import/download-template") + public void downloadIcResiDownloadTemplate(HttpServletResponse response) { + InputStream is = null; + ServletOutputStream os = null; + try { + os = response.getOutputStream(); + + is = this.getClass().getClassLoader().getResourceAsStream("excel/customer_staff_import_template.xlsx"); + + response.setHeader("Access-Control-Expose-Headers", "Content-Disposition"); + response.setHeader("content-Type", "application/vnd.ms-excel"); + response.setHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode("工作人员导入模板.xlsx", "UTF-8")); + + IOUtils.copy(is, os); + } catch (Exception e) { + String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); + log.error("下载工作人员导入模板失败:{}", errorStackTrace); + + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "下载工作人员导入模板失败"); + } finally { + org.apache.poi.util.IOUtils.closeQuietly(is); + org.apache.poi.util.IOUtils.closeQuietly(os); + } + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffLoginLogController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffLoginLogController.java index c2967945f7..e79c65cd41 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffLoginLogController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffLoginLogController.java @@ -1,12 +1,22 @@ package com.epmet.controller; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.write.metadata.WriteSheet; +import com.alibaba.fastjson.JSON; import com.alibaba.nacos.client.naming.utils.CollectionUtils; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; +import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.yt.CommunityLoginFormDTO; import com.epmet.dto.form.yt.CountActivityFormDTO; import com.epmet.dto.form.yt.LoginLogCountByLevelFormDTO; @@ -16,6 +26,7 @@ import com.epmet.dto.result.yt.LoginLogCountByLevelResultDTO; import com.epmet.excel.yt.AccountActivityExcel; import com.epmet.excel.yt.AccountInactivityExcel; import com.epmet.service.StaffLoginLogService; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -24,6 +35,8 @@ import org.springframework.web.bind.annotation.RestController; import com.epmet.dto.result.yt.AccountActivityInfo; import javax.servlet.http.HttpServletResponse; +import java.io.PrintWriter; +import java.util.Date; import java.util.List; @@ -33,6 +46,7 @@ import java.util.List; * @author generator generator@elink-cn.com * @since v1.0.0 2023-04-04 */ +@Slf4j @RestController @RequestMapping("staffLoginLog") public class StaffLoginLogController { @@ -62,6 +76,46 @@ public class StaffLoginLogController { return new Result>().ok(staffLoginLogService.pageCommunityCount(formDTO)); } + /** + * 下级社区账号登录次数排名 + * + * @return + */ + @PostMapping("community-count-export") + public void communityCount(HttpServletResponse response, @RequestBody CommunityLoginFormDTO formDTO) throws Exception { + ExcelWriter excelWriter = null; + formDTO.setPageNo(NumConstant.ONE); + formDTO.setPageSize(NumConstant.TEN_THOUSAND); + try { + String fileName = "社区级账号登录情况" + DateUtils.format(new Date()) + ".xlsx"; + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), CommunityLoginResultDTO.class).build(); + WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build(); + PageData data = null; + List list = null; + do { + // 默认查询本组织及下级 + data = staffLoginLogService.pageCommunityCount(formDTO); + list = ConvertUtils.sourceToTarget(data.getList(), CommunityLoginResultDTO.class); + formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE); + excelWriter.write(list, writeSheet); + } while (org.apache.commons.collections4.CollectionUtils.isNotEmpty(list) && list.size() == formDTO.getPageSize()); + } catch (EpmetException e) { + response.reset(); + response.setCharacterEncoding("UTF-8"); + response.setHeader("content-type", "application/json; charset=UTF-8"); + PrintWriter printWriter = response.getWriter(); + Result result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), e.getMsg()); + printWriter.write(JSON.toJSONString(result)); + printWriter.close(); + } catch (Exception e) { + log.error("社区级账号登录情况export exception", e); + } finally { + if (excelWriter != null) { + excelWriter.finish(); + } + } + } + /** * 柱状图:下级组织账号登录次数汇总 * @@ -101,6 +155,21 @@ public class StaffLoginLogController { formDTO.getPageNo(), formDTO.getPageSize())); } + /** + * 柱状图点击区县,查看街道,调用此接口 + * 计算的是街道的工作人员+街道下所有社区的人 的总次数 + * @param formDTO + * @return + */ + @PostMapping("streetTotal") + public Result> streetTotal(@RequestBody CommunityLoginFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO,CommunityLoginFormDTO.StreetTotalShowGroup.class); + return new Result>().ok(staffLoginLogService.streetTotal(formDTO.getOrgId(), + formDTO.getStartDate(), + formDTO.getEndDate(), + formDTO.getPageNo(), formDTO.getPageSize())); + } + /*** * 获取当前agencyid下 下级组织活跃情况 * @param formDTO @@ -141,11 +210,9 @@ public class StaffLoginLogController { PageData res = staffLoginLogService.getAccountActivityInfo(formDTO); if (!CollectionUtils.isEmpty(res.getList())) { if("1".equals(formDTO.getIsActivity())){ -// List accountActivityExcels = ConvertUtils.sourceToTarget(res.getList(), AccountActivityExcel.class); - ExcelUtils.exportExcelToTarget(response, null, res.getList(), AccountActivityExcel.class); + ExcelUtils.exportExcelToTarget(response, "社区活跃数据", res.getList(), AccountActivityExcel.class); }else { -// List accountActivityExcels = ConvertUtils.sourceToTarget(res.getList(), AccountInactivityExcel.class); - ExcelUtils.exportExcelToTarget(response, null, res.getList(), AccountInactivityExcel.class); + ExcelUtils.exportExcelToTarget(response, "社区不活跃数据", res.getList(), AccountInactivityExcel.class); } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CommunityBuildingManagerDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CommunityBuildingManagerDao.java new file mode 100644 index 0000000000..e6c19b0d26 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CommunityBuildingManagerDao.java @@ -0,0 +1,50 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.yt.CommunityBuildingManagerResultDTO; +import com.epmet.entity.CommunityBuildingManagerEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 楼长单元长信息表(烟台) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-06 + */ +@Mapper +public interface CommunityBuildingManagerDao extends BaseDao { + /** + * 楼长单元长分页列表查询 + * @param customerId + * @param orgIdPath + * @param name + * @param phone + * @param idCard + * @param type + * @param districtId + * @param streetId + * @param communityId + * @param gridId + * @param viliageId + * @param buildingId + * @param unitId + * @return + */ + List pageList(@Param("customerId") String customerId, + @Param("orgIdPath")String orgIdPath, + @Param("name")String name, + @Param("phone")String phone, + @Param("idCard")String idCard, + @Param("type")String type, + @Param("districtId")String districtId, + @Param("streetId")String streetId, + @Param("communityId")String communityId, + @Param("gridId")String gridId, + @Param("viliageId")String viliageId, + @Param("buildingId")String buildingId, + @Param("unitId")String unitId, + @Param("id")String id); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java index 5639d33894..b17ddb6de6 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java @@ -434,11 +434,13 @@ public interface CustomerAgencyDao extends BaseDao { */ List getAllCommunity(String customerId); - List agencyCount(@Param("pids") String pids); + List agencyCount(@Param("pids") String pids,@Param("timeStart")Date timeStart,@Param("timeEnd")Date timeEnd); - Integer agencyGridCount(@Param("pids") String pids); + Integer communityCount(@Param("pids") String pids); - Integer agencyStaffCount(@Param("pids") String pids); + Integer agencyGridCount(@Param("pids") String pids,@Param("timeStart")Date timeStart,@Param("timeEnd")Date timeEnd); + + Integer agencyStaffCount(@Param("pids") String pids,@Param("timeStart")Date timeStart,@Param("timeEnd")Date timeEnd); Integer getCommunityCount(@Param("pids")String pids,@Param("timeStart")Date timeStart,@Param("timeEnd")Date timeEnd); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java index 4b10e94bf1..f70181c475 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java @@ -19,7 +19,6 @@ package com.epmet.dao; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.IcNeighborHoodDTO; import com.epmet.dto.ImportGeneralDTO; import com.epmet.dto.form.CheckHouseInfoFormDTO; import com.epmet.dto.form.IcBuildingListFormDTO; @@ -240,12 +239,14 @@ public interface IcBuildingDao extends BaseDao { /** * 展示所有楼栋和小区信息 * - * @param dto * @return java.util.List * @author zhy * @date 2022/8/19 17:32 */ - List listBuildingInfo(IcNeighborHoodDTO dto); + List listBuildingInfo(@Param("customerId")String customerId, + @Param("agencyId")String agencyId, + @Param("gridId") String gridId, + @Param("buildingName")String buildingName); /** diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java index 2fd4f25eee..b97fdf0f03 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java @@ -224,4 +224,17 @@ public interface IcNeighborHoodDao extends BaseDao { IcNeighborHoodEntity getNeighborHoodInfoByName(CheckHouseInfoFormDTO formDTO); List queryNeighborHoodOptions(NeighborHoodOptionFormDTO formDTO); + + /** + * label: xxx网格-xxx小区 + * @param customerId + * @param agencyId + * @param gridId + * @param neighborHoodName + * @return + */ + List queryNeighborHoodOptionsYanTai(@Param("customerId") String customerId, + @Param("agencyId") String agencyId, + @Param("gridId") String gridId, + @Param("neighborHoodName") String neighborHoodName); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodPropertyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodPropertyDao.java index 79a71a11b8..55b50486de 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodPropertyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodPropertyDao.java @@ -18,8 +18,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.IcNeighborHoodDTO; import com.epmet.entity.IcNeighborHoodPropertyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 小区物业关系表 @@ -29,5 +33,11 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface IcNeighborHoodPropertyDao extends BaseDao { - + /** + * 查询物业下的小区名称 + * @param propertyId 物业id + * @param agencyId 组织id + * @return 当前物业在 当前组织及下级范围内,管理的小区数量 + */ + List getNeighborHoodList(@Param("propertyId") String propertyId, @Param("agencyId") String agencyId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPropertyManagementDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPropertyManagementDao.java index 915b2f6d7d..1f2c910c1d 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPropertyManagementDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPropertyManagementDao.java @@ -59,5 +59,9 @@ public interface IcPropertyManagementDao extends BaseDao selectPropertyNameList(String neighborhoodId); - List queryList(@Param("customerId") String customerId,@Param("name")String name); + List queryList(@Param("customerId") String customerId, + @Param("name")String name, + @Param("contactName") String contactName, + @Param("contactMobile") String contactMobile, + @Param("agencyId")String agencyId); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffLoginLogDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffLoginLogDao.java index 0db1338752..98879a4204 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffLoginLogDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffLoginLogDao.java @@ -27,12 +27,17 @@ public interface StaffLoginLogDao extends BaseDao { * @param orgId * @param startDate * @param endDate + * @param dataRange exclude_zero:不展示登录次数为0的社区 all:全部展示 * @return */ List pageCommunityCount(@Param("orgId") String orgId, @Param("startDate") Date startDate, - @Param("endDate") Date endDate); + @Param("endDate") Date endDate, + @Param("dataRange")String dataRange); + List selectCommunityCount(@Param("orgId") String orgId, + @Param("startDate") Date startDate, + @Param("endDate") Date endDate); /** * 柱状图:下级组织账号登录次数汇总 * @@ -72,4 +77,10 @@ public interface StaffLoginLogDao extends BaseDao { ActivityTatalInfo selectOneActivityTotal(CountActivityFormDTO formDTO); + + Integer selectLoginTotalByPath(@Param("orgIdPath") String orgIdPath, + @Param("startDate") Date startDate, + @Param("endDate") Date endDate); + + List selectStreetTotal(@Param("orgId") String orgId, @Param("startDate") Date startDate, @Param("endDate") Date endDate); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CommunityBuildingManagerEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CommunityBuildingManagerEntity.java new file mode 100644 index 0000000000..1c769d2926 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CommunityBuildingManagerEntity.java @@ -0,0 +1,89 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +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 2023-05-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("community_building_manager") +public class CommunityBuildingManagerEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + @TableField(fill = FieldFill.INSERT) + private String customerId; + + /** + * 姓名 + */ + private String name; + + /** + * 联系电话 + */ + private String phone; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 类型:0楼长;1单元长 + */ + private String type; + + /** + * 所属区县id;取名字关联customer_agency + */ + private String districtId; + + /** + * 所属街道id;取名字关联customer_agency + */ + private String streetId; + + /** + * 所属社区id;取名字关联customer_agency + */ + private String communityId; + + /** + * 所属网格id;取名字关联customer_grid + */ + private String gridId; + + /** + * 网格的全路径,包含网格id + */ + private String orgIdPath; + + /** + * 所属小区id + */ + private String viliageId; + + /** + * 所属楼栋id + */ + private String buildingId; + + /** + * 所属单元id + */ + private String unitId; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java index a2668ae5fd..236a8c3181 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java @@ -149,4 +149,31 @@ public class CustomerAgencyEntity extends BaseEpmetEntity { */ private String remark; + + /** + * 村居/社区书记姓名 + */ + private String secretaryName; + /** + * 村居/社区书记电话 + */ + private String secretaryMobile; + /** + * 值班电话 + */ + private String dutyMobile; + /** + * 统一社会信用代码 + */ + private String unifiedSocialCreditCode; + /** + * 统一社会信用代码证书(图片附件) + */ + private String unifiedSocialCreditCodeCertificate; + + /** + * 详细地址 + */ + private String fullAddress; + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcBuildingEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcBuildingEntity.java index 801267e2dd..4921e1f878 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcBuildingEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcBuildingEntity.java @@ -92,6 +92,16 @@ public class IcBuildingEntity extends BaseEpmetEntity { */ private String buildingLeaderMobile; + /** + * 烟台需求:楼长身份证号 + */ + private String buildingLeaderIdCard; + + /** + * 烟台需求:类型:0楼长;1单元长 + */ + private String buildingLeaderType; + /** * 中心点位:经度 */ @@ -122,4 +132,6 @@ public class IcBuildingEntity extends BaseEpmetEntity { */ private Integer realPerson; + + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java index 96e993c865..983b876709 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java @@ -136,4 +136,12 @@ public class IcHouseEntity extends BaseEpmetEntity { * 房屋可编辑编码 */ private String coding; + /** + * 所在楼层 + */ + private String floor; + /** + * 面积 + */ + private String area; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcNeighborHoodEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcNeighborHoodEntity.java index 26e278fd16..2d67d4259b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcNeighborHoodEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcNeighborHoodEntity.java @@ -121,4 +121,21 @@ public class IcNeighborHoodEntity extends BaseEpmetEntity { * 二维码地址 */ private String qrcodeUrl; + + /** + * 烟台需求:自然村/小区 + */ + private String viliageType; + /** + * 烟台需求:面积 + */ + private String area; + /** + * 烟台需求:开放类型 + */ + private String openType; + /** + * 烟台需求:建筑年代 + */ + private String buildYear; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPropertyManagementEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPropertyManagementEntity.java index 239fce61cc..81a75f86ec 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPropertyManagementEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPropertyManagementEntity.java @@ -17,6 +17,8 @@ package com.epmet.entity; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; @@ -39,5 +41,15 @@ public class IcPropertyManagementEntity extends BaseEpmetEntity { * 物业名称 */ private String name; + @TableField(fill = FieldFill.INSERT) private String customerId; + /** + * 烟台需求:物业联系人姓名 + */ + private String contactName; + + /** + * 烟台需求:物业联系人电话 + */ + private String contactMobile; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffImportExcelData.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffImportExcelData.java new file mode 100644 index 0000000000..c667472284 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffImportExcelData.java @@ -0,0 +1,75 @@ +package com.epmet.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.util.Date; + +/** + * 核酸检测信息导入excel数据 + */ +@Data +public class CustomerStaffImportExcelData { + + @NotBlank(message = "姓名为必填项") + @ExcelProperty("姓名※") + private String name; + + @NotBlank(message = "手机号为必填项") + @ExcelProperty("联系电话※") + @Length(max = 15, message = "手机号长度不正确,应小于15位") + private String mobile; + + @NotBlank(message = "身份证号为必填项") + @ExcelProperty("身份证号※") + @Length(max = 18, message = "证身份证号长度不正确,应小于18位") + private String idCard; + + @ExcelProperty("村居委员职务") + private String viliagePosition; + + @ExcelProperty("党组织职务") + private String partyPosition; + + @NotBlank(message = "居住地址为必填项") + @ExcelProperty("居住地址※") + private String address; + + @NotBlank(message = "文化程度为必填项") + @ExcelProperty("文化程度※") + private String cultureName; + + @NotBlank(message = "性别为必填项") + @ExcelProperty("性别※") + private String genderName; + + @NotBlank(message = "专兼职为必填项") + @ExcelProperty("专兼职※") + private String workTypeName; + + @NotBlank(message = "工作职责为必填项") + @ExcelProperty("工作职责※") + private String duty; + + @ExcelProperty("备注") + private String remark; + + @Data + public static class RowRemarkMessage { + + @ColumnWidth(60) + @ExcelProperty("姓名") + private String name; + + @ColumnWidth(60) + @ExcelProperty("联系电话") + private String mobile; + + @ColumnWidth(60) + @ExcelProperty("错误信息") + private String errorInfo; + } +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/EnterpriseImportExcelDTO.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/EnterpriseImportExcelDTO.java index becc763ba3..55bbb1d60f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/EnterpriseImportExcelDTO.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/EnterpriseImportExcelDTO.java @@ -5,7 +5,6 @@ import com.alibaba.excel.annotation.write.style.ColumnWidth; import lombok.Data; import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; /** @@ -59,9 +58,9 @@ public class EnterpriseImportExcelDTO { * 4:100人以上】 * 改为手输数字了 */ - @NotNull(message = "规模不能为空") + @NotBlank(message = "规模不能为空") @ExcelProperty(value = "规模") - private Integer scaleTotal; + private String scaleTotal; /** * 场所负责人 @@ -110,7 +109,7 @@ public class EnterpriseImportExcelDTO { @ColumnWidth(20) @ExcelProperty(value = "规模") - private Integer scaleTotal; + private String scaleTotal; @ColumnWidth(20) @ExcelProperty(value = "负责人") diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcBuildingExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcBuildingExcel.java index dbd7f8239b..52e7a2a435 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcBuildingExcel.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcBuildingExcel.java @@ -130,4 +130,10 @@ public class IcBuildingExcel extends ExcelVerifyInfo implements Serializable { @Excel(name = "楼长电话") private String buildingLeaderMobile; + + @Excel(name = "楼长身份证号") + private String buildingLeaderIdCard; + + @Excel(name = "楼长类型") + private String buildingLeaderType; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcNeighborHoodExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcNeighborHoodExcel.java index e9306fa5d7..0406b33490 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcNeighborHoodExcel.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcNeighborHoodExcel.java @@ -18,6 +18,7 @@ package com.epmet.excel; import cn.afterturn.easypoi.excel.annotation.Excel; +import com.alibaba.excel.annotation.ExcelProperty; import com.epmet.util.ExcelVerifyInfo; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; @@ -108,9 +109,27 @@ public class IcNeighborHoodExcel extends ExcelVerifyInfo implements Serializable @Length(max=50,message = "不能超过50个字") private String neighborHoodName; + @Excel(name = "小区/自然村类型") + private String viliageTypeName; + + @Excel(name = "面积") + private String area; + + @Excel(name = "开放类型") + private String openTypeName; + + @Excel(name = "建筑年代") + private String buildYear; + @Excel(name = "关联物业") private String propertyName; + @Excel(name = "物业联系人") + private String propertyUserName; + + @Excel(name = "联系电话") + private String propertyUserMobile; + @Excel(name = "详细地址") @NotBlank(message = "不能为空") private String address; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/handler/CommunityBuildingManagerImportListener.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/handler/CommunityBuildingManagerImportListener.java new file mode 100644 index 0000000000..d496c0b2cb --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/handler/CommunityBuildingManagerImportListener.java @@ -0,0 +1,120 @@ +package com.epmet.excel.handler; + +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.read.listener.ReadListener; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.exception.ValidateException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.ObjectUtil; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.result.CommunityBuildingManagerDTO; +import com.epmet.excel.yt.CommunityBuildingManagerImportExcelData; +import com.epmet.service.impl.CommunityBuildingManagerServiceImpl; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * @Description + * @Author yzm + * @Date 2023/5/9 16:26 + */ +@Slf4j +public class CommunityBuildingManagerImportListener implements ReadListener { + + // 最大条数阈值 + public static final int MAX_THRESHOLD = 200; + private Map gridMap; + private String customerId; + private String staffId; + private String agencyId; + private String districtId; + private String streetId; + private String rediPrex; + private CommunityBuildingManagerServiceImpl communityBuildingManagerService; + // 错误项列表 + private List errorRows = new ArrayList<>(); + // 要插入的数据 + private List excelDataList = new ArrayList<>(); + + public CommunityBuildingManagerImportListener(Map gridMap,String customerId, String staffId, String agencyId, String districtId, String streetId, String rediPrex, CommunityBuildingManagerServiceImpl communityBuildingManagerService) { + this.gridMap=gridMap; + this.customerId = customerId; + this.staffId = staffId; + this.agencyId=agencyId; + this.districtId=districtId; + this.streetId=streetId; + this.rediPrex=rediPrex; + this.communityBuildingManagerService = communityBuildingManagerService; + } + + + @Override + public void invoke(CommunityBuildingManagerImportExcelData data, AnalysisContext analysisContext) { + try { + // log.warn("有数据吗?"+JSON.toJSONString(data)); + // 不能为空先校验数据 + ValidatorUtils.validateEntity(data); + // 去除空格 + ObjectUtil.objectToTrim(data); + + CommunityBuildingManagerDTO communityBuildingManagerDTO = ConvertUtils.sourceToTarget(data, CommunityBuildingManagerDTO.class); + communityBuildingManagerDTO.setCustomerId(customerId); + communityBuildingManagerDTO.setCommunityId(agencyId); + communityBuildingManagerDTO.setType("单元长".equals(data.getTypeName()) ? NumConstant.ONE_STR : NumConstant.ZERO_STR); + excelDataList.add(communityBuildingManagerDTO); + if (excelDataList.size() == MAX_THRESHOLD) { + execPersist(); + } + } catch (Exception e) { + String errorMsg = null; + if (e instanceof ValidateException) { + errorMsg = ((ValidateException) e).getMsg(); + } else if (e instanceof EpmetException) { + errorMsg = ((EpmetException) e).getMsg(); + } else { + errorMsg = "未知错误"; + log.error("【楼长单元长ic_property_management导入】出错:{}", ExceptionUtils.getErrorStackTrace(e)); + } + CommunityBuildingManagerImportExcelData.ErrorRow errorRow = ConvertUtils.sourceToTarget(data, CommunityBuildingManagerImportExcelData.ErrorRow.class); + errorRow.setErrorInfo(errorMsg); + errorRows.add(errorRow); + } + } + + @Override + public void doAfterAllAnalysed(AnalysisContext analysisContext) { + // 最后几条达不到阈值,这里必须再调用一次 + execPersist(); + } + + /** + * 执行持久化 + */ + private void execPersist() { + try { + if (CollectionUtils.isNotEmpty(excelDataList)) { + communityBuildingManagerService.handleImportExcelData(gridMap,customerId,staffId,agencyId, districtId, streetId,rediPrex,excelDataList,this); + } + } finally { + excelDataList.clear(); + } + } + + /** + * 获取错误行 + * + * @return + */ + public List getErrorRows() { + return errorRows; + } + + +} + diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/handler/CustomerStaffImportListener.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/handler/CustomerStaffImportListener.java new file mode 100644 index 0000000000..7a8406eb8f --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/handler/CustomerStaffImportListener.java @@ -0,0 +1,202 @@ +package com.epmet.excel.handler; + +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.read.listener.ReadListener; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.exception.ValidateException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.AddStaffV2FromDTO; +import com.epmet.excel.CustomerStaffImportExcelData; +import com.epmet.service.impl.StaffServiceImpl; +import lombok.Data; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; + +import java.util.ArrayList; +import java.util.List; + +/** + * 核酸检测excel导入监听器 + */ +@Data +@Slf4j +public class CustomerStaffImportListener implements ReadListener { + + /** + * 最大条数阈值 + */ + public static final int MAX_THRESHOLD = 200; + + private String currentUserId; + + private String currentCustomerId; + + private String currentOrgType; + + private String currentOrgId; + + private CustomerStaffImportExcelData dataB; + + + /** + * 数据 + */ + private List datas = new ArrayList<>(); + + /** + * 错误项列表 + */ + private List errorRows = new ArrayList<>(); + /** + * 其他被标记出来的列表列表 + */ + private List otherRows = new ArrayList<>(); + + private StaffServiceImpl staffService; + + public CustomerStaffImportListener(String currentUserId, String currentCustomerId, String currentOrgType,String currentOrgId,StaffServiceImpl staffService) { + this.currentUserId = currentUserId; + this.currentCustomerId = currentCustomerId; + this.staffService = staffService; + this.currentOrgType = currentOrgType; + this.currentOrgId = currentOrgId; + } + + @Override + public void invoke(CustomerStaffImportExcelData data, AnalysisContext context) { + + try { + + dataB = data; + // 先校验数据 + ValidatorUtils.validateEntity(data); + + AddStaffV2FromDTO fromDTO = ConvertUtils.sourceToTarget(data, AddStaffV2FromDTO.class); + + fromDTO.setCustomerId(currentCustomerId); + //因为添加的是工作人员,这里写死吧! + fromDTO.setApp("gov"); + fromDTO.setClient("wxmp"); + //当前登录用户 + fromDTO.setCurrentUserId(currentUserId); + fromDTO.setOrgId(currentOrgId); + fromDTO.setOrgType(currentOrgType); + + if (StringUtils.isNotBlank(data.getWorkTypeName())){ + if (data.getWorkTypeName().equals("专职")){ + fromDTO.setWorkType("fulltime"); + } + if (data.getWorkTypeName().equals("兼职")){ + fromDTO.setWorkType("parttime"); + } + } + + if (StringUtils.isNotBlank(data.getGenderName())){ + if (data.getGenderName().equals("男")){ + fromDTO.setGender(1); + } + if (data.getGenderName().equals("女")){ + fromDTO.setGender(2); + } + if (data.getGenderName().equals("未知")){ + fromDTO.setGender(0); + } + } + //0小学及文盲,1初中,2高中,3大专,4本科,5硕士,6博士,7中专 + if (StringUtils.isNotBlank(data.getCultureName())){ + if (data.getCultureName().equals("小学及文盲")){ + fromDTO.setCulture("0"); + } + if (data.getCultureName().equals("初中")){ + fromDTO.setCulture("1"); + } + if (data.getCultureName().equals("高中")){ + fromDTO.setCulture("2"); + } + if (data.getCultureName().equals("大专")){ + fromDTO.setCulture("3"); + } + if (data.getCultureName().equals("本科")){ + fromDTO.setCulture("4"); + } + if (data.getCultureName().equals("硕士")){ + fromDTO.setCulture("5"); + } + if (data.getCultureName().equals("博士")){ + fromDTO.setCulture("6"); + } + } + + + datas.add(fromDTO); + + if (datas.size() == MAX_THRESHOLD) { + execPersist(); + } + } catch (Exception e) { + String errorMsg = null; + if (e instanceof ValidateException) { + errorMsg = ((ValidateException) e).getMsg(); + } else { + log.error("【客户信息导入】出错:{}", e.getStackTrace()); + errorMsg = ((EpmetException)e).getInternalMsg(); + log.error("【客户信息导入】出错:{}", ExceptionUtils.getErrorStackTrace(e)); + } + + CustomerStaffImportExcelData.RowRemarkMessage errorRow = new CustomerStaffImportExcelData.RowRemarkMessage(); + errorRow.setErrorInfo(errorMsg); + errorRow.setName(data.getName()); + errorRow.setMobile(data.getMobile()); + errorRows.add(errorRow); + } + } + + @Override + public void doAfterAllAnalysed(AnalysisContext context) { + // 最后几条达不到阈值,这里必须再调用一次 + try { + execPersist(); + }catch (Exception e) { + String errorMsg = null; + if (e instanceof ValidateException) { + errorMsg = ((ValidateException) e).getMsg(); + } else { + log.error("【客户信息导入】出错:{}", e.getStackTrace()); + errorMsg = ((EpmetException)e).getInternalMsg(); + log.error("【客户信息导入】出错:{}", ExceptionUtils.getErrorStackTrace(e)); + } + + CustomerStaffImportExcelData.RowRemarkMessage errorRow = new CustomerStaffImportExcelData.RowRemarkMessage(); + errorRow.setErrorInfo(errorMsg); + errorRow.setName(dataB.getName()); + errorRow.setMobile(dataB.getMobile()); + errorRows.add(errorRow); + } + + } + + /** + * 执行持久化 + */ + private void execPersist() { + try { + if (datas != null && datas.size() > 0) { +// icNatService.batchPersist(datas, this); + staffService.exportAdd(datas,this); + } + }finally { + datas.clear(); + } + } + + /** + * 获取错误行 + * @return + */ + public List getErrorRows() { + return errorRows; + } +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/handler/DeptExcelImportListener.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/handler/DeptExcelImportListener.java new file mode 100644 index 0000000000..5419175bff --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/handler/DeptExcelImportListener.java @@ -0,0 +1,112 @@ +package com.epmet.excel.handler; + +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.read.listener.ReadListener; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.entity.CustomerAgencyEntity; +import com.epmet.entity.CustomerDepartmentEntity; +import com.epmet.excel.yt.DeptImportExcelDTO; +import com.epmet.service.CustomerDepartmentService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; + +import java.util.ArrayList; +import java.util.List; + +/** + * @Description + * @Author yzm + * @Date 2023/4/26 16:11 + */ +@Slf4j +public class DeptExcelImportListener implements ReadListener { + //最大条数阈值 + public static final int MAX_THRESHOLD = 200; + private String customerId; + private String staffId; + private CustomerAgencyEntity agencyEntity; + /** + * 当前操作用户 + */ + //要插入的数据 + private List insertDatas = new ArrayList<>(); + //错误项列表 + private List errorRows = new ArrayList<>(); + private CustomerDepartmentService departmentService; + public DeptExcelImportListener(String loginUserCustomerId, String loginUserId, CustomerAgencyEntity agencyEntity, CustomerDepartmentService departmentService) { + this.customerId = loginUserCustomerId; + this.staffId = loginUserId; + this.agencyEntity = agencyEntity; + this.departmentService = departmentService; + } + + @Override + public void invoke(DeptImportExcelDTO data, AnalysisContext analysisContext) { + try { + ValidatorUtils.validateEntity(data); + //当前组织下,是否存在该部门 + departmentService.checkUnqiueName(agencyEntity.getId(),data.getDepartmentName(),null); + CustomerDepartmentEntity entity = ConvertUtils.sourceToTarget(data, CustomerDepartmentEntity.class); + entity.setCustomerId(customerId); + entity.setAgencyId(agencyEntity.getId()); + entity.setCreatedBy(staffId); + entity.setUpdatedBy(staffId); + entity.setTotalUser(NumConstant.ZERO); + entity.setAreaCode(StringUtils.isNotBlank(agencyEntity.getAreaCode())?agencyEntity.getAreaCode(): StrConstant.EPMETY_STR); + entity.setDepartmentDuty(StrConstant.EPMETY_STR); + entity.setDeptType("duty"); + insertDatas.add(entity); + if (insertDatas.size() == MAX_THRESHOLD) { + execPersist(); + } + } catch (Exception e) { + String errorMsg = null; + if(e instanceof EpmetException){ + errorMsg=((EpmetException) e).getMsg(); + }else { + errorMsg = "未知错误"; + log.error("【部门导入】出错:{}", ExceptionUtils.getErrorStackTrace(e)); + } + DeptImportExcelDTO.ErrorRow errorRow = ConvertUtils.sourceToTarget(data,DeptImportExcelDTO.ErrorRow.class); + errorRow.setErrorInfo(errorMsg); + errorRows.add(errorRow); + } + } + + @Override + public void doAfterAllAnalysed(AnalysisContext context) { + // 最后几条达不到阈值,这里必须再调用一次 + execPersist(); + } + + /** + * 执行持久化 + */ + private void execPersist() { + try { + if (CollectionUtils.isNotEmpty(insertDatas)) { + departmentService.insertBatch(insertDatas); + } + + } finally { + insertDatas.clear(); + } + } + + /** + * 获取错误行 + * + * @return + */ + public List getErrorRows() { + return errorRows; + } + +} + diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/handler/IcEnterpriseExcelImportListener.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/handler/IcEnterpriseExcelImportListener.java index 5495dd6ff6..99a76ad94e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/handler/IcEnterpriseExcelImportListener.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/handler/IcEnterpriseExcelImportListener.java @@ -5,6 +5,8 @@ import com.alibaba.excel.read.listener.ReadListener; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.ValidateException; import com.epmet.commons.tools.utils.ConvertUtils; @@ -67,11 +69,16 @@ public class IcEnterpriseExcelImportListener implements ReadListener { + + // 最大条数阈值 + public static final int MAX_THRESHOLD = 200; + private String currentCustomerId; + private IcPropertyManagementServiceImpl propertyManagementService; + // 错误项列表 + private List errorRows = new ArrayList<>(); + // 要插入的数据 + private List insertDatas = new ArrayList<>(); + private List updateDatas = new ArrayList<>(); + + public IcPropertyManagementImportListener(String customerId, IcPropertyManagementServiceImpl propertyManagementService) { + this.currentCustomerId = customerId; + this.propertyManagementService = propertyManagementService; + } + + @Override + public void invoke(IcPropertyManagementImportExcelData data, AnalysisContext analysisContext) { + try { + // log.warn("有数据吗?"+JSON.toJSONString(data)); + // 不能为空先校验数据 + ValidatorUtils.validateEntity(data); + // 去除空格 + ObjectUtil.objectToTrim(data); + //物业名称唯一 + IcPropertyManagementEntity origin=propertyManagementService.getByName(currentCustomerId, data.getName()); + + IcPropertyManagementEntity propertyManagementEntity = ConvertUtils.sourceToTarget(data, IcPropertyManagementEntity.class); + propertyManagementEntity.setCustomerId(currentCustomerId); + if (null != origin) { + origin.setContactMobile(data.getContactMobile()); + origin.setContactName(data.getContactName()); + updateDatas.add(origin); + } else { + insertDatas.add(propertyManagementEntity); + } + + if (insertDatas.size() == MAX_THRESHOLD) { + execPersist(); + } + if (updateDatas.size() == MAX_THRESHOLD) { + execPersist(); + } + } catch (Exception e) { + String errorMsg = null; + if (e instanceof ValidateException) { + errorMsg = ((ValidateException) e).getMsg(); + } else if (e instanceof EpmetException) { + errorMsg = ((EpmetException) e).getInternalMsg(); + } else { + errorMsg = "未知错误"; + log.error("【物业管理表ic_property_management导入】出错:{}", ExceptionUtils.getErrorStackTrace(e)); + } + IcPropertyManagementImportExcelData.ErrorRow errorRow = ConvertUtils.sourceToTarget(data, IcPropertyManagementImportExcelData.ErrorRow.class); + errorRow.setErrorInfo(errorMsg); + errorRows.add(errorRow); + } + + } + + @Override + public void doAfterAllAnalysed(AnalysisContext analysisContext) { + // 最后几条达不到阈值,这里必须再调用一次 + execPersist(); + } + + /** + * 执行持久化 + */ + private void execPersist() { + try { + if (CollectionUtils.isNotEmpty(insertDatas)) { + propertyManagementService.insertBatch(insertDatas); + } + + if (CollectionUtils.isNotEmpty(updateDatas)) { + propertyManagementService.updateBatchById(updateDatas); + } + } finally { + insertDatas.clear(); + updateDatas.clear(); + } + } + + /** + * 获取错误行 + * + * @return + */ + public List getErrorRows() { + return errorRows; + } +} + diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/yt/CommunityBuildingManagerImportExcelData.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/yt/CommunityBuildingManagerImportExcelData.java new file mode 100644 index 0000000000..469532c38f --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/yt/CommunityBuildingManagerImportExcelData.java @@ -0,0 +1,116 @@ +package com.epmet.excel.yt; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; + +/** + * @Description + * @Author yzm + * @Date 2023/5/9 16:13 + */ +@Data +public class CommunityBuildingManagerImportExcelData { + + /** + * 姓名 + */ + @ExcelProperty(value = "*姓名") + @Length(max = 50, message = "姓名最多输入50字") + @NotBlank(message = "姓名不能为空") + private String name; + + /** + * 联系电话 + */ + @ExcelProperty(value = "*联系电话") + @Length(max = 50, message = "联系电话最多输入50字") + @NotBlank(message = "联系电话不能为空") + private String phone; + + /** + * 身份证号 + */ + @ExcelProperty(value = "*身份证号") + @Length(max = 50, message = "身份证号最多输入50字") + @NotBlank(message = "身份证号不能为空") + private String idCard; + + /** + * 类型:0楼长;1单元长 + */ + @ExcelProperty(value = "*类型") + @NotBlank(message = "类型不能为空") + private String typeName; + + @ExcelProperty(value = "*所属网格") + @NotBlank(message = "所属网格不能为空") + private String gridName; + + @ExcelProperty(value = "*所属小区") + @NotBlank(message = "所属小区不能为空") + private String viliageName; + + @ExcelProperty(value = "*楼栋") + @NotBlank(message = "楼栋不能为空") + private String buildingName; + + @ExcelProperty(value = "单元") + private String unitName; + + @Data + public static class ErrorRow { + /** + * 姓名 + */ + @ExcelProperty(value = "*姓名") + @ColumnWidth(20) + private String name; + + /** + * 联系电话 + */ + @ExcelProperty(value = "*联系电话") + @ColumnWidth(20) + private String phone; + + /** + * 身份证号 + */ + @ExcelProperty(value = "*身份证号") + @ColumnWidth(25) + private String idCard; + + /** + * 类型:0楼长;1单元长 + */ + @ExcelProperty(value = "*类型") + @ColumnWidth(15) + private String typeName; + + @ExcelProperty(value = "*所属网格") + @ColumnWidth(30) + private String gridName; + + @ExcelProperty(value = "*所属小区") + @ColumnWidth(30) + private String viliageName; + + @ExcelProperty(value = "*楼栋") + @ColumnWidth(20) + private String buildingName; + + @ExcelProperty(value = "单元") + @ColumnWidth(20) + private String unitName; + + @ColumnWidth(60) + @ExcelProperty("错误信息") + private String errorInfo; + } + +} + diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/yt/DeptImportExcelDTO.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/yt/DeptImportExcelDTO.java new file mode 100644 index 0000000000..302fe9afd7 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/yt/DeptImportExcelDTO.java @@ -0,0 +1,72 @@ +package com.epmet.excel.yt; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; + +/** + * @Description + * @Author yzm + * @Date 2023/4/26 15:59 + */ +@Data +public class DeptImportExcelDTO { + /** + * 部门名称 + */ + @NotBlank(message = "部门名称不能为空") + @Length(max = 50, message = "部门名称不能超过50个字") + @ExcelProperty(value = "*部门名称") + private String departmentName; + + /** + * 组织编码 + */ + @ExcelProperty(value = "组织编码") + private String code; + /** + * 负责人 + */ + @ExcelProperty(value = "联系人") + private String contacts; + /** + * 联系电话 + */ + @ExcelProperty(value = "联系电话") + private String mobile; + + @Data + public static class ErrorRow { + @ColumnWidth(50) + @ExcelProperty(value = "*部门名称") + private String departmentName; + + /** + * 组织编码 + */ + @ColumnWidth(20) + @ExcelProperty(value = "组织编码") + private String code; + /** + * 负责人 + */ + @ColumnWidth(20) + @ExcelProperty(value = "联系人") + private String contacts; + + /** + * 联系电话 + */ + @ColumnWidth(20) + @ExcelProperty(value = "联系电话") + private String mobile; + + @ColumnWidth(50) + @ExcelProperty("错误信息") + private String errorInfo; + } +} + diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/yt/IcPropertyManagementImportExcelData.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/yt/IcPropertyManagementImportExcelData.java new file mode 100644 index 0000000000..7a318bbad7 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/yt/IcPropertyManagementImportExcelData.java @@ -0,0 +1,61 @@ +package com.epmet.excel.yt; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * @Description + * @Author yzm + * @Date 2023/5/8 14:24 + */ +@Data +public class IcPropertyManagementImportExcelData { + /** + * 物业名称 + */ + @NotBlank(message = "物业名称必填") + @ExcelProperty(value = "*物业名称") + private String name; + + /** + * 烟台需求:物业联系人姓名 + */ + @ExcelProperty(value = "物业联系人") + private String contactName; + + /** + * 烟台需求:物业联系人电话 + */ + @ExcelProperty(value = "联系电话") + private String contactMobile; + + @Data + public static class ErrorRow { + /** + * 物业名称 + */ + @ExcelProperty(value = "*物业名称") + private String name; + + /** + * 烟台需求:物业联系人姓名 + */ + @ExcelProperty(value = "物业联系人") + private String contactName; + + /** + * 烟台需求:物业联系人电话 + */ + @ExcelProperty(value = "联系电话") + private String contactMobile; + + + @ColumnWidth(60) + @ExcelProperty("错误信息") + private String errorInfo; + } +} + diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/BuildingInfoModel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/BuildingInfoModel.java index 2339587a1f..38df15fe5d 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/BuildingInfoModel.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/BuildingInfoModel.java @@ -44,6 +44,12 @@ public class BuildingInfoModel { @ExcelProperty(value = "楼长电话") private String buildingLeaderMobile; + @ExcelProperty(value = "楼长身份证号") + private String buildingLeaderIdCard; + + @ExcelProperty(value = "楼长类型") + private String buildingLeaderType; + @ExcelProperty(value = "排序") private BigDecimal sort; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/HouseInfoModel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/HouseInfoModel.java index 0e5edb21f3..c78e46633f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/HouseInfoModel.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/HouseInfoModel.java @@ -37,6 +37,12 @@ public class HouseInfoModel { @ExcelProperty(value = "房屋类型") private String houseType; + @ExcelProperty(value = "所在楼层") + private String floor; + + @ExcelProperty(value = "面积(平方米)") + private String area; + @ExcelProperty(value = "房屋用途") private String purpose; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportNeighborHoodInfoListener.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportNeighborHoodInfoListener.java index 5bacafb1fe..f4fe33adb2 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportNeighborHoodInfoListener.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportNeighborHoodInfoListener.java @@ -185,6 +185,13 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener { IcPropertyManagementEntity e = new IcPropertyManagementEntity(); e.setName(name); + for (ImportGeneralDTO importGeneralDTO : notExistList) { + if (importGeneralDTO.getPropertyName().equals(name)){ + e.setContactMobile(importGeneralDTO.getPropertyUserMobile()); + e.setContactName(importGeneralDTO.getPropertyUserName()); + break; + } + } propertyManagementEntities.add(e); }); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/NeighborHoodInfoModel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/NeighborHoodInfoModel.java index 63260ee190..374f367a2e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/NeighborHoodInfoModel.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/NeighborHoodInfoModel.java @@ -21,9 +21,27 @@ public class NeighborHoodInfoModel { @ExcelProperty(value = "小区名称") private String neighborHoodName; + @ExcelProperty(value = "小区/自然村类型") + private String viliageTypeName; + + @ExcelProperty(value = "面积") + private String area; + + @ExcelProperty(value = "开放类型") + private String openTypeName; + + @ExcelProperty(value = "建筑年代") + private String buildYear; + @ExcelProperty(value = "关联物业") private String propertyName; + @ExcelProperty(value = "物业联系人") + private String propertyUserName; + + @ExcelProperty(value = "联系电话") + private String propertyUserMobile; + @ExcelProperty(value = "详细地址") private String address; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CommunityBuildingManagerService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CommunityBuildingManagerService.java new file mode 100644 index 0000000000..1e90100266 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CommunityBuildingManagerService.java @@ -0,0 +1,77 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.form.yt.CommunityBuildingManagerPageFormDTO; +import com.epmet.dto.result.CommunityBuildingManagerDTO; +import com.epmet.dto.result.yt.CommunityBuildingManagerResultDTO; +import com.epmet.entity.CommunityBuildingManagerEntity; + +import java.nio.file.Path; +import java.util.List; + +/** + * 楼长单元长信息表(烟台) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-06 + */ +public interface CommunityBuildingManagerService extends BaseService { + + /** + * 默认分页 + * + * @param formDTO + * @return PageData + * @author generator + * @date 2023-05-06 + */ + PageData page(CommunityBuildingManagerPageFormDTO formDTO); + + /** + * 查看详情 + * + * @param id + * @return CommunityBuildingManagerResultDTO + * @author generator + * @date 2023-05-06 + */ + CommunityBuildingManagerResultDTO get(String id); + + /** + * 新增楼长/单元长 + * 同步到具体的楼栋表 + * + * @param dto + * @return + */ + void save(CommunityBuildingManagerDTO dto); + + /** + * 编辑楼长/单元长 + * 同步到具体的楼栋 + * + * @param dto + * @return + */ + void update(CommunityBuildingManagerDTO dto); + + /** + * 批量删除楼长/单元长 + * 同时清空楼栋表里的信息 + * + * @param ids + * @return + */ + void delete(List ids); + + void execAsyncExcelImport(Path fileSavePath, String taskId); + + /** + * 楼长单元长功能,只能社区级工作人员导入 + * + * @param customerId + * @param userId + */ + void checkImportPermission(String customerId, String userId); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java index f43de77102..ceac3653a9 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java @@ -368,10 +368,10 @@ public interface CustomerAgencyService extends BaseService /** * 返回下级数量 - * @param agencyId + * @param dto * @return */ - List getAgencyCountList(String agencyId); + List getAgencyCountList(CommunityCountCensusFormDTO dto); /** * @Description: 获取下级组织的社区数量 diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerDepartmentService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerDepartmentService.java index bcb0267e38..0cdcf1373d 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerDepartmentService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerDepartmentService.java @@ -102,4 +102,6 @@ public interface CustomerDepartmentService extends BaseService { * @return com.epmet.commons.tools.utils.Result */ Result getBuildingDetail(String buildingId); + + /** + * 更新ic_building的楼长信息那4列:building_leader_name、building_leader_mobile、building_leader_id_card、building_leader_type + * @param updateList + */ + void updateBuildingLeader(List updateList); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java index 5ffb6a19e8..5313886414 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java @@ -20,7 +20,6 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.IcNeighborHoodDTO; import com.epmet.dto.ImportGeneralDTO; @@ -28,6 +27,7 @@ import com.epmet.dto.NeighborHoodAndManagementDTO; import com.epmet.dto.form.IcNeighborHoodAddFormDTO; import com.epmet.dto.form.ImportInfoFormDTO; import com.epmet.dto.form.NeighborHoodOptionFormDTO; +import com.epmet.dto.form.yt.ChooseGridFormDTO; import com.epmet.dto.result.BuildingResultDTO; import com.epmet.dto.result.IcNeighborHoodDetailDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; @@ -123,13 +123,12 @@ public interface IcNeighborHoodService extends BaseService /** * 获取用户组织下小区列表 * - * @param tokenDto * @param dto * @return java.util.List * @author zhy * @date 2022/8/19 15:57 */ - List getNeighborhoodList(TokenDto tokenDto, IcNeighborHoodDTO dto); + List getNeighborhoodList(ChooseGridFormDTO dto); /** * @Description 通过ID查询小区信息 @@ -204,4 +203,11 @@ public interface IcNeighborHoodService extends BaseService * @return */ List queryNeighborHoodOptions(NeighborHoodOptionFormDTO formDTO); + + /** + * 小区下拉框,小区名:xxx网格-xxx小区 + * @param formDTO + * @return + */ + List queryNeighborHoodOptionsYanTai(NeighborHoodOptionFormDTO formDTO); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPropertyManagementService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPropertyManagementService.java index bc808af034..83ea49e041 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPropertyManagementService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPropertyManagementService.java @@ -92,4 +92,13 @@ public interface IcPropertyManagementService extends BaseService page(Integer pageNo, Integer pageSize, String name); + /** + * 物业管理-列表查询 + * @param pageNo + * @param pageSize + * @param name 物业名称 + * @param contactName 物业联系人 + * @param contactMobile 联系电话 + * @return + */ + PageData page(Integer pageNo, + Integer pageSize, + String name, + String contactName, + String contactMobile); + + /** + * 查看物业详情 + * @param id + * @return + */ + IcPropertyManagementDTO getDetail(String id); + + /** + * + * @param fileSavePath + * @param taskId + */ + void execAsyncExcelImport(Path fileSavePath, String taskId); + + /** + * 物业管理批量删除 + * + * @param ids + * @return 返回失败的id列表 + */ + List deleteBatch(List ids); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffLoginLogService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffLoginLogService.java index 5d39463647..ed1a49aa6e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffLoginLogService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffLoginLogService.java @@ -84,6 +84,12 @@ public interface StaffLoginLogService extends BaseService { */ PageData streetCount(String orgId, Date startDate, Date endDate, Boolean isPage, Integer pageNo, Integer pageSize); + /** + * 柱状图点击区县,查看街道,调用此接口 + * 计算的是街道的工作人员+街道下所有社区的人 的总次数 + * @return + */ + PageData streetTotal(String orgId, Date startDate, Date endDate, Integer pageNo, Integer pageSize); /*** * 获取登陆情况 * @param formDTO diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java index 5a4a989166..6bbb42094e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java @@ -4,7 +4,9 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.*; import com.epmet.dto.result.*; +import org.springframework.web.bind.annotation.RequestParam; +import java.nio.file.Path; import java.util.List; /** @@ -154,4 +156,6 @@ public interface StaffService { * @Date 2021/9/8 16:57 */ List staffOrgList(TokenDto tokenDto); + + void execAsyncExcelImport(Path fileSavePath, String taskId,String orgType, String orgId); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java index 31d49852b7..b39c2e9d66 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java @@ -167,6 +167,12 @@ public class AgencyServiceImpl implements AgencyService { originalEntity.setContacts(formDTO.getContacts()); originalEntity.setMobile(formDTO.getMobile()); originalEntity.setRemark(formDTO.getRemark()); + originalEntity.setSecretaryName(formDTO.getSecretaryName()); + originalEntity.setSecretaryMobile(formDTO.getSecretaryMobile()); + originalEntity.setDutyMobile(formDTO.getDutyMobile()); + originalEntity.setUnifiedSocialCreditCode(formDTO.getUnifiedSocialCreditCode()); + originalEntity.setUnifiedSocialCreditCodeCertificate(formDTO.getUnifiedSocialCreditCodeCertificate()); + originalEntity.setFullAddress(formDTO.getFullAddress()); //利用mybatis 拦截器填充值 originalEntity.setUpdatedTime(null); originalEntity.setUpdatedBy(null); @@ -1147,12 +1153,15 @@ public class AgencyServiceImpl implements AgencyService { calendar.set(Calendar.MILLISECOND, 0); Date endTime = calendar.getTime(); - AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId); +/* AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId); agencyOrgIdPath = getOrgIdPath(agencyInfo.getPids(), agencyInfo.getId()); - List currentUsingCommunityList = customerAgencyDao.getUsingCommunityList(customerId, orgId, agencyOrgIdPath, null); + List currentUsingCommunityList = customerAgencyDao.getUsingCommunityList(customerId, orgId, agencyOrgIdPath, null);*/ // List preferUsingCommunityList = customerAgencyDao.getUsingCommunityList(customerId, orgId, agencyOrgIdPath, endTime); // return new UsingCommunityStatsResultDTO(currentUsingCommunityList.size(), currentUsingCommunityList.size() - preferUsingCommunityList.size()); - return new UsingCommunityStatsResultDTO(currentUsingCommunityList.size(), 0); + CustomerAgencyEntity customerAgency = customerAgencyDao.selectById(orgId); + String pids = PidUtils.convertPid2OrgIdPath(customerAgency.getId(),customerAgency.getPids()); + + return new UsingCommunityStatsResultDTO(customerAgencyDao.communityCount(pids), 0); } else if ("grid".equals(orgType)) { // 网格下不会有该数据,给个0 return new UsingCommunityStatsResultDTO(0, 0); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java index 5f16fb2c62..8eb14781f5 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java @@ -92,6 +92,8 @@ public class BuildingServiceImpl implements BuildingService { private IcOrganizationCodeInfoDao icOrganizationCodeInfoDao; @Autowired private IcOrganizationCodeInfoServiceImpl icOrganizationCodeInfoServiceImpl; + @Autowired + private CommunityBuildingManagerDao communityBuildingManagerDao; @Override @@ -103,8 +105,8 @@ public class BuildingServiceImpl implements BuildingService { if (null != count && count > 0) { throw new RenException(EpmetErrorCode.BUILDING_NAME_EXITED.getCode(), EpmetErrorCode.BUILDING_NAME_EXITED.getMsg()); } - IcNeighborHoodEntity neighborHood = icNeighborHoodDao.selectById(formDTO.getNeighborHoodId()); - count = icBuildingDao.checkBuildNameV2(formDTO.getAgencyId(), neighborHood.getNeighborHoodName(), formDTO.getBuildingName(), null); + IcNeighborHoodEntity neighborHood1 = icNeighborHoodDao.selectById(formDTO.getNeighborHoodId()); + count = icBuildingDao.checkBuildNameV2(formDTO.getAgencyId(), neighborHood1.getNeighborHoodName(), formDTO.getBuildingName(), null); if (null != count && count > 0) { throw new EpmetException(EpmetErrorCode.BUILDING_NAME_EXITED_IN_GRID.getCode()); } @@ -121,6 +123,57 @@ public class BuildingServiceImpl implements BuildingService { IcBuildingEntity entity = ConvertUtils.sourceToTarget(icBuildingDTO, IcBuildingEntity.class); icBuildingDao.insert(entity); + + LambdaQueryWrapper manager = new LambdaQueryWrapper().eq(CommunityBuildingManagerEntity::getBuildingId,entity.getId()); + CommunityBuildingManagerEntity communityBuildingManagerEntity = communityBuildingManagerDao.selectOne(manager); + + + if (StringUtils.isNotBlank(entity.getBuildingLeaderType())&& + StringUtils.isNotBlank(entity.getBuildingLeaderIdCard())&& + StringUtils.isNotBlank(entity.getBuildingLeaderMobile())&& + StringUtils.isNotBlank(entity.getBuildingLeaderName())){ + + if (communityBuildingManagerEntity!=null){ + communityBuildingManagerEntity.setIdCard(entity.getBuildingLeaderIdCard()); + communityBuildingManagerEntity.setPhone(entity.getBuildingLeaderMobile()); + communityBuildingManagerEntity.setType(entity.getBuildingLeaderType()); + communityBuildingManagerEntity.setName(entity.getBuildingLeaderName()); + communityBuildingManagerDao.updateById(communityBuildingManagerEntity); + }else{ + communityBuildingManagerEntity= new CommunityBuildingManagerEntity(); + communityBuildingManagerEntity.setIdCard(entity.getBuildingLeaderIdCard()); + communityBuildingManagerEntity.setPhone(entity.getBuildingLeaderMobile()); + communityBuildingManagerEntity.setType(entity.getBuildingLeaderType()); + communityBuildingManagerEntity.setName(entity.getBuildingLeaderName()); + communityBuildingManagerEntity.setBuildingId(entity.getId()); + communityBuildingManagerEntity.setViliageId(entity.getNeighborHoodId()); + IcNeighborHoodEntity neighborHood = icNeighborHoodDao.selectById(entity.getNeighborHoodId()); + communityBuildingManagerEntity.setGridId(neighborHood.getGridId()); + communityBuildingManagerEntity.setOrgIdPath(neighborHood.getAgencyPids()+":"+neighborHood.getAgencyId()+":"+neighborHood.getGridId()); + + List agencyIds = new ArrayList<>(Arrays.asList(neighborHood.getAgencyPids().split(":"))); + agencyIds.add(neighborHood.getAgencyId()); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper().in(CustomerAgencyEntity::getId,agencyIds); + List customerAgencyEntities = customerAgencyDao.selectList(queryWrapper); + for (CustomerAgencyEntity customerAgencyEntity : customerAgencyEntities) { + if (customerAgencyEntity.getLevel().equals("community")){ + communityBuildingManagerEntity.setCommunityId(customerAgencyEntity.getId()); + } + if (customerAgencyEntity.getLevel().equals("street")){ + communityBuildingManagerEntity.setStreetId(customerAgencyEntity.getId()); + } + if (customerAgencyEntity.getLevel().equals("district")){ + communityBuildingManagerEntity.setDistrictId(customerAgencyEntity.getId()); + } + } + communityBuildingManagerDao.insert(communityBuildingManagerEntity); + } + }else{ + if (communityBuildingManagerEntity!=null){ + communityBuildingManagerDao.deleteById(communityBuildingManagerEntity); + } + } + //设置楼宇单元 Integer totalUnitNum = formDTO.getTotalUnitNum(); List unitList = new ArrayList<>(); @@ -657,8 +710,8 @@ public class BuildingServiceImpl implements BuildingService { if (null != count && count > 0) { throw new RenException(EpmetErrorCode.BUILDING_NAME_EXITED.getCode(), EpmetErrorCode.BUILDING_NAME_EXITED.getMsg()); } - IcNeighborHoodEntity neighborHood = icNeighborHoodDao.selectById(formDTO.getNeighborHoodId()); - count = icBuildingDao.checkBuildNameV2(formDTO.getAgencyId(), neighborHood.getNeighborHoodName(), formDTO.getBuildingName(), formDTO.getBuildingId()); + IcNeighborHoodEntity neighborHood1 = icNeighborHoodDao.selectById(formDTO.getNeighborHoodId()); + count = icBuildingDao.checkBuildNameV2(formDTO.getAgencyId(), neighborHood1.getNeighborHoodName(), formDTO.getBuildingName(), formDTO.getBuildingId()); if (null != count && count > 0) { throw new EpmetException(EpmetErrorCode.BUILDING_NAME_EXITED_IN_GRID.getCode()); } @@ -684,6 +737,57 @@ public class BuildingServiceImpl implements BuildingService { icBuildingDTO.setCustomerId(customerId); icBuildingService.update(icBuildingDTO); + + LambdaQueryWrapper manager = new LambdaQueryWrapper().eq(CommunityBuildingManagerEntity::getBuildingId,icBuildingDTO.getId()); + CommunityBuildingManagerEntity communityBuildingManagerEntity = communityBuildingManagerDao.selectOne(manager); + + + if (StringUtils.isNotBlank(icBuildingDTO.getBuildingLeaderType())&& + StringUtils.isNotBlank(icBuildingDTO.getBuildingLeaderIdCard())&& + StringUtils.isNotBlank(icBuildingDTO.getBuildingLeaderMobile())&& + StringUtils.isNotBlank(icBuildingDTO.getBuildingLeaderName())){ + + if (communityBuildingManagerEntity!=null){ + communityBuildingManagerEntity.setIdCard(icBuildingDTO.getBuildingLeaderIdCard()); + communityBuildingManagerEntity.setPhone(icBuildingDTO.getBuildingLeaderMobile()); + communityBuildingManagerEntity.setType(icBuildingDTO.getBuildingLeaderType()); + communityBuildingManagerEntity.setName(icBuildingDTO.getBuildingLeaderName()); + communityBuildingManagerDao.updateById(communityBuildingManagerEntity); + }else{ + communityBuildingManagerEntity= new CommunityBuildingManagerEntity(); + communityBuildingManagerEntity.setIdCard(icBuildingDTO.getBuildingLeaderIdCard()); + communityBuildingManagerEntity.setPhone(icBuildingDTO.getBuildingLeaderMobile()); + communityBuildingManagerEntity.setType(icBuildingDTO.getBuildingLeaderType()); + communityBuildingManagerEntity.setName(icBuildingDTO.getBuildingLeaderName()); + communityBuildingManagerEntity.setBuildingId(icBuildingDTO.getId()); + communityBuildingManagerEntity.setViliageId(icBuildingDTO.getNeighborHoodId()); + IcNeighborHoodEntity neighborHood = icNeighborHoodDao.selectById(icBuildingDTO.getNeighborHoodId()); + communityBuildingManagerEntity.setGridId(neighborHood.getGridId()); + communityBuildingManagerEntity.setOrgIdPath(neighborHood.getAgencyPids()+":"+neighborHood.getAgencyId()+":"+neighborHood.getGridId()); + + List agencyIds = new ArrayList<>(Arrays.asList(neighborHood.getAgencyPids().split(":"))); + agencyIds.add(neighborHood.getAgencyId()); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper().in(CustomerAgencyEntity::getId,agencyIds); + List customerAgencyEntities = customerAgencyDao.selectList(queryWrapper); + for (CustomerAgencyEntity customerAgencyEntity : customerAgencyEntities) { + if (customerAgencyEntity.getLevel().equals("community")){ + communityBuildingManagerEntity.setCommunityId(customerAgencyEntity.getId()); + } + if (customerAgencyEntity.getLevel().equals("street")){ + communityBuildingManagerEntity.setStreetId(customerAgencyEntity.getId()); + } + if (customerAgencyEntity.getLevel().equals("district")){ + communityBuildingManagerEntity.setDistrictId(customerAgencyEntity.getId()); + } + } + communityBuildingManagerDao.insert(communityBuildingManagerEntity); + } + }else{ + if (communityBuildingManagerEntity!=null){ + communityBuildingManagerDao.deleteById(communityBuildingManagerEntity); + } + } + // 更新房屋名称 icHouseDao.houseUpdateHouseName(formDTO.getBuildingId()); //更新楼宇单元 diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CommunityBuildingManagerServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CommunityBuildingManagerServiceImpl.java new file mode 100644 index 0000000000..3a26479c71 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CommunityBuildingManagerServiceImpl.java @@ -0,0 +1,547 @@ +package com.epmet.service.impl; + +import com.alibaba.excel.EasyExcel; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.enums.OrgLevelEnum; +import com.epmet.commons.tools.enums.OrgTypeEnum; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.page.PageData; +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.utils.*; +import com.epmet.constants.ImportTaskConstants; +import com.epmet.dao.CommunityBuildingManagerDao; +import com.epmet.dao.IcBuildingDao; +import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.dto.CustomerGridDTO; +import com.epmet.dto.IcBuildingDTO; +import com.epmet.dto.form.ImportTaskCommonFormDTO; +import com.epmet.dto.form.NeighborHoodOptionFormDTO; +import com.epmet.dto.form.yt.CommunityBuildingManagerPageFormDTO; +import com.epmet.dto.result.CommunityBuildingManagerDTO; +import com.epmet.dto.result.UploadImgResultDTO; +import com.epmet.dto.result.yt.CommunityBuildingManagerResultDTO; +import com.epmet.entity.CommunityBuildingManagerEntity; +import com.epmet.entity.IcBuildingEntity; +import com.epmet.excel.handler.CommunityBuildingManagerImportListener; +import com.epmet.excel.yt.CommunityBuildingManagerImportExcelData; +import com.epmet.excel.yt.IcPropertyManagementImportExcelData; +import com.epmet.feign.EpmetCommonServiceOpenFeignClient; +import com.epmet.feign.OssFeignClient; +import com.epmet.service.*; +import com.epmet.utils.ImportTaskUtils; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.fileupload.FileItem; +import org.apache.commons.fileupload.disk.DiskFileItemFactory; +import org.apache.commons.lang3.StringUtils; +import org.apache.http.entity.ContentType; +import org.apache.poi.util.IOUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; +import org.springframework.web.multipart.commons.CommonsMultipartFile; + +import java.io.IOException; +import java.io.OutputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 楼长单元长信息表(烟台) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-06 + */ +@Slf4j +@Service +public class CommunityBuildingManagerServiceImpl extends BaseServiceImpl implements CommunityBuildingManagerService { + @Autowired + private IcBuildingDao icBuildingDao; + @Autowired + private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; + @Autowired + private OssFeignClient ossFeignClient; + @Autowired + private CustomerGridService customerGridService; + @Autowired + private RedisUtils redisUtils; + + /** + * 列表分页查询 + * + * @param formDTO + * @return + */ + @Override + public PageData page(CommunityBuildingManagerPageFormDTO formDTO) { + // 默认查询本组织及下级 + CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + if (null == staffInfoCacheResult) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询工作人员信息异常staffId:" + formDTO.getStaffId(), "查询工作人员信息异常"); + } + formDTO.setOrgIdPath(PidUtils.convertPid2OrgIdPath(staffInfoCacheResult.getAgencyId(), staffInfoCacheResult.getAgencyPIds())); + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + List resList = baseDao.pageList(formDTO.getCustomerId(), + formDTO.getOrgIdPath(), + formDTO.getName(), + formDTO.getPhone(), + formDTO.getIdCard(), + formDTO.getType(), + formDTO.getDistrictId(), + formDTO.getStreetId(), + formDTO.getCommunityId(), + formDTO.getGridId(), + formDTO.getViliageId(), + formDTO.getBuildingId(), + formDTO.getUnitId(), null); + PageInfo pageInfo = new PageInfo<>(resList); + return new PageData<>(resList, pageInfo.getTotal(), formDTO.getPageSize()); + } + + /** + * 查看详情 + * + * @param id + * @return + */ + @Override + public CommunityBuildingManagerResultDTO get(String id) { + List resList = baseDao.pageList(EpmetRequestHolder.getLoginUserCustomerId(), + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, id); + if (CollectionUtils.isEmpty(resList)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "community_building_manager表记录不存在:id:" + id, "记录不存在"); + } + return resList.get(NumConstant.ZERO); + } + + /** + * 新增楼长/单元长 + * 同步到具体的楼栋表 + * + * @param addFormDto + * @return + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void save(CommunityBuildingManagerDTO addFormDto) { + // 唯一性判断,类型+楼栋id或者类型+单元id唯一 + checkUnqiue(addFormDto.getType(), addFormDto.getBuildingId(), addFormDto.getUnitId(), null); + CommunityBuildingManagerEntity entity = ConvertUtils.sourceToTarget(addFormDto, CommunityBuildingManagerEntity.class); + CustomerGridDTO gridDTO = SpringContextUtils.getBean(CustomerGridService.class).get(addFormDto.getGridId()); + entity.setOrgIdPath(PidUtils.convertPid2OrgIdPath(gridDTO.getId(), gridDTO.getPids())); + insert(entity); + // 同步更新至ic_building + LambdaUpdateWrapper buildingUpdate = new LambdaUpdateWrapper<>(); + buildingUpdate.eq(IcBuildingEntity::getId, entity.getBuildingId()) + .set(IcBuildingEntity::getBuildingLeaderName, entity.getName()) + .set(IcBuildingEntity::getBuildingLeaderMobile, entity.getPhone()) + .set(IcBuildingEntity::getBuildingLeaderIdCard, entity.getIdCard()) + .set(IcBuildingEntity::getBuildingLeaderType, entity.getType()) + .set(IcBuildingEntity::getUpdatedBy, EpmetRequestHolder.getLoginUserId()) + .set(IcBuildingEntity::getUpdatedTime, new Date()); + icBuildingDao.update(null, buildingUpdate); + } + + private void checkUnqiue(String type, String buildingId, String unitId, String id) { + // 1号楼只允许有一个楼长 + // 1号楼只允许有一个单元长 + LambdaQueryWrapper countQuery = new LambdaQueryWrapper<>(); + countQuery.eq(CommunityBuildingManagerEntity::getType, type) + .eq(CommunityBuildingManagerEntity::getBuildingId, buildingId) + .eq(StringUtils.isNotBlank(unitId), CommunityBuildingManagerEntity::getUnitId, unitId) + .ne(StringUtils.isNotBlank(id), CommunityBuildingManagerEntity::getId, id); + if (baseDao.selectCount(countQuery) > NumConstant.ZERO) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "所选楼栋(单元)已存在楼长(单元长)", "所选楼栋(单元)已存在楼长(单元长)"); + } + } + + /** + * 编辑楼长/单元长 + * 同步到具体的楼栋 + * + * @param updateFormDto + * @return + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CommunityBuildingManagerDTO updateFormDto) { + checkUnqiue(updateFormDto.getType(), updateFormDto.getBuildingId(), updateFormDto.getUnitId(), updateFormDto.getId()); + CommunityBuildingManagerEntity entity = ConvertUtils.sourceToTarget(updateFormDto, CommunityBuildingManagerEntity.class); + CustomerGridDTO gridDTO = SpringContextUtils.getBean(CustomerGridService.class).get(updateFormDto.getGridId()); + entity.setOrgIdPath(PidUtils.convertPid2OrgIdPath(gridDTO.getId(), gridDTO.getPids())); + updateById(entity); + // 同步更新至ic_building + LambdaUpdateWrapper buildingUpdate = new LambdaUpdateWrapper<>(); + buildingUpdate.eq(IcBuildingEntity::getId, updateFormDto.getBuildingId()) + .set(IcBuildingEntity::getBuildingLeaderName, updateFormDto.getName()) + .set(IcBuildingEntity::getBuildingLeaderMobile, updateFormDto.getPhone()) + .set(IcBuildingEntity::getBuildingLeaderIdCard, updateFormDto.getIdCard()) + .set(IcBuildingEntity::getBuildingLeaderType, updateFormDto.getType()) + .set(IcBuildingEntity::getUpdatedBy, EpmetRequestHolder.getLoginUserId()) + .set(IcBuildingEntity::getUpdatedTime, new Date()); + icBuildingDao.update(null, buildingUpdate); + } + + /** + * 批量删除楼长/单元长 + * 同时清空楼栋表里的信息 + * + * @param ids + * @return + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(List ids) { + Date now = new Date(); + ids.forEach(id -> { + CommunityBuildingManagerEntity origin = baseDao.selectById(id); + if (null != origin) { + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.eq(CommunityBuildingManagerEntity::getId, id) + .set(CommunityBuildingManagerEntity::getDelFlag, NumConstant.ONE_STR) + .set(CommunityBuildingManagerEntity::getUpdatedBy, EpmetRequestHolder.getLoginUserId()) + .set(CommunityBuildingManagerEntity::getUpdatedTime, now); + baseDao.update(null, updateWrapper); + if (StringUtils.isNotBlank(origin.getBuildingId())) { + // 清空楼栋表的楼长4列信息 + LambdaUpdateWrapper buildingUpdate = new LambdaUpdateWrapper<>(); + buildingUpdate.eq(IcBuildingEntity::getId, origin.getBuildingId()) + .set(IcBuildingEntity::getBuildingLeaderName, StrConstant.EPMETY_STR) + .set(IcBuildingEntity::getBuildingLeaderMobile, StrConstant.EPMETY_STR) + .set(IcBuildingEntity::getBuildingLeaderIdCard, StrConstant.EPMETY_STR) + .set(IcBuildingEntity::getBuildingLeaderType, StrConstant.EPMETY_STR) + .set(IcBuildingEntity::getUpdatedBy, EpmetRequestHolder.getLoginUserId()) + .set(IcBuildingEntity::getUpdatedTime, now); + icBuildingDao.update(null, buildingUpdate); + } + } + }); + } + + @Override + public void checkImportPermission(String customerId, String userId) { + CustomerStaffInfoCacheResult result = CustomerStaffRedis.getStaffInfo(customerId, userId); + CustomerAgencyDTO agencyDTO = SpringContextUtils.getBean(CustomerAgencyService.class).get(result.getAgencyId()); + if (!OrgLevelEnum.COMMUNITY.getCode().equals(agencyDTO.getLevel())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "楼长单元长导入功能只有社区账号才可以正常导入", "请使用社区级账号导入excel"); + } + } + + /** + * 执行Excel导入 + * + * @param filePath + * @param importTaskId + */ + @Async + @Override + public void execAsyncExcelImport(Path filePath, String importTaskId) { + String staffId = EpmetRequestHolder.getLoginUserId(); + String customerId = EpmetRequestHolder.getLoginUserCustomerId(); + // 当前登录用户缓存信息 + CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(customerId, staffId); + // 当前登录用户所属组织信息 + CustomerAgencyDTO community = SpringContextUtils.getBean(CustomerAgencyService.class).get(staffInfoCacheResult.getAgencyId()); + String streetId = community.getPid(); + // 社区上级街道信息 + CustomerAgencyDTO street = SpringContextUtils.getBean(CustomerAgencyService.class).get(streetId); + String districtId = street.getPid(); + + //查询当前社区下的网格列表 + List gridList=customerGridService.getGridOption(staffInfoCacheResult.getAgencyId(), "addorupdate"); + Map gridMap = gridList.stream().collect(Collectors.toMap(OptionResultDTO::getLabel, OptionResultDTO::getValue)); + String uuid = IdWorker.getIdStr(); + String redisKey = "community_building_manager_import".concat(StrConstant.COLON).concat(uuid); + + try { + CommunityBuildingManagerImportListener listener = new CommunityBuildingManagerImportListener(gridMap,customerId,staffId,staffInfoCacheResult.getAgencyId(),districtId,streetId,redisKey, + SpringContextUtils.getBean(CommunityBuildingManagerServiceImpl.class)); + + EasyExcel.read(filePath.toFile(), CommunityBuildingManagerImportExcelData.class, listener).headRowNumber(1).sheet(0).doRead(); + + String errorDesFileUrl = null; + + List errorRows = listener.getErrorRows(); + + boolean failed = errorRows.size() > 0; + + // 合并到一起写入 + // errorRows.addAll(otherRows); + + // 生成并上传描述文件 + OutputStream os = null; + FileItem fileItem = null; + if (errorRows.size() > 0) { + try { + // 文件生成 + Path errorDescDir = FileUtils.getAndCreateDirUnderEpmetFilesDir(ImportTaskConstants.COMMUNITY_BUILDING_MANAGER, "import", "error_des"); + String fileName = UUID.randomUUID().toString().concat(".xlsx"); + + fileItem = new DiskFileItemFactory(DiskFileItemFactory.DEFAULT_SIZE_THRESHOLD, errorDescDir.toFile()) + .createItem("file", ContentType.APPLICATION_OCTET_STREAM.toString(), false, fileName); + os = fileItem.getOutputStream(); + + EasyExcel.write(os, IcPropertyManagementImportExcelData.ErrorRow.class).sheet("信息列表").doWrite(errorRows); + // 文件上传oss + Result errorDesFileUploadResult = ossFeignClient.uploadImportTaskDescFile(new CommonsMultipartFile(fileItem)); + if (errorDesFileUploadResult.success()) { + errorDesFileUrl = errorDesFileUploadResult.getData().getUrl(); + } + + } finally { + IOUtils.closeQuietly(os); + if (!fileItem.isInMemory()) { + try { + fileItem.delete(); + } catch (Exception e) { + log.error("【楼长单元长表community_building_manager】删除错误描述临时文件失败:{}", ExceptionUtils.getErrorStackTrace(e)); + } + } + } + } + + Result result = ImportTaskUtils.finishImportTask( + importTaskId, + failed ? ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL : ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS, + errorDesFileUrl, + ""); + + if (!result.success()) { + log.error("【楼长单元长表community_building_manager】finishImportTask失败"); + } + } catch (Exception e) { + String errorMsg = ExceptionUtils.getErrorStackTrace(e); + log.error("【楼长单元长表community_building_manager】出错:{}", errorMsg); + + ImportTaskCommonFormDTO importFinishTaskForm = new ImportTaskCommonFormDTO(); + importFinishTaskForm.setTaskId(importTaskId); + importFinishTaskForm.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL); + importFinishTaskForm.setOperatorId(staffId); + importFinishTaskForm.setResultDesc("物业管理表导入失败:系统异常,请查看系统日志"); + + Result result = commonServiceOpenFeignClient.finishImportTask(importFinishTaskForm); + if (!result.success()) { + log.error("【楼长单元长表community_building_manager】导入记录状态修改为'完成'失败"); + } + } finally { + // 删除临时文件 + if (Files.exists(filePath)) { + try { + Files.delete(filePath); + } catch (IOException e) { + e.printStackTrace(); + } + } + //删除小区缓存、楼栋缓存、单元缓存 + redisUtils.deleteByPrex(redisKey+"*"); + } + + + } + + /** + * @param customerId + * @param staffId + * @param agencyId + * @param rediPrex + * @param excelDataList + * @param listener + */ + public void handleImportExcelData(Map gridMap, + String customerId, + String staffId, + String agencyId, + String districtId, + String streetId, + String rediPrex, + List excelDataList, + CommunityBuildingManagerImportListener listener) { + List insertList = new ArrayList<>(); + List updateList = new ArrayList<>(); + List buildingUpdateList=new ArrayList<>(); + for (CommunityBuildingManagerDTO dto : excelDataList) { + try { + CommunityBuildingManagerEntity entity = ConvertUtils.sourceToTarget(dto, CommunityBuildingManagerEntity.class); + entity.setDistrictId(districtId); + entity.setStreetId(streetId); + + // 所属网格 + if (MapUtils.isEmpty(gridMap) || !gridMap.containsKey(dto.getGridName()) || StringUtils.isBlank(gridMap.get(dto.getGridName()))) { + CommunityBuildingManagerImportExcelData.ErrorRow errorRow = ConvertUtils.sourceToTarget(dto, CommunityBuildingManagerImportExcelData.ErrorRow.class); + errorRow.setErrorInfo("网格不存在"); + listener.getErrorRows().add(errorRow); + continue; + } + String gridId = gridMap.get(dto.getGridName()); + entity.setGridId(gridId); + entity.setOrgIdPath(CustomerOrgRedis.getOrgIdPath(gridId, OrgTypeEnum.GRID.getCode())); + + // 查询当前网格下的小区 + // 所属小区 + Map viliageMap =queryViliageList(customerId,staffId,agencyId,gridId,rediPrex); + if (MapUtils.isEmpty(viliageMap) || !viliageMap.containsKey(dto.getViliageName()) || StringUtils.isBlank(viliageMap.get(dto.getViliageName()))) { + CommunityBuildingManagerImportExcelData.ErrorRow errorRow = ConvertUtils.sourceToTarget(dto, CommunityBuildingManagerImportExcelData.ErrorRow.class); + errorRow.setErrorInfo("小区不存在"); + listener.getErrorRows().add(errorRow); + continue; + } + String viliageId = viliageMap.get(dto.getViliageName()); + entity.setViliageId(viliageId); + + + // 查询当前小区下的楼栋 + // 所属楼栋 + // List buildingList=queryBuildingList(viliageId,rediPrex); + // Map buildingMap = buildingList.stream().collect(Collectors.toMap(OptionResultDTO::getLabel, OptionResultDTO::getValue)); + Map buildingMap =queryBuildingList(viliageId,rediPrex);; + if (MapUtils.isEmpty(buildingMap) || !buildingMap.containsKey(dto.getBuildingName()) || StringUtils.isBlank(buildingMap.get(dto.getBuildingName()))) { + CommunityBuildingManagerImportExcelData.ErrorRow errorRow = ConvertUtils.sourceToTarget(dto, CommunityBuildingManagerImportExcelData.ErrorRow.class); + errorRow.setErrorInfo("楼栋不存在"); + listener.getErrorRows().add(errorRow); + continue; + } + String buildingId = buildingMap.get(dto.getBuildingName()); + entity.setBuildingId(buildingId); + + // 所属单元 + String unitId = ""; + if (StringUtils.isNotBlank(dto.getUnitName())) { + // 查询楼栋下的单元列表 + // List unitList=queryUnitList(buildingId,rediPrex); + // Map unitMap = unitList.stream().collect(Collectors.toMap(OptionResultDTO::getLabel, OptionResultDTO::getValue)); + Map unitMap = queryUnitList(buildingId, rediPrex); + if (MapUtils.isEmpty(unitMap) || !unitMap.containsKey(dto.getUnitName()) || StringUtils.isBlank(unitMap.get(dto.getUnitName()))) { + CommunityBuildingManagerImportExcelData.ErrorRow errorRow = ConvertUtils.sourceToTarget(dto, CommunityBuildingManagerImportExcelData.ErrorRow.class); + errorRow.setErrorInfo("单元不存在"); + listener.getErrorRows().add(errorRow); + continue; + } + unitId = unitMap.get(dto.getUnitName()); + } + entity.setUnitId(unitId); + + LambdaQueryWrapper countQuery = new LambdaQueryWrapper<>(); + countQuery.eq(CommunityBuildingManagerEntity::getType, entity.getType()) + .eq(CommunityBuildingManagerEntity::getBuildingId, buildingId) + .eq(StringUtils.isNotBlank(unitId), CommunityBuildingManagerEntity::getUnitId, unitId) + .ne(StringUtils.isNotBlank(entity.getId()),CommunityBuildingManagerEntity::getId, entity.getId()); + CommunityBuildingManagerEntity origin = baseDao.selectOne(countQuery); + if (null == origin) { + insertList.add(entity); + } else { + entity.setId(origin.getId()); + updateList.add(entity); + } + // 同步更新至ic_building + IcBuildingDTO icBuildingDTO = new IcBuildingDTO(); + icBuildingDTO.setId(entity.getBuildingId()); + icBuildingDTO.setBuildingLeaderMobile(entity.getPhone()); + icBuildingDTO.setBuildingLeaderIdCard(entity.getIdCard()); + icBuildingDTO.setBuildingLeaderType(entity.getType()); + icBuildingDTO.setBuildingLeaderName(entity.getName()); + icBuildingDTO.setUpdatedBy(staffId); + icBuildingDTO.setUpdatedTime(new Date()); + buildingUpdateList.add(icBuildingDTO); + + } catch (Exception e) { + CommunityBuildingManagerImportExcelData.ErrorRow errorRow = ConvertUtils.sourceToTarget(dto, CommunityBuildingManagerImportExcelData.ErrorRow.class); + errorRow.setErrorInfo("数据处理异常"); + listener.getErrorRows().add(errorRow); + } + } + // 同步到ic_building + if(!CollectionUtils.isEmpty(insertList)){ + this.insertBatch(insertList); + } + if(!CollectionUtils.isEmpty(updateList)){ + this.updateBatchById(updateList); + } + if(!CollectionUtils.isEmpty(buildingUpdateList)){ + SpringContextUtils.getBean(IcBuildingService.class).updateBuildingLeader(buildingUpdateList); + } + } + + + private Map queryViliageList(String customerId, String staffId, String agencyId, String gridId, String rediPrex) { + String redisKey = rediPrex.concat(StrConstant.COLON).concat("viliage_list").concat(StrConstant.COLON).concat(gridId); + Map viliageMap = redisUtils.hGetAll(redisKey); + if (MapUtils.isEmpty(viliageMap)) { + NeighborHoodOptionFormDTO neighborHoodOptionFormDTO = new NeighborHoodOptionFormDTO(); + neighborHoodOptionFormDTO.setCustomerId(customerId); + neighborHoodOptionFormDTO.setStaffId(staffId); + neighborHoodOptionFormDTO.setAgencyId(agencyId); + neighborHoodOptionFormDTO.setGridId(gridId); + List resultList = SpringContextUtils.getBean(IcNeighborHoodService.class).queryNeighborHoodOptions(neighborHoodOptionFormDTO); + viliageMap = resultList.stream().collect(Collectors.toMap(OptionResultDTO::getLabel, OptionResultDTO::getValue)); + // 有效时间1小时 + redisUtils.hMSet(redisKey, viliageMap, RedisUtils.HOUR_ONE_EXPIRE); + } + Map resultMap = new HashMap<>(); + viliageMap.forEach((k, v) -> + resultMap.put(k, (String) v) + ); + return resultMap; + } + + private Map queryBuildingList(String viliageId, String rediPrex) { + String redisKey = rediPrex.concat(StrConstant.COLON).concat("building_List").concat(StrConstant.COLON).concat(viliageId); + Map buildingMap = redisUtils.hGetAll(redisKey); + if (MapUtils.isEmpty(buildingMap)) { + List resultList = SpringContextUtils.getBean(IcBuildingService.class).getBuildingOptions(viliageId); + buildingMap = resultList.stream().collect(Collectors.toMap(OptionResultDTO::getLabel, OptionResultDTO::getValue)); + // 有效时间1小时 + redisUtils.hMSet(redisKey, buildingMap, RedisUtils.HOUR_ONE_EXPIRE); + } + Map resultMap = new HashMap<>(); + buildingMap.forEach((k, v) -> + resultMap.put(k, (String) v) + ); + return resultMap; + } + + private Map queryUnitList(String buildingId, String rediPrex) { + String redisKey = rediPrex.concat(StrConstant.COLON).concat("unit_List").concat(StrConstant.COLON).concat(buildingId); + Map unitMap = redisUtils.hGetAll(redisKey); + if (MapUtils.isEmpty(unitMap)) { + List resultList = SpringContextUtils.getBean(IcBuildingUnitService.class).getUnitOptions(buildingId); + unitMap = resultList.stream().collect(Collectors.toMap(OptionResultDTO::getLabel, OptionResultDTO::getValue)); + // 有效时间1小时 + redisUtils.hMSet(redisKey, unitMap, RedisUtils.HOUR_ONE_EXPIRE); + } + Map resultMap = new HashMap<>(); + unitMap.forEach((k, v) -> + resultMap.put(k, (String) v) + ); + return resultMap; + } + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index 7a651ecc9a..87f0555690 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -18,7 +18,6 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; @@ -45,7 +44,6 @@ import com.epmet.constant.CustomerGridConstant; import com.epmet.dao.*; import com.epmet.dto.*; import com.epmet.dto.form.*; -import com.epmet.dto.region.LogOperationResultDTO; import com.epmet.dto.result.*; import com.epmet.entity.CustomerAgencyEntity; import com.epmet.entity.CustomerDepartmentEntity; @@ -136,12 +134,16 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl getWrapper(Map params) { - String id = (String) params.get(FieldConstant.ID_HUMP); - - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); - + private LambdaQueryWrapper getWrapper(Map map) { + String id = map.containsKey(FieldConstant.ID_HUMP) ? (String) map.get(FieldConstant.ID_HUMP) : null; + String customerId = map.containsKey("CUSTOMER_ID") ? (String) map.get("CUSTOMER_ID") : null; + String level = map.containsKey("LEVEL") ? (String) map.get("LEVEL") : null; + String pid = map.containsKey("PID") ? (String) map.get("PID") : null; + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), CustomerAgencyEntity::getId, id) + .eq(StringUtils.isNotBlank(customerId), CustomerAgencyEntity::getCustomerId, customerId) + .eq(StringUtils.isNotBlank(level), CustomerAgencyEntity::getLevel, level) + .eq(StringUtils.isNotBlank(pid), CustomerAgencyEntity::getPid, pid); return wrapper; } @@ -1244,7 +1246,7 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl agencyList, List gridList) { @@ -1662,34 +1664,55 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl * @Author: lichao * @Date: 2023/4/7 14:17 */ @Override - public List getAgencyCountList(String agencyId) { + public List getAgencyCountList(CommunityCountCensusFormDTO dto) { List agencyCountCensusResultDTOS = new ArrayList<>(); - CustomerAgencyEntity customerAgency = baseDao.selectById(agencyId); + CustomerAgencyEntity customerAgency = baseDao.selectById(dto.getAgencyId()); if (customerAgency != null){ + + Map type = new HashMap<>(); String pids = PidUtils.convertPid2OrgIdPath(customerAgency.getId(),customerAgency.getPids()); - agencyCountCensusResultDTOS = baseDao.agencyCount(pids); + agencyCountCensusResultDTOS = baseDao.agencyCount(pids,dto.getTimeStart(),dto.getTimeEnd()); + agencyCountCensusResultDTOS.forEach( + agencyCountCensusResultDTO ->{ + type.put(agencyCountCensusResultDTO.getLevel(),agencyCountCensusResultDTO.getLevel()); + } + ); AgencyCountCensusResultDTO agencyCountCensusResultDTOGrid = new AgencyCountCensusResultDTO(); agencyCountCensusResultDTOGrid.setLevel("grid"); - agencyCountCensusResultDTOGrid.setCount(baseDao.agencyGridCount(pids)); + agencyCountCensusResultDTOGrid.setCount(baseDao.agencyGridCount(pids,dto.getTimeStart(),dto.getTimeEnd())); agencyCountCensusResultDTOS.add(agencyCountCensusResultDTOGrid); AgencyCountCensusResultDTO agencyCountCensusResultDTOStaff = new AgencyCountCensusResultDTO(); agencyCountCensusResultDTOStaff.setLevel("staff"); - agencyCountCensusResultDTOStaff.setCount(baseDao.agencyStaffCount(pids)); + agencyCountCensusResultDTOStaff.setCount(baseDao.agencyStaffCount(pids,dto.getTimeStart(),dto.getTimeEnd())); agencyCountCensusResultDTOS.add(agencyCountCensusResultDTOStaff); + if (type.get("community") == null){ + AgencyCountCensusResultDTO agencyCountCensusResultDTOcom = new AgencyCountCensusResultDTO(); + agencyCountCensusResultDTOcom.setLevel("community"); + agencyCountCensusResultDTOcom.setCount(0); + agencyCountCensusResultDTOS.add(agencyCountCensusResultDTOcom); + } + if (type.get("street") == null){ + AgencyCountCensusResultDTO agencyCountCensusResultDTOstree = new AgencyCountCensusResultDTO(); + agencyCountCensusResultDTOstree.setLevel("street"); + agencyCountCensusResultDTOstree.setCount(0); + agencyCountCensusResultDTOS.add(agencyCountCensusResultDTOstree); + } }else{ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"获取用户组织信息异常","获取用户组织信息异常"); } + + return agencyCountCensusResultDTOS; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerDepartmentServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerDepartmentServiceImpl.java index 63acec3171..9a95149a5f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerDepartmentServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerDepartmentServiceImpl.java @@ -17,11 +17,14 @@ package com.epmet.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.CustomerDepartmentDao; @@ -118,6 +121,15 @@ public class CustomerDepartmentServiceImpl extends BaseServiceImpl countQuery=new LambdaQueryWrapper<>(); + countQuery.eq(CustomerDepartmentEntity::getAgencyId,agencyId) + .eq(CustomerDepartmentEntity::getDepartmentName,departmentName) + .ne(StringUtils.isNotBlank(deptId),CustomerDepartmentEntity::getId,deptId); + if(baseDao.selectCount(countQuery)>0){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"部门名称已存在","部门名称已存在"); + } + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java index 5aad1c9b59..c518e45d14 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java @@ -17,19 +17,21 @@ package com.epmet.service.impl; +import com.alibaba.excel.EasyExcel; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.user.LoginUserUtil; -import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.*; import com.epmet.constant.CustomerDepartmentConstant; +import com.epmet.constants.ImportTaskConstants; import com.epmet.dao.CustomerAgencyDao; import com.epmet.dao.CustomerDepartmentDao; import com.epmet.dao.CustomerStaffDepartmentDao; @@ -38,20 +40,29 @@ import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.*; -import com.epmet.feign.EpmetHeartOpenFeignClient; -import com.epmet.feign.EpmetUserFeignClient; -import com.epmet.feign.EpmetUserOpenFeignClient; -import com.epmet.feign.GovProjectOpenFeignClient; +import com.epmet.excel.handler.DeptExcelImportListener; +import com.epmet.excel.yt.DeptImportExcelDTO; +import com.epmet.feign.*; import com.epmet.service.*; import com.epmet.util.ModuleConstant; +import org.apache.commons.fileupload.FileItem; +import org.apache.commons.fileupload.FileItemFactory; +import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.lang3.StringUtils; +import org.apache.http.entity.ContentType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import org.springframework.web.multipart.commons.CommonsMultipartFile; +import java.io.IOException; +import java.io.OutputStream; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -93,6 +104,11 @@ public class DepartmentServiceImpl implements DepartmentService { private EpmetHeartOpenFeignClient epmetHeartOpenFeignClient; @Autowired private GovProjectOpenFeignClient govProjectOpenFeignClient; + @Autowired + private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; + @Autowired + private OssFeignClient ossFeignClient; + /** * @param formDTO @@ -103,6 +119,8 @@ public class DepartmentServiceImpl implements DepartmentService { @Override @Transactional(rollbackFor = Exception.class) public Result addDepartment(AddDepartmentFormDTO formDTO) { + //同一组织下部门名称唯一 + SpringContextUtils.getBean(CustomerDepartmentService.class).checkUnqiueName(formDTO.getAgencyId(),formDTO.getDepartmentName(),null); Result result = new Result(); AddDepartmentResultDTO addDepartmentResultDTO = new AddDepartmentResultDTO(); CustomerDepartmentEntity entity = ConvertUtils.sourceToTarget(formDTO, CustomerDepartmentEntity.class); @@ -135,6 +153,9 @@ public class DepartmentServiceImpl implements DepartmentService { @Override @Transactional(rollbackFor = Exception.class) public Result editDepartment(EditDepartmentFormDTO formDTO) { + CustomerDepartmentEntity origin=customerDepartmentDao.selectById(formDTO.getDepartmentId()); + //同一组织下部门名称唯一 + SpringContextUtils.getBean(CustomerDepartmentService.class).checkUnqiueName(origin.getAgencyId(),formDTO.getDepartmentName(),formDTO.getDepartmentId()); Result result = new Result(); CustomerDepartmentEntity entity = ConvertUtils.sourceToTarget(formDTO, CustomerDepartmentEntity.class); entity.setId(formDTO.getDepartmentId()); @@ -551,5 +572,83 @@ public class DepartmentServiceImpl implements DepartmentService { return resultDTO; } + @Async + @Override + public void execAsyncExcelImport(Path filePath, String importTaskId,String agencyId,String originalFilename) { + CustomerAgencyEntity agencyEntity = customerAgencyDao.selectById(agencyId); + try { + DeptExcelImportListener listener = new DeptExcelImportListener(EpmetRequestHolder.getLoginUserCustomerId(), + EpmetRequestHolder.getLoginUserId(), + agencyEntity, + SpringContextUtils.getBean(CustomerDepartmentService.class)); + EasyExcel.read(filePath.toFile(), DeptImportExcelDTO.class, listener).headRowNumber(1).sheet(0).doRead(); + + Path errorDescFile = null; + String errorDesFileUrl = null; + List errorRows = listener.getErrorRows(); + + boolean failed = errorRows.size() > 0; + if (failed) { + // 生成并上传错误文件 + try { + // 文件生成 + Path errorDescDir = FileUtils.getAndCreateDirUnderEpmetFilesDir("customer_dept", "import", "error_des"); + String fileName = originalFilename.concat(DateUtils.format(new Date(),DateUtils.DATE_TIME_NO_SPLIT)).concat(".xlsx"); + errorDescFile = errorDescDir.resolve(fileName); + + FileItemFactory factory = new DiskFileItemFactory(16, errorDescDir.toFile()); + FileItem fileItem = factory.createItem("file", ContentType.APPLICATION_OCTET_STREAM.toString(), true, fileName); + OutputStream os = fileItem.getOutputStream(); + + EasyExcel.write(os, DeptImportExcelDTO.ErrorRow.class).sheet("导入失败列表").doWrite(errorRows); + + // 文件上传oss + Result errorDesFileUploadResult = ossFeignClient.uploadImportTaskDescFile(new CommonsMultipartFile(fileItem)); + if (errorDesFileUploadResult.success()) { + errorDesFileUrl = errorDesFileUploadResult.getData().getUrl(); + } + } finally { + if (Files.exists(errorDescFile)) { + Files.delete(errorDescFile); + } + } + } + + ImportTaskCommonFormDTO importFinishTaskForm = new ImportTaskCommonFormDTO(); + importFinishTaskForm.setTaskId(importTaskId); + importFinishTaskForm.setProcessStatus(failed ? ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL : ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS); + importFinishTaskForm.setOperatorId(EpmetRequestHolder.getLoginUserId()); + importFinishTaskForm.setResultDesc(""); + importFinishTaskForm.setResultDescFilePath(errorDesFileUrl); + + Result result = commonServiceOpenFeignClient.finishImportTask(importFinishTaskForm); + if (!result.success()) { + log.error("【部门导入】finishImportTask失败"); + } + } catch (Exception e) { + String errorMsg = ExceptionUtils.getErrorStackTrace(e); + log.error("【部门导入】出错:{}", errorMsg); + + ImportTaskCommonFormDTO importFinishTaskForm = new ImportTaskCommonFormDTO(); + importFinishTaskForm.setTaskId(importTaskId); + importFinishTaskForm.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL); + importFinishTaskForm.setOperatorId(EpmetRequestHolder.getLoginUserId()); + importFinishTaskForm.setResultDesc("导入失败"); + Result result = commonServiceOpenFeignClient.finishImportTask(importFinishTaskForm); + if (!result.success()) { + log.error("【部门导入】导入记录状态修改为'完成'失败"); + } + } finally { + // 删除临时文件 + if (Files.exists(filePath)) { + try { + Files.delete(filePath); + } catch (IOException e) { + log.error("method exception", e); + } + } + } + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java index 10b1be7d14..f4972a30b3 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java @@ -243,6 +243,8 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { icHouseDTO.setHouseTypeName(HouseTypeEnums.getTypeValue(formDTO.getHouseType())); icHouseDTO.setPurposeName(HousePurposeEnums.getTypeValue(formDTO.getPurpose())); icHouseDTO.setRentName(HouseRentFlagEnums.getTypeValue(formDTO.getRentFlag())); + icHouseDTO.setFloor(formDTO.getFloor()); + icHouseDTO.setArea(formDTO.getArea()); //设置 icHouseDTO.setHouseName(getHouseName(formDTO)); icHouseDTO.setFullName(icHouseService.getFullName(formDTO.getNeighborHoodId(), formDTO.getBuildingId(), formDTO.getBuildingUnitId(), formDTO.getDoorName())); @@ -272,10 +274,10 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { houseChangeRecordCollect(formDTO.getId(), formDTO.getCustomerId(), icHouseDTO); icHouseDao.updateById(entity); - IcHouseDTO houseDTO = icHouseService.get(formDTO.getId()); + // IcHouseDTO houseDTO = icHouseService.get(formDTO.getId()); //删除房屋缓存 - icHouseRedis.delHouseInfo(formDTO.getId(), houseDTO.getCustomerId()); + icHouseRedis.delHouseInfo(formDTO.getId(), formDTO.getCustomerId()); } /** diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingServiceImpl.java index b08b903120..027199df87 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingServiceImpl.java @@ -21,6 +21,7 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.TypeReference; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; @@ -197,4 +198,23 @@ public class IcBuildingServiceImpl extends BaseServiceImpl().ok(baseDao.getBuildingDetail(buildingId)); } + /** + * 更新ic_building的楼长信息那4列:building_leader_name、building_leader_mobile、building_leader_id_card、building_leader_type + * + * @param updateList + */ + @Override + public void updateBuildingLeader(List updateList) { + updateList.forEach(dto -> { + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.eq(IcBuildingEntity::getId, dto.getId()) + .set(IcBuildingEntity::getBuildingLeaderName, dto.getBuildingLeaderName()) + .set(IcBuildingEntity::getBuildingLeaderMobile, dto.getBuildingLeaderMobile()) + .set(IcBuildingEntity::getBuildingLeaderIdCard, dto.getBuildingLeaderIdCard()) + .set(IcBuildingEntity::getBuildingLeaderType, dto.getBuildingLeaderType()) + .set(IcBuildingEntity::getUpdatedBy, dto.getUpdatedBy()) + .set(null != dto.getUpdatedTime(), IcBuildingEntity::getUpdatedTime, dto.getUpdatedTime()); + baseDao.update(null, updateWrapper); + }); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseServiceImpl.java index f5da256144..399c2df6b0 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseServiceImpl.java @@ -3,6 +3,7 @@ package com.epmet.service.impl; import com.alibaba.excel.EasyExcel; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.aop.NoRepeatSubmit; @@ -167,7 +168,16 @@ public class IcEnterpriseServiceImpl extends BaseServiceImpl update=new LambdaUpdateWrapper<>(); + update.eq(IcEnterprisePatrolRecordEntity::getId, formDTO.getPatrolId()) + .set(IcEnterprisePatrolRecordEntity::getPatrolTime, formDTO.getPatrolTime()) + .set(IcEnterprisePatrolRecordEntity::getStaffId, formDTO.getStaffId()) + .set(IcEnterprisePatrolRecordEntity::getStaffName, formDTO.getStaffName()) + .set(IcEnterprisePatrolRecordEntity::getMobile, formDTO.getMobile()) + .set(IcEnterprisePatrolRecordEntity::getResult, formDTO.getResult()) + .set(IcEnterprisePatrolRecordEntity::getDetailed, formDTO.getDetailed()) + .set(IcEnterprisePatrolRecordEntity::getReviewTime, formDTO.getReviewTime()); + enterprisePatrolRecordDao.update(null,update); //删除之前的图片 enterprisePatrolAttachmentDao.deleteByPatrolId(formDTO.getPatrolId(), formDTO.getUserId()); } @@ -184,7 +194,19 @@ public class IcEnterpriseServiceImpl extends BaseServiceImpl queryWrapper = new LambdaQueryWrapper(); + queryWrapper.eq(IcEnterprisePatrolRecordEntity::getEnterpriseId, formDTO.getEnterpriseId()) + .orderByDesc(IcEnterprisePatrolRecordEntity::getPatrolTime) + .orderByDesc(IcEnterprisePatrolRecordEntity::getCreatedTime) + .last("limit 1"); + IcEnterprisePatrolRecordEntity latestPatrol = enterprisePatrolRecordDao.selectOne(queryWrapper); + if (null != latestPatrol) { + // 更新主表的最新结果和最新检查时间 + baseDao.updateLatestPatrol(formDTO.getEnterpriseId(), latestPatrol.getPatrolTime(), latestPatrol.getResult(), formDTO.getUserId()); + }else{ + baseDao.updateLatestPatrol(formDTO.getEnterpriseId(), null, StrConstant.EPMETY_STR, formDTO.getUserId()); + } return patrolRecordEntity.getId(); } @@ -200,14 +222,27 @@ public class IcEnterpriseServiceImpl extends BaseServiceImpl patrolUpdate = new LambdaUpdateWrapper<>(); + patrolUpdate.eq(IcEnterprisePatrolRecordEntity::getId, patrolId) + .set(IcEnterprisePatrolRecordEntity::getUpdatedBy, currentUserId) + .set(IcEnterprisePatrolRecordEntity::getUpdatedTime, nowTime) + .set(IcEnterprisePatrolRecordEntity::getDelFlag, NumConstant.ONE_STR); + enterprisePatrolRecordDao.update(null, patrolUpdate); //2、删除之前的图片 enterprisePatrolAttachmentDao.deleteByPatrolId(patrolId, currentUserId); - //3、如果是记录清空,那主表的最近一次巡查时间和最新结果也置空 + // 3、如果是记录清空,那主表的最近一次巡查时间和最新结果也置空 LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.eq(IcEnterprisePatrolRecordEntity::getEnterpriseId, origin.getEnterpriseId()); - if (NumConstant.ZERO == enterprisePatrolRecordDao.selectCount(queryWrapper)) { + queryWrapper.eq(IcEnterprisePatrolRecordEntity::getEnterpriseId, origin.getEnterpriseId()) + .orderByDesc(IcEnterprisePatrolRecordEntity::getPatrolTime) + .orderByDesc(IcEnterprisePatrolRecordEntity::getCreatedTime) + .last("limit 1"); + IcEnterprisePatrolRecordEntity latestPatrol = enterprisePatrolRecordDao.selectOne(queryWrapper); + if (null != latestPatrol) { + // 更新主表的最新结果和最新检查时间 + baseDao.updateLatestPatrol(origin.getEnterpriseId(), latestPatrol.getPatrolTime(), latestPatrol.getResult(), currentUserId); + } else { baseDao.updateLatestPatrol(origin.getEnterpriseId(), null, StrConstant.EPMETY_STR, currentUserId); } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java index 72eec412ca..0f81c75531 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java @@ -439,17 +439,66 @@ public class IcHouseServiceImpl extends BaseServiceImpl type = new HashMap<>(); + resultDTO.setTotal(0); if (dto.getOrgType().equals("community") || dto.getOrgType().equals("street") ||dto.getOrgType().equals("district") ||dto.getOrgType().equals("city")){ dto.setOrgType("agency"); } - resultDTO.setList(baseDao.getHousePurposeCount(dto.getOrgId(),dto.getOrgType(),dto.getTimeStart(),dto.getTimeEnd())); - resultDTO.getList().forEach( - result->resultDTO.setTotal(resultDTO.getTotal()+result.getCount()) - ); + List list = baseDao.getHousePurposeCount(dto.getOrgId(),dto.getOrgType(),dto.getTimeStart(),dto.getTimeEnd()); + list.forEach( + result->{ + resultDTO.setTotal(resultDTO.getTotal()+result.getCount()); + type.put(result.getType(),result.getType()); + } + ); + HouseCountPictureListResultDTO houseCountPictureListResultDTO = new HouseCountPictureListResultDTO(); + if (type.get("1") == null){ + houseCountPictureListResultDTO = new HouseCountPictureListResultDTO(); + houseCountPictureListResultDTO.setType("1"); + houseCountPictureListResultDTO.setCount(0); + list.add(houseCountPictureListResultDTO); + } + if (type.get("2") == null){ + houseCountPictureListResultDTO = new HouseCountPictureListResultDTO(); + houseCountPictureListResultDTO.setType("2"); + houseCountPictureListResultDTO.setCount(0); + list.add(houseCountPictureListResultDTO); + } + if (type.get("3") == null){ + houseCountPictureListResultDTO = new HouseCountPictureListResultDTO(); + houseCountPictureListResultDTO.setType("3"); + houseCountPictureListResultDTO.setCount(0); + list.add(houseCountPictureListResultDTO); + } + if (type.get("4") == null){ + houseCountPictureListResultDTO = new HouseCountPictureListResultDTO(); + houseCountPictureListResultDTO.setType("4"); + houseCountPictureListResultDTO.setCount(0); + list.add(houseCountPictureListResultDTO); + } + if (type.get("5") == null){ + houseCountPictureListResultDTO = new HouseCountPictureListResultDTO(); + houseCountPictureListResultDTO.setType("5"); + houseCountPictureListResultDTO.setCount(0); + list.add(houseCountPictureListResultDTO); + } + if (type.get("6") == null){ + houseCountPictureListResultDTO = new HouseCountPictureListResultDTO(); + houseCountPictureListResultDTO.setType("6"); + houseCountPictureListResultDTO.setCount(0); + list.add(houseCountPictureListResultDTO); + } + if (type.get("7") == null){ + houseCountPictureListResultDTO = new HouseCountPictureListResultDTO(); + houseCountPictureListResultDTO.setType("7"); + houseCountPictureListResultDTO.setCount(0); + list.add(houseCountPictureListResultDTO); + } + resultDTO.setList(list); return resultDTO; } @@ -458,18 +507,51 @@ public class IcHouseServiceImpl extends BaseServiceImpl type = new HashMap<>(); + resultDTO.setTotal(0); if (dto.getOrgType().equals("community") || dto.getOrgType().equals("street") ||dto.getOrgType().equals("district") ||dto.getOrgType().equals("city")){ dto.setOrgType("agency"); } - resultDTO.setList(baseDao.getHouseStatusCount(dto.getOrgId(),dto.getOrgType(),dto.getTimeStart(),dto.getTimeEnd())); + List list =baseDao.getHouseStatusCount(dto.getOrgId(),dto.getOrgType(),dto.getTimeStart(),dto.getTimeEnd()); + + list.forEach( + result->{ + type.put(result.getType(),result.getType()); + resultDTO.setTotal(resultDTO.getTotal()+result.getCount()); + } - resultDTO.getList().forEach( - result->resultDTO.setTotal(resultDTO.getTotal()+result.getCount()) ); + HouseCountPictureListResultDTO houseCountPictureListResultDTO = new HouseCountPictureListResultDTO(); + if (type.get("1") == null){ + houseCountPictureListResultDTO = new HouseCountPictureListResultDTO(); + houseCountPictureListResultDTO.setType("1"); + houseCountPictureListResultDTO.setCount(0); + list.add(houseCountPictureListResultDTO); + } + if (type.get("2") == null){ + houseCountPictureListResultDTO = new HouseCountPictureListResultDTO(); + houseCountPictureListResultDTO.setType("2"); + houseCountPictureListResultDTO.setCount(0); + list.add(houseCountPictureListResultDTO); + } + if (type.get("3") == null){ + houseCountPictureListResultDTO = new HouseCountPictureListResultDTO(); + houseCountPictureListResultDTO.setType("3"); + houseCountPictureListResultDTO.setCount(0); + list.add(houseCountPictureListResultDTO); + } + if (type.get("0") == null){ + houseCountPictureListResultDTO = new HouseCountPictureListResultDTO(); + houseCountPictureListResultDTO.setType("0"); + houseCountPictureListResultDTO.setCount(0); + list.add(houseCountPictureListResultDTO); + } + resultDTO.setList(list); + return resultDTO; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java index 785bfc799f..f18b1b1b88 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java @@ -44,7 +44,6 @@ 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; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.CustomerGridConstant; @@ -55,6 +54,7 @@ import com.epmet.dto.form.IcNeighborHoodAddFormDTO; import com.epmet.dto.form.ImportInfoFormDTO; import com.epmet.dto.form.ImportTaskCommonFormDTO; import com.epmet.dto.form.NeighborHoodOptionFormDTO; +import com.epmet.dto.form.yt.ChooseGridFormDTO; import com.epmet.dto.result.*; import com.epmet.entity.*; import com.epmet.excel.IcNeighborHoodExcel; @@ -128,6 +128,12 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl page(Map params) { @@ -242,8 +248,7 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl getNeighborhoodList(TokenDto tokenDto, IcNeighborHoodDTO dto) { - dto.setCustomerId(tokenDto.getCustomerId()); + public List getNeighborhoodList(ChooseGridFormDTO dto) { // if (StringUtils.isBlank(dto.getAgencyId()) && StringUtils.isEmpty(dto.getGridId())) { // log.info("agencyId与gridId都为空时,默认查询当前工作人员所属组织下的小区"); // CustomerStaffInfoCacheResult result= CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); @@ -253,7 +258,9 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl list = icBuildingDao.listBuildingInfo(dto.getCustomerId(), dto.getAgencyId(), dto.getGridId(), dto.getBuildingName()); + return list; } /** @@ -641,8 +648,17 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl manager = new LambdaQueryWrapper().eq(CommunityBuildingManagerEntity::getBuildingId,info.getBuildingId()); + CommunityBuildingManagerEntity communityBuildingManagerEntity = communityBuildingManagerDao.selectOne(manager); + + + if (StringUtils.isNotBlank(info.getBuildingLeaderTypeNum())&& + StringUtils.isNotBlank(info.getBuildingLeaderIdCard())&& + StringUtils.isNotBlank(info.getBuildingLeaderMobile())&& + StringUtils.isNotBlank(info.getBuildingLeaderName())){ + + if (communityBuildingManagerEntity!=null){ + communityBuildingManagerEntity.setIdCard(info.getBuildingLeaderIdCard()); + communityBuildingManagerEntity.setPhone(info.getBuildingLeaderMobile()); + communityBuildingManagerEntity.setType(info.getBuildingLeaderTypeNum()); + communityBuildingManagerEntity.setName(info.getBuildingLeaderName()); + communityBuildingManagerDao.updateById(communityBuildingManagerEntity); + }else{ + communityBuildingManagerEntity= new CommunityBuildingManagerEntity(); + communityBuildingManagerEntity.setIdCard(info.getBuildingLeaderIdCard()); + communityBuildingManagerEntity.setPhone(info.getBuildingLeaderMobile()); + communityBuildingManagerEntity.setType(info.getBuildingLeaderTypeNum()); + communityBuildingManagerEntity.setName(info.getBuildingLeaderName()); + communityBuildingManagerEntity.setBuildingId(building.getId()); + IcBuildingEntity buildingEntity = icBuildingDao.selectById(building.getId()); + if (buildingEntity.getNeighborHoodId()!=null){ + communityBuildingManagerEntity.setViliageId(buildingEntity.getNeighborHoodId()); + IcNeighborHoodEntity neighborHood = neighborHoodDao.selectById(buildingEntity.getNeighborHoodId()); + communityBuildingManagerEntity.setGridId(neighborHood.getGridId()); + communityBuildingManagerEntity.setOrgIdPath(neighborHood.getAgencyPids()+":"+neighborHood.getAgencyId()+":"+neighborHood.getGridId()); + + List agencyIds = new ArrayList<>(Arrays.asList(neighborHood.getAgencyPids().split(":"))); + agencyIds.add(neighborHood.getAgencyId()); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper().in(CustomerAgencyEntity::getId,agencyIds); + List customerAgencyEntities = customerAgencyDao.selectList(queryWrapper); + for (CustomerAgencyEntity customerAgencyEntity : customerAgencyEntities) { + if (customerAgencyEntity.getLevel().equals("community")){ + communityBuildingManagerEntity.setCommunityId(customerAgencyEntity.getId()); + } + if (customerAgencyEntity.getLevel().equals("street")){ + communityBuildingManagerEntity.setStreetId(customerAgencyEntity.getId()); + } + if (customerAgencyEntity.getLevel().equals("district")){ + communityBuildingManagerEntity.setDistrictId(customerAgencyEntity.getId()); + } + } + } + communityBuildingManagerDao.insert(communityBuildingManagerEntity); + + } + + }else{ + if (communityBuildingManagerEntity!=null){ + communityBuildingManagerDao.deleteById(communityBuildingManagerEntity); + } + } + } return building.getId(); } @@ -698,6 +769,42 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl agencyIds = new ArrayList<>(Arrays.asList(neighborHood.getAgencyPids().split(":"))); + agencyIds.add(neighborHood.getAgencyId()); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper().in(CustomerAgencyEntity::getId,agencyIds); + List customerAgencyEntities = customerAgencyDao.selectList(queryWrapper); + for (CustomerAgencyEntity customerAgencyEntity : customerAgencyEntities) { + if (customerAgencyEntity.getLevel().equals("community")){ + communityBuildingManagerEntity.setCommunityId(customerAgencyEntity.getId()); + } + if (customerAgencyEntity.getLevel().equals("street")){ + communityBuildingManagerEntity.setStreetId(customerAgencyEntity.getId()); + } + if (customerAgencyEntity.getLevel().equals("district")){ + communityBuildingManagerEntity.setDistrictId(customerAgencyEntity.getId()); + } + } + communityBuildingManagerDao.insert(communityBuildingManagerEntity); + } + + if (null != info.getTotalUnitNum() && info.getTotalUnitNum() > NumConstant.ZERO) { //设置楼宇单元 List unitList = new ArrayList<>(); @@ -813,6 +920,27 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl needUpdateList) { + + needUpdateList.forEach( + needUpdate->{ + if (StringUtils.isNotBlank(needUpdate.getViliageTypeName())){ + if (needUpdate.getViliageTypeName().equals("自然村")){ + needUpdate.setViliageType("2"); + } + if (needUpdate.getViliageTypeName().equals("住宅小区")){ + needUpdate.setViliageType("1"); + } + } + if (StringUtils.isNotBlank(needUpdate.getOpenTypeName())){ + if (needUpdate.getOpenTypeName().equals("封闭式")){ + needUpdate.setOpenType("1"); + } + if (needUpdate.getOpenTypeName().equals("开放式")){ + needUpdate.setOpenType("2"); + } + } + }); + if (CollectionUtils.isNotEmpty(needUpdateList)){ baseDao.updateNeighborHood(needUpdateList); } @@ -853,6 +981,23 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl().ok(result); } @@ -874,9 +1019,20 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl queryNeighborHoodOptionsYanTai(NeighborHoodOptionFormDTO formDTO) { + if (StringUtils.isBlank(formDTO.getGridId()) && StringUtils.isBlank(formDTO.getAgencyId())) { + // 默认查询当前工作人员所属组织及下级的 + CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + formDTO.setAgencyId(staffInfoCacheResult.getAgencyId()); + } + List list = baseDao.queryNeighborHoodOptionsYanTai(formDTO.getCustomerId(),formDTO.getAgencyId(),formDTO.getGridId(),formDTO.getNeighborHoodName()); + return list; + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPropertyManagementServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPropertyManagementServiceImpl.java index 4296911e8d..421f59838f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPropertyManagementServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPropertyManagementServiceImpl.java @@ -17,6 +17,7 @@ package com.epmet.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; @@ -97,4 +98,10 @@ public class IcPropertyManagementServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPropertyManagementEntity::getCustomerId,customerId).eq(IcPropertyManagementEntity::getName,name); + return baseDao.selectOne(wrapper); + } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/PropertyManagementServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/PropertyManagementServiceImpl.java index 41d2f7bfbc..558383ed73 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/PropertyManagementServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/PropertyManagementServiceImpl.java @@ -1,37 +1,75 @@ package com.epmet.service.impl; +import com.alibaba.excel.EasyExcel; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.EpmetRequestHolder; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.*; +import com.epmet.constants.ImportTaskConstants; import com.epmet.dao.IcNeighborHoodPropertyDao; import com.epmet.dao.IcPropertyManagementDao; +import com.epmet.dto.IcNeighborHoodDTO; import com.epmet.dto.IcPropertyManagementDTO; import com.epmet.dto.form.IcPropertyManagementFormDTO; +import com.epmet.dto.form.ImportTaskCommonFormDTO; import com.epmet.dto.result.IcPropertyManagementResultDTO; +import com.epmet.dto.result.UploadImgResultDTO; import com.epmet.entity.IcNeighborHoodPropertyEntity; import com.epmet.entity.IcPropertyManagementEntity; +import com.epmet.excel.handler.IcPropertyManagementImportListener; +import com.epmet.excel.yt.IcPropertyManagementImportExcelData; +import com.epmet.feign.EpmetCommonServiceOpenFeignClient; +import com.epmet.feign.OssFeignClient; import com.epmet.service.PropertyManagementService; +import com.epmet.utils.ImportTaskUtils; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.fileupload.FileItem; +import org.apache.commons.fileupload.disk.DiskFileItemFactory; +import org.apache.commons.lang3.StringUtils; +import org.apache.http.entity.ContentType; +import org.apache.poi.util.IOUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.commons.CommonsMultipartFile; import javax.annotation.Resource; +import java.io.IOException; +import java.io.OutputStream; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.ArrayList; +import java.util.Date; import java.util.List; +import java.util.UUID; +import java.util.stream.Collectors; @Slf4j @Service public class PropertyManagementServiceImpl implements PropertyManagementService { + /** + * 物业表 + */ @Resource private IcPropertyManagementDao icPropertyManagementDao; @Resource private IcNeighborHoodPropertyDao icNeighborHoodPropertyDao; + @Autowired + private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; + @Autowired + private OssFeignClient ossFeignClient; /** * 查询当前客户下的物业 @@ -55,55 +93,289 @@ public class PropertyManagementServiceImpl implements PropertyManagementService /** * 新增物业 * 名称客户下唯一 + * * @param formDTO * @return */ @Override @Transactional(rollbackFor = Exception.class) public String add(IcPropertyManagementFormDTO formDTO) { - //物业名字平台内唯一 - //如果输入的物业名字已经存在,直接返回物业id + // 物业名字平台内唯一 + // 如果输入的物业名字已经存在,直接返回物业id formDTO.setName(formDTO.getName().trim()); - IcPropertyManagementEntity entity = icPropertyManagementDao.selectByName(formDTO.getCustomerId(),formDTO.getName(),null); + IcPropertyManagementEntity entity = icPropertyManagementDao.selectByName(formDTO.getCustomerId(), formDTO.getName(), null); if (null != entity) { - return entity.getId(); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "物业名称已存在", "物业名称已存在"); } IcPropertyManagementEntity icPropertyManagementEntity = ConvertUtils.sourceToTarget(formDTO, IcPropertyManagementEntity.class); icPropertyManagementDao.insert(icPropertyManagementEntity); + if (CollectionUtils.isNotEmpty(formDTO.getNeighborHoodIdList())) { + formDTO.getNeighborHoodIdList().forEach(neighborHoodId -> { + // 插入小区物业关系表 + IcNeighborHoodPropertyEntity neighborHoodPropertyEntity = new IcNeighborHoodPropertyEntity(); + neighborHoodPropertyEntity.setPropertyId(icPropertyManagementEntity.getId()); + neighborHoodPropertyEntity.setNeighborHoodId(neighborHoodId); + icNeighborHoodPropertyDao.insert(neighborHoodPropertyEntity); + }); + } return icPropertyManagementEntity.getId(); } + /** + * 物业管理-修改 + * + * @param formDTO + */ @Override @Transactional(rollbackFor = Exception.class) public void update(IcPropertyManagementFormDTO formDTO) { - IcPropertyManagementEntity entity = icPropertyManagementDao.selectByName(EpmetRequestHolder.getLoginUserCustomerId(),formDTO.getName(),formDTO.getId()); + IcPropertyManagementEntity entity = icPropertyManagementDao.selectByName(EpmetRequestHolder.getLoginUserCustomerId(), formDTO.getName(), formDTO.getId()); if (null != entity) { - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"物业名称已存在","物业名称已存在"); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "物业名称已存在", "物业名称已存在"); + } + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.eq(IcPropertyManagementEntity::getId, formDTO.getId()) + .set(IcPropertyManagementEntity::getName, formDTO.getName()) + .set(IcPropertyManagementEntity::getContactName, formDTO.getContactName()) + .set(IcPropertyManagementEntity::getContactMobile, formDTO.getContactMobile()) + .set(IcPropertyManagementEntity::getUpdatedTime, new Date()) + .set(IcPropertyManagementEntity::getUpdatedBy, EpmetRequestHolder.getLoginUserId()); + icPropertyManagementDao.update(null, updateWrapper); + CustomerStaffInfoCacheResult staffInfoCacheResult= CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(),EpmetRequestHolder.getLoginUserId()); + + // 查询当前物业,在本组织及下级范围内,管理的小区 + List originNeighborHoodList = icNeighborHoodPropertyDao.getNeighborHoodList(formDTO.getId(), staffInfoCacheResult.getAgencyId()); + // 原来存在关联的小区,现在取消勾选了,需要删除物业小区关系表 + originNeighborHoodList.forEach(origin -> { + // 举例:原来管理A小区,现在取消勾选 + if (!formDTO.getNeighborHoodIdList().contains(origin.getId())) { + LambdaUpdateWrapper updateWrapper1 = new LambdaUpdateWrapper<>(); + updateWrapper1.eq(IcNeighborHoodPropertyEntity::getPropertyId, formDTO.getId()) + .eq(IcNeighborHoodPropertyEntity::getNeighborHoodId, origin.getId()) + .set(IcNeighborHoodPropertyEntity::getDelFlag, NumConstant.ONE_STR) + .set(IcNeighborHoodPropertyEntity::getUpdatedTime, new Date()) + .set(IcNeighborHoodPropertyEntity::getUpdatedBy, EpmetRequestHolder.getLoginUserId()); + icNeighborHoodPropertyDao.update(null, updateWrapper1); + } + }); + if (CollectionUtils.isNotEmpty(formDTO.getNeighborHoodIdList())) { + formDTO.getNeighborHoodIdList().forEach(neighborHoodId -> { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(IcNeighborHoodPropertyEntity::getPropertyId, formDTO.getId()) + .eq(IcNeighborHoodPropertyEntity::getNeighborHoodId, neighborHoodId); + if (icNeighborHoodPropertyDao.selectCount(queryWrapper) < NumConstant.ONE) { + // 插入小区物业关系表 + IcNeighborHoodPropertyEntity neighborHoodPropertyEntity = new IcNeighborHoodPropertyEntity(); + neighborHoodPropertyEntity.setPropertyId(formDTO.getId()); + neighborHoodPropertyEntity.setNeighborHoodId(neighborHoodId); + icNeighborHoodPropertyDao.insert(neighborHoodPropertyEntity); + } + //原本已经存在小区和物业的关系,不用再插入 + }); } - IcPropertyManagementEntity icPropertyManagementEntity = ConvertUtils.sourceToTarget(formDTO, IcPropertyManagementEntity.class); - icPropertyManagementDao.updateById(icPropertyManagementEntity); } /** * 单个删除 - * @param formDTO + * + * @param id */ @Override @Transactional(rollbackFor = Exception.class) - public void delete(IcPropertyManagementFormDTO formDTO) { - LambdaQueryWrapper queryWrapper=new LambdaQueryWrapper<>(); - queryWrapper.eq(IcNeighborHoodPropertyEntity::getPropertyId,formDTO.getId()); - if (icNeighborHoodPropertyDao.selectCount(queryWrapper) > 0) { - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"物业存在与小区关联,无法删除","已与小区关联,无法删除"); + public void delete(String id) { + Date now = new Date(); + // 删除物业与小区关联关系表 + LambdaUpdateWrapper updateWrapper1 = new LambdaUpdateWrapper<>(); + updateWrapper1.eq(IcNeighborHoodPropertyEntity::getPropertyId, id) + .set(IcNeighborHoodPropertyEntity::getDelFlag, NumConstant.ONE_STR) + .set(IcNeighborHoodPropertyEntity::getUpdatedTime, now) + .set(IcNeighborHoodPropertyEntity::getUpdatedBy, EpmetRequestHolder.getLoginUserId()); + icNeighborHoodPropertyDao.update(null, updateWrapper1); + // 删除物业表 + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.eq(IcPropertyManagementEntity::getId, id) + .set(IcPropertyManagementEntity::getDelFlag, NumConstant.ONE_STR) + .set(IcPropertyManagementEntity::getUpdatedTime, now) + .set(IcPropertyManagementEntity::getUpdatedBy, EpmetRequestHolder.getLoginUserId()); + icPropertyManagementDao.update(null, updateWrapper); + } + + + /** + * 物业管理批量删除 + * + * @param ids + * @return 返回失败的id列表 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public List deleteBatch(List ids) { + if (CollectionUtils.isEmpty(ids)) { + return new ArrayList<>(); } - icPropertyManagementDao.deleteById(formDTO.getId()); + List failedIdList = new ArrayList<>(); + for (String id : ids) { + Boolean res =true; + try{ + //调用单挑删除方法 + delete(id); + }catch(EpmetException e){ + res=false; + } + if (!res) { + failedIdList.add(id); + } + } + return failedIdList; } + + /** + * 物业管理-列表查询 + * + * @param pageNo + * @param pageSize + * @param name 物业名称 + * @param contactName 物业联系人 + * @param contactMobile 联系电话 + * @return + */ @Override - public PageData page(Integer pageNo, Integer pageSize, String name) { - PageHelper.startPage(pageNo,pageSize); - List list=icPropertyManagementDao.queryList(EpmetRequestHolder.getLoginUserCustomerId(),name); + public PageData page(Integer pageNo, Integer pageSize, String name, String contactName, String contactMobile) { + CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), EpmetRequestHolder.getLoginUserId()); + PageHelper.startPage(pageNo, pageSize); + List list = icPropertyManagementDao.queryList(EpmetRequestHolder.getLoginUserCustomerId(), name, contactName, contactMobile, staffInfoCacheResult.getAgencyId()); PageInfo pageInfo = new PageInfo<>(list); - return new PageData<>(list, pageInfo.getTotal()); + // 导出时需要导出关联的小区名称 + pageInfo.getList().forEach(result -> { + List neighborHoodList = icNeighborHoodPropertyDao.getNeighborHoodList(result.getId(), staffInfoCacheResult.getAgencyId()); + List neighborHoodNames = neighborHoodList.stream() + .map(IcNeighborHoodDTO::getNeighborHoodName) + .distinct().collect(Collectors.toList()); + result.setNeighborHoodNames(CollectionUtils.isNotEmpty(neighborHoodList) ? StringUtils.join(neighborHoodNames, StrConstant.COMMA_ZH) : StrConstant.EPMETY_STR); + result.setNeighborHoodList(neighborHoodList); + result.setTotalNeighborHood(CollectionUtils.isNotEmpty(neighborHoodList)?neighborHoodList.size():NumConstant.ZERO); + }); + return new PageData<>(list, pageInfo.getTotal(), pageSize); } + + /** + * 查看物业详情 + * + * @param id + * @return + */ + @Override + public IcPropertyManagementDTO getDetail(String id) { + CustomerStaffInfoCacheResult staffInfoCacheResult= CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(),EpmetRequestHolder.getLoginUserId()); + IcPropertyManagementEntity icPropertyManagementEntity = icPropertyManagementDao.selectById(id); + if (null == icPropertyManagementEntity) { + return null; + } + IcPropertyManagementDTO resultDto = ConvertUtils.sourceToTarget(icPropertyManagementEntity, IcPropertyManagementDTO.class); + List neighborHoodList = icNeighborHoodPropertyDao.getNeighborHoodList(id,staffInfoCacheResult.getAgencyId()); + List neighborHoodNames = neighborHoodList.stream() + .map(IcNeighborHoodDTO::getNeighborHoodName) + .distinct().collect(Collectors.toList()); + resultDto.setNeighborHoodNames(CollectionUtils.isNotEmpty(neighborHoodList) ? StringUtils.join(neighborHoodNames, StrConstant.COMMA_ZH) : StrConstant.EPMETY_STR); + resultDto.setNeighborHoodList(neighborHoodList); + resultDto.setTotalNeighborHood(CollectionUtils.isNotEmpty(neighborHoodList)?neighborHoodList.size():NumConstant.ZERO); + return resultDto; + } + + /** + * 执行Excel导入 + * + * @param filePath + * @param importTaskId + */ + @Async + @Override + public void execAsyncExcelImport(Path filePath, String importTaskId) { + String userId = null; + try { + userId = EpmetRequestHolder.getLoginUserId(); + String customerId = EpmetRequestHolder.getLoginUserCustomerId(); + + IcPropertyManagementImportListener listener = new IcPropertyManagementImportListener(customerId, SpringContextUtils.getBean(IcPropertyManagementServiceImpl.class)); + + EasyExcel.read(filePath.toFile(), IcPropertyManagementImportExcelData.class, listener).headRowNumber(1).sheet(0).doRead(); + + String errorDesFileUrl = null; + + List errorRows = listener.getErrorRows(); + + boolean failed = errorRows.size() > 0; + + // 合并到一起写入 + // errorRows.addAll(otherRows); + + // 生成并上传描述文件 + OutputStream os = null; + FileItem fileItem = null; + if (errorRows.size() > 0) { + try { + // 文件生成 + Path errorDescDir = FileUtils.getAndCreateDirUnderEpmetFilesDir(ImportTaskConstants.IC_PROPERTY_MANAGEMENT, "import", "error_des"); + String fileName = UUID.randomUUID().toString().concat(".xlsx"); + + fileItem = new DiskFileItemFactory(DiskFileItemFactory.DEFAULT_SIZE_THRESHOLD, errorDescDir.toFile()) + .createItem("file", ContentType.APPLICATION_OCTET_STREAM.toString(), false, fileName); + os = fileItem.getOutputStream(); + + EasyExcel.write(os, IcPropertyManagementImportExcelData.ErrorRow.class).sheet("信息列表").doWrite(errorRows); + // 文件上传oss + Result errorDesFileUploadResult = ossFeignClient.uploadImportTaskDescFile(new CommonsMultipartFile(fileItem)); + if (errorDesFileUploadResult.success()) { + errorDesFileUrl = errorDesFileUploadResult.getData().getUrl(); + } + + } finally { + IOUtils.closeQuietly(os); + if (!fileItem.isInMemory()) { + try { + fileItem.delete(); + } catch (Exception e) { + log.error("【物业管理表ic_property_management】删除错误描述临时文件失败:{}", ExceptionUtils.getErrorStackTrace(e)); + } + } + } + } + + Result result = ImportTaskUtils.finishImportTask( + importTaskId, + failed ? ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL : ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS, + errorDesFileUrl, + ""); + + if (!result.success()) { + log.error("【物业管理表ic_property_management】finishImportTask失败"); + } + } catch (Exception e) { + String errorMsg = ExceptionUtils.getErrorStackTrace(e); + log.error("【物业管理表ic_property_management】出错:{}", errorMsg); + + ImportTaskCommonFormDTO importFinishTaskForm = new ImportTaskCommonFormDTO(); + importFinishTaskForm.setTaskId(importTaskId); + importFinishTaskForm.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL); + importFinishTaskForm.setOperatorId(userId); + importFinishTaskForm.setResultDesc("物业管理表导入失败:系统异常,请查看系统日志"); + + Result result = commonServiceOpenFeignClient.finishImportTask(importFinishTaskForm); + if (!result.success()) { + log.error("【物业管理表ic_property_management】导入记录状态修改为'完成'失败"); + } + } finally { + // 删除临时文件 + if (Files.exists(filePath)) { + try { + Files.delete(filePath); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + } + + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffLoginLogServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffLoginLogServiceImpl.java index a47241caf1..cd56d4dac1 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffLoginLogServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffLoginLogServiceImpl.java @@ -9,17 +9,20 @@ import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.utils.EpmetRequestHolder; +import com.epmet.commons.tools.utils.PidUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.SpringContextUtils; +import com.epmet.dao.CustomerAgencyDao; import com.epmet.dao.StaffLoginLogDao; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.form.yt.CommunityLoginFormDTO; import com.epmet.dto.form.yt.CountActivityFormDTO; +import com.epmet.dto.result.yt.AccountActivityInfo; import com.epmet.dto.result.yt.ActivityTatalInfo; import com.epmet.dto.result.yt.CommunityLoginResultDTO; import com.epmet.dto.result.yt.LoginLogCountByLevelResultDTO; -import com.epmet.dto.result.yt.AccountActivityInfo; +import com.epmet.entity.CustomerAgencyEntity; import com.epmet.entity.StaffLoginLogEntity; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.service.CustomerAgencyService; @@ -32,6 +35,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -45,6 +49,8 @@ import java.util.List; public class StaffLoginLogServiceImpl extends BaseServiceImpl implements StaffLoginLogService { @Autowired private EpmetUserOpenFeignClient userOpenFeignClient; + @Autowired + private CustomerAgencyDao customerAgencyDao; /** @@ -217,12 +223,12 @@ public class StaffLoginLogServiceImpl extends BaseServiceImpl list = baseDao.pageCommunityCount(formDTO.getOrgId(), formDTO.getStartDate(), formDTO.getEndDate()); + List list = baseDao.pageCommunityCount(formDTO.getOrgId(), formDTO.getStartDate(), formDTO.getEndDate(),formDTO.getDataRange()); PageInfo pageInfo = new PageInfo<>(list); return new PageData<>(list, pageInfo.getTotal(), formDTO.getPageSize()); } // 不分页 - List list = baseDao.pageCommunityCount(formDTO.getOrgId(), formDTO.getStartDate(), formDTO.getEndDate()); + List list = baseDao.pageCommunityCount(formDTO.getOrgId(), formDTO.getStartDate(), formDTO.getEndDate(),formDTO.getDataRange()); int total = CollectionUtils.isEmpty(list) ? NumConstant.ZERO : list.size(); return new PageData<>(list, total, total); } @@ -242,8 +248,31 @@ public class StaffLoginLogServiceImpl extends BaseServiceImpl list = baseDao.selectCommunityCount(orgId, startDate, endDate); + int total = CollectionUtils.isEmpty(list) ? NumConstant.ZERO : list.size(); + return new PageData(list, total, total); } - List list = baseDao.querySubCount(orgId, startDate, endDate); + //先查询出下级组织 + LambdaQueryWrapper agencyWrapper=new LambdaQueryWrapper<>(); + agencyWrapper.eq(CustomerAgencyEntity::getPid,orgId).orderByAsc(CustomerAgencyEntity::getCreatedTime); + List subAgencyList=customerAgencyDao.selectList(agencyWrapper); + List list=new ArrayList<>(); + //横坐标展示所有组织 + for(CustomerAgencyEntity agencyEntity:subAgencyList){ + CommunityLoginResultDTO resultDTO=new CommunityLoginResultDTO(); + resultDTO.setAgencyId(agencyEntity.getId()); + resultDTO.setAgencyName(agencyEntity.getOrganizationName()); + resultDTO.setAgencyLevel(agencyEntity.getLevel()); + String orgIdPath=PidUtils.convertPid2OrgIdPath(agencyEntity.getId(),agencyEntity.getPids()); + //查询本组织及下级登录次数!!!!!!!! + resultDTO.setCount(baseDao.selectLoginTotalByPath(orgIdPath,startDate,endDate)); + list.add(resultDTO); + } + // List list = baseDao.querySubCount(orgId, startDate, endDate); int total = CollectionUtils.isEmpty(list) ? NumConstant.ZERO : list.size(); return new PageData(list, total, total); } @@ -307,4 +336,20 @@ public class StaffLoginLogServiceImpl extends BaseServiceImpl(list, total, total); } + + /** + * 柱状图点击区县,查看街道,调用此接口 + * 计算的是街道的工作人员+街道下所有社区的人 的总次数 + * @return + */ + @Override + public PageData streetTotal(String orgId, Date startDate, Date endDate,Integer pageNo, Integer pageSize){ + PageHelper.startPage(pageNo, pageSize); + // todo + List list = baseDao.selectStreetTotal(orgId, startDate, endDate); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal(), pageSize); + } + + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java index a81f868ac5..8c74a45df3 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java @@ -1,18 +1,21 @@ package com.epmet.service.impl; +import com.alibaba.excel.EasyExcel; +import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.security.dto.TokenDto; -import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.*; import com.epmet.constant.OrgInfoConstant; +import com.epmet.constants.ImportTaskConstants; import com.epmet.dao.CustomerStaffAgencyDao; import com.epmet.dao.StaffOrgRelationDao; import com.epmet.dto.*; @@ -20,17 +23,31 @@ import com.epmet.dto.form.*; import com.epmet.dto.form.yantai.YtSyncStaffIdFormDTO; import com.epmet.dto.result.*; import com.epmet.entity.*; +import com.epmet.excel.CustomerStaffImportExcelData; +import com.epmet.excel.handler.CustomerStaffImportListener; import com.epmet.feign.*; +import com.epmet.remote.EpmetUserRemoteService; import com.epmet.service.*; +import com.epmet.utils.ImportTaskUtils; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.fileupload.FileItem; +import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.lang3.StringUtils; +import org.apache.http.entity.ContentType; +import org.apache.poi.util.IOUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.commons.CommonsMultipartFile; import javax.annotation.Resource; +import java.io.IOException; +import java.io.OutputStream; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -41,6 +58,7 @@ import java.util.stream.Collectors; * @dscription * @date 2020/4/23 18:05 */ +@Slf4j @Service public class StaffServiceImpl implements StaffService { private static final Logger logger = LoggerFactory.getLogger(StaffServiceImpl.class); @@ -80,6 +98,10 @@ public class StaffServiceImpl implements StaffService { private GovAccessFeignClient govAccessFeignClient; @Autowired private EpmetThirdOpenFeignClient epmetThirdOpenFeignClient; + @Autowired + private EpmetUserRemoteService userRemoteService; + @Autowired + private OssFeignClient ossFeignClient; @Override public Result getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) { @@ -745,5 +767,180 @@ public class StaffServiceImpl implements StaffService { return list; } + @Override + public void execAsyncExcelImport(Path filePath, String importTaskId,String orgType, String orgId) { + + try { + + CustomerStaffImportListener listener = new CustomerStaffImportListener(userRemoteService.getLoginUserDetails().getUserId(), userRemoteService.getLoginUserDetails().getCustomerId(), orgType,orgId,this); + + EasyExcel.read(filePath.toFile(), CustomerStaffImportExcelData.class, listener).headRowNumber(1).sheet(0).doRead(); + + String errorDesFileUrl = null; + + List errorRows = listener.getErrorRows(); + List otherRows = listener.getOtherRows(); + + boolean failed = errorRows.size() > 0; + + // 合并到一起写入 + errorRows.addAll(otherRows); + + // 生成并上传描述文件 + OutputStream os = null; + FileItem fileItem = null; + if (errorRows.size() > 0) { + try { + // 文件生成 + Path errorDescDir = FileUtils.getAndCreateDirUnderEpmetFilesDir("staff", "import", "error_des"); + String timeMillis = String.valueOf(System.currentTimeMillis()); + String fileName = "staff_import_error_".concat(timeMillis).concat(".xlsx"); + + fileItem = new DiskFileItemFactory(DiskFileItemFactory.DEFAULT_SIZE_THRESHOLD, errorDescDir.toFile()) + .createItem("file", ContentType.APPLICATION_OCTET_STREAM.toString(), false, fileName); + + os = fileItem.getOutputStream(); + + EasyExcel.write(os, CustomerStaffImportExcelData.RowRemarkMessage.class).sheet("信息列表").doWrite(errorRows); + // 文件上传oss + Result errorDesFileUploadResult = ossFeignClient.uploadImportTaskDescFile(new CommonsMultipartFile(fileItem)); + if (errorDesFileUploadResult.success()) { + errorDesFileUrl = errorDesFileUploadResult.getData().getUrl(); + } + } finally { + IOUtils.closeQuietly(os); + try { + fileItem.delete(); + } catch (Exception e){ + log.error("【客户信息导入】删除临时描述文件失败:{}", ExceptionUtils.getErrorStackTrace(e)); + } + } + } + + // 完成导入 + Result result = ImportTaskUtils.finishImportTask(importTaskId, + failed ? ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL : ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS, + errorDesFileUrl, + ""); + + if (!result.success()) { + log.error("【客户信息导入】导入记录状态修改为'finished_success'失败"); + } + } catch (Exception e) { + String errorMsg = ExceptionUtils.getErrorStackTrace(e); + log.error("【客户信息导入】出错:{}", errorMsg); + + Result result = ImportTaskUtils.finishImportTask(importTaskId, ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL, null, "导入失败"); + + if (!result.success()) { + log.error("【客户信息导入】导入记录状态修改为'finished_fail'失败"); + } + } finally { + // 删除临时文件 + if (Files.exists(filePath)) { + try { + Files.delete(filePath); + } catch (IOException e) { + log.error("method exception", e); + } + } + } + } + + /** + * 批量持久化 + * @param addStaffV2FromDTOList + */ + public void exportAdd(List addStaffV2FromDTOList, CustomerStaffImportListener listener) { + + addStaffV2FromDTOList.forEach(fromDTO -> { + + //1.根据新增人员类型判断查询机关信息 + OrgResultDTO orgDTO = customerAgencyDao.selectAgencyDetail(fromDTO.getOrgId(), fromDTO.getOrgType()); + if (null == orgDTO) { + logger.warn(String.format("工作人员新增,根据新增人员组织类型未查询到相关组织信息,orgId->%s,orgType->%s", fromDTO.getOrgId(), fromDTO.getOrgType())); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"根据新增人员组织类型未查询到相关组织信息","组织不存在"); + } + + //2.调用user服务,新增用户信息 + StaffSubmitFromDTO submitDTO = ConvertUtils.sourceToTarget(fromDTO, StaffSubmitFromDTO.class); + submitDTO.setAgencyId(orgDTO.getAgencyId()); + Result result = epmetUserFeignClient.addStaff(submitDTO); + if (!result.success()) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),result.getInternalMsg(),result.getMsg()); + } + + //3.人员机关表总人数加一、关系表新增关系数据 + //人员机关关系表 + CustomerStaffAgencyEntity customerStaffAgencyEntity = new CustomerStaffAgencyEntity(); + customerStaffAgencyEntity.setCustomerId(fromDTO.getCustomerId()); + customerStaffAgencyEntity.setUserId(result.getData().getUserId()); + customerStaffAgencyEntity.setAgencyId(orgDTO.getAgencyId()); + customerStaffAgencyService.insert(customerStaffAgencyEntity); + //机关总人数加一 + CustomerAgencyEntity agencyEntity = new CustomerAgencyEntity(); + agencyEntity.setId(orgDTO.getAgencyId()); + agencyEntity.setTotalUser(orgDTO.getTotalUser() + 1); + customerAgencyService.updateById(agencyEntity); + + //4.部门、网格主表、关系表修改、新增数据 + if ("dept".equals(fromDTO.getOrgType())) { + CustomerStaffDepartmentEntity dept = new CustomerStaffDepartmentEntity(); + dept.setCustomerId(fromDTO.getCustomerId()); + dept.setUserId(result.getData().getUserId()); + dept.setDepartmentId(fromDTO.getOrgId()); + customerStaffDepartmentService.insert(dept); + CustomerDepartmentEntity departmentEntity = new CustomerDepartmentEntity(); + departmentEntity.setId(fromDTO.getOrgId()); + departmentEntity.setTotalUser(orgDTO.getDeptTotalUser() + 1); + customerDepartmentService.updateById(departmentEntity); + } + if ("grid".equals(fromDTO.getOrgType())) { + CustomerStaffGridEntity grid = new CustomerStaffGridEntity(); + grid.setCustomerId(fromDTO.getCustomerId()); + grid.setUserId(result.getData().getUserId()); + grid.setGridId(fromDTO.getOrgId()); + customerStaffGridService.insert(grid); + CustomerGridEntity gridEntity = new CustomerGridEntity(); + gridEntity.setId(fromDTO.getOrgId()); + gridEntity.setTotalUser(orgDTO.getGridTotalUser() + 1); + customerGridService.updateById(gridEntity); + } + + //5.工作人员注册组织关系表新增数据 + StaffOrgRelationEntity staffOrgRelationEntity = new StaffOrgRelationEntity(); + staffOrgRelationEntity.setCustomerId(fromDTO.getCustomerId()); + if("agency".equals(fromDTO.getOrgType())){ + staffOrgRelationEntity.setPids(("".equals(orgDTO.getPids()) ? "" : orgDTO.getPids())); + }else { + staffOrgRelationEntity.setPids(("".equals(orgDTO.getPids()) ? "" : orgDTO.getPids() + ":") + orgDTO.getAgencyId()); + } + staffOrgRelationEntity.setStaffId(result.getData().getUserId()); + staffOrgRelationEntity.setOrgId(fromDTO.getOrgId()); + staffOrgRelationEntity.setOrgType(fromDTO.getOrgType()); + staffOrgRelationService.insert(staffOrgRelationEntity); + + if (CollectionUtils.isNotEmpty(fromDTO.getNewRoles())){ + Result roleUserAccess = govAccessFeignClient.roleUser(new RoleUserFormDTO(fromDTO.getNewRoles(), customerStaffAgencyEntity.getUserId(),fromDTO.getCustomerId())); + if (!roleUserAccess.success()){ + throw new EpmetException("save data to gov-role-user failure"); + } + } + //如果是烟台的需要更新 根据手机号+姓名 更新data_sync_user_data置为已创建、记录staffId + // 开发环境默认:45687aa479955f9d06204d415238f7cc + // 测试环境:0c41b272ee9ee95ac6f184ad548a30eb + // 烟台: 1535072605621841922 + if ("1535072605621841922".equals(fromDTO.getCustomerId()) + || "45687aa479955f9d06204d415238f7cc".equals(fromDTO.getCustomerId()) + || "0c41b272ee9ee95ac6f184ad548a30eb".equals(fromDTO.getCustomerId())) { + YtSyncStaffIdFormDTO ytSyncStaffIdFormDTO = ConvertUtils.sourceToTarget(fromDTO,YtSyncStaffIdFormDTO.class); + ytSyncStaffIdFormDTO.setStaffId(result.getData().getUserId()); + ytSyncStaffIdFormDTO.setOperUserId(fromDTO.getCurrentUserId()); + epmetThirdOpenFeignClient.dataSyncUpdateStaff(ytSyncStaffIdFormDTO); + } + + }); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.50__modify_wuye.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.50__modify_wuye.sql new file mode 100644 index 0000000000..a0cd82c5bd --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.50__modify_wuye.sql @@ -0,0 +1,2 @@ +alter table epmet_gov_org.ic_property_management add COLUMN `CONTACT_NAME` varchar(32) DEFAULT NULL COMMENT '烟台需求:物业联系人姓名' AFTER CUSTOMER_ID; +alter table epmet_gov_org.ic_property_management add COLUMN `CONTACT_MOBILE` varchar(32) DEFAULT NULL COMMENT '烟台需求:物业联系人电话' AFTER CONTACT_NAME; \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.51__create_community_building_manager.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.51__create_community_building_manager.sql new file mode 100644 index 0000000000..5d9829210d --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.51__create_community_building_manager.sql @@ -0,0 +1,24 @@ +CREATE TABLE `community_building_manager` ( + `ID` varchar(64) NOT NULL COMMENT '主键(烟台需求)', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id customer.id', + `NAME` varchar(64) NOT NULL COMMENT '姓名', + `PHONE` varchar(32) NOT NULL COMMENT '联系电话', + `ID_CARD` varchar(32) NOT NULL COMMENT '身份证号', + `TYPE` varchar(32) NOT NULL COMMENT '类型:0楼长;1单元长', + `DISTRICT_ID` varchar(64) NOT NULL COMMENT '所属区县id;取名字关联customer_agency', + `STREET_ID` varchar(64) NOT NULL COMMENT '所属街道id;取名字关联customer_agency', + `COMMUNITY_ID` varchar(64) NOT NULL COMMENT '所属社区id;取名字关联customer_agency', + `GRID_ID` varchar(64) NOT NULL COMMENT '所属网格id;取名字关联customer_grid', + `ORG_ID_PATH` varchar(512) NOT NULL COMMENT '网格的全路径,包含网格id', + `VILIAGE_ID` varchar(64) NOT NULL COMMENT '所属小区id', + `BUILDING_ID` varchar(64) NOT NULL COMMENT '所属楼栋id', + `UNIT_ID` varchar(64) DEFAULT NULL COMMENT '所属单元id; 单元长时必填此列', + `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`), + KEY `idx_community_building_manager` (`ORG_ID_PATH`) COMMENT 'org_id_path' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='楼长单元长信息表(烟台)'; \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.52__alter_ic_building.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.52__alter_ic_building.sql new file mode 100644 index 0000000000..d3cc16dabd --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.52__alter_ic_building.sql @@ -0,0 +1,2 @@ +alter table ic_building add COLUMN `BUILDING_LEADER_ID_CARD` varchar(32) DEFAULT NULL COMMENT '烟台需求:楼长身份证号' after BUILDING_LEADER_MOBILE; +alter table ic_building add COLUMN `BUILDING_LEADER_TYPE` varchar(32) DEFAULT NULL COMMENT '烟台需求:类型:0楼长;1单元长' AFTER BUILDING_LEADER_ID_CARD; \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/building_export.xlsx b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/building_export.xlsx index 5a178ed9bb..d1cad4c556 100644 Binary files a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/building_export.xlsx and b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/building_export.xlsx differ diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/building_export_0510.xlsx b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/building_export_0510.xlsx new file mode 100644 index 0000000000..5a178ed9bb Binary files /dev/null and b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/building_export_0510.xlsx differ diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/building_template.xlsx b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/building_template.xlsx index 0be5175435..0f597ecdff 100644 Binary files a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/building_template.xlsx and b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/building_template.xlsx differ diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/building_template_0510.xlsx b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/building_template_0510.xlsx new file mode 100644 index 0000000000..0be5175435 Binary files /dev/null and b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/building_template_0510.xlsx differ diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/customer_staff_import_template.xlsx b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/customer_staff_import_template.xlsx new file mode 100644 index 0000000000..4b9b2f1fce Binary files /dev/null and b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/customer_staff_import_template.xlsx differ diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/enterprise_patrol_import_tem.xlsx b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/enterprise_patrol_import_tem.xlsx index 6981727e9b..7b748c289e 100644 Binary files a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/enterprise_patrol_import_tem.xlsx and b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/enterprise_patrol_import_tem.xlsx differ diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_export_for_easyexcel.xlsx b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_export_for_easyexcel.xlsx index 359b68f0bd..865c8415bb 100644 Binary files a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_export_for_easyexcel.xlsx and b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_export_for_easyexcel.xlsx differ diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_export_for_easyexcel_0510.xlsx b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_export_for_easyexcel_0510.xlsx new file mode 100644 index 0000000000..359b68f0bd Binary files /dev/null and b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_export_for_easyexcel_0510.xlsx differ diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_template.xlsx b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_template.xlsx index c722017f31..5aca0af7a6 100644 Binary files a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_template.xlsx and b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_template.xlsx differ diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_template_0510.xlsx b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_template_0510.xlsx new file mode 100644 index 0000000000..c722017f31 Binary files /dev/null and b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_template_0510.xlsx differ diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/neighbor_export.xlsx b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/neighbor_export.xlsx index 2a1b3237d9..91a9637774 100644 Binary files a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/neighbor_export.xlsx and b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/neighbor_export.xlsx differ diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/neighbor_export_0510.xlsx b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/neighbor_export_0510.xlsx new file mode 100644 index 0000000000..2a1b3237d9 Binary files /dev/null and b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/neighbor_export_0510.xlsx differ diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/neighbor_template.xlsx b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/neighbor_template.xlsx index 36297ea510..ca0705dea6 100644 Binary files a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/neighbor_template.xlsx and b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/neighbor_template.xlsx differ diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/neighbor_template_0510.xlsx b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/neighbor_template_0510.xlsx new file mode 100644 index 0000000000..36297ea510 Binary files /dev/null and b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/neighbor_template_0510.xlsx differ diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/yantai/community_building_manager_import_temp.xlsx b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/yantai/community_building_manager_import_temp.xlsx new file mode 100644 index 0000000000..e8ceae9aa1 Binary files /dev/null and b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/yantai/community_building_manager_import_temp.xlsx differ diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/yantai/ic_property_management_temp.xlsx b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/yantai/ic_property_management_temp.xlsx new file mode 100644 index 0000000000..c219d94ab5 Binary files /dev/null and b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/yantai/ic_property_management_temp.xlsx differ diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/yantai/yantai_dept_import_tem.xlsx b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/yantai/yantai_dept_import_tem.xlsx new file mode 100644 index 0000000000..4bc5ef807b Binary files /dev/null and b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/yantai/yantai_dept_import_tem.xlsx differ diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/logback-spring.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/logback-spring.xml index f366605fba..5371a1f541 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/logback-spring.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/logback-spring.xml @@ -3,7 +3,8 @@ - + + diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CommunityBuildingManagerDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CommunityBuildingManagerDao.xml new file mode 100644 index 0000000000..23b0f682e9 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CommunityBuildingManagerDao.xml @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index 7f3f76b2d0..8005814843 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -889,16 +889,38 @@ from customer_agency where DEL_FLAG = 0 and PIDS like concat(#{pids},'%') + + and UPDATED_TIME >= #{timeStart} + + + and UPDATED_TIME <= #{timeEnd} + group by level + + @@ -911,6 +933,12 @@ and staff.DEL_FLAG = 0 and agency.PIDS like concat(#{pids},'%') + + and agency.UPDATED_TIME >= #{timeStart} + + + and agency.UPDATED_TIME <= #{timeEnd} + @@ -1094,102 +1122,102 @@ select t.ID from (select ca.ID , ca.CREATED_TIME created_time - , count(csa.ID) community_count - from customer_agency ca - inner join customer_staff_agency csa on (ca.ID = csa.AGENCY_ID and csa.DEL_FLAG = 0) - where ca.DEL_FLAG = 0 - and ca.CUSTOMER_ID=#{customerId} - and ca.LEVEL = 'community' - - and csa.CREATED_TIME #{endDate} - - and (ca.ID = #{agencyId} or ca.PIDS like CONCAT(#{agencyOrgIdPath}, '%')) - group by ca.ID, ca.CREATED_TIME - having community_count > 0 - order by created_time desc) t - - + + + - - - - + (SELECT ca.ID as id, ca.ORGANIZATION_NAME as label, - ca.LONGITUDE as longitude, - ca.LATITUDE as latitude, - ca.`LEVEL` as level, - ca.PID as pId, - 'agency' AS orgType - FROM - customer_agency ca - WHERE - ca.ID = #{agencyId} - AND ca.DEL_FLAG = '0' - - - - - - - + ca.LONGITUDE as longitude, + ca.LATITUDE as latitude, + ca.`LEVEL` as level, + ca.PID as pId, + 'agency' AS orgType + FROM customer_agency ca + WHERE ca.PID = #{agencyId} + AND ca.DEL_FLAG = '0' + ORDER BY CAST(ca.organization_name AS SIGNED), CONVERT(ca.organization_name using gbk)) + union all + (SELECT cg.id, + cg.GRID_NAME AS label, + cg.LONGITUDE, + cg.LATITUDE, + 'grid' AS LEVEL, + cg.PID, + 'grid' AS orgType + FROM customer_grid cg + WHERE cg.DEL_FLAG = '0' + AND cg.PID = #{agencyId} + ORDER BY cg.sort, CAST(cg.GRID_NAME AS SIGNED), CONVERT(cg.GRID_NAME using gbk)) + + + + + SELECT - CONCAT( n.NEIGHBOR_HOOD_NAME, b.BUILDING_NAME ) AS label, - b.id AS buildingId, - b.BUILDING_NAME AS buildingName, - n.id AS neighborhoodId, - n.NEIGHBOR_HOOD_NAME AS neighborhoodName, - n.GRID_ID, - g.GRID_NAME, - a.ALL_PARENT_NAME, - a.ORGANIZATION_NAME AS AGENCY_NAME, - n.CUSTOMER_ID - FROM - ic_building b - LEFT JOIN ic_neighbor_hood n ON b.NEIGHBOR_HOOD_ID = n.id - LEFT JOIN customer_grid g ON n.GRID_ID = g.id - LEFT JOIN customer_agency a ON a.id = g.pid + CONCAT( n.NEIGHBOR_HOOD_NAME, b.BUILDING_NAME ) AS label, + b.id AS buildingId, + b.BUILDING_NAME AS buildingName, + n.id AS neighborhoodId, + n.NEIGHBOR_HOOD_NAME AS neighborhoodName, + n.GRID_ID, + g.GRID_NAME, + a.ALL_PARENT_NAME, + a.ORGANIZATION_NAME AS AGENCY_NAME, + n.CUSTOMER_ID + FROM ic_building b + LEFT JOIN ic_neighbor_hood n + ON b.NEIGHBOR_HOOD_ID = n.id + LEFT JOIN customer_grid g + ON n.GRID_ID = g.id + LEFT JOIN customer_agency a + ON a.id = g.pid WHERE - n.DEL_FLAG = '0' - AND b.DEL_FLAG = '0' - AND g.DEL_FLAG = '0' - AND a.DEL_FLAG = '0' - AND n.CUSTOMER_ID = #{customerId} - - AND n.GRID_ID = #{gridId} - - - AND (n.NEIGHBOR_HOOD_NAME LIKE CONCAT('%', #{buildingName}, '%') OR b.BUILDING_NAME LIKE CONCAT('%', #{buildingName}, '%')) - - - AND ( - n.AGENCY_ID = #{agencyId} - OR n.AGENCY_PIDS LIKE CONCAT('%', #{agencyId}, '%')) - + n.DEL_FLAG = '0' + AND b.DEL_FLAG = '0' + AND g.DEL_FLAG = '0' + AND a.DEL_FLAG = '0' + AND n.CUSTOMER_ID = #{customerId} + + AND n.GRID_ID = #{gridId} + + + AND n.NEIGHBOR_HOOD_NAME LIKE CONCAT('%', #{buildingName}, '%') + + + AND ( + n.AGENCY_ID = #{agencyId} + OR n.AGENCY_PIDS LIKE CONCAT('%', #{agencyId}, '%')) + + order by n.CREATED_TIME asc,n.id asc + + diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodPropertyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodPropertyDao.xml index 749861cc9a..9e5f9b0bf9 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodPropertyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodPropertyDao.xml @@ -15,5 +15,19 @@ - + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPropertyManagementDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPropertyManagementDao.xml index 045514482f..64c35920e1 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPropertyManagementDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPropertyManagementDao.xml @@ -71,15 +71,33 @@ \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffLoginLogDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffLoginLogDao.xml index 13a1b5da8e..0a1bb6fdbe 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffLoginLogDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffLoginLogDao.xml @@ -48,9 +48,43 @@ and l.LOGIN_TIME <= #{endDate} - GROUP BY ca.id + + + GROUP BY ca.id having count( l.id )>0 + + + GROUP BY ca.id + + order by count(l.id) desc,ca.CREATED_TIME desc + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/logback-spring.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/logback-spring.xml index a1e8c5f1b0..ad19a235ae 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/logback-spring.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/logback-spring.xml @@ -3,7 +3,8 @@ - + + diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml index d7e0d5ff39..546c52b88f 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml @@ -247,7 +247,7 @@ #{secondId} - order by ie.created_time desc, ie.latest_operated_time desc + order by ie.happen_time desc, ie.latest_operated_time desc \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/logback-spring.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/logback-spring.xml index 36ddc6f222..03c538fdc0 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/logback-spring.xml +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/logback-spring.xml @@ -3,7 +3,8 @@ - + + diff --git a/epmet-module/oper-access/oper-access-server/src/main/resources/logback-spring.xml b/epmet-module/oper-access/oper-access-server/src/main/resources/logback-spring.xml index e22bb16a66..080c035973 100644 --- a/epmet-module/oper-access/oper-access-server/src/main/resources/logback-spring.xml +++ b/epmet-module/oper-access/oper-access-server/src/main/resources/logback-spring.xml @@ -3,7 +3,8 @@ - + + diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/resources/logback-spring.xml b/epmet-module/oper-crm/oper-crm-server/src/main/resources/logback-spring.xml index b670ba07bf..5a0f538ff1 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/resources/logback-spring.xml +++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/logback-spring.xml @@ -3,7 +3,8 @@ - + + diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.41__add_idcardtype_item.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.41__add_idcardtype_item.sql new file mode 100644 index 0000000000..3d02e58ddd --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.41__add_idcardtype_item.sql @@ -0,0 +1,18 @@ +-- 删除原来的证件类型 +update ic_form_item i set i.DEL_FLAG='1',i.UPDATED_TIME='2023-05-06 01:01:01',i.UPDATED_BY='烟台需求0506' where i.ID='6da7739161d116caacfbb218846ac713'; + +-- 证件类型。1:身份证号;2:护照;3:港澳通行证;4:军人证;5:台胞证;6:其他 +SET @customerId='1535072605621841922'; +set @areaCode ='370600'; +set @formId='20220610103408_1'; +set @itemGroupId='1535072605621841922_0'; + +INSERT INTO `epmet_oper_customize`.`ic_form_item` (`ID`, `CUSTOMER_ID`, `AREA_CODE`, `FORM_ID`, `FORM_CODE`, `PARENT_ITEM_ID`, `LABEL`, `ITEM_TYPE`, `ITEM_GROUP_ID`, `REQUIRED`, `VALID_TYPE`, `DEFAULT_VALUE`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_VALUE`, `SORT`, `PLACEHOLDER`, `SEARCH_DISPLAY`, `LIST_DISPLAY`, `ZHZL_LIST_DISPLAY`, `DATA_ANALYSE`, `EXPORT_FLAG`, `COLUMN_NAME`, `COLUMN_NUM`, `DYNAMIC`, `MULTI_SELECT`, `POLICY_FLAG`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES (UUID(), @customerId, @areaCode, @formId, 'resi_base_info', '0', '证件类型', 'select', @itemGroupId, 1, '', NULL, 'remote', '/sys/dict/data/dictOption/yt_id_card_type', 801, '请选择证件号类型', 1, 1, 1, 0, 1, 'ID_CARD_TYPE', 0, 1, 0, '1', 0, 0, '烟台需求0506', '2023-05-06 01:01:01', '烟台需求0506', '2023-05-06 01:01:01'); + + + + + + + diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.42__add_guoji4item.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.42__add_guoji4item.sql new file mode 100644 index 0000000000..673e8e6905 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.42__add_guoji4item.sql @@ -0,0 +1,26 @@ +-- 烟台 +SET @customerId='1535072605621841922'; +set @areaCode ='370600'; +set @formId='20220610103408_1'; +set @itemGroupId='1535072605621841922_0'; + + +INSERT INTO `epmet_oper_customize`.`ic_form_item` (`ID`, `CUSTOMER_ID`, `AREA_CODE`, `FORM_ID`, `FORM_CODE`, `PARENT_ITEM_ID`, `LABEL`, `ITEM_TYPE`, `ITEM_GROUP_ID`, `REQUIRED`, `VALID_TYPE`, `DEFAULT_VALUE`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_VALUE`, `SORT`, `PLACEHOLDER`, `SEARCH_DISPLAY`, `LIST_DISPLAY`, `ZHZL_LIST_DISPLAY`, `DATA_ANALYSE`, `EXPORT_FLAG`, `COLUMN_NAME`, `COLUMN_NUM`, `DYNAMIC`, `MULTI_SELECT`, `POLICY_FLAG`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES (UUID(), @customerId, @areaCode, @formId, 'resi_base_info', '0', '重点人群', 'select', @itemGroupId, 0, '', NULL, 'remote', '/sys/dict/data/dictOption/yt_key_point_user_type', 1301, '请选择', 1, 1, 1, 0, 1, 'KEY_POINT_USER_TYPE', 0, 1, 0, '1', 0, 0, '烟台需求0506', '2023-05-06 01:01:01', '烟台需求0506', '2023-05-06 01:01:01'); + + +INSERT INTO `epmet_oper_customize`.`ic_form_item` (`ID`, `CUSTOMER_ID`, `AREA_CODE`, `FORM_ID`, `FORM_CODE`, `PARENT_ITEM_ID`, `LABEL`, `ITEM_TYPE`, `ITEM_GROUP_ID`, `REQUIRED`, `VALID_TYPE`, `DEFAULT_VALUE`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_VALUE`, `SORT`, `PLACEHOLDER`, `SEARCH_DISPLAY`, `LIST_DISPLAY`, `ZHZL_LIST_DISPLAY`, `DATA_ANALYSE`, `EXPORT_FLAG`, `COLUMN_NAME`, `COLUMN_NUM`, `DYNAMIC`, `MULTI_SELECT`, `POLICY_FLAG`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES (UUID(), @customerId, @areaCode, @formId, 'resi_base_info', '0', '国籍', 'input', @itemGroupId, 0, '', NULL, '', '', 1302, '请选择', 1, 1, 1, 0, 1, 'NATIONALITY', 0, 1, 0, '1', 0, 0, '烟台需求0506', '2023-05-06 01:01:01', '烟台需求0506', '2023-05-06 01:01:01'); + + + +INSERT INTO `epmet_oper_customize`.`ic_form_item` (`ID`, `CUSTOMER_ID`, `AREA_CODE`, `FORM_ID`, `FORM_CODE`, `PARENT_ITEM_ID`, `LABEL`, `ITEM_TYPE`, `ITEM_GROUP_ID`, `REQUIRED`, `VALID_TYPE`, `DEFAULT_VALUE`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_VALUE`, `SORT`, `PLACEHOLDER`, `SEARCH_DISPLAY`, `LIST_DISPLAY`, `ZHZL_LIST_DISPLAY`, `DATA_ANALYSE`, `EXPORT_FLAG`, `COLUMN_NAME`, `COLUMN_NUM`, `DYNAMIC`, `MULTI_SELECT`, `POLICY_FLAG`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES (UUID(), @customerId, @areaCode, @formId, 'resi_base_info', '0', '人口类型', 'select', @itemGroupId, 1, '', NULL, 'remote', '/sys/dict/data/dictOption/yt_population_type', 1303, '请选择', 1, 1, 1, 0, 1, 'POPULATION_TYPE', 0, 1, 0, '1', 0, 0, '烟台需求0506', '2023-05-06 01:01:01', '烟台需求0506', '2023-05-06 01:01:01'); + + + +INSERT INTO `epmet_oper_customize`.`ic_form_item` (`ID`, `CUSTOMER_ID`, `AREA_CODE`, `FORM_ID`, `FORM_CODE`, `PARENT_ITEM_ID`, `LABEL`, `ITEM_TYPE`, `ITEM_GROUP_ID`, `REQUIRED`, `VALID_TYPE`, `DEFAULT_VALUE`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_VALUE`, `SORT`, `PLACEHOLDER`, `SEARCH_DISPLAY`, `LIST_DISPLAY`, `ZHZL_LIST_DISPLAY`, `DATA_ANALYSE`, `EXPORT_FLAG`, `COLUMN_NAME`, `COLUMN_NUM`, `DYNAMIC`, `MULTI_SELECT`, `POLICY_FLAG`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES (UUID(), @customerId, @areaCode, @formId, 'resi_base_info', '0', '政治面貌', 'select', @itemGroupId, 0, '', NULL, 'remote', '/sys/dict/data/dictOption/yt_politics_status', 1304, '请选择', 1, 1, 1, 0, 1, 'POLITICS_STATUS', 0, 1, 0, '1', 0, 0, '烟台需求0506', '2023-05-06 01:01:01', '烟台需求0506', '2023-05-06 01:01:01'); + + + diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.43__add_jiatingxinxi.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.43__add_jiatingxinxi.sql new file mode 100644 index 0000000000..3645218aa3 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.43__add_jiatingxinxi.sql @@ -0,0 +1,17 @@ +-- 与业主关系 +set @huzhuItemId='20220610103408_1066'; +update ic_form_item i set i.LABEL='与业主关系',i.UPDATED_BY='烟台需求0506',i.UPDATED_TIME='2023-05-06 01:01:01' where i.ID=@huzhuItemId; + + + +-- 婚姻状况增加2个下拉值 +SET @customerId='1535072605621841922'; +set @formId='20220610103408_1'; +set @hunyinItemId='20220610103408_1068'; +INSERT INTO `epmet_oper_customize`.`ic_form_item_options` (`ID`, `CUSTOMER_ID`, `FORM_ID`, `FORM_CODE`, `ITEM_ID`, `OPTION_LABEL`, `OPTION_VALUE`, `SORT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES (UUID(), @customerId, @formId, 'resi_base_info', @hunyinItemId, '丧偶', 'sangou', 6, 0, 0, '烟台需求0506', '2023-05-06 01:01:01', '烟台需求0506', '2023-05-06 01:01:01'); + + +INSERT INTO `epmet_oper_customize`.`ic_form_item_options` (`ID`, `CUSTOMER_ID`, `FORM_ID`, `FORM_CODE`, `ITEM_ID`, `OPTION_LABEL`, `OPTION_VALUE`, `SORT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES (UUID(), @customerId, @formId, 'resi_base_info', @hunyinItemId, '未说明的婚姻状况', 'no_desc', 7, 0, 0, '烟台需求0506', '2023-05-06 01:01:01', '烟台需求0506', '2023-05-06 01:01:01'); + diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.44__add_huzhuguanxi.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.44__add_huzhuguanxi.sql new file mode 100644 index 0000000000..e20706ee8d --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.44__add_huzhuguanxi.sql @@ -0,0 +1,12 @@ +-- 家庭信息信息增加与户主关系 +SET @customerId='1535072605621841922'; +set @areaCode ='370600'; +set @formId='20220610103408_1'; +set @itemGroupId='20220610103408_108'; +set @parentItemId='20220610103408_0'; + +INSERT INTO `epmet_oper_customize`.`ic_form_item` (`ID`, `CUSTOMER_ID`, `AREA_CODE`, `FORM_ID`, `FORM_CODE`, `PARENT_ITEM_ID`, `LABEL`, `ITEM_TYPE`, `ITEM_GROUP_ID`, `REQUIRED`, `VALID_TYPE`, `DEFAULT_VALUE`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_VALUE`, `SORT`, `PLACEHOLDER`, `SEARCH_DISPLAY`, `LIST_DISPLAY`, `ZHZL_LIST_DISPLAY`, `DATA_ANALYSE`, `EXPORT_FLAG`, `COLUMN_NAME`, `COLUMN_NUM`, `DYNAMIC`, `MULTI_SELECT`, `POLICY_FLAG`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES (UUID(), @customerId, @areaCode, @formId, 'resi_base_info', '0', '与户主关系', 'select', @itemGroupId, 1, '', NULL, 'remote', '/sys/dict/data/dictOption/yt_Householder_relationship_type', 201, '请选择', 1, 1, 1, 0, 1, 'YT_YHZGX', 0, 1, 0, '1', 0, 0, '烟台需求0506', '2023-05-06 01:01:01', '烟台需求0506', '2023-05-06 01:01:01'); + + + diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.45__add_juzhuxinxi.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.45__add_juzhuxinxi.sql new file mode 100644 index 0000000000..5f4b816e04 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.45__add_juzhuxinxi.sql @@ -0,0 +1,79 @@ +-- 居住信息增加21列 +SET @customerId='1535072605621841922'; +set @areaCode ='370600'; +set @formId='20220610103408_1'; +set @itemGroupId='20220610103408_107'; +set @parentItemId ='20220610103408_0'; + +INSERT INTO `epmet_oper_customize`.`ic_form_item` (`ID`, `CUSTOMER_ID`, `AREA_CODE`, `FORM_ID`, `FORM_CODE`, `PARENT_ITEM_ID`, `LABEL`, `ITEM_TYPE`, `ITEM_GROUP_ID`, `REQUIRED`, `VALID_TYPE`, `DEFAULT_VALUE`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_VALUE`, `SORT`, `PLACEHOLDER`, `SEARCH_DISPLAY`, `LIST_DISPLAY`, `ZHZL_LIST_DISPLAY`, `DATA_ANALYSE`, `EXPORT_FLAG`, `COLUMN_NAME`, `COLUMN_NUM`, `DYNAMIC`, `MULTI_SELECT`, `POLICY_FLAG`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES (UUID(), @customerId, @areaCode, @formId, 'resi_base_info', @parentItemId, '是否现居住', 'radio', @itemGroupId, 0, NULL, NULL, 'remote', '/sys/dict/data/dictOption/yt_is_now_live', 401, NULL, 0, 0, 0, 0, 1, 'IS_NOW_LIVE', 0, 1, 0, '1', 0, 0, '烟台需求0506', '2023-05-06 01:01:01', '烟台需求0506', '2023-05-06 01:01:01'); + +INSERT INTO `epmet_oper_customize`.`ic_form_item` (`ID`, `CUSTOMER_ID`, `AREA_CODE`, `FORM_ID`, `FORM_CODE`, `PARENT_ITEM_ID`, `LABEL`, `ITEM_TYPE`, `ITEM_GROUP_ID`, `REQUIRED`, `VALID_TYPE`, `DEFAULT_VALUE`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_VALUE`, `SORT`, `PLACEHOLDER`, `SEARCH_DISPLAY`, `LIST_DISPLAY`, `ZHZL_LIST_DISPLAY`, `DATA_ANALYSE`, `EXPORT_FLAG`, `COLUMN_NAME`, `COLUMN_NUM`, `DYNAMIC`, `MULTI_SELECT`, `POLICY_FLAG`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES (UUID(), @customerId, @areaCode, @formId, 'resi_base_info', @parentItemId, '居住省', 'input', @itemGroupId, 0, NULL, NULL, 'local', '', 402, NULL, 0, 0, 0, 0, 1, 'LIVING_PROVINCE', 0, 1, 0, '1', 0, 0, '烟台需求0506', '2023-05-06 01:01:01', '烟台需求0506', '2023-05-06 01:01:01'); + + +INSERT INTO `epmet_oper_customize`.`ic_form_item` (`ID`, `CUSTOMER_ID`, `AREA_CODE`, `FORM_ID`, `FORM_CODE`, `PARENT_ITEM_ID`, `LABEL`, `ITEM_TYPE`, `ITEM_GROUP_ID`, `REQUIRED`, `VALID_TYPE`, `DEFAULT_VALUE`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_VALUE`, `SORT`, `PLACEHOLDER`, `SEARCH_DISPLAY`, `LIST_DISPLAY`, `ZHZL_LIST_DISPLAY`, `DATA_ANALYSE`, `EXPORT_FLAG`, `COLUMN_NAME`, `COLUMN_NUM`, `DYNAMIC`, `MULTI_SELECT`, `POLICY_FLAG`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES (UUID(), @customerId, @areaCode, @formId, 'resi_base_info', @parentItemId, '居住市', 'input', @itemGroupId, 0, NULL, NULL, 'local', '', 403, NULL, 0, 0, 0, 0, 1, 'LIVING_CITY', 0, 1, 0, '1', 0, 0, '烟台需求0506', '2023-05-06 01:01:01', '烟台需求0506', '2023-05-06 01:01:01'); + + +INSERT INTO `epmet_oper_customize`.`ic_form_item` (`ID`, `CUSTOMER_ID`, `AREA_CODE`, `FORM_ID`, `FORM_CODE`, `PARENT_ITEM_ID`, `LABEL`, `ITEM_TYPE`, `ITEM_GROUP_ID`, `REQUIRED`, `VALID_TYPE`, `DEFAULT_VALUE`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_VALUE`, `SORT`, `PLACEHOLDER`, `SEARCH_DISPLAY`, `LIST_DISPLAY`, `ZHZL_LIST_DISPLAY`, `DATA_ANALYSE`, `EXPORT_FLAG`, `COLUMN_NAME`, `COLUMN_NUM`, `DYNAMIC`, `MULTI_SELECT`, `POLICY_FLAG`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES (UUID(), @customerId, @areaCode, @formId, 'resi_base_info', @parentItemId, '居住区', 'input', @itemGroupId, 0, NULL, NULL, 'local', '', 404, NULL, 0, 0, 0, 0, 1, 'LIVING_AREA', 0, 1, 0, '1', 0, 0, '烟台需求0506', '2023-05-06 01:01:01', '烟台需求0506', '2023-05-06 01:01:01'); + +INSERT INTO `epmet_oper_customize`.`ic_form_item` (`ID`, `CUSTOMER_ID`, `AREA_CODE`, `FORM_ID`, `FORM_CODE`, `PARENT_ITEM_ID`, `LABEL`, `ITEM_TYPE`, `ITEM_GROUP_ID`, `REQUIRED`, `VALID_TYPE`, `DEFAULT_VALUE`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_VALUE`, `SORT`, `PLACEHOLDER`, `SEARCH_DISPLAY`, `LIST_DISPLAY`, `ZHZL_LIST_DISPLAY`, `DATA_ANALYSE`, `EXPORT_FLAG`, `COLUMN_NAME`, `COLUMN_NUM`, `DYNAMIC`, `MULTI_SELECT`, `POLICY_FLAG`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES (UUID(), @customerId, @areaCode, @formId, 'resi_base_info', @parentItemId, '居住街道', 'input', @itemGroupId, 0, NULL, NULL, 'local', '', 405, NULL, 0, 0, 0, 0, 1, 'LIVING_STREET', 0, 1, 0, '1', 0, 0, '烟台需求0506', '2023-05-06 01:01:01', '烟台需求0506', '2023-05-06 01:01:01'); + +INSERT INTO `epmet_oper_customize`.`ic_form_item` (`ID`, `CUSTOMER_ID`, `AREA_CODE`, `FORM_ID`, `FORM_CODE`, `PARENT_ITEM_ID`, `LABEL`, `ITEM_TYPE`, `ITEM_GROUP_ID`, `REQUIRED`, `VALID_TYPE`, `DEFAULT_VALUE`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_VALUE`, `SORT`, `PLACEHOLDER`, `SEARCH_DISPLAY`, `LIST_DISPLAY`, `ZHZL_LIST_DISPLAY`, `DATA_ANALYSE`, `EXPORT_FLAG`, `COLUMN_NAME`, `COLUMN_NUM`, `DYNAMIC`, `MULTI_SELECT`, `POLICY_FLAG`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES (UUID(), @customerId, @areaCode, @formId, 'resi_base_info', @parentItemId, '居住社区', 'input', @itemGroupId, 0, NULL, NULL, 'local', '', 406, NULL, 0, 0, 0, 0, 1, 'LIVING_COMMUNITY', 0, 1, 0, '1', 0, 0, '烟台需求0506', '2023-05-06 01:01:01', '烟台需求0506', '2023-05-06 01:01:01'); + +INSERT INTO `epmet_oper_customize`.`ic_form_item` (`ID`, `CUSTOMER_ID`, `AREA_CODE`, `FORM_ID`, `FORM_CODE`, `PARENT_ITEM_ID`, `LABEL`, `ITEM_TYPE`, `ITEM_GROUP_ID`, `REQUIRED`, `VALID_TYPE`, `DEFAULT_VALUE`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_VALUE`, `SORT`, `PLACEHOLDER`, `SEARCH_DISPLAY`, `LIST_DISPLAY`, `ZHZL_LIST_DISPLAY`, `DATA_ANALYSE`, `EXPORT_FLAG`, `COLUMN_NAME`, `COLUMN_NUM`, `DYNAMIC`, `MULTI_SELECT`, `POLICY_FLAG`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES (UUID(), @customerId, @areaCode, @formId, 'resi_base_info', @parentItemId, '居住小区', 'input', @itemGroupId, 0, NULL, NULL, 'local', '', 407, NULL, 0, 0, 0, 0, 1, 'LIVING_VILIAGE_NAME', 0, 1, 0, '1', 0, 0, '烟台需求0506', '2023-05-06 01:01:01', '烟台需求0506', '2023-05-06 01:01:01'); + +INSERT INTO `epmet_oper_customize`.`ic_form_item` (`ID`, `CUSTOMER_ID`, `AREA_CODE`, `FORM_ID`, `FORM_CODE`, `PARENT_ITEM_ID`, `LABEL`, `ITEM_TYPE`, `ITEM_GROUP_ID`, `REQUIRED`, `VALID_TYPE`, `DEFAULT_VALUE`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_VALUE`, `SORT`, `PLACEHOLDER`, `SEARCH_DISPLAY`, `LIST_DISPLAY`, `ZHZL_LIST_DISPLAY`, `DATA_ANALYSE`, `EXPORT_FLAG`, `COLUMN_NAME`, `COLUMN_NUM`, `DYNAMIC`, `MULTI_SELECT`, `POLICY_FLAG`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES (UUID(), @customerId, @areaCode, @formId, 'resi_base_info', @parentItemId, '居住楼号', 'input', @itemGroupId, 0, NULL, NULL, 'local', '', 408, NULL, 0, 0, 0, 0, 1, 'LIVING_BUILDING_NO', 0, 1, 0, '1', 0, 0, '烟台需求0506', '2023-05-06 01:01:01', '烟台需求0506', '2023-05-06 01:01:01'); + + +INSERT INTO `epmet_oper_customize`.`ic_form_item` (`ID`, `CUSTOMER_ID`, `AREA_CODE`, `FORM_ID`, `FORM_CODE`, `PARENT_ITEM_ID`, `LABEL`, `ITEM_TYPE`, `ITEM_GROUP_ID`, `REQUIRED`, `VALID_TYPE`, `DEFAULT_VALUE`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_VALUE`, `SORT`, `PLACEHOLDER`, `SEARCH_DISPLAY`, `LIST_DISPLAY`, `ZHZL_LIST_DISPLAY`, `DATA_ANALYSE`, `EXPORT_FLAG`, `COLUMN_NAME`, `COLUMN_NUM`, `DYNAMIC`, `MULTI_SELECT`, `POLICY_FLAG`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES (UUID(), @customerId, @areaCode, @formId, 'resi_base_info', @parentItemId, '居住单元号', 'input', @itemGroupId, 0, NULL, NULL, 'local', '', 409, NULL, 0, 0, 0, 0, 1, 'LIVING_UNIT_NO', 0, 1, 0, '1', 0, 0, '烟台需求0506', '2023-05-06 01:01:01', '烟台需求0506', '2023-05-06 01:01:01'); + +INSERT INTO `epmet_oper_customize`.`ic_form_item` (`ID`, `CUSTOMER_ID`, `AREA_CODE`, `FORM_ID`, `FORM_CODE`, `PARENT_ITEM_ID`, `LABEL`, `ITEM_TYPE`, `ITEM_GROUP_ID`, `REQUIRED`, `VALID_TYPE`, `DEFAULT_VALUE`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_VALUE`, `SORT`, `PLACEHOLDER`, `SEARCH_DISPLAY`, `LIST_DISPLAY`, `ZHZL_LIST_DISPLAY`, `DATA_ANALYSE`, `EXPORT_FLAG`, `COLUMN_NAME`, `COLUMN_NUM`, `DYNAMIC`, `MULTI_SELECT`, `POLICY_FLAG`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES (UUID(), @customerId, @areaCode, @formId, 'resi_base_info', @parentItemId, '居住房间号', 'input', @itemGroupId, 0, NULL, NULL, 'local', '', 410, NULL, 0, 0, 0, 0, 1, 'LIVING_HOUSE_NO', 0, 1, 0, '1', 0, 0, '烟台需求0506', '2023-05-06 01:01:01', '烟台需求0506', '2023-05-06 01:01:01'); + + +INSERT INTO `epmet_oper_customize`.`ic_form_item` (`ID`, `CUSTOMER_ID`, `AREA_CODE`, `FORM_ID`, `FORM_CODE`, `PARENT_ITEM_ID`, `LABEL`, `ITEM_TYPE`, `ITEM_GROUP_ID`, `REQUIRED`, `VALID_TYPE`, `DEFAULT_VALUE`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_VALUE`, `SORT`, `PLACEHOLDER`, `SEARCH_DISPLAY`, `LIST_DISPLAY`, `ZHZL_LIST_DISPLAY`, `DATA_ANALYSE`, `EXPORT_FLAG`, `COLUMN_NAME`, `COLUMN_NUM`, `DYNAMIC`, `MULTI_SELECT`, `POLICY_FLAG`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES (UUID(), @customerId, @areaCode, @formId, 'resi_base_info', @parentItemId, '户籍所在省', 'input', @itemGroupId, 0, NULL, NULL, 'local', '', 411, NULL, 0, 0, 0, 0, 1, 'REGISTER_PROVINCE', 0, 1, 0, '1', 0, 0, '烟台需求0506', '2023-05-06 01:01:01', '烟台需求0506', '2023-05-06 01:01:01'); + + +INSERT INTO `epmet_oper_customize`.`ic_form_item` (`ID`, `CUSTOMER_ID`, `AREA_CODE`, `FORM_ID`, `FORM_CODE`, `PARENT_ITEM_ID`, `LABEL`, `ITEM_TYPE`, `ITEM_GROUP_ID`, `REQUIRED`, `VALID_TYPE`, `DEFAULT_VALUE`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_VALUE`, `SORT`, `PLACEHOLDER`, `SEARCH_DISPLAY`, `LIST_DISPLAY`, `ZHZL_LIST_DISPLAY`, `DATA_ANALYSE`, `EXPORT_FLAG`, `COLUMN_NAME`, `COLUMN_NUM`, `DYNAMIC`, `MULTI_SELECT`, `POLICY_FLAG`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES (UUID(), @customerId, @areaCode, @formId, 'resi_base_info', @parentItemId, '户籍所在市', 'input', @itemGroupId, 0, NULL, NULL, 'local', '', 412, NULL, 0, 0, 0, 0, 1, 'REGISTER_CITY', 0, 1, 0, '1', 0, 0, '烟台需求0506', '2023-05-06 01:01:01', '烟台需求0506', '2023-05-06 01:01:01'); + +INSERT INTO `epmet_oper_customize`.`ic_form_item` (`ID`, `CUSTOMER_ID`, `AREA_CODE`, `FORM_ID`, `FORM_CODE`, `PARENT_ITEM_ID`, `LABEL`, `ITEM_TYPE`, `ITEM_GROUP_ID`, `REQUIRED`, `VALID_TYPE`, `DEFAULT_VALUE`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_VALUE`, `SORT`, `PLACEHOLDER`, `SEARCH_DISPLAY`, `LIST_DISPLAY`, `ZHZL_LIST_DISPLAY`, `DATA_ANALYSE`, `EXPORT_FLAG`, `COLUMN_NAME`, `COLUMN_NUM`, `DYNAMIC`, `MULTI_SELECT`, `POLICY_FLAG`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES (UUID(), @customerId, @areaCode, @formId, 'resi_base_info', @parentItemId, '户籍所在区县', 'input', @itemGroupId, 0, NULL, NULL, 'local', '', 413, NULL, 0, 0, 0, 0, 1, 'REGISTER_AREA', 0, 1, 0, '1', 0, 0, '烟台需求0506', '2023-05-06 01:01:01', '烟台需求0506', '2023-05-06 01:01:01'); + + +INSERT INTO `epmet_oper_customize`.`ic_form_item` (`ID`, `CUSTOMER_ID`, `AREA_CODE`, `FORM_ID`, `FORM_CODE`, `PARENT_ITEM_ID`, `LABEL`, `ITEM_TYPE`, `ITEM_GROUP_ID`, `REQUIRED`, `VALID_TYPE`, `DEFAULT_VALUE`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_VALUE`, `SORT`, `PLACEHOLDER`, `SEARCH_DISPLAY`, `LIST_DISPLAY`, `ZHZL_LIST_DISPLAY`, `DATA_ANALYSE`, `EXPORT_FLAG`, `COLUMN_NAME`, `COLUMN_NUM`, `DYNAMIC`, `MULTI_SELECT`, `POLICY_FLAG`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES (UUID(), @customerId, @areaCode, @formId, 'resi_base_info', @parentItemId, '户籍所在街道', 'input', @itemGroupId, 0, NULL, NULL, 'local', '', 414, NULL, 0, 0, 0, 0, 1, 'REGISTER_STREET', 0, 1, 0, '1', 0, 0, '烟台需求0506', '2023-05-06 01:01:01', '烟台需求0506', '2023-05-06 01:01:01'); + +INSERT INTO `epmet_oper_customize`.`ic_form_item` (`ID`, `CUSTOMER_ID`, `AREA_CODE`, `FORM_ID`, `FORM_CODE`, `PARENT_ITEM_ID`, `LABEL`, `ITEM_TYPE`, `ITEM_GROUP_ID`, `REQUIRED`, `VALID_TYPE`, `DEFAULT_VALUE`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_VALUE`, `SORT`, `PLACEHOLDER`, `SEARCH_DISPLAY`, `LIST_DISPLAY`, `ZHZL_LIST_DISPLAY`, `DATA_ANALYSE`, `EXPORT_FLAG`, `COLUMN_NAME`, `COLUMN_NUM`, `DYNAMIC`, `MULTI_SELECT`, `POLICY_FLAG`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES (UUID(), @customerId, @areaCode, @formId, 'resi_base_info', @parentItemId, '户籍所在社区', 'input', @itemGroupId, 0, NULL, NULL, 'local', '', 415, NULL, 0, 0, 0, 0, 1, 'REGISTER_COMMUNITY', 0, 1, 0, '1', 0, 0, '烟台需求0506', '2023-05-06 01:01:01', '烟台需求0506', '2023-05-06 01:01:01'); + + +INSERT INTO `epmet_oper_customize`.`ic_form_item` (`ID`, `CUSTOMER_ID`, `AREA_CODE`, `FORM_ID`, `FORM_CODE`, `PARENT_ITEM_ID`, `LABEL`, `ITEM_TYPE`, `ITEM_GROUP_ID`, `REQUIRED`, `VALID_TYPE`, `DEFAULT_VALUE`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_VALUE`, `SORT`, `PLACEHOLDER`, `SEARCH_DISPLAY`, `LIST_DISPLAY`, `ZHZL_LIST_DISPLAY`, `DATA_ANALYSE`, `EXPORT_FLAG`, `COLUMN_NAME`, `COLUMN_NUM`, `DYNAMIC`, `MULTI_SELECT`, `POLICY_FLAG`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES (UUID(), @customerId, @areaCode, @formId, 'resi_base_info', @parentItemId, '户籍所在小区', 'input', @itemGroupId, 0, NULL, NULL, 'local', '', 416, NULL, 0, 0, 0, 0, 1, 'REGISTER_VILIAGE_NAME', 0, 1, 0, '1', 0, 0, '烟台需求0506', '2023-05-06 01:01:01', '烟台需求0506', '2023-05-06 01:01:01'); + + +INSERT INTO `epmet_oper_customize`.`ic_form_item` (`ID`, `CUSTOMER_ID`, `AREA_CODE`, `FORM_ID`, `FORM_CODE`, `PARENT_ITEM_ID`, `LABEL`, `ITEM_TYPE`, `ITEM_GROUP_ID`, `REQUIRED`, `VALID_TYPE`, `DEFAULT_VALUE`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_VALUE`, `SORT`, `PLACEHOLDER`, `SEARCH_DISPLAY`, `LIST_DISPLAY`, `ZHZL_LIST_DISPLAY`, `DATA_ANALYSE`, `EXPORT_FLAG`, `COLUMN_NAME`, `COLUMN_NUM`, `DYNAMIC`, `MULTI_SELECT`, `POLICY_FLAG`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES (UUID(), @customerId, @areaCode, @formId, 'resi_base_info', @parentItemId, '户籍楼号', 'input', @itemGroupId, 0, NULL, NULL, 'local', '', 417, NULL, 0, 0, 0, 0, 1, 'REGISTER_BUILDING_NO', 0, 1, 0, '1', 0, 0, '烟台需求0506', '2023-05-06 01:01:01', '烟台需求0506', '2023-05-06 01:01:01'); + +INSERT INTO `epmet_oper_customize`.`ic_form_item` (`ID`, `CUSTOMER_ID`, `AREA_CODE`, `FORM_ID`, `FORM_CODE`, `PARENT_ITEM_ID`, `LABEL`, `ITEM_TYPE`, `ITEM_GROUP_ID`, `REQUIRED`, `VALID_TYPE`, `DEFAULT_VALUE`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_VALUE`, `SORT`, `PLACEHOLDER`, `SEARCH_DISPLAY`, `LIST_DISPLAY`, `ZHZL_LIST_DISPLAY`, `DATA_ANALYSE`, `EXPORT_FLAG`, `COLUMN_NAME`, `COLUMN_NUM`, `DYNAMIC`, `MULTI_SELECT`, `POLICY_FLAG`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES (UUID(), @customerId, @areaCode, @formId, 'resi_base_info', @parentItemId, '户籍单元号', 'input', @itemGroupId, 0, NULL, NULL, 'local', '', 418, NULL, 0, 0, 0, 0, 1, 'REGISTER_UNIT_NO', 0, 1, 0, '1', 0, 0, '烟台需求0506', '2023-05-06 01:01:01', '烟台需求0506', '2023-05-06 01:01:01'); + + +INSERT INTO `epmet_oper_customize`.`ic_form_item` (`ID`, `CUSTOMER_ID`, `AREA_CODE`, `FORM_ID`, `FORM_CODE`, `PARENT_ITEM_ID`, `LABEL`, `ITEM_TYPE`, `ITEM_GROUP_ID`, `REQUIRED`, `VALID_TYPE`, `DEFAULT_VALUE`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_VALUE`, `SORT`, `PLACEHOLDER`, `SEARCH_DISPLAY`, `LIST_DISPLAY`, `ZHZL_LIST_DISPLAY`, `DATA_ANALYSE`, `EXPORT_FLAG`, `COLUMN_NAME`, `COLUMN_NUM`, `DYNAMIC`, `MULTI_SELECT`, `POLICY_FLAG`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES (UUID(), @customerId, @areaCode, @formId, 'resi_base_info', @parentItemId, '户籍房间号', 'input', @itemGroupId, 0, NULL, NULL, 'local', '', 419, NULL, 0, 0, 0, 0, 1, 'REGISTER_HOUSE_NO', 0, 1, 0, '1', 0, 0, '烟台需求0506', '2023-05-06 01:01:01', '烟台需求0506', '2023-05-06 01:01:01'); + + +INSERT INTO `epmet_oper_customize`.`ic_form_item` (`ID`, `CUSTOMER_ID`, `AREA_CODE`, `FORM_ID`, `FORM_CODE`, `PARENT_ITEM_ID`, `LABEL`, `ITEM_TYPE`, `ITEM_GROUP_ID`, `REQUIRED`, `VALID_TYPE`, `DEFAULT_VALUE`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_VALUE`, `SORT`, `PLACEHOLDER`, `SEARCH_DISPLAY`, `LIST_DISPLAY`, `ZHZL_LIST_DISPLAY`, `DATA_ANALYSE`, `EXPORT_FLAG`, `COLUMN_NAME`, `COLUMN_NUM`, `DYNAMIC`, `MULTI_SELECT`, `POLICY_FLAG`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES (UUID(), @customerId, @areaCode, @formId, 'resi_base_info', @parentItemId, '户别', 'select', @itemGroupId, 0, NULL, NULL, 'remote', '/sys/dict/data/dictOption/yt_household_category', 420, NULL, 0, 0, 0, 0, 1, 'HOUSEHOLD_CATEGORY', 0, 1, 0, '1', 0, 0, '烟台需求0506', '2023-05-06 01:01:01', '烟台需求0506', '2023-05-06 01:01:01'); + +INSERT INTO `epmet_oper_customize`.`ic_form_item` (`ID`, `CUSTOMER_ID`, `AREA_CODE`, `FORM_ID`, `FORM_CODE`, `PARENT_ITEM_ID`, `LABEL`, `ITEM_TYPE`, `ITEM_GROUP_ID`, `REQUIRED`, `VALID_TYPE`, `DEFAULT_VALUE`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_VALUE`, `SORT`, `PLACEHOLDER`, `SEARCH_DISPLAY`, `LIST_DISPLAY`, `ZHZL_LIST_DISPLAY`, `DATA_ANALYSE`, `EXPORT_FLAG`, `COLUMN_NAME`, `COLUMN_NUM`, `DYNAMIC`, `MULTI_SELECT`, `POLICY_FLAG`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES (UUID(), @customerId, @areaCode, @formId, 'resi_base_info', @parentItemId, '户号', 'input', @itemGroupId, 0, NULL, NULL, 'local', '', 421, NULL, 0, 0, 0, 0, 1, 'HOUSE_HOLD_ID', 0, 1, 0, '1', 0, 0, '烟台需求0506', '2023-05-06 01:01:01', '烟台需求0506', '2023-05-06 01:01:01'); \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.46__add_list_item.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.46__add_list_item.sql new file mode 100644 index 0000000000..5c71dde8e4 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.46__add_list_item.sql @@ -0,0 +1,38 @@ +set @customerId='1535072605621841922'; +-- 先放大排序 +update ic_form_list_item l set l.SORT=l.SORT*100 +where l.CUSTOMER_ID=@customerId; + + +INSERT INTO `ic_form_list_item` (`ID`, `CUSTOMER_ID`, `FORM_ITEM_ID`, `FORM_CODE`, `WIDTH`, `SORT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES (UUID(), @customerId, + (select i.ID from ic_form_item i + where i.LABEL='证件类型' + and i.customer_id=@customerId + and i.DEL_FLAG='0'), 'resi_base_info', 180, 501, 0, 0, '烟台需求0511', '2023-05-11 01:01:01', '烟台需求0511', '2023-05-11 01:01:01'); + + + + +INSERT INTO `ic_form_list_item` (`ID`, `CUSTOMER_ID`, `FORM_ITEM_ID`, `FORM_CODE`, `WIDTH`, `SORT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES (UUID(), @customerId, + (select i.ID from ic_form_item i + where i.LABEL='重点人群' + and i.customer_id=@customerId + and i.DEL_FLAG='0'), 'resi_base_info', 150, 701, 0, 0, '烟台需求0511', '2023-05-11 01:01:01', '烟台需求0511', '2023-05-11 01:01:01'); + +INSERT INTO `ic_form_list_item` (`ID`, `CUSTOMER_ID`, `FORM_ITEM_ID`, `FORM_CODE`, `WIDTH`, `SORT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES (UUID(), @customerId, + (select i.ID from ic_form_item i + where i.LABEL='国籍' + and i.customer_id=@customerId + and i.DEL_FLAG='0'), 'resi_base_info', 80, 702, 0, 0, '烟台需求0511', '2023-05-11 01:01:01', '烟台需求0511', '2023-05-11 01:01:01'); + +INSERT INTO `ic_form_list_item` (`ID`, `CUSTOMER_ID`, `FORM_ITEM_ID`, `FORM_CODE`, `WIDTH`, `SORT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES (UUID(), @customerId, + (select i.ID from ic_form_item i + where i.LABEL='人口类型' + and i.customer_id=@customerId + and i.DEL_FLAG='0'), 'resi_base_info', 150, 703, 0, 0, '烟台需求0511', '2023-05-11 01:01:01', '烟台需求0511', '2023-05-11 01:01:01'); + +INSERT INTO `ic_form_list_item` (`ID`, `CUSTOMER_ID`, `FORM_ITEM_ID`, `FORM_CODE`, `WIDTH`, `SORT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES (UUID(), @customerId, + (select i.ID from ic_form_item i + where i.LABEL='政治面貌' + and i.customer_id=@customerId + and i.DEL_FLAG='0'), 'resi_base_info', 150, 704, 0, 0, '烟台需求0511', '2023-05-11 01:01:01', '烟台需求0511', '2023-05-11 01:01:01'); \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.47__add_query_item.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.47__add_query_item.sql new file mode 100644 index 0000000000..0522519a3e --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.47__add_query_item.sql @@ -0,0 +1,47 @@ +set @customerId='1535072605621841922'; + +update ic_form_query_builder b set b.SORT=b.SORT*100 +where b.DEL_FLAG='0' + and b.CUSTOMER_ID=@customerId; + +INSERT INTO `ic_form_query_builder` (`ID`, `CUSTOMER_ID`, `FORM_ITEM_ID`, `LABEL`, `FORM_CODE`, `ITEM_TYPE`, `QUERY_TYPE`, `FUN_TYPE`, `VALID_TYPE`, `MULTI_SELECT`, `SORT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES (UUID(), @customerId, + (select i.ID from ic_form_item i + where i.LABEL='证件类型' + and i.customer_id=@customerId + and i.DEL_FLAG='0'), + '证件类型', 'resi_base_info', 'select', 'equal', NULL, NULL, 0, 901, 0, 0, '烟台需求0511', '2023-05-11 01:01:01', '烟台需求0511', '2023-05-11 01:01:01'); + + +INSERT INTO `ic_form_query_builder` (`ID`, `CUSTOMER_ID`, `FORM_ITEM_ID`, `LABEL`, `FORM_CODE`, `ITEM_TYPE`, `QUERY_TYPE`, `FUN_TYPE`, `VALID_TYPE`, `MULTI_SELECT`, `SORT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES (UUID(), @customerId, + (select i.ID from ic_form_item i + where i.LABEL='重点人群' + and i.customer_id=@customerId + and i.DEL_FLAG='0'), + '重点人群', 'resi_base_info', 'select', 'equal', NULL, NULL, 0, 1301, 0, 0, '烟台需求0511', '2023-05-11 01:01:01', '烟台需求0511', '2023-05-11 01:01:01'); + + +INSERT INTO `ic_form_query_builder` (`ID`, `CUSTOMER_ID`, `FORM_ITEM_ID`, `LABEL`, `FORM_CODE`, `ITEM_TYPE`, `QUERY_TYPE`, `FUN_TYPE`, `VALID_TYPE`, `MULTI_SELECT`, `SORT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES (UUID(), @customerId, + (select i.ID from ic_form_item i + where i.LABEL='国籍' + and i.customer_id=@customerId + and i.DEL_FLAG='0'), + '国籍', 'resi_base_info', 'input', 'like', NULL, NULL, 0, 1302, 0, 0, '烟台需求0511', '2023-05-11 01:01:01', '烟台需求0511', '2023-05-11 01:01:01'); + +INSERT INTO `ic_form_query_builder` (`ID`, `CUSTOMER_ID`, `FORM_ITEM_ID`, `LABEL`, `FORM_CODE`, `ITEM_TYPE`, `QUERY_TYPE`, `FUN_TYPE`, `VALID_TYPE`, `MULTI_SELECT`, `SORT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES (UUID(), @customerId, + (select i.ID from ic_form_item i + where i.LABEL='人口类型' + and i.customer_id=@customerId + and i.DEL_FLAG='0'), + '人口类型', 'resi_base_info', 'select', 'equal', NULL, NULL, 0, 1303, 0, 0, '烟台需求0511', '2023-05-11 01:01:01', '烟台需求0511', '2023-05-11 01:01:01'); + +INSERT INTO `ic_form_query_builder` (`ID`, `CUSTOMER_ID`, `FORM_ITEM_ID`, `LABEL`, `FORM_CODE`, `ITEM_TYPE`, `QUERY_TYPE`, `FUN_TYPE`, `VALID_TYPE`, `MULTI_SELECT`, `SORT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES (UUID(), @customerId, + (select i.ID from ic_form_item i + where i.LABEL='政治面貌' + and i.customer_id=@customerId + and i.DEL_FLAG='0'), + '政治面貌', 'resi_base_info', 'select', 'equal', NULL, NULL, 0, 1304, 0, 0, '烟台需求0511', '2023-05-11 01:01:01', '烟台需求0511', '2023-05-11 01:01:01'); \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/logback-spring.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/logback-spring.xml index cedd663d22..40a734010f 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/logback-spring.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/logback-spring.xml @@ -3,7 +3,8 @@ - + + diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupEntity.java index cc35c91b5b..23279882cb 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupEntity.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupEntity.java @@ -98,4 +98,7 @@ Ps: 如果一个小组被拒绝,当前小组的状态将永久停留在“审 * 小组等级 */ private Integer level; + private String agencyId; + + private String orgIdPath; } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java index 8c2d43f75f..63065ee322 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java @@ -30,6 +30,8 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.scan.param.ImgScanParamDTO; import com.epmet.commons.tools.scan.param.ImgTaskDTO; import com.epmet.commons.tools.scan.param.TextScanParamDTO; @@ -37,10 +39,7 @@ import com.epmet.commons.tools.scan.param.TextTaskDTO; import com.epmet.commons.tools.scan.result.SyncScanResult; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.user.LoginUserUtil; -import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.commons.tools.utils.Result; -import com.epmet.commons.tools.utils.ScanContentUtils; +import com.epmet.commons.tools.utils.*; import com.epmet.constant.ReadFlagConstant; import com.epmet.constant.UserMessageTypeConstant; import com.epmet.dto.form.*; @@ -609,6 +608,10 @@ public class ResiGroupServiceImpl extends BaseServiceImpl--> - + + diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/resources/logback-spring.xml b/epmet-module/resi-guide/resi-guide-server/src/main/resources/logback-spring.xml index 126316c645..a42f347111 100644 --- a/epmet-module/resi-guide/resi-guide-server/src/main/resources/logback-spring.xml +++ b/epmet-module/resi-guide/resi-guide-server/src/main/resources/logback-spring.xml @@ -3,7 +3,8 @@ - + + diff --git a/epmet-module/resi-hall/resi-hall-server/src/main/resources/logback-spring.xml b/epmet-module/resi-hall/resi-hall-server/src/main/resources/logback-spring.xml index a5db66cb09..049506c162 100644 --- a/epmet-module/resi-hall/resi-hall-server/src/main/resources/logback-spring.xml +++ b/epmet-module/resi-hall/resi-hall-server/src/main/resources/logback-spring.xml @@ -3,7 +3,8 @@ - + + diff --git a/epmet-module/resi-home/resi-home-server/src/main/resources/logback-spring.xml b/epmet-module/resi-home/resi-home-server/src/main/resources/logback-spring.xml index 0b5eedfde0..490067bb31 100644 --- a/epmet-module/resi-home/resi-home-server/src/main/resources/logback-spring.xml +++ b/epmet-module/resi-home/resi-home-server/src/main/resources/logback-spring.xml @@ -3,7 +3,8 @@ - + + diff --git a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/InitInfoResultDTO.java b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/InitInfoResultDTO.java index 36b860a3e9..c55c4d41fb 100644 --- a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/InitInfoResultDTO.java +++ b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/InitInfoResultDTO.java @@ -53,4 +53,15 @@ public class InitInfoResultDTO implements Serializable { * 手机号 */ private String mobile; + + /** + * 2023.04.18烟台需求增加 + * 用于完善信息界面展示 + */ + private String gridId; + /** + * 2023.04.18烟台需求增加 + * 用于完善信息界面展示 + */ + private String gridName; } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/impl/PersonalCenterServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/impl/PersonalCenterServiceImpl.java index 5c4788f7b7..29f2eecffe 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/impl/PersonalCenterServiceImpl.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/impl/PersonalCenterServiceImpl.java @@ -1,6 +1,8 @@ package com.epmet.modules.mine.service.impl; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.EditInfoFormDTO; @@ -11,6 +13,7 @@ import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.modules.mine.service.PersonalCenterService; import com.epmet.resi.mine.dto.result.InitInfoResultDTO; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -46,6 +49,16 @@ public class PersonalCenterServiceImpl implements PersonalCenterService { resultDTO.setIdNum(baseInfoResult.getData().getIdNum()); resultDTO.setMobile(baseInfoResult.getData().getMobile()); resultDTO.setRealName(baseInfoResult.getData().getRealName()); + // start + // 2023.04.18烟台需求增加 + // 用于完善信息界面展示 + resultDTO.setGridId(baseInfoResult.getData().getGridId()); + if (StringUtils.isNotBlank(resultDTO.getGridId())) { + GridInfoCache gridInfoCache = CustomerOrgRedis.getGridInfo(resultDTO.getGridId()); + if (null != gridInfoCache) { + resultDTO.setGridName(gridInfoCache.getGridNamePath()); + } + }// end return resultDTO; } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/resources/logback-spring.xml b/epmet-module/resi-mine/resi-mine-server/src/main/resources/logback-spring.xml index f797654dbd..a0c67122f7 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/resources/logback-spring.xml +++ b/epmet-module/resi-mine/resi-mine-server/src/main/resources/logback-spring.xml @@ -3,7 +3,8 @@ - + + diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/EditPrincipalFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/EditPrincipalFormDTO.java index c518b0ef7e..403c68016e 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/EditPrincipalFormDTO.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/EditPrincipalFormDTO.java @@ -31,6 +31,6 @@ public class EditPrincipalFormDTO implements Serializable { @NotBlank(message = "principalMobile不能为空",groups = AddGroup.class) private String principalMobile; - @NotBlank(message = "principalStaffId不能为空",groups = AddGroup.class) + // @NotBlank(message = "principalStaffId不能为空",groups = AddGroup.class) private String principalStaffId; } diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/PartymemberPortraitResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/PartymemberPortraitResultDTO.java new file mode 100644 index 0000000000..9989ef8f5e --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/PartymemberPortraitResultDTO.java @@ -0,0 +1,41 @@ +package com.epmet.resi.partymember.dto.partymember.result; + +import com.alibaba.excel.annotation.ExcelIgnore; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.Data; + +/** + * @Description 烟台管理平台党员画像 + * @Author yzm + * @Date 2023/4/20 13:32 + */ +@Data +public class PartymemberPortraitResultDTO { + @ExcelIgnore + private String userId; + + @ColumnWidth(15) + @ExcelProperty(value = "姓名",order = 1) + private String name; + + @ColumnWidth(20) + @ExcelProperty(value = "手机号",order = 2) + private String mobile; + + @ColumnWidth(20) + @ExcelProperty(value = "证件号",order = 3) + private String idCard; + + @ColumnWidth(15) + @ExcelProperty(value = "年龄",order = 4) + private String age; + + @ColumnWidth(15) + @ExcelProperty(value = "学历",order = 5) + private String education; + + @ExcelIgnore + private String icResiUser; +} + diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java index aa13fbfec8..5764d703d3 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java @@ -158,4 +158,12 @@ public interface IcPartyOrgService extends BaseService { */ void editPrincipal(EditPrincipalFormDTO formDTO); + /** + * 获取工作人员所属组织下的党组织 + * @param customerId + * @param staffId + * @return + */ + IcPartyOrgEntity getIcPartyOrg(String customerId,String staffId); + } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java index 0b18281ce5..b13a9b573a 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java @@ -503,4 +503,28 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl orgWrapper = new LambdaQueryWrapper<>(); + orgWrapper.eq(IcPartyOrgEntity::getCustomerId, customerId); + orgWrapper.eq(IcPartyOrgEntity::getAgencyId, staffInfo.getAgencyId()); + orgWrapper.ne(IcPartyOrgEntity::getPartyOrgType, NumConstant.FIVE_STR); + IcPartyOrgEntity icPartyOrgEntity = baseDao.selectOne(orgWrapper); + if (null == icPartyOrgEntity) { + log.warn("当前工作人员所属组织下,暂无党组织,当前"); + } + return icPartyOrgEntity; + } } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberController.java index 7628cfbb82..0330f3b9d3 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberController.java @@ -4,21 +4,18 @@ import com.alibaba.excel.EasyExcel; import com.alibaba.excel.ExcelWriter; import com.alibaba.excel.write.metadata.WriteSheet; import com.alibaba.fastjson.JSON; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.MaskResponse; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.dto.result.OptionDataResultDTO; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.*; import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; @@ -33,14 +30,15 @@ import com.epmet.dto.form.IcPartyMemberListFormDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.dto.result.PartyMemberAgeResultDTO; import com.epmet.dto.result.PartyMemberEducationResultDTO; -import com.epmet.modules.partyOrg.dao.IcPartyOrgDao; import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity; +import com.epmet.modules.partyOrg.service.IcPartyOrgService; import com.epmet.modules.partymember.excel.IcPartyMemberExcel; import com.epmet.modules.partymember.service.IcPartyMemberService; import com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO; import com.epmet.resi.partymember.dto.partymember.form.IcPartyMemberFromDTO; import com.epmet.resi.partymember.dto.partymember.result.IcPartyInfoResultDTO; import com.epmet.resi.partymember.dto.partymember.result.IcPartyMemberResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartymemberPortraitResultDTO; import com.epmet.utils.ImportTaskUtils; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; @@ -59,10 +57,7 @@ import java.io.InputStream; import java.io.PrintWriter; import java.net.URLEncoder; import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.UUID; +import java.util.*; import java.util.concurrent.atomic.AtomicInteger; @@ -79,8 +74,10 @@ public class IcPartyMemberController implements ResultDataResolver { @Autowired private IcPartyMemberService icPartyMemberService; + // @Autowired + // private IcPartyOrgDao icPartyOrgDao; @Autowired - private IcPartyOrgDao icPartyOrgDao; + private IcPartyOrgService icPartyOrgService; @RequestMapping("page") @MaskResponse(fieldNames = { "mobile", "idCard" }, fieldsMaskType = { MaskResponse.MASK_TYPE_MOBILE, MaskResponse.MASK_TYPE_ID_CARD }) @@ -230,6 +227,26 @@ public class IcPartyMemberController implements ResultDataResolver { return new Result(); } + + /** + * @describe: 统计分析-党员年龄范围统计 + * @author wangtong + * @date 2022/5/23 10:19 + * @params [formDTO] + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("partymemberagestatistics") + public Result> partyMemberAgeStatistics(@LoginUser TokenDto tokenDto,@RequestBody IcPartyMemberFormDTO formDTO) { + if(StringUtils.isBlank(formDTO.getOrgId())){ + IcPartyOrgEntity org =icPartyOrgService.getIcPartyOrg(tokenDto.getCustomerId(),tokenDto.getUserId()); + if (null == org) { + return new Result>().ok(new ArrayList<>()); + } + formDTO.setOrgId(org.getId()); + } + return new Result>().ok(icPartyMemberService.partyMemberAgeStatistics(formDTO)); + } + /** * @describe: 统计分析-党员学历统计 * @author wangtong @@ -240,7 +257,7 @@ public class IcPartyMemberController implements ResultDataResolver { @PostMapping("partymembereducationstatistics") public Result> partyMemberEducationStatistics(@LoginUser TokenDto tokenDto, @RequestBody IcPartyMemberFormDTO formDTO) { if(StringUtils.isBlank(formDTO.getOrgId())){ - IcPartyOrgEntity org = setOrgId(tokenDto); + IcPartyOrgEntity org= icPartyOrgService.getIcPartyOrg(tokenDto.getCustomerId(),tokenDto.getUserId()); if (null == org) { return new Result>().ok(new ArrayList<>()); } @@ -260,7 +277,7 @@ public class IcPartyMemberController implements ResultDataResolver { @MaskResponse(fieldNames = {"mobile"}, fieldsMaskType = {MaskResponse.MASK_TYPE_MOBILE}) public Result> partyMemberAgelist(@LoginUser TokenDto tokenDto,@RequestBody IcPartyMemberListFormDTO formDTO) { if(StringUtils.isBlank(formDTO.getOrgId())){ - IcPartyOrgEntity org = setOrgId(tokenDto); + IcPartyOrgEntity org= icPartyOrgService.getIcPartyOrg(tokenDto.getCustomerId(),tokenDto.getUserId()); if (null == org) { return new Result>().ok(new PageData<>(Collections.emptyList(), 0)); } @@ -280,7 +297,7 @@ public class IcPartyMemberController implements ResultDataResolver { @MaskResponse(fieldNames = {"mobile"}, fieldsMaskType = {MaskResponse.MASK_TYPE_MOBILE}) public Result> partyMemberEducationlist(@LoginUser TokenDto tokenDto,@RequestBody IcPartyMemberListFormDTO formDTO) { if(StringUtils.isBlank(formDTO.getOrgId())){ - IcPartyOrgEntity org = setOrgId(tokenDto); + IcPartyOrgEntity org= icPartyOrgService.getIcPartyOrg(tokenDto.getCustomerId(),tokenDto.getUserId()); if (null == org) { return new Result>().ok(new PageData<>(Collections.emptyList(), 0)); } @@ -289,43 +306,116 @@ public class IcPartyMemberController implements ResultDataResolver { return new Result>().ok(icPartyMemberService.getPartyMemberEducationList(formDTO)); } + /** - * @describe: 统计分析-党员年龄范围统计 - * @author wangtong - * @date 2022/5/23 10:19 - * @params [formDTO] - * @return com.epmet.commons.tools.utils.Result> - */ - @PostMapping("partymemberagestatistics") - public Result> partyMemberAgeStatistics(@LoginUser TokenDto tokenDto,@RequestBody IcPartyMemberFormDTO formDTO) { - if(StringUtils.isBlank(formDTO.getOrgId())){ - IcPartyOrgEntity org = setOrgId(tokenDto); - if (null == org) { - return new Result>().ok(new ArrayList<>()); + * 烟台党员画像列表接口,将上方两个接口,合为一个 + * @param formDTO + * @return + */ + @PostMapping("partymember-portrait-list") + @MaskResponse(fieldNames = {"mobile","idCard"}, fieldsMaskType = {MaskResponse.MASK_TYPE_MOBILE,MaskResponse.MASK_TYPE_ID_CARD}) + public Result> queryPartyMemberPortraitList(@RequestBody IcPartyMemberListFormDTO formDTO) { + return new Result>().ok(icPartyMemberService.queryPartyMemberPortraitList(formDTO)); + } + + + /** + * 烟台党员画像列表-导出 + * @param formDTO + * @return + */ + @NoRepeatSubmit + @PostMapping("partymember-portrait-export") + public void partymemberPortraitExport(@RequestBody IcPartyMemberListFormDTO formDTO, HttpServletResponse response) throws Exception { + ExcelWriter excelWriter = null; + formDTO.setPageSize(NumConstant.TEN_THOUSAND); + formDTO.setIsPage(true); + String fileName=getPartymemberPortraitFileName(formDTO.getCodeType(),formDTO.getCode()); + try { + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), PartymemberPortraitResultDTO.class).build(); + WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build(); + PageData data = null; + List list = null; + do { + data = icPartyMemberService.queryPartyMemberPortraitList(formDTO); + list = data.getList(); + formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE); + excelWriter.write(list, writeSheet); + } while (org.apache.commons.collections4.CollectionUtils.isNotEmpty(list) && list.size() == formDTO.getPageSize()); + } catch (EpmetException e) { + response.reset(); + response.setCharacterEncoding("UTF-8"); + response.setHeader("content-type", "application/json; charset=UTF-8"); + PrintWriter printWriter = response.getWriter(); + Result result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), e.getMsg()); + printWriter.write(JSON.toJSONString(result)); + printWriter.close(); + } catch (Exception e) { + log.error("党员画像列表导出exception", e); + } finally { + if (excelWriter != null) { + excelWriter.finish(); } - formDTO.setOrgId(org.getId()); } - return new Result>().ok(icPartyMemberService.partyMemberAgeStatistics(formDTO)); } /** - * @describe: 组装党组织信息 - * @author wangtong - * @date 2022/7/8 16:46 - * @params [tokenDto, formDTO] - * @return com.epmet.modules.partyOrg.entity.IcPartyOrgEntity - */ - public IcPartyOrgEntity setOrgId(TokenDto tokenDto){ - CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(),tokenDto.getUserId()); - if (null == staffInfo) { - throw new EpmetException("获取工作人员信息失败"); + * 烟台党员画像列表-导出 + * @return 返回导出excel的文件名 + */ + private String getPartymemberPortraitFileName(String codeType, String code) { + String name = "党员画像"; + if ("age".equals(codeType)) { + switch (code) { + case NumConstant.ZERO_STR: + name = "50岁以下党员信息"; + break; + case NumConstant.ONE_STR: + name = "50-59岁党员信息"; + break; + case NumConstant.TWO_STR: + name = "60-69岁党员信息"; + break; + case NumConstant.THREE_STR: + name = "70-79岁党员信息"; + break; + case NumConstant.FOUR_STR: + name = "80岁以上党员信息"; + break; + default: + name = ""; + break; + } + }else if ("education".equals(codeType)) { + switch (code) { + case NumConstant.ZERO_STR: + name = "小学及文盲党员信息"; + break; + case NumConstant.ONE_STR: + name = "初中学历党员信息"; + break; + case NumConstant.TWO_STR: + name = "高中学历党员信息"; + break; + case NumConstant.THREE_STR: + name = "大专学历党员信息"; + break; + case NumConstant.FOUR_STR: + name = "本科学历党员信息"; + break; + case NumConstant.FIVE_STR: + name = "硕士学历党员信息"; + break; + case NumConstant.SIX_STR: + name = "博士学历党员信息"; + break; + default: + name = "党员画像"; + break; + } } - //获取工作人员所属组织同级的党组织 - LambdaQueryWrapper orgWrapper = new LambdaQueryWrapper<>(); - orgWrapper.eq(IcPartyOrgEntity::getCustomerId, tokenDto.getCustomerId()); - orgWrapper.eq(IcPartyOrgEntity::getAgencyId, staffInfo.getAgencyId()); - orgWrapper.ne(IcPartyOrgEntity::getPartyOrgType, NumConstant.FIVE_STR); - return icPartyOrgDao.selectOne(orgWrapper); + String fileName=name+DateUtils.format(new Date()) + ".xlsx"; + return fileName; } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberDao.java index 0f18a60ac5..740128a912 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberDao.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberDao.java @@ -65,7 +65,10 @@ public interface IcPartyMemberDao extends BaseDao { * @params [orgId, code] * @return java.util.List */ - List getPartyMemberEducationList(@Param("agencyId") String agencyId,@Param("orgId") String orgId,@Param("code") String code); + List getPartyMemberEducationList(@Param("agencyId") String agencyId, + @Param("orgId") String orgId, + @Param("code") String code, + @Param("codeType") String codeType); /** * @describe: 党员年龄范围统计 diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberService.java index c88113ae6a..1ff8c2dece 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberService.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberService.java @@ -8,6 +8,7 @@ import com.epmet.dto.form.IcPartyMemberFormDTO; import com.epmet.dto.form.IcPartyMemberListFormDTO; import com.epmet.dto.result.PartyMemberAgeResultDTO; import com.epmet.dto.result.PartyMemberEducationResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartymemberPortraitResultDTO; import com.epmet.modules.partymember.entity.IcPartyMemberEntity; import com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO; import com.epmet.resi.partymember.dto.partymember.form.IcPartyMemberFromDTO; @@ -150,4 +151,11 @@ public interface IcPartyMemberService extends BaseService { void execAsyncExcelImport(Path filePath, String importTaskId); IcPartyInfoResultDTO partyInfo(TokenDto tokenDto); + + /** + * 烟台管理平台党员画像,列表查询 + * @param formDTO + * @return + */ + PageData queryPartyMemberPortraitList(IcPartyMemberListFormDTO formDTO); } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberServiceImpl.java index d9d43ea387..d80fa318be 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberServiceImpl.java @@ -10,7 +10,6 @@ import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.form.DictListFormDTO; -import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.dto.result.DictListResultDTO; import com.epmet.commons.tools.dto.result.OptionDataResultDTO; import com.epmet.commons.tools.enums.DictTypeEnum; @@ -22,7 +21,6 @@ import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.*; import com.epmet.constants.ImportTaskConstants; @@ -49,6 +47,7 @@ import com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO; import com.epmet.resi.partymember.dto.partymember.form.IcPartyMemberFromDTO; import com.epmet.resi.partymember.dto.partymember.result.IcPartyInfoResultDTO; import com.epmet.resi.partymember.dto.partymember.result.IcPartyMemberResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartymemberPortraitResultDTO; import com.epmet.utils.ImportTaskUtils; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -106,17 +105,9 @@ public class IcPartyMemberServiceImpl extends BaseServiceImpl page(TokenDto tokenDto, IcPartyMemberFromDTO formDTO) { - CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); - if (null == staffInfo) { - throw new EpmetException("获取工作人员信息失败"); - } if (StringUtils.isBlank(formDTO.getPartyOrgId())) { //获取工作人员所属组织同级的党组织 - LambdaQueryWrapper orgWrapper = new LambdaQueryWrapper<>(); - orgWrapper.eq(IcPartyOrgEntity::getCustomerId, tokenDto.getCustomerId()); - orgWrapper.eq(IcPartyOrgEntity::getAgencyId, staffInfo.getAgencyId()); - orgWrapper.ne(IcPartyOrgEntity::getPartyOrgType, NumConstant.FIVE_STR); - IcPartyOrgEntity org = icPartyOrgDao.selectOne(orgWrapper); + IcPartyOrgEntity org = icPartyOrgService.getIcPartyOrg(tokenDto.getCustomerId(),tokenDto.getUserId()); if (null == org) { return new PageData<>(Collections.emptyList(), 0); } @@ -177,17 +168,8 @@ public class IcPartyMemberServiceImpl extends BaseServiceImpl orgWrapper = new LambdaQueryWrapper<>(); - orgWrapper.eq(IcPartyOrgEntity::getCustomerId, tokenDto.getCustomerId()); - orgWrapper.eq(IcPartyOrgEntity::getAgencyId, staffInfo.getAgencyId()); - orgWrapper.ne(IcPartyOrgEntity::getPartyOrgType, NumConstant.FIVE_STR); - IcPartyOrgEntity orgInfo = icPartyOrgDao.selectOne(orgWrapper); + IcPartyOrgEntity orgInfo=icPartyOrgService.getIcPartyOrg(tokenDto.getCustomerId(),tokenDto.getUserId()); if (null == orgInfo) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "党组织不存在", "党组织不存在"); } @@ -450,7 +432,7 @@ public class IcPartyMemberServiceImpl extends BaseServiceImpl list = baseDao.getPartyMemberAgeList(formDTO.getAgencyId(),formDTO.getOrgId(), formDTO.getCode()); PageInfo pageInfo = new PageInfo<>(list); - return new PageData<>(list, pageInfo.getTotal()); + return new PageData<>(list, pageInfo.getTotal(),formDTO.getPageSize()); } List list = baseDao.getPartyMemberAgeList(formDTO.getAgencyId(),formDTO.getOrgId(), formDTO.getCode()); return new PageData<>(list, null == list?NumConstant.ZERO:list.size()); @@ -460,23 +442,23 @@ public class IcPartyMemberServiceImpl extends BaseServiceImpl getPartyMemberEducationList(IcPartyMemberListFormDTO formDTO) { if (formDTO.getIsPage()) { PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); - List list = baseDao.getPartyMemberEducationList(formDTO.getAgencyId(),formDTO.getOrgId(), formDTO.getCode()); - Result> mapResult = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.EDUCATION.getCode()); + List list = baseDao.getPartyMemberEducationList(formDTO.getAgencyId(),formDTO.getOrgId(), formDTO.getCode(),"education"); PageInfo pageInfo = new PageInfo<>(list); - if (CollectionUtils.isNotEmpty(list)) { - list.forEach(item -> { - item.setEducation(null == mapResult.getData().get(item.getEducation()) ? "" : mapResult.getData().get(item.getEducation())); - }); - } - return new PageData<>(list, pageInfo.getTotal()); - } - List list = baseDao.getPartyMemberEducationList(formDTO.getAgencyId(),formDTO.getOrgId(), formDTO.getCode()); - Result> mapResult = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.EDUCATION.getCode()); - if (CollectionUtils.isNotEmpty(list)) { - list.forEach(item -> { - item.setEducation(null == mapResult.getData().get(item.getEducation()) ? "" : mapResult.getData().get(item.getEducation())); - }); - } + // Result> mapResult = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.EDUCATION.getCode()); + // if (CollectionUtils.isNotEmpty(list)) { + // list.forEach(item -> { + // item.setEducation(null == mapResult.getData().get(item.getEducation()) ? "" : mapResult.getData().get(item.getEducation())); + // }); + // } + return new PageData<>(list, pageInfo.getTotal(),formDTO.getPageSize()); + } + List list = baseDao.getPartyMemberEducationList(formDTO.getAgencyId(),formDTO.getOrgId(), formDTO.getCode(),"education"); + // Result> mapResult = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.EDUCATION.getCode()); + // if (CollectionUtils.isNotEmpty(list)) { + // list.forEach(item -> { + // item.setEducation(null == mapResult.getData().get(item.getEducation()) ? "" : mapResult.getData().get(item.getEducation())); + // }); + // } return new PageData<>(list, null == list?NumConstant.ZERO:list.size()); } @@ -734,5 +716,39 @@ public class IcPartyMemberServiceImpl extends BaseServiceImpl queryPartyMemberPortraitList(IcPartyMemberListFormDTO formDTO) { + if (StringUtils.isBlank(formDTO.getOrgId())) { + // 当前工作人员所属组织下的,党组织 + IcPartyOrgEntity org= icPartyOrgService.getIcPartyOrg(EpmetRequestHolder.getLoginUserCustomerId(),EpmetRequestHolder.getLoginUserId()); + if (null == org) { + return new PageData<>(Collections.emptyList(), 0, formDTO.getPageSize()); + } + formDTO.setOrgId(org.getId()); + } + if ("age".equals(formDTO.getCodeType())) { + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + List list = baseDao.getPartyMemberAgeList(formDTO.getAgencyId(), formDTO.getOrgId(), formDTO.getCode()); + PageInfo pageInfo = new PageInfo<>(list); + + List resultDTOList = ConvertUtils.sourceToTarget(list, PartymemberPortraitResultDTO.class); + return new PageData<>(resultDTOList, pageInfo.getTotal(), formDTO.getPageSize()); + + } + // else if ("education".equals(formDTO.getCodeType())) { + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + List list = baseDao.getPartyMemberEducationList(formDTO.getAgencyId(), formDTO.getOrgId(), formDTO.getCode(),formDTO.getCodeType()); + PageInfo pageInfo = new PageInfo<>(list); + + List resultDTOList = ConvertUtils.sourceToTarget(list, PartymemberPortraitResultDTO.class); + return new PageData<>(resultDTOList, pageInfo.getTotal(), formDTO.getPageSize()); + } + } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/logback-spring.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/logback-spring.xml index b8b3161188..1bc47d8520 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/logback-spring.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/logback-spring.xml @@ -3,7 +3,8 @@ - + + diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberDao.xml index a9d4f8c583..962f962a8b 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberDao.xml @@ -164,7 +164,9 @@ NAME, MOBILE, age, - IC_RESI_USER + IC_RESI_USER, + ID_CARD, + education FROM ( SELECT @@ -172,14 +174,16 @@ NAME, MOBILE, age, - CASE + (CASE WHEN age < 50 THEN '0' WHEN age >= 50 AND age <= 59 THEN '1' WHEN age >= 60 AND age <= 69 THEN '2' WHEN age >= 70 AND age <= 79 THEN '3' ELSE '4' - END AS ageGroup, - IC_RESI_USER + END )AS ageGroup, + IC_RESI_USER, + ID_CARD, + education FROM ( SELECT @@ -187,7 +191,20 @@ NAME, MOBILE, YEAR (FROM_DAYS(DATEDIFF(NOW(),SUBSTRING( ID_CARD, 7, 8 )))) AS age, - IC_RESI_USER + IC_RESI_USER, + ID_CARD, + ( + case when CULTURE='0' then '小学及文盲' + when CULTURE='1' then '初中' + when CULTURE='2' then '高中' + when CULTURE='3' then '大专' + when CULTURE='4' then '本科' + when CULTURE='5' then '硕士' + when CULTURE='6' then '博士' + when CULTURE='7' then '中专' + else '' + end + )as education FROM ic_party_member WHERE @@ -205,22 +222,37 @@ WHERE ageGroup = #{code} - ORDER BY CONVERT(NAME USING GBK) ASC + ORDER BY ID ASC SELECT - d.id, - d.`NAME`, - d.ID_CARD, - d.DEATH_DATE, - d.AGE, - d.ADDRESS, - d.IC_RESI_USER_ID, - d.GRID_ID, - d.AGENCY_ID, - d.CREMATION_TIME, - d.ORGAN_NAME + d.* FROM data_sync_record_death d WHERE diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectDao.xml index 35090d4a12..ea43232174 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectDao.xml @@ -19,6 +19,7 @@ + @@ -32,6 +33,7 @@ c.HOME_ID as homeId, c.CHECK_STATE as checkState, c.AGENCY_ID as agencyId, + c.GRID_ID as gridId, #{domicilePlace} as domicile_place FROM ic_resi_collect c left join ic_resi_member m on(c.id=m.IC_RESI_COLLECT_ID and m.del_flag='0') @@ -54,6 +56,12 @@ AND m.DOMICILE_PLACE LIKE CONCAT('%',#{domicilePlace},'%') + + AND c.CHECK_STATE = #{checkState} + + + AND c.HOUSE_HOLDER_NAME like concat('%', #{houseHolderName},'%') + ORDER BY c.CREATED_TIME DESC select * from ic_resi_user where del_flag='0' and id=#{icResiUserId} and customer_id=#{customerId} @@ -322,7 +335,7 @@ ORDER BY - IC_RESI_USER.GRID_ID desc, + IC_RESI_USER.GRID_ID asc, IC_RESI_USER.VILLAGE_ID ASC, IC_RESI_USER.BUILD_ID ASC, IC_RESI_USER.UNIT_ID ASC, @@ -1606,7 +1619,7 @@ r.DEL_FLAG = '0' AND r.CUSTOMER_ID = #{customerId} - AND ( r.AGENCY_ID = #{orgId} OR r.PIDS LIKE concat('%',#{orgId},'%') ) + and r.PIDS LIKE concat(#{orgIdPath},'%') and r.GRID_ID = #{orgId} @@ -1647,7 +1660,7 @@ and u.BIRTHDAY is not null and u.BIRTHDAY !='' - AND ( u.AGENCY_ID = #{orgId} OR u.PIDS LIKE concat('%',#{orgId},'%') ) + and u.PIDS LIKE concat(#{orgIdPath},'%') and u.GRID_ID = #{orgId} @@ -1673,6 +1686,18 @@ ( CASE WHEN u.GENDER = '1' THEN '男' WHEN u.GENDER = '2' THEN '女' ELSE '未知' END ) AS genderName, YEAR (NOW())- SUBSTR( u.BIRTHDAY, 1, 4 ) AS age, u.CULTURE AS educationCode, + ( + case when u.CULTURE='0' then '小学及文盲' + when u.CULTURE='1' then '初中' + when u.CULTURE='2' then '高中' + when u.CULTURE='3' then '大专' + when u.CULTURE='4' then '本科' + when u.CULTURE='5' then '硕士' + when u.CULTURE='6' then '博士' + when u.CULTURE='7' then '中专' + else '' + end + )as educationName, '' AS educationName, IFNULL(u.CULTURE,'')AS educationCode, u.BIRTHDAY AS birthday @@ -1683,7 +1708,7 @@ AND u.CUSTOMER_ID = #{customerId} AND u.`STATUS` = '0' - AND ( u.AGENCY_ID = #{orgId} OR u.PIDS LIKE concat('%',#{orgId},'%') ) + and u.PIDS LIKE concat(#{orgIdPath},'%') and u.GRID_ID = #{orgId} @@ -1712,4 +1737,8 @@ order by u.ID asc + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/RegisterRelationDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/RegisterRelationDao.xml index c43cea28cc..f2e0506de3 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/RegisterRelationDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/RegisterRelationDao.xml @@ -97,5 +97,20 @@ AND grid_id = #{gridId} - +