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..803b801402 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 @@ -93,7 +93,8 @@ public enum EpmetErrorCode { DEMAND_CAN_NOT_UPDATE(8223,"当前状态,不可更新需求"), DEMAND_NOT_EXITS(8224,"需求不存在"), DEMAND_SERVICE_NOT_EXITS(8225,"服务记录不存在"), - + DEMAND_CAN_NOT_TAKE_ORDER(8226, "当前状态,不可接单"), + DEMAND_CAN_NOT_EVALUATE(8227, "当前状态,不可评价"), REQUIRE_PERMISSION(8301, "您没有足够的操作权限"), THIRD_PLAT_REQUEST_ERROR(8302, "请求第三方平台错误"), 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-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 - select * + select CUSTOMER_ID CUSTOMER_ID, + DATE_ID DATE_ID, + sum(VOLUNTEER_TOTAL) VOLUNTEER_TOTAL, + sum(PARTY_TOTAL) PARTY_TOTAL, + sum(RESI_TOTAL) RESI_TOTAL, + sum(SERVICE_TOTAL) SERVICE_TOTAL, + sum(PARTY_SERVICE_TOTAL) PARTY_SERVICE_TOTAL, + sum(RESI_SERVICE_TOTAL) RESI_SERVICE_TOTAL from fact_volunteer_service_daily where DEL_FLAG = 0 and CUSTOMER_ID = #{customerId} + and PIDS like CONCAT(#{agencyPids}, "%") + group by CUSTOMER_ID, DATE_ID order by DATE_ID desc - limit 1 + limit 1 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/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/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-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/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/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..1a0a5d28f2 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/EvaluateDemandFormDTO.java @@ -0,0 +1,44 @@ +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; +} 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..68424240b1 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 @@ -2,6 +2,7 @@ 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; @@ -16,27 +17,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 +50,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/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/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..9a5e2fdc7f 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,使用PIDS like,查询该组织下所有志愿者,注意,是like 'agencyId:%' + */ + private String superiorAgencyId; + private Integer pageNo = 0; private Integer pageSize = 20; 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..5a71625cac --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandDetailResDTO.java @@ -0,0 +1,100 @@ +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 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; + + /** + * 实际服务开始时间 + */ + @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; +} 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/DemandRecResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java index e7b673d22f..6a6c5145f1 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,14 @@ public class DemandRecResultDTO implements Serializable { private String icResiUserId; private String epmetUserId; + + /** + * 奖励积分 + */ + private Integer awardPoint; + + /** + * 服务地点 + */ + private String serviceAddress; } 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..db0bff7f8d 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 @@ -10,6 +10,8 @@ import java.io.Serializable; */ @Data public class FinishResultDTO implements Serializable { - private Boolean sendCalStatisfaction; - private String partyUnitId; + private String serverId; + private String serviceType; + private Boolean grantPoint; + private Integer awardPoint; } 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/feign/EpmetHeartOpenFeignClient.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java index 4bad8f25d7..a21cccb8f3 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 @@ -23,6 +23,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 { /** 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..0d747cb8cb 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 @@ -35,7 +35,7 @@ public interface UserDemandConstant { /** - * 创建需求: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,9 @@ public interface UserDemandConstant { */ String PERSONAL_DATA="personal-data"; String DEMAND_ANALYSIS="demand-analysis"; + + /** + * pc完成情况:完成+评价 + */ + String FINISH_AND_EVALUATE="finish_and_evaluate"; } 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 06c991b31c..31c250bc83 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 @@ -19,6 +19,7 @@ package com.epmet.controller; import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; @@ -29,10 +30,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; @@ -85,7 +82,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 +147,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 +185,22 @@ 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()){ + //如果服务方是区域化党建单位,需要实时去计算他的群众满意度=服务过的需求的评价分数相加➗ 需求的总个数。 + if(UserDemandConstant.PARTY_UNIT.equals(finishResultDTO.getServiceType())){ CalPartyUnitSatisfactionFormDTO mqMsg = new CalPartyUnitSatisfactionFormDTO(); mqMsg.setCustomerId(formDTO.getCustomerId()); - mqMsg.setPartyUnitId(finishResultDTO.getPartyUnitId()); + mqMsg.setPartyUnitId(finishResultDTO.getServerId()); SystemMsgFormDTO form = new SystemMsgFormDTO(); form.setMessageType(SystemMessageType.CAL_PARTY_UNIT_SATISFACTION); form.setContent(mqMsg); epmetMessageOpenFeignClient.sendSystemMsgByMQ(form); + } else if (UserDemandConstant.VOLUNTEER.equals(finishResultDTO.getServiceType()) && finishResultDTO.getAwardPoint() > NumConstant.ZERO) { + // todo + // 志愿者发放积分 } 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..1e5dc8d033 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java @@ -0,0 +1,156 @@ +package com.epmet.controller; + + +import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.form.PageFormDTO; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.constant.SystemMessageType; +import com.epmet.constant.UserDemandConstant; +import com.epmet.dto.form.SystemMsgFormDTO; +import com.epmet.dto.form.demand.*; +import com.epmet.dto.result.demand.DemandDetailResDTO; +import com.epmet.dto.result.demand.DemandHallResultDTO; +import com.epmet.dto.result.demand.FinishResultDTO; +import com.epmet.dto.result.demand.TakeOrderResultDTO; +import com.epmet.feign.EpmetMessageOpenFeignClient; +import com.epmet.service.IcUserDemandRecService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + + +/** + * 居民端-需求相关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; + + /** + * 居民端-需求大厅(未处理、处理中、已完成) + * + * @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 + */ + @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 + */ + @PostMapping("finish") + public Result finish(@LoginUser TokenDto tokenDto, @RequestBody FinishStaffFromDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setType(UserDemandConstant.FINISHED); + formDTO.setUserType(UserDemandConstant.RESI); + ValidatorUtils.validateEntity(formDTO, FinishStaffFromDTO.ResiShowGroup.class, FinishStaffFromDTO.AddUserInternalGroup.class); + icUserDemandRecService.finish(formDTO); + return new Result(); + } + + /** + * 我的需求-服务评价 + * 已经完成的可以评价 + * + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("evaluate") + public Result evaluate(@LoginUser TokenDto tokenDto, @RequestBody EvaluateDemandFormDTO formDTO) { + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO, EvaluateDemandFormDTO.ShowGroup.class, EvaluateDemandFormDTO.AddUserInternalGroup.class); + FinishResultDTO finishResultDTO = icUserDemandRecService.evaluate(formDTO); + //如果服务方是区域化党建单位,需要实时去计算他的群众满意度=服务过的需求的评价分数相加➗ 需求的总个数。 + if (UserDemandConstant.PARTY_UNIT.equals(finishResultDTO.getServiceType())) { + CalPartyUnitSatisfactionFormDTO mqMsg = new CalPartyUnitSatisfactionFormDTO(); + mqMsg.setCustomerId(formDTO.getCustomerId()); + mqMsg.setPartyUnitId(finishResultDTO.getServerId()); + SystemMsgFormDTO form = new SystemMsgFormDTO(); + form.setMessageType(SystemMessageType.CAL_PARTY_UNIT_SATISFACTION); + form.setContent(mqMsg); + epmetMessageOpenFeignClient.sendSystemMsgByMQ(form); + } else if (UserDemandConstant.VOLUNTEER.equals(finishResultDTO.getServiceType()) && finishResultDTO.getAwardPoint() > NumConstant.ZERO) { + // todo + // 志愿者发放积分 + } + return new Result(); + } + + /** + * 我的需求-取消需求 + * 取消,未完成之前都可以取消,pc和居民端小程序内部通用 + * + * @param tokenDto + * @param formDTO + * @return + */ + @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(); + } + + + +} 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 e1d18e5536..842919a3f2 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 superiorAgencyId = input.getSuperiorAgencyId(); + List l = volunteerInfoService.queryVolunteerPage(customerId, pageNo, pageSize, superiorAgencyId); return new Result>().ok(l); } } 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..8142b0c659 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 @@ -66,4 +66,6 @@ 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); } \ 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..c118a2d8b2 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 @@ -86,4 +86,17 @@ public interface IcUserDemandRecDao extends BaseDao { @Param("endDateId") String endDateId); List selectGroupByPartyUnit(@Param("customerId") String customerId, @Param("partyUnitId") String partyUnitId); + + /** + * 居民端-需求大厅(未处理、处理中、已完成) + * 未处理:未指派、未接单;处理中:已指派、已接单给我的 ;已完成:我填写实际服务时间,并点击确认 + * + * @param gridId + * @param type 未处理:unprocessed;处理中:processing;已完成:finished + * @param currentUserId 当前用户自己提出的,不在这展示,在我的需求里面展示 + * @return + */ + List selectListDemandHall(@Param("gridId") String gridId, + @Param("type") String type, + @Param("currentUserId") String currentUserId); } \ No newline at end of file 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/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/service/IcResiDemandDictService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java index 12cbaf7dad..716956d292 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 @@ -119,4 +119,13 @@ public interface IcResiDemandDictService extends BaseService pageList(UserDemandPageFormDTO formDTO); /** - * 未完成之前都可以取消 + * 未完成之前都可以取消,pc和居民端小程序内部通用 * * @param formDTO */ - void cancel(StaffCancelFormDTO formDTO); + void cancel(CancelDemandFormDTO formDTO); /** * 指派 @@ -180,4 +175,33 @@ public interface IcUserDemandRecService extends BaseService groupByPartyUnit(String customerId, String partyUnitId); + + /** + * 居民端-需求大厅(未处理、处理中、已完成) + * @param formDTO + * @return + */ + List listHall(ListHallFormDTO formDTO); + + /** + * 需求大厅-需求详情 + * @param formDTO + * @return + */ + DemandDetailResDTO queryDetailHall(DemandDetailFormDTO formDTO); + + /** + * 需求大厅-我要接单 + * @param formDTO + * @return + */ + TakeOrderResultDTO takeOrder(TakeOrderFormDTO formDTO); + + /** + * 居民端-我的需求-服务评价 + * + * @param formDTO + * @return + */ + FinishResultDTO evaluate(EvaluateDemandFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java index 6a84fb67a1..3df4a76018 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,7 +93,7 @@ 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); + List queryVolunteerPage(String customerId, Integer pageNo, Integer pageSize, String superiorAgencyId); } 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..96ab55a472 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 @@ -258,5 +258,10 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl page(Map params) { @@ -154,6 +154,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(); @@ -197,6 +223,32 @@ 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()) + .concat(houseInfoDTO.getBuildingName()) + .concat(houseInfoDTO.getUnitName()) + .concat(houseInfoDTO.getDoorName())); + insertEntity.setLongitude(houseInfoDTO.getBuildingLongitude()); + insertEntity.setLatitude(houseInfoDTO.getBuildingLatitude()); baseDao.insert(insertEntity); IcUserDemandOperateLogEntity logEntity=new IcUserDemandOperateLogEntity(); logEntity.setCustomerId(fromDTO.getCustomerId()); @@ -330,13 +382,13 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl 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 RenException(EpmetErrorCode.DEMAND_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_NOT_EXITS.getMsg()); + } + if (!UserDemandConstant.PENDING.equals(entity.getStatus())) { + //待处理的才可以抢单 + throw new RenException(EpmetErrorCode.DEMAND_CAN_NOT_TAKE_ORDER.getCode(), EpmetErrorCode.DEMAND_CAN_NOT_TAKE_ORDER.getMsg()); + } + 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(); + } + 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 RenException(EpmetErrorCode.DEMAND_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_NOT_EXITS.getMsg()); + } + if (!UserDemandConstant.FINISHED.equals(entity.getStatus())) { + // 已完成的可以评价 + throw new RenException(EpmetErrorCode.DEMAND_CAN_NOT_EVALUATE.getCode(), EpmetErrorCode.DEMAND_CAN_NOT_EVALUATE.getMsg()); + } + // todo 只有需求人才可以评价 + + // 1、插入评价得分记录 + IcUserDemandSatisfactionEntity satisfactionEntity = ConvertUtils.sourceToTarget(formDTO, IcUserDemandSatisfactionEntity.class); + satisfactionEntity.setEvaluateTime(new Date()); + satisfactionEntity.setUserType(UserDemandConstant.RESI); + demandSatisfactionDao.insert(satisfactionEntity); + + // 2、插入评价操作日志 + IcUserDemandOperateLogEntity evaluateEntity = ConvertUtils.sourceToTarget(formDTO, IcUserDemandOperateLogEntity.class); + evaluateEntity.setActionCode(UserDemandConstant.EVALUATE); + evaluateEntity.setOperateTime(satisfactionEntity.getEvaluateTime()); + evaluateEntity.setUserType(UserDemandConstant.RESI); + 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()); + return finishResultDTO; + } + + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java index ac87cc6b4c..84ee7f16fb 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,33 @@ 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.constant.ServiceConstant; +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.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.enums.EventEnum; 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.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.CustomerGridFormDTO; import com.epmet.dto.form.SendVerificationCodeFormDTO; +import com.epmet.dto.form.VolunteerRegResiFormDTO; import com.epmet.dto.form.resi.ResiSendSmsCodeFormDTO; import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO; import com.epmet.dto.result.ResiUserBaseInfoResultDTO; @@ -50,6 +60,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; @@ -64,6 +75,9 @@ import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Optional; +import java.util.Set; +import java.util.Optional; import java.util.function.Function; import java.util.stream.Collectors; @@ -74,7 +88,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]"; @@ -90,7 +104,11 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl 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); + } + //3、志愿者认证,更新用户基础信息user_base_info+自动注册居民 + VolunteerRegResiFormDTO param = ConvertUtils.sourceToTarget(formDTO, VolunteerRegResiFormDTO.class); + Result regResi=epmetUserOpenFeignClient.volunteerAutoRegResi(param); + if(!regResi.success()){ + logger.warn(String.format("userId:%s,认证志愿者时,自动注册居民失败,返参:%s",formDTO.getUserId(), JSON.toJSONString(regResi))); + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), regResi.getMsg()); + } } private void grantActPoints(ResiVolunteerAuthenticateFormDTO formDTO){ @@ -231,14 +301,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 +357,23 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl queryVolunteerPage(String customerId, Integer pageNo, Integer pageSize) { + public List queryVolunteerPage(String customerId, Integer pageNo, Integer pageSize, String superiorAgencyId) { LambdaQueryWrapper query = new LambdaQueryWrapper<>(); - query.eq(VolunteerInfoEntity::getCustomerId, customerId); + Optional.ofNullable(customerId).ifPresent(cid -> query.eq(VolunteerInfoEntity::getCustomerId, cid)); + Optional.ofNullable(superiorAgencyId).ifPresent(cid -> { + + // 需要查询agency的pids:id,通过这个字符串去匹配志愿者的Pids字段来查询 + String errorMsg = "【分页查询志愿者列表】失败"; + CustomerAgencyDTO agencyInfo = getResultDataOrThrowsException(govOrgOpenFeignClient.getAgencyById(superiorAgencyId), 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(superiorAgencyId); + if (pidsAndAgencyIdPath.startsWith(":")) pidsAndAgencyIdPath = pidsAndAgencyIdPath.replaceFirst(":", ""); + + query.likeRight(VolunteerInfoEntity::getPids, pidsAndAgencyIdPath); + }); PageHelper.startPage(pageNo, pageSize); List volunteerInfoEntities = baseDao.selectList(query); 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..769e943842 --- /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/mapper/IcResiDemandDictDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml index d9d79ecaec..9be81d0e7e 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 @@ -247,4 +247,11 @@ AND m.CUSTOMER_ID = #{customerId} AND m.CATEGORY_CODE = #{categoryCode} + + \ 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..1b6dcab86e 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 @@ -205,7 +205,9 @@ CASE WHEN R.DEMAND_USER_TYPE='mini_resi' THEN R.DEMAND_USER_ID ELSE '' END - ) as epmetUserId + ) as epmetUserId, + r.AWARD_POINT as awardPoint, + concat( r.SERVICE_LOCATION, r.LOCATION_DETAIL ) AS serviceAddress 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' ) @@ -411,4 +413,43 @@ group by s.SERVER_ID + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml index 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/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/UserMessageTypeConstant.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/UserMessageTypeConstant.java index adcea05711..3f4407bce8 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-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/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..a8e323ccfa 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 = '0', + 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/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/CommonIssueListFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/CommonIssueListFormDTO.java index 925551f55c..bebad0de3d 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/CommonIssueListFormDTO.java +++ b/epmet-module/gov-issue/gov-issue-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/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index ce5dafdb9c..111154e6de 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -587,9 +587,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); } @@ -602,9 +600,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); } @@ -1555,15 +1551,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/resources/mapper/IssueDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml index ecc7dd39f0..044de4a3ed 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml @@ -218,8 +218,6 @@ AND ISSUE_STATUS = 'voting' ORDER BY created_time DESC - LIMIT #{pageNo}, - #{pageSize} @@ -239,8 +237,6 @@ AND RESOLVE_TYPE = 'resolved' ORDER BY created_time DESC - LIMIT #{pageNo}, - #{pageSize} + + 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..8ed7d3d378 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', + code AS 'code', + contacts AS 'contacts', + 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..d5c412343d 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 @@ -277,9 +281,13 @@ SELECT ih.ID as homeId, + IFNULL(n.ADDRESS,'') as neighborAddress, ih.NEIGHBOR_HOOD_ID as neighborHoodId, - n.NEIGHBOR_HOOD_NAME as neighborHoodName, + IFNULL(n.NEIGHBOR_HOOD_NAME,'') as neighborHoodName, ih.BUILDING_ID as buildingId, - ib.BUILDING_NAME as buildingName, + IFNULL(ib.BUILDING_NAME,'') as buildingName, ih.BUILDING_UNIT_ID as buildingUnitId, - u.UNIT_NAME as unitName, - ih.DOOR_NAME as doorName, + IFNULL(u.UNIT_NAME,'') as unitName, + IFNULL(ih.DOOR_NAME,'') as doorName, ih.house_type, - ih.HOUSE_NAME + IFNULL(ih.HOUSE_NAME,'') as HOUSE_NAME, + IFNULL(ib.LONGITUDE,'') as buildingLongitude, + IFNULL(ib.LATITUDE,'') as buildingLatitude FROM ic_house ih left JOIN ic_neighbor_hood n ON ( ih.NEIGHBOR_HOOD_ID = n.id ) 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..275a3be71b 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..0a8929b0dd 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 @@ -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..4f0e1f1ff0 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 @@ -76,6 +76,16 @@ public class EventDetailResultDTO implements Serializable { */ private String eventPeopleName; + /** + * 语音附件url集合 + */ + private List voiceList; + /** + * 事件附件 + */ + @JsonIgnore + private List attachmentList; + @JsonIgnore private String eventUserId; @@ -105,4 +115,17 @@ 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; + } } 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..580d9da12d 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..44dc457a59 --- /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..4be78b5d64 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..1b2dceb751 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,25 @@ 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"; } 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 ca48b13304..0ca734f95f 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 @@ -254,4 +254,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)); + } + } \ No newline at end of file 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 0d7f93a2d8..915851c5de 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 @@ -72,6 +72,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 d0d71cab98..7b2779afea 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..b28acf8317 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,20 @@ public class ResiEventAttachmentEntity extends BaseEpmetEntity { */ private Integer sort; + /** + * 附件状态(审核中:auditing; + auto_passed: 自动通过; + review:结果不确定,需要人工审核; + block: 结果违规; + rejected:人工审核驳回; + approved:人工审核通过) + 现在图片是同步审核的,所以图片只有auto_passed一种状态 + */ + private String status; + + /** + * 审核失败原因 + */ + private String reason; + } 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 6cafe080f3..9ec1029422 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 @@ -25,8 +25,8 @@ import com.epmet.commons.rocketmq.messages.ProjectChangedMQMsg; import com.epmet.commons.tools.constant.*; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.exception.EpmetErrorCode; -import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; @@ -58,11 +58,12 @@ import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import com.epmet.send.SendMqMsgUtil; import com.epmet.service.*; import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import com.google.common.base.Joiner; import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import org.apache.commons.collections4.CollectionUtils; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.ListUtils; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; @@ -76,7 +77,6 @@ import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; import org.springframework.web.multipart.MultipartFile; - import javax.servlet.http.HttpServletRequest; import java.text.ParseException; import java.text.SimpleDateFormat; @@ -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/ProjectTraceServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java index 1150ecc9f5..c7258c8d50 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 @@ -41,6 +41,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; @@ -879,6 +880,10 @@ public class ProjectTraceServiceImpl implements ProjectTraceS log.error("【项目流转】上链失败,错误信息:{}", errorMsg); } + //2021.12.21 给报事人推送站内信 sun start + sendMsg(resiEventEntity); + //2021.12.21 给报事人推送站内信 sun end + return resultDTO; } @@ -1011,4 +1016,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..1521c76bc6 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 ab54bfd340..626b058f2d 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 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())){ + voiceList.add(file.getUrl()); + } + }); + dto.setEventImgs(eventImgs); + dto.setVoiceList(voiceList); + // 已转项目 if (dto.getIsProject()){ // 查询项目信息 @@ -247,6 +273,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())) { + eventVoiceAttachment(formDTO.getCustomerId(), resiEventEntity.getId(), formDTO.getVoiceList()); + } //6、插入组织表 List orgEntityList=getOrgList(formDTO.getCustomerId(),resiEventEntity.getId(),formDTO.getOrgList()); orgEntityList.forEach(orgEntity->{ @@ -364,6 +407,56 @@ public class ResiEventServiceImpl extends BaseServiceImpl voiceList) { + //1.语音附件存入表中 + List voiceDTOList = new ArrayList<>(); + int sort = 0; + for (FileCommonDTO file : voiceList) { + ResiEventAttachmentEntity entity = new ResiEventAttachmentEntity(); + entity.setCustomerId(customerId); + entity.setResiEventId(resiEventId); + entity.setAttachmentName(file.getName()); + entity.setAttachmentFormat(file.getFormat()); + entity.setAttachmentType(file.getType()); + entity.setAttachmentUrl(file.getUrl()); + entity.setSort(sort); + sort++; + resiEventAttachmentDao.insert(entity); + + VoiceTaskDTO task = new VoiceTaskDTO(); + task.setDataId(entity.getId()); + task.setUrl(file.getUrl()); + voiceDTOList.add(task); + } + //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(); + List taskIds = taskList.stream().map(AsyncScanTaskDTO::getTaskId).collect(Collectors.toList()); + //提交记录存入task表 + List scanTaskEntityList = taskList.stream().map(item -> { + ResiEventScanTaskEntity taskEntity = new ResiEventScanTaskEntity(); + taskEntity.setCustomerId(customerId); + taskEntity.setResiEventId(resiEventId); + taskEntity.setResiEventAttachmentId(item.getDataId()); + taskEntity.setTaskId(item.getTaskId()); + taskEntity.setStatus(TopicConstant.AUDITING); + taskEntity.setAttachmentType(TopicConstant.VOICE); + return taskEntity; + }).collect(Collectors.toList()); + resiEventScanTaskService.insertBatch(scanTaskEntityList); + } + } + private void scanContent(String eventContent, List attachmentList) { //事件内容 if (StringUtils.isNotBlank(eventContent)) { @@ -534,6 +627,19 @@ 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"); @@ -559,6 +665,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<>(); @@ -605,6 +726,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 } /** @@ -766,5 +922,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.REVIEW); + 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(); + } } \ No newline at end of file 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 2e5d52b4ca..97fa70c844 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 IFNULL(re.EVENT_CONTENT,'') AS eventContent, DATE_FORMAT(re.CREATED_TIME,'%Y-%m-%d %H:%i') AS eventTime, - ea.ATTACHMENT_URL AS img, + 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 +228,58 @@ 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..cc884b3d5a 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,15 @@ - + + + + + + \ 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/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/topic/service/impl/ResiTopicServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java index e462289cb7..4305b0f966 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java @@ -2850,6 +2850,8 @@ public class ResiTopicServiceImpl extends BaseServiceImpl 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-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/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..6d4e1dded0 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GridMobileListResultDTO.java @@ -0,0 +1,61 @@ +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 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/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index bff8b92a50..2c4989f718 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 @@ -23,7 +23,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 { @@ -241,14 +241,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 @@ -681,4 +681,12 @@ public interface EpmetUserOpenFeignClient { */ @PostMapping(value = "/epmetuser/user/findicuser") Result findIcUser(@RequestBody FindIcUserFormDTO formDTO); + + /** + * 获取ic_resi_user + * @param icResiUserId + * @return + */ + @PostMapping(value = "/epmetuser/icresiuser/geticresiuser/{icResiUserId}") + Result getIcResiUserDTO(@PathVariable("icResiUserId") String icResiUserId); } 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 109c54c0ed..3d2b474453 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 @@ -174,8 +174,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 @@ -499,11 +499,16 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien /** * 查找居民端小程序里的用户对应ic里的人。以及家属们 * - * @param epmetUserIdList + * @param formDTO * @return */ @Override public Result findIcUser(FindIcUserFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "findIcUser", formDTO); } + + @Override + public Result getIcResiUserDTO(String icResiUserId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getIcResiUserDTO", icResiUserId); + } } 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..cc3911cca3 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(@RequestBody GridMobileListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GridMobileListFormDTO.Gridobile.class); + return new Result>().ok(customerStaffService.gridMobileList(formDTO.getGridId())); + } + } 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..2438eae9c6 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 @@ -30,7 +30,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; 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 +166,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); } /** 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/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/service/CustomerStaffService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java index 08916bfcc8..d7bc875993 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); } 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..efa3b0cda3 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 @@ -22,7 +22,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; 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 +164,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 清除用户缓存信息 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..cb360e3d08 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,48 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl gridMobileList(String gridId) { + List resultList = new ArrayList<>(); + //1.查询网格下工作人员列表 + CommonGridIdFormDTO dto = new CommonGridIdFormDTO(); + dto.setGridId(gridId); + 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 2fad36a652..bc18a37e02 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 page(Map params) { @@ -345,14 +349,20 @@ 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()); - } + }*/ 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 edc1149e6f..218784f968 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 @@ -54,10 +54,10 @@ public class VolunteerServiceImpl implements VolunteerService, ResultDataResolve * @param customerId * @return */ - 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(); @@ -89,7 +89,7 @@ public class VolunteerServiceImpl implements VolunteerService, ResultDataResolve * @param customerId * @return */ - public VolunteerDistributionResultDTO getVolunteerDistribution(String customerId) { + public VolunteerDistributionResultDTO getVolunteerDistribution(String customerId, String agencyId) { //epmetHeartOpenFeignClient.queryVolunteerPage() // 1.分页查询出所有志愿者列表 @@ -104,6 +104,7 @@ public class VolunteerServiceImpl implements VolunteerService, ResultDataResolve VolunteerCommonFormDTO volunteerForm = new VolunteerCommonFormDTO(); volunteerForm.setCustomerId(customerId); + volunteerForm.setSuperiorAgencyId(agencyId); volunteerForm.setPageNo(pageNo); volunteerForm.setPageSize(pageSize); 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/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/UserWechatDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml index 06cbd5f02c..3a34083ef4 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml @@ -34,8 +34,8 @@ UPDATED_BY = #{updatedBy}, UPDATED_TIME = #{updatedTime} - WHERE - USER_ID = #{userId} + WHERE del_flag='0' + and USER_ID = #{userId}