diff --git a/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.9__add_data_type.sql b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.9__add_data_type.sql new file mode 100644 index 0000000000..d4aebf1828 --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.9__add_data_type.sql @@ -0,0 +1,10 @@ +INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1000000000000000012', 'grid_type', '网格类型', '', 12, 0, 0, '', '2021-12-23 18:23:27', '', '2021-12-23 18:23:27'); + +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1000000000000000300', 1000000000000000012, '党政机关', '0', '0', '', 0, 0, 0, '', '2021-12-23 18:39:18', '', '2021-12-23 18:39:18'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1000000000000000301', 1000000000000000012, '企业', '1', '0', '', 0, 0, 0, '', '2021-12-23 18:39:18', '', '2021-12-23 18:39:18'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1000000000000000302', 1000000000000000012, '园区', '2', '0', '', 4, 0, 0, '', '2021-12-23 18:39:18', '', '2021-12-23 18:39:18'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1000000000000000303', 1000000000000000012, '商圈', '3', '0', '', 4, 0, 0, '', '2021-12-23 18:39:18', '', '2021-12-23 18:39:18'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1000000000000000304', 1000000000000000012, '市场', '4', '0', '', 4, 0, 0, '', '2021-12-23 18:39:18', '', '2021-12-23 18:39:18'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1000000000000000305', 1000000000000000012, '景区', '5', '0', '', 4, 0, 0, '', '2021-12-23 18:39:18', '', '2021-12-23 18:39:18'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1000000000000000306', 1000000000000000012, '医院', '6', '0', '', 4, 0, 0, '', '2021-12-23 18:39:18', '', '2021-12-23 18:39:18'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1000000000000000307', 1000000000000000012, '学校', '7', '0', '', 4, 0, 0, '', '2021-12-23 18:39:18', '', '2021-12-23 18:39:18'); diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/handler/FieldMetaObjectHandler.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/handler/FieldMetaObjectHandler.java index e4dde4f2fa..3c0b35ff4d 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/handler/FieldMetaObjectHandler.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/handler/FieldMetaObjectHandler.java @@ -147,10 +147,12 @@ public class FieldMetaObjectHandler implements MetaObjectHandler { updatedTime = metaObject.getValue(FieldConstant.UPDATED_TIME_HUMP); } if (updatedTime == null) { - if(metaObject.hasGetter(FieldConstant.CREATED_TIME_HUMP)) + if(metaObject.hasGetter(FieldConstant.CREATED_TIME_HUMP)) { updatedTime = metaObject.getValue(FieldConstant.CREATED_TIME_HUMP); - if(updatedTime == null) + } + if(updatedTime == null) { updatedTime = new Date(); + } } return updatedTime; } @@ -163,11 +165,13 @@ public class FieldMetaObjectHandler implements MetaObjectHandler { } if (value == null) { - if(metaObject.hasGetter(FieldConstant.CREATED_BY_HUMP)) + if(metaObject.hasGetter(FieldConstant.CREATED_BY_HUMP)) { value = metaObject.getValue(FieldConstant.CREATED_BY_HUMP); + } - if(null == value) + if(null == value) { value = Optional.ofNullable(loginUserUtil.getLoginUserId()).orElse(Constant.APP_USER_FLAG); + } } return value; 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 400eca1d51..9bbd564ea2 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 @@ -41,10 +41,24 @@ public interface ConsomerGroupConstants { */ String PROJECT_OPERATION_LOG_GROUP = "project_operation_log_group"; /** - * 积分操作消费组 + * 积分操作日志消费组 */ String POINT_OPERATION_LOG_GROUP = "point_operation_log_group"; + /** + * 爱心互助积分操作消费组 + */ + String EPMET_HEART_POINT_OPERATION_GROUP = "epmet_heart_point_operation_group"; + /** + * 楼院小组积分操作消费组 + */ + String RESI_GROUP_POINT_OPERATION_GROUP = "resi_group_point_operation_group"; + + /** + * 社区服务(原居民需求)积分操作消费组 + */ + String COMMUNITY_SERVICE_POINT_OPERATION_GROUP = "community_service_point_operation_group"; + /** * 开放的对接数据(中间库) 组织变更事件监听器分组 */ @@ -73,5 +87,5 @@ public interface ConsomerGroupConstants { /** * 需求完成,如果服务方是区域化党建单位,重新计算这个单位的满意度 */ - String CAL_PARTY_UNIT_SATISFACTION = "cal_party_unit_satisfaction"; + String USER_DEMAND_FINISH_GROUP = "user_demand_finish_group"; } 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 e11400fef3..f4c2d45e89 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 @@ -55,7 +55,23 @@ public interface TopicConstants { String IC_RESI_USER = "ic_resi_user"; /** - * 需求完成,如果服务方是区域化党建单位,重新计算这个单位的满意度 + * 需求完成 + * 1、如果服务方是区域化党建单位,重新计算这个单位的满意度 */ - String CAL_PARTY_UNIT_SATISFACTION = "cal_party_unit_satisfaction"; + String USER_DEMAND = "user_demand"; + + /** + * 爱心互助 + */ + String EPMET_HEART = "epmet_heart"; + + /** + * 楼院小组 + */ + String RESI_GROUP = "resi_group"; + + /** + * 社区服务,原居民需求 + */ + String COMMUNITY_SERVICE="community_service"; } 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 deleted file mode 100644 index bfaf63703a..0000000000 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CalPartyUnitSatisfactionFormDTO.java +++ /dev/null @@ -1,19 +0,0 @@ -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-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/ServerSatisfactionCalFormDTO.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/ServerSatisfactionCalFormDTO.java new file mode 100644 index 0000000000..998d1523cb --- /dev/null +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/ServerSatisfactionCalFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.commons.rocketmq.messages; + + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 需求完成,如果服务方是区域化党建单位,重新计算这个单位的满意度,或者直接计算整个客户 + */ +@Data +public class ServerSatisfactionCalFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + @NotBlank(message = "客户id不能为空",groups = AddUserInternalGroup.class) + private String customerId; + /** + * 服务方id:可以值区域化党建单位id + * 后面也可以是社会组织、社区自组织id... + */ + private String serverId; + /** + * 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + */ + @NotBlank(message = "serviceType不能为空",groups = AddUserInternalGroup.class) + private String serviceType; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/MqConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/MqConstant.java index 8ccaba98b4..8d458c4a60 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/MqConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/MqConstant.java @@ -17,4 +17,6 @@ public interface MqConstant { * 减分标识 minus */ String MINUS="minus"; + + String SOURCE_TYPE_DEMAND="demand"; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/BasePointEventMsg.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/BasePointEventMsg.java index 9235fe77a7..ff2849d331 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/BasePointEventMsg.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/BasePointEventMsg.java @@ -92,4 +92,6 @@ public class BasePointEventMsg implements Serializable { private String eventTag; private String eventClass; + private String objectId; + private String eventName; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java index 39f80d7910..7afc85aab1 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java @@ -21,6 +21,7 @@ public enum DictTypeEnum { USER_DEMAND_SERVICE_TYPE("user_demand_service_type","居民需求服务方类型",10), AGE_GROUP("age_group", "年龄范围", 11), PATROL_WORK_TYPE("patrol_work_type", "例行工作分类", 13), + GRID_TYPE("grid_type", "网格类型", 12), ; private final String code; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java index 44d229ec3b..3cccd74d7a 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java @@ -18,6 +18,7 @@ public enum EventEnum { SHIFT_TOPIC_TO_ISSUE("shift_topic_to_issue","resi_group","转话题为议题(将自建小组中话题转为议题)"), TOPIC_SHIFTED_TO_PROJECT("topic_to_project","resi_group","话题被转为项目"), LEADER_RESOLVE_TOPIC("leader_resolve_topic","resi_group","组长解决组内话题"), + FINISH_USER_DEMAND("finish_user_demand","community_service","服务完成"), ; private String eventClass; 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 0f70c9ecbd..47079e14a8 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,14 +85,6 @@ 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, "请求第三方平台错误"), @@ -121,6 +113,7 @@ public enum EpmetErrorCode { CAN_NOT_REPLY_RESI_EVENT_SELF(8606,"当前事件待处理,不可回复"), RESI_EVENT_CAN_NOT_CLOSE_CASE(8607,"事件尚未处理,请处理完成后进行办结"), RESI_EVENT_SHIFT_PROJECT(8608,"事件已立项,请勿重复操作"), + RESI_EVENT_SUBMIT(8616,"事件内容和语音不能同时为空"), PLEASE_CHOOSE_RECEIVER(8609,"请选择接收人"), REPLY_INFO_CONTENT_NOT_NULL(8610,"回复内容不能为空"), diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java index 1de1fce475..32cba063c5 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java @@ -193,7 +193,9 @@ public class RedisUtils { public List lrange(String key,long start,long end,Class clazz){ List content = redisTemplate.opsForList().range(key,start,end); - if(CollectionUtils.isEmpty(content)) return null; + if(CollectionUtils.isEmpty(content)) { + return null; + } return content.stream().map( o -> { try { T target = clazz.newInstance(); @@ -314,7 +316,9 @@ public class RedisUtils { **/ public Map hincrby(String key,String field,Long delta){ Map existed = hGetAll(key); - if(null == existed || existed.size() < NumConstant.ONE) return null; + if(null == existed || existed.size() < NumConstant.ONE) { + return null; + } //hincrby redisTemplate.opsForHash().increment(key,field,delta); @@ -367,7 +371,9 @@ public class RedisUtils { public Set zReverseRange(String key, long start, long end, Class clazz) { Set objects = redisTemplate.opsForZSet().reverseRange(key, start, end); - if(CollectionUtils.isEmpty(objects)) return null; + if(CollectionUtils.isEmpty(objects)) { + return null; + } return objects.stream().map(o->{ try { T target = clazz.newInstance(); diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java index eeac282cd8..048745cfb6 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java @@ -200,8 +200,9 @@ public class HttpClientManager { httppost.addHeader(HEADER_CONTENT_TYPE, HEADER_APPLICATION_JSON); if (null != headerMap) { headerMap.forEach((k, v) -> { - if (v != null) + if (v != null) { httppost.addHeader(k, v.toString()); + } }); } if (StringUtils.isNotEmpty(jsonStrParam)) { diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IpUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IpUtils.java index b53ed5e4ea..495565e33c 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IpUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IpUtils.java @@ -141,8 +141,9 @@ public class IpUtils { } private static boolean isValidAddress(InetAddress address) { - if (address == null || address.isLoopbackAddress()) - return false; + if (address == null || address.isLoopbackAddress()) { + return false; + } String name = address.getHostAddress(); return (name != null && !ANYHOST.equals(name) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/Md5Util.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/Md5Util.java index 9f4426d728..0d22d230a0 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/Md5Util.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/Md5Util.java @@ -55,16 +55,18 @@ public class Md5Util { private static String byteArrayToHexString(byte[] b) { StringBuffer resultSb = new StringBuffer(); - for (int i = 0; i < b.length; i++) - resultSb.append(byteToHexString(b[i])); + for (int i = 0; i < b.length; i++) { + resultSb.append(byteToHexString(b[i])); + } return resultSb.toString(); } private static String byteToHexString(byte b) { int n = b; - if (n < 0) - n += 256; + if (n < 0) { + n += 256; + } int d1 = n / 16; int d2 = n % 16; return hexDigits[d1] + "" + hexDigits[d2]; @@ -75,12 +77,13 @@ public class Md5Util { try { resultString = origin; MessageDigest md = MessageDigest.getInstance("MD5"); - if (charsetname == null || "".equals(charsetname)) - resultString = byteArrayToHexString(md.digest(resultString - .getBytes())); - else - resultString = byteArrayToHexString(md.digest(resultString - .getBytes(charsetname))); + if (charsetname == null || "".equals(charsetname)) { + resultString = byteArrayToHexString(md.digest(resultString + .getBytes())); + } else { + resultString = byteArrayToHexString(md.digest(resultString + .getBytes(charsetname))); + } } catch (Exception e) { log.error("MD5Encode is error,msg={0}", e); } 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 7c343c5ccc..70c25c839c 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 @@ -157,4 +157,19 @@ public class CustomerAgencyDTO implements Serializable { * 中心位置纬度 */ private String latitude; + + /** + * 组织编码 + */ + private String code; + + /** + * 负责人姓名 + */ + private String contacts; + + /** + * 联系电话 + */ + private String mobile; } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerDepartmentDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerDepartmentDTO.java index ca02fda8bf..096e24acad 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerDepartmentDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerDepartmentDTO.java @@ -94,4 +94,19 @@ public class CustomerDepartmentDTO implements Serializable { */ private Date updatedTime; + /** + * 组织编码 + */ + private String code; + + /** + * 负责人姓名 + */ + private String contacts; + + /** + * 联系电话 + */ + private String mobile; + } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerGridDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerGridDTO.java index fcb6d13250..cacdf2e849 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerGridDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerGridDTO.java @@ -133,4 +133,24 @@ public class CustomerGridDTO implements Serializable { * 组织-网格 */ private String gridNamePath; + + /** + * 网格编码 + */ + private String code; + + /** + * 组织编码 + */ + private String gridType; + + /** + * 负责人姓名 + */ + private String contacts; + + /** + * 联系电话 + */ + private String mobile; } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerAgencyEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerAgencyEntity.java index 6c6420ffc8..171e01198f 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerAgencyEntity.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerAgencyEntity.java @@ -108,4 +108,19 @@ public class CustomerAgencyEntity extends BaseEpmetEntity { * 社区 */ private String community; + + /** + * 组织编码 + */ + private String code; + + /** + * 负责人姓名 + */ + private String contacts; + + /** + * 联系电话 + */ + private String mobile; } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerDepartmentEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerDepartmentEntity.java index 74d4ceddc9..dc9e882e05 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerDepartmentEntity.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerDepartmentEntity.java @@ -64,4 +64,19 @@ public class CustomerDepartmentEntity extends BaseEpmetEntity { * 部门所属的行政地区编码:实际就是所属组织的地区编码 */ private String areaCode; + + /** + * 组织编码 + */ + private String code; + + /** + * 负责人姓名 + */ + private String contacts; + + /** + * 联系电话 + */ + private String mobile; } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerGridEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerGridEntity.java index 60e35afefa..c58ce50893 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerGridEntity.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerGridEntity.java @@ -79,4 +79,24 @@ public class CustomerGridEntity extends BaseEpmetEntity { * 所有上级组织ID */ private String pids; + + /** + * 网格编码 + */ + private String code; + + /** + * 组织编码 + */ + private String gridType; + + /** + * 负责人姓名 + */ + private String contacts; + + /** + * 联系电话 + */ + private String mobile; } 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 ee8caafc3e..d2c47a0922 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 @@ -27,25 +27,12 @@ ca.level, ca.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 + IFNULL(ca.longitude, cc.longitude) longitude, + IFNULL(ca.latitude, cc.latitude) latitude FROM customer_staff_agency csa INNER JOIN customer_agency ca ON csa.agency_id = ca.id + INNER JOIN customer_agency cc ON cc.pid = '0' AND ca.customer_id = cc.customer_id WHERE csa.del_flag = '0' AND ca.del_flag = '0' diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/heart/VolunteerDemandServiceFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/heart/VolunteerDemandServiceFormDTO.java new file mode 100644 index 0000000000..4a661bebb4 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/heart/VolunteerDemandServiceFormDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.form.heart; + +import lombok.Data; + +/** + * @Description + * @Author wangxianzhang + * @Date 2021/12/22 3:12 下午 + * @Version 1.0 + */ +@Data +public class VolunteerDemandServiceFormDTO { + + /** + * 组织ID + */ + private String agencyId; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/heart/DataReportHeartDemandController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/heart/DataReportHeartDemandController.java index 86eabe2b3c..d1de1db852 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/heart/DataReportHeartDemandController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/heart/DataReportHeartDemandController.java @@ -3,10 +3,13 @@ package com.epmet.datareport.controller.heart; 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.datareport.service.heart.DemandService; +import com.epmet.dto.form.heart.VolunteerDemandServiceFormDTO; import com.epmet.dto.result.heart.VolunteerDemandServiceStatsResultDTO; 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; @@ -29,9 +32,14 @@ public class DataReportHeartDemandController { * @return */ @PostMapping("volunteer/service") - public Result getVolunteerServiceStats(@LoginUser TokenDto loginUser) { + public Result getVolunteerServiceStats(@LoginUser TokenDto loginUser, @RequestBody VolunteerDemandServiceFormDTO input) { + + ValidatorUtils.validateEntity(input); + + String agencyId = input.getAgencyId(); String customerId = loginUser.getCustomerId(); - VolunteerDemandServiceStatsResultDTO r = demandService.getVolunteerServiceStats(customerId); + + VolunteerDemandServiceStatsResultDTO r = demandService.getVolunteerServiceStats(customerId, agencyId); return new Result().ok(r); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactVolunteerServiceDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactVolunteerServiceDailyDao.java index fd4d28afb0..6589571c66 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactVolunteerServiceDailyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactVolunteerServiceDailyDao.java @@ -36,8 +36,9 @@ public interface FactVolunteerServiceDailyDao extends BaseDao(); + if(null == result) { + return new ArrayList<>(); + } return result; } @@ -404,7 +406,9 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { private String convertPercentStr(BigDecimal percent,Integer digits){ - if(null == percent) percent = BigDecimal.ZERO; + if(null == percent) { + percent = BigDecimal.ZERO; + } String percentStr = percent.setScale(digits, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString(); return percentStr.concat(ModuleConstant.SYMBOL_PERCENT); } @@ -418,7 +422,9 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { */ private ScreenCustomerAgencyDTO agencyInfo(String agencyId){ ScreenCustomerAgencyDTO agencyInfo = agencyDao.selectByAgencyId(agencyId); - if(null == agencyInfo) throw new RenException("获取Agency信息失败"); + if(null == agencyInfo) { + throw new RenException("获取Agency信息失败"); + } return agencyInfo; } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java index 3173e1269e..cc99586d88 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java @@ -249,7 +249,9 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService if(StringUtils.isBlank(param.getMonthId())){ param.setMonthId(dateUtils.getCurrentMonthId()); } - if(NumConstant.ZERO == param.getTopNum()) param.setTopNum(NumConstant.MAX); + if(NumConstant.ZERO == param.getTopNum()) { + param.setTopNum(NumConstant.MAX); + } PageHelper.startPage(NumConstant.ONE,param.getTopNum()); List orderList = screenPartyBranchDataDao.selectBranchDataByTypeOrder(param.getAgencyId(),param.getCategory(),param.getMonthId(),param.getBottomMonthId()); @@ -278,7 +280,9 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService private String convertPercentStr(BigDecimal percent){ - if (null == percent || BigDecimal.ZERO.equals(percent)) return "0.00%"; + if (null == percent || BigDecimal.ZERO.equals(percent)) { + return "0.00%"; + } String percentStr = percent.setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString(); return percentStr.concat(ModuleConstant.SYMBOL_PERCENT); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java index 948b543080..b69407cc04 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java @@ -171,7 +171,9 @@ public class IndexServiceImpl implements IndexService { //针对X轴,数据集合不全则进行数据填充 a:for(int i = NumConstant.ZERO; i < _ymList.size(); i++){ //这里的collect必须是有序且升序的 - if(cursor >= collect.size()) break a; + if(cursor >= collect.size()) { + break a; + } //如果存在过期数据,即从数据库中查询出超出横坐标左边界的月份值 if(Integer.parseInt(collect.get(cursor).getMonthId()) < Integer.parseInt(_ymList.get(NumConstant.ZERO))) { //控制当前循环重复进行 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java index a5ce203e96..5fcb834b5f 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java @@ -276,7 +276,9 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { PageHelper.startPage(NumConstant.ONE,param.getTopNum()); gridData = screenOrgRankDataDao.selectGridDataMonthlyAreaCode(monthId,param.getAreaCode()); } - if(null == gridData || gridData.isEmpty()) return result; + if(null == gridData || gridData.isEmpty()) { + return result; + } int num=1; for(OrgRankDataResultDTO data:gridData){ AdvanceBranchRankResultDTO o = ConvertUtils.sourceToTarget(data,AdvanceBranchRankResultDTO.class); @@ -297,7 +299,9 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { PageHelper.startPage(NumConstant.ONE,param.getTopNum()); gridData = screenOrgRankDataDao.selectGridDataMonthly(param.getAgencyId(),monthId); } - if(null == gridData || gridData.isEmpty()) return result; + if(null == gridData || gridData.isEmpty()) { + return result; + } int num=1; for(OrgRankDataResultDTO data:gridData){ AdvanceBranchRankResultDTO o = ConvertUtils.sourceToTarget(data,AdvanceBranchRankResultDTO.class); @@ -323,7 +327,9 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public List advancedPartymemberRank(AgencyAndNumFormDTO param) { - if(null == param.getTopNum()) param.setTopNum(NumConstant.TEN); + if(null == param.getTopNum()) { + param.setTopNum(NumConstant.TEN); + } PageHelper.startPage(NumConstant.ONE,param.getTopNum()); List result=new ArrayList<>(); if(StringUtils.isNotBlank(param.getAreaCode())){ @@ -332,13 +338,17 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { }else{ result=screenPartyUserRankDataDao.selectPartymemberPointOrder(param.getAgencyId()); } - if(null == result) return new ArrayList<>(); + if(null == result) { + return new ArrayList<>(); + } return result; } private String convertPercentStr(BigDecimal percent){ - if (null == percent || BigDecimal.ZERO.equals(percent)) return "0.0%"; + if (null == percent || BigDecimal.ZERO.equals(percent)) { + return "0.0%"; + } String percentStr = percent.setScale(NumConstant.ONE, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString(); return percentStr.concat(ModuleConstant.SYMBOL_PERCENT); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/heart/DemandService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/heart/DemandService.java index ccbbb319a1..cae8e5bf94 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/heart/DemandService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/heart/DemandService.java @@ -9,5 +9,5 @@ import com.epmet.dto.result.heart.VolunteerDemandServiceStatsResultDTO; * @Version 1.0 */ public interface DemandService { - VolunteerDemandServiceStatsResultDTO getVolunteerServiceStats(String customerId); + VolunteerDemandServiceStatsResultDTO getVolunteerServiceStats(String customerId, String agencyId); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/heart/impl/DemandServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/heart/impl/DemandServiceImpl.java index 79ba0274ea..7a2e2f5ec3 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/heart/impl/DemandServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/heart/impl/DemandServiceImpl.java @@ -1,12 +1,14 @@ package com.epmet.datareport.service.heart.impl; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.epmet.commons.dynamic.datasource.annotation.DataSource; -import com.epmet.constant.DataSourceConstant; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.datareport.dao.fact.FactVolunteerServiceDailyDao; -import com.epmet.datareport.entity.heart.FactVolunteerServiceDailyEntity; import com.epmet.datareport.service.heart.DemandService; +import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.result.heart.VolunteerDemandServiceStatsResultDTO; +import com.epmet.feign.GovOrgOpenFeignClient; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -17,13 +19,41 @@ import org.springframework.stereotype.Service; * @Version 1.0 */ @Service -public class DemandServiceImpl implements DemandService { +public class DemandServiceImpl implements DemandService, ResultDataResolver { @Autowired private FactVolunteerServiceDailyDao factVolunteerServiceDailyDao; + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Override - public VolunteerDemandServiceStatsResultDTO getVolunteerServiceStats(String customerId) { - return factVolunteerServiceDailyDao.getLatestVolunteerDemandServiceStats(customerId); + public VolunteerDemandServiceStatsResultDTO getVolunteerServiceStats(String customerId, String agencyId) { + + String errorMsg = "【查询志愿者需求服务信息】查询选中组织信息失败"; + CustomerAgencyDTO agencyInfo = getResultDataOrThrowsException(govOrgOpenFeignClient.getAgencyById(agencyId), + ServiceConstant.GOV_ORG_SERVER, + EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), + errorMsg, errorMsg); + + if (agencyInfo == null) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); + } + + String agencyIdPath = agencyInfo.getPids().concat(":").concat(agencyId); + agencyIdPath = agencyIdPath.startsWith(":") ? agencyIdPath.replaceFirst(":", "") : agencyIdPath; + VolunteerDemandServiceStatsResultDTO r = factVolunteerServiceDailyDao.getLatestVolunteerDemandServiceStats(customerId, agencyIdPath); + if (r == null) { + r = new VolunteerDemandServiceStatsResultDTO(); + r.setCustomerId(customerId); + r.setDateId(null); + r.setPartyServiceTotal(0); + r.setServiceTotal(0); + r.setResiServiceTotal(0); + r.setVolunteerTotal(0); + r.setPartyTotal(0); + r.setResiTotal(0); + } + return r; } } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java index 55e0d3c7c0..69248da197 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java @@ -337,7 +337,9 @@ public class ProjectServiceImpl implements ProjectService { } } - if (null == resultList) return new ArrayList<>(); + if (null == resultList) { + return new ArrayList<>(); + } return resultList; } @@ -360,7 +362,9 @@ public class ProjectServiceImpl implements ProjectService { result.get(i).setImgUrlList(imgUrlList); } - if (null == result) return new ArrayList<>(); + if (null == result) { + return new ArrayList<>(); + } return result; } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactVolunteerServiceDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactVolunteerServiceDailyDao.xml index fbe645deb3..67e940e2a9 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactVolunteerServiceDailyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactVolunteerServiceDailyDao.xml @@ -24,12 +24,21 @@ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/IcUserDemandServiceDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/IcUserDemandServiceDao.java index 165ae6b91c..02fc225940 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/IcUserDemandServiceDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/IcUserDemandServiceDao.java @@ -40,5 +40,5 @@ public interface IcUserDemandServiceDao extends BaseDao listDemandServeTimes(@Param("customerId") String customerId, @Param("endTime") Date endTime, @Param("serviceType") String serviceType); + List listDemandServeTimes(@Param("customerId") String customerId, @Param("gridId") String gridId, @Param("endTime") Date endTime, @Param("serviceType") String serviceType); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactVolunteerServiceDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactVolunteerServiceDailyEntity.java index f2b473bfe9..82687aeba0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactVolunteerServiceDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactVolunteerServiceDailyEntity.java @@ -43,6 +43,11 @@ public class FactVolunteerServiceDailyEntity extends BaseEpmetEntity { */ private String customerId; + /** + * 网格ID + */ + private String gridId; + /** * yyyyMMdd */ @@ -82,5 +87,9 @@ public class FactVolunteerServiceDailyEntity extends BaseEpmetEntity { * 居民服务总次数 */ private Integer resiServiceTotal; + + private String pid; + + private String pids; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/ParseIndexExcelResult.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/ParseIndexExcelResult.java index 17b4fa0634..0c21d759ba 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/ParseIndexExcelResult.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/ParseIndexExcelResult.java @@ -39,8 +39,12 @@ public class ParseIndexExcelResult implements Serializable { @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } ParseIndexExcelResult that = (ParseIndexExcelResult) o; return indexCode.equals(that.indexCode) && indexName.equals(that.indexName) && diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java index 209588d464..c834b74437 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java @@ -98,7 +98,9 @@ public class GroupExtractServiceImpl implements GroupExtractService { for(Iterator iter = originGroupData.iterator(); iter.hasNext();){ FactOriginGroupMainDailyDTO pointer = iter.next(); - if(null == gridMap.get(pointer.getGridId()))iter.remove(); + if(null == gridMap.get(pointer.getGridId())) { + iter.remove(); + } } //记录全量中的垃圾数 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java index 73507e7c54..164387d70b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java @@ -513,7 +513,9 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { public void projectProcessCostTimeDataCompensation() { List customers = dimCustomerService.getAllCustomerId(); - if(CollectionUtils.isEmpty(customers)) return ; + if(CollectionUtils.isEmpty(customers)) { + return ; + } customers.forEach(local -> { // projectProcessService.getProjectPeriod(true, local,null); }); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java index 3fd804ec7a..d1e449b4a0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java @@ -218,7 +218,9 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { return false; } customerIds = externalCustomerIds.getData(); - }else customerIds.add(formDTO.getCustomerId()); + }else { + customerIds.add(formDTO.getCustomerId()); + } List monthIds = new ArrayList<>(); if (StringUtils.isNotEmpty(formDTO.getStartMonth()) && StringUtils.isNotEmpty(formDTO.getEndMonth())){ monthIds = DateUtils.getMonthBetween(formDTO.getStartMonth(),formDTO.getEndMonth()); @@ -227,7 +229,9 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { if (StringUtils.isEmpty(formDTO.getMonthId())){ // 默认上月 monthIds.add(DimIdGenerator.getMonthDimId(DateUtils.addDateMonths(new Date(), -1))); - }else monthIds.add(formDTO.getMonthId()); + }else { + monthIds.add(formDTO.getMonthId()); + } } List finalMonthIds = monthIds; customerIds.forEach(customerId -> { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java index f263b332fc..f8f1d50d8b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java @@ -47,7 +47,9 @@ public class ScreenDifficultyDataServiceImpl extends BaseServiceImpl selectExistedInfo(String customerId) { - if (baseDao.selectCountByCustomerId(customerId) > NumConstant.ZERO) return baseDao.selectClosedProjectId(customerId); + if (baseDao.selectCountByCustomerId(customerId) > NumConstant.ZERO) { + return baseDao.selectClosedProjectId(customerId); + } return null; } @@ -80,4 +82,4 @@ public class ScreenDifficultyDataServiceImpl extends BaseServiceImpl getAllDifficultyByCustomerId(String customerId) { return baseDao.selectAllDifficultyByCustomerId(customerId); } -} \ No newline at end of file +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/HeartDemandService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/HeartDemandService.java index baaa29c97b..981fd1fc2f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/HeartDemandService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/HeartDemandService.java @@ -11,5 +11,5 @@ import java.util.List; *@Date 2021/12/8 */ public interface HeartDemandService { - List listDemandServeTimesPage(String customerId, Date endTime, int serviceCountPageNo, int serviceCountPageSize); + List listDemandServeTimesPage(String customerId, String gridId, Date endTime, int serviceCountPageNo, int serviceCountPageSize); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartDemandServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartDemandServiceImpl.java index c33f426ad5..8969b61d31 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartDemandServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartDemandServiceImpl.java @@ -29,11 +29,11 @@ public class HeartDemandServiceImpl implements HeartDemandService { private IcUserDemandServiceDao demandServiceDao; @Override - public List listDemandServeTimesPage(String customerId, Date endTime, int serviceCountPageNo, int serviceCountPageSize) { + public List listDemandServeTimesPage(String customerId, String gridId, Date endTime, int serviceCountPageNo, int serviceCountPageSize) { return PageHelper.startPage(serviceCountPageNo, serviceCountPageSize).doSelectPage(new ISelect() { @Override public void doSelect() { - demandServiceDao.listDemandServeTimes(customerId, endTime, "volunteer"); + demandServiceDao.listDemandServeTimes(customerId, gridId, endTime, "volunteer"); } }); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DemandServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DemandServiceImpl.java index 66cbf1058d..036718bf0f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DemandServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DemandServiceImpl.java @@ -1,11 +1,16 @@ package com.epmet.service.impl; import com.epmet.commons.tools.constant.EpmetRoleKeyConstant; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dto.CustomerGridDTO; +import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.heart.result.DemandServiceCountResultDTO; -import com.epmet.entity.crm.CustomerEntity; import com.epmet.entity.heart.VolunteerInfoEntity; import com.epmet.entity.stats.FactVolunteerServiceDailyEntity; +import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.service.DemandService; import com.epmet.service.crm.CustomerService; import com.epmet.service.heart.HeartDemandService; @@ -27,7 +32,7 @@ import java.util.stream.Collectors; * @Version 1.0 */ @Service -public class DemandServiceImpl implements DemandService { +public class DemandServiceImpl implements DemandService, ResultDataResolver { @Autowired private HeartDemandService heartDemandService; @@ -37,12 +42,15 @@ public class DemandServiceImpl implements DemandService { @Autowired private UserService userService; - + @Autowired private DemandStatsService demandStatsService; - + @Autowired private CustomerService customerService; + + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; @Override public void statsVolunteerDemandServicesDaily(String customerId) { @@ -50,7 +58,7 @@ public class DemandServiceImpl implements DemandService { Date now = new Date(); Date today = DateUtils.integrate(now, "yyyy-MM-dd"); Date yestoday = DateUtils.addDateDays(today, -1); - + if (StringUtils.isNotBlank(customerId)) { // 只计算单个客户 clearOldDatas(Arrays.asList(customerId), yestoday); @@ -67,7 +75,8 @@ public class DemandServiceImpl implements DemandService { /** * 清理旧数据 - * @param targetDate 要清理哪天的数据 + * + * @param targetDate 要清理哪天的数据 * @param customerIds 要清理哪些客户的 */ private void clearOldDatas(List customerIds, Date targetDate) { @@ -80,12 +89,44 @@ public class DemandServiceImpl implements DemandService { /** * 统计单个客户的志愿者服务情况 + * * @param customerId 客户ID - * @param endTime 统计截止时间(> gridIdAndVolunteers = new HashMap<>(); + + heartVolunteerService.listVolunteers(customerId, endTime).forEach(v -> { + String volunteerGridId = v.getGridId(); + if (StringUtils.isNotBlank(volunteerGridId)) { + if (!gridIdAndVolunteers.containsKey(volunteerGridId)) { + gridIdAndVolunteers.put(volunteerGridId, new ArrayList<>()); + } + + gridIdAndVolunteers.get(volunteerGridId).add(v); + } + }); + + // 2.按网格分别统计,且持久化 + for (Map.Entry> entry : gridIdAndVolunteers.entrySet()) { + statsVolunteerDemandServicesDaily4Grid(customerId, entry.getKey(), endTime, entry.getValue(), belongTime); + } + } + + /** + * 按日统计网格需求服务数据 + * @param customerId + * @param gridId + * @param endTime 统计截止时间 + * @param volunteers 志愿者volunteerInfo列表 + * @param belongTime 该次统计要归属到哪一天,即createTime + * @return 统计结果entity,以备他用 + */ + private FactVolunteerServiceDailyEntity statsVolunteerDemandServicesDaily4Grid(String customerId, String gridId, Date endTime, List volunteers, Date belongTime) { // 1.志愿者分流为党员志愿者&普通居民志愿者 - Integer volunteerTotalCount = 0; + Integer volunteerTotalCount = volunteers.size(); // 党员志愿者数量 Integer partymemberVolunteerCount = 0; // 居民志愿者数量 @@ -94,15 +135,13 @@ public class DemandServiceImpl implements DemandService { // 党员志愿者用户id列表 List partymemberVolunteerUserIds = new ArrayList<>(16); - List volunteers = heartVolunteerService.listVolunteers(customerId, endTime); - - volunteerTotalCount = volunteers.size(); + //--------------------------------【以上是结果数据变量】------------------------------------------ // 分片开始下标 int shardingStartIndex = 0; // 分片大小(条数) int shardingSize = 100; - + // 分片去确定党员身份,防止in条件过大 while (true) { int realShardingSize = Math.min(shardingSize, volunteerTotalCount - shardingStartIndex); @@ -141,7 +180,7 @@ public class DemandServiceImpl implements DemandService { while (true) { // 取出每一个服务者的服务次数 - List damendServeTimes = heartDemandService.listDemandServeTimesPage(customerId, endTime, serviceCountPageNo, serviceCountPageSize); + List damendServeTimes = heartDemandService.listDemandServeTimesPage(customerId, gridId, endTime, serviceCountPageNo, serviceCountPageSize); for (DemandServiceCountResultDTO damendServiceTimes : damendServeTimes) { String serverId = damendServiceTimes.getServerId(); @@ -158,11 +197,12 @@ public class DemandServiceImpl implements DemandService { } totalDemandServeTimes = partymemberDemandServeTimes + resiDemandServeTimes; - - // 3.持久化 + + // 3.组装entity数据返回,待存储 FactVolunteerServiceDailyEntity insert = new FactVolunteerServiceDailyEntity(); insert.setDateId(DimIdGenerator.getDateDimId(belongTime)); insert.setCustomerId(customerId); + insert.setGridId(gridId); insert.setMonthId(DimIdGenerator.getMonthDimId(belongTime)); insert.setPartyServiceTotal(partymemberDemandServeTimes); insert.setServiceTotal(totalDemandServeTimes); @@ -171,6 +211,19 @@ public class DemandServiceImpl implements DemandService { insert.setResiTotal(resiVolunteerCount); insert.setVolunteerTotal(volunteerTotalCount); + CustomerGridFormDTO gridForm = new CustomerGridFormDTO(); + gridForm.setGridId(gridId); + String errorMsg = "【志愿者服务按日统计】查询网格基本信息失败"; + CustomerGridDTO gridInfo = getResultDataOrThrowsException(govOrgOpenFeignClient.getGridBaseInfoByGridId(gridForm), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); + + Optional.ofNullable(gridInfo).ifPresent(gi -> { + insert.setPid(gi.getPid()); + insert.setPids(gi.getPids()); + }); + + // 持久化 demandStatsService.addVolunteerServiceDaily(insert); + + return insert; } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java index 6844c930e9..9f1861df0f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java @@ -139,9 +139,13 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl list,String dateId,String customerId) { - if(CollectionUtils.isEmpty(list)) return; + if(CollectionUtils.isEmpty(list)) { + return; + } List closedInfo = baseDao.selectClosedProjectOnAppointedDay(customerId, dateId); - if(CollectionUtils.isEmpty(closedInfo)) return; + if(CollectionUtils.isEmpty(closedInfo)) { + return; + } list = list.stream().flatMap(target -> closedInfo.stream().filter(closedCase -> StringUtils.equals(closedCase.getProjectId(),target.getProjectId())).map( merge -> { @@ -161,9 +165,13 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl list) { - if(CollectionUtils.isEmpty(list)) return; + if(CollectionUtils.isEmpty(list)) { + return; + } List closedInfo = baseDao.selectClosedProjectByProjectIds(list.stream().map(ScreenProjectDataDTO::getProjectId).distinct().collect(Collectors.toList())); - if(CollectionUtils.isEmpty(closedInfo)) return; + if(CollectionUtils.isEmpty(closedInfo)) { + return; + } list = list.stream().flatMap(target -> closedInfo.stream().filter(closedCase -> StringUtils.equals(closedCase.getProjectId(),target.getProjectId())).map( merge -> { @@ -186,7 +194,9 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl buildNewScreenProjectProcessData(String customerId, String dateId, boolean ifRanged, String projectId) { List processes = baseDao.selectProjectProcessAndDirection(customerId, ifRanged ? null : dateId, dateId, projectId); - if(CollectionUtils.isEmpty(processes)) return null; + if(CollectionUtils.isEmpty(processes)) { + return null; + } return processes.stream().map(target -> { List points = target.getPoints(); if(!CollectionUtils.isEmpty(points)){ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java index a9664b82e7..ecdcda2e71 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java @@ -98,7 +98,9 @@ public class ProjectServiceImpl extends BaseServiceImpl> getProjectCategory(List projectIds) { - if(CollectionUtils.isEmpty(projectIds)) return null; + if(CollectionUtils.isEmpty(projectIds)) { + return null; + } List categories = baseDao.selectProjectCategory(projectIds); - if(CollectionUtils.isEmpty(categories)) return null; + if(CollectionUtils.isEmpty(categories)) { + return null; + } Map> map = new HashMap<>(); Map> projectMap = categories.stream().collect(Collectors.groupingBy(ProjectCategoryDTO::getProjectId)); projectMap.forEach((k,v) -> { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimTopicStatusServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimTopicStatusServiceImpl.java index 07c82cb9ce..13a15d27f4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimTopicStatusServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimTopicStatusServiceImpl.java @@ -66,7 +66,9 @@ public class DimTopicStatusServiceImpl extends BaseServiceImpl getWrapper(Map params){ String id = (String)params.get(FieldConstant.ID_HUMP); String delFlag = (String)params.get(FieldConstant.DEL_FLAG_HUMP); - if(StringUtils.isBlank(delFlag)) delFlag = NumConstant.ZERO_STR; + if(StringUtils.isBlank(delFlag)) { + delFlag = NumConstant.ZERO_STR; + } QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); @@ -101,4 +103,4 @@ public class DimTopicStatusServiceImpl extends BaseServiceImpl(); + if(null == result) { + result = new LinkedList<>(); + } } // 网格级别 List gridUserResult = diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/TopicStatisticalServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/TopicStatisticalServiceImpl.java index e70e4f7afe..d5c63b599c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/TopicStatisticalServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/TopicStatisticalServiceImpl.java @@ -52,7 +52,9 @@ public class TopicStatisticalServiceImpl implements TopicStatisticalService { @Override @Transactional(rollbackFor = Exception.class) public void insertUniquely(TopicStatisticalData data) { - if(null == data) return; + if(null == data) { + return; + } if(StringUtils.isBlank(data.getDateId()) || StringUtils.isBlank(data.getMonthId())){ logger.warn("缺失重要参数:dateId或monthId"); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java index 4aa8d924a6..cae99da457 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java @@ -149,9 +149,13 @@ public class TopicServiceImpl implements TopicService { */ @Override public Map> getTopicImgs(List list) { - if(CollectionUtils.isEmpty(list)) return Collections.EMPTY_MAP; + if(CollectionUtils.isEmpty(list)) { + return Collections.EMPTY_MAP; + } List imgs = topicDao.selectTopicImgs(list); - if(CollectionUtils.isEmpty(imgs)) return Collections.EMPTY_MAP; + if(CollectionUtils.isEmpty(imgs)) { + return Collections.EMPTY_MAP; + } //key -> topicId | value -> projectId Map projectTopicMap = list.stream().collect(Collectors.toMap(ProjectSourceMapFormDTO :: getSourceId,ProjectSourceMapFormDTO :: getProjectId,(o,n)->n)); //key -> topicId @@ -179,9 +183,13 @@ public class TopicServiceImpl implements TopicService { */ @Override public Map getTopicContent(List list) { - if(CollectionUtils.isEmpty(list)) return Collections.EMPTY_MAP; + if(CollectionUtils.isEmpty(list)) { + return Collections.EMPTY_MAP; + } List contents = topicDao.selectTopicContent(list); - if(CollectionUtils.isEmpty(contents)) return Collections.EMPTY_MAP; + if(CollectionUtils.isEmpty(contents)) { + return Collections.EMPTY_MAP; + } Map topicContentMap = contents.stream().collect(Collectors.toMap(TopicContentResultDTO :: getTopicId,TopicContentResultDTO::getContent)); //key -> topicId | value -> projectId Map projectTopicMap = list.stream().collect(Collectors.toMap(ProjectSourceMapFormDTO :: getSourceId,ProjectSourceMapFormDTO :: getProjectId,(o,n)->n)); @@ -227,7 +235,9 @@ public class TopicServiceImpl implements TopicService { @Override public List buildNewScreenProjectImgData(List list) { List imgs = topicDao.initNewScreenProjectImgData(list.get(NumConstant.ZERO).getCustomerId(), list); - if(CollectionUtils.isEmpty(imgs)) return null; + if(CollectionUtils.isEmpty(imgs)) { + return null; + } return imgs.stream().flatMap(img -> list.stream().filter(project -> StringUtils.equals(img.getTopicId(),project.getTopicId())).map( match -> { ScreenProjectImgDataDTO matchedImg diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java index 01906d5bae..5abf6a910e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java @@ -168,7 +168,9 @@ public abstract class ScoreCalculator { */ protected BigDecimal calcuteCoefficient(BigDecimal min, BigDecimal max) { BigDecimal fenmu = max.subtract(min); - if (fenmu.compareTo(BigDecimal.ZERO)==0)return new BigDecimal(0); + if (fenmu.compareTo(BigDecimal.ZERO)==0) { + return new BigDecimal(0); + } BigDecimal fenzi = maxScore.subtract(minScore); BigDecimal divide = fenzi.divide(fenmu, MathContext.DECIMAL32); return divide; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.27__volunteer_service_daily_add_gridid.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.27__volunteer_service_daily_add_gridid.sql new file mode 100644 index 0000000000..de4af15c6f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.27__volunteer_service_daily_add_gridid.sql @@ -0,0 +1,14 @@ +-- 发布前执行 +alter table fact_volunteer_service_daily add column GRID_ID varchar(64) not null comment '网格ID' after CUSTOMER_ID; +alter table fact_volunteer_service_daily add column PID varchar(64) default '' comment 'pid网格父级ID' after RESI_SERVICE_TOTAL; +alter table fact_volunteer_service_daily add column PIDS varchar(255) default '' comment 'pid网格父级ID路径,包含PID' after PID; + +-- 发布后执行 + +delete from fact_volunteer_service_daily; + +alter table fact_volunteer_service_daily drop key uni_vsd; + +alter table fact_volunteer_service_daily + add constraint uni_vsd + unique (GRID_ID, DATE_ID, DEL_FLAG); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/IcUserDemandServiceDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/IcUserDemandServiceDao.xml index ddebabef66..ab73afd872 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/IcUserDemandServiceDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/IcUserDemandServiceDao.xml @@ -24,11 +24,13 @@ select service.SERVER_ID, SERVICE_TYPE, count(1) as SERVE_TIMES from ic_user_demand_rec damend inner join ic_user_demand_service service on (damend.ID = service.DEMAND_REC_ID and service.DEL_FLAG = 0) + inner join volunteer_info v on (service.SERVER_ID = v.USER_ID and v.DEL_FLAG = 0) where damend.DEL_FLAG = 0 and damend.STATUS = 'finished' and damend.CUSTOMER_ID = #{customerId} and service.SERVICE_END_TIME #{endTime} and service.SERVICE_TYPE = #{serviceType} + and v.GRID_ID = #{gridId} group by service.SERVER_ID, SERVICE_TYPE \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactVolunteerServiceDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactVolunteerServiceDailyDao.xml index 59dfd96c12..be083bd93e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactVolunteerServiceDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactVolunteerServiceDailyDao.xml @@ -14,6 +14,8 @@ + + diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/WorkDayServiceImpl.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/WorkDayServiceImpl.java index 80241a5a2e..98e2f839c8 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/WorkDayServiceImpl.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/WorkDayServiceImpl.java @@ -119,7 +119,9 @@ public class WorkDayServiceImpl implements WorkDayService { @Override public Map workMinutes(WorkMinuteFormDTO param) { List params = param.getTimeList(); - if(CollectionUtils.isEmpty(params)) return null; + if(CollectionUtils.isEmpty(params)) { + return null; + } Map result = new LinkedHashMap<>(); //默认非精准计算 if(StringUtils.isBlank(param.getIfPrecise()) || !StringUtils.equals(ProjectConstant.PRECISE_CALCULATION,param.getIfPrecise())){ @@ -192,7 +194,9 @@ public class WorkDayServiceImpl implements WorkDayService { private Integer calculateImpreciseDetentionMinutes(Date left, Date right){ if(null == left){ logger.error("计算工作日,传入的开始日期为空!");return null;} //给右区间赋值,默认当前时间 - if(null == right || right.compareTo(left) < NumConstant.ZERO) right = new Date(); + if(null == right || right.compareTo(left) < NumConstant.ZERO) { + right = new Date(); + } List list = calenderDao.selectByStartAndEnd(format.format(left),format.format(right)); if(!CollectionUtils.isEmpty(list)){ @@ -204,10 +208,14 @@ public class WorkDayServiceImpl implements WorkDayService { //集合中有两个元素以上,说明两个时间存在跨度 else{ int costMin = NumConstant.ZERO; - if(NumConstant.TWO == list.size()) return costMin; - for(int index = NumConstant.ZERO ; index < list.size() ; index++) - if(StringUtils.equals(ProjectConstant.DAY_TYPE_WORK,list.get(index).getType())) + if(NumConstant.TWO == list.size()) { + return costMin; + } + for(int index = NumConstant.ZERO ; index < list.size() ; index++) { + if(StringUtils.equals(ProjectConstant.DAY_TYPE_WORK,list.get(index).getType())) { costMin += NumConstant.TWENTY_FOUR * NumConstant.SIXTY; + } + } return costMin; } @@ -228,15 +236,17 @@ public class WorkDayServiceImpl implements WorkDayService { private Integer calculateDetentionMinutes(Date left ,Date right){ if(null == left){ logger.error("计算工作日,传入的开始日期为空!");return null;} //给右区间赋值,默认当前时间 - if(null == right || right.compareTo(left) < NumConstant.ZERO) right = new Date(); + if(null == right || right.compareTo(left) < NumConstant.ZERO) { + right = new Date(); + } List list = calenderDao.selectByStartAndEnd(format.format(left),format.format(right)); if(!CollectionUtils.isEmpty(list)){ //集合中只有一个元素,说明两个时间在同一天 if(list.size() == NumConstant.ONE){ - if(ProjectConstant.DAY_TYPE_WORK.equals(list.get(NumConstant.ZERO).getType())) + if(ProjectConstant.DAY_TYPE_WORK.equals(list.get(NumConstant.ZERO).getType())) { return (int)((right.getTime() - left.getTime())/NumConstant.ONE_THOUSAND/NumConstant.SIXTY); - else { + } else { logger.warn("计算工作日,传入的起始时间都在同一天且是在节假日,开始时间:{},结束时间:{},节日类型:{}(1工作日、2周末、3、节假日)",left,right); return NumConstant.ZERO; } @@ -263,10 +273,14 @@ public class WorkDayServiceImpl implements WorkDayService { //ChronoUnit日期枚举类,between方法计算两个时间对象之间的时间量 costMin += ChronoUnit.SECONDS.between(localDateTime, initialTime)/NumConstant.SIXTY; } - if(NumConstant.TWO == list.size()) return costMin; - for(int index = NumConstant.ONE ; index < list.size() - NumConstant.ONE ; index++) - if(StringUtils.equals(ProjectConstant.DAY_TYPE_WORK,list.get(index).getType())) + if(NumConstant.TWO == list.size()) { + return costMin; + } + for(int index = NumConstant.ONE ; index < list.size() - NumConstant.ONE ; index++) { + if(StringUtils.equals(ProjectConstant.DAY_TYPE_WORK,list.get(index).getType())) { costMin += NumConstant.TWENTY_FOUR * NumConstant.SIXTY; + } + } return costMin; } @@ -290,7 +304,9 @@ public class WorkDayServiceImpl implements WorkDayService { if(null == left){ logger.error("计算工作日,传入的开始日期为空!");return null;} if(null == start || null == end){start = "9:00:00"; end = "17:00:00";} //给右区间赋值,默认当前时间 - if(null == right || right.compareTo(left) < NumConstant.ZERO) right = new Date(); + if(null == right || right.compareTo(left) < NumConstant.ZERO) { + right = new Date(); + } //自定义起始时间 String standardStartDateStr = format.format(left).concat(" ").concat(start); //自定义截至时间 @@ -359,10 +375,14 @@ public class WorkDayServiceImpl implements WorkDayService { costMin += delta_T; } } - if(NumConstant.TWO == list.size()) return costMin; - for(int index = NumConstant.ONE ; index < list.size() - NumConstant.ONE ; index++) - if(StringUtils.equals(ProjectConstant.DAY_TYPE_WORK,list.get(index).getType())) + if(NumConstant.TWO == list.size()) { + return costMin; + } + for(int index = NumConstant.ONE ; index < list.size() - NumConstant.ONE ; index++) { + if(StringUtils.equals(ProjectConstant.DAY_TYPE_WORK,list.get(index).getType())) { costMin += delta_T * NumConstant.SIXTY; + } + } return costMin; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java index b747b77985..10180e0222 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java @@ -44,6 +44,27 @@ public class ActInfoDTO implements Serializable { */ private String customerId; + /** + * 活动类型爱心活动heart 联建活动party + */ + private String actType; + + /** + * 联建单位 + */ + private String unitId; + private String unitName; + /** + * 活动目标 + */ + private String target; + + /** + * 服务事项 + */ + private String serviceMatter; + private String serviceMatterName; + /** * 活动标题 */ 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 index a8c770f8e9..81edd97c20 100644 --- 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 @@ -58,6 +58,11 @@ public class IcPartyActivityDTO implements Serializable { */ private String pids; + /** + * act_info表ID + */ + private String actId; + /** * 单位ID */ 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 index b070d80073..30b24a8498 100644 --- 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 @@ -145,6 +145,11 @@ public class IcUserDemandRecDTO implements Serializable { */ private Boolean evaluateFlag; + /** + * 奖励积分 + */ + private Integer awardPoint; + /** * 删除标识:0.未删除 1.已删除 */ @@ -175,4 +180,6 @@ public class IcUserDemandRecDTO implements Serializable { */ private Date updatedTime; + private String serverId; + private String serviceType; } \ 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 index c28b702723..e1ec95519d 100644 --- 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 @@ -17,11 +17,11 @@ package com.epmet.dto; -import java.io.Serializable; -import java.util.Date; import lombok.Data; +import java.io.Serializable; import java.math.BigDecimal; +import java.util.Date; /** * 居民需求评价记录表 @@ -69,6 +69,11 @@ public class IcUserDemandSatisfactionDTO implements Serializable { */ private BigDecimal score; + /** + * 评价时,填写的完成情况 + */ + private String remark; + /** * 删除标识:0.未删除 1.已删除 */ 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 index e3196e2b02..aa2218a8af 100644 --- 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 @@ -17,9 +17,10 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -69,7 +70,7 @@ public class IcUserDemandServiceDTO implements Serializable { private Date serviceEndTime; /** - * 完成情况 + * 此列暂时没有用。完成情况在ic_user_demand_satisfaction.remark */ private String finishDesc; diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java index 0d0824fdfd..e73c466837 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java @@ -179,6 +179,26 @@ public class LatestActInfoDTO implements Serializable { */ private Boolean auditSwitch; + /** + * 活动类型爱心活动heart 联建活动party + */ + private String actType; + + /** + * 联建单位 + */ + private String unitId; + + /** + * 活动目标 + */ + private String target; + + /** + * 服务事项 + */ + private String serviceMatter; + /** * 乐观锁 */ diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/VolunteerInfoDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/VolunteerInfoDTO.java index b309d9a7d5..35d451f2a0 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/VolunteerInfoDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/VolunteerInfoDTO.java @@ -17,9 +17,10 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -97,4 +98,12 @@ public class VolunteerInfoDTO implements Serializable { * 志愿者注册,所在网格名称 */ private String gridName; + /** + * 网格所属的组织id + */ + private String pid; + /** + * 网格的所有上级 + */ + private String pids; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AutoEvaluateDemandFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AutoEvaluateDemandFormDTO.java new file mode 100644 index 0000000000..2df4640227 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AutoEvaluateDemandFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 自动评价参数 + */ +@Data +public class AutoEvaluateDemandFormDTO implements Serializable { + private String customerId; + private Integer exceedValue; + /** + * day + * minute + */ + private String type; +} 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/CancelDemandFormDTO.java similarity index 67% rename from epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/StaffCancelFormDTO.java rename to epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/CancelDemandFormDTO.java index 09d920f55c..3240a74515 100644 --- 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/CancelDemandFormDTO.java @@ -4,8 +4,11 @@ import lombok.Data; import javax.validation.constraints.NotBlank; +/** + * 取消需求入参dto + */ @Data -public class StaffCancelFormDTO { +public class CancelDemandFormDTO { public interface AddUserInternalGroup {} @NotBlank(message = "需求id不能为空",groups = AddUserInternalGroup.class) private String demandRecId; @@ -14,4 +17,12 @@ public class StaffCancelFormDTO { private String userId; @NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) private String customerId; + + /** + * staff:pc工作人员取消 + * resi:居民端用户主动需求 + * 代码里写死的UserDemandConstant.RESI/STAFF + */ + private String userType; } + 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 index f3a1c9ae0c..a9ae2fad05 100644 --- 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 @@ -10,6 +10,9 @@ import javax.validation.constraints.NotNull; import java.io.Serializable; import java.util.Date; +/** + * pc录入需求入参 + */ @Data public class DemandAddFromDTO implements Serializable { 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 index 25ec764f3f..8e24df4191 100644 --- 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 @@ -5,6 +5,10 @@ import lombok.Data; import javax.validation.constraints.NotBlank; import java.io.Serializable; +/** + * 需求大厅-需求详情入参 + * 我的需求-需求详情入参 + */ @Data public class DemandDetailFormDTO implements Serializable { private static final long serialVersionUID = 514538389753713095L; diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/EvaluateDemandFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/EvaluateDemandFormDTO.java new file mode 100644 index 0000000000..119061edee --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/EvaluateDemandFormDTO.java @@ -0,0 +1,47 @@ +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; +import java.math.BigDecimal; + +/** + * 居民端-需求-服务评价入参 + */ +@Data +public class EvaluateDemandFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + public interface ShowGroup extends CustomerClientShowGroup { + } + + + @NotBlank(message = "需求id不能为空", groups = AddUserInternalGroup.class) + private String demandRecId; + + @NotBlank(message = "服务id不能为空", groups = AddUserInternalGroup.class) + private String serviceId; + + @NotBlank(message = "完成结果不能为空", groups = ShowGroup.class) + private String finishResult; + + @Length(max = 1000,message = "最多输入1000字",groups = {ShowGroup.class}) + private String finishDesc; + + @NotNull(message = "得分不能为空", groups = ShowGroup.class) + private BigDecimal score; + + + + @NotBlank(message = "userId不能为空", groups = AddUserInternalGroup.class) + private String userId; + @NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) + private String customerId; + // 政府端:gov、居民端:resi、运营端:oper + @NotBlank(message = "app不能为空", groups = AddUserInternalGroup.class) + private String app; +} 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 index 06ca8a93fc..39f04f2e59 100644 --- 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 @@ -16,27 +16,31 @@ public class FinishStaffFromDTO implements Serializable { public interface AddUserInternalGroup { } - public interface AddUserShowGroup extends CustomerClientShowGroup { + public interface IcShowGroup extends CustomerClientShowGroup { + } + public interface ResiShowGroup extends CustomerClientShowGroup { } @NotBlank(message = "需求id不能为空", groups = AddUserInternalGroup.class) private String demandRecId; - @NotBlank(message = "服务id不能为空", groups = AddUserShowGroup.class) + @NotBlank(message = "服务id不能为空", groups = AddUserInternalGroup.class) private String serviceId; - @NotNull(message = "实际服务开始不能为空", groups = AddUserShowGroup.class) + @NotNull(message = "实际服务开始不能为空", groups = {IcShowGroup.class,ResiShowGroup.class}) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date serviceStartTime; - @NotNull(message = "实际服务结束不能为空", groups = AddUserShowGroup.class) + @NotNull(message = "实际服务结束不能为空", groups = {IcShowGroup.class,ResiShowGroup.class}) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date serviceEndTime; - @NotBlank(message = "完成结果不能为空", groups = AddUserShowGroup.class) + // @NotBlank(message = "完成结果不能为空", groups = IcShowGroup.class) private String finishResult; + + // @Length(max = 1000,message = "最多输入1000字",groups = {IcShowGroup.class}) private String finishDesc; - @NotNull(message = "得分不能为空", groups = AddUserShowGroup.class) + // @NotNull(message = "得分不能为空", groups = IcShowGroup.class) private BigDecimal score; @@ -45,4 +49,14 @@ public class FinishStaffFromDTO implements Serializable { private String userId; @NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) private String customerId; + /** + * pc完成情况:完成+评价 UserDemandConstant.FINISH_AND_EVALUATE + * 居民端完成:UserDemandConstant.FINISHED + */ + private String type; + /** + * pc完成情况:UserDemandConstant.STAFF + * 居民端完成:UserDemandConstant.RESI + */ + private String userType; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ListHallFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ListHallFormDTO.java new file mode 100644 index 0000000000..8ffcd0589d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ListHallFormDTO.java @@ -0,0 +1,34 @@ +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 ListHallFormDTO extends PageFormDTO implements Serializable { + public interface AddUserInternalGroup {} + + /** + * 当前所在网格id + */ + @NotBlank(message = "gridId不能为空", groups = AddUserInternalGroup.class) + private String gridId; + + /** + * 未处理:unprocessed;处理中:processing;已完成:finished + */ + @NotBlank(message = "type不能为空,未处理:unprocessed;处理中:processing;已完成:finished", groups = AddUserInternalGroup.class) + private String type; + + // 以下入参从token中获取 + @NotBlank(message = "tokenDto获取userId不能为空", groups = AddUserInternalGroup.class) + private String currentUserId; + @NotBlank(message = "tokenDto获取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/PageListAnalysisFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/PageListAnalysisFormDTO.java index 464d1062a8..2eb55979b1 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/PageListAnalysisFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/PageListAnalysisFormDTO.java @@ -49,4 +49,8 @@ public class PageListAnalysisFormDTO implements Serializable { private Boolean pageFlag; + /** + * 数据分析-服务措施分析排除,已取消 + */ + private String excludeStatus; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ReportDemandFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ReportDemandFormDTO.java new file mode 100644 index 0000000000..267254bc3b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ReportDemandFormDTO.java @@ -0,0 +1,112 @@ +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 ReportDemandFormDTO implements Serializable { + private static final long serialVersionUID = -2931148629441558468L; + + public interface Add extends CustomerClientShowGroup { + } + + public interface AddInternalGroup { + } + + public interface Update extends CustomerClientShowGroup { + } + + public interface UpdateInternalGroup { + } + + @NotBlank(message = "需求id不能为空",groups = UpdateInternalGroup.class) + private String demandRecId; + + @NotBlank(message = "customerId不能为空", groups = {AddInternalGroup.class, UpdateInternalGroup.class}) + private String customerId; + + /** + * 网格id + */ + @NotBlank(message = "所属网格不能为空",groups = {AddInternalGroup.class}) + private String gridId; + + /** + * 需求内容1000字 + */ + @NotBlank(message = "需求内容不能为空", groups = {Add.class, Update.class}) + @Length(max = 1000, message = "需求内容至多输入1000字", groups = {Add.class, Update.class}) + private String content; + + /** + * 二级需求分类编码 + */ + @NotBlank(message = "需求类别不能为空",groups = Add.class) + private String categoryCode; + + /** + * 父级需求分类编码 + */ + @NotBlank(message = "父级分类不能为空",groups = Add.class) + private String parentCode; + + + /** + * 希望服务时间 + */ + @NotNull(message = "服务时间不能为空",groups = {Add.class, Update.class}) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date wantServiceTime; + + /** + * 需求人:user.id或者ic_resi_user.id + */ + @NotBlank(message = "需求人不能为空",groups ={AddInternalGroup.class, UpdateInternalGroup.class}) + private String demandUserId; + + /** + * 需求人联系姓名 + */ + @NotBlank(message = "联系人不能为空",groups = {Add.class, Update.class}) + private String demandUserName; + + /** + * 需求人联系电话 + */ + @NotBlank(message = "联系电话不能为空",groups = {Add.class, Update.class}) + private String demandUserMobile; + + /** + * 服务地点,工作端指派默认居民居住房屋地址,居民端地图选择 + */ + @NotBlank(message = "服务地点不能为空",groups = {Add.class, Update.class}) + private String serviceLocation; + + /** + * 门牌号详细地址 + */ + @Length(max = 200, message = "门牌号至多输入200字", groups = {Add.class, Update.class}) + private String locationDetail; + + /** + * 经度,需求人是ic的居民时,取所住楼栋的中心点位 + */ + private String longitude; + + /** + * 纬度,需求人是ic的居民时,取所住楼栋的中心点位 + */ + private String latitude; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ResiClientMyDemandFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ResiClientMyDemandFormDTO.java new file mode 100644 index 0000000000..dad278f438 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ResiClientMyDemandFormDTO.java @@ -0,0 +1,56 @@ +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 ResiClientMyDemandFormDTO extends PageFormDTO implements Serializable { + /*List userIds=new ArrayList<>(); + userIds.add(formDTO.getIcResiUserId()); + if(CollectionUtils.isNotEmpty(formDTO.getEpmetUserIdList())){ + userIds.addAll(formDTO.getEpmetUserIdList()); + } + formDTO.setUserIds(userIds); + //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())); + } + resDto.setFirstCategoryName(demandDictService.getCategoryName(formDTO.getCustomerId(),resDto.getFirstCategoryCode())); + } + }*/ + public interface AddUserInternalGroup {} + @NotBlank(message = "gridId不能为空",groups = AddUserInternalGroup.class) + private String gridId; + + /** + * 待处理:unprocessed;处理中:processing;已完成:finished;已取消:canceled + */ + @NotBlank(message = "type不能为空,待处理:unprocessed;处理中:processing;已完成:finished;已取消:canceled",groups = AddUserInternalGroup.class) + private String type; + + @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/TakeOrderFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/TakeOrderFormDTO.java new file mode 100644 index 0000000000..9672d8b457 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/TakeOrderFormDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.form.demand; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 需求大厅-我要接单 + */ +@Data +public class TakeOrderFormDTO implements Serializable { + private static final long serialVersionUID = -2030750128789890382L; + public interface AddUserInternalGroup { + } + @NotBlank(message = "demandRecId不能为空", groups = AddUserInternalGroup.class) + private String demandRecId; + + @NotBlank(message = "tokenDto获取userId不能为空", groups = AddUserInternalGroup.class) + private String userId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandRelFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandRelFormDTO.java new file mode 100644 index 0000000000..82182b2440 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandRelFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.form.demand; + + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 当前用户与需求消息的关系 + */ +@Data +public class UserDemandRelFormDTO implements Serializable { + private static final long serialVersionUID = 948510931204329428L; + + public interface AddInternalGroup { + } + @NotBlank(message = "需求id不能为空",groups = AddInternalGroup.class) + private String demandRecId; + + @NotBlank(message = "userId不能为空",groups = AddInternalGroup.class) + private String userId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiVolunteerAuthenticateFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiVolunteerAuthenticateFormDTO.java index 0a42ede194..877abcb74c 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiVolunteerAuthenticateFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiVolunteerAuthenticateFormDTO.java @@ -17,80 +17,67 @@ import java.io.Serializable; public class ResiVolunteerAuthenticateFormDTO implements Serializable { private static final long serialVersionUID = 1L; - - //>>>>>>>>>>>>>>>>>校验分组开始>>>>>>>>>>>>>>>>>>>>> - /** - * 添加用户操作的内部异常分组 - * 出现错误会提示给前端7000错误码,返回信息为:服务器开小差... - */ public interface AddUserInternalGroup {} - - /** - * 添加用户操作的用户可见异常分组 - * 该分组用于校验需要返回给前端错误信息提示的列,需要继承CustomerClientShowGroup - * 返回错误码为8999,提示信息为DTO中具体的列的校验注解message的内容 - */ public interface AddUserShowGroup extends CustomerClientShowGroup {} - // <<<<<<<<<<<<<<<<<<<校验分组结束<<<<<<<<<<<<<<<<<<<<<<<< - /** * 用户id */ + @NotBlank(message = "tokenDto中获取userId为空", groups = {AddUserInternalGroup.class }) private String userId; /** * 客户id */ - @NotBlank(message = "客户id不能为空", groups = {AddUserShowGroup.class }) + @NotBlank(message = "tokenDto中获取customerId为空", groups = {AddUserInternalGroup.class }) private String customerId; /** * 姓 */ - @NotBlank(message = "姓不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class }) + @NotBlank(message = "姓不能为空", groups = {AddUserShowGroup.class }) private String surname; /** * 名 */ - @NotBlank(message = "名不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class }) + @NotBlank(message = "名不能为空", groups = {AddUserShowGroup.class }) private String name; /** * 性别(1男2女0未知) */ - @NotBlank(message = "性别不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class }) + @NotBlank(message = "性别不能为空", groups = {AddUserShowGroup.class }) private String gender; /** * 手机号 */ - @NotBlank(message = "手机号不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class }) + @NotBlank(message = "手机号不能为空", groups = {AddUserShowGroup.class }) private String mobile; /** * 身份证号码 */ - @NotBlank(message = "身份证号码不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class }) + @NotBlank(message = "身份证号码不能为空", groups = {AddUserShowGroup.class }) private String idNum; /** * 街道 */ - @NotBlank(message = "街道不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class }) + @NotBlank(message = "居住地址:街道不能为空", groups = {AddUserShowGroup.class }) private String street; /** * 小区名 */ - @NotBlank(message = "小区名不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class }) + @NotBlank(message = "居住地址:小区名不能为空", groups = {AddUserShowGroup.class }) private String district; /** * 楼栋单元 */ - @NotBlank(message = "楼栋单元不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class }) + @NotBlank(message = "居住地址:楼栋单元不能为空", groups = {AddUserShowGroup.class }) private String buildingAddress; /** @@ -101,13 +88,13 @@ public class ResiVolunteerAuthenticateFormDTO implements Serializable { /** * 昵称 */ - @NotBlank(message = "昵称不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class }) + @NotBlank(message = "昵称不能为空", groups = {AddUserInternalGroup.class}) private String nickname; /** * 头像 */ - @NotBlank(message = "头像不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class }) + @NotBlank(message = "头像不能为空", groups = {AddUserInternalGroup.class}) private String avatarUrl; /** diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/VolunteerCommonFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/VolunteerCommonFormDTO.java index c8893697a8..4a9973d735 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/VolunteerCommonFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/VolunteerCommonFormDTO.java @@ -14,12 +14,16 @@ import javax.validation.constraints.NotNull; @Data public class VolunteerCommonFormDTO { - public interface VolunteerPage { - } - - @NotBlank(message = "客户ID不能为空", groups = {VolunteerPage.class}) + /** + * 客户ID + */ private String customerId; + /** + * 组织ID + */ + private String agencyId; + private Integer pageNo = 0; private Integer pageSize = 20; diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActIdFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActIdFormDTO.java index 632b567c11..4ba08831e9 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActIdFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActIdFormDTO.java @@ -21,4 +21,5 @@ public class ActIdFormDTO implements Serializable { */ @NotBlank(message = "活动id不能为空", groups = { ActIdFormDTO.AddUserInternalGroup.class }) private String actId; + private String customerId; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActPreviewFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActPreviewFormDTO.java index 57166c22f1..78bd1a6cd5 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActPreviewFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActPreviewFormDTO.java @@ -23,4 +23,5 @@ public class ActPreviewFormDTO implements Serializable { */ @NotBlank(message = "活动草稿id不能为空", groups = {UserInternalGroup.class}) private String actDraftId; + private String customerId; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java index 1d128594ff..f00ebe792f 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java @@ -161,4 +161,24 @@ public class DraftActInfoFormDTO implements Serializable { */ private String sponsorTel; + /** + * 活动类型爱心活动heart 联建活动party + */ + private String actType = "heart"; + + /** + * 联建单位 + */ + private String unitId; + + /** + * 活动目标 + */ + private String target; + + /** + * 服务事项 + */ + private String serviceMatter; + } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java index fae068b230..ef1f3c3e19 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java @@ -25,6 +25,8 @@ public class PublishActInfoFormDTO implements Serializable { public interface AddUserInternalGroup { } + public interface AddPartyActivityGroup { + } public interface AddUserShowGroup extends CustomerClientShowGroup { } @@ -189,4 +191,27 @@ public class PublishActInfoFormDTO implements Serializable { */ @NotBlank(message = "联系电话不能为空", groups = {AddUserShowGroup.class}) private String sponsorTel; + + /** + * 活动类型爱心活动heart 联建活动party + */ + private String actType = "heart"; + + /** + * 联建单位 + */ + @NotBlank(message = "联建单位不能为空", groups = {AddPartyActivityGroup.class}) + private String unitId; + + /** + * 活动目标 + */ + @NotBlank(message = "活动目标不能为空", groups = {AddPartyActivityGroup.class}) + private String target; + + /** + * 服务事项 + */ + @NotBlank(message = "服务事项不能为空", groups = {AddPartyActivityGroup.class}) + private String serviceMatter; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java index dfd1aeed99..b093e9dcba 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java @@ -24,6 +24,8 @@ public class RePublishFormDTO implements Serializable { private static final long serialVersionUID = -959956652123514886L; public interface AddUserInternalGroup { } + public interface AddPartyActivityGroup { + } public interface AddUserShowGroup extends CustomerClientShowGroup { } @@ -195,4 +197,27 @@ public class RePublishFormDTO implements Serializable { */ @NotBlank(message = "联系电话不能为空", groups = {AddUserShowGroup.class}) private String sponsorTel; + + /** + * 活动类型爱心活动heart 联建活动party + */ + private String actType = "heart"; + + /** + * 联建单位 + */ + @NotBlank(message = "联建单位不能为空", groups = {AddPartyActivityGroup.class}) + private String unitId; + + /** + * 活动目标 + */ + @NotBlank(message = "活动目标不能为空", groups = {AddPartyActivityGroup.class}) + private String target; + + /** + * 服务事项 + */ + @NotBlank(message = "服务事项不能为空", groups = {AddPartyActivityGroup.class}) + private String serviceMatter; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandCategoryResDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandCategoryResDTO.java new file mode 100644 index 0000000000..c03c898eb6 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandCategoryResDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.result.demand; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + + +/** + * 1、居民端-我有需求,分类列表发布餐(可用) + * 2、居民端-我有需求,最近预约返参 + */ +@Data +public class DemandCategoryResDTO implements Serializable { + private String categoryId; + private String categoryCode; + private String parentCode; + private String categoryName; + @JsonIgnore + private String customerId; + private List children; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandDataDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandDataDTO.java index f5ca265feb..5153d91eed 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandDataDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandDataDTO.java @@ -5,6 +5,9 @@ import lombok.Data; import java.io.Serializable; import java.util.List; +/** + * 数据分析-个人档案-需求详情,研判分析的 分类,以及分类下的需求 + */ @Data public class DemandDataDTO implements Serializable { private String firstCategoryCode; diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandDetailResDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandDetailResDTO.java new file mode 100644 index 0000000000..cad6a2c4dd --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandDetailResDTO.java @@ -0,0 +1,121 @@ +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.math.BigDecimal; +import java.util.Date; + +/** + * 需求大厅-需求详情 + * 我的需求-需求详情 todo + */ +@Data +public class DemandDetailResDTO implements Serializable { + + private String demandRecId; + @JsonIgnore + private String categoryCode; + @JsonIgnore + private String parentCode; + /** + * 二级分类名称 + */ + private String categoryName; + + /** + * 奖励积分 + */ + private Integer awardPoint; + + /** + * 需求内容 + */ + private String content; + + /** + * 服务要求-服务时间:yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date wantServiceTime; + + /** + * 服务要求-联系人(需求人)名称 + */ + private String demandUserName; + + /** + * 服务要求-联系人(需求人)电话 + */ + private String demandUserMobile; + + /** + * 服务地点 + */ + private String serviceAddress; + + // 服务地点,工作端指派默认居民居住房屋地址,居民端地图选择 + private String serviceLocation; + // 门牌号详细地址 + private String locationDetail; + // 经度,需求人是ic的居民时,取所住楼栋的中心点位 + private String longitude; + // 纬度,需求人是ic的居民时,取所住楼栋的中心点位 + private String latitude; + + + + /** + * 实际服务开始时间 + */ + @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 BigDecimal score; + + /** + * 完成结果:已解决 resolved,未解决 unresolved + + */ + private String finishResult; + + /** + * 完成情况 + */ + private String finishDesc; + + /** + * 待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished + */ + private String status; + + /** + * 1:已评价;0:未评价;评价后ic_user_satisfaction表有记录 + */ + private Boolean evaluateFlag; + + /** + * 服务记录主键 + */ + private String serviceId; + @JsonIgnore + private String serverId; + // 以下几个返参在我的需求详情中返回: + private String serviceType; + private String serviceUserName; + private String serviceUserMobile; + private String serviceUnitName; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date cancelTime; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandHallResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandHallResultDTO.java new file mode 100644 index 0000000000..407767d6a2 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandHallResultDTO.java @@ -0,0 +1,79 @@ +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.math.BigDecimal; +import java.util.Date; + +/** + * 居民端-需求大厅(未处理、处理中、已完成)返参DTO + * 返参DTO + */ +@Data +public class DemandHallResultDTO implements Serializable { + /** + * 需求id + */ + private String demandRecId; + + /** + * 分类编码 + */ + @JsonIgnore + private String categoryCode; + + /** + * 父级分类编码 + */ + @JsonIgnore + private String parentCode; + + /** + * 服务事项,实际就是需求分类二级分类名字 + */ + private String categoryName; + + /** + * 服务时间,yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date wantServiceTime; + + /** + * 服务地点 + */ + private String serviceAddress; + + /** + * 奖励积分 + */ + private Integer awardPoint; + + /** + * 需求人名字 + */ + private String demandUserName; + + /** + * 需求人联系电话 + */ + private String demandUserMobile; + + /** + * 得分可为半星 + */ + private BigDecimal score; + + /** + * 待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished + */ + private String status; + + /** + * 1:已评价;0:未评价;评价后ic_user_satisfaction表有记录 + */ + private Boolean evaluateFlag; +} 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 index 5b2a12c529..4f39edf676 100644 --- 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 @@ -6,6 +6,9 @@ import java.io.Serializable; import java.math.BigDecimal; import java.util.List; +/** + * 需求分类:列表返参 + */ @Data public class DemandPageResDTO implements Serializable { private String customerId; 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 index e7b673d22f..c235915430 100644 --- 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 @@ -121,4 +121,22 @@ public class DemandRecResultDTO implements Serializable { private String icResiUserId; private String epmetUserId; + + /** + * 奖励积分 + */ + private Integer awardPoint; + + /** + * 服务地点 + */ + private String serviceAddress; + // 服务地点,工作端指派默认居民居住房屋地址,居民端地图选择 + private String serviceLocation; + // 门牌号详细地址 + private String locationDetail; + // 经度,需求人是ic的居民时,取所住楼栋的中心点位 + private String longitude; + // 纬度,需求人是ic的居民时,取所住楼栋的中心点位 + private String latitude; } 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 index 96d03b9c2d..6eae50568c 100644 --- 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 @@ -6,10 +6,34 @@ import java.io.Serializable; /** * 完成需求时,是否需要计算 区域化党建单位的满意度 - * */ @Data public class FinishResultDTO implements Serializable { - private Boolean sendCalStatisfaction; - private String partyUnitId; + /** + * 服务方id:可以值区域化党建单位id、也可以是社会组织、社区自组织id、爱心互助的志愿者用户id + */ + private String serverId; + /** + * 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + */ + private String serviceType; + /** + * 奖励积分:只有服务方是志愿者且积分大于0时,才发放积分 + */ + private Integer awardPoint; + + /** + * 1:已评价;0:未评价;评价后ic_user_satisfaction表有记录 + */ + private Boolean evaluateFlag; + /** + * 完成了XXX的需求 + */ + private String remark; + private String firstCategoryName; + private String categoryCode; + /** + * 完成结果:已解决 resolved,未解决 unresolved + */ + private String finishResult; } 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 index 19757a671c..4dd722fb59 100644 --- 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 @@ -7,6 +7,10 @@ import lombok.Data; import java.io.Serializable; import java.util.Date; +/** + * 数据分析-个人档案,居民需求列表table + * 数据分析-个人档案,需求详情,研判分析-需求列表 + */ @Data public class IcResiUserReportDemandRes implements Serializable { private static final long serialVersionUID = 7043350476644105434L; 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 index c0cfd3b48d..71f1a0edb0 100644 --- 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 @@ -9,4 +9,5 @@ public class OptionDTO implements Serializable { private static final long serialVersionUID = -6722370308097497466L; private String label; private String value; + private Integer awardPoint; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ResiClientMyDemandResDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ResiClientMyDemandResDTO.java new file mode 100644 index 0000000000..f606c04f5e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ResiClientMyDemandResDTO.java @@ -0,0 +1,74 @@ +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.math.BigDecimal; +import java.util.Date; + +/** + * 居民端-我的需求列表入参 + */ +@Data +public class ResiClientMyDemandResDTO implements Serializable { + private String demandRecId; + @JsonIgnore + private String categoryCode; + @JsonIgnore + private String parentCode; + /** + * 二级分类名称 + */ + private String categoryName; + + /** + * 服务要求-服务时间:yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date wantServiceTime; + + /** + * 服务地点 + */ + private String serviceAddress; + /** + * 根据服务方类型找名字 + */ + //服务方类型:服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + @JsonIgnore + private String serviceType; + @JsonIgnore + private String serverId; + + /** + * 服务方负责人姓名,如果是志愿者返回志愿者的姓名 + */ + private String serviceUserName; + /** + * 服务方负责人联系电话,如果是志愿者返回志愿者的注册手机号 + */ + private String serviceUserMobile; + /** + * 社会组织名 + * 社区自组织名 + * 区域党建单位名 + */ + private String serviceUnitName; + /** + * 1:已评价;0:未评价;评价后ic_user_satisfaction表有记录 + */ + private Boolean evaluateFlag; + /** + * 得分可为半星 + */ + private BigDecimal score; + /** + * 待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished + */ + private String status; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date cancelTime; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/TakeOrderResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/TakeOrderResultDTO.java new file mode 100644 index 0000000000..a16bc5c648 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/TakeOrderResultDTO.java @@ -0,0 +1,15 @@ +package com.epmet.dto.result.demand; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 需求大厅-我要接单 + */ +@Data +public class TakeOrderResultDTO implements Serializable { + private static final long serialVersionUID = -4390598017224563310L; + private Boolean isVolunteer; + private String serviceId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/UserDemandRelResDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/UserDemandRelResDTO.java new file mode 100644 index 0000000000..9c7808dd81 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/UserDemandRelResDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.result.demand; + + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; + +/** + * 当前用户与需求消息的关系 + */ +@AllArgsConstructor +@Data +public class UserDemandRelResDTO implements Serializable { + private static final long serialVersionUID = -9007483306143283653L; + // 需求发布人:publisher ;服务人:server + private String identity; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActDetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActDetailResultDTO.java index 4ee734f45e..a232ebdf33 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActDetailResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActDetailResultDTO.java @@ -175,4 +175,25 @@ public class ResiActDetailResultDTO implements Serializable { * 取消活动的时间(yyyy-MM-dd HH:mm) */ private String cancelTime; + + /** + * 活动类型爱心活动heart 联建活动party + */ + private String actType; + + /** + * 联建单位 + */ + private String unitId; + private String unitName; + /** + * 活动目标 + */ + private String target; + + /** + * 服务事项 + */ + private String serviceMatter; + private String serviceMatterName; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActInfoResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActInfoResultDTO.java index c842cef5e4..01d783e0bd 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActInfoResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActInfoResultDTO.java @@ -87,4 +87,9 @@ public class ResiActInfoResultDTO implements Serializable { *用户报名状态(no_signed_up: 未报名,signed_up: 已报名) */ private String signupFlag; + + /** + * 活动类型 爱心活动heart 联建活动party + */ + private String actType; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiInProgressActResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiInProgressActResultDTO.java index b6905711fe..055e35663d 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiInProgressActResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiInProgressActResultDTO.java @@ -41,4 +41,9 @@ public class ResiInProgressActResultDTO implements Serializable { * 标题 */ private String title; + + /** + * 活动类型 爱心活动heart 联建活动party + */ + private String actType; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiLatestActResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiLatestActResultDTO.java index 1bf6b8124e..c0a4aadbf0 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiLatestActResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiLatestActResultDTO.java @@ -82,4 +82,9 @@ public class ResiLatestActResultDTO implements Serializable { * 活动状态:(报名中:signing_up;已报满:enough;截止报名: end_sign_up; 已开始: in_progress;) */ private String actCurrentState; + + /** + * 活动类型 爱心活动heart 联建活动party + */ + private String actType; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiLookBackActResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiLookBackActResultDTO.java index fc7d7d39e7..986bcb06c5 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiLookBackActResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiLookBackActResultDTO.java @@ -66,4 +66,9 @@ public class ResiLookBackActResultDTO implements Serializable { * 活动状态:(已结束:finished;) */ private String actCurrentState; + + /** + * 活动类型 爱心活动heart 联建活动party + */ + private String actType; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiMyActResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiMyActResultDTO.java index b477f6d513..5eb0d2b8a4 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiMyActResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiMyActResultDTO.java @@ -82,4 +82,9 @@ public class ResiMyActResultDTO implements Serializable { * 活动当前状态(审核中auditing,审核通过passed,审核不通过refused,已结束canceld) */ private String actCurrentState; + + /** + * 活动类型 爱心活动heart 联建活动party + */ + private String actType; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java index eb6f07693c..5e3df9d139 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java @@ -89,4 +89,25 @@ public class ActPreviewResultDTO implements Serializable { * 活动详情 */ private List actContent; + + /** + * 活动类型爱心活动heart 联建活动party + */ + private String actType; + + /** + * 联建单位 + */ + private String unitId; + private String unitName; + /** + * 活动目标 + */ + private String target; + + /** + * 服务事项 + */ + private String serviceMatter; + private String serviceMatterName; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java index 3a19c7d4d4..3da7fade52 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java @@ -147,4 +147,25 @@ public class CanceledActDetailResultDTO implements Serializable { * 活动签到打卡半径(单位:米) */ private Integer signInRadius; + + /** + * 活动类型爱心活动heart 联建活动party + */ + private String actType; + + /** + * 联建单位 + */ + private String unitId; + private String unitName; + /** + * 活动目标 + */ + private String target; + + /** + * 服务事项 + */ + private String serviceMatter; + private String serviceMatterName; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActResultDTO.java index 17e21fc678..89b1374c03 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActResultDTO.java @@ -57,4 +57,8 @@ public class CanceledActResultDTO implements Serializable { * 活动地点 */ private String actAddress; + /** + * 活动类型 爱心活动heart 联建活动party + */ + private String actType; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActDetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActDetailResultDTO.java index e96026f842..3e4bfbdc9a 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActDetailResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActDetailResultDTO.java @@ -136,4 +136,25 @@ public class FinishedActDetailResultDTO implements Serializable { * 活动签到打卡半径(单位:米) */ private Integer signInRadius; + + /** + * 活动类型爱心活动heart 联建活动party + */ + private String actType; + + /** + * 联建单位 + */ + private String unitId; + private String unitName; + /** + * 活动目标 + */ + private String target; + + /** + * 服务事项 + */ + private String serviceMatter; + private String serviceMatterName; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActResultDTO.java index a908287e24..113d5dc46e 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActResultDTO.java @@ -58,4 +58,9 @@ public class FinishedActResultDTO implements Serializable { * 活动地点 */ private String actAddress; + + /** + * 活动类型 爱心活动heart 联建活动party + */ + private String actType; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActDetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActDetailResultDTO.java index cd2518f840..8dc4ad2fb2 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActDetailResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActDetailResultDTO.java @@ -131,4 +131,25 @@ public class InProgressActDetailResultDTO implements Serializable { * 活动签到打卡半径(单位:米) */ private Integer signInRadius; + + /** + * 活动类型爱心活动heart 联建活动party + */ + private String actType; + + /** + * 联建单位 + */ + private String unitId; + private String unitName; + /** + * 活动目标 + */ + private String target; + + /** + * 服务事项 + */ + private String serviceMatter; + private String serviceMatterName; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActResultDTO.java index 7f0d214f70..eae286055b 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActResultDTO.java @@ -82,4 +82,9 @@ public class InProgressActResultDTO implements Serializable { * 活动地点 */ private String actAddress; + + /** + * 活动类型 爱心活动heart 联建活动party + */ + private String actType; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java index 7906c364d5..c4a250df92 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java @@ -166,4 +166,24 @@ public class LatestDraftActInfoResultDTO implements Serializable { * 活动内容- */ private List actContent; + + /** + * 活动类型爱心活动heart 联建活动party + */ + private String actType = "heart"; + + /** + * 联建单位 + */ + private String unitId; + + /** + * 活动目标 + */ + private String target; + + /** + * 服务事项 + */ + private String serviceMatter; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ReEditActInfoResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ReEditActInfoResultDTO.java index 80f668afae..a360fd53c3 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ReEditActInfoResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ReEditActInfoResultDTO.java @@ -148,4 +148,25 @@ public class ReEditActInfoResultDTO implements Serializable { * 活动详情 */ private List actContent; + + /** + * 活动类型爱心活动heart 联建活动party + */ + private String actType; + + /** + * 联建单位 + */ + private String unitId; + private String unitName; + /** + * 活动目标 + */ + private String target; + + /** + * 服务事项 + */ + private String serviceMatter; + private String serviceMatterName; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java index b75ac8e39b..ffce4482d0 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java @@ -4,6 +4,7 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.ActInfoDTO; import com.epmet.dto.VolunteerInfoDTO; +import com.epmet.dto.form.AutoEvaluateDemandFormDTO; import com.epmet.dto.form.CommonCustomerFormDTO; import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO; import com.epmet.dto.form.resi.VolunteerCommonFormDTO; @@ -23,6 +24,7 @@ import java.util.List; * @date 2020/6/4 13:25 */ @FeignClient(name = ServiceConstant.EPMET_HEART_SERVER, fallbackFactory = EpmetHeartOpenFeignClientFallbackFactory.class) +//@FeignClient(name = ServiceConstant.EPMET_HEART_SERVER, fallbackFactory = EpmetHeartOpenFeignClientFallbackFactory.class, url = "http://localhost:8111") public interface EpmetHeartOpenFeignClient { /** @@ -67,6 +69,13 @@ public interface EpmetHeartOpenFeignClient { @PostMapping("/heart/resi/volunteer/page") Result> queryVolunteerPage(@RequestBody VolunteerCommonFormDTO input); + /** + * 服务方填写实际服务时间,并点击确认后。 7天内需求人未作出评价,默认完成情况为已完成,五星好评,为服务方发放积分 + * @return + */ + @PostMapping("/heart/residemand/autoevaluate") + Result autoEvaluateDemand(@RequestBody AutoEvaluateDemandFormDTO formDTO); + /** * 查询志愿者数量 * @param input diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java index 5271fb57e0..db83d85a27 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java @@ -5,6 +5,7 @@ import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.ActInfoDTO; import com.epmet.dto.VolunteerInfoDTO; +import com.epmet.dto.form.AutoEvaluateDemandFormDTO; import com.epmet.dto.form.CommonCustomerFormDTO; import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO; import com.epmet.dto.form.resi.VolunteerCommonFormDTO; @@ -61,6 +62,16 @@ public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignCli return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "queryVolunteerPage", input); } + /** + * 服务方填写实际服务时间,并点击确认后。 7天内需求人未作出评价,默认完成情况为已完成,五星好评,为服务方发放积分 + * + * @return + */ + @Override + public Result autoEvaluateDemand(AutoEvaluateDemandFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "autoEvaluate",formDTO); + } + @Override public Result getVolunteerCount(VolunteerCommonFormDTO input) { return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "getVolunteerCount", input); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java index c5387c8ce4..ce1d187bf2 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java @@ -161,4 +161,17 @@ public interface ActConstant { String HANDLED="handled"; String RESET="reset"; + /** + * 活动类型-爱心互助 + */ + String HEART = "heart"; + /** + * 活动类型-联建活动 + */ + String PARTY = "party"; + + /** + * 服务事项code + */ + String SERVICE_MATTER_CODE = "1010"; } 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 index 85168b8a32..2f449f9201 100644 --- 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 @@ -32,10 +32,10 @@ public interface UserDemandConstant { */ String STAFF="staff"; String RESI="resi"; - + String SYS="sys"; /** - * 创建需求:create;撤销需求:cancel;指派:assign;接单:take_order;完成:finish;; + * 创建需求:create;撤销需求:cancel;指派:assign;接单:take_order;完成:finish;;评价:evaluate * 更新需求:update */ String CREATE="create"; @@ -44,6 +44,7 @@ public interface UserDemandConstant { String ASSIGN="assign"; String TAKE_ORDER="take_order"; String FINISH="finish"; + String EVALUATE="evaluate"; // 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; String VOLUNTEER="volunteer"; @@ -58,4 +59,28 @@ public interface UserDemandConstant { */ String PERSONAL_DATA="personal-data"; String DEMAND_ANALYSIS="demand-analysis"; + + /** + * pc完成情况:完成+评价 + */ + String FINISH_AND_EVALUATE="finish_and_evaluate"; + + String MESSAGE_TITILE="您有一条需求消息"; + String HAVE_SERVICE="您提出的需求将由%s为您解决,请查看"; + String FINISH_DEMAND_MESSAGE="您提出的需求已完成,请进行服务评价。"; + /** + * 您收到来自张三的评价,请查看。 + */ + String DEMAND_EVALUATED=" 您收到来自%s的评价,请查看。"; + String DEMAND_CANCELED=" %s的需求已取消,请查看。"; + + String DEMAND_PUBLISHER="publisher"; + String DEMAND_SERVER="server"; + + String GRANT_POINT_REMARK="完成了%s的需求:%s"; + + String DEFAULT_EVALUATE_REMARK="此用户没有填写内容,由系统默认评分"; + // 完成结果:已解决 resolved,未解决 unresolved + String RESOLVED="resolved"; + String UN_RESOLVED="unresolved"; } 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 index 27f193b978..5aaf4863fb 100644 --- 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 @@ -17,7 +17,7 @@ package com.epmet.controller; -import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO; +import com.epmet.commons.rocketmq.messages.ServerSatisfactionCalFormDTO; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.dto.result.OptionDataResultDTO; @@ -189,8 +189,8 @@ public class IcPartyUnitController { * @return */ @PostMapping("cal-partyunit-satisfation") - public Result calPartyUnitSatisfation(@RequestBody CalPartyUnitSatisfactionFormDTO formDTO){ - ValidatorUtils.validateEntity(formDTO,CalPartyUnitSatisfactionFormDTO.AddUserInternalGroup.class); + public Result calPartyUnitSatisfation(@RequestBody ServerSatisfactionCalFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,ServerSatisfactionCalFormDTO.AddUserInternalGroup.class); icPartyUnitService.calPartyUnitSatisfation(formDTO); return new Result(); } 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 565a7a8423..4bb3a8c969 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 @@ -27,6 +27,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.demand.*; +import com.epmet.dto.result.demand.DemandCategoryResDTO; import com.epmet.dto.result.demand.DemandPageResDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.service.IcResiDemandDictService; @@ -172,8 +173,27 @@ public class IcResiDemandDictController { return new Result>().ok(icResiDemandDictService.querySubCodeList(formDTO)); } + /** + * 居民端,我有需求,分类列表 + * 查询可用的需求 + * + * @param tokenDto + * @return + */ + @PostMapping("category-list") + public Result> queryCategoryList(@LoginUser TokenDto tokenDto){ + return new Result>().ok(icResiDemandDictService.queryCategoryList(tokenDto.getCustomerId())); + } - + /** + * 居民端,我有需求,最近预约,显示最近预约过的五个需求,按照预约时间倒 + * @param tokenDto + * @return + */ + @PostMapping("latest-order") + public Result> queryLatestOrder(@LoginUser TokenDto tokenDto){ + return new Result>().ok(icResiDemandDictService.queryLatestOrder(tokenDto.getUserId(),tokenDto.getCustomerId())); + } 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 index 01a928da76..0eb686a401 100644 --- 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 @@ -17,8 +17,12 @@ package com.epmet.controller; -import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO; +import com.epmet.commons.rocketmq.messages.ServerSatisfactionCalFormDTO; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.constant.MqConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg; +import com.epmet.commons.tools.enums.EventEnum; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; @@ -29,10 +33,6 @@ import com.epmet.constant.UserDemandConstant; import com.epmet.dto.form.SystemMsgFormDTO; import com.epmet.dto.form.demand.*; import com.epmet.dto.result.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; @@ -44,6 +44,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; import java.util.List; @@ -85,7 +86,7 @@ public class IcUserDemandRecController { 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())); + return new Result>().ok(volunteerInfoService.queryListVolunteer(tokenDto.getCustomerId(), formDTO.getStaffId(),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)); @@ -150,10 +151,11 @@ public class IcUserDemandRecController { * @return */ @PostMapping("cancel") - public Result cancel(@LoginUser TokenDto tokenDto,@RequestBody StaffCancelFormDTO formDTO){ + public Result cancel(@LoginUser TokenDto tokenDto,@RequestBody CancelDemandFormDTO formDTO){ formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setUserId(tokenDto.getUserId()); - ValidatorUtils.validateEntity(formDTO,StaffCancelFormDTO.AddUserInternalGroup.class); + formDTO.setUserType(UserDemandConstant.STAFF); + ValidatorUtils.validateEntity(formDTO,CancelDemandFormDTO.AddUserInternalGroup.class); icUserDemandRecService.cancel(formDTO); return new Result(); } @@ -187,16 +189,49 @@ public class IcUserDemandRecController { 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); + formDTO.setType(UserDemandConstant.FINISH_AND_EVALUATE); + formDTO.setUserType(UserDemandConstant.STAFF); + ValidatorUtils.validateEntity(formDTO,FinishStaffFromDTO.IcShowGroup.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); + if(finishResultDTO.getEvaluateFlag()){ + //如果服务方是区域化党建单位,需要实时去计算他的群众满意度=服务过的需求的评价分数相加➗ 需求的总个数。 + if(UserDemandConstant.PARTY_UNIT.equals(finishResultDTO.getServiceType())){ + ServerSatisfactionCalFormDTO mqMsg = new ServerSatisfactionCalFormDTO(); + mqMsg.setCustomerId(formDTO.getCustomerId()); + mqMsg.setServerId(finishResultDTO.getServerId()); + mqMsg.setServiceType(finishResultDTO.getServiceType()); + SystemMsgFormDTO form = new SystemMsgFormDTO(); + form.setMessageType(SystemMessageType.CAL_PARTY_UNIT_SATISFACTION); + form.setContent(mqMsg); + epmetMessageOpenFeignClient.sendSystemMsgByMQ(form); + } else if (UserDemandConstant.VOLUNTEER.equals(finishResultDTO.getServiceType()) + && null != finishResultDTO.getAwardPoint() + && finishResultDTO.getAwardPoint() > NumConstant.ZERO + && UserDemandConstant.RESOLVED.equals(finishResultDTO.getFinishResult())) { + // 志愿者发放积分 + List actPointEventMsgList = new ArrayList<>(); + BasePointEventMsg actPointEventMsg = new BasePointEventMsg(); + actPointEventMsg.setCustomerId(formDTO.getCustomerId()); + actPointEventMsg.setSourceType(MqConstant.SOURCE_TYPE_DEMAND); + actPointEventMsg.setSourceId(formDTO.getDemandRecId()); + actPointEventMsg.setUserId(finishResultDTO.getServerId()); + actPointEventMsg.setActionFlag(MqConstant.PLUS); + actPointEventMsg.setIsCommon(false); + actPointEventMsg.setRemark(finishResultDTO.getRemark()); + actPointEventMsg.setEventTag(EventEnum.FINISH_USER_DEMAND.getEventTag()); + actPointEventMsg.setEventClass(EventEnum.FINISH_USER_DEMAND.getEventClass()); + actPointEventMsg.setEventName(finishResultDTO.getFirstCategoryName()); + actPointEventMsg.setObjectId(finishResultDTO.getCategoryCode()); + actPointEventMsg.setPoint(finishResultDTO.getAwardPoint()); + actPointEventMsgList.add(actPointEventMsg); + SystemMsgFormDTO sendMsgForm = new SystemMsgFormDTO(); + sendMsgForm.setContent(actPointEventMsgList); + sendMsgForm.setMessageType(SystemMessageType.FINISH_USER_DEMAND); + Result mqResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(sendMsgForm); + if (!mqResult.success()) { + log.error(String.format("demandRecId:%s,给志愿者发放积分失败", formDTO.getDemandRecId())); + } + } } return new Result(); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java new file mode 100644 index 0000000000..b798d0fe0c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java @@ -0,0 +1,270 @@ +package com.epmet.controller; + + +import com.epmet.commons.rocketmq.messages.ServerSatisfactionCalFormDTO; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.commons.tools.constant.MqConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.form.PageFormDTO; +import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg; +import com.epmet.commons.tools.enums.EventEnum; +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.AutoEvaluateDemandFormDTO; +import com.epmet.dto.form.SystemMsgFormDTO; +import com.epmet.dto.form.demand.*; +import com.epmet.dto.result.demand.*; +import com.epmet.feign.EpmetMessageOpenFeignClient; +import com.epmet.service.IcUserDemandRecService; +import com.epmet.service.IcUserDemandSatisfactionService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.ArrayList; +import java.util.List; + + +/** + * 居民端-需求相关API 写在这吧 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Slf4j +@RestController +@RequestMapping("residemand") +public class ResiDemandController { + @Autowired + private IcUserDemandRecService icUserDemandRecService; + @Autowired + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; + @Autowired + private IcUserDemandSatisfactionService demandSatisfactionService; + + /** + * 居民端-需求大厅(未处理、处理中、已完成) + * + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("list-hall") + public Result> listHall(@LoginUser TokenDto tokenDto, @RequestBody ListHallFormDTO formDTO) { + formDTO.setCurrentUserId(tokenDto.getUserId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class, ListHallFormDTO.AddUserInternalGroup.class); + return new Result>().ok(icUserDemandRecService.listHall(formDTO)); + } + + /** + * 需求大厅-需求详情 + * + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("detail-hall") + public Result queryDetailHall(@LoginUser TokenDto tokenDto, @RequestBody DemandDetailFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO, DemandDetailFormDTO.AddUserInternalGroup.class); + return new Result().ok(icUserDemandRecService.queryDetailHall(formDTO)); + } + + /** + * 需求大厅-我要接单 + * + * @param tokenDto + * @return + */ + @NoRepeatSubmit + @PostMapping("takeorder") + public Result takeOrder(@LoginUser TokenDto tokenDto, @RequestBody TakeOrderFormDTO formDTO) { + formDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, TakeOrderFormDTO.AddUserInternalGroup.class); + return new Result().ok(icUserDemandRecService.takeOrder(formDTO)); + } + + /** + * 需求大厅-完成需求 + * + * @param tokenDto + * @param formDTO + * @return + */ + @NoRepeatSubmit + @PostMapping("finish") + public Result finish(@LoginUser TokenDto tokenDto, @RequestBody FinishStaffFromDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setType(UserDemandConstant.FINISHED); + if (AppClientConstant.APP_GOV.equals(tokenDto.getApp())) { + formDTO.setUserType(UserDemandConstant.STAFF); + } else if (AppClientConstant.APP_RESI.equals(tokenDto.getApp())) { + formDTO.setUserType(UserDemandConstant.RESI); + } + ValidatorUtils.validateEntity(formDTO, FinishStaffFromDTO.ResiShowGroup.class, FinishStaffFromDTO.AddUserInternalGroup.class); + icUserDemandRecService.finish(formDTO); + return new Result(); + } + + /** + * 我的需求-服务评价 + * 已经完成的可以评价 + * + * @param tokenDto + * @param formDTO + * @return + */ + @NoRepeatSubmit + @PostMapping("evaluate") + public Result evaluate(@LoginUser TokenDto tokenDto, @RequestBody EvaluateDemandFormDTO formDTO) { + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setApp(tokenDto.getApp()); + ValidatorUtils.validateEntity(formDTO, EvaluateDemandFormDTO.ShowGroup.class, EvaluateDemandFormDTO.AddUserInternalGroup.class); + FinishResultDTO finishResultDTO = icUserDemandRecService.evaluate(formDTO); + if(finishResultDTO.getEvaluateFlag()){ + //如果服务方是区域化党建单位,需要实时去计算他的群众满意度=服务过的需求的评价分数相加➗ 需求的总个数。 + if (UserDemandConstant.PARTY_UNIT.equals(finishResultDTO.getServiceType())) { + ServerSatisfactionCalFormDTO mqMsg = new ServerSatisfactionCalFormDTO(); + mqMsg.setCustomerId(formDTO.getCustomerId()); + mqMsg.setServerId(finishResultDTO.getServerId()); + mqMsg.setServiceType(finishResultDTO.getServiceType()); + SystemMsgFormDTO form = new SystemMsgFormDTO(); + form.setMessageType(SystemMessageType.CAL_PARTY_UNIT_SATISFACTION); + form.setContent(mqMsg); + epmetMessageOpenFeignClient.sendSystemMsgByMQ(form); + } else if (UserDemandConstant.VOLUNTEER.equals(finishResultDTO.getServiceType()) + && null != finishResultDTO.getAwardPoint() + && finishResultDTO.getAwardPoint() > NumConstant.ZERO + && UserDemandConstant.RESOLVED.equals(finishResultDTO.getFinishResult())) { + // 志愿者发放积分 + List actPointEventMsgList = new ArrayList<>(); + BasePointEventMsg actPointEventMsg = new BasePointEventMsg(); + actPointEventMsg.setCustomerId(formDTO.getCustomerId()); + actPointEventMsg.setSourceType(MqConstant.SOURCE_TYPE_DEMAND); + actPointEventMsg.setSourceId(formDTO.getDemandRecId()); + actPointEventMsg.setUserId(finishResultDTO.getServerId()); + actPointEventMsg.setActionFlag(MqConstant.PLUS); + actPointEventMsg.setIsCommon(false); + actPointEventMsg.setRemark(finishResultDTO.getRemark()); + actPointEventMsg.setEventTag(EventEnum.FINISH_USER_DEMAND.getEventTag()); + actPointEventMsg.setEventClass(EventEnum.FINISH_USER_DEMAND.getEventClass()); + actPointEventMsg.setEventName(finishResultDTO.getFirstCategoryName()); + actPointEventMsg.setObjectId(finishResultDTO.getCategoryCode()); + actPointEventMsg.setPoint(finishResultDTO.getAwardPoint()); + actPointEventMsgList.add(actPointEventMsg); + SystemMsgFormDTO sendMsgForm = new SystemMsgFormDTO(); + sendMsgForm.setContent(actPointEventMsgList); + sendMsgForm.setMessageType(SystemMessageType.FINISH_USER_DEMAND); + Result mqResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(sendMsgForm); + if (!mqResult.success()) { + log.error(String.format("需求评价完成:demandRecId:%s,给志愿者发放积分失败", formDTO.getDemandRecId())); + } + } + } + return new Result(); + } + + /** + * 我的需求-取消需求 + * 取消,未完成之前都可以取消,pc和居民端小程序内部通用 + * + * @param tokenDto + * @param formDTO + * @return + */ + @NoRepeatSubmit + @PostMapping("cancel") + public Result cancel(@LoginUser TokenDto tokenDto,@RequestBody CancelDemandFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setUserType(UserDemandConstant.RESI); + ValidatorUtils.validateEntity(formDTO,CancelDemandFormDTO.AddUserInternalGroup.class); + icUserDemandRecService.cancel(formDTO); + return new Result(); + } + + /** + * 居民端-我的需求(待处理,处理中,已完成,已取消) + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("mydemand") + public Result> queryMyDemand(@LoginUser TokenDto tokenDto,@RequestBody ResiClientMyDemandFormDTO formDTO){ + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO,PageFormDTO.AddUserInternalGroup.class,ResiClientMyDemandFormDTO.AddUserInternalGroup.class); + return new Result>().ok(icUserDemandRecService.queryMyDemandForResiClient(formDTO)); + } + /** + * 我的需求-需求详情(待处理,处理中,已完成,已取消) + * + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("my-detail") + public Result queryMyDetail(@LoginUser TokenDto tokenDto, @RequestBody DemandDetailFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO, DemandDetailFormDTO.AddUserInternalGroup.class); + return new Result().ok(icUserDemandRecService.queryMyDetail(formDTO)); + } + + /** + * 居民端-我的需求:提交需求,修改需求 + * @param tokenDto + * @param formDTO + * @return + */ + @NoRepeatSubmit + @PostMapping("submit") + public Result saveOrUpdateDemand(@LoginUser TokenDto tokenDto,@RequestBody ReportDemandFormDTO formDTO){ + //需求人默认是当前用户id + formDTO.setDemandUserId(tokenDto.getUserId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + if(StringUtils.isNotBlank(formDTO.getDemandRecId())){ + ValidatorUtils.validateEntity(formDTO,ReportDemandFormDTO.Update.class,ReportDemandFormDTO.UpdateInternalGroup.class); + }else{ + ValidatorUtils.validateEntity(formDTO,ReportDemandFormDTO.Add.class,ReportDemandFormDTO.AddInternalGroup.class); + } + return new Result().ok(icUserDemandRecService.saveOrUpdateDemand(formDTO)); + } + + /** + * 当前用户与需求消息的关系 + * 需求发布人:publisher ;服务人:server + * + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("user-demand-rel") + public Result queryUserDemandRel(@LoginUser TokenDto tokenDto, @RequestBody UserDemandRelFormDTO formDTO) { + formDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, UserDemandRelFormDTO.AddInternalGroup.class); + return new Result().ok(icUserDemandRecService.queryUserDemandRel(formDTO)); + } + + /** + * 服务方填写实际服务时间,并点击确认后。 7天内需求人未作出评价,默认完成情况为已完成,五星好评,为服务方发放积分 + * + * @return + */ + @PostMapping("autoevaluate") + public Result autoEvaluate(@RequestBody AutoEvaluateDemandFormDTO formDTO){ + demandSatisfactionService.evaluateDemandAuto(formDTO); + return new Result(); + } +} 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 6205fb524a..39da0690af 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 @@ -60,8 +60,11 @@ public class ResiVolunteerController { **/ @PostMapping("authenticate") public Result authenticate(@LoginUser TokenDto tokenDto, @RequestBody ResiVolunteerAuthenticateFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO, ResiVolunteerAuthenticateFormDTO.AddUserInternalGroup.class, ResiVolunteerAuthenticateFormDTO.AddUserShowGroup.class); - return volunteerInfoService.authenticate(tokenDto, formDTO); + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO, ResiVolunteerAuthenticateFormDTO.AddUserShowGroup.class, ResiVolunteerAuthenticateFormDTO.AddUserInternalGroup.class); + volunteerInfoService.authenticate(formDTO); + return new Result(); } /** @@ -125,7 +128,7 @@ public class ResiVolunteerController { */ @PostMapping("listprofile") public Result> queryListVolunteer(@LoginUser TokenDto tokenDto,@RequestBody ServiceQueryFormDTO formDTO){ - return new Result>().ok(volunteerInfoService.queryListVolunteer(tokenDto.getCustomerId(),formDTO.getServiceName())); + return new Result>().ok(volunteerInfoService.queryListVolunteer(tokenDto.getCustomerId(),tokenDto.getUserId(),formDTO.getServiceName())); } /** @@ -135,13 +138,11 @@ public class ResiVolunteerController { */ @PostMapping("page") public Result> queryVolunteerPage(@RequestBody VolunteerCommonFormDTO input) { - - ValidatorUtils.validateEntity(input, VolunteerCommonFormDTO.VolunteerPage.class); - Integer pageNo = input.getPageNo(); Integer pageSize = input.getPageSize(); String customerId = input.getCustomerId(); - List l = volunteerInfoService.queryVolunteerPage(customerId, pageNo, pageSize); + String agencyId = input.getAgencyId(); + List l = volunteerInfoService.queryVolunteerPage(customerId, pageNo, pageSize, agencyId); return new Result>().ok(l); } @@ -152,10 +153,10 @@ public class ResiVolunteerController { */ @PostMapping("count") public Result getVolunteerCount(@RequestBody VolunteerCommonFormDTO input) { - ValidatorUtils.validateEntity(input, VolunteerCommonFormDTO.VolunteerPage.class); String customerId = input.getCustomerId(); + String agencyId = input.getAgencyId(); - Integer volunteerCount = volunteerInfoService.getVolunteerCount(customerId); + Integer volunteerCount = volunteerInfoService.getVolunteerCount(customerId, agencyId); return new Result().ok(volunteerCount); } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java index fb0a64e4dc..1383924f57 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java @@ -1,7 +1,10 @@ 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.constant.ActConstant; import com.epmet.dto.form.work.*; import com.epmet.dto.result.work.*; import com.epmet.service.WorkActService; @@ -69,6 +72,23 @@ public class WorkActController { return new Result().ok(workActService.publishAct(formDTO)); } + @PostMapping("publishV2") + public Result publishActV2(@RequestBody PublishActInfoFormDTO formDTO) { + if (ActConstant.HEART.equals(formDTO.getActType())) { + ValidatorUtils.validateEntity(formDTO, PublishActInfoFormDTO.AddUserShowGroup.class, PublishActInfoFormDTO.AddUserInternalGroup.class); + } else { + ValidatorUtils.validateEntity(formDTO, PublishActInfoFormDTO.AddUserShowGroup.class, + PublishActInfoFormDTO.AddUserInternalGroup.class, PublishActInfoFormDTO.AddPartyActivityGroup.class); + } + for (PublishActContentFormDTO actContentFormDTO : formDTO.getActContent()) { + ValidatorUtils.validateEntity(actContentFormDTO, + PublishActContentFormDTO.UserShowGroup.class, + PublishActContentFormDTO.UserInternalGroup.class + ); + } + return new Result().ok(workActService.publishActV2(formDTO)); + } + /** * @return com.epmet.commons.tools.utils.Result * @param formDTO @@ -130,9 +150,9 @@ public class WorkActController { * @Date 2020/7/26 18:00 **/ @PostMapping("canceleddetail") - public Result canceledDetail(@RequestBody ActIdFormDTO actIdFormDTO) { + public Result canceledDetail(@LoginUser TokenDto tokenDto, @RequestBody ActIdFormDTO actIdFormDTO) { ValidatorUtils.validateEntity(actIdFormDTO, ActIdFormDTO.AddUserInternalGroup.class); - return new Result().ok(workActService.canceledDetail(actIdFormDTO.getActId())); + return new Result().ok(workActService.canceledDetail(tokenDto.getCustomerId(), actIdFormDTO.getActId())); } /** @@ -158,8 +178,9 @@ public class WorkActController { * @Date 2020/7/26 21:01 **/ @PostMapping("finisheddetail") - public Result finishedDeatil(@RequestBody ActIdFormDTO formDTO) { + public Result finishedDeatil(@LoginUser TokenDto tokenDto, @RequestBody ActIdFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); return new Result().ok(workActService.finishedDeatil(formDTO)); } @@ -171,9 +192,10 @@ public class WorkActController { * @Date 2020/7/26 21:33 **/ @PostMapping("inprogressdetail") - public Result inProgressDetail(@RequestBody ActIdFormDTO formDTO) { + public Result inProgressDetail(@LoginUser TokenDto tokenDto, @RequestBody ActIdFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class); - return new Result().ok(workActService.inProgressDetail(formDTO.getActId())); + + return new Result().ok(workActService.inProgressDetail(tokenDto.getCustomerId(), formDTO.getActId())); } /** @@ -229,9 +251,9 @@ public class WorkActController { * @Date 2020/7/27 13:36 **/ @PostMapping("getactinfo") - public Result getActInfo(@RequestBody ActIdFormDTO formDTO){ + public Result getActInfo(@LoginUser TokenDto tokenDto, @RequestBody ActIdFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class); - return new Result().ok(workActService.getActInfo(formDTO.getActId())); + return new Result().ok(workActService.getActInfo(tokenDto.getCustomerId(), formDTO.getActId())); } /** @@ -253,5 +275,21 @@ public class WorkActController { return new Result().ok(workActService.rePublish(rePublishFormDTO)); } + @PostMapping("republishV2") + public Result rePublishV2(@RequestBody RePublishFormDTO rePublishFormDTO) { + if (ActConstant.HEART.equals(rePublishFormDTO.getActType())) { + ValidatorUtils.validateEntity(rePublishFormDTO, PublishActInfoFormDTO.AddUserShowGroup.class, PublishActInfoFormDTO.AddUserInternalGroup.class); + } else { + ValidatorUtils.validateEntity(rePublishFormDTO, RePublishFormDTO.AddUserShowGroup.class, RePublishFormDTO.AddUserInternalGroup.class); + } + for (PublishActContentFormDTO actContentFormDTO : rePublishFormDTO.getActContent()) { + ValidatorUtils.validateEntity(actContentFormDTO, + PublishActContentFormDTO.UserShowGroup.class, + PublishActContentFormDTO.UserInternalGroup.class + ); + } + return new Result().ok(workActService.rePublishV2(rePublishFormDTO)); + } + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java index e960a2f926..9d018d7d81 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java @@ -1,5 +1,7 @@ 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.work.*; @@ -82,8 +84,9 @@ public class WorkActDraftController { * @Date 2020/7/21 17:24 **/ @PostMapping("preview") - public Result previewActDetail(@RequestBody ActPreviewFormDTO formDTO){ + public Result previewActDetail(@LoginUser TokenDto tokenDto, @RequestBody ActPreviewFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO,ActPreviewFormDTO.UserInternalGroup.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); ActPreviewResultDTO resultDTO=workActDraftService.previewActDetail(formDTO); return new Result().ok(resultDTO); } 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 211ab20e8d..73ad65dcd6 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,7 @@ 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.DemandCategoryResDTO; import com.epmet.dto.result.demand.DemandPageResDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.entity.IcResiDemandDictEntity; @@ -66,4 +67,14 @@ public interface IcResiDemandDictDao extends BaseDao { List selectSecondCodes(@Param("customerId") String customerId, @Param("cateogryCodes") List categoryCodes); String selectNameByCode(@Param("customerId")String customerId, @Param("categoryCode") String categoryCode); + + IcResiDemandDictEntity selectByCode(@Param("customerId") String customerId, @Param("categoryCode") String categoryCode); + + /** + * 查询分类信息,限制未被禁用的 + * @param customerId + * @param categoryCodes + * @return + */ + List selectListByCodes(@Param("customerId") String customerId, @Param("categoryCodes") List categoryCodes); } \ 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 index 6c36e11618..27eaa8c689 100644 --- 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 @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.IcUserDemandRecDTO; import com.epmet.dto.form.demand.IcResiUserDemandFromDTO; import com.epmet.dto.form.demand.PageListAnalysisFormDTO; import com.epmet.dto.form.demand.UserDemandPageFormDTO; @@ -85,5 +86,36 @@ public interface IcUserDemandRecDao extends BaseDao { @Param("startDateId") String startDateId, @Param("endDateId") String endDateId); - List selectGroupByPartyUnit(@Param("customerId") String customerId, @Param("partyUnitId") String partyUnitId); + List selectGroupByServer(@Param("customerId") String customerId, + @Param("serverId") String serverId, + @Param("serviceType") String serviceType); + + /** + * 居民端-需求大厅(未处理、处理中、已完成) + * 未处理:未指派、未接单;处理中:已指派、已接单给我的 ;已完成:我填写实际服务时间,并点击确认 + * + * @param gridId + * @param type 未处理:unprocessed;处理中:processing;已完成:finished + * @param currentUserId 当前用户自己提出的,不在这展示,在我的需求里面展示 + * @return + */ + List selectListDemandHall(@Param("gridId") String gridId, + @Param("type") String type, + @Param("currentUserId") String currentUserId); + /** + * 居民端-我的需求(待处理,处理中,已完成,已取消) + * + * @param gridId + * @param type 待处理:unprocessed;处理中:processing;已完成:finished;已取消:canceled + * @return demandUserId 需求人id + */ + List queryMyDemandForResiClient(@Param("gridId") String gridId, + @Param("type")String type, + @Param("demandUserId")String demandUserId); + + List selectNoEvaluate(@Param("customerId")String customerId, + @Param("exceedValue")Integer exceedValue, + @Param("type")String type); + + int evaluate(@Param("demandRecId")String demandRecId, @Param("finishResult")String finishResult); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActInfoEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActInfoEntity.java index e227b29ed5..191e639b24 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActInfoEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActInfoEntity.java @@ -18,7 +18,6 @@ package com.epmet.entity; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; @@ -217,4 +216,24 @@ public class ActInfoEntity extends BaseEpmetEntity { */ private Boolean summaryFlag; + /** + * 活动类型爱心活动heart 联建活动party + */ + private String actType; + + /** + * 联建单位 + */ + private String unitId; + + /** + * 活动目标 + */ + private String target; + + /** + * 服务事项 + */ + private String serviceMatter; + } 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 index 529bb4f34a..4919fdd133 100644 --- 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 @@ -53,6 +53,11 @@ public class IcPartyActivityEntity extends BaseEpmetEntity { */ private String pids; + /** + * act_info表ID + */ + private String actId; + /** * 单位ID */ 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 1b9a30b755..73ed4137d9 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 @@ -79,4 +79,5 @@ public class IcResiDemandDictEntity extends BaseEpmetEntity { * 1可用,0不可用,11.17 */ private Boolean usableFlag; + } 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 index 9b6afa0aea..127bc1c9e3 100644 --- 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 @@ -59,7 +59,7 @@ public class IcUserDemandOperateLogEntity extends BaseEpmetEntity { private String userId; /** - * 创建需求:create;撤销需求:cancel;指派:assign;接单:take_order;完成:finish; + * 创建需求:create;更新需求:update;撤销需求:cancel;指派:assign;接单:take_order;完成:finish;评价:evaluate */ private String actionCode; 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 index 5979d780ed..0d54cd6184 100644 --- 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 @@ -143,4 +143,32 @@ public class IcUserDemandRecEntity extends BaseEpmetEntity { */ private Boolean evaluateFlag; + /** + * 奖励积分 + */ + private Integer awardPoint; + + /** + * 服务地点,工作端指派默认居民居住房屋地址,居民端地图选择 + */ + private String serviceLocation; + + /** + * 门牌号详细地址 + */ + private String locationDetail; + + /** + * 经度,需求人是ic的居民时,取所住楼栋的中心点位 + */ + private String longitude; + + /** + * 纬度,需求人是ic的居民时,取所住楼栋的中心点位 + */ + private String latitude; + /** + * 需求人是ic的居民时,记录下住的房屋id + */ + private String demandUserHouseId; } 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 index bae8aaaff0..819fb8239d 100644 --- 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 @@ -50,7 +50,7 @@ public class IcUserDemandSatisfactionEntity extends BaseEpmetEntity { private String demandRecId; /** - * 当前操作用户属于哪个端?工作端:staff;居民端:resi + * 当前操作用户属于哪个端?工作端:staff;居民端:resi;系统操作:sys */ private String userType; @@ -69,4 +69,8 @@ public class IcUserDemandSatisfactionEntity extends BaseEpmetEntity { */ private BigDecimal score; + /** + * 评价时,填写的完成情况 + */ + private String remark; } 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 index b2b95ec5d4..2dd6b4ca04 100644 --- 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 @@ -69,7 +69,7 @@ public class IcUserDemandServiceEntity extends BaseEpmetEntity { private Date serviceEndTime; /** - * 完成情况 + * 此列暂时没有用。完成情况在ic_user_demand_satisfaction.remark */ private String finishDesc; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java index 706cf0668b..491ed210f8 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java @@ -182,4 +182,24 @@ public class LatestActInfoEntity extends BaseEpmetEntity { * 数据库新增ACT_INFO_ID字段,act_info.id */ private String actInfoId; + + /** + * 活动类型爱心活动heart 联建活动party + */ + private String actType; + + /** + * 联建单位 + */ + private String unitId; + + /** + * 活动目标 + */ + private String target; + + /** + * 服务事项 + */ + private String serviceMatter; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/VolunteerInfoEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/VolunteerInfoEntity.java index fcce38bc75..0f12f0f710 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/VolunteerInfoEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/VolunteerInfoEntity.java @@ -18,13 +18,10 @@ 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; - /** * 志愿者信息 * @@ -67,4 +64,12 @@ public class VolunteerInfoEntity extends BaseEpmetEntity { * 志愿者注册,所在网格名称 */ private String gridName; + /** + * 网格所属的组织id + */ + private String pid; + /** + * 网格的所有上级 + */ + private String pids; } 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 index 3f599eefc0..2278c905e7 100644 --- 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 @@ -4,7 +4,7 @@ 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 com.epmet.mq.listener.ServerSatisfactionCalEventListener; import org.apache.rocketmq.common.protocol.heartbeat.MessageModel; import org.springframework.stereotype.Component; @@ -20,11 +20,11 @@ public class RocketMQConsumerRegister extends MQAbstractRegister { public void registerAllListeners(String env, MQConsumerProperties consumerProperties) { // 客户初始化监听器注册 register(consumerProperties, - ConsomerGroupConstants.CAL_PARTY_UNIT_SATISFACTION, + ConsomerGroupConstants.USER_DEMAND_FINISH_GROUP, MessageModel.CLUSTERING, - TopicConstants.CAL_PARTY_UNIT_SATISFACTION, + TopicConstants.USER_DEMAND, "*", - new PartyUnitSatisfactionCalEventListener()); + new ServerSatisfactionCalEventListener()); // ...其他监听器类似 } 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/ServerSatisfactionCalEventListener.java similarity index 77% rename from epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/listener/PartyUnitSatisfactionCalEventListener.java rename to epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/listener/ServerSatisfactionCalEventListener.java index b7c3abc938..606a3801c3 100644 --- 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/ServerSatisfactionCalEventListener.java @@ -2,13 +2,14 @@ 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.rocketmq.messages.ServerSatisfactionCalFormDTO; 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.constant.SystemMessageType; import com.epmet.service.IcPartyUnitService; import org.apache.commons.lang.StringUtils; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; @@ -22,13 +23,7 @@ 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 { - +public class ServerSatisfactionCalEventListener implements MessageListenerConcurrently { private Logger logger = LoggerFactory.getLogger(getClass()); private RedisUtils redisUtils; @@ -57,23 +52,28 @@ public class PartyUnitSatisfactionCalEventListener implements MessageListenerCon String tags = messageExt.getTags(); String pendingMsgLabel = messageExt.getUserProperty(MQUserPropertys.BLOCKED_MSG_LABEL); - logger.info("【计算区域化党建单位群众满意度事件监听器】-需求完成-收到消息内容:{},操作:{}", msg, tags); - CalPartyUnitSatisfactionFormDTO obj = JSON.parseObject(msg, CalPartyUnitSatisfactionFormDTO.class); + logger.info("【需求完成计算服务方群众满意度事件监听器】-需求完成-收到消息内容:{},操作:{}", msg, tags); + ServerSatisfactionCalFormDTO obj = JSON.parseObject(msg, ServerSatisfactionCalFormDTO.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()), + lock = distributedLock.getLock(String.format("lock:user_demand:%s", obj.getCustomerId()), 30L, 30L, TimeUnit.SECONDS); - //待执行方法 - SpringContextUtils.getBean(IcPartyUnitService.class).calPartyUnitSatisfation(obj); + switch (tags) { + case SystemMessageType.CAL_PARTY_UNIT_SATISFACTION: + //区域化党建单位-计算群众满意度 + SpringContextUtils.getBean(IcPartyUnitService.class).calPartyUnitSatisfation(obj); + break; + //后面社会组织、社区自组织可能都会计算....先预备着 + } } catch (RenException e) { // 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试 - logger.error("【计算区域化党建单位群众满意度事件监听器】-MQ失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + logger.error("【需求完成计算服务方群众满意度事件监听器】-MQ失败:".concat(ExceptionUtils.getErrorStackTrace(e))); } catch (Exception e) { // 不是我们自己抛出的异常,可以让MQ重试 - logger.error("【计算区域化党建单位群众满意度监听器】-MQ失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + logger.error("【需求完成计算服务方群众满意度监听器】-MQ失败:".concat(ExceptionUtils.getErrorStackTrace(e))); throw e; } finally { distributedLock.unLock(lock); @@ -83,7 +83,7 @@ public class PartyUnitSatisfactionCalEventListener implements MessageListenerCon try { removePendingMqMsgCache(pendingMsgLabel); } catch (Exception e) { - logger.error("【计算区域化党建单位群众满意度监听器】-删除mq阻塞消息缓存失败:{}", ExceptionUtils.getErrorStackTrace(e)); + logger.error("【需求完成计算服务方群众满意度监听器】-删除mq阻塞消息缓存失败:{}", ExceptionUtils.getErrorStackTrace(e)); } } } 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 index 4445d2f82b..9f8c8f4682 100644 --- 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 @@ -158,4 +158,6 @@ public interface IcCommunitySelfOrganizationService extends BaseService queryListById(List communityOrgIds); } \ 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 index c3931bbd0b..c36db9b2d6 100644 --- 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 @@ -117,4 +117,22 @@ public interface IcPartyActivityService extends BaseService getActivityList(TokenDto tokenDto, PartyActivityFormDTO formDTO); + + /** + * 根据爱心活动ID获取联建活动 + * @Param actId + * @Return {@link IcPartyActivityDTO} + * @Author zhaoqifeng + * @Date 2021/12/23 16:13 + */ + IcPartyActivityDTO getActivityByActId(String actId); + + /** + * 根据爱心活动ID删除联建活动 + * @Param actId + * @Return {@link IcPartyActivityDTO} + * @Author zhaoqifeng + * @Date 2021/12/23 16:13 + */ + void deleteByActId(String actId); } \ 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 index b844a95bf6..22e69d652e 100644 --- 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 @@ -18,8 +18,8 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.rocketmq.messages.ServerSatisfactionCalFormDTO; import com.epmet.commons.tools.dto.result.OptionDataResultDTO; -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; @@ -156,5 +156,7 @@ public interface IcPartyUnitService extends BaseService { * 计算区域化党建单位的群众满意度 * @param formDTO */ - void calPartyUnitSatisfation(CalPartyUnitSatisfactionFormDTO formDTO); + void calPartyUnitSatisfation(ServerSatisfactionCalFormDTO formDTO); + + List queryListById(List partyUnitIds); } \ 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 12cbaf7dad..b3adf2301c 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 @@ -22,6 +22,7 @@ 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.form.demand.*; +import com.epmet.dto.result.demand.DemandCategoryResDTO; import com.epmet.dto.result.demand.DemandPageResDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.entity.IcResiDemandDictEntity; @@ -119,4 +120,30 @@ public interface IcResiDemandDictService extends BaseService queryCategoryList(String customerId); + + /** + * 居民端,我有需求,最近预约,显示最近预约过的五个需求,按照预约时间倒 + * @param userId + * @param customerId + * @return + */ + List queryLatestOrder(String userId, String customerId); } \ 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 index f2646de029..0147c948f1 100644 --- 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 @@ -75,4 +75,5 @@ public interface IcSocietyOrgService extends BaseService { **/ List importExcel(String customerId, List list, String staffId, List numList) throws ParseException; + List queryListById(List socialOrgIds); } \ 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 index d17b6b3bfc..da3fd68cdf 100644 --- 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 @@ -21,16 +21,10 @@ 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.CategoryAnalysisResDTO; -import com.epmet.dto.result.demand.DemandRecResultDTO; -import com.epmet.dto.result.demand.DemandResearchAnalysisResultDTO; -import com.epmet.dto.result.demand.FinishResultDTO; -import com.epmet.dto.result.demand.IcResiUserReportDemandRes; -import com.epmet.dto.result.demand.ServiceStatDTO; +import com.epmet.dto.result.demand.*; import com.epmet.entity.IcUserDemandRecEntity; import java.util.List; -import java.util.Map; /** * 居民需求记录表 @@ -40,25 +34,6 @@ import java.util.Map; */ 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); /** * 单条查询 @@ -70,16 +45,6 @@ public interface IcUserDemandRecService extends BaseService pageList(UserDemandPageFormDTO formDTO); /** - * 未完成之前都可以取消 + * 未完成之前都可以取消,pc和居民端小程序内部通用 * * @param formDTO */ - void cancel(StaffCancelFormDTO formDTO); + void cancel(CancelDemandFormDTO formDTO); /** * 指派 @@ -176,8 +141,77 @@ public interface IcUserDemandRecService extends BaseService groupByServer(String customerId, String serverId,String serviceType); + + /** + * 居民端-需求大厅(未处理、处理中、已完成) + * @param formDTO + * @return + */ + List listHall(ListHallFormDTO formDTO); + + /** + * 需求大厅-需求详情 + * @param formDTO + * @return + */ + DemandDetailResDTO queryDetailHall(DemandDetailFormDTO formDTO); + + /** + * 需求大厅-我要接单 + * @param formDTO * @return */ - List groupByPartyUnit(String customerId, String partyUnitId); + TakeOrderResultDTO takeOrder(TakeOrderFormDTO formDTO); + + /** + * 居民端-我的需求-服务评价 + * + * @param formDTO + * @return + */ + FinishResultDTO evaluate(EvaluateDemandFormDTO formDTO); + + /** + * 居民端,我有需求,最近预约,显示最近预约过的五个需求,按照预约时间倒 + * 查询最近预约的5个编码 + * + * @param userId + * @return + */ + List getLatestRegCode(String userId); + + /** + * 居民端-我的需求(待处理,处理中,已完成,已取消) + * @param formDTO + * @return + */ + List queryMyDemandForResiClient(ResiClientMyDemandFormDTO formDTO); + + /** + * 我的需求-需求详情(待处理,处理中,已完成,已取消) + * @param formDTO + * @return + */ + DemandDetailResDTO queryMyDetail(DemandDetailFormDTO formDTO); + + /** + * 居民端-我的需求:提交需求,修改需求 + * @param formDTO + * @return + */ + DemandRecId saveOrUpdateDemand(ReportDemandFormDTO formDTO); + + /** + * 当前用户与需求消息的关系 需求发布人:publisher ;服务人:server + * + * @param formDTO + * @return + */ + UserDemandRelResDTO queryUserDemandRel(UserDemandRelFormDTO formDTO); + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandSatisfactionService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandSatisfactionService.java new file mode 100644 index 0000000000..935064aa49 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandSatisfactionService.java @@ -0,0 +1,14 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.form.AutoEvaluateDemandFormDTO; +import com.epmet.entity.IcUserDemandSatisfactionEntity; + +public interface IcUserDemandSatisfactionService extends BaseService { + /** + * + * @param formDTO + * @return + */ + void evaluateDemandAuto(AutoEvaluateDemandFormDTO formDTO); +} 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 4fa082f5e3..f9db916bbe 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 @@ -42,13 +42,12 @@ public interface VolunteerInfoService extends BaseService { /** * 志愿者认证 * - * @param tokenDto * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:09 2020-07-23 **/ - Result authenticate(TokenDto tokenDto, ResiVolunteerAuthenticateFormDTO formDTO); + void authenticate(ResiVolunteerAuthenticateFormDTO formDTO); /** * 志愿者认证界面,获取用户基础信息+志愿者信息 @@ -94,14 +93,22 @@ public interface VolunteerInfoService extends BaseService { * @param customerId * @return */ - List queryListVolunteer(String customerId,String userRealName); + List queryListVolunteer(String customerId,String staffId,String userRealName); - List queryVolunteerPage(String customerId, Integer pageNo, Integer pageSize); + /** + * @param customerId + * @param pageNo + * @param pageSize + * @param agencyId 组织ID,使用PIDS like,查询该组织"及下级"所有志愿者 + * @return + */ + List queryVolunteerPage(String customerId, Integer pageNo, Integer pageSize, String agencyId); /** * 查询志愿者数量 * @param customerId + * @param agencyId 组织ID,查询该组织"及下级"下所有的志愿者 * @return */ - Integer getVolunteerCount(String customerId); + Integer getVolunteerCount(String customerId, String agencyId); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java index bc72cc7d67..d470f3571f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java @@ -38,7 +38,7 @@ public interface WorkActService { * @Date 2020/7/21 18:33 **/ PublishActResultDTO publishAct(PublishActInfoFormDTO formDTO); - + PublishActResultDTO publishActV2(PublishActInfoFormDTO formDTO); /** * @return com.epmet.dto.result.work.InProgressActResultDTO * @param formDTO @@ -82,7 +82,7 @@ public interface WorkActService { * @description 已取消-活动详情 * @Date 2020/7/26 18:00 **/ - CanceledActDetailResultDTO canceledDetail(String actId); + CanceledActDetailResultDTO canceledDetail(String customerId, String actId); /** * @return void @@ -109,7 +109,7 @@ public interface WorkActService { * @description 进行中-活动详情 * @Date 2020/7/26 21:34 **/ - InProgressActDetailResultDTO inProgressDetail(String actId); + InProgressActDetailResultDTO inProgressDetail(String customerId, String actId); /** * @return void @@ -136,7 +136,7 @@ public interface WorkActService { * @description 重新编辑-获取活动详情 * @Date 2020/7/27 13:36 **/ - ReEditActInfoResultDTO getActInfo(String actId); + ReEditActInfoResultDTO getActInfo(String customerId, String actId); /** * @return com.epmet.dto.result.work.PublishActResultDTO @@ -146,6 +146,6 @@ public interface WorkActService { * @Date 2020/7/27 13:55 **/ PublishActResultDTO rePublish(RePublishFormDTO rePublishFormDTO); - + PublishActResultDTO rePublishV2(RePublishFormDTO rePublishFormDTO); void testGrantPoint(TestGrantFormDTO formDTO); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java index eb2cd42af7..983c4834a2 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java @@ -22,6 +22,7 @@ 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.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; @@ -33,12 +34,17 @@ import com.epmet.dao.ActInfoDao; import com.epmet.dao.ActUserRelationDao; import com.epmet.dao.HeartUserInfoDao; import com.epmet.dto.ActInfoDTO; +import com.epmet.dto.IcPartyUnitDTO; +import com.epmet.dto.form.demand.SubCodeFormDTO; import com.epmet.dto.form.resi.*; +import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.resi.*; import com.epmet.entity.ActInfoEntity; import com.epmet.entity.ActUserRelationEntity; import com.epmet.service.ActInfoService; import com.epmet.service.ActUserRelationService; +import com.epmet.service.IcPartyUnitService; +import com.epmet.service.IcResiDemandDictService; import com.epmet.utils.CaculateDistance; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; @@ -47,7 +53,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import javax.annotation.Resource; import java.util.*; +import java.util.stream.Collectors; /** * 活动信息 @@ -68,6 +76,10 @@ public class ActInfoServiceImpl extends BaseServiceImpl page(Map params) { @@ -245,6 +257,20 @@ public class ActInfoServiceImpl extends BaseServiceImpl categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + detailResultDTO.setServiceMatterName(categoryMap.get(detailResultDTO.getServiceMatter())); + } + if (StringUtils.isNotBlank(detailResultDTO.getUnitId())) { + //获取单位名称 + IcPartyUnitDTO unitDTO = icPartyUnitService.get(detailResultDTO.getUnitId()); + detailResultDTO.setUnitName(null != unitDTO ? unitDTO.getUnitName() : StrConstant.EPMETY_STR); + } return new Result().ok(detailResultDTO); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java index c745c98192..3c7d9a6647 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java @@ -36,16 +36,19 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.commons.tools.utils.SendMqMsgUtils; +import com.epmet.constant.SystemMessageType; import com.epmet.dao.ActLivePicDao; import com.epmet.dao.ActLiveRecDao; import com.epmet.dto.ActInfoDTO; import com.epmet.dto.ActLivePicDTO; import com.epmet.dto.ActLiveRecDTO; +import com.epmet.dto.form.SystemMsgFormDTO; import com.epmet.dto.form.resi.ResiActInsertLiveFormDTO; import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.dto.result.resi.ResiActLiveRecResultDTO; import com.epmet.entity.ActLivePicEntity; import com.epmet.entity.ActLiveRecEntity; +import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.redis.ActLiveRecRedis; import com.epmet.service.ActInfoService; @@ -80,6 +83,9 @@ public class ActLiveRecServiceImpl extends BaseServiceImpl actPointEventMsgList=new ArrayList<>(); BasePointEventMsg actPointEventMsg=new BasePointEventMsg(); actPointEventMsg.setCustomerId(formDTO.getCustomerId()); @@ -242,8 +248,14 @@ public class ActLiveRecServiceImpl extends BaseServiceImpl queryListById(List communityOrgIds) { + if(CollectionUtils.isNotEmpty(communityOrgIds)){ + return baseDao.selectBatchIds(communityOrgIds); + } + return Collections.EMPTY_LIST; + } + } 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 index bfb076ac96..67391ef70c 100644 --- 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 @@ -383,6 +383,40 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl(dtoList, pageInfo.getTotal()); } + /** + * 根据爱心活动ID获取联建活动 + * + * @param actId + * @Param actId + * @Return {@link IcPartyActivityDTO} + * @Author zhaoqifeng + * @Date 2021/12/23 16:13 + */ + @Override + public IcPartyActivityDTO getActivityByActId(String actId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPartyActivityEntity::getActId, actId); + IcPartyActivityEntity entity = baseDao.selectOne(wrapper); + return ConvertUtils.sourceToTarget(entity, IcPartyActivityDTO.class); + } + + /** + * 根据爱心活动ID删除联建活动 + * + * @param actId + * @Param actId + * @Return {@link IcPartyActivityDTO} + * @Author zhaoqifeng + * @Date 2021/12/23 16:13 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteByActId(String actId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPartyActivityEntity::getActId, actId); + baseDao.delete(wrapper); + } + /** * 近30天开始时间和结束时间 (精确到秒) * @Param formDTO 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 index 228887fb76..3850acd354 100644 --- 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 @@ -22,7 +22,7 @@ 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.rocketmq.messages.ServerSatisfactionCalFormDTO; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; @@ -459,10 +459,11 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl list = icUserDemandRecService.groupByPartyUnit(formDTO.getCustomerId(), formDTO.getPartyUnitId()); + List list = icUserDemandRecService.groupByServer(formDTO.getCustomerId(), formDTO.getServerId(),formDTO.getServiceType()); for (ServiceStatDTO serviceStatDTO : list) { if (0 != serviceStatDTO.getDemandCount()) { BigDecimal result = serviceStatDTO.getTotalScore().divide(new BigDecimal(serviceStatDTO.getDemandCount()), 4, BigDecimal.ROUND_HALF_UP); @@ -471,6 +472,14 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl queryListById(List partyUnitIds) { + if(CollectionUtils.isNotEmpty(partyUnitIds)){ + return baseDao.selectBatchIds(partyUnitIds); + } + return Collections.EMPTY_LIST; + } + 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()); 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 8dfd1599cf..0e352910c6 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 @@ -17,6 +17,7 @@ package com.epmet.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; @@ -24,27 +25,29 @@ 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.EpmetException; 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.form.demand.*; +import com.epmet.dto.result.demand.DemandCategoryResDTO; 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.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.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Map; +import java.util.*; /** * 居民需求字典表 @@ -55,6 +58,8 @@ import java.util.Map; @Slf4j @Service public class IcResiDemandDictServiceImpl extends BaseServiceImpl implements IcResiDemandDictService { + @Autowired + private IcUserDemandRecService icUserDemandRecService; /** * 分页查询 @@ -78,7 +83,7 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl NumConstant.ZERO) { // 名称唯一 - throw new RenException(EpmetErrorCode.DEMAND_NAME_EXITED.getCode(), EpmetErrorCode.DEMAND_NAME_EXITED.getMsg()); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("【%s】已存在", formDTO.getCategoryName()), "分类名称已存在"); } IcResiDemandDictEntity entity = new IcResiDemandDictEntity(); @@ -105,7 +110,7 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl NumConstant.ZERO) { // 名称唯一 - throw new RenException(EpmetErrorCode.DEMAND_NAME_EXITED.getCode(), EpmetErrorCode.DEMAND_NAME_EXITED.getMsg()); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("【%s】已存在", formDTO.getCategoryName()), "分类名称已存在"); } IcResiDemandDictEntity entity = new IcResiDemandDictEntity(); @@ -158,7 +163,7 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl NumConstant.ZERO) { // 名称唯一 - throw new RenException(EpmetErrorCode.DEMAND_NAME_EXITED.getCode(), EpmetErrorCode.DEMAND_NAME_EXITED.getMsg()); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("【%s】已存在", formDTO.getCategoryName()), "分类名称已存在"); } origin.setCategoryName(formDTO.getCategoryName()); if (NumConstant.TWO == origin.getLevel()) { @@ -258,5 +263,66 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl queryCategoryList(String customerId) { + List list=new ArrayList<>(); + LambdaQueryWrapper wrapper=new LambdaQueryWrapper(); + wrapper.eq(IcResiDemandDictEntity::getCustomerId,customerId); + wrapper.eq(IcResiDemandDictEntity::getUsableFlag,true); + wrapper.eq(IcResiDemandDictEntity::getParentCode,NumConstant.ZERO_STR); + wrapper.orderByAsc(IcResiDemandDictEntity::getSort); + List first=baseDao.selectList(wrapper); + first.forEach(dto->{ + DemandCategoryResDTO resultDto= ConvertUtils.sourceToTarget(dto,DemandCategoryResDTO.class); + resultDto.setCategoryId(dto.getId()); + + LambdaQueryWrapper query=new LambdaQueryWrapper(); + query.eq(IcResiDemandDictEntity::getCustomerId,customerId); + query.eq(IcResiDemandDictEntity::getUsableFlag,true); + query.eq(IcResiDemandDictEntity::getParentCode,dto.getCategoryCode()); + query.orderByAsc(IcResiDemandDictEntity::getSort); + List sub=baseDao.selectList(query); + + List children=new ArrayList<>(); + sub.forEach(subDto->{ + DemandCategoryResDTO subDTO= ConvertUtils.sourceToTarget(subDto,DemandCategoryResDTO.class); + subDTO.setCategoryId(subDto.getId()); + children.add(subDTO); + }); + resultDto.setChildren(children); + list.add(resultDto); + }); + return list; + } + + /** + * 居民端,我有需求,最近预约,显示最近预约过的五个需求,按照预约时间倒 + * + * @param userId + * @param customerId + * @return + */ + @Override + public List queryLatestOrder(String userId, String customerId) { + List categoryCodes=icUserDemandRecService.getLatestRegCode(userId); + if(CollectionUtils.isNotEmpty(categoryCodes)){ + //限制未被禁用的 + return baseDao.selectListByCodes(customerId,categoryCodes); + } + return new ArrayList<>(); + } + } \ 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 index e9fc54a6f1..52193bb4df 100644 --- 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 @@ -268,4 +268,12 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl queryListById(List socialOrgIds) { + if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(socialOrgIds)){ + return baseDao.selectBatchIds(socialOrgIds); + } + return Collections.EMPTY_LIST; + } + } \ 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 index dfab2f5bb7..83ac3e0422 100644 --- 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 @@ -19,9 +19,8 @@ package com.epmet.service.impl; import com.alibaba.fastjson.JSON; 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.AppClientConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; @@ -31,28 +30,30 @@ 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.scan.param.TextScanParamDTO; +import com.epmet.commons.tools.scan.param.TextTaskDTO; +import com.epmet.commons.tools.scan.result.SyncScanResult; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.ScanContentUtils; +import com.epmet.constant.ReadFlagConstant; import com.epmet.constant.UserDemandConstant; +import com.epmet.constant.UserMessageTypeConstant; import com.epmet.dao.IcUserDemandOperateLogDao; import com.epmet.dao.IcUserDemandRecDao; import com.epmet.dao.IcUserDemandSatisfactionDao; import com.epmet.dao.IcUserDemandServiceDao; -import com.epmet.dto.CustomerAgencyDTO; -import com.epmet.dto.CustomerGridDTO; -import com.epmet.dto.IcUserDemandRecDTO; -import com.epmet.dto.form.CustomerGridFormDTO; -import com.epmet.dto.form.FindIcUserFormDTO; -import com.epmet.dto.form.ResiUserFormDTO; +import com.epmet.dto.*; +import com.epmet.dto.form.*; import com.epmet.dto.form.demand.*; import com.epmet.dto.result.*; import com.epmet.dto.result.demand.*; import com.epmet.entity.*; import com.epmet.feign.EpmetAdminOpenFeignClient; +import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; -import com.epmet.service.IcResiDemandDictService; -import com.epmet.service.IcUserDemandRecService; +import com.epmet.service.*; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; @@ -60,6 +61,7 @@ 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.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -90,62 +92,48 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl 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()); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "需求不存在", EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg()); } if(!UserDemandConstant.PENDING.equals(origin.getStatus())){ //待处理的才可以修改需求 - throw new RenException(EpmetErrorCode.DEMAND_CAN_NOT_UPDATE.getCode(),EpmetErrorCode.DEMAND_CAN_NOT_UPDATE.getMsg()); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("需求当前状态为【%s】,不允许重新编辑", origin.getStatus()), "需求已处理,不允许重新编辑"); } CustomerGridFormDTO customerGridFormDTO=new CustomerGridFormDTO(); customerGridFormDTO.setGridId(dto.getGridId()); Result gridInfoRes=govOrgOpenFeignClient.getGridBaseInfoByGridId(customerGridFormDTO); if(!gridInfoRes.success()||null==gridInfoRes.getData()){ - throw new RenException("查询网格信息失败"); + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(),"查询网格信息失败"); } IcUserDemandRecEntity updateEntity=ConvertUtils.sourceToTarget(dto,IcUserDemandRecEntity.class); updateEntity.setAgencyId(gridInfoRes.getData().getPid()); @@ -154,6 +142,32 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl demandUserRes=epmetUserOpenFeignClient.getIcResiUserDTO(dto.getDemandUserId()); + if(!demandUserRes.success()||null==demandUserRes.getData()){ + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询需求人信息异常"); + } + updateEntity.setDemandUserHouseId(demandUserRes.getData().getHomeId()); + // 查询需求人的居住地址 + Set houseIds=new HashSet<>(); + houseIds.add(updateEntity.getDemandUserHouseId()); + Result> houseInfoRes=govOrgOpenFeignClient.queryListHouseInfo(houseIds); + if(!houseInfoRes.success()||CollectionUtils.isEmpty(houseInfoRes.getData())){ + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询需求人房屋地址信息异常"+JSON.toJSONString(houseInfoRes)); + } + HouseInfoDTO houseInfoDTO=houseInfoRes.getData().get(NumConstant.ZERO); + updateEntity.setServiceLocation(houseInfoDTO.getNeighborAddress(). + concat(houseInfoDTO.getNeighborHoodName()) + .concat(houseInfoDTO.getBuildingName()) + .concat(houseInfoDTO.getUnitName()) + .concat(houseInfoDTO.getDoorName())); + updateEntity.setLongitude(houseInfoDTO.getBuildingLongitude()); + updateEntity.setLatitude(houseInfoDTO.getBuildingLatitude()); baseDao.updateById(updateEntity); IcUserDemandOperateLogEntity logEntity=new IcUserDemandOperateLogEntity(); @@ -189,7 +203,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl gridInfoRes=govOrgOpenFeignClient.getGridBaseInfoByGridId(customerGridFormDTO); if(!gridInfoRes.success()||null==gridInfoRes.getData()){ - throw new RenException("查询网格信息失败"); + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(),"查询网格信息失败"); } IcUserDemandRecEntity insertEntity=ConvertUtils.sourceToTarget(fromDTO,IcUserDemandRecEntity.class); insertEntity.setAgencyId(gridInfoRes.getData().getPid()); @@ -197,6 +211,30 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl demandUserRes=epmetUserOpenFeignClient.getIcResiUserDTO(fromDTO.getDemandUserId()); + if(!demandUserRes.success()||null==demandUserRes.getData()){ + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询需求人信息异常"+ JSON.toJSONString(demandUserRes)); + } + insertEntity.setDemandUserHouseId(demandUserRes.getData().getHomeId()); + // 查询需求人的居住地址 + Set houseIds=new HashSet<>(); + houseIds.add(insertEntity.getDemandUserHouseId()); + Result> houseInfoRes=govOrgOpenFeignClient.queryListHouseInfo(houseIds); + if(!houseInfoRes.success()||CollectionUtils.isEmpty(houseInfoRes.getData())){ + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询需求人房屋地址信息异常"+JSON.toJSONString(houseInfoRes)); + } + HouseInfoDTO houseInfoDTO=houseInfoRes.getData().get(NumConstant.ZERO); + insertEntity.setServiceLocation(houseInfoDTO.getNeighborAddress(). + concat(houseInfoDTO.getNeighborHoodName())); + insertEntity.setLocationDetail(houseInfoDTO.getBuildingName().concat(StrConstant.HYPHEN).concat(houseInfoDTO.getUnitName()).concat(StrConstant.HYPHEN).concat(houseInfoDTO.getDoorName())); + insertEntity.setLongitude(houseInfoDTO.getBuildingLongitude()); + insertEntity.setLatitude(houseInfoDTO.getBuildingLatitude()); baseDao.insert(insertEntity); IcUserDemandOperateLogEntity logEntity=new IcUserDemandOperateLogEntity(); logEntity.setCustomerId(fromDTO.getCustomerId()); @@ -215,7 +253,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl pageList(UserDemandPageFormDTO formDTO) { CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getCurrentStaffId()); if (null == staffInfo) { - throw new RenException("工作人员所属组织信息查询异常"); + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(),"工作人员所属组织信息查询异常"); } if (StringUtils.isBlank(staffInfo.getAgencyPIds())|| NumConstant.ZERO_STR.equals(staffInfo.getAgencyPIds())) { //当前用户属于根组织下的人 @@ -241,11 +279,11 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl userInfoMap=new HashMap<>(); - Set userIdList=list.stream().filter(item->item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet()); + Set userIdList=list.stream().filter(item->null!=item.getServiceType()&&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("查询志愿者信息异常"); + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(),"查询志愿者信息异常"); } userInfoMap=userInfoRes.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, UserBaseInfoResultDTO::getRealName)); } @@ -274,76 +312,31 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl(list, pageInfo.getTotal()); } /** - * 未完成之前都可以取消 + * 未完成之前都可以取消,pc和居民端小程序内部通用 * * @param formDTO */ @Transactional(rollbackFor = Exception.class) @Override - public void cancel(StaffCancelFormDTO formDTO) { + public void cancel(CancelDemandFormDTO formDTO) { IcUserDemandRecEntity entity = baseDao.selectById(formDTO.getDemandRecId()); if (null == entity) { - throw new RenException(EpmetErrorCode.DEMAND_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_NOT_EXITS.getMsg()); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "需求不存在", EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg()); } - if (UserDemandConstant.FINISH.equals(entity.getStatus())) { + if (UserDemandConstant.FINISH.equals(entity.getStatus()) || UserDemandConstant.CANCELED.equals(entity.getStatus())) { //需求已完成,不可取消 - throw new RenException(EpmetErrorCode.DEMAND_CAN_NOT_CANCEL.getCode(),EpmetErrorCode.DEMAND_CAN_NOT_CANCEL.getMsg()); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("需求当前状态为【%s】,不可取消需求", entity.getStatus()), "当前状态,不可取消"); } //1、修改主表 //置为取消状态、设置取消时间 @@ -351,14 +344,12 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl 100 ? entity.getContent().substring(0, 99) : entity.getContent(); + finishResultDTO.setRemark(String.format(UserDemandConstant.GRANT_POINT_REMARK,entity.getDemandUserName(),content)); + finishResultDTO.setFinishResult(StringUtils.isNotBlank(formDTO.getFinishResult())?formDTO.getFinishResult():UserDemandConstant.UN_RESOLVED); } - //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); + // 5、如果是居民端用户提出的需求,发消息:您提出的需求已完成,请进行服务评价。 + sendDemandUserFinished(entity); + return finishResultDTO; + } - //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); + /** + * 校验需求是否可以点击完成 + * + * @param demandRecId + * @return + */ + private IcUserDemandRecEntity checkFinishPreCondition(String demandRecId) { + IcUserDemandRecEntity entity=baseDao.selectById(demandRecId); + if (null == entity) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "需求不存在", EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg()); } - return finishResultDTO; + /*if(UserDemandConstant.FINISHED.equals(entity.getStatus()) ){ + //已经完成 + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "服务已完成,不可重复提交", "服务已完成,不可重复提交"); + } + if (!UserDemandConstant.ASSIGNED.equals(entity.getStatus()) && !UserDemandConstant.HAVE_ORDER.equals(entity.getStatus())) { + //已指派、已抢单的才可以完成 + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("需求当前状态为【%s】,不可点击服务完成",entity.getStatus()), "当前状态,不能确认服务完成"); + }*/ + return entity; } /** @@ -600,7 +628,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl resiRes = epmetUserOpenFeignClient.findEpmetUser(resiUserFormDTO); if (!resiRes.success()) { - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询小程序用户异常"); + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询小程序用户异常"); } if (null != resiRes.getData() && CollectionUtils.isNotEmpty(resiRes.getData().getEpmetUserIdList())) { formDTO.setEpmetUserIdList(resiRes.getData().getEpmetUserIdList()); @@ -616,7 +644,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl userRes = epmetUserOpenFeignClient.findFamilyMem(formDTO.getIcResiUserId()); if (!userRes.success() || null == userRes.getData()) { - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取居民信息接口异常"); + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "获取居民信息接口异常"); } houseMemResDTO=ConvertUtils.sourceToTarget(userRes.getData(),HouseMemResDTO.class); } @@ -684,7 +712,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl epmetUserFamilyDTOResult=epmetUserOpenFeignClient.findIcUser(findIcUserFormDTO); if (!epmetUserFamilyDTOResult.success() || null == epmetUserFamilyDTOResult.getData()) { - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "根据小程序用户id,获取ic居民信息接口异常"); + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "根据小程序用户id,获取ic居民信息接口异常"); } houseMemResDTO=ConvertUtils.sourceToTarget(epmetUserFamilyDTOResult.getData(),HouseMemResDTO.class); formDTO.setEpmetUserIdList(epmetUserFamilyDTOResult.getData().getEpmetUserIdList()); @@ -700,11 +728,12 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl pageListAnalysis(PageListAnalysisFormDTO formDTO) { + formDTO.setExcludeStatus(UserDemandConstant.CANCELED); if("agency".equals(formDTO.getOrgType())){ //找到当前组织的所有上级,再拼接上自己 Result customerAgencyDTOResult=govOrgOpenFeignClient.getAgencyById(formDTO.getOrgId()); if(!customerAgencyDTOResult.success()||null==customerAgencyDTOResult.getData()){ - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取组织信息异常govOrgOpenFeignClient.getAgencyById"); + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "获取组织信息异常govOrgOpenFeignClient.getAgencyById"); } if(NumConstant.ZERO_STR.equals(customerAgencyDTOResult.getData().getPid())){ //当前传入的组织id=客户的根组织 @@ -738,25 +767,15 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl userInfoMap=new HashMap<>(); - Set userIdList=list.stream().filter(item->item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet()); + Set userIdList=list.stream().filter(item->null!=item.getServiceType()&&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("查询志愿者信息异常"); + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(),"查询志愿者信息异常"); } 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()); @@ -770,11 +789,27 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl> serviceTypeRes=adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_SERVICE_TYPE.getCode()); if(!serviceTypeRes.success()||MapUtils.isEmpty(serviceTypeRes.getData())){ - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"查询服务方类型异常,请检查是否已经配置字典信息"); + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(),"查询服务方类型异常,请检查是否已经配置字典信息"); } List legend=new ArrayList<>(); serviceTypeRes.getData().forEach((code,name)->{ @@ -816,7 +851,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl customerAgencyDTOResult=govOrgOpenFeignClient.getAgencyById(formDTO.getOrgId()); if(!customerAgencyDTOResult.success()||null==customerAgencyDTOResult.getData()){ - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取组织信息异常govOrgOpenFeignClient.getAgencyById"); + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "获取组织信息异常govOrgOpenFeignClient.getAgencyById"); } if(NumConstant.ZERO_STR.equals(customerAgencyDTOResult.getData().getPid())){ //当前传入的组织id=客户的根组织 @@ -900,16 +935,628 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl groupByPartyUnit(String customerId, String partyUnitId) { - if(StringUtils.isBlank(customerId)&&StringUtils.isBlank(partyUnitId)){ + public List groupByServer(String customerId, String serverId,String serviceType) { + if(StringUtils.isBlank(customerId)&&StringUtils.isBlank(serverId)){ return new ArrayList<>(); } - return baseDao.selectGroupByPartyUnit(customerId,partyUnitId); + return baseDao.selectGroupByServer(customerId,serverId,serviceType); + } + + + /** + * 居民端-需求大厅(未处理、处理中、已完成) + * 未处理:未指派、未接单;处理中:已指派、已接单给我的 ;已完成:我填写实际服务时间,并点击确认 + * @param formDTO + * @return + */ + @Override + public List listHall(ListHallFormDTO formDTO) { + PageInfo result = PageHelper.startPage(formDTO.getPageNo(), + formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectListDemandHall(formDTO.getGridId(), + formDTO.getType(),formDTO.getCurrentUserId())); + result.getList().forEach(resultDTO->{ + //设置分类名称 + IcResiDemandDictEntity demandDictEntity=demandDictService.getByCode(formDTO.getCustomerId(),resultDTO.getCategoryCode()); + if(null!=demandDictEntity){ + resultDTO.setCategoryName(demandDictEntity.getCategoryName()); + } + }); + return result.getList(); + } + + /** + * 需求大厅-需求详情 + * + * @param formDTO + * @return + */ + @Override + public DemandDetailResDTO queryDetailHall(DemandDetailFormDTO formDTO) { + DemandRecResultDTO demandRecResultDTO = baseDao.selectDemandRecDetail(formDTO.getCustomerId(), formDTO.getDemandRecId()); + if (null != demandRecResultDTO) { + DemandDetailResDTO result = ConvertUtils.sourceToTarget(demandRecResultDTO, DemandDetailResDTO.class); + //设置分类名称 + IcResiDemandDictEntity demandDictEntity = demandDictService.getByCode(formDTO.getCustomerId(), result.getCategoryCode()); + if (null != demandDictEntity) { + result.setCategoryName(demandDictEntity.getCategoryName()); + } + return result; + } + return null; + } + + /** + * 需求大厅-我要接单 + * 未处理列表中,不包含自己提出的需求,不会存在自己提的需求,自己接单 + * + * @param formDTO + * @return + */ + @Transactional(rollbackFor = Exception.class) + @Override + public TakeOrderResultDTO takeOrder(TakeOrderFormDTO formDTO) { + IcUserDemandRecEntity entity = baseDao.selectById(formDTO.getDemandRecId()); + if (null == entity) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "需求不存在", EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg()); + } + if (!UserDemandConstant.PENDING.equals(entity.getStatus())) { + //待处理的才可以抢单 + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("需求当前状态为【%s】,不可接单",entity.getStatus()), "当前状态不可接单"); + } + TakeOrderResultDTO takeOrderResultDTO=new TakeOrderResultDTO(); + //只有志愿者才可以接单 + VolunteerInfoDTO volunteerInfoDTO=volunteerInfoService.queryUserVolunteerInfo(formDTO.getUserId()); + if(null==volunteerInfoDTO){ + takeOrderResultDTO.setIsVolunteer(false); + return takeOrderResultDTO; + } + takeOrderResultDTO.setIsVolunteer(true); + //1、修改主表 + //置为已接单 + entity.setStatus(UserDemandConstant.HAVE_ORDER); + baseDao.updateById(entity); + //2、插入操作日志 + IcUserDemandOperateLogEntity logEntity = new IcUserDemandOperateLogEntity(); + logEntity.setCustomerId(entity.getCustomerId()); + logEntity.setDemandRecId(formDTO.getDemandRecId()); + logEntity.setUserType(UserDemandConstant.RESI); + logEntity.setUserId(formDTO.getUserId()); + logEntity.setActionCode(UserDemandConstant.TAKE_ORDER); + logEntity.setOperateTime(new Date()); + operateLogDao.insert(logEntity); + //3、插入或更新服务记录 + IcUserDemandServiceEntity origin=demandServiceDao.selectByRecId(formDTO.getDemandRecId()); + String serviceId=""; + if (null == origin) { + IcUserDemandServiceEntity serviceEntity=new IcUserDemandServiceEntity(); + serviceEntity.setCustomerId(entity.getCustomerId()); + serviceEntity.setDemandRecId(entity.getId()); + serviceEntity.setServiceType(UserDemandConstant.VOLUNTEER); + serviceEntity.setServerId(formDTO.getUserId()); + demandServiceDao.insert(serviceEntity); + serviceId=serviceEntity.getId(); + }else{ + origin.setServiceType(UserDemandConstant.VOLUNTEER); + origin.setServerId(formDTO.getUserId()); + origin.setUpdatedBy(formDTO.getUserId()); + demandServiceDao.updateById(origin); + serviceId=origin.getId(); + } + this.sendDemandUserHaveVolunnteerService(entity,formDTO.getUserId()); + takeOrderResultDTO.setServiceId(serviceId); + return takeOrderResultDTO; + } + + /** + * 居民端-我的需求-服务评价 + * + * @param formDTO + * @return + */ + @Transactional(rollbackFor = Exception.class) + @Override + public FinishResultDTO evaluate(EvaluateDemandFormDTO formDTO) { + IcUserDemandRecEntity entity = baseDao.selectById(formDTO.getDemandRecId()); + if (null == entity) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "需求不存在", EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg()); + } + if (!UserDemandConstant.FINISHED.equals(entity.getStatus())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "服务未完成,不可评价", "服务未完成,不可评价"); + } + //用户输入的完成情况,走内容审核 + textScan(formDTO.getFinishDesc()); + //当前操作用户是工作端用户还是居民端用户 + String userType = ""; + if (AppClientConstant.APP_GOV.equals(formDTO.getApp())) { + userType = UserDemandConstant.STAFF; + } else if (AppClientConstant.APP_RESI.equals(formDTO.getApp())) { + userType = UserDemandConstant.RESI; + } + // 1、插入评价得分记录 + IcUserDemandSatisfactionEntity satisfactionEntity = ConvertUtils.sourceToTarget(formDTO, IcUserDemandSatisfactionEntity.class); + satisfactionEntity.setEvaluateTime(new Date()); + satisfactionEntity.setUserType(userType); + satisfactionEntity.setRemark(formDTO.getFinishDesc()); + demandSatisfactionDao.insert(satisfactionEntity); + + // 2、插入评价操作日志 + IcUserDemandOperateLogEntity evaluateEntity = ConvertUtils.sourceToTarget(formDTO, IcUserDemandOperateLogEntity.class); + evaluateEntity.setActionCode(UserDemandConstant.EVALUATE); + evaluateEntity.setOperateTime(satisfactionEntity.getEvaluateTime()); + evaluateEntity.setUserType(userType); + operateLogDao.insert(evaluateEntity); + + // 3、更新主表已评价标识,是否解决标识。 + entity.setEvaluateFlag(true); + entity.setFinishResult(formDTO.getFinishResult()); + baseDao.updateById(entity); + + //4、返回服务方,志愿者发放积分,区域化党建单位,计算群众满意度 + IcUserDemandServiceEntity serviceEntity = demandServiceDao.selectById(formDTO.getServiceId()); + FinishResultDTO finishResultDTO = new FinishResultDTO(); + finishResultDTO.setServerId(serviceEntity.getServerId()); + finishResultDTO.setServiceType(serviceEntity.getServiceType()); + finishResultDTO.setAwardPoint(entity.getAwardPoint()); + finishResultDTO.setEvaluateFlag(entity.getEvaluateFlag()); + if(StringUtils.isBlank(entity.getParentCode())||NumConstant.ZERO_STR.equals(entity.getParentCode())){ + finishResultDTO.setFirstCategoryName(demandDictService.getCategoryName(entity.getCustomerId(),entity.getCategoryCode())); + }else{ + finishResultDTO.setFirstCategoryName(demandDictService.getCategoryName(entity.getCustomerId(),entity.getParentCode())); + } + String content = entity.getContent().length() > 100 ? entity.getContent().substring(0, 99) : entity.getContent(); + finishResultDTO.setRemark(String.format(UserDemandConstant.GRANT_POINT_REMARK,entity.getDemandUserName(),content)); + finishResultDTO.setCategoryCode(entity.getCategoryCode()); + finishResultDTO.setFinishResult(formDTO.getFinishResult()); + //5、我的需求-评价:如果服务方是志愿者,通知它: 您收到来自XXX(需求人姓名)的评价,请查看。 + sendVolunnterEvaluated(entity); + return finishResultDTO; + } + + /** + * 居民端,我有需求,最近预约,显示最近预约过的五个需求,按照预约时间倒 + * 查询最近预约的5个编码 + * + * @param userId + * @return + */ + @Override + public List getLatestRegCode(String userId) { + QueryWrapper queryWrapper=new QueryWrapper<>(); + queryWrapper.eq("DEMAND_USER_ID",userId); + queryWrapper.orderByDesc("WANT_SERVICE_TIME"); + queryWrapper.last("limit 5"); + queryWrapper.select("DISTINCT CATEGORY_CODE"); + return baseDao.selectObjs(queryWrapper).stream().map(o->o.toString()).collect(Collectors.toList()); + } + + /** + * 居民端-我的需求(待处理,处理中,已完成,已取消) + * 待处理:unprocessed;处理中:processing;已完成:finished;已取消:canceled + * + * @param formDTO + * @return + */ + @Override + public List queryMyDemandForResiClient(ResiClientMyDemandFormDTO formDTO) { + PageInfo result = PageHelper.startPage(formDTO.getPageNo(), + formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.queryMyDemandForResiClient(formDTO.getGridId(), + formDTO.getType(), formDTO.getUserId())); + List list=result.getList(); + if (CollectionUtils.isNotEmpty(list)) { + //1、服务方(社会组织、社区自组织、区域化党建单位)单位名称,负责人姓名,负责人手机号 + List partyUnitIds = result.getList().stream().filter(l -> null != l.getServiceType() && l.getServiceType().equals(UserDemandConstant.PARTY_UNIT)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toList()); + Map partyUnitMap =getPartyUnitMap(partyUnitIds); + + List socialOrgIds = result.getList().stream().filter(l -> null != l.getServiceType() && l.getServiceType().equals(UserDemandConstant.SOCIAL_ORG)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toList()); + Map socialOrgMap=getSocialOrgMap(socialOrgIds); + + List communityOrgIds = result.getList().stream().filter(l -> null != l.getServiceType() && l.getServiceType().equals(UserDemandConstant.COMMUNITY_ORG)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toList()); + Map communityOrgMap=getCommunityOrgMap(communityOrgIds); + + //2、志愿者姓名、手机号 + Set userIdList=list.stream().filter(item->null!=item.getServiceType()&&item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toSet()); + Map userInfoMap=getVolunteerMap(userIdList); + + for (ResiClientMyDemandResDTO resDto : list) { + //3、查询分类名称 + IcResiDemandDictEntity demandDict = demandDictService.getByCode(formDTO.getCustomerId(), resDto.getCategoryCode()); + resDto.setCategoryName(null != demandDict ? demandDict.getCategoryName() : StrConstant.EPMETY_STR); + if(StringUtils.isNotBlank(resDto.getServiceType())){ + switch (resDto.getServiceType()) + { + case UserDemandConstant.PARTY_UNIT: + resDto.setServiceUnitName(partyUnitMap.get(resDto.getServerId()).getUnitName()); + resDto.setServiceUserName(partyUnitMap.get(resDto.getServerId()).getContact()); + resDto.setServiceUserMobile(partyUnitMap.get(resDto.getServerId()).getContactMobile()); + break; + case UserDemandConstant.SOCIAL_ORG: + resDto.setServiceUnitName(socialOrgMap.get(resDto.getServerId()).getSocietyName()); + resDto.setServiceUserName(socialOrgMap.get(resDto.getServerId()).getPersonInCharge()); + resDto.setServiceUserMobile(socialOrgMap.get(resDto.getServerId()).getMobile()); + break; + case UserDemandConstant.COMMUNITY_ORG: + resDto.setServiceUnitName(communityOrgMap.get(resDto.getServerId()).getOrganizationName()); + resDto.setServiceUserName(communityOrgMap.get(resDto.getServerId()).getPrincipalName()); + resDto.setServiceUserMobile(communityOrgMap.get(resDto.getServerId()).getPrincipalPhone()); + break; + case UserDemandConstant.VOLUNTEER: + resDto.setServiceUnitName(StrConstant.EPMETY_STR); + resDto.setServiceUserName(userInfoMap.get(resDto.getServerId()).getRealName()); + resDto.setServiceUserMobile(userInfoMap.get(resDto.getServerId()).getMobile()); + break; + default: + log.warn("serviceType 错误"); + break; + } + } + } + } + return list; + } + + + /** + * 获取党建单位基本信息 + * @param partyUnitIds + * @return + */ + private Map getPartyUnitMap(List partyUnitIds) { + List partyUnitList=partyUnitService.queryListById(partyUnitIds); + Map partyUnitMap = partyUnitList.stream().collect(Collectors.toMap(IcPartyUnitEntity::getId, o -> o, (o1, o2) -> o1)); + return partyUnitMap; } + /** + * 获取社会组织基本信息 + * @param socialOrgIds + * @return + */ + private Map getSocialOrgMap(List socialOrgIds) { + List socialOrgList=societyOrgService.queryListById(socialOrgIds); + Map socialOrgMap = socialOrgList.stream().collect(Collectors.toMap(IcSocietyOrgEntity::getId, o -> o, (o1, o2) -> o1)); + return socialOrgMap; + } + + /** + * 获取社区自组织基本信息 + * @param communityOrgIds + * @return + */ + private Map getCommunityOrgMap(List communityOrgIds) { + List communityOrgList=communitySelfOrganizationService.queryListById(communityOrgIds); + Map communityOrgMap = communityOrgList.stream().collect(Collectors.toMap(IcCommunitySelfOrganizationEntity::getId, o -> o, (o1, o2) -> o1)); + return communityOrgMap; + } + + /** + * 获取志愿者基本信息 + * @param userIdList + * @return + */ + private Map getVolunteerMap(Set userIdList) { + Map userInfoMap=new HashMap<>(); + if(CollectionUtils.isNotEmpty(userIdList)){ + Result> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIdList)); + if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){ + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(),"查询志愿者信息异常"); + } + userInfoMap=userInfoRes.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, o -> o, (o1, o2) -> o1)); + } + return userInfoMap; + } + + /** + * 我的需求-需求详情(待处理,处理中,已完成,已取消) + * + * @param formDTO + * @return + */ + @Override + public DemandDetailResDTO queryMyDetail(DemandDetailFormDTO formDTO) { + DemandRecResultDTO demandRecResultDTO = baseDao.selectDemandRecDetail(formDTO.getCustomerId(), formDTO.getDemandRecId()); + if (null != demandRecResultDTO) { + DemandDetailResDTO resDto = ConvertUtils.sourceToTarget(demandRecResultDTO, DemandDetailResDTO.class); + //1、设置分类名称 + IcResiDemandDictEntity demandDictEntity = demandDictService.getByCode(formDTO.getCustomerId(), resDto.getCategoryCode()); + if (null != demandDictEntity) { + resDto.setCategoryName(demandDictEntity.getCategoryName()); + } + //2、志愿者(姓名、手机号 + //3、区域化党建单位、社会组织、社区自组织 设置负责人和手机 + if(StringUtils.isNotBlank(resDto.getServiceType())){ + switch (resDto.getServiceType()) { + case UserDemandConstant.PARTY_UNIT: + Map partyUnitMap = getPartyUnitMap(Arrays.asList(resDto.getServerId())); + resDto.setServiceUnitName(partyUnitMap.get(resDto.getServerId()).getUnitName()); + resDto.setServiceUserName(partyUnitMap.get(resDto.getServerId()).getContact()); + resDto.setServiceUserMobile(partyUnitMap.get(resDto.getServerId()).getContactMobile()); + break; + case UserDemandConstant.SOCIAL_ORG: + Map socialOrgMap = getSocialOrgMap(Arrays.asList(resDto.getServerId())); + resDto.setServiceUnitName(socialOrgMap.get(resDto.getServerId()).getSocietyName()); + resDto.setServiceUserName(socialOrgMap.get(resDto.getServerId()).getPersonInCharge()); + resDto.setServiceUserMobile(socialOrgMap.get(resDto.getServerId()).getMobile()); + break; + case UserDemandConstant.COMMUNITY_ORG: + Map communityOrgMap = getCommunityOrgMap(Arrays.asList(resDto.getServerId())); + resDto.setServiceUnitName(communityOrgMap.get(resDto.getServerId()).getOrganizationName()); + resDto.setServiceUserName(communityOrgMap.get(resDto.getServerId()).getPrincipalName()); + resDto.setServiceUserMobile(communityOrgMap.get(resDto.getServerId()).getPrincipalPhone()); + break; + case UserDemandConstant.VOLUNTEER: + Map userInfoMap = getVolunteerMap(new HashSet<>(Arrays.asList(resDto.getServerId()))); + resDto.setServiceUnitName(StrConstant.EPMETY_STR); + resDto.setServiceUserName(userInfoMap.get(resDto.getServerId()).getRealName()); + resDto.setServiceUserMobile(userInfoMap.get(resDto.getServerId()).getMobile()); + break; + default: + log.warn("serviceType 错误"); + break; + } + } + return resDto; + } + return null; + } + + /** + * 居民端-我的需求:提交需求,修改需求 + * + * @param formDTO + * @return + */ + @Override + public DemandRecId saveOrUpdateDemand(ReportDemandFormDTO formDTO) { + //需求内容走内容审核 + textScan(formDTO.getContent()); + Date now = new Date(); + DemandRecId resultDto = new DemandRecId(); + resultDto.setDemandRecId(formDTO.getDemandRecId()); + if (StringUtils.isNotBlank(formDTO.getDemandRecId())) { + //修改需求 + IcUserDemandRecEntity origin = baseDao.selectById(formDTO.getDemandRecId()); + if (null == origin) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "需求不存在", EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg()); + } + if (!UserDemandConstant.PENDING.equals(origin.getStatus())) { + //待处理的才可以修改需求 + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("需求当前状态为【%s】,不允许重新编辑", origin.getStatus()), "需求已处理,不允许重新编辑"); + } + origin.setContent(formDTO.getContent()); + origin.setWantServiceTime(formDTO.getWantServiceTime()); + origin.setDemandUserName(formDTO.getDemandUserName()); + origin.setDemandUserMobile(formDTO.getDemandUserMobile()); + origin.setServiceLocation(formDTO.getServiceLocation()); + origin.setLatitude(formDTO.getLatitude()); + origin.setLongitude(formDTO.getLongitude()); + origin.setLocationDetail(formDTO.getLocationDetail()); + baseDao.updateById(origin); + } else { + CustomerGridFormDTO customerGridFormDTO = new CustomerGridFormDTO(); + customerGridFormDTO.setGridId(formDTO.getGridId()); + Result gridInfoRes = govOrgOpenFeignClient.getGridBaseInfoByGridId(customerGridFormDTO); + if (!gridInfoRes.success() || null == gridInfoRes.getData()) { + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询网格信息失败"); + } + IcUserDemandRecEntity insertEntity = ConvertUtils.sourceToTarget(formDTO, IcUserDemandRecEntity.class); + insertEntity.setAgencyId(gridInfoRes.getData().getPid()); + insertEntity.setGridPids(gridInfoRes.getData().getPids()); + insertEntity.setDemandUserType(UserDemandConstant.MINI_RESI); + insertEntity.setStatus(UserDemandConstant.PENDING); + insertEntity.setEvaluateFlag(false); + //设置上报人消息 + insertEntity.setReportType(UserDemandConstant.SELF_HELP_REPORT); + insertEntity.setReportTime(now); + insertEntity.setReportUserId(formDTO.getDemandUserId()); + insertEntity.setReportUserMobile(formDTO.getDemandUserMobile()); + insertEntity.setReportUserName(formDTO.getDemandUserName()); + //记录发放积分 + IcResiDemandDictEntity icResiDemandDictEntity = demandDictService.getByCode(formDTO.getCustomerId(), formDTO.getCategoryCode()); + if (null != icResiDemandDictEntity) { + insertEntity.setAwardPoint(icResiDemandDictEntity.getAwardPoint()); + } + baseDao.insert(insertEntity); + resultDto.setDemandRecId(insertEntity.getId()); + } + //插入操作日志 + IcUserDemandOperateLogEntity logEntity = new IcUserDemandOperateLogEntity(); + logEntity.setCustomerId(formDTO.getCustomerId()); + logEntity.setDemandRecId(resultDto.getDemandRecId()); + logEntity.setUserType(UserDemandConstant.RESI); + logEntity.setUserId(formDTO.getDemandUserId()); + logEntity.setActionCode(StringUtils.isNotBlank(formDTO.getDemandRecId()) ? UserDemandConstant.UPDATE : UserDemandConstant.CREATE); + logEntity.setOperateTime(now); + operateLogDao.insert(logEntity); + + return resultDto; + } + + /** + * 需求内容,服务评价-完成情况走内容审核 + * @param content + */ + private void textScan(String content) { + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + TextTaskDTO taskDTO = new TextTaskDTO(); + taskDTO.setContent(content); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); + textScanParamDTO.getTasks().add(taskDTO); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()) { + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode(), EpmetErrorCode.TEXT_SCAN_FAILED.getMsg()); + } + } + } + + /** + * 我的需求被抢单->您提出的需求将由青岛亿联科技有限公司为您解决,请查看。 + */ + private void sendDemandUserHaveVolunnteerService(IcUserDemandRecEntity entity, String volunteerUserId) { + // 如果需求人是小程序里的用户,需要通知需求人: + // 您提出的需求将由青岛亿联科技有限公司为您解决,请查看。 + // 您提出的需求将由张三为您解决,请查看。 + if (UserDemandConstant.MINI_RESI.equals(entity.getDemandUserType())) { + UserResiInfoListFormDTO formDTO = new UserResiInfoListFormDTO(); + formDTO.setUserIdList(Arrays.asList(volunteerUserId)); + Result> userRes = epmetUserOpenFeignClient.getUserResiInfoList(formDTO); + if (userRes.success() && CollectionUtils.isNotEmpty(userRes.getData())) { + String volunteerName=userRes.getData().get(NumConstant.ZERO).getRealName(); + UserMessageFormDTO userMessage = new UserMessageFormDTO(); + userMessage.setApp(AppClientConstant.APP_RESI); + userMessage.setCustomerId(entity.getCustomerId()); + userMessage.setGridId(entity.getGridId()); + String messageContent = String.format(UserDemandConstant.HAVE_SERVICE, volunteerName); + userMessage.setMessageContent(messageContent); + userMessage.setReadFlag(ReadFlagConstant.UN_READ); + userMessage.setTitle(UserDemandConstant.MESSAGE_TITILE); + userMessage.setMessageType(UserMessageTypeConstant.DEMAND); + userMessage.setTargetId(entity.getId()); + //通知需求提出人 + userMessage.setUserId(entity.getDemandUserId()); + messageOpenFeignClient.saveUserMessage(userMessage); + } + } + } + + /** + * 您提出的需求将由青岛亿联科技有限公司为您解决,请查看。 + */ + private void sendDemandUserHaveOrgService(IcUserDemandRecEntity entity, String serverId, String serviceType) { + // 如果需求人是小程序里的用户,需要通知需求人: + // 您提出的需求将由青岛亿联科技有限公司为您解决,请查看。 + String serviceName = ""; + if (UserDemandConstant.PARTY_UNIT.equals(serviceType)) { + IcPartyUnitDTO data = partyUnitService.get(serverId); + serviceName = null != data ? data.getUnitName() : StrConstant.EPMETY_STR; + } else if (UserDemandConstant.SOCIAL_ORG.equals(serviceType)) { + Map map = getSocialOrgMap(Arrays.asList(serverId)); + serviceName = MapUtils.isNotEmpty(map) ? map.get(serverId).getSocietyName() : StrConstant.EPMETY_STR; + } else if (UserDemandConstant.COMMUNITY_ORG.equals(serviceType)) { + Map communityOrgMap = getCommunityOrgMap(Arrays.asList(serverId)); + serviceName = MapUtils.isNotEmpty(communityOrgMap) ? communityOrgMap.get(serverId).getOrganizationName() : StrConstant.EPMETY_STR; + }else if(UserDemandConstant.VOLUNTEER.equals(serviceType)){ + //如果指派给了志愿者-》您提出的需求将由XX为您解决,请查看 + UserResiInfoListFormDTO userResiInfoListFormDTO=new UserResiInfoListFormDTO(); + userResiInfoListFormDTO.setUserIdList(Arrays.asList(serverId)); + Result> userRes = epmetUserOpenFeignClient.getUserResiInfoList(userResiInfoListFormDTO); + if(userRes.success()){ + serviceName=userRes.getData().get(NumConstant.ZERO).getRealName(); + } + } + if (StringUtils.isNotBlank(serviceName)) { + UserMessageFormDTO userMessage = new UserMessageFormDTO(); + userMessage.setApp(AppClientConstant.APP_RESI); + userMessage.setCustomerId(entity.getCustomerId()); + userMessage.setGridId(entity.getGridId()); + String messageContent = String.format(UserDemandConstant.HAVE_SERVICE, serviceName); + userMessage.setMessageContent(messageContent); + userMessage.setReadFlag(ReadFlagConstant.UN_READ); + userMessage.setTitle(UserDemandConstant.MESSAGE_TITILE); + userMessage.setMessageType(UserMessageTypeConstant.DEMAND); + userMessage.setTargetId(entity.getId()); + //通知需求提出人 + userMessage.setUserId(entity.getDemandUserId()); + messageOpenFeignClient.saveUserMessage(userMessage); + } + } + + /** + * 我的需求服务完成->您提出的需求已完成,请进行服务评价。 + */ + private void sendDemandUserFinished(IcUserDemandRecEntity entity) { + if (UserDemandConstant.MINI_RESI.equals(entity.getDemandUserType())) { + UserMessageFormDTO userMessage = new UserMessageFormDTO(); + userMessage.setApp(AppClientConstant.APP_RESI); + userMessage.setCustomerId(entity.getCustomerId()); + userMessage.setGridId(entity.getGridId()); + String messageContent = UserDemandConstant.FINISH_DEMAND_MESSAGE; + userMessage.setMessageContent(messageContent); + userMessage.setReadFlag(ReadFlagConstant.UN_READ); + userMessage.setTitle(UserDemandConstant.MESSAGE_TITILE); + userMessage.setMessageType(UserMessageTypeConstant.DEMAND); + userMessage.setTargetId(entity.getId()); + //通知需求提出人 + userMessage.setUserId(entity.getDemandUserId()); + messageOpenFeignClient.saveUserMessage(userMessage); + } + } + + /** + * 我的需求-评价:如果服务方是志愿者,通知TA: 您收到来自张三的评价,请查看。 + */ + private void sendVolunnterEvaluated(IcUserDemandRecEntity entity) { + IcUserDemandServiceEntity serviceEntity = demandServiceDao.selectByRecId(entity.getId()); + if (null != serviceEntity && UserDemandConstant.VOLUNTEER.equals(serviceEntity.getServiceType())) { + UserMessageFormDTO userMessage = new UserMessageFormDTO(); + userMessage.setApp(AppClientConstant.APP_RESI); + userMessage.setCustomerId(entity.getCustomerId()); + userMessage.setGridId(entity.getGridId()); + String messageContent = String.format(UserDemandConstant.DEMAND_EVALUATED, entity.getDemandUserName()); + userMessage.setMessageContent(messageContent); + userMessage.setReadFlag(ReadFlagConstant.UN_READ); + userMessage.setTitle(UserDemandConstant.MESSAGE_TITILE); + userMessage.setMessageType(UserMessageTypeConstant.DEMAND); + userMessage.setTargetId(entity.getId()); + //通知志愿者 + userMessage.setUserId(serviceEntity.getServerId()); + messageOpenFeignClient.saveUserMessage(userMessage); + } + } + + /** + * 我的需求-取消需求(未完成的都可以取消),如果需求已经被小程序里的志愿者接单通知它->XXX的需求已取消,请查看。 + * pc指派给志愿者的,如果取消了也要通知 + * @param entity + */ + private void sendVolunnterCanceled(IcUserDemandRecEntity entity) { + IcUserDemandServiceEntity serviceEntity = demandServiceDao.selectByRecId(entity.getId()); + if (null != serviceEntity && UserDemandConstant.VOLUNTEER.equals(serviceEntity.getServiceType())) { + UserMessageFormDTO userMessage = new UserMessageFormDTO(); + userMessage.setApp(AppClientConstant.APP_RESI); + userMessage.setCustomerId(entity.getCustomerId()); + userMessage.setGridId(entity.getGridId()); + String messageContent = String.format(UserDemandConstant.DEMAND_CANCELED, entity.getDemandUserName()); + userMessage.setMessageContent(messageContent); + userMessage.setReadFlag(ReadFlagConstant.UN_READ); + userMessage.setTitle(UserDemandConstant.MESSAGE_TITILE); + userMessage.setMessageType(UserMessageTypeConstant.DEMAND); + userMessage.setTargetId(entity.getId()); + //通知志愿者 + userMessage.setUserId(serviceEntity.getServerId()); + messageOpenFeignClient.saveUserMessage(userMessage); + } + } + + /** + * 当前用户与需求消息的关系 需求发布人:publisher ;服务人:server + * + * @param formDTO + * @return + */ + @Override + public UserDemandRelResDTO queryUserDemandRel(UserDemandRelFormDTO formDTO) { + UserDemandRelResDTO res = new UserDemandRelResDTO(""); + IcUserDemandRecEntity origin = baseDao.selectById(formDTO.getDemandRecId()); + if (null != origin && formDTO.getUserId().equals(origin.getDemandUserId())) { + res.setIdentity(UserDemandConstant.DEMAND_PUBLISHER); + return res; + } + IcUserDemandServiceEntity serviceEntity = demandServiceDao.selectByRecId(formDTO.getDemandRecId()); + if (null != serviceEntity && formDTO.getUserId().equals(serviceEntity.getServerId())) { + res.setIdentity(UserDemandConstant.DEMAND_SERVER); + } + return res; + } + + } + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandSatisfactionServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandSatisfactionServiceImpl.java new file mode 100644 index 0000000000..c8b87ed69e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandSatisfactionServiceImpl.java @@ -0,0 +1,144 @@ +package com.epmet.service.impl; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.rocketmq.messages.ServerSatisfactionCalFormDTO; +import com.epmet.commons.tools.constant.Constant; +import com.epmet.commons.tools.constant.MqConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg; +import com.epmet.commons.tools.enums.EventEnum; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.SystemMessageType; +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.IcUserDemandRecDTO; +import com.epmet.dto.form.AutoEvaluateDemandFormDTO; +import com.epmet.dto.form.SystemMsgFormDTO; +import com.epmet.entity.IcUserDemandOperateLogEntity; +import com.epmet.entity.IcUserDemandSatisfactionEntity; +import com.epmet.entity.IcUserDemandServiceEntity; +import com.epmet.feign.EpmetMessageOpenFeignClient; +import com.epmet.service.IcPartyUnitService; +import com.epmet.service.IcResiDemandDictService; +import com.epmet.service.IcUserDemandSatisfactionService; +import lombok.extern.slf4j.Slf4j; +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.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +@Slf4j +@Service +public class IcUserDemandSatisfactionServiceImpl extends BaseServiceImpl implements IcUserDemandSatisfactionService { + + @Autowired + private IcUserDemandRecDao icUserDemandRecDao; + @Autowired + private IcUserDemandOperateLogDao operateLogDao; + @Autowired + private IcUserDemandServiceDao demandServiceDao; + @Autowired + private IcResiDemandDictService demandDictService; + @Autowired + private IcPartyUnitService icPartyUnitService; + @Autowired + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; + + + /** + * + * @param formDTO + * @return + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void evaluateDemandAuto(AutoEvaluateDemandFormDTO formDTO) { + if (null == formDTO.getExceedValue()) { + formDTO.setExceedValue(NumConstant.SEVEN); + formDTO.setType("day"); + } + // 查询完成后,超过7天未评价的记录 + List list=icUserDemandRecDao.selectNoEvaluate(formDTO.getCustomerId(),formDTO.getExceedValue(),formDTO.getType()); + if(CollectionUtils.isEmpty(list)){ + return; + } + Date nowDate=new Date(); + for(IcUserDemandRecDTO demand:list){ + + //4、返回服务方,志愿者发放积分,区域化党建单位,计算群众满意度 + IcUserDemandServiceEntity serviceEntity = demandServiceDao.selectByRecId(demand.getId()); + if(null==serviceEntity){ + continue; + } + if(UserDemandConstant.PARTY_UNIT.equals(serviceEntity.getServiceType())){ + ServerSatisfactionCalFormDTO satisfactionCalFormDTO=new ServerSatisfactionCalFormDTO(); + satisfactionCalFormDTO.setCustomerId(demand.getCustomerId()); + satisfactionCalFormDTO.setServiceType(serviceEntity.getServiceType()); + satisfactionCalFormDTO.setServerId(serviceEntity.getServerId()); + icPartyUnitService.calPartyUnitSatisfation(satisfactionCalFormDTO); + } else if (UserDemandConstant.VOLUNTEER.equals(serviceEntity.getServiceType()) && null != demand.getAwardPoint() && demand.getAwardPoint() > NumConstant.ZERO) { + List actPointEventMsgList = new ArrayList<>(); + BasePointEventMsg actPointEventMsg = new BasePointEventMsg(); + actPointEventMsg.setCustomerId(demand.getCustomerId()); + actPointEventMsg.setSourceType(MqConstant.SOURCE_TYPE_DEMAND); + actPointEventMsg.setSourceId(demand.getId()); + actPointEventMsg.setUserId(serviceEntity.getServerId()); + actPointEventMsg.setActionFlag(MqConstant.PLUS); + actPointEventMsg.setIsCommon(false); + String content = demand.getContent().length() > 100 ? demand.getContent().substring(0, 99) : demand.getContent(); + actPointEventMsg.setRemark(String.format(UserDemandConstant.GRANT_POINT_REMARK,demand.getDemandUserName(),content)); + actPointEventMsg.setEventTag(EventEnum.FINISH_USER_DEMAND.getEventTag()); + actPointEventMsg.setEventClass(EventEnum.FINISH_USER_DEMAND.getEventClass()); + if(StringUtils.isBlank(demand.getParentCode())||NumConstant.ZERO_STR.equals(demand.getParentCode())){ + actPointEventMsg.setEventName(demandDictService.getCategoryName(demand.getCustomerId(),demand.getCategoryCode())); + }else{ + actPointEventMsg.setEventName(demandDictService.getCategoryName(demand.getCustomerId(),demand.getParentCode())); + } + actPointEventMsg.setObjectId(demand.getCategoryCode()); + actPointEventMsg.setPoint(demand.getAwardPoint()); + actPointEventMsgList.add(actPointEventMsg); + SystemMsgFormDTO sendMsgForm = new SystemMsgFormDTO(); + sendMsgForm.setContent(actPointEventMsgList); + sendMsgForm.setMessageType(SystemMessageType.FINISH_USER_DEMAND); + Result mqResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(sendMsgForm); + if (!mqResult.success()) { + log.warn(String.format("需求自动评价志愿者发放积分失败:demandRecId:%s,消息体:%s", demand.getId(), JSON.toJSONString(sendMsgForm))); + continue; + } + } + + // 1、插入评价得分记录 + IcUserDemandSatisfactionEntity satisfactionEntity = new IcUserDemandSatisfactionEntity(); + satisfactionEntity.setCustomerId(demand.getCustomerId()); + satisfactionEntity.setDemandRecId(demand.getId()); + satisfactionEntity.setEvaluateTime(nowDate); + satisfactionEntity.setUserType(UserDemandConstant.SYS); + satisfactionEntity.setUserId(Constant.APP_USER_FLAG); + satisfactionEntity.setScore(new BigDecimal(NumConstant.FIVE_STR)); + satisfactionEntity.setRemark(UserDemandConstant.DEFAULT_EVALUATE_REMARK); + baseDao.insert(satisfactionEntity); + + // 2、插入评价操作日志 + IcUserDemandOperateLogEntity evaluateEntity = new IcUserDemandOperateLogEntity(); + evaluateEntity.setCustomerId(demand.getCustomerId()); + evaluateEntity.setDemandRecId(demand.getId()); + evaluateEntity.setUserType(UserDemandConstant.SYS); + evaluateEntity.setUserId(Constant.APP_USER_FLAG); + evaluateEntity.setActionCode(UserDemandConstant.EVALUATE); + evaluateEntity.setOperateTime(nowDate); + operateLogDao.insert(evaluateEntity); + + // 3、更新主表已评价标识,是否解决标识。 + icUserDemandRecDao.evaluate(demand.getId(),UserDemandConstant.RESOLVED); + } + } +} 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 9d1e7a9240..71417dbb2e 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 @@ -22,23 +22,28 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.MqConstant; import com.epmet.commons.tools.constant.NumConstant; -import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg; -import com.epmet.commons.tools.enums.EventEnum; +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.feign.ResultDataResolver; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.commons.tools.utils.SendMqMsgUtils; import com.epmet.constant.SmsTemplateConstant; +import com.epmet.constant.SystemMessageType; import com.epmet.dao.VolunteerInfoDao; +import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.HeartUserInfoDTO; import com.epmet.dto.VolunteerInfoDTO; -import com.epmet.dto.form.CommonCustomerFormDTO; -import com.epmet.dto.form.SendVerificationCodeFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.form.resi.ResiSendSmsCodeFormDTO; import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO; import com.epmet.dto.result.ResiUserBaseInfoResultDTO; @@ -50,6 +55,7 @@ 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.feign.GovOrgOpenFeignClient; import com.epmet.service.HeartUserInfoService; import com.epmet.service.VolunteerInfoService; import com.github.pagehelper.PageHelper; @@ -61,9 +67,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; @@ -74,7 +78,7 @@ import java.util.stream.Collectors; * @since v1.0.0 2020-07-19 */ @Service -public class VolunteerInfoServiceImpl extends BaseServiceImpl implements VolunteerInfoService { +public class VolunteerInfoServiceImpl extends BaseServiceImpl implements VolunteerInfoService, ResultDataResolver { private Logger logger = LogManager.getLogger(VolunteerInfoServiceImpl.class); private static final String SEND_SMS_CODE_ERROR = "发送短信验证码异常,手机号[%s],code[%s],msg[%s]"; @@ -89,8 +93,11 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl 8000) { + throw new RenException(regResi.getCode(), regResi.getMsg()); + } + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), regResi.getMsg()); + } + // 3、检查是否是志愿者 + VolunteerInfoDTO originVolunteer = baseDao.selectVolunteerInfoByUserId(formDTO.getUserId()); + if (null != originVolunteer) { + //能修改的只有这两个属性,像是网格id,网格名称,pid,pids不允许修改,第一次注册成功后不可修改 + originVolunteer.setVolunteerIntroduce(formDTO.getVolunteerIntroduce()); + originVolunteer.setVolunteerSignature(formDTO.getVolunteerSignature()); + baseDao.updateById(ConvertUtils.sourceToTarget(originVolunteer, VolunteerInfoEntity.class)); + } else { + //2.1不是志愿者:插入志愿者信息表 + VolunteerInfoEntity insertVolunteer = ConvertUtils.sourceToTarget(formDTO, VolunteerInfoEntity.class); + // 赋值gridName,pid,pids + CustomerGridFormDTO customerGridFormDTO = new CustomerGridFormDTO(); + customerGridFormDTO.setGridId(formDTO.getGridId()); + Result gridInfoRes = govOrgOpenFeignClient.getGridBaseInfoByGridId(customerGridFormDTO); + if (!gridInfoRes.success() || null == gridInfoRes.getData()) { + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询网格信息失败"); + } + insertVolunteer.setGridName(gridInfoRes.getData().getGridName()); + insertVolunteer.setPid(gridInfoRes.getData().getPid()); + insertVolunteer.setPids(gridInfoRes.getData().getPids()); + baseDao.insert(insertVolunteer); + + // 2.2 更新用户信息表的 是否是志愿者标识 + HeartUserInfoDTO userInfoDTO = new HeartUserInfoDTO(); + userInfoDTO.setUserId(formDTO.getUserId()); + userInfoDTO.setVolunteerFlag(true); + heartUserInfoService.updateHeartUserInfoByUserId(userInfoDTO); + + // 2.3发送消息 由积分系统消费消息(需要使用规则) + this.grantActPoints(formDTO); + } } private void grantActPoints(ResiVolunteerAuthenticateFormDTO formDTO){ - MqBaseMsgDTO mqBaseMsgDTO=new MqBaseMsgDTO(); + //MqBaseMsgDTO mqBaseMsgDTO=new MqBaseMsgDTO(); //mq的事件类型 - mqBaseMsgDTO.setEventClass(EventEnum.REGISTER_VOLUNTEER.getEventClass()); + //mqBaseMsgDTO.setEventClass(EventEnum.REGISTER_VOLUNTEER.getEventClass()); //事件code - mqBaseMsgDTO.setEventTag(EventEnum.REGISTER_VOLUNTEER.getEventTag()); + //mqBaseMsgDTO.setEventTag(EventEnum.REGISTER_VOLUNTEER.getEventTag()); List actPointEventMsgList=new ArrayList<>(); BasePointEventMsg actPointEventMsg=new BasePointEventMsg(); actPointEventMsg.setCustomerId(formDTO.getCustomerId()); @@ -143,8 +205,14 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl NumConstant.ZERO){ - // 获取志愿者信息 - VolunteerInfoDTO dto = baseDao.selectVolunteerInfoByUserId(tokenDto.getUserId()); + // 获取志愿者信息 + // Integer volunteerFlag = baseDao.queryVolunteerFlagByUserId(tokenDto.getUserId()); + VolunteerInfoDTO dto = baseDao.selectVolunteerInfoByUserId(tokenDto.getUserId()); + if (null!=dto){ resultDTO.setVolunteerIntroduce(dto.getVolunteerIntroduce() == null ? "" : dto.getVolunteerIntroduce()); resultDTO.setVolunteerSignature(dto.getVolunteerSignature() == null ? "" : dto.getVolunteerSignature()); // 遗留数据处理,如果表中数据为空,一律返回null,前端重新获取 网格信息 resultDTO.setGridId( "".equals(dto.getGridId()) ? null : dto.getGridId()); - resultDTO.setGridName( "".equals(dto.getGridName()) ? null : dto.getGridName()); + resultDTO.setGridName( "".equals(dto.getGridName()) ? null : dto.getGridName()); } } else { logger.error("获取用户基本信息失败"); @@ -231,14 +299,38 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl queryListVolunteer(String customerId, String userRealName) { + public List queryListVolunteer(String customerId, String staffId,String userRealName) { + CustomerStaffInfoCacheResult staffInfo= CustomerStaffRedis.getStaffInfo(customerId,staffId); + if (null == staffInfo) { + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询工作人员信息异常"); + } + // 如果是根级组织的工作人员,agencyPids="";正常是以英文冒号隔开 + String pids=""; + if(StringUtils.isBlank(staffInfo.getAgencyPIds())||NumConstant.ZERO_STR.equals(staffInfo.getAgencyPIds())){ + pids=staffInfo.getAgencyId(); + }else{ + pids=staffInfo.getAgencyPIds().concat(StrConstant.COLON).concat(staffInfo.getAgencyId()); + } + LambdaQueryWrapper query=new LambdaQueryWrapper<>(); + query.eq(VolunteerInfoEntity::getCustomerId,customerId); + query.likeRight(VolunteerInfoEntity::getPids,pids); + query.select(VolunteerInfoEntity::getUserId); + query.orderByAsc(VolunteerInfoEntity::getCreatedTime); + Set userIds = baseDao.selectObjs(query).stream().map(o->o.toString()).collect(Collectors.toSet()); List resultList = new ArrayList<>(); - List userIds = baseDao.selectVolunteerIds(customerId); if (CollectionUtils.isEmpty(userIds)) { return resultList; } - Result> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(userIds); + Result> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIds)); if (userInfoRes.success() && CollectionUtils.isNotEmpty(userInfoRes.getData())) { Map userMap = userInfoRes.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, Function.identity())); for (String userId : userIds) { @@ -263,9 +355,12 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl queryVolunteerPage(String customerId, Integer pageNo, Integer pageSize) { + public List queryVolunteerPage(String customerId, Integer pageNo, Integer pageSize, String agencyId) { LambdaQueryWrapper query = new LambdaQueryWrapper<>(); - query.eq(VolunteerInfoEntity::getCustomerId, customerId); + Optional.ofNullable(customerId).ifPresent(cid -> query.eq(VolunteerInfoEntity::getCustomerId, cid)); + Optional.ofNullable(agencyId).ifPresent(aid -> { + query.likeRight(VolunteerInfoEntity::getPids, getPidsByAgencyId(aid)); + }); PageHelper.startPage(pageNo, pageSize); List volunteerInfoEntities = baseDao.selectList(query); @@ -275,14 +370,48 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl query = new LambdaQueryWrapper<>(); - query.eq(VolunteerInfoEntity::getCustomerId, customerId); + + Optional.ofNullable(customerId).ifPresent((cId) -> { + query.eq(VolunteerInfoEntity::getCustomerId, cId); + }); + + Optional.ofNullable(agencyId).ifPresent((aid) -> { + query.likeRight(VolunteerInfoEntity::getPids, getPidsByAgencyId(aid)); + }); + return baseDao.selectCount(query); } + + /** + * 使用agencyId,获取pids(agencyPids:agencyId) + * @param agencyId + * @return + */ + private String getPidsByAgencyId(String agencyId) { + // 需要查询agency的pids:id,通过这个字符串去匹配志愿者的Pids字段来查询 + String errorMsg = "【分页查询志愿者列表】失败"; + CustomerAgencyDTO agencyInfo = getResultDataOrThrowsException(govOrgOpenFeignClient.getAgencyById(agencyId), + ServiceConstant.GOV_ORG_SERVER, + EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), + errorMsg, + errorMsg); + + if (agencyInfo == null) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); + } + + String pidsAndAgencyIdPath = agencyInfo.getPids().concat(":").concat(agencyId); + if (pidsAndAgencyIdPath.startsWith(":")) { + pidsAndAgencyIdPath = pidsAndAgencyIdPath.replaceFirst(":", ""); + } + + return pidsAndAgencyIdPath; + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java index 930d220fc7..6e2a67aa17 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java @@ -3,15 +3,16 @@ package com.epmet.service.impl; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dto.IcPartyUnitDTO; import com.epmet.dto.LatestActContentDTO; import com.epmet.dto.LatestActInfoDTO; +import com.epmet.dto.form.demand.SubCodeFormDTO; import com.epmet.dto.form.work.ActPreviewFormDTO; import com.epmet.dto.form.work.DraftActContentFormDTO; import com.epmet.dto.form.work.DraftActInfoFormDTO; +import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.work.*; -import com.epmet.service.LatestActContentService; -import com.epmet.service.LatestActInfoService; -import com.epmet.service.WorkActDraftService; +import com.epmet.service.*; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -19,9 +20,12 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import javax.annotation.Resource; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; /** * 工作端活动草稿 @@ -38,6 +42,15 @@ public class WorkActDraftServiceImpl implements WorkActDraftService { private LatestActInfoService latestActInfoService; @Autowired private LatestActContentService latestActContentService; + @Resource + private IcResiDemandDictService icResiDemandDictService; + @Resource + private IcPartyUnitService icPartyUnitService; + + /** + * 服务事项code + */ + private static final String SERVICE_MATTER_CODE = "1010"; /** * @return com.epmet.dto.form.work.PublishActInitResultDTO @@ -126,6 +139,20 @@ public class WorkActDraftServiceImpl implements WorkActDraftService { if (null != actContent && actContent.size() > 0) { actPreviewResultDTO.setActContent(actContent); } + + if (StringUtils.isNotBlank(actPreviewResultDTO.getServiceMatter())) { + //获取服务事项 + SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); + codeFormDTO.setCustomerId(formDTO.getCustomerId()); + codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE); + Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + actPreviewResultDTO.setServiceMatterName(categoryMap.get(actPreviewResultDTO.getServiceMatter())); + } + if (StringUtils.isNotBlank(actPreviewResultDTO.getUnitId())) { + //获取单位名称 + IcPartyUnitDTO unitDTO = icPartyUnitService.get(actPreviewResultDTO.getUnitId()); + actPreviewResultDTO.setUnitName(unitDTO.getUnitName()); + } } return actPreviewResultDTO; } @@ -258,6 +285,12 @@ public class WorkActDraftServiceImpl implements WorkActDraftService { latestActInfoDTO.setVolunteerLimit(formDTO.getVolunteerLimit()); //审核开关:1报名人员需要人工审核0不需要 latestActInfoDTO.setAuditSwitch(formDTO.getAuditSwitch()); + + latestActInfoDTO.setActType(formDTO.getActType()); + latestActInfoDTO.setUnitId(formDTO.getUnitId()); + latestActInfoDTO.setTarget(formDTO.getTarget()); + latestActInfoDTO.setServiceMatter(formDTO.getServiceMatter()); + return latestActInfoDTO; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java index b552ee29bc..e113d72019 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java @@ -6,9 +6,7 @@ import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.MqConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; -import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO; import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg; -import com.epmet.commons.tools.enums.EventEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.scan.param.ImgScanParamDTO; @@ -17,17 +15,20 @@ import com.epmet.commons.tools.scan.param.TextScanParamDTO; import com.epmet.commons.tools.scan.param.TextTaskDTO; import com.epmet.commons.tools.scan.result.SyncScanResult; import com.epmet.commons.tools.security.user.LoginUserUtil; -import com.epmet.commons.tools.utils.*; -import com.epmet.constant.ActConstant; -import com.epmet.constant.ActMessageConstant; -import com.epmet.constant.ReadFlagConstant; -import com.epmet.constant.UserMessageTypeConstant; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.ScanContentUtils; +import com.epmet.constant.*; import com.epmet.dao.*; import com.epmet.dto.*; +import com.epmet.dto.form.SystemMsgFormDTO; import com.epmet.dto.form.UserMessageFormDTO; import com.epmet.dto.form.WxSubscribeMessageFormDTO; +import com.epmet.dto.form.demand.SubCodeFormDTO; import com.epmet.dto.form.work.*; import com.epmet.dto.result.ActSponsorResultDTO; +import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.work.*; import com.epmet.entity.*; import com.epmet.feign.EpmetMessageOpenFeignClient; @@ -41,12 +42,10 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.UUID; +import javax.annotation.Resource; +import java.util.*; +import java.util.concurrent.atomic.AtomicReference; +import java.util.stream.Collectors; /** * 描述一下 @@ -56,7 +55,7 @@ import java.util.UUID; */ @Service public class WorkActServiceImpl implements WorkActService { - private Logger logger = LogManager.getLogger(WorkActServiceImpl.class); + private final Logger logger = LogManager.getLogger(WorkActServiceImpl.class); @Value("${openapi.scan.server.url}") private String scanApiUrl; @Value("${openapi.scan.method.textSyncScan}") @@ -97,9 +96,16 @@ public class WorkActServiceImpl implements WorkActService { private UserKindnessTimeLogDao userKindnessTimeLogDao; @Autowired private LatestActInfoDao latestActInfoDao; + @Resource + private IcPartyActivityService icPartyActivityService; + @Resource + private IcResiDemandDictService icResiDemandDictService; + @Resource + private IcPartyUnitService icPartyUnitService; + + /** - * @return void * @author yinzuomei * @description 发布活动-删除历史活动草稿 * @Date 2020/7/20 18:15 @@ -184,9 +190,55 @@ public class WorkActServiceImpl implements WorkActService { return publishActResultDTO; } + @Override + @Transactional(rollbackFor = Exception.class) + public PublishActResultDTO publishActV2(PublishActInfoFormDTO formDTO) { + //构造属性保存活动属性,活动内容 + ActInfoEntity actInfoEntity=this.constructActInfo(formDTO); + //校验参数 + + //校验 活动报名截止时间应该大于当前时间 + if (actInfoEntity.getSignUpEndTime().before(DateUtils.minStrToSecondDate(DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE)))){ + throw new RenException(EpmetErrorCode.ACT_SIGN_UP_END_TIME_EARLIER_NOW_EERROR.getCode(),EpmetErrorCode.ACT_SIGN_UP_END_TIME_EARLIER_NOW_EERROR.getMsg()); + } + this.checkPublishFormDTO(actInfoEntity); + PublishActResultDTO publishActResultDTO=new PublishActResultDTO(); + //内容审核(活动标题、招募要求、活动内容图文) + this.auditAct(formDTO); + logger.info("发布活动,审核成功"); + + actInfoDao.insert(actInfoEntity); + //如果用户之前点击了预览,需要去更新草稿表里的act_info_id,记录草稿和活动的关系 + if(StringUtils.isNotBlank(formDTO.getActDraftId())){ + logger.info("更新latest_act_info表的act_info_id字段"); + latestActInfoDao.updateActInfoId(formDTO.getActDraftId(),actInfoEntity.getId()); + } + List actContentEntityList=this.constructActContent(formDTO.getActContent(),actInfoEntity.getId()); + for(ActContentEntity actContentEntity:actContentEntityList){ + actContentDao.insert(actContentEntity); + } + //插入一条操作日志 + ActOperationRecEntity actOperationRecEntity=new ActOperationRecEntity(); + actOperationRecEntity.setActId(actInfoEntity.getId()); + actOperationRecEntity.setType(ActConstant.ACT_OPER_TYPE_PUBLISH); + actOperationRecEntity.setNoticeUser(false); + actOperationRecEntity.setRemark(StrConstant.EPMETY_STR); + actOperationRecDao.insert(actOperationRecEntity); + + //删除所有的草稿 + this.deleteDraft(); + publishActResultDTO.setActId(actInfoEntity.getId()); + + //添加信息到ic_party_activity + if (ActConstant.PARTY.equals(formDTO.getActType())) { + IcPartyActivityEntity activity = getPartyActivityEntity(formDTO, actInfoEntity); + icPartyActivityService.insert(activity); + } + + return publishActResultDTO; + } /** - * @return void * @param actInfoEntity * @author yinzuomei * @description 第一次发布 @@ -209,23 +261,6 @@ public class WorkActServiceImpl implements WorkActService { } } - public static void main(String[] args) { - SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - - try { - Date yesterDate=format.parse("2020-07-26 13:00:00"); - Date today=format.parse("2020-07-27 13:00:00"); - Date tommorrow=format.parse("2020-07-28 13:00:00"); - Date today1=format.parse("2020-07-27 13:00:00"); - System.out.println(yesterDate.compareTo(today)); - System.out.println(tommorrow.compareTo(today)); - System.out.println(today.compareTo(today1)); - } catch (ParseException e) { - e.printStackTrace(); - } - - } - /** * @return void * @param formDTO @@ -720,7 +755,10 @@ public class WorkActServiceImpl implements WorkActService { if (wxmpMsg.success()) { logger.info("给审核通过的用户推送微信订阅消息成功"); } + } + //取消活动,删除ic_party_activity对应的活动 + icPartyActivityService.deleteByActId(formDTO.getActId()); } @@ -732,7 +770,7 @@ public class WorkActServiceImpl implements WorkActService { * @Date 2020/7/26 18:00 **/ @Override - public CanceledActDetailResultDTO canceledDetail(String actId) { + public CanceledActDetailResultDTO canceledDetail(String customerId, String actId) { CanceledActDetailResultDTO canceledActDetailResultDTO=actInfoDao.selectCanceledActInfo(actId); if(null!=canceledActDetailResultDTO){ canceledActDetailResultDTO.setActContent(actContentDao.selectByActId(actId)); @@ -741,6 +779,20 @@ public class WorkActServiceImpl implements WorkActService { }else{ canceledActDetailResultDTO.setIsMyPublish(false); } + + if (StringUtils.isNotBlank(canceledActDetailResultDTO.getServiceMatter())) { + //获取服务事项 + SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); + codeFormDTO.setCustomerId(customerId); + codeFormDTO.setParentCategoryCode(ActConstant.SERVICE_MATTER_CODE); + Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + canceledActDetailResultDTO.setServiceMatterName(categoryMap.get(canceledActDetailResultDTO.getServiceMatter())); + } + if (StringUtils.isNotBlank(canceledActDetailResultDTO.getUnitId())) { + //获取单位名称 + IcPartyUnitDTO unitDTO = icPartyUnitService.get(canceledActDetailResultDTO.getUnitId()); + canceledActDetailResultDTO.setUnitName(unitDTO.getUnitName()); + } } return canceledActDetailResultDTO; } @@ -785,6 +837,20 @@ public class WorkActServiceImpl implements WorkActService { }else{ resultDTO.setIsMyPublish(false); } + + if (StringUtils.isNotBlank(resultDTO.getServiceMatter())) { + //获取服务事项 + SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); + codeFormDTO.setCustomerId(formDTO.getCustomerId()); + codeFormDTO.setParentCategoryCode(ActConstant.SERVICE_MATTER_CODE); + Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + resultDTO.setServiceMatterName(categoryMap.get(resultDTO.getServiceMatter())); + } + if (StringUtils.isNotBlank(resultDTO.getUnitId())) { + //获取单位名称 + IcPartyUnitDTO unitDTO = icPartyUnitService.get(resultDTO.getUnitId()); + resultDTO.setUnitName(unitDTO.getUnitName()); + } } return resultDTO; } @@ -797,7 +863,7 @@ public class WorkActServiceImpl implements WorkActService { * @Date 2020/7/26 21:34 **/ @Override - public InProgressActDetailResultDTO inProgressDetail(String actId) { + public InProgressActDetailResultDTO inProgressDetail(String customerId, String actId) { InProgressActDetailResultDTO resultDTO = actInfoDao.selectInProgressDetail(actId); if (null != resultDTO) { Date nowDate=new Date(); @@ -853,6 +919,19 @@ public class WorkActServiceImpl implements WorkActService { }else{ resultDTO.setIsMyPublish(false); } + if (StringUtils.isNotBlank(resultDTO.getServiceMatter())) { + //获取服务事项 + SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); + codeFormDTO.setCustomerId(customerId); + codeFormDTO.setParentCategoryCode(ActConstant.SERVICE_MATTER_CODE); + Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + resultDTO.setServiceMatterName(categoryMap.get(resultDTO.getServiceMatter())); + } + if (StringUtils.isNotBlank(resultDTO.getUnitId())) { + //获取单位名称 + IcPartyUnitDTO unitDTO = icPartyUnitService.get(resultDTO.getUnitId()); + resultDTO.setUnitName(unitDTO.getUnitName()); + } } return resultDTO; } @@ -917,11 +996,11 @@ public class WorkActServiceImpl implements WorkActService { String opAgencyId=userResult.getData().getId(); //备注 String remark=String.format(ActMessageConstant.ACT_POINTS_EVENT_REMARK,actInfoDTO.getTitle()); - MqBaseMsgDTO mqBaseMsgDTO=new MqBaseMsgDTO(); + //MqBaseMsgDTO mqBaseMsgDTO=new MqBaseMsgDTO(); //mq的事件类型 - mqBaseMsgDTO.setEventClass(EventEnum.ACTIVE_SEND_POINT.getEventClass()); + //mqBaseMsgDTO.setEventClass(EventEnum.ACTIVE_SEND_POINT.getEventClass()); //事件code - mqBaseMsgDTO.setEventTag(EventEnum.ACTIVE_SEND_POINT.getEventTag()); + //mqBaseMsgDTO.setEventTag(EventEnum.ACTIVE_SEND_POINT.getEventTag()); List basePointEventMsgArrayList=new ArrayList<>(); for(ActUserRelationEntity actUserRelationEntity:actUserRelationEntityList){ BasePointEventMsg basePointEventMsg=new BasePointEventMsg(); @@ -937,15 +1016,22 @@ public class WorkActServiceImpl implements WorkActService { basePointEventMsg.setOperatorId(loginUserUtil.getLoginUserId()); basePointEventMsgArrayList.add(basePointEventMsg); } - mqBaseMsgDTO.setMsg(JSON.toJSONString(basePointEventMsgArrayList)); - Result result=SendMqMsgUtils.sendMsg(mqBaseMsgDTO); + //mqBaseMsgDTO.setMsg(JSON.toJSONString(basePointEventMsgArrayList)); + //Result result=SendMqMsgUtils.sendMsg(mqBaseMsgDTO); + + SystemMsgFormDTO systemMsgFormDTO = new SystemMsgFormDTO(); + systemMsgFormDTO.setMessageType(SystemMessageType.ACTIVE_SEND_POINT); + systemMsgFormDTO.setContent(basePointEventMsgArrayList); + + Result result = epmetMessageOpenFeignClient.sendSystemMsgByMQ(systemMsgFormDTO); + ActGrantPointLogEntity actGrantPointLogEntity=new ActGrantPointLogEntity(); actGrantPointLogEntity.setActId(actInfoDTO.getId()); actGrantPointLogEntity.setCustomerId(actInfoDTO.getCustomerId()); actGrantPointLogEntity.setOperatorId(loginUserUtil.getLoginUserId()); actGrantPointLogEntity.setRemark(remark); actGrantPointLogEntity.setReward(actInfoDTO.getReward()); - actGrantPointLogEntity.setSendMsg(JSON.toJSONString(mqBaseMsgDTO)); + actGrantPointLogEntity.setSendMsg(JSON.toJSONString(systemMsgFormDTO)); actGrantPointLogEntity.setResponseMsg(JSON.toJSONString(result)); actGrantPointLogDao.insert(actGrantPointLogEntity); if(!result.success()){ @@ -958,11 +1044,11 @@ public class WorkActServiceImpl implements WorkActService { //查询当前用户所属组织信息 Result userResult = govOrgOpenFeignClient.getAgencyByStaff(loginUserUtil.getLoginUserId()); String opAgencyId = userResult.getData().getId(); - MqBaseMsgDTO mqBaseMsgDTO = new MqBaseMsgDTO(); + //MqBaseMsgDTO mqBaseMsgDTO = new MqBaseMsgDTO(); //mq的事件类型 - mqBaseMsgDTO.setEventClass(EventEnum.ACTIVE_SEND_POINT.getEventClass()); + //mqBaseMsgDTO.setEventClass(EventEnum.ACTIVE_SEND_POINT.getEventClass()); //事件code - mqBaseMsgDTO.setEventTag(EventEnum.ACTIVE_SEND_POINT.getEventTag()); + //mqBaseMsgDTO.setEventTag(EventEnum.ACTIVE_SEND_POINT.getEventTag()); List basePointEventMsgArrayList = new ArrayList<>(); BasePointEventMsg basePointEventMsg = new BasePointEventMsg(); basePointEventMsg.setOpAgencyId(opAgencyId); @@ -976,9 +1062,16 @@ public class WorkActServiceImpl implements WorkActService { basePointEventMsg.setSourceId(formDTO.getSourceId()); basePointEventMsg.setOperatorId(loginUserUtil.getLoginUserId()); basePointEventMsgArrayList.add(basePointEventMsg); - mqBaseMsgDTO.setMsg(JSON.toJSONString(basePointEventMsgArrayList)); - logger.info("发送消息入参:"+JSON.toJSON(mqBaseMsgDTO)); - Result result = SendMqMsgUtils.sendMsg(mqBaseMsgDTO); + //mqBaseMsgDTO.setMsg(JSON.toJSONString(basePointEventMsgArrayList)); + //logger.info("发送消息入参:"+JSON.toJSON(mqBaseMsgDTO)); + //Result result = SendMqMsgUtils.sendMsg(mqBaseMsgDTO); + + SystemMsgFormDTO msgForm = new SystemMsgFormDTO(); + msgForm.setMessageType(SystemMessageType.ACTIVE_SEND_POINT); + msgForm.setContent(basePointEventMsgArrayList); + + Result result = epmetMessageOpenFeignClient.sendSystemMsgByMQ(msgForm); + logger.info("发送消息返参:"+JSON.toJSON(result)); ActGrantPointLogEntity actGrantPointLogEntity=new ActGrantPointLogEntity(); actGrantPointLogEntity.setActId(formDTO.getSourceId()); @@ -986,7 +1079,7 @@ public class WorkActServiceImpl implements WorkActService { actGrantPointLogEntity.setOperatorId(loginUserUtil.getLoginUserId()); actGrantPointLogEntity.setRemark(formDTO.getRemark()); actGrantPointLogEntity.setReward(formDTO.getReward()); - actGrantPointLogEntity.setSendMsg(JSON.toJSONString(mqBaseMsgDTO)); + actGrantPointLogEntity.setSendMsg(JSON.toJSONString(msgForm)); actGrantPointLogEntity.setResponseMsg(JSON.toJSONString(result)); actGrantPointLogDao.insert(actGrantPointLogEntity); if (!result.success()) { @@ -1084,6 +1177,15 @@ public class WorkActServiceImpl implements WorkActService { //拒绝发放积分总人数 actStatisticalDTO.setDenyRewardUserNum(actUserRelationDao.selectCountByReward(actId,ActConstant.ACT_USER_STATUS_DENY)); actStatisticalService.save(actStatisticalDTO); + + //保存服务人数 + IcPartyActivityDTO dto = icPartyActivityService.getActivityByActId(actId); + if (null != dto) { + IcPartyActivityEntity actInfoEntity = new IcPartyActivityEntity(); + actInfoEntity.setId(dto.getId()); + actInfoEntity.setPeopleCount(actStatisticalDTO.getSignedInUserNum()); + icPartyActivityService.updateById(actInfoEntity); + } } /** @@ -1177,6 +1279,15 @@ public class WorkActServiceImpl implements WorkActService { //更新act_info表的SUMMARY_FLAG=true actInfoDTO.setSummaryFlag(true); actInfoService.update(actInfoDTO); + + //保存活动结果 + IcPartyActivityDTO dto = icPartyActivityService.getActivityByActId(formDTO.getActId()); + if (null != dto) { + IcPartyActivityEntity actInfoEntity = new IcPartyActivityEntity(); + actInfoEntity.setId(dto.getId()); + actInfoEntity.setResult(getContent(formDTO.getActSummary())); + icPartyActivityService.updateById(actInfoEntity); + } } /** @@ -1187,7 +1298,7 @@ public class WorkActServiceImpl implements WorkActService { * @Date 2020/7/27 13:36 **/ @Override - public ReEditActInfoResultDTO getActInfo(String actId) { + public ReEditActInfoResultDTO getActInfo(String customerId, String actId) { ActInfoDTO actInfoDTO=actInfoService.get(actId); if(null==actInfoDTO){ logger.error("act_info is null"); @@ -1203,6 +1314,21 @@ public class WorkActServiceImpl implements WorkActService { resultDTO.setActId(actId); List actContent=actContentDao.selectByActId(actId); resultDTO.setActContent(actContent); + + if (StringUtils.isNotBlank(resultDTO.getServiceMatter())) { + //获取服务事项 + SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); + codeFormDTO.setCustomerId(customerId); + codeFormDTO.setParentCategoryCode(ActConstant.SERVICE_MATTER_CODE); + Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + resultDTO.setServiceMatterName(categoryMap.get(resultDTO.getServiceMatter())); + } + if (StringUtils.isNotBlank(resultDTO.getUnitId())) { + //获取单位名称 + IcPartyUnitDTO unitDTO = icPartyUnitService.get(resultDTO.getUnitId()); + resultDTO.setUnitName(unitDTO.getUnitName()); + } + return resultDTO; } @@ -1264,5 +1390,108 @@ public class WorkActServiceImpl implements WorkActService { return publishActResultDTO; } + @Override + @Transactional(rollbackFor = Exception.class) + public PublishActResultDTO rePublishV2(RePublishFormDTO rePublishFormDTO) { + ActInfoDTO originalActInfo=actInfoService.get(rePublishFormDTO.getActId()); + if(null==originalActInfo){ + logger.error("act_info is null"); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } + if(!originalActInfo.getCreatedBy().equals(loginUserUtil.getLoginUserId())){ + throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); + } + if(!ActConstant.ACT_STATUS_PUBLISHED.equals(originalActInfo.getActStatus())){ + throw new RenException("只有进行中的活动才可以编辑"); + } + //构造属性保存活动属性,活动内容 + ActInfoEntity newActInfoEntity=this.constructRePublishActInfo(rePublishFormDTO); + //校验参数 + this.checkPublishFormDTO(newActInfoEntity); + PublishActResultDTO publishActResultDTO=new PublishActResultDTO(); + //内容审核(活动标题、招募要求、活动内容图文) + this.auditRePublishAct(rePublishFormDTO); + logger.info("重新发布活动,审核成功"); + newActInfoEntity.setId(rePublishFormDTO.getActId()); + actInfoDao.updateById(newActInfoEntity); + //删除原来的 + actContentDao.updateDelFlagByActId(rePublishFormDTO.getActId()); + //插入编辑后的活动详情 + List actContentEntityList=this.constructActContent(rePublishFormDTO.getActContent(),rePublishFormDTO.getActId()); + for(ActContentEntity actContentEntity:actContentEntityList){ + actContentDao.insert(actContentEntity); + } + //插入一条操作日志 + ActOperationRecEntity actOperationRecEntity=new ActOperationRecEntity(); + actOperationRecEntity.setActId(rePublishFormDTO.getActId()); + actOperationRecEntity.setType(ActConstant.ACT_OPER_TYPE_UPDATE); + actOperationRecEntity.setNoticeUser(rePublishFormDTO.getNoticePassedPeople()); + actOperationRecEntity.setRemark(StrConstant.EPMETY_STR); + actOperationRecDao.insert(actOperationRecEntity); + + //删除所有的草稿 + this.deleteDraft(); + publishActResultDTO.setActId(rePublishFormDTO.getActId()); + //发送消息通知-暂时不做了,前端默认串的是不通知 + //如果用户在重新发布之前点击了预览,需要去更新草稿表里的act_info_id,记录草稿和活动的关系 + if(StringUtils.isNotBlank(rePublishFormDTO.getActDraftId())){ + latestActInfoDao.updateActInfoId(rePublishFormDTO.getActDraftId(),newActInfoEntity.getId()); + } + + //添加信息到ic_party_activity + if (ActConstant.PARTY.equals(rePublishFormDTO.getActType())) { + IcPartyActivityDTO activityDTO = icPartyActivityService.getActivityByActId(newActInfoEntity.getId()); + if (null != activityDTO) { + IcPartyActivityEntity activity = getPartyActivityEntity(ConvertUtils.sourceToTarget(rePublishFormDTO, PublishActInfoFormDTO.class), newActInfoEntity); + activity.setId(activityDTO.getId()); + icPartyActivityService.updateById(activity); + } + } + + return publishActResultDTO; + } + + /** + * 构建联建活动对象 + * @Param formDTO + * @Return {@link IcPartyActivityEntity} + * @Author zhaoqifeng + * @Date 2021/12/23 14:32 + */ + private IcPartyActivityEntity getPartyActivityEntity(PublishActInfoFormDTO formDTO, ActInfoEntity actInfoEntity) { + IcPartyActivityEntity entity = new IcPartyActivityEntity(); + entity.setCustomerId(actInfoEntity.getCustomerId()); + entity.setAgencyId(actInfoEntity.getSponsorId()); + Result result=govOrgOpenFeignClient.getAgencyById(formDTO.getSponsorId()); + if(result.success()&&null!=result.getData()){ + entity.setPids(result.getData().getPids()); + }else{ + logger.warn("根据agencyId查询组织信息失败,agencyId={}",formDTO.getSponsorId()); + } + entity.setActId(actInfoEntity.getId()); + entity.setUnitId(actInfoEntity.getUnitId()); + entity.setServiceMatter(actInfoEntity.getServiceMatter()); + entity.setTitle(actInfoEntity.getTitle()); + entity.setTarget(actInfoEntity.getTarget()); + entity.setContent(getContent(formDTO.getActContent())); + entity.setPeopleCount(NumConstant.ZERO); + entity.setActivityTime(actInfoEntity.getActStartTime()); + entity.setAddress(actInfoEntity.getActAddress()); + entity.setLongitude(actInfoEntity.getActLongitude().toPlainString()); + entity.setLatitude(actInfoEntity.getActLatitude().toPlainString()); + return entity; + } + + private String getContent(List actContent) { + AtomicReference content = new AtomicReference<>(""); + actContent.forEach(i -> { + if(ActConstant.ACT_CONTENT_TYPE_TEXT.equals(i.getContentType())) { + content.set(content.get().concat("

").concat(i.getContent()).concat("

")); + } else { + content.set(content.get().concat("

").concat("").concat("

")); + } + }); + return content.get(); + } } 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 11e6aea570..aa43055c8e 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 @@ -63,7 +63,7 @@ spring: password: @datasource.druid.password@ baseline-on-migrate: true baseline-version: 0 - + validate-on-migrate: false management: endpoints: web: diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.4__awardpoint_volunteerpid.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.4__awardpoint_volunteerpid.sql new file mode 100644 index 0000000000..6849125e20 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.4__awardpoint_volunteerpid.sql @@ -0,0 +1,8 @@ +alter table ic_user_demand_rec add COLUMN AWARD_POINT int(11) not null default '0' comment '奖励积分', +add COLUMN SERVICE_LOCATION VARCHAR(255) NOT NULL DEFAULT '' COMMENT '服务地点,工作端指派默认居民居住房屋地址,居民端地图选择', +add COLUMN LOCATION_DETAIL VARCHAR(255) DEFAULT'' COMMENT '门牌号详细地址', +add COLUMN LONGITUDE VARCHAR(64) DEFAULT'' COMMENT '经度,需求人是ic的居民时,取所住楼栋的中心点位', +add COLUMN LATITUDE VARCHAR(64) DEFAULT'' COMMENT '纬度,需求人是ic的居民时,取所住楼栋的中心点位', +add COLUMN DEMAND_USER_HOUSE_ID VARCHAR(64) DEFAULT'' COMMENT '需求人是ic的居民时,记录下住的房屋id'; +-- alter table volunteer_info add COLUMN PID VARCHAR(64) comment '网格所属的组织id' after GRID_ID; +-- alter table volunteer_info add COLUMN PIDS VARCHAR(255) comment '网格的所有上级' after PID; \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.5__activity.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.5__activity.sql new file mode 100644 index 0000000000..fd9732bc6e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.5__activity.sql @@ -0,0 +1,9 @@ +ALTER TABLE `epmet_heart`.`act_info` + ADD COLUMN `ACT_TYPE` varchar(10) NULL COMMENT '活动类型 爱心活动heart 联建活动party' AFTER `CUSTOMER_ID`, + ADD COLUMN `UNIT_ID` varchar(64) NULL COMMENT '联建单位ID' AFTER `ACT_TYPE`, + ADD COLUMN `SERVICE_MATTER` varchar(64) NULL COMMENT '服务事项' AFTER `UNIT_ID`, + ADD COLUMN `TARGET` varchar(100) NULL COMMENT '活动目标' AFTER `TITLE`; + + +ALTER TABLE `epmet_heart`.`ic_party_activity` + ADD COLUMN `ACT_ID` varchar(64) NULL COMMENT 'act_info表ID' AFTER `PIDS`; \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.6__activity.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.6__activity.sql new file mode 100644 index 0000000000..283aaaf5c2 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.6__activity.sql @@ -0,0 +1,5 @@ +ALTER TABLE `epmet_heart`.`latest_act_info` + ADD COLUMN `ACT_TYPE` varchar(10) NULL COMMENT '活动类型 爱心活动heart 联建活动party' AFTER `CUSTOMER_ID`, + ADD COLUMN `UNIT_ID` varchar(64) NULL COMMENT '联建单位ID' AFTER `ACT_TYPE`, + ADD COLUMN `SERVICE_MATTER` varchar(64) NULL COMMENT '服务事项' AFTER `UNIT_ID`, + ADD COLUMN `TARGET` varchar(100) NULL COMMENT '活动目标' AFTER `TITLE`; \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml index 4ce15b04c7..6aa5b1b477 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml @@ -63,7 +63,8 @@ i.ACT_QUOTA actQuota, IFNULL(c.signupNum, 0) signupNum, -- 已报名人数 'signing_up' AS actCurrentState, -- 活动状态:报名中,未报满 - IF(u.USER_ID = #{userId},'signed_up','no_signed_up') as signupFlag + IF(u.USER_ID = #{userId},'signed_up','no_signed_up') as signupFlag, + i.ACT_TYPE as actType FROM act_info i LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0' AND u.`STATUS` != 'refused' AND u.`STATUS` != 'canceled' AND u.USER_ID = #{userId} LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` != 'refused' AND re.`STATUS` != 'canceled' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID @@ -89,7 +90,8 @@ i.ACT_QUOTA actQuota, IFNULL(c.signupNum, 0) signupNum, -- 已报名人数 'enough' AS actCurrentState, -- 活动状态:报名中,已报满 - IF(u.USER_ID = #{userId},'signed_up','no_signed_up') as signupFlag + IF(u.USER_ID = #{userId},'signed_up','no_signed_up') as signupFlag, + i.ACT_TYPE as actType FROM act_info i LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0' AND u.`STATUS` != 'refused' AND u.`STATUS` != 'canceled' AND u.USER_ID = #{userId} LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` != 'refused' AND re.`STATUS` != 'canceled' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID @@ -116,7 +118,8 @@ i.ACT_QUOTA actQuota, IFNULL(c.signupNum, 0) signupNum, -- 已报名人数 'end_sign_up' AS actCurrentState, -- 活动状态:未开始 - IF(u.USER_ID = #{userId},'signed_up','no_signed_up') as signupFlag + IF(u.USER_ID = #{userId},'signed_up','no_signed_up') as signupFlag, + i.ACT_TYPE as actType FROM act_info i LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0' AND u.`STATUS` != 'refused' AND u.`STATUS` != 'canceled' AND u.USER_ID = #{userId} LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` != 'refused' AND re.`STATUS` != 'canceled' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID @@ -142,7 +145,8 @@ i.ACT_QUOTA actQuota, IFNULL(c.signupNum, 0) signupNum, -- 已报名人数 'in_progress' AS actCurrentState, -- 活动状态:进行中 - IF(u.USER_ID = #{userId},'signed_up','no_signed_up') as signupFlag + IF(u.USER_ID = #{userId},'signed_up','no_signed_up') as signupFlag, + i.ACT_TYPE as actType FROM act_info i LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0' AND u.`STATUS` != 'refused' AND u.`STATUS` != 'canceled' AND u.USER_ID = #{userId} LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` != 'refused' AND re.`STATUS` != 'canceled' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID @@ -173,7 +177,8 @@ when i.ACT_STATUS = 'canceled' then 'canceled' end as actCurrentState, -- 活动状态:已结束、已取消 - IF(u.USER_ID = #{userId},'signed_up','no_signed_up') as signupFlag + IF(u.USER_ID = #{userId},'signed_up','no_signed_up') as signupFlag, + i.ACT_TYPE as actType FROM act_info i LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0' AND u.`STATUS` != 'refused' AND u.`STATUS` != 'canceled' AND u.USER_ID = #{userId} LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` != 'refused' AND re.`STATUS` != 'canceled' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID @@ -197,7 +202,8 @@ i.ACT_QUOTA_CATEGORY actQuotaCategory, -- 活动名额类型(true:固定名额(1) false: 不限制名额(0)) i.ACT_QUOTA actQuota, IFNULL(c.signupNum, 0) signupNum, -- 已报名人数 - 'auditing' AS actCurrentState -- 活动状态 + 'auditing' AS actCurrentState, -- 活动状态 + i.act_type as actType FROM act_user_relation u LEFT JOIN act_info i ON i.ID = u.ACT_ID LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` != 'refused' AND re.`STATUS` != 'canceled' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID WHERE i.DEL_FLAG = '0' @@ -222,7 +228,8 @@ i.ACT_QUOTA_CATEGORY actQuotaCategory, -- 活动名额类型(true:固定名额(1) false: 不限制名额(0)) i.ACT_QUOTA actQuota, IFNULL(c.signupNum, 0) signupNum, -- 已报名人数 - 'passed' AS actCurrentState -- 活动状态 + 'passed' AS actCurrentState, -- 活动状态 + i.act_type as actType FROM act_user_relation u LEFT JOIN act_info i ON i.ID = u.ACT_ID LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` != 'refused' AND re.`STATUS` != 'canceled' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID WHERE i.DEL_FLAG = '0' @@ -247,7 +254,8 @@ i.ACT_QUOTA_CATEGORY actQuotaCategory, -- 活动名额类型(true:固定名额(1) false: 不限制名额(0)) i.ACT_QUOTA actQuota, IFNULL(c.signupNum, 0) signupNum, -- 已报名人数 - 'refused' AS actCurrentState -- 活动状态 + 'refused' AS actCurrentState, -- 活动状态 + i.act_type as actType FROM act_user_relation u LEFT JOIN act_info i ON i.ID = u.ACT_ID LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` != 'refused' AND re.`STATUS` != 'canceled' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID WHERE i.DEL_FLAG = '0' @@ -272,7 +280,8 @@ i.ACT_QUOTA_CATEGORY actQuotaCategory, -- 活动名额类型(true:固定名额(1) false: 不限制名额(0)) i.ACT_QUOTA actQuota, IFNULL(c.signupNum, 0) signupNum, -- 已报名人数 - 'canceld' AS actCurrentState -- 活动状态 + 'canceld' AS actCurrentState, -- 活动状态 + i.act_type as actType FROM act_user_relation u LEFT JOIN act_info i ON i.ID = u.ACT_ID LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` != 'refused' AND re.`STATUS` != 'canceled' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID WHERE i.DEL_FLAG = '0' @@ -309,7 +318,8 @@ then 'end_sign_up' when NOW() then 'in_progress' - end as actCurrentState + end as actCurrentState, + i.act_type as actType FROM act_info i LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` != 'refused' AND re.`STATUS` != 'canceled' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID WHERE i.DEL_FLAG = '0' @@ -329,7 +339,8 @@ '您报名的活动即将开始' ELSE '活动进行中' - END title + END title, + i.act_type as actType FROM act_info i LEFT JOIN act_user_relation r ON i.ID = r.ACT_ID WHERE i.DEL_FLAG = '0' AND r.DEL_FLAG = '0' @@ -349,7 +360,8 @@ a.actStartTime, a.actEndTime, a.actAddress, - a.actCurrentState + a.actCurrentState, + a.actType FROM( SELECT i.ID actId, @@ -360,7 +372,8 @@ DATE_FORMAT(i.ACT_END_TIME,'%Y-%m-%d %H:%i') actEndTime, i.ACT_ADDRESS actAddress, 'finished' actCurrentState, - i.CREATED_TIME + i.CREATED_TIME, + i.ACT_TYPE as actType FROM act_info i LEFT JOIN act_live_rec r ON r.ACT_ID = i.ID AND r.DEL_FLAG = '0' WHERE i.DEL_FLAG = '0' @@ -432,7 +445,11 @@ IF(aur.SIGN_IN_FLAG = 'signed_in', true , false ) as isSignUp, -- 是否已签到(true已签到,false未签到) i.ACT_STATUS actStatus, i.CANCEL_REASON cancelReason, - DATE_FORMAT(i.CANCEL_TIME,'%Y-%m-%d %H:%i') cancelTime + DATE_FORMAT(i.CANCEL_TIME,'%Y-%m-%d %H:%i') cancelTime, + i.UNIT_ID AS unitId, + i.SERVICE_MATTER AS serviceMatter, + i.TARGET AS target, + i.act_type as actType FROM act_info i LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` != 'refused' AND re.`STATUS` != 'canceled' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID @@ -516,7 +533,8 @@ ) AS signedUp, ai.SIGN_UP_END_TIME as signUpEndTime, ai.SIGN_UP_START_TIME as signUpStartTime, - ai.ACT_ADDRESS as actAddress + ai.ACT_ADDRESS as actAddress, + ai.act_type as actType FROM act_info ai WHERE @@ -537,7 +555,8 @@ ai.ACT_END_TIME AS actEndTime, ai.CANCEL_TIME AS cancelTime, ai.CANCEL_REASON AS cancelReason, - ai.ACT_ADDRESS as actAddress + ai.ACT_ADDRESS as actAddress, + ai.act_type as actType FROM act_info ai WHERE @@ -559,7 +578,8 @@ ai.ACT_END_TIME AS actEndTime, ai.ACTUAL_START_TIME as actualStartTime, ai.ACTUAL_END_TIME as actualEndTime, - ai.ACT_ADDRESS as actAddress + ai.ACT_ADDRESS as actAddress, + ai.act_type as actType FROM act_info ai WHERE @@ -645,7 +665,11 @@ ai.SIGN_IN_START_TIME as signInStartTime, ai.SIGN_IN_END_TIME as signInEndTime, ai.SIGN_IN_ADDRESS as signInAddress, - ai.SIGN_IN_RADIUS as signInRadius + ai.SIGN_IN_RADIUS as signInRadius, + ai.ACT_TYPE, + ai.UNIT_ID, + ai.SERVICE_MATTER, + ai.TARGET FROM act_info ai WHERE @@ -678,7 +702,11 @@ ai.SIGN_IN_START_TIME as signInStartTime, ai.SIGN_IN_END_TIME as signInEndTime, ai.SIGN_IN_ADDRESS as signInAddress, - ai.SIGN_IN_RADIUS as signInRadius + ai.SIGN_IN_RADIUS as signInRadius, + ai.ACT_TYPE, + ai.UNIT_ID, + ai.SERVICE_MATTER, + ai.TARGET FROM act_info ai WHERE @@ -717,7 +745,11 @@ ai.SIGN_IN_START_TIME as signInStartTime, ai.SIGN_IN_END_TIME as signInEndTime, ai.SIGN_IN_ADDRESS as signInAddress, - ai.SIGN_IN_RADIUS as signInRadius + ai.SIGN_IN_RADIUS as signInRadius, + ai.ACT_TYPE, + ai.UNIT_ID, + ai.SERVICE_MATTER, + ai.TARGET FROM act_info ai WHERE 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 d9d79ecaec..36aa408316 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 @@ -91,7 +91,8 @@ + + + + + + \ 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 index 11d3190a6c..4bb193f075 100644 --- 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 @@ -68,7 +68,7 @@ ) as serviceName, s.SERVICE_START_TIME as serviceStartTime, s.SERVICE_END_TIME as serviceEndTime, - IFNULL(s.FINISH_DESC,'') as finishDesc, + IFNULL(sa.remark,'') as finishDesc, '' AS serviceShowName, s.id as serviceId, ( @@ -192,7 +192,7 @@ ) as serviceName, s.SERVICE_START_TIME as serviceStartTime, s.SERVICE_END_TIME as serviceEndTime, - IFNULL(s.FINISH_DESC,'') as finishDesc, + IFNULL(sa.remark,'') as finishDesc, '' AS serviceShowName, s.id as serviceId, left(r.CATEGORY_CODE,4) as firstCategoryCode, @@ -205,7 +205,20 @@ CASE WHEN R.DEMAND_USER_TYPE='mini_resi' THEN R.DEMAND_USER_ID ELSE '' END - ) as epmetUserId + ) as epmetUserId, + r.AWARD_POINT as awardPoint, + ( + case when r.status ='pending' then r.SERVICE_LOCATION + when r.status ='assigned' then concat( r.SERVICE_LOCATION, r.LOCATION_DETAIL ) + when r.status ='have_order' then concat( r.SERVICE_LOCATION, r.LOCATION_DETAIL ) + when r.status ='finished' then concat( r.SERVICE_LOCATION, r.LOCATION_DETAIL ) + else '' + end + ) AS serviceAddress, + r.SERVICE_LOCATION, + r.LOCATION_DETAIL, + r.LONGITUDE, + r.LATITUDE FROM ic_user_demand_rec r left JOIN ic_user_demand_service s ON ( r.id = s.DEMAND_REC_ID AND s.DEL_FLAG = '0' ) @@ -227,10 +240,27 @@ r.PARENT_CODE as parentCode, r.CONTENT, r.REPORT_TYPE as reportType, + ( + case when r.REPORT_TYPE='community' then '社区帮办' + when r.REPORT_TYPE='building_caption' then '楼长帮办' + when r.REPORT_TYPE='party' then '党员帮办' + when r.REPORT_TYPE='self_help' then '自身上报' + else '' + end + )as reportTypeName, r.REPORT_TIME as reportTime, r.REPORT_USER_NAME as reportUserName, r.REPORT_USER_MOBILE as reportUserMobile, r.`STATUS` as status, + ( + case when r.`STATUS`='pending' then '待处理' + when r.`STATUS`='canceled' then '已取消' + when r.`STATUS`='assigned' then '已派单' + when r.`STATUS`='have_order' then '已接单' + when r.`STATUS`='finished' then '已完成' + else '' + end + )as statusName, r.DEMAND_USER_ID as demandUserId, r.DEMAND_USER_NAME as demandUserName, r.DEMAND_USER_MOBILE as demandUserMobile, @@ -251,7 +281,7 @@ ) as serviceName, s.SERVICE_START_TIME as serviceStartTime, s.SERVICE_END_TIME as serviceEndTime, - IFNULL(s.FINISH_DESC,'') as finishDesc, + IFNULL(sa.remark,'') as finishDesc, '' AS serviceShowName, s.id as serviceId, ( @@ -292,6 +322,9 @@ AND DATE_FORMAT(r.REPORT_TIME,'%Y-%m-%d') #{endDateId} + + and r.STATUS !=#{excludeStatus} + order by r.WANT_SERVICE_TIME desc,r.REPORT_TIME asc @@ -391,7 +424,8 @@ - SELECT S.SERVER_ID AS serverId, SUM( M.SCORE ) AS totalScore, @@ -405,10 +439,130 @@ AND r.DEL_FLAG = '0' AND m.CUSTOMER_ID = #{customerId} AND r.`STATUS` = 'finished' - and s.SERVICE_TYPE ='party_unit' - - and s.server_id=#{partyUnitId} + and s.SERVICE_TYPE=#{serviceType} + + and s.server_id=#{serverId} group by s.SERVER_ID + + + + + + + + + + + + + + update ic_user_demand_rec + set EVALUATE_FLAG='1', + FINISH_RESULT=#{finishResult}, + UPDATED_TIME=NOW() + where id=#{demandRecId} + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml index f0904b26a4..67f4cb64a7 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml @@ -113,7 +113,11 @@ lai.REQUIREMENT AS requirement, lai.SPONSOR_NAME AS sponsorName, lai.SPONSOR_CONTACTS AS sponsorContacts, - lai.SPONSOR_TEL AS sponsorTel + lai.SPONSOR_TEL AS sponsorTel, + lai.ACT_TYPE, + lai.UNIT_ID, + lai.SERVICE_MATTER, + lai.TARGET FROM latest_act_info lai WHERE 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 4dc80881f2..11d2fde8c4 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 @@ -17,6 +17,8 @@ + + SELECT - CUSTOMER_ID customerId, - VOLUNTEER_INTRODUCE volunteerIntroduce, - VOLUNTEER_SIGNATURE volunteerSignature, - GRID_ID gridId, - GRID_NAME gridName, - USER_ID as userId + * FROM volunteer_info WHERE DEL_FLAG = '0' AND USER_ID = #{userId} diff --git a/epmet-module/epmet-job/epmet-job-server/pom.xml b/epmet-module/epmet-job/epmet-job-server/pom.xml index a29d14a7c6..e4580a3649 100644 --- a/epmet-module/epmet-job/epmet-job-server/pom.xml +++ b/epmet-module/epmet-job/epmet-job-server/pom.xml @@ -90,6 +90,12 @@ 2.0.0 compile + + com.epmet + epmet-heart-client + 2.0.0 + compile + com.epmet gov-issue-client diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/AutoEvaluateDemandTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/AutoEvaluateDemandTask.java new file mode 100644 index 0000000000..23d5d34787 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/AutoEvaluateDemandTask.java @@ -0,0 +1,31 @@ +package com.epmet.task; + + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.AutoEvaluateDemandFormDTO; +import com.epmet.feign.EpmetHeartOpenFeignClient; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @author yinzuomei + * @dscription 每天晚上23:50执行,需求已完成,未评分的自动评分=》发放积分,计算满意度 + */ +@Slf4j +@Component("autoEvaluateDemandTask") +public class AutoEvaluateDemandTask implements ITask { + @Autowired + private EpmetHeartOpenFeignClient heartOpenFeignClient; + + @Override + public void run(String params) { + AutoEvaluateDemandFormDTO formDTO = new AutoEvaluateDemandFormDTO(); + if (StringUtils.isNotBlank(params)) { + formDTO = JSON.parseObject(params, AutoEvaluateDemandFormDTO.class); + } + Result result = heartOpenFeignClient.autoEvaluateDemand(formDTO); + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ResiEventAutoAuditTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ResiEventAutoAuditTask.java new file mode 100644 index 0000000000..1e56204d0f --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ResiEventAutoAuditTask.java @@ -0,0 +1,30 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.feign.GovProjectOpenFeignClient; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @author sun + * @dscription 事件语音附件自动审核任务,没两分钟执行一次 + */ +@Slf4j +@Component("resiEventAutoAuditTask") +public class ResiEventAutoAuditTask implements ITask { + + @Autowired + private GovProjectOpenFeignClient govProjectOpenFeignClient; + + @Override + public void run(String params) { + log.info("ResiEventAutoAuditTask定时任务正在执行,参数为:{}", params); + Result result = govProjectOpenFeignClient.autoAudit(); + if (result.success()) { + log.info("ResiEventAutoAuditTask定时任务执行成功"); + } else { + log.error("ResiEventAutoAuditTask定时任务执行失败:" + result.getMsg()); + } + } +} 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 60230d3a10..ca857bf0f5 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 @@ -110,4 +110,54 @@ public interface SystemMessageType { */ String CAL_PARTY_UNIT_SATISFACTION = "cal_party_unit_satisfaction"; + /** + * 活动发放积分 + */ + String ACTIVE_SEND_POINT = "active_send_point"; + /** + * 认证志愿者 + */ + String REGISTER_VOLUNTEER = "register_volunteer"; + /** + * 添加活动实况 + */ + String ACTIVE_INSERT_LIVE = "active_insert_live"; + /** + * 拉新用户入组 + */ + String INVITE_NEW_INTO_GROUP = "invite_new_into_group"; + /** + * 邀请已注册的用户入组 + */ + String INVITE_RESI_INTO_GROUP = "invite_resi_into_group"; + /** + * 发布话题 + */ + String PUBLISH_ONE_TOPIC = "publish_one_topic"; + /** + * 话题被转为议题(小组中发布的话题被组长转为议题) + */ + String TOPIC_TO_ISSUE = "topic_to_issue"; + /** + * 对小组内话题进行15字以上评论 + */ + String PARTICIPATE_ONE_TOPIC = "participate_one_topic"; + /** + * 转话题为议题(将自建小组中话题转为议题) + */ + String SHIFT_TOPIC_TO_ISSUE = "shift_topic_to_issue"; + /** + * 话题被转为项目 + */ + String TOPIC_TO_PROJECT = "topic_to_project"; + /** + * 组长解决组内话题 + */ + String LEADER_RESOLVE_TOPIC = "leader_resolve_topic"; + + /** + * 完成用户需求,需求人提交评价 + */ + String FINISH_USER_DEMAND="finish_user_demand"; + } diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/UserMessageTypeConstant.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/UserMessageTypeConstant.java index adcea05711..c4f703049c 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/UserMessageTypeConstant.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/UserMessageTypeConstant.java @@ -191,4 +191,16 @@ public interface UserMessageTypeConstant { * user_badge_certificate_record.id */ String BADGE_AUTH_APPLY="badge_auth_apply"; + + /** + * 事件回复、立项、办结操作 + * rsi_event.id + */ + String EVENT ="event"; + + /** + * 需求接单、指派、确认服务时间操作 + * ic_user_demand_rec.id + */ + String DEMAND="demand"; } diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SystemMsgFormDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SystemMsgFormDTO.java index c0fb1400e9..24dbd8694f 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SystemMsgFormDTO.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SystemMsgFormDTO.java @@ -19,6 +19,6 @@ public class SystemMsgFormDTO { @NotNull(message = "消息内容不能为空", groups = { SendMsgByMQ.class }) private Object content; - @NotNull(message = "pendingMsgLabel不能为空", groups = { AckMsgByMQ.class }) - private String pendingMsgLabel; + //@NotNull(message = "pendingMsgLabel不能为空", groups = { AckMsgByMQ.class }) + //private String pendingMsgLabel; } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/UserMessageController.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/UserMessageController.java index a176b3f2ca..61bfa0166a 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/UserMessageController.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/UserMessageController.java @@ -18,7 +18,9 @@ package com.epmet.controller; import com.baomidou.mybatisplus.extension.api.R; +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.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; @@ -162,4 +164,15 @@ public class UserMessageController { List list = userMessageService.queryStaffMessage(formDTO); return new Result>().ok(list); } + + /** + * @Author sun + * @Description 【消息】删除已读消息列表 + **/ + @PostMapping("delreadmsg") + public Result delReadMsg(@LoginUser TokenDto tokenDto) { + userMessageService.delReadMsg(tokenDto.getUserId()); + return new Result(); + } + } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/UserMessageDao.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/UserMessageDao.java index bc89c54224..9a5bb0d739 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/UserMessageDao.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/UserMessageDao.java @@ -62,4 +62,10 @@ public interface UserMessageDao extends BaseDao { * @Date 2020/5/17 16:47 **/ List queryStaffMessage(StaffMessageFormDTO formDTO); + + /** + * @Author sun + * @Description 【消息】删除已读消息列表 + **/ + int delReadMsg(@Param("userId") String userId); } \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/UserMessageService.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/UserMessageService.java index cdc41470c8..ce8417175c 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/UserMessageService.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/UserMessageService.java @@ -142,4 +142,10 @@ public interface UserMessageService extends BaseService { StaffUnReadMsgResultDTO queryUnReadMsg(StaffMessageCommonFormDTO formDTO); List queryStaffMessage(StaffMessageFormDTO formDTO); + + /** + * @Author sun + * @Description 【消息】删除已读消息列表 + **/ + void delReadMsg(String userId); } \ No newline at end of file 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 a5c07f9ea1..77fe52d141 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 @@ -209,7 +209,26 @@ public class SystemMessageServiceImpl implements SystemMessageService { topic = TopicConstants.IC_RESI_USER; break; case SystemMessageType.CAL_PARTY_UNIT_SATISFACTION: - topic=TopicConstants.CAL_PARTY_UNIT_SATISFACTION; + topic=TopicConstants.USER_DEMAND; + break; + case SystemMessageType.INVITE_NEW_INTO_GROUP: + case SystemMessageType.INVITE_RESI_INTO_GROUP: + case SystemMessageType.PUBLISH_ONE_TOPIC: + case SystemMessageType.PARTICIPATE_ONE_TOPIC: + case SystemMessageType.TOPIC_TO_ISSUE: + case SystemMessageType.SHIFT_TOPIC_TO_ISSUE: + case SystemMessageType.TOPIC_TO_PROJECT: + case SystemMessageType.LEADER_RESOLVE_TOPIC: + topic = TopicConstants.RESI_GROUP; + break; + case SystemMessageType.ACTIVE_SEND_POINT: + case SystemMessageType.REGISTER_VOLUNTEER: + case SystemMessageType.ACTIVE_INSERT_LIVE: + topic = TopicConstants.EPMET_HEART; + break; + //社区服务相关积分 + case SystemMessageType.FINISH_USER_DEMAND: + topic=TopicConstants.COMMUNITY_SERVICE; break; default: logger.error("getTopicByMsgType msgType:{} is not support for any topic", msgType); diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/UserMessageServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/UserMessageServiceImpl.java index eb0e559e74..0bdec194d4 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/UserMessageServiceImpl.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/UserMessageServiceImpl.java @@ -209,4 +209,14 @@ public class UserMessageServiceImpl extends BaseServiceImpl list = baseDao.queryStaffMessage(formDTO); return list; } + + /** + * @Author sun + * @Description 【消息】删除已读消息列表 + **/ + @Override + public void delReadMsg(String userId) { + baseDao.delReadMsg(userId); + } + } \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/UserMessageDao.xml b/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/UserMessageDao.xml index 7aca569542..2b80a6cc56 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/UserMessageDao.xml +++ b/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/UserMessageDao.xml @@ -81,4 +81,15 @@ ORDER BY CREATED_TIME DESC LIMIT #{pageNo}, #{pageSize} + + + UPDATE user_message + SET del_flag = '1', + updated_by = #{userId}, + updated_time = NOW() + WHERE + read_flag = 'read' + AND user_id = #{userId} + + \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/pom.xml b/epmet-module/epmet-point/epmet-point-server/pom.xml index b0d136987c..904781f9ed 100644 --- a/epmet-module/epmet-point/epmet-point-server/pom.xml +++ b/epmet-module/epmet-point/epmet-point-server/pom.xml @@ -167,6 +167,10 @@ https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4 SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd + + + true + 192.168.1.140:9876;192.168.1.141:9876 @@ -210,6 +214,10 @@ https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4 SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd + + + true + 192.168.1.140:9876;192.168.1.141:9876 @@ -253,6 +261,10 @@ https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4 SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd + + + true + 192.168.10.161:9876 @@ -296,6 +308,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-point/epmet-point-server/src/main/java/com/epmet/entity/PointRuleEntity.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRuleEntity.java index 7191215345..4e766098f0 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRuleEntity.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRuleEntity.java @@ -119,9 +119,15 @@ public class PointRuleEntity extends BaseEpmetEntity { @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + if (!super.equals(o)) { + return false; + } PointRuleEntity entity = (PointRuleEntity) o; return Objects.equals(customerId, entity.customerId) && Objects.equals(ruleName, entity.ruleName) && diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java new file mode 100644 index 0000000000..500f4bb632 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java @@ -0,0 +1,28 @@ +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.PointListener; +import com.epmet.service.UserPointActionLogService; +import org.apache.rocketmq.common.protocol.heartbeat.MessageModel; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +@Component +public class RocketMQConsumerRegister extends MQAbstractRegister { + + @Autowired + private UserPointActionLogService userPointActionLogService; + + @Override + public void registerAllListeners(String env, MQConsumerProperties consumerProperties) { + // 客户初始化监听器注册 + register(consumerProperties, ConsomerGroupConstants.RESI_GROUP_POINT_OPERATION_GROUP, MessageModel.CLUSTERING, TopicConstants.RESI_GROUP, "*", new PointListener(userPointActionLogService)); + register(consumerProperties, ConsomerGroupConstants.EPMET_HEART_POINT_OPERATION_GROUP, MessageModel.CLUSTERING, TopicConstants.EPMET_HEART, "*", new PointListener(userPointActionLogService)); + register(consumerProperties, ConsomerGroupConstants.COMMUNITY_SERVICE_POINT_OPERATION_GROUP, MessageModel.CLUSTERING, TopicConstants.COMMUNITY_SERVICE, "*", new PointListener(userPointActionLogService)); + + // ...其他监听器类似 + } +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/mq/listener/PointListener.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/mq/listener/PointListener.java new file mode 100644 index 0000000000..63b4c44e2b --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/mq/listener/PointListener.java @@ -0,0 +1,243 @@ +package com.epmet.mq.listener; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.rocketmq.constants.MQUserPropertys; +import com.epmet.commons.tools.distributedlock.DistributedLock; +import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg; +import com.epmet.commons.tools.enums.EventEnum; +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.constant.SystemMessageType; +import com.epmet.service.UserPointActionLogService; +import dto.form.SendPointFormDTO; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.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 java.util.List; +import java.util.concurrent.TimeUnit; + +/** + * @author wxz + * @Description 登录操作日志监听器 + + * @return + * @date 2021.06.07 16:12 + */ +@Slf4j +public class PointListener implements MessageListenerConcurrently { + + private RedisUtils redisUtils; + + private UserPointActionLogService userPointActionLogService; + + public PointListener(UserPointActionLogService userPointActionLogService) { + this.userPointActionLogService = userPointActionLogService; + } + + @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) { + log.error(ExceptionUtils.getErrorStackTrace(e)); + return ConsumeConcurrentlyStatus.RECONSUME_LATER; + } + return ConsumeConcurrentlyStatus.CONSUME_SUCCESS; + } + + private void consumeMessage(MessageExt messageExt) { + String tags = messageExt.getTags(); + String msg = new String(messageExt.getBody()); + String pendingMsgLabel = messageExt.getUserProperty(MQUserPropertys.BLOCKED_MSG_LABEL); + log.info("【积分操作监听器】-收到消息内容:{}", msg); + + DistributedLock distributedLock = null; + RLock lock = null; + try { + distributedLock = SpringContextUtils.getBean(DistributedLock.class); + lock = distributedLock.getLock("lock:point_operation", 30L, 30L, TimeUnit.SECONDS); + + switch (tags) { + case SystemMessageType.PARTICIPATE_ONE_TOPIC: + resiGroupPointOpe(msg); + break; + case SystemMessageType.ACTIVE_SEND_POINT: + // 爱心活动积分发放 + activeSendPoint(msg); + break; + case SystemMessageType.ACTIVE_INSERT_LIVE: + // 添加活动实况 + activeInsertLive(msg); + break; + case SystemMessageType.REGISTER_VOLUNTEER: + // 注册志愿者 + registerVolunteer(msg); + break; + case SystemMessageType.TOPIC_TO_ISSUE: + // 话题被组长转为议题 + topicToIssue(msg); + break; + case SystemMessageType.TOPIC_TO_PROJECT: + // 话题转为项目 + topicToProject(msg); + break; + case SystemMessageType.INVITE_RESI_INTO_GROUP: + inviteResiIntoGroup(msg); + break; + case SystemMessageType.INVITE_NEW_INTO_GROUP: + inviteNewIntoGroup(msg); + break; + case SystemMessageType.SHIFT_TOPIC_TO_ISSUE: + shiftTopicToIssue(msg); + break; + case SystemMessageType.PUBLISH_ONE_TOPIC: + publicOneTopic(msg); + break; + case SystemMessageType.LEADER_RESOLVE_TOPIC: + leaderResolveTopic(msg); + break; + case SystemMessageType.FINISH_USER_DEMAND: + //给需求服务方(志愿者)发放积分 + grantServerPoint(msg); + break; + } + + } catch (RenException e) { + // 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试 + log.error("【积分操作监听器】消费消息失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + } catch (Exception e) { + // 不是我们自己抛出的异常,可以让MQ重试 + log.error("【积分操作监听器】消费消息失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + throw e; + } finally { + distributedLock.unLock(lock); + } + + if (StringUtils.isNotBlank(pendingMsgLabel)) { + try { + removePendingMqMsgCache(pendingMsgLabel); + } catch (Exception e) { + log.error("【登录操作事件监听器】-删除mq阻塞消息缓存失败:{}", ExceptionUtils.getErrorStackTrace(e)); + } + } + } + + private void leaderResolveTopic(String msg) { + List formList = JSON.parseArray(msg, BasePointEventMsg.class); + + formList.forEach(obj -> { + userPointActionLogService.grantPointByEvent(obj.getEventTag(),obj); + }); + } + + private void publicOneTopic(String msg) { + List formList = JSON.parseArray(msg, BasePointEventMsg.class); + + formList.forEach(obj -> { + userPointActionLogService.grantPointByEvent(obj.getEventTag(),obj); + }); + } + + private void shiftTopicToIssue(String msg) { + List formList = JSON.parseArray(msg, BasePointEventMsg.class); + + formList.forEach(obj -> { + userPointActionLogService.grantPointByEvent(obj.getEventTag(),obj); + }); + } + + private void inviteNewIntoGroup(String msg) { + List formList = JSON.parseArray(msg, BasePointEventMsg.class); + + formList.forEach(obj -> { + userPointActionLogService.grantPointByEvent(obj.getEventTag(),obj); + }); + } + + private void inviteResiIntoGroup(String msg) { + List formList = JSON.parseArray(msg, BasePointEventMsg.class); + + formList.forEach(obj -> { + userPointActionLogService.grantPointByEvent(obj.getEventTag(),obj); + }); + } + + private void topicToProject(String msg) { + List formList = JSON.parseArray(msg, BasePointEventMsg.class); + + formList.forEach(obj -> { + userPointActionLogService.grantPointByEvent(obj.getEventTag(),obj); + }); + } + + private void topicToIssue(String msg) { + List formList = JSON.parseArray(msg, BasePointEventMsg.class); + + formList.forEach(obj -> { + userPointActionLogService.grantPointByEvent(obj.getEventTag(), obj); + }); + } + + private void registerVolunteer(String msg) { + List formList = JSON.parseArray(msg, BasePointEventMsg.class); + formList.forEach(obj -> { + userPointActionLogService.grantPointByEvent(EventEnum.REGISTER_VOLUNTEER.getEventTag(),obj); + }); + } + + private void activeInsertLive(String msg) { + List formList = JSON.parseArray(msg, BasePointEventMsg.class); + formList.forEach(obj -> { + userPointActionLogService.grantPointByEvent(EventEnum.ACTIVE_INSERT_LIVE.getEventTag(), obj); + }); + } + + private void activeSendPoint(String msg) { + List formDTO = JSON.parseArray(msg, SendPointFormDTO.class); + userPointActionLogService.grantPoint(formDTO); + } + + private void resiGroupPointOpe(String msg) { + List formList = JSON.parseArray(msg, BasePointEventMsg.class); + + formList.forEach(obj -> { + userPointActionLogService.grantPointByEvent(obj.getEventTag(),obj); + }); + } + + /** + * 需求完成,给志愿者发放积分 + * @param msg + */ + private void grantServerPoint(String msg) { + List formDTO = JSON.parseArray(msg, BasePointEventMsg.class); + userPointActionLogService.grantServerPoint(formDTO); + } + + /** + * @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("【登录操作事件监听器】删除pendingMsgLabel成功:{}", pendingMsgLabel); + } +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java index b156816c80..360edcb9cb 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java @@ -119,6 +119,12 @@ public interface UserPointActionLogService extends BaseService grantPointParam); + /** + * 需求完成-志愿者发放积分 + * @param grantPointParam + */ + void grantServerPoint(List grantPointParam); + /** * @Description 通过事件推送进行积分加减 * @param event diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdjustmentLogServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdjustmentLogServiceImpl.java index e5aad18cef..5002214030 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdjustmentLogServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdjustmentLogServiceImpl.java @@ -59,7 +59,7 @@ import java.util.List; import java.util.Map; /** - * + * * * @author generator generator@elink-cn.com * @since v1.0.0 2020-07-27 @@ -177,7 +177,9 @@ public class PointAdjustmentLogServiceImpl extends BaseServiceImpl baseDao.selectPageResiPoin(formDTO)); return new PageData<>(pageInfo.getList(), pageInfo.getTotal()); } + + /** + * 需求完成,给志愿者发放积分 + * @param list + */ + @Override + public void grantServerPoint(List list){ + if (CollectionUtils.isEmpty(list)){ + return; + } + list.forEach(grantPoint->{ + if (null != grantPoint.getPoint()) { + //1.新增用户积分行为记录 + UserPointActionLogEntity action = new UserPointActionLogEntity(); + action.setCustomerId(grantPoint.getCustomerId()); + action.setBizType("community_service"); + action.setPoint(grantPoint.getPoint()); + //完成了XXX的需求 + action.setEventStatement(grantPoint.getRemark()); + //需求分类表中一级分类的名称 + action.setEventId(EventEnum.FINISH_USER_DEMAND.getEventTag()); + action.setActionFlag(grantPoint.getActionFlag()); + action.setUserId(grantPoint.getUserId()); + action.setCreatedBy(grantPoint.getOperatorId()); + action.setUpdatedBy(grantPoint.getOperatorId()); + action.setSourceType(grantPoint.getSourceType()); + action.setSourceId(grantPoint.getSourceId()); + // 需求所属分类编码,对应objectId + action.setObjectId(grantPoint.getObjectId()); + //需求所属分类-一级分类名称 + action.setEventName(grantPoint.getEventName()); + baseDao.insert(action); + //2.新增/修改用户积分日统计 + DimIdGenerator.DimIdBean dimVal = DimIdGenerator.getDimIdBean(new Date()); + UserPointStatisticalDailyEntity statistical = ConvertUtils.sourceToTarget(dimVal, UserPointStatisticalDailyEntity.class); + statistical.setPointChange(grantPoint.getPoint()); + statistical.setActionFlag(grantPoint.getActionFlag()); + statistical.setCustomerId(grantPoint.getCustomerId()); + statistical.setUserId(grantPoint.getUserId()); + statistical.setCreatedBy(grantPoint.getOperatorId()); + statistical.setUpdatedBy(grantPoint.getOperatorId()); + userPointStatisticalDailyService.insertOrUpdate(statistical); + //3.新增/修改用户积分日统计 + UserPointTotalEntity point = new UserPointTotalEntity(); + point.setCustomerId(grantPoint.getCustomerId()); + point.setUserId(grantPoint.getUserId()); + point.setTotalPoint(grantPoint.getPoint()); + point.setUsablePoint(grantPoint.getPoint()); + point.setUsedPoint(NumConstant.ZERO); + point.setCreatedBy(grantPoint.getOperatorId()); + point.setUpdatedBy(grantPoint.getOperatorId()); + userPointTotalService.insertOrUpdate(point); + } + }); + } } \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointTotalServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointTotalServiceImpl.java index 7ba7c79b4e..66f83715c8 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointTotalServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointTotalServiceImpl.java @@ -63,8 +63,12 @@ public class UserPointTotalServiceImpl extends BaseServiceImpl> customizedHeatMap = new HashMap<>(); customizedTuples.forEach(tuple -> { List queue = customizedHeatMap.get(tuple.getScore()); - if((CollectionUtils.isEmpty(queue))) queue = new LinkedList<>(); + if((CollectionUtils.isEmpty(queue))) { + queue = new LinkedList<>(); + } queue.add(parseObject(tuple.getValue(), IssueCategoryTagResultDTO.class)); customizedHeatMap.put(tuple.getScore(),queue); }); @@ -137,8 +139,9 @@ public class IssueProjectTagDictRedis { //默认、自定义标签,只要有一个是空就触发补偿 //不信任缓存数据 if(!CollectionUtils.isEmpty(result) && !CollectionUtils.isEmpty(result.get(ModuleConstants.DEFAULT_TAG_CATEGORY_NAME)) - && !CollectionUtils.isEmpty(result.get(ModuleConstants.CUSTOMIZED_TAG_CATEGORY_NAME))) + && !CollectionUtils.isEmpty(result.get(ModuleConstants.CUSTOMIZED_TAG_CATEGORY_NAME))) { return result; + } @@ -183,11 +186,13 @@ public class IssueProjectTagDictRedis { IssueProjectCategoryDictEntity otherCategory = categoryDictDao.selectSingleByCustomerIdAndCategoryNameAndCategoryType(customerId, ModuleConstants.CATEGORY_NAME_OTHERS, null); boolean ifOtherOnly = null != otherCategory && (!CollectionUtils.isEmpty(category) && category.size() == NumConstant.ONE && category.contains(otherCategory.getId())); Set keys; - if (CollectionUtils.isEmpty(category) || ifOtherOnly) + if (CollectionUtils.isEmpty(category) || ifOtherOnly) { keys = redisUtils.keys(GovIssueRedisKeys.getGovernmentTagKey(customerId, null)); - else keys = category.stream().map(key -> { - return GovIssueRedisKeys.getGovernmentTagKey(customerId, key); - }).collect(Collectors.toSet()); + } else { + keys = category.stream().map(key -> { + return GovIssueRedisKeys.getGovernmentTagKey(customerId, key); + }).collect(Collectors.toSet()); + } //如果keys集合为空,说明缓存中没有当前客户的标签排行信息,直接进行补偿 if (!CollectionUtils.isEmpty(keys)){ keys.remove(GovIssueRedisKeys.getGovernmentTagKey(customerId,ModuleConstants.CUSTOMIZED_TAG_CATEGORY_NAME)); @@ -211,7 +216,9 @@ public class IssueProjectTagDictRedis { tupleSet.forEach(tuple -> { Double heatScore = tuple.getScore(); List queue = heatMap.get(heatScore); - if (CollectionUtils.isEmpty(queue)) queue = new LinkedList<>(); + if (CollectionUtils.isEmpty(queue)) { + queue = new LinkedList<>(); + } queue.add(parseObject(tuple.getValue(), IssueCategoryTagResultDTO.class)); heatMap.put(heatScore, queue); }); @@ -228,7 +235,9 @@ public class IssueProjectTagDictRedis { Map> customizedHeatMap = new HashMap<>(); customizedTuples.forEach(tuple -> { List queue = customizedHeatMap.get(tuple.getValue()); - if((CollectionUtils.isEmpty(queue))) queue = new LinkedList<>(); + if((CollectionUtils.isEmpty(queue))) { + queue = new LinkedList<>(); + } queue.add(parseObject(tuple.getValue(), IssueCategoryTagResultDTO.class)); customizedHeatMap.put((Double) tuple.getValue(),queue); }); @@ -323,7 +332,9 @@ public class IssueProjectTagDictRedis { String redisKey = GovIssueRedisKeys.getGovernmentTagKey(customerId, k); v.forEach(tag -> { List unit = scoreMap.get(tag.getIssueUseCount()); - if (CollectionUtils.isEmpty(unit)) unit = new LinkedList<>(); + if (CollectionUtils.isEmpty(unit)) { + unit = new LinkedList<>(); + } IssueCategoryTagResultDTO object = ConvertUtils.sourceToTarget(tag, IssueCategoryTagResultDTO.class); object.setName(tag.getTagName()); unit.add(object); @@ -423,7 +434,9 @@ public class IssueProjectTagDictRedis { * @date 2021.03.20 01:04 */ public void batchIncrScore(Map>> param){ - if(CollectionUtils.isEmpty(param)) return; + if(CollectionUtils.isEmpty(param)) { + return; + } redisTemplate.executePipelined((RedisCallback) connection -> { param.forEach((operation,map) -> { if(!CollectionUtils.isEmpty(map)){ @@ -452,7 +465,9 @@ public class IssueProjectTagDictRedis { * @date 2021.03.22 16:20 */ public void updateTagAvailabilityBySecondCategoryIds(String customerId,ListsecondCategoryIds,String availableFlag){ - if(CollectionUtils.isEmpty(secondCategoryIds)) return; + if(CollectionUtils.isEmpty(secondCategoryIds)) { + return; + } secondCategoryIds.forEach(cid -> { String key = GovIssueRedisKeys.getGovernmentTagKey(customerId, cid); @@ -463,7 +478,9 @@ public class IssueProjectTagDictRedis { Map> heatMap = new HashMap<>(); tagTuples.forEach(tuple -> { Set queue = heatMap.get(tuple.getValue()); - if((CollectionUtils.isEmpty(queue))) queue = new HashSet<>(); + if((CollectionUtils.isEmpty(queue))) { + queue = new HashSet<>(); + } IssueCategoryTagResultDTO ele = parseObject(tuple.getValue(), IssueCategoryTagResultDTO.class); ele.setIsDisable(availableFlag); queue.add(ele); diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueVoteDetailRedis.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueVoteDetailRedis.java index 580b6a0f76..6330942024 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueVoteDetailRedis.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueVoteDetailRedis.java @@ -88,7 +88,9 @@ public class IssueVoteDetailRedis { } public void deleteBatch(List issueIds){ - if(CollectionUtils.isEmpty(issueIds)) return ; + if(CollectionUtils.isEmpty(issueIds)) { + return ; + } Set keys = issueIds.stream().map(id -> { return IssueConstant.REDIS_KEY + id; }).collect(Collectors.toSet()); @@ -293,4 +295,4 @@ public class IssueVoteDetailRedis { } -} \ No newline at end of file +} diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectTagDictServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectTagDictServiceImpl.java index cf5af822da..cbc5d8822c 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectTagDictServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectTagDictServiceImpl.java @@ -185,7 +185,9 @@ public class IssueProjectTagDictServiceImpl extends BaseServiceImpl imp int issueAffectedRow = baseDao.insertOne(issueDTO); if(issueAffectedRow == NumConstant.ONE && (StringUtils.isNotBlank(issueDTO.getId()) || StringUtils.isNotBlank(issueDTO.getIssueId()))){ - if(StringUtils.isNotBlank(issueDTO.getIssueId())) issueDTO.setId(issueDTO.getIssueId()); + if(StringUtils.isNotBlank(issueDTO.getIssueId())) { + issueDTO.setId(issueDTO.getIssueId()); + } //2.新增议题流程 IssueProcessDTO issueProcessDTO = new IssueProcessDTO(); @@ -322,7 +324,9 @@ public class IssueServiceImpl extends BaseServiceImpl imp voteInitCache.setShouldVoteCount(issueShiftedFromTopicFormDTO.getVotableCount()); issueVoteDetailRedis.set(voteInitCache); - if(StringUtils.isNotBlank(issueShiftedFromTopicFormDTO.getIssueId())) issueDTO.setId(issueShiftedFromTopicFormDTO.getIssueId()); + if(StringUtils.isNotBlank(issueShiftedFromTopicFormDTO.getIssueId())) { + issueDTO.setId(issueShiftedFromTopicFormDTO.getIssueId()); + } return issueDTO.getId(); } logger.warn(String.format( @@ -393,9 +397,11 @@ public class IssueServiceImpl extends BaseServiceImpl imp applicationList.sort(Comparator.comparing(IssueApplicationDTO::getUpdatedTime, Collections.reverseOrder())); logger.error("com.epmet.service.impl.IssueServiceImpl.topicShiftedToIssueV2,查出多条转移提提交记录,话题Id:{}", param.getTopicId()); } - if(!isStaffAudition) - if(StringUtils.equals(ModuleConstants.ISSUE_APPLICATION_STATUS_UNDER_AUDITING,applicationList.iterator().next().getApplyStatus())) - ifRepeat = true; + if(!isStaffAudition) { + if(StringUtils.equals(ModuleConstants.ISSUE_APPLICATION_STATUS_UNDER_AUDITING,applicationList.iterator().next().getApplyStatus())) { + ifRepeat = true; + } + } applyIds.addAll(applicationList.stream().map(IssueApplicationDTO::getId).collect(Collectors.toList())); } if(!ifRepeat) { @@ -442,14 +448,17 @@ public class IssueServiceImpl extends BaseServiceImpl imp }); } - if(CollectionUtils.isNotEmpty(applyIds)) - result.setIssueApplicationId(applyIds.iterator().next()); + if(CollectionUtils.isNotEmpty(applyIds)) { + result.setIssueApplicationId(applyIds.iterator().next()); + } //只有当审核开关关闭 或 工作端人员审核通过时才生成议题 if(!ifOpen || StringUtils.equals(ModuleConstants.AUDITION_TYPE_APPROVAL,defaultStatusUnderAuditing)){ ValidatorUtils.validateEntity(param, IssueShiftedFromTopicFormDTO.IssueGenerationGroup.class); - if(isStaffAudition) param.setUserId(param.getIssueAuthorId()); + if(isStaffAudition) { + param.setUserId(param.getIssueAuthorId()); + } result.setIssueId(issueShiftedToTopic(param)); if(StringUtils.equals(ModuleConstants.AUDITION_TYPE_AUTO_PASSED,defaultStatusUnderAuditing)){ applicationList.forEach(apply -> { @@ -498,7 +507,9 @@ public class IssueServiceImpl extends BaseServiceImpl imp Date unifiedDate = new Date(); IssueApplicationDTO application = applicationService.get(param.getIssueApplicationId()); - if(null == application) throw new RenException("没有相应的议题申请信息"); + if(null == application) { + throw new RenException("没有相应的议题申请信息"); + } IssueApplicationDTO app2update = new IssueApplicationDTO(); //app2update.setId(param.getIssueApplicationId()); @@ -543,7 +554,9 @@ public class IssueServiceImpl extends BaseServiceImpl imp app2update.setIssueId(issueResult.getIssueId()); } - }else throw new RenException(topicInfo.getInternalMsg()); + }else { + throw new RenException(topicInfo.getInternalMsg()); + } //发送站内信 @@ -588,9 +601,7 @@ public class IssueServiceImpl extends BaseServiceImpl imp **/ @Override public List votingList(CommonIssueListFormDTO issueListForm) { - issueListForm.setPageNo(null == issueListForm.getPageNo() ? NumConstant.ZERO : - (issueListForm.getPageNo() - NumConstant.ONE)*issueListForm.getPageSize() - ); + PageHelper.startPage(issueListForm.getPageNo(), issueListForm.getPageSize(), issueListForm.getIsPage()); return baseDao.selectVotingList(issueListForm); } @@ -603,9 +614,7 @@ public class IssueServiceImpl extends BaseServiceImpl imp **/ @Override public List closedList(CommonIssueListFormDTO issueListForm) { - issueListForm.setPageNo(null == issueListForm.getPageNo() ? NumConstant.ZERO : - (issueListForm.getPageNo() - NumConstant.ONE)*issueListForm.getPageSize() - ); + PageHelper.startPage(issueListForm.getPageNo(), issueListForm.getPageSize(), issueListForm.getIsPage()); return baseDao.selectClosedList(issueListForm); } @@ -1566,15 +1575,17 @@ public class IssueServiceImpl extends BaseServiceImpl imp } if (CollectionUtils.isNotEmpty(resultList)) { resultList = resultList.stream().sorted(Comparator.comparing(UnResolvedResultDTO::getClosedTime).reversed()).collect(Collectors.toList()); - int fromIndex = (fromDTO.getPageNo() - NumConstant.ONE) * fromDTO.getPageSize(); - int toIndex = fromDTO.getPageNo() * fromDTO.getPageSize(); - if (fromIndex >= resultList.size()) { - return new ArrayList<>(); - } - if (toIndex > resultList.size()) { - toIndex = resultList.size(); + if (fromDTO.getIsPage()) { + int fromIndex = (fromDTO.getPageNo() - NumConstant.ONE) * fromDTO.getPageSize(); + int toIndex = fromDTO.getPageNo() * fromDTO.getPageSize(); + if (fromIndex >= resultList.size()) { + return new ArrayList<>(); + } + if (toIndex > resultList.size()) { + toIndex = resultList.size(); + } + resultList = resultList.subList(fromIndex, toIndex); } - resultList = resultList.subList(fromIndex, toIndex); } return resultList; } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueShareLinkVisitRecordServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueShareLinkVisitRecordServiceImpl.java index cbefa389e9..be578eb2aa 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueShareLinkVisitRecordServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueShareLinkVisitRecordServiceImpl.java @@ -38,7 +38,7 @@ import java.util.List; import java.util.Map; /** - * 议题分享链接访问记录表 + * 议题分享链接访问记录表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-12-18 @@ -108,7 +108,9 @@ public class IssueShareLinkVisitRecordServiceImpl extends BaseServiceImpl @@ -239,8 +237,6 @@ AND RESOLVE_TYPE = 'resolved' ORDER BY created_time DESC - LIMIT #{pageNo}, - #{pageSize} SELECT id, - organization_name AS 'name' + organization_name AS 'name', + level AS 'level', + area_code AS 'areaCode', + code 'code', + contacts 'contacts', + mobile 'mobile' FROM customer_agency WHERE del_flag = '0' AND id IN @@ -123,7 +128,10 @@ SELECT id AS 'agencyId', organization_name AS 'agencyName', - total_user AS 'totalUser' + total_user AS 'totalUser', + IFNULL(code,'')AS 'code', + IFNULL(contacts,'')AS 'contacts', + IFNULL(mobile,'')AS 'mobile' FROM customer_agency WHERE del_flag = '0' AND pid = #{pId} @@ -182,23 +190,10 @@ ca.organization_name AS "agencyName", ca.pids AS "pids", ca.level level, - ( 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 + IFNULL(ca.longitude, cc.longitude) longitude, + IFNULL(ca.latitude, cc.latitude) latitude FROM customer_agency ca + INNER JOIN customer_agency cc ON cc.pid = '0' AND ca.customer_id = cc.customer_id WHERE ca.del_flag = '0' AND ca.pids = #{subAgencyPids} ORDER BY ca.created_time DESC @@ -722,4 +717,29 @@ AND PID = #{orgId} + + + + UPDATE customer_agency + SET AREA_CODE = '', + PARENT_AREA_CODE = '', + UPDATED_BY=#{operateUserId} + UPDATED_TIME = NOW() + WHERE + DEL_FLAG = '0' + AND CUSTOMER_ID = #{customerId} + AND PARENT_AREA_CODE LIKE concat( #{originalParentAreaCode}, '%' ) + diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml index fbfbe06478..9bbe9e96b7 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml @@ -23,7 +23,10 @@ SELECT id AS 'departmentId', department_name AS 'departmentName', - total_user AS 'totalUser' + total_user AS 'totalUser', + IFNULL(code,'')AS 'code', + IFNULL(contacts,'')AS 'contacts', + IFNULL(mobile,'')AS 'mobile' FROM customer_department WHERE del_flag = '0' AND agency_id = #{agencyId} diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml index 0ddf90f008..4c34ea5bed 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml @@ -189,7 +189,11 @@ manage_district AS manageDistrict, total_user AS totalUser, pid AS agencyId, - pids AS pids + pids AS pids, + `code` AS 'code', + grid_type AS 'gridType', + contacts AS 'contacts', + mobile AS 'mobile' FROM customer_grid WHERE @@ -233,6 +237,10 @@ set grid_name = #{gridName}, manage_district = #{manageDistrict}, + code = #{code}, + grid_type = #{gridType}, + contacts = #{contacts}, + mobile = #{mobile}, updated_by = #{updatedBy}, UPDATED_TIME=NOW() where @@ -277,9 +285,13 @@ + + + diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml index 37d56c5ec4..f997a5cf3a 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml @@ -234,15 +234,18 @@ @@ -45,4 +49,28 @@ GROUP BY matterId + + + \ 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 index b241afaf64..97f5e43cbf 100644 --- 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 @@ -14,16 +14,25 @@ - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ResiEventScanTaskDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ResiEventScanTaskDTO.java new file mode 100644 index 0000000000..303159fbdf --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ResiEventScanTaskDTO.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.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 事件附件安全校验任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-12-22 + */ +@Data +public class ResiEventScanTaskDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 事件Id,关联resi_event的id + */ + private String resiEventId; + + /** + * 事件附件表主键,对应dataId + */ + private String resiEventAttachmentId; + + /** + * 阿里云审核任务Id + */ + private String taskId; + + /** + * 审核状态【auditing: 审核中; +auto_passed: 自动通过; +review:结果不确定,需要人工审核; +block: 结果违规;】 + */ + private String status; + + /** + * 附件类型(视频 - video、 语音 - voice 文件 - doc) + */ + private String attachmentType; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ReplyFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ReplyFormDTO.java index a6729ff46f..c3b94741cb 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ReplyFormDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ReplyFormDTO.java @@ -31,4 +31,6 @@ public class ReplyFormDTO implements Serializable { */ @NotBlank(message = "userId不能为空",groups = AddUserInternalGroup.class) private String userId; + + private String customerId; } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ResiEventFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ResiEventFormDTO.java index b0d1f4ff99..e297f4f153 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ResiEventFormDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ResiEventFormDTO.java @@ -34,7 +34,7 @@ public class ResiEventFormDTO implements Serializable { /** * 事件内容,最多1000 */ - @Length(min = 1, max = 1000, message = "请填写内容,最多输入1000字", groups = AddUserShowGroup.class) + @Length(max = 1000, message = "请填写内容,最多输入1000字", groups = AddUserShowGroup.class) private String eventContent; /** @@ -54,9 +54,9 @@ public class ResiEventFormDTO implements Serializable { private String address; /** - * 附件列表 + * 图片附件列表 */ - private List attachmentList; + private List attachmentList; /** * @的人 */ @@ -82,4 +82,9 @@ public class ResiEventFormDTO implements Serializable { */ @NotBlank(message = "customerId不能为空",groups = AddUserInternalGroup.class) private String customerId; + + /** + * 语音附件列表 + */ + private List voiceList; } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ResiEventLsitFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ResiEventLsitFormDTO.java new file mode 100644 index 0000000000..8c9e190bb1 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ResiEventLsitFormDTO.java @@ -0,0 +1,41 @@ +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 ResiEventLsitFormDTO implements Serializable { + /** + * 网格Id + */ + @NotBlank(message = "网格Id不能为空",groups = Event.class) + private String gridId; + /** + * 未处理:un_read;处理中:processing;已办结:closed_case + */ + @NotBlank(message = "statusCondition不能为空",groups = Event.class) + private String statusCondition; + /** + * 请求页码 + * */ + @Min(1) + private int pageNo = 1; + /** + * 每页多少条数据 + * */ + private int pageSize = 20; + /** + * 是否分页(是:true 否:false) + * */ + private Boolean isPage = true; + + public interface Event {} + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ShiftProjectListFromDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ShiftProjectListFromDTO.java index d7e4cd1801..48d71f28d5 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ShiftProjectListFromDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ShiftProjectListFromDTO.java @@ -25,4 +25,6 @@ public class ShiftProjectListFromDTO implements Serializable { * 每页记录数 */ private Integer pageSize; + + private Boolean isPage = true; } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventDetailResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventDetailResultDTO.java index 0b6bb8ccb2..67e1843931 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventDetailResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventDetailResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.result; +import com.epmet.commons.tools.dto.form.FileCommonDTO; import com.epmet.dto.EventProjectInfoDTO; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; @@ -65,6 +66,10 @@ public class EventDetailResultDTO implements Serializable { * 报事提到的人 */ private List eventPerson; + /** + * 报事提到的人,用户id + */ + private List eventPersonIds; /** * 被提到的组织 @@ -76,7 +81,20 @@ public class EventDetailResultDTO implements Serializable { */ private String eventPeopleName; + /** + * 语音附件url集合 + */ + private List voiceList; + /** + * 事件附件 + */ @JsonIgnore + private List attachmentList; + + // @JsonIgnore + /** + * 报事人id: resi_event.CREATED_BY + */ private String eventUserId; /** @@ -93,6 +111,11 @@ public class EventDetailResultDTO implements Serializable { //@JsonIgnore private Boolean isProject; + /** + * userIdentity : 报事人:report-user;被@的人:mention-user; 其他用户:other + */ + private String userIdentity; + public EventDetailResultDTO() { this.eventTime = ""; this.eventContent = ""; @@ -105,4 +128,22 @@ public class EventDetailResultDTO implements Serializable { this.eventPerson = new ArrayList<>(); this.projectInfo = new EventProjectInfoDTO(); } + + @Data + public static class Attachment { + /** + * url + */ + private String url; + + /** + * 附件类型 + */ + private String type; + + /** + * 附件类型 + */ + private Integer duration; + } } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventListResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventListResultDTO.java index 23ecd11982..47fc45c7c6 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventListResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventListResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.result; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -45,4 +46,27 @@ public class EventListResultDTO implements Serializable { */ private List eventImgs; + /** + * 语音附件url集合 + */ + private List voiceList; + /** + * 事件附件 + */ + @JsonIgnore + private List attachmentList; + + @Data + public static class Attachment { + /** + * url + */ + private String url; + + /** + * 附件类型 + */ + private String type; + } + } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/NewEventsResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/NewEventsResultDTO.java index 8035108f6a..68e0ba99ca 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/NewEventsResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/NewEventsResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.result; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -31,4 +32,25 @@ public class NewEventsResultDTO implements Serializable { private List eventImgs; private String eventId; + /** + * 语音附件url集合 + */ + private List voiceList; + /** + * 事件附件 + */ + @JsonIgnore + private List attachmentList; + + @Data + public static class Attachment { + /** + * url + */ + private String url; + /** + * 附件类型 + */ + private String type; + } } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/PendingResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/PendingResultDTO.java index 7fe06f2dce..ed9f0d8d16 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/PendingResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/PendingResultDTO.java @@ -28,4 +28,6 @@ public class PendingResultDTO implements Serializable { private String sourceId; @JsonIgnore private String projectId; + private String longitude; + private String latitude; } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ResiEventListResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ResiEventListResultDTO.java new file mode 100644 index 0000000000..3fa8432bab --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ResiEventListResultDTO.java @@ -0,0 +1,85 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * @Author sun + * @Description 【事件】(未处理、处理中、已办结)地图、列表 + **/ +@Data +public class ResiEventListResultDTO implements Serializable { + private static final long serialVersionUID = -7372245830000262134L; + + /** + * 事件id + */ + private String resiEventId; + /** + * 事件内容 + */ + private String eventContent; + /** + * 图片列表,可为空 + */ + private List imgList; + /** + * true展示;false不展示 + */ + private Boolean redDot; + /** + * 处理中:processing;已办结:closed_case + */ + private String status; + /** + * true:已转项目;false:未立项 + */ + private Boolean shiftProject; + /** + * 列表显示时间用此列:yyyy-MM-dd HH:mm:ss;处理中:上报事件时间,处理中:最新一次处理事件;已办结:办结时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + private Date showTime; + /** + * true:显示回复;false:不显示回复按钮 + */ + private String replyButtonFlag; + /** + * 事件是否被阅读过;1已读;针对报事人待处理列表 + */ + private Boolean readFlag; + /** + * 语音附件url集合 + */ + private List voiceList; + /** + * 经度 + */ + private String longitude; + /** + * 纬度 + */ + private String latitude; + /** + * 事件附件 + */ + @JsonIgnore + private List attachmentList; + + @Data + public static class Attachment { + /** + * url + */ + private String url; + /** + * 附件类型 + */ + private String type; + } +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ResolvedResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ResolvedResultDTO.java index 644a4d33cd..14187406e3 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ResolvedResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ResolvedResultDTO.java @@ -50,4 +50,7 @@ public class ResolvedResultDTO implements Serializable { * 话题内容 */ private String topicContent; + private String longitude; + private String latitude; + } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/UnResolvedResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/UnResolvedResultDTO.java index f803df9fc6..53f183c389 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/UnResolvedResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/UnResolvedResultDTO.java @@ -50,4 +50,6 @@ public class UnResolvedResultDTO implements Serializable { * 话题内容 */ private String topicContent; + private String longitude; + private String latitude; } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/UserMentionResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/UserMentionResultDTO.java index 48bb9583ba..0abae1961f 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/UserMentionResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/UserMentionResultDTO.java @@ -1,6 +1,7 @@ package com.epmet.dto.result; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -58,4 +59,27 @@ public class UserMentionResultDTO implements Serializable { */ private String replyButtonFlag; + /** + * 语音附件url集合 + */ + private List voiceList; + + /** + * 事件附件 + */ + @JsonIgnore + private List attachmentList; + + @Data + public static class Attachment { + /** + * url + */ + private String url; + /** + * 附件类型 + */ + private String type; + } + } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java index 7824ba71ee..9eaca9c495 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java @@ -134,4 +134,11 @@ public interface GovProjectOpenFeignClient { */ @PostMapping("gov/project/resievent/queryResiEventManageRedDot/{agencyId}") Result queryResiEventManageRedDot(@PathVariable("agencyId") String agencyId); + + /** + * @Author sun + * @Description 定时任务调用-事件语音附件自动审核 + **/ + @PostMapping("gov/project/resievent/autoAudit") + Result autoAudit(); } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java index 41f41664c1..04aed95fa5 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java @@ -132,4 +132,13 @@ public class GovProjectOpenFeignClientFallback implements GovProjectOpenFeignCli public Result queryResiEventManageRedDot(String agencyId) { return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "queryResiEventManageRedDot", agencyId); } + + /** + * @Author sun + * @Description 定时任务调用-事件语音附件自动审核 + **/ + @Override + public Result autoAudit() { + return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "autoAudit"); + } } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/EventConstant.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/EventConstant.java index 7daf809615..38eb0e0923 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/EventConstant.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/EventConstant.java @@ -49,4 +49,31 @@ public interface EventConstant { */ String TYPE_GOV = "gov"; String TYPE_RESI = "resi"; + + /** + * 附件文件类型 + * 图片 - image、文档 - doc、语音 - voice、视频 - video + */ + String FILE_IMAGE = "image"; + String FILE_DOC = "doc"; + String FILE_VOICE = "voice"; + String FILE_VIDEO = "video"; + + String AUDITING = "auditing"; + String AUTO_PASSED = "auto_passed"; + String REVIEW = "review"; + String BLOCK = "block"; + String REJECTED = "rejected"; + String APPROVED = "approved"; + String SUBMIT = "submit"; + String IMAGE = "image"; + String VIDEO = "video"; + String VOICE = "voice"; + String DOC = "doc"; + + + // 报事人:report_user;被@的人:mention_user; 其他用户:other + // String REPORT_USER="report_user"; + String MENTION_USER="mention_user"; + String OTHER="other"; } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/UserMessageConstant.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/UserMessageConstant.java index 9a1323f55f..8d40c4ebe9 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/UserMessageConstant.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/UserMessageConstant.java @@ -57,4 +57,24 @@ public interface UserMessageConstant { */ String STAY_REMINDER_MSG_3 = "滞留项目:%n%s"; + /** + * 事件消息标题 + */ + String EVENT_TITILE = "您有一条事件消息!"; + + /** + * 事件被@的人或上报给网格或组织的回复 + */ + String REPLY_EVENT = "%s对您上报的事件进行了回复,请查看。"; + + /** + * 事件被立项 + */ + String PROJECT_EVENT = "%s将您上报的事件转为项目,请查看。"; + + /** + * 事件被办结 + */ + String RCLOSE_PROJECT_EVENT = "%s将您上报的事件状态调整为已办结,请查看。"; + } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventController.java index 70706d8461..503e0f2bfe 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventController.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventController.java @@ -258,4 +258,25 @@ public class ResiEventController { ValidatorUtils.validateEntity(formDTO,ResiEventResearchAnalysisFormDTO.AddUserInternalGroup.class); return new Result().ok(resiEventService.queryResiEventResearchAnalysis(formDTO)); } + + /** + * @Author sun + * @Description 定时任务调用-事件语音附件自动审核 + **/ + @PostMapping("autoAudit") + public Result autoAudit() { + resiEventService.autoAudit(); + return new Result(); + } + + /** + * @Author sun + * @Description 【事件】(未处理、处理中、已办结)地图、列表 + **/ + @PostMapping("resieventlist") + public Result> resiEventList(@RequestBody ResiEventLsitFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ResiEventLsitFormDTO.Event.class); + return new Result>().ok(resiEventService.resiEventList(formDTO)); + } + } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventReplyController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventReplyController.java index 002621c98f..fd1c4983c7 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventReplyController.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventReplyController.java @@ -74,6 +74,7 @@ public class ResiEventReplyController { @PostMapping("govReply") public Result govReply(@LoginUser TokenDto tokenDto,@RequestBody ReplyFormDTO replyFormDTO){ replyFormDTO.setUserId(tokenDto.getUserId()); + replyFormDTO.setCustomerId(tokenDto.getCustomerId()); ValidatorUtils.validateEntity(replyFormDTO,ReplyFormDTO.AddUserShowGroup.class,ReplyFormDTO.AddUserInternalGroup.class); resiEventReplyService.govReply(replyFormDTO); return new Result(); diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventScanTaskController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventScanTaskController.java new file mode 100644 index 0000000000..bf86dad1de --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventScanTaskController.java @@ -0,0 +1,40 @@ +/** + * 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.service.ResiEventScanTaskService; +import org.springframework.beans.factory.annotation.Autowired; +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-12-22 + */ +@RestController +@RequestMapping("resieventscantask") +public class ResiEventScanTaskController { + + @Autowired + private ResiEventScanTaskService resiEventScanTaskService; + + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java index 673acf371e..3006a8b4f6 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java @@ -180,24 +180,18 @@ public interface ProjectDao extends BaseDao { * @author zhaoqifeng * @date 2021/7/27 10:28 * @param gridId - * @param pageNo - * @param pageSize * @return java.util.List */ - List selectPendingListByGrid(@Param("gridId")String gridId, @Param("pageNo") Integer pageNo, - @Param("pageSize") Integer pageSize); + List selectPendingListByGrid(@Param("gridId")String gridId); /** * 获取党建声音已结案列表 * @author zhaoqifeng * @date 2021/7/27 10:28 * @param gridId - * @param pageNo - * @param pageSize * @return java.util.List */ - List selectResolvedListByGrid(@Param("gridId")String gridId, @Param("pageNo") Integer pageNo, - @Param("pageSize") Integer pageSize); + List selectResolvedListByGrid(@Param("gridId")String gridId); /** * 无需解决列表 diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventDao.java index a39c72aa76..cf06138591 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventDao.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventDao.java @@ -95,4 +95,10 @@ public interface ResiEventDao extends BaseDao { * @return */ List selectUserReported(PageUserReportEventFormDTO formDTO); + + /** + * @Author sun + * @Description 查询网格下各种状态事件列表 + **/ + List resiEventList(@Param("gridId") String gridId, @Param("statusCondition")String statusCondition); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventReportOrgDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventReportOrgDao.java index 0668eb78f7..ddddb65c63 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventReportOrgDao.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventReportOrgDao.java @@ -64,4 +64,6 @@ public interface ResiEventReportOrgDao extends BaseDao Integer selectUnReadCount(String agencyId); Integer selectRedCount(String agencyId); + + ResiEventReportOrgEntity getByEventId(@Param("resiEventId") String resiEventId); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventScanTaskDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventScanTaskDao.java new file mode 100644 index 0000000000..fa2479ba11 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventScanTaskDao.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.ResiEventScanTaskEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 事件附件安全校验任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-12-22 + */ +@Mapper +public interface ResiEventScanTaskDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventAttachmentEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventAttachmentEntity.java index 255c7c465c..658922b493 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventAttachmentEntity.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventAttachmentEntity.java @@ -73,4 +73,25 @@ public class ResiEventAttachmentEntity extends BaseEpmetEntity { */ private Integer sort; + /** + * 附件状态(审核中:auditing; + auto_passed: 自动通过; + review:结果不确定,需要人工审核; + block: 结果违规; + rejected:人工审核驳回; + approved:人工审核通过) + 现在图片是同步审核的,所以图片只有auto_passed一种状态 + */ + private String status; + + /** + * 审核失败原因 + */ + private String reason; + + /** + * 语音或视频时长,秒 + * */ + private Integer duration; + } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventEntity.java index f00dab5a06..ee261096ad 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventEntity.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventEntity.java @@ -143,4 +143,20 @@ public class ResiEventEntity extends BaseEpmetEntity { */ private String closeRemark; + /** + * 事件审核状态[涉及附件审核需要加的状态] + * (审核中:auditing; + * auto_passed: 自动通过; + * review:结果不确定,需要人工审核; + * block: 结果违规; + * rejected:人工审核驳回; + * approved:人工审核通过) + */ + private String auditStatus; + + /** + * 审核理由 + */ + private String auditReason; + } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventScanTaskEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventScanTaskEntity.java new file mode 100644 index 0000000000..360174e83d --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventScanTaskEntity.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; + +/** + * 事件附件安全校验任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-12-22 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("resi_event_scan_task") +public class ResiEventScanTaskEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 事件Id,关联resi_event的id + */ + private String resiEventId; + + /** + * 事件附件表主键,对应dataId + */ + private String resiEventAttachmentId; + + /** + * 阿里云审核任务Id + */ + private String taskId; + + /** + * 审核状态【auditing: 审核中; +auto_passed: 自动通过; +review:结果不确定,需要人工审核; +block: 结果违规;】 + */ + private String status; + + /** + * 附件类型(视频 - video、 语音 - voice 文件 - doc) + */ + private String attachmentType; + +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ResiEventScanTaskService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ResiEventScanTaskService.java new file mode 100644 index 0000000000..ec29a6beaf --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ResiEventScanTaskService.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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.ResiEventScanTaskEntity; + +import java.util.List; + +/** + * 事件附件安全校验任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-12-22 + */ +public interface ResiEventScanTaskService extends BaseService { + + /** + * @Author sun + * @Description 获取事件附件待审核列表 + **/ + List getScanTaskList(String draftId, String auditing); +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ResiEventService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ResiEventService.java index c6e52d4cc3..b3b0321144 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ResiEventService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ResiEventService.java @@ -155,4 +155,16 @@ public interface ResiEventService extends BaseService { * @return */ ResiEventResearchAnalysisResDTO queryResiEventResearchAnalysis(ResiEventResearchAnalysisFormDTO formDTO); + + /** + * @Author sun + * @Description 定时任务调用-事件语音附件自动审核 + **/ + void autoAudit(); + + /** + * @Author sun + * @Description 【事件】(未处理、处理中、已办结)地图、列表 + **/ + List resiEventList(ResiEventLsitFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index 38e428873c..90a11635e7 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -2810,14 +2810,16 @@ public class ProjectServiceImpl extends BaseServiceImpl getPendingList(ShiftProjectListFromDTO fromDTO) { - int pageIndex = (fromDTO.getPageNo() - NumConstant.ONE) * fromDTO.getPageSize(); - List list = baseDao.selectPendingListByGrid(fromDTO.getGridId(), pageIndex, fromDTO.getPageSize()); - list.forEach(item -> { - ProjectDTO dto = new ProjectDTO(); - dto.setId(item.getProjectId()); - item.setCurrentHandleDepartMent(baseDao.selectDepartmentNameList(dto)); - }); - return list; + PageInfo result = + PageHelper.startPage(fromDTO.getPageNo(), fromDTO.getPageSize(), fromDTO.getIsPage()).doSelectPageInfo(() -> baseDao.selectPendingListByGrid(fromDTO.getGridId())); + if (CollectionUtils.isNotEmpty(result.getList())) { + result.getList().forEach(item -> { + ProjectDTO dto = new ProjectDTO(); + dto.setId(item.getProjectId()); + item.setCurrentHandleDepartMent(baseDao.selectDepartmentNameList(dto)); + }); + } + return result.getList(); } /** @@ -2830,8 +2832,8 @@ public class ProjectServiceImpl extends BaseServiceImpl getResolvedListByGrid(ShiftProjectListFromDTO fromDTO) { - int pageIndex = (fromDTO.getPageNo() - NumConstant.ONE) * fromDTO.getPageSize(); - return baseDao.selectResolvedListByGrid(fromDTO.getGridId(), pageIndex, fromDTO.getPageSize()); + PageHelper.startPage(fromDTO.getPageNo(), fromDTO.getPageSize(), fromDTO.getIsPage()); + return baseDao.selectResolvedListByGrid(fromDTO.getGridId()); } /** diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTagsServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTagsServiceImpl.java index 87edc5e00b..41bba0364a 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTagsServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTagsServiceImpl.java @@ -128,7 +128,9 @@ public class ProjectTagsServiceImpl extends BaseServiceImpl orientHooks = baseDao.selectProjectTagList(param.getProjectId()); //新增 List newHooks = param.getTagList(); - if(!CollectionUtils.isEmpty(orientHooks)) baseDao.deleteProjectTags(param.getProjectId()); + if(!CollectionUtils.isEmpty(orientHooks)) { + baseDao.deleteProjectTags(param.getProjectId()); + } if(!CollectionUtils.isEmpty(newHooks)){ baseDao.insertBatch(newHooks.stream().map(o->{ ProjectTagsEntity hook = ConvertUtils.sourceToTarget(param,ProjectTagsEntity.class);hook.setTagId(o.getId());hook.setTagName(o.getName());hook.setCreatedBy(param.getStaffId());return hook; @@ -139,16 +141,24 @@ public class ProjectTagsServiceImpl extends BaseServiceImpl newIds = CollectionUtils.isEmpty(newHooks) ? null : newHooks.stream().map(ProjectCategoryTagResultDTO::getId).collect(Collectors.toList()); TagDifferentSetFormDTO differentSet = ConvertUtils.sourceToTarget(param,TagDifferentSetFormDTO.class); differentSet.setUserId(param.getStaffId()); - if(null == orientIds && null == newIds) return ; - if(null != orientIds && null == newIds) differentSet.setMinus(orientIds); - if(null == orientIds && null != newIds) differentSet.setPlus(newIds); + if(null == orientIds && null == newIds) { + return ; + } + if(null != orientIds && null == newIds) { + differentSet.setMinus(orientIds); + } + if(null == orientIds && null != newIds) { + differentSet.setPlus(newIds); + } if(null != orientIds && null != newIds){ List replaceNews = new LinkedList<>(newIds); differentSet.setPlus(newIds.removeAll(orientIds) ? newIds : null); differentSet.setMinus(orientIds.removeAll(replaceNews) ? orientIds : null); } Result result = issueClient.updateCitations(differentSet); - if(!result.success()) throw new RenException(result.getInternalMsg()); + if(!result.success()) { + throw new RenException(result.getInternalMsg()); + } } -} \ No newline at end of file +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java index 5a2495eb3f..2a56eb3dfc 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java @@ -887,6 +887,10 @@ public class ProjectTraceServiceImpl implements ProjectTraceS log.error("【项目流转】上链失败,错误信息:{}", errorMsg); } + //2021.12.21 给报事人推送站内信 sun start + sendMsg(resiEventEntity); + //2021.12.21 给报事人推送站内信 sun end + return resultDTO; } @@ -1125,4 +1129,44 @@ public class ProjectTraceServiceImpl implements ProjectTraceS logger.info("事件立项,推送微信订阅消息"); return epmetMessageOpenFeignClient.sendWxSubscribeMessage(msgList); } + + /** + * @author sun + * 事件立项-给报事人推送站内信 + */ + private void sendMsg(ResiEventEntity resiEventEntity){ + //查询事件上报给网格还是组织信息 + ResiEventReportOrgEntity reportOrg = resiEventReportOrgDao.getByEventId(resiEventEntity.getId()); + String name = ""; + if ("grid".equals(reportOrg.getOrgType())) { + Result gridInfoRes = govOrgOpenFeignClient.queryGridInfo(reportOrg.getOrgId()); + if (!gridInfoRes.success() || null == gridInfoRes.getData()) { + throw new RenException("网格信息查询异常"); + } + name = gridInfoRes.getData().getGridName(); + } else { + AgencyInfoFormDTO dto = new AgencyInfoFormDTO(); + dto.setOrgId(reportOrg.getOrgId()); + dto.setOrgType(reportOrg.getOrgType()); + Result agencyResult = govOrgOpenFeignClient.agencyInfo(dto); + if (!agencyResult.success() || null == agencyResult.getData()) { + throw new RenException("组织信息查询异常"); + } + name = agencyResult.getData().getAgencyName(); + } + UserMessageFormDTO userMessage = new UserMessageFormDTO(); + userMessage.setApp(AppClientConstant.APP_RESI); + userMessage.setCustomerId(resiEventEntity.getCustomerId()); + userMessage.setGridId(resiEventEntity.getGridId()); + String messageContent = String.format(UserMessageConstant.PROJECT_EVENT, name); + userMessage.setMessageContent(messageContent); + userMessage.setReadFlag(ReadFlagConstant.UN_READ); + userMessage.setTitle(UserMessageConstant.EVENT_TITILE); + userMessage.setMessageType(UserMessageTypeConstant.EVENT); + userMessage.setTargetId(resiEventEntity.getId()); + //通知事件上报人 + userMessage.setUserId(resiEventEntity.getReportUserId()); + epmetMessageOpenFeignClient.saveUserMessage(userMessage); + } + } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventReplyServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventReplyServiceImpl.java index 0cc50a69b2..7a0b19a9fc 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventReplyServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventReplyServiceImpl.java @@ -18,24 +18,28 @@ package com.epmet.service.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.AppClientConstant; +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.RenException; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.scan.param.TextScanParamDTO; import com.epmet.commons.tools.scan.param.TextTaskDTO; import com.epmet.commons.tools.scan.result.SyncScanResult; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.ScanContentUtils; -import com.epmet.constant.EventConstant; -import com.epmet.constant.ResiEventAction; +import com.epmet.constant.*; import com.epmet.dao.*; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.form.ReplyFormDTO; import com.epmet.dto.form.ReplyListFormDTO; +import com.epmet.dto.form.UserMessageFormDTO; +import com.epmet.dto.result.GridInfoResultDTO; import com.epmet.dto.result.ReplyListResultDTO; import com.epmet.dto.result.UserBaseInfoResultDTO; -import com.epmet.entity.ResiEventEntity; -import com.epmet.entity.ResiEventOperationLogEntity; -import com.epmet.entity.ResiEventReplyEntity; +import com.epmet.entity.*; +import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.service.ResiEventReplyService; @@ -71,6 +75,8 @@ public class ResiEventReplyServiceImpl extends BaseServiceImpl gridInfoRes = govOrgOpenFeignClient.queryGridInfo(reportOrgEntity.getOrgId()); + if (!gridInfoRes.success() || null == gridInfoRes.getData()) { + throw new RenException("网格信息查询异常"); + } + name = gridInfoRes.getData().getGridName(); + } + UserMessageFormDTO userMessage = new UserMessageFormDTO(); + userMessage.setApp(AppClientConstant.APP_RESI); + userMessage.setCustomerId(replyFormDTO.getCustomerId()); + userMessage.setGridId(eventEntity.getGridId()); + String messageContent = String.format(UserMessageConstant.REPLY_EVENT, name); + userMessage.setMessageContent(messageContent); + userMessage.setReadFlag(ReadFlagConstant.UN_READ); + userMessage.setTitle(UserMessageConstant.EVENT_TITILE); + userMessage.setMessageType(UserMessageTypeConstant.EVENT); + userMessage.setTargetId(eventEntity.getId()); + //通知事件上报人 + userMessage.setUserId(eventEntity.getReportUserId()); + epmetMessageOpenFeignClient.saveUserMessage(userMessage); + //2021.12.21 给报事人推送站内信 sun end } private ResiEventEntity queryResiEntity(String resiEventId) { @@ -254,6 +286,25 @@ public class ResiEventReplyServiceImpl extends BaseServiceImpl + * 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.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.ResiEventScanTaskDao; +import com.epmet.entity.ResiEventScanTaskEntity; +import com.epmet.service.ResiEventScanTaskService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 事件附件安全校验任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-12-22 + */ +@Service +public class ResiEventScanTaskServiceImpl extends BaseServiceImpl implements ResiEventScanTaskService { + + /** + * @Author sun + * @Description 获取事件附件待审核列表 + **/ + @Override + public List getScanTaskList(String draftId, String status) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(draftId), "RESI_EVENT_ID", draftId); + wrapper.eq(StringUtils.isNotBlank(status),"STATUS", status); + List entityList = baseDao.selectList(wrapper); + return entityList; + + } + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java index a64b74ee99..3c5b66a824 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java @@ -19,6 +19,7 @@ package com.epmet.service.impl; import com.alibaba.fastjson.JSON; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.form.FileCommonDTO; @@ -26,17 +27,16 @@ 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.scan.param.ImgScanParamDTO; -import com.epmet.commons.tools.scan.param.ImgTaskDTO; -import com.epmet.commons.tools.scan.param.TextScanParamDTO; -import com.epmet.commons.tools.scan.param.TextTaskDTO; +import com.epmet.commons.tools.scan.param.*; +import com.epmet.commons.tools.scan.result.AsyncScanResult; +import com.epmet.commons.tools.scan.result.AsyncScanTaskDTO; import com.epmet.commons.tools.scan.result.SyncScanResult; +import com.epmet.commons.tools.scan.result.VoiceResultDTO; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.ScanContentUtils; -import com.epmet.constant.EventConstant; -import com.epmet.constant.ResiEventAction; +import com.epmet.constant.*; import com.epmet.dao.*; import com.epmet.dto.EventProjectInfoDTO; import com.epmet.dto.IssueProjectCategoryDictDTO; @@ -44,10 +44,13 @@ import com.epmet.dto.ProjectCategoryDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.*; +import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovIssueOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.resi.group.constant.TopicConstant; import com.epmet.service.ProjectCategoryService; +import com.epmet.service.ResiEventScanTaskService; import com.epmet.service.ResiEventService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -60,6 +63,8 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; /** * 居民报事表 @@ -76,6 +81,10 @@ public class ResiEventServiceImpl extends BaseServiceImpl result = baseDao.eventUnDisposedList(formDTO.getOrgId(), formDTO.getEventType()); if (!CollectionUtils.isEmpty(result)){ + //附件按类型分组【图片、语音】 + result.forEach(re->{ + List eventImgs = new ArrayList<>(); + List voiceList = new ArrayList<>(); + re.getAttachmentList().forEach(file->{ + if ("image".equals(file.getType())) { + eventImgs.add(file.getUrl()); + } else if ("voice".equals(file.getType())) { + voiceList.add(file.getUrl()); + } + }); + re.setEventImgs(eventImgs); + re.setVoiceList(voiceList); + }); return result; } return new ArrayList<>(); @@ -130,17 +157,21 @@ public class ResiEventServiceImpl extends BaseServiceImpl eventImgs = new ArrayList<>(); + List voiceList = new ArrayList<>(); + dto.getAttachmentList().forEach(file->{ + if("image".equals(file.getType())){ + eventImgs.add(file.getUrl()); + }else if("voice".equals(file.getType())){ + FileCommonDTO fl = new FileCommonDTO(); + fl.setUrl(file.getUrl()); + fl.setDuration(file.getDuration()); + voiceList.add(fl); + } + }); + dto.setEventImgs(eventImgs); + dto.setVoiceList(voiceList); + // 已转项目 if (dto.getIsProject()){ // 查询项目信息 @@ -248,6 +305,14 @@ public class ResiEventServiceImpl extends BaseServiceImpl attachmentEntityList=getAttList(formDTO.getCustomerId(),resiEventEntity.getId(),formDTO.getAttachmentList()); attachmentEntityList.forEach(attachmentEntity->{ resiEventAttachmentDao.insert(attachmentEntity); }); + //5-2.插入语音附件 + if(!org.apache.commons.collections4.CollectionUtils.isEmpty(formDTO.getVoiceList())) { + //语音附件处理【创建阿里安全审核任务】 + //5-2-1.语音附件存入表中 + List voiceDTOList = new ArrayList<>(); + int sort = 1;//原本下标从0开始 图片的用了1就保持一致从1开始 + for (FileCommonDTO file : formDTO.getVoiceList()) { + ResiEventAttachmentEntity entity = new ResiEventAttachmentEntity(); + entity.setCustomerId(formDTO.getCustomerId()); + entity.setResiEventId(resiEventEntity.getId()); + entity.setAttachmentName(file.getName()); + entity.setAttachmentFormat(file.getFormat()); + entity.setAttachmentType("voice"); + entity.setAttachmentUrl(file.getUrl()); + entity.setSort(sort); + entity.setStatus(TopicConstant.AUDITING); + entity.setDuration(file.getDuration()); + sort++; + resiEventAttachmentDao.insert(entity); + + VoiceTaskDTO task = new VoiceTaskDTO(); + task.setDataId(entity.getId()); + task.setUrl(file.getUrl()); + voiceDTOList.add(task); + } + //5-2-2.语音创建审核任务【定时任务会处理待审核语音后修改数据库数据】 + VoiceScanParamDTO voiceScanParamDTO = new VoiceScanParamDTO(); + voiceScanParamDTO.setTasks(voiceDTOList); + voiceScanParamDTO.setOpenCallBack(false); + Result voiceScanResult = ScanContentUtils.voiceAsyncScan(scanApiUrl.concat(voiceAsyncScanMethod), voiceScanParamDTO); + if (!voiceScanResult.success() || !voiceScanResult.getData().isAllSuccess()) { + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + List taskList = voiceScanResult.getData().getSuccessTasks(); + //提交记录存入task表 + List scanTaskEntityList = taskList.stream().map(item -> { + ResiEventScanTaskEntity taskEntity = new ResiEventScanTaskEntity(); + taskEntity.setCustomerId(formDTO.getCustomerId()); + taskEntity.setResiEventId(resiEventEntity.getId()); + taskEntity.setResiEventAttachmentId(item.getDataId()); + taskEntity.setTaskId(item.getTaskId()); + taskEntity.setStatus(TopicConstant.AUDITING); + taskEntity.setAttachmentType(TopicConstant.VOICE); + return taskEntity; + }).collect(Collectors.toList()); + resiEventScanTaskService.insertBatch(scanTaskEntityList); + } + } //6、插入组织表 List orgEntityList=getOrgList(formDTO.getCustomerId(),resiEventEntity.getId(),formDTO.getOrgList()); orgEntityList.forEach(orgEntity->{ @@ -359,6 +477,7 @@ public class ResiEventServiceImpl extends BaseServiceImpl resiEventMentionDao.selectMentionList(formDTO.getUserId(), formDTO.getReadFlag())); result.getList().forEach(dto->{ + //附件按类型分组【图片、语音】 + List imgList = new ArrayList<>(); + List voiceList = new ArrayList<>(); + dto.getAttachmentList().forEach(file -> { + if ("image".equals(file.getType())) { + imgList.add(file.getUrl()); + } else if ("voice".equals(file.getType())) { + voiceList.add(file.getUrl()); + } + }); + dto.setImgList(imgList); + dto.setVoiceList(voiceList); + if(dto.getShiftProject()||dto.getStatus().equals(EventConstant.EVENT_STATUS_CLOSED_CASE)){ // 立项和办结了不能回复哈。 dto.setReplyButtonFlag("false"); @@ -560,6 +692,21 @@ public class ResiEventServiceImpl extends BaseServiceImpl orgIds = listResult.getData(); if (!CollectionUtils.isEmpty(orgIds)){ List result = baseDao.newEvents(orgIds); + //附件按类型分组【图片、语音】 + result.forEach(re->{ + List eventImgs = new ArrayList<>(); + List voiceList = new ArrayList<>(); + re.getAttachmentList().forEach(file->{ + if ("image".equals(file.getType())) { + eventImgs.add(file.getUrl()); + } else if ("voice".equals(file.getType())) { + voiceList.add(file.getUrl()); + } + }); + re.setEventImgs(eventImgs); + re.setVoiceList(voiceList); + }); + return result; } return new ArrayList<>(); @@ -606,6 +753,41 @@ public class ResiEventServiceImpl extends BaseServiceImpl gridInfoRes = govOrgOpenFeignClient.queryGridInfo(reportOrgEntity.getOrgId()); + if (!gridInfoRes.success() || null == gridInfoRes.getData()) { + throw new RenException("网格信息查询异常"); + } + name = gridInfoRes.getData().getGridName(); + } else { + AgencyInfoFormDTO dto = new AgencyInfoFormDTO(); + dto.setOrgId(reportOrgEntity.getOrgId()); + dto.setOrgType(reportOrgEntity.getOrgType()); + Result agencyResult = govOrgOpenFeignClient.agencyInfo(dto); + if (!agencyResult.success() || null == agencyResult.getData()) { + throw new RenException("组织信息查询异常"); + } + name = agencyResult.getData().getAgencyName(); + } + UserMessageFormDTO userMessage = new UserMessageFormDTO(); + userMessage.setApp(AppClientConstant.APP_RESI); + userMessage.setCustomerId(resiEventEntity.getCustomerId()); + userMessage.setGridId(resiEventEntity.getGridId()); + String messageContent = String.format(UserMessageConstant.RCLOSE_PROJECT_EVENT, name); + userMessage.setMessageContent(messageContent); + userMessage.setReadFlag(ReadFlagConstant.UN_READ); + userMessage.setTitle(UserMessageConstant.EVENT_TITILE); + userMessage.setMessageType(UserMessageTypeConstant.EVENT); + userMessage.setTargetId(resiEventEntity.getId()); + //通知事件上报人 + userMessage.setUserId(resiEventEntity.getReportUserId()); + epmetMessageOpenFeignClient.saveUserMessage(userMessage); + //2021.12.21 给报事人推送站内信 sun end } /** @@ -767,5 +949,149 @@ public class ResiEventServiceImpl extends BaseServiceImpl taskList = resiEventScanTaskService.getScanTaskList(null, TopicConstant.AUDITING); + if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(taskList)) { + Map map = taskList.stream().collect(Collectors.toMap(ResiEventScanTaskEntity::getTaskId, Function.identity())); + List taskIds = taskList.stream().map(ResiEventScanTaskEntity::getTaskId).collect(Collectors.toList()); + List draftIds = taskList.stream().map(ResiEventScanTaskEntity::getResiEventId).collect(Collectors.toList()); + Result> voiceResults = ScanContentUtils.voiceResults(scanApiUrl.concat(voiceResultsMethod), taskIds); + if (!voiceResults.success()) { + return; + } + List list = voiceResults.getData(); + for (VoiceResultDTO item : list) { + ResiEventScanTaskEntity taskEntity = map.get(item.getTaskId()); + if (EventConstant.REVIEW.equals(item.getSuggestion())) { + //结果不确定 + ResiEventAttachmentEntity entity = new ResiEventAttachmentEntity(); + entity.setId(taskEntity.getResiEventAttachmentId()); + entity.setStatus(EventConstant.REVIEW); + entity.setReason(item.getLabelDesc()); + resiEventAttachmentDao.updateById(entity); + + taskEntity.setStatus(EventConstant.REVIEW); + resiEventScanTaskService.updateById(taskEntity); + + } else if (EventConstant.BLOCK.equals(item.getSuggestion())) { + //结果违规 + ResiEventAttachmentEntity entity = new ResiEventAttachmentEntity(); + entity.setId(taskEntity.getResiEventAttachmentId()); + entity.setStatus(EventConstant.BLOCK); + entity.setReason(item.getLabelDesc()); + resiEventAttachmentDao.updateById(entity); + + taskEntity.setStatus(EventConstant.BLOCK); + resiEventScanTaskService.updateById(taskEntity); + } else { + //审核通过 + ResiEventAttachmentEntity entity = new ResiEventAttachmentEntity(); + entity.setId(taskEntity.getResiEventAttachmentId()); + entity.setStatus(EventConstant.AUTO_PASSED); + entity.setReason(item.getLabelDesc()); + resiEventAttachmentDao.updateById(entity); + + taskEntity.setStatus(EventConstant.AUTO_PASSED); + resiEventScanTaskService.updateById(taskEntity); + } + } + + //判断事件对应的所有需要审核的附件是否全部审核完成 + draftIds.forEach(draftId -> { + List tasks = resiEventScanTaskService.getScanTaskList(draftId, null); + String status = EventConstant.AUTO_PASSED; + for (ResiEventScanTaskEntity task : tasks) { + if (EventConstant.AUDITING.equals(task.getStatus())) { + status = EventConstant.AUDITING; + break; + } else if (EventConstant.BLOCK.equals(task.getStatus())) { + status = EventConstant.BLOCK; + } else if (EventConstant.REVIEW.equals(task.getStatus())) { + if (!EventConstant.BLOCK.equals(status)) { + status = EventConstant.REVIEW; + } + } else { + if (!EventConstant.BLOCK.equals(status) && !EventConstant.REVIEW.equals(status)) { + status = EventConstant.AUTO_PASSED; + } + } + } + + if (EventConstant.BLOCK.equals(status)) { + //草稿状态更新为block + ResiEventEntity draftEntity = new ResiEventEntity(); + draftEntity.setId(draftId); + draftEntity.setAuditStatus(EventConstant.BLOCK); + draftEntity.setAuditReason("语音存在违规内容"); + baseDao.updateById(draftEntity); + + } else if (EventConstant.REVIEW.equals(status)) { + //草稿状态更新为review + ResiEventEntity draftEntity = new ResiEventEntity(); + draftEntity.setId(draftId); + draftEntity.setAuditStatus(EventConstant.REVIEW); + draftEntity.setAuditReason("需要人工审核"); + baseDao.updateById(draftEntity); + + } else if (EventConstant.AUTO_PASSED.equals(status)) { + //草稿状态更新为auto_passed + ResiEventEntity draftEntity = new ResiEventEntity(); + draftEntity.setId(draftId); + draftEntity.setAuditStatus(EventConstant.AUTO_PASSED); + baseDao.updateById(draftEntity); + } + }); + } + + } + + /** + * @Author sun + * @Description 【事件】(未处理、处理中、已办结)地图、列表 + * 未处理: 发了没有人看过的时间 + * 处理中: 有人看,正在处理中的 + * 已办结:有人看,已经办结了的 + **/ + @Override + public List resiEventList(ResiEventLsitFormDTO formDTO) { + PageInfo result = PageHelper.startPage(formDTO.getPageNo(), + formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.resiEventList(formDTO.getGridId(), formDTO.getStatusCondition())); + result.getList().forEach(resultDTO -> { + //附件按类型分组【图片、语音】 + List imgList = new ArrayList<>(); + List voiceList = new ArrayList<>(); + resultDTO.getAttachmentList().forEach(file -> { + if ("image".equals(file.getType())) { + imgList.add(file.getUrl()); + } else if ("voice".equals(file.getType())) { + voiceList.add(file.getUrl()); + } + }); + resultDTO.setImgList(imgList); + resultDTO.setVoiceList(voiceList); + + if (EventConstant.EVENT_STATUS_CLOSED_CASE.equals(resultDTO.getStatus()) || resultDTO.getShiftProject()) { + // 已办结的、立项的不显示回复按钮 + resultDTO.setReplyButtonFlag("false"); + } else { + // 处理中的事件 + if (resultDTO.getReadFlag()) { + // 被别人看过了就显示回复 + resultDTO.setReplyButtonFlag("true"); + } else { + //别人没看过 + resultDTO.setReplyButtonFlag("false"); + } + } + }); + return result.getList(); + } } diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml b/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml index 2800f5ad1c..7821e73e53 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml @@ -122,6 +122,8 @@ openapi: method: imgSyncScan: /imgSyncScan textSyncScan: /textSyncScan + voiceAsyncScan: /voiceAsyncScan + voiceResults: /voiceResults #pageHelper分页插件 pagehelper: diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.17__event_scan.sql b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.17__event_scan.sql new file mode 100644 index 0000000000..78eed0497e --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.17__event_scan.sql @@ -0,0 +1,26 @@ + +ALTER TABLE `resi_event` +ADD COLUMN `AUDIT_STATUS` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'auto_passed' COMMENT '事件审核状态[涉及附件审核需要加的状态](审核中:auditing; \r\nauto_passed: 自动通过;\r\nreview:结果不确定,需要人工审核;\r\nblock: 结果违规;\r\nrejected:人工审核驳回;\r\napproved:人工审核通过)' AFTER `UPDATED_TIME`, +ADD COLUMN `AUDIT_REASON` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '审核理由' AFTER `AUDIT_STATUS`; + +CREATE TABLE `resi_event_scan_task` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `RESI_EVENT_ID` varchar(64) NOT NULL COMMENT '事件Id,关联resi_event的id', + `RESI_EVENT_ATTACHMENT_ID` varchar(64) NOT NULL COMMENT '事件附件表主键,对应dataId', + `TASK_ID` varchar(64) NOT NULL COMMENT '阿里云审核任务Id', + `STATUS` varchar(32) NOT NULL COMMENT '审核状态【auditing: 审核中;\r\nauto_passed: 自动通过;\r\nreview:结果不确定,需要人工审核;\r\nblock: 结果违规;】', + `ATTACHMENT_TYPE` varchar(64) NOT NULL COMMENT '附件类型(视频 - video、 语音 - voice 文件 - doc)', + `DEL_FLAG` char(1) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '操作人,API审核结果,存储为SCAN_USER或者APP_USER', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='事件附件安全校验任务表'; + +ALTER TABLE `resi_event_attachment` +ADD COLUMN `STATUS` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'auto_passed' COMMENT '附件状态(审核中:auditing; \r\nauto_passed: 自动通过;\r\nreview:结果不确定,需要人工审核;\r\nblock: 结果违规;\r\nrejected:人工审核驳回;\r\napproved:人工审核通过)\r\n现在图片是同步审核的,所以图片只有auto_passed一种状态' AFTER `UPDATED_TIME`, +ADD COLUMN `REASON` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '失败原因' AFTER `STATUS`; + diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.18__alter.sql b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.18__alter.sql new file mode 100644 index 0000000000..f9edb65bb3 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.18__alter.sql @@ -0,0 +1,3 @@ +ALTER TABLE `resi_event_attachment` +ADD COLUMN `DURATION` int(11) NULL DEFAULT NULL COMMENT '语音或视频时长,秒' AFTER `REASON`; + diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml index dd1d3cc4bd..60c2050f24 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml @@ -333,7 +333,6 @@ AND a.`STATUS` = 'pending' AND a.ORIGIN = 'issue' ORDER BY a.CREATED_TIME DESC - LIMIT #{pageNo}, #{pageSize} - SELECT rea.ATTACHMENT_URL AS img,t.* FROM - (SELECT - re.EVENT_CONTENT AS eventContent, - - IFNULL(DATE_FORMAT(re.CREATED_TIME,'%Y-%m-%d %H:%i'),'') AS eventTime, - - - IFNULL(DATE_FORMAT(re.LATEST_OPERATED_TIME,'%Y-%m-%d %H:%i'),'') AS eventTime, - - - IFNULL(DATE_FORMAT(re.CLOSE_CASE_TIME,'%Y-%m-%d %H:%i'),'') AS eventTime, - - re.ID AS eventId, - (CASE WHEN re.SHIFT_PROJECT = 1 THEN TRUE ELSE FALSE END) AS isProject, - (CASE WHEN ro.RED_DOT = 1 THEN TRUE ELSE FALSE END) AS redDot - FROM resi_event_report_org ro - INNER JOIN resi_event re ON (ro.RESI_EVENT_ID = re.ID AND re.DEL_FLAG = '0') - AND ro.DEL_FLAG = '0' - and ro.ORG_ID = #{orgId} - - AND ro.ORG_READ = 'un_read' - - - AND ro.ORG_READ = 'read' - AND re.`STATUS` = 'processing' - - - AND ro.ORG_READ = 'read' - AND re.`STATUS` = 'closed_case' - + SELECT + rea.id AS resiEventAttachmentId, + rea.ATTACHMENT_URL AS url, + rea.ATTACHMENT_TYPE AS type, + t.* + FROM + ( + SELECT + re.EVENT_CONTENT AS eventContent, + + IFNULL(DATE_FORMAT(re.CREATED_TIME,'%Y-%m-%d %H:%i'),'') AS eventTime, + + + IFNULL(DATE_FORMAT(re.LATEST_OPERATED_TIME,'%Y-%m-%d %H:%i'),'') AS eventTime, + + + IFNULL(DATE_FORMAT(re.CLOSE_CASE_TIME,'%Y-%m-%d %H:%i'),'') AS eventTime, + + re.ID AS eventId, + (CASE WHEN re.SHIFT_PROJECT = 1 THEN TRUE ELSE FALSE END) AS isProject, + (CASE WHEN ro.RED_DOT = 1 THEN TRUE ELSE FALSE END) AS redDot + FROM resi_event_report_org ro + INNER JOIN resi_event re ON (ro.RESI_EVENT_ID = re.ID AND re.DEL_FLAG = '0' AND re.audit_status = 'auto_passed') + AND ro.DEL_FLAG = '0' + AND ro.ORG_ID = #{orgId} + + AND ro.ORG_READ = 'un_read' + + + AND ro.ORG_READ = 'read' + AND re.`STATUS` = 'processing' + + + AND ro.ORG_READ = 'read' + AND re.`STATUS` = 'closed_case' + )t - LEFT JOIN resi_event_attachment rea - ON (rea.RESI_EVENT_ID = t.eventId - and rea.DEL_FLAG = '0' - AND rea.ATTACHMENT_TYPE = 'image') + LEFT JOIN resi_event_attachment rea ON (rea.resi_event_id = t.eventId AND rea.del_flag = '0' AND rea.attachment_type = 'image') ORDER BY t.eventTime,rea.sort asc @@ -98,6 +103,7 @@ and rea.ATTACHMENT_TYPE='image') where re.DEL_FLAG='0' and re.RECALL_FLAG='0' + AND re.audit_status = 'auto_passed' and re.REPORT_USER_ID=#{userId} and re.READ_FLAG='0' @@ -121,19 +127,28 @@ - + + + + + + + + + SELECT IFNULL(re.EVENT_CONTENT,'') AS eventContent, DATE_FORMAT(re.CREATED_TIME,'%Y-%m-%d %H:%i') AS eventTime, - ea.ATTACHMENT_URL AS img, + ea.id AS resiEventAttachmentId, + ea.attachment_url AS url, + ea.attachment_type AS type, re.id as eventId FROM resi_event_report_org ro - LEFT JOIN resi_event re ON (re.ID = ro.RESI_EVENT_ID AND re.DEL_FLAG = '0') + LEFT JOIN resi_event re ON (re.ID = ro.RESI_EVENT_ID AND re.DEL_FLAG = '0' AND re.audit_status = 'auto_passed') LEFT JOIN resi_event_attachment ea ON (ea.RESI_EVENT_ID = ro.RESI_EVENT_ID AND ea.DEL_FLAG = '0' AND ea.ATTACHMENT_TYPE = 'image' AND ea.SORT IN (3,1,2)) WHERE ro.DEL_FLAG = '0' @@ -217,4 +243,60 @@ re.REPORT_USER_ID = #{epmetUserId} + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventMentionDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventMentionDao.xml index b7c65d32be..f979dbfe96 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventMentionDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventMentionDao.xml @@ -10,11 +10,16 @@ - + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventScanTaskDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventScanTaskDao.xml new file mode 100644 index 0000000000..ae523c9093 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventScanTaskDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerParameterServiceImpl.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerParameterServiceImpl.java index f00c91d57e..fc7cd29f80 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerParameterServiceImpl.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerParameterServiceImpl.java @@ -66,7 +66,9 @@ public class CustomerParameterServiceImpl implements CustomerParameterService { @Override @Transactional(rollbackFor = Exception.class) public void updateParamInfo(List formDTOS) { - if (CollectionUtils.isEmpty(formDTOS))return; + if (CollectionUtils.isEmpty(formDTOS)) { + return; + } parameterDao.updateParamInfo(formDTOS); } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicDetailResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicDetailResultDTO.java index 4cb680301b..67202ed3f6 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicDetailResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicDetailResultDTO.java @@ -65,6 +65,7 @@ public class ResiTopicDetailResultDTO implements Serializable { */ private List topicVoices; - + private String longitude; + private String latitude; } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupRedis.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupRedis.java index 5cb1b48027..40f64fe6fa 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupRedis.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupRedis.java @@ -78,8 +78,8 @@ public class ResiGroupRedis { } /** * @Description 新增/更新群组缓存信息 - * @Param - * @return + * @Param + * @return * @Author wangc * @Date 2020.04.13 09:58 **/ @@ -275,7 +275,9 @@ public class ResiGroupRedis { */ public String getFullName(String userId){ String fieldValue = (String)redisUtils.hGet(RedisKeys.getResiUserKey(userId),"realName"); - if(StringUtils.isNotBlank(fieldValue)) return fieldValue; + if(StringUtils.isNotBlank(fieldValue)) { + return fieldValue; + } List userParam = new LinkedList<>(); userParam.add(userId); Result> userCacheResult = epmetUserOpenFeignClient.queryUserBaseInfo(userParam); if(userCacheResult.success() && !CollectionUtils.isEmpty(userCacheResult.getData())){ @@ -283,4 +285,4 @@ public class ResiGroupRedis { } return null; } -} \ No newline at end of file +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/impl/GroupInvitationServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/impl/GroupInvitationServiceImpl.java index 28a58d0a12..f6a7cd87d1 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/impl/GroupInvitationServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/impl/GroupInvitationServiceImpl.java @@ -430,15 +430,21 @@ public class GroupInvitationServiceImpl extends BaseServiceImpl page(Map params) { @@ -352,10 +358,13 @@ public class GroupMemeberOperationServiceImpl extends BaseServiceImpl pointEventMsgList = new ArrayList<>(); BasePointEventMsg pointEventMsg = new BasePointEventMsg(); pointEventMsg.setCustomerId(resiGroupDTO.getCustomerId()); @@ -368,8 +377,8 @@ public class GroupMemeberOperationServiceImpl extends BaseServiceImpl pointEventMsgList = new ArrayList<>(); BasePointEventMsg pointEventMsg = new BasePointEventMsg(); pointEventMsg.setCustomerId(groupCache.getCustomerId()); @@ -689,7 +693,7 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl userParam = new LinkedList<>(); @@ -707,8 +711,15 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl NumConstant.FIFTEEN){ + String eventClass = EventEnum.PARTICIPATE_ONE_TOPIC.getEventClass(); + String eventTag = EventEnum.PARTICIPATE_ONE_TOPIC.getEventTag(); + //mq的事件类型 - MqBaseMsgDTO mqBaseMsgDTO = new MqBaseMsgDTO(); - mqBaseMsgDTO.setEventClass(EventEnum.PARTICIPATE_ONE_TOPIC.getEventClass()); + //MqBaseMsgDTO mqBaseMsgDTO = new MqBaseMsgDTO(); + //mqBaseMsgDTO.setEventClass(EventEnum.PARTICIPATE_ONE_TOPIC.getEventClass()); //事件code - mqBaseMsgDTO.setEventTag(EventEnum.PARTICIPATE_ONE_TOPIC.getEventTag()); + //mqBaseMsgDTO.setEventTag(EventEnum.PARTICIPATE_ONE_TOPIC.getEventTag()); List pointEventMsgList = new ArrayList<>(); BasePointEventMsg pointEventMsg = new BasePointEventMsg(); String customerId = resiTopicdDao.selectCustomerIdByTopicId(resiCommentFormDTO.getTopicId()); @@ -297,8 +304,8 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl pointEventMsgList = new ArrayList<>(); BasePointEventMsg pointEventMsg = new BasePointEventMsg(); ResiGroupInfoRedisDTO resiGroupInfoRedisDTO = resiGroupRedis.get(resiTopicPublishFormDTO.getGroupId()); @@ -449,13 +455,19 @@ public class ResiTopicServiceImpl extends BaseServiceImpl pointEventMsgList = new ArrayList<>(); BasePointEventMsg pointEventMsg = new BasePointEventMsg(); @@ -840,8 +852,15 @@ public class ResiTopicServiceImpl extends BaseServiceImpl result = SendMqMsgUtils.sendMsg(mqBaseMsgDTO); + + SystemMsgFormDTO msgFormDTO = new SystemMsgFormDTO(); + msgFormDTO.setContent(pointEventMsgList); + msgFormDTO.setMessageType(SystemMessageType.LEADER_RESOLVE_TOPIC); + Result result = epmetMessageOpenFeignClient.sendSystemMsgByMQ(msgFormDTO); + + if (!result.success()) { log.error("组长解决话题事件发送失败,参数:{}", JSON.toJSONString(closeFormDTO)); } } @@ -1931,15 +1950,22 @@ public class ResiTopicServiceImpl extends BaseServiceImpl { - MqBaseMsgDTO msgDTO = new MqBaseMsgDTO(); - msgDTO.setEventClass("resi_group"); + //MqBaseMsgDTO msgDTO = new MqBaseMsgDTO(); + //msgDTO.setEventClass("resi_group"); //事件code 因为楼院小组的事件回调统一入口,外层的EventTag不能够判断具体的事件 //因为可能会一次发送多个事件集合,需要对集合里的对象逐个判断 - msgDTO.setEventTag(EventEnum.SHIFT_TOPIC_TO_ISSUE.getEventTag()); + //msgDTO.setEventTag(EventEnum.SHIFT_TOPIC_TO_ISSUE.getEventTag()); List msgList = new ArrayList<>(); msgList.add(item); - msgDTO.setMsg(JSON.toJSONString(msgList)); - if(!SendMqMsgUtils.sendMsg(msgDTO).success()){ + //msgDTO.setMsg(JSON.toJSONString(msgList)); + + SystemMsgFormDTO msgForm = new SystemMsgFormDTO(); + msgForm.setMessageType(SystemMessageType.SHIFT_TOPIC_TO_ISSUE); + msgForm.setContent(msgList); + Result sendMsgResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(msgForm); + + //Result sendMsgResult = SendMqMsgUtils.sendMsg(msgDTO); + if(!sendMsgResult.success()){ log.error("话题转议题事件发送失败,参数:{}",JSON.toJSONString(topicTurnIssueFromDTO)); } }); @@ -2104,15 +2130,22 @@ public class ResiTopicServiceImpl extends BaseServiceImpl { - MqBaseMsgDTO msgDTO = new MqBaseMsgDTO(); - msgDTO.setEventClass("resi_group"); + //MqBaseMsgDTO msgDTO = new MqBaseMsgDTO(); + //msgDTO.setEventClass("resi_group"); //事件code 因为楼院小组的事件回调统一入口,外层的EventTag不能够判断具体的事件 //因为可能会一次发送多个事件集合,需要对集合里的对象逐个判断 - msgDTO.setEventTag(EventEnum.SHIFT_TOPIC_TO_ISSUE.getEventTag()); + //msgDTO.setEventTag(EventEnum.SHIFT_TOPIC_TO_ISSUE.getEventTag()); List msgList = new ArrayList<>(); msgList.add(item); - msgDTO.setMsg(JSON.toJSONString(msgList)); - if(!SendMqMsgUtils.sendMsg(msgDTO).success()){ + //msgDTO.setMsg(JSON.toJSONString(msgList)); + + SystemMsgFormDTO sendMsgForm = new SystemMsgFormDTO(); + sendMsgForm.setContent(msgList); + sendMsgForm.setMessageType(SystemMessageType.SHIFT_TOPIC_TO_ISSUE); + Result sendMsgResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(sendMsgForm); + + //Result sendMsgResult = SendMqMsgUtils.sendMsg(msgDTO); + if(!sendMsgResult.success()){ log.error("话题转议题事件发送失败,参数:{}",JSON.toJSONString(param)); } }); @@ -2462,10 +2495,10 @@ public class ResiTopicServiceImpl extends BaseServiceImpl pointEventMsgList = new ArrayList<>(); //话题被转为项目 话题作者 @@ -2493,8 +2526,16 @@ public class ResiTopicServiceImpl extends BaseServiceImpl content.length() ? "\"" : "…\"") ).append("被转为项目").toString()); pointEventMsgList.add(pointEventMsg); - mqBaseMsgDTO.setMsg(JSON.toJSONString(pointEventMsgList)); - if(!SendMqMsgUtils.sendMsg(mqBaseMsgDTO).success()){ + //mqBaseMsgDTO.setMsg(JSON.toJSONString(pointEventMsgList)); + + //Result sendMsgResult = SendMqMsgUtils.sendMsg(mqBaseMsgDTO); + + SystemMsgFormDTO sendMsgForm = new SystemMsgFormDTO(); + sendMsgForm.setContent(pointEventMsgList); + sendMsgForm.setMessageType(SystemMessageType.TOPIC_TO_PROJECT); + Result sendMsgResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(sendMsgForm); + + if(!sendMsgResult.success()){ log.error("话题转议题事件发送失败,参数:{}",JSON.toJSONString(param)); } } @@ -2850,6 +2891,8 @@ public class ResiTopicServiceImpl extends BaseServiceImpl actPointEventMsgList=new ArrayList<>(); BasePointEventMsg actPointEventMsg=new BasePointEventMsg(); actPointEventMsg.setCustomerId(customerId); @@ -1026,8 +1028,14 @@ public class TopicDraftServiceImpl extends BaseServiceImpl issueShareLinkInfo = issueClient.shareLinkInfo(param.getId()); @@ -234,7 +236,9 @@ public class TopicShareLinkRecordServiceImpl extends BaseServiceImpl groups = resiGroupMemberDao.getGroupIdByUserIdAndGridId(groupEntity.getGridId(), userId, NumConstant.ONE_STR); if(!CollectionUtils.isEmpty(groups)){ relation.setInAnyGroup(true); diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicShareLinkVisitRecordServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicShareLinkVisitRecordServiceImpl.java index 949cfd6bab..85164a7a13 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicShareLinkVisitRecordServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicShareLinkVisitRecordServiceImpl.java @@ -97,7 +97,9 @@ public class TopicShareLinkVisitRecordServiceImpl extends BaseServiceImpl> locationGridList(@LoginUser TokenDto dto,@RequestBody CustomerGridListFormDTO customerGridListFormDTO){ ValidatorUtils.validateEntity(customerGridListFormDTO); - if(null == dto || StringUtils.isEmpty(dto.getCustomerId())) throw new ValidateException("无法获取客户Id"); + if(null == dto || StringUtils.isEmpty(dto.getCustomerId())) { + throw new ValidateException("无法获取客户Id"); + } return strangerAccessRecordService.listCustomerGridH5(customerGridListFormDTO,dto.getCustomerId()); } diff --git a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/form/CommonIssueListFormDTO.java b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/form/CommonIssueListFormDTO.java index 925551f55c..bebad0de3d 100644 --- a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/form/CommonIssueListFormDTO.java +++ b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/form/CommonIssueListFormDTO.java @@ -32,4 +32,6 @@ public class CommonIssueListFormDTO implements Serializable { * 每页多少条 * */ private Integer pageSize = 20; + + private Boolean isPage = true; } diff --git a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/ClosedIssueListResultDTO.java b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/ClosedIssueListResultDTO.java index 8fe3e10d51..da7574183f 100644 --- a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/ClosedIssueListResultDTO.java +++ b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/ClosedIssueListResultDTO.java @@ -54,4 +54,6 @@ public class ClosedIssueListResultDTO implements Serializable { * */ private String topicContent; + private String longitude; + private String latitude; } diff --git a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/VotingIssueListResultDTO.java b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/VotingIssueListResultDTO.java index d6ccbee1d1..3b9bee2505 100644 --- a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/VotingIssueListResultDTO.java +++ b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/VotingIssueListResultDTO.java @@ -54,4 +54,7 @@ public class VotingIssueListResultDTO implements Serializable { * 话题内容 */ private String topicContent; + + private String longitude; + private String latitude; } diff --git a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 97ea4918b7..edc3a74476 100644 --- a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -363,11 +363,11 @@ public class IssueServiceImpl implements IssueService { } else { List topicDetails = topicDetailsResult.getData(); HashMap rtm = convertTopicDetailList2Map(topicDetails); - resultList.stream().forEach(vi -> { + resultList.forEach(vi -> { ResiTopicDetailResultDTO rr = rtm.get(vi.getSourceId()); vi.setTopicImgs(rr == null ? null : rr.getTopicImgs()); vi.setTopicVoices(rr == null ? null : rr.getTopicImgs()); - vi.setTopicContent(rr.getTopicContent()); + vi.setTopicContent(rr == null ? "" : rr.getTopicContent()); }); } @@ -421,11 +421,13 @@ public class IssueServiceImpl implements IssueService { } else { List topicDetails = topicDetailsResult.getData(); HashMap rtm = convertTopicDetailList2Map(topicDetails); - votingIssueList.stream().forEach(vi -> { + votingIssueList.forEach(vi -> { ResiTopicDetailResultDTO rr = rtm.get(vi.getSourceId()); vi.setTopicImgs(rr == null ? null : rr.getTopicImgs()); vi.setTopicVoices(rr == null ? null : rr.getTopicImgs()); - vi.setTopicContent(rr.getTopicContent()); + vi.setTopicContent(rr == null ? "" : rr.getTopicContent()); + vi.setLongitude(rr == null ? "" : rr.getLongitude()); + vi.setLatitude(rr == null ? "" : rr.getLatitude()); }); } } @@ -459,11 +461,13 @@ public class IssueServiceImpl implements IssueService { } else { List topicDetails = topicDetailsResult.getData(); HashMap rtm = convertTopicDetailList2Map(topicDetails); - issueList.stream().forEach(vi -> { + issueList.forEach(vi -> { ResiTopicDetailResultDTO rr = rtm.get(vi.getSourceId()); vi.setTopicImgs(rr == null ? null : rr.getTopicImgs()); vi.setTopicVoices(rr == null ? null : rr.getTopicImgs()); - vi.setTopicContent(rr.getTopicContent()); + vi.setTopicContent(rr == null ? "" :rr.getTopicContent()); + vi.setLongitude(rr == null ? "" : rr.getLongitude()); + vi.setLatitude(rr == null ? "" : rr.getLatitude()); }); } } @@ -500,6 +504,8 @@ public class IssueServiceImpl implements IssueService { vi.setTopicImgs(rr == null ? new ArrayList<>() : rr.getTopicImgs()); vi.setTopicVoices(rr == null ? new ArrayList<>() : rr.getTopicImgs()); vi.setTopicContent(rr == null ? "" : rr.getTopicContent()); + vi.setLongitude(rr == null ? "" : rr.getLongitude()); + vi.setLatitude(rr == null ? "" : rr.getLatitude()); }); } @@ -535,6 +541,8 @@ public class IssueServiceImpl implements IssueService { vi.setTopicImgs(rr == null ? new ArrayList<>() : rr.getTopicImgs()); vi.setTopicVoices(rr == null ? new ArrayList<>() : rr.getTopicImgs()); vi.setTopicContent(rr == null ? "" : rr.getTopicContent()); + vi.setLongitude(rr == null ? "" : rr.getLongitude()); + vi.setLatitude(rr == null ? "" : rr.getLatitude()); }); } @@ -570,6 +578,8 @@ public class IssueServiceImpl implements IssueService { vi.setTopicImgs(rr == null ? new ArrayList<>() : rr.getTopicImgs()); vi.setTopicVoices(rr == null ? new ArrayList<>() : rr.getTopicImgs()); vi.setTopicContent(rr == null ? "" : rr.getTopicContent()); + vi.setLongitude(rr == null ? "" : rr.getLongitude()); + vi.setLatitude(rr == null ? "" : rr.getLatitude()); }); } diff --git a/epmet-openapi/epmet-openapi-sdk/src/main/java/com/epmet/openapi/sdk/encrypt/Md5Util.java b/epmet-openapi/epmet-openapi-sdk/src/main/java/com/epmet/openapi/sdk/encrypt/Md5Util.java index a003736c74..25fb36e167 100644 --- a/epmet-openapi/epmet-openapi-sdk/src/main/java/com/epmet/openapi/sdk/encrypt/Md5Util.java +++ b/epmet-openapi/epmet-openapi-sdk/src/main/java/com/epmet/openapi/sdk/encrypt/Md5Util.java @@ -43,16 +43,18 @@ public class Md5Util { private static String byteArrayToHexString(byte[] b) { StringBuffer resultSb = new StringBuffer(); - for (int i = 0; i < b.length; i++) - resultSb.append(byteToHexString(b[i])); + for (int i = 0; i < b.length; i++) { + resultSb.append(byteToHexString(b[i])); + } return resultSb.toString(); } private static String byteToHexString(byte b) { int n = b; - if (n < 0) - n += 256; + if (n < 0) { + n += 256; + } int d1 = n / 16; int d2 = n % 16; return hexDigits[d1] + "" + hexDigits[d2]; @@ -62,12 +64,13 @@ public class Md5Util { String resultString = null; resultString = origin; MessageDigest md = MessageDigest.getInstance("MD5"); - if (charsetname == null || "".equals(charsetname)) - resultString = byteArrayToHexString(md.digest(resultString - .getBytes())); - else - resultString = byteArrayToHexString(md.digest(resultString - .getBytes(charsetname))); + if (charsetname == null || "".equals(charsetname)) { + resultString = byteArrayToHexString(md.digest(resultString + .getBytes())); + } else { + resultString = byteArrayToHexString(md.digest(resultString + .getBytes(charsetname))); + } return resultString; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GridMobileListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GridMobileListFormDTO.java new file mode 100644 index 0000000000..6c2e34a3a9 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GridMobileListFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.form; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; + +/** + * @description: 【事件】网格员服务电话 + * @author: sun + */ +@NoArgsConstructor +@Data +public class GridMobileListFormDTO { + + /** + * 网格Id + */ + @NotBlank(message = "网格Id不能为空", groups = Gridobile.class) + private String gridId; + + public interface Gridobile{} + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ResiVolunteerAuthenticateFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ResiVolunteerAuthenticateFormDTO.java deleted file mode 100644 index 13789fa4cf..0000000000 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ResiVolunteerAuthenticateFormDTO.java +++ /dev/null @@ -1,116 +0,0 @@ -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; - -/** - * 志愿者认证 入参 - * - * @Auther: zhangyong - * @Date: 2020-07-23 09:57 - */ - -@Data -public class ResiVolunteerAuthenticateFormDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - - /** - * 添加用户操作的内部异常分组 - * 出现错误会提示给前端7000错误码,返回信息为:服务器开小差... - */ - - - /** - * 添加用户操作的用户可见异常分组 - * 该分组用于校验需要返回给前端错误信息提示的列,需要继承CustomerClientShowGroup - * 返回错误码为8999,提示信息为DTO中具体的列的校验注解message的内容 - */ - - - - /** - * 用户id - */ - private String userId; - - /** - * 客户id - */ - @NotBlank(message = "客户id不能为空") - private String customerId; - - /** - * 姓 - */ - @NotBlank(message = "姓不能为空") - private String surname; - - /** - * 名 - */ - @NotBlank(message = "名不能为空") - private String name; - - /** - * 性别(1男2女0未知) - */ - @NotBlank(message = "性别不能为空") - private String gender; - - /** - * 手机号 - */ - @NotBlank(message = "手机号不能为空") - private String mobile; - - /** - * 身份证号码 - */ - @NotBlank(message = "身份证号码不能为空") - private String idNum; - - /** - * 街道 - */ - @NotBlank(message = "街道不能为空") - private String street; - - /** - * 小区名 - */ - @NotBlank(message = "小区名不能为空") - private String district; - - /** - * 楼栋单元 - */ - @NotBlank(message = "楼栋单元不能为空") - private String buildingAddress; - - /** - * 志愿者自我介绍 - */ - private String volunteerIntroduce; - - /** - * 昵称 - */ - @NotBlank(message = "昵称不能为空") - private String nickname; - - /** - * 头像 - */ - @NotBlank(message = "头像不能为空") - private String avatarUrl; - - /** - * 志愿者签名 - */ - private String volunteerSignature; -} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserBadgeUnitFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserBadgeUnitFormDTO.java index 124b94b3bd..81b9e7fbfc 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserBadgeUnitFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserBadgeUnitFormDTO.java @@ -34,8 +34,12 @@ public class UserBadgeUnitFormDTO implements Serializable { @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } UserBadgeUnitFormDTO that = (UserBadgeUnitFormDTO) o; return badgeId.equals(that.badgeId) && badgeIcon.equals(that.badgeIcon) && diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VolunteerCommonFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VolunteerCommonFormDTO.java index a2c8dff5a1..1cea3c46c4 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VolunteerCommonFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VolunteerCommonFormDTO.java @@ -23,4 +23,7 @@ public class VolunteerCommonFormDTO { @NotBlank(message = "客户ID不能为空", groups = {GetVolunteerDistribution.class}) private String customerId; + @NotBlank(message = "组织ID不能为空", groups = {GetVolunteerDistribution.class}) + private String agencyId; + } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VolunteerRegResiFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VolunteerRegResiFormDTO.java new file mode 100644 index 0000000000..fc373397da --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VolunteerRegResiFormDTO.java @@ -0,0 +1,103 @@ +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; + +/** + * 认证志愿者时保存/修改用户基础信息+自动注册居民 + * + * @Auther: zhangyong + * @Date: 2020-07-23 09:57 + */ + +@Data +public class VolunteerRegResiFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + public interface AddUserInternalGroup {} + public interface AddUserShowGroup extends CustomerClientShowGroup {} + + /** + * 用户id + */ + @NotBlank(message = "tokenDto中获取userId为空", groups = {AddUserInternalGroup.class }) + private String userId; + + /** + * 客户id + */ + @NotBlank(message = "tokenDto中获取customerId为空", groups = {AddUserInternalGroup.class }) + private String customerId; + + /** + * 姓 + */ + @NotBlank(message = "姓不能为空", groups = {AddUserShowGroup.class }) + private String surname; + + /** + * 名 + */ + @NotBlank(message = "名不能为空", groups = {AddUserShowGroup.class }) + private String name; + + /** + * 性别(1男2女0未知) + */ + @NotBlank(message = "性别不能为空", groups = {AddUserShowGroup.class }) + private String gender; + + /** + * 手机号 + */ + @NotBlank(message = "手机号不能为空", groups = {AddUserShowGroup.class }) + private String mobile; + + /** + * 身份证号码 + */ + @NotBlank(message = "身份证号码不能为空", groups = {AddUserShowGroup.class }) + private String idNum; + + /** + * 街道 + */ + @NotBlank(message = "居住地址:街道不能为空", groups = {AddUserShowGroup.class }) + private String street; + + /** + * 小区名 + */ + @NotBlank(message = "居住地址:小区名不能为空", groups = {AddUserShowGroup.class }) + private String district; + + /** + * 楼栋单元 + */ + @NotBlank(message = "居住地址:楼栋单元不能为空", groups = {AddUserShowGroup.class }) + private String buildingAddress; + + /** + * 昵称 + */ + @NotBlank(message = "昵称不能为空", groups = {AddUserInternalGroup.class}) + private String nickname; + + /** + * 头像 + */ + @NotBlank(message = "头像不能为空", groups = {AddUserInternalGroup.class}) + private String avatarUrl; + + /** + * 志愿者注册,所在网格ID + */ + @NotBlank(message = "网格ID不能为空", groups = {AddUserShowGroup.class }) + private String gridId; + private String pid; + private String pids; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GridMobileListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GridMobileListResultDTO.java new file mode 100644 index 0000000000..080f4709b8 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GridMobileListResultDTO.java @@ -0,0 +1,66 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.util.List; + +/** + * @description: 【事件】网格员服务电话 + * @author: sun + */ +@Data +public class GridMobileListResultDTO { + /** + * 网格Id + */ + private String gridId; + + /** + * 工作人员Id + */ + private String staffId; + + /** + * 人员名称 + */ + private String staffName; + + /** + * 性别 + */ + private String gender; + + /** + * 工作人员头像 + */ + private String staffHeadPhoto; + + /** + * 工作人员头像 + */ + private String mobile; + + /** + * 人员角色列表 + */ + private List roleList; + + @Data + public static class Role { + /** + * 工作人员Id + */ + @JsonIgnore + private String staffId; + /** + * 角色Id + */ + private String roleId; + + /** + * 角色名称 + */ + private String roleName; + } +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoOnEnterGridResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoOnEnterGridResultDTO.java index 3561cb4060..e8bff9cd33 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoOnEnterGridResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoOnEnterGridResultDTO.java @@ -30,6 +30,16 @@ public class UserInfoOnEnterGridResultDTO implements Serializable{ * */ private String currentGridId; + /** + * 网格经度【没值则去客户跟组织的值】 + */ + private String longitude; + + /** + * 网格纬度【没值则去客户跟组织的值】 + */ + private String latitude; + /** * 当前网格名称 * */ diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserResiInfoResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserResiInfoResultDTO.java index c5482e05ba..a4be7e8745 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserResiInfoResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserResiInfoResultDTO.java @@ -58,4 +58,5 @@ public class UserResiInfoResultDTO implements Serializable { private String headPhoto; private String nickName; + private String realName; } 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 45e8ee383e..9c57423628 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 @@ -24,7 +24,7 @@ import java.util.Set; * @author yinzuomei@elink-cn.com * @date 2020/6/4 13:09 */ -//@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class, url = "localhost:8087") +// @FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class, url = "localhost:8087") @FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class) public interface EpmetUserOpenFeignClient { @@ -242,14 +242,14 @@ public interface EpmetUserOpenFeignClient { Result selectUserBaseInfo(@RequestBody TokenDto tokenDTO); /** - * @Description 认证志愿者时保存/修改用户基础信息 + * @Description 认证志愿者时保存/修改用户基础信息+自动注册居民 * @param param * @return * @author wangc * @date 2020.07.31 09:38 **/ - @PostMapping("/epmetuser/userbaseinfo/volunteerbaseinfo") - Result volunteerBaseInfo(@RequestBody ResiVolunteerAuthenticateFormDTO param); + @PostMapping("/epmetuser/userbaseinfo/volunteerautoregresi") + Result volunteerAutoRegResi(@RequestBody VolunteerRegResiFormDTO param); /** * @return @@ -690,4 +690,22 @@ public interface EpmetUserOpenFeignClient { */ @PostMapping(value = "/epmetuser/patrolroutinework/selectList") Result> getPatrolRoutineWorkList(@RequestBody PatrolQueryFormDTO patrolQueryFormDTO); + + /** + * 获取ic_resi_user + * @param icResiUserId + * @return + */ + @PostMapping(value = "/epmetuser/icresiuser/geticresiuser/{icResiUserId}") + Result getIcResiUserDTO(@PathVariable("icResiUserId") String icResiUserId); + + /** + * @Description 查询居民注册关系 + * @param userId + * @author zxc + * @date 2021/12/30 3:12 下午 + */ + @PostMapping("/epmetuser/userbaseinfo/resirelationinfo") + Result resiRelationInfo(@RequestParam("userId")String userId); + } 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 df25d4f4a9..b434b30806 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 @@ -175,8 +175,8 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien } @Override - public Result volunteerBaseInfo(ResiVolunteerAuthenticateFormDTO param) { - return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "volunteerBaseInfo", param); + public Result volunteerAutoRegResi(VolunteerRegResiFormDTO param) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "volunteerAutoRegResi", param); } @Override @@ -512,4 +512,14 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result> getPatrolRoutineWorkList(PatrolQueryFormDTO patrolQueryFormDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getPatrolRoutineWorkList", patrolQueryFormDTO); } + + @Override + public Result getIcResiUserDTO(String icResiUserId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getIcResiUserDTO", icResiUserId); + } + + @Override + public Result resiRelationInfo(String userId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "resiRelationInfo", userId); + } } 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 4be5398b9e..60e935497e 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 @@ -479,5 +479,15 @@ public class CustomerStaffController { return new Result>().ok(customerStaffService.getByRealNames(formDTO)); } + /** + * @Author sun + * @Description 【事件】网格员服务电话 + **/ + @PostMapping(value = "gridmobilelist") + public Result> gridMobileList(@LoginUser TokenDto tokenDto, @RequestBody GridMobileListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GridMobileListFormDTO.Gridobile.class); + return new Result>().ok(customerStaffService.gridMobileList(formDTO.getGridId(), tokenDto.getUserId())); + } + } 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 e170e5a63d..395a5d40b9 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 @@ -627,4 +627,17 @@ public class IcResiUserController { IcResiUserBriefDTO r = icResiUserService.getResiBrief(resiUserId, customerId); return new Result().ok(r); } + + /** + * 获取ic_resi_user + * @param icResiUserId + * @return + */ + @PostMapping("geticresiuser/{icResiUserId}") + public Result getIcResiUserDTO(@PathVariable("icResiUserId") String icResiUserId){ + if(StringUtils.isNotBlank(icResiUserId)){ + return new Result().ok(icResiUserService.get(icResiUserId)); + } + return new Result<>(); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java index d8d9d969f3..adc98f7a08 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java @@ -27,10 +27,11 @@ 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.RegisterRelationDTO; import com.epmet.dto.UserBaseInfoDTO; import com.epmet.dto.form.CommonUserIdFormDTO; import com.epmet.dto.form.IssueInitiatorFormDTO; -import com.epmet.dto.form.ResiVolunteerAuthenticateFormDTO; +import com.epmet.dto.form.VolunteerRegResiFormDTO; import com.epmet.dto.result.CustomerUserDetailResultDTO; import com.epmet.dto.result.ExtUserInfoResultDTO; import com.epmet.dto.result.ResiUserBaseInfoResultDTO; @@ -166,16 +167,16 @@ public class UserBaseInfoController { } /** - * @Description 认证志愿者时保存/修改用户基础信息 + * @Description 认证志愿者时保存/修改用户基础信息+自动注册居民 * @param param * @return * @author wangc * @date 2020.07.31 09:38 **/ - @PostMapping("volunteerbaseinfo") - public Result volunteerBaseInfo(@RequestBody ResiVolunteerAuthenticateFormDTO param){ - userBaseInfoService.saveUserBaseInfoWhenAuthVolunteer(param); - return new Result(); + @PostMapping("volunteerautoregresi") + public Result volunteerAutoRegResi(@RequestBody VolunteerRegResiFormDTO param){ + ValidatorUtils.validateEntity(param,VolunteerRegResiFormDTO.AddUserShowGroup.class,VolunteerRegResiFormDTO.AddUserInternalGroup.class); + return userBaseInfoService.volunteerAutoRegResi(param); } /** @@ -203,5 +204,16 @@ public class UserBaseInfoController { ValidatorUtils.validateEntity(param, CommonUserIdFormDTO.CommonUserIdGroup.class); return new Result().ok(userBaseInfoService.extUserInfo(param)); } + + /** + * @Description 查询居民注册关系 + * @param userId + * @author zxc + * @date 2021/12/30 3:12 下午 + */ + @PostMapping("resirelationinfo") + public Result resiRelationInfo(@RequestParam("userId")String userId){ + return new Result().ok(userBaseInfoService.resiRelationInfo(userId)); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/VolunteerController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/VolunteerController.java index aedfe54e49..51e5020b31 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/VolunteerController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/VolunteerController.java @@ -40,8 +40,9 @@ public class VolunteerController { ValidatorUtils.validateEntity(input, VolunteerCommonFormDTO.GetVolunteerDistribution.class); String customerId = input.getCustomerId(); + String agencyId = input.getAgencyId(); - VolunteerDistributionResultDTO r = volunteerService.getVolunteerDistributionAndLegends(customerId); + VolunteerDistributionResultDTO r = volunteerService.getVolunteerDistributionAndLegends(customerId, agencyId); return new Result().ok(r); } 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 d0ce82f757..f877b1e50b 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 @@ -127,7 +127,7 @@ public interface CustomerStaffDao extends BaseDao { * @Author sun * @Description 根据staffId集合查询工作人员基础信息 **/ - List selectStaffByIds(@Param("staffIdList") List staffIdList); + List selectStaffByIds(@Param("staffIdList") List staffIdList); /** * @param staffId @@ -221,4 +221,10 @@ public interface CustomerStaffDao extends BaseDao { * @Description 根据工作人员姓名批量查询基础信息数据 **/ List getByRealNames(GetByRealNamesFormDTO formDTO); + + /** + * @Author sun + * @Description 工作人员基本信息 + **/ + List gridStaffMobileList(List staffIdList); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RegisterRelationDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RegisterRelationDao.java index 160e1a4afc..480c8b52fa 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RegisterRelationDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RegisterRelationDao.java @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.RegisterRelationDTO; import com.epmet.entity.RegisterRelationEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -55,4 +56,12 @@ public interface RegisterRelationDao extends BaseDao { * @date 2021/3/16 下午3:05 */ String selectRegisterGridIdByUserId(@Param("userId")String userId); + + /** + * @Description 居民注册关系 + * @param userId + * @author zxc + * @date 2021/12/30 3:14 下午 + */ + RegisterRelationDTO resiRelationInfo(@Param("userId")String userId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java index 876634717b..31e6591d92 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java @@ -163,4 +163,10 @@ public interface StaffRoleDao extends BaseDao { * @date 2021/8/19 11:16 上午 */ Set selectRoleStaffIds(@Param("customerId") String customerId,@Param("roleIds") Set roleIds); + + /** + * @Author sun + * @Description 【事件】网格员服务电话 + **/ + List staffRoleList(@Param("staffIds") List staffIds); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java index 0ffa41aaa0..ba05ebd830 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java @@ -110,10 +110,14 @@ public class UserBadgeRedis { public List obtainUserBadge2List(String userId,String customerId) { List cache = redisUtils.lrange(RedisKeys.getResiUserBadgeKey(customerId, userId), NumConstant.ZERO, NumConstant.ONE_NEG, UserBadgeUnitFormDTO.class); - if(!CollectionUtils.isEmpty(cache)) return cache; + if(!CollectionUtils.isEmpty(cache)) { + return cache; + } //补偿 cache = badgeService.getUserSortedBadge(userId,customerId); - if(CollectionUtils.isEmpty(cache)) return cache; + if(CollectionUtils.isEmpty(cache)) { + return cache; + } final List sortedBadges = cache; redisTemplate.executePipelined((RedisCallback>) connection ->{ sortedBadges.forEach(badge -> { @@ -135,7 +139,9 @@ public class UserBadgeRedis { * @date 2020.11.10 15:00 */ public Map> batchObtainUserBadge(String customerId,List userIds){ - if(CollectionUtils.isEmpty(userIds)) return Collections.EMPTY_MAP; + if(CollectionUtils.isEmpty(userIds)) { + return Collections.EMPTY_MAP; + } Map> result = new HashMap<>(); //存放缓存为空的 List cacheBlank = new LinkedList<>(); @@ -177,7 +183,9 @@ public class UserBadgeRedis { * @date 2020.11.05 13:37 */ public long pushOrRemoveUserBadge4List(String userId, String badgeId, String customerId) { - if(StringUtils.isNotBlank(userId)) return illumeOrExtinguishStronglyConsistent(userId,customerId); + if(StringUtils.isNotBlank(userId)) { + return illumeOrExtinguishStronglyConsistent(userId,customerId); + } List orient = redisUtils.lrange(RedisKeys.getResiUserBadgeKey(customerId, userId), NumConstant.ZERO, NumConstant.ONE_NEG, UserBadgeUnitFormDTO.class); UserBadgeUnitFormDTO unit = null; @@ -203,8 +211,11 @@ public class UserBadgeRedis { if (null == unit) { Optional poolOpt = badgePool.stream().filter(badge -> StringUtils.equals(badge.getBadgeId(), badgeId)).findFirst(); - if (poolOpt.isPresent()) unit = ConvertUtils.sourceToTarget(poolOpt.get(), UserBadgeUnitFormDTO.class); - else return NumConstant.ZERO; + if (poolOpt.isPresent()) { + unit = ConvertUtils.sourceToTarget(poolOpt.get(), UserBadgeUnitFormDTO.class); + } else { + return NumConstant.ZERO; + } } redisUtils.leftPush(RedisKeys.getResiUserBadgeKey(customerId, userId), unit, -1); return NumConstant.ONE; @@ -241,7 +252,9 @@ public class UserBadgeRedis { */ public void batchClearUserBadgeCache(String customerId){ Set key = redisUtils.keys(RedisKeys.getResiUserBadgeKey(customerId, null)); - if(CollectionUtils.isEmpty(key)) return; + if(CollectionUtils.isEmpty(key)) { + return; + } final Set keys = key; redisTemplate.executePipelined((RedisCallback) connection ->{ keys.forEach( ser -> {connection.del(redisTemplate.getKeySerializer().serialize(ser));}); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java index aaee53101c..435b99f213 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java @@ -79,7 +79,9 @@ public class UserBaseInfoRedis { * @date 2020.07.23 14:43 **/ public void set(UserBaseInfoResultDTO baseInfo){ - if(StringUtils.isBlank(baseInfo.getUserId())) return; + if(StringUtils.isBlank(baseInfo.getUserId())) { + return; + } String key = RedisKeys.getResiUserKey(baseInfo.getUserId()); //bean to map Map map = BeanUtil.beanToMap(baseInfo, false, true); @@ -289,7 +291,9 @@ public class UserBaseInfoRedis { * @date 2020.07.30 14:07 **/ public void updateUserCache(UserBaseInfoEntity entity){ - if(null == entity || StringUtils.isBlank(entity.getUserId())) return; + if(null == entity || StringUtils.isBlank(entity.getUserId())) { + return; + } UserBaseInfoResultDTO currentCache = ConvertUtils.sourceToTarget(entity,UserBaseInfoResultDTO.class); @@ -314,7 +318,9 @@ public class UserBaseInfoRedis { && StringUtils.isNotBlank(gridResult.getData().getBelongsGridName())) { String gridFullName = gridResult.getData().getBelongsGridName(); currentCache.setRegisteredGridName(gridFullName); - if (StringUtils.isBlank(currentCache.getGender())) currentCache.setGender(NumConstant.ZERO_STR); + if (StringUtils.isBlank(currentCache.getGender())) { + currentCache.setGender(NumConstant.ZERO_STR); + } if (StringUtils.isNotBlank(currentCache.getNickname())) { StringBuffer buffer = new StringBuffer(gridFullName.split(ModuleConstant.DASH)[NumConstant.ONE]).append(ModuleConstant.DASH).append(currentCache.getSurname()); switch (currentCache.getGender()) { @@ -370,10 +376,12 @@ public class UserBaseInfoRedis { } public void mergeObject(T origin, T destination) { - if (origin == null || destination == null) + if (origin == null || destination == null) { return; - if (!origin.getClass().equals(destination.getClass())) + } + if (!origin.getClass().equals(destination.getClass())) { return; + } Field[] fields = origin.getClass().getDeclaredFields(); for (int i = 0; i < fields.length; i++) { 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 08916bfcc8..e986aa8f07 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 @@ -341,4 +341,10 @@ public interface CustomerStaffService extends BaseService { * @Description 根据工作人员姓名批量查询基础信息数据 **/ List getByRealNames(GetByRealNamesFormDTO formDTO); + + /** + * @Author sun + * @Description 【事件】网格员服务电话 + **/ + List gridMobileList(String gridId, String userId); } 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 787c54bdc3..16d2aaf0d9 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 @@ -192,4 +192,11 @@ public interface IcResiUserService extends BaseService { PageData getPartyMemberEducationList(PartyMemberListFormDTO formDTO); IcResiUserBriefDTO getResiBrief(String resiUserId, String customerId); + + /** + * 获取居民主表记录 + * @param icResiUserId + * @return + */ + IcResiUserDTO get(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 b5ca38d3ed..01bac74fc2 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 @@ -20,9 +20,10 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.RegisterRelationDTO; import com.epmet.dto.UserBaseInfoDTO; import com.epmet.dto.form.CommonUserIdFormDTO; -import com.epmet.dto.form.ResiVolunteerAuthenticateFormDTO; +import com.epmet.dto.form.VolunteerRegResiFormDTO; import com.epmet.dto.result.CustomerUserDetailResultDTO; import com.epmet.dto.result.ExtUserInfoResultDTO; import com.epmet.dto.result.ResiUserBaseInfoResultDTO; @@ -164,13 +165,13 @@ public interface UserBaseInfoService extends BaseService { Result selecUserBaseInfoByUserId(String userId); /** - * @Description 认证志愿者时保存/修改用户基础信息 + * @Description 认证志愿者时保存/修改用户基础信息+自动注册居民 * @param param * @return * @author wangc * @date 2020.07.31 09:38 **/ - void saveUserBaseInfoWhenAuthVolunteer(ResiVolunteerAuthenticateFormDTO param); + Result volunteerAutoRegResi(VolunteerRegResiFormDTO param); /** * @Description 清除用户缓存信息 @@ -194,4 +195,12 @@ public interface UserBaseInfoService extends BaseService { @Deprecated Integer checkIdNum(String idNum, String customerId, String excludeUserId); + + /** + * @Description 查询居民注册关系 + * @param userId + * @author zxc + * @date 2021/12/30 3:12 下午 + */ + RegisterRelationDTO resiRelationInfo(String userId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserResiInfoService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserResiInfoService.java index 30b73bd794..1334034ebd 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserResiInfoService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserResiInfoService.java @@ -115,6 +115,14 @@ public interface UserResiInfoService extends BaseService { */ Result submit(UserResiInfoDTO userResiInfoDTO); + /** + * 自动认证居民:志愿者注册,自动认证居民 + * + * @param userResiInfoDTO + * @return + */ + Result autoRegResi(UserResiInfoDTO userResiInfoDTO); + /** * 居民端-居民注册根据手机号获取验证码 * diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/VolunteerService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/VolunteerService.java index cd87cf7dd5..cab57d3c00 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/VolunteerService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/VolunteerService.java @@ -10,6 +10,6 @@ import com.epmet.dto.result.VolunteerDistributionResultDTO; */ public interface VolunteerService { - VolunteerDistributionResultDTO getVolunteerDistributionAndLegends(String customerId); + VolunteerDistributionResultDTO getVolunteerDistributionAndLegends(String customerId, String agencyId); } 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 e97ba4e662..418b9dfbc6 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 @@ -799,4 +799,49 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl gridMobileList(String gridId, String userId) { + List resultList = new ArrayList<>(); + //1.查询网格下工作人员列表 + CommonGridIdFormDTO dto = new CommonGridIdFormDTO(); + dto.setGridId(gridId); + dto.setUserId(userId); + Result> gridStaffs = govOrgOpenFeignClient.getGridStaffs(dto); + if (!gridStaffs.success()) { + throw new RenException("获取网格下工作人员列表失败!"); + } + if (gridStaffs.getData().size() < NumConstant.ONE) { + return resultList; + } + + //2.查询工作人员中拥有网格长网格员角色的人员列表 + List staffRoleList = staffRoleDao.staffRoleList(gridStaffs.getData()); + + //3.查询工作人员基础信息 + List staffIdList = staffRoleList.stream().map(GridMobileListResultDTO.Role::getStaffId).collect(Collectors.toList()); + staffIdList = staffIdList.stream().distinct().collect(Collectors.toList()); + List list = baseDao.selectStaffByIds(staffIdList); + + //4.封装数据并返回 + resultList = ConvertUtils.sourceToTarget(list, GridMobileListResultDTO.class); + List roleList = null; + for (GridMobileListResultDTO re : resultList) { + roleList = new ArrayList<>(); + for (GridMobileListResultDTO.Role r : staffRoleList) { + if (re.getStaffId().equals(r.getStaffId())) { + GridMobileListResultDTO.Role role = ConvertUtils.sourceToTarget(r, GridMobileListResultDTO.Role.class); + roleList.add(role); + } + } + re.setGridId(gridId); + re.setRoleList(roleList); + } + + return resultList; + } + } 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 62af9502bb..bc787d1d67 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 @@ -937,6 +937,12 @@ public class IcResiUserServiceImpl extends BaseServiceImpl> getBatchUserSortedBadge(String customerId, List userIds) { List badges = userBadgeDao.selectBatchUserSortedBadge(customerId, userIds); - if (CollectionUtils.isEmpty(badges)) return Collections.EMPTY_MAP; + if (CollectionUtils.isEmpty(badges)) { + return Collections.EMPTY_MAP; + } return badges.stream().collect(Collectors.groupingBy(UserBadgeInfoResultDTO::getUserId)); } 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 5dd7677665..898a7735d2 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 @@ -21,6 +21,7 @@ import com.alibaba.fastjson.JSON; 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.AppClientConstant; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; @@ -29,12 +30,13 @@ 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.*; +import com.epmet.dto.RegisterRelationDTO; import com.epmet.dto.UserBaseInfoDTO; import com.epmet.dto.UserResiInfoDTO; import com.epmet.dto.UserWechatDTO; import com.epmet.dto.form.CommonUserIdFormDTO; -import com.epmet.dto.form.ResiVolunteerAuthenticateFormDTO; import com.epmet.dto.form.UserRoleFormDTO; +import com.epmet.dto.form.VolunteerRegResiFormDTO; import com.epmet.dto.result.*; import com.epmet.entity.UserBaseInfoEntity; import com.epmet.entity.UserWechatEntity; @@ -44,6 +46,7 @@ import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient; import com.epmet.service.RegisterRelationService; import com.epmet.service.UserBaseInfoService; +import com.epmet.service.UserResiInfoService; import com.epmet.util.ModuleConstant; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; @@ -82,6 +85,10 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl page(Map params) { @@ -345,26 +352,55 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl ids) { - if(null == ids || ids.isEmpty()) return; + if(null == ids || ids.isEmpty()) { + return; + } userBaseInfoRedis.clearUserCache(ids); } @@ -455,4 +493,15 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl implem UserBaseInfoEntity baseInfo = new UserBaseInfoEntity(); //UserBaseInfoResultDTO cache = userBaseInfoRedis.get(wxUserInfoFormDTO.getUserId()); - UserResiInfoDTO resiInfo = userResiInfoDao.selectByUserId(wxUserInfoFormDTO.getUserId()); + // 以下这段注释于21.12.22,只更新微信相关信息就可以 + /* UserResiInfoDTO resiInfo = userResiInfoDao.selectByUserId(wxUserInfoFormDTO.getUserId()); if(null != resiInfo && StringUtils.isNotBlank((resiInfo.getId()))) { baseInfo.setSurname(resiInfo.getSurname()); baseInfo.setName(resiInfo.getName()); @@ -152,7 +153,7 @@ public class UserServiceImpl extends BaseServiceImpl implem baseInfo.setDistrict(resiInfo.getDistrict()); baseInfo.setBuildingAddress(resiInfo.getBuildingAddress()); baseInfo.setMobile(resiInfo.getRegMobile()); - } + }*/ @@ -203,7 +204,9 @@ public class UserServiceImpl extends BaseServiceImpl implem if(gridResult.success() && null != gridResult.getData() && null != gridResult.getData().getGridName()){ result.setRegisterGridName(gridResult.getData().getGridName()); }else { - if (StringUtils.isNotBlank(gridResult.getMsg())) log.warn(gridResult.getMsg()); + if (StringUtils.isNotBlank(gridResult.getMsg())) { + log.warn(gridResult.getMsg()); + } } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/VolunteerServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/VolunteerServiceImpl.java index 238b70cc41..a25f7d2ad7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/VolunteerServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/VolunteerServiceImpl.java @@ -60,10 +60,10 @@ public class VolunteerServiceImpl implements VolunteerService, ResultDataResolve * @return */ @Override - public VolunteerDistributionResultDTO getVolunteerDistributionAndLegends(String customerId) { + public VolunteerDistributionResultDTO getVolunteerDistributionAndLegends(String customerId, String agencyId) { // 1.查询分布 - VolunteerDistributionResultDTO volunteerDistribution = getVolunteerDistribution(customerId); + VolunteerDistributionResultDTO volunteerDistribution = getVolunteerDistribution(customerId, agencyId); // 2.补充图例 IcFormOptionsQueryFormDTO optionsForm = new IcFormOptionsQueryFormDTO(); @@ -95,7 +95,7 @@ public class VolunteerServiceImpl implements VolunteerService, ResultDataResolve * @param customerId * @return */ - public VolunteerDistributionResultDTO getVolunteerDistribution(String customerId) { + public VolunteerDistributionResultDTO getVolunteerDistribution(String customerId, String agencyId) { VolunteerDistributionResultDTO r = new VolunteerDistributionResultDTO(); // 1.==========分页查询出所有志愿者列表========== @@ -103,12 +103,13 @@ public class VolunteerServiceImpl implements VolunteerService, ResultDataResolve String vcErrorMsg = "【志愿者分布】查询志愿者总数出错"; VolunteerCommonFormDTO volunteerCountForm = new VolunteerCommonFormDTO(); volunteerCountForm.setCustomerId(customerId); + volunteerCountForm.setAgencyId(agencyId); Integer volunteerCount = getResultDataOrThrowsException(epmetHeartOpenFeignClient.getVolunteerCount(volunteerCountForm), ServiceConstant.EPMET_HEART_SERVER, EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), vcErrorMsg, vcErrorMsg); - + if (volunteerCount == null || volunteerCount == 0) { // 没得志愿者,直接返回 return r; @@ -125,12 +126,12 @@ public class VolunteerServiceImpl implements VolunteerService, ResultDataResolve // 分页查询志愿者的epmet user id List>> volsPageFutures = new ArrayList<>(); - + for (int pageNo = 1 ; pageNo <= pageCount ; pageNo ++) { - + int pageNoTemp = pageNo; CompletableFuture> future = CompletableFuture.supplyAsync(() -> { - return listVolunteersByPage(customerId, pageNoTemp, pageSize) + return listVolunteersByPage(customerId, agencyId, pageNoTemp, pageSize) .stream() .map(v -> v.getUserId()) .collect(Collectors.toSet()); @@ -149,17 +150,17 @@ public class VolunteerServiceImpl implements VolunteerService, ResultDataResolve log.error("【志愿者分布】异步获取志愿者userId列表失败:{}", ExceptionUtils.getErrorStackTrace(e)); } } - + log.info("【志愿者分布】查询到志愿者userId公{}个", volunteerEpmetUserIds.size()); - + // 2.==========异步填充ic居民信息========== List>> volResiInfoFutures = new ArrayList<>(); - + // 将所有的userId按100固定分割成多个部分,循环用每个部分去查询,然后填充 List> volunteerEpmetUserIdParts = Lists.partition(volunteerEpmetUserIds, 100); for (List volunteerEpmetUserIdPart : volunteerEpmetUserIdParts) { - + log.info("【志愿者分布】查询ic居民信息,切割后,本组的userId个数:{}", volunteerEpmetUserIdPart.size()); CompletableFuture> future = CompletableFuture.supplyAsync(() -> { @@ -222,7 +223,7 @@ public class VolunteerServiceImpl implements VolunteerService, ResultDataResolve }); } - + return icResiInfos; } @@ -233,9 +234,10 @@ public class VolunteerServiceImpl implements VolunteerService, ResultDataResolve * @param pageSize * @return */ - private List listVolunteersByPage(String customerId, Integer pageNo, Integer pageSize) { + private List listVolunteersByPage(String customerId, String agencyId, Integer pageNo, Integer pageSize) { VolunteerCommonFormDTO volunteerForm = new VolunteerCommonFormDTO(); volunteerForm.setCustomerId(customerId); + volunteerForm.setAgencyId(agencyId); volunteerForm.setPageNo(pageNo); volunteerForm.setPageSize(pageSize); @@ -246,4 +248,5 @@ public class VolunteerServiceImpl implements VolunteerService, ResultDataResolve errorMsg, errorMsg); } + } 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 37c1b545c0..f441f419af 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 @@ -451,5 +451,6 @@ #{name} + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/RegisterRelationDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/RegisterRelationDao.xml index f6e9b17e34..74c1691615 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/RegisterRelationDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/RegisterRelationDao.xml @@ -82,5 +82,10 @@ SELECT GRID_ID FROM register_relation WHERE DEL_FLAG = 0 and USER_ID = #{userId} + + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml index 05ce74c660..edb8b4e4a4 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml @@ -253,4 +253,23 @@ + + + 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 93cb1fc7a4..102f9611ac 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 @@ -106,6 +106,7 @@ uri.DEL_FLAG = '0' AND uri.REG_MOBILE = #{regMobile,jdbcType=VARCHAR} AND uc.CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} + AND uri.CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND uc.IS_REGISTER = 1 @@ -113,7 +114,7 @@