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 9faf6cabaf..bb8d12f49c 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 @@ -6,9 +6,11 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.result.CorsConfigResultDTO; import com.epmet.feign.fallback.EpmetAdminOpenFeignClientFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import java.util.List; +import java.util.Map; @FeignClient(name = ServiceConstant.EPMET_ADMIN_SERVER, fallbackFactory = EpmetAdminOpenFeignClientFallbackFactory.class) //@FeignClient(name = ServiceConstant.EPMET_ADMIN_SERVER, fallbackFactory = EpmetAdminOpenFeignClientFallbackFactory.class, url = "localhost:8082") @@ -72,4 +74,14 @@ public interface EpmetAdminOpenFeignClient { */ @PostMapping("/sys/dict/data/relationship") Result> getRelationshipOption(); + + /** + * 字典数据查询通用接口 + * @Param dictType + * @Return {@link Result< Map < String, String>>} + * @Author zhaoqifeng + * @Date 2021/11/19 17:36 + */ + @PostMapping("/sys/dict/data/dictmap/{dictType}") + Result> dictMap(@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 6ba1f8bee7..139514d1f5 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 @@ -6,39 +6,44 @@ import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.result.CorsConfigResultDTO; import com.epmet.feign.EpmetAdminOpenFeignClient; -import org.springframework.stereotype.Component; import java.util.List; +import java.util.Map; //@Component public class EpmetAdminOpenFeignClientFallback implements EpmetAdminOpenFeignClient { @Override public Result> list() { - return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "list", null); + return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "list", null); } @Override public Result> getEducationOption() { - return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getEducationOption", null); + return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "getEducationOption", null); } @Override public Result> getHouseOption() { - return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getHouseOption", null); + return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "getHouseOption", null); } @Override public Result> getNationOption() { - return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getNationOption", null); + return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "getNationOption", null); } @Override public Result> getNineSmallPlacesOption() { - return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getNineSmallPlacesOption", null); + return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "getNineSmallPlacesOption", null); } @Override public Result> getRelationshipOption() { - return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getRelationshipOption", null); + return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "getRelationshipOption", null); + } + + @Override + public Result> dictMap(String dictType) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "dictMap", 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 18e0437551..aff54e6e09 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 @@ -150,4 +150,16 @@ public class SysDictDataController { return new Result>().ok(sysDictDataService.dictList(formDTO.getDictType())); } + /** + * 字典数据查询通用接口 + * @Param dictType + * @Return {@link Result< Map< String, String>>} + * @Author zhaoqifeng + * @Date 2021/11/19 17:36 + */ + @PostMapping("dictmap/{dictType}") + public Result> dictMap(@PathVariable("dictType") String dictType) { + return new Result>().ok(sysDictDataService.dictMap(dictType)); + } + } 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 0d64ee0d8c..9109cfdc86 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 @@ -9,7 +9,6 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.commons.tools.dto.form.DictListFormDTO; import com.epmet.commons.tools.dto.result.DictListResultDTO; import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.page.PageData; @@ -85,4 +84,7 @@ public interface SysDictDataService extends BaseService { * @Author sun */ List dictList(String dictType); + + + Map dictMap(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 468fb764c7..d3c61d6c16 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 @@ -12,7 +12,6 @@ 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.dto.form.DictListFormDTO; import com.epmet.commons.tools.dto.result.DictListResultDTO; import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.page.PageData; @@ -212,4 +211,10 @@ public class SysDictDataServiceImpl extends BaseServiceImpl dictMap(String dictType) { + List resultDTOList = baseDao.selectDictList(dictType); + return resultDTOList.stream().collect(Collectors.toMap(DictListResultDTO::getValue, DictListResultDTO::getLabel)); + } + } diff --git a/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.6__add_dict_data.sql b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.6__add_dict_data.sql new file mode 100644 index 0000000000..78f16f4d94 --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.6__add_dict_data.sql @@ -0,0 +1,29 @@ +-- 1、增加字典类型 +INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (8, 'user_demand_status', '居民需求状态', '待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished', 8, 1067246875800000001, '2021-11-18 16:29:58', 1067246875800000001, '2021-11-18 16:29:58'); +INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (9, 'user_demand_report_type', '居民需求上报类型', '社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help', 9, 1067246875800000001, '2021-11-18 16:29:58', 1067246875800000001, '2021-11-18 16:29:58'); +INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (10, 'user_demand_service_type', '居民需求服务方类型', '服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit;', 10, 1067246875800000001, '2021-11-18 16:29:58', 1067246875800000001, '2021-11-18 16:29:58'); +INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000006, 'scale', '人员规模', '', 6, 1067246875800000001, '2021-11-18 16:29:58', 1067246875800000001, '2021-11-18 16:29:58'); +INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000007, 'party_unit_type', '联建单位分类', '', 7, 1067246875800000001, '2021-11-18 16:29:58', 1067246875800000001, '2021-11-18 16:29:58'); +-- 2、增加字典数据 +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000200, 1000000000000000007, '楼宇党建', '0', '', 0, 1067246875800000001, '2020-03-08 16:29:58', 1067246875800000001, '2020-03-08 16:29:58'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000201, 1000000000000000007, '两新组织', '1', '', 1, 1067246875800000001, '2020-03-08 16:29:58', 1067246875800000001, '2020-03-08 16:29:58'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000202, 1000000000000000007, '区域单位党建', '2', '', 2, 1067246875800000001, '2020-03-08 16:29:58', 1067246875800000001, '2020-03-08 16:29:58'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000203, 1000000000000000007, '机关直属部门', '3', '', 3, 1067246875800000001, '2020-03-08 16:29:58', 1067246875800000001, '2020-03-08 16:29:58'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000204, 1000000000000000007, '其他', '4', '', 4, 1067246875800000001, '2020-03-08 16:29:58', 1067246875800000001, '2020-03-08 16:29:58'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000205, 8, '待处理', 'pending', '', 1, 1, '2021-11-23 14:00:59', 1, '2021-11-23 14:00:59'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000206, 8, '已取消', 'canceled', '', 2, 1, '2021-11-23 14:00:59', 1, '2021-11-23 14:00:59'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000207, 8, '已派单', 'assigned', '', 3, 1, '2021-11-23 14:00:59', 1, '2021-11-23 14:00:59'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000208, 8, '已接单', 'have_order', '', 4, 1, '2021-11-23 14:00:59', 1, '2021-11-23 14:00:59'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000209, 8, '已完成', 'finished', '', 5, 1, '2021-11-23 14:00:59', 1, '2021-11-23 14:00:59'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000210, 9, '社区帮办', 'community', '', 1, 1, '2021-11-23 14:03:22', 1, '2021-11-23 14:03:22'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000211, 9, '楼长帮办', 'building_caption', '', 2, 1, '2021-11-23 14:03:22', 1, '2021-11-23 14:03:22'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000212, 9, '党员帮办', 'party', '', 3, 1, '2021-11-23 14:03:22', 1, '2021-11-23 14:03:22'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000213, 10, '志愿者', 'volunteer', '', 1, 1, '2021-11-23 14:04:42', 1, '2021-11-23 14:04:42'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000214, 10, '社会组织', 'social_org', '', 2, 1, '2021-11-23 14:04:42', 1, '2021-11-23 14:04:42'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000215, 10, '社区自组织', 'community_org', '', 3, 1, '2021-11-23 14:04:42', 1, '2021-11-23 14:04:42'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000216, 10, '区域党建单位', 'party_unit', '', 4, 1, '2021-11-23 14:04:42', 1, '2021-11-23 14:04:42'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (2000000000000000000, 1000000000000000006, '10人以下', '0', '', 0, 1067246875800000001, '2021-11-18 16:29:58', 1067246875800000001, '2021-11-18 16:29:58'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (2000000000000000001, 1000000000000000006, '10-20人', '1', '', 1, 1067246875800000001, '2021-11-18 16:29:58', 1067246875800000001, '2021-11-18 16:29:58'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (2000000000000000002, 1000000000000000006, '21-40人', '2', '', 2, 1067246875800000001, '2021-11-18 16:29:58', 1067246875800000001, '2021-11-18 16:29:58'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (2000000000000000003, 1000000000000000006, '41-100人', '3', '', 3, 1067246875800000001, '2021-11-18 16:29:58', 1067246875800000001, '2021-11-18 16:29:58'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (2000000000000000004, 1000000000000000006, '100人以上', '4', '', 4, 1067246875800000001, '2021-11-18 16:29:58', 1067246875800000001, '2021-11-18 16:29:58'); \ No newline at end of file diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java index 93894c0bdb..400eca1d51 100644 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java @@ -70,4 +70,8 @@ public interface ConsomerGroupConstants { */ String IC_WARN_STATS_EVENT_LISTENER_GROUP = "ic_warn_stats_event_listener_group"; + /** + * 需求完成,如果服务方是区域化党建单位,重新计算这个单位的满意度 + */ + String CAL_PARTY_UNIT_SATISFACTION = "cal_party_unit_satisfaction"; } diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java index 13217da550..e11400fef3 100644 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java @@ -53,4 +53,9 @@ public interface TopicConstants { * 项目 */ String IC_RESI_USER = "ic_resi_user"; + + /** + * 需求完成,如果服务方是区域化党建单位,重新计算这个单位的满意度 + */ + String CAL_PARTY_UNIT_SATISFACTION = "cal_party_unit_satisfaction"; } diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CalPartyUnitSatisfactionFormDTO.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CalPartyUnitSatisfactionFormDTO.java new file mode 100644 index 0000000000..bfaf63703a --- /dev/null +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CalPartyUnitSatisfactionFormDTO.java @@ -0,0 +1,19 @@ +package com.epmet.commons.rocketmq.messages; + + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 需求完成,如果服务方是区域化党建单位,重新计算这个单位的满意度,或者直接计算整个客户 + */ +@Data +public class CalPartyUnitSatisfactionFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + @NotBlank(message = "客户id不能为空",groups = AddUserInternalGroup.class) + private String customerId; + private String partyUnitId; +} 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 c5db9c6718..81c74a4c38 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 @@ -93,4 +93,20 @@ public class CustomerStaffInfoCacheResult implements Serializable { */ private List deptList; + /** + * 组织级别 + */ + private String level; + + /** + * 中心位置经度 + */ + private String longitude; + + /** + * 中心位置纬度 + */ + private String latitude; + + } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionResultDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionResultDTO.java index 158b59fb55..8c42570bc3 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionResultDTO.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionResultDTO.java @@ -15,6 +15,8 @@ public class OptionResultDTO implements Serializable { private static final long serialVersionUID = 8618231166600518980L; private String label; private String value; + private String pValue; private String sysDictDataId; private List children; + private Boolean usableFlag; } 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 new file mode 100644 index 0000000000..478e7d4376 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java @@ -0,0 +1,58 @@ +package com.epmet.commons.tools.enums; + +/** + * @author Administrator + */ +public enum DictTypeEnum { + /** + * 环境变量枚举 + */ + UN_KNOWN("un_know", "暂不清楚", 0), + NINE_SMALL_PLACES("nine_small_places", "九小场所", 1), + EDUCATION("education", "文化程度", 2), + NATION("nation", "民族", 3), + RELATIONSHIP("relationship", "与户主关系", 4), + HOUSE("house", "住房性质", 5), + SCALE("scale", "人员规模", 6), + PARTY_UNIT_TYPE("party_unit_type", "联建单位分类", 7), + GENDER("gender", "性别", 8), + USER_DEMAND_STATUS("user_demand_status", "居民需求状态",8), + USER_DEMAND_REPORT_TYPE("user_demand_report_type","居民需求上报类型",9), + USER_DEMAND_SERVICE_TYPE("user_demand_service_type","居民需求服务方类型",10) + ; + + private final String code; + private final String name; + private final Integer sort; + + + + DictTypeEnum(String code, String name, Integer sort) { + this.code = code; + this.name = name; + this.sort = sort; + } + + public static DictTypeEnum getEnum(String code) { + DictTypeEnum[] values = DictTypeEnum.values(); + for (DictTypeEnum value : values) { + if (value.getCode().equals(code)) { + return value; + } + } + return DictTypeEnum.UN_KNOWN; + } + + + public String getCode() { + return code; + } + + public String getName() { + return name; + } + + public Integer getSort(){ + return sort; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/PartyUnitTypeEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/PartyUnitTypeEnum.java new file mode 100644 index 0000000000..6d7aee6009 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/PartyUnitTypeEnum.java @@ -0,0 +1,59 @@ +package com.epmet.commons.tools.enums; + +import com.epmet.commons.tools.exception.EpmetErrorCode; + +/** + * @author Administrator + */ +public enum PartyUnitTypeEnum { + //房屋类型,1楼房,2平房,3别墅 + LOUYU("0", "楼宇党建"), + ZUZHI("1", "两新组织"), + DANWEI("2", "区域单位党建"), + JIGUAN("3", "机关直属部门"), + QITA("4", "其他"); + private String code; + private String name; + + + PartyUnitTypeEnum(String code, String name) { + this.code = code; + this.name = name; + } + + public static String getName(String code) { + PartyUnitTypeEnum[] houseTypeEnums = values(); + for (PartyUnitTypeEnum houseTypeEnum : houseTypeEnums) { + if (houseTypeEnum.getCode() == code) { + return houseTypeEnum.getName(); + } + } + return EpmetErrorCode.SERVER_ERROR.getMsg(); + } + + public static String getCode(String name) { + PartyUnitTypeEnum[] houseTypeEnums = values(); + for (PartyUnitTypeEnum houseTypeEnum : houseTypeEnums) { + if (houseTypeEnum.getName().equals(name)) { + return houseTypeEnum.getCode(); + } + } + return null; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 39b11650a8..0f70c9ecbd 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -85,6 +85,14 @@ public enum EpmetErrorCode { BUILDING_NAME_EXITED(8215,"楼栋名称已存在"), DOOR_NAME_EXITED(8216,"门牌号已存在"), NEIGHBOOR_NAME_EXITED(8217,"小区名称已存在"), + DEMAND_NAME_EXITED(8218, "分类名称已存在"), + DEMAND_CAN_NOT_CANCEL(8219, "需求已完成,不可取消"), + DEMAND_CAN_NOT_ASSIGN(8220, "当前状态,不可指派"), + DEMAND_CAN_NOT_FINISH(8221, "当前状态,不能评价"), + DEMAND_FINISHED(8222,"需求已完成"), + DEMAND_CAN_NOT_UPDATE(8223,"当前状态,不可更新需求"), + DEMAND_NOT_EXITS(8224,"需求不存在"), + DEMAND_SERVICE_NOT_EXITS(8225,"服务记录不存在"), REQUIRE_PERMISSION(8301, "您没有足够的操作权限"), THIRD_PLAT_REQUEST_ERROR(8302, "请求第三方平台错误"), @@ -137,6 +145,26 @@ public enum EpmetErrorCode { PATROL_REPEATED_SUBMIT_ERROR(8521, "巡查已结束,请勿重复提交"), PATROL_END_TIME_ERROR(8522, "巡查结束时间不能小于巡查开始时间"), TIME_FORMAT_ERROR(8523, "时间格式错误"), + //社区党建 + PARTY_UNIT_NAME_EXITED(8531, "单位名称已存在"), + // 社区自组织 + COMMUNITY_SELF_ORGANIZATION_REPART_ERROR(8524, "社区自组织名称已存在"), + + // 党群服务中心 + PARTY_SERVICE_CENTER_ERROR(8525, "党群服务中心名称已存在"), + // 删除可预约事项存在预约记录时提示 + MATTER_EXISTS_APPOINTMENT_ERROR(8526, "尚有未履行的预约存在,请确认后操作"), + + // 预约某事项在某时间段存在记录时 + APPOINTMENT_TIME_ERROR(8527, "该时间段已被预约,请选择其他时间段"), + + APPOINTMENT_ERROR(8528, "%s尚有未履行的预约存在,请确认后操作"), + + EXISTS_SAME_PHONE_ERROR(8529, "%s存在重复"), + + COMMUNITY_SELF_ORGANIZATION_LIST_REPART_ERROR(8530, "%s社区自组织名称已存在"), + MATTER_NAME_EXISTS_APPOINTMENT_ERROR(8532, "存在重复预约事项"), + // 该错误不会提示给前端,只是后端传输错误信息用。 ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数"), OPER_ADD_CUSTOMER_ROOT_AGENCY_ERROR(8702, "添加客户根级组织失败"), diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelPoiUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelPoiUtils.java new file mode 100644 index 0000000000..3ea8472867 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelPoiUtils.java @@ -0,0 +1,276 @@ +package com.epmet.commons.tools.utils; + +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.ExcelImportUtil; +import cn.afterturn.easypoi.excel.entity.ExportParams; +import cn.afterturn.easypoi.excel.entity.ImportParams; +import cn.afterturn.easypoi.excel.entity.TemplateExportParams; +import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; +import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.ss.usermodel.Workbook; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URLEncoder; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; + +public class ExcelPoiUtils { + /** + * excel 导出 + * + * @param list 数据列表 + * @param fileName 导出时的excel名称 + * @param response + */ + public static void exportExcel(List> list, String fileName, HttpServletResponse response) throws IOException { + defaultExport(list, fileName, response); + } + + /** + * 默认的 excel 导出 + * + * @param list 数据列表 + * @param fileName 导出时的excel名称 + * @param response + */ + private static void defaultExport(List> list, String fileName, HttpServletResponse response) throws IOException { + //把数据添加到excel表格中 + Workbook workbook = ExcelExportUtil.exportExcel(list, ExcelType.HSSF); + downLoadExcel(fileName, response, workbook); + } + + /** + * excel 导出 + * + * @param list 数据列表 + * @param pojoClass pojo类型 + * @param fileName 导出时的excel名称 + * @param response + * @param exportParams 导出参数(标题、sheet名称、是否创建表头,表格类型) + */ + private static void defaultExport(List list, Class pojoClass, String fileName, HttpServletResponse response, ExportParams exportParams) throws IOException { + //把数据添加到excel表格中 + Workbook workbook = ExcelExportUtil.exportExcel(exportParams, pojoClass, list); + downLoadExcel(fileName, response, workbook); + } + + /** + * excel 导出 + * + * @param list 数据列表 + * @param pojoClass pojo类型 + * @param fileName 导出时的excel名称 + * @param exportParams 导出参数(标题、sheet名称、是否创建表头,表格类型) + * @param response + */ + public static void exportExcel(List list, Class pojoClass, String fileName, ExportParams exportParams, HttpServletResponse response) throws IOException { + defaultExport(list, pojoClass, fileName, response, exportParams); + } + + /** + * excel 导出 + * + * @param list 数据列表 + * @param title 表格内数据标题 + * @param sheetName sheet名称 + * @param pojoClass pojo类型 + * @param fileName 导出时的excel名称 + * @param response + */ + public static void exportExcel(List list, String title, String sheetName, Class pojoClass, String fileName, HttpServletResponse response) throws IOException { + defaultExport(list, pojoClass, fileName, response, new ExportParams(title, sheetName, ExcelType.XSSF)); + } + + + + /** + * excel 导出 + * + * @param list 数据列表 + * @param title 表格内数据标题 + * @param sheetName sheet名称 + * @param pojoClass pojo类型 + * @param fileName 导出时的excel名称 + * @param isCreateHeader 是否创建表头 + * @param response + */ + public static void exportExcel(List list, String title, String sheetName, Class pojoClass, String fileName, boolean isCreateHeader, HttpServletResponse response) throws IOException { + ExportParams exportParams = new ExportParams(title, sheetName, ExcelType.XSSF); + exportParams.setCreateHeadRows(isCreateHeader); + defaultExport(list, pojoClass, fileName, response, exportParams); + } + /** + * 根据模板生成excel后导出 + * @param templatePath 模板路径 + * @param map 数据集合 + * @param fileName 文件名 + * @param response + * @throws IOException + */ + public static void exportExcel(TemplateExportParams templatePath, Map map, String fileName, HttpServletResponse response) throws IOException { + Workbook workbook = ExcelExportUtil.exportExcel(templatePath, map); + downLoadExcel(fileName, response, workbook); + } + + + /** + * excel下载 + * + * @param fileName 下载时的文件名称 + * @param response + * @param workbook excel数据 + */ + private static void downLoadExcel(String fileName, HttpServletResponse response, Workbook workbook) throws IOException { + try { + response.setCharacterEncoding("UTF-8"); + response.setHeader("content-Type", "application/vnd.ms-excel"); + response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName + ".xlsx", "UTF-8")); + workbook.write(response.getOutputStream()); + } catch (Exception e) { + throw new IOException(e.getMessage()); + } + } + + + + /** + * excel 导入 + * + * @param file excel文件 + * @param pojoClass pojo类型 + * @param + * @return + */ + public static List importExcel(MultipartFile file, Class pojoClass) throws IOException { + return importExcel(file, 1, 1, pojoClass); + } + + /** + * excel 导入 + * + * @param filePath excel文件路径 + * @param titleRows 表格内数据标题行 + * @param headerRows 表头行 + * @param pojoClass pojo类型 + * @param + * @return + */ + public static List importExcel(String filePath, Integer titleRows, Integer headerRows, Class pojoClass) throws IOException { + if (StringUtils.isBlank(filePath)) { + return null; + } + ImportParams params = new ImportParams(); + params.setTitleRows(titleRows); + params.setHeadRows(headerRows); + params.setNeedSave(true); + params.setSaveUrl("/tmp/excel/"); + try { + return ExcelImportUtil.importExcel(new File(filePath), pojoClass, params); + } catch (NoSuchElementException e) { + throw new IOException("模板不能为空"); + } catch (Exception e) { + throw new IOException(e.getMessage()); + } + } + + + /** + * excel 导入 + * + * @param file 上传的文件 + * @param titleRows 表格内数据标题行 + * @param headerRows 表头行 + * @param pojoClass pojo类型 + * @param + * @return + */ + public static List importExcel(MultipartFile file, Integer titleRows, Integer headerRows, Class pojoClass) throws IOException { + if (file == null) { + return null; + } + try { + return importExcel(file.getInputStream(), titleRows, headerRows, pojoClass); + } catch (Exception e) { + throw new IOException(e.getMessage()); + } + } + + /** + * excel 导入 + * + * @param inputStream 文件输入流 + * @param titleRows 表格内数据标题行 + * @param headerRows 表头行 + * @param pojoClass pojo类型 + * @param + * @return + */ + public static List importExcel(InputStream inputStream, Integer titleRows, Integer headerRows, Class pojoClass) throws IOException { + if (inputStream == null) { + return null; + } + ImportParams params = new ImportParams(); + params.setTitleRows(titleRows); + params.setHeadRows(headerRows); + params.setSaveUrl("/tmp/excel/"); + params.setNeedSave(true); + try { + return ExcelImportUtil.importExcel(inputStream, pojoClass, params); + } catch (NoSuchElementException e) { + throw new IOException("excel文件不能为空"); + } catch (Exception e) { + throw new IOException(e.getMessage()); + } + } + /** + * excel 导入,有错误信息 + * + * @param file 上传的文件 + * @param pojoClass pojo类型 + * @param + * @return + */ + public static ExcelImportResult importExcelMore(MultipartFile file,Integer titleRows, Integer headerRows, Class pojoClass) throws IOException { + if (file == null) { + return null; + } + try { + return importExcelMore(file.getInputStream(), titleRows, headerRows, pojoClass); + } catch (Exception e) { + throw new IOException(e.getMessage()); + } + } + + /** + * excel 导入 + * + * @param inputStream 文件输入流 + * @param pojoClass pojo类型 + * @param + * @return + */ + private static ExcelImportResult importExcelMore(InputStream inputStream,Integer titleRows, Integer headerRows, Class pojoClass) throws IOException { + if (inputStream == null) { + return null; + } + ImportParams params = new ImportParams(); + params.setTitleRows(titleRows);//表格内数据标题行 + params.setHeadRows(headerRows);//表头行 + params.setSaveUrl("/tmp/excel/"); + params.setNeedSave(true); + params.setNeedVerify(true); + try { + return ExcelImportUtil.importExcelMore(inputStream, pojoClass, params); + } catch (NoSuchElementException e) { + throw new IOException("excel文件不能为空"); + } catch (Exception e) { + throw new IOException(e.getMessage()); + } + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelUtils.java index 6dae6eb249..754cdf012d 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelUtils.java @@ -121,7 +121,7 @@ public class ExcelUtils { out.flush(); out.close(); } - public static OutputStream getOutputStream(String fileName, HttpServletResponse response) throws Exception { + public static OutputStream getOutputStreamForExcel(String fileName, HttpServletResponse response) throws Exception { fileName = URLEncoder.encode(fileName, "UTF-8"); response.setContentType("application/vnd.ms-excel"); response.setCharacterEncoding("utf8"); diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelVerifyInfo.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelVerifyInfo.java new file mode 100644 index 0000000000..a00bb8bbf4 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelVerifyInfo.java @@ -0,0 +1,31 @@ +package com.epmet.commons.tools.utils; + +import cn.afterturn.easypoi.handler.inter.IExcelDataModel; +import cn.afterturn.easypoi.handler.inter.IExcelModel; + +public class ExcelVerifyInfo implements IExcelModel, IExcelDataModel { + + private String errorMsg; + + private int rowNum; + + @Override + public Integer getRowNum() { + return rowNum; + } + + @Override + public void setRowNum(Integer rowNum) { + this.rowNum = rowNum; + } + + @Override + public String getErrorMsg() { + return errorMsg; + } + + @Override + public void setErrorMsg(String errorMsg) { + this.errorMsg = errorMsg; + } +} 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 a03406f0d0..3269ebcb26 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 @@ -93,4 +93,24 @@ public class CustomerStaffResultDTO implements Serializable { */ private String twoOrgName; + /** + * 【社区】名称0409 + */ + private String community; + + /** + * 组织级别 + */ + private String level; + + /** + * 中心位置经度 + */ + private String longitude; + + /** + * 中心位置纬度 + */ + private String latitude; + } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerAgencyDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerAgencyDTO.java index 496a2c87cc..7c343c5ccc 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerAgencyDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerAgencyDTO.java @@ -142,4 +142,19 @@ public class CustomerAgencyDTO implements Serializable { * 社区 */ private String community; + + /** + * 坐标 + */ + private String coordinates; + + /** + * 中心位置经度 + */ + private String longitude; + + /** + * 中心位置纬度 + */ + private String latitude; } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/ProjectTotalFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/ProjectTotalFormDTO.java new file mode 100644 index 0000000000..975e22596b --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/ProjectTotalFormDTO.java @@ -0,0 +1,35 @@ +package com.epmet.dataaggre.dto.govproject.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 赋能平台【项目处理分析】事件总数查询-接口入参 + * @Auth sun + */ +@NoArgsConstructor +@Data +public class ProjectTotalFormDTO implements Serializable { + private static final long serialVersionUID = -8515172319313536407L; + //组织Id + @NotBlank(message = "组织ID不能为空", groups = {Total.class, Monthincr.class, Statuslist.class}) + private String agencyId; + //日期yyyymmdd + @NotBlank(message = "组织ID不能为空", groups = {Total.class, Monthincr.class, Statuslist.class}) + private String dateId; + //状态:待处理 pending,结案closed + @NotBlank(message = "项目状态不能为空", groups = {Statuslist.class}) + private String status; + + public interface Total extends CustomerClientShowGroup { + } + public interface Monthincr extends CustomerClientShowGroup { + } + public interface Statuslist extends CustomerClientShowGroup { + } + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectMonthIncrResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectMonthIncrResultDTO.java new file mode 100644 index 0000000000..8947eb971b --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectMonthIncrResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dataaggre.dto.govproject.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 赋能平台【项目处理分析】进12月新增项目折线图-接口返参 + * @Auth sun + */ +@Data +public class ProjectMonthIncrResultDTO implements Serializable { + private static final long serialVersionUID = 6188316867855643263L; + + //横坐标值 + private String value; + //横坐标 + private Integer type; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectStatusListResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectStatusListResultDTO.java new file mode 100644 index 0000000000..c8c895e549 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectStatusListResultDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dataaggre.dto.govproject.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 赋能平台【项目处理分析】事件总数查询-接口返参 + * @Auth sun + */ +@Data +public class ProjectStatusListResultDTO implements Serializable { + private static final long serialVersionUID = 6188316867855643263L; + + //组织Id + private String agencyId; + //项目Id + private String projectId; + //来源:议题issue 项目立项:agency 事件:resi_event + private Integer origin; + //状态:待处理 pending,结案closed + private Integer status; + //经度 + private Integer longitude; + //纬度 + private Integer dimension; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectTotalResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectTotalResultDTO.java new file mode 100644 index 0000000000..541a742582 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectTotalResultDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dataaggre.dto.govproject.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 赋能平台【项目处理分析】事件总数查询-接口返参 + * @Auth sun + */ +@Data +public class ProjectTotalResultDTO implements Serializable { + private static final long serialVersionUID = 6188316867855643263L; + + //组织Id + private String agencyId; + //日期yyyymmdd + private String dateId; + //项目总数 + private Integer projectTotal; + //较昨日数 + private Integer dateIncr; + //较上月数 + private Integer monthIncr; + //未结案项目数 + private Integer pendingTotal; + //为结案项目占比 xx% + private String pendingRatio; + //已结案项目数 + private Integer closedTotal; + //已结案项目占比 + private String closedRatio; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovProjectController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovProjectController.java index 18aa5a924c..503caedfb4 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovProjectController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovProjectController.java @@ -8,8 +8,11 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dataaggre.dto.govproject.form.AllProjectFormDTO; import com.epmet.dataaggre.dto.govproject.form.ProjectDistributionFormDTO; +import com.epmet.dataaggre.dto.govproject.form.ProjectTotalFormDTO; import com.epmet.dataaggre.dto.govproject.result.AllProjectResultDTO; import com.epmet.dataaggre.dto.govproject.result.ProjectDistributionResultDTO; +import com.epmet.dataaggre.dto.govproject.result.ProjectMonthIncrResultDTO; +import com.epmet.dataaggre.dto.govproject.result.ProjectTotalResultDTO; import com.epmet.dataaggre.service.govproject.GovProjectService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -56,4 +59,35 @@ public class GovProjectController { ValidatorUtils.validateEntity(formDTO); return new Result>().ok(govProjectService.queryProjectDistribution(formDTO)); } + + /** + * @Description 赋能平台【项目处理分析】事件总数查询 + * @author sun + */ + @PostMapping("projecttotal") + public Result projectTotal(@RequestBody ProjectTotalFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ProjectTotalFormDTO.Total.class); + return new Result().ok(govProjectService.projectTotal(formDTO)); + } + + /** + * @Description 赋能平台【项目处理分析】进12月新增项目折线图 + * @author sun + */ + @PostMapping("projectmonthincr") + public Result> projectMonthIncr(@RequestBody ProjectTotalFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ProjectTotalFormDTO.Monthincr.class); + return new Result>().ok(govProjectService.projectMonthIncr(formDTO)); + } + + /** + * @Description 赋能平台【项目处理分析】按状态查询项目列表 + * @author sun + */ + @PostMapping("projectstatuslist") + public Result> projectStatusList(@RequestBody ProjectTotalFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ProjectTotalFormDTO.Statuslist.class); + return new Result>().ok(govProjectService.projectStatusList(formDTO)); + } + } 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 6315daf303..50221188f9 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 @@ -602,6 +602,9 @@ public class EpmetUserServiceImpl implements EpmetUserService { result.setAgencyId(agencyDTO.getId()); result.setAgencyName(agencyDTO.getOrganizationName()); result.setAgencyPIds(agencyDTO.getPids()); + result.setLevel(agencyDTO.getLevel()); + result.setLongitude(agencyDTO.getLongitude()); + result.setLatitude(agencyDTO.getLatitude()); StaffOrgRelationResultDTO fromOrgTypeDto = govOrgService.getStaffFromOrgType(staffId); String fromOrgType = OrgTypeEnum.AGENCY.getCode(); if (fromOrgTypeDto != null){ diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/GovProjectService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/GovProjectService.java index 35b0096790..a09c9257db 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/GovProjectService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/GovProjectService.java @@ -4,9 +4,8 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dataaggre.dto.govissue.result.IssueListResultDTO; import com.epmet.dataaggre.dto.govproject.form.AllProjectFormDTO; import com.epmet.dataaggre.dto.govproject.form.ProjectDistributionFormDTO; -import com.epmet.dataaggre.dto.govproject.result.AllProjectResultDTO; -import com.epmet.dataaggre.dto.govproject.result.ProjectDistributionResultDTO; -import com.epmet.dataaggre.dto.govproject.result.ShiftProjectResultDTO; +import com.epmet.dataaggre.dto.govproject.form.ProjectTotalFormDTO; +import com.epmet.dataaggre.dto.govproject.result.*; import java.util.List; @@ -51,4 +50,22 @@ public interface GovProjectService { * @date 2021/8/3 15:27 */ int countRedDot(String userId); + + /** + * @Description 赋能平台【项目处理分析】事件总数查询 + * @author sun + */ + ProjectTotalResultDTO projectTotal(ProjectTotalFormDTO formDTO); + + /** + * @Description 赋能平台【项目处理分析】进12月新增项目折线图 + * @author sun + */ + List projectMonthIncr(ProjectTotalFormDTO formDTO); + + /** + * @Description 赋能平台【项目处理分析】按状态查询项目列表 + * @author sun + */ + List projectStatusList(ProjectTotalFormDTO formDTO); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java index 2063b3f83d..a0401eb9b8 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java @@ -14,10 +14,8 @@ import com.epmet.dataaggre.dto.govissue.result.IssueListResultDTO; import com.epmet.dataaggre.dto.govproject.ProjectDTO; import com.epmet.dataaggre.dto.govproject.form.AllProjectFormDTO; import com.epmet.dataaggre.dto.govproject.form.ProjectDistributionFormDTO; -import com.epmet.dataaggre.dto.govproject.result.AllProjectResultDTO; -import com.epmet.dataaggre.dto.govproject.result.ProjectDistributionResultDTO; -import com.epmet.dataaggre.dto.govproject.result.ProjectInfoDTO; -import com.epmet.dataaggre.dto.govproject.result.ShiftProjectResultDTO; +import com.epmet.dataaggre.dto.govproject.form.ProjectTotalFormDTO; +import com.epmet.dataaggre.dto.govproject.result.*; import com.epmet.dataaggre.dto.resigroup.ResiTopicDTO; import com.epmet.dataaggre.service.govissue.GovIssueService; import com.epmet.dataaggre.service.govorg.GovOrgService; @@ -247,4 +245,31 @@ public class GovProjectServiceImpl implements GovProjectService { return projectDao.countRedDot(userId); } + /** + * @Description 赋能平台【项目处理分析】事件总数查询 + * @author sun + */ + @Override + public ProjectTotalResultDTO projectTotal(ProjectTotalFormDTO formDTO) { + return null; + } + + /** + * @Description 赋能平台【项目处理分析】进12月新增项目折线图 + * @author sun + */ + @Override + public List projectMonthIncr(ProjectTotalFormDTO formDTO) { + return null; + } + + /** + * @Description 赋能平台【项目处理分析】按状态查询项目列表 + * @author sun + */ + @Override + public List projectStatusList(ProjectTotalFormDTO formDTO) { + return null; + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml index 55c4d7789c..ee8caafc3e 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml @@ -26,7 +26,23 @@ ca.organization_name, ca.level, ca.area_code, - ca.parent_area_code + ca.parent_area_code, + ( CASE WHEN ca.longitude is null THEN + ( SELECT longitude FROM customer_agency + WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id) + ORDER BY pid ASC LIMIT 1 + ) + ELSE ca.longitude + END + ) longitude, + ( CASE WHEN ca.latitude is null THEN + ( SELECT latitude FROM customer_agency + WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id) + ORDER BY pid ASC LIMIT 1 + ) + ELSE ca.latitude + END + ) latitude FROM customer_staff_agency csa INNER JOIN customer_agency ca ON csa.agency_id = ca.id diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java index 98cda05a2b..5b9e5c314d 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java @@ -268,7 +268,7 @@ public class ScreenProjectController { //String template = this.getClass().getResource(templatePath).getPath(); String fileName = "项目统计.xlsx"; - excelWriter = EasyExcel.write(ExcelUtils.getOutputStream(fileName, response)).withTemplate(inputStream).build(); + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response)).withTemplate(inputStream).build(); WriteSheet writeSheet = EasyExcel.writerSheet().build(); excelWriter.fill(mapData, writeSheet); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java index 1b70d7b6dc..d84301a75b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java @@ -370,7 +370,7 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { //dateId不为空,只计算当天存在评价记录的项目,更新项目对应的得分。 screenProjectSettleService.updateProjectSatisfactionScore(customerId,dateId,null); }catch(Exception e){ - log.error("群众不满得分更新失败"); + log.error("群众不满得分更新失败,msg:{}", e); } } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcCommunitySelfOrganizationDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcCommunitySelfOrganizationDTO.java new file mode 100644 index 0000000000..6be34cb9b8 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcCommunitySelfOrganizationDTO.java @@ -0,0 +1,136 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 社区自组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcCommunitySelfOrganizationDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String orgId; + + /** + * 组织类型,agency:组织,grid:网格 + */ + private String orgType; + + /** + * 组织ID的父级 + */ + private String pid; + + /** + * org_id的所有上级 + */ + private String pids; + + /** + * 组织名称 + */ + private String organizationName; + + /** + * 组织人数 + */ + private Integer organizationPersonCount; + + /** + * 负责人姓名 + */ + private String principalName; + + /** + * 负责人电话 + */ + private String principalPhone; + + /** + * 服务事项 + */ + private String serviceItem; + + /** + * 社区自组织创建时间 + */ + private Date organizationCreatedTime; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private String revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcCommunitySelfOrganizationPersonnelDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcCommunitySelfOrganizationPersonnelDTO.java new file mode 100644 index 0000000000..53c7196083 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcCommunitySelfOrganizationPersonnelDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 社区自组织人员表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcCommunitySelfOrganizationPersonnelDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 社区自组织ID + */ + private String orgId; + + /** + * 人员姓名 + */ + private String personName; + + /** + * 人员电话 + */ + private String personPhone; + + /** + * + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private String revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java new file mode 100644 index 0000000000..fc0d7555e3 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java @@ -0,0 +1,156 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import com.epmet.commons.tools.validator.group.AddGroup; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + + +/** + * 联建活动 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Data +public class IcPartyActivityDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 组织的所有上级 + */ + private String pids; + + /** + * 单位ID + */ + @NotBlank(message = "单位不能为空",groups = AddGroup.class) + private String unitId; + private String unitName; + /** + * 服务事项 + */ + @NotBlank(message = "服务事项不能为空",groups = AddGroup.class) + private String serviceMatter; + + /** + * 活动标题 + */ + @NotBlank(message = "活动标题不能为空",groups = AddGroup.class) + private String title; + + /** + * 活动目标 + */ + @NotBlank(message = "活动目标不能为空",groups = AddGroup.class) + private String target; + + /** + * 活动内容 + */ + @NotBlank(message = "活动内容不能为空",groups = AddGroup.class) + private String content; + + /** + * 服务人数 + */ + private Integer peopleCount; + + /** + * 活动时间 + */ + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date activityTime; + + /** + * 活动地址 + */ + @NotBlank(message = "活动地址不能为空",groups = AddGroup.class) + private String address; + + /** + * 活动地址经度 + */ + @NotBlank(message = "活动地址不能为空",groups = AddGroup.class) + private String longitude; + + /** + * 活动地址纬度 + */ + @NotBlank(message = "活动地址不能为空",groups = AddGroup.class) + private String latitude; + + /** + * 活动结果 + */ + private String result; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitDTO.java new file mode 100644 index 0000000000..1782ddf316 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitDTO.java @@ -0,0 +1,153 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import com.epmet.commons.tools.validator.group.AddGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + + +/** + * 联建单位 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Data +public class IcPartyUnitDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * + */ + private String pids; + + /** + * 单位名称 + */ + @NotBlank(message = "单位名称不能为空",groups = AddGroup.class) + private String unitName; + + /** + * 分类 楼宇党建 两新组织 区域单位党建 机关直属部门 其他 + */ + @NotBlank(message = "分类不能为空",groups = AddGroup.class) + private String type; + + /** + * 服务事项 多选逗号隔开 + */ + private String serviceMatter; + + private List serviceMatterList; + + /** + * 联系人 + */ + @NotBlank(message = "联系人不能为空",groups = AddGroup.class) + private String contact; + + /** + * 联系电话 + */ + @NotBlank(message = "联系电话不能为空",groups = AddGroup.class) + private String contactMobile; + + /** + * 在职党员数 + */ + private Integer memberCount; + + /** + * 地址 + */ + private String address; + + /** + * 中心位置经度 + */ + @NotBlank(message = "经度不能为空",groups = AddGroup.class) + private String longitude; + + /** + * 中心位置纬度 + */ + @NotBlank(message = "纬度不能为空",groups = AddGroup.class) + private String latitude; + + /** + * 群众满意度 + */ + private String satisfaction; + + /** + * 备注 + */ + private String remark; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcSocietyOrgDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcSocietyOrgDTO.java new file mode 100644 index 0000000000..898b01df9d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcSocietyOrgDTO.java @@ -0,0 +1,141 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 社会组织管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcSocietyOrgDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织Id + */ + private String agencyId; + + /** + * agency_id的所有上级 + */ + private String pids; + + /** + * 社会组织名称 + */ + private String societyName; + + /** + * 服务事项 + */ + private String serviceMatters; + + /** + * 负责人 + */ + private String personInCharge; + + /** + * 负责人电话 + */ + private String mobile; + + /** + * 起始服务时间 + */ + private Date serviceStartTime; + + /** + * 终止服务时间 + */ + private Date serviceEndTime; + + /** + * 绑定管理员[组织下录入的工作人员] + */ + private String adminStaffId; + + /** + * 地址 + */ + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 维度 + */ + private String latitude; + + /** + * 备注 + */ + private String remarks; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandOperateLogDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandOperateLogDTO.java new file mode 100644 index 0000000000..3acb6a0510 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandOperateLogDTO.java @@ -0,0 +1,103 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 居民需求操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Data +public class IcUserDemandOperateLogDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 需求id + */ + private String demandRecId; + + /** + * 当前操作用户属于哪个端?工作端:staff;居民端:resi + */ + private String userType; + + /** + * 当前操作用户id + */ + private String userId; + + /** + * 创建需求:create;撤销需求:cancel;指派:assign;接单:take_order;完成:finish; + */ + private String actionCode; + + /** + * 操作时间 + */ + private Date operateTime; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandRecDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandRecDTO.java new file mode 100644 index 0000000000..b070d80073 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandRecDTO.java @@ -0,0 +1,178 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 居民需求记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Data +public class IcUserDemandRecDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 网格id + */ + private String gridId; + + /** + * 组织id + */ + private String agencyId; + + /** + * 网格的所有上级id + */ + private String gridPids; + + /** + * 二级需求分类编码 + */ + private String categoryCode; + + /** + * 父级需求分类编码 + */ + private String parentCode; + + /** + * 需求内容1000字 + */ + private String content; + + /** + * 社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help + */ + private String reportType; + + /** + * 上报人姓名 + */ + private String reportUserName; + + /** + * 上报人联系方式。自身上报时存储注册居民的手机号 + */ + private String reportUserMobile; + + /** + * 自身上报时存储居民端用户id + */ + private String reportUserId; + + /** + * 上报时间 + */ + private Date reportTime; + + /** + * 希望服务时间 + */ + private Date wantServiceTime; + + /** + * 小程序用户自己上报:mini_resi;居民信息录入的居民:ic_resi_user + */ + private String demandUserType; + + /** + * 需求人:user.id或者ic_resi_user.id + */ + private String demandUserId; + + /** + * 需求人姓名 + */ + private String demandUserName; + + /** + * 需求人联系电话 + */ + private String demandUserMobile; + + /** + * 待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished + */ + private String status; + + /** + * 完成结果:已解决 resolved,未解决 unresolved + + */ + private String finishResult; + + /** + * 取消时间 + */ + private Date cancelTime; + + /** + * 1:已评价;0:未评价;评价后ic_user_satisfaction表有记录 + */ + private Boolean evaluateFlag; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandSatisfactionDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandSatisfactionDTO.java new file mode 100644 index 0000000000..c28b702723 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandSatisfactionDTO.java @@ -0,0 +1,102 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 居民需求评价记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Data +public class IcUserDemandSatisfactionDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键,居民需求评价表 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 需求id + */ + private String demandRecId; + + /** + * 当前操作用户属于哪个端?工作端:staff;居民端:resi + */ + private String userType; + + /** + * 当前评价用户id,可以是小程序里用户id,也可以是工作端帮忙录入需求的人 + */ + private String userId; + + /** + * 评价时间 + */ + private Date evaluateTime; + + /** + * 得分可为半星 + */ + private BigDecimal score; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandServiceDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandServiceDTO.java new file mode 100644 index 0000000000..e3196e2b02 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandServiceDTO.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 居民需求服务记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Data +public class IcUserDemandServiceDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 需求id + */ + private String demandRecId; + + /** + * 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + */ + private String serviceType; + + /** + * 志愿者:居民端爱心互助的志愿者userId; + */ + private String serverId; + + /** + * 实际服务开始时间 + */ + private Date serviceStartTime; + + /** + * 实际服务结束时间 + */ + private Date serviceEndTime; + + /** + * 完成情况 + */ + private String finishDesc; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddCommunitySelfOrganizationFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddCommunitySelfOrganizationFormDTO.java new file mode 100644 index 0000000000..302f3d08a4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddCommunitySelfOrganizationFormDTO.java @@ -0,0 +1,73 @@ +package com.epmet.dto.form; + +import com.epmet.dto.IcCommunitySelfOrganizationPersonnelDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/11/18 5:32 下午 + * @DESC + */ +@Data +public class AddCommunitySelfOrganizationFormDTO implements Serializable { + + private static final long serialVersionUID = -4996925380900678065L; + + public interface AddCommunitySelfOrganizationForm{} + + /** + * 组织名称 + */ + @NotBlank(message = "organizationName不能为空",groups = AddCommunitySelfOrganizationForm.class) + private String organizationName; + + /** + * 组织人数 + */ + @NotNull(message = "organizationPersonCount不能为空",groups = AddCommunitySelfOrganizationForm.class) + private Integer organizationPersonCount; + + /** + * 负责人姓名 + */ + @NotBlank(message = "principalName不能为空",groups = AddCommunitySelfOrganizationForm.class) + private String principalName; + + /** + * 负责人电话 + */ + @NotBlank(message = "principalPhone不能为空",groups = AddCommunitySelfOrganizationForm.class) + private String principalPhone; + + /** + * 服务事项 + */ + @NotBlank(message = "serviceItem不能为空",groups = AddCommunitySelfOrganizationForm.class) + private String serviceItem; + + /** + * 社区自组织创建时间 + */ + private String organizationCreatedTime; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 社区自组织人员 + */ + private List organizationPersonnel; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddSocietyOrgFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddSocietyOrgFormDTO.java new file mode 100644 index 0000000000..a1a12c71e6 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddSocietyOrgFormDTO.java @@ -0,0 +1,105 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + + +/** + * @Author sun + * @Description 新增社会组织 + **/ +@Data +public class AddSocietyOrgFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + /** + * 客户Id + */ + private String customerId; + /** + * 组织Id + */ + private String agencyId; + /** + * agency_id的所有上级 + */ + private String pids; + /** + * 社会组织名称 + */ + @NotBlank(message = "社会组织名称不能为空", groups = { AddSocietyOrgFormDTO.Add.class }) + @Length(max = 50, message = "社会组织名称不能超过50个字符",groups = {Add.class}) + private String societyName; + /** + * 服务事项 + */ + @NotBlank(message = "服务事项不能为空", groups = { AddSocietyOrgFormDTO.Add.class }) + @Length(max = 1000, message = "服务事项不能超过1000个字符",groups = {Add.class}) + private String serviceMatters; + /** + * 负责人 + */ + @NotBlank(message = "负责人名称不能为空", groups = { AddSocietyOrgFormDTO.Add.class }) + @Length(max = 20, message = "负责人名称不能超过20个字符",groups = {Add.class}) + private String personInCharge; + /** + * 负责人电话 + */ + @NotBlank(message = "负责人电话不能为空", groups = { AddSocietyOrgFormDTO.Add.class }) + @Length(max = 11, message = "负责人电话不能超过11个字符",groups = {Add.class}) + private String mobile; + /** + * 起始服务时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date serviceStartTime; + /** + * 终止服务时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date serviceEndTime; + /** + * 绑定管理员[组织下录入的工作人员] + */ + @NotBlank(message = "绑定管理员名称不能为空", groups = { AddSocietyOrgFormDTO.Add.class }) + private String adminStaffId; + /** + * 地址 + */ + private String address; + /** + * 经度 + */ + private String longitude; + /** + * 维度 + */ + private String latitude; + //token中userId + private String staffId; + + public interface Add {} + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CommunitySelfOrganizationListFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CommunitySelfOrganizationListFormDTO.java new file mode 100644 index 0000000000..c70e2a7055 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CommunitySelfOrganizationListFormDTO.java @@ -0,0 +1,49 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/19 1:47 下午 + * @DESC + */ +@Data +public class CommunitySelfOrganizationListFormDTO implements Serializable { + + private static final long serialVersionUID = 4202083250504143469L; + + public interface CommunitySelfOrganizationListForm{} + + /** + * 社区自组织名 + */ + private String organizationName; + + /** + * 开始时间 + */ + private String startTime; + + /** + * 结束时间 + */ + private String endTime; + + @NotNull(message = "pageNo不能为空",groups = CommunitySelfOrganizationListForm.class) + private Integer pageNo; + + @NotNull(message = "pageSize不能为空",groups = CommunitySelfOrganizationListForm.class) + private Integer pageSize; + + /** + * 是否分页,默认true分页 + */ + private Boolean isPage = true; + + private String customerId; + private String agencyId; + private Integer ranking; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/DelCommunitySelfOrganizationFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/DelCommunitySelfOrganizationFormDTO.java new file mode 100644 index 0000000000..67ee078676 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/DelCommunitySelfOrganizationFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/19 4:19 下午 + * @DESC + */ +@Data +public class DelCommunitySelfOrganizationFormDTO implements Serializable { + + private static final long serialVersionUID = 789228513283561471L; + + public interface DelCommunitySelfOrganizationForm{} + + @NotBlank(message = "orgId不能为空",groups = DelCommunitySelfOrganizationForm.class) + private String orgId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditCommunitySelfOrganizationFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditCommunitySelfOrganizationFormDTO.java new file mode 100644 index 0000000000..cade96113f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditCommunitySelfOrganizationFormDTO.java @@ -0,0 +1,81 @@ +package com.epmet.dto.form; + +import com.epmet.dto.IcCommunitySelfOrganizationPersonnelDTO; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/11/18 5:32 下午 + * @DESC + */ +@Data +public class EditCommunitySelfOrganizationFormDTO implements Serializable { + + private static final long serialVersionUID = -4990925380900678065L; + + public interface EditCommunitySelfOrganizationForm{} + + /** + * 组织名称 + */ + @NotBlank(message = "organizationName不能为空",groups = EditCommunitySelfOrganizationForm.class) + private String organizationName; + + /** + * 组织人数 + */ + @NotNull(message = "organizationPersonCount不能为空",groups = EditCommunitySelfOrganizationForm.class) + private Integer organizationPersonCount; + + /** + * 负责人姓名 + */ + @NotBlank(message = "principalName不能为空",groups = EditCommunitySelfOrganizationForm.class) + private String principalName; + + /** + * 负责人电话 + */ + @NotBlank(message = "principalPhone不能为空",groups = EditCommunitySelfOrganizationForm.class) + private String principalPhone; + + /** + * 服务事项 + */ + @NotBlank(message = "serviceItem不能为空",groups = EditCommunitySelfOrganizationForm.class) + private String serviceItem; + + /** + * 社区自组织创建时间 + */ + @NotNull(message = "organizationCreatedTime不能为空",groups = EditCommunitySelfOrganizationForm.class) + private String organizationCreatedTime; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 社区自组织ID + */ + @NotBlank(message = "orgId不能为空",groups = EditCommunitySelfOrganizationForm.class) + private String orgId; + + /** + * 社区自组织人员 + */ + private List organizationPersonnel; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditSocietyOrgFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditSocietyOrgFormDTO.java new file mode 100644 index 0000000000..2acad633c0 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditSocietyOrgFormDTO.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + + +/** + * @Author sun + * @Description 修改、删除社会组织 + **/ +@Data +public class EditSocietyOrgFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 社会组织Id + */ + @NotBlank(message = "社会组织Id不能为空", groups = { Edit.class, Del.class }) + private String societyId; + /** + * 社会组织名称 + */ + @Length(max = 50, message = "社会组织名称不能超过50个字符",groups = {Edit.class}) + private String societyName; + /** + * 服务事项 + */ + @Length(max = 1000, message = "服务事项不能超过1000个字符",groups = {Edit.class}) + private String serviceMatters; + /** + * 负责人 + */ + @Length(max = 20, message = "负责人名称不能超过20个字符",groups = {Edit.class}) + private String personInCharge; + /** + * 负责人电话 + */ + @Length(max = 11, message = "负责人电话不能超过11个字符",groups = {Edit.class}) + private String mobile; + /** + * 起始服务时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date serviceStartTime; + /** + * 终止服务时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date serviceEndTime; + /** + * 绑定管理员[组织下录入的工作人员] + */ + private String adminStaffId; + /** + * 地址 + */ + private String address; + /** + * 经度 + */ + private String longitude; + /** + * 维度 + */ + private String latitude; + //token中userId + private String staffId; + + public interface Edit {} + public interface Del {} + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/GetListSocietyOrgFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/GetListSocietyOrgFormDTO.java new file mode 100644 index 0000000000..c04a76dc77 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/GetListSocietyOrgFormDTO.java @@ -0,0 +1,58 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import java.io.Serializable; + + +/** + * @Author sun + * @Description 社会组织列表查询 + **/ +@Data +public class GetListSocietyOrgFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + //社会组织名称 + private String societyName; + //负责人 + private String personInCharge; + //负责人电话 + private String mobile; + //起始服务时间 + private String serviceStartTime; + //终止服务时间 + private String serviceEndTime; + //页码 + @Min(1) + private Integer pageNo = 1; + //每页多少条 + private Integer pageSize = 20; + //是否分页(是:true 否:false) + private Boolean isPage = true; + //token中客户Id + private String customerId; + //token中userId + private String staffId; + //token中userId所属组织的pid + private String pids; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyActivityFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyActivityFormDTO.java new file mode 100644 index 0000000000..40ac5563ac --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyActivityFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.form; + +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/11/22 14:42 + */ +@NoArgsConstructor +@Data +public class PartyActivityFormDTO implements Serializable { + private static final long serialVersionUID = -2510068555703677L; + private String agencyId; + private String unitId; + private String title; + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date startTime; + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date endTime; + private String serviceMatter; + private Integer pageNo; + private Integer pageSize; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitFormDTO.java new file mode 100644 index 0000000000..cf7841d93e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.form; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/11/19 16:19 + */ +@NoArgsConstructor +@Data +public class PartyUnitFormDTO implements Serializable { + + private static final long serialVersionUID = 1256798619648265622L; + private String customerId; + private String agencyId; + private String unitName; + private String serviceMatter; + private String type; + private String contact; + private String contactMobile; + private Integer pageNo; + private Integer pageSize; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/AddCategoryFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/AddCategoryFormDTO.java new file mode 100644 index 0000000000..866a20bc6d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/AddCategoryFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.form.demand; + +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; + +@Data +public class AddCategoryFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + @NotBlank(message = "客户id不能为空", groups = AddUserInternalGroup.class) + private String customerId; + + @NotBlank(message = "分类名称不能为空", groups = AddUserShowGroup.class) + @Length(max = 100, message = "分类名称最多输入100字", groups = AddUserShowGroup.class) + private String categoryName; + + @NotBlank(message = "请先选择一级分类", groups = AddUserShowGroup.class) + private String parentCategoryCode; + + @NotNull(message = "奖励积分不能为空", groups = AddUserShowGroup.class) + private Integer awardPoint; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/AddFirstCategoryFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/AddFirstCategoryFormDTO.java new file mode 100644 index 0000000000..b0a610d278 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/AddFirstCategoryFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.form.demand; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +@Data +public class AddFirstCategoryFormDTO implements Serializable { + private static final long serialVersionUID = -9011014064624688518L; + + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + @NotBlank(message = "客户id不能为空", groups = AddUserInternalGroup.class) + private String customerId; + + @NotBlank(message = "分类名称不能为空", groups = AddUserShowGroup.class) + @Length(max = 20, message = "一级分类名称最多输入20字", groups = AddUserShowGroup.class) + private String categoryName; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/AssignFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/AssignFormDTO.java new file mode 100644 index 0000000000..b24a505a5f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/AssignFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.form.demand; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +@Data +public class AssignFormDTO implements Serializable { + private static final long serialVersionUID = -8844710824469349121L; + + public interface AddUserInternalGroup { + } + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + @NotBlank(message = "需求id不能为空", groups = AddUserInternalGroup.class) + private String demandRecId; + @NotBlank(message = "服务方类型不能为空", groups = AddUserShowGroup.class) + private String serviceType; + @NotBlank(message = "服务方不能为空", groups = AddUserShowGroup.class) + private String serverId; + + + + @NotBlank(message = "userId不能为空", groups = AddUserInternalGroup.class) + private String userId; + @NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) + private String customerId; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandAddFromDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandAddFromDTO.java new file mode 100644 index 0000000000..f3a1c9ae0c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandAddFromDTO.java @@ -0,0 +1,120 @@ +package com.epmet.dto.form.demand; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Date; + +@Data +public class DemandAddFromDTO implements Serializable { + + private static final long serialVersionUID = 1589287946950749226L; + + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + public interface UpdateInternalGroup { + } + + @NotBlank(message = "需求id不能为空",groups = UpdateInternalGroup.class) + private String demandRecId; + + private String customerId; + private String currentUserId; + + + /** + * 网格id + */ + @NotBlank(message = "所属网格不能为空",groups = AddUserShowGroup.class) + private String gridId; + + /** + * 组织id + */ + private String agencyId; + + /** + * 网格的所有上级id + */ + private String gridPids; + + + + + /** + * 二级需求分类编码 + */ + @NotBlank(message = "需求类别不能为空",groups = AddUserShowGroup.class) + private String categoryCode; + + /** + * 父级需求分类编码 + */ + @NotBlank(message = "需求类别不能为空",groups = AddUserShowGroup.class) + private String parentCode; + + /** + * 需求内容1000字 + */ + @NotBlank(message = "需求内容不能为空",groups = AddUserShowGroup.class) + @Length(max = 1000,message = "需求内容至多输入1000字",groups = AddUserShowGroup.class) + private String content; + + /** + * 社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help + */ + @NotBlank(message = "上报类型不能为空",groups = AddUserShowGroup.class) + private String reportType; + + /** + * 上报人姓名 + */ + @NotBlank(message = "上报人不能为空",groups = AddUserShowGroup.class) + private String reportUserName; + + /** + * 上报人联系方式。自身上报时存储注册居民的手机号 + */ + @NotBlank(message = "上报人联系方式不能为空",groups = AddUserShowGroup.class) + private String reportUserMobile; + + /** + * 上报时间 + */ + @NotNull(message = "上报时间不能为空",groups = AddUserShowGroup.class) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date reportTime; + + /** + * 需求人:user.id或者ic_resi_user.id + */ + @NotNull(message = "需求人不能为空",groups = AddUserShowGroup.class) + private String demandUserId; + + /** + * 需求人姓名 + */ + @NotNull(message = "需求人不能为空",groups = AddUserShowGroup.class) + private String demandUserName; + + /** + * 需求人联系电话 + */ + @NotNull(message = "需求人不能为空",groups = AddUserShowGroup.class) + private String demandUserMobile; + + /** + * 希望服务时间 + */ + @NotNull(message = "服务时间不能为空",groups = AddUserShowGroup.class) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date wantServiceTime; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandDetailFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandDetailFormDTO.java new file mode 100644 index 0000000000..25ec764f3f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandDetailFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.form.demand; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +@Data +public class DemandDetailFormDTO implements Serializable { + private static final long serialVersionUID = 514538389753713095L; + public interface AddUserInternalGroup { + } + + @NotBlank(message = "demandRecId不能为空", groups = AddUserInternalGroup.class) + private String demandRecId; + + + @NotBlank(message = "tokenDto获取客户id不能为空", groups = IcResiUserDemandFromDTO.AddUserInternalGroup.class) + private String customerId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandDictPageFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandDictPageFormDTO.java new file mode 100644 index 0000000000..3ff7d63c0b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandDictPageFormDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.form.demand; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +@Data +public class DemandDictPageFormDTO extends PageFormDTO implements Serializable { + public interface AddUserInternalGroup {} + + @NotBlank(message = "客户id不能为空",groups = AddUserInternalGroup.class) + private String customerId; + + private String firstCategoryCode; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandOptionFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandOptionFormDTO.java new file mode 100644 index 0000000000..64d77d5788 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandOptionFormDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.form.demand; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +@Data +public class DemandOptionFormDTO implements Serializable { + private static final long serialVersionUID = -5335277881919236426L; + + public interface AddUserInternalGroup { + } + + @NotBlank(message = "token获取客户id不能为空", groups = AddUserInternalGroup.class) + private String customerId; + @NotBlank(message = "查询条件和查看居民详情:query;新增或修改居民信息:addorupdate", groups = AddUserInternalGroup.class) + private String purpose; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandRecId.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandRecId.java new file mode 100644 index 0000000000..7fdf7a29c5 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandRecId.java @@ -0,0 +1,10 @@ +package com.epmet.dto.form.demand; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class DemandRecId implements Serializable { + private String demandRecId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/FinishStaffFromDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/FinishStaffFromDTO.java new file mode 100644 index 0000000000..06ca8a93fc --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/FinishStaffFromDTO.java @@ -0,0 +1,48 @@ +package com.epmet.dto.form.demand; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class FinishStaffFromDTO implements Serializable { + private static final long serialVersionUID = 591380873862126679L; + + public interface AddUserInternalGroup { + } + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + @NotBlank(message = "需求id不能为空", groups = AddUserInternalGroup.class) + private String demandRecId; + + @NotBlank(message = "服务id不能为空", groups = AddUserShowGroup.class) + private String serviceId; + + @NotNull(message = "实际服务开始不能为空", groups = AddUserShowGroup.class) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date serviceStartTime; + + @NotNull(message = "实际服务结束不能为空", groups = AddUserShowGroup.class) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date serviceEndTime; + + @NotBlank(message = "完成结果不能为空", groups = AddUserShowGroup.class) + private String finishResult; + private String finishDesc; + + @NotNull(message = "得分不能为空", groups = AddUserShowGroup.class) + private BigDecimal score; + + + + @NotBlank(message = "userId不能为空", groups = AddUserInternalGroup.class) + private String userId; + @NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) + private String customerId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/IcResiUserDemandFromDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/IcResiUserDemandFromDTO.java new file mode 100644 index 0000000000..f29e088293 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/IcResiUserDemandFromDTO.java @@ -0,0 +1,44 @@ +package com.epmet.dto.form.demand; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +@Data +public class IcResiUserDemandFromDTO implements Serializable { + public interface AddUserInternalGroup { + } + + + /** + * 居民信息录入的居民的id + */ + @NotBlank(message = "userId不能为空", groups = AddUserInternalGroup.class) + private String userId; + + /** + * icresiuser/persondata接口返参中有此值 + */ + private List epmetUserIdList; + + @NotNull(message = "pageNo不能为空", groups = AddUserInternalGroup.class) + private Integer pageNo; + @NotNull(message = "pageSize不能为空", groups = AddUserInternalGroup.class) + private Integer pageSize; + + /** + * 研判分析界面,查看同类型的需求可以用此接口,只需传入分类编码 + */ + private String firstCategoryCode; + + @NotBlank(message = "tokenDto获取客户id不能为空", groups = AddUserInternalGroup.class) + private String customerId; + + /** + * epmetUserIdList+userId + */ + private List userIds; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceQueryFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceQueryFormDTO.java new file mode 100644 index 0000000000..74d3ca3c7f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceQueryFormDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dto.form.demand; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +@Data +public class ServiceQueryFormDTO implements Serializable { + private static final long serialVersionUID = -2738313255838176318L; + + public interface AddUserInternalGroup { + } + + public interface SocietyOrgInternalGroup { + } + + /** + * 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + */ + @NotBlank(message = "服务方类型不能为空", groups = AddUserInternalGroup.class) + private String serviceType; + + /** + * 名称检索 + */ + private String serviceName; + + /** + * 列表查询条件:query_demand 需求指派:add_demand + */ + @NotBlank(message = "新增需求:add_demand;列表查询:query_demand", groups = SocietyOrgInternalGroup.class) + private String queryPurpose; + + // -------------------------------------------------------- + // 以下参数从token中获取 + @NotBlank(message = "userId不能为空", groups = AddUserInternalGroup.class) + private String staffId; + @NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) + private String customerId; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/StaffCancelFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/StaffCancelFormDTO.java new file mode 100644 index 0000000000..09d920f55c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/StaffCancelFormDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.form.demand; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +@Data +public class StaffCancelFormDTO { + public interface AddUserInternalGroup {} + @NotBlank(message = "需求id不能为空",groups = AddUserInternalGroup.class) + private String demandRecId; + + @NotBlank(message = "userId不能为空", groups =AddUserInternalGroup.class) + private String userId; + @NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) + private String customerId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/StatusFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/StatusFormDTO.java new file mode 100644 index 0000000000..879d632cc7 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/StatusFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.form.demand; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +@Data +public class StatusFormDTO implements Serializable { + + public interface AddUserInternalGroup { + } + + @NotBlank(message = "categoryId不能为空", groups = AddUserInternalGroup.class) + private String categoryId; + + @NotNull(message = "usableFlag不能为空", groups = AddUserInternalGroup.class) + private Boolean usableFlag; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/SubCodeFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/SubCodeFormDTO.java new file mode 100644 index 0000000000..d7952fd53a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/SubCodeFormDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.form.demand; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +@Data +public class SubCodeFormDTO implements Serializable { + public interface AddUserInternalGroup {} + @NotBlank(message = "客户id不能为空",groups = AddUserInternalGroup.class) + private String customerId; + @NotBlank(message = "parentCategoryCode不能为空",groups = AddUserInternalGroup.class) + private String parentCategoryCode; + + private String categoryName; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UpdateFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UpdateFormDTO.java new file mode 100644 index 0000000000..4929228f29 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UpdateFormDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dto.form.demand; + +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; + +@Data +public class UpdateFormDTO implements Serializable { + + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + public interface First extends CustomerClientShowGroup { + } + + public interface Two extends CustomerClientShowGroup { + } + @NotBlank(message = "客户id不能为空", groups = AddUserInternalGroup.class) + private String customerId; + + @NotBlank(message = "categoryId不能为空", groups = AddUserInternalGroup.class) + private String categoryId; + + @NotNull(message = "等级不能为空", groups = AddUserInternalGroup.class) + private Integer level; + + + @NotBlank(message = "分类名称不能为空", groups = AddUserShowGroup.class) + @Length(max = 100, message = "分类名称最多输入100字", groups = First.class) + @Length(max = 20, message = "分类名称最多输入20字", groups = Two.class) + private String categoryName; + + @NotNull(message = "奖励积分不能为空", groups = Two.class) + private Integer awardPoint; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandNameQueryFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandNameQueryFormDTO.java index 3247482054..2a0141713f 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandNameQueryFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandNameQueryFormDTO.java @@ -13,7 +13,7 @@ public class UserDemandNameQueryFormDTO implements Serializable { public interface AddUserInternalGroup {} - @NotBlank(message = "客户idbu不能为空",groups =AddUserInternalGroup.class) + @NotBlank(message = "客户id不能为空",groups =AddUserInternalGroup.class) private String customerId; @NotEmpty(message = "分类编码不能为空",groups =AddUserInternalGroup.class) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandPageFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandPageFormDTO.java new file mode 100644 index 0000000000..a574bb3100 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandPageFormDTO.java @@ -0,0 +1,77 @@ +package com.epmet.dto.form.demand; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class UserDemandPageFormDTO extends PageFormDTO implements Serializable { + + private String customerId; + private String currentStaffId; + private String gridPids; + + + /** + * 网格id + */ + private String gridId; + + + + /** + * 分类的编码 + */ + private String categoryCode; + + /** + * 分类的级别 + */ + private Integer level; + + + + /** + * 需求人姓名 + */ + private String demandUserName; + + /** + * 上报时间开始 + */ + private String reportStartTime; + + /** + * 上报时间截止 + */ + private String reportEndTime; + + /** + * 待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished + */ + private String status; + + + + + /** + * 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + */ + private String serviceType; + + /** + * 服务方id + */ + private String serverId; + + /** + * 希望服务时间开始 + */ + private String wantServiceStartTime; + + /** + * 希望截止 + */ + private String wantServiceEndTime; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListDTO.java new file mode 100644 index 0000000000..47b2c02df8 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListDTO.java @@ -0,0 +1,89 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.dto.IcCommunitySelfOrganizationPersonnelDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/11/19 1:47 下午 + * @DESC + */ +@Data +public class CommunitySelfOrganizationListDTO implements Serializable { + + private static final long serialVersionUID = 3208034033470533749L; + + /** + * 排序 + */ + private Integer sort; + + /** + * 社区自组织人数 + */ + private Integer organizationPersonCount; + + /** + * 社区自组织名字 + */ + private String organizationName; + + /** + * 服务事项 + */ + private String serviceItem; + + /** + * 负责人 + */ + private String principalName; + + /** + * 负责人电话 + */ + private String principalPhone; + + /** + * 自组织创办时间 + */ + private String organizationCreatedTime; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 社区自组织ID + */ + private String orgId; + + /** + * 社区自组织人员 + */ + private List organizationPersonnel; + + public CommunitySelfOrganizationListDTO() { + this.sort = NumConstant.ZERO; + this.organizationPersonCount = NumConstant.ZERO; + this.organizationName = ""; + this.serviceItem = ""; + this.principalName = ""; + this.principalPhone = ""; + this.organizationCreatedTime = ""; + this.longitude = ""; + this.latitude = ""; + this.orgId = ""; + this.organizationPersonnel = new ArrayList<>(); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListResultDTO.java new file mode 100644 index 0000000000..c8cb3375fd --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListResultDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/11/19 1:47 下午 + * @DESC + */ +@Data +public class CommunitySelfOrganizationListResultDTO implements Serializable { + + private static final long serialVersionUID = 3208034033470533749L; + + private Integer total; + + private List list; + + public CommunitySelfOrganizationListResultDTO() { + this.total = NumConstant.ZERO; + this.list = new ArrayList<>(); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/GetListSocietyOrgResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/GetListSocietyOrgResultDTO.java new file mode 100644 index 0000000000..376078ab10 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/GetListSocietyOrgResultDTO.java @@ -0,0 +1,73 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * @Author sun + * @Description 社会组织列表查询 + **/ +@Data +public class GetListSocietyOrgResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + //集合总条数 + private Integer total; + //社会组织信息 + private List list; + + @Data + public class SocietyOrgList{ + //所属组织Id + private String agencyId; + //社会组织Id + private String societyId; + //社会组织名称 + private String societyName; + //服务事项 + private String serviceMatters; + //负责人姓名 + private String personInCharge; + //负责人电话 + private String mobile; + //起始服务时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date serviceStartTime; + //终止服务时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date serviceEndTime; + //绑定管理员[组织下Id录入的工作人员] + private String adminStaffId; + //绑定管理员[组织下录入的工作人员]姓名 + private String adminStaffName; + //地址 + private String address; + //经度 + private String longitude; + //维度 + private String latitude; + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java new file mode 100644 index 0000000000..1650882b84 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java @@ -0,0 +1,63 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author sun + * @Description 社会组织列表查询 + **/ +@Data +public class SocietyOrgListResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + + //所属组织Id + private String agencyId; + //所属组织名称 + private String agencyName; + //社会组织Id + private String societyId; + //社会组织名称 + private String societyName; + //服务事项 + private String serviceMatters; + //负责人姓名 + private String personInCharge; + //负责人电话 + private String mobile; + //起始服务时间 + //@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + //private Date serviceStartTime; + private String serviceStartTime; + //终止服务时间 + private String serviceEndTime; + //绑定管理员[组织下Id录入的工作人员] + private String adminStaffId; + //绑定管理员[组织下录入的工作人员]姓名 + private String adminStaffName = ""; + //地址 + private String address; + //经度 + private String longitude; + //维度 + private String latitude; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandPageResDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandPageResDTO.java new file mode 100644 index 0000000000..5b2a12c529 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandPageResDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.result.demand; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +@Data +public class DemandPageResDTO implements Serializable { + private String customerId; + private String categoryId; + private String categoryCode; + private String parentCategoryCode; + private String categoryName; + private Integer level; + private Integer sort; + private BigDecimal awardPoint; + private Boolean usableFlag; + private List children; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java new file mode 100644 index 0000000000..feb5c70b84 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java @@ -0,0 +1,117 @@ +package com.epmet.dto.result.demand; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + + +@Data +public class DemandRecResultDTO implements Serializable { + private static final long serialVersionUID = 1140730681599839420L; + + private String demandRecId; + //@JsonIgnore + private String gridId; + private String gridName; + private String agencyId; + + //@JsonIgnore + private String categoryCode; + private String parentCode; + private String categoryName; + private String firstCategoryCode; + private String firstCategoryName; + + + //社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help + private String reportType; + private String reportTypeName; + + private String content; + private String reportUserName; + private String reportUserMobile; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date reportTime; + private String demandUserId; + private String demandUser; + private String demandUserName; + private String demandUserMobile; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date wantServiceTime; + + /** + * 待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished + */ + private String status; + private String statusName; + + /** + * 完成结果:已解决 resolved,未解决 unresolved + + */ + private String finishResult; + + /** + * 取消时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date cancelTime; + + /** + * 1:已评价;0:未评价;评价后ic_user_satisfaction表有记录 + */ + private Boolean evaluateFlag; + /** + * 得分可为半星 + */ + private BigDecimal score; + + /** 服务情况********************************************************************/ + /** 服务情况********************************************************************/ + /** 服务情况********************************************************************/ + private String serviceId; + /** + * 志愿者的姓名 + * 社会组织名 + * 社区自组织的名字 + * 区域党建单位名称 + */ + private String serviceName; + /** + * 尹作梅(志愿者) + * XXX(社会组织) + * XXX(社区自组织) + * XXX(区域化党建单位) + */ + private String serviceShowName; + /** + * 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + */ + private String serviceType; + + /** + * 志愿者:居民端爱心互助的志愿者userId; + */ + private String serverId; + + /** + * 实际服务开始时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date serviceStartTime; + + /** + * 实际服务结束时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date serviceEndTime; + + /** + * 完成情况 + */ + private String finishDesc; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java new file mode 100644 index 0000000000..96d03b9c2d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java @@ -0,0 +1,15 @@ +package com.epmet.dto.result.demand; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 完成需求时,是否需要计算 区域化党建单位的满意度 + * + */ +@Data +public class FinishResultDTO implements Serializable { + private Boolean sendCalStatisfaction; + private String partyUnitId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/IcResiUserReportDemandRes.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/IcResiUserReportDemandRes.java new file mode 100644 index 0000000000..e4792920b3 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/IcResiUserReportDemandRes.java @@ -0,0 +1,33 @@ +package com.epmet.dto.result.demand; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +@Data +public class IcResiUserReportDemandRes implements Serializable { + private static final long serialVersionUID = 7043350476644105434L; + + private String demandRecId; + + @JsonIgnore + private String categoryCode; + + @JsonIgnore + private String parentCode; + + private String categoryName; + + private String content; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date wantServiceTime; + + @JsonIgnore + private String status; + + private String statusName; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/OptionDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/OptionDTO.java new file mode 100644 index 0000000000..c0cfd3b48d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/OptionDTO.java @@ -0,0 +1,12 @@ +package com.epmet.dto.result.demand; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class OptionDTO implements Serializable { + private static final long serialVersionUID = -6722370308097497466L; + private String label; + private String value; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ServiceStatDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ServiceStatDTO.java new file mode 100644 index 0000000000..2393e942d6 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ServiceStatDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.result.demand; + + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +@Data +public class ServiceStatDTO implements Serializable { + /** + * 服务方id + */ + private String serverId; + /** + * 总分 + */ + private BigDecimal totalScore; + /** + * 服务的需求个数 + */ + private Integer demandCount; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/pom.xml b/epmet-module/epmet-heart/epmet-heart-server/pom.xml index 1cbdfea3c4..034780d7d5 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/pom.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/pom.xml @@ -82,6 +82,18 @@ 2.0.0 compile + + com.epmet + epmet-admin-client + 2.0.0 + compile + + + + com.epmet + epmet-commons-rocketmq + 2.0.0 + @@ -146,6 +158,10 @@ https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4 SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd + + + true + 192.168.1.140:9876;192.168.1.141:9876 @@ -189,6 +205,10 @@ https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4 SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd + + + false + 192.168.1.140:9876;192.168.1.141:9876 @@ -232,6 +252,10 @@ https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4 SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd + + + true + 192.168.10.161:9876 @@ -275,6 +299,10 @@ https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + + + true + 192.168.11.187:9876;192.168.11.184:9876 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/IcCommunitySelfOrganizationConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/IcCommunitySelfOrganizationConstant.java new file mode 100644 index 0000000000..ffd87124bf --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/IcCommunitySelfOrganizationConstant.java @@ -0,0 +1,11 @@ +package com.epmet.constant; + +/** + * @Author zxc + * @DateTime 2021/11/19 8:39 上午 + * @DESC + */ +public interface IcCommunitySelfOrganizationConstant { + + String ORG_TYPE_AGENCY = "agency"; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java new file mode 100644 index 0000000000..c28768b30f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java @@ -0,0 +1,53 @@ +package com.epmet.constant; + +public interface UserDemandConstant { + + + /** + * 小程序用户自己上报:mini_resi;居民信息录入的居民:ic_resi_user + */ + String MINI_RESI = "mini_resi"; + String IC_RESI_USER = "ic_resi_user"; + + /** + * 上报类型:社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help + */ + String COMMUNITY_REPORT="community"; + String BUILDING_CAPTION_REPORT="building_caption"; + String PARTY_REPORT="party"; + String SELF_HELP_REPORT="self_help"; + /** + * 待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished + */ + String PENDING = "pending"; + String CANCELED = "canceled"; + String ASSIGNED = "assigned"; + String HAVE_ORDER = "have_order"; + String FINISHED = "finished"; + + + + /** + * 当前操作用户属于哪个端?工作端:staff;居民端:resi + */ + String STAFF="staff"; + String RESI="resi"; + + + /** + * 创建需求:create;撤销需求:cancel;指派:assign;接单:take_order;完成:finish;; + * 更新需求:update + */ + String CREATE="create"; + String UPDATE="update"; + String CANCEL="cancel"; + String ASSIGN="assign"; + String TAKE_ORDER="take_order"; + String FINISH="finish"; + +// 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + String VOLUNTEER="volunteer"; + String SOCIAL_ORG="social_org"; + String COMMUNITY_ORG="community_org"; + String PARTY_UNIT="party_unit"; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationController.java new file mode 100644 index 0000000000..d9019b6c5b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationController.java @@ -0,0 +1,213 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IcCommunitySelfOrganizationDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.form.demand.ServiceQueryFormDTO; +import com.epmet.dto.result.CommunitySelfOrganizationListResultDTO; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.excel.ExportCommunitySelfOrganizationExcel; +import com.epmet.excel.IcCommunitySelfOrganizationExcel; +import com.epmet.service.IcCommunitySelfOrganizationService; +import org.apache.commons.io.FilenameUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 社区自组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@RestController +@RequestMapping("iccommunityselforganization") +public class IcCommunitySelfOrganizationController { + + @Autowired + private IcCommunitySelfOrganizationService icCommunitySelfOrganizationService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icCommunitySelfOrganizationService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcCommunitySelfOrganizationDTO data = icCommunitySelfOrganizationService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcCommunitySelfOrganizationDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icCommunitySelfOrganizationService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcCommunitySelfOrganizationDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icCommunitySelfOrganizationService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icCommunitySelfOrganizationService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = icCommunitySelfOrganizationService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, IcCommunitySelfOrganizationExcel.class); + } + + /** + * @Description 导出 社区自组织查询列表 + * @param response + * @param tokenDto + * @param formDTO + * @author zxc + * @date 2021/11/24 10:59 上午 + */ + @PostMapping("exportcommunityselforganization") + public void exportCommunitySelfOrganization(HttpServletResponse response,@LoginUser TokenDto tokenDto,@RequestBody CommunitySelfOrganizationListFormDTO formDTO) throws Exception { + CommunitySelfOrganizationListResultDTO resultDTO = icCommunitySelfOrganizationService.communitySelfOrganizationList(tokenDto, formDTO); + ExcelUtils.exportExcelToTarget(response, null, resultDTO.getList(), ExportCommunitySelfOrganizationExcel.class); + } + + /** + * @Description 导入 + * @param tokenDto + * @param response + * @param file + * @author zxc + * @date 2021/11/25 9:03 上午 + */ + @PostMapping("importcommunityselforganization") + public Result importCommunitySelfOrganization(@LoginUser TokenDto tokenDto, HttpServletResponse response, @RequestPart("file") MultipartFile file) throws Exception { + if (file.isEmpty()) { + throw new RenException("请上传文件"); + } + + // 校验文件类型 + String extension = FilenameUtils.getExtension(file.getOriginalFilename()); + if (!"xls".equals(extension) && !"xlsx".equals(extension)) { + throw new RenException("文件类型不匹配"); + } + icCommunitySelfOrganizationService.importCommunitySelfOrganization(tokenDto, response, file); + return new Result(); + } + + /** + * @Description 添加社区自组织 + * @param tokenDto + * @param formDTO + * @author zxc + * @date 2021/11/19 8:33 上午 + */ + @NoRepeatSubmit + @PostMapping("addcommunityselforganization") + public Result addCommunitySelfOrganization(@LoginUser TokenDto tokenDto, @RequestBody AddCommunitySelfOrganizationFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, AddCommunitySelfOrganizationFormDTO.AddCommunitySelfOrganizationForm.class); + icCommunitySelfOrganizationService.addCommunitySelfOrganization(tokenDto, formDTO); + return new Result(); + } + + /** + * @Description 修改社区自组织 + * @param tokenDto + * @param formDTO + * @author zxc + * @date 2021/11/19 10:12 上午 + */ + @NoRepeatSubmit + @PostMapping("editcommunityselforganization") + public Result editCommunitySelfOrganization(@LoginUser TokenDto tokenDto, @RequestBody EditCommunitySelfOrganizationFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, EditCommunitySelfOrganizationFormDTO.EditCommunitySelfOrganizationForm.class); + icCommunitySelfOrganizationService.editCommunitySelfOrganization(tokenDto, formDTO); + return new Result(); + } + + /** + * @Description 查询社区自组织列表 + * @param tokenDto + * @param formDTO + * @author zxc + * @date 2021/11/19 1:59 下午 + */ + @PostMapping("communityselforganizationlist") + public Result communitySelfOrganizationList(@LoginUser TokenDto tokenDto,@RequestBody CommunitySelfOrganizationListFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, CommunitySelfOrganizationListFormDTO.CommunitySelfOrganizationListForm.class); + return new Result().ok(icCommunitySelfOrganizationService.communitySelfOrganizationList(tokenDto, formDTO)); + } + + /** + * @Description 社区自组织删除 + * @param formDTO + * @author zxc + * @date 2021/11/19 4:22 下午 + */ + @PostMapping("delcommunityselforganization") + public Result delCommunitySelfOrganization(@RequestBody DelCommunitySelfOrganizationFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, DelCommunitySelfOrganizationFormDTO.DelCommunitySelfOrganizationForm.class); + icCommunitySelfOrganizationService.delCommunitySelfOrganization(formDTO); + return new Result(); + } + + /** + * 需求指派,选择社区自组织,调用此接口 + * 返回需求所属社区下的 组织 + * + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("servicelist") + public Result> queryServiceList(@LoginUser TokenDto tokenDto, @RequestBody ServiceQueryFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO,ServiceQueryFormDTO.AddUserInternalGroup.class); + return new Result>().ok(icCommunitySelfOrganizationService.queryServiceList(formDTO)); + } +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationPersonnelController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationPersonnelController.java new file mode 100644 index 0000000000..76a64ce4f0 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationPersonnelController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.IcCommunitySelfOrganizationPersonnelDTO; +import com.epmet.excel.IcCommunitySelfOrganizationPersonnelExcel; +import com.epmet.service.IcCommunitySelfOrganizationPersonnelService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 社区自组织人员表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@RestController +@RequestMapping("iccommunityselforganizationpersonnel") +public class IcCommunitySelfOrganizationPersonnelController { + + @Autowired + private IcCommunitySelfOrganizationPersonnelService icCommunitySelfOrganizationPersonnelService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icCommunitySelfOrganizationPersonnelService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcCommunitySelfOrganizationPersonnelDTO data = icCommunitySelfOrganizationPersonnelService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcCommunitySelfOrganizationPersonnelDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icCommunitySelfOrganizationPersonnelService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcCommunitySelfOrganizationPersonnelDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icCommunitySelfOrganizationPersonnelService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icCommunitySelfOrganizationPersonnelService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = icCommunitySelfOrganizationPersonnelService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, IcCommunitySelfOrganizationPersonnelExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java new file mode 100644 index 0000000000..a17609835d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java @@ -0,0 +1,120 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +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.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.IcPartyActivityDTO; +import com.epmet.dto.form.PartyActivityFormDTO; +import com.epmet.excel.IcPartyActivityExcel; +import com.epmet.service.IcPartyActivityService; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; + + +/** + * 联建活动 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@RestController +@RequestMapping("icpartyactivity") +public class IcPartyActivityController { + + @Autowired + private IcPartyActivityService icPartyActivityService; + + @PostMapping("search") + public Result> page(@RequestBody PartyActivityFormDTO formDTO){ + PageData page = icPartyActivityService.search(formDTO); + return new Result>().ok(page); + } + + @PostMapping("detail") + public Result get(@RequestBody IcPartyActivityDTO dto){ + IcPartyActivityDTO data = icPartyActivityService.get(dto.getId()); + return new Result().ok(data); + } + + @PostMapping("save") + @NoRepeatSubmit + public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcPartyActivityDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icPartyActivityService.save(tokenDto, dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody IcPartyActivityDTO dto){ + icPartyActivityService.delete(dto.getId()); + return new Result(); + } + + @PostMapping("export") + public void export(@RequestBody PartyActivityFormDTO formDTO, HttpServletResponse response) throws Exception { + List list = icPartyActivityService.list(formDTO); + List excelList = new ArrayList<>(); + AtomicInteger i = new AtomicInteger(1); + if (CollectionUtils.isNotEmpty(list)) { + excelList = list.stream().map(item -> { + IcPartyActivityExcel excel = new IcPartyActivityExcel(); + excel.setIndex(i.getAndIncrement()); + excel.setUnitName(item.getUnitName()); + excel.setTitle(item.getTitle()); + excel.setAddress(item.getAddress()); + excel.setPeopleCount(item.getPeopleCount()); + excel.setActivityTime(DateUtils.format(item.getActivityTime(), DateUtils.DATE_TIME_PATTERN)); + return excel; + }).collect(Collectors.toList()); + } + ExcelUtils.exportExcelToTarget(response, null, excelList, IcPartyActivityExcel.class); + } + + /** + * 数据导入 + * @Param tokenDto + * @Param response + * @Param file + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2021/11/30 14:42 + */ + @PostMapping("import") + public Result importData(@LoginUser TokenDto tokenDto, HttpServletResponse response, @RequestPart("file") MultipartFile file) throws IOException { + return icPartyActivityService.importData(tokenDto, response, file); + } +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java new file mode 100644 index 0000000000..90c500b87d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java @@ -0,0 +1,168 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.IcPartyUnitDTO; +import com.epmet.dto.form.PartyUnitFormDTO; +import com.epmet.dto.form.demand.ServiceQueryFormDTO; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.excel.IcPartyUnitExcel; +import com.epmet.service.IcPartyUnitService; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; + + +/** + * 联建单位 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@RestController +@RequestMapping("icpartyunit") +public class IcPartyUnitController { + + @Autowired + private IcPartyUnitService icPartyUnitService; + + @PostMapping("list") + public Result> search(@LoginUser TokenDto tokenDto, @RequestBody PartyUnitFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + PageData page = icPartyUnitService.search(formDTO); + return new Result>().ok(page); + } + + @PostMapping("detail") + public Result get(@RequestBody IcPartyUnitDTO formDTO){ + AssertUtils.isBlank(formDTO.getId(), "id"); + IcPartyUnitDTO data = icPartyUnitService.get(formDTO.getId()); + return new Result().ok(data); + } + + @PostMapping("save") + @NoRepeatSubmit + public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcPartyUnitDTO dto){ + //效验数据 + dto.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icPartyUnitService.save(tokenDto, dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody IcPartyUnitDTO dto){ + //效验数据 + AssertUtils.isBlank(dto.getId(), "id"); + icPartyUnitService.delete(dto.getId()); + return new Result(); + } + + @PostMapping("export") + public void export(@LoginUser TokenDto tokenDto, @RequestBody PartyUnitFormDTO formDTO, HttpServletResponse response) throws Exception { + formDTO.setCustomerId(tokenDto.getCustomerId()); + List list = icPartyUnitService.list(formDTO); + List excelList = new ArrayList<>(); + AtomicInteger i = new AtomicInteger(1); + if (CollectionUtils.isNotEmpty(list)) { + excelList = list.stream().map(item -> { + IcPartyUnitExcel excel = new IcPartyUnitExcel(); + excel.setIndex(i.getAndIncrement()); + excel.setUnitName(item.getUnitName()); + excel.setContact(item.getContact()); + excel.setContactMobile(item.getContactMobile()); + excel.setType(item.getType()); + excel.setMemberCount(item.getMemberCount()); + excel.setRemark(item.getRemark()); + excel.setSatisfaction(item.getSatisfaction()); + excel.setServiceMatter(String.join(String.valueOf((char) 10), item.getServiceMatterList())); + return excel; + }).collect(Collectors.toList()); + } + ExcelUtils.exportExcelToTarget(response, null, excelList, IcPartyUnitExcel.class); + } + + /** + * 需求指派,选择区域化党建单位,调用此接口 + * 返回需求所属组织线上的数据 + * + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("servicelist") + public Result> queryServiceList(@LoginUser TokenDto tokenDto, @RequestBody ServiceQueryFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO,ServiceQueryFormDTO.AddUserInternalGroup.class); + return new Result>().ok(icPartyUnitService.queryServiceList(formDTO)); + } + + @PostMapping("option") + public Result> option(@RequestBody IcPartyUnitDTO dto){ + AssertUtils.isBlank(dto.getAgencyId(), "agencyId"); + return new Result>().ok(icPartyUnitService.option(dto)); + } + + /** + * 数据导入 + * @Param tokenDto + * @Param response + * @Param file + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2021/11/30 14:42 + */ + @PostMapping("import") + public Result importData(@LoginUser TokenDto tokenDto, HttpServletResponse response, @RequestPart("file") MultipartFile file) throws IOException { + return icPartyUnitService.importData(tokenDto, response, file); + } + + + /** + * 计算区域化党建单位的群众满意度 + * + * @param formDTO + * @return + */ + @PostMapping("cal-partyunit-satisfation") + public Result calPartyUnitSatisfation(@RequestBody CalPartyUnitSatisfactionFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,CalPartyUnitSatisfactionFormDTO.AddUserInternalGroup.class); + icPartyUnitService.calPartyUnitSatisfation(formDTO); + return new Result(); + } +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcResiDemandDictController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcResiDemandDictController.java index 13779cfe13..565a7a8423 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcResiDemandDictController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcResiDemandDictController.java @@ -18,23 +18,22 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.form.PageFormDTO; 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.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.commons.tools.validator.group.AddGroup; -import com.epmet.commons.tools.validator.group.DefaultGroup; -import com.epmet.commons.tools.validator.group.UpdateGroup; -import com.epmet.dto.IcResiDemandDictDTO; -import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO; +import com.epmet.dto.form.demand.*; +import com.epmet.dto.result.demand.DemandPageResDTO; +import com.epmet.dto.result.demand.OptionDTO; import com.epmet.service.IcResiDemandDictService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; -import java.util.Map; /** @@ -50,31 +49,73 @@ public class IcResiDemandDictController { @Autowired private IcResiDemandDictService icResiDemandDictService; - @GetMapping("page") - public Result> page(@RequestParam Map params){ - PageData page = icResiDemandDictService.page(params); - return new Result>().ok(page); + /** + * 分页列表查询 + * + * @param formDTO + * @return + */ + @PostMapping("pagelist") + public Result> page(@RequestBody DemandDictPageFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,DemandDictPageFormDTO.AddUserInternalGroup.class, PageFormDTO.AddUserInternalGroup.class); + PageData page = icResiDemandDictService.page(formDTO); + return new Result>().ok(page); } - @GetMapping("{id}") - public Result get(@PathVariable("id") String id){ - IcResiDemandDictDTO data = icResiDemandDictService.get(id); - return new Result().ok(data); + /** + * 添加一级分类 + * @param formDTO + * @return + */ + @PostMapping("addfirst") + public Result addFirstCategory(@RequestBody AddFirstCategoryFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,AddFirstCategoryFormDTO.AddUserShowGroup.class,AddFirstCategoryFormDTO.AddUserInternalGroup.class); + icResiDemandDictService.addFirstCategory(formDTO); + return new Result(); } - @PostMapping - public Result save(@RequestBody IcResiDemandDictDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - icResiDemandDictService.save(dto); + /** + * 新增二级分类 + * @param formDTO + * @return + */ + @PostMapping("addchild") + public Result addChild(@RequestBody AddCategoryFormDTO formDTO ){ + ValidatorUtils.validateEntity(formDTO,AddCategoryFormDTO.AddUserShowGroup.class,AddCategoryFormDTO.AddUserInternalGroup.class); + icResiDemandDictService.addChild(formDTO); return new Result(); } - @PutMapping - public Result update(@RequestBody IcResiDemandDictDTO dto){ + /** + * 修改分类 + * + * + * @param formDTO + * @return + */ + @PostMapping("update") + public Result update(@RequestBody UpdateFormDTO formDTO) { //效验数据 - ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - icResiDemandDictService.update(dto); + ValidatorUtils.validateEntity(formDTO, UpdateFormDTO.AddUserInternalGroup.class, UpdateFormDTO.AddUserShowGroup.class); + if (NumConstant.ONE == formDTO.getLevel()) { + ValidatorUtils.validateEntity(formDTO, UpdateFormDTO.First.class); + } else if (NumConstant.TWO == formDTO.getLevel()) { + ValidatorUtils.validateEntity(formDTO, UpdateFormDTO.Two.class); + } + icResiDemandDictService.update(formDTO); + return new Result(); + } + + /** + * 启用或禁用 + * + * @param formDTO + * @return + */ + @PostMapping("updatestatus") + public Result updateStatus(@RequestBody StatusFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,StatusFormDTO.AddUserInternalGroup.class); + icResiDemandDictService.updateStatus(formDTO); return new Result(); } @@ -91,6 +132,19 @@ public class IcResiDemandDictController { return new Result>().ok(icResiDemandDictService.getDemandOptions(tokenDto.getCustomerId())); } + /** + * 服务措施管理界面, + * + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("option-service") + public Result> getDemandOptionsV2(@LoginUser TokenDto tokenDto,@RequestBody DemandOptionFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO,DemandOptionFormDTO.AddUserInternalGroup.class); + return new Result>().ok(icResiDemandDictService.getDemandOptionsV2(formDTO)); + } /** * 居民信息列表需要展示分类名称,单独开出来这个接口,供user查询 @@ -102,4 +156,38 @@ public class IcResiDemandDictController { ValidatorUtils.validateEntity(formDTO,UserDemandNameQueryFormDTO.AddUserInternalGroup.class); return icResiDemandDictService.queryDemandNames(formDTO); } + + /** + * 居民需求查询条件:一级分类列表 0 + * 区域化党建单位:服务事项下拉框 1010 + * + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("subcodelist") + public Result> querySubCodeList(@LoginUser TokenDto tokenDto, @RequestBody SubCodeFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO,SubCodeFormDTO.AddUserInternalGroup.class); + return new Result>().ok(icResiDemandDictService.querySubCodeList(formDTO)); + } + + + + + + + + + + + + + + + + + + + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java new file mode 100644 index 0000000000..786fc77928 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java @@ -0,0 +1,172 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ExcelPoiUtils; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.AddSocietyOrgFormDTO; +import com.epmet.dto.form.EditSocietyOrgFormDTO; +import com.epmet.dto.form.GetListPlaceOrgFormDTO; +import com.epmet.dto.form.GetListSocietyOrgFormDTO; +import com.epmet.dto.form.demand.ServiceQueryFormDTO; +import com.epmet.dto.result.GetListPlaceOrgResultDTO; +import com.epmet.dto.result.GetListSocietyOrgResultDTO; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.excel.IcSocietyOrgExcel; +import com.epmet.service.IcSocietyOrgService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + + +/** + * 社会组织管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Slf4j +@RestController +@RequestMapping("societyorg") +public class IcSocietyOrgController { + + @Autowired + private IcSocietyOrgService societyOrgService; + + /** + * @Author sun + * @Description 新增社会组织 + **/ + @PostMapping("add") + public Result add(@LoginUser TokenDto tokenDto, @RequestBody AddSocietyOrgFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AddSocietyOrgFormDTO.Add.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + societyOrgService.add(formDTO); + return new Result(); + } + + /** + * @Author sun + * @Description 修改社会组织 + **/ + @PostMapping("edit") + public Result edit(@LoginUser TokenDto tokenDto, @RequestBody EditSocietyOrgFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, EditSocietyOrgFormDTO.Edit.class); + societyOrgService.edit(formDTO); + return new Result(); + } + + /** + * @Author sun + * @Description 删除社会组织 + **/ + @PostMapping("del") + public Result del(@LoginUser TokenDto tokenDto, @RequestBody EditSocietyOrgFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, EditSocietyOrgFormDTO.Del.class); + societyOrgService.del(formDTO.getSocietyId()); + return new Result(); + } + + /** + * @Author sun + * @Description 社会组织列表查询 + **/ + @PostMapping("getlist") + public Result getList(@LoginUser TokenDto tokenDto, @RequestBody GetListSocietyOrgFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + return new Result().ok(societyOrgService.getList(formDTO)); + } + + /** + * 需求指派,选择社会组织,调用此接口 + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("servicelist") + public Result> queryServiceList(@LoginUser TokenDto tokenDto,@RequestBody ServiceQueryFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO,ServiceQueryFormDTO.AddUserInternalGroup.class,ServiceQueryFormDTO.SocietyOrgInternalGroup.class); + return new Result>().ok(societyOrgService.queryServiceList(formDTO)); + } + + /** + * @Author sun + * @Description 九小场所下组织列表导出 + **/ + @PostMapping("export") + public void export(@LoginUser TokenDto tokenDto, @RequestBody GetListSocietyOrgFormDTO formDTO, HttpServletResponse response) throws Exception { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + formDTO.setIsPage(false); + GetListSocietyOrgResultDTO list = societyOrgService.getList(formDTO); + ExcelUtils.exportExcelToTarget(response, null, list.getList(), IcSocietyOrgExcel.class); + } + + /** + * @Author sun + * @Description 九小场所下组织列表导入 + **/ + @PostMapping("import") + public Result importExcel(@LoginUser TokenDto tokenDTO, @RequestParam("file") MultipartFile file) throws IOException, ParseException { + + ExcelImportResult importResult = ExcelPoiUtils.importExcelMore(file, 0, 1, IcSocietyOrgExcel.class); + List failList = importResult.getFailList(); + + //存放错误数据行号 + List numList = new ArrayList<>(); + if (!CollectionUtils.isEmpty(failList)) { + for (IcSocietyOrgExcel entity : failList) { + log.warn("第{}行,{}", entity.getRowNum(), entity.getErrorMsg());//打印失败的行 和失败的信息 + numList.add(entity.getRowNum()); + } + //return new Result().error(8001,failList.get(0).getErrorMsg()); + } + List result = importResult.getList(); + + List resultList = societyOrgService.importExcel(tokenDTO.getCustomerId(), result, tokenDTO.getUserId(), numList); + String str = String.format("共%s条,成功导入%s条。", numList.size() + result.size(), numList.size() + result.size() - resultList.size()); + if (resultList.size() > NumConstant.ZERO) { + Collections.sort(resultList); + String subList = resultList.stream().map(String::valueOf).collect(Collectors.joining("、")); + log.warn(str + "第" + subList + "行未成功!"); + return new Result().error(9999, str + "第" + subList + "行未成功!"); + } + return new Result().ok(str); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java new file mode 100644 index 0000000000..0d5567ad63 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java @@ -0,0 +1,231 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO; +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.constant.SystemMessageType; +import com.epmet.constant.UserDemandConstant; +import com.epmet.dto.form.SystemMsgFormDTO; +import com.epmet.dto.form.demand.*; +import com.epmet.dto.result.demand.DemandRecResultDTO; +import com.epmet.dto.result.demand.FinishResultDTO; +import com.epmet.dto.result.demand.IcResiUserReportDemandRes; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.feign.EpmetMessageOpenFeignClient; +import com.epmet.service.*; +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; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + + +/** + * 居民需求记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Slf4j +@RestController +@RequestMapping("userdemand") +public class IcUserDemandRecController { + + @Autowired + private IcUserDemandRecService icUserDemandRecService; + @Autowired + private VolunteerInfoService volunteerInfoService; + @Autowired + private IcSocietyOrgService societyOrgService; + @Autowired + private IcCommunitySelfOrganizationService icCommunitySelfOrganizationService; + @Autowired + private IcPartyUnitService icPartyUnitService; + @Autowired + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; + + /** + * 根据服务方类型查询 下拉框 + * 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + * + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("servicelist") + public Result> queryServiceList(@LoginUser TokenDto tokenDto, @RequestBody ServiceQueryFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, ServiceQueryFormDTO.AddUserInternalGroup.class); + if (UserDemandConstant.VOLUNTEER.equals(formDTO.getServiceType())) { + return new Result>().ok(volunteerInfoService.queryListVolunteer(tokenDto.getCustomerId(), formDTO.getServiceName())); + } else if (UserDemandConstant.SOCIAL_ORG.equals(formDTO.getServiceType())) { + ValidatorUtils.validateEntity(formDTO, ServiceQueryFormDTO.AddUserInternalGroup.class, ServiceQueryFormDTO.SocietyOrgInternalGroup.class); + return new Result>().ok(societyOrgService.queryServiceList(formDTO)); + } else if (UserDemandConstant.COMMUNITY_ORG.equals(formDTO.getServiceType())) { + return new Result>().ok(icCommunitySelfOrganizationService.queryServiceList(formDTO)); + } else if (UserDemandConstant.PARTY_UNIT.equals(formDTO.getServiceType())) { + return new Result>().ok(icPartyUnitService.queryServiceList(formDTO)); + } + return new Result<>(); + } + + /** + * 新增需求 + * + * @param tokenDto + * @param fromDTO + * @return + */ + @PostMapping("add") + public Result add(@LoginUser TokenDto tokenDto, @RequestBody DemandAddFromDTO fromDTO){ + fromDTO.setCustomerId(tokenDto.getCustomerId()); + fromDTO.setCurrentUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(fromDTO,DemandAddFromDTO.AddUserShowGroup.class); + return new Result().ok(icUserDemandRecService.add(fromDTO)); + } + + /** + * 更新需求 + * 只有待处理的才可以编辑 + * + * @param tokenDto + * @param fromDTO + * @return + */ + @PostMapping("update") + public Result update(@LoginUser TokenDto tokenDto, @RequestBody DemandAddFromDTO fromDTO){ + fromDTO.setCustomerId(tokenDto.getCustomerId()); + fromDTO.setCurrentUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(fromDTO,DemandAddFromDTO.UpdateInternalGroup.class,DemandAddFromDTO.AddUserShowGroup.class); + return new Result().ok(icUserDemandRecService.update(fromDTO)); + } + + /** + * 列表查询 分页 + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("pagelist") + public Result> pageList(@LoginUser TokenDto tokenDto, @RequestBody UserDemandPageFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setCurrentStaffId(tokenDto.getUserId()); + return new Result>().ok(icUserDemandRecService.pageList(formDTO)); + } + + + /** + * 取消,未完成之前都可以取消 + * + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("cancel") + public Result cancel(@LoginUser TokenDto tokenDto,@RequestBody StaffCancelFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO,StaffCancelFormDTO.AddUserInternalGroup.class); + icUserDemandRecService.cancel(formDTO); + return new Result(); + } + + + /** + * 指派 + * 待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished + * 待处理+已派单才可以指派 + * + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("assign") + public Result assign(@LoginUser TokenDto tokenDto,@RequestBody AssignFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO,AssignFormDTO.AddUserShowGroup.class,AssignFormDTO.AddUserInternalGroup.class); + icUserDemandRecService.assign(formDTO); + return new Result(); + } + + /** + * 完成并评价 + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("finish") + public Result finish(@LoginUser TokenDto tokenDto,@RequestBody FinishStaffFromDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO,FinishStaffFromDTO.AddUserShowGroup.class,FinishStaffFromDTO.AddUserInternalGroup.class); + FinishResultDTO finishResultDTO=icUserDemandRecService.finish(formDTO); + if(finishResultDTO.getSendCalStatisfaction()){ + CalPartyUnitSatisfactionFormDTO mqMsg = new CalPartyUnitSatisfactionFormDTO(); + mqMsg.setCustomerId(formDTO.getCustomerId()); + mqMsg.setPartyUnitId(finishResultDTO.getPartyUnitId()); + SystemMsgFormDTO form = new SystemMsgFormDTO(); + form.setMessageType(SystemMessageType.CAL_PARTY_UNIT_SATISFACTION); + form.setContent(mqMsg); + epmetMessageOpenFeignClient.sendSystemMsgByMQ(form); + } + return new Result(); + } + + + /** + * 数据分析-个人档案,居民需求列表table + * + * @param formDTO + * @return + */ + @PostMapping("mydemand") + public Result> queryMyDemand(@LoginUser TokenDto tokenDto,@RequestBody IcResiUserDemandFromDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO,IcResiUserDemandFromDTO.AddUserInternalGroup.class); + return new Result>().ok(icUserDemandRecService.queryMyDemand(formDTO)); + } + + /** + * 数据分析-个人档案、居民需求列表-查看需求详情 + * + * @param formDTO + * @return + */ + @PostMapping("demandDetail") + public Result queryDemandDetail(@LoginUser TokenDto tokenDto, @RequestBody DemandDetailFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO,DemandDetailFormDTO.AddUserInternalGroup.class); + return new Result().ok(icUserDemandRecService.queryDemandDetail(formDTO)); + } + + + + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java index 00a07440ca..e144e9c11f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java @@ -23,8 +23,10 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.VolunteerInfoDTO; import com.epmet.dto.form.CommonCustomerFormDTO; +import com.epmet.dto.form.demand.ServiceQueryFormDTO; import com.epmet.dto.form.resi.ResiSendSmsCodeFormDTO; import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO; +import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.resi.ResiVolunteerInfoResultDTO; import com.epmet.service.VolunteerInfoService; import org.springframework.beans.factory.annotation.Autowired; @@ -112,4 +114,15 @@ public class ResiVolunteerController { public Result queryUserVolunteerInfo(@PathVariable("userId")String userId){ return new Result().ok(volunteerInfoService.queryUserVolunteerInfo(userId)); } + + /** + * 需求指派时,服务对象选择志愿者,调用此接口查询当前客户下所有的志愿者信息:姓名(手机号) + * + * @param tokenDto + * @return + */ + @PostMapping("listprofile") + public Result> queryListVolunteer(@LoginUser TokenDto tokenDto,@RequestBody ServiceQueryFormDTO formDTO){ + return new Result>().ok(volunteerInfoService.queryListVolunteer(tokenDto.getCustomerId(),formDTO.getServiceName())); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java new file mode 100644 index 0000000000..efc9881b2a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java @@ -0,0 +1,67 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.CommunitySelfOrganizationListFormDTO; +import com.epmet.dto.result.CommunitySelfOrganizationListDTO; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.entity.IcCommunitySelfOrganizationEntity; +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 2021-11-18 + */ +@Mapper +public interface IcCommunitySelfOrganizationDao extends BaseDao { + + /** + * @Description 自组织修改 + * @param formDTO + * @author zxc + * @date 2021/11/19 2:04 下午 + */ + void updateCommunitySelfOrganization(IcCommunitySelfOrganizationEntity formDTO); + + /** + * @Description 查询社区自组织列表 + * @param formDTO + * @author zxc + * @date 2021/11/19 2:05 下午 + */ + List selectCommunitySelfOrganizationList(CommunitySelfOrganizationListFormDTO formDTO); + + List selectListByAgencyId(@Param("customerId") String customerId, + @Param("agencyIds") List agencyIds, + @Param("orgName") String orgName); + + /** + * @Description 根据名字查询存在的自组织 + * @param names + * @author zxc + * @date 2021/11/25 9:07 上午 + */ + List selectOrgByOrgName(@Param("names")List names, @Param("customerId") String customerId); + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationPersonnelDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationPersonnelDao.java new file mode 100644 index 0000000000..4bd2fde9f4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationPersonnelDao.java @@ -0,0 +1,42 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcCommunitySelfOrganizationPersonnelEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 社区自组织人员表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Mapper +public interface IcCommunitySelfOrganizationPersonnelDao extends BaseDao { + + /** + * @Description 根据社区自组织ID删除 + * @param orgId + * @author zxc + * @date 2021/11/19 11:19 上午 + */ + void deleteByOrgId(@Param("orgId")String orgId); + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyActivityDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyActivityDao.java new file mode 100644 index 0000000000..c596572fee --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyActivityDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcPartyActivityEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 联建活动 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Mapper +public interface IcPartyActivityDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java new file mode 100644 index 0000000000..4efaff7d84 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java @@ -0,0 +1,49 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.entity.IcPartyUnitEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.math.BigDecimal; +import java.util.List; + +/** + * 联建单位 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Mapper +public interface IcPartyUnitDao extends BaseDao { + + /** + * 需求指派,选择区域化党建单位,调用此接口 + * @param agencyIds + * @param unitName + * @return + */ + List selectListByAgencyId(@Param("agencyIds") List agencyIds, + @Param("unitName") String unitName, + @Param("customerId")String customerId); + + int updateSatisfaction(@Param("partyUnitId") String serverId, @Param("satisfaction") BigDecimal satisfaction); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java index 94fd335929..211ab20e8d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java @@ -19,6 +19,8 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.dto.result.demand.DemandPageResDTO; +import com.epmet.dto.result.demand.OptionDTO; import com.epmet.entity.IcResiDemandDictEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -34,8 +36,34 @@ import java.util.Set; */ @Mapper public interface IcResiDemandDictDao extends BaseDao { - List selectDemandOptions(@Param("customerId") String customerId); - List selectChildDemands(@Param("customerId")String customerId, @Param("parentCode") String parentCode); + List selectDemandOptions(@Param("customerId") String customerId,@Param("usableFlagFormValue") String usableFlagFormValue); + List selectChildDemands(@Param("customerId")String customerId, @Param("parentCode") String parentCode,@Param("usableFlagFormValue") String usableFlagFormValue); String selectCategoryNames(@Param("customerId") String customerId,@Param("codeSet") Set codeSet); + + List selectByPCode(@Param("pcode") String pcode, + @Param("customerId") String customerId, + @Param("categoryName")String categoryName); + + List pageSelect(@Param("customerId") String customerId, @Param("firstCategoryCode")String firstCategoryCode); + + List selectChild(@Param("customerId") String customerId, @Param("parentCode")String parentCode); + + int selectCountName(@Param("customerId") String customerId, + @Param("categoryName")String categoryName, + @Param("level")int level, + @Param("parentCode")String parentCode, + @Param("id")String id); + + Integer selectMaxCategoryCode(@Param("customerId") String customerId, + @Param("level") Integer level, + @Param("parentCode") String parentCode); + + Integer selectMaxSort(@Param("customerId") String customerId, + @Param("level") int level, + @Param("parentCode") String parentCode); + + List selectSecondCodes(@Param("customerId") String customerId, @Param("cateogryCodes") List categoryCodes); + + String selectNameByCode(@Param("customerId")String customerId, @Param("categoryCode") String categoryCode); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcSocietyOrgDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcSocietyOrgDao.java new file mode 100644 index 0000000000..60f62e3a8d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcSocietyOrgDao.java @@ -0,0 +1,63 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.IcSocietyOrgDTO; +import com.epmet.dto.form.GetListSocietyOrgFormDTO; +import com.epmet.dto.result.GetListSocietyOrgResultDTO; +import com.epmet.dto.result.SocietyOrgListResultDTO; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.entity.IcSocietyOrgEntity; +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 2021-11-18 + */ +@Mapper +public interface IcSocietyOrgDao extends BaseDao { + + /** + * @Author sun + * @Description 社会组织列表查询 + **/ + List getList(GetListSocietyOrgFormDTO formDTO); + + /** + * 需求指派,选择社会组织,调用此接口 + * + * @param agencyIds + * @return + */ + List selectListByAgencyId(@Param("agencyIds")List agencyIds, + @Param("societyName")String societyName, + @Param("customerId")String customerId, + @Param("queryPurpose")String queryPurpose); + + /** + * @Author sun + * @Description 查询当前组织下的社会组织数据 + **/ + List getByAgencyId(@Param("agencyId") String agencyId); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandOperateLogDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandOperateLogDao.java new file mode 100644 index 0000000000..178e0482b9 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandOperateLogDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcUserDemandOperateLogEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 居民需求操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Mapper +public interface IcUserDemandOperateLogDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java new file mode 100644 index 0000000000..3089b64be9 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java @@ -0,0 +1,62 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.demand.IcResiUserDemandFromDTO; +import com.epmet.dto.form.demand.UserDemandPageFormDTO; +import com.epmet.dto.result.demand.DemandRecResultDTO; +import com.epmet.dto.result.demand.IcResiUserReportDemandRes; +import com.epmet.dto.result.demand.ServiceStatDTO; +import com.epmet.entity.IcUserDemandRecEntity; +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 2021-11-19 + */ +@Mapper +public interface IcUserDemandRecDao extends BaseDao { + + + List pageSelect(UserDemandPageFormDTO formDTO); + + /** + * 数据分析-个人档案,居民需求列表table + * + * @param formDTO + * @return + */ + List selectUserDemand(IcResiUserDemandFromDTO formDTO); + + /** + * 数据分析-个人档案,居民需求详情 + * + * @param customerId + * @param demandRecId + * @return + */ + DemandRecResultDTO selectDemandRecDetail(@Param("customerId") String customerId, @Param("demandRecId") String demandRecId); + + List selectGroupByPartyUnit(@Param("customerId") String customerId, @Param("partyUnitId") String partyUnitId); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandSatisfactionDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandSatisfactionDao.java new file mode 100644 index 0000000000..4c32bc9045 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandSatisfactionDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcUserDemandSatisfactionEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 居民需求评价记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Mapper +public interface IcUserDemandSatisfactionDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandServiceDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandServiceDao.java new file mode 100644 index 0000000000..5f9adffb87 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandServiceDao.java @@ -0,0 +1,34 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcUserDemandServiceEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 居民需求服务记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Mapper +public interface IcUserDemandServiceDao extends BaseDao { + + IcUserDemandServiceEntity selectByRecId(String demandRecId); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcCommunitySelfOrganizationEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcCommunitySelfOrganizationEntity.java new file mode 100644 index 0000000000..b66e6a0773 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcCommunitySelfOrganizationEntity.java @@ -0,0 +1,109 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 社区自组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_community_self_organization") +public class IcCommunitySelfOrganizationEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String orgId; + + /** + * 组织类型,agency:组织,grid:网格 + */ + private String orgType; + + /** + * 组织ID的父级 + */ + private String pid; + + /** + * org_id的所有上级 + */ + private String pids; + + /** + * 组织名称 + */ + private String organizationName; + + /** + * 组织人数 + */ + private Integer organizationPersonCount; + + /** + * 负责人姓名 + */ + private String principalName; + + /** + * 负责人电话 + */ + private String principalPhone; + + /** + * 服务事项 + */ + private String serviceItem; + + /** + * 社区自组织创建时间 + */ + private Date organizationCreatedTime; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcCommunitySelfOrganizationPersonnelEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcCommunitySelfOrganizationPersonnelEntity.java new file mode 100644 index 0000000000..66e4309b16 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcCommunitySelfOrganizationPersonnelEntity.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 2021-11-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_community_self_organization_personnel") +public class IcCommunitySelfOrganizationPersonnelEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 社区自组织ID + */ + private String orgId; + + /** + * 人员姓名 + */ + private String personName; + + /** + * 人员电话 + */ + private String personPhone; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyActivityEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyActivityEntity.java new file mode 100644 index 0000000000..529bb4f34a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyActivityEntity.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 2021-11-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_party_activity") +public class IcPartyActivityEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 组织的所有上级 + */ + private String pids; + + /** + * 单位ID + */ + private String unitId; + + /** + * 服务事项 + */ + private String serviceMatter; + + /** + * 活动标题 + */ + private String title; + + /** + * 活动目标 + */ + private String target; + + /** + * 活动内容 + */ + private String content; + + /** + * 服务人数 + */ + private Integer peopleCount; + + /** + * 活动时间 + */ + private Date activityTime; + + /** + * 活动地址 + */ + private String address; + + /** + * 活动地址经度 + */ + private String longitude; + + /** + * 活动地址纬度 + */ + private String latitude; + + /** + * 活动结果 + */ + private String result; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyUnitEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyUnitEntity.java new file mode 100644 index 0000000000..f789736b80 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyUnitEntity.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 2021-11-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_party_unit") +public class IcPartyUnitEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * + */ + private String pids; + + /** + * 单位名称 + */ + private String unitName; + + /** + * 分类 楼宇党建 两新组织 区域单位党建 机关直属部门 其他 + */ + private String type; + + /** + * 服务事项 多选逗号隔开 + */ + private String serviceMatter; + + /** + * 联系人 + */ + private String contact; + + /** + * 联系电话 + */ + private String contactMobile; + + /** + * 在职党员数 + */ + private Integer memberCount; + + /** + * 地址 + */ + private String address; + + /** + * 中心位置经度 + */ + private String longitude; + + /** + * 中心位置纬度 + */ + private String latitude; + + /** + * 群众满意度 + */ + private String satisfaction; + + /** + * 备注 + */ + private String remark; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcResiDemandDictEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcResiDemandDictEntity.java index 5e01dd2b14..1b9a30b755 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcResiDemandDictEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcResiDemandDictEntity.java @@ -58,7 +58,7 @@ public class IcResiDemandDictEntity extends BaseEpmetEntity { /** * 级别 */ - private String level; + private Integer level; /** * 备注 @@ -70,4 +70,13 @@ public class IcResiDemandDictEntity extends BaseEpmetEntity { */ private Integer sort; + /** + * 奖励积分:只有二级分类才会配置,一级默认为0。11.17 + */ + private Integer awardPoint; + + /** + * 1可用,0不可用,11.17 + */ + private Boolean usableFlag; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcSocietyOrgEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcSocietyOrgEntity.java new file mode 100644 index 0000000000..569156783f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcSocietyOrgEntity.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 2021-11-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_society_org") +public class IcSocietyOrgEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织Id + */ + private String agencyId; + + /** + * agency_id的所有上级 + */ + private String pids; + + /** + * 社会组织名称 + */ + private String societyName; + + /** + * 服务事项 + */ + private String serviceMatters; + + /** + * 负责人 + */ + private String personInCharge; + + /** + * 负责人电话 + */ + private String mobile; + + /** + * 起始服务时间 + */ + private Date serviceStartTime; + + /** + * 终止服务时间 + */ + private Date serviceEndTime; + + /** + * 绑定管理员[组织下录入的工作人员] + */ + private String adminStaffId; + + /** + * 地址 + */ + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 维度 + */ + private String latitude; + + /** + * 备注 + */ + private String remarks; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandOperateLogEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandOperateLogEntity.java new file mode 100644 index 0000000000..9b6afa0aea --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandOperateLogEntity.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 2021-11-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_user_demand_operate_log") +public class IcUserDemandOperateLogEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 需求id + */ + private String demandRecId; + + /** + * 当前操作用户属于哪个端?工作端:staff;居民端:resi + */ + private String userType; + + /** + * 当前操作用户id + */ + private String userId; + + /** + * 创建需求:create;撤销需求:cancel;指派:assign;接单:take_order;完成:finish; + */ + private String actionCode; + + /** + * 操作时间 + */ + private Date operateTime; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandRecEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandRecEntity.java new file mode 100644 index 0000000000..5979d780ed --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandRecEntity.java @@ -0,0 +1,146 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 2021-11-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_user_demand_rec") +public class IcUserDemandRecEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 网格id + */ + private String gridId; + + /** + * 组织id + */ + private String agencyId; + + /** + * 网格的所有上级id + */ + private String gridPids; + + /** + * 二级需求分类编码 + */ + private String categoryCode; + + /** + * 父级需求分类编码 + */ + private String parentCode; + + /** + * 需求内容1000字 + */ + private String content; + + /** + * 社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help + */ + private String reportType; + + /** + * 上报人姓名 + */ + private String reportUserName; + + /** + * 上报人联系方式。自身上报时存储注册居民的手机号 + */ + private String reportUserMobile; + + /** + * 自身上报时存储居民端用户id + */ + private String reportUserId; + + /** + * 上报时间 + */ + private Date reportTime; + + /** + * 希望服务时间 + */ + private Date wantServiceTime; + + /** + * 小程序用户自己上报:mini_resi;居民信息录入的居民:ic_resi_user + */ + private String demandUserType; + + /** + * 需求人:user.id或者ic_resi_user.id + */ + private String demandUserId; + + /** + * 需求人姓名 + */ + private String demandUserName; + + /** + * 需求人联系电话 + */ + private String demandUserMobile; + + /** + * 待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished + */ + private String status; + + /** + * 完成结果:已解决 resolved,未解决 unresolved + + */ + private String finishResult; + + /** + * 取消时间 + */ + private Date cancelTime; + + /** + * 1:已评价;0:未评价;评价后ic_user_satisfaction表有记录 + */ + private Boolean evaluateFlag; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandSatisfactionEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandSatisfactionEntity.java new file mode 100644 index 0000000000..bae8aaaff0 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandSatisfactionEntity.java @@ -0,0 +1,72 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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.math.BigDecimal; +import java.util.Date; + +/** + * 居民需求评价记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_user_demand_satisfaction") +public class IcUserDemandSatisfactionEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 需求id + */ + private String demandRecId; + + /** + * 当前操作用户属于哪个端?工作端:staff;居民端:resi + */ + private String userType; + + /** + * 当前评价用户id,可以是小程序里用户id,也可以是工作端帮忙录入需求的人 + */ + private String userId; + + /** + * 评价时间 + */ + private Date evaluateTime; + + /** + * 得分可为半星 + */ + private BigDecimal score; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandServiceEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandServiceEntity.java new file mode 100644 index 0000000000..b2b95ec5d4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandServiceEntity.java @@ -0,0 +1,76 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 2021-11-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_user_demand_service") +public class IcUserDemandServiceEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 需求id + */ + private String demandRecId; + + /** + * 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + */ + private String serviceType; + + /** + * 志愿者:居民端爱心互助的志愿者userId; + */ + private String serverId; + + /** + * 实际服务开始时间 + */ + private Date serviceStartTime; + + /** + * 实际服务结束时间 + */ + private Date serviceEndTime; + + /** + * 完成情况 + */ + private String finishDesc; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ExportCommunitySelfOrganizationExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ExportCommunitySelfOrganizationExcel.java new file mode 100644 index 0000000000..d8020a3345 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ExportCommunitySelfOrganizationExcel.java @@ -0,0 +1,31 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.CellStyler; +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +@Data +public class ExportCommunitySelfOrganizationExcel { + + @Excel(name = "排序") + private Integer sort; + + @Excel(name = "组织名称", width = 40) + private String organizationName; + + @Excel(name = "组织人数", width = 20) + private Integer organizationPersonCount; + + @Excel(name = "负责人姓名", width = 20) + private String principalName; + + @Excel(name = "负责人电话", width = 20) + private String principalPhone; + + @Excel(name = "服务事项", width = 60) + private String serviceItem; + + @Excel(name = "社区自组织创建时间", width = 20) + private String organizationCreatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcCommunitySelfOrganizationExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcCommunitySelfOrganizationExcel.java new file mode 100644 index 0000000000..7310a47279 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcCommunitySelfOrganizationExcel.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 社区自组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcCommunitySelfOrganizationExcel { + + @Excel(name = "") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "组织ID") + private String orgId; + + @Excel(name = "组织类型,agency:组织,grid:网格") + private String orgType; + + @Excel(name = "组织ID的父级") + private String pid; + + @Excel(name = "org_id的所有上级") + private String pids; + + @Excel(name = "组织名称") + private String organizationName; + + @Excel(name = "组织人数") + private Integer organizationPersonCount; + + @Excel(name = "负责人姓名") + private String principalName; + + @Excel(name = "负责人电话") + private String principalPhone; + + @Excel(name = "服务事项") + private String serviceItem; + + @Excel(name = "社区自组织创建时间") + private Date organizationCreatedTime; + + @Excel(name = "经度") + private String longitude; + + @Excel(name = "纬度") + private String latitude; + + @Excel(name = "") + private Integer delFlag; + + @Excel(name = "乐观锁") + private String revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcCommunitySelfOrganizationPersonnelExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcCommunitySelfOrganizationPersonnelExcel.java new file mode 100644 index 0000000000..da9480bb66 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcCommunitySelfOrganizationPersonnelExcel.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 社区自组织人员表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcCommunitySelfOrganizationPersonnelExcel { + + @Excel(name = "") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "社区自组织ID") + private String orgId; + + @Excel(name = "人员姓名") + private String personName; + + @Excel(name = "人员电话") + private String personIphone; + + @Excel(name = "") + private Integer delFlag; + + @Excel(name = "乐观锁") + private String revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityExcel.java new file mode 100644 index 0000000000..c39b3f9147 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityExcel.java @@ -0,0 +1,53 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; + +/** + * 联建活动 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Data +public class IcPartyActivityExcel { + + @Excel(name = "序号") + private Integer index; + + @Excel(name = "单位名称") + private String unitName; + + @Excel(name = "活动标题") + private String title; + + @Excel(name = "活动地址") + private String address; + + @Excel(name = "服务人数") + private Integer peopleCount; + + @Excel(name = "活动时间") + private String activityTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityImportExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityImportExcel.java new file mode 100644 index 0000000000..6a2d4116ef --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityImportExcel.java @@ -0,0 +1,66 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.epmet.commons.tools.utils.ExcelVerifyInfo; +import lombok.Data; + +/** + * 联建活动 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Data +public class IcPartyActivityImportExcel extends ExcelVerifyInfo { + + @Excel(name = "单位名称") + private String unitName; + + @Excel(name = "服务事项") + private String serviceMatter; + + @Excel(name = "活动标题") + private String title; + + @Excel(name = "活动目标") + private String target; + + @Excel(name = "活动内容") + private String content; + + @Excel(name = "活动地址") + private String address; + + @Excel(name = "活动地址经度") + private String longitude; + + @Excel(name = "活动地址纬度") + private String latitude; + + @Excel(name = "服务人数") + private Integer peopleCount; + + @Excel(name = "活动时间") + private String activityTime; + + @Excel(name = "活动结果") + private String result; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitExcel.java new file mode 100644 index 0000000000..652542ef62 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitExcel.java @@ -0,0 +1,58 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +/** + * 联建单位 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Data +public class IcPartyUnitExcel { + + @Excel(name = "序号") + private Integer index; + + @Excel(name = "单位名称") + private String unitName; + + @Excel(name = "分类") + private String type; + + @Excel(name = "服务事项") + private String serviceMatter; + + @Excel(name = "联系人") + private String contact; + + @Excel(name = "联系电话") + private String contactMobile; + + @Excel(name = "在职党员") + private Integer memberCount; + + @Excel(name = "群众满意度") + private String satisfaction; + + @Excel(name = "备注") + private String remark; +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitImportExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitImportExcel.java new file mode 100644 index 0000000000..13e8f27c6a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitImportExcel.java @@ -0,0 +1,62 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.epmet.commons.tools.utils.ExcelVerifyInfo; +import lombok.Data; + +/** + * 联建单位 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Data +public class IcPartyUnitImportExcel extends ExcelVerifyInfo { + + @Excel(name = "单位名称") + private String unitName; + + @Excel(name = "分类") + private String type; + + @Excel(name = "服务事项") + private String serviceMatter; + + @Excel(name = "联系人") + private String contact; + + @Excel(name = "联系电话") + private String contactMobile; + + @Excel(name = "在职党员") + private Integer memberCount; + + @Excel(name = "地址") + private String address; + + @Excel(name = "中心位置经度") + private String longitude; + + @Excel(name = "中心位置纬度") + private String latitude; + + @Excel(name = "备注") + private String remark; +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcSocietyOrgExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcSocietyOrgExcel.java new file mode 100644 index 0000000000..35fff240d9 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcSocietyOrgExcel.java @@ -0,0 +1,83 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.epmet.commons.tools.utils.ExcelVerifyInfo; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + +/** + * 社会组织管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcSocietyOrgExcel extends ExcelVerifyInfo implements Serializable { + + @Excel(name = "组织名称") + @NotBlank(message = "不能为空") + private String agencyName; + + @Excel(name = "社会组织名称") + @NotBlank(message = "不能为空") + @Length(max=50,message = "不能超过50个字") + private String societyName; + + @Excel(name = "服务事项") + @NotBlank(message = "不能为空") + @Length(max=1000,message = "不能超过1000个字") + private String serviceMatters; + + @Excel(name = "负责人") + @NotBlank(message = "不能为空") + @Length(max=20,message = "不能超过20个字") + private String personInCharge; + + @Excel(name = "负责人电话") + @NotBlank(message = "不能为空") + @Length(max=11,message = "不能超过11个字") + private String mobile; + + @Excel(name = "起始服务时间") + @NotBlank(message = "不能为空") + private String serviceStartTime; + + @Excel(name = "终止服务时间") + @NotBlank(message = "不能为空") + private String serviceEndTime; + + @Excel(name = "管理员姓名") + private String adminStaffName; + + @Excel(name = "地址") + private String address; + + @Excel(name = "经度") + private String longitude; + + @Excel(name = "维度") + private String latitude; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ImportCommunitySelfOrganization.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ImportCommunitySelfOrganization.java new file mode 100644 index 0000000000..2a9995be2a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ImportCommunitySelfOrganization.java @@ -0,0 +1,40 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import cn.afterturn.easypoi.excel.annotation.ExcelCollection; +import com.epmet.commons.tools.utils.ExcelVerifyInfo; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/11/24 4:34 下午 + * @DESC + */ +@Data +public class ImportCommunitySelfOrganization extends ExcelVerifyInfo { + + @Excel(name = "组织名称", needMerge = true) + private String organizationName; + + @Excel(name = "组织人数", needMerge = true) + private Integer organizationPersonCount; + + @Excel(name = "服务事项", needMerge = true) + private String serviceItem; + + @Excel(name = "负责人", needMerge = true) + private String principalName; + + @Excel(name = "联系电话", needMerge = true) + private String principalPhone; + + @Excel(name = "创建时间", needMerge = true) + private Date organizationCreatedTime; + + @ExcelCollection(name = "组织成员") + private List persons; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ImportCommunitySelfOrganizationSon.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ImportCommunitySelfOrganizationSon.java new file mode 100644 index 0000000000..7fb44af70e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ImportCommunitySelfOrganizationSon.java @@ -0,0 +1,20 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +/** + * @Author zxc + * @DateTime 2021/11/24 4:46 下午 + * @DESC + */ +@Data +public class ImportCommunitySelfOrganizationSon { + + @Excel(name = "姓名") + private String personName; + + @Excel(name = "电话") + private String personPhone; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java new file mode 100644 index 0000000000..3f599eefc0 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java @@ -0,0 +1,31 @@ +package com.epmet.mq; + +import com.epmet.commons.rocketmq.constants.ConsomerGroupConstants; +import com.epmet.commons.rocketmq.constants.TopicConstants; +import com.epmet.commons.rocketmq.register.MQAbstractRegister; +import com.epmet.commons.rocketmq.register.MQConsumerProperties; +import com.epmet.mq.listener.PartyUnitSatisfactionCalEventListener; +import org.apache.rocketmq.common.protocol.heartbeat.MessageModel; +import org.springframework.stereotype.Component; + +/** + * @Description 如果rocketmq.enable=true,这里必须实现,且 实例化 + * @author wxz + * @date 2021.07.14 17:13:41 +*/ +@Component +public class RocketMQConsumerRegister extends MQAbstractRegister { + + @Override + public void registerAllListeners(String env, MQConsumerProperties consumerProperties) { + // 客户初始化监听器注册 + register(consumerProperties, + ConsomerGroupConstants.CAL_PARTY_UNIT_SATISFACTION, + MessageModel.CLUSTERING, + TopicConstants.CAL_PARTY_UNIT_SATISFACTION, + "*", + new PartyUnitSatisfactionCalEventListener()); + + // ...其他监听器类似 + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/listener/PartyUnitSatisfactionCalEventListener.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/listener/PartyUnitSatisfactionCalEventListener.java new file mode 100644 index 0000000000..b7c3abc938 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/listener/PartyUnitSatisfactionCalEventListener.java @@ -0,0 +1,104 @@ +package com.epmet.mq.listener; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.rocketmq.constants.MQUserPropertys; +import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO; +import com.epmet.commons.tools.distributedlock.DistributedLock; +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.utils.SpringContextUtils; +import com.epmet.service.IcPartyUnitService; +import org.apache.commons.lang.StringUtils; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; +import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; +import org.apache.rocketmq.common.message.MessageExt; +import org.redisson.api.RLock; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; +import java.util.concurrent.TimeUnit; + +/** + * @Description 计算区域化党建单位,群众满意度=分数相加➗ 需求的总个数。 + * @author wxz + * @date 2021.10.13 15:21:48 +*/ +public class PartyUnitSatisfactionCalEventListener implements MessageListenerConcurrently { + + private Logger logger = LoggerFactory.getLogger(getClass()); + + private RedisUtils redisUtils; + + @Override + public ConsumeConcurrentlyStatus consumeMessage(List msgs, ConsumeConcurrentlyContext context) { + + if (redisUtils == null) { + redisUtils = SpringContextUtils.getBean(RedisUtils.class); + } + + try { + msgs.forEach(msg -> consumeMessage(msg)); + } catch (Exception e) { + logger.error(ExceptionUtils.getErrorStackTrace(e)); + return ConsumeConcurrentlyStatus.RECONSUME_LATER; + } + return ConsumeConcurrentlyStatus.CONSUME_SUCCESS; + } + + private void consumeMessage(MessageExt messageExt) { + // msg即为消息体 + // tags为SystemMessageType.java中的项,为具体的操作,此处拿到tags,判断是创建还是变更,来做响应的后续操作即可 + String msg = new String(messageExt.getBody()); + String topic = messageExt.getTopic(); + String tags = messageExt.getTags(); + String pendingMsgLabel = messageExt.getUserProperty(MQUserPropertys.BLOCKED_MSG_LABEL); + + logger.info("【计算区域化党建单位群众满意度事件监听器】-需求完成-收到消息内容:{},操作:{}", msg, tags); + CalPartyUnitSatisfactionFormDTO obj = JSON.parseObject(msg, CalPartyUnitSatisfactionFormDTO.class); + + DistributedLock distributedLock = null; + RLock lock = null; + try { + distributedLock = SpringContextUtils.getBean(DistributedLock.class); + lock = distributedLock.getLock(String.format("lock:ic_warn_stats:%s", obj.getCustomerId()), + 30L, 30L, TimeUnit.SECONDS); + //待执行方法 + SpringContextUtils.getBean(IcPartyUnitService.class).calPartyUnitSatisfation(obj); + } catch (RenException e) { + // 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试 + logger.error("【计算区域化党建单位群众满意度事件监听器】-MQ失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + } catch (Exception e) { + // 不是我们自己抛出的异常,可以让MQ重试 + logger.error("【计算区域化党建单位群众满意度监听器】-MQ失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + throw e; + } finally { + distributedLock.unLock(lock); + } + + if (StringUtils.isNotBlank(pendingMsgLabel)) { + try { + removePendingMqMsgCache(pendingMsgLabel); + } catch (Exception e) { + logger.error("【计算区域化党建单位群众满意度监听器】-删除mq阻塞消息缓存失败:{}", ExceptionUtils.getErrorStackTrace(e)); + } + } + } + + /** + * @description + * + * @param pendingMsgLabel + * @return + * @author wxz + * @date 2021.10.14 16:32:32 + */ + private void removePendingMqMsgCache(String pendingMsgLabel) { + String key = RedisKeys.blockedMqMsgKey(pendingMsgLabel); + redisUtils.delete(key); + //logger.info("【开放数据事件监听器】删除mq阻塞消息缓存成功,blockedMsgLabel:{}", pendingMsgLabel); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/IcPartyActivityRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/IcPartyActivityRedis.java new file mode 100644 index 0000000000..c2ead1498b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/IcPartyActivityRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 联建活动 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Component +public class IcPartyActivityRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/IcPartyUnitRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/IcPartyUnitRedis.java new file mode 100644 index 0000000000..83113e7903 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/IcPartyUnitRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 联建单位 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Component +public class IcPartyUnitRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcCommunitySelfOrganizationPersonnelService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcCommunitySelfOrganizationPersonnelService.java new file mode 100644 index 0000000000..32d04687af --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcCommunitySelfOrganizationPersonnelService.java @@ -0,0 +1,103 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcCommunitySelfOrganizationPersonnelDTO; +import com.epmet.entity.IcCommunitySelfOrganizationPersonnelEntity; + +import java.util.List; +import java.util.Map; + +/** + * 社区自组织人员表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +public interface IcCommunitySelfOrganizationPersonnelService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-11-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-11-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcCommunitySelfOrganizationPersonnelDTO + * @author generator + * @date 2021-11-18 + */ + IcCommunitySelfOrganizationPersonnelDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-18 + */ + void save(IcCommunitySelfOrganizationPersonnelDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-18 + */ + void update(IcCommunitySelfOrganizationPersonnelDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-11-18 + */ + void delete(String[] ids); + + /** + * @Description 根据社区自组织ID删除 + * @param orgId + * @author zxc + * @date 2021/11/19 11:18 上午 + */ + void deleteByOrgId(String orgId); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcCommunitySelfOrganizationService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcCommunitySelfOrganizationService.java new file mode 100644 index 0000000000..4445d2f82b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcCommunitySelfOrganizationService.java @@ -0,0 +1,161 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.IcCommunitySelfOrganizationDTO; +import com.epmet.dto.form.AddCommunitySelfOrganizationFormDTO; +import com.epmet.dto.form.CommunitySelfOrganizationListFormDTO; +import com.epmet.dto.form.DelCommunitySelfOrganizationFormDTO; +import com.epmet.dto.form.EditCommunitySelfOrganizationFormDTO; +import com.epmet.dto.form.demand.ServiceQueryFormDTO; +import com.epmet.dto.result.CommunitySelfOrganizationListResultDTO; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.entity.IcCommunitySelfOrganizationEntity; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * 社区自组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +public interface IcCommunitySelfOrganizationService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-11-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-11-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcCommunitySelfOrganizationDTO + * @author generator + * @date 2021-11-18 + */ + IcCommunitySelfOrganizationDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-18 + */ + void save(IcCommunitySelfOrganizationDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-18 + */ + void update(IcCommunitySelfOrganizationDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-11-18 + */ + void delete(String[] ids); + + /** + * @Description 添加社区自组织 + * @param tokenDto + * @param formDTO + * @author zxc + * @date 2021/11/19 8:33 上午 + */ + void addCommunitySelfOrganization(TokenDto tokenDto, AddCommunitySelfOrganizationFormDTO formDTO); + + /** + * @Description 修改社区自组织 + * @param tokenDto + * @param formDTO + * @author zxc + * @date 2021/11/19 10:12 上午 + */ + void editCommunitySelfOrganization(TokenDto tokenDto, EditCommunitySelfOrganizationFormDTO formDTO); + + /** + * @Description 查询社区自组织列表 + * @param tokenDto + * @param formDTO + * @author zxc + * @date 2021/11/19 1:59 下午 + */ + CommunitySelfOrganizationListResultDTO communitySelfOrganizationList(TokenDto tokenDto, CommunitySelfOrganizationListFormDTO formDTO); + + /** + * @Description 社区自组织删除 + * @param formDTO + * @author zxc + * @date 2021/11/19 4:22 下午 + */ + void delCommunitySelfOrganization(DelCommunitySelfOrganizationFormDTO formDTO); + + + /** + * 需求指派,选择社区自组织,调用此接口 + * 返回需求所属社区下的 组织 + * + * @param formDTO + * @return + */ + List queryServiceList(ServiceQueryFormDTO formDTO); + + /** + * @Description 导入 + * @param tokenDto + * @param response + * @param file + * @author zxc + * @date 2021/11/25 9:03 上午 + */ + void importCommunitySelfOrganization(TokenDto tokenDto, HttpServletResponse response, MultipartFile file) throws IOException; +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java new file mode 100644 index 0000000000..dc0ca8b8a9 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +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.IcPartyActivityDTO; +import com.epmet.dto.form.PartyActivityFormDTO; +import com.epmet.entity.IcPartyActivityEntity; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; + +/** + * 联建活动 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +public interface IcPartyActivityService extends BaseService { + + /** + * 默认分页 + * + * @param formDTO + * @return PageData + * @author generator + * @date 2021-11-19 + */ + PageData search(PartyActivityFormDTO formDTO); + + /** + * 默认查询 + * + * @param formDTO + * @return java.util.List + * @author generator + * @date 2021-11-19 + */ + List list(PartyActivityFormDTO formDTO); + + /** + * 单条查询 + * + * @param id + * @return IcPartyActivityDTO + * @author generator + * @date 2021-11-19 + */ + IcPartyActivityDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-19 + */ + void save(TokenDto tokenDto, IcPartyActivityDTO dto); + + /** + * 批量删除 + * + * @param id + * @return void + * @author generator + * @date 2021-11-19 + */ + void delete(String id); + + /** + * 导入数据 + * @Param tokenDto + * @Param response + * @Param file + * @Return + * @Author zhaoqifeng + * @Date 2021/11/29 11:01 + */ + Result importData(TokenDto tokenDto, HttpServletResponse response, MultipartFile file) throws IOException; +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java new file mode 100644 index 0000000000..b303cab184 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java @@ -0,0 +1,130 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO; +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.IcPartyUnitDTO; +import com.epmet.dto.form.PartyUnitFormDTO; +import com.epmet.dto.form.demand.ServiceQueryFormDTO; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.entity.IcPartyUnitEntity; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; + +/** + * 联建单位 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +public interface IcPartyUnitService extends BaseService { + + /** + * 默认分页 + * + * @param formDTO + * @return PageData + * @author generator + * @date 2021-11-19 + */ + PageData search(PartyUnitFormDTO formDTO); + + /** + * 默认查询 + * + * @param formDTO + * @return java.util.List + * @author generator + * @date 2021-11-19 + */ + List list(PartyUnitFormDTO formDTO); + + /** + * 单条查询 + * + * @param id + * @return IcPartyUnitDTO + * @author generator + * @date 2021-11-19 + */ + IcPartyUnitDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-19 + */ + void save(TokenDto tokenDto, IcPartyUnitDTO dto); + + + /** + * 批量删除 + * + * @param id + * @return void + * @author generator + * @date 2021-11-19 + */ + void delete(String id); + + /** + * 需求指派,选择区域化党建单位,调用此接口 + * 返回需求所属组织线上的数据 + * + * @param formDTO + * @param formDTO + * @return + */ + List queryServiceList(ServiceQueryFormDTO formDTO); + + /** + * @Description 获取组织下单位列表 + * @Param dto + * @Return {@link List< OptionDTO>} + * @Author zhaoqifeng + * @Date 2021/11/22 14:35 + */ + List option(IcPartyUnitDTO dto); + + /** + * 导入数据 + * @Param tokenDto + * @Param response + * @Param file + * @Return + * @Author zhaoqifeng + * @Date 2021/11/29 11:01 + */ + Result importData(TokenDto tokenDto, HttpServletResponse response, MultipartFile file) throws IOException; + + /** + * 计算区域化党建单位的群众满意度 + * @param formDTO + */ + void calPartyUnitSatisfation(CalPartyUnitSatisfactionFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java index d41c4303ba..12cbaf7dad 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java @@ -21,12 +21,12 @@ 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.utils.Result; -import com.epmet.dto.IcResiDemandDictDTO; -import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO; +import com.epmet.dto.form.demand.*; +import com.epmet.dto.result.demand.DemandPageResDTO; +import com.epmet.dto.result.demand.OptionDTO; import com.epmet.entity.IcResiDemandDictEntity; import java.util.List; -import java.util.Map; /** * 居民需求字典表 @@ -39,52 +39,33 @@ public interface IcResiDemandDictService extends BaseService - * @author generator - * @date 2021-10-27 - */ - PageData page(Map params); - - /** - * 默认查询 - * - * @param params - * @return java.util.List + * @param formDTO * @author generator * @date 2021-10-27 */ - List list(Map params); + PageData page(DemandDictPageFormDTO formDTO); /** - * 单条查询 - * - * @param id - * @return IcResiDemandDictDTO - * @author generator - * @date 2021-10-27 + * 新增一级分类 + * @param formDTO */ - IcResiDemandDictDTO get(String id); + void addFirstCategory(AddFirstCategoryFormDTO formDTO); /** - * 默认保存 - * - * @param dto - * @return void - * @author generator - * @date 2021-10-27 + * 新增二级分类 + * @param formDTO */ - void save(IcResiDemandDictDTO dto); + void addChild(AddCategoryFormDTO formDTO); /** * 默认更新 * - * @param dto + * @param formDTO * @return void * @author generator * @date 2021-10-27 */ - void update(IcResiDemandDictDTO dto); + void update(UpdateFormDTO formDTO); /** * 批量删除 @@ -105,10 +86,37 @@ public interface IcResiDemandDictService extends BaseService getDemandOptions(String customerId); + List getDemandOptionsV2(DemandOptionFormDTO formDTO); /** * 居民信息列表需要展示分类名称,单独开出来这个接口,供user查询 * @param formDTO * @return */ Result queryDemandNames(UserDemandNameQueryFormDTO formDTO); + + List querySubCodeList(SubCodeFormDTO formDTO); + + /** + * 启用或禁用 + * + * @param formDTO + */ + void updateStatus(StatusFormDTO formDTO); + + /** + * 供服务措施管理,列表查询,显示需求类型名称用 + * @param customerId + * @param categoryCodes + * @return + */ + List listByCodes(String customerId, List categoryCodes); + + /** + * 查询当前分类的名称 + * + * @param customerId + * @param categoryCode + * @return + */ + String getCategoryName(String customerId, String categoryCode); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcSocietyOrgService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcSocietyOrgService.java new file mode 100644 index 0000000000..f2646de029 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcSocietyOrgService.java @@ -0,0 +1,78 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.form.AddSocietyOrgFormDTO; +import com.epmet.dto.form.EditSocietyOrgFormDTO; +import com.epmet.dto.form.GetListSocietyOrgFormDTO; +import com.epmet.dto.form.demand.ServiceQueryFormDTO; +import com.epmet.dto.result.GetListSocietyOrgResultDTO; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.entity.IcSocietyOrgEntity; +import com.epmet.excel.IcSocietyOrgExcel; + +import java.text.ParseException; +import java.util.List; + +/** + * 社会组织管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +public interface IcSocietyOrgService extends BaseService { + + /** + * @Author sun + * @Description 新增社会组织 + **/ + void add(AddSocietyOrgFormDTO dto); + + /** + * @Author sun + * @Description 修改社会组织 + **/ + void edit(EditSocietyOrgFormDTO formDTO); + + /** + * @Author sun + * @Description 删除社会组织 + **/ + void del(String societyId); + + /** + * @Author sun + * @Description 社会组织列表查询 + **/ + GetListSocietyOrgResultDTO getList(GetListSocietyOrgFormDTO formDTO); + + /** + * 需求指派,选择社会组织,调用此接口 + * @param formDTO + * @return + */ + List queryServiceList(ServiceQueryFormDTO formDTO); + + /** + * @Author sun + * @Description 九小场所下组织列表导入 + **/ + List importExcel(String customerId, List list, String staffId, List numList) throws ParseException; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java new file mode 100644 index 0000000000..87ffcaa67f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java @@ -0,0 +1,158 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcUserDemandRecDTO; +import com.epmet.dto.form.demand.*; +import com.epmet.dto.result.demand.DemandRecResultDTO; +import com.epmet.dto.result.demand.FinishResultDTO; +import com.epmet.dto.result.demand.IcResiUserReportDemandRes; +import com.epmet.dto.result.demand.ServiceStatDTO; +import com.epmet.entity.IcUserDemandRecEntity; + +import java.util.List; +import java.util.Map; + +/** + * 居民需求记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +public interface IcUserDemandRecService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-11-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-11-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcUserDemandRecDTO + * @author generator + * @date 2021-11-19 + */ + IcUserDemandRecDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-19 + */ + void save(IcUserDemandRecDTO dto); + + /** + * 更新需求 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-19 + */ + DemandRecId update(DemandAddFromDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-11-19 + */ + void delete(String[] ids); + + /** + * 新增需求 + * + * @param fromDTO + * @return + */ + DemandRecId add(DemandAddFromDTO fromDTO); + + PageData pageList(UserDemandPageFormDTO formDTO); + + /** + * 未完成之前都可以取消 + * + * @param formDTO + */ + void cancel(StaffCancelFormDTO formDTO); + + /** + * 指派 + * 待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished + * 待处理+已派单才可以指派 + * + * @param formDTO + * @return + */ + void assign(AssignFormDTO formDTO); + + /** + * 完成并评价 + * @param formDTO + */ + FinishResultDTO finish(FinishStaffFromDTO formDTO); + + /** + * 数据分析-个人档案,居民需求列表table + * + * @param formDTO + * @return + */ + PageData queryMyDemand(IcResiUserDemandFromDTO formDTO); + + /** + * 数据分析-个人档案、居民需求列表-查看需求详情 + * + * @param formDTO + * @return + */ + DemandRecResultDTO queryDemandDetail(DemandDetailFormDTO formDTO); + + /** + * 计算出服务方,评价总分,服务的需求个数 + * + * @param customerId + * @param partyUnitId + * @return + */ + List groupByPartyUnit(String customerId, String partyUnitId); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java index 53ac849cb8..850c4367de 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java @@ -24,6 +24,7 @@ import com.epmet.dto.VolunteerInfoDTO; import com.epmet.dto.form.CommonCustomerFormDTO; import com.epmet.dto.form.resi.ResiSendSmsCodeFormDTO; import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO; +import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.resi.ResiVolunteerInfoResultDTO; import com.epmet.entity.VolunteerInfoEntity; @@ -84,4 +85,13 @@ public interface VolunteerInfoService extends BaseService { * @return com.epmet.dto.VolunteerInfoDTO */ VolunteerInfoDTO queryUserVolunteerInfo(String userId); + + /** + * label: 张三(15764229697) + * value:userId + * + * @param customerId + * @return + */ + List queryListVolunteer(String customerId,String userRealName); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationPersonnelServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationPersonnelServiceImpl.java new file mode 100644 index 0000000000..15b759def7 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationPersonnelServiceImpl.java @@ -0,0 +1,112 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IcCommunitySelfOrganizationPersonnelDao; +import com.epmet.dto.IcCommunitySelfOrganizationPersonnelDTO; +import com.epmet.entity.IcCommunitySelfOrganizationPersonnelEntity; +import com.epmet.service.IcCommunitySelfOrganizationPersonnelService; +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; + +/** + * 社区自组织人员表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Service +public class IcCommunitySelfOrganizationPersonnelServiceImpl extends BaseServiceImpl implements IcCommunitySelfOrganizationPersonnelService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcCommunitySelfOrganizationPersonnelDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcCommunitySelfOrganizationPersonnelDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcCommunitySelfOrganizationPersonnelDTO get(String id) { + IcCommunitySelfOrganizationPersonnelEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcCommunitySelfOrganizationPersonnelDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcCommunitySelfOrganizationPersonnelDTO dto) { + IcCommunitySelfOrganizationPersonnelEntity entity = ConvertUtils.sourceToTarget(dto, IcCommunitySelfOrganizationPersonnelEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcCommunitySelfOrganizationPersonnelDTO dto) { + IcCommunitySelfOrganizationPersonnelEntity entity = ConvertUtils.sourceToTarget(dto, IcCommunitySelfOrganizationPersonnelEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Description 根据社区自组织ID删除 + * @param orgId + * @author zxc + * @date 2021/11/19 11:19 上午 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void deleteByOrgId(String orgId) { + baseDao.deleteByOrgId(orgId); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java new file mode 100644 index 0000000000..cde9814019 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java @@ -0,0 +1,402 @@ +package com.epmet.service.impl; + +import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; +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.entity.BaseEpmetEntity; +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.constant.StrConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetErrorCode; +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.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; +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.ExcelPoiUtils; +import com.epmet.constant.IcCommunitySelfOrganizationConstant; +import com.epmet.dao.IcCommunitySelfOrganizationDao; +import com.epmet.dto.IcCommunitySelfOrganizationDTO; +import com.epmet.dto.form.AddCommunitySelfOrganizationFormDTO; +import com.epmet.dto.form.CommunitySelfOrganizationListFormDTO; +import com.epmet.dto.form.DelCommunitySelfOrganizationFormDTO; +import com.epmet.dto.form.EditCommunitySelfOrganizationFormDTO; +import com.epmet.dto.form.demand.ServiceQueryFormDTO; +import com.epmet.dto.result.CommunitySelfOrganizationListDTO; +import com.epmet.dto.result.CommunitySelfOrganizationListResultDTO; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.entity.IcCommunitySelfOrganizationEntity; +import com.epmet.entity.IcCommunitySelfOrganizationPersonnelEntity; +import com.epmet.excel.ImportCommunitySelfOrganization; +import com.epmet.service.IcCommunitySelfOrganizationPersonnelService; +import com.epmet.service.IcCommunitySelfOrganizationService; +import com.epmet.service.IcUserDemandRecService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.*; +import java.util.concurrent.atomic.AtomicReference; +import java.util.stream.Collectors; + +import static com.epmet.commons.tools.utils.DateUtils.DATE_PATTERN; + +/** + * 社区自组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Service +public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl implements IcCommunitySelfOrganizationService { + + @Autowired + private IcCommunitySelfOrganizationPersonnelService personnelService; + @Autowired + private IcUserDemandRecService icUserDemandRecService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcCommunitySelfOrganizationDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcCommunitySelfOrganizationDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcCommunitySelfOrganizationDTO get(String id) { + IcCommunitySelfOrganizationEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcCommunitySelfOrganizationDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcCommunitySelfOrganizationDTO dto) { + IcCommunitySelfOrganizationEntity entity = ConvertUtils.sourceToTarget(dto, IcCommunitySelfOrganizationEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcCommunitySelfOrganizationDTO dto) { + IcCommunitySelfOrganizationEntity entity = ConvertUtils.sourceToTarget(dto, IcCommunitySelfOrganizationEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Description 添加社区自组织 + * @param tokenDto + * @param formDTO + * @author zxc + * @date 2021/11/19 8:33 上午 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void addCommunitySelfOrganization(TokenDto tokenDto, AddCommunitySelfOrganizationFormDTO formDTO) { + String customerId = tokenDto.getCustomerId(); + LambdaQueryWrapper l = new LambdaQueryWrapper<>(); + l.eq(IcCommunitySelfOrganizationEntity::getOrganizationName,formDTO.getOrganizationName()) + .eq(IcCommunitySelfOrganizationEntity::getCustomerId,customerId) + .eq(BaseEpmetEntity::getDelFlag, NumConstant.ZERO); + IcCommunitySelfOrganizationEntity record = baseDao.selectOne(l); + if (null != record){ + throw new RenException(EpmetErrorCode.COMMUNITY_SELF_ORGANIZATION_REPART_ERROR.getCode()); + } + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, tokenDto.getUserId()); + if (null == staffInfo){ + throw new RenException(String.format("查询人员{%s}信息失败",tokenDto.getUserId())); + } + IcCommunitySelfOrganizationEntity orgEntity = ConvertUtils.sourceToTarget(formDTO, IcCommunitySelfOrganizationEntity.class); + orgEntity.setCustomerId(customerId); + orgEntity.setOrgId(staffInfo.getAgencyId()); + orgEntity.setOrgType(IcCommunitySelfOrganizationConstant.ORG_TYPE_AGENCY); + orgEntity.setOrganizationCreatedTime(DateUtils.parse(formDTO.getOrganizationCreatedTime(), DATE_PATTERN)); + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId()); + if (null == agencyInfo){ + throw new RenException(String.format("查询组织信息失败%s",staffInfo.getAgencyId())); + } + orgEntity.setPid(agencyInfo.getPid()); + orgEntity.setPids(agencyInfo.getPids()); + // 保持时间统一 + if (null == formDTO.getOrganizationCreatedTime()){ + Date date = new Date(); + orgEntity.setOrganizationCreatedTime(date); + orgEntity.setCreatedTime(date); + orgEntity.setUpdatedTime(date); + } + baseDao.insert(orgEntity); + if(CollectionUtils.isNotEmpty(formDTO.getOrganizationPersonnel())){ + List persons = ConvertUtils.sourceToTarget(formDTO.getOrganizationPersonnel(), IcCommunitySelfOrganizationPersonnelEntity.class); + Map> groupPhone = persons.stream().collect(Collectors.groupingBy(IcCommunitySelfOrganizationPersonnelEntity::getPersonPhone)); + List phones = new ArrayList<>(); + groupPhone.forEach((k,v) -> { + if (v.size() > NumConstant.ONE){ + phones.add(k); + } + }); + if (CollectionUtils.isNotEmpty(phones)){ + StringBuffer sb = new StringBuffer(); + phones.forEach(p -> { + sb.append(p).append(","); + }); + String copywriter = sb.toString().substring(NumConstant.ZERO, sb.length() - NumConstant.ONE); + EpmetErrorCode.EXISTS_SAME_PHONE_ERROR.setMsg(String.format(EpmetErrorCode.EXISTS_SAME_PHONE_ERROR.getMsg(),copywriter)); + throw new RenException(EpmetErrorCode.EXISTS_SAME_PHONE_ERROR.getCode()); + } + persons.forEach(p -> { + p.setCustomerId(customerId); + p.setOrgId(orgEntity.getId()); + }); + personnelService.insertBatch(persons); + } + } + + /** + * @Description 修改社区自组织 + * 社区自组织人员为全删全增 + * @param tokenDto + * @param formDTO + * @author zxc + * @date 2021/11/19 10:12 上午 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void editCommunitySelfOrganization(TokenDto tokenDto, EditCommunitySelfOrganizationFormDTO formDTO) { + LambdaQueryWrapper l = new LambdaQueryWrapper<>(); + l.eq(IcCommunitySelfOrganizationEntity::getOrganizationName,formDTO.getOrganizationName()) + .eq(IcCommunitySelfOrganizationEntity::getCustomerId,tokenDto.getCustomerId()) + .eq(BaseEpmetEntity::getDelFlag, NumConstant.ZERO) + .ne(BaseEpmetEntity::getId,formDTO.getOrgId()); + IcCommunitySelfOrganizationEntity record = baseDao.selectOne(l); + if (null != record){ + throw new RenException(EpmetErrorCode.COMMUNITY_SELF_ORGANIZATION_REPART_ERROR.getCode()); + } + IcCommunitySelfOrganizationEntity e = ConvertUtils.sourceToTarget(formDTO, IcCommunitySelfOrganizationEntity.class); + e.setOrganizationCreatedTime(DateUtils.stringToDate(formDTO.getOrganizationCreatedTime(),DATE_PATTERN)); + e.setUpdatedBy(tokenDto.getUserId()); + baseDao.updateCommunitySelfOrganization(e); + personnelService.deleteByOrgId(formDTO.getOrgId()); + if (CollectionUtils.isNotEmpty(formDTO.getOrganizationPersonnel())){ + List persons = ConvertUtils.sourceToTarget(formDTO.getOrganizationPersonnel(), IcCommunitySelfOrganizationPersonnelEntity.class); + Map> groupPhone = persons.stream().collect(Collectors.groupingBy(IcCommunitySelfOrganizationPersonnelEntity::getPersonPhone)); + List phones = new ArrayList<>(); + groupPhone.forEach((k,v) -> { + if (v.size() > NumConstant.ONE){ + phones.add(k); + } + }); + if (CollectionUtils.isNotEmpty(phones)){ + StringBuffer sb = new StringBuffer(); + phones.forEach(p -> { + sb.append(p).append(","); + }); + String copywriter = sb.toString().substring(NumConstant.ZERO, sb.length() - NumConstant.ONE); + EpmetErrorCode.EXISTS_SAME_PHONE_ERROR.setMsg(String.format(EpmetErrorCode.EXISTS_SAME_PHONE_ERROR.getMsg(),copywriter)); + throw new RenException(EpmetErrorCode.EXISTS_SAME_PHONE_ERROR.getCode()); + } + persons.forEach(p -> { + p.setOrgId(formDTO.getOrgId()); + p.setCustomerId(tokenDto.getCustomerId()); + }); + personnelService.insertBatch(persons); + } + } + + /** + * @Description 查询社区自组织列表 + * @param tokenDto + * @param formDTO + * @author zxc + * @date 2021/11/19 1:59 下午 + */ + @Override + public CommunitySelfOrganizationListResultDTO communitySelfOrganizationList(TokenDto tokenDto, CommunitySelfOrganizationListFormDTO formDTO) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + if (null == staffInfo){ + throw new RenException(String.format("查询人员{%s}信息失败",tokenDto.getUserId())); + } + formDTO.setAgencyId(staffInfo.getAgencyId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + final int[] i = {(formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize() + NumConstant.ONE}; + CommunitySelfOrganizationListResultDTO result = new CommunitySelfOrganizationListResultDTO(); + if (formDTO.getIsPage()){ + PageInfo objectPageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectCommunitySelfOrganizationList(formDTO)); + result.setTotal(Integer.valueOf(String.valueOf(objectPageInfo.getTotal()))); + if (CollectionUtils.isNotEmpty(objectPageInfo.getList())){ + objectPageInfo.getList().forEach(l -> { + l.setSort(i[NumConstant.ZERO]); + i[NumConstant.ZERO]++; + }); + result.setList(objectPageInfo.getList()); + } + return result; + } + List resultDTOs = baseDao.selectCommunitySelfOrganizationList(formDTO); + if (CollectionUtils.isNotEmpty(resultDTOs)){ + result.setTotal(resultDTOs.size()); + AtomicReference sort = new AtomicReference<>(NumConstant.ONE); + resultDTOs.forEach(r -> { + r.setSort(sort.getAndSet(sort.get() + NumConstant.ONE)); + }); + result.setList(resultDTOs); + } + return result; + } + + /** + * @Description 社区自组织删除 + * 社区自组织表逻辑删,社区自组织人员表物理删 + * @param formDTO + * @author zxc + * @date 2021/11/19 4:22 下午 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void delCommunitySelfOrganization(DelCommunitySelfOrganizationFormDTO formDTO) { + baseDao.deleteById(formDTO.getOrgId()); + personnelService.deleteByOrgId(formDTO.getOrgId()); + } + + /** + * 需求指派,选择社区自组织,调用此接口 + * 返回需求所属社区下的 组织 + * + * @param formDTO + * @return + */ + @Override + public List queryServiceList(ServiceQueryFormDTO formDTO) { + List resultList=new ArrayList<>(); + CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + if (null == staffInfoCacheResult || StringUtils.isBlank(staffInfoCacheResult.getAgencyId())) { + throw new RenException("工作人员所属组织信息查询异常"); + } + List agencyIds=new ArrayList<>(); + if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) { + if(staffInfoCacheResult.getAgencyPIds().contains(StrConstant.COLON)){ + agencyIds.addAll(Arrays.asList(staffInfoCacheResult.getAgencyPIds().split(StrConstant.COLON))); + }else{ + //当前用户属于第二级组织的人,不会有: + agencyIds.add(staffInfoCacheResult.getAgencyPIds()); + } + } + agencyIds.add(staffInfoCacheResult.getAgencyId()); + resultList=baseDao.selectListByAgencyId(formDTO.getCustomerId(),agencyIds,formDTO.getServiceName()); + return resultList; + } + + /** + * @Description 导入 + * @param tokenDto + * @param response + * @param file + * @author zxc + * @date 2021/11/25 9:03 上午 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void importCommunitySelfOrganization(TokenDto tokenDto, HttpServletResponse response, MultipartFile file) throws IOException { + ExcelImportResult testExcelImportResult = ExcelPoiUtils.importExcelMore(file, 0, 2, ImportCommunitySelfOrganization.class); + List list = testExcelImportResult.getList(); + if (CollectionUtils.isNotEmpty(list)){ + String customerId = tokenDto.getCustomerId(); + List existsNames = baseDao.selectOrgByOrgName(list.stream().map(ImportCommunitySelfOrganization::getOrganizationName).collect(Collectors.toList()), customerId); + Map> groupByName = list.stream().collect(Collectors.groupingBy(ImportCommunitySelfOrganization::getOrganizationName)); + groupByName.forEach((k,v) -> { + if (v.size() > NumConstant.ONE){ + existsNames.add(k); + } + }); + List repeatName = existsNames.stream().distinct().collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(repeatName)){ + StringBuffer sb = new StringBuffer(); + repeatName.forEach(p -> { + sb.append(p).append(","); + }); + String copywriter = sb.toString().substring(NumConstant.ZERO, sb.length() - NumConstant.ONE); + EpmetErrorCode.COMMUNITY_SELF_ORGANIZATION_LIST_REPART_ERROR.setMsg(String.format(EpmetErrorCode.COMMUNITY_SELF_ORGANIZATION_LIST_REPART_ERROR.getMsg(),copywriter)); + throw new RenException(EpmetErrorCode.COMMUNITY_SELF_ORGANIZATION_LIST_REPART_ERROR.getCode()); + } + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, tokenDto.getUserId()); + if (null == staffInfo){ + throw new RenException(String.format("查询人员{%s}信息失败",tokenDto.getUserId())); + } + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId()); + if (null == agencyInfo){ + throw new RenException(String.format("查询组织信息失败%s",staffInfo.getAgencyId())); + } + list.forEach(l -> { + IcCommunitySelfOrganizationEntity e = ConvertUtils.sourceToTarget(l, IcCommunitySelfOrganizationEntity.class); + e.setCustomerId(customerId); + e.setOrgId(staffInfo.getAgencyId()); + e.setOrgType(IcCommunitySelfOrganizationConstant.ORG_TYPE_AGENCY); + e.setPid(agencyInfo.getPid()); + e.setPids(agencyInfo.getPids()); + e.setOrganizationCreatedTime(l.getOrganizationCreatedTime()); + baseDao.insert(e); + if (CollectionUtils.isNotEmpty(l.getPersons())){ + List persons = ConvertUtils.sourceToTarget(l.getPersons(), IcCommunitySelfOrganizationPersonnelEntity.class); + Map> groupByPhone = persons.stream().collect(Collectors.groupingBy(IcCommunitySelfOrganizationPersonnelEntity::getPersonPhone)); + List phones = new ArrayList<>(); + groupByPhone.forEach((k,v) -> { + if (v.size() > NumConstant.ONE){ + phones.add(k); + } + }); + if (CollectionUtils.isNotEmpty(phones)){ + StringBuffer sb = new StringBuffer(); + phones.forEach(p -> { + sb.append(p).append(","); + }); + String copywriter = sb.toString().substring(NumConstant.ZERO, sb.length() - NumConstant.ONE); + EpmetErrorCode.EXISTS_SAME_PHONE_ERROR.setMsg(String.format(EpmetErrorCode.EXISTS_SAME_PHONE_ERROR.getMsg(),copywriter)); + throw new RenException(EpmetErrorCode.EXISTS_SAME_PHONE_ERROR.getCode()); + } + persons.forEach(p -> { + p.setCustomerId(customerId); + p.setOrgId(e.getId()); + }); + personnelService.insertBatch(persons); + } + }); + } + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java new file mode 100644 index 0000000000..213dacc377 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java @@ -0,0 +1,290 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +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.dto.result.CustomerStaffInfoCacheResult; +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.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.ExcelPoiUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.IcPartyActivityDao; +import com.epmet.dto.IcPartyActivityDTO; +import com.epmet.dto.IcPartyUnitDTO; +import com.epmet.dto.form.PartyActivityFormDTO; +import com.epmet.dto.form.demand.SubCodeFormDTO; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.entity.IcPartyActivityEntity; +import com.epmet.excel.IcPartyActivityImportExcel; +import com.epmet.service.IcPartyActivityService; +import com.epmet.service.IcPartyUnitService; +import com.epmet.service.IcResiDemandDictService; +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.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 联建活动 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Slf4j +@Service +public class IcPartyActivityServiceImpl extends BaseServiceImpl implements IcPartyActivityService { + + @Resource + private IcPartyUnitService icPartyUnitService; + @Resource + private IcResiDemandDictService icResiDemandDictService; + + @Override + public PageData search(PartyActivityFormDTO formDTO) { + if (null == formDTO.getStartTime()) { + Date startDate = DateUtils.parse("1900-01-01 00:00:00", DateUtils.DATE_TIME_PATTERN); + formDTO.setStartTime(startDate); + } + if (null == formDTO.getEndTime()) { + Date endDate = DateUtils.parse("2099-12-31 00:00:00", DateUtils.DATE_TIME_PATTERN); + formDTO.setEndTime(endDate); + } + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPartyActivityEntity::getAgencyId, formDTO.getAgencyId()); + wrapper.eq(StringUtils.isNotBlank(formDTO.getUnitId()), IcPartyActivityEntity::getUnitId, formDTO.getUnitId()); + wrapper.eq(StringUtils.isNotBlank(formDTO.getServiceMatter()), IcPartyActivityEntity::getServiceMatter, formDTO.getServiceMatter()); + wrapper.like(StringUtils.isNotBlank(formDTO.getTitle()), IcPartyActivityEntity::getTitle, formDTO.getTitle()); + wrapper.between(IcPartyActivityEntity::getActivityTime, formDTO.getStartTime(), formDTO.getEndTime()); + wrapper.orderByDesc(IcPartyActivityEntity::getUpdatedTime); + List list = baseDao.selectList(wrapper); + List dtoList = ConvertUtils.sourceToTarget(list, IcPartyActivityDTO.class); + + IcPartyUnitDTO unitDTO = new IcPartyUnitDTO(); + unitDTO.setAgencyId(formDTO.getAgencyId()); + if (CollectionUtils.isNotEmpty(dtoList)) { + Map option = icPartyUnitService.option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + dtoList.forEach(dto -> { + dto.setUnitName(option.get(dto.getUnitId())); + }); + } + PageInfo pageInfo = new PageInfo<>(dtoList); + return new PageData<>(dtoList, pageInfo.getTotal()); + } + + @Override + public List list(PartyActivityFormDTO formDTO) { + if (null == formDTO.getStartTime()) { + Date startDate = DateUtils.parse("1900-01-01 00:00:00", DateUtils.DATE_TIME_PATTERN); + formDTO.setStartTime(startDate); + } + if (null == formDTO.getEndTime()) { + Date endDate = DateUtils.parse("2099-12-31 00:00:00", DateUtils.DATE_TIME_PATTERN); + formDTO.setEndTime(endDate); + } + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPartyActivityEntity::getAgencyId, formDTO.getAgencyId()); + wrapper.eq(StringUtils.isNotBlank(formDTO.getUnitId()), IcPartyActivityEntity::getUnitId, formDTO.getUnitId()); + wrapper.eq(StringUtils.isNotBlank(formDTO.getServiceMatter()), IcPartyActivityEntity::getServiceMatter, formDTO.getServiceMatter()); + wrapper.like(StringUtils.isNotBlank(formDTO.getTitle()), IcPartyActivityEntity::getTitle, formDTO.getTitle()); + wrapper.between(IcPartyActivityEntity::getActivityTime, formDTO.getStartTime(), formDTO.getEndTime()); + wrapper.orderByDesc(IcPartyActivityEntity::getUpdatedTime); + List list = baseDao.selectList(wrapper); + List dtoList = ConvertUtils.sourceToTarget(list, IcPartyActivityDTO.class); + + IcPartyUnitDTO unitDTO = new IcPartyUnitDTO(); + unitDTO.setAgencyId(formDTO.getAgencyId()); + if (CollectionUtils.isNotEmpty(dtoList)) { + Map option = icPartyUnitService.option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + dtoList.forEach(dto -> { + dto.setUnitName(option.get(dto.getUnitId())); + }); + } + + return dtoList; + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcPartyActivityDTO get(String id) { + IcPartyActivityEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcPartyActivityDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(TokenDto tokenDto, IcPartyActivityDTO dto) { + IcPartyActivityEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyActivityEntity.class); + CustomerStaffInfoCacheResult staff = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + entity.setCustomerId(tokenDto.getCustomerId()); + entity.setAgencyId(staff.getAgencyId()); + entity.setPids(staff.getAgencyPIds()); + if(StringUtils.isBlank(entity.getId())) { + insert(entity); + } else { + updateById(entity); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String id) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteById(id); + } + + /** + * 导入数据 + * + * @param tokenDto + * @param response + * @param file + * @Param tokenDto + * @Param response + * @Param file + * @Return + * @Author zhaoqifeng + * @Date 2021/11/29 11:01 + */ + @Override + public Result importData(TokenDto tokenDto, HttpServletResponse response, MultipartFile file) throws IOException { + ExcelImportResult importResult = ExcelPoiUtils.importExcelMore(file, 0, 1, IcPartyActivityImportExcel.class); + List failList = importResult.getFailList(); + //存放错误数据行号 + List numList = new ArrayList<>(); + if (!org.springframework.util.CollectionUtils.isEmpty(failList)) { + for (IcPartyActivityImportExcel entity : failList) { + //打印失败的行 和失败的信息 + log.warn("第{}行,{}", entity.getRowNum(), entity.getErrorMsg()); + numList.add(entity.getRowNum()); + } + } + List result = importResult.getList(); + + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + //获取服务事项 + SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); + codeFormDTO.setCustomerId(tokenDto.getCustomerId()); + codeFormDTO.setParentCategoryCode("1010"); + Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getLabel, OptionDTO::getValue)); + //获取联建单位 + IcPartyUnitDTO unitDTO = new IcPartyUnitDTO(); + unitDTO.setAgencyId(staffInfoCache.getAgencyId()); + Map option = icPartyUnitService.option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getLabel, OptionDTO::getValue)); + + //1.数据校验 + Iterator iterator = result.iterator(); + while (iterator.hasNext()) { + IcPartyActivityImportExcel obj = iterator.next(); + //单位名称校验 + if (StringUtils.isBlank(obj.getUnitName())) { + numList.add(obj.getRowNum()); + log.warn(String.format("单位名称为空,行号->%s", obj.getRowNum())); + iterator.remove(); + } else if (null == option.get(obj.getUnitName())){ + numList.add(obj.getRowNum()); + log.warn(String.format("单位名称不存在,行号->%s", obj.getRowNum())); + iterator.remove(); + } + //服务事项校验 + if (StringUtils.isBlank(obj.getServiceMatter())) { + numList.add(obj.getRowNum()); + log.warn(String.format("服务事项为空,行号->%s", obj.getRowNum())); + iterator.remove(); + } else if (null == categoryMap.get(obj.getServiceMatter())){ + numList.add(obj.getRowNum()); + log.warn(String.format("服务事项不存在,行号->%s", obj.getRowNum())); + iterator.remove(); + } + //活动标题 活动目标 活动内容 活动时间 活动地址 活动地址经度 活动地址纬度 活动结果 + if(StringUtils.isBlank(obj.getTitle()) || StringUtils.isBlank(obj.getTarget()) || + StringUtils.isBlank(obj.getContent()) || + StringUtils.isBlank(obj.getActivityTime()) || + StringUtils.isBlank(obj.getAddress()) || + StringUtils.isBlank(obj.getLatitude()) || + StringUtils.isBlank(obj.getLongitude()) || + StringUtils.isBlank(obj.getResult())) { + numList.add(obj.getRowNum()); + log.warn(String.format("活动标题、活动目标、活动内容、活动时间、活动地址、活动地址经度、活动地址纬度、活动结果为空,行号->%s", obj.getRowNum())); + iterator.remove(); + } + } + if (CollectionUtils.isEmpty(result)) { + Collections.sort(numList); + String subList = numList.stream().map(String::valueOf).collect(Collectors.joining("、")); + return new Result().error(9999, "第" + subList + "行未成功!"); + } + + List list = result.stream().map(item -> { + IcPartyActivityEntity entity = new IcPartyActivityEntity(); + entity.setCustomerId(tokenDto.getCustomerId()); + entity.setAgencyId(staffInfoCache.getAgencyId()); + entity.setPids(staffInfoCache.getAgencyPIds()); + entity.setTitle(item.getTitle()); + entity.setTarget(item.getTarget()); + entity.setContent(item.getContent()); + entity.setUnitId(option.get(item.getUnitName())); + entity.setServiceMatter(categoryMap.get(item.getServiceMatter())); + entity.setPeopleCount(item.getPeopleCount()); + entity.setActivityTime(DateUtils.parse(item.getActivityTime(), DateUtils.DATE_TIME_PATTERN)); + entity.setAddress(item.getAddress()); + entity.setLatitude(item.getLatitude()); + entity.setLongitude(item.getLongitude()); + entity.setResult(item.getResult()); + return entity; + }).collect(Collectors.toList()); + + insertBatch(list); + + String str = String.format("共%s条,成功导入%s条。", numList.size() + result.size(), numList.size() + result.size() - numList.size()); + if (numList.size() > NumConstant.ZERO) { + Collections.sort(numList); + String subList = numList.stream().map(String::valueOf).collect(Collectors.joining("、")); + log.warn(str + "第" + subList + "行未成功!"); + return new Result().error(9999, str + "第" + subList + "行未成功!"); + } + return new Result().ok(str); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java new file mode 100644 index 0000000000..5b49e3a276 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java @@ -0,0 +1,405 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO; +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.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.enums.DictTypeEnum; +import com.epmet.commons.tools.enums.PartyUnitTypeEnum; +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.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.ExcelPoiUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.IcPartyUnitDao; +import com.epmet.dto.IcPartyUnitDTO; +import com.epmet.dto.form.PartyUnitFormDTO; +import com.epmet.dto.form.demand.ServiceQueryFormDTO; +import com.epmet.dto.form.demand.SubCodeFormDTO; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.dto.result.demand.ServiceStatDTO; +import com.epmet.entity.IcPartyUnitEntity; +import com.epmet.excel.IcPartyUnitImportExcel; +import com.epmet.feign.EpmetAdminOpenFeignClient; +import com.epmet.service.IcPartyUnitService; +import com.epmet.service.IcResiDemandDictService; +import com.epmet.service.IcUserDemandRecService; +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.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 联建单位 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Slf4j +@Service +public class IcPartyUnitServiceImpl extends BaseServiceImpl implements IcPartyUnitService { + + @Resource + private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient; + @Resource + private IcUserDemandRecService icUserDemandRecService; + @Resource + private IcResiDemandDictService icResiDemandDictService; + + + @Override + public PageData search(PartyUnitFormDTO formDTO) { + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPartyUnitEntity::getAgencyId, formDTO.getAgencyId()); + wrapper.like(StringUtils.isNotBlank(formDTO.getUnitName()), IcPartyUnitEntity::getUnitName, formDTO.getUnitName()); + wrapper.like(StringUtils.isNotBlank(formDTO.getServiceMatter()), IcPartyUnitEntity::getServiceMatter, formDTO.getServiceMatter()); + wrapper.eq(StringUtils.isNotBlank(formDTO.getType()), IcPartyUnitEntity::getType, formDTO.getType()); + wrapper.like(StringUtils.isNotBlank(formDTO.getContact()), IcPartyUnitEntity::getContact, formDTO.getContact()); + wrapper.like(StringUtils.isNotBlank(formDTO.getContactMobile()), IcPartyUnitEntity::getContactMobile, formDTO.getContactMobile()); + wrapper.orderByDesc(IcPartyUnitEntity::getUpdatedTime); + List list = baseDao.selectList(wrapper); + List dtoList = ConvertUtils.sourceToTarget(list, IcPartyUnitDTO.class); + Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); + SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); + codeFormDTO.setCustomerId(formDTO.getCustomerId()); + codeFormDTO.setParentCategoryCode("1010"); + Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + dtoList.forEach(item -> { + item.setType(unitTypeMap.getData().get(item.getType())); + if (StringUtils.isNotBlank(item.getServiceMatter())) { + List matters = Arrays.asList(item.getServiceMatter().split(StrConstant.COMMA)); + item.setServiceMatterList(matters.stream().map(categoryMap::get).collect(Collectors.toList())); + } else { + item.setServiceMatterList(new ArrayList<>()); + } + if(StringUtils.isBlank(item.getSatisfaction())){ + item.setSatisfaction(StrConstant.HYPHEN); + }else{ + item.setSatisfaction(new BigDecimal(item.getSatisfaction()).setScale(2,BigDecimal.ROUND_HALF_UP).toString()); + } + }); + PageInfo pageInfo = new PageInfo<>(dtoList); + return new PageData<>(dtoList, pageInfo.getTotal()); + } + + @Override + public List list(PartyUnitFormDTO formDTO) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPartyUnitEntity::getAgencyId, formDTO.getAgencyId()); + wrapper.like(StringUtils.isNotBlank(formDTO.getUnitName()), IcPartyUnitEntity::getUnitName, formDTO.getUnitName()); + wrapper.like(StringUtils.isNotBlank(formDTO.getServiceMatter()), IcPartyUnitEntity::getServiceMatter, formDTO.getServiceMatter()); + wrapper.eq(StringUtils.isNotBlank(formDTO.getType()), IcPartyUnitEntity::getType, formDTO.getType()); + wrapper.like(StringUtils.isNotBlank(formDTO.getContact()), IcPartyUnitEntity::getContact, formDTO.getContact()); + wrapper.like(StringUtils.isNotBlank(formDTO.getContactMobile()), IcPartyUnitEntity::getContactMobile, formDTO.getContactMobile()); + wrapper.orderByDesc(IcPartyUnitEntity::getUpdatedTime); + List list = baseDao.selectList(wrapper); + List dtoList = ConvertUtils.sourceToTarget(list, IcPartyUnitDTO.class); + Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); + SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); + codeFormDTO.setCustomerId(formDTO.getCustomerId()); + codeFormDTO.setParentCategoryCode("1010"); + Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + dtoList.forEach(item -> { + item.setType(unitTypeMap.getData().get(item.getType())); + if (StringUtils.isNotBlank(item.getServiceMatter())) { + List matters = Arrays.asList(item.getServiceMatter().split(StrConstant.COMMA)); + item.setServiceMatterList(matters.stream().map(categoryMap::get).collect(Collectors.toList())); + } else { + item.setServiceMatterList(new ArrayList<>()); + } + }); + return dtoList; + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcPartyUnitDTO get(String id) { + IcPartyUnitEntity entity = baseDao.selectById(id); + IcPartyUnitDTO dto = ConvertUtils.sourceToTarget(entity, IcPartyUnitDTO.class); + if (StringUtils.isNotBlank(dto.getServiceMatter())) { + dto.setServiceMatterList(Arrays.asList(dto.getServiceMatter().split(StrConstant.COMMA))); + } + return dto; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(TokenDto tokenDto, IcPartyUnitDTO dto) { + IcPartyUnitEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyUnitEntity.class); + CustomerStaffInfoCacheResult staff = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + entity.setAgencyId(staff.getAgencyId()); + entity.setPids(staff.getAgencyPIds()); + if (CollectionUtils.isNotEmpty(dto.getServiceMatterList())) { + entity.setServiceMatter(StringUtils.join(dto.getServiceMatterList(), StrConstant.COMMA)); + } + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPartyUnitEntity::getAgencyId, entity.getAgencyId()); + wrapper.eq(IcPartyUnitEntity::getUnitName, entity.getUnitName()); + List list = baseDao.selectList(wrapper); + if(StringUtils.isBlank(entity.getId())) { + if (CollectionUtils.isNotEmpty(list)) { + throw new EpmetException(EpmetErrorCode.PARTY_UNIT_NAME_EXITED.getCode(), EpmetErrorCode.PARTY_UNIT_NAME_EXITED.getMsg(), EpmetErrorCode.PARTY_UNIT_NAME_EXITED.getMsg()); + } + insert(entity); + } else { + if (CollectionUtils.isNotEmpty(list) && list.get(0).getId().equals(entity.getId())) { + throw new EpmetException(EpmetErrorCode.PARTY_UNIT_NAME_EXITED.getCode(), EpmetErrorCode.PARTY_UNIT_NAME_EXITED.getMsg(), EpmetErrorCode.PARTY_UNIT_NAME_EXITED.getMsg()); + } + updateById(entity); + } + } + + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String id) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteById(id); + } + + /** + * 需求指派,选择区域化党建单位,调用此接口 + * 返回需求所属组织线上的数据 + * + * @param formDTO + * @return + */ + @Override + public List queryServiceList(ServiceQueryFormDTO formDTO) { + List resultList = new ArrayList<>(); + CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + if (null == staffInfoCacheResult || StringUtils.isBlank(staffInfoCacheResult.getAgencyId())) { + throw new EpmetException("工作人员所属组织信息查询异常"); + } + List agencyIds = new ArrayList<>(); + if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) { + if (staffInfoCacheResult.getAgencyPIds().contains(StrConstant.COLON)) { + agencyIds.addAll(Arrays.asList(staffInfoCacheResult.getAgencyPIds().split(StrConstant.COLON))); + }else{ + //当前用户属于第二级组织的人,不会有: + agencyIds.add(staffInfoCacheResult.getAgencyPIds()); + } + } + agencyIds.add(staffInfoCacheResult.getAgencyId()); + resultList=baseDao.selectListByAgencyId(agencyIds,formDTO.getServiceName(),formDTO.getCustomerId()); + return resultList; + } + + /** + * @Description 获取组织下单位列表 + * @param dto + * @Return {@link List< OptionDTO>} + * @Author zhaoqifeng + * @Date 2021/11/22 14:35 + */ + @Override + public List option(IcPartyUnitDTO dto) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPartyUnitEntity::getAgencyId, dto.getAgencyId()); + wrapper.orderByDesc(IcPartyUnitEntity::getUpdatedTime); + wrapper.eq(StringUtils.isNotBlank(dto.getServiceMatter()), IcPartyUnitEntity::getServiceMatter, dto.getServiceMatter()); + List list = baseDao.selectList(wrapper); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + return list.stream().map(item -> { + OptionDTO option = new OptionDTO(); + option.setValue(item.getId()); + option.setLabel(item.getUnitName()); + return option; + }).collect(Collectors.toList()); + } + + /** + * 导入数据 + * + * @param tokenDto + * @param response + * @param file + * @Param tokenDto + * @Param response + * @Param file + * @Return + * @Author zhaoqifeng + * @Date 2021/11/29 11:01 + */ + @Override + public Result importData(TokenDto tokenDto, HttpServletResponse response, MultipartFile file) throws IOException { + ExcelImportResult importResult = ExcelPoiUtils.importExcelMore(file, 0, 1, IcPartyUnitImportExcel.class); + List failList = importResult.getFailList(); + //存放错误数据行号 + List numList = new ArrayList<>(); + if (!org.springframework.util.CollectionUtils.isEmpty(failList)) { + for (IcPartyUnitImportExcel entity : failList) { + //打印失败的行 和失败的信息 + log.warn("第{}行,{}", entity.getRowNum(), entity.getErrorMsg()); + numList.add(entity.getRowNum()); + } + } + List result = importResult.getList(); + + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + if (null == staffInfoCache) { + throw new EpmetException(8000, "获取用户缓存失败"); + } + SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); + codeFormDTO.setCustomerId(tokenDto.getCustomerId()); + codeFormDTO.setParentCategoryCode("1010"); + Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getLabel, OptionDTO::getValue)); + //1.数据校验 + Iterator iterator = result.iterator(); + while (iterator.hasNext()) { + IcPartyUnitImportExcel obj = iterator.next(); + //单位名称不能为空,不可重复 + if (StringUtils.isBlank(obj.getUnitName())) { + numList.add(obj.getRowNum()); + log.warn(String.format("单位名称为空,行号->%s", obj.getRowNum())); + iterator.remove(); + } else { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPartyUnitEntity::getAgencyId, staffInfoCache.getAgencyId()); + wrapper.eq(IcPartyUnitEntity::getUnitName, obj.getUnitName()); + List list = baseDao.selectList(wrapper); + if (CollectionUtils.isNotEmpty(list)) { + numList.add(obj.getRowNum()); + log.warn(String.format("单位名称已存在,行号->%s", obj.getRowNum())); + iterator.remove(); + } + } + //分类校验 + if (StringUtils.isBlank(obj.getType()) || null == PartyUnitTypeEnum.getCode(obj.getType())) { + numList.add(obj.getRowNum()); + log.warn(String.format("分类名不存在,行号->%s", obj.getRowNum())); + iterator.remove(); + } + //服务事项校验 + if (StringUtils.isNotBlank(obj.getServiceMatter())) { + List matters = Arrays.asList(obj.getServiceMatter().split(StrConstant.COLON)); + matters.forEach(item -> { + if (null == categoryMap.get(item)) { + numList.add(obj.getRowNum()); + log.warn(String.format("服务事项不存在,行号->%s", obj.getRowNum())); + iterator.remove(); + } + }); + } + //联系人 联系电话 在职党员 地址 中心位置经度 中心位置纬度 校验 + if (StringUtils.isBlank(obj.getContact()) || StringUtils.isBlank(obj.getContactMobile()) || + StringUtils.isBlank(obj.getContact()) || + null == obj.getMemberCount() || + StringUtils.isBlank(obj.getLatitude()) || + StringUtils.isBlank(obj.getLongitude())) { + numList.add(obj.getRowNum()); + log.warn(String.format("联系人、联系电话、在职党员、地址、中心位置经度、中心位置纬度为空,行号->%s", obj.getRowNum())); + iterator.remove(); + } + + } + if (CollectionUtils.isEmpty(result)) { + Collections.sort(numList); + String subList = numList.stream().map(String::valueOf).collect(Collectors.joining("、")); + return new Result().error(9999, "第" + subList + "行未成功!"); + } + + List list = result.stream().map(item -> { + IcPartyUnitEntity entity = new IcPartyUnitEntity(); + entity.setCustomerId(tokenDto.getCustomerId()); + entity.setAgencyId(staffInfoCache.getAgencyId()); + entity.setPids(staffInfoCache.getAgencyPIds()); + entity.setUnitName(item.getUnitName()); + entity.setType(PartyUnitTypeEnum.getCode(item.getType())); + if (StringUtils.isNotBlank(item.getServiceMatter())) { + entity.setServiceMatter(getServiceMatter(categoryMap, item.getServiceMatter())); + } + entity.setContact(item.getContact()); + entity.setContactMobile(item.getContactMobile()); + entity.setAddress(item.getAddress()); + entity.setLatitude(item.getLatitude()); + entity.setLongitude(item.getLongitude()); + entity.setMemberCount(item.getMemberCount()); + entity.setRemark(item.getRemark()); + return entity; + }).collect(Collectors.toList()); + + insertBatch(list); + + String str = String.format("共%s条,成功导入%s条。", numList.size() + result.size(), numList.size() + result.size() - numList.size()); + if (numList.size() > NumConstant.ZERO) { + Collections.sort(numList); + String subList = numList.stream().map(String::valueOf).collect(Collectors.joining("、")); + log.warn(str + "第" + subList + "行未成功!"); + return new Result().error(9999, str + "第" + subList + "行未成功!"); + } + return new Result().ok(str); + } + + /** + * 计算区域化党建单位的群众满意度 + * 总分➗需求个数 + * @param formDTO + */ + @Override + public void calPartyUnitSatisfation(CalPartyUnitSatisfactionFormDTO formDTO) { + log.info("收到消息内容啦...." + JSON.toJSONString(formDTO)); + List list = icUserDemandRecService.groupByPartyUnit(formDTO.getCustomerId(), formDTO.getPartyUnitId()); + for (ServiceStatDTO serviceStatDTO : list) { + if (0 != serviceStatDTO.getDemandCount()) { + BigDecimal result = serviceStatDTO.getTotalScore().divide(new BigDecimal(serviceStatDTO.getDemandCount()), 4, BigDecimal.ROUND_HALF_UP); + baseDao.updateSatisfaction(serviceStatDTO.getServerId(),result); + } + } + } + + private String getServiceMatter(Map map, String matter) { + List matters = Arrays.asList(matter.split(StrConstant.COLON)); + List list = matters.stream().map(map::get).collect(Collectors.toList()); + return StringUtils.join(list, StrConstant.COMMA); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java index fb23a85fe8..5fe0df4eff 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java @@ -18,18 +18,24 @@ package com.epmet.service.impl; 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.constant.StrConstant; import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.IcResiDemandDictDao; -import com.epmet.dto.IcResiDemandDictDTO; -import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO; +import com.epmet.dto.form.demand.*; +import com.epmet.dto.result.demand.DemandPageResDTO; +import com.epmet.dto.result.demand.OptionDTO; import com.epmet.entity.IcResiDemandDictEntity; import com.epmet.service.IcResiDemandDictService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -44,23 +50,88 @@ import java.util.Map; * @author generator generator@elink-cn.com * @since v1.0.0 2021-10-27 */ +@Slf4j @Service public class IcResiDemandDictServiceImpl extends BaseServiceImpl implements IcResiDemandDictService { + /** + * 分页查询 + * + * @param formDTO + * @return + */ + @Override + public PageData page(DemandDictPageFormDTO formDTO) { + PageInfo pageInfo= PageHelper.startPage(formDTO.getPageNo(), + formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.pageSelect(formDTO.getCustomerId(),formDTO.getFirstCategoryCode())); + return new PageData<>(pageInfo.getList(), pageInfo.getTotal()); + } + + /** + * 新增一级分类 + * @param formDTO + */ @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, IcResiDemandDictDTO.class); + @Transactional(rollbackFor = Exception.class) + public void addFirstCategory(AddFirstCategoryFormDTO formDTO) { + if (checkCategoryName(formDTO.getCustomerId(), formDTO.getCategoryName(), NumConstant.ONE, NumConstant.ZERO_STR,null) > NumConstant.ZERO) { + // 名称唯一 + throw new RenException(EpmetErrorCode.DEMAND_NAME_EXITED.getCode(), EpmetErrorCode.DEMAND_NAME_EXITED.getMsg()); + } + + IcResiDemandDictEntity entity = new IcResiDemandDictEntity(); + entity.setCustomerId(formDTO.getCustomerId()); + entity.setCategoryName(formDTO.getCategoryName()); + entity.setLevel(NumConstant.ONE); + entity.setParentCode(NumConstant.ZERO_STR); + entity.setAwardPoint(NumConstant.ZERO); + entity.setUsableFlag(true); + // 获取当前最大的排序号 + Integer maxSort = baseDao.selectMaxSort(formDTO.getCustomerId(), NumConstant.ONE,NumConstant.ZERO_STR); + entity.setSort(null == maxSort ? NumConstant.ZERO : maxSort + 1); + // 一级分类,直接获取最大的,然后+1 + Integer maxFirstCategoryCode = baseDao.selectMaxCategoryCode(formDTO.getCustomerId(),NumConstant.ONE,NumConstant.ZERO_STR); + entity.setCategoryCode(null == maxFirstCategoryCode ? "1001" : String.valueOf(maxFirstCategoryCode + 1)); + baseDao.insert(entity); } + @Transactional(rollbackFor = Exception.class) @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); + public void addChild(AddCategoryFormDTO formDTO) { + if(NumConstant.ZERO_STR.equals(formDTO.getParentCategoryCode())){ + throw new RenException("添加一级分类,调用接口/heart/icresidemanddict/addfirst"); + } + if (checkCategoryName(formDTO.getCustomerId(), formDTO.getCategoryName(), NumConstant.TWO, formDTO.getParentCategoryCode(),null) > NumConstant.ZERO) { + // 名称唯一 + throw new RenException(EpmetErrorCode.DEMAND_NAME_EXITED.getCode(), EpmetErrorCode.DEMAND_NAME_EXITED.getMsg()); + } - return ConvertUtils.sourceToTarget(entityList, IcResiDemandDictDTO.class); + IcResiDemandDictEntity entity = new IcResiDemandDictEntity(); + entity.setCustomerId(formDTO.getCustomerId()); + entity.setCategoryName(formDTO.getCategoryName()); + entity.setLevel(NumConstant.TWO); + entity.setParentCode(formDTO.getParentCategoryCode()); + entity.setAwardPoint(formDTO.getAwardPoint()); + entity.setUsableFlag(true); + // 获取当前最大的排序号 + Integer maxSort = baseDao.selectMaxSort(formDTO.getCustomerId(), NumConstant.TWO,formDTO.getParentCategoryCode()); + entity.setSort(null == maxSort ? NumConstant.ZERO : maxSort + 1); + // 二级分类,直接获取最大的,然后+1 + Integer maxCategoryCode = baseDao.selectMaxCategoryCode(formDTO.getCustomerId(),NumConstant.TWO,formDTO.getParentCategoryCode()); + entity.setCategoryCode(null == maxCategoryCode ? formDTO.getParentCategoryCode().concat("0001") : String.valueOf(maxCategoryCode + 1)); + baseDao.insert(entity); + } + + /** + * 校验名字是否存在 + * @param customerId + * @param categoryName + * @param level + * @param id + * @return + */ + public int checkCategoryName(String customerId,String categoryName,int level,String parentCategoryCode,String id){ + return baseDao.selectCountName(customerId,categoryName,level,parentCategoryCode,id); } private QueryWrapper getWrapper(Map params){ @@ -72,24 +143,26 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl NumConstant.ZERO) { + // 名称唯一 + throw new RenException(EpmetErrorCode.DEMAND_NAME_EXITED.getCode(), EpmetErrorCode.DEMAND_NAME_EXITED.getMsg()); + } + origin.setCategoryName(formDTO.getCategoryName()); + if (NumConstant.TWO == origin.getLevel()) { + origin.setAwardPoint(formDTO.getAwardPoint()); + } + updateById(origin); } @Override @@ -109,7 +182,18 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl getDemandOptions(String customerId) { - return baseDao.selectDemandOptions(customerId); + return baseDao.selectDemandOptions(customerId,null); + } + + + @Override + public List getDemandOptionsV2(DemandOptionFormDTO formDTO) { + if ("addorupdate".equals(formDTO.getPurpose())) { + //只查询可用的 + return baseDao.selectDemandOptions(formDTO.getCustomerId(), "1"); + } + //查询全部 + return baseDao.selectDemandOptions(formDTO.getCustomerId(), null); } @Override @@ -117,4 +201,56 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl().ok(baseDao.selectCategoryNames(formDTO.getCustomerId(),formDTO.getCodeSet())); } + @Override + public List querySubCodeList(SubCodeFormDTO formDTO) { + return baseDao.selectByPCode(formDTO.getParentCategoryCode(),formDTO.getCustomerId(),formDTO.getCategoryName()); + } + + @Override + public void updateStatus(StatusFormDTO formDTO) { + IcResiDemandDictEntity origin = baseDao.selectById(formDTO.getCategoryId()); + if (null == origin) { + log.error("category_id=" + formDTO.getCategoryId() + " 没有找到记录"); + return; + } + origin.setUsableFlag(formDTO.getUsableFlag()); + updateById(origin); + // 如果修改的是一级分类, 同步到二级 + if (NumConstant.ONE == origin.getLevel()) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(origin.getCategoryCode()), "PARENT_CODE", origin.getCategoryCode()); + List entityList = baseDao.selectList(wrapper); + for (IcResiDemandDictEntity sub : entityList) { + sub.setUsableFlag(formDTO.getUsableFlag()); + updateById(sub); + } + } + } + + /** + * 供服务措施管理,列表查询,显示需求类型名称用 + * + * @param customerId + * @param categoryCodes + * @return + */ + @Override + public List listByCodes(String customerId, List categoryCodes) { + return baseDao.selectSecondCodes(customerId,categoryCodes); + } + + /** + * 查询当前分类的名称 + * + * @param customerId + * @param categoryCode + * @return + */ + @Override + public String getCategoryName(String customerId, String categoryCode) { + String categoryName=baseDao.selectNameByCode(customerId,categoryCode); + return StringUtils.isNotBlank(categoryName)?categoryName: StrConstant.EPMETY_STR; + } + + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java new file mode 100644 index 0000000000..e9fc54a6f1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java @@ -0,0 +1,271 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +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.exception.RenException; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.IcSocietyOrgDao; +import com.epmet.dto.CustomerStaffDTO; +import com.epmet.dto.IcSocietyOrgDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.form.demand.ServiceQueryFormDTO; +import com.epmet.dto.result.*; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.entity.IcSocietyOrgEntity; +import com.epmet.excel.IcSocietyOrgExcel; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.service.IcSocietyOrgService; +import com.epmet.service.IcUserDemandRecService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.lang3.StringUtils; +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.util.CollectionUtils; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 社会组织管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Service +public class IcSocietyOrgServiceImpl extends BaseServiceImpl implements IcSocietyOrgService { + private static final Logger log = LoggerFactory.getLogger(IcSocietyOrgServiceImpl.class); + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + @Autowired + private IcUserDemandRecService icUserDemandRecService; + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + + /** + * @Author sun + * @Description 新增社会组织 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void add(AddSocietyOrgFormDTO dto) { + IcSocietyOrgEntity entity = ConvertUtils.sourceToTarget(dto, IcSocietyOrgEntity.class); + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(dto.getCustomerId(), dto.getStaffId()); + entity.setAgencyId(staffInfoCache.getAgencyId()); + entity.setPids(staffInfoCache.getAgencyPIds()); + insert(entity); + } + + /** + * @Author sun + * @Description 修改社会组织 + **/ + @Override + public void edit(EditSocietyOrgFormDTO formDTO) { + IcSocietyOrgEntity entity = baseDao.selectById(formDTO.getSocietyId()); + if (null == entity) { + throw new RenException(String.format("修改社会组织信息失败,社会组织信息不存在,组织Id->%s", formDTO.getSocietyId())); + } + entity = ConvertUtils.sourceToTarget(formDTO, IcSocietyOrgEntity.class); + entity.setId(formDTO.getSocietyId()); + baseDao.updateById(entity); + } + + /** + * @Author sun + * @Description 删除社会组织 + **/ + @Override + public void del(String societyId) { + if (baseDao.deleteById(societyId) < NumConstant.ONE) { + throw new RenException(String.format("修改社会组织信息删除失败,社会组织Id->%s", societyId)); + } + } + + /** + * @Author sun + * @Description 社会组织列表查询 + **/ + @Override + public GetListSocietyOrgResultDTO getList(GetListSocietyOrgFormDTO formDTO) { + GetListSocietyOrgResultDTO resultDTO = new GetListSocietyOrgResultDTO(); + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + formDTO.setPids(staffInfoCache.getAgencyPIds()); + //1.根据查询条件分页查询社会组织数据 + PageInfo result = + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.getList(formDTO)); + if (CollectionUtils.isEmpty(result.getList())) { + return resultDTO; + } + resultDTO.setTotal((int) result.getTotal()); + + //2.查询被绑定管理员信息 + UserIdsFormDTO dto = new UserIdsFormDTO(); + List staffIdList = result.getList().stream().map(SocietyOrgListResultDTO::getAdminStaffId).collect(Collectors.toList()); + staffIdList = staffIdList.stream().distinct().collect(Collectors.toList()); + dto.setUserIds(staffIdList); + Result> listResult = epmetUserOpenFeignClient.getStaffInfoList(dto); + if (!listResult.success()) { + throw new RenException("获取工作人员基本信息失败......"); + } + result.getList().forEach(r -> listResult.getData().stream().filter(u -> r.getAdminStaffId().equals(u.getStaffId())).forEach(u -> r.setAdminStaffName(u.getStaffName()))); + + //3.查询被绑定管理员信息 + OrgInfoFormDTO org = new OrgInfoFormDTO(); + List orgIds = result.getList().stream().map(SocietyOrgListResultDTO::getAgencyId).collect(Collectors.toList()); + orgIds = orgIds.stream().distinct().collect(Collectors.toList()); + org.setOrgIds(orgIds); + org.setOrgType("agency"); + Result> orgResult = govOrgOpenFeignClient.selectOrgInfo(org); + if (!orgResult.success()) { + throw new RenException("获取组织基础信息失败......"); + } + result.getList().forEach(r -> orgResult.getData().stream().filter(u -> r.getAgencyId().equals(u.getOrgId())).forEach(u -> r.setAgencyName(u.getOrgName()))); + + resultDTO.setList(result.getList()); + return resultDTO; + } + + /** + * 需求指派,选择社会组织,调用此接口 + * + * @param formDTO + * @return + */ + @Override + public List queryServiceList(ServiceQueryFormDTO formDTO) { + List resultList = new ArrayList<>(); + CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + if (null == staffInfoCacheResult || StringUtils.isBlank(staffInfoCacheResult.getAgencyId())) { + throw new RenException("工作人员所属组织信息查询异常"); + } + List agencyIds = new ArrayList<>(); + if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) { + if (staffInfoCacheResult.getAgencyPIds().contains(StrConstant.COLON)) { + agencyIds.addAll(Arrays.asList(staffInfoCacheResult.getAgencyPIds().split(StrConstant.COLON))); + }else{ + //当前用户属于第二级组织的人,不会有: + agencyIds.add(staffInfoCacheResult.getAgencyPIds()); + } + } + agencyIds.add(staffInfoCacheResult.getAgencyId()); + resultList = baseDao.selectListByAgencyId(agencyIds, formDTO.getServiceName(), formDTO.getCustomerId(), formDTO.getQueryPurpose()); + return resultList; + } + + /** + * @Author sun + * @Description 九小场所下组织列表导入 + **/ + @Override + public List importExcel(String customerId, List list, String staffId, List numList) throws ParseException { + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(customerId, staffId); + //查询当前组织下的社会组织数据 + List societyOrgList = baseDao.getByAgencyId(staffInfoCache.getAgencyId()); + //1.数据校验 只允许导入当前组织下社会组织且是当前组织下不存在的社会组织 + //组织名称不一样的数据舍弃 + Iterator iterator = list.iterator(); + while (iterator.hasNext()) { + IcSocietyOrgExcel obj = iterator.next(); + if (!obj.getAgencyName().trim().equals(staffInfoCache.getAgencyName())) { + numList.add(obj.getRowNum()); + log.warn(String.format("不是当前组织下可导入的数据,组织名称->%s,行号->%s", obj.getAgencyName(), obj.getRowNum())); + iterator.remove(); + continue; + } + societyOrgList.forEach(org -> { + if (obj.getSocietyName().equals(org.getSocietyName())) { + numList.add(obj.getRowNum()); + log.warn(String.format("当前组织下的社会组织已存在,社会组织名称->%s,行号->%s", obj.getSocietyName(), obj.getRowNum())); + iterator.remove(); + } + }); + + } + if (CollectionUtils.isEmpty(list)) { + return numList; + } + + //2.查询绑定的管理员信息 + Set staffNames = list.stream().map(item -> item.getAdminStaffName().trim()).collect(Collectors.toSet()); + GetByRealNamesFormDTO dto = new GetByRealNamesFormDTO(); + dto.setCustomerId(customerId); + dto.setRealNames(staffNames); + Result> staffResult = epmetUserOpenFeignClient.getByRealNames(dto); + if (!staffResult.success()) { + throw new RenException("获取工作人员基础信息失败......"); + } + if (null == staffResult.getData()) { + Iterator iter = list.iterator(); + while (iter.hasNext()) { + IcSocietyOrgExcel obj = iter.next(); + numList.add(obj.getRowNum()); + iterator.remove(); + } + return numList; + } + Map map = staffResult.getData().stream().collect(Collectors.toMap(CustomerStaffDTO::getRealName, CustomerStaffDTO::getUserId)); + + //3.遍历封装有效数据 + List houseEntityList = new ArrayList<>(); + Iterator iterator1 = list.iterator(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + while (iterator1.hasNext()) { + IcSocietyOrgExcel icHouseExcel = iterator1.next(); + IcSocietyOrgEntity entity = new IcSocietyOrgEntity(); + entity.setCustomerId(customerId); + entity.setAgencyId(staffInfoCache.getAgencyId()); + entity.setPids(staffInfoCache.getAgencyPIds()); + entity.setSocietyName(icHouseExcel.getSocietyName()); + entity.setServiceMatters(icHouseExcel.getServiceMatters()); + entity.setPersonInCharge(icHouseExcel.getPersonInCharge()); + entity.setMobile(icHouseExcel.getMobile()); + entity.setServiceStartTime(sdf.parse(icHouseExcel.getServiceStartTime())); + entity.setServiceEndTime(sdf.parse(icHouseExcel.getServiceEndTime())); + entity.setAdminStaffId(map.containsKey(icHouseExcel.getAdminStaffName().trim()) ? map.get(icHouseExcel.getAdminStaffName().trim()) : ""); + if ("".equals(entity.getAdminStaffId())) { + numList.add(icHouseExcel.getRowNum()); + log.warn(String.format("绑定的管理员不存在,管理员名称->%s,行号->%s", icHouseExcel.getAdminStaffName(), icHouseExcel.getRowNum())); + iterator1.remove(); + continue; + } + entity.setAddress(icHouseExcel.getAddress()); + entity.setLongitude(icHouseExcel.getLongitude()); + entity.setLatitude(icHouseExcel.getLatitude()); + houseEntityList.add(entity); + } + + //3.批量保存数据 + insertBatch(houseEntityList); + + return numList; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java new file mode 100644 index 0000000000..447531f7fd --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java @@ -0,0 +1,582 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +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.constant.StrConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.enums.DictTypeEnum; +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.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.UserDemandConstant; +import com.epmet.dao.IcUserDemandOperateLogDao; +import com.epmet.dao.IcUserDemandRecDao; +import com.epmet.dao.IcUserDemandSatisfactionDao; +import com.epmet.dao.IcUserDemandServiceDao; +import com.epmet.dto.CustomerGridDTO; +import com.epmet.dto.IcUserDemandRecDTO; +import com.epmet.dto.form.CustomerGridFormDTO; +import com.epmet.dto.form.demand.*; +import com.epmet.dto.result.AllGridsByUserIdResultDTO; +import com.epmet.dto.result.UserBaseInfoResultDTO; +import com.epmet.dto.result.demand.DemandRecResultDTO; +import com.epmet.dto.result.demand.FinishResultDTO; +import com.epmet.dto.result.demand.IcResiUserReportDemandRes; +import com.epmet.dto.result.demand.ServiceStatDTO; +import com.epmet.entity.*; +import com.epmet.feign.EpmetAdminOpenFeignClient; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.service.IcResiDemandDictService; +import com.epmet.service.IcUserDemandRecService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * 居民需求记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Service +public class IcUserDemandRecServiceImpl extends BaseServiceImpl implements IcUserDemandRecService { + @Autowired + private IcUserDemandOperateLogDao operateLogDao; + @Autowired + private IcUserDemandServiceDao demandServiceDao; + @Autowired + private IcUserDemandSatisfactionDao demandSatisfactionDao; + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private IcResiDemandDictService demandDictService; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + @Autowired + private EpmetAdminOpenFeignClient adminOpenFeignClient; + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcUserDemandRecDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcUserDemandRecDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcUserDemandRecDTO get(String id) { + IcUserDemandRecEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcUserDemandRecDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcUserDemandRecDTO dto) { + IcUserDemandRecEntity entity = ConvertUtils.sourceToTarget(dto, IcUserDemandRecEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public DemandRecId update(DemandAddFromDTO dto) { + IcUserDemandRecEntity origin = baseDao.selectById(dto.getDemandRecId()); + if (null == origin) { + throw new RenException(EpmetErrorCode.DEMAND_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_NOT_EXITS.getMsg()); + } + if(!UserDemandConstant.PENDING.equals(origin.getStatus())){ + //待处理的才可以修改需求 + throw new RenException(EpmetErrorCode.DEMAND_CAN_NOT_UPDATE.getCode(),EpmetErrorCode.DEMAND_CAN_NOT_UPDATE.getMsg()); + } + CustomerGridFormDTO customerGridFormDTO=new CustomerGridFormDTO(); + customerGridFormDTO.setGridId(dto.getGridId()); + Result gridInfoRes=govOrgOpenFeignClient.getGridBaseInfoByGridId(customerGridFormDTO); + if(!gridInfoRes.success()||null==gridInfoRes.getData()){ + throw new RenException("查询网格信息失败"); + } + IcUserDemandRecEntity updateEntity=ConvertUtils.sourceToTarget(dto,IcUserDemandRecEntity.class); + updateEntity.setAgencyId(gridInfoRes.getData().getPid()); + updateEntity.setGridPids(gridInfoRes.getData().getPids()); + updateEntity.setDemandUserType(UserDemandConstant.IC_RESI_USER); + updateEntity.setStatus(UserDemandConstant.PENDING); + updateEntity.setEvaluateFlag(false); + updateEntity.setId(dto.getDemandRecId()); + baseDao.updateById(updateEntity); + + IcUserDemandOperateLogEntity logEntity=new IcUserDemandOperateLogEntity(); + logEntity.setCustomerId(dto.getCustomerId()); + logEntity.setDemandRecId(dto.getDemandRecId()); + logEntity.setUserType(UserDemandConstant.STAFF); + logEntity.setUserId(dto.getCurrentUserId()); + logEntity.setActionCode(UserDemandConstant.UPDATE); + logEntity.setOperateTime(new Date()); + operateLogDao.insert(logEntity); + DemandRecId resultDto=new DemandRecId(); + resultDto.setDemandRecId(updateEntity.getId()); + return resultDto; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 新增需求 + * + * @param fromDTO + * @return + */ + @Override + @Transactional(rollbackFor = Exception.class) + public DemandRecId add(DemandAddFromDTO fromDTO) { + CustomerGridFormDTO customerGridFormDTO=new CustomerGridFormDTO(); + customerGridFormDTO.setGridId(fromDTO.getGridId()); + Result gridInfoRes=govOrgOpenFeignClient.getGridBaseInfoByGridId(customerGridFormDTO); + if(!gridInfoRes.success()||null==gridInfoRes.getData()){ + throw new RenException("查询网格信息失败"); + } + IcUserDemandRecEntity insertEntity=ConvertUtils.sourceToTarget(fromDTO,IcUserDemandRecEntity.class); + insertEntity.setAgencyId(gridInfoRes.getData().getPid()); + insertEntity.setGridPids(gridInfoRes.getData().getPids()); + insertEntity.setDemandUserType(UserDemandConstant.IC_RESI_USER); + insertEntity.setStatus(UserDemandConstant.PENDING); + insertEntity.setEvaluateFlag(false); + baseDao.insert(insertEntity); + IcUserDemandOperateLogEntity logEntity=new IcUserDemandOperateLogEntity(); + logEntity.setCustomerId(fromDTO.getCustomerId()); + logEntity.setDemandRecId(insertEntity.getId()); + logEntity.setUserType(UserDemandConstant.STAFF); + logEntity.setUserId(fromDTO.getCurrentUserId()); + logEntity.setActionCode(UserDemandConstant.CREATE); + logEntity.setOperateTime(new Date()); + operateLogDao.insert(logEntity); + DemandRecId resultDto=new DemandRecId(); + resultDto.setDemandRecId(insertEntity.getId()); + return resultDto; + } + + @Override + public PageData pageList(UserDemandPageFormDTO formDTO) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getCurrentStaffId()); + if (null == staffInfo) { + throw new RenException("工作人员所属组织信息查询异常"); + } + if (StringUtils.isBlank(staffInfo.getAgencyPIds())|| NumConstant.ZERO_STR.equals(staffInfo.getAgencyPIds())) { + //当前用户属于根组织下的人 + formDTO.setGridPids(staffInfo.getAgencyId()); + } else { + formDTO.setGridPids(staffInfo.getAgencyPIds().concat(StrConstant.COLON).concat(staffInfo.getAgencyId())); + } + PageInfo pageInfo= PageHelper.startPage(formDTO.getPageNo(), + formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.pageSelect(formDTO)); + List list=pageInfo.getList(); + if(CollectionUtils.isNotEmpty(list)){ + //1、查询网格信息 + List gridIds=list.stream().map(DemandRecResultDTO::getGridId).collect(Collectors.toList()); + Result> gridInfoRes=govOrgOpenFeignClient.getGridListByGridIds(gridIds); + List gridInfoList = gridInfoRes.success() && !CollectionUtils.isEmpty(gridInfoRes.getData()) ? gridInfoRes.getData() : new ArrayList<>(); + Map gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(AllGridsByUserIdResultDTO::getGridId, Function.identity())); + + //2、查询分类名称 + List categoryCodes=list.stream().map(DemandRecResultDTO::getCategoryCode).collect(Collectors.toList()); + List dictList=demandDictService.listByCodes(formDTO.getCustomerId(),categoryCodes); + Map dictMap = dictList.stream().collect(Collectors.toMap(IcResiDemandDictEntity::getCategoryCode, IcResiDemandDictEntity::getCategoryName)); + + //3、查询志愿者 + // 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + Map userInfoMap=new HashMap<>(); + Set userIdList=list.stream().filter(item->item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet()); + if(CollectionUtils.isNotEmpty(userIdList)){ + Result> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIdList)); + if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){ + throw new RenException("查询志愿者信息异常"); + } + userInfoMap=userInfoRes.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, UserBaseInfoResultDTO::getRealName)); + } + + //查询字典表 + Result> reportTypeRes=adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_REPORT_TYPE.getCode()); + Map reportTypeMap=reportTypeRes.success()&& MapUtils.isNotEmpty(reportTypeRes.getData())?reportTypeRes.getData():new HashMap<>(); + + Result> statusRes=adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_STATUS.getCode()); + Map statusMap=statusRes.success()&& MapUtils.isNotEmpty(statusRes.getData())?statusRes.getData():new HashMap<>(); + + Result> serviceTypeRes=adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_SERVICE_TYPE.getCode()); + Map serviceTypeMap=serviceTypeRes.success()&& MapUtils.isNotEmpty(serviceTypeRes.getData())?serviceTypeRes.getData():new HashMap<>(); + + for(DemandRecResultDTO res:list){ + if (null != gridInfoMap && gridInfoMap.containsKey(res.getGridId())) { + res.setGridName(gridInfoMap.get(res.getGridId()).getGridName()); + } + + if (null != dictMap && dictMap.containsKey(res.getCategoryCode())) { + res.setCategoryName(dictMap.get(res.getCategoryCode())); + } + res.setFirstCategoryName(demandDictService.getCategoryName(formDTO.getCustomerId(), res.getFirstCategoryCode())); + if (null != userInfoMap && userInfoMap.containsKey(res.getServerId())) { + res.setServiceName(userInfoMap.get(res.getServerId())); + } + //社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help + res.setReportTypeName(reportTypeMap.containsKey(res.getReportType())?reportTypeMap.get(res.getReportType()):StrConstant.EPMETY_STR); + /*switch(res.getReportType()){ + case UserDemandConstant.COMMUNITY_REPORT : + res.setReportTypeName("社区帮办"); + break; + case UserDemandConstant.BUILDING_CAPTION_REPORT : + res.setReportTypeName("楼长帮办"); + break; + case UserDemandConstant.PARTY_REPORT : + res.setReportTypeName("党员帮办"); + break; + case UserDemandConstant.SELF_HELP_REPORT : + res.setReportTypeName("自身上报"); + break; + }*/ + //待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished + res.setStatusName(statusMap.containsKey(res.getStatus())?statusMap.get(res.getStatus()):StrConstant.EPMETY_STR); + /*switch(res.getStatus()){ + case UserDemandConstant.PENDING : + res.setStatusName("待处理"); + break; + case UserDemandConstant.CANCELED : + res.setStatusName("已取消"); + break; + case UserDemandConstant.ASSIGNED : + res.setStatusName("已指派"); + break; + case UserDemandConstant.HAVE_ORDER : + res.setStatusName("已接单"); + break; + case UserDemandConstant.FINISHED : + res.setStatusName("已完成"); + break; + }*/ + //服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + res.setServiceShowName(serviceTypeMap.containsKey(res.getServiceType())?res.getServiceName().concat("(").concat(serviceTypeMap.get(res.getServiceType())).concat(")"):StrConstant.EPMETY_STR); + /*switch(res.getServiceType()){ + case UserDemandConstant.VOLUNTEER : + res.setServiceShowName(res.getServiceName().concat("(志愿者)")); + break; + case UserDemandConstant.SOCIAL_ORG : + res.setServiceShowName(res.getServiceName().concat("(社会组织)")); + break; + case UserDemandConstant.COMMUNITY_ORG : + res.setServiceShowName(res.getServiceName().concat("(社区自组织")); + break; + case UserDemandConstant.PARTY_UNIT : + res.setServiceShowName(res.getServiceName().concat("(区域化党建单位)")); + break; + }*/ + } + } + return new PageData<>(list, pageInfo.getTotal()); + } + + /** + * 未完成之前都可以取消 + * + * @param formDTO + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void cancel(StaffCancelFormDTO formDTO) { + IcUserDemandRecEntity entity = baseDao.selectById(formDTO.getDemandRecId()); + if (null == entity) { + throw new RenException(EpmetErrorCode.DEMAND_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_NOT_EXITS.getMsg()); + } + if (UserDemandConstant.FINISH.equals(entity.getStatus())) { + //需求已完成,不可取消 + throw new RenException(EpmetErrorCode.DEMAND_CAN_NOT_CANCEL.getCode(),EpmetErrorCode.DEMAND_CAN_NOT_CANCEL.getMsg()); + } + //1、修改主表 + //置为取消状态、设置取消时间 + entity.setStatus(UserDemandConstant.CANCELED); + entity.setCancelTime(new Date()); + baseDao.updateById(entity); + //2、插入操作日志 + IcUserDemandOperateLogEntity logEntity = new IcUserDemandOperateLogEntity(); + logEntity.setCustomerId(formDTO.getCustomerId()); + logEntity.setDemandRecId(formDTO.getDemandRecId()); + logEntity.setUserType(UserDemandConstant.STAFF); + logEntity.setUserId(formDTO.getUserId()); + logEntity.setActionCode(UserDemandConstant.CANCEL); + logEntity.setOperateTime(entity.getCancelTime()); + operateLogDao.insert(logEntity); + } + + /** + * 指派 + * 待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished + * 待处理+已派单才可以指派 + * + * @param formDTO + * @return + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void assign(AssignFormDTO formDTO) { + IcUserDemandRecEntity entity = baseDao.selectById(formDTO.getDemandRecId()); + if (null == entity) { + throw new RenException(EpmetErrorCode.DEMAND_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_NOT_EXITS.getMsg()); + } + if (!UserDemandConstant.PENDING.equals(entity.getStatus()) && !UserDemandConstant.ASSIGNED.equals(entity.getStatus())) { + //待处理+已派单才可以指派 + throw new RenException(EpmetErrorCode.DEMAND_CAN_NOT_ASSIGN.getCode(), EpmetErrorCode.DEMAND_CAN_NOT_ASSIGN.getMsg()); + } + //1、修改主表 + //置为已派单 + entity.setStatus(UserDemandConstant.ASSIGNED); + baseDao.updateById(entity); + //2、插入操作日志 + IcUserDemandOperateLogEntity logEntity = new IcUserDemandOperateLogEntity(); + logEntity.setCustomerId(formDTO.getCustomerId()); + logEntity.setDemandRecId(formDTO.getDemandRecId()); + logEntity.setUserType(UserDemandConstant.STAFF); + logEntity.setUserId(formDTO.getUserId()); + logEntity.setActionCode(UserDemandConstant.ASSIGN); + logEntity.setOperateTime(new Date()); + operateLogDao.insert(logEntity); + //3、插入或更新服务记录 + IcUserDemandServiceEntity serviceEntity=ConvertUtils.sourceToTarget(formDTO,IcUserDemandServiceEntity.class); + IcUserDemandServiceEntity origin=demandServiceDao.selectByRecId(formDTO.getDemandRecId()); + if (null == origin) { + demandServiceDao.insert(serviceEntity); + }else{ + serviceEntity.setId(origin.getId()); + serviceEntity.setUpdatedBy(formDTO.getUserId()); + demandServiceDao.updateById(serviceEntity); + } + + } + + /** + * 完成并评价 + * + * @param formDTO + */ + @Transactional(rollbackFor = Exception.class) + @Override + public FinishResultDTO finish(FinishStaffFromDTO formDTO) { + IcUserDemandRecEntity entity = baseDao.selectById(formDTO.getDemandRecId()); + if (null == entity) { + throw new RenException(EpmetErrorCode.DEMAND_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_NOT_EXITS.getMsg()); + } + if (UserDemandConstant.PENDING.equals(entity.getStatus()) ||UserDemandConstant.CANCELED.equals(entity.getStatus())) { + //待处理或者已取消的不能评价 + throw new RenException(EpmetErrorCode.DEMAND_CAN_NOT_FINISH.getCode(), EpmetErrorCode.DEMAND_CAN_NOT_FINISH.getMsg()); + } + if(UserDemandConstant.FINISHED.equals(entity.getStatus()) ){ + //已经完成 + throw new RenException(EpmetErrorCode.DEMAND_FINISHED.getCode(), EpmetErrorCode.DEMAND_FINISHED.getMsg()); + } + //1、修改主表 + entity.setStatus(UserDemandConstant.FINISHED); + entity.setFinishResult(formDTO.getFinishResult()); + entity.setEvaluateFlag(true); + baseDao.updateById(entity); + + //2、插入操作日志 + IcUserDemandOperateLogEntity logEntity = new IcUserDemandOperateLogEntity(); + logEntity.setCustomerId(formDTO.getCustomerId()); + logEntity.setDemandRecId(formDTO.getDemandRecId()); + logEntity.setUserType(UserDemandConstant.STAFF); + logEntity.setUserId(formDTO.getUserId()); + logEntity.setActionCode(UserDemandConstant.FINISH); + logEntity.setOperateTime(new Date()); + operateLogDao.insert(logEntity); + + //3、更新服务记录 + IcUserDemandServiceEntity serviceEntity=demandServiceDao.selectById(formDTO.getServiceId()); + if(null==serviceEntity){ + throw new RenException(EpmetErrorCode.DEMAND_SERVICE_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_SERVICE_NOT_EXITS.getMsg()); + } + serviceEntity.setServiceStartTime(formDTO.getServiceStartTime()); + serviceEntity.setServiceEndTime(formDTO.getServiceEndTime()); + serviceEntity.setFinishDesc(formDTO.getFinishDesc()); + demandServiceDao.updateById(serviceEntity); + + //4、插入评价 + IcUserDemandSatisfactionEntity satisfactionEntity=new IcUserDemandSatisfactionEntity(); + satisfactionEntity.setCustomerId(formDTO.getCustomerId()); + satisfactionEntity.setDemandRecId(formDTO.getDemandRecId()); + satisfactionEntity.setUserType(UserDemandConstant.STAFF); + satisfactionEntity.setUserId(formDTO.getUserId()); + satisfactionEntity.setEvaluateTime(logEntity.getOperateTime()); + satisfactionEntity.setScore(formDTO.getScore()); + demandSatisfactionDao.insert(satisfactionEntity); + FinishResultDTO finishResultDTO=new FinishResultDTO(); + finishResultDTO.setPartyUnitId(serviceEntity.getServerId()); + finishResultDTO.setSendCalStatisfaction(false); + //5、如果服务方区域化党建单位,需求重新计算当前这个单位的满意度。 + //如果服务方是区域化党建单位,需要实时去计算他的群众满意度=服务过的需求的评价分数相加➗ 需求的总个数。 + if(UserDemandConstant.PARTY_UNIT.equals(serviceEntity.getServiceType())){ + finishResultDTO.setSendCalStatisfaction(true); + } + return finishResultDTO; + } + + /** + * 数据分析-个人档案,居民需求列表table + * + * @param formDTO + * @return + */ + @Override + public PageData queryMyDemand(IcResiUserDemandFromDTO formDTO) { + /*//1、查询当前居民在小程序里是否有用户id + ResiUserFormDTO resiUserFormDTO=new ResiUserFormDTO(); + resiUserFormDTO.setCustomerId(formDTO.getCustomerId()); + resiUserFormDTO.setIcResiUserId(formDTO.getUserId()); + Result userRes=epmetUserOpenFeignClient.findUser(resiUserFormDTO); + if(!userRes.success()){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"/epmetuser/user/finduser接口异常","查找居民端小程序用户信息异常"); + } + formDTO.setEpmetUserId(userRes.getData().getEpmetUserId());*/ + //icresiuser/persondata接口已经返回去epmetUserId,这里就不需要再查询了。直接让前端传过来 + List userIds=new ArrayList<>(); + userIds.add(formDTO.getUserId()); + if(CollectionUtils.isNotEmpty(formDTO.getEpmetUserIdList())){ + userIds.addAll(formDTO.getEpmetUserIdList()); + } + //2、小程序内自己上报+赋能平台待录入的 + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), + formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectUserDemand(formDTO)); + List list = pageInfo.getList(); + if (CollectionUtils.isNotEmpty(list)) { + // 1、状态字典 + Result> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_STATUS.getCode()); + Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); + //2、查询分类名称 + List categoryCodes = list.stream().map(IcResiUserReportDemandRes::getCategoryCode).collect(Collectors.toList()); + List dictList = demandDictService.listByCodes(formDTO.getCustomerId(), categoryCodes); + Map dictMap = dictList.stream().collect(Collectors.toMap(IcResiDemandDictEntity::getCategoryCode, IcResiDemandDictEntity::getCategoryName)); + + for (IcResiUserReportDemandRes resDto : list) { + resDto.setStatusName(statusMap.containsKey(resDto.getStatus()) ? statusMap.get(resDto.getStatus()) : StrConstant.EPMETY_STR); + if (null != dictMap && dictMap.containsKey(resDto.getCategoryCode())) { + resDto.setCategoryName(dictMap.get(resDto.getCategoryCode())); + } + } + } + return new PageData<>(list, pageInfo.getTotal()); + } + + /** + * 数据分析-个人档案、居民需求列表-查看需求详情 + * + * @param formDTO + * @return + */ + @Override + public DemandRecResultDTO queryDemandDetail(DemandDetailFormDTO formDTO) { + DemandRecResultDTO res = baseDao.selectDemandRecDetail(formDTO.getCustomerId(), formDTO.getDemandRecId()); + if (null != res) { + CustomerGridFormDTO customerGridFormDTO = new CustomerGridFormDTO(); + customerGridFormDTO.setGridId(res.getGridId()); + Result gridInfoRes = govOrgOpenFeignClient.getGridBaseInfoByGridId(customerGridFormDTO); + res.setGridName(gridInfoRes.success() && null != gridInfoRes.getData() ? gridInfoRes.getData().getGridNamePath() : StrConstant.EPMETY_STR); + + res.setCategoryName(demandDictService.getCategoryName(formDTO.getCustomerId(), res.getCategoryCode())); + res.setFirstCategoryName(demandDictService.getCategoryName(formDTO.getCustomerId(),res.getFirstCategoryCode())); + if (UserDemandConstant.VOLUNTEER.equals(res.getServiceType())) { + // 如果服务方是志愿者,需要查询小程序端的志愿者姓名 + List userIdList = Arrays.asList(res.getServerId()); + Result> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(userIdList); + if (!userInfoRes.success() || CollectionUtils.isEmpty(userInfoRes.getData())) { + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询志愿者信息异常"); + } + res.setServiceName(userInfoRes.getData().get(NumConstant.ZERO).getRealName()); + } + //查询字典表 + Result> reportTypeRes = adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_REPORT_TYPE.getCode()); + Map reportTypeMap = reportTypeRes.success() && MapUtils.isNotEmpty(reportTypeRes.getData()) ? reportTypeRes.getData() : new HashMap<>(); + + Result> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_STATUS.getCode()); + Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); + + Result> serviceTypeRes = adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_SERVICE_TYPE.getCode()); + Map serviceTypeMap = serviceTypeRes.success() && MapUtils.isNotEmpty(serviceTypeRes.getData()) ? serviceTypeRes.getData() : new HashMap<>(); + + //社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help + res.setReportTypeName(reportTypeMap.containsKey(res.getReportType()) ? reportTypeMap.get(res.getReportType()) : StrConstant.EPMETY_STR); + + //待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished + res.setStatusName(statusMap.containsKey(res.getStatus()) ? statusMap.get(res.getStatus()) : StrConstant.EPMETY_STR); + + //服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + res.setServiceShowName(serviceTypeMap.containsKey(res.getServiceType()) ? res.getServiceName().concat("(").concat(serviceTypeMap.get(res.getServiceType())).concat(")") : StrConstant.EPMETY_STR); + } + return res; + } + + /** + * 计算出服务方,评价总分,服务的需求个数 + * + * @param customerId + * @param partyUnitId + * @return + */ + @Override + public List groupByPartyUnit(String customerId, String partyUnitId) { + if(StringUtils.isBlank(customerId)&&StringUtils.isBlank(partyUnitId)){ + return new ArrayList<>(); + } + return baseDao.selectGroupByPartyUnit(customerId,partyUnitId); + } + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java index 71b318ba0a..a0ac541131 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java @@ -42,12 +42,16 @@ import com.epmet.dto.form.resi.ResiSendSmsCodeFormDTO; import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO; import com.epmet.dto.result.ResiUserBaseInfoResultDTO; import com.epmet.dto.result.SendVerificationCodeResultDTO; +import com.epmet.dto.result.UserBaseInfoResultDTO; +import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.resi.ResiVolunteerInfoResultDTO; import com.epmet.entity.VolunteerInfoEntity; import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.service.HeartUserInfoService; import com.epmet.service.VolunteerInfoService; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; @@ -56,6 +60,9 @@ import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; /** * 志愿者信息 @@ -220,4 +227,35 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl queryListVolunteer(String customerId, String userRealName) { + List resultList = new ArrayList<>(); + List userIds = baseDao.selectVolunteerIds(customerId); + if (CollectionUtils.isEmpty(userIds)) { + return resultList; + } + Result> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(userIds); + if (userInfoRes.success() && CollectionUtils.isNotEmpty(userInfoRes.getData())) { + Map userMap = userInfoRes.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, Function.identity())); + for (String userId : userIds) { + if (userMap.containsKey(userId)) { + if (StringUtils.isNoneBlank(userRealName)) { + if (userMap.get(userId).getRealName().contains(userRealName)) { + OptionDTO optionDTO = new OptionDTO(); + optionDTO.setLabel(userMap.get(userId).getRealName().concat("(").concat(userMap.get(userId).getMobile().concat(")"))); + optionDTO.setValue(userId); + resultList.add(optionDTO); + } + } else { + OptionDTO optionDTO = new OptionDTO(); + optionDTO.setLabel(userMap.get(userId).getRealName().concat("(").concat(userMap.get(userId).getMobile().concat(")"))); + optionDTO.setValue(userId); + resultList.add(optionDTO); + } + } + } + } + return resultList; + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml index fe4ff2e5fa..11e6aea570 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml @@ -141,7 +141,10 @@ dingTalk: robot: webHook: @dingTalk.robot.webHook@ secret: @dingTalk.robot.secret@ - +rocketmq: + # 是否开启mq + enable: @rocketmq.enable@ + name-server: @rocketmq.nameserver@ # 停机选项 shutdown: graceful: diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml new file mode 100644 index 0000000000..aff4bf4c67 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml @@ -0,0 +1,100 @@ + + + + + + + + UPDATE ic_community_self_organization + SET ORGANIZATION_NAME = #{organizationName}, + ORGANIZATION_PERSON_COUNT = #{organizationPersonCount}, + PRINCIPAL_NAME = #{principalName}, + PRINCIPAL_PHONE = #{principalPhone}, + SERVICE_ITEM = #{serviceItem}, + LONGITUDE = #{longitude}, + LATITUDE = #{latitude}, + ORGANIZATION_CREATED_TIME = #{organizationCreatedTime}, + UPDATED_TIME = NOW(), + UPDATED_BY = #{updatedBy} + WHERE DEL_FLAG = 0 + AND ID = #{orgId} + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationPersonnelDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationPersonnelDao.xml new file mode 100644 index 0000000000..f3b365f739 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationPersonnelDao.xml @@ -0,0 +1,10 @@ + + + + + + + + DELETE FROM ic_community_self_organization_personnel WHERE ORG_ID = #{orgId} + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml new file mode 100644 index 0000000000..fd84685f0e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml new file mode 100644 index 0000000000..024b33adf6 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + update ic_party_unit + set SATISFACTION=#{satisfaction},UPDATED_TIME=NOW() + where del_flag='0' + and id=#{partyUnitId} + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml index ae0c5a1e7f..be50e98601 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml @@ -23,21 +23,29 @@ + + + select="selectChildDemands" column="customerId=customerId,parentCode=value,usableFlagFormValue=usable_flag_form_value"> @@ -45,7 +53,10 @@ SELECT CUSTOMER_ID AS customerId, CATEGORY_CODE AS "value", - CATEGORY_NAME AS "label" + CATEGORY_NAME AS "label", + PARENT_CODE as pValue, + #{usableFlagFormValue} as usable_flag_form_value, + USABLE_FLAG as usableFlag FROM ic_resi_demand_dict WHERE @@ -53,6 +64,9 @@ AND LEVEL = 2 AND CUSTOMER_ID = #{customerId} AND PARENT_CODE = #{parentCode} + + and USABLE_FLAG=#{usableFlagFormValue} + ORDER BY SORT ASC @@ -74,4 +88,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcSocietyOrgDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcSocietyOrgDao.xml new file mode 100644 index 0000000000..56daf5dc2b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcSocietyOrgDao.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandOperateLogDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandOperateLogDao.xml new file mode 100644 index 0000000000..0d1b2c9f14 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandOperateLogDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml new file mode 100644 index 0000000000..f352685356 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml @@ -0,0 +1,220 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandSatisfactionDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandSatisfactionDao.xml new file mode 100644 index 0000000000..08d7883eb1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandSatisfactionDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandServiceDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandServiceDao.xml new file mode 100644 index 0000000000..219f457444 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandServiceDao.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml index d4bd179a9d..4dc80881f2 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml @@ -69,9 +69,10 @@ diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java index 5d6cd6190c..284be1cb95 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java @@ -100,4 +100,8 @@ public interface SystemMessageType { */ String IC_RESI_USER_DEL = "ic_resi_user_del"; + /** + * 需求完成,如果服务方是区域化党建单位,重新计算这个单位的满意度 + */ + String CAL_PARTY_UNIT_SATISFACTION = "cal_party_unit_satisfaction"; } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java index c57bd798f6..ca4f862049 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java @@ -192,6 +192,9 @@ public class SystemMessageServiceImpl implements SystemMessageService { case SystemMessageType.IC_RESI_USER_DEL: topic = TopicConstants.IC_RESI_USER; break; + case SystemMessageType.CAL_PARTY_UNIT_SATISFACTION: + topic=TopicConstants.CAL_PARTY_UNIT_SATISFACTION; + break; } return topic; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcMatterAppointmentRecordDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcMatterAppointmentRecordDTO.java new file mode 100644 index 0000000000..27ee8af29b --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcMatterAppointmentRecordDTO.java @@ -0,0 +1,131 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 事项预约记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcMatterAppointmentRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * + */ + private String customerId; + + /** + * 组织ID + */ + private String orgId; + + /** + * 组织类型,agency:组织,grid:网格 + */ + private String orgType; + + /** + * + */ + private String pid; + + /** + * + */ + private String pids; + + /** + * 事项ID + */ + private String matterId; + + /** + * 预约日期 + */ + private String appointmentDate; + + /** + * 预约人 + */ + private String appointmentName; + + /** + * 预约电话 + */ + private String appointmentPhone; + + /** + * 备注 + */ + private String remark; + + /** + * 预约状态【cancel:取消,appointing:预约中】 + */ + private String status; + + /** + * + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private String revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 1,2,5 + */ + private String timeId; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPartyServiceCenterDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPartyServiceCenterDTO.java new file mode 100644 index 0000000000..50430c31b5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPartyServiceCenterDTO.java @@ -0,0 +1,141 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 党群服务中心 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcPartyServiceCenterDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String orgId; + + /** + * 组织类型,agency:组织,grid:网格 + */ + private String orgType; + + /** + * + */ + private String pid; + + /** + * + */ + private String pids; + + /** + * 中心名称 + */ + private String centerName; + + /** + * 办公电话 + */ + private String workPhone; + + /** + * 上午开始办公时间 + */ + private String amStartTime; + + /** + * 上午结束办公时间 + */ + private String amEndTime; + + /** + * 下午开始办公时间 + */ + private String pmStartTime; + + /** + * 下午结束办公时间 + */ + private String pmEndTime; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 地址 + */ + private String address; + + /** + * + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private String revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPartyServiceCenterMatterDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPartyServiceCenterMatterDTO.java new file mode 100644 index 0000000000..42b028df98 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPartyServiceCenterMatterDTO.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 党群服务中心可预约事项表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcPartyServiceCenterMatterDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 党群服务中心ID + */ + private String partyServiceCenterId; + + /** + * 事项名字 + */ + private String matterName; + + /** + * 预约类型,每天:everyDay,工作日:workDay,周末:weekend + */ + private String appointmentType; + + /** + * 可预约开始时间 + */ + private String startTime; + + /** + * 可预约结束时间 + */ + private String endTime; + + /** + * + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private String revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 客户ID + */ + 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/IcPlaceOrgDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPlaceOrgDTO.java new file mode 100644 index 0000000000..f836ce406f --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPlaceOrgDTO.java @@ -0,0 +1,131 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 九小场所下组织管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcPlaceOrgDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织Id + */ + private String agencyId; + + /** + * agency_id的所有上级 + */ + private String pids; + + /** + * 网格Id【场所区域】 + */ + private String gridId; + + /** + * 场所类型【admin库sys_dict_data表九小场所value值】 + */ + private String ninePlaceVal; + + /** + * 场所名称 + */ + private String placeOrgName; + + /** + * 场所地址 + */ + private String address; + + /** + * 字典value,场所规模【 +0:10人以下 +1:10-20人 +2:21-40人 +3:41-100人 +4:100人以上】 + */ + private String scale; + + /** + * 场所负责人 + */ + private String personInCharge; + + /** + * 负责人电话 + */ + private String mobile; + + /** + * 备注 + */ + private String remarks; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPlacePatrolRecordDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPlacePatrolRecordDTO.java new file mode 100644 index 0000000000..519ec4f1a4 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPlacePatrolRecordDTO.java @@ -0,0 +1,146 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 场所巡查记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcPlacePatrolRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织Id + */ + private String agencyId; + + /** + * agency_id的所有上级 + */ + private String pids; + + /** + * 网格Id【场所区域】 + */ + private String gridId; + + /** + * 场所类型【admin库sys_dict_data表九小场所value值】 + */ + private String ninePlaceVal; + + /** + * 场所下的组织Id + */ + private String placeOrgId; + + /** + * 场所下分队(place_patrolteam)表Id + */ + private String placePatrolTeamId; + + /** + * 分队下检查人员Id,分号分隔 + */ + private String inspectors; + + /** + * 首次巡查时间 + */ + private Date firstTime; + + /** + * 隐患明细 + */ + private String detailed; + + /** + * 首次检查结果【0:合格 1:不合格】 + */ + private String firstResult; + + /** + * 拟复查时间 + */ + private Date reviewTime; + + /** + * 最终检查结果【0:合格 1:不合格】初始数据默认和首次检查结果相同 + */ + private String finalResult; + + /** + * 最新复查时间【初始数据默认和首次巡查时间相同】 + */ + private Date finalTime; + + /** + * 备注 + */ + private String remarks; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPlacePatrolReviewRecordDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPlacePatrolReviewRecordDTO.java new file mode 100644 index 0000000000..d93e3928c7 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPlacePatrolReviewRecordDTO.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 场所巡查复查记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcPlacePatrolReviewRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 巡查记录主(place_patrol_record)表Id + */ + private String placePatrolRecordId; + + /** + * 场所下分队(place_patrol_team)表Id + */ + private String placePatrolTeamId; + + /** + * 检查人员Id,逗号分隔 + */ + private String inspectors; + + /** + * 复查时间 + */ + private Date reviewTime; + + /** + * 复查隐患明细 + */ + private String detailed; + + /** + * 复查检查结果【0:合格 1:不合格】 + */ + private String reviewResult; + + /** + * 备注 + */ + private String remarks; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPlacePatrolTeamDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPlacePatrolTeamDTO.java new file mode 100644 index 0000000000..7e4531f0a4 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPlacePatrolTeamDTO.java @@ -0,0 +1,126 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 场所分队管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcPlacePatrolTeamDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织Id + */ + private String agencyId; + + /** + * agency_id的所有上级 + */ + private String pids; + + /** + * 负责区域【网格Id 多个值逗号分隔】 + */ + private String gridIds; + + /** + * 负责场所类型【admin库sys_dict_data表九小场所value值 多个值逗号分隔】 + */ + private String ninePlaceVals; + + /** + * 分队名称 + */ + private String teamName; + + /** + * 巡查计划 + */ + private String plan; + + /** + * 创建(建队)时间 + */ + private Date time; + + /** + * 场所负责人 + */ + private String personInCharge; + + /** + * 负责人电话 + */ + private String mobile; + + /** + * 备注 + */ + private String remarks; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiDemandDictDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPlacePatrolTeamStaffDTO.java similarity index 78% rename from epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiDemandDictDTO.java rename to epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPlacePatrolTeamStaffDTO.java index ccdb6f5752..36eb03ac3a 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiDemandDictDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPlacePatrolTeamStaffDTO.java @@ -17,20 +17,19 @@ package com.epmet.dto; -import lombok.Data; - import java.io.Serializable; import java.util.Date; +import lombok.Data; /** - * 居民需求字典表 + * 场所分队下人员管理 * * @author generator generator@elink-cn.com - * @since v1.0.0 2021-10-27 + * @since v1.0.0 2021-11-18 */ @Data -public class IcResiDemandDictDTO implements Serializable { +public class IcPlacePatrolTeamStaffDTO implements Serializable { private static final long serialVersionUID = 1L; @@ -40,39 +39,29 @@ public class IcResiDemandDictDTO implements Serializable { private String id; /** - * 客户Id customer.id + * 客户Id */ private String customerId; /** - * 父级 + * 巡查分队(place_patrol_team)表Id */ - private String parentCode; + private String placePatrolTeamId; /** - * 字典值 + * 成员姓名 */ - private String categoryCode; + private String name; /** - * 字典描述 + * 成员电话 */ - private String categoryName; - - /** - * 级别 - */ - private String level; + private String mobile; /** * 备注 */ - private String remark; - - /** - * 排序 - */ - private Integer sort; + private String remarks; /** * 删除标识:0.未删除 1.已删除 diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/MatterListDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/MatterListDTO.java new file mode 100644 index 0000000000..95c545f656 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/MatterListDTO.java @@ -0,0 +1,47 @@ +package com.epmet.dto; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/22 2:41 下午 + * @DESC + */ +@Data +public class MatterListDTO implements Serializable { + + private static final long serialVersionUID = 493404409015559029L; + + private Integer sort; + + /** + * 事项名 + */ + private String matterName; + + /** + * 事项ID + */ + private String matterId; + + /** + * 可预约时间 + */ + private String allowTime; + + private String startTime; + + private String endTime; + + private String appointmentType; + + public MatterListDTO() { + this.sort = NumConstant.ZERO; + this.matterName = ""; + this.matterId = ""; + this.allowTime = ""; + } +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/TimeDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/TimeDTO.java new file mode 100644 index 0000000000..00b01c30fe --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/TimeDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/22 3:56 下午 + * @DESC + */ +@Data +public class TimeDTO implements Serializable { + + private static final long serialVersionUID = -3290964095027429971L; + + private String timeId; + + private Boolean isAppointment = true; + + private String time; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPartyServiceCenterFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPartyServiceCenterFormDTO.java new file mode 100644 index 0000000000..2c122705c7 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPartyServiceCenterFormDTO.java @@ -0,0 +1,80 @@ +package com.epmet.dto.form; + +import com.epmet.dto.IcPartyServiceCenterMatterDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/11/22 9:05 上午 + * @DESC + */ +@Data +public class AddPartyServiceCenterFormDTO implements Serializable { + + private static final long serialVersionUID = -230856877756036529L; + + public interface AddPartyServiceCenterForm{} + + /** + * 中心名称 + */ + @NotBlank(message = "centerName不能为空",groups = AddPartyServiceCenterForm.class) + private String centerName; + + /** + * 社区地址 + */ + @NotBlank(message = "address不能为空",groups = AddPartyServiceCenterForm.class) + private String address; + + /** + * 办公电话 + */ + @NotBlank(message = "workPhone不能为空",groups = AddPartyServiceCenterForm.class) + private String workPhone; + + /** + * 上午开始时间 + */ + @NotBlank(message = "amStartTime不能为空",groups = AddPartyServiceCenterForm.class) + private String amStartTime; + + /** + * 上午结束时间 + */ + @NotBlank(message = "amEndTime不能为空",groups = AddPartyServiceCenterForm.class) + private String amEndTime; + + /** + * 下午开始时间 + */ + @NotBlank(message = "pmStartTime不能为空",groups = AddPartyServiceCenterForm.class) + private String pmStartTime; + + /** + * 下午结束时间 + */ + @NotBlank(message = "pmEndTime不能为空",groups = AddPartyServiceCenterForm.class) + private String pmEndTime; + + /** + * 经度 + */ + @NotBlank(message = "longitude不能为空",groups = AddPartyServiceCenterForm.class) + private String longitude; + + /** + * 纬度 + */ + @NotBlank(message = "latitude不能为空",groups = AddPartyServiceCenterForm.class) + private String latitude; + + /** + * 可预约事项 + */ + private List matterList; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlaceOrgFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlaceOrgFormDTO.java new file mode 100644 index 0000000000..a3d56416c0 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlaceOrgFormDTO.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * @Author sun + * @Description 新增九小场所下组织 + **/ +@Data +public class AddPlaceOrgFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + /** + * 客户Id + */ + private String customerId; + /** + * 组织Id + */ + private String agencyId; + /** + * agency_id的所有上级 + */ + private String pids; + /** + * 网格Id【场所区域】 + */ + @NotBlank(message = "场所区域不能为空", groups = {Add.class}) + private String gridId; + /** + * 场所类型【admin库sys_dict_data表九小场所value值】 + */ + @NotBlank(message = "场所类型不能为空", groups = {Add.class}) + private String ninePlaceVal; + /** + * 场所名称 + */ + @NotBlank(message = "场所名称不能为空", groups = {Add.class}) + @Length(max = 20, message = "场所名称不能超过20个字符", groups = {Add.class}) + private String placeOrgName; + /** + * 场所地址 + */ + @NotBlank(message = "场所地址不能为空", groups = {Add.class}) + @Length(max = 100, message = "场所地址不能超过100个字符", groups = {Add.class}) + private String address; + /** + * 字典value,场所规模【0:10人以下 1:10-20人 2:21-40人 3:41-100人 4:100人以上】 + */ + @NotBlank(message = "场所规模不能为空", groups = {Add.class}) + private String scale; + /** + * 场所负责人 + */ + @NotBlank(message = "负责人名称不能为空", groups = {Add.class}) + @Length(max = 20, message = "负责人名称不能超过20个字符", groups = {Add.class}) + private String personInCharge; + /** + * 负责人电话 + */ + @NotBlank(message = "负责人电话不能为空", groups = {Add.class}) + @Length(max = 11, message = "负责人电话不能超过11个字符", groups = {Add.class}) + private String mobile; + /** + * 备注 + */ + private String remarks; + //token中userId + private String staffId; + + public interface Add { } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolRecordFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolRecordFormDTO.java new file mode 100644 index 0000000000..cb8b6b2724 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolRecordFormDTO.java @@ -0,0 +1,127 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + + +/** + * @Author sun + * @Description 新增场所巡查记录 + **/ +@Data +public class AddPlacePatrolRecordFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织Id + */ + private String agencyId; + + /** + * agency_id的所有上级 + */ + private String pids; + + /** + * 网格Id【场所区域】 + */ + @NotBlank(message = "场所区域不能为空", groups = {Add.class}) + private String gridId; + /** + * 场所类型【admin库sys_dict_data表九小场所value值】 + */ + @NotBlank(message = "场所类型不能为空", groups = {Add.class}) + private String ninePlaceVal; + + /** + * 场所下的组织Id + */ + @NotBlank(message = "场所名称不能为空", groups = {Add.class}) + private String placeOrgId; + + /** + * 场所下分队(place_patrolteam)表Id + */ + @NotBlank(message = "分队名称不能为空", groups = {Add.class}) + private String placePatrolTeamId; + + /** + * 分队下检查人员Id,分号分隔 + */ + @NotBlank(message = "检察人员不能为空", groups = {Add.class}) + private String inspectors; + + /** + * 首次巡查时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date firstTime; + + /** + * 隐患明细 + */ + @NotBlank(message = "隐患明细不能为空", groups = {Add.class}) + //@Length(max = 200, message = "隐患明细不能超过200个字符", groups = {Add.class}) + private String detailed; + + /** + * 首次检查结果【0:合格 1:不合格】 + */ + @NotBlank(message = "首次检查结果不能为空", groups = {Add.class}) + private String firstResult; + + /** + * 拟复查时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date reviewTime; + + /** + * 最终检查结果【0:合格 1:不合格】初始数据默认和首次检查结果相同 + */ + private String finalResult; + + /** + * 最新复查时间【初始数据默认和首次巡查时间相同】 + */ + private Date finalTime; + + /** + * 备注 + */ + private String remarks; + + + //token中userId + private String staffId; + + public interface Add {} + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolReviewRecordFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolReviewRecordFormDTO.java new file mode 100644 index 0000000000..fefc67e2ea --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolReviewRecordFormDTO.java @@ -0,0 +1,84 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + + +/** + * @Author sun + * @Description 新增巡查复查记录 + **/ +@Data +public class AddPlacePatrolReviewRecordFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 巡查记录主(place_patrol_record)表Id + */ + @NotBlank(message = "巡查记录Id不能为空", groups = {Add.class}) + private String placePatrolRecordId; + + /** + * 场所下分队(place_patrol_team)表Id + */ + @NotBlank(message = "分队名称不能为空", groups = {Add.class}) + private String placePatrolTeamId; + + /** + * 检查人员Id,逗号分隔 + */ + @NotBlank(message = "检查人员不能为空", groups = {Add.class}) + private String inspectors; + + /** + * 复查时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date reviewTime; + + /** + * 复查隐患明细 + */ + private String detailed; + + /** + * 复查检查结果【0:合格 1:不合格】 + */ + @NotBlank(message = "复查检查结果不能为空", groups = {Add.class}) + private String reviewResult; + + /** + * 备注 + */ + private String remarks; + + public interface Add { } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolTeamFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolTeamFormDTO.java new file mode 100644 index 0000000000..a0ece62eb1 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolTeamFormDTO.java @@ -0,0 +1,125 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import com.fasterxml.jackson.annotation.JsonFormat; +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.Date; +import java.util.List; + + +/** + * @Author sun + * @Description 新增九小场所巡查分队人员管理 + **/ +@Data +public class AddPlacePatrolTeamFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织Id + */ + private String agencyId; + + /** + * agency_id的所有上级 + */ + private String pids; + + /** + * 网格Id【场所区域】 + */ + @NotBlank(message = "场所区域不能为空", groups = {Add.class}) + private String gridIds; + /** + * 场所类型【admin库sys_dict_data表九小场所value值】 + */ + @NotBlank(message = "场所类型不能为空", groups = {Add.class}) + private String ninePlaceVals; + + /** + * 分队名称 + */ + @NotBlank(message = "分队名称不能为空", groups = {Add.class}) + @Length(max = 20, message = "分队名称不能超过20个字符", groups = {Add.class}) + private String teamName; + + /** + * 巡查计划 + */ + @NotBlank(message = "巡查计划不能为空", groups = {Add.class}) + @Length(max = 200, message = "巡查计划不能超过200个字符", groups = {Add.class}) + private String plan; + + /** + * 创建(建队)时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date time; + + /** + * 场所负责人 + */ + @NotBlank(message = "负责人名称不能为空", groups = {Add.class}) + @Length(max = 20, message = "负责人名称不能超过20个字符", groups = {Add.class}) + private String personInCharge; + /** + * 负责人电话 + */ + @NotBlank(message = "负责人电话不能为空", groups = {Add.class}) + @Length(max = 11, message = "负责人电话不能超过11个字符", groups = {Add.class}) + private String mobile; + + /** + * 备注 + */ + private String remarks; + + /** + * 分队成员信息 + */ + @Valid + @NotEmpty(message = "成员列表不能为空", groups = {Add.class}) + private List memberList; + + //token中userId + private String staffId; + + public interface Add { } + + @Data + public static class Member { + //姓名 + private String name; + //联系电话 + private String mobile; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AppointmentFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AppointmentFormDTO.java new file mode 100644 index 0000000000..a1caadfd14 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AppointmentFormDTO.java @@ -0,0 +1,54 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/22 2:00 下午 + * @DESC + */ +@Data +public class AppointmentFormDTO implements Serializable { + + private static final long serialVersionUID = -7113952715343314153L; + + public interface AppointmentForm{} + + /** + * 事项ID + */ + @NotBlank(message = "matterId不能为空",groups = AppointmentForm.class) + private String matterId; + + /** + * 预约日期 + */ + @NotBlank(message = "appointmentDate不能为空",groups = AppointmentForm.class) + private String appointmentDate; + + /** + * 预约编号 + */ + @NotBlank(message = "timeId不能为空",groups = AppointmentForm.class) + private String timeId; + + /** + * 预约人 + */ + @NotBlank(message = "appointmentName不能为空",groups = AppointmentForm.class) + private String appointmentName; + + /** + * 预约电话 + */ + @NotBlank(message = "appointmentPhone不能为空",groups = AppointmentForm.class) + private String appointmentPhone; + + /** + * 备注 + */ + private String remark; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AppointmentRecordFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AppointmentRecordFormDTO.java new file mode 100644 index 0000000000..ef3783f1fa --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AppointmentRecordFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.time.LocalDate; + +/** + * @Author zxc + * @DateTime 2021/11/23 10:42 上午 + * @DESC + */ +@Data +public class AppointmentRecordFormDTO implements Serializable { + + private static final long serialVersionUID = 2021698309505676292L; + + public interface AppointmentRecordForm{} + + @NotBlank(message = "matterId不能为空",groups = AppointmentRecordForm.class) + private String matterId; + + @NotBlank(message = "date不能为空",groups = AppointmentRecordForm.class) + private String date; + + public AppointmentRecordFormDTO() { + this.date = LocalDate.now().toString(); + } +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AppointmentTimeFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AppointmentTimeFormDTO.java new file mode 100644 index 0000000000..241aba3802 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AppointmentTimeFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/23 9:57 上午 + * @DESC + */ +@Data +public class AppointmentTimeFormDTO implements Serializable { + + private static final long serialVersionUID = -3645075481936669437L; + + public interface AppointmentTimeForm{} + + /** + * 事项ID + */ + @NotBlank(message = "matterId不能为空",groups = AppointmentTimeForm.class) + private String matterId; + + /** + * 日期,默认当天 + */ + @NotBlank(message = "date不能为空",groups = AppointmentTimeForm.class) + private String date; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CancelAppointmentFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CancelAppointmentFormDTO.java new file mode 100644 index 0000000000..51faf2aa6d --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CancelAppointmentFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/26 5:19 下午 + * @DESC + */ +@Data +public class CancelAppointmentFormDTO implements Serializable { + + private static final long serialVersionUID = 8646430374802086292L; + + public interface CancelAppointmentForm{} + + @NotBlank(message = "recordId不能为空",groups = CancelAppointmentForm.class) + private String recordId; + + private String userId; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerGridFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerGridFormDTO.java index c34d3c5870..1949f6d8a8 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerGridFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerGridFormDTO.java @@ -31,11 +31,12 @@ import java.io.Serializable; public class CustomerGridFormDTO implements Serializable { private static final long serialVersionUID = 1L; - /** * 网格Id */ - @NotBlank(message = "网格ID不能为空") + @NotBlank(message = "网格ID不能为空", groups = {Grid.class}) private String gridId; + public interface Grid{} + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DelMatterFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DelMatterFormDTO.java new file mode 100644 index 0000000000..2c45e104b5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DelMatterFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/22 11:11 上午 + * @DESC + */ +@Data +public class DelMatterFormDTO implements Serializable { + + private static final long serialVersionUID = -5351894549285626126L; + + public interface DelMatterForm{} + + /** + * 事项ID + */ + @NotBlank(message = "matterId不能为空",groups = DelMatterForm.class) + private String matterId; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPartyServiceCenterFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPartyServiceCenterFormDTO.java new file mode 100644 index 0000000000..d292fa6ae2 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPartyServiceCenterFormDTO.java @@ -0,0 +1,91 @@ +package com.epmet.dto.form; + +import com.epmet.dto.IcPartyServiceCenterMatterDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/11/22 9:05 上午 + * @DESC + */ +@Data +public class EditPartyServiceCenterFormDTO implements Serializable { + + private static final long serialVersionUID = -231856877756036529L; + + public interface EditPartyServiceCenterForm{} + + /** + * 中心名称 + */ + @NotBlank(message = "centerName不能为空",groups = EditPartyServiceCenterForm.class) + private String centerName; + + /** + * 社区地址 + */ + @NotBlank(message = "address不能为空",groups = EditPartyServiceCenterForm.class) + private String address; + + /** + * 办公电话 + */ + @NotBlank(message = "workPhone不能为空",groups = EditPartyServiceCenterForm.class) + private String workPhone; + + /** + * 上午开始时间 + */ + @NotBlank(message = "amStartTime不能为空",groups = EditPartyServiceCenterForm.class) + private String amStartTime; + + /** + * 上午结束时间 + */ + @NotBlank(message = "amEndTime不能为空",groups = EditPartyServiceCenterForm.class) + private String amEndTime; + + /** + * 下午开始时间 + */ + @NotBlank(message = "pmStartTime不能为空",groups = EditPartyServiceCenterForm.class) + private String pmStartTime; + + /** + * 下午结束时间 + */ + @NotBlank(message = "pmEndTime不能为空",groups = EditPartyServiceCenterForm.class) + private String pmEndTime; + + /** + * 经度 + */ + @NotBlank(message = "longitude不能为空",groups = EditPartyServiceCenterForm.class) + private String longitude; + + /** + * 纬度 + */ + @NotBlank(message = "latitude不能为空",groups = EditPartyServiceCenterForm.class) + private String latitude; + + /** + * 党群服务中心ID + */ + @NotBlank(message = "partyServiceCenterId不能为空",groups = EditPartyServiceCenterForm.class) + private String partyServiceCenterId; + + /** + * 新增的可预约事项 + */ + private List matterList; + + /** + * 要删除的事项 + */ + private List delMatterList; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlaceOrgFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlaceOrgFormDTO.java new file mode 100644 index 0000000000..d4863f9cb9 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlaceOrgFormDTO.java @@ -0,0 +1,84 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * @Author sun + * @Description 修改、删除九小场所下组织 + **/ +@Data +public class EditPlaceOrgFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + /** + * 场所Id + */ + @NotBlank(message = "场所Id不能为空", groups = {Edit.class, Del.class, Detail.class}) + private String placeOrgId; + /** + * 网格Id【场所区域】 + */ + private String gridId; + /** + * 场所类型【admin库sys_dict_data表九小场所value值】 + */ + private String ninePlaceVal; + /** + * 场所名称 + */ + @Length(max = 20, message = "场所名称不能超过20个字符", groups = {Edit.class}) + private String placeOrgName; + /** + * 场所地址 + */ + @Length(max = 100, message = "场所地址不能超过100个字符", groups = {Edit.class}) + private String address; + /** + * 字典value,场所规模【0:10人以下 1:10-20人 2:21-40人 3:41-100人 4:100人以上】 + */ + private String scale; + /** + * 场所负责人 + */ + @Length(max = 20, message = "负责人名称不能超过20个字符", groups = {Edit.class}) + private String personInCharge; + /** + * 负责人电话 + */ + @Length(max = 11, message = "负责人电话不能超过11个字符", groups = {Edit.class}) + private String mobile; + /** + * 备注 + */ + private String remarks; + + public interface Edit { } + + public interface Del { } + + public interface Detail { } + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolRecordFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolRecordFormDTO.java new file mode 100644 index 0000000000..ea24f0613b --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolRecordFormDTO.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * @Author sun + * @Description 删除、详情场所巡查记录 + **/ +@Data +public class EditPlacePatrolRecordFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + /** + * 巡查记录Id + */ + @NotBlank(message = "巡查记录Id不能为空", groups = {Del.class, Detail.class}) + private String placePatrolRecordId; + + + public interface Del { } + public interface Detail { } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolReviewRecordFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolReviewRecordFormDTO.java new file mode 100644 index 0000000000..0ceff8ebab --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolReviewRecordFormDTO.java @@ -0,0 +1,79 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + + +/** + * @Author sun + * @Description 修改、删除、详情巡查复查记录 + **/ +@Data +public class EditPlacePatrolReviewRecordFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + /** + * 复查记录Id + */ + @NotBlank(message = "复查记录Id不能为空", groups = {Edit.class, Del.class, Detail.class}) + private String placePatrolReviewRecordId; + + /** + * 场所下分队(place_patrol_team)表Id + */ + private String placePatrolTeamId; + + /** + * 检查人员Id,逗号分隔 + */ + private String inspectors; + + /** + * 复查时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date reviewTime; + + /** + * 复查隐患明细 + */ + private String detailed; + + /** + * 复查检查结果【0:合格 1:不合格】 + */ + private String reviewResult; + + /** + * 备注 + */ + private String remarks; + + public interface Edit { } + public interface Del { } + public interface Detail { } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolTeamFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolTeamFormDTO.java new file mode 100644 index 0000000000..4509c6f443 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolTeamFormDTO.java @@ -0,0 +1,114 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + + +/** + * @Author sun + * @Description 修改、删除九小场所巡查分队人员管理 + **/ +@Data +public class EditPlacePatrolTeamFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + /** + * 分队Id + */ + @NotBlank(message = "分队Id不能为空", groups = {Edit.class, Del.class, Detail.class}) + private String teamId; + + /** + * 网格Id【场所区域】 + */ + private String gridIds; + /** + * 场所类型【admin库sys_dict_data表九小场所value值】 + */ + private String ninePlaceVals; + + /** + * 分队名称 + */ + @Length(max = 20, message = "分队名称不能超过20个字符", groups = {AddPlacePatrolTeamFormDTO.Add.class}) + private String teamName; + + /** + * 巡查计划 + */ + @Length(max = 200, message = "巡查计划不能超过200个字符", groups = {AddPlacePatrolTeamFormDTO.Add.class}) + private String plan; + + /** + * 创建(建队)时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date time; + + /** + * 场所负责人 + */ + @Length(max = 20, message = "负责人名称不能超过20个字符", groups = {AddPlacePatrolTeamFormDTO.Add.class}) + private String personInCharge; + /** + * 负责人电话 + */ + @Length(max = 11, message = "负责人电话不能超过11个字符", groups = {AddPlacePatrolTeamFormDTO.Add.class}) + private String mobile; + + /** + * 备注 + */ + private String remarks; + + /** + * 分队成员信息 + */ + private List memberList; + + public interface Edit { + } + + public interface Del { + } + + public interface Detail { + } + + @Data + public static class Member { + //姓名 + private String name; + //联系电话 + private String mobile; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlaceOrgFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlaceOrgFormDTO.java new file mode 100644 index 0000000000..4725a8b32d --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlaceOrgFormDTO.java @@ -0,0 +1,60 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import java.io.Serializable; + + +/** + * @Author sun + * @Description 九小场所下组织列表查询 + **/ +@Data +public class GetListPlaceOrgFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + //场所名称 + private String placeOrgName; + //联系电话 + private String mobile; + //场所规模【 0:10人以下 1:10-20人 2:21-40人 3:41-100人 4:100人以上】 + private String scale; + //场所区域【网格Id】 + private String gridId; + //场所类型【九小场所Value值】 + private String ninePlaceVal; + //是否分页(是:true 否:false) 有这个参数是给新增巡查记录时用的,默认是 + private Boolean isPage = true; + //页码 + @Min(1) + private Integer pageNo = 1; + //每页多少条 + private Integer pageSize = 20; + //token中客户Id + private String customerId; + //场所Id + private String placeOrgId; + //token中userId + private String staffId; + //token中userId所属组织的pid + private String pids; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolRecordFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolRecordFormDTO.java new file mode 100644 index 0000000000..f176bca7ba --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolRecordFormDTO.java @@ -0,0 +1,58 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import java.io.Serializable; + + +/** + * @Author sun + * @Description 场所巡查记录列表查询 + **/ +@Data +public class GetListPlacePatrolRecordFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + //场所名称 + private String placeOrgName; + //首次检查结果【0:合格 1:不合格】 + private String firstResult; + //场所区域【网格Id】 + private String gridId; + //场所类型【九小场所Value值】 + private String ninePlaceVal; + //最终检查结果【0:合格 1:不合格】 + private String finalResult; + //页码 + @Min(1) + private Integer pageNo = 1; + //每页多少条 + private Integer pageSize = 20; + //token中客户Id + private String customerId; + //巡查记录Id + private String placePatrolRecordId; + //token中userId + private String staffId; + //token中userId所属组织的pid + private String pids; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolReviewRecordFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolReviewRecordFormDTO.java new file mode 100644 index 0000000000..a4f0eeae0a --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolReviewRecordFormDTO.java @@ -0,0 +1,48 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * @Author sun + * @Description 巡查复查记录列表查询 + **/ +@Data +public class GetListPlacePatrolReviewRecordFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + //巡查记录Id + @NotBlank(message = "巡查记录Id不能为空", groups = {GetData.class}) + private String placePatrolRecordId; + //复查记录Id + private String placePatrolReviewRecordId; + //页码 + @Min(1) + private Integer pageNo = 1; + //每页多少条 + private Integer pageSize = 20; + //token中客户Id + private String customerId; + public interface GetData { } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolTeamFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolTeamFormDTO.java new file mode 100644 index 0000000000..381a085107 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolTeamFormDTO.java @@ -0,0 +1,58 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import java.io.Serializable; + + +/** + * @Author sun + * @Description 九小场所巡查分队人员管理列表查询 + **/ +@Data +public class GetListPlacePatrolTeamFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + //负责人 + private String personInCharge; + //联系电话 + private String mobile; + //场所区域【网格Id】 + private String gridId; + //场所类型【九小场所Value值】 + private String ninePlaceVal; + //是否分页(是:true 否:false) 有这个参数是给新增巡查记录时用的,默认是 + private Boolean isPage = true; + //页码 + @Min(1) + private Integer pageNo = 1; + //每页多少条 + private Integer pageSize = 20; + //token中客户Id + private String customerId; + //场所Id + private String teamId; + //token中userId + private String staffId; + //token中userId所属组织的pid + private String pids; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/PartyServiceCenterListFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/PartyServiceCenterListFormDTO.java new file mode 100644 index 0000000000..1014b844cc --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/PartyServiceCenterListFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/22 2:37 下午 + * @DESC + */ +@Data +public class PartyServiceCenterListFormDTO implements Serializable { + + private static final long serialVersionUID = -6620725991593811931L; + + private String orgId; + + private String orgType; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentExistRecordResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentExistRecordResultDTO.java new file mode 100644 index 0000000000..ffb4d74c20 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentExistRecordResultDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/11/23 10:45 上午 + * @DESC + */ +@Data +public class AppointmentExistRecordResultDTO implements Serializable { + + private static final long serialVersionUID = 6651436509788141940L; + + /** + * 事项名 + */ + private String matterName; + + private String matterId; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentRecordResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentRecordResultDTO.java new file mode 100644 index 0000000000..84813a4f47 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentRecordResultDTO.java @@ -0,0 +1,62 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/11/23 10:45 上午 + * @DESC + */ +@Data +public class AppointmentRecordResultDTO implements Serializable { + + private static final long serialVersionUID = 6066514365788141940L; + + private Integer sort; + + /** + * 事项名 + */ + private String matterName; + + /** + * 预约人 + */ + private String appointmentName; + + /** + * 预约电话 + */ + private String appointmentPhone; + + /** + * 备注 + */ + private String remark; + + private String recordId; + + /** + * 预约时间 + */ + private List appointmentTime; + + @JsonIgnore + private String timeId; + + public AppointmentRecordResultDTO() { + this.sort = NumConstant.ZERO; + this.matterName = ""; + this.appointmentName = ""; + this.appointmentPhone = ""; + this.remark = ""; + this.appointmentTime = new ArrayList<>(); + this.recordId = ""; + } +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentTimeResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentTimeResultDTO.java new file mode 100644 index 0000000000..b37e4e913a --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentTimeResultDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dto.result; + +import com.epmet.dto.TimeDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/11/23 9:55 上午 + * @DESC + */ +@Data +public class AppointmentTimeResultDTO implements Serializable { + + private static final long serialVersionUID = 8724962797702659712L; + + /** + * 预约类型【每天:everyDay,工作日:workDay,周末:weekend】 + */ + private String appointmentType; + + /** + * 时间段 + */ + private List timeDetail; + + public AppointmentTimeResultDTO() { + this.appointmentType = ""; + this.timeDetail = new ArrayList<>(); + } +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlaceOrgResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlaceOrgResultDTO.java new file mode 100644 index 0000000000..ffa2b18b74 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlaceOrgResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author sun + * @Description 九小场所下组织列表查询 + **/ +@Data +public class GetListPlaceOrgResultDTO implements Serializable { + //集合总条数 + private Integer total = 0; + //社会组织信息 + private List list = new ArrayList<>(); + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolRecordResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolRecordResultDTO.java new file mode 100644 index 0000000000..1531ab2901 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolRecordResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author sun + * @Description 场所巡查记录列表查询 + **/ +@Data +public class GetListPlacePatrolRecordResultDTO implements Serializable { + //集合总条数 + private Integer total = 0; + //社会组织信息 + private List list = new ArrayList<>(); + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolReviewRecordResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolReviewRecordResultDTO.java new file mode 100644 index 0000000000..08b9fe2461 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolReviewRecordResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author sun + * @Description 巡查复查记录列表查询 + **/ +@Data +public class GetListPlacePatrolReviewRecordResultDTO implements Serializable { + //集合总条数 + private Integer total = 0; + //社会组织信息 + private List list = new ArrayList<>(); + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolTeamResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolTeamResultDTO.java new file mode 100644 index 0000000000..e7dac5b53d --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolTeamResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author sun + * @Description 九小场所巡查分队人员管理列表查询 + **/ +@Data +public class GetListPlacePatrolTeamResultDTO implements Serializable { + //集合总条数 + private Integer total = 0; + //社会组织信息 + private List list = new ArrayList<>(); + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PartyServiceCenterListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PartyServiceCenterListResultDTO.java new file mode 100644 index 0000000000..17ca6f112c --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PartyServiceCenterListResultDTO.java @@ -0,0 +1,77 @@ +package com.epmet.dto.result; + +import com.epmet.dto.MatterListDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/11/22 2:38 下午 + * @DESC + */ +@Data +public class PartyServiceCenterListResultDTO implements Serializable { + + private static final long serialVersionUID = -5977663317819468536L; + + /** + * 中心名称 + */ + private String centerName; + + /** + * 党群服务中心ID + */ + private String partyServiceCenterId; + + /** + * 社区地址 + */ + private String address; + + /** + * 办公电话 + */ + private String workPhone; + + /** + * 上午工作时间 + */ + private String amWorkTime; + + /** + * 下午工作时间 + */ + private String pmWorkTime; + private String amStartTime; + private String amEndTime; + private String pmStartTime; + private String pmEndTime; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + private List matterList; + + public PartyServiceCenterListResultDTO() { + this.centerName = ""; + this.partyServiceCenterId = ""; + this.address = ""; + this.workPhone = ""; + this.amWorkTime = ""; + this.pmWorkTime = ""; + this.longitude = ""; + this.latitude = ""; + this.matterList = new ArrayList<>(); + } +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlaceOrgDetailResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlaceOrgDetailResultDTO.java new file mode 100644 index 0000000000..866f1cc981 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlaceOrgDetailResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author sun + * @Description 九小场所下组织列表查询 + **/ +@Data +public class PlaceOrgDetailResultDTO implements Serializable { + //场所Id + private String placeOrgId; + //场所名称 + private String placeOrgName; + //场所区域Id + private String gridId; + //场所区域名称 + private String gridName; + //场所地址 + private String address; + //场所类型名称[九小场所Value值] + private String ninePlaceVal; + //场所类型名称[九小场所名称] + private String ninePlaceName; + //场所规模【 0:10人以下 1:10-20人 2:21-40人 3:41-100人 4:100人以上】 + private String scale; + //场所规模名称【 0:10人以下 1:10-20人 2:21-40人 3:41-100人 4:100人以上】 + private String scaleName; + //负责人 + private String personInCharge; + //联系电话 + private String mobile; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlacePatrolRecordDetailResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlacePatrolRecordDetailResultDTO.java new file mode 100644 index 0000000000..93450c6cfa --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlacePatrolRecordDetailResultDTO.java @@ -0,0 +1,50 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author sun + * @Description 场所巡查记录详情 + **/ +@Data +public class PlacePatrolRecordDetailResultDTO implements Serializable { + //所属组织Id + private String agencyId; + //巡查Id + private String placePatrolRecordId; + //网格Id【场所区域】 + private String gridId; + //网格名称【场所区域】 + private String gridName; + //场所下的组织Id + private String placeOrgId; + //场所下的组织名称 + private String placeOrgName; + //场所类型【admin库sys_dict_data表九小场所value值】 + private String ninePlaceVal; + //场所类型名称 + private String ninePlaceName; + //场所下分队(place_patrolteam)表Id + private String placePatrolTeamId; + //场所下分队名称 + private String placePatrolTeamName; + //分队下检查人员Id,分号分隔 + private String inspectors; + //分队下检查人员名称 + private String inspectorsNames; + //首次巡查时间 + private String firstTime; + //隐患明细 + private String detailed; + //首次检查结果【0:合格 1:不合格】 + private String firstResult; + //拟复查时间 + private String reviewTime; + //最新结果【0:合格 1:不合格】 + private String finalResult; + //最新检查时间 + private String finalTime; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlacePatrolReviewRecordDetailResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlacePatrolReviewRecordDetailResultDTO.java new file mode 100644 index 0000000000..47da9065f7 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlacePatrolReviewRecordDetailResultDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author sun + * @Description 巡查复查记录详情 + **/ +@Data +public class PlacePatrolReviewRecordDetailResultDTO implements Serializable { + //复查记录Id + private String placePatrolReviewRecordId; + //巡查记录Id + private String placePatrolRecordId; + //分队id + private String placePatrolTeamId; + //分队名称 + private String placePatrolTeamName; + //检查人员Id,分号分隔 + private String inspectors; + //检查人员姓名,分号分隔 + private String inspectorsNames; + //复查时间 + private String reviewTime; + //复查隐患明细 + private String detailed; + //复查检查结果【0:合格 1:不合格】 + private String reviewResult; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlacePatrolTeamDetailResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlacePatrolTeamDetailResultDTO.java new file mode 100644 index 0000000000..57ef081c5e --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlacePatrolTeamDetailResultDTO.java @@ -0,0 +1,39 @@ +package com.epmet.dto.result; + +import com.epmet.dto.IcPlacePatrolTeamStaffDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author sun + * @Description 九小场所巡查分队人员管理详情 + **/ +@Data +public class PlacePatrolTeamDetailResultDTO implements Serializable { + //分队Id + private String teamId; + //场所名称 + private String teamName; + //场所区域Id + private String gridIds; + //场所区域名称 + private String gridNames; + //场所类型名称[九小场所Value值] + private String ninePlaceVals; + //场所类型名称[九小场所名称] + private String ninePlaceNames; + //负责人 + private String personInCharge; + //联系电话 + private String mobile; + //监查计划 + private String plan; + //创建时间 + private String time; + //分队成员信息 + private List memberList = new ArrayList<>(); + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index aa044e74fe..6c438becaf 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -528,4 +528,7 @@ public interface GovOrgOpenFeignClient { @PostMapping("/gov/org/icneighborhood/getlistbyids") Result> getListByIds(@RequestBody List ids); + + @GetMapping("/gov/org/customergrid/getGridIListByAgency/{agencyId}") + Result> getGridIListByAgency(@PathVariable("agencyId") String agencyId); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index 8649513937..58847819eb 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java @@ -329,6 +329,11 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getListByIds", ids); } + @Override + public Result> getGridIListByAgency(String agencyId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridIListByAgency", agencyId); + } + @Override public Result selectPidsByGridId(String gridId) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectPidsByGridId", gridId); diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index e813e41954..0177e4b4cd 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -119,6 +119,12 @@ 2.0.0 compile + + com.epmet + epmet-admin-client + 2.0.0 + compile + diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/PartyServiceCenterConstant.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/PartyServiceCenterConstant.java new file mode 100644 index 0000000000..ced0df2da5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/PartyServiceCenterConstant.java @@ -0,0 +1,15 @@ +package com.epmet.constant; + +/** + * @Author zxc + * @DateTime 2021/11/22 9:29 上午 + * @DESC + */ +public interface PartyServiceCenterConstant { + + String ORG_TYPE_AGENCY = "agency"; + + String APPOINTMENT_STATUS_APPOINTING = "appointing"; + String APPOINTMENT_STATUS_CANCEL = "cancel"; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java index b46bd1aeab..0b58b4d6f0 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java @@ -103,6 +103,7 @@ public class CustomerGridController { */ @PostMapping("getcustomergridbygridid") public Result getCustomerGridByGridId(@RequestBody CustomerGridFormDTO customerGridFormDTO) { + ValidatorUtils.validateEntity(customerGridFormDTO, CustomerGridFormDTO.Grid.class); return customerGridService.getCustomerGridByGridId(customerGridFormDTO); } @@ -302,4 +303,10 @@ public class CustomerGridController { ValidatorUtils.validateEntity(formDTO); return new Result>().ok(customerGridService.getGridOption(formDTO.getAgencyId(),formDTO.getPurpose())); } + + @GetMapping("getGridIListByAgency/{agencyId}") + public Result> getGridIListByAgency(@PathVariable("agencyId") String agencyId) { + List resultDTOS = customerGridService.getGridIListByAgency(agencyId); + return new Result>().ok(resultDTOS); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcMatterAppointmentRecordController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcMatterAppointmentRecordController.java new file mode 100644 index 0000000000..848ab27ceb --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcMatterAppointmentRecordController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.IcMatterAppointmentRecordDTO; +import com.epmet.excel.IcMatterAppointmentRecordExcel; +import com.epmet.service.IcMatterAppointmentRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 事项预约记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@RestController +@RequestMapping("icmatterappointmentrecord") +public class IcMatterAppointmentRecordController { + + @Autowired + private IcMatterAppointmentRecordService icMatterAppointmentRecordService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icMatterAppointmentRecordService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcMatterAppointmentRecordDTO data = icMatterAppointmentRecordService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcMatterAppointmentRecordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icMatterAppointmentRecordService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcMatterAppointmentRecordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icMatterAppointmentRecordService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icMatterAppointmentRecordService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = icMatterAppointmentRecordService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, IcMatterAppointmentRecordExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterController.java new file mode 100644 index 0000000000..a948681219 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterController.java @@ -0,0 +1,207 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.IcPartyServiceCenterDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.AppointmentRecordResultDTO; +import com.epmet.dto.result.AppointmentTimeResultDTO; +import com.epmet.dto.result.PartyServiceCenterListResultDTO; +import com.epmet.excel.IcPartyServiceCenterExcel; +import com.epmet.service.IcPartyServiceCenterService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.*; + + +/** + * 党群服务中心 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@RestController +@RequestMapping("icpartyservicecenter") +public class IcPartyServiceCenterController { + + @Autowired + private IcPartyServiceCenterService icPartyServiceCenterService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icPartyServiceCenterService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcPartyServiceCenterDTO data = icPartyServiceCenterService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcPartyServiceCenterDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icPartyServiceCenterService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcPartyServiceCenterDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icPartyServiceCenterService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icPartyServiceCenterService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = icPartyServiceCenterService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, IcPartyServiceCenterExcel.class); + } + + /** + * @Description 新增党群服务中心 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/22 9:13 上午 + */ + @NoRepeatSubmit + @PostMapping("addpartyservicecenter") + public Result addPartyServiceCenter(@RequestBody AddPartyServiceCenterFormDTO formDTO, @LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO, AddPartyServiceCenterFormDTO.AddPartyServiceCenterForm.class); + icPartyServiceCenterService.addPartyServiceCenter(formDTO,tokenDto); + return new Result(); + } + + /** + * @Description 修改党群服务中心 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/22 10:21 上午 + */ + @NoRepeatSubmit + @PostMapping("editpartyservicecenter") + public Result editPartyServiceCenter(@RequestBody EditPartyServiceCenterFormDTO formDTO,@LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO, EditPartyServiceCenterFormDTO.EditPartyServiceCenterForm.class); + icPartyServiceCenterService.editPartyServiceCenter(formDTO,tokenDto); + return new Result(); + } + + /** + * @Description 事项删除 + * @param formDTO + * @author zxc + * @date 2021/11/22 1:25 下午 + */ + @PostMapping("delmatter") + public Result delMatter(@RequestBody DelMatterFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, DelMatterFormDTO.DelMatterForm.class); + icPartyServiceCenterService.delMatter(formDTO); + return new Result(); + } + + /** + * @Description 预约 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/22 2:06 下午 + */ + @PostMapping("appointment") + public Result appointment(@RequestBody AppointmentFormDTO formDTO, @LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO, AppointmentFormDTO.AppointmentForm.class); + icPartyServiceCenterService.appointment(formDTO,tokenDto); + return new Result(); + } + + /** + * @Description 党群服务中心列表 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/22 2:47 下午 + */ + @PostMapping("partyservicecenterlist") + public Result> partyServiceCenterList(@RequestBody PartyServiceCenterListFormDTO formDTO, @LoginUser TokenDto tokenDto){ + return new Result>().ok(icPartyServiceCenterService.partyServiceCenterList(formDTO,tokenDto)); + } + + /** + * @Description 【党群服务中心】点击预约按钮时,查询可选时间 + * @param formDTO + * @author zxc + * @date 2021/11/23 10:02 上午 + */ + @PostMapping("appointmenttime") + public Result appointmentTime(@RequestBody AppointmentTimeFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, AppointmentTimeFormDTO.AppointmentTimeForm.class); + return new Result().ok(icPartyServiceCenterService.appointmentTime(formDTO)); + } + + /** + * @Description 【党群服务中心】预约记录 + * @param formDTO + * @author zxc + * @date 2021/11/23 10:50 上午 + */ + @PostMapping("appointmentrecord") + public Result> appointmentRecord(@RequestBody AppointmentRecordFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, AppointmentRecordFormDTO.AppointmentRecordForm.class); + return new Result>().ok(icPartyServiceCenterService.appointmentRecord(formDTO)); + } + + /** + * @Description 取消预约 + * @param formDTO + * @author zxc + * @date 2021/11/26 5:21 下午 + */ + @PostMapping("cancelappointment") + public Result cancelAppointment(@RequestBody CancelAppointmentFormDTO formDTO,@LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO,CancelAppointmentFormDTO.CancelAppointmentForm.class); + formDTO.setUserId(tokenDto.getUserId()); + icPartyServiceCenterService.cancelAppointment(formDTO); + 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/IcPartyServiceCenterMatterController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterMatterController.java new file mode 100644 index 0000000000..affe64381a --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterMatterController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.IcPartyServiceCenterMatterDTO; +import com.epmet.excel.IcPartyServiceCenterMatterExcel; +import com.epmet.service.IcPartyServiceCenterMatterService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 党群服务中心可预约事项表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@RestController +@RequestMapping("icpartyservicecentermatter") +public class IcPartyServiceCenterMatterController { + + @Autowired + private IcPartyServiceCenterMatterService icPartyServiceCenterMatterService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icPartyServiceCenterMatterService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcPartyServiceCenterMatterDTO data = icPartyServiceCenterMatterService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcPartyServiceCenterMatterDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icPartyServiceCenterMatterService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcPartyServiceCenterMatterDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icPartyServiceCenterMatterService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icPartyServiceCenterMatterService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = icPartyServiceCenterMatterService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, IcPartyServiceCenterMatterExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlaceOrgController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlaceOrgController.java new file mode 100644 index 0000000000..2d152c21c6 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlaceOrgController.java @@ -0,0 +1,107 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.AddPlaceOrgFormDTO; +import com.epmet.dto.form.EditPlaceOrgFormDTO; +import com.epmet.dto.form.GetListPlaceOrgFormDTO; +import com.epmet.dto.result.GetListPlaceOrgResultDTO; +import com.epmet.dto.result.PlaceOrgDetailResultDTO; +import com.epmet.service.IcPlaceOrgService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 九小场所下组织管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@RestController +@RequestMapping("placeorg") +public class IcPlaceOrgController { + + @Autowired + private IcPlaceOrgService placeOrgService; + + /** + * @Author sun + * @Description 新增九小场所下组织 + **/ + @PostMapping("add") + public Result add(@LoginUser TokenDto tokenDto, @RequestBody AddPlaceOrgFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AddPlaceOrgFormDTO.Add.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + placeOrgService.add(formDTO); + return new Result(); + } + + /** + * @Author sun + * @Description 修改九小场所下组织 + **/ + @PostMapping("edit") + public Result edit(@LoginUser TokenDto tokenDto, @RequestBody EditPlaceOrgFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, EditPlaceOrgFormDTO.Edit.class); + placeOrgService.edit(formDTO); + return new Result(); + } + + /** + * @Author sun + * @Description 删除九小场所下组织 + **/ + @PostMapping("del") + public Result del(@LoginUser TokenDto tokenDto, @RequestBody EditPlaceOrgFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, EditPlaceOrgFormDTO.Del.class); + placeOrgService.del(formDTO.getPlaceOrgId()); + return new Result(); + } + + /** + * @Author sun + * @Description 九小场所下组织详情 + **/ + @PostMapping("detail") + public Result detail(@LoginUser TokenDto tokenDto, @RequestBody EditPlaceOrgFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, EditPlaceOrgFormDTO.Detail.class); + return new Result().ok(placeOrgService.detail(formDTO.getPlaceOrgId())); + } + + /** + * @Author sun + * @Description 九小场所下组织列表查询 + **/ + @PostMapping("getlist") + public Result getList(@LoginUser TokenDto tokenDto, @RequestBody GetListPlaceOrgFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + return new Result().ok(placeOrgService.getList(formDTO)); + } + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolRecordController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolRecordController.java new file mode 100644 index 0000000000..0d2c02a3d6 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolRecordController.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.AddPlacePatrolRecordFormDTO; +import com.epmet.dto.form.EditPlacePatrolRecordFormDTO; +import com.epmet.dto.form.GetListPlacePatrolRecordFormDTO; +import com.epmet.dto.result.GetListPlacePatrolRecordResultDTO; +import com.epmet.dto.result.PlacePatrolRecordDetailResultDTO; +import com.epmet.service.IcPlacePatrolRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 场所巡查记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@RestController +@RequestMapping("placepatrolrecord") +public class IcPlacePatrolRecordController { + + @Autowired + private IcPlacePatrolRecordService placePatrolRecordService; + + /** + * @Author sun + * @Description 新增场所巡查记录 + **/ + @PostMapping("add") + public Result add(@LoginUser TokenDto tokenDto, @RequestBody AddPlacePatrolRecordFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AddPlacePatrolRecordFormDTO.Add.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + placePatrolRecordService.add(formDTO); + return new Result(); + } + + /** + * @Author sun + * @Description 删除场所巡查记录 + **/ + @PostMapping("del") + public Result del(@LoginUser TokenDto tokenDto, @RequestBody EditPlacePatrolRecordFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, EditPlacePatrolRecordFormDTO.Del.class); + placePatrolRecordService.del(tokenDto.getUserId(), formDTO.getPlacePatrolRecordId()); + return new Result(); + } + + /** + * @Author sun + * @Description 场所巡查记录详情 + **/ + @PostMapping("detail") + public Result detail(@LoginUser TokenDto tokenDto, @RequestBody EditPlacePatrolRecordFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, EditPlacePatrolRecordFormDTO.Detail.class); + return new Result().ok(placePatrolRecordService.detail(formDTO.getPlacePatrolRecordId())); + } + + /** + * @Author sun + * @Description 场所巡查记录列表查询 + **/ + @PostMapping("getlist") + public Result getList(@LoginUser TokenDto tokenDto, @RequestBody GetListPlacePatrolRecordFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + return new Result().ok(placePatrolRecordService.getList(formDTO)); + } + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolReviewRecordController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolReviewRecordController.java new file mode 100644 index 0000000000..04666c0230 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolReviewRecordController.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.AddPlacePatrolReviewRecordFormDTO; +import com.epmet.dto.form.EditPlacePatrolReviewRecordFormDTO; +import com.epmet.dto.form.GetListPlacePatrolReviewRecordFormDTO; +import com.epmet.dto.result.GetListPlacePatrolReviewRecordResultDTO; +import com.epmet.dto.result.PlacePatrolReviewRecordDetailResultDTO; +import com.epmet.service.IcPlacePatrolReviewRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 场所巡查复查记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@RestController +@RequestMapping("placepatrolreviewrecord") +public class IcPlacePatrolReviewRecordController { + + @Autowired + private IcPlacePatrolReviewRecordService placePatrolReviewRecordService; + + /** + * @Author sun + * @Description 新增巡查复查记录 + **/ + @PostMapping("add") + public Result add(@LoginUser TokenDto tokenDto, @RequestBody AddPlacePatrolReviewRecordFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AddPlacePatrolReviewRecordFormDTO.Add.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result().ok(placePatrolReviewRecordService.add(formDTO)); + } + + /** + * @Author sun + * @Description 修改巡查复查记录 + **/ + @PostMapping("edit") + public Result edit(@LoginUser TokenDto tokenDto, @RequestBody EditPlacePatrolReviewRecordFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, EditPlacePatrolReviewRecordFormDTO.Edit.class); + return new Result().ok(placePatrolReviewRecordService.edit(formDTO)); + } + + /** + * @Author sun + * @Description 删除巡查复查记录 + **/ + @PostMapping("del") + public Result del(@LoginUser TokenDto tokenDto, @RequestBody EditPlacePatrolReviewRecordFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, EditPlacePatrolReviewRecordFormDTO.Del.class); + placePatrolReviewRecordService.del(formDTO.getPlacePatrolReviewRecordId()); + return new Result(); + } + + /** + * @Author sun + * @Description 巡查复查记录详情 + **/ + @PostMapping("detail") + public Result detail(@LoginUser TokenDto tokenDto, @RequestBody EditPlacePatrolReviewRecordFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, EditPlacePatrolReviewRecordFormDTO.Detail.class); + return new Result().ok(placePatrolReviewRecordService.detail(formDTO.getPlacePatrolReviewRecordId())); + } + + /** + * @Author sun + * @Description 巡查复查记录列表查询 + **/ + @PostMapping("getlist") + public Result getList(@LoginUser TokenDto tokenDto, @RequestBody GetListPlacePatrolReviewRecordFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GetListPlacePatrolReviewRecordFormDTO.GetData.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result().ok(placePatrolReviewRecordService.getList(formDTO)); + } + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolTeamController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolTeamController.java new file mode 100644 index 0000000000..23013c9f02 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolTeamController.java @@ -0,0 +1,108 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.AddPlacePatrolTeamFormDTO; +import com.epmet.dto.form.EditPlacePatrolTeamFormDTO; +import com.epmet.dto.form.GetListPlacePatrolTeamFormDTO; +import com.epmet.dto.result.GetListPlacePatrolTeamResultDTO; +import com.epmet.dto.result.PlacePatrolTeamDetailResultDTO; +import com.epmet.service.IcPlacePatrolTeamService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 场所分队管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@RestController +@RequestMapping("placepatrolteam") +public class IcPlacePatrolTeamController { + + @Autowired + private IcPlacePatrolTeamService placePatrolTeamService; + + + /** + * @Author sun + * @Description 新增九小场所巡查分队人员管理 + **/ + @PostMapping("add") + public Result add(@LoginUser TokenDto tokenDto, @RequestBody AddPlacePatrolTeamFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AddPlacePatrolTeamFormDTO.Add.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + placePatrolTeamService.add(formDTO); + return new Result(); + } + + /** + * @Author sun + * @Description 修改九小场所巡查分队人员管理 + **/ + @PostMapping("edit") + public Result edit(@LoginUser TokenDto tokenDto, @RequestBody EditPlacePatrolTeamFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, EditPlacePatrolTeamFormDTO.Edit.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + placePatrolTeamService.edit(formDTO); + return new Result(); + } + + /** + * @Author sun + * @Description 删除九小场所巡查分队人员管理 + **/ + @PostMapping("del") + public Result del(@LoginUser TokenDto tokenDto, @RequestBody EditPlacePatrolTeamFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, EditPlacePatrolTeamFormDTO.Del.class); + placePatrolTeamService.del(tokenDto.getUserId(), formDTO.getTeamId()); + return new Result(); + } + + /** + * @Author sun + * @Description 九小场所巡查分队人员管理详情 + **/ + @PostMapping("detail") + public Result detail(@LoginUser TokenDto tokenDto, @RequestBody EditPlacePatrolTeamFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, EditPlacePatrolTeamFormDTO.Detail.class); + return new Result().ok(placePatrolTeamService.detail(formDTO.getTeamId())); + } + + /** + * @Author sun + * @Description 九小场所巡查分队人员管理列表查询 + **/ + @PostMapping("getlist") + public Result getList(@LoginUser TokenDto tokenDto, @RequestBody GetListPlacePatrolTeamFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + return new Result().ok(placePatrolTeamService.getList(formDTO)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolTeamStaffController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolTeamStaffController.java new file mode 100644 index 0000000000..9d3750d7b8 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolTeamStaffController.java @@ -0,0 +1,59 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.IcPlacePatrolTeamStaffDTO; +import com.epmet.dto.form.GetListPlacePatrolTeamFormDTO; +import com.epmet.dto.result.GetListPlacePatrolTeamResultDTO; +import com.epmet.service.IcPlacePatrolTeamStaffService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + + +/** + * 场所分队下人员管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@RestController +@RequestMapping("placepatrolteamstaff") +public class IcPlacePatrolTeamStaffController { + + @Autowired + private IcPlacePatrolTeamStaffService placePatrolTeamStaffService; + + + /** + * @Author sun + * @Description 查询分队下人员列表数据 + **/ + @PostMapping("getlist") + public Result> getList(@LoginUser TokenDto tokenDto, @RequestBody GetListPlacePatrolTeamFormDTO formDTO) { + return new Result>().ok(placePatrolTeamStaffService.getList(formDTO.getTeamId())); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcMatterAppointmentRecordDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcMatterAppointmentRecordDao.java new file mode 100644 index 0000000000..0b118216bb --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcMatterAppointmentRecordDao.java @@ -0,0 +1,64 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.AppointmentExistRecordResultDTO; +import com.epmet.dto.result.AppointmentRecordResultDTO; +import com.epmet.entity.IcMatterAppointmentRecordEntity; +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 2021-11-18 + */ +@Mapper +public interface IcMatterAppointmentRecordDao extends BaseDao { + + /** + * @Description 查询预约列表 + * @param matterId + * @param date + * @author zxc + * @date 2021/11/23 1:55 下午 + */ + List appointmentRecord(@Param("matterId")String matterId,@Param("date")String date); + + /** + * @Description 查询事项是不是存在预约记录 + * @param matterIds + * @author zxc + * @date 2021/11/23 3:48 下午 + */ + List appointmentExistRecord(@Param("matterIds")List matterIds); + + /** + * @Description 取消预约 + * @param recordId + * @param userId + * @author zxc + * @date 2021/11/29 3:34 下午 + */ + void cancelAppointment(@Param("recordId")String recordId,@Param("userId")String userId); + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPartyServiceCenterDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPartyServiceCenterDao.java new file mode 100644 index 0000000000..b85d2086f0 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPartyServiceCenterDao.java @@ -0,0 +1,45 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.PartyServiceCenterListResultDTO; +import com.epmet.entity.IcPartyServiceCenterEntity; +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 2021-11-18 + */ +@Mapper +public interface IcPartyServiceCenterDao extends BaseDao { + + /** + * @Description 查询党群服务中心列表 + * @param orgId + * @author zxc + * @date 2021/11/22 2:51 下午 + */ + List partyServiceCenterList(@Param("orgId")String orgId); + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPartyServiceCenterMatterDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPartyServiceCenterMatterDao.java new file mode 100644 index 0000000000..18bf0f63f0 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPartyServiceCenterMatterDao.java @@ -0,0 +1,52 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcPartyServiceCenterMatterEntity; +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 2021-11-18 + */ +@Mapper +public interface IcPartyServiceCenterMatterDao extends BaseDao { + + /** + * @Description 根据党群服务中心删除事项 + * @param partyServiceCenterId + * @author zxc + * @date 2021/11/22 10:29 上午 + */ + void deleteMattersByPartyServiceCenterId(@Param("partyServiceCenterId") String partyServiceCenterId); + + /** + * @Description 根据党群服务中心ID查询事件名字 + * @param centerId + * @author zxc + * @date 2021/12/10 8:56 上午 + */ + List selectMatterNameByCenterId(@Param("centerId") String centerId); + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlaceOrgDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlaceOrgDao.java new file mode 100644 index 0000000000..a3c5c667bd --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlaceOrgDao.java @@ -0,0 +1,43 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.GetListPlaceOrgFormDTO; +import com.epmet.dto.result.PlaceOrgDetailResultDTO; +import com.epmet.entity.IcPlaceOrgEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 九小场所下组织管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Mapper +public interface IcPlaceOrgDao extends BaseDao { + + /** + * @Author sun + * @Description 九小场所下组织列表查询 + **/ + List getList(GetListPlaceOrgFormDTO formDTO); + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolRecordDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolRecordDao.java new file mode 100644 index 0000000000..be3bd364f2 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolRecordDao.java @@ -0,0 +1,38 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.GetListPlacePatrolRecordFormDTO; +import com.epmet.dto.result.PlacePatrolRecordDetailResultDTO; +import com.epmet.entity.IcPlacePatrolRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 场所巡查记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Mapper +public interface IcPlacePatrolRecordDao extends BaseDao { + + List getList(GetListPlacePatrolRecordFormDTO dto); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolReviewRecordDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolReviewRecordDao.java new file mode 100644 index 0000000000..0b6c476228 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolReviewRecordDao.java @@ -0,0 +1,49 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.GetListPlacePatrolReviewRecordFormDTO; +import com.epmet.dto.result.PlacePatrolReviewRecordDetailResultDTO; +import com.epmet.entity.IcPlacePatrolReviewRecordEntity; +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 2021-11-18 + */ +@Mapper +public interface IcPlacePatrolReviewRecordDao extends BaseDao { + + /** + * @Author sun + * @Description 删除巡查记录对应的复查记录 + **/ + int delByPatrolRecordId(@Param("staffId") String staffId, @Param("placePatrolRecordId") String placePatrolRecordId); + + /** + * @Author sun + * @Description 查询巡查记录对应的复查记录数据 + **/ + List getList(GetListPlacePatrolReviewRecordFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolTeamDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolTeamDao.java new file mode 100644 index 0000000000..d53d0f24e8 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolTeamDao.java @@ -0,0 +1,42 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.GetListPlacePatrolTeamFormDTO; +import com.epmet.dto.result.PlacePatrolTeamDetailResultDTO; +import com.epmet.entity.IcPlacePatrolTeamEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 场所分队管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Mapper +public interface IcPlacePatrolTeamDao extends BaseDao { + + /** + * @Author sun + * @Description 九小场所巡查分队人员管理列表查询 + **/ + List getList(GetListPlacePatrolTeamFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolTeamStaffDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolTeamStaffDao.java new file mode 100644 index 0000000000..8f8df8c9dd --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolTeamStaffDao.java @@ -0,0 +1,60 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.IcPlacePatrolTeamStaffDTO; +import com.epmet.entity.IcPlacePatrolTeamStaffEntity; +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 2021-11-18 + */ +@Mapper +public interface IcPlacePatrolTeamStaffDao extends BaseDao { + + /** + * @Author sun + * @Description 删除分队下成员信息 + **/ + int delByTeamId(@Param("teamId") String teamId); + + /** + * @Author sun + * @Description 查询分队下成员信息 + **/ + List getByTeamId(@Param("teamId") String teamId); + + /** + * @Author sun + * @Description 批量查询分队下人员信息 + **/ + List selectByTeamIds(@Param("teamIds") List teamIds); + + /** + * @Author sun + * @Description 逻辑删除分队成员子表数据 + **/ + int upByTeamId(@Param("staffId") String staffId, @Param("teamId") String teamId); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcMatterAppointmentRecordEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcMatterAppointmentRecordEntity.java new file mode 100644 index 0000000000..c7df20f0f7 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcMatterAppointmentRecordEntity.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 2021-11-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_matter_appointment_record") +public class IcMatterAppointmentRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String customerId; + + /** + * 组织ID + */ + private String orgId; + + /** + * 组织类型,agency:组织,grid:网格 + */ + private String orgType; + + /** + * + */ + private String pid; + + /** + * + */ + private String pids; + + /** + * 事项ID + */ + private String matterId; + + /** + * 预约日期 + */ + private String appointmentDate; + + /** + * 预约人 + */ + private String appointmentName; + + /** + * 预约电话 + */ + private String appointmentPhone; + + /** + * 备注 + */ + private String remark; + + /** + * 预约状态【cancel:取消,appointing:预约中】 + */ + private String status; + + /** + * 1,2,5 + */ + private String timeId; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPartyServiceCenterEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPartyServiceCenterEntity.java new file mode 100644 index 0000000000..b2b422ff9e --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPartyServiceCenterEntity.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 2021-11-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_party_service_center") +public class IcPartyServiceCenterEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String orgId; + + /** + * 组织类型,agency:组织,grid:网格 + */ + private String orgType; + + /** + * + */ + private String pid; + + /** + * + */ + private String pids; + + /** + * 中心名称 + */ + private String centerName; + + /** + * 办公电话 + */ + private String workPhone; + + /** + * 上午开始办公时间 + */ + private String amStartTime; + + /** + * 上午结束办公时间 + */ + private String amEndTime; + + /** + * 下午开始办公时间 + */ + private String pmStartTime; + + /** + * 下午结束办公时间 + */ + private String pmEndTime; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 地址 + */ + private String address; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPartyServiceCenterMatterEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPartyServiceCenterMatterEntity.java new file mode 100644 index 0000000000..fd9f55fe13 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPartyServiceCenterMatterEntity.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 2021-11-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_party_service_center_matter") +public class IcPartyServiceCenterMatterEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 党群服务中心ID + */ + private String partyServiceCenterId; + + /** + * 事项名字 + */ + private String matterName; + + /** + * 预约类型,每天:everyDay,工作日:workDay,周末:weekend + */ + private String appointmentType; + + /** + * 可预约开始时间 + */ + private String startTime; + + /** + * 可预约结束时间 + */ + private String endTime; + + /** + * 客户ID + */ + private String customerId; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlaceOrgEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlaceOrgEntity.java new file mode 100644 index 0000000000..65540a28b1 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlaceOrgEntity.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 2021-11-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_place_org") +public class IcPlaceOrgEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织Id + */ + private String agencyId; + + /** + * agency_id的所有上级 + */ + private String pids; + + /** + * 网格Id【场所区域】 + */ + private String gridId; + + /** + * 场所类型【admin库sys_dict_data表九小场所value值】 + */ + private String ninePlaceVal; + + /** + * 场所名称 + */ + private String placeOrgName; + + /** + * 场所地址 + */ + private String address; + + /** + * 字典value,场所规模【 +0:10人以下 +1:10-20人 +2:21-40人 +3:41-100人 +4:100人以上】 + */ + private String scale; + + /** + * 场所负责人 + */ + private String personInCharge; + + /** + * 负责人电话 + */ + private String mobile; + + /** + * 备注 + */ + private String remarks; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlacePatrolRecordEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlacePatrolRecordEntity.java new file mode 100644 index 0000000000..3b6995b09c --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlacePatrolRecordEntity.java @@ -0,0 +1,116 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 2021-11-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_place_patrol_record") +public class IcPlacePatrolRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织Id + */ + private String agencyId; + + /** + * agency_id的所有上级 + */ + private String pids; + + /** + * 网格Id【场所区域】 + */ + private String gridId; + + /** + * 场所类型【admin库sys_dict_data表九小场所value值】 + */ + private String ninePlaceVal; + + /** + * 场所下的组织Id + */ + private String placeOrgId; + + /** + * 场所下分队(place_patrolteam)表Id + */ + private String placePatrolTeamId; + + /** + * 分队下检查人员Id,分号分隔 + */ + private String inspectors; + + /** + * 首次巡查时间 + */ + private Date firstTime; + + /** + * 隐患明细 + */ + private String detailed; + + /** + * 首次检查结果【0:合格 1:不合格】 + */ + private String firstResult; + + /** + * 拟复查时间 + */ + private Date reviewTime; + + /** + * 最终检查结果【0:合格 1:不合格】初始数据默认和首次检查结果相同 + */ + private String finalResult; + + /** + * 最新复查时间【初始数据默认和首次巡查时间相同】 + */ + private Date finalTime; + + /** + * 备注 + */ + private String remarks; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlacePatrolReviewRecordEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlacePatrolReviewRecordEntity.java new file mode 100644 index 0000000000..dd492d7dfa --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlacePatrolReviewRecordEntity.java @@ -0,0 +1,81 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 2021-11-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_place_patrol_review_record") +public class IcPlacePatrolReviewRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 巡查记录主(place_patrol_record)表Id + */ + private String placePatrolRecordId; + + /** + * 场所下分队(place_patrol_team)表Id + */ + private String placePatrolTeamId; + + /** + * 检查人员Id,逗号分隔 + */ + private String inspectors; + + /** + * 复查时间 + */ + private Date reviewTime; + + /** + * 复查隐患明细 + */ + private String detailed; + + /** + * 复查检查结果【0:合格 1:不合格】 + */ + private String reviewResult; + + /** + * 备注 + */ + private String remarks; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlacePatrolTeamEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlacePatrolTeamEntity.java new file mode 100644 index 0000000000..85b37ddd64 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlacePatrolTeamEntity.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 2021-11-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_place_patrol_team") +public class IcPlacePatrolTeamEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织Id + */ + private String agencyId; + + /** + * agency_id的所有上级 + */ + private String pids; + + /** + * 负责区域【网格Id 多个值逗号分隔】 + */ + private String gridIds; + + /** + * 负责场所类型【admin库sys_dict_data表九小场所value值 多个值逗号分隔】 + */ + private String ninePlaceVals; + + /** + * 分队名称 + */ + private String teamName; + + /** + * 巡查计划 + */ + private String plan; + + /** + * 创建(建队)时间 + */ + private Date time; + + /** + * 场所负责人 + */ + private String personInCharge; + + /** + * 负责人电话 + */ + private String mobile; + + /** + * 备注 + */ + private String remarks; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlacePatrolTeamStaffEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlacePatrolTeamStaffEntity.java new file mode 100644 index 0000000000..fc16a6dc42 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlacePatrolTeamStaffEntity.java @@ -0,0 +1,66 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 2021-11-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_place_patrol_team_staff") +public class IcPlacePatrolTeamStaffEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 巡查分队(place_patrol_team)表Id + */ + private String placePatrolTeamId; + + /** + * 成员姓名 + */ + private String name; + + /** + * 成员电话 + */ + private String mobile; + + /** + * 备注 + */ + private String remarks; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcMatterAppointmentRecordExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcMatterAppointmentRecordExcel.java new file mode 100644 index 0000000000..ecbb00ee36 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcMatterAppointmentRecordExcel.java @@ -0,0 +1,92 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 事项预约记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcMatterAppointmentRecordExcel { + + @Excel(name = "") + private String id; + + @Excel(name = "") + private String customerId; + + @Excel(name = "组织ID") + private String orgId; + + @Excel(name = "组织类型,agency:组织,grid:网格") + private String orgType; + + @Excel(name = "") + private String pid; + + @Excel(name = "") + private String pids; + + @Excel(name = "事项ID") + private String matterId; + + @Excel(name = "预约日期") + private String appointmentDate; + + @Excel(name = "预约人") + private String appointmentName; + + @Excel(name = "预约电话") + private String appointmentPhone; + + @Excel(name = "备注") + private String remark; + + @Excel(name = "预约状态【cancel:取消,appointing:预约中】") + private String status; + + @Excel(name = "") + private Integer delFlag; + + @Excel(name = "乐观锁") + private String revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + @Excel(name = "1,2,5") + private String timeId; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPartyServiceCenterExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPartyServiceCenterExcel.java new file mode 100644 index 0000000000..b1779eca45 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPartyServiceCenterExcel.java @@ -0,0 +1,98 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 党群服务中心 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcPartyServiceCenterExcel { + + @Excel(name = "") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "组织ID") + private String orgId; + + @Excel(name = "组织类型,agency:组织,grid:网格") + private String orgType; + + @Excel(name = "") + private String pid; + + @Excel(name = "") + private String pids; + + @Excel(name = "中心名称") + private String centerName; + + @Excel(name = "办公电话") + private String workPhone; + + @Excel(name = "上午开始办公时间") + private String amStartTime; + + @Excel(name = "上午结束办公时间") + private String amEndTime; + + @Excel(name = "下午开始办公时间") + private String pmStartTime; + + @Excel(name = "下午结束办公时间") + private String pmEndTime; + + @Excel(name = "经度") + private String longitude; + + @Excel(name = "纬度") + private String latitude; + + @Excel(name = "地址") + private String address; + + @Excel(name = "") + private Integer delFlag; + + @Excel(name = "乐观锁") + private String revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPartyServiceCenterMatterExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPartyServiceCenterMatterExcel.java new file mode 100644 index 0000000000..465f2f7493 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPartyServiceCenterMatterExcel.java @@ -0,0 +1,74 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 党群服务中心可预约事项表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcPartyServiceCenterMatterExcel { + + @Excel(name = "") + private String id; + + @Excel(name = "党群服务中心ID") + private String partyServiceCenterId; + + @Excel(name = "事项名字") + private String matterName; + + @Excel(name = "预约类型,每天:everyDay,工作日:workDay,周末:weekend") + private String appointmentType; + + @Excel(name = "可预约开始时间") + private String startTime; + + @Excel(name = "可预约结束时间") + private String endTime; + + @Excel(name = "") + private Integer delFlag; + + @Excel(name = "乐观锁") + private String revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + @Excel(name = "客户ID") + private String customerId; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPlaceOrgExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPlaceOrgExcel.java new file mode 100644 index 0000000000..4647a3e9b9 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPlaceOrgExcel.java @@ -0,0 +1,89 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 九小场所下组织管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcPlaceOrgExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "客户Id") + private String customerId; + + @Excel(name = "组织Id") + private String agencyId; + + @Excel(name = "agency_id的所有上级") + private String pids; + + @Excel(name = "网格Id【场所区域】") + private String gridId; + + @Excel(name = "场所类型") + private String ninePlaceVal; + + @Excel(name = "场所名称") + private String placeOrgName; + + @Excel(name = "场所地址") + private String address; + + @Excel(name = "场所规模") + private String scale; + + @Excel(name = "场所负责人") + private String personInCharge; + + @Excel(name = "负责人电话") + private String mobile; + + @Excel(name = "备注") + private String remarks; + + @Excel(name = "删除标识:0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPlacePatrolRecordExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPlacePatrolRecordExcel.java new file mode 100644 index 0000000000..423f7b845e --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPlacePatrolRecordExcel.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 场所巡查记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcPlacePatrolRecordExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "客户Id") + private String customerId; + + @Excel(name = "组织Id") + private String agencyId; + + @Excel(name = "agency_id的所有上级") + private String pids; + + @Excel(name = "网格Id【场所区域】") + private String gridId; + + @Excel(name = "场所类型【admin库sys_dict_data表九小场所value值】") + private String ninePlaceVal; + + @Excel(name = "场所下的组织Id") + private String placeOrgId; + + @Excel(name = "场所下分队(place_patrolteam)表Id") + private String placePatrolTeamId; + + @Excel(name = "分队下检查人员Id,分号分隔") + private String inspectors; + + @Excel(name = "首次巡查时间") + private Date firstTime; + + @Excel(name = "隐患明细") + private String detailed; + + @Excel(name = "首次检查结果【0:合格 1:不合格】") + private String firstResult; + + @Excel(name = "拟复查时间") + private Date reviewTime; + + @Excel(name = "最终检查结果【0:合格 1:不合格】初始数据默认和首次检查结果相同") + private String finalResult; + + @Excel(name = "最新复查时间【初始数据默认和首次巡查时间相同】") + private Date finalTime; + + @Excel(name = "备注") + private String remarks; + + @Excel(name = "删除标识:0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPlacePatrolReviewRecordExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPlacePatrolReviewRecordExcel.java new file mode 100644 index 0000000000..3a997045a3 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPlacePatrolReviewRecordExcel.java @@ -0,0 +1,80 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 场所巡查复查记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcPlacePatrolReviewRecordExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "客户Id") + private String customerId; + + @Excel(name = "巡查记录主(place_patrol_record)表Id") + private String placePatrolRecordId; + + @Excel(name = "场所下分队(place_patrol_team)表Id") + private String placePatrolTeamId; + + @Excel(name = "检查人员Id,逗号分隔") + private String inspectors; + + @Excel(name = "复查时间") + private Date reviewTime; + + @Excel(name = "复查隐患明细") + private String detailed; + + @Excel(name = "复查检查结果【0:合格 1:不合格】") + private String reviewResult; + + @Excel(name = "备注") + private String remarks; + + @Excel(name = "删除标识:0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPlacePatrolTeamExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPlacePatrolTeamExcel.java new file mode 100644 index 0000000000..1e5da44cfa --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPlacePatrolTeamExcel.java @@ -0,0 +1,89 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 场所分队管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcPlacePatrolTeamExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "客户Id") + private String customerId; + + @Excel(name = "组织Id") + private String agencyId; + + @Excel(name = "agency_id的所有上级") + private String pids; + + @Excel(name = "负责区域【网格Id 多个值逗号分隔】") + private String gridIds; + + @Excel(name = "负责场所类型【admin库sys_dict_data表九小场所value值 多个值逗号分隔】") + private String ninePlaceVals; + + @Excel(name = "分队名称") + private String teamName; + + @Excel(name = "巡查计划") + private String plan; + + @Excel(name = "创建(建队)时间") + private Date time; + + @Excel(name = "场所负责人") + private String personInCharge; + + @Excel(name = "负责人电话") + private String mobile; + + @Excel(name = "备注") + private String remarks; + + @Excel(name = "删除标识:0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPlacePatrolTeamStaffExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPlacePatrolTeamStaffExcel.java new file mode 100644 index 0000000000..99e1641231 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPlacePatrolTeamStaffExcel.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 场所分队下人员管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcPlacePatrolTeamStaffExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "客户Id") + private String customerId; + + @Excel(name = "巡查分队(place_patrol_team)表Id") + private String placePatrolTeamId; + + @Excel(name = "成员姓名") + private String name; + + @Excel(name = "成员电话") + private String mobile; + + @Excel(name = "备注") + private String remarks; + + @Excel(name = "删除标识:0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java index 7538c7bb29..d6ac66d201 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java @@ -338,4 +338,14 @@ public interface CustomerGridService extends BaseService { * @Date 2021/10/26 14:01 */ List getGridOption(String agencyId,String purpose); + + + /** + * @Description 获取组织下网格 + * @Param agencyId + * @Return {@link List< CustomerGridDTO>} + * @Author zhaoqifeng + * @Date 2021/11/29 17:00 + */ + List getGridIListByAgency(String agencyId); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcMatterAppointmentRecordService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcMatterAppointmentRecordService.java new file mode 100644 index 0000000000..4f330654a9 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcMatterAppointmentRecordService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcMatterAppointmentRecordDTO; +import com.epmet.entity.IcMatterAppointmentRecordEntity; + +import java.util.List; +import java.util.Map; + +/** + * 事项预约记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +public interface IcMatterAppointmentRecordService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-11-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-11-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcMatterAppointmentRecordDTO + * @author generator + * @date 2021-11-18 + */ + IcMatterAppointmentRecordDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-18 + */ + void save(IcMatterAppointmentRecordDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-18 + */ + void update(IcMatterAppointmentRecordDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-11-18 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterMatterService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterMatterService.java new file mode 100644 index 0000000000..23ac454d97 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterMatterService.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcPartyServiceCenterMatterDTO; +import com.epmet.entity.IcPartyServiceCenterMatterEntity; + +import java.util.List; +import java.util.Map; + +/** + * 党群服务中心可预约事项表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +public interface IcPartyServiceCenterMatterService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-11-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-11-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcPartyServiceCenterMatterDTO + * @author generator + * @date 2021-11-18 + */ + IcPartyServiceCenterMatterDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-18 + */ + void save(IcPartyServiceCenterMatterDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-18 + */ + void update(IcPartyServiceCenterMatterDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-11-18 + */ + void delete(String[] ids); + + /** + * @Description 根据党群服务中心删除事项 + * @param partyServiceCenterId + * @author zxc + * @date 2021/11/22 10:29 上午 + */ + void deleteMattersByPartyServiceCenterId(String partyServiceCenterId); + + /** + * @Description 根据党群服务中心ID查询事件名字 + * @param centerId + * @author zxc + * @date 2021/12/10 8:56 上午 + */ + List selectMatterNameByCenterId(String centerId); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterService.java new file mode 100644 index 0000000000..9bbfcaf44e --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterService.java @@ -0,0 +1,169 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.IcPartyServiceCenterDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.AppointmentRecordResultDTO; +import com.epmet.dto.result.AppointmentTimeResultDTO; +import com.epmet.dto.result.PartyServiceCenterListResultDTO; +import com.epmet.entity.IcPartyServiceCenterEntity; + +import java.util.List; +import java.util.Map; + +/** + * 党群服务中心 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +public interface IcPartyServiceCenterService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-11-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-11-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcPartyServiceCenterDTO + * @author generator + * @date 2021-11-18 + */ + IcPartyServiceCenterDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-18 + */ + void save(IcPartyServiceCenterDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-18 + */ + void update(IcPartyServiceCenterDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-11-18 + */ + void delete(String[] ids); + + /** + * @Description 新增党群服务中心 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/22 9:13 上午 + */ + void addPartyServiceCenter(AddPartyServiceCenterFormDTO formDTO, TokenDto tokenDto); + + /** + * @Description 修改党群服务中心 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/22 10:21 上午 + */ + void editPartyServiceCenter(EditPartyServiceCenterFormDTO formDTO,TokenDto tokenDto); + + /** + * @Description 事项删除 + * @param formDTO + * @author zxc + * @date 2021/11/22 1:25 下午 + */ + void delMatter(DelMatterFormDTO formDTO); + + /** + * @Description 预约 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/22 2:06 下午 + */ + void appointment(AppointmentFormDTO formDTO,TokenDto tokenDto); + + /** + * @Description 党群服务中心列表 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/22 2:47 下午 + */ + List partyServiceCenterList(PartyServiceCenterListFormDTO formDTO,TokenDto tokenDto); + + /** + * @Description 【党群服务中心】点击预约按钮时,查询可选时间 + * @param formDTO + * @author zxc + * @date 2021/11/23 10:02 上午 + */ + AppointmentTimeResultDTO appointmentTime(AppointmentTimeFormDTO formDTO); + + /** + * @Description 【党群服务中心】预约记录 + * @param formDTO + * @author zxc + * @date 2021/11/23 10:50 上午 + */ + List appointmentRecord(AppointmentRecordFormDTO formDTO); + + /** + * @Description 取消预约 + * @param formDTO + * @author zxc + * @date 2021/11/26 5:21 下午 + */ + void cancelAppointment(CancelAppointmentFormDTO formDTO); + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlaceOrgService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlaceOrgService.java new file mode 100644 index 0000000000..e8fed58f7a --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlaceOrgService.java @@ -0,0 +1,65 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.form.AddPlaceOrgFormDTO; +import com.epmet.dto.form.EditPlaceOrgFormDTO; +import com.epmet.dto.form.GetListPlaceOrgFormDTO; +import com.epmet.dto.result.GetListPlaceOrgResultDTO; +import com.epmet.dto.result.PlaceOrgDetailResultDTO; +import com.epmet.entity.IcPlaceOrgEntity; + +/** + * 九小场所下组织管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +public interface IcPlaceOrgService extends BaseService { + + /** + * @Author sun + * @Description 新增九小场所下组织 + **/ + void add(AddPlaceOrgFormDTO formDTO); + + /** + * @Author sun + * @Description 修改九小场所下组织 + **/ + void edit(EditPlaceOrgFormDTO formDTO); + + /** + * @Author sun + * @Description 删除九小场所下组织 + **/ + void del(String placeOrgId); + + /** + * @Author sun + * @Description 九小场所下组织详情 + **/ + PlaceOrgDetailResultDTO detail(String placeOrgId); + + /** + * @Author sun + * @Description 九小场所下组织列表查询 + **/ + GetListPlaceOrgResultDTO getList(GetListPlaceOrgFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolRecordService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolRecordService.java new file mode 100644 index 0000000000..3b0c2c6e12 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolRecordService.java @@ -0,0 +1,58 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.form.AddPlacePatrolRecordFormDTO; +import com.epmet.dto.form.GetListPlacePatrolRecordFormDTO; +import com.epmet.dto.result.GetListPlacePatrolRecordResultDTO; +import com.epmet.dto.result.PlacePatrolRecordDetailResultDTO; +import com.epmet.entity.IcPlacePatrolRecordEntity; + +/** + * 场所巡查记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +public interface IcPlacePatrolRecordService extends BaseService { + + /** + * @Author sun + * @Description 新增场所巡查记录 + **/ + void add(AddPlacePatrolRecordFormDTO formDTO); + + /** + * @Author sun + * @Description 删除场所巡查记录 + **/ + void del(String staffId, String placePatrolRecordId); + + /** + * @Author sun + * @Description 场所巡查记录详情 + **/ + PlacePatrolRecordDetailResultDTO detail(String placePatrolRecordId); + + /** + * @Author sun + * @Description 场所巡查记录列表查询 + **/ + GetListPlacePatrolRecordResultDTO getList(GetListPlacePatrolRecordFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolReviewRecordService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolReviewRecordService.java new file mode 100644 index 0000000000..1bc4b86fe5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolReviewRecordService.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.form.AddPlacePatrolReviewRecordFormDTO; +import com.epmet.dto.form.EditPlacePatrolReviewRecordFormDTO; +import com.epmet.dto.form.GetListPlacePatrolReviewRecordFormDTO; +import com.epmet.dto.result.GetListPlacePatrolReviewRecordResultDTO; +import com.epmet.dto.result.PlacePatrolReviewRecordDetailResultDTO; +import com.epmet.entity.IcPlacePatrolReviewRecordEntity; + +/** + * 场所巡查复查记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +public interface IcPlacePatrolReviewRecordService extends BaseService { + + /** + * @Author sun + * @Description 新增巡查复查记录 + **/ + PlacePatrolReviewRecordDetailResultDTO add(AddPlacePatrolReviewRecordFormDTO formDTO); + + /** + * @Author sun + * @Description 修改巡查复查记录 + **/ + PlacePatrolReviewRecordDetailResultDTO edit(EditPlacePatrolReviewRecordFormDTO formDTO); + + /** + * @Author sun + * @Description 删除巡查复查记录 + **/ + void del(String placePatrolReviewRecordId); + + /** + * @Author sun + * @Description 巡查复查记录详情 + **/ + PlacePatrolReviewRecordDetailResultDTO detail(String placePatrolReviewRecordId); + + /** + * @Author sun + * @Description 巡查复查记录列表查询 + **/ + GetListPlacePatrolReviewRecordResultDTO getList(GetListPlacePatrolReviewRecordFormDTO formDTO); + + /** + * @Author sun + * @Description 删除巡查记录对应的复查记录 + **/ + int delByPatrolRecordId(String staffId, String placePatrolRecordId); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolTeamService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolTeamService.java new file mode 100644 index 0000000000..6ec9cf1a96 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolTeamService.java @@ -0,0 +1,65 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.form.AddPlacePatrolTeamFormDTO; +import com.epmet.dto.form.EditPlacePatrolTeamFormDTO; +import com.epmet.dto.form.GetListPlacePatrolTeamFormDTO; +import com.epmet.dto.result.GetListPlacePatrolTeamResultDTO; +import com.epmet.dto.result.PlacePatrolTeamDetailResultDTO; +import com.epmet.entity.IcPlacePatrolTeamEntity; + +/** + * 场所分队管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +public interface IcPlacePatrolTeamService extends BaseService { + + /** + * @Author sun + * @Description 新增九小场所巡查分队人员管理 + **/ + void add(AddPlacePatrolTeamFormDTO formDTO); + + /** + * @Author sun + * @Description 修改九小场所巡查分队人员管理 + **/ + void edit(EditPlacePatrolTeamFormDTO formDTO); + + /** + * @Author sun + * @Description 删除九小场所巡查分队人员管理 + **/ + void del(String staffId, String teamId); + + /** + * @Author sun + * @Description 九小场所巡查分队人员管理详情 + **/ + PlacePatrolTeamDetailResultDTO detail(String teamId); + + /** + * @Author sun + * @Description 九小场所巡查分队人员管理列表查询 + **/ + GetListPlacePatrolTeamResultDTO getList(GetListPlacePatrolTeamFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolTeamStaffService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolTeamStaffService.java new file mode 100644 index 0000000000..a622e03811 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolTeamStaffService.java @@ -0,0 +1,52 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.IcPlacePatrolTeamStaffDTO; +import com.epmet.dto.form.GetListPlacePatrolTeamFormDTO; +import com.epmet.entity.IcPlacePatrolTeamStaffEntity; + +import java.util.List; + +/** + * 场所分队下人员管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +public interface IcPlacePatrolTeamStaffService extends BaseService { + + /** + * @Author sun + * @Description 删除分队下成员信息 + **/ + int delByTeamId(String teamId); + + /** + * @Author sun + * @Description 查询分队下人员列表数据 + **/ + List getList(String teamId); + + /** + * @Author sun + * @Description 逻辑删除分队成员子表数据 + **/ + void upByTeamId(String staffId, String teamId); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index 8dac4ed55f..9b6f41daad 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -847,4 +847,23 @@ public class CustomerGridServiceImpl extends BaseServiceImpl} + * @Author zhaoqifeng + * @Date 2021/11/29 17:00 + */ + @Override + public List getGridIListByAgency(String agencyId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(CustomerGridEntity::getPid, agencyId); + List list = baseDao.selectList(wrapper); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + return ConvertUtils.sourceToTarget(list, CustomerGridDTO.class); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerPartyBranchServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerPartyBranchServiceImpl.java index d7ea09f680..57a1277cb0 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerPartyBranchServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerPartyBranchServiceImpl.java @@ -150,7 +150,7 @@ public class CustomerPartyBranchServiceImpl extends BaseServiceImpl getBranchOption(String gridId) { if (StringUtils.isBlank(gridId)) { - log.error("网格ID为空"); + log.warn("网格ID为空"); return Collections.emptyList(); } LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcMatterAppointmentRecordServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcMatterAppointmentRecordServiceImpl.java new file mode 100644 index 0000000000..6878b736c3 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcMatterAppointmentRecordServiceImpl.java @@ -0,0 +1,100 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IcMatterAppointmentRecordDao; +import com.epmet.dto.IcMatterAppointmentRecordDTO; +import com.epmet.entity.IcMatterAppointmentRecordEntity; +import com.epmet.service.IcMatterAppointmentRecordService; +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; + +/** + * 事项预约记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Service +public class IcMatterAppointmentRecordServiceImpl extends BaseServiceImpl implements IcMatterAppointmentRecordService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcMatterAppointmentRecordDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcMatterAppointmentRecordDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcMatterAppointmentRecordDTO get(String id) { + IcMatterAppointmentRecordEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcMatterAppointmentRecordDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcMatterAppointmentRecordDTO dto) { + IcMatterAppointmentRecordEntity entity = ConvertUtils.sourceToTarget(dto, IcMatterAppointmentRecordEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcMatterAppointmentRecordDTO dto) { + IcMatterAppointmentRecordEntity entity = ConvertUtils.sourceToTarget(dto, IcMatterAppointmentRecordEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterMatterServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterMatterServiceImpl.java new file mode 100644 index 0000000000..e6e85dc9ff --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterMatterServiceImpl.java @@ -0,0 +1,123 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IcPartyServiceCenterMatterDao; +import com.epmet.dto.IcPartyServiceCenterMatterDTO; +import com.epmet.entity.IcPartyServiceCenterMatterEntity; +import com.epmet.service.IcPartyServiceCenterMatterService; +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; + +/** + * 党群服务中心可预约事项表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Service +public class IcPartyServiceCenterMatterServiceImpl extends BaseServiceImpl implements IcPartyServiceCenterMatterService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcPartyServiceCenterMatterDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcPartyServiceCenterMatterDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcPartyServiceCenterMatterDTO get(String id) { + IcPartyServiceCenterMatterEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcPartyServiceCenterMatterDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcPartyServiceCenterMatterDTO dto) { + IcPartyServiceCenterMatterEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyServiceCenterMatterEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcPartyServiceCenterMatterDTO dto) { + IcPartyServiceCenterMatterEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyServiceCenterMatterEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Description 根据党群服务中心删除事项 + * @param partyServiceCenterId + * @author zxc + * @date 2021/11/22 10:29 上午 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void deleteMattersByPartyServiceCenterId(String partyServiceCenterId) { + baseDao.deleteMattersByPartyServiceCenterId(partyServiceCenterId); + } + + /** + * @Description 根据党群服务中心ID查询事件名字 + * @param centerId + * @author zxc + * @date 2021/12/10 8:56 上午 + */ + @Override + public List selectMatterNameByCenterId(String centerId) { + return baseDao.selectMatterNameByCenterId(centerId); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java new file mode 100644 index 0000000000..f15494c546 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java @@ -0,0 +1,501 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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.entity.BaseEpmetEntity; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +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.RenException; +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.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.constant.PartyServiceCenterConstant; +import com.epmet.dao.IcMatterAppointmentRecordDao; +import com.epmet.dao.IcPartyServiceCenterDao; +import com.epmet.dto.IcPartyServiceCenterDTO; +import com.epmet.dto.TimeDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.AppointmentExistRecordResultDTO; +import com.epmet.dto.result.AppointmentRecordResultDTO; +import com.epmet.dto.result.AppointmentTimeResultDTO; +import com.epmet.dto.result.PartyServiceCenterListResultDTO; +import com.epmet.entity.IcMatterAppointmentRecordEntity; +import com.epmet.entity.IcPartyServiceCenterEntity; +import com.epmet.entity.IcPartyServiceCenterMatterEntity; +import com.epmet.service.IcPartyServiceCenterMatterService; +import com.epmet.service.IcPartyServiceCenterService; +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.text.ParseException; +import java.text.SimpleDateFormat; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.concurrent.atomic.AtomicReference; +import java.util.stream.Collectors; + +/** + * 党群服务中心 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Service +public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl implements IcPartyServiceCenterService { + + @Autowired + private IcPartyServiceCenterMatterService matterService; + @Autowired + private IcMatterAppointmentRecordDao matterAppointmentRecordDao; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcPartyServiceCenterDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcPartyServiceCenterDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcPartyServiceCenterDTO get(String id) { + IcPartyServiceCenterEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcPartyServiceCenterDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcPartyServiceCenterDTO dto) { + IcPartyServiceCenterEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyServiceCenterEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcPartyServiceCenterDTO dto) { + IcPartyServiceCenterEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyServiceCenterEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Description 新增党群服务中心 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/22 9:13 上午 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void addPartyServiceCenter(AddPartyServiceCenterFormDTO formDTO, TokenDto tokenDto) { + String customerId = tokenDto.getCustomerId(); + LambdaQueryWrapper l = new LambdaQueryWrapper<>(); + l.eq(IcPartyServiceCenterEntity::getCenterName,formDTO.getCenterName()) + .eq(IcPartyServiceCenterEntity::getCustomerId,customerId) + .eq(BaseEpmetEntity::getDelFlag, NumConstant.ZERO); + IcPartyServiceCenterEntity record = baseDao.selectOne(l); + if (null != record){ + throw new RenException(EpmetErrorCode.PARTY_SERVICE_CENTER_ERROR.getCode()); + } + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, tokenDto.getUserId()); + if (null == staffInfo){ + throw new RenException(String.format("查询人员{%s}信息失败",tokenDto.getUserId())); + } + IcPartyServiceCenterEntity centerEntity = ConvertUtils.sourceToTarget(formDTO, IcPartyServiceCenterEntity.class); + centerEntity.setCustomerId(customerId); + centerEntity.setOrgId(staffInfo.getAgencyId()); + centerEntity.setOrgType(PartyServiceCenterConstant.ORG_TYPE_AGENCY); + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId()); + if (null == agencyInfo){ + throw new RenException(String.format("查询组织信息失败%s",staffInfo.getAgencyId())); + } + centerEntity.setPid(agencyInfo.getPid()); + centerEntity.setPids(agencyInfo.getPids()); + baseDao.insert(centerEntity); + if (CollectionUtils.isNotEmpty(formDTO.getMatterList())){ + List matters = ConvertUtils.sourceToTarget(formDTO.getMatterList(), IcPartyServiceCenterMatterEntity.class); + List paramMatterNames = matters.stream().map(m -> m.getMatterName()).collect(Collectors.toList()); + Integer allSize = paramMatterNames.size(); + Integer distinctSize = paramMatterNames.stream().distinct().collect(Collectors.toList()).size(); + if (distinctSize < allSize){ + throw new EpmetException(EpmetErrorCode.MATTER_NAME_EXISTS_APPOINTMENT_ERROR.getCode()); + } + matters.forEach(m -> { + m.setCustomerId(customerId); + m.setPartyServiceCenterId(centerEntity.getId()); + }); + matterService.insertBatch(matters); + } + } + + /** + * @Description 修改党群服务中心 + * 事项只准删除,不准修改 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/22 10:21 上午 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void editPartyServiceCenter(EditPartyServiceCenterFormDTO formDTO, TokenDto tokenDto) { + LambdaQueryWrapper l = new LambdaQueryWrapper<>(); + l.eq(IcPartyServiceCenterEntity::getCenterName,formDTO.getCenterName()) + .eq(IcPartyServiceCenterEntity::getCustomerId,tokenDto.getCustomerId()) + .eq(BaseEpmetEntity::getDelFlag, NumConstant.ZERO) + .ne(BaseEpmetEntity::getId,formDTO.getPartyServiceCenterId()); + IcPartyServiceCenterEntity record = baseDao.selectOne(l); + if (null != record){ + throw new RenException(EpmetErrorCode.PARTY_SERVICE_CENTER_ERROR.getCode()); + } + IcPartyServiceCenterEntity centerEntity = ConvertUtils.sourceToTarget(formDTO, IcPartyServiceCenterEntity.class); + centerEntity.setId(formDTO.getPartyServiceCenterId()); + baseDao.updateById(centerEntity); + + // del matter + if (CollectionUtils.isNotEmpty(formDTO.getDelMatterList())){ + List delMatterList = formDTO.getDelMatterList(); + List existRecord = matterAppointmentRecordDao.appointmentExistRecord(delMatterList); + if (CollectionUtils.isNotEmpty(existRecord)){ + StringBuffer sb = new StringBuffer(); + existRecord.forEach(e -> { + sb.append(e.getMatterName()).append(","); + }); + String copywriter = sb.toString().substring(NumConstant.ZERO, sb.length() - NumConstant.ONE); + EpmetErrorCode.APPOINTMENT_ERROR.setMsg(String.format(EpmetErrorCode.APPOINTMENT_ERROR.getMsg(),copywriter)); + throw new RenException(EpmetErrorCode.APPOINTMENT_ERROR.getCode()); + }else { + matterService.deleteBatchIds(delMatterList); + } + } + + if (CollectionUtils.isNotEmpty(formDTO.getMatterList())){ + List existsMatterNames = matterService.selectMatterNameByCenterId(formDTO.getPartyServiceCenterId()); + List matters = ConvertUtils.sourceToTarget(formDTO.getMatterList(), IcPartyServiceCenterMatterEntity.class); + List paramMatterNames = matters.stream().map(m -> m.getMatterName()).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(existsMatterNames)){ + paramMatterNames.addAll(existsMatterNames); + } + Integer allSize = paramMatterNames.size(); + Integer distinctSize = paramMatterNames.stream().distinct().collect(Collectors.toList()).size(); + if (distinctSize < allSize){ + throw new EpmetException(EpmetErrorCode.MATTER_NAME_EXISTS_APPOINTMENT_ERROR.getCode()); + } + matters.forEach(m -> { + m.setCustomerId(tokenDto.getCustomerId()); + m.setPartyServiceCenterId(formDTO.getPartyServiceCenterId()); + }); + matterService.insertBatch(matters); + } + } + + /** + * @Description 事项删除 + * @param formDTO + * @author zxc + * @date 2021/11/22 1:25 下午 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void delMatter(DelMatterFormDTO formDTO) { + LambdaQueryWrapper re = new LambdaQueryWrapper<>(); + re.eq(BaseEpmetEntity::getDelFlag,NumConstant.ZERO). + eq(IcMatterAppointmentRecordEntity::getMatterId,formDTO.getMatterId()). + ge(IcMatterAppointmentRecordEntity::getAppointmentDate, LocalDate.now()); + List appointmentRecords = matterAppointmentRecordDao.selectList(re); + if (CollectionUtils.isNotEmpty(appointmentRecords)){ + throw new RenException(EpmetErrorCode.MATTER_EXISTS_APPOINTMENT_ERROR.getCode()); + } + matterService.deleteById(formDTO.getMatterId()); + } + + /** + * @Description 预约 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/22 2:06 下午 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void appointment(AppointmentFormDTO formDTO, TokenDto tokenDto) { + String customerId = tokenDto.getCustomerId(); + LambdaQueryWrapper l = new LambdaQueryWrapper<>(); + l.eq(IcMatterAppointmentRecordEntity::getMatterId,formDTO.getMatterId()) + .eq(IcMatterAppointmentRecordEntity::getAppointmentDate,formDTO.getAppointmentDate()) + .eq(IcMatterAppointmentRecordEntity::getStatus,PartyServiceCenterConstant.APPOINTMENT_STATUS_APPOINTING) + .eq(BaseEpmetEntity::getDelFlag,NumConstant.ZERO); + List records = matterAppointmentRecordDao.selectList(l); + if (CollectionUtils.isNotEmpty(records)){ + List timeIds = new ArrayList<>(); + records.forEach(r -> { + timeIds.addAll(Arrays.asList(r.getTimeId().split(","))); + }); + List formTimeId = Arrays.asList(formDTO.getTimeId().split(",")); + int before = timeIds.size() + formTimeId.size(); + List endTimeId = new ArrayList<>(); + endTimeId.addAll(timeIds);endTimeId.addAll(formTimeId); + List collect = endTimeId.stream().distinct().collect(Collectors.toList()); + if (collect.size() < before){ + throw new RenException(EpmetErrorCode.APPOINTMENT_TIME_ERROR.getCode()); + } + } + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, tokenDto.getUserId()); + if (null == staffInfo){ + throw new RenException(String.format("查询人员{%s}信息失败",tokenDto.getUserId())); + } + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId()); + if (null == agencyInfo){ + throw new RenException(String.format("查询组织信息失败%s",staffInfo.getAgencyId())); + } + IcMatterAppointmentRecordEntity e = ConvertUtils.sourceToTarget(formDTO, IcMatterAppointmentRecordEntity.class); + e.setCustomerId(customerId); + e.setOrgId(staffInfo.getAgencyId()); + e.setOrgType(PartyServiceCenterConstant.ORG_TYPE_AGENCY); + e.setPid(agencyInfo.getPid()); + e.setPids(agencyInfo.getPids()); + e.setStatus(PartyServiceCenterConstant.APPOINTMENT_STATUS_APPOINTING); + matterAppointmentRecordDao.insert(e); + } + + /** + * @Description 党群服务中心列表 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/22 2:47 下午 + */ + @Override + public List partyServiceCenterList(PartyServiceCenterListFormDTO formDTO, TokenDto tokenDto) { + if (StringUtils.isBlank(formDTO.getOrgId())){ + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + if (null == staffInfo){ + throw new RenException(String.format("查询人员{%s}信息失败",tokenDto.getUserId())); + } + formDTO.setOrgId(staffInfo.getAgencyId()); + } + List result = baseDao.partyServiceCenterList(formDTO.getOrgId()); + if (CollectionUtils.isNotEmpty(result)){ + result.forEach(r -> { + if (CollectionUtils.isNotEmpty(r.getMatterList())){ + final Integer[] sort = {NumConstant.ONE}; + r.getMatterList().forEach(m -> { + m.setSort(sort[NumConstant.ZERO]++); + }); + } + }); + } + return result; + } + + /** + * @Description 【党群服务中心】点击预约按钮时,查询可选时间 + * @param formDTO + * @author zxc + * @date 2021/11/23 10:02 上午 + */ + @Override + public AppointmentTimeResultDTO appointmentTime(AppointmentTimeFormDTO formDTO) { + AppointmentTimeResultDTO result = new AppointmentTimeResultDTO(); + IcPartyServiceCenterMatterEntity matter = matterService.selectById(formDTO.getMatterId()); + if (null == matter){ + throw new RenException("事项不存在..."); + } + result.setAppointmentType(matter.getAppointmentType()); + LambdaQueryWrapper l = new LambdaQueryWrapper<>(); + l.eq(IcMatterAppointmentRecordEntity::getMatterId,formDTO.getMatterId()) + .eq(IcMatterAppointmentRecordEntity::getAppointmentDate,formDTO.getDate()) + .eq(IcMatterAppointmentRecordEntity::getStatus,PartyServiceCenterConstant.APPOINTMENT_STATUS_APPOINTING) + .eq(BaseEpmetEntity::getDelFlag,NumConstant.ZERO); + List records = matterAppointmentRecordDao.selectList(l); + List timeList = getTimeList(matter.getStartTime(), matter.getEndTime(), NumConstant.THIRTY); + if (formDTO.getDate().equals(LocalDate.now().toString())){ + LocalDateTime now = LocalDateTime.now(); + DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + for (TimeDTO t : timeList) { + List list = Arrays.asList(t.getTime().split("-")); + String concat = formDTO.getDate().concat(" ").concat(list.get(NumConstant.ONE)).concat(":00"); + LocalDateTime parse = LocalDateTime.parse(concat, df); + t.setIsAppointment(parse.isAfter(now)); + } + } + if (LocalDate.now().isAfter(LocalDate.parse(formDTO.getDate()))){ + timeList.forEach(t -> { + t.setIsAppointment(false); + }); + result.setTimeDetail(timeList); + return result; + } + if (CollectionUtils.isNotEmpty(records)){ + records.forEach(r -> { + String[] split = r.getTimeId().split(","); + for (String s : split) { + for (TimeDTO t : timeList) { + if (s.equals(t.getTimeId())){ + t.setIsAppointment(false); + break; + } + } + } + }); + } + result.setTimeDetail(timeList); + return result; + } + + /** + * @Description 【党群服务中心】预约记录 + * @param formDTO + * @author zxc + * @date 2021/11/23 10:50 上午 + */ + @Override + public List appointmentRecord(AppointmentRecordFormDTO formDTO) { + List result = matterAppointmentRecordDao.appointmentRecord(formDTO.getMatterId(), formDTO.getDate()); + if (CollectionUtils.isEmpty(result)){ + return new ArrayList<>(); + } + IcPartyServiceCenterMatterEntity matter = matterService.selectById(formDTO.getMatterId()); + if (null == matter){ + throw new RenException("事项不存在..."); + } + List timeList = getTimeList(matter.getStartTime(), matter.getEndTime(), NumConstant.THIRTY); + AtomicReference sort = new AtomicReference<>(NumConstant.ONE); + result.forEach(r -> { + r.setSort(sort.getAndSet(sort.get() + NumConstant.ONE)); + List time = new ArrayList<>(); + List list = Arrays.asList(r.getTimeId().split(",")); + list.forEach(l -> timeList.stream().filter( t -> l.equals(t.getTimeId())).forEach(t -> time.add(t.getTime()))); + r.setAppointmentTime(time); + }); + return result; + } + + /** + * @Description 取消预约 + * @param formDTO + * @author zxc + * @date 2021/11/26 5:21 下午 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void cancelAppointment(CancelAppointmentFormDTO formDTO) { + matterAppointmentRecordDao.cancelAppointment(formDTO.getRecordId(), formDTO.getUserId()); + } + + public List getTimeList(String start,String end,Integer interval){ + List result = new ArrayList<>(); + List intervalTimeList = getIntervalTimeList(start, end, interval); + Integer sort = NumConstant.ONE; + for (int i = NumConstant.ZERO; i < intervalTimeList.size(); i++) { + if (i + NumConstant.ONE >= intervalTimeList.size()){ + return result; + } + TimeDTO timeDTO = new TimeDTO(); + timeDTO.setTime(intervalTimeList.get(i) + "-" + intervalTimeList.get(i + NumConstant.ONE)); + timeDTO.setTimeId(String.valueOf(sort++)); + result.add(timeDTO); + } + return result; + } + + /** + * @Description 获取固定时间段之间固定时间的集合 + * @param start 开始时间 + * @param end 结束时间 + * @param interval 间隔时间 + * @author zxc + * @date 2021/11/22 3:48 下午 + */ + public List getIntervalTimeList(String start,String end,Integer interval) { + Date startDate = convertStringToDate("HH:mm", start); + Date endDate = convertStringToDate("HH:mm", end); + List list = new ArrayList<>(); + while (startDate.getTime() <= endDate.getTime()) { + list.add(convertDateToString("HH:mm", startDate)); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.MINUTE, interval); + if (calendar.getTime().getTime() > endDate.getTime()) { + if (!startDate.equals(endDate)) { + list.add(convertDateToString("HH:mm", endDate)); + } + startDate = calendar.getTime(); + } else { + startDate = calendar.getTime(); + } + + } + return list; + } + + + public Date convertStringToDate(String format, String dateStr) { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format); + try { + Date date = simpleDateFormat.parse(dateStr); + return date; + } catch (ParseException e) { + e.printStackTrace(); + } + return null; + } + + public String convertDateToString(String format, Date date) { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format); + return simpleDateFormat.format(date); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlaceOrgServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlaceOrgServiceImpl.java new file mode 100644 index 0000000000..1a0e071404 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlaceOrgServiceImpl.java @@ -0,0 +1,171 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.enums.DictTypeEnum; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.IcPlaceOrgDao; +import com.epmet.dto.form.AddPlaceOrgFormDTO; +import com.epmet.dto.form.EditPlaceOrgFormDTO; +import com.epmet.dto.form.GetListPlaceOrgFormDTO; +import com.epmet.dto.result.GetListPlaceOrgResultDTO; +import com.epmet.dto.result.PlaceOrgDetailResultDTO; +import com.epmet.entity.IcPlaceOrgEntity; +import com.epmet.feign.EpmetAdminOpenFeignClient; +import com.epmet.service.IcPlaceOrgService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +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.util.CollectionUtils; + +import java.util.List; +import java.util.Map; + +/** + * 九小场所下组织管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Service +public class IcPlaceOrgServiceImpl extends BaseServiceImpl implements IcPlaceOrgService { + private static final Logger log = LoggerFactory.getLogger(IcPlaceOrgServiceImpl.class); + @Autowired + private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient; + + /** + * @Author sun + * @Description 新增九小场所下组织 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void add(AddPlaceOrgFormDTO formDTO) { + IcPlaceOrgEntity entity = ConvertUtils.sourceToTarget(formDTO, IcPlaceOrgEntity.class); + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + entity.setAgencyId(staffInfoCache.getAgencyId()); + entity.setPids(staffInfoCache.getAgencyPIds()); + insert(entity); + } + + /** + * @Author sun + * @Description 修改九小场所下组织 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void edit(EditPlaceOrgFormDTO formDTO) { + IcPlaceOrgEntity entity = baseDao.selectById(formDTO.getPlaceOrgId()); + if (null == entity) { + throw new RenException(String.format("修改九小场所下场所信息失败,场所不存在,场所Id->%s", formDTO.getPlaceOrgId())); + } + entity = ConvertUtils.sourceToTarget(formDTO, IcPlaceOrgEntity.class); + entity.setId(formDTO.getPlaceOrgId()); + baseDao.updateById(entity); + } + + /** + * @Author sun + * @Description 删除九小场所下组织 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void del(String placeOrgId) { + if (baseDao.deleteById(placeOrgId) < NumConstant.ONE) { + throw new RenException(String.format("删除九小场所下场所信息失败,场所Id->%s", placeOrgId)); + } + } + + /** + * @Author sun + * @Description 九小场所下组织详情 + **/ + @Override + public PlaceOrgDetailResultDTO detail(String placeOrgId) { + PlaceOrgDetailResultDTO resultDTO = new PlaceOrgDetailResultDTO(); + //1.查询场所基础信息 + GetListPlaceOrgFormDTO dto = new GetListPlaceOrgFormDTO(); + dto.setPlaceOrgId(placeOrgId); + List result = baseDao.getList(dto); + if (CollectionUtils.isEmpty(result)) { + return resultDTO; + } + resultDTO = result.get(0); + + //2.查询九小场所信息 + Result> result1 = epmetAdminOpenFeignClient.getNineSmallPlacesOption(); + if (!result1.success()) { + throw new RenException("获取九小场所基本信息失败......"); + } + for (OptionResultDTO d : result1.getData()) { + if (d.getValue().equals(resultDTO.getNinePlaceVal())) { + resultDTO.setNinePlaceName(d.getLabel()); + } + } + + //3.查询人员规模字典表信息 + Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.SCALE.getCode()); + resultDTO.setScaleName(unitTypeMap.getData().get(resultDTO.getScale())); + + return resultDTO; + } + + /** + * @Author sun + * @Description 九小场所下组织列表查询 + **/ + @Override + public GetListPlaceOrgResultDTO getList(GetListPlaceOrgFormDTO formDTO) { + GetListPlaceOrgResultDTO resultDTO = new GetListPlaceOrgResultDTO(); + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + formDTO.setPids(staffInfoCache.getAgencyPIds()); + //1.根据查询条件分页查询场所数据 + PageInfo result = + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.getList(formDTO)); + if (CollectionUtils.isEmpty(result.getList())) { + return resultDTO; + } + resultDTO.setTotal((int) result.getTotal()); + + //2.查询九小场所信息 + Result> result1 = epmetAdminOpenFeignClient.getNineSmallPlacesOption(); + if (!result1.success()) { + throw new RenException("获取九小场所基本信息失败......"); + } + result.getList().forEach(r -> result1.getData().stream().filter(u -> r.getNinePlaceVal().equals(u.getValue())).forEach(u -> r.setNinePlaceName(u.getLabel()))); + + //3.人员规模字典表赋值 + Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.SCALE.getCode()); + result.getList().forEach(item -> { + item.setScaleName(unitTypeMap.getData().get(item.getScale())); + }); + + resultDTO.setList(result.getList()); + return resultDTO; + } +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolRecordServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolRecordServiceImpl.java new file mode 100644 index 0000000000..2b205e9ae6 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolRecordServiceImpl.java @@ -0,0 +1,205 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.IcPlacePatrolRecordDao; +import com.epmet.dao.IcPlacePatrolTeamStaffDao; +import com.epmet.dto.CustomerGridDTO; +import com.epmet.dto.IcPlacePatrolTeamStaffDTO; +import com.epmet.dto.form.AddPlacePatrolRecordFormDTO; +import com.epmet.dto.form.GetListPlacePatrolRecordFormDTO; +import com.epmet.dto.form.GetListPlacePatrolTeamFormDTO; +import com.epmet.dto.result.*; +import com.epmet.entity.IcHouseEntity; +import com.epmet.entity.IcPlacePatrolRecordEntity; +import com.epmet.entity.IcPlacePatrolTeamEntity; +import com.epmet.entity.IcPlacePatrolTeamStaffEntity; +import com.epmet.feign.EpmetAdminOpenFeignClient; +import com.epmet.service.IcPlacePatrolRecordService; +import com.epmet.service.IcPlacePatrolReviewRecordService; +import com.epmet.service.IcPlacePatrolTeamService; +import com.epmet.service.IcPlacePatrolTeamStaffService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.lang3.StringUtils; +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.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 场所巡查记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Service +public class IcPlacePatrolRecordServiceImpl extends BaseServiceImpl implements IcPlacePatrolRecordService { + private static final Logger log = LoggerFactory.getLogger(IcPlaceOrgServiceImpl.class); + @Autowired + private IcPlacePatrolReviewRecordService icPlacePatrolReviewRecordService; + @Autowired + private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient; + @Autowired + private IcPlacePatrolTeamStaffDao icPlacePatrolTeamStaffDao; + + + /** + * @Author sun + * @Description 新增场所巡查记录 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void add(AddPlacePatrolRecordFormDTO formDTO) { + IcPlacePatrolRecordEntity entity = ConvertUtils.sourceToTarget(formDTO, IcPlacePatrolRecordEntity.class); + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + entity.setAgencyId(staffInfoCache.getAgencyId()); + entity.setPids(staffInfoCache.getAgencyPIds()); + entity.setFinalResult(entity.getFirstResult()); + entity.setFinalTime(entity.getFirstTime()); + insert(entity); + } + + /** + * @Author sun + * @Description 删除场所巡查记录 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void del(String staffId, String placePatrolRecordId) { + //1.删除巡查记录主表数据 + if (baseDao.deleteById(placePatrolRecordId) < NumConstant.ONE) { + throw new RenException(String.format("删除场所巡查记录信息失败,巡查Id->%s", placePatrolRecordId)); + } + //2.删除复查记录附表数据 + icPlacePatrolReviewRecordService.delByPatrolRecordId(staffId, placePatrolRecordId); + } + + /** + * @Author sun + * @Description 场所巡查记录详情 + **/ + @Override + public PlacePatrolRecordDetailResultDTO detail(String placePatrolRecordId) { + PlacePatrolRecordDetailResultDTO resultDTO = new PlacePatrolRecordDetailResultDTO(); + //1.查询巡查记录信息 + GetListPlacePatrolRecordFormDTO dto = new GetListPlacePatrolRecordFormDTO(); + dto.setPlacePatrolRecordId(placePatrolRecordId); + List result = baseDao.getList(dto); + if (CollectionUtils.isEmpty(result)) { + return resultDTO; + } + resultDTO = result.get(0); + + //2.查询九小场所信息 + Result> nineList = epmetAdminOpenFeignClient.getNineSmallPlacesOption(); + if (!nineList.success()) { + throw new RenException("获取九小场所基本信息失败......"); + } + + //3.查询所有分队下人员名单 + List teamIds = new ArrayList<>(); + teamIds.add(resultDTO.getPlacePatrolTeamId()); + List teamDTOList = icPlacePatrolTeamStaffDao.selectByTeamIds(teamIds); + + //4.封装九小场所、分队成员数据 + for (OptionResultDTO n : nineList.getData()){ + if(resultDTO.getNinePlaceVal().equals(n.getValue())){ + resultDTO.setNinePlaceName(n.getLabel()); + } + } + //分队成员 + StringBuffer inspectorsNames = new StringBuffer(""); + for (String str : resultDTO.getInspectors().split(",")) { + teamDTOList.forEach(r -> { + if (str.equals(r.getId())) { + inspectorsNames.append("".equals(inspectorsNames.toString().trim()) ? r.getName() : "," + r.getName()); + } + }); + } + resultDTO.setInspectorsNames(inspectorsNames.toString()); + + return resultDTO; + } + + /** + * @Author sun + * @Description 场所巡查记录列表查询 + **/ + @Override + public GetListPlacePatrolRecordResultDTO getList(GetListPlacePatrolRecordFormDTO formDTO) { + GetListPlacePatrolRecordResultDTO resultDTO = new GetListPlacePatrolRecordResultDTO(); + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + formDTO.setPids(staffInfoCache.getAgencyPIds()); + //1.根据条件查询巡查记录数据 + PageInfo result = + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.getList(formDTO)); + if (CollectionUtils.isEmpty(result.getList())) { + return resultDTO; + } + resultDTO.setTotal((int) result.getTotal()); + + //2.查询九小场所信息 + Result> nineList = epmetAdminOpenFeignClient.getNineSmallPlacesOption(); + if (!nineList.success()) { + throw new RenException("获取九小场所基本信息失败......"); + } + + //3.查询所有分队下人员名单 + List teamIds = result.getList().stream().map(PlacePatrolRecordDetailResultDTO::getPlacePatrolTeamId).collect(Collectors.toList()); + teamIds = teamIds.stream().distinct().collect(Collectors.toList()); + List teamDTOList = icPlacePatrolTeamStaffDao.selectByTeamIds(teamIds); + //4.封装九小场所、分队人员数据 + for (PlacePatrolRecordDetailResultDTO dto : result.getList()){ + //九小场所 + nineList.getData().forEach(n->{ + if(dto.getNinePlaceVal().equals(n.getValue())){ + dto.setNinePlaceName(n.getLabel()); + } + }); + //分队成员 + StringBuffer inspectorsNames = new StringBuffer(""); + for (String str : dto.getInspectors().split(",")) { + teamDTOList.forEach(r -> { + if (str.equals(r.getId())) { + inspectorsNames.append("".equals(inspectorsNames.toString().trim()) ? r.getName() : "," + r.getName()); + } + }); + } + dto.setInspectorsNames(inspectorsNames.toString()); + } + + resultDTO.setList(result.getList()); + return resultDTO; + } +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolReviewRecordServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolReviewRecordServiceImpl.java new file mode 100644 index 0000000000..24eb3ebd2b --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolReviewRecordServiceImpl.java @@ -0,0 +1,221 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.IcPlacePatrolReviewRecordDao; +import com.epmet.dao.IcPlacePatrolTeamStaffDao; +import com.epmet.dto.IcPlacePatrolTeamStaffDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.GetListPlacePatrolRecordResultDTO; +import com.epmet.dto.result.GetListPlacePatrolReviewRecordResultDTO; +import com.epmet.dto.result.PlacePatrolRecordDetailResultDTO; +import com.epmet.dto.result.PlacePatrolReviewRecordDetailResultDTO; +import com.epmet.entity.IcPlacePatrolRecordEntity; +import com.epmet.entity.IcPlacePatrolReviewRecordEntity; +import com.epmet.entity.IcPlacePatrolTeamEntity; +import com.epmet.entity.IcPlacePatrolTeamStaffEntity; +import com.epmet.feign.EpmetAdminOpenFeignClient; +import com.epmet.service.IcPlacePatrolRecordService; +import com.epmet.service.IcPlacePatrolReviewRecordService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +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.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 场所巡查复查记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Service +public class IcPlacePatrolReviewRecordServiceImpl extends BaseServiceImpl implements IcPlacePatrolReviewRecordService { + private static final Logger log = LoggerFactory.getLogger(IcPlaceOrgServiceImpl.class); + @Autowired + private IcPlacePatrolRecordService icPlacePatrolRecordService; + @Autowired + private IcPlacePatrolTeamStaffDao icPlacePatrolTeamStaffDao; + + + /** + * @Author sun + * @Description 新增巡查复查记录 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public PlacePatrolReviewRecordDetailResultDTO add(AddPlacePatrolReviewRecordFormDTO formDTO) { + PlacePatrolReviewRecordDetailResultDTO resultDTO = new PlacePatrolReviewRecordDetailResultDTO(); + //1.复查记录表新增数据 + IcPlacePatrolReviewRecordEntity entity = ConvertUtils.sourceToTarget(formDTO, IcPlacePatrolReviewRecordEntity.class); + insert(entity); + + //2.修改巡查记录数据最新巡查时间和结果 + IcPlacePatrolRecordEntity recordEntity = new IcPlacePatrolRecordEntity(); + recordEntity.setId(entity.getPlacePatrolRecordId()); + recordEntity.setFinalResult(entity.getReviewResult()); + recordEntity.setFinalTime(entity.getReviewTime()); + icPlacePatrolRecordService.updateById(recordEntity); + + //3.返回详情数据 + resultDTO = detail(entity.getId()); + return resultDTO; + } + + /** + * @Author sun + * @Description 修改巡查复查记录 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public PlacePatrolReviewRecordDetailResultDTO edit(EditPlacePatrolReviewRecordFormDTO formDTO) { + PlacePatrolReviewRecordDetailResultDTO resultDTO = new PlacePatrolReviewRecordDetailResultDTO(); + //1.修改复查记录表数据 + IcPlacePatrolReviewRecordEntity entity = baseDao.selectById(formDTO.getPlacePatrolReviewRecordId()); + if (null == entity) { + throw new RenException(String.format("修改巡查复查记录信息失败,复查记录不存在,复查记录Id->%s", formDTO.getPlacePatrolReviewRecordId())); + } + entity = ConvertUtils.sourceToTarget(formDTO, IcPlacePatrolReviewRecordEntity.class); + entity.setId(formDTO.getPlacePatrolReviewRecordId()); + baseDao.updateById(entity); + + //2.复查记录修改了复查时间或复查结果时对应修改巡查记录数据最新巡查时间和结果 + if (StringUtils.isNotEmpty(formDTO.getReviewResult()) || StringUtils.isNotEmpty(formDTO.getReviewTime().toString())) { + IcPlacePatrolRecordEntity recordEntity = new IcPlacePatrolRecordEntity(); + recordEntity.setId(entity.getPlacePatrolRecordId()); + if (StringUtils.isNotEmpty(formDTO.getReviewResult()) || StringUtils.isNotEmpty(formDTO.getReviewTime().toString())) { + recordEntity.setFinalResult(entity.getReviewResult()); + } + if (StringUtils.isNotEmpty(formDTO.getReviewTime().toString())) { + recordEntity.setFinalTime(entity.getReviewTime()); + } + icPlacePatrolRecordService.updateById(recordEntity); + } + + //3.返回复查记录修改后的详情数据 + resultDTO = detail(formDTO.getPlacePatrolReviewRecordId()); + return resultDTO; + } + + /** + * @Author sun + * @Description 删除巡查复查记录 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void del(String placePatrolReviewRecordId) { + if (baseDao.deleteById(placePatrolReviewRecordId) < NumConstant.ONE) { + throw new RenException(String.format("删除巡查复查记录信息失败,复查记录Id->%s", placePatrolReviewRecordId)); + } + } + + /** + * @Author sun + * @Description 巡查复查记录详情 + **/ + @Override + public PlacePatrolReviewRecordDetailResultDTO detail(String placePatrolReviewRecordId) { + PlacePatrolReviewRecordDetailResultDTO resultDTO = new PlacePatrolReviewRecordDetailResultDTO(); + //1.查询场所基础信息 + GetListPlacePatrolReviewRecordFormDTO dto = new GetListPlacePatrolReviewRecordFormDTO(); + dto.setPlacePatrolReviewRecordId(placePatrolReviewRecordId); + List result = baseDao.getList(dto); + if (CollectionUtils.isEmpty(result)) { + return resultDTO; + } + resultDTO = result.get(0); + + //2.查询所有分队下人员名单 + List teamDTOList = icPlacePatrolTeamStaffDao.getByTeamId(resultDTO.getPlacePatrolTeamId()); + //3.封装九小场所数据 + StringBuffer inspectorsNames = new StringBuffer(""); + for (String str : resultDTO.getInspectors().split(",")) { + teamDTOList.forEach(r -> { + if (str.equals(r.getId())) { + inspectorsNames.append("".equals(inspectorsNames.toString().trim()) ? r.getName() : "," + r.getName()); + } + }); + } + resultDTO.setInspectorsNames(inspectorsNames.toString()); + + return resultDTO; + } + + /** + * @Author sun + * @Description 巡查复查记录列表查询 + **/ + @Override + public GetListPlacePatrolReviewRecordResultDTO getList(GetListPlacePatrolReviewRecordFormDTO formDTO) { + GetListPlacePatrolReviewRecordResultDTO resultDTO = new GetListPlacePatrolReviewRecordResultDTO(); + //1.查询巡查记录对应的复查记录数据 + PageInfo result = + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.getList(formDTO)); + if (CollectionUtils.isEmpty(result.getList())) { + return resultDTO; + } + resultDTO.setTotal((int) result.getTotal()); + + //2.查询所有分队下人员名单 + List teamIds = result.getList().stream().map(PlacePatrolReviewRecordDetailResultDTO::getPlacePatrolTeamId).collect(Collectors.toList()); + teamIds = teamIds.stream().distinct().collect(Collectors.toList()); + List teamDTOList = icPlacePatrolTeamStaffDao.selectByTeamIds(teamIds); + + //3.封装各分队人员数据 + for (PlacePatrolReviewRecordDetailResultDTO dto : result.getList()) { + //分队成员 + StringBuffer inspectorsNames = new StringBuffer(""); + for (String str : dto.getInspectors().split(",")) { + teamDTOList.forEach(r -> { + if (str.equals(r.getId())) { + inspectorsNames.append("".equals(inspectorsNames.toString().trim()) ? r.getName() : "," + r.getName()); + } + }); + } + dto.setInspectorsNames(inspectorsNames.toString()); + } + + resultDTO.setList(result.getList()); + return resultDTO; + } + + /** + * @Author sun + * @Description 删除巡查记录对应的复查记录 + **/ + @Override + public int delByPatrolRecordId(String staffId, String placePatrolRecordId) { + return baseDao.delByPatrolRecordId(staffId, placePatrolRecordId); + } +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamServiceImpl.java new file mode 100644 index 0000000000..c16b575230 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamServiceImpl.java @@ -0,0 +1,275 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.CustomerGridDao; +import com.epmet.dao.IcPlacePatrolTeamDao; +import com.epmet.dto.CustomerGridDTO; +import com.epmet.dto.form.AddPlacePatrolTeamFormDTO; +import com.epmet.dto.form.EditPlacePatrolTeamFormDTO; +import com.epmet.dto.form.GetListPlacePatrolTeamFormDTO; +import com.epmet.dto.result.GetListPlacePatrolTeamResultDTO; +import com.epmet.dto.result.PlacePatrolTeamDetailResultDTO; +import com.epmet.entity.IcPlacePatrolTeamEntity; +import com.epmet.entity.IcPlacePatrolTeamStaffEntity; +import com.epmet.feign.EpmetAdminOpenFeignClient; +import com.epmet.service.IcPlacePatrolTeamService; +import com.epmet.service.IcPlacePatrolTeamStaffService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +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.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 场所分队管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Service +public class IcPlacePatrolTeamServiceImpl extends BaseServiceImpl implements IcPlacePatrolTeamService { + private static final Logger log = LoggerFactory.getLogger(IcPlacePatrolTeamServiceImpl.class); + @Autowired + private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient; + @Autowired + private IcPlacePatrolTeamStaffService placePatrolTeamStaffService; + @Autowired + private CustomerGridDao customerGridDao; + + /** + * @Author sun + * @Description 新增九小场所巡查分队人员管理 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void add(AddPlacePatrolTeamFormDTO formDTO) { + //检验分队下添加的人员手机号唯一 + Map map = new HashMap<>(); + formDTO.getMemberList().forEach(m -> { + if(map.containsKey(m.getMobile())){ + throw new RenException(String.format("新增巡查人员管理失败,分队下人员手机号重复,重复手机号->%s", m.getMobile())); + } + map.put(m.getMobile(),m.getName()); + }); + //1.分队主表新增数据 + IcPlacePatrolTeamEntity entity = ConvertUtils.sourceToTarget(formDTO, IcPlacePatrolTeamEntity.class); + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + entity.setAgencyId(staffInfoCache.getAgencyId()); + entity.setPids(staffInfoCache.getAgencyPIds()); + insert(entity); + //2.分队成员表新增数据 + List entityList = new ArrayList<>(); + formDTO.getMemberList().forEach(m -> { + IcPlacePatrolTeamStaffEntity entity1 = new IcPlacePatrolTeamStaffEntity(); + entity1.setCustomerId(formDTO.getCustomerId()); + entity1.setPlacePatrolTeamId(entity.getId()); + entity1.setName(m.getName()); + entity1.setMobile(m.getMobile()); + entityList.add(entity1); + }); + placePatrolTeamStaffService.insertBatch(entityList); + + } + + /** + * @Author sun + * @Description 修改九小场所巡查分队人员管理数据 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void edit(EditPlacePatrolTeamFormDTO formDTO) { + //检验分队下添加的人员手机号唯一 + Map map = new HashMap<>(); + formDTO.getMemberList().forEach(m -> { + if(map.containsKey(m.getMobile())){ + throw new RenException(String.format("修改巡查人员管理失败,分队下人员手机号重复,重复手机号->%s", m.getMobile())); + } + map.put(m.getMobile(),m.getName()); + }); + //1.修改分队主表信息 + IcPlacePatrolTeamEntity entity = baseDao.selectById(formDTO.getTeamId()); + if (null == entity) { + throw new RenException(String.format("修改九小场所下巡查分队人员信息失败,分队信息不存在,分队Id->%s", formDTO.getTeamId())); + } + entity = ConvertUtils.sourceToTarget(formDTO, IcPlacePatrolTeamEntity.class); + entity.setId(formDTO.getTeamId()); + baseDao.updateById(entity); + //2.全删全增分队成员字表数据 + List entityList = new ArrayList<>(); + for (EditPlacePatrolTeamFormDTO.Member m : formDTO.getMemberList()) { + IcPlacePatrolTeamStaffEntity entity1 = new IcPlacePatrolTeamStaffEntity(); + entity1.setCustomerId(entity.getCustomerId()); + entity1.setPlacePatrolTeamId(entity.getId()); + entity1.setName(m.getName()); + entity1.setMobile(m.getMobile()); + entityList.add(entity1); + } + //物理删除 + placePatrolTeamStaffService.delByTeamId(formDTO.getTeamId()); + placePatrolTeamStaffService.insertBatch(entityList); + + } + + /** + * @Author sun + * @Description 删除九小场所巡查分队人员管理数据 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void del(String staffId, String teamId) { + //1.删除分队主表数据 + if (baseDao.deleteById(teamId) < NumConstant.ONE) { + throw new RenException(String.format("删除九小场所下分队信息失败,分队Id->%s", teamId)); + } + //2.逻辑删除分队成员字表数据 + placePatrolTeamStaffService.upByTeamId(staffId, teamId); + } + + /** + * @Author sun + * @Description 九小场所巡查分队人员管理详情 + **/ + @Override + public PlacePatrolTeamDetailResultDTO detail(String teamId) { + PlacePatrolTeamDetailResultDTO resultDTO = new PlacePatrolTeamDetailResultDTO(); + //1.查询场所基础信息 + GetListPlacePatrolTeamFormDTO dto = new GetListPlacePatrolTeamFormDTO(); + dto.setTeamId(teamId); + List result = baseDao.getList(dto); + if (CollectionUtils.isEmpty(result)) { + return resultDTO; + } + resultDTO = result.get(0); + + //2.查询网格信息 + List gridIds = new ArrayList<>(); + for (String str : resultDTO.getGridIds().split(",")) { + gridIds.add(str); + } + gridIds = gridIds.stream().distinct().collect(Collectors.toList()); + List gridList = customerGridDao.selectGridListByIds(gridIds); + + //3.查询九小场所信息 + Result> nineList = epmetAdminOpenFeignClient.getNineSmallPlacesOption(); + if (!nineList.success()) { + throw new RenException("获取九小场所基本信息失败......"); + } + + //4.分别封装网格。九小场所数据 + //网格 + StringBuffer gridNames = new StringBuffer(""); + for (String str : resultDTO.getGridIds().split(",")) { + gridList.forEach(r -> { + if (str.equals(r.getId())) { + gridNames.append("".equals(gridNames.toString().trim()) ? r.getGridName() : "," + r.getGridName()); + } + }); + } + resultDTO.setGridNames(gridNames.toString()); + //九小场所 + StringBuffer ninePlaceNames = new StringBuffer(""); + for (String str : resultDTO.getNinePlaceVals().split(",")) { + nineList.getData().forEach(r -> { + if (str.equals(r.getValue())) { + ninePlaceNames.append("".equals(ninePlaceNames.toString().trim()) ? r.getLabel() : "," + r.getLabel()); + } + }); + } + resultDTO.setNinePlaceNames(ninePlaceNames.toString()); + + return resultDTO; + } + + /** + * @Author sun + * @Description 九小场所巡查分队人员管理列表查询 + **/ + @Override + public GetListPlacePatrolTeamResultDTO getList(GetListPlacePatrolTeamFormDTO formDTO) { + GetListPlacePatrolTeamResultDTO resultDTO = new GetListPlacePatrolTeamResultDTO(); + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + formDTO.setPids(staffInfoCache.getAgencyPIds()); + //1.根据条件查询分队及成员数据 + PageInfo result = + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.getList(formDTO)); + if (CollectionUtils.isEmpty(result.getList())) { + return resultDTO; + } + resultDTO.setTotal((int) result.getTotal()); + + //2.查询网格信息 + List gridIds = new ArrayList<>(); + for (PlacePatrolTeamDetailResultDTO dto : result.getList()) { + for (String str : dto.getGridIds().split(",")) { + gridIds.add(str); + } + } + gridIds = gridIds.stream().distinct().collect(Collectors.toList()); + List gridList = customerGridDao.selectGridListByIds(gridIds); + + //3.查询九小场所信息 + Result> nineList = epmetAdminOpenFeignClient.getNineSmallPlacesOption(); + if (!nineList.success()) { + throw new RenException("获取九小场所基本信息失败......"); + } + + //4.封装网格、九小场所数据 + for (PlacePatrolTeamDetailResultDTO dto : result.getList()) { + StringBuffer gridNames = new StringBuffer(""); + for (String str : dto.getGridIds().split(",")) { + gridList.forEach(r -> { + if (str.equals(r.getId())) { + gridNames.append("".equals(gridNames.toString().trim()) ? r.getGridName() : "," + r.getGridName()); + } + }); + } + dto.setGridNames(gridNames.toString()); + StringBuffer ninePlaceNames = new StringBuffer(""); + for (String str : dto.getNinePlaceVals().split(",")) { + nineList.getData().forEach(r -> { + if (str.equals(r.getValue())) { + ninePlaceNames.append("".equals(ninePlaceNames.toString().trim()) ? r.getLabel() : "," + r.getLabel()); + } + }); + } + dto.setNinePlaceNames(ninePlaceNames.toString()); + } + + resultDTO.setList(result.getList()); + return resultDTO; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamStaffServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamStaffServiceImpl.java new file mode 100644 index 0000000000..8f26db929e --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamStaffServiceImpl.java @@ -0,0 +1,69 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.IcPlacePatrolTeamStaffDao; +import com.epmet.dto.IcPlacePatrolTeamStaffDTO; +import com.epmet.dto.form.GetListPlacePatrolTeamFormDTO; +import com.epmet.dto.result.GetListPlacePatrolTeamResultDTO; +import com.epmet.entity.IcPlacePatrolTeamStaffEntity; +import com.epmet.service.IcPlacePatrolTeamStaffService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 场所分队下人员管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Service +public class IcPlacePatrolTeamStaffServiceImpl extends BaseServiceImpl implements IcPlacePatrolTeamStaffService { + + + + /** + * @Author sun + * @Description 删除分队下成员信息 + **/ + @Override + public int delByTeamId(String teamId) { + return baseDao.delByTeamId(teamId); + } + + /** + * @Author sun + * @Description 查询分队下人员列表数据 + **/ + @Override + public List getList(String teamId) { + return baseDao.getByTeamId(teamId); + } + + /** + * @Author sun + * @Description 逻辑删除分队成员子表数据 + **/ + @Override + public void upByTeamId(String staffId, String teamId) { + baseDao.upByTeamId(staffId, teamId); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMatterAppointmentRecordDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMatterAppointmentRecordDao.xml new file mode 100644 index 0000000000..3b5f960894 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMatterAppointmentRecordDao.xml @@ -0,0 +1,48 @@ + + + + + + + + UPDATE ic_matter_appointment_record + SET `STATUS` = 'cancel', + DEL_FLAG = 1, + UPDATED_BY = #{userId}, + UPDATED_TIME = NOW() + WHERE ID = #{recordId} + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterDao.xml new file mode 100644 index 0000000000..b241afaf64 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterDao.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterMatterDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterMatterDao.xml new file mode 100644 index 0000000000..d8bbd1ba95 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterMatterDao.xml @@ -0,0 +1,22 @@ + + + + + + + + DELETE FROM ic_party_service_center_matter + WHERE DEL_FLAG = 0 + AND PARTY_SERVICE_CENTER_ID = #{partyServiceCenterId} + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlaceOrgDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlaceOrgDao.xml new file mode 100644 index 0000000000..600a80ee7f --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlaceOrgDao.xml @@ -0,0 +1,49 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolRecordDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolRecordDao.xml new file mode 100644 index 0000000000..58fab01358 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolRecordDao.xml @@ -0,0 +1,59 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolReviewRecordDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolReviewRecordDao.xml new file mode 100644 index 0000000000..8b54d868e9 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolReviewRecordDao.xml @@ -0,0 +1,45 @@ + + + + + + + UPDATE + ic_place_patrol_review_record + SET + del_flag = '1', + updated_by = #{staffId}, + updated_time = NOW() + WHERE + place_patrol_record_id = #{placePatrolRecordId} + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamDao.xml new file mode 100644 index 0000000000..3475fce30b --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamDao.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamStaffDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamStaffDao.xml new file mode 100644 index 0000000000..06d8285f21 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamStaffDao.xml @@ -0,0 +1,50 @@ + + + + + + + DELETE + FROM + ic_place_patrol_team_staff + WHERE + place_patrol_team_id = #{teamId} + + + + + + + + UPDATE + ic_place_patrol_team_staff + SET + del_flag = '1', + updated_by = #{staffId}, + updated_time = NOW() + WHERE + place_patrol_team_id = #{teamId} + + + \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormController.java index dee3afb8ec..8466ceb6a6 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormController.java @@ -18,28 +18,20 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; -import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.security.dto.TokenDto; -import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.commons.tools.validator.group.AddGroup; -import com.epmet.commons.tools.validator.group.DefaultGroup; -import com.epmet.commons.tools.validator.group.UpdateGroup; -import com.epmet.dto.IcFormDTO; import com.epmet.dto.form.CustomerFormQueryDTO; import com.epmet.dto.result.*; -import com.epmet.excel.IcFormExcel; import com.epmet.service.IcFormItemService; import com.epmet.service.IcFormService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import javax.servlet.http.HttpServletResponse; import java.util.List; -import java.util.Map; import java.util.Set; @@ -58,49 +50,24 @@ public class IcFormController { @Autowired private IcFormItemService icFormItemService; - @GetMapping("page") - public Result> page(@RequestParam Map params){ - PageData page = icFormService.page(params); - return new Result>().ok(page); - } - - @GetMapping("{id}") - public Result get(@PathVariable("id") String id){ - IcFormDTO data = icFormService.get(id); - return new Result().ok(data); - } - - @PostMapping - public Result save(@RequestBody IcFormDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - icFormService.save(dto); - return new Result(); - } - - @PutMapping - public Result update(@RequestBody IcFormDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - icFormService.update(dto); - return new Result(); - } - - @DeleteMapping - public Result delete(@RequestBody String[] ids){ - //效验数据 - AssertUtils.isArrayEmpty(ids, "id"); - icFormService.delete(ids); - return new Result(); - } - - @GetMapping("export") - public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { - List list = icFormService.list(params); - ExcelUtils.exportExcelToTarget(response, null, list, IcFormExcel.class); + /** + * desc: 初始化 客户表单配置 + * + * @param customerId + * @param formCode + * @return com.epmet.commons.tools.utils.Result + * @author LiuJanJun + * @date 2021/12/8 4:28 下午 + */ + @GetMapping("initCustomerForm/{formCode}") + public Result initCustomerFormByCode(@RequestParam String customerId,@RequestParam String areaCode, + @PathVariable(value = "formCode") String formCode){ + if (StringUtils.isBlank(customerId)){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"参数错误"); + } + return new Result().ok(icFormService.initCustomerFormByCode(customerId, areaCode, formCode)); } - /** * 获取居民信息表单 【dynamic=null】查询全部;否则查询对应的item * diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemController.java index 50f4d10ff9..1cfe0d4276 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemController.java @@ -17,25 +17,16 @@ package com.epmet.controller; -import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.commons.tools.validator.AssertUtils; -import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.commons.tools.validator.group.AddGroup; -import com.epmet.commons.tools.validator.group.UpdateGroup; -import com.epmet.commons.tools.validator.group.DefaultGroup; -import com.epmet.dto.IcFormItemDTO; import com.epmet.dto.result.ColumnTableNameResultDTO; -import com.epmet.dto.result.CustomerStaffRoleResultDTO; -import com.epmet.excel.IcFormItemExcel; import com.epmet.service.IcFormItemService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; -import javax.servlet.http.HttpServletResponse; import java.util.List; -import java.util.Map; /** @@ -47,52 +38,10 @@ import java.util.Map; @RestController @RequestMapping("icformitem") public class IcFormItemController { - + @Autowired private IcFormItemService icFormItemService; - @GetMapping("page") - public Result> page(@RequestParam Map params){ - PageData page = icFormItemService.page(params); - return new Result>().ok(page); - } - - @GetMapping("{id}") - public Result get(@PathVariable("id") String id){ - IcFormItemDTO data = icFormItemService.get(id); - return new Result().ok(data); - } - - @PostMapping - public Result save(@RequestBody IcFormItemDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - icFormItemService.save(dto); - return new Result(); - } - - @PutMapping - public Result update(@RequestBody IcFormItemDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - icFormItemService.update(dto); - return new Result(); - } - - @DeleteMapping - public Result delete(@RequestBody String[] ids){ - //效验数据 - AssertUtils.isArrayEmpty(ids, "id"); - icFormItemService.delete(ids); - return new Result(); - } - - @GetMapping("export") - public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { - List list = icFormItemService.list(params); - ExcelUtils.exportExcelToTarget(response, null, list, IcFormItemExcel.class); - } - /** * @Author sun * @Description 居民信息新增查询各表必填字段 @@ -102,4 +51,4 @@ public class IcFormItemController { return new Result>().ok(icFormItemService.getMustColumn(customerId)); } -} \ No newline at end of file +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormDao.java index 7cd489b2bb..41928a94ce 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormDao.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormDao.java @@ -47,7 +47,7 @@ public interface IcFormDao extends BaseDao { */ CustomerFormResultDTO selectByCode(@Param("customerId") String customerId, @Param("formCode") String formCode); - List selectItemList(String formId, Boolean dynamic); + List selectItemList(@Param("formId") String formId, @Param("dynamic") Boolean dynamic); List selectItemListByGroupId(String groupId); List selectListOption(String itemId); diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormQueryBuilderDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormQueryBuilderDao.java new file mode 100644 index 0000000000..a142d8d637 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormQueryBuilderDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcFormQueryBuilderEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 表单查询项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-12-08 + */ +@Mapper +public interface IcFormQueryBuilderDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormQueryBuilderEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormQueryBuilderEntity.java new file mode 100644 index 0000000000..f8255baa01 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormQueryBuilderEntity.java @@ -0,0 +1,63 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 2021-12-08 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_form_query_builder") +public class IcFormQueryBuilderEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * ic_form_item.id + */ + private String formItemId; + + /** + * ic_form.form_code,举例:resi_base_info + */ + private String formCode; + + /** + * 查询类型: equal, like,daterange.... + */ + private String queryType; + + /** + * 排序 + */ + private Integer sort; + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemService.java index 32480613c2..575e31d6b1 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemService.java @@ -18,8 +18,6 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.commons.tools.page.PageData; -import com.epmet.dto.IcFormItemDTO; import com.epmet.dto.form.CustomerFormQueryDTO; import com.epmet.dto.result.ColumnTableNameResultDTO; import com.epmet.dto.result.ConditionResultDTO; @@ -28,7 +26,6 @@ import com.epmet.dto.result.TableHeaderResultDTO; import com.epmet.entity.IcFormItemEntity; import java.util.List; -import java.util.Map; import java.util.Set; /** @@ -38,67 +35,6 @@ import java.util.Set; * @since v1.0.0 2021-10-26 */ public interface IcFormItemService extends BaseService { - - /** - * 默认分页 - * - * @param params - * @return PageData - * @author generator - * @date 2021-10-26 - */ - PageData page(Map params); - - /** - * 默认查询 - * - * @param params - * @return java.util.List - * @author generator - * @date 2021-10-26 - */ - List list(Map params); - - /** - * 单条查询 - * - * @param id - * @return IcFormItemDTO - * @author generator - * @date 2021-10-26 - */ - IcFormItemDTO get(String id); - - /** - * 默认保存 - * - * @param dto - * @return void - * @author generator - * @date 2021-10-26 - */ - void save(IcFormItemDTO dto); - - /** - * 默认更新 - * - * @param dto - * @return void - * @author generator - * @date 2021-10-26 - */ - void update(IcFormItemDTO dto); - - /** - * 批量删除 - * - * @param ids - * @return void - * @author generator - * @date 2021-10-26 - */ - void delete(String[] ids); - /** * 获取居民信息的查询条件,组件列表 * @@ -122,4 +58,4 @@ public interface IcFormItemService extends BaseService { * @Description 居民信息新增查询各表必填字段 **/ List getMustColumn(String customerId); -} \ No newline at end of file +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormService.java index c90e6227dc..7bbc7ca275 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormService.java @@ -18,15 +18,12 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.commons.tools.page.PageData; -import com.epmet.dto.IcFormDTO; import com.epmet.dto.form.CustomerFormQueryDTO; import com.epmet.dto.result.CustomerFormResultDTO; import com.epmet.dto.result.FormItemResult; import com.epmet.entity.IcFormEntity; import java.util.List; -import java.util.Map; /** * 配置表单 @@ -35,67 +32,6 @@ import java.util.Map; * @since v1.0.0 2021-10-26 */ public interface IcFormService extends BaseService { - - /** - * 默认分页 - * - * @param params - * @return PageData - * @author generator - * @date 2021-10-26 - */ - PageData page(Map params); - - /** - * 默认查询 - * - * @param params - * @return java.util.List - * @author generator - * @date 2021-10-26 - */ - List list(Map params); - - /** - * 单条查询 - * - * @param id - * @return IcFormDTO - * @author generator - * @date 2021-10-26 - */ - IcFormDTO get(String id); - - /** - * 默认保存 - * - * @param dto - * @return void - * @author generator - * @date 2021-10-26 - */ - void save(IcFormDTO dto); - - /** - * 默认更新 - * - * @param dto - * @return void - * @author generator - * @date 2021-10-26 - */ - void update(IcFormDTO dto); - - /** - * 批量删除 - * - * @param ids - * @return void - * @author generator - * @date 2021-10-26 - */ - void delete(String[] ids); - /** * 获取居民信息表单 * @@ -116,4 +52,6 @@ public interface IcFormService extends BaseService { * @date 2021.10.27 17:41:59 */ List listItems(String customerId, String formCode); + + String initCustomerFormByCode(String customerId, String areaCode, String formCode); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java index f614e64e0b..00c79db52c 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java @@ -49,59 +49,6 @@ import java.util.*; @Service public class IcFormItemServiceImpl extends BaseServiceImpl implements IcFormItemService { - - @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, IcFormItemDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, IcFormItemDTO.class); - } - - private QueryWrapper getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); - - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); - - return wrapper; - } - - @Override - public IcFormItemDTO get(String id) { - IcFormItemEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, IcFormItemDTO.class); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void save(IcFormItemDTO dto) { - IcFormItemEntity entity = ConvertUtils.sourceToTarget(dto, IcFormItemEntity.class); - insert(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(IcFormItemDTO dto) { - IcFormItemEntity entity = ConvertUtils.sourceToTarget(dto, IcFormItemEntity.class); - updateById(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(String[] ids) { - // 逻辑删除(@TableLogic 注解) - baseDao.deleteBatchIds(Arrays.asList(ids)); - } - /** * 获取居民信息的查询条件,组件列表 * @@ -171,4 +118,4 @@ public class IcFormItemServiceImpl extends BaseServiceImpl implements IcFormService { - @Autowired + @Autowired private CustomerFootBarRedis customerFootBarRedis; - @Autowired - private RedisUtils redisUtils; - - @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, IcFormDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, IcFormDTO.class); - } - - private QueryWrapper getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); - - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); - - return wrapper; - } - - @Override - public IcFormDTO get(String id) { - IcFormEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, IcFormDTO.class); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void save(IcFormDTO dto) { - IcFormEntity entity = ConvertUtils.sourceToTarget(dto, IcFormEntity.class); - insert(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(IcFormDTO dto) { - IcFormEntity entity = ConvertUtils.sourceToTarget(dto, IcFormEntity.class); - updateById(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(String[] ids) { - // 逻辑删除(@TableLogic 注解) - baseDao.deleteBatchIds(Arrays.asList(ids)); - } + @Autowired + private RedisUtils redisUtils; + @Autowired + private IcFormItemDao icFormItemDao; + @Autowired + private IcFormItemOptionsDao icFormItemOptionsDao; + @Autowired + private IcFormItemGroupDao icFormItemGroupDao; + @Autowired + private IcFormQueryBuilderDao icFormQueryBuilderDao; + @Autowired + private IcResiCategoryStatsConfigDao icResiCategoryStatsConfigDao; + @Autowired + private IcResiCategoryWarnConfigDao icResiCategoryWarnConfigDao; /** * 获取居民信息表单 @@ -122,19 +83,19 @@ public class IcFormServiceImpl extends BaseServiceImpl */ @Override public CustomerFormResultDTO getCustomerForm(CustomerFormQueryDTO formDto) { - CustomerFormResultDTO customerFormResultDTO = customerFootBarRedis.getCustomerFormResultDTO(formDto.getFormCode(), formDto.getCustomerId(),formDto.getDynamic()); + CustomerFormResultDTO customerFormResultDTO = customerFootBarRedis.getCustomerFormResultDTO(formDto.getFormCode(), formDto.getCustomerId(), formDto.getDynamic()); if (null != customerFormResultDTO) { return customerFormResultDTO; } - CustomerFormResultDTO resultDTO=baseDao.selectByCode(formDto.getCustomerId(),formDto.getFormCode()); + CustomerFormResultDTO resultDTO = baseDao.selectByCode(formDto.getCustomerId(), formDto.getFormCode()); if (null == resultDTO) { - throw new RenException(EpmetErrorCode.CUSTOMER_FORM_NOT_EXITS.getCode(),EpmetErrorCode.CUSTOMER_FORM_NOT_EXITS.getMsg()); + throw new RenException(EpmetErrorCode.CUSTOMER_FORM_NOT_EXITS.getCode(), EpmetErrorCode.CUSTOMER_FORM_NOT_EXITS.getMsg()); } - List itemList=baseDao.selectItemList(resultDTO.getFormId(),formDto.getDynamic()); - List groupList=baseDao.selectListGroup(resultDTO.getFormId()); + List itemList = baseDao.selectItemList(resultDTO.getFormId(), formDto.getDynamic()); + List groupList = baseDao.selectListGroup(resultDTO.getFormId()); resultDTO.setItemList(itemList); resultDTO.setGroupList(groupList); - customerFootBarRedis.setCustomerFormResultDTO(formDto.getFormCode(),formDto.getCustomerId(),resultDTO,formDto.getDynamic()); + customerFootBarRedis.setCustomerFormResultDTO(formDto.getFormCode(), formDto.getCustomerId(), resultDTO, formDto.getDynamic()); return resultDTO; } @@ -150,9 +111,9 @@ public class IcFormServiceImpl extends BaseServiceImpl } // 从db取 - CustomerFormResultDTO formResultDto=baseDao.selectByCode(customerId, formCode); + CustomerFormResultDTO formResultDto = baseDao.selectByCode(customerId, formCode); if (null == formResultDto) { - throw new RenException(EpmetErrorCode.CUSTOMER_FORM_NOT_EXITS.getCode(),EpmetErrorCode.CUSTOMER_FORM_NOT_EXITS.getMsg()); + throw new RenException(EpmetErrorCode.CUSTOMER_FORM_NOT_EXITS.getCode(), EpmetErrorCode.CUSTOMER_FORM_NOT_EXITS.getMsg()); } List formItemResults = baseDao.listItems(formResultDto.getFormId()); @@ -165,4 +126,149 @@ public class IcFormServiceImpl extends BaseServiceImpl return formItemResults; } + + @Transactional(rollbackFor = Exception.class) + @Override + public String initCustomerFormByCode(String customerId, String areaCode, String formCode) { + CustomerFormResultDTO formResultDTO = baseDao.selectByCode(customerId, formCode); + if (formResultDTO != null) { + return "该客户已经存在了表单的数据"; + } + String defaultCustomerId = "default"; + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcFormEntity::getCustomerId, defaultCustomerId); + wrapper.eq(IcFormEntity::getFormCode, formCode); + IcFormEntity defaultIcForm = baseDao.selectOne(wrapper); + if (defaultIcForm == null) { + return "默认配置错误"; + } + + //统一前缀 + String newPrefixed = DateUtils.format(new Date(), DateUtils.DATE_TIME_NO_SPLIT) + StrConstant.UNDER_LINE; + String newFormId = newPrefixed + defaultIcForm.getId(); + defaultIcForm.setId(newFormId); + defaultIcForm.setCustomerId(customerId); + defaultIcForm.setAreaCode(areaCode); + defaultIcForm.setCreatedBy("init_user"); + defaultIcForm.setCreatedTime(new Date()); + defaultIcForm.setUpdatedBy("init_user"); + defaultIcForm.setUpdatedTime(new Date()); + + int insert = baseDao.insert(defaultIcForm); + log.info("insert icForm:" + insert); + + LambdaQueryWrapper wrapperItem = new LambdaQueryWrapper<>(); + wrapperItem.eq(IcFormItemEntity::getCustomerId, defaultCustomerId); + wrapperItem.eq(IcFormItemEntity::getFormCode, formCode); + List itemList = icFormItemDao.selectList(wrapperItem); + if (CollectionUtils.isEmpty(itemList)) { + return "默认配置错误"; + } + //设置item + itemList.forEach(item -> { + item.setId(newPrefixed + item.getId()); + item.setCustomerId(customerId); + item.setFormId(newFormId); + item.setAreaCode(areaCode); + item.setParentItemId(newPrefixed + item.getParentItemId()); + //分组Id 为0 说明不村子分组 则直接不设置 仍然为0 + if (!NumConstant.ZERO_STR.equals(item.getItemGroupId())){ + item.setItemGroupId(newPrefixed + item.getItemGroupId()); + } + String optionSourceValue = item.getOptionSourceValue(); + if (StringUtils.isNotBlank(optionSourceValue) && optionSourceValue.contains(StrConstant.QUESTION_MARK)){ + //多个参数 + String[] paramArr = optionSourceValue.split(StrConstant.QUESTION_MARK_TRANSFER)[NumConstant.ONE].split(StrConstant.AND_MARK); + for (String o : paramArr) { + optionSourceValue = optionSourceValue.replace(o, newPrefixed + o); + } + item.setOptionSourceValue(optionSourceValue); + } + item.setCreatedBy("init_user"); + item.setCreatedTime(new Date()); + item.setUpdatedBy("init_user"); + item.setUpdatedTime(new Date()); + log.debug("item:"+ JSON.toJSONString(item)); + icFormItemDao.insert(item); + }); + + LambdaQueryWrapper wrapperOptions = new LambdaQueryWrapper<>(); + wrapperOptions.eq(IcFormItemOptionsEntity::getCustomerId, defaultCustomerId); + wrapperOptions.eq(IcFormItemOptionsEntity::getFormCode, formCode); + List optionsList = icFormItemOptionsDao.selectList(wrapperOptions); + optionsList.forEach(item -> { + item.setId(newPrefixed + item.getId()); + item.setCustomerId(customerId); + item.setFormId(newFormId); + item.setItemId(newPrefixed + item.getItemId()); + item.setCreatedBy("init_user"); + item.setCreatedTime(new Date()); + item.setUpdatedBy("init_user"); + item.setUpdatedTime(new Date()); + log.debug("option:"+ JSON.toJSONString(item)); + icFormItemOptionsDao.insert(item); + }); + + LambdaQueryWrapper wrapperGroup = new LambdaQueryWrapper<>(); + wrapperGroup.eq(IcFormItemGroupEntity::getCustomerId, defaultCustomerId); + wrapperGroup.eq(IcFormItemGroupEntity::getFormCode, formCode); + List groupList = icFormItemGroupDao.selectList(wrapperGroup); + groupList.forEach(item -> { + item.setId(newPrefixed + item.getId()); + item.setCustomerId(customerId); + item.setFormId(newFormId); + item.setCreatedBy("init_user"); + item.setCreatedTime(new Date()); + item.setUpdatedBy("init_user"); + item.setUpdatedTime(new Date()); + log.debug("group:"+ JSON.toJSONString(item)); + icFormItemGroupDao.insert(item); + }); + + LambdaQueryWrapper wrapperQuery = new LambdaQueryWrapper<>(); + wrapperQuery.eq(IcFormQueryBuilderEntity::getCustomerId, defaultCustomerId); + wrapperQuery.eq(IcFormQueryBuilderEntity::getFormCode, formCode); + List queryList = icFormQueryBuilderDao.selectList(wrapperQuery); + queryList.forEach(item -> { + item.setId(newPrefixed + item.getId()); + item.setCustomerId(customerId); + item.setFormItemId(newPrefixed + item.getFormItemId()); + item.setCreatedBy("init_user"); + item.setCreatedTime(new Date()); + item.setUpdatedBy("init_user"); + item.setUpdatedTime(new Date()); + log.debug("query:"+ JSON.toJSONString(item)); + icFormQueryBuilderDao.insert(item); + }); + + LambdaQueryWrapper wrapperStats = new LambdaQueryWrapper<>(); + wrapperStats.eq(IcResiCategoryStatsConfigEntity::getCustomerId, defaultCustomerId); + List statsConfigList = icResiCategoryStatsConfigDao.selectList(wrapperStats); + statsConfigList.forEach(item -> { + item.setId(newPrefixed + item.getId()); + item.setCustomerId(customerId); + item.setCreatedBy("init_user"); + item.setCreatedTime(new Date()); + item.setUpdatedBy("init_user"); + item.setUpdatedTime(new Date()); + log.debug("stats:"+ JSON.toJSONString(item)); + icResiCategoryStatsConfigDao.insert(item); + }); + + LambdaQueryWrapper wrapperWarn = new LambdaQueryWrapper<>(); + wrapperWarn.eq(IcResiCategoryWarnConfigEntity::getCustomerId, defaultCustomerId); + List warnConfigList = icResiCategoryWarnConfigDao.selectList(wrapperWarn); + warnConfigList.forEach(item -> { + item.setId(newPrefixed + item.getId()); + item.setCustomerId(customerId); + item.setCreatedBy("init_user"); + item.setCreatedTime(new Date()); + item.setUpdatedBy("init_user"); + item.setUpdatedTime(new Date()); + log.debug("stats:"+ JSON.toJSONString(item)); + icResiCategoryWarnConfigDao.insert(item); + }); + + return "初始化成功!客户ID:" + customerId + " formCode:" + formCode; + } } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormDao.xml index d93d611f7c..d3c2c0261e 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormDao.xml @@ -82,7 +82,7 @@ ) - SELECT fi.ID AS item_id, 'ic_resi_user' AS table_name, diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml index 61a1c155c9..c9b16fd11c 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml @@ -97,7 +97,8 @@ temp.LABEL from ( SELECT - ( CASE WHEN M.ITEM_GROUP_ID = '0' THEN 'ic_resi_user' ELSE g.TABLE_NAME END ) AS table_name, + ifnull(g.TABLE_NAME,'ic_resi_user') AS table_name, + #( CASE WHEN M.ITEM_GROUP_ID = '0' THEN 'ic_resi_user' ELSE g.TABLE_NAME END ) AS table_name, m.COLUMN_NAME AS columnName, m.LABEL FROM @@ -158,4 +159,4 @@ AND a.customer_id = #{customerId} - \ No newline at end of file + diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormQueryBuilderDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormQueryBuilderDao.xml new file mode 100644 index 0000000000..62281279fa --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormQueryBuilderDao.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyResiUserInfoResultDTO.java b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyResiUserInfoResultDTO.java index c75bca8a46..5ffe04836b 100644 --- a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyResiUserInfoResultDTO.java +++ b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyResiUserInfoResultDTO.java @@ -52,4 +52,8 @@ public class MyResiUserInfoResultDTO implements Serializable { * */ private Integer todayObtainedPoint; + /** + * 是否录入身份证号,true ,false + * */ + private Boolean completeIdNum; } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/controller/PersonalCenterController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/controller/PersonalCenterController.java index e71b28101f..48ea31f06b 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/controller/PersonalCenterController.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/controller/PersonalCenterController.java @@ -3,6 +3,7 @@ package com.epmet.modules.mine.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.EditInfoFormDTO; import com.epmet.dto.form.EditMobileFormDTO; import com.epmet.dto.form.SendCodeFormDTO; @@ -51,6 +52,9 @@ public class PersonalCenterController { */ @PostMapping("editinfo") public Result editInfo(@LoginUser TokenDto tokenDto, @RequestBody EditInfoFormDTO formDTO) { + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO,EditInfoFormDTO.AddUserShowGroup.class,EditInfoFormDTO.AddUserInternalGroup.class); personalCenterService.editInfo(tokenDto, formDTO); return new Result(); } 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 d3cf8a2a64..d9c1b86e9a 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 @@ -45,7 +45,6 @@ public class PersonalCenterServiceImpl implements PersonalCenterService { @Override public void editInfo(TokenDto tokenDto, EditInfoFormDTO formDTO) { - formDTO.setUserId(tokenDto.getUserId()); Result result = epmetUserOpenFeignClient.editUserInfo(formDTO); if (!result.success()) { throw new RenException(result.getCode(), result.getMsg()); diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberServiceImpl.java index 447055431a..1cc431a9b3 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberServiceImpl.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberServiceImpl.java @@ -10,7 +10,6 @@ import com.epmet.resi.mine.dto.from.PartyMemberSubmitFromDTO; import com.epmet.resi.mine.dto.from.VerificationCodeFromDTO; import com.epmet.resi.mine.dto.result.PartyMemberInitResultDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; -import org.apache.poi.ss.formula.constant.ErrorConstant; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartymemberStyleDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartymemberStyleDTO.java new file mode 100644 index 0000000000..1bfdc10d0b --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartymemberStyleDTO.java @@ -0,0 +1,102 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.resi.partymember.dto.partymember; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + + +/** + * 党员风采 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcPartymemberStyleDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 楼栋主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + private String gridName; + + /** + * 党员姓名 + */ + private String name; + + /** + * 主要事迹 + */ + private String mainDeed; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + private List imageList; + +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartymemberStyleImageDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartymemberStyleImageDTO.java new file mode 100644 index 0000000000..0a39e3dc8e --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartymemberStyleImageDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.resi.partymember.dto.partymember; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 党员风采图片 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcPartymemberStyleImageDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 党员风采ID + */ + private String styleId; + + /** + * 图片地址 + */ + private String imageUrl; + + /** + * 排序 + */ + private Integer sort; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/PartyMemberStyleFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/PartyMemberStyleFormDTO.java new file mode 100644 index 0000000000..6cedb15c89 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/PartyMemberStyleFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.resi.partymember.dto.partymember.form; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/11/19 9:49 + */ +@NoArgsConstructor +@Data +public class PartyMemberStyleFormDTO implements Serializable { + private static final long serialVersionUID = 4743261460276449408L; + @NotBlank(message = "组织ID不能为空") + private String agencyId; + private String gridId; + private String name; + private String mainDeed; + private Integer pageNo; + private Integer pageSize; +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartymemberStyleController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartymemberStyleController.java new file mode 100644 index 0000000000..cadf703b2c --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartymemberStyleController.java @@ -0,0 +1,120 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.partymember.controller; + +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.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.modules.partymember.excel.IcPartymemberStyleExcel; +import com.epmet.modules.partymember.service.IcPartymemberStyleService; +import com.epmet.resi.partymember.dto.partymember.IcPartymemberStyleDTO; +import com.epmet.resi.partymember.dto.partymember.form.PartyMemberStyleFormDTO; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; + + +/** + * 党员风采 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Slf4j +@RestController +@RequestMapping("icpartymemberstyle") +public class IcPartymemberStyleController { + + @Autowired + private IcPartymemberStyleService icPartymemberStyleService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icPartymemberStyleService.page(params); + return new Result>().ok(page); + } + + @PostMapping("detail") + public Result get(@RequestBody IcPartymemberStyleDTO dto){ + IcPartymemberStyleDTO data = icPartymemberStyleService.get(dto.getId()); + return new Result().ok(data); + } + + @PostMapping("save") + @NoRepeatSubmit + public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcPartymemberStyleDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icPartymemberStyleService.save(tokenDto, dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody IcPartymemberStyleDTO dto){ + //效验数据 + icPartymemberStyleService.delete(dto.getId()); + return new Result(); + } + + @PostMapping("export") + public void export(@RequestBody PartyMemberStyleFormDTO formDTO, HttpServletResponse response) throws Exception { + List list = icPartymemberStyleService.list(formDTO); + List result = new ArrayList<>(); + AtomicInteger i = new AtomicInteger(NumConstant.ONE); + if (CollectionUtils.isNotEmpty(list)) { + result = list.stream().map(item -> { + IcPartymemberStyleExcel excel = new IcPartymemberStyleExcel(); + excel.setIndex(i.getAndIncrement()); + excel.setGridName(item.getGridName()); + excel.setName(item.getName()); + excel.setMainDeed(item.getMainDeed()); + return excel; + }).collect(Collectors.toList()); + } + ExcelUtils.exportExcelToTarget(response, null, result, IcPartymemberStyleExcel.class); + } + + @PostMapping("list") + public Result> search(@RequestBody PartyMemberStyleFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(icPartymemberStyleService.search(formDTO)); + } + + @PostMapping("import") + public Result importData(@LoginUser TokenDto tokenDto, HttpServletResponse response, @RequestPart("file") MultipartFile file) throws IOException { + return icPartymemberStyleService.importData(tokenDto, response, file); + } + +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartymemberStyleImageController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartymemberStyleImageController.java new file mode 100644 index 0000000000..cddd24d894 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartymemberStyleImageController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.partymember.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.modules.partymember.excel.IcPartymemberStyleImageExcel; +import com.epmet.modules.partymember.service.IcPartymemberStyleImageService; +import com.epmet.resi.partymember.dto.partymember.IcPartymemberStyleImageDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 党员风采图片 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@RestController +@RequestMapping("icpartymemberstyleimage") +public class IcPartymemberStyleImageController { + + @Autowired + private IcPartymemberStyleImageService icPartymemberStyleImageService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icPartymemberStyleImageService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcPartymemberStyleImageDTO data = icPartymemberStyleImageService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcPartymemberStyleImageDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icPartymemberStyleImageService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcPartymemberStyleImageDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icPartymemberStyleImageService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icPartymemberStyleImageService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = icPartymemberStyleImageService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, IcPartymemberStyleImageExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartymemberStyleDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartymemberStyleDao.java new file mode 100644 index 0000000000..de5966a068 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartymemberStyleDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.partymember.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.partymember.entity.IcPartymemberStyleEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 党员风采 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Mapper +public interface IcPartymemberStyleDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartymemberStyleImageDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartymemberStyleImageDao.java new file mode 100644 index 0000000000..34a43a8bfc --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartymemberStyleImageDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.partymember.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.partymember.entity.IcPartymemberStyleImageEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 党员风采图片 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Mapper +public interface IcPartymemberStyleImageDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/IcPartymemberStyleEntity.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/IcPartymemberStyleEntity.java new file mode 100644 index 0000000000..ad3e4afe9e --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/IcPartymemberStyleEntity.java @@ -0,0 +1,63 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.partymember.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 2021-11-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_partymember_style") +public class IcPartymemberStyleEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 党员姓名 + */ + private String name; + + /** + * 主要事迹 + */ + private String mainDeed; + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/IcPartymemberStyleImageEntity.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/IcPartymemberStyleImageEntity.java new file mode 100644 index 0000000000..1da117a7b2 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/IcPartymemberStyleImageEntity.java @@ -0,0 +1,103 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.partymember.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 党员风采图片 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_partymember_style_image") +public class IcPartymemberStyleImageEntity { + + private static final long serialVersionUID = 1L; + /** + * id + */ + @TableId(type = IdType.UUID) + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 党员风采ID + */ + private String styleId; + + /** + * 图片地址 + */ + private String imageUrl; + + /** + * 排序 + */ + private Integer sort; + + /** + * 乐观锁 + */ + @TableField(fill = FieldFill.INSERT) + private Integer revision; + + /** + * 创建者 + */ + @TableField(fill = FieldFill.INSERT) + private String createdBy; + + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createdTime; + + /** + * 修改者 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private String updatedBy; + + /** + * 修改时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date updatedTime; + + /** + * 是否已删除(0-未删除,1-已删除) + */ + @TableField(fill = FieldFill.INSERT) + private String delFlag; + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/IcPartymemberStyleExcel.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/IcPartymemberStyleExcel.java new file mode 100644 index 0000000000..a64decdd9c --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/IcPartymemberStyleExcel.java @@ -0,0 +1,43 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.partymember.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +/** + * 党员风采 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcPartymemberStyleExcel { + + @Excel(name = "序号") + private Integer index; + + @Excel(name = "党员姓名") + private String name; + + @Excel(name = "所属网格") + private String gridName; + + @Excel(name = "主要事迹") + private String mainDeed; +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/IcPartymemberStyleImageExcel.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/IcPartymemberStyleImageExcel.java new file mode 100644 index 0000000000..6b97049997 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/IcPartymemberStyleImageExcel.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.partymember.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 党员风采图片 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcPartymemberStyleImageExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "党员风采ID") + private String styleId; + + @Excel(name = "图片地址") + private String imageUrl; + + @Excel(name = "排序") + private Integer sort; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/IcPartymemberStyleImportExcel.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/IcPartymemberStyleImportExcel.java new file mode 100644 index 0000000000..fa48ae5b34 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/IcPartymemberStyleImportExcel.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.partymember.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.epmet.commons.tools.utils.ExcelVerifyInfo; +import lombok.Data; + +/** + * 党员风采 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcPartymemberStyleImportExcel extends ExcelVerifyInfo { + + @Excel(name = "所属网格") + private String gridName; + + @Excel(name = "党员姓名") + private String name; + + @Excel(name = "主要事迹") + private String mainDeed; + + @Excel(name = "照片") + private String imageUrl; +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartymemberStyleImageService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartymemberStyleImageService.java new file mode 100644 index 0000000000..43e101ed26 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartymemberStyleImageService.java @@ -0,0 +1,113 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.partymember.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.modules.partymember.entity.IcPartymemberStyleImageEntity; +import com.epmet.resi.partymember.dto.partymember.IcPartymemberStyleImageDTO; + +import java.util.List; +import java.util.Map; + +/** + * 党员风采图片 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +public interface IcPartymemberStyleImageService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-11-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-11-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcPartymemberStyleImageDTO + * @author generator + * @date 2021-11-18 + */ + IcPartymemberStyleImageDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-18 + */ + void save(IcPartymemberStyleImageDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-18 + */ + void update(IcPartymemberStyleImageDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-11-18 + */ + void delete(String[] ids); + + /** + * 删除党员风采图片 + * @Param styleId + * @Return + * @Author zhaoqifeng + * @Date 2021/11/19 10:14 + */ + void deleteByStyleId(String styleId); + + /** + * 获取党员风采图片 + * @Param styleId + * @Return {@link List< String>} + * @Author zhaoqifeng + * @Date 2021/11/19 10:40 + */ + List getByStyleId(String styleId); +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartymemberStyleService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartymemberStyleService.java new file mode 100644 index 0000000000..fb4c6e1800 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartymemberStyleService.java @@ -0,0 +1,112 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.partymember.service; + +import com.epmet.commons.mybatis.service.BaseService; +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.modules.partymember.entity.IcPartymemberStyleEntity; +import com.epmet.resi.partymember.dto.partymember.IcPartymemberStyleDTO; +import com.epmet.resi.partymember.dto.partymember.form.PartyMemberStyleFormDTO; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * 党员风采 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +public interface IcPartymemberStyleService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-11-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param formDTO + * @return java.util.List + * @author generator + * @date 2021-11-18 + */ + List list(PartyMemberStyleFormDTO formDTO); + + /** + * 单条查询 + * + * @param id + * @return IcPartymemberStyleDTO + * @author generator + * @date 2021-11-18 + */ + IcPartymemberStyleDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-18 + */ + void save(TokenDto tokenDto, IcPartymemberStyleDTO dto); + + /** + * 删除 + * + * @param id + * @return void + * @author generator + * @date 2021-11-18 + */ + void delete(String id); + + /** + * 查询列表 + * @Param formDTO + * @Return {@link PageData} + * @Author zhaoqifeng + * @Date 2021/11/19 9:30 + */ + PageData search(PartyMemberStyleFormDTO formDTO); + + /** + * 导入数据 + * @Param tokenDto + * @Param response + * @Param file + * @Return + * @Author zhaoqifeng + * @Date 2021/11/29 11:01 + */ + Result importData(TokenDto tokenDto, HttpServletResponse response, MultipartFile file) throws IOException; + +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleImageServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleImageServiceImpl.java new file mode 100644 index 0000000000..8f0d323673 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleImageServiceImpl.java @@ -0,0 +1,137 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.partymember.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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.modules.partymember.dao.IcPartymemberStyleImageDao; +import com.epmet.modules.partymember.entity.IcPartymemberStyleImageEntity; +import com.epmet.modules.partymember.service.IcPartymemberStyleImageService; +import com.epmet.resi.partymember.dto.partymember.IcPartymemberStyleImageDTO; +import org.apache.commons.lang3.StringUtils; +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.stream.Collectors; + +/** + * 党员风采图片 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Service +public class IcPartymemberStyleImageServiceImpl extends BaseServiceImpl implements IcPartymemberStyleImageService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcPartymemberStyleImageDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcPartymemberStyleImageDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcPartymemberStyleImageDTO get(String id) { + IcPartymemberStyleImageEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcPartymemberStyleImageDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcPartymemberStyleImageDTO dto) { + IcPartymemberStyleImageEntity entity = ConvertUtils.sourceToTarget(dto, IcPartymemberStyleImageEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcPartymemberStyleImageDTO dto) { + IcPartymemberStyleImageEntity entity = ConvertUtils.sourceToTarget(dto, IcPartymemberStyleImageEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 删除党员风采图片 + * + * @param styleId + * @Param styleId + * @Return + * @Author zhaoqifeng + * @Date 2021/11/19 10:14 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteByStyleId(String styleId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPartymemberStyleImageEntity::getStyleId, styleId); + baseDao.delete(wrapper); + } + + /** + * 获取党员风采图片 + * + * @param styleId + * @Param styleId + * @Return {@link List< String>} + * @Author zhaoqifeng + * @Date 2021/11/19 10:40 + */ + @Override + public List getByStyleId(String styleId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPartymemberStyleImageEntity::getStyleId, styleId); + wrapper.orderByAsc(IcPartymemberStyleImageEntity::getSort); + List list = baseDao.selectList(wrapper); + return list.stream().map(IcPartymemberStyleImageEntity::getImageUrl).collect(Collectors.toList()); + } + +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleServiceImpl.java new file mode 100644 index 0000000000..72872ab638 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleServiceImpl.java @@ -0,0 +1,293 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.partymember.service.impl; + +import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; +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.constant.StrConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetException; +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.GridInfoCache; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.ExcelPoiUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerGridDTO; +import com.epmet.dto.form.GridOptionFormDTO; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.modules.partymember.dao.IcPartymemberStyleDao; +import com.epmet.modules.partymember.entity.IcPartymemberStyleEntity; +import com.epmet.modules.partymember.entity.IcPartymemberStyleImageEntity; +import com.epmet.modules.partymember.excel.IcPartymemberStyleImportExcel; +import com.epmet.modules.partymember.service.IcPartymemberStyleImageService; +import com.epmet.modules.partymember.service.IcPartymemberStyleService; +import com.epmet.resi.partymember.dto.partymember.IcPartymemberStyleDTO; +import com.epmet.resi.partymember.dto.partymember.form.PartyMemberStyleFormDTO; +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.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; + +/** + * 党员风采 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Slf4j +@Service +public class IcPartymemberStyleServiceImpl extends BaseServiceImpl implements IcPartymemberStyleService { + + @Resource + private IcPartymemberStyleImageService icPartymemberStyleImageService; + @Resource + private GovOrgOpenFeignClient govOrgOpenFeignClient; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcPartymemberStyleDTO.class); + } + + @Override + public List list(PartyMemberStyleFormDTO formDTO) { + //分页查询 + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPartymemberStyleEntity::getAgencyId, formDTO.getAgencyId()); + wrapper.eq(StringUtils.isNotBlank(formDTO.getGridId()), IcPartymemberStyleEntity::getGridId, formDTO.getGridId()); + wrapper.like(StringUtils.isNotBlank(formDTO.getName()), IcPartymemberStyleEntity::getName, formDTO.getName()); + wrapper.like(StringUtils.isNotBlank(formDTO.getMainDeed()), IcPartymemberStyleEntity::getMainDeed, formDTO.getMainDeed()); + List list = baseDao.selectList(wrapper); + List dtoList = ConvertUtils.sourceToTarget(list, IcPartymemberStyleDTO.class); + //设置网格名 + dtoList.forEach(item -> { + if (StringUtils.isNotBlank(item.getGridId())) { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(item.getGridId()); + item.setGridName(gridInfo.getGridName()); + } + }); + + return dtoList; + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcPartymemberStyleDTO get(String id) { + IcPartymemberStyleEntity entity = baseDao.selectById(id); + IcPartymemberStyleDTO dto = ConvertUtils.sourceToTarget(entity, IcPartymemberStyleDTO.class); + dto.setImageList(icPartymemberStyleImageService.getByStyleId(id)); + return dto; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(TokenDto tokenDto, IcPartymemberStyleDTO dto) { + IcPartymemberStyleEntity entity = ConvertUtils.sourceToTarget(dto, IcPartymemberStyleEntity.class); + entity.setCustomerId(tokenDto.getCustomerId()); + CustomerStaffInfoCacheResult staff = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + entity.setAgencyId(staff.getAgencyId()); + if (StringUtils.isBlank(entity.getId())) { + insert(entity); + } else { + updateById(entity); + } + //删除原有的照片 + icPartymemberStyleImageService.deleteByStyleId(entity.getId()); + //保存新的照片 + if (CollectionUtils.isNotEmpty(dto.getImageList())) { + AtomicInteger i = new AtomicInteger(NumConstant.ZERO); + List list = dto.getImageList().stream().map(item -> { + IcPartymemberStyleImageEntity e = new IcPartymemberStyleImageEntity(); + e.setCustomerId(tokenDto.getCustomerId()); + e.setStyleId(entity.getId()); + e.setImageUrl(item); + e.setSort(i.getAndIncrement()); + e.setRevision(NumConstant.ZERO); + e.setDelFlag(NumConstant.ZERO_STR); + e.setCreatedBy(tokenDto.getUserId()); + e.setUpdatedBy(tokenDto.getUserId()); + e.setCreatedTime(new Date()); + e.setUpdatedTime(new Date()); + return e; + }).collect(Collectors.toList()); + icPartymemberStyleImageService.insertBatch(list); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String id) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteById(id); + } + + /** + * 查询列表 + * + * @param formDTO + * @Param formDTO + * @Return {@link PageData} + * @Author zhaoqifeng + * @Date 2021/11/19 9:30 + */ + @Override + public PageData search(PartyMemberStyleFormDTO formDTO) { + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + //分页查询 + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPartymemberStyleEntity::getAgencyId, formDTO.getAgencyId()); + wrapper.eq(StringUtils.isNotBlank(formDTO.getGridId()), IcPartymemberStyleEntity::getGridId, formDTO.getGridId()); + wrapper.like(StringUtils.isNotBlank(formDTO.getName()), IcPartymemberStyleEntity::getName, formDTO.getName()); + wrapper.like(StringUtils.isNotBlank(formDTO.getMainDeed()), IcPartymemberStyleEntity::getMainDeed, formDTO.getMainDeed()); + List list = baseDao.selectList(wrapper); + List dtoList = ConvertUtils.sourceToTarget(list, IcPartymemberStyleDTO.class); + PageInfo pageInfo = new PageInfo<>(dtoList); + //设置网格名 + dtoList.forEach(item -> { + if (StringUtils.isNotBlank(item.getGridId())) { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(item.getGridId()); + item.setGridName(gridInfo.getGridName()); + } + }); + return new PageData<>(dtoList, pageInfo.getTotal()); + } + + /** + * 导入数据 + * + * @Param tokenDto + * @Param response + * @Param file + * @Return + * @Author zhaoqifeng + * @Date 2021/11/29 11:01 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Result importData(TokenDto tokenDto, HttpServletResponse response, MultipartFile file) throws IOException { + ExcelImportResult importResult = ExcelPoiUtils.importExcelMore(file, 0, 1, IcPartymemberStyleImportExcel.class); + List failList = importResult.getFailList(); + //存放错误数据行号 + List numList = new ArrayList<>(); + if (!org.springframework.util.CollectionUtils.isEmpty(failList)) { + for (IcPartymemberStyleImportExcel entity : failList) { + //打印失败的行 和失败的信息 + log.warn("第{}行,{}", entity.getRowNum(), entity.getErrorMsg()); + numList.add(entity.getRowNum()); + } + } + List result = importResult.getList(); + + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + //获取组织下网格信息 + GridOptionFormDTO formDTO = new GridOptionFormDTO(); + formDTO.setAgencyId(staffInfoCache.getAgencyId()); + Result> gridOptionResult = govOrgOpenFeignClient.getGridIListByAgency(staffInfoCache.getAgencyId()); + if (!gridOptionResult.success()) { + throw new EpmetException(gridOptionResult.getCode(), gridOptionResult.getMsg()); + } + Map gridMap = gridOptionResult.getData().stream().collect(Collectors.toMap(CustomerGridDTO::getGridName, CustomerGridDTO::getId)); + //1.数据校验 只允许导入当前组织下的网格的数据 + //网格名称不一样的数据舍弃 + Iterator iterator = result.iterator(); + while (iterator.hasNext()) { + IcPartymemberStyleImportExcel obj = iterator.next(); + if (null == gridMap.get(obj.getGridName().trim())) { + numList.add(obj.getRowNum()); + log.warn(String.format("不是当前组织下可导入的数据,网格名称->%s,行号->%s", obj.getGridName(), obj.getRowNum())); + iterator.remove(); + } + } + if (CollectionUtils.isEmpty(result)) { + Collections.sort(numList); + String subList = numList.stream().map(String::valueOf).collect(Collectors.joining("、")); + return new Result().error(9999, "第" + subList + "行未成功!"); + } + List imageList = new ArrayList<>(); + List list = result.stream().map(item -> { + IcPartymemberStyleEntity entity = new IcPartymemberStyleEntity(); + entity.setId(UUID.randomUUID().toString().replace("-", "")); + entity.setCustomerId(tokenDto.getCustomerId()); + entity.setAgencyId(staffInfoCache.getAgencyId()); + entity.setGridId(gridMap.get(item.getGridName())); + entity.setName(item.getName()); + entity.setMainDeed(item.getMainDeed()); + AtomicInteger i = new AtomicInteger(); + if (StringUtils.isNotBlank(item.getImageUrl())) { + Arrays.asList(item.getImageUrl().split(StrConstant.COMMA)).forEach(url -> { + IcPartymemberStyleImageEntity urlEntity = new IcPartymemberStyleImageEntity(); + urlEntity.setImageUrl(url); + urlEntity.setCustomerId(tokenDto.getCustomerId()); + urlEntity.setStyleId(entity.getId()); + urlEntity.setSort(i.getAndIncrement()); + urlEntity.setRevision(NumConstant.ZERO); + urlEntity.setDelFlag(NumConstant.ZERO_STR); + urlEntity.setCreatedBy(tokenDto.getUserId()); + urlEntity.setUpdatedBy(tokenDto.getUserId()); + urlEntity.setCreatedTime(new Date()); + urlEntity.setUpdatedTime(new Date()); + imageList.add(urlEntity); + }); + } + return entity; + }).collect(Collectors.toList()); + + insertBatch(list); + icPartymemberStyleImageService.insertBatch(imageList); + + String str = String.format("共%s条,成功导入%s条。", numList.size() + result.size(), numList.size() + result.size() - numList.size()); + if (numList.size() > NumConstant.ZERO) { + Collections.sort(numList); + String subList = numList.stream().map(String::valueOf).collect(Collectors.joining("、")); + log.warn(str + "第" + subList + "行未成功!"); + return new Result().error(9999, str + "第" + subList + "行未成功!"); + } + return new Result().ok(str); + } + +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java index 502a520dc3..ae67b95ebf 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java @@ -580,6 +580,8 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService userResiInfoDTO.setDistrict(partyMemberInfoDTO.getEstate()); userResiInfoDTO.setBuildingAddress(partyMemberInfoDTO.getBuilding()); userResiInfoDTO.setCustomerId(partyMemberInfoDTO.getCustomerId()); + //注册居民需要录入身份证号 + userResiInfoDTO.setIdNum(partyMemberInfoDTO.getIdCard()); Result result = epmetUserFeignClient.saveResiInfo(userResiInfoDTO); log.info("isResiRegister epmetUserFeignClient.saveResiInfo result:{}",JSON.toJSONString(result)); if (!result.success()){ @@ -608,7 +610,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService /** - * 保存或者更新热心居民申请行为记录表 + * 保存或者更新党员认证行为记录表 * * @param visitId 主键 * @param fromDTO 参数 diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartymemberStyleDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartymemberStyleDao.xml new file mode 100644 index 0000000000..a8375fe173 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartymemberStyleDao.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartymemberStyleImageDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartymemberStyleImageDao.xml new file mode 100644 index 0000000000..308d34d1e6 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartymemberStyleImageDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserResiInfoDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserResiInfoDTO.java index 3d81025a02..d8b5c10495 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserResiInfoDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserResiInfoDTO.java @@ -66,6 +66,11 @@ public class UserResiInfoDTO implements Serializable { */ private String name; + /** + * 身份证号,1206新增 + */ + private String idNum; + /** * 街道 */ diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DemandUserFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DemandUserFormDTO.java new file mode 100644 index 0000000000..27e59a526d --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DemandUserFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +@Data +public class DemandUserFormDTO implements Serializable { + public interface InternalGroup { + } + +// public interface GridIdGroup extends CustomerClientShowGroup { +// } + + @NotBlank(message = "工作人员所属组织id不能为空", groups = InternalGroup.class) + private String agencyId; + +// @NotBlank(message = "请先选择所属网格", groups = GridIdGroup.class) + private String gridId; + + + private String name; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EditInfoFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EditInfoFormDTO.java index 81bd8e9082..e8eb4249fa 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EditInfoFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EditInfoFormDTO.java @@ -1,7 +1,9 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; import lombok.NoArgsConstructor; +import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotBlank; import java.io.Serializable; @@ -16,30 +18,41 @@ import java.io.Serializable; public class EditInfoFormDTO implements Serializable { private static final long serialVersionUID = 1280489016677129419L; + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } /** * 头像 */ - @NotBlank(message = "头像不能为空") + @NotBlank(message = "userId不能为空",groups = AddUserInternalGroup.class) private String userId; /** * 头像 */ - @NotBlank(message = "头像不能为空") + @NotBlank(message = "头像不能为空",groups = AddUserShowGroup.class) private String headImgUrl; /** * 姓 */ - @NotBlank(message = "姓不能为空") + @NotBlank(message = "姓不能为空",groups = AddUserShowGroup.class) private String surname; /** * 名 */ - @NotBlank(message = "名不能为空") + @NotBlank(message = "名不能为空",groups = AddUserShowGroup.class) private String name; + + //@NotBlank(message = "身份证号不能为空") + @Length(max=18,message = "身份证号不能超过18位",groups = AddUserShowGroup.class) + //别的小程序不统一升级,没办法限制必填。 + private String idNum; + /** * 路牌号 */ - @NotBlank(message = "路牌号不能为空") + @NotBlank(message = "路牌号不能为空",groups = AddUserShowGroup.class) private String street; /** * 小区名称 @@ -52,6 +65,12 @@ public class EditInfoFormDTO implements Serializable { /** * 昵称 */ - @NotBlank(message = "昵称不能为空") + @NotBlank(message = "昵称不能为空",groups = AddUserShowGroup.class) private String nickname; + + /** + * 当前客户id + */ + @NotBlank(message = "customerId不能为空",groups = AddUserInternalGroup.class) + private String customerId; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GetByRealNamesFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GetByRealNamesFormDTO.java new file mode 100644 index 0000000000..80719e6737 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GetByRealNamesFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.form; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.Set; + +/** + * @Author sun + * @Description 根据工作人员姓名批量查询基础信息数据 + **/ +@NoArgsConstructor +@Data +public class GetByRealNamesFormDTO implements Serializable { + + private static final long serialVersionUID = -5220529162950147825L; + /** + * 客户Id + */ + private String customerId; + /** + * 工作人员姓名集合 + */ + private Set realNames; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/InfoSubmitFromDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/InfoSubmitFromDTO.java index 75453a1d22..c99a96878c 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/InfoSubmitFromDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/InfoSubmitFromDTO.java @@ -22,7 +22,6 @@ import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotBlank; import java.io.Serializable; -import java.util.Date; /** @@ -57,6 +56,11 @@ public class InfoSubmitFromDTO implements Serializable { @Length(max=20,message = "名称不能超过20个字") private String name; + //@NotBlank(message = "身份证号不能为空") + @Length(max=18,message = "身份证号不能超过18位") + //别的小程序不统一升级,没办法限制必填。 + private String idNum; + /** * 街道 */ diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PersonDataFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PersonDataFormDTO.java index 52d96870a2..e2355d145a 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PersonDataFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PersonDataFormDTO.java @@ -19,4 +19,8 @@ public class PersonDataFormDTO implements Serializable { @NotBlank(message = "userId不能为空",groups = PersonDataForm.class) private String userId; + + + @NotBlank(message = "tokenDto获取customerId不能为空",groups = PersonDataForm.class) + private String customerId; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ResiUserFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ResiUserFormDTO.java new file mode 100644 index 0000000000..e8b62f166a --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ResiUserFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 根据身份证号||ic_resi_user.id找居民端小程序里的人 + */ +@Data +public class ResiUserFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + + /** + * 身份证号 + */ + private String idNum; + + /** + * ic_resi_user.id + */ + private String icResiUserId; + + @NotBlank(message = "客户id不能为空", groups = AddUserInternalGroup.class) + private String customerId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/DemandUserResDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/DemandUserResDTO.java new file mode 100644 index 0000000000..da8e6cfd07 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/DemandUserResDTO.java @@ -0,0 +1,15 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class DemandUserResDTO implements Serializable { + private String demandUserId; + private String demandUserName; + private String demandUserMobile; + private String label; + private String gridId; + private String idCard; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyResiUserInfoResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyResiUserInfoResultDTO.java index 5b26ee9150..a81e542024 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyResiUserInfoResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyResiUserInfoResultDTO.java @@ -22,6 +22,10 @@ public class MyResiUserInfoResultDTO implements Serializable { * 是否已注册居民,true ,false * */ private Boolean registerFlag; + /** + * 是否录入身份证号,true ,false + * */ + private Boolean completeIdNum; /** * 微信昵称,可为空“” * */ diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyselfMsgResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyselfMsgResultDTO.java index b46c665dfc..cb15d9440b 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyselfMsgResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyselfMsgResultDTO.java @@ -38,4 +38,8 @@ public class MyselfMsgResultDTO implements Serializable { * */ private String gridId; + /** + * 身份证号 + * */ + private String idNum; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonDataResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonDataResultDTO.java index 6a89bb2037..68ad326637 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonDataResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonDataResultDTO.java @@ -7,7 +7,6 @@ import lombok.Data; import java.io.Serializable; import java.util.ArrayList; import java.util.List; -import java.util.Map; /** * @Author zxc @@ -19,6 +18,16 @@ public class PersonDataResultDTO implements Serializable { private static final long serialVersionUID = 5210308218052783909L; + /** + * epemt_user.user.id + */ + private List epmetUserIdList; + + /** + * ic_resi_user.id + */ + private String icResiUserId; + /** * 工作单位 */ diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/ResiUserResDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/ResiUserResDTO.java new file mode 100644 index 0000000000..250ed45494 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/ResiUserResDTO.java @@ -0,0 +1,16 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 根据ic_resi_user找 epmetUser + */ +@Data +public class ResiUserResDTO implements Serializable { + private String idNum; + private String customerId; + private List epmetUserIdList; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java index c861899ccb..f981a68f8b 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java @@ -77,4 +77,20 @@ public class StaffBasicInfoResultDTO implements Serializable { */ private String agencyName; + /** + * 组织级别 + */ + private String level; + + /** + * 中心位置经度 + */ + private String longitude; + + /** + * 中心位置纬度 + */ + private String latitude; + + } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 5637b6b765..ff3b7ffc1c 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -653,4 +653,20 @@ public interface EpmetUserOpenFeignClient { @PostMapping("/epmetuser/icresiuser/categorycount") Result>> getHomeUserCategoryCount(@RequestBody IcResiUserDTO formDTO); + + /** + * @Author sun + * @Description 根据工作人员姓名批量查询基础信息数据 + **/ + @PostMapping(value = "epmetuser/customerstaff/getbyrealnames") + Result> getByRealNames(@RequestBody GetByRealNamesFormDTO formDTO); + + /** + * 根据身份证号||ic_resi_user.id找居民端小程序里的人 + * + * @param formDTO + * @return + */ + @PostMapping(value = "/epmetuser/user/findepmetuser") + Result findEpmetUser(@RequestBody ResiUserFormDTO formDTO); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index e339f2e83b..1eeca4cdd3 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -474,4 +474,20 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result>> getHomeUserCategoryCount(IcResiUserDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getHomeUserCategoryCount", formDTO); } + + @Override + public Result> getByRealNames(GetByRealNamesFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getByRealNames", formDTO); + } + + /** + * 根据身份证号||ic_resi_user.id找居民端小程序里的人 + * + * @param formDTO + * @return + */ + @Override + public Result findEpmetUser(ResiUserFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "findEpmetUser", formDTO); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java index cfbe7e4575..531d6791ac 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java @@ -472,5 +472,14 @@ public class CustomerStaffController { return new Result(); } + /** + * @Author sun + * @Description 根据工作人员姓名批量查询基础信息数据 + **/ + @PostMapping(value = "getbyrealnames") + public Result> getByRealNames(@RequestBody GetByRealNamesFormDTO formDTO) { + return new Result>().ok(customerStaffService.getByRealNames(formDTO)); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java index f703d7304b..d6df9f57e0 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java @@ -17,15 +17,10 @@ package com.epmet.controller; -import cn.afterturn.easypoi.excel.ExcelExportUtil; -import cn.afterturn.easypoi.excel.entity.TemplateExportParams; import com.alibaba.excel.EasyExcel; import com.alibaba.excel.ExcelWriter; -import com.alibaba.excel.enums.WriteDirectionEnum; import com.alibaba.excel.write.metadata.WriteSheet; -import com.alibaba.excel.write.metadata.fill.FillConfig; import com.alibaba.excel.write.metadata.fill.FillWrapper; -import com.alibaba.fastjson.JSON; import com.epmet.commons.rocketmq.messages.IcResiUserAddMQMsg; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; @@ -40,12 +35,11 @@ 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.ExcelUtils; import com.epmet.commons.tools.utils.HttpClientManager; import com.epmet.commons.tools.utils.IpUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.constant.IcResiUserConstant; import com.epmet.constant.SystemMessageType; import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.form.*; @@ -62,20 +56,20 @@ import org.apache.commons.io.FileUtils; import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; -import org.apache.poi.ss.usermodel.Workbook; import org.jetbrains.annotations.NotNull; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; -import java.io.*; -import java.net.URLEncoder; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.*; -import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; @@ -237,155 +231,6 @@ public class IcResiUserController { return new Result().ok(icResiUserService.queryIcResiDetail(pageFormDTO)); } - /** - * desc :备用 easypoi - * - * @param customerId - * @param pageFormDTO - * @param response - * @throws Exception - */ - @RequestMapping(value = "/exportExcel2") - public void exportExcel(@RequestHeader String customerId, @LoginUser TokenDto tokenDto, @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws Exception { - //tokenDto.setUserId("9e37adcce6472152e6508a19d3683e02"); - CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(customerId, tokenDto.getUserId()); - String staffOrgPath = null; - if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) { - staffOrgPath = staffInfoCacheResult.getAgencyPIds().concat(":").concat(staffInfoCacheResult.getAgencyId()); - } else { - staffOrgPath = staffInfoCacheResult.getAgencyId(); - } - pageFormDTO.setCustomerId(customerId); - pageFormDTO.setPageFlag(false); - CustomerFormResultDTO resiFormItems = getResiFormAddItems(pageFormDTO.getCustomerId()); - - Map> otherSheetItems = buildItemMap(resiFormItems); - - Map> resiMainList = null;//icResiUserService.getDataForExport(otherSheetItems.get(IcResiUserConstant.IC_RESI_USER), IcResiUserConstant.IC_RESI_USER, pageFormDTO, staffInfoCacheResult.getAgencyId(), staffOrgPath); - //resiMainList = (List>)JSON.parse("[{\"IS_BDHJ\":\"1\",\"IS_SPECIAL\":\"1\",\"IS_XFRY\":\"0\",\"REMARKS\":\"beizhu\",\"IS_PARTY\":\"1\",\"icResiUserId\":\"yzmtest2\",\"HOME_ID\":\"中海国际社区一里城1号楼1单元101\",\"HOUSE_TYPE\":\"平房\",\"UNIT_NAME\":\"1单元\",\"GRID_ID\":\"市北区-市北区第三网格3\",\"IS_DB\":\"0\",\"GENDER\":\"男\",\"BIRTHDAY\":\"2021-10-04\",\"IS_VETERANS\":\"0\",\"IS_MB\":\"0\",\"IS_UNEMPLOYED\":\"0\",\"DEMAND_NAME\":null,\"IS_KC\":\"0\",\"IS_ENSURE_HOUSE\":\"0\",\"IS_SD\":\"0\",\"NAME\":\"尹作梅\",\"RDSJ\":null,\"IS_VOLUNTEER\":\"1\",\"GRID_ID_VALUE\":\"e74829ffc43d5470eba6b5e060c11e63\",\"IS_SZ\":\"0\",\"IS_CJ\":\"0\",\"HOME_ID_VALUE\":\"200\",\"DEMAND_CATEGORY_IDS\":null,\"VILLAGE_NAME\":\"中海国际社区一里城\",\"IS_DBH\":\"0\",\"IS_SN\":\"0\",\"BUILD_NAME\":\"1号楼\",\"IS_YLFN\":\"0\",\"IS_UNITED_FRONT\":\"0\",\"ID_CARD\":\"371325199310260529\",\"MOBILE\":\"15764229697\",\"IS_OLD_PEOPLE\":\"0\",\"DOOR_NAME\":\"101\"},{\"IS_SPECIAL\":\"1\",\"IS_XFRY\":\"0\",\"REMARKS\":\"beizhu\",\"IS_PARTY\":\"1\",\"icResiUserId\":\"yzmtest\",\"HOME_ID\":\"中海国际社区一里城1号楼1单元101\",\"HOUSE_TYPE\":\"平房\",\"UNIT_NAME\":\"1单元\",\"GRID_ID\":\"市北区-市北区第三网格3\",\"IS_DB\":\"0\",\"GENDER\":\"男\",\"BIRTHDAY\":\"2021-10-04\",\"IS_VETERANS\":\"0\",\"IS_MB\":\"0\",\"IS_UNEMPLOYED\":\"0\",\"DEMAND_NAME\":\"心理咨询\",\"IS_KC\":\"0\",\"IS_ENSURE_HOUSE\":\"0\",\"IS_SD\":\"0\",\"NAME\":\"尹作梅\",\"RDSJ\":\"2021-10-28 00:00:00\",\"IS_VOLUNTEER\":\"1\",\"GRID_ID_VALUE\":\"e74829ffc43d5470eba6b5e060c11e63\",\"IS_SZ\":\"0\",\"IS_CJ\":\"0\",\"HOME_ID_VALUE\":\"200\",\"DEMAND_CATEGORY_IDS\":\"10180002\",\"VILLAGE_NAME\":\"中海国际社区一里城\",\"IS_DBH\":\"0\",\"IS_SN\":\"0\",\"BUILD_NAME\":\"1号楼\",\"IS_YLFN\":\"0\",\"IS_UNITED_FRONT\":\"0\",\"ID_CARD\":\"371325199310260529\",\"MOBILE\":\"15764229697\",\"IS_OLD_PEOPLE\":\"0\",\"DOOR_NAME\":\"101\"}]"); - log.info("resiMainList:{}", JSON.toJSONString(resiMainList)); - String templatePath = "excel/ic_resi_info_cid.xls"; - TemplateExportParams params = new TemplateExportParams(templatePath, true); - - Map> sheetMap = new HashMap<>(); - Map mapData = new HashMap<>(); - mapData.put("list", resiMainList.values()); - System.out.println("===resiMainList===" + " " + JSON.toJSONString(resiMainList.values())); - sheetMap.put(0, mapData); - AtomicInteger n = new AtomicInteger(); - for (FormItemResult item : resiFormItems.getItemList()) { - //如果 childGroup是空 或者是主表 则跳过 继续下次循环 - if (item.getChildGroup() == null || IcResiUserConstant.IC_RESI_USER.equals(item.getChildGroup().getTableName())) { - continue; - } - String tableName = item.getChildGroup().getTableName(); - - Map itemMap1 = otherSheetItems.get(tableName); - Map> resiChildMap = null;//icResiUserService.getDataForExport(itemMap1, tableName, pageFormDTO, staffInfoCacheResult.getAgencyId(), staffOrgPath); - //resiChildMap.forEach((key, value) -> value.putAll(resiMainList.get(key))); - - Map mapData2 = new HashMap<>(); - mapData2.put("list", resiChildMap.values()); - System.out.println("===resiChildMap===" + tableName + " " + JSON.toJSONString(resiChildMap.values())); - sheetMap.put(n.incrementAndGet(), mapData2); - - - } - - Workbook workbook = ExcelExportUtil.exportExcel(sheetMap, params); - workbook.setActiveSheet(0); - workbook.write(getOutputStream("居民基本信息.xls", response)); - } - - @RequestMapping(value = "/exportExcel3") - public void exportExcelByEasyExcel3(@RequestHeader String customerId,@LoginUser TokenDto tokenDto, @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws Exception { - //tokenDto.setUserId("9e37adcce6472152e6508a19d3683e02"); - CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(customerId, tokenDto.getUserId()); - String staffOrgPath = null; - if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) { - staffOrgPath = staffInfoCacheResult.getAgencyPIds().concat(":").concat(staffInfoCacheResult.getAgencyId()); - } else { - staffOrgPath = staffInfoCacheResult.getAgencyId(); - } - pageFormDTO.setCustomerId(customerId); - pageFormDTO.setPageFlag(false); - CustomerFormResultDTO resiFormItems = getResiFormAddItems(pageFormDTO.getCustomerId()); - Map> otherSheetItems = buildItemMap(resiFormItems); - - /*List resiFormAllItems = getResiFormAllItems(pageFormDTO.getCustomerId()); - resiFormAllItems.stream().collect(Collectors.groupingBy(e ->e.get));*/ - - //获取模版文件 - File file = getExportTemplateFile(customerId); - ExcelWriter excelWriter = EasyExcel.write(getOutputStream("居民基本信息.xlsx", response)).withTemplate(file).build(); - - FillConfig fillConfig = FillConfig.builder().direction(WriteDirectionEnum.VERTICAL).build(); - IcResiUserTableEnum tableEnums = IcResiUserTableEnum.getObjectByTableName(IcResiUserConstant.IC_RESI_USER); - WriteSheet fistSheet = EasyExcel.writerSheet(tableEnums.getSheetNo()).build(); - - pageFormDTO.setPageSize(NumConstant.FIVE_HUNDRED); - pageFormDTO.setPageNo(NumConstant.ONE); - //子表是否停止查询 - Set stopSearchSet = new HashSet<>(); - Map childTableWriteSheetMap = new HashMap<>(); - Map> resiMainTableMap = null; - do { - resiMainTableMap = null;//icResiUserService.getDataForExport(otherSheetItems.get(IcResiUserConstant.IC_RESI_USER), IcResiUserConstant.IC_RESI_USER, pageFormDTO, staffInfoCacheResult.getAgencyId(), staffOrgPath); - //如果 返回的条数小于每页显示的数 则退出查询 - if (resiMainTableMap.keySet().size() < pageFormDTO.getPageSize()) { - stopSearchSet.add(IcResiUserConstant.IC_RESI_USER); - } - //写入数据 - excelWriter.fill(new FillWrapper("t1", resiMainTableMap.values()), fillConfig, fistSheet); - pageFormDTO.setPageNo(pageFormDTO.getPageNo() + 1); - //重置数据 - resiMainTableMap.clear(); - } while (!stopSearchSet.contains(IcResiUserConstant.IC_RESI_USER)); - - //子表数据写入 - AtomicInteger n = new AtomicInteger(); - for (FormItemResult item : resiFormItems.getItemList()) { - - //如果 childGroup是空 或者是主表 则跳过 继续下次循环 - if (item.getChildGroup() == null || IcResiUserConstant.IC_RESI_USER.equals(item.getChildGroup().getTableName())) { - continue; - } - String tableName = item.getChildGroup().getTableName(); - pageFormDTO.setPageNo(NumConstant.ONE); - //循环一次 写入每个sheet - do { - //如果包含则说明子表的数据 已经查询完毕 无需再继续查询了 - boolean contains = stopSearchSet.contains(tableName); - if (contains) { - continue; - } - Map itemMap1 = otherSheetItems.get(tableName); - Map> resiChildMap = null;//icResiUserService.getDataForExport(itemMap1, tableName, pageFormDTO, staffInfoCacheResult.getAgencyId(), staffOrgPath); - //如果 返回的条数小于每页显示的数 则退出查询 - if (resiChildMap.keySet().size() < pageFormDTO.getPageSize()) { - stopSearchSet.add(tableName); - } - tableEnums = IcResiUserTableEnum.getObjectByTableName(tableName); - if (tableEnums == null) { - continue; - } - //构建新的sheet - WriteSheet childWriteSheet = childTableWriteSheetMap.get(tableName); - if (childWriteSheet == null) { - childWriteSheet = EasyExcel.writerSheet(tableEnums.getSheetNo()).build(); - } - childTableWriteSheetMap.put(tableName, childWriteSheet); - //写入数据 - excelWriter.fill(new FillWrapper("t" + (tableEnums.getSheetNo() + NumConstant.ONE), resiChildMap.values()), childWriteSheet); - pageFormDTO.setPageNo(pageFormDTO.getPageNo() + NumConstant.ONE); - //重置数据 - resiChildMap.clear(); - } while (!stopSearchSet.contains(tableName)); - } - - excelWriter.finish(); - } - /** * desc: 导出居民信息 * @@ -396,7 +241,8 @@ public class IcResiUserController { * @return void * @author LiuJanJun * @date 2021/11/19 4:24 下午 - * @remark:分页批量导出 + * @remark:分页批量导出 oss目录在 各个环境对应的前缀文件夹/file-template/resi-template/客户ID.xlsx, + * 如果某个客户需要更新模版 则替换掉上面的模版文件;然后 更新缓存里的值或者删除也行 再导出就会下载新的模版了 */ @NoRepeatSubmit @RequestMapping(value = "/exportExcel") @@ -416,7 +262,7 @@ public class IcResiUserController { File file = getExportTemplateFile(customerId); ExcelWriter excelWriter = null; try { - excelWriter = EasyExcel.write(getOutputStream("居民基本信息.xlsx", response)).withTemplate(file).build(); + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel("居民基本信息.xlsx", response)).withTemplate(file).build(); //子表是否停止查询 Set stopSearchSet = new HashSet<>(); @@ -523,66 +369,6 @@ public class IcResiUserController { return file; } - @NotNull - private Map> buildItemMap(CustomerFormResultDTO resiFormItems) { - Map> otherSheetItems = new HashMap<>(); - - //主表的 - for (FormItemResult formItemResult : resiFormItems.getItemList()) { - if (StringUtils.isBlank(formItemResult.getColumnName())) { - continue; - } - - Map itemMap = otherSheetItems.getOrDefault(formItemResult.getTableName(), new HashMap<>()); - otherSheetItems.putIfAbsent(formItemResult.getTableName(), itemMap); - if (formItemResult.getItemType().equals("checkbox") || formItemResult.getItemType().equals("select") || formItemResult.getItemType().equals("radio")) { - itemMap.put(formItemResult.getColumnName().concat(formItemResult.getColumnNum() == 0 ? "" : formItemResult.getColumnNum().toString()), formItemResult); - } - if (formItemResult.getChildGroup() != null) { - itemMap = otherSheetItems.getOrDefault(formItemResult.getChildGroup().getTableName(), new HashMap<>()); - otherSheetItems.putIfAbsent(formItemResult.getChildGroup().getTableName(), itemMap); - for (FormItemResult2 item2 : formItemResult.getChildGroup().getItemList()) { - if (StringUtils.isBlank(item2.getColumnName())) { - continue; - } - - if ("checkbox".equals(item2.getItemType()) || "select".equals(item2.getItemType()) || "radio".equals(item2.getItemType())) { - itemMap.put(item2.getColumnName().concat(item2.getColumnNum() == 0 ? "" : item2.getColumnNum().toString()), ConvertUtils.sourceToTarget(item2, FormItemResult.class)); - } - } - - } - } - //其他sheet - - for (FormGroupDTO groupItem : resiFormItems.getGroupList()) { - if (groupItem.getItemList() == null) { - continue; - } - Map itemMap = otherSheetItems.getOrDefault(groupItem.getTableName(), new HashMap<>()); - otherSheetItems.putIfAbsent(groupItem.getTableName(), itemMap); - for (FormItemResult2 formItemResult2 : groupItem.getItemList()) { - if (StringUtils.isBlank(formItemResult2.getColumnName())) { - continue; - } - if ("checkbox".equals(formItemResult2.getItemType()) || "select".equals(formItemResult2.getItemType()) || "radio".equals(formItemResult2.getItemType())) { - itemMap.put(formItemResult2.getColumnName().concat(formItemResult2.getColumnNum() == 0 ? "" : formItemResult2.getColumnNum().toString()), ConvertUtils.sourceToTarget(formItemResult2, FormItemResult.class)); - } - } - } - return otherSheetItems; - } - - private static OutputStream getOutputStream(String fileName, HttpServletResponse response) throws Exception { - fileName = URLEncoder.encode(fileName, "UTF-8"); - response.setContentType("application/vnd.ms-excel"); - response.setCharacterEncoding("utf8"); - response.setHeader("Content-Disposition", "attachment;filename=" + fileName); - response.addHeader("Access-Control-Expose-Headers", "Content-disposition"); - - return response.getOutputStream(); - } - /** * excel导入居民基本信息 * @@ -640,7 +426,9 @@ public class IcResiUserController { * @date 2021/11/3 9:21 上午 */ @PostMapping("persondata") - public Result personData(@RequestBody PersonDataFormDTO formDTO) { + public Result personData(@LoginUser TokenDto tokenDto,@RequestBody PersonDataFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO,PersonDataFormDTO.PersonDataForm.class); return new Result().ok(icResiUserService.personData(formDTO)); } @@ -693,4 +481,15 @@ public class IcResiUserController { return new Result>>().ok(icResiUserService.getHomeUserCategoryCount(formDTO.getBuildId())); } + /** + * @LoginUser TokenDto tokenDto, + * 新增需求,需求人列表:展示当前工作人员所属组织+页面已选择所属网格 下的居民列表 + * @param formDTO + * @return + */ + @PostMapping("demandusers") + public Result> queryDemandUsers(@RequestBody DemandUserFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, DemandUserFormDTO.InternalGroup.class); + return new Result>().ok(icResiUserService.queryDemandUsers(formDTO)); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java index f1cbcb114a..66d5d15d7a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java @@ -185,4 +185,17 @@ public class UserController { } return new Result().ok(userService.queryUserClient(userId)); } + + /** + * 根据身份证号||ic_resi_user.id找居民端小程序里的人 + * + * + * @param formDTO + * @return + */ + @PostMapping("findepmetuser") + public Result findEpmetUser(@RequestBody ResiUserFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,ResiUserFormDTO.AddUserInternalGroup.class); + return new Result().ok(userService.findEpmetUser(formDTO)); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java index 41e4a1114a..820f310a40 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java @@ -171,6 +171,7 @@ public class UserResiInfoController { */ @PostMapping("edituserinfo") public Result editUserInfo(@RequestBody EditInfoFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO,EditInfoFormDTO.AddUserShowGroup.class,EditInfoFormDTO.AddUserInternalGroup.class); userResiInfoService.editUserInfo(formDTO); return new Result(); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java index 97e4bf7424..d0ce82f757 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java @@ -215,4 +215,10 @@ public interface CustomerStaffDao extends BaseDao { List listDTOS(@Param("customerId") String customerId, @Param("realName") String realName, @Param("mobile") String mobile, @Param("userIds") List userIds); List selectStaffRoles(@Param("userId") String userId,@Param("customerId") String customerId); + + /** + * @Author sun + * @Description 根据工作人员姓名批量查询基础信息数据 + **/ + List getByRealNames(GetByRealNamesFormDTO formDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java index 81cd7bf54e..ea5ca5b741 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java @@ -20,6 +20,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.form.ResiUserQueryValueDTO; +import com.epmet.dto.result.DemandUserResDTO; import com.epmet.dto.result.IcFormResColumnDTO; import com.epmet.dto.result.PersonDataResultDTO; import com.epmet.dto.result.SearchByNameResultDTO; @@ -151,4 +152,18 @@ public interface IcResiUserDao extends BaseDao { * @Description 查询居民信息 **/ IcResiUserDTO getResiUser(IcResiUserDTO dto); -} \ No newline at end of file + /** + * + * @param agencyId + * @param gridId + * @param name + * @return + */ + List selectDemandUsers(@Param("agencyId") String agencyId, + @Param("gridId")String gridId, + @Param("name")String name); + + IcResiUserDTO selectIdByIdCard(@Param("customerId") String customerId, + @Param("idNum")String idNum, + @Param("icResiUserId")String icResiUserId); +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBaseInfoDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBaseInfoDao.java index 6fdd2f931f..3cd4c5ffe2 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBaseInfoDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBaseInfoDao.java @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.UserBaseInfoDTO; import com.epmet.dto.result.ResiUserBaseInfoResultDTO; import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.dto.result.UserWechatResultDTO; @@ -25,6 +26,8 @@ import com.epmet.entity.UserBaseInfoEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 用户基础信息 * @@ -80,4 +83,11 @@ public interface UserBaseInfoDao extends BaseDao { * @date 2020.07.30 19:16 **/ String selectIdByUserId(@Param("userId") String userId); + + List selectCommonIdNumUser(@Param("customerId") String customerId, + @Param("idNum")String idNum); + + Integer selectCountIdNum(@Param("idNum") String idNum, + @Param("customerId")String customerId, + @Param("excludeUserId")String excludeUserId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserResiInfoDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserResiInfoDao.java index 59d42dfc6e..73044f21c4 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserResiInfoDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserResiInfoDao.java @@ -96,4 +96,16 @@ public interface UserResiInfoDao extends BaseDao { * @return void */ void updateByUserId(UserResiInfoEntity entity); + + /** + * 身份证 + * @param idNum + * @return + */ + Integer selectCountByIdNum(@Param("idNum") String idNum, + @Param("customerId") String customerId, + @Param("excludeUserId")String excludeUserId); + + List selectCommonIdNumUser(@Param("customerId") String customerId, + @Param("idNum")String idNum); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserResiInfoEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserResiInfoEntity.java index 7c4266e3c7..7df10f75a6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserResiInfoEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserResiInfoEntity.java @@ -20,13 +20,10 @@ 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; -import java.util.Date; - /** * 用户居民端注册信息表 用户在居民端完善的个人信息 * @@ -60,6 +57,11 @@ public class UserResiInfoEntity extends BaseEpmetEntity { */ private String name; + /** + * 身份证号,1206新增 + */ + private String idNum; + /** * 街道 */ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java index bd4e8aae97..08916bfcc8 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java @@ -335,4 +335,10 @@ public interface CustomerStaffService extends BaseService { * @author sun */ void enableStaff(EnableStaffFormDTO fromDTO); + + /** + * @Author sun + * @Description 根据工作人员姓名批量查询基础信息数据 + **/ + List getByRealNames(GetByRealNamesFormDTO formDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java index 2d8a3592bd..9a0fcbed95 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java @@ -20,6 +20,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.IcResiUserEntity; @@ -139,4 +140,15 @@ public interface IcResiUserService extends BaseService { * @return */ List listFormItems(String customerId, String formCode); + + List queryDemandUsers(DemandUserFormDTO formDTO); + + /** + * 返回ic_resi_user.id + * + * @param customerId + * @param idNum + * @return + */ + IcResiUserDTO getByIdCard(String customerId, String idNum,String icResiUserId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java index 531213863d..b5ca38d3ed 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java @@ -189,4 +189,9 @@ public interface UserBaseInfoService extends BaseService { * @date 2020.08.21 17:16 **/ ExtUserInfoResultDTO extUserInfo(CommonUserIdFormDTO param); + + List getCommonIdNumUser(String customerId, String idNum); + + @Deprecated + Integer checkIdNum(String idNum, String customerId, String excludeUserId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserService.java index 33e7b1c7ad..0790655742 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserService.java @@ -104,4 +104,13 @@ public interface UserService extends BaseService { * @date 2021/9/10 8:50 上午 */ UserDTO queryUserClient(String userId); + + /** + * 根据身份证号||ic_resi_user.id找居民端小程序里的人 + * + * + * @param formDTO + * @return + */ + ResiUserResDTO findEpmetUser(ResiUserFormDTO formDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index 545550dcd1..648c0e8245 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java @@ -717,6 +717,9 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl().ok(resultDTO); @@ -766,4 +769,13 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl getByRealNames(GetByRealNamesFormDTO formDTO) { + return baseDao.getByRealNames(formDTO); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index dfc0185caf..ea21846183 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -21,7 +21,6 @@ import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; -import com.epmet.commons.rocketmq.messages.IcResiUserAddMQMsg; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.ServiceConstant; @@ -47,7 +46,6 @@ import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.IcPlatformConstant; import com.epmet.constant.IcResiUserConstant; -import com.epmet.constant.SystemMessageType; import com.epmet.constant.UserConstant; import com.epmet.dao.IcResiUserDao; import com.epmet.dto.*; @@ -61,6 +59,7 @@ import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.OperCustomizeOpenFeignClient; import com.epmet.service.IcResiUserService; +import com.epmet.service.UserService; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -101,6 +100,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl getWrapper(Map params){ String id = (String)params.get(FieldConstant.ID_HUMP); @@ -530,6 +531,16 @@ public class IcResiUserServiceImpl extends BaseServiceImpl()); + personData.setIcResiUserId(formDTO.getUserId()); + // 房屋信息查询 Result> listResult = govOrgOpenFeignClient.selectHouseInfoByIdCard(personData.getIdCard()); if (!listResult.success()){ @@ -847,4 +858,24 @@ public class IcResiUserServiceImpl extends BaseServiceImpl> result = operCustomizeOpenFeignClient.listItems(form); return getResultDataOrThrowsException(result, ServiceConstant.OPER_CUSTOMIZE_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "查询表单相关信息失败", null); } + + @Override + public List queryDemandUsers(DemandUserFormDTO formDTO) { + return baseDao.selectDemandUsers(formDTO.getAgencyId(),formDTO.getGridId(),formDTO.getName()); + } + + /** + * 返回ic_resi_user.id + * + * @param customerId + * @param idNum + * @return + */ + @Override + public IcResiUserDTO getByIdCard(String customerId, String idNum,String icResiUserId) { + if(StringUtils.isBlank(idNum)&&StringUtils.isBlank(icResiUserId)){ + return null; + } + return baseDao.selectIdByIdCard(customerId,idNum,icResiUserId); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java index 0f4d76d821..5dd7677665 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java @@ -442,4 +442,17 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl getCommonIdNumUser(String customerId, String idNum) { + if(StringUtils.isBlank(idNum)){ + return null; + } + return baseDao.selectCommonIdNumUser(customerId,idNum); + } + + @Override + public Integer checkIdNum(String idNum, String customerId, String excludeUserId) { + return baseDao.selectCountIdNum(idNum,customerId,excludeUserId); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java index 822c68abcd..385c02dc24 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java @@ -217,6 +217,17 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl NumConstant.ZERO) { + throw new EpmetException(EpmetErrorCode.IDCARDNO_ALREADY_EXITS.getCode(), "user_resi_info已存在该身份证号", EpmetErrorCode.IDCARDNO_ALREADY_EXITS.getMsg()); + } + //判断user_base_info表是否存在相同的身份证号 + if (userBaseInfoService.checkIdNum(userResiInfoDTO.getIdNum(), userResiInfoDTO.getCustomerId(), null) > 0) { + throw new EpmetException(EpmetErrorCode.IDCARDNO_ALREADY_EXITS.getCode(), "user_base_info已存在该身份证号", EpmetErrorCode.IDCARDNO_ALREADY_EXITS.getMsg()); + } + }*/ userResiRegisterVisitService.updateResiRegisterVisit(true, userResiInfoDTO); //4:居民注册关系表新增数据 首次注册数加一 注册数加一 参与数加一 registerRelationService.saveRegisterRelation(userResiInfoDTO); @@ -302,24 +313,32 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl 0) { + throw new EpmetException(EpmetErrorCode.IDCARDNO_ALREADY_EXITS.getCode(), "user_resi_info已存在该身份证号", EpmetErrorCode.IDCARDNO_ALREADY_EXITS.getMsg()); + } + //判断user_base_info表是否存在相同的身份证号 + if (userBaseInfoService.checkIdNum(userResiInfoDTO.getIdNum(), userResiInfoDTO.getCustomerId(), null) > 0) { + throw new EpmetException(EpmetErrorCode.IDCARDNO_ALREADY_EXITS.getCode(), "user_base_info已存在该身份证号", EpmetErrorCode.IDCARDNO_ALREADY_EXITS.getMsg()); + } + }*/ + //居民注册关系表新增数据 首次注册数加一 注册数加一 参与数加一 + registerRelationService.saveRegisterRelation(userResiInfoDTO); + //数据存入居民注册表 + saveUserResiInfo(userResiInfoDTO); /* //将用户于居民角色关联 saveUserResiInfo已包含 UserRoleDTO userRole = new UserRoleDTO(); userRole.setUserId(userResiInfoDTO.getUserId()); userRole.setRoleKey(UserConstant.ROLE_RESI); userRole.setApp(userResiInfoDTO.getApp()); userRoleService.saveUserRole(userRole);*/ - //更新该用户在该客户下的注册状态 - userCustomerDao.updateRegistered(userResiInfoDTO.getCustomerId(), userResiInfoDTO.getUserId()); - }else{ - log.warn("手机号客户内不可用,没有更新用户信息,param:{}", JSON.toJSONString(userResiInfoDTO)); - throw new RenException(EpmetErrorCode.THE_MOBILE_HAS_BEEN_USED.getCode(),EpmetErrorCode.THE_MOBILE_HAS_BEEN_USED.getMsg()); - } - + //更新该用户在该客户下的注册状态 + userCustomerDao.updateRegistered(userResiInfoDTO.getCustomerId(), userResiInfoDTO.getUserId()); return result; } @@ -382,6 +401,20 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl18){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "user_resi_info已存在该身份证号", "身份证号至多18位"); + } + //判断身份证号唯一,除了当前用户外没有人用过这个身份证号吧??? + if(baseDao.selectCountByIdNum(formDTO.getIdNum(),formDTO.getCustomerId(),formDTO.getUserId())>0){ + throw new EpmetException(EpmetErrorCode.IDCARDNO_ALREADY_EXITS.getCode(), "user_resi_info已存在该身份证号", EpmetErrorCode.IDCARDNO_ALREADY_EXITS.getMsg()); + } + //判断user_base_info表是否存在相同的身份证号 + if (userBaseInfoService.checkIdNum(formDTO.getIdNum(), formDTO.getCustomerId(), formDTO.getUserId()) > 0) { + throw new EpmetException(EpmetErrorCode.IDCARDNO_ALREADY_EXITS.getCode(), "user_base_info已存在该身份证号", EpmetErrorCode.IDCARDNO_ALREADY_EXITS.getMsg()); + } + }*/ //更新居民注册信息表 baseDao.updateByUserId(ConvertUtils.sourceToTarget(formDTO, UserResiInfoEntity.class)); //更新baseInfo diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java index 6c56b705a8..697fda9582 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java @@ -2,16 +2,18 @@ package com.epmet.service.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; 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.exception.RenException; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.CpUserDetailRedis; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.UserConstant; -import com.epmet.dao.*; -import com.epmet.dto.CustomerGridDTO; -import com.epmet.dto.UserDTO; -import com.epmet.dto.UserResiInfoDTO; -import com.epmet.dto.UserWechatDTO; +import com.epmet.dao.UserDao; +import com.epmet.dao.UserResiInfoDao; +import com.epmet.dao.UserRoleDao; +import com.epmet.dao.UserWechatDao; +import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.UserBaseInfoEntity; @@ -19,16 +21,21 @@ import com.epmet.entity.UserEntity; import com.epmet.entity.UserWechatEntity; import com.epmet.feign.EpmetPointOpenFeignClient; import com.epmet.feign.GovOrgFeignClient; +import com.epmet.service.IcResiUserService; import com.epmet.service.UserBaseInfoService; import com.epmet.service.UserService; import com.epmet.util.ModuleConstant; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; /** @@ -53,7 +60,8 @@ public class UserServiceImpl extends BaseServiceImpl implem private EpmetPointOpenFeignClient epmetPointOpenFeignClient; @Autowired private UserResiInfoDao userResiInfoDao; - + @Autowired + private IcResiUserService icResiUserService; private static final Logger log = LoggerFactory.getLogger(UserServiceImpl.class); @@ -183,6 +191,8 @@ public class UserServiceImpl extends BaseServiceImpl implem MyResiUserInfoResultDTO result = ConvertUtils.sourceToTarget(myselfMsg,MyResiUserInfoResultDTO.class); //registerFlag 是否已注册居民,true ,false result.setRegisterFlag(StringUtils.isNotBlank(myselfMsg.getResiId())); + // 已录入身份证号:true;未完善:false. + result.setCompleteIdNum(StringUtils.isNotBlank(myselfMsg.getIdNum())); result.setRegisterGridName(ModuleConstant.EMPTY_STR); if(StringUtils.isNotBlank(myselfMsg.getGridId())){ //registerGridName 当前在哪个网格,显示哪个网格的名称 @@ -342,4 +352,37 @@ public class UserServiceImpl extends BaseServiceImpl implem return baseDao.selectByUserId(userId); } + /** + * 根据身份证号||ic_resi_user.id找居民端小程序里的人 + * + * @param formDTO + * @return + */ + @Override + public ResiUserResDTO findEpmetUser(ResiUserFormDTO formDTO) { + if (StringUtils.isBlank(formDTO.getIdNum()) && StringUtils.isBlank(formDTO.getIcResiUserId())) { + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "身份证号、icResiUserId至少输入一个", "至少选择一种查询方式"); + } + //可以根据身份证号查询,也可以根据epmet_user.user.id查询 + if (StringUtils.isNotBlank(formDTO.getIcResiUserId()) && StringUtils.isBlank(formDTO.getIdNum())) { + IcResiUserDTO icResiUserDTO = icResiUserService.getByIdCard(formDTO.getCustomerId(), null, formDTO.getIcResiUserId()); + if (null == icResiUserDTO) { + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "根据ic_resi_user.id没有找到记录id=" + formDTO.getIcResiUserId(), "至少选择一种查询方式"); + } + formDTO.setIdNum(icResiUserDTO.getIdCard()); + } + ResiUserResDTO resiUserResDTO = ConvertUtils.sourceToTarget(formDTO, ResiUserResDTO.class); + if (StringUtils.isNotBlank(formDTO.getIdNum())) { + List userBaseInfoList = userBaseInfoService.getCommonIdNumUser(formDTO.getCustomerId(),formDTO.getIdNum()); + if (CollectionUtils.isEmpty(userBaseInfoList)) { + log.info("user_base_info没有找到,去查下user_resi_info表吧"); + List userResiInfoDTO = userResiInfoDao.selectCommonIdNumUser(formDTO.getCustomerId(),formDTO.getIdNum()); + resiUserResDTO.setEpmetUserIdList(CollectionUtils.isNotEmpty(userResiInfoDTO) ? userResiInfoDTO.stream().map(UserResiInfoDTO::getUserId).collect(Collectors.toList()): new ArrayList<>()); + } else { + resiUserResDTO.setEpmetUserIdList(userBaseInfoList.stream().map(UserBaseInfoDTO::getUserId).collect(Collectors.toList())); + } + } + return resiUserResDTO; + } + } diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.19__user_resi_infoaddidnum.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.19__user_resi_infoaddidnum.sql new file mode 100644 index 0000000000..535da1b138 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.19__user_resi_infoaddidnum.sql @@ -0,0 +1 @@ +alter table user_resi_info add COLUMN ID_NUM VARCHAR(32) COMMENT '身份证号,1206新增' AFTER NAME; diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml index 4448cb0566..37c1b545c0 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml @@ -426,4 +426,30 @@ and sr.STAFF_ID=#{userId} ) + + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index 5f23694620..e7c9de9224 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -284,4 +284,44 @@ AND customer_id = #{customerId} AND id_card = #{idCard} + + + + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml index 8c664e678e..ae0fbc5486 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml @@ -120,4 +120,27 @@ WHERE DEL_FLAG = '0' AND USER_ID = #{userId} + + + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserDao.xml index bbdaf024ba..6d82e4c200 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserDao.xml @@ -34,7 +34,8 @@ IFNULL(wechat.NICKNAME,"") AS nickName, IFNULL(resi.ID,"") AS resiId, IFNULL(CONCAT(resi.SURNAME,resi.NAME),"") AS userRealName, - IFNULL(relation.GRID_ID,"") AS gridId + IFNULL(relation.GRID_ID,"") AS gridId, + IFNULL(resi.id_num,'')AS idNum FROM USER user LEFT JOIN diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml index fb360d3a39..93cb1fc7a4 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml @@ -43,7 +43,8 @@ NAME = #{name}, STREET = #{street}, DISTRICT = #{district}, - BUILDING_ADDRESS = #{buildingAddress} + BUILDING_ADDRESS = #{buildingAddress}, + ID_NUM = #{idNum} where USER_ID = #{userId} and DEL_FLAG = '0' @@ -175,4 +176,29 @@ uri.DEL_FLAG = '0' AND uri.USER_ID = #{userId} + + + +