wxz 2 years ago
parent
commit
d27a8a6b2a
  1. 5
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java
  2. 5
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoCache.java
  3. 19
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java
  4. 16
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyActivityFormDTO.java
  5. 22
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyActivitySignUpRecordFormDTO.java
  6. 25
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/SignUpParyActFormDTO.java
  7. 46
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyActivityResDTO.java
  8. 61
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyActivitySignUpRecordResDTO.java
  9. 85
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java
  10. 9
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcActivityUnitRelationDao.java
  11. 27
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyActivityDao.java
  12. 24
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyActivitySignUpRecordDao.java
  13. 9
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceItemDictDao.java
  14. 14
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyActivityEntity.java
  15. 54
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyActivitySignUpRecordEntity.java
  16. 13
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityExcel.java
  17. 13
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityImportExcel.java
  18. 7
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcActivityUnitRelationService.java
  19. 52
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java
  20. 8
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java
  21. 11
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcActivityUnitRelationServiceImpl.java
  22. 186
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java
  23. 12
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java
  24. 9
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcActivityUnitRelationDao.xml
  25. 90
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml
  26. 40
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivitySignUpRecordDao.xml
  27. 15
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceItemDictDao.xml
  28. BIN
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/templates/icpartyactivity_import_tem.xlsx
  29. 112
      epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/ThirdAppManageDTO.java
  30. 50
      epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/ThirdAppManageFormDTO.java
  31. 83
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/ThirdAppManageController.java
  32. 16
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/ThirdAppManageDao.java
  33. 71
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/ThirdAppManageEntity.java
  34. 66
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/ThirdAppManageService.java
  35. 112
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/ThirdAppManageServiceImpl.java
  36. 20
      epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.10__third_app.sql
  37. 27
      epmet-module/gov-access/gov-access-server/src/main/resources/mapper/ThirdAppManageDao.xml
  38. 6
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyV2FormDTO.java
  39. 32
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CommunityCountCensusFormDTO.java
  40. 3
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java
  41. 13
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EnterprisePageFormDTO.java
  42. 48
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GroupRentHouseFormDTO.java
  43. 30
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseCountPictureFormDTO.java
  44. 41
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/CommunityLoginFormDTO.java
  45. 42
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/CountActivityFormDTO.java
  46. 15
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/EnterpriseCountPlaceTypeFormDTO.java
  47. 41
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/LoginLogCountByLevelFormDTO.java
  48. 20
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyCountCensusResultDTO.java
  49. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyResultDTO.java
  50. 4
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencySubResultDTO.java
  51. 4
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java
  52. 4
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java
  53. 23
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityCountCensusResultDTO.java
  54. 33
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityListByAgencyIdResultDTO.java
  55. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridDetailResultDTO.java
  56. 77
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GroupRentHouseResultDTO.java
  57. 23
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseCountPictureListResultDTO.java
  58. 24
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseCountPictureResultDTO.java
  59. 37
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HousePictureListResultDTO.java
  60. 44
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/AccountActivityInfo.java
  61. 30
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/ActivityTatalInfo.java
  62. 37
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/CommunityLoginResultDTO.java
  63. 24
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/EnterpriseCountPlaceTypeDetailDTO.java
  64. 17
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/EnterpriseCountPlaceTypeResDTO.java
  65. 29
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/LoginLogCountByLevelResultDTO.java
  66. 10
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  67. 10
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  68. 13
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java
  69. 46
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java
  70. 17
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java
  71. 17
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcEnterpriseController.java
  72. 113
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java
  73. 154
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffLoginLogController.java
  74. 21
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
  75. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcEnterpriseDao.java
  76. 20
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java
  77. 75
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffLoginLogDao.java
  78. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java
  79. 73
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/StaffLoginLogEntity.java
  80. 50
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/HousePictureListExcelDTO.java
  81. 45
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/yt/AccountActivityExcel.java
  82. 28
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/yt/AccountInactivityExcel.java
  83. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java
  84. 110
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/mq/listener/StaffLoginLogListener.java
  85. 7
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java
  86. 37
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java
  87. 7
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java
  88. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcEnterpriseService.java
  89. 7
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java
  90. 97
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffLoginLogService.java
  91. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
  92. 153
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  93. 26
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
  94. 52
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseServiceImpl.java
  95. 79
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java
  96. 310
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffLoginLogServiceImpl.java
  97. 2
      epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.49__alter_agency.sql
  98. 121
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
  99. 3
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
  100. 36
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcEnterpriseDao.xml

5
epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java

@ -36,6 +36,11 @@ public interface ConsomerGroupConstants {
*/
String AUTH_OPERATION_LOG_GROUP = "auth_operation_log_group";
/**
* 数字社区web端工作人员登录
*/
String STAFF_LOGIN_LOG_GROUP = "staff_login_log_group";
/**
* 项目操作日志消费组
*/

5
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoCache.java

@ -32,6 +32,11 @@ public class CustomerStaffInfoCache implements Serializable {
*/
private String agencyName;
/**
* 组织级别
*/
private String level;
/**
* 2级组织名称 根据添加的来源返回xx组织-组织/网格/部门
*/

19
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java

@ -110,17 +110,30 @@ public class IcPartyActivityDTO implements Serializable {
private String content;
/**
* 服务人数
* 服务人数;烟台服务人数是活动限制名额如果是0代表不限制
*/
private Integer peopleCount;
/**
* 活动时间
* 活动时间;烟台此列作为活动开始时间
*/
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern="yyyy-MM-dd HH:mm")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date activityTime;
/**
* 烟台此列作为活动结束时间;必填
*/
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date activityEndTime;
/**
* 烟台活动封面必填
*/
private String coverUrl;
/**
* 活动地址
*/

16
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyActivityFormDTO.java

@ -18,8 +18,16 @@ import java.util.Date;
@Data
public class PartyActivityFormDTO extends PageFormDTO implements Serializable {
private static final long serialVersionUID = -2510068555703677L;
@NotBlank(message = "组织Id不能为空" )
public interface ResiDingQueryInternalGroup {
}
@NotBlank(message = "组织Id不能为空",groups = {ResiDingQueryInternalGroup.class})
private String agencyId;
@NotBlank(message = "gridId不能为空",groups = {ResiDingQueryInternalGroup.class})
private String gridId;
private String unitId;
private String title;
@ -31,4 +39,10 @@ public class PartyActivityFormDTO extends PageFormDTO implements Serializable {
// private Integer pageNo;
// private Integer pageSize;
private String customerId;
/**
* 居民端钉钉传userId
*/
@NotBlank(message = "userId不能为空",groups = {ResiDingQueryInternalGroup.class})
private String userId;
}

22
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyActivitySignUpRecordFormDTO.java

@ -0,0 +1,22 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 人员名单
* @Author yzm
* @Date 2023/3/29 13:42
*/
@Data
public class PartyActivitySignUpRecordFormDTO extends PageFormDTO implements Serializable {
/**
* 联建活动ID
*/
@NotBlank(message = "activityId不能为空", groups = AddUserInternalGroup.class)
private String activityId;
}

25
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/SignUpParyActFormDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.QueryGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* @Description
* @Author yzm
* @Date 2023/3/29 15:27
*/
@Data
public class SignUpParyActFormDTO {
/**
*
*/
@NotBlank(message = "userId不能为空", groups = QueryGroup.class)
private String userId;
@NotBlank(message = "activityId不能为空", groups = QueryGroup.class)
private String activityId;
@NotBlank(message = "gridId不能为空", groups = QueryGroup.class)
private String gridId;
}

46
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyActivityResDTO.java

@ -0,0 +1,46 @@
package com.epmet.dto.result;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @Description 居民端钉钉查看联建活动详情
* @Author yzm
* @Date 2023/3/29 15:59
*/
@Data
public class PartyActivityResDTO {
private String activityId;
private String agencyName;
private String agencyId;
private List<String> unitNameList;
private List<String> serviceMatterNameList;
private String title;
private String target;
private String content;
private Integer peopleCount;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date activityTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date activityEndTime;
private String coverUrl;
private String address;
private String result;
/**
* 报名记录id
*/
private String signUpId;
/**
* 已报名总人数
*/
private Integer signUpCount;
/**
* 是否报名:true已报名false未报名
*/
private Boolean signUpFlag;
}

61
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyActivitySignUpRecordResDTO.java

@ -0,0 +1,61 @@
package com.epmet.dto.result;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 联建活动报名记录表(烟台需求)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-03-29
*/
@Data
public class PartyActivitySignUpRecordResDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 联建活动ID
*/
private String activityId;
/**
* 居民端用户id
*/
private String userId;
/**
* 姓名
*/
private String userName;
private String mobile;
/**
* 报名时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date signUpTime;
/**
* 用户报名时所在的网格
*/
private String gridId;
/**
* 网格名称XXX社区-xxx网格
*/
private String gridName;
}

85
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java

@ -24,6 +24,7 @@ import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
@ -35,11 +36,16 @@ import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.QueryGroup;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dto.IcPartyActivityDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.form.PartyActivityFormDTO;
import com.epmet.dto.form.PartyActivitySignUpRecordFormDTO;
import com.epmet.dto.form.SignUpParyActFormDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.dto.result.PartyActivityResDTO;
import com.epmet.dto.result.PartyActivitySignUpRecordResDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.excel.IcPartyActivityExcel;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
@ -47,6 +53,7 @@ import com.epmet.service.IcPartyActivityService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.*;
@ -60,9 +67,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.nio.file.Path;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import java.util.*;
/**
@ -253,5 +258,79 @@ public class IcPartyActivityController implements ResultDataResolver {
}
}
/**
* 人员名单
*
* @param formDTO
* @return
*/
@PostMapping("querySignUpRecord")
public Result<PageData<PartyActivitySignUpRecordResDTO>> querySignUpRecord(@RequestBody PartyActivitySignUpRecordFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserShowGroup.class,PageFormDTO.AddUserInternalGroup.class);
return new Result<PageData<PartyActivitySignUpRecordResDTO>>().ok(icPartyActivityService.querySignUpRecord(formDTO.getActivityId(),formDTO.getPageNo(),formDTO.getPageSize()));
}
/**
* 居民端钉钉报名联建活动
*
* @param formDTO
* @return
*/
@PostMapping("signUp")
public Result signUp(@RequestBody SignUpParyActFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, QueryGroup.class);
String signUpId = icPartyActivityService.signUp(formDTO.getActivityId(), formDTO.getUserId(), formDTO.getGridId());
Map resultMap = new HashMap<>();
resultMap.put("signUpId", signUpId);
return new Result().ok(resultMap);
}
/**
* 居民端钉钉查看联建活动详情
*
* @param tokenDto
* @param activityId
* @return
*/
@PostMapping("act-detail-resi/{activityId}")
public Result<PartyActivityResDTO> queryActDetailForResi(@LoginUser TokenDto tokenDto, @PathVariable("activityId") String activityId) {
if (StringUtils.isBlank(activityId)) {
return new Result();
}
return new Result<PartyActivityResDTO>().ok(icPartyActivityService.queryActDetailForResi(tokenDto.getCustomerId(),tokenDto.getUserId(),activityId));
}
/**
* 居民端钉钉分页查询联建活动
*
* @param formDTO
* @return
*/
@PostMapping("page-all-act")
public Result<PageData<PartyActivityResDTO>> pageAllAct(@RequestBody PartyActivityFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, PartyActivityFormDTO.ResiDingQueryInternalGroup.class);
return new Result<PageData<PartyActivityResDTO>>().ok(
icPartyActivityService.pageAllAct(formDTO.getPageNo(),
formDTO.getPageSize(),
formDTO.getGridId(),
formDTO.getAgencyId(),
formDTO.getUserId()));
}
/**
* 居民端钉钉已报名列表
* @param formDTO
* @return
*/
@PostMapping("applied-act")
public Result<PageData<PartyActivityResDTO>> appliedAct(@RequestBody PartyActivityFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, PartyActivityFormDTO.ResiDingQueryInternalGroup.class);
return new Result<PageData<PartyActivityResDTO>>().ok(
icPartyActivityService.appliedAct(formDTO.getPageNo(),
formDTO.getPageSize(),
formDTO.getGridId(),
formDTO.getAgencyId(),
formDTO.getUserId()));
}
}

9
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcActivityUnitRelationDao.java

@ -5,6 +5,8 @@ import com.epmet.entity.IcActivityUnitRelationEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 联建活动与单位关联表
*
@ -22,4 +24,11 @@ public interface IcActivityUnitRelationDao extends BaseDao<IcActivityUnitRelatio
* @Date 2022/2/21 16:19
*/
void deleteByActivity(@Param("activityId") String activityId);
/**
* 查询联建活动关联的联建单位名称列表
* @param activityId
* @return
*/
List<String> selectActivityUntiNames(String activityId);
}

27
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyActivityDao.java

@ -20,8 +20,10 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.PartyActivityFormDTO;
import com.epmet.dto.result.ActivityStatisticsDTO;
import com.epmet.dto.result.PartyActivityResDTO;
import com.epmet.entity.IcPartyActivityEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -54,4 +56,29 @@ public interface IcPartyActivityDao extends BaseDao<IcPartyActivityEntity> {
List<IcPartyActivityEntity> getActivityList(PartyActivityFormDTO formDTO);
/**
*
* @param gridId 当前用户所在网格id
* @param agencyId 当前用户所在网格所属组织id
* @param userId 居民端用户id,校验当前用户是否报名
* @return 居民端钉钉-分页查询全部联建活动
*/
List<PartyActivityResDTO> pageAllAct(@Param("customerId")String customerId,
@Param("gridId") String gridId,
@Param("agencyId")String agencyId,
@Param("userId")String userId);
/**
* 居民端钉钉已报名列表
* @param customerId
* @param gridId
* @param agencyId
* @param userId
* @return
*/
List<PartyActivityResDTO> selectAppliedAct(@Param("customerId")String customerId,
@Param("gridId") String gridId,
@Param("agencyId")String agencyId,
@Param("userId")String userId);
}

24
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyActivitySignUpRecordDao.java

@ -0,0 +1,24 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.PartyActivitySignUpRecordResDTO;
import com.epmet.entity.IcPartyActivitySignUpRecordEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 联建活动报名记录表(烟台需求)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-03-29
*/
@Mapper
public interface IcPartyActivitySignUpRecordDao extends BaseDao<IcPartyActivitySignUpRecordEntity> {
/**
* 人员名单
* @param activityId
* @return
*/
List<PartyActivitySignUpRecordResDTO> querySignUpRecord(String activityId);
}

9
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceItemDictDao.java

@ -39,4 +39,13 @@ public interface IcServiceItemDictDao extends BaseDao<IcServiceItemDictEntity> {
IcServiceItemDictEntity selectMax(String customerId);
String selectName(@Param("customerId") String customerId, @Param("categoryCode") String categoryCode);
/**
* 查询联建活动的服务事项名称
* @param activityId
* @param customerId
* @return
*/
List<String> selectActivityServiceItemName(@Param("activityId") String activityId,
@Param("customerId") String customerId);
}

14
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyActivityEntity.java

@ -83,14 +83,24 @@ public class IcPartyActivityEntity extends BaseEpmetEntity {
private String content;
/**
* 服务人数
* 服务人数;烟台服务人数是活动限制名额如果是0代表不限制
*/
private Integer peopleCount;
/**
* 活动时间
* 活动时间;烟台此列作为活动开始时间
*/
private Date activityTime;
/**
* 烟台此列作为活动结束时间;必填
*/
private Date activityEndTime;
/**
* 烟台活动封面必填
*/
private String coverUrl;
/**
* 活动地址

54
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyActivitySignUpRecordEntity.java

@ -0,0 +1,54 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 联建活动报名记录表(烟台需求)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-03-29
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_party_activity_sign_up_record")
public class IcPartyActivitySignUpRecordEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 联建活动ID
*/
private String activityId;
/**
* 居民端用户id
*/
private String userId;
/**
* 姓名
*/
private String userName;
private String mobile;
/**
* 报名时间
*/
private Date signUpTime;
/**
* 用户报名时所在的网格
*/
private String gridId;
private String gridName;
}

13
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityExcel.java

@ -49,9 +49,20 @@ public class IcPartyActivityExcel {
private Integer peopleCount;
@ColumnWidth(20)
@ExcelProperty(value = "活动时间")
@ExcelProperty(value = "活动开始时间")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date activityTime;
/**
* 烟台此列作为活动结束时间;必填
*/
@ColumnWidth(20)
@ExcelProperty(value = "活动结束时间")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date activityEndTime;
/**
* actId不为空小程序
* 为空管理平台

13
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityImportExcel.java

@ -51,11 +51,20 @@ public class IcPartyActivityImportExcel extends ExcelVerifyInfo {
@ExcelProperty(value = "服务人数*")
private Integer peopleCount;
@NotNull(message = "活动时间不能为空")
@ExcelProperty("活动时间*")
@NotNull(message = "活动开始时间不能为空")
@ExcelProperty("活动开始时间*")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date activityTime;
/**
* 烟台此列作为活动结束时间;必填
*/
@NotNull(message = "活动结束时间不能为空")
@ExcelProperty("活动结束时间*")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date activityEndTime;
@NotBlank(message = "详细地址")
@Length(max = 250, message = "详细地址最多输入250字")
@ExcelProperty(value = "详细地址*")

7
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcActivityUnitRelationService.java

@ -22,6 +22,13 @@ public interface IcActivityUnitRelationService extends BaseService<IcActivityUni
*/
List<String> getUnitList(String activityId);
/**
* 获取联建活动关联的联建单位名称
* @param activityId
* @return
*/
List<String> getActivityUntiNames(String activityId);
/**
* 物理删除删除活动所属单位
*

52
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java

@ -22,6 +22,8 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.IcPartyActivityDTO;
import com.epmet.dto.form.PartyActivityFormDTO;
import com.epmet.dto.result.PartyActivityResDTO;
import com.epmet.dto.result.PartyActivitySignUpRecordResDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcPartyActivityEntity;
@ -127,4 +129,54 @@ public interface IcPartyActivityService extends BaseService<IcPartyActivityEntit
* @param filePath
*/
void execAsyncExcelImport(Path filePath, String importTaskId,String customerId,String userId);
/**
* 人员名单
* @param activityId
* @return
*/
PageData<PartyActivitySignUpRecordResDTO> querySignUpRecord(String activityId,Integer pageNo,Integer pageSize);
/**
* 居民端钉钉报名联建活动
* @param activityId
* @param userId
* @param gridId
*/
String signUp(String activityId, String userId, String gridId);
/**
* 居民端钉钉查看联建活动详情
* @param customerId
* @param userId
* @param activityId
* @return
*/
PartyActivityResDTO queryActDetailForResi(String customerId, String userId, String activityId);
/**
* 居民端钉钉-分页查询全部联建活动
*
* @param pageNo
* @param pageSize
* @param gridId
* @param userId
* @return
*/
PageData<PartyActivityResDTO> pageAllAct(Integer pageNo, Integer pageSize, String gridId, String agencyId,String userId);
/**
* 居民端钉钉已报名列表
* @param pageNo
* @param pageSize
* @param gridId
* @param agencyId
* @param userId
* @return
*/
PageData<PartyActivityResDTO> appliedAct(Integer pageNo,
Integer pageSize,
String gridId,
String agencyId,
String userId);
}

8
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java

@ -83,4 +83,12 @@ public interface IcServiceItemDictService extends BaseService<IcServiceItemDictE
String getCategoryName(String customerId, String id);
List<ServiceItemResultDTO> queryDictOption(String type, String customerId);
/**
* 查询联建活动的服务事项名称列表
* @param activityId
* @param customerId
* @return
*/
List<String> getByActivityId(String activityId, String customerId);
}

11
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcActivityUnitRelationServiceImpl.java

@ -43,6 +43,17 @@ public class IcActivityUnitRelationServiceImpl extends BaseServiceImpl<IcActivit
return list.stream().map(IcActivityUnitRelationEntity::getUnitId).collect(Collectors.toList());
}
/**
* 获取联建活动关联的联建单位名称
*
* @param activityId
* @return
*/
@Override
public List<String> getActivityUntiNames(String activityId) {
return baseDao.selectActivityUntiNames(activityId);
}
/**
* 删除活动所属单位
*

186
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java

@ -24,28 +24,33 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.*;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcPartyActivityDao;
import com.epmet.dao.IcPartyActivitySignUpRecordDao;
import com.epmet.dto.IcPartyActivityDTO;
import com.epmet.dto.IcPartyUnitDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.form.PartyActivityFormDTO;
import com.epmet.dto.result.ActivityStatisticsDTO;
import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.dto.result.*;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcActivityServiceRelationEntity;
import com.epmet.entity.IcActivityUnitRelationEntity;
import com.epmet.entity.IcPartyActivityEntity;
import com.epmet.entity.IcPartyActivitySignUpRecordEntity;
import com.epmet.excel.IcPartyActivityImportExcel;
import com.epmet.excel.handler.IcPartyActivityImportListener;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.OssFeignClient;
import com.epmet.service.*;
import com.github.pagehelper.PageHelper;
@ -57,6 +62,7 @@ import org.apache.commons.fileupload.FileItemFactory;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.entity.ContentType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -83,8 +89,8 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
@Resource
private IcPartyUnitService icPartyUnitService;
@Resource
private IcServiceItemDictService icServiceItemDictService;
// @Resource
// private IcServiceItemDictService icServiceItemDictService;
@Resource
private IcActivityUnitRelationService icActivityUnitRelationService;
@Resource
@ -93,6 +99,10 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
private OssFeignClient ossFeignClient;
@Resource
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient;
@Autowired
private IcPartyActivitySignUpRecordDao partyActivitySignUpRecordDao;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Override
@ -139,7 +149,7 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
List<String> serviceMatterid = Arrays.asList(dto.getServiceMatter().split(StrConstant.COMMA));
List<String> serviceMatterNameList=new ArrayList<>();
for(String id:serviceMatterid){
String categoryName=icServiceItemDictService.getCategoryName(dto.getCustomerId(),id);
String categoryName=SpringContextUtils.getBean(IcServiceItemDictService.class).getCategoryName(dto.getCustomerId(),id);
if(StringUtils.isNotBlank(categoryName)){
serviceMatterNameList.add(categoryName);
}
@ -156,7 +166,7 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
});
}
return new PageData<>(dtoList, pageInfo.getTotal());
return new PageData<>(dtoList, pageInfo.getTotal(),formDTO.getPageSize());
}
@Override
@ -201,7 +211,7 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
IcPartyActivityDTO dto = ConvertUtils.sourceToTarget(entity, IcPartyActivityDTO.class);
//获取服务事项
List<OptionDTO> serviceItemList = icServiceItemDictService.queryDictList(entity.getCustomerId());
List<OptionDTO> serviceItemList = SpringContextUtils.getBean(IcServiceItemDictService.class).queryDictList(entity.getCustomerId());
Map<String, String> categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
List<String> services = icActivityServiceRelationService.getServiceList(id);
List<String> serviceNames = services.stream().map(categoryMap::get).collect(Collectors.toList());
@ -335,7 +345,7 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
//获取联建单位
Map<String, String> option = icPartyUnitService.options(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
//获取服务事项字典
List<OptionDTO> serviceItemList = icServiceItemDictService.queryDictList(tokenDto.getCustomerId());
List<OptionDTO> serviceItemList = SpringContextUtils.getBean(IcServiceItemDictService.class).queryDictList(tokenDto.getCustomerId());
Map<String, String> categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
//数据组装
dtoList.forEach(dto -> {
@ -509,4 +519,164 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
baseDao.insert(e);
});
}
/**
* 人员名单
*
* @param activityId
* @return
*/
@Override
public PageData<PartyActivitySignUpRecordResDTO> querySignUpRecord(String activityId, Integer pageNo, Integer pageSize) {
PageHelper.startPage(pageNo, pageSize);
List<PartyActivitySignUpRecordResDTO> list = partyActivitySignUpRecordDao.querySignUpRecord(activityId);
PageInfo<PartyActivitySignUpRecordResDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal(), pageSize);
}
/**
* 居民端钉钉报名联建活动
*
* @param activityId
* @param userId
* @param gridId
*/
@Override
public String signUp(String activityId, String userId, String gridId) {
LambdaQueryWrapper<IcPartyActivitySignUpRecordEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(IcPartyActivitySignUpRecordEntity::getActivityId, activityId)
.eq(IcPartyActivitySignUpRecordEntity::getUserId, userId)
.select(IcPartyActivitySignUpRecordEntity::getId);
IcPartyActivitySignUpRecordEntity entity = partyActivitySignUpRecordDao.selectOne(queryWrapper);
if (null != entity) {
return entity.getId();
}
// 查询网格名称
GridInfoCache gridInfoCache = CustomerOrgRedis.getGridInfo(gridId);
if (null == gridInfoCache) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "网格信息查询异常gridId:" + gridId, "网格信息查询异常");
}
// 查询用户姓名和手机号
List<String> userIdList=new ArrayList<>();
userIdList.add(userId);
Result<List<UserBaseInfoResultDTO>> userRes = epmetUserOpenFeignClient.queryUserBaseInfo(userIdList);
if (!userRes.success() || CollectionUtils.isEmpty(userRes.getData())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "网格信息查询异常gridId:" + gridId, "查询用户信息异常");
}
UserBaseInfoResultDTO userBaseInfoResultDTO=userRes.getData().get(NumConstant.ZERO);
IcPartyActivitySignUpRecordEntity insert = new IcPartyActivitySignUpRecordEntity();
insert.setActivityId(activityId);
insert.setCustomerId(EpmetRequestHolder.getLoginUserCustomerId());
insert.setGridId(gridId);
insert.setGridName(gridInfoCache.getGridNamePath());
insert.setUserId(userId);
insert.setUserName(userBaseInfoResultDTO.getRealName());
insert.setMobile(userBaseInfoResultDTO.getMobile());
insert.setSignUpTime(new Date());
partyActivitySignUpRecordDao.insert(insert);
return insert.getId();
}
/**
* 居民端钉钉查看联建活动详情
*
* @param customerId
* @param userId
* @param activityId
* @return
*/
@Override
public PartyActivityResDTO queryActDetailForResi(String customerId, String userId, String activityId) {
IcPartyActivityEntity activityEntity = baseDao.selectById(activityId);
if (null == activityEntity) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "联建活动不存在,activityId:" + activityId, "联建活动不存在");
}
PartyActivityResDTO resDTO = ConvertUtils.sourceToTarget(activityEntity, PartyActivityResDTO.class);
resDTO.setSignUpFlag(false);
resDTO.setActivityId(activityId);
// 当前用户是否报名
LambdaQueryWrapper<IcPartyActivitySignUpRecordEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(IcPartyActivitySignUpRecordEntity::getActivityId, activityId)
.eq(IcPartyActivitySignUpRecordEntity::getUserId, userId)
.select(IcPartyActivitySignUpRecordEntity::getId);
IcPartyActivitySignUpRecordEntity signUpRecordEntity = partyActivitySignUpRecordDao.selectOne(queryWrapper);
if (null != signUpRecordEntity) {
resDTO.setSignUpId(signUpRecordEntity.getId());
resDTO.setSignUpFlag(true);
}
// 主办方:组织名称
AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(resDTO.getAgencyId());
if (null != agencyInfoCache) {
resDTO.setAgencyName(agencyInfoCache.getOrganizationName());
}
// 联建单位:
resDTO.setUnitNameList(icActivityUnitRelationService.getActivityUntiNames(activityId));
// 服务事项
resDTO.setServiceMatterNameList(SpringContextUtils.getBean(IcServiceItemDictService.class).getByActivityId(activityId,activityEntity.getCustomerId()));
// 报名总人数
LambdaQueryWrapper<IcPartyActivitySignUpRecordEntity> countWrapper = new LambdaQueryWrapper<>();
countWrapper.eq(IcPartyActivitySignUpRecordEntity::getActivityId, activityId);
resDTO.setSignUpCount(partyActivitySignUpRecordDao.selectCount(countWrapper));
return resDTO;
}
/**
* 居民端钉钉-分页查询全部联建活动
*
* @param pageNo
* @param pageSize
* @param gridId
* @param userId
* @return
*/
@Override
public PageData<PartyActivityResDTO> pageAllAct(Integer pageNo, Integer pageSize, String gridId,String agencyId, String userId) {
PageHelper.startPage(pageNo,pageSize);
List<PartyActivityResDTO> list=baseDao.pageAllAct(EpmetRequestHolder.getLoginUserCustomerId(),gridId,agencyId,userId);
list.forEach(resDTO->{
// 主办方:组织名称
AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(resDTO.getAgencyId());
if (null != agencyInfoCache) {
resDTO.setAgencyName(agencyInfoCache.getOrganizationName());
}
// 联建单位:
resDTO.setUnitNameList(icActivityUnitRelationService.getActivityUntiNames(resDTO.getActivityId()));
// 服务事项
resDTO.setServiceMatterNameList(SpringContextUtils.getBean(IcServiceItemDictService.class).getByActivityId(resDTO.getActivityId(),EpmetRequestHolder.getLoginUserCustomerId()));
});
PageInfo<PartyActivityResDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal(),pageSize);
}
/**
* 居民端钉钉已报名列表
*
* @param pageNo
* @param pageSize
* @param gridId
* @param agencyId
* @param userId
* @return
*/
@Override
public PageData<PartyActivityResDTO> appliedAct(Integer pageNo, Integer pageSize, String gridId, String agencyId, String userId) {
PageHelper.startPage(pageNo, pageSize);
List<PartyActivityResDTO> list = baseDao.selectAppliedAct(EpmetRequestHolder.getLoginUserCustomerId(), gridId, agencyId, userId);
list.forEach(resDTO -> {
// 主办方:组织名称
AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(resDTO.getAgencyId());
if (null != agencyInfoCache) {
resDTO.setAgencyName(agencyInfoCache.getOrganizationName());
}
// 联建单位:
resDTO.setUnitNameList(icActivityUnitRelationService.getActivityUntiNames(resDTO.getActivityId()));
// 服务事项
resDTO.setServiceMatterNameList(SpringContextUtils.getBean(IcServiceItemDictService.class).getByActivityId(resDTO.getActivityId(), EpmetRequestHolder.getLoginUserCustomerId()));
});
PageInfo<PartyActivityResDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal(), pageSize);
}
}

12
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java

@ -226,5 +226,15 @@ public class IcServiceItemDictServiceImpl extends BaseServiceImpl<IcServiceItemD
return resultList;
}
/**
* 查询联建活动的服务事项名称列表
*
* @param activityId
* @param customerId
* @return
*/
@Override
public List<String> getByActivityId(String activityId, String customerId) {
return baseDao.selectActivityServiceItemName(activityId,customerId);
}
}

9
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcActivityUnitRelationDao.xml

@ -22,5 +22,14 @@
DELETE FROM ic_activity_unit_relation WHERE ACTIVITY_ID = #{activityId}
</delete>
<!-- 查询联建活动关联的联建单位名称列表 -->
<select id="selectActivityUntiNames" parameterType="java.lang.String" resultType="java.lang.String">
select u.UNIT_NAME from ic_party_unit u
where u.id in(
select r.UNIT_ID from ic_activity_unit_relation r
where r.ACTIVITY_ID=#{activityId}
and r.DEL_FLAG='0'
)
</select>
</mapper>

90
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml

@ -63,7 +63,9 @@
a.LATITUDE,
a.RESULT,
a.AGENCY_ID,
a.CUSTOMER_ID
a.CUSTOMER_ID,
a.COVER_URL,
a.ACTIVITY_END_TIME
FROM
ic_party_activity a
left join ic_activity_unit_relation ur
@ -89,8 +91,11 @@
<if test='null != serviceMatter and "" != serviceMatter'>
AND sr.SERVICE_MATTER = #{serviceMatter}
</if>
<if test=" null != startTime and null != endTime">
AND a.ACTIVITY_TIME BETWEEN #{startTime} AND #{endTime}
<if test=" null != startTime">
AND a.ACTIVITY_TIME &gt;= #{startTime}
</if>
<if test=" null != endTime">
AND a.ACTIVITY_TIME &lt;= #{endTime}
</if>
GROUP BY a.id
ORDER BY a.ACTIVITY_TIME DESC
@ -159,4 +164,83 @@
</select>
<!-- 居民端钉钉-分页查询全部联建活动 -->
<select id="pageAllAct" parameterType="map" resultType="com.epmet.dto.result.PartyActivityResDTO">
select
a.ID as activityId,
a.AGENCY_ID,
'' as agencyName,
a.TITLE,
a.TARGET,
a.CONTENT,
a.PEOPLE_COUNT,
a.ACTIVITY_TIME,
a.ACTIVITY_END_TIME,
a.COVER_URL,
a.ADDRESS,
a.RESULT,
su.id as signUpId,
(
case when su.id is null then 0
else 1
end
)as signUpFlag,
(
select count(s.id)
from ic_party_activity_sign_up_record s
where s.ACTIVITY_ID=a.id
and s.DEL_FLAG='0'
)as signUpCount
from ic_party_activity a
left join ic_party_activity_sign_up_record su
on(a.id=su.ACTIVITY_ID
and su.USER_ID=#{userId}
and su.DEL_FLAG='0')
where a.DEL_FLAG='0'
and a.CUSTOMER_ID = #{customerId}
and (a.GRID_ID = #{gridId}
or a.AGENCY_ID = #{agencyId}
or a.PIDS like concat('%',#{agencyId},'%')
)
order by a.ACTIVITY_END_TIME desc,a.CREATED_TIME desc
</select>
<!-- 居民端钉钉,已报名列表 -->
<select id="selectAppliedAct" parameterType="map" resultType="com.epmet.dto.result.PartyActivityResDTO">
select
a.ID as activityId,
a.AGENCY_ID,
'' as agencyName,
a.TITLE,
a.TARGET,
a.CONTENT,
a.PEOPLE_COUNT,
a.ACTIVITY_TIME,
a.ACTIVITY_END_TIME,
a.COVER_URL,
a.ADDRESS,
a.RESULT,
su.id as signUpId,
1 as signUpFlag,
(
select count(s.id)
from ic_party_activity_sign_up_record s
where s.ACTIVITY_ID=a.id
and s.DEL_FLAG='0'
)as signUpCount
from ic_party_activity_sign_up_record su
inner join ic_party_activity a
on(su.ACTIVITY_ID=a.ID)
where su.DEL_FLAG='0'
and a.DEL_FLAG='0'
and su.CUSTOMER_ID = #{customerId}
and su.USER_ID = #{userId}
and (a.GRID_ID = #{gridId}
or a.AGENCY_ID = #{agencyId}
or a.PIDS like concat('%',#{agencyId},'%')
)
order by a.ACTIVITY_END_TIME desc,a.CREATED_TIME desc
</select>
</mapper>

40
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivitySignUpRecordDao.xml

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.IcPartyActivitySignUpRecordDao">
<resultMap type="com.epmet.entity.IcPartyActivitySignUpRecordEntity" id="icPartyActivitySignUpRecordMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="activityId" column="ACTIVITY_ID"/>
<result property="userId" column="USER_ID"/>
<result property="userName" column="USER_NAME"/>
<result property="signUpTime" column="SIGN_UP_TIME"/>
<result property="gridId" column="GRID_ID"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="querySignUpRecord" parameterType="java.lang.String" resultType="com.epmet.dto.result.PartyActivitySignUpRecordResDTO">
SELECT
m.ID,
m.CUSTOMER_ID,
m.ACTIVITY_ID,
m.USER_ID,
m.USER_NAME,
m.MOBILE,
m.GRID_ID,
m.GRID_NAME,
m.SIGN_UP_TIME
FROM
ic_party_activity_sign_up_record m
WHERE
m.ACTIVITY_ID = #{activityId}
ORDER BY
m.SIGN_UP_TIME DESC
</select>
</mapper>

15
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceItemDictDao.xml

@ -41,4 +41,19 @@
d.CUSTOMER_ID = #{customerId}
AND d.CATEGORY_CODE = #{categoryCode}
</select>
<!-- 查询联建活动的服务事项名称 -->
<select id="selectActivityServiceItemName" parameterType="map" resultType="java.lang.String">
select
distinct d.CATEGORY_NAME
from ic_service_item_dict d
where d.CUSTOMER_ID = #{customerId}
and d.DEL_FLAG='0'
and d.CATEGORY_CODE in(
select r.SERVICE_MATTER
from ic_activity_service_relation r
where r.ACTIVITY_ID = #{activityId}
and r.DEL_FLAG='0'
)order by d.SORT asc
</select>
</mapper>

BIN
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/templates/icpartyactivity_import_tem.xlsx

Binary file not shown.

112
epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/ThirdAppManageDTO.java

@ -0,0 +1,112 @@
package com.epmet.dto;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
/**
* 烟台第三方应用管理
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-03
*/
@Data
public class ThirdAppManageDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 应用名称
*/
@NotBlank(message = "应用名称不能为空")
private String name;
/**
* 应用链接
*/
@NotBlank(message = "应用链接不能为空")
private String link;
/**
* 账号
*/
@NotBlank(message = "测试账号不能为空")
private String account;
/**
* 密码
*/
@NotBlank(message = "测试密码不能为空")
private String password;
/**
* 应用介绍
*/
private String remark;
/**
* 第三方公司名
*/
private String companyName;
/**
* 联系人
*/
@NotBlank(message = "联系人不能为空")
private String contacts;
/**
* 联系电话
*/
@NotBlank(message = "联系电话不能为空")
private String mobile;
/**
* 状态0:未审核;1:审核不通过;2:审核通过;3:已发布
*/
private String status;
/**
* 乐观锁
*/
private Integer revision;
/**
* 删除标识 0未删除 1删除
*/
private Integer delFlag;
/**
* 创建者
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新者
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

50
epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/ThirdAppManageFormDTO.java

@ -0,0 +1,50 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import java.io.Serializable;
/**
* 烟台第三方应用管理
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-03
*/
@Data
public class ThirdAppManageFormDTO extends PageFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
private String id;
/**
* 应用名称
*/
private String name;
/**
* 第三方公司名
*/
private String companyName;
/**
* 联系人
*/
private String contacts;
/**
* 联系电话
*/
private String mobile;
/**
* 状态0:未审核;1:审核不通过;2:审核通过;3:已发布
*/
private String status;
}

83
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/ThirdAppManageController.java

@ -0,0 +1,83 @@
package com.epmet.controller;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.ThirdAppManageDTO;
import com.epmet.dto.form.ThirdAppManageFormDTO;
import com.epmet.service.ThirdAppManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* 烟台第三方应用管理
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-03
*/
@RestController
@RequestMapping("thirdAppManage")
public class ThirdAppManageController {
@Autowired
private ThirdAppManageService thirdAppManageService;
@PostMapping("page")
public Result<PageData<ThirdAppManageDTO>> page(@RequestBody ThirdAppManageFormDTO formDTO){
PageData<ThirdAppManageDTO> page = thirdAppManageService.page(formDTO);
return new Result<PageData<ThirdAppManageDTO>>().ok(page);
}
@PostMapping("detail/{id}")
public Result<ThirdAppManageDTO> get(@PathVariable("id") String id){
ThirdAppManageDTO data = thirdAppManageService.get(id);
return new Result<ThirdAppManageDTO>().ok(data);
}
@NoRepeatSubmit
@PostMapping("save")
public Result save(@RequestBody ThirdAppManageDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
thirdAppManageService.save(dto);
return new Result();
}
/**
* 审核
*
* @Param dto
* @Return {@link Result}
* @Author zhaoqifeng
* @Date 2023/2/3 14:18
*/
@NoRepeatSubmit
@PostMapping("audit")
public Result audit(@RequestBody ThirdAppManageDTO dto){
//效验数据
thirdAppManageService.audit(dto);
return new Result();
}
/**
* 发布
*
* @Param dto
* @Return {@link Result}
* @Author zhaoqifeng
* @Date 2023/2/3 14:18
*/
@NoRepeatSubmit
@PostMapping("release")
public Result release(@RequestBody ThirdAppManageDTO dto){
//效验数据
thirdAppManageService.release(dto);
return new Result();
}
}

16
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/ThirdAppManageDao.java

@ -0,0 +1,16 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.ThirdAppManageEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 烟台第三方应用管理
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-03
*/
@Mapper
public interface ThirdAppManageDao extends BaseDao<ThirdAppManageEntity> {
}

71
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/ThirdAppManageEntity.java

@ -0,0 +1,71 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 烟台第三方应用管理
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-03
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("third_app_manage")
public class ThirdAppManageEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 应用名称
*/
private String name;
/**
* 应用链接
*/
private String link;
/**
* 账号
*/
private String account;
/**
* 密码
*/
private String password;
/**
* 应用介绍
*/
private String remark;
/**
* 第三方公司名
*/
private String companyName;
/**
* 联系人
*/
private String contacts;
/**
* 联系电话
*/
private String mobile;
/**
* 状态0:未审核;1:审核不通过;2:审核通过;3:已发布
*/
private String status;
}

66
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/ThirdAppManageService.java

@ -0,0 +1,66 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.ThirdAppManageDTO;
import com.epmet.dto.form.ThirdAppManageFormDTO;
import com.epmet.entity.ThirdAppManageEntity;
/**
* 烟台第三方应用管理
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-03
*/
public interface ThirdAppManageService extends BaseService<ThirdAppManageEntity> {
/**
* 默认分页
*
* @param formDTO
* @return PageData<ThirdAppManageDTO>
* @author generator
* @date 2023-02-03
*/
PageData<ThirdAppManageDTO> page(ThirdAppManageFormDTO formDTO);
/**
* 单条查询
*
* @param id
* @return ThirdAppManageDTO
* @author generator
* @date 2023-02-03
*/
ThirdAppManageDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2023-02-03
*/
void save(ThirdAppManageDTO dto);
/**
* 审核
*
* @Param dto
* @Return
* @Author zhaoqifeng
* @Date 2023/2/3 14:19
*/
void audit(ThirdAppManageDTO dto);
/**
* 发布
*
* @Param dto
* @Return
* @Author zhaoqifeng
* @Date 2023/2/3 14:19
*/
void release(ThirdAppManageDTO dto);
}

112
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/ThirdAppManageServiceImpl.java

@ -0,0 +1,112 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.ThirdAppManageDao;
import com.epmet.dto.ThirdAppManageDTO;
import com.epmet.dto.form.ThirdAppManageFormDTO;
import com.epmet.entity.ThirdAppManageEntity;
import com.epmet.service.ThirdAppManageService;
import com.github.pagehelper.PageInfo;
import com.github.pagehelper.page.PageMethod;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* 烟台第三方应用管理
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-03
*/
@Service
public class ThirdAppManageServiceImpl extends BaseServiceImpl<ThirdAppManageDao, ThirdAppManageEntity> implements ThirdAppManageService {
@Override
public PageData<ThirdAppManageDTO> page(ThirdAppManageFormDTO formDTO) {
PageMethod.startPage(formDTO.getPageNo(), formDTO.getPageSize());
LambdaQueryWrapper<ThirdAppManageEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.like(StringUtils.isNotBlank(formDTO.getName()), ThirdAppManageEntity::getName, formDTO.getName());
wrapper.like(StringUtils.isNotBlank(formDTO.getCompanyName()), ThirdAppManageEntity::getCompanyName, formDTO.getCompanyName());
wrapper.like(StringUtils.isNotBlank(formDTO.getContacts()), ThirdAppManageEntity::getContacts, formDTO.getContacts());
wrapper.like(StringUtils.isNotBlank(formDTO.getMobile()), ThirdAppManageEntity::getMobile, formDTO.getMobile());
wrapper.eq(StringUtils.isNotBlank(formDTO.getStatus()), ThirdAppManageEntity::getStatus, formDTO.getStatus());
wrapper.orderByDesc(ThirdAppManageEntity::getCreatedTime);
List<ThirdAppManageEntity> list = baseDao.selectList(wrapper);
PageInfo<ThirdAppManageEntity> pageInfo = new PageInfo<>(list);
return new PageData<>(ConvertUtils.sourceToTarget(list, ThirdAppManageDTO.class), pageInfo.getTotal());
}
@Override
public ThirdAppManageDTO get(String id) {
ThirdAppManageEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, ThirdAppManageDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(ThirdAppManageDTO dto) {
ThirdAppManageEntity entity = ConvertUtils.sourceToTarget(dto, ThirdAppManageEntity.class);
insert(entity);
}
/**
* 审核
*
* @param dto
* @Param dto
* @Return
* @Author zhaoqifeng
* @Date 2023/2/3 14:19
*/
@Override
public void audit(ThirdAppManageDTO dto) {
ThirdAppManageEntity info = baseDao.selectById(dto.getId());
if (!NumConstant.ZERO_STR.equals(info.getStatus())) {
String errorMsg = "应用已审核";
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg);
}
ThirdAppManageEntity entity = new ThirdAppManageEntity();
entity.setId(dto.getId());
entity.setStatus(dto.getStatus());
baseDao.updateById(entity);
}
/**
* 发布
*
* @param dto
* @Param dto
* @Return
* @Author zhaoqifeng
* @Date 2023/2/3 14:19
*/
@Override
public void release(ThirdAppManageDTO dto) {
ThirdAppManageEntity info = baseDao.selectById(dto.getId());
if (NumConstant.ZERO_STR.equals(info.getStatus())) {
String errorMsg = "应用未审核,请先审核";
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg);
} else if (NumConstant.ONE_STR.equals(info.getStatus())) {
String errorMsg = "应用审核不通过,不能发布";
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg);
} else if (NumConstant.THREE_STR.equals(info.getStatus())) {
String errorMsg = "应用已发布";
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg);
}
ThirdAppManageEntity entity = new ThirdAppManageEntity();
entity.setId(dto.getId());
entity.setStatus(NumConstant.THREE_STR);
baseDao.updateById(entity);
}
}

20
epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.10__third_app.sql

@ -0,0 +1,20 @@
CREATE TABLE `third_app_manage` (
`ID` varchar(64) NOT NULL COMMENT 'id',
`CUSTOMER_ID` varchar(64) DEFAULT NULL COMMENT '客户ID',
`NAME` varchar(64) NOT NULL COMMENT '应用名称',
`LINK` varchar(128) NOT NULL COMMENT '应用链接',
`ACCOUNT` varchar(64) NOT NULL COMMENT '账号',
`PASSWORD` varchar(64) NOT NULL COMMENT '密码',
`REMARK` text COMMENT '应用介绍',
`COMPANY_NAME` varchar(64) DEFAULT '0' COMMENT '第三方公司名',
`CONTACTS` varchar(64) NOT NULL COMMENT '联系人',
`MOBILE` varchar(32) NOT NULL COMMENT '联系电话',
`STATUS` varchar(1) DEFAULT '0' COMMENT '状态【0:未审核;1:审核不通过;2:审核通过;3:已发布】',
`REVISION` int(11) DEFAULT NULL COMMENT '乐观锁',
`DEL_FLAG` tinyint(1) unsigned DEFAULT NULL COMMENT '删除标识 0:未删除 1:删除',
`CREATED_BY` varchar(32) DEFAULT NULL COMMENT '创建者',
`CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新者',
`UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='烟台第三方应用管理';

27
epmet-module/gov-access/gov-access-server/src/main/resources/mapper/ThirdAppManageDao.xml

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.ThirdAppManageDao">
<resultMap type="com.epmet.entity.ThirdAppManageEntity" id="thirdAppManageMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="name" column="NAME"/>
<result property="link" column="LINK"/>
<result property="account" column="ACCOUNT"/>
<result property="password" column="PASSWORD"/>
<result property="remark" column="REMARK"/>
<result property="companyName" column="COMPANY_NAME"/>
<result property="contacts" column="CONTACTS"/>
<result property="mobile" column="MOBILE"/>
<result property="status" column="STATUS"/>
<result property="revision" column="REVISION"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

6
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyV2FormDTO.java

@ -118,4 +118,10 @@ public class AddAgencyV2FormDTO implements Serializable {
* 中心点位位置
*/
private String centerAddress;
/**
* 社区简介
*/
@Length(max = 500,message ="最多输入500字",groups =DefaultUserShowGroup.class )
private String remark;
}

32
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CommunityCountCensusFormDTO.java

@ -0,0 +1,32 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
/**
* @ClassName AgencyCountCensus$
* @Description
* @Date 2023/4/6 16:46
* @Author lichao
**/
@Data
public class CommunityCountCensusFormDTO implements Serializable {
private static final long serialVersionUID = 4360690752084258055L;
@NotBlank(message = "组织Id不能为空")
private String agencyId;
private Date timeStart;
private Date timeEnd;
private Integer pageNum;
private Integer pageSize;
}

3
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java

@ -110,4 +110,7 @@ public class EditAgencyFormDTO implements Serializable {
private String centerAddress;
private String customerId;
@Length(max = 500,message = "最多输入500字",groups =DefaultUserShowGroup.class )
private String remark;
}

13
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EnterprisePageFormDTO.java

@ -10,6 +10,19 @@ import java.io.Serializable;
*/
@Data
public class EnterprisePageFormDTO implements Serializable {
/**
* 组织id或者网格id
* 04.10添加次入参原型地址https://modao.cc/app/DUshpXWirii6amoDQsb8OP#screen=slfbvzaghxlqxhe
*/
private String orgId;
/**
* 组织agency
* 网格grid
* 04.10添加次入参原型地址https://modao.cc/app/DUshpXWirii6amoDQsb8OP#screen=slfbvzaghxlqxhe
*/
private String orgType;
/**
* 场所区域
*/

48
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GroupRentHouseFormDTO.java

@ -0,0 +1,48 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @Author yzm
* @Date 2023/3/2 17:35
*/
@Data
public class GroupRentHouseFormDTO extends PageFormDTO implements Serializable {
private static final long serialVersionUID = -953729855530434972L;
/**
* 组织ID
*/
private String orgId;
private String orgType;
/**
* 房主姓名
*/
private String ownerName;
/**
* 房主电话
*/
private String ownerPhone;
/**
* 房屋用途
*/
private String purpose;
/**
* 备注
*/
private String remark;
/**
* tokenDto获取
*/
private String customerId;
private String staffId;
}

30
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseCountPictureFormDTO.java

@ -0,0 +1,30 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Description 根据小区楼宇单元名称校验是否存在
* @Author wgf
* @Date 2022/8/24 9:03
*/
@Data
public class HouseCountPictureFormDTO implements Serializable {
private static final long serialVersionUID = 2636608477324780974L;
private String orgIdPath;
private Date timeStart;
private Date timeEnd;
private String purpose;
private Integer rentFlag;
private Integer pageSize;
private Integer pageNo;
}

41
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/CommunityLoginFormDTO.java

@ -0,0 +1,41 @@
package com.epmet.dto.form.yt;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* @Description 下级社区账号登录次数排名入参
* @Author yzm
* @Date 2023/4/6 14:18
*/
@Data
public class CommunityLoginFormDTO extends PageFormDTO {
/**
* 所选择的组织id
*/
private String orgId;
/**
* 组织类型
*/
private String level;
/**
* 开始日期yyyy-MM-dd
*/
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date startDate;
/**
* 截止日期yyyy-MM-dd
*/
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date endDate;
}

42
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/CountActivityFormDTO.java

@ -0,0 +1,42 @@
package com.epmet.dto.form.yt;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* @Description 下级社区账号登录次数排名入参
* @Author yzm
* @Date 2023/4/6 14:18
*/
@Data
public class CountActivityFormDTO extends PageFormDTO {
/**
* 所选择的组织id
*/
private String orgId;
/**
* 是否活跃 1 活跃 0 不活跃
*/
private String isActivity;
/**
* 开始日期yyyy-MM-dd
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date startDate;
/**
* 截止日期yyyy-MM-dd
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endDate;
}

15
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/EnterpriseCountPlaceTypeFormDTO.java

@ -0,0 +1,15 @@
package com.epmet.dto.form.yt;
import lombok.Data;
/**
* @Description 九小场所分析
* @Author yzm
* @Date 2023/4/7 16:47
*/
@Data
public class EnterpriseCountPlaceTypeFormDTO {
private String orgId;
private String orgType;
}

41
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/LoginLogCountByLevelFormDTO.java

@ -0,0 +1,41 @@
package com.epmet.dto.form.yt;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* @Description 账号登录情况查询市级账号/区县级账号/镇街级账号/社区级账号登录次数入参dto
* @Author yzm
* @Date 2023/4/6 10:09
*/
@Data
public class LoginLogCountByLevelFormDTO {
/**
* 所选择的组织id
*/
private String orgId;
/**
* 组织类型
*/
private String level;
/**
* 开始日期yyyy-MM-dd
*/
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date startDate;
/**
* 截止日期yyyy-MM-dd
*/
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date endDate;
}

20
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyCountCensusResultDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @ClassName AgencyCountCensus$
* @Description
* @Date 2023/4/6 16:46
* @Author lichao
**/
@Data
public class AgencyCountCensusResultDTO implements Serializable {
private static final long serialVersionUID = 4360690752084258055L;
private String level;
private Integer count;
}

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyResultDTO.java

@ -47,5 +47,8 @@ public class AgencyResultDTO implements Serializable {
private String longitude;
//维度【没值则取跟客户的值】
private String latitude;
/**
* agencyId的全路径包含自身
*/
private String orgIdPath;
}

4
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencySubResultDTO.java

@ -61,4 +61,8 @@ public class AgencySubResultDTO implements Serializable {
* 组织维度没值取根组织的值
*/
private String latitude = "";
/**
* agencyId的全路径包含自身
*/
private String orgIdPath;
}

4
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java

@ -35,6 +35,10 @@ public class AgencyTreeResultDTO implements Serializable {
* orgId-orgLevel
*/
private String orgLevel;
/**
* agencyId的全路径包含自身
*/
private String orgIdPath;
/**
* 下级机关组织
*/

4
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java

@ -133,4 +133,8 @@ public class AgencysResultDTO implements Serializable {
* 中心点位位置
*/
private String centerAddress;
private String remark;
private String coordinates;
}

23
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityCountCensusResultDTO.java

@ -0,0 +1,23 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @ClassName AgencyCountCensus$
* @Description
* @Date 2023/4/6 16:46
* @Author lichao
**/
@Data
public class CommunityCountCensusResultDTO implements Serializable {
private static final long serialVersionUID = 4360690752084258055L;
private String agencyId;
private String agencyName;
private Integer count;
}

33
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityListByAgencyIdResultDTO.java

@ -0,0 +1,33 @@
package com.epmet.dto.result;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @Description:
* @Author: lichao
* @Date: 2023/4/7 16:43
*/
@Data
public class CommunityListByAgencyIdResultDTO implements Serializable {
private static final long serialVersionUID = -1677303397440121269L;
private String id;
private String pids;
private String name;
private String streeName;
// private String streeId;
private String districtName;
// private String districtId;
private Date createTime;
}

2
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridDetailResultDTO.java

@ -96,4 +96,6 @@ public class GridDetailResultDTO implements Serializable {
*/
private Integer gridSort = 0;
private String coordinates;
}

77
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GroupRentHouseResultDTO.java

@ -0,0 +1,77 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 群租房列表
* @Author yzm
* @Date 2023/3/3 9:27
*/
@Data
public class GroupRentHouseResultDTO implements Serializable {
private static final long serialVersionUID = 3671964765109154117L;
private String houseId;
/**
* 所属组织
*/
private String agencyName;
private String agencyId;
/**
* 所属网格
*/
private String gridName;
private String gridId;
/**
* 所属小区
*/
private String neighborHoodName;
/**
* 所属楼栋
*/
private String buildingName;
private String houseName;
/**
* 房屋类型
*/
private String houseType;
private String houseTypeKey;
/**
* 房屋用途
*/
private String purpose;
private String purposeKey;
/**
* 房屋状态房屋状态:1出租 0自住 2闲置 3未售出
*/
private String rentFlag;
/**
* 房主姓名
*/
private String ownerName;
/**
* 房主电话
*/
private String ownerPhone;
/**
* 房主身份证
*/
private String ownerIdCard;
/**
* 备注
*/
private String remark;
/**
* 排序
*/
private Double sort;
}

23
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseCountPictureListResultDTO.java

@ -0,0 +1,23 @@
package com.epmet.dto.result;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* @Description:
* @Author: lichao
* @Date: 2023/4/11 15:05
*/
@NoArgsConstructor
@Data
public class HouseCountPictureListResultDTO implements Serializable {
private static final long serialVersionUID = 2063032844842070847L;
private String type;
private Integer count;
}

24
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseCountPictureResultDTO.java

@ -0,0 +1,24 @@
package com.epmet.dto.result;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* @Description:
* @Author: lichao
* @Date: 2023/4/11 15:05
*/
@NoArgsConstructor
@Data
public class HouseCountPictureResultDTO implements Serializable {
private static final long serialVersionUID = 2063032844842070847L;
private Integer total;
private List<HouseCountPictureListResultDTO> list;
}

37
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HousePictureListResultDTO.java

@ -0,0 +1,37 @@
package com.epmet.dto.result;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Description:
* @Author: lichao
* @Date: 2023/4/11 14:41
*/
@NoArgsConstructor
@Data
public class HousePictureListResultDTO implements Serializable {
private static final long serialVersionUID = 2063032844842070847L;
private String houseId;
private String districtName;
private String streetName;
private String communityName;
private String gridName;
private String houseName;
private String purposeName;
private String rentFlagName;
private String orgIdPath;
}

44
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/AccountActivityInfo.java

@ -0,0 +1,44 @@
package com.epmet.dto.result.yt;
import lombok.Data;
import java.io.Serializable;
/**
* @author: qushutong
* @Date: 2023/4/6 13:33
* @Description: 账户活跃情况
*/
@Data
public class AccountActivityInfo implements Serializable {
private static final long serialVersionUID = -918630886413844674L;
/**
* 组织名称
*/
private String agencyName = "";
/**
* 登陆次数
*/
private String loginCount = "";
/**
* 活跃账号数
*/
private String accountActivityCount = "";
/**
* 总账号数
*/
private String accountCount = "";
/**
* 组织id
*/
private String agencyId = "";
}

30
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/ActivityTatalInfo.java

@ -0,0 +1,30 @@
package com.epmet.dto.result.yt;
import lombok.Data;
import java.io.Serializable;
/**
* @author: qushutong
* @Date: 2023/4/6 13:33
* @Description: 账户活跃总数
*/
@Data
public class ActivityTatalInfo implements Serializable {
private static final long serialVersionUID = -918630886413844674L;
/**
* 不活跃账号总数
*/
private String inactivityCount = "";
/**
* 活跃账号总数
*/
private String activityCount = "";
}

37
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/CommunityLoginResultDTO.java

@ -0,0 +1,37 @@
package com.epmet.dto.result.yt;
import lombok.Data;
/**
* @Description 下级社区账号登录次数排名
* @Author yzm
* @Date 2023/4/6 14:15
*/
@Data
public class CommunityLoginResultDTO {
/**
* 组织id
*/
private String agencyId;
/**
* 组织名称
*/
private String agencyName;
/**
* 组织级别社区级community 街道:street, 区县级: district, 市级: city 省级:province
*/
private String agencyLevel;
/**
* 所属街道名称
*/
private String streetName;
/**
* 所属区县名称
*/
private String districtName;
/**
* 登录次数
*/
private Integer count;
}

24
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/EnterpriseCountPlaceTypeDetailDTO.java

@ -0,0 +1,24 @@
package com.epmet.dto.result.yt;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
/**
* @Description 九小场所分析
* @Author yzm
* @Date 2023/4/7 16:48
*/
@Data
public class EnterpriseCountPlaceTypeDetailDTO {
private String placeType;
private String placeTypeName;
private Integer total;
public EnterpriseCountPlaceTypeDetailDTO() {
this.total = NumConstant.ZERO;
}
}

17
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/EnterpriseCountPlaceTypeResDTO.java

@ -0,0 +1,17 @@
package com.epmet.dto.result.yt;
import lombok.Data;
import java.util.List;
/**
* @Description 九小场所分析
* @Author yzm
* @Date 2023/4/7 16:47
*/
@Data
public class EnterpriseCountPlaceTypeResDTO {
private Integer total;
private List<EnterpriseCountPlaceTypeDetailDTO> list;
}

29
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/LoginLogCountByLevelResultDTO.java

@ -0,0 +1,29 @@
package com.epmet.dto.result.yt;
import lombok.Data;
/**
* @Description 账号登录情况查询市级账号/区县级账号/镇街级账号/社区级账号登录次数返参dto
* @Author yzm
* @Date 2023/4/6 10:13
*/
@Data
public class LoginLogCountByLevelResultDTO {
/**
* 市级账号登录总次数-1时不展示
*/
private Integer cityCount;
/**
* 区县级账号登录总次数-1时不展示
*/
private Integer districtCount;
/**
* 镇街级账号登录总次数-1时不展示
*/
private Integer streetCount;
/**
* 社区级账号登录总次数-1时不展示
*/
private Integer communityCount;
}

10
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java

@ -21,7 +21,7 @@ import java.util.Set;
* @author yinzuomei@elink-cn.com
* @date 2020/6/4 13:37
*/
//@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallbackFactory = GovOrgOpenFeignClientFallbackFactory.class, url = "localhost:8092")
// @FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallbackFactory = GovOrgOpenFeignClientFallbackFactory.class, url = "localhost:8092")
@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallbackFactory = GovOrgOpenFeignClientFallbackFactory.class)
public interface GovOrgOpenFeignClient {
@ -757,4 +757,12 @@ public interface GovOrgOpenFeignClient {
@PostMapping("/gov/org/enterprise/sendEnterprisePatrolRemindMessage")
Result sendEnterprisePatrolRemindMessage();
/**
* 获取当前客户下所有的社区组织,只返回id,orgIdPathagencyName
* @param customerId
* @return
*/
@PostMapping("/gov/org/agency/getAllCommunity/{customerId}")
Result<List<AgencyResultDTO>> getAllCommunity(@PathVariable(value = "customerId") String customerId);
}

10
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java

@ -474,4 +474,14 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "gridStaffList", dto);
}
/**
* 获取当前客户下所有的社区组织,只返回id,orgIdPathagencyName
*
* @param customerId
* @return
*/
@Override
public Result<List<AgencyResultDTO>> getAllCommunity(String customerId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAllCommunity", customerId);
}
}

13
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java

@ -624,4 +624,17 @@ public class AgencyController {
String orgType = input.getOrgType();
return new Result<UsingCommunityStatsResultDTO>().ok(agencyService.usingCommunityStats(orgId, orgType));
}
/**
* @param customerId
* @return 获取当前客户下所有的社区组织,只返回id,orgIdPathagencyName
*/
@PostMapping("getAllCommunity/{customerId}")
public Result<List<AgencyResultDTO>> getAllCommunity(@PathVariable(value = "customerId") String customerId) {
if (StringUtils.isBlank(customerId)) {
return new Result<>();
}
return new Result<List<AgencyResultDTO>>().ok(agencyService.getAllCommunity(customerId));
}
}

46
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java

@ -251,6 +251,17 @@ public class CustomerAgencyController {
return new Result<StaffInAgencyListResultDTO>().ok(customerAgencyService.staffInAgencyList(tokenDTO.getUserId()));
}
/**
* @param tokenDTO
* @return
* @Author sun
* @Description 工作端-查询当前人员所属组织及所有下级组织到区县级
**/
@PostMapping("staffinAgencyLevelList")
public Result<StaffInAgencyListResultDTO> staffinAgencyLevelList(@LoginUser TokenDto tokenDTO) {
return new Result<StaffInAgencyListResultDTO>().ok(customerAgencyService.staffinAgencyLevelList(tokenDTO.getUserId()));
}
/**
* @Description 对外接口根据customerId返回Element UI中Tree结构的agency列表
* @param map
@ -517,5 +528,40 @@ public class CustomerAgencyController {
return customerAgencyService.getCurrentUserCommunityInfo(tokenDTO);
}
/**
* @Description: 返回下级数量统计
* @param agencyId:
* @Return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.dto.result.AgencyCountCensusResultDTO>>
* @Author: lichao
* @Date: 2023/4/7 14:48
*/
@GetMapping("getAgencyCountList")
public Result<List<AgencyCountCensusResultDTO>> getAgencyCountList(@RequestParam String agencyId){
return new Result<List<AgencyCountCensusResultDTO>>().ok(customerAgencyService.getAgencyCountList(agencyId));
}
/**
* @Description: 获取下级组织数量统计
* @param dto:
* @Return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.dto.result.CommunityCountCensusResultDTO>>
* @Author: lichao
* @Date: 2023/4/7 15:08
*/
@PostMapping("getCommunityCountList")
public Result<List<CommunityCountCensusResultDTO>> getCommunityCountList(@RequestBody CommunityCountCensusFormDTO dto){
return new Result<List<CommunityCountCensusResultDTO>>().ok(customerAgencyService.getCommunityCountList(dto));
}
/**
* @Description: 根据agencyId获取下级社区列表
* @param dto:
* @Return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.dto.result.CommunityListByAgencyIdResultDTO>>
* @Author: lichao
* @Date: 2023/4/7 16:49
*/
@PostMapping("getCommunityList")
public Result<PageData<CommunityListByAgencyIdResultDTO>> getCommunityList(@RequestBody CommunityCountCensusFormDTO dto){
return new Result<PageData<CommunityListByAgencyIdResultDTO>>().ok(customerAgencyService.getCommunityList(dto));
}
}

17
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java

@ -691,4 +691,21 @@ public class HouseController implements ResultDataResolver {
return new Result<PageData<SubUserHouseListResultDTO>>().ok(r);
}
/**
* 群租房列表来源于烟台需求
* @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("group-rent-house-list")
@MaskResponse(fieldNames = {"ownerIdCard", "ownerPhone"},
fieldsMaskType = {MaskResponse.MASK_TYPE_ID_CARD, MaskResponse.MASK_TYPE_MOBILE})
public Result<PageData<GroupRentHouseResultDTO>> groupRentHouseList(@LoginUser TokenDto tokenDto, @RequestBody GroupRentHouseFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
return new Result<PageData<GroupRentHouseResultDTO>>().ok(houseService.groupRentHouseList(formDTO));
}
}

17
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcEnterpriseController.java

@ -22,14 +22,15 @@ import com.epmet.commons.tools.utils.*;
import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dto.IcEnterpriseChangeRecordDTO;
import com.epmet.dto.form.EnterpriseFormDTO;
import com.epmet.dto.form.EnterprisePageFormDTO;
import com.epmet.dto.form.EnterprisePatrolFormDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.form.yt.EnterpriseCountPlaceTypeFormDTO;
import com.epmet.dto.result.EnterpriseDetailDTO;
import com.epmet.dto.result.EnterprisePatrolResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.dto.result.yt.EnterpriseCountPlaceTypeResDTO;
import com.epmet.excel.EnterpriseExportExcelDTO;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.service.IcEnterpriseService;
@ -69,6 +70,7 @@ public class IcEnterpriseController implements ResultDataResolver {
private IcEnterpriseService icEnterpriseService;
@Autowired
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient;
/**
* 企事业单位巡查新增/编辑
*
@ -359,4 +361,17 @@ public class IcEnterpriseController implements ResultDataResolver {
icEnterpriseService.qrCodeExport(formDTO,response);
}
/**
* 九小场所分析:返回各个场所类型的数量
*
* @param formDTO
* @return
*/
@PostMapping("count-type")
public Result<EnterpriseCountPlaceTypeResDTO> countType(@RequestBody EnterpriseCountPlaceTypeFormDTO formDTO) {
return new Result<EnterpriseCountPlaceTypeResDTO>().ok(icEnterpriseService.countType(formDTO.getOrgId(), formDTO.getOrgType()));
}
}

113
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java

@ -17,24 +17,47 @@
package com.epmet.controller;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.metadata.style.WriteCellStyle;
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.annotation.MaskResponse;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.IcHouseDTO;
import com.epmet.dto.form.CheckHouseInfoFormDTO;
import com.epmet.dto.form.HouseCountPictureFormDTO;
import com.epmet.dto.form.HouseFormDTO;
import com.epmet.dto.result.HouseAgencyInfoResultDTO;
import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.HouseListResultDTO;
import com.epmet.dto.result.HousesNameResultDTO;
import com.epmet.dto.result.*;
import com.epmet.excel.EnterpriseExportExcelDTO;
import com.epmet.excel.HousePictureListExcelDTO;
import com.epmet.service.IcHouseService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -45,6 +68,7 @@ import java.util.Map;
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-25
*/
@Slf4j
@RestController
@RequestMapping("ichouse")
public class IcHouseController {
@ -161,4 +185,85 @@ public class IcHouseController {
return icHouseService.checkHomeInfo(formDTO);
}
/**
* @Description: 房屋画像-用途统计
* @param dto:
* @Return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.HouseCountPictureResultDTO>
* @Author: lichao
* @Date: 2023/4/11 15:08
*/
@PostMapping("getHousePurposeCount")
public Result<HouseCountPictureResultDTO> getHousePurposeCount(@RequestBody HouseCountPictureFormDTO dto){
return new Result<HouseCountPictureResultDTO>().ok(icHouseService.getHousePurposeCount(dto));
}
/**
* @Description: 房屋画像-状态统计
* @param dto:
* @Return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.HouseCountPictureResultDTO>
* @Author: lichao
* @Date: 2023/4/11 15:07
*/
@PostMapping("getHouseStatusCount")
public Result<HouseCountPictureResultDTO> getHouseStatusCount(@RequestBody HouseCountPictureFormDTO dto){
return new Result<HouseCountPictureResultDTO>().ok(icHouseService.getHouseStatusCount(dto));
}
/**
* @Description: 房屋画像-列表
* @param dto:
* @Return com.epmet.commons.tools.utils.Result<com.epmet.commons.tools.page.PageData < com.epmet.dto.result.HousePictureListResultDTO>>
* @Author: lichao
* @Date: 2023/4/11 16:20
*/
@PostMapping("getHousePictureList")
public Result<PageData<HousePictureListResultDTO>> getHousePictureList(@RequestBody HouseCountPictureFormDTO dto){
return new Result<PageData<HousePictureListResultDTO>>().ok(icHouseService.getHousePictureList(dto));
}
@PostMapping("export")
public void export(@RequestBody HouseCountPictureFormDTO formDTO, HttpServletResponse response) throws IOException {
ExcelWriter excelWriter = null;
formDTO.setPageNo(NumConstant.ONE);
formDTO.setPageSize(NumConstant.TEN_THOUSAND);
try {
String fileName = "房屋列表" + DateUtils.format(new Date()) + ".xlsx";
// 头的策略
WriteCellStyle headWriteCellStyle = new WriteCellStyle();
// 背景设置为红色
headWriteCellStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex());
WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle);
FreezeAndFilter writeHandler = new FreezeAndFilter();
excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), HousePictureListExcelDTO.class)
.registerWriteHandler(horizontalCellStyleStrategy)
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
.registerWriteHandler(writeHandler).build();
WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build();
PageData<HousePictureListResultDTO> data = null;
List<HousePictureListExcelDTO> list = null;
do {
data = icHouseService.getHousePictureList(formDTO);
list = ConvertUtils.sourceToTarget(data.getList(), HousePictureListExcelDTO.class);
formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE);
excelWriter.write(list, writeSheet);
} while (CollectionUtils.isNotEmpty(list) && list.size() == formDTO.getPageSize());
} catch (EpmetException e) {
response.reset();
response.setCharacterEncoding("UTF-8");
response.setHeader("content-type", "application/json; charset=UTF-8");
PrintWriter printWriter = response.getWriter();
Result<Object> result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), e.getMsg());
printWriter.write(JSON.toJSONString(result));
printWriter.close();
} catch (Exception e) {
log.error("房屋列表导出异常export exception", e);
} finally {
if (excelWriter != null) {
excelWriter.finish();
}
}
}
}

154
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffLoginLogController.java

@ -0,0 +1,154 @@
package com.epmet.controller;
import com.alibaba.nacos.client.naming.utils.CollectionUtils;
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.ConvertUtils;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.yt.CommunityLoginFormDTO;
import com.epmet.dto.form.yt.CountActivityFormDTO;
import com.epmet.dto.form.yt.LoginLogCountByLevelFormDTO;
import com.epmet.dto.result.yt.ActivityTatalInfo;
import com.epmet.dto.result.yt.CommunityLoginResultDTO;
import com.epmet.dto.result.yt.LoginLogCountByLevelResultDTO;
import com.epmet.excel.yt.AccountActivityExcel;
import com.epmet.excel.yt.AccountInactivityExcel;
import com.epmet.service.StaffLoginLogService;
import 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 com.epmet.dto.result.yt.AccountActivityInfo;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 工作人员登录日志表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-04-04
*/
@RestController
@RequestMapping("staffLoginLog")
public class StaffLoginLogController {
@Autowired
private StaffLoginLogService staffLoginLogService;
/**
* 返回市级账号登录总次数区县级账号登录总次数镇街级账号登录总次数社区级账号登录总次数
*
* @param formDTO
* @return
*/
@PostMapping("count-level")
public Result<LoginLogCountByLevelResultDTO> countLevel(@RequestBody LoginLogCountByLevelFormDTO formDTO) {
return new Result<LoginLogCountByLevelResultDTO>().ok(staffLoginLogService.countLevel(formDTO.getOrgId(), formDTO.getLevel(), formDTO.getStartDate(), formDTO.getEndDate()));
}
/**
* 下级社区账号登录次数排名
*
* @return
*/
@PostMapping("community-count")
public Result<PageData<CommunityLoginResultDTO>> communityCount(@RequestBody CommunityLoginFormDTO formDTO) {
return new Result<PageData<CommunityLoginResultDTO>>().ok(staffLoginLogService.pageCommunityCount(formDTO));
}
/**
* 柱状图下级组织账号登录次数汇总
*
* @param formDTO
* @return
*/
@PostMapping("sub-count")
public Result<PageData<CommunityLoginResultDTO>> querySubCount(@RequestBody LoginLogCountByLevelFormDTO formDTO) {
return new Result<PageData<CommunityLoginResultDTO>>().ok(staffLoginLogService.querySubCount(formDTO.getOrgId(), formDTO.getLevel(), formDTO.getStartDate(), formDTO.getEndDate()));
}
/**
* 查看区县
*
* @param formDTO
* @return
*/
@PostMapping("district-count")
public Result<PageData<CommunityLoginResultDTO>> districtCount(@RequestBody CommunityLoginFormDTO formDTO) {
return new Result<PageData<CommunityLoginResultDTO>>().ok(staffLoginLogService.pageDistrictCount(formDTO.getOrgId(),
formDTO.getLevel(), formDTO.getStartDate(),
formDTO.getEndDate(), formDTO.getIsPage(),
formDTO.getPageNo(), formDTO.getPageSize()));
}
/**
* 查看街镇
*
* @param formDTO
* @return
*/
@PostMapping("street-count")
public Result<PageData<CommunityLoginResultDTO>> streetCount(@RequestBody CommunityLoginFormDTO formDTO) {
return new Result<PageData<CommunityLoginResultDTO>>().ok(staffLoginLogService.streetCount(formDTO.getOrgId(),
formDTO.getStartDate(),
formDTO.getEndDate(), formDTO.getIsPage(),
formDTO.getPageNo(), formDTO.getPageSize()));
}
/***
* 获取当前agencyid下 下级组织活跃情况
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.yt.AccountActivityInfo>
* @author qushutong
* @date 2023/4/6 13:41
*/
@PostMapping("getAccountActivityInfo")
public Result<PageData<AccountActivityInfo>> getAccountActivityInfo(@RequestBody CountActivityFormDTO formDTO) {
return new Result<PageData<AccountActivityInfo>>().ok(staffLoginLogService.getAccountActivityInfo(formDTO));
}
/***
* 获取活跃度总数
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.commons.tools.page.PageData < com.epmet.dto.result.yt.AccountActivityInfo>>
* @author qushutong
* @date 2023/4/6 17:35
*/
@PostMapping("getActivityTotal")
public Result<ActivityTatalInfo> getActivityTotal(@RequestBody CountActivityFormDTO formDTO) {
return new Result<ActivityTatalInfo>().ok(staffLoginLogService.getActivityTotal(formDTO));
}
/***
* 导出活跃
* @param response
* @param tokenDto
* @param formDTO
* @return void
* @author qushutong
* @date 2023/4/6 18:04
*/
@PostMapping("accountActivityInfo-export")
public void analysisExport(HttpServletResponse response, @LoginUser TokenDto tokenDto, @RequestBody CountActivityFormDTO formDTO) throws Exception {
formDTO.setIsPage(false);
PageData<AccountActivityInfo> res = staffLoginLogService.getAccountActivityInfo(formDTO);
if (!CollectionUtils.isEmpty(res.getList())) {
if("1".equals(formDTO.getIsActivity())){
// List<AccountActivityExcel> accountActivityExcels = ConvertUtils.sourceToTarget(res.getList(), AccountActivityExcel.class);
ExcelUtils.exportExcelToTarget(response, null, res.getList(), AccountActivityExcel.class);
}else {
// List<AccountInactivityExcel> accountActivityExcels = ConvertUtils.sourceToTarget(res.getList(), AccountInactivityExcel.class);
ExcelUtils.exportExcelToTarget(response, null, res.getList(), AccountInactivityExcel.class);
}
}
}
}

21
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java

@ -108,6 +108,8 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
**/
List<AgencySubResultDTO> selectSubAgencyList(@Param("subAgencyPids") String subAgencyPids);
List<AgencySubResultDTO> selectSubAgencyLevelList(@Param("subAgencyPids") String subAgencyPids);
/**
* 查询客户根级组织
*
@ -195,6 +197,8 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
**/
AgencyResultDTO selectAgencyByStaffId(@Param("staffId") String staffId);
// AgencyResultDTO selectAgencyByLevelStaffId(@Param("staffId") String staffId);
/**
* @param customerId
* @param pid
@ -422,5 +426,22 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
* @return
*/
Integer selectTotalNext(String agencyId);
/**
* 获取当前客户下所有的社区组织,只返回id,orgIdPathagencyName
* @param customerId
* @return
*/
List<AgencyResultDTO> getAllCommunity(String customerId);
List<AgencyCountCensusResultDTO> agencyCount(@Param("pids") String pids);
Integer agencyGridCount(@Param("pids") String pids);
Integer agencyStaffCount(@Param("pids") String pids);
Integer getCommunityCount(@Param("pids")String pids,@Param("timeStart")Date timeStart,@Param("timeEnd")Date timeEnd);
List<CommunityListByAgencyIdResultDTO> getCommunityByPidList (@Param("pids")String pids,@Param("timeStart")Date timeStart,@Param("timeEnd")Date timeEnd);
}

11
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcEnterpriseDao.java

@ -3,6 +3,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.EnterprisePageFormDTO;
import com.epmet.dto.result.EnterpriseDetailDTO;
import com.epmet.dto.result.yt.EnterpriseCountPlaceTypeDetailDTO;
import com.epmet.entity.IcEnterpriseEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -32,4 +33,14 @@ public interface IcEnterpriseDao extends BaseDao<IcEnterpriseEntity> {
List<EnterpriseDetailDTO> selectList(EnterprisePageFormDTO formDTO);
List<IcEnterpriseEntity> selectForUniqueName(@Param("gridId") String gridId, @Param("placeOrgName") String placeOrgName, @Param("enterpriseId") String enterpriseId);
/**
* 按场所类型
* @param orgId
* @param orgType
* @return
*/
List<EnterpriseCountPlaceTypeDetailDTO> selectCountByPlaceType(@Param("customerId")String customerId,
@Param("orgId") String orgId,
@Param("orgType") String orgType);
}

20
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java

@ -2,10 +2,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.ImportGeneralDTO;
import com.epmet.dto.form.CheckHouseInfoFormDTO;
import com.epmet.dto.form.GetHouseInfoToCollectFormDTO;
import com.epmet.dto.form.HouseChartFormDTO;
import com.epmet.dto.form.IcHouseListFormDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.CustomerOrgParameterEntity;
import com.epmet.entity.IcHouseEntity;
@ -13,6 +10,7 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Set;
@ -213,4 +211,18 @@ public interface IcHouseDao extends BaseDao<IcHouseEntity> {
List<IcHouseListResultDTO> houseStatisListDetail(HouseChartFormDTO formDTO);
List<IcHouseEntity> selectListForRenFangStats(@Param("buildingId") String buildingId);
/**
* 群租房列表
* 群租房出租状态并超过5人5
* @param formDTO
* @return
*/
List<GroupRentHouseResultDTO> selectGroupRentHouseList(GroupRentHouseFormDTO formDTO);
List<HouseCountPictureListResultDTO> getHousePurposeCount(@Param("orgId") String orgId, @Param("timeStart")Date timeStart,@Param("timeEnd")Date timeEnd);
List<HouseCountPictureListResultDTO> getHouseStatusCount(@Param("orgId") String orgId, @Param("timeStart")Date timeStart,@Param("timeEnd")Date timeEnd);
List<HousePictureListResultDTO> getHousePictureList(@Param("orgId") String orgId, @Param("timeStart")Date timeStart,@Param("timeEnd")Date timeEnd,@Param("purpose") String purpose,@Param("rentFlag") Integer rentFlag);
}

75
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffLoginLogDao.java

@ -0,0 +1,75 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.yt.CountActivityFormDTO;
import com.epmet.dto.result.yt.ActivityTatalInfo;
import com.epmet.dto.result.yt.CommunityLoginResultDTO;
import com.epmet.dto.result.yt.AccountActivityInfo;
import com.epmet.entity.StaffLoginLogEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
/**
* 工作人员登录日志表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-04-04
*/
@Mapper
public interface StaffLoginLogDao extends BaseDao<StaffLoginLogEntity> {
/**
* 各社区登录总次数
*
* @param orgId
* @param startDate
* @param endDate
* @return
*/
List<CommunityLoginResultDTO> pageCommunityCount(@Param("orgId") String orgId,
@Param("startDate") Date startDate,
@Param("endDate") Date endDate);
/**
* 柱状图下级组织账号登录次数汇总
*
* @param orgId
* @param startDate
* @param endDate
* @return
*/
List<CommunityLoginResultDTO> querySubCount(@Param("orgId") String orgId,
@Param("startDate") Date startDate,
@Param("endDate") Date endDate);
/**
* 各区县登录总次数
*
* @param orgId
* @param startDate
* @param endDate
* @return
*/
List<CommunityLoginResultDTO> pageDistrictCount(@Param("orgId") String orgId,
@Param("startDate") Date startDate,
@Param("endDate") Date endDate);
List<CommunityLoginResultDTO> pageStreetCount(@Param("orgId") String orgId,
@Param("startDate") Date startDate,
@Param("endDate") Date endDate);
/***
* 获取登陆情况
* @param formDTO
* @return com.epmet.dto.result.yt.AccountActivityInfo
* @author qushutong
* @date 2023/4/6 13:47
*/
List<AccountActivityInfo> selectListActivityInfo(CountActivityFormDTO formDTO);
ActivityTatalInfo selectOneActivityTotal(CountActivityFormDTO formDTO);
}

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java

@ -143,4 +143,10 @@ public class CustomerAgencyEntity extends BaseEpmetEntity {
* 联系电话
*/
private String mobile;
/**
* 备注
*/
private String remark;
}

73
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/StaffLoginLogEntity.java

@ -0,0 +1,73 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 工作人员登录日志表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-04-04
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("staff_login_log")
public class StaffLoginLogEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 工作端用户id
*/
private String staffId;
/**
* 工作人员姓名
*/
private String staffName;
/**
* 工作人员手机号
*/
private String mobile;
/**
* 工作人员所属组织id组织名称在customer_agency
*/
private String agencyId;
/**
* 组织级别社区级community
街道:street,
区县级: district,
市级: city
省级:province
*/
private String agencyLevel;
/**
* agency_id的直属上级如果是根组织的用户登录pid=0或者pid=''
*/
private String pid;
/**
* AGENCY_ID全路径包含agency_id自身
*/
private String orgIdPath;
/**
* 登录时间
*/
private Date loginTime;
}

50
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/HousePictureListExcelDTO.java

@ -0,0 +1,50 @@
package com.epmet.excel;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
import java.util.Date;
/**
* 企事业单位导出excel
*/
@Data
public class HousePictureListExcelDTO {
@ExcelIgnore
private String houseId;
@ExcelProperty(value = "区县")
@ColumnWidth(25)
private String districtName;
@ExcelProperty(value = "镇街")
@ColumnWidth(25)
private String streetName;
@ExcelProperty(value = "社区")
@ColumnWidth(25)
private String communityName;
@ExcelProperty(value = "网格")
@ColumnWidth(25)
private String gridName;
@ExcelProperty(value = "房屋名称")
@ColumnWidth(25)
private String houseName;
@ExcelProperty(value = "房屋用途")
@ColumnWidth(25)
private String purposeName;
@ExcelProperty(value = "房屋状态")
@ColumnWidth(25)
private String rentFlagName;
@ExcelIgnore
private String orgIdPath;
}

45
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/yt/AccountActivityExcel.java

@ -0,0 +1,45 @@
package com.epmet.excel.yt;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.io.Serializable;
/**
* @author: qushutong
* @Date: 2023/4/6 13:33
* @Description: 账户活跃情况
*/
@Data
public class AccountActivityExcel implements Serializable {
private static final long serialVersionUID = -918630886413844674L;
/**
* 组织名称
*/
@Excel(name = "组织名称")
private String agencyName = "";
/**
* 登陆次数
*/
@Excel(name = "登陆次数")
private String loginCount = "";
/**
* 活跃账号数
*/
@Excel(name = "活跃账号数")
private String accountActivityCount = "";
/**
* 总账号数
*/
@Excel(name = "总账号数")
private String accountCount = "";
}

28
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/yt/AccountInactivityExcel.java

@ -0,0 +1,28 @@
package com.epmet.excel.yt;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.io.Serializable;
/**
* @author: qushutong
* @Date: 2023/4/6 13:33
* @Description: 账户不活跃情况
*/
@Data
public class AccountInactivityExcel implements Serializable {
private static final long serialVersionUID = -918630886413844674L;
/**
* 组织名称
*/
@Excel(name = "组织名称")
private String agencyName = "";
}

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java

@ -5,6 +5,7 @@ import com.epmet.commons.rocketmq.constants.TopicConstants;
import com.epmet.commons.rocketmq.register.MQAbstractRegister;
import com.epmet.commons.rocketmq.register.MQConsumerProperties;
import com.epmet.mq.listener.InitCustomerOrgRolesListener;
import com.epmet.mq.listener.StaffLoginLogListener;
import org.apache.rocketmq.common.protocol.heartbeat.MessageModel;
import org.springframework.stereotype.Component;
@ -32,5 +33,10 @@ public class RocketMQConsumerRegister extends MQAbstractRegister {
new InitCustomerOrgRolesListener());
// ...其他监听器类似
register(consumerProperties,
ConsomerGroupConstants.STAFF_LOGIN_LOG_GROUP,
MessageModel.CLUSTERING,
TopicConstants.AUTH, "login",
new StaffLoginLogListener());
}
}

110
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/mq/listener/StaffLoginLogListener.java

@ -0,0 +1,110 @@
package com.epmet.mq.listener;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.rocketmq.constants.MQUserPropertys;
import com.epmet.commons.rocketmq.messages.LoginMQMsg;
import com.epmet.commons.tools.distributedlock.DistributedLock;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.utils.SpringContextUtils;
import com.epmet.service.StaffLoginLogService;
import org.apache.commons.lang3.StringUtils;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently;
import org.apache.rocketmq.common.message.MessageExt;
import org.redisson.api.RLock;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
* @author wxz
* @Description 登录操作日志监听器
* @return
* @date 2021.06.07 16:12
*/
public class StaffLoginLogListener implements MessageListenerConcurrently {
private Logger logger = LoggerFactory.getLogger(getClass());
private RedisUtils redisUtils;
@Override
public ConsumeConcurrentlyStatus consumeMessage(List<MessageExt> msgs, ConsumeConcurrentlyContext context) {
if (redisUtils == null) {
redisUtils = SpringContextUtils.getBean(RedisUtils.class);
}
try {
msgs.forEach(msg -> consumeMessage(msg));
} catch (Exception e) {
logger.error(ExceptionUtils.getErrorStackTrace(e));
return ConsumeConcurrentlyStatus.RECONSUME_LATER;
}
return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;
}
private void consumeMessage(MessageExt messageExt) {
String tags = messageExt.getTags();
// msg示例:
// {
// "userId": "5198ef9e3644c4f49457d2b551a1432e",
// "appId": "数字社区登录",
// "loginTime": "2023-04-04 14:05:37",
// "ip": "219.146.91.110",
// "fromApp": "gov",
// "fromClient": "web"
// }
String msg = new String(messageExt.getBody());
String pendingMsgLabel = messageExt.getUserProperty(MQUserPropertys.BLOCKED_MSG_LABEL);
logger.info("工作人员登录操作日志监听器-收到消息内容:{}", msg);
LoginMQMsg msgObj = JSON.parseObject(msg, LoginMQMsg.class);
DistributedLock distributedLock = null;
RLock lock = null;
try {
distributedLock = SpringContextUtils.getBean(DistributedLock.class);
lock = distributedLock.getLock(String.format("lock:staff_login_log:%s:%s", tags, msgObj.getUserId()),
30L, 30L, TimeUnit.SECONDS);
SpringContextUtils.getBean(StaffLoginLogService.class).saveLog(msgObj.getUserId(),msgObj.getLoginTime());
} catch (RenException e) {
// 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试
logger.error("【RocketMQ】工作人员登录添加操作日志失败:".concat(ExceptionUtils.getErrorStackTrace(e)));
} catch (Exception e) {
// 不是我们自己抛出的异常,可以让MQ重试
logger.error("【RocketMQ】工作人员登录添加操作日志失败:".concat(ExceptionUtils.getErrorStackTrace(e)));
throw e;
} finally {
distributedLock.unLock(lock);
}
if (StringUtils.isNotBlank(pendingMsgLabel)) {
try {
removePendingMqMsgCache(pendingMsgLabel);
} catch (Exception e) {
logger.error("【工作人员登录操作事件监听器】-删除mq阻塞消息缓存失败:{}", ExceptionUtils.getErrorStackTrace(e));
}
}
}
/**
* @description
*
* @param pendingMsgLabel
* @return
* @author wxz
* @date 2021.10.14 16:32:32
*/
private void removePendingMqMsgCache(String pendingMsgLabel) {
String key = RedisKeys.blockedMqMsgKey(pendingMsgLabel);
redisUtils.delete(key);
//logger.info("【登录操作事件监听器】删除pendingMsgLabel成功:{}", pendingMsgLabel);
}
}

7
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java

@ -204,4 +204,11 @@ public interface AgencyService {
* @return
*/
UsingCommunityStatsResultDTO usingCommunityStats(String orgId, String orgType);
/**
* 获取当前客户下所有的社区组织,只返回id,orgIdPathagencyName
* @param customerId
* @return
*/
List<AgencyResultDTO> getAllCommunity(String customerId);
}

37
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java

@ -18,7 +18,6 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
@ -216,6 +215,9 @@ public interface CustomerAgencyService extends BaseService<CustomerAgencyEntity>
**/
StaffInAgencyListResultDTO staffInAgencyList(String staffId);
StaffInAgencyListResultDTO staffinAgencyLevelList(String staffId);
/**
* @Description 运营端-返回element ui - tree 结构agency列表
* @param customerId
@ -355,4 +357,37 @@ public interface CustomerAgencyService extends BaseService<CustomerAgencyEntity>
* @Date 2022/11/30 22:41
**/
Result<List<CurrentUserCommunityInfoResultDTO>> getCurrentUserCommunityInfo(TokenDto tokenDTO);
/**
* 返回组织的orgIdPath包含自身
*
* @param orgId
* @return
*/
String getOrgIdPath(String orgId);
/**
* 返回下级数量
* @param agencyId
* @return
*/
List<AgencyCountCensusResultDTO> getAgencyCountList(String agencyId);
/**
* @Description: 获取下级组织的社区数量
* @param dto:
* @Return java.util.List<com.epmet.dto.result.CommunityCountCensusResultDTO>
* @Author: lichao
* @Date: 2023/4/7 15:09
*/
List<CommunityCountCensusResultDTO> getCommunityCountList(CommunityCountCensusFormDTO dto);
/**
* @Description: 根据agencyId获取下级社区列表
* @param dto:
* @Return java.util.List<com.epmet.dto.result.CommunityListByAgencyIdResultDTO>
* @Author: lichao
* @Date: 2023/4/7 16:49
*/
PageData<CommunityListByAgencyIdResultDTO> getCommunityList(CommunityCountCensusFormDTO dto);
}

7
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java

@ -204,4 +204,11 @@ public interface HouseService {
PageData<IcHouseListResultDTO> houseStatisListDetail(HouseChartFormDTO formDTO);
PageData<SubUserHouseListResultDTO> usingCommunityUserHouseStats(String orgId, String orgType, Integer pageNo, Integer pageSize);
/**
* 群租房列表来源于烟台需求
* @param formDTO
* @return
*/
PageData<GroupRentHouseResultDTO> groupRentHouseList(GroupRentHouseFormDTO formDTO);
}

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcEnterpriseService.java

@ -2,19 +2,17 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcEnterpriseChangeRecordDTO;
import com.epmet.dto.form.EnterpriseFormDTO;
import com.epmet.dto.form.EnterprisePageFormDTO;
import com.epmet.dto.form.EnterprisePatrolFormDTO;
import com.epmet.dto.result.EnterpriseDetailDTO;
import com.epmet.dto.result.EnterprisePatrolResultDTO;
import com.epmet.dto.result.yt.EnterpriseCountPlaceTypeResDTO;
import com.epmet.entity.IcEnterpriseEntity;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.nio.file.Path;
import java.util.List;
import java.util.Map;
/**
@ -103,4 +101,12 @@ public interface IcEnterpriseService extends BaseService<IcEnterpriseEntity> {
*/
void qrCodeExport(EnterprisePageFormDTO formDTO, HttpServletResponse response) throws IOException;
/**
* 九小场所分析:返回各个场所类型的数量
*
* @param orgId
* @param orgType
* @return
*/
EnterpriseCountPlaceTypeResDTO countType(String orgId, String orgType);
}

7
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java

@ -2,12 +2,14 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.IcHouseDTO;
import com.epmet.dto.ImportGeneralDTO;
import com.epmet.dto.form.CheckHouseInfoFormDTO;
import com.epmet.dto.form.DetailByTypeFormDTO;
import com.epmet.dto.form.HouseCountPictureFormDTO;
import com.epmet.dto.form.HouseFormDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.IcHouseEntity;
@ -139,4 +141,9 @@ public interface IcHouseService extends BaseService<IcHouseEntity> {
Result checkHomeInfo(CheckHouseInfoFormDTO formDTO);
HouseCountPictureResultDTO getHousePurposeCount(HouseCountPictureFormDTO dto);
HouseCountPictureResultDTO getHouseStatusCount(HouseCountPictureFormDTO dto);
PageData<HousePictureListResultDTO> getHousePictureList(HouseCountPictureFormDTO dto);
}

97
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffLoginLogService.java

@ -0,0 +1,97 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.form.yt.CommunityLoginFormDTO;
import com.epmet.dto.form.yt.CountActivityFormDTO;
import com.epmet.dto.result.yt.ActivityTatalInfo;
import com.epmet.dto.result.yt.CommunityLoginResultDTO;
import com.epmet.dto.result.yt.LoginLogCountByLevelResultDTO;
import com.epmet.dto.result.yt.AccountActivityInfo;
import com.epmet.entity.StaffLoginLogEntity;
import java.util.Date;
/**
* 工作人员登录日志表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-04-04
*/
public interface StaffLoginLogService extends BaseService<StaffLoginLogEntity> {
/**
* 登录插入记录
*
* @param staffId
* @param loginTime
*/
void saveLog(String staffId, Date loginTime);
/**
* 返回市级账号登录总次数区县级账号登录总次数镇街级账号登录总次数社区级账号登录总次数
*
* @param orgId 为空时默认当前登录用户所属组织id
* @param level
* @param startDate yyyy-MM-dd
* @param endDate yyyy-MM-dd
* @return
*/
LoginLogCountByLevelResultDTO countLevel(String orgId, String level, Date startDate, Date endDate);
/**
* 下级社区账号登录次数排名
*
* @param formDTO
* @return
*/
PageData<CommunityLoginResultDTO> pageCommunityCount(CommunityLoginFormDTO formDTO);
/**
* 柱状图下级组织账号登录次数汇总
*
* @param orgId
* @param level
* @param startDate
* @param endDate
* @return
*/
PageData<CommunityLoginResultDTO> querySubCount(String orgId, String level, Date startDate, Date endDate);
/**
* 查看区县
*
* @param orgId
* @param level
* @param startDate
* @param endDate
* @param isPage
* @param pageNo
* @param pageSize
* @return
*/
PageData<CommunityLoginResultDTO> pageDistrictCount(String orgId, String level, Date startDate, Date endDate, Boolean isPage, Integer pageNo, Integer pageSize);
/**
* 查看街镇
*
* @param orgId
* @param startDate
* @param endDate
* @param isPage
* @param pageNo
* @param pageSize
* @return
*/
PageData<CommunityLoginResultDTO> streetCount(String orgId, Date startDate, Date endDate, Boolean isPage, Integer pageNo, Integer pageSize);
/***
* 获取登陆情况
* @param formDTO
* @return com.epmet.dto.result.yt.AccountActivityInfo
* @author qushutong
* @date 2023/4/6 13:47
*/
PageData<AccountActivityInfo> getAccountActivityInfo(CountActivityFormDTO formDTO);
ActivityTatalInfo getActivityTotal(CountActivityFormDTO formDTO);
}

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java

@ -166,6 +166,7 @@ public class AgencyServiceImpl implements AgencyService {
originalEntity.setCode(formDTO.getCode());
originalEntity.setContacts(formDTO.getContacts());
originalEntity.setMobile(formDTO.getMobile());
originalEntity.setRemark(formDTO.getRemark());
//利用mybatis 拦截器填充值
originalEntity.setUpdatedTime(null);
originalEntity.setUpdatedBy(null);
@ -1167,4 +1168,15 @@ public class AgencyServiceImpl implements AgencyService {
return orgPids.concat(":").concat(orgId);
}
/**
* 获取当前客户下所有的社区组织,只返回id,orgIdPathagencyName
*
* @param customerId
* @return
*/
@Override
public List<AgencyResultDTO> getAllCommunity(String customerId) {
return customerAgencyDao.getAllCommunity(customerId);
}
}

153
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java

@ -17,6 +17,7 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -37,12 +38,14 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.PidUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.CustomerAgencyConstant;
import com.epmet.constant.CustomerGridConstant;
import com.epmet.dao.*;
import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.region.LogOperationResultDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.CustomerAgencyEntity;
import com.epmet.entity.CustomerDepartmentEntity;
@ -56,6 +59,8 @@ import com.epmet.feign.OperCrmFeignClient;
import com.epmet.redis.CustomerAgencyRedis;
import com.epmet.service.CustomerAgencyService;
import com.epmet.util.ModuleConstant;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
@ -681,6 +686,17 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
return subAgencyList;
}
private List<AgencySubResultDTO> getDepartmentLevelList(String subAgencyPids) {
List<AgencySubResultDTO> subAgencyList = baseDao.selectSubAgencyLevelList(subAgencyPids);
if (subAgencyList.size() > NumConstant.ZERO) {
for (AgencySubResultDTO sub : subAgencyList) {
List<AgencySubResultDTO> subAgency = getDepartmentLevelList(sub.getPids() + ":" + sub.getAgencyId());
sub.setSubAgencyList(subAgency);
}
}
return subAgencyList;
}
/**
* @param staffId
* @return
@ -1052,6 +1068,24 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
return resultDTO;
}
@Override
public StaffInAgencyListResultDTO staffinAgencyLevelList(String staffId) {
StaffInAgencyListResultDTO resultDTO = new StaffInAgencyListResultDTO();
//1.查询工作人员所属组织信息
AgencyResultDTO agencyList = baseDao.selectAgencyByStaffId(staffId);
if (null == agencyList) {
logger.error(String.format("查询工作人员所属组织信息失败,staffId->%s", staffId));
throw new RenException(CustomerAgencyConstant.SELECT_STAFF_AGENCY_EXCEPTION);
}
resultDTO.setAgencyList(agencyList);
//2.递归查询所有下级组织信息
List<AgencySubResultDTO> subAgencyList = getDepartmentLevelList(("".equals(agencyList.getPids()) ? "" : agencyList.getPids() + ":") + agencyList.getAgencyId());
resultDTO.setSubAgencyList(subAgencyList);
return resultDTO;
}
/**
* @param customerId
* @return com.epmet.dto.result.AgencyElementTreeResultDTO
@ -1193,6 +1227,7 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
result.setOrgLevel(rootAgency.getAgencyId().concat("-").concat(rootAgency.getLevel()));
result.setLongitude(rootAgency.getLongitude());
result.setLatitude(rootAgency.getLatitude());
result.setOrgIdPath(rootAgency.getOrgIdPath());
String orgTreeCacheKey = RedisKeys.getOrgTreeCacheKey(rootAgency.getAgencyId(),customerId);
Object o = redisUtils.get(orgTreeCacheKey);
@ -1607,4 +1642,122 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
return new Result<List<CurrentUserCommunityInfoResultDTO>>().ok(list);
}
/**
* 返回组织的orgIdPath包含自身
*
* @param orgId
* @return
*/
@Override
public String getOrgIdPath(String orgId) {
CustomerAgencyEntity customerAgencyEntity = baseDao.selectById(orgId);
if (null == customerAgencyEntity) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode());
}
if (StringUtils.isBlank(customerAgencyEntity.getPid()) || NumConstant.ZERO_STR.equals(customerAgencyEntity.getPid())) {
return orgId;
}
return customerAgencyEntity.getPids().concat(StrConstant.COLON).concat(orgId);
}
/**
* @Description:
* @param agencyId:
* @Return java.util.List<com.epmet.dto.result.AgencyCountCensusResultDTO>
* @Author: lichao
* @Date: 2023/4/7 14:17
*/
@Override
public List<AgencyCountCensusResultDTO> getAgencyCountList(String agencyId) {
List<AgencyCountCensusResultDTO> agencyCountCensusResultDTOS = new ArrayList<>();
CustomerAgencyEntity customerAgency = baseDao.selectById(agencyId);
if (customerAgency != null){
String pids = PidUtils.convertPid2OrgIdPath(customerAgency.getId(),customerAgency.getPids());
agencyCountCensusResultDTOS = baseDao.agencyCount(pids);
AgencyCountCensusResultDTO agencyCountCensusResultDTOGrid = new AgencyCountCensusResultDTO();
agencyCountCensusResultDTOGrid.setLevel("grid");
agencyCountCensusResultDTOGrid.setCount(baseDao.agencyGridCount(pids));
agencyCountCensusResultDTOS.add(agencyCountCensusResultDTOGrid);
AgencyCountCensusResultDTO agencyCountCensusResultDTOStaff = new AgencyCountCensusResultDTO();
agencyCountCensusResultDTOStaff.setLevel("staff");
agencyCountCensusResultDTOStaff.setCount(baseDao.agencyStaffCount(pids));
agencyCountCensusResultDTOS.add(agencyCountCensusResultDTOStaff);
}else{
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"获取用户组织信息异常","获取用户组织信息异常");
}
return agencyCountCensusResultDTOS;
}
@Override
public List<CommunityCountCensusResultDTO> getCommunityCountList(CommunityCountCensusFormDTO dto) {
List<CommunityCountCensusResultDTO> resultDTOS = new ArrayList<>();
CustomerAgencyEntity customerAgency = baseDao.selectById(dto.getAgencyId());
if (customerAgency!=null){
String pids = PidUtils.convertPid2OrgIdPath(customerAgency.getId(),customerAgency.getPids());
LambdaQueryWrapper<CustomerAgencyEntity> queryWrapper = new LambdaQueryWrapper<CustomerAgencyEntity>().eq(CustomerAgencyEntity::getPids,pids);
List<CustomerAgencyEntity> agencyEntityList = baseDao.selectList(queryWrapper);
agencyEntityList.forEach(
entity->{
CommunityCountCensusResultDTO communityCountCensusResultDTO = new CommunityCountCensusResultDTO();
communityCountCensusResultDTO.setAgencyId(entity.getId());
communityCountCensusResultDTO.setAgencyName(entity.getOrganizationName());
String agencyPids = PidUtils.convertPid2OrgIdPath(entity.getId(),entity.getPids());
communityCountCensusResultDTO.setCount(baseDao.getCommunityCount(agencyPids,dto.getTimeStart(),dto.getTimeEnd()));
resultDTOS.add(communityCountCensusResultDTO);
}
);
}else {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"获取用户组织信息异常","获取用户组织信息异常");
}
return resultDTOS;
}
@Override
public PageData<CommunityListByAgencyIdResultDTO> getCommunityList(CommunityCountCensusFormDTO dto) {
CustomerAgencyEntity customerAgency = baseDao.selectById(dto.getAgencyId());
if (customerAgency!=null){
String pids = PidUtils.convertPid2OrgIdPath(customerAgency.getId(),customerAgency.getPids());
PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
List<CommunityListByAgencyIdResultDTO> entityList = baseDao.getCommunityByPidList(pids,dto.getTimeStart(),dto.getTimeEnd());
entityList.forEach(
entity->{
String[] pidArray = entity.getPids().split(":");
LambdaQueryWrapper<CustomerAgencyEntity> queryWrapper = new LambdaQueryWrapper<CustomerAgencyEntity>().in(CustomerAgencyEntity::getId,pidArray);
List<CustomerAgencyEntity> customerAgencyEntities = baseDao.selectList(queryWrapper);
for (CustomerAgencyEntity customerAgencyEntity : customerAgencyEntities) {
if (customerAgencyEntity.getLevel().equals("district")){
entity.setDistrictName(customerAgencyEntity.getOrganizationName());
}
if (customerAgencyEntity.getLevel().equals("street")){
entity.setStreeName(customerAgencyEntity.getOrganizationName());
}
}
}
);
PageInfo<CommunityListByAgencyIdResultDTO> pageInfo = new PageInfo<>(entityList);
return new PageData<>(entityList, pageInfo.getTotal(),dto.getPageSize());
}else {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"获取用户组织信息异常","获取用户组织信息异常");
}
}
}

26
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java

@ -1485,4 +1485,30 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
agencyNamePathList.add(agencyInfo.getOrganizationName());
return String.join("-", agencyNamePathList);
}
/**
* 群租房列表来源于烟台需求
*
* @param formDTO
* @return
*/
@Override
public PageData<GroupRentHouseResultDTO> groupRentHouseList(GroupRentHouseFormDTO formDTO) {
if(StringUtils.isBlank(formDTO.getOrgId())){
//默认查询当前组织及下级
formDTO.setOrgType("agency");
CustomerStaffInfoCacheResult staffInfoCacheResult=CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(),formDTO.getStaffId());
formDTO.setOrgId(staffInfoCacheResult.getAgencyId());
}
//群租房:出租状态并超过5人(≥5)
PageHelper.startPage(formDTO.getPageNo(),formDTO.getPageSize());
List<GroupRentHouseResultDTO> list=icHouseDao.selectGroupRentHouseList(formDTO);
list.forEach(item -> {
item.setHouseType(HouseTypeEnums.getTypeValue(item.getHouseTypeKey()));
item.setPurpose(HousePurposeEnums.getTypeValue(item.getPurposeKey()));
});
PageInfo<GroupRentHouseResultDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal());
}
}

52
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseServiceImpl.java

@ -29,10 +29,11 @@ import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.dto.result.yt.EnterpriseCountPlaceTypeDetailDTO;
import com.epmet.dto.result.yt.EnterpriseCountPlaceTypeResDTO;
import com.epmet.entity.*;
import com.epmet.excel.EnterpriseImportExcelDTO;
import com.epmet.excel.handler.IcEnterpriseExcelImportListener;
import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.OssFeignClient;
@ -85,8 +86,6 @@ public class IcEnterpriseServiceImpl extends BaseServiceImpl<IcEnterpriseDao, Ic
@Autowired
private IcEnterprisePatrolRecordDao enterprisePatrolRecordDao;
@Autowired
private EpmetAdminOpenFeignClient adminOpenFeignClient;
@Autowired
private IcCoverageCategoryDictDao coverageCategoryDictDao;
@Autowired
private OssFeignClient ossFeignClient;
@ -101,8 +100,6 @@ public class IcEnterpriseServiceImpl extends BaseServiceImpl<IcEnterpriseDao, Ic
@Autowired
private IcEnterpriseChangeRecordService icEnterpriseChangeRecordService;
@Autowired
private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient;
@Autowired
private LoginUserUtil loginUserUtil;
@ -678,4 +675,49 @@ public class IcEnterpriseServiceImpl extends BaseServiceImpl<IcEnterpriseDao, Ic
zip.close();
}
/**
* 九小场所分析:返回各个场所类型的数量
*
* @param orgId
* @param orgType
* @return
*/
@Override
public EnterpriseCountPlaceTypeResDTO countType(String orgId, String orgType) {
if (StringUtils.isBlank(orgId)) {
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), EpmetRequestHolder.getLoginUserId());
orgId = staffInfoCacheResult.getAgencyId();
orgType = "agency";
}
// 查字典
List<IcCoverageCategoryDictListResultDTO> dictList = SpringContextUtils.getBean(CoverageService.class).dictMap(EpmetRequestHolder.getLoginUserCustomerId(), CoveragePlaceTypeEnum.ENTERPRISE_PATROL.getCode());
if (CollectionUtils.isEmpty(dictList)) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "场所类型字典为空", "场所类型字典为空");
}
//
List<EnterpriseCountPlaceTypeDetailDTO> placeTypeCountList = baseDao.selectCountByPlaceType(EpmetRequestHolder.getLoginUserCustomerId(),orgId, orgType);
Map<String, EnterpriseCountPlaceTypeDetailDTO> map = CollectionUtils.isEmpty(placeTypeCountList) ? new HashMap<>() : placeTypeCountList.stream().collect(Collectors.toMap(EnterpriseCountPlaceTypeDetailDTO::getPlaceType, o -> o));;
List<EnterpriseCountPlaceTypeDetailDTO> list = new ArrayList<>();
int total = 0;
for (IcCoverageCategoryDictListResultDTO placeType : dictList) {
EnterpriseCountPlaceTypeDetailDTO detailDTO = new EnterpriseCountPlaceTypeDetailDTO();
detailDTO.setPlaceType(placeType.getValue());
detailDTO.setPlaceTypeName(placeType.getLabel());
detailDTO.setTotal(NumConstant.ZERO);
if (map.containsKey(placeType.getValue())) {
detailDTO.setTotal(map.get(placeType.getValue()).getTotal());
}
list.add(detailDTO);
total += detailDTO.getTotal();
}
EnterpriseCountPlaceTypeResDTO resDTO = new EnterpriseCountPlaceTypeResDTO();
resDTO.setList(list);
resDTO.setTotal(total);
return resDTO;
}
}

79
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java

@ -9,26 +9,23 @@ import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis;
import com.epmet.commons.tools.redis.common.bean.HouseInfoCache;
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.dao.IcBuildingDao;
import com.epmet.dao.IcBuildingUnitDao;
import com.epmet.dao.IcHouseDao;
import com.epmet.dao.IcNeighborHoodDao;
import com.epmet.dao.*;
import com.epmet.dto.IcHouseDTO;
import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.ImportGeneralDTO;
import com.epmet.dto.form.CheckHouseInfoFormDTO;
import com.epmet.dto.form.HouseCountPictureFormDTO;
import com.epmet.dto.form.HouseFormDTO;
import com.epmet.dto.region.LogOperationResultDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.IcBuildingEntity;
import com.epmet.entity.IcBuildingUnitEntity;
import com.epmet.entity.IcHouseEntity;
import com.epmet.entity.IcNeighborHoodEntity;
import com.epmet.entity.*;
import com.epmet.enums.HousePurposeEnums;
import com.epmet.enums.HouseRentFlagEnums;
import com.epmet.enums.HouseTypeEnums;
@ -36,10 +33,14 @@ import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.OperCustomizeOpenFeignClient;
import com.epmet.redis.IcHouseRedis;
import com.epmet.service.CustomerAgencyService;
import com.epmet.service.IcHouseService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.record.PageBreakRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -73,6 +74,10 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
private IcBuildingUnitDao buildingUnitDao;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
@Autowired
private CustomerAgencyDao customerAgencyDao;
@Autowired
private CustomerGridDao customerGridDao;
@Override
public IcHouseDTO get(String id) {
@ -405,4 +410,62 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
return new Result<CheckHomeInfoResultInfo>().ok(checkHomeInfoResultInfo);
}
@Override
public HouseCountPictureResultDTO getHousePurposeCount(HouseCountPictureFormDTO dto) {
HouseCountPictureResultDTO resultDTO = new HouseCountPictureResultDTO();
resultDTO.setTotal(0);
resultDTO.setList(baseDao.getHousePurposeCount(dto.getOrgIdPath(),dto.getTimeStart(),dto.getTimeEnd()));
resultDTO.getList().forEach(
result->resultDTO.setTotal(resultDTO.getTotal()+result.getCount())
);
return resultDTO;
}
@Override
public HouseCountPictureResultDTO getHouseStatusCount(HouseCountPictureFormDTO dto) {
HouseCountPictureResultDTO resultDTO = new HouseCountPictureResultDTO();
resultDTO.setTotal(0);
resultDTO.setList(baseDao.getHouseStatusCount(dto.getOrgIdPath(),dto.getTimeStart(),dto.getTimeEnd()));
resultDTO.getList().forEach(
result->resultDTO.setTotal(resultDTO.getTotal()+result.getCount())
);
return resultDTO;
}
@Override
public PageData<HousePictureListResultDTO> getHousePictureList(HouseCountPictureFormDTO dto) {
// 列表/导出查询
PageHelper.startPage(dto.getPageNo(), dto.getPageSize());
List<HousePictureListResultDTO> list = baseDao.getHousePictureList(dto.getOrgIdPath(),dto.getTimeStart(),dto.getTimeEnd(),dto.getPurpose(),dto.getRentFlag());
list.forEach(entity->{
String[] agencyIds = entity.getOrgIdPath().split(":");
LambdaQueryWrapper<CustomerAgencyEntity> queryWrapperAgency = new LambdaQueryWrapper<CustomerAgencyEntity>().in(CustomerAgencyEntity::getId,agencyIds);
List<CustomerAgencyEntity> customerAgencyEntities = customerAgencyDao.selectList(queryWrapperAgency);
customerAgencyEntities.forEach(agency->{
if (agency.getLevel().equals("district")){
entity.setDistrictName(agency.getOrganizationName());
}else if (agency.getLevel().equals("street")){
entity.setStreetName(agency.getOrganizationName());
}else if (agency.getLevel().equals("community")){
entity.setCommunityName(agency.getOrganizationName());
}
});
});
PageInfo<HousePictureListResultDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list,pageInfo.getTotal());
}
}

310
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffLoginLogServiceImpl.java

@ -0,0 +1,310 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.EpmetRequestHolder;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.SpringContextUtils;
import com.epmet.dao.StaffLoginLogDao;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.form.yt.CommunityLoginFormDTO;
import com.epmet.dto.form.yt.CountActivityFormDTO;
import com.epmet.dto.result.yt.ActivityTatalInfo;
import com.epmet.dto.result.yt.CommunityLoginResultDTO;
import com.epmet.dto.result.yt.LoginLogCountByLevelResultDTO;
import com.epmet.dto.result.yt.AccountActivityInfo;
import com.epmet.entity.StaffLoginLogEntity;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.service.CustomerAgencyService;
import com.epmet.service.StaffLoginLogService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.Date;
import java.util.List;
/**
* 工作人员登录日志表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-04-04
*/
@Service
public class StaffLoginLogServiceImpl extends BaseServiceImpl<StaffLoginLogDao, StaffLoginLogEntity> implements StaffLoginLogService {
@Autowired
private EpmetUserOpenFeignClient userOpenFeignClient;
/**
* 登录插入记录
*
* @param staffId
* @param loginTime
*/
@Transactional(rollbackFor = Exception.class)
@Override
public void saveLog(String staffId, Date loginTime) {
CustomerStaffDTO form = new CustomerStaffDTO();
form.setUserId(staffId);
Result<CustomerStaffDTO> result = userOpenFeignClient.getCustomerStaffInfoByUserId(form);
if (!result.success() || null == result.getData()) {
return;
}
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(result.getData().getCustomerId(), staffId);
StaffLoginLogEntity logEntity = new StaffLoginLogEntity();
logEntity.setCustomerId(result.getData().getCustomerId());
logEntity.setStaffId(staffId);
logEntity.setStaffName(staffInfoCacheResult.getRealName());
logEntity.setMobile(staffInfoCacheResult.getMobile());
logEntity.setAgencyId(staffInfoCacheResult.getAgencyId());
CustomerAgencyDTO customerAgencyDTO = SpringContextUtils.getBean(CustomerAgencyService.class).get(staffInfoCacheResult.getAgencyId());
logEntity.setAgencyLevel(customerAgencyDTO.getLevel());
logEntity.setPid(customerAgencyDTO.getPid());
if (StringUtils.isBlank(customerAgencyDTO.getPid()) || NumConstant.ZERO_STR.equals(customerAgencyDTO.getPid())) {
logEntity.setOrgIdPath(customerAgencyDTO.getId());
} else {
logEntity.setOrgIdPath(customerAgencyDTO.getPids().concat(StrConstant.COLON).concat(customerAgencyDTO.getId()));
}
logEntity.setLoginTime(loginTime);
baseDao.insert(logEntity);
}
/**
* 返回市级账号登录总次数区县级账号登录总次数镇街级账号登录总次数社区级账号登录总次数
*
* @param orgId 为空时默认当前登录用户所属组织id
* @param level :组织级别社区级community 街道:street,区县级: district,市级: city;省级:province
* @param startDate yyyy-MM-dd
* @param endDate yyyy-MM-dd
* @return
*/
@Override
public LoginLogCountByLevelResultDTO countLevel(String orgId, String level, Date startDate, Date endDate) {
if (StringUtils.isBlank(orgId)) {
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), EpmetRequestHolder.getLoginUserId());
orgId = staffInfoCacheResult.getAgencyId();
level = staffInfoCacheResult.getLevel();
}
String orgIdPath = SpringContextUtils.getBean(CustomerAgencyService.class).getOrgIdPath(orgId);
LoginLogCountByLevelResultDTO resultDTO = new LoginLogCountByLevelResultDTO();
if (Constant.CITY.equals(level)) {
//市级账号登录
LambdaQueryWrapper<StaffLoginLogEntity> cityWrapper = new LambdaQueryWrapper<>();
cityWrapper.eq(StaffLoginLogEntity::getAgencyId, orgId)
.between(null != startDate && null != endDate, StaffLoginLogEntity::getLoginTime, startDate, endDate);
resultDTO.setCityCount(baseDao.selectCount(cityWrapper));
// 市下面区县账号
LambdaQueryWrapper<StaffLoginLogEntity> districtWrapper = new LambdaQueryWrapper<>();
districtWrapper.eq(StaffLoginLogEntity::getPid, orgId)
.eq(StaffLoginLogEntity::getAgencyLevel, Constant.DISTRICT)
.between(null != startDate && null != endDate, StaffLoginLogEntity::getLoginTime, startDate, endDate);
resultDTO.setDistrictCount(baseDao.selectCount(districtWrapper));
// 市级下面所有街道
LambdaQueryWrapper<StaffLoginLogEntity> streetWrapper = new LambdaQueryWrapper<>();
streetWrapper.like(StaffLoginLogEntity::getOrgIdPath, orgIdPath)
.eq(StaffLoginLogEntity::getAgencyLevel, Constant.STREET)
.between(null != startDate && null != endDate, StaffLoginLogEntity::getLoginTime, startDate, endDate);
resultDTO.setStreetCount(baseDao.selectCount(streetWrapper));
// 市级下面所有社区
LambdaQueryWrapper<StaffLoginLogEntity> communityWrapper = new LambdaQueryWrapper<>();
communityWrapper.like(StaffLoginLogEntity::getOrgIdPath, orgIdPath)
.eq(StaffLoginLogEntity::getAgencyLevel, Constant.COMMUNITY)
.between(null != startDate && null != endDate, StaffLoginLogEntity::getLoginTime, startDate, endDate);
resultDTO.setCommunityCount(baseDao.selectCount(communityWrapper));
} else if (Constant.DISTRICT.equals(level)) {
resultDTO.setCityCount(NumConstant.ONE_NEG);
//只展示本区县的登录情况
LambdaQueryWrapper<StaffLoginLogEntity> districtWrapper = new LambdaQueryWrapper<>();
districtWrapper.eq(StaffLoginLogEntity::getAgencyId, orgId)
.between(null != startDate && null != endDate, StaffLoginLogEntity::getLoginTime, startDate, endDate);
resultDTO.setDistrictCount(baseDao.selectCount(districtWrapper));
// 区县下所有的街道
LambdaQueryWrapper<StaffLoginLogEntity> streetWrapper = new LambdaQueryWrapper<>();
streetWrapper.like(StaffLoginLogEntity::getOrgIdPath, orgIdPath)
.eq(StaffLoginLogEntity::getAgencyLevel, Constant.STREET)
.between(null != startDate && null != endDate, StaffLoginLogEntity::getLoginTime, startDate, endDate);
resultDTO.setStreetCount(baseDao.selectCount(streetWrapper));
// 去线下所有社区
LambdaQueryWrapper<StaffLoginLogEntity> communityWrapper = new LambdaQueryWrapper<>();
communityWrapper.like(StaffLoginLogEntity::getOrgIdPath, orgIdPath)
.eq(StaffLoginLogEntity::getAgencyLevel, Constant.COMMUNITY)
.between(null != startDate && null != endDate, StaffLoginLogEntity::getLoginTime, startDate, endDate);
resultDTO.setCommunityCount(baseDao.selectCount(communityWrapper));
} else if (Constant.STREET.equals(level)) {
resultDTO.setCityCount(NumConstant.ONE_NEG);
resultDTO.setDistrictCount(NumConstant.ONE_NEG);
// 只展示本街道的登录情况
LambdaQueryWrapper<StaffLoginLogEntity> streetWrapper = new LambdaQueryWrapper<>();
streetWrapper.eq(StaffLoginLogEntity::getAgencyId, orgId)
.between(null != startDate && null != endDate, StaffLoginLogEntity::getLoginTime, startDate, endDate);
resultDTO.setStreetCount(baseDao.selectCount(streetWrapper));
// 街道下所有社区
LambdaQueryWrapper<StaffLoginLogEntity> communityWrapper = new LambdaQueryWrapper<>();
communityWrapper.like(StaffLoginLogEntity::getOrgIdPath, orgIdPath)
.eq(StaffLoginLogEntity::getAgencyLevel, Constant.COMMUNITY)
.between(null != startDate && null != endDate, StaffLoginLogEntity::getLoginTime, startDate, endDate);
resultDTO.setCommunityCount(baseDao.selectCount(communityWrapper));
} else if (Constant.COMMUNITY.equals(level)) {
resultDTO.setCityCount(NumConstant.ONE_NEG);
resultDTO.setDistrictCount(NumConstant.ONE_NEG);
resultDTO.setStreetCount(NumConstant.ONE_NEG);
// 只展示本社区的登录情况
LambdaQueryWrapper<StaffLoginLogEntity> communityWrapper = new LambdaQueryWrapper<>();
communityWrapper.eq(StaffLoginLogEntity::getAgencyId, orgId)
.between(null != startDate && null != endDate, StaffLoginLogEntity::getLoginTime, startDate, endDate);
resultDTO.setCommunityCount(baseDao.selectCount(communityWrapper));
}
return resultDTO;
}
@Override
public PageData<AccountActivityInfo> getAccountActivityInfo(CountActivityFormDTO formDTO) {
if (formDTO.getIsPage()) {
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize());
List<AccountActivityInfo> accountActivityInfos = baseDao.selectListActivityInfo(formDTO);
int total = CollectionUtils.isEmpty(accountActivityInfos) ? NumConstant.ZERO : accountActivityInfos.size();
return new PageData<>(accountActivityInfos, total);
}
List<AccountActivityInfo> accountActivityInfos = baseDao.selectListActivityInfo(formDTO);
int total = CollectionUtils.isEmpty(accountActivityInfos) ? NumConstant.ZERO : accountActivityInfos.size();
return new PageData<>(accountActivityInfos, total);
}
@Override
public ActivityTatalInfo getActivityTotal(CountActivityFormDTO formDTO) {
return baseDao.selectOneActivityTotal(formDTO);
}
/**
* 下级社区账号登录次数排名
*
* @param formDTO
* @return
*/
@Override
public PageData<CommunityLoginResultDTO> pageCommunityCount(CommunityLoginFormDTO formDTO) {
if (StringUtils.isBlank(formDTO.getOrgId())) {
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), EpmetRequestHolder.getLoginUserId());
formDTO.setOrgId(staffInfoCacheResult.getAgencyId());
// formDTO.setLevel(staffInfoCacheResult.getLevel());
}
if (formDTO.getIsPage()) {
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize());
List<CommunityLoginResultDTO> list = baseDao.pageCommunityCount(formDTO.getOrgId(), formDTO.getStartDate(), formDTO.getEndDate());
PageInfo<CommunityLoginResultDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal(), formDTO.getPageSize());
}
// 不分页
List<CommunityLoginResultDTO> list = baseDao.pageCommunityCount(formDTO.getOrgId(), formDTO.getStartDate(), formDTO.getEndDate());
int total = CollectionUtils.isEmpty(list) ? NumConstant.ZERO : list.size();
return new PageData<>(list, total, total);
}
/**
* 柱状图下级组织账号登录次数汇总
*
* @param orgId
* @param level
* @param startDate
* @param endDate
* @return
*/
@Override
public PageData<CommunityLoginResultDTO> querySubCount(String orgId, String level, Date startDate, Date endDate) {
if (StringUtils.isBlank(orgId)) {
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), EpmetRequestHolder.getLoginUserId());
orgId = staffInfoCacheResult.getAgencyId();
}
List<CommunityLoginResultDTO> list = baseDao.querySubCount(orgId, startDate, endDate);
int total = CollectionUtils.isEmpty(list) ? NumConstant.ZERO : list.size();
return new PageData<CommunityLoginResultDTO>(list, total, total);
}
/**
* 查看区县
*
* @param orgId
* @param level
* @param startDate
* @param endDate
* @param isPage
* @param pageNo
* @param pageSize
* @return 返回agencyIdagencyNamecount
*/
@Override
public PageData<CommunityLoginResultDTO> pageDistrictCount(String orgId, String level, Date startDate, Date endDate, Boolean isPage, Integer pageNo, Integer pageSize) {
if (StringUtils.isBlank(orgId)) {
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), EpmetRequestHolder.getLoginUserId());
orgId = staffInfoCacheResult.getAgencyId();
}
if (isPage) {
PageHelper.startPage(pageNo, pageSize);
List<CommunityLoginResultDTO> list = baseDao.pageDistrictCount(orgId, startDate, endDate);
PageInfo<CommunityLoginResultDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal(), pageSize);
}
// 不分页
List<CommunityLoginResultDTO> list = baseDao.pageDistrictCount(orgId, startDate, endDate);
int total = CollectionUtils.isEmpty(list) ? NumConstant.ZERO : list.size();
return new PageData<>(list, total, total);
}
/**
* 查看街镇
*
* @param orgId
* @param startDate
* @param endDate
* @param isPage
* @param pageNo
* @param pageSize
* @return
*/
@Override
public PageData<CommunityLoginResultDTO> streetCount(String orgId, Date startDate, Date endDate, Boolean isPage, Integer pageNo, Integer pageSize) {
if (StringUtils.isBlank(orgId)) {
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), EpmetRequestHolder.getLoginUserId());
orgId = staffInfoCacheResult.getAgencyId();
}
if (isPage) {
PageHelper.startPage(pageNo, pageSize);
List<CommunityLoginResultDTO> list = baseDao.pageStreetCount(orgId, startDate, endDate);
PageInfo<CommunityLoginResultDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal(), pageSize);
}
// 不分页
List<CommunityLoginResultDTO> list = baseDao.pageStreetCount(orgId, startDate, endDate);
int total = CollectionUtils.isEmpty(list) ? NumConstant.ZERO : list.size();
return new PageData<>(list, total, total);
}
}

2
epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.49__alter_agency.sql

@ -0,0 +1,2 @@
ALTER TABLE `epmet_gov_org`.`customer_agency`
ADD COLUMN `REMARK` varchar(512) NULL COMMENT '备注说明' AFTER `REVISION`;

121
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

@ -198,7 +198,11 @@
ca.pids AS "pids",
ca.level level,
IFNULL(ca.longitude, cc.longitude) longitude,
IFNULL(ca.latitude, cc.latitude) latitude
IFNULL(ca.latitude, cc.latitude) latitude,
(
case when ca.pid is null or ca.pid='0' or ca.pid='' then ca.id
else concat(ca.pids,':',ca.id)
end)as orgIdPath
FROM customer_agency ca
INNER JOIN customer_agency cc ON cc.pid = '0' AND ca.customer_id = cc.customer_id
WHERE ca.del_flag = '0'
@ -206,6 +210,26 @@
ORDER BY ca.created_time DESC
</select>
<select id="selectSubAgencyLevelList" resultType="com.epmet.dto.result.AgencySubResultDTO">
SELECT
ca.id AS "agencyId",
ca.organization_name AS "agencyName",
ca.pids AS "pids",
ca.level level,
IFNULL(ca.longitude, cc.longitude) longitude,
IFNULL(ca.latitude, cc.latitude) latitude,
(
case when ca.pid is null or ca.pid='0' or ca.pid='' then ca.id
else concat(ca.pids,':',ca.id)
end)as orgIdPath
FROM customer_agency ca
INNER JOIN customer_agency cc ON cc.pid = '0' AND ca.customer_id = cc.customer_id
WHERE ca.del_flag = '0'
AND ca.pids = #{subAgencyPids}
AND (ca.LEVEL = 'city' or ca.LEVEL = 'district')
ORDER BY ca.created_time DESC
</select>
<select id="getCustomerRootAgency" resultType="com.epmet.dto.CustomerAgencyDTO">
SELECT *
FROM customer_agency ca
@ -397,7 +421,11 @@
ca.pid pid,
ca.level level,
ca.longitude,
ca.latitude
ca.latitude,
(
case when ca.pid is null or ca.pid='0' or ca.pid='' then ca.id
else concat(ca.pids,':',ca.id)
end)as orgIdPath
FROM
customer_agency ca
INNER JOIN customer_staff_agency csa ON ca.id = csa.agency_id
@ -614,7 +642,12 @@
ID AS agencyId,
ORGANIZATION_NAME AS agencyName,
PID,
LEVEL
LEVEL,
(
case when pid is null or pid='0' or pid='' then id
else concat(pids,':',id)
end
)as orgIdPath
from customer_agency
where
DEL_FLAG = 0
@ -628,7 +661,12 @@
ID AS agencyId,
ORGANIZATION_NAME AS agencyName,
PID,
LEVEL
LEVEL,
(
case when pid is null or pid='0' or pid='' then id
else concat(pids,':',id)
end
)as orgIdPath
from
customer_agency
where
@ -845,6 +883,36 @@
AND CUSTOMER_ID = #{customerId}
AND pids LIKE concat('%',#{agencyId}, '%' )
</update>
<select id="agencyCount" resultType="com.epmet.dto.result.AgencyCountCensusResultDTO">
select level as level,count(*) as count
from customer_agency
where DEL_FLAG = 0
and PIDS like concat(#{pids},'%')
group by level
</select>
<select id="agencyGridCount" resultType="java.lang.Integer">
select count(*)
from customer_grid
where DEL_FLAG = 0
and PIDS like concat(#{pids},'%')
</select>
<select id="agencyStaffCount" resultType="java.lang.Integer">
select count(1)
from customer_staff_agency staff
left join customer_agency agency on staff.AGENCY_ID = agency.ID
where agency.DEL_FLAG = 0
and
staff.DEL_FLAG = 0
and agency.PIDS like concat(#{pids},'%')
</select>
<select id="selectSubOrg" resultType="com.epmet.dto.result.SubOrgResDTO">
SELECT
@ -1120,4 +1188,49 @@
AND g.DEL_FLAG = '0'
) t
</select>
<!-- 获取当前客户下所有的社区组织,只返回id,orgIdPath,agencyName -->
<select id="getAllCommunity" parameterType="java.lang.String" resultType="com.epmet.dto.result.AgencyResultDTO">
SELECT
ca.id agencyId,
ca.organization_name agencyName,
(
case when ca.pid is null or ca.pid='0' or ca.pid='' then ca.id
else concat(ca.pids,':',ca.id)
end)as orgIdPath
FROM
customer_agency ca
WHERE
ca.del_flag = '0'
AND ca.customer_id = #{customerId}
</select>
<select id="getCommunityCount" resultType="java.lang.Integer">
select count(1)
from customer_agency agency
where agency.DEL_FLAG = 0
and agency.LEVEL = 'community'
and agency.PIDS like concat(#{pids},'%')
<if test="timeStart != null">
and agency.CREATED_TIME &gt;= #{timeStart}
</if>
<if test="timeEnd != null">
and agency.CREATED_TIME &lt;= #{timeEnd}
</if>
</select>
<select id="getCommunityByPidList" resultType="com.epmet.dto.result.CommunityListByAgencyIdResultDTO">
SELECT
ID,ORGANIZATION_NAME as name,CREATED_TIME as createTime,PIDS as pids
FROM customer_agency
WHERE DEL_FLAG = '0'
AND `LEVEL` = 'community'
AND PIDS LIKE CONCAT(#{pids},'%')
<if test="timeStart != null">
and CREATED_TIME &gt;= #{timeStart}
</if>
<if test="timeEnd != null">
and CREATED_TIME &lt;= #{timeEnd}
</if>
</select>
</mapper>

3
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml

@ -197,7 +197,8 @@
grid_type AS 'gridType',
contacts AS 'contacts',
mobile AS 'mobile',
sort AS gridSort
sort AS gridSort,
COORDINATES AS coordinates
FROM
customer_grid
WHERE

36
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcEnterpriseDao.xml

@ -66,10 +66,18 @@
LEFT JOIN ic_enterprise_patrol_record r ON ( ie.id = r.ENTERPRISE_ID AND r.DEL_FLAG = '0' )
WHERE
ie.DEL_FLAG = '0'
AND (
ie.AGENCY_ID = #{staffAgencyId}
OR ie.AGENCY_PIDS LIKE concat( '%', #{staffAgencyId}, '%' )
)
<if test='"grid" == orgType'>
AND ie.GRID_ID = #{orgId}
</if>
<if test='"agency" == orgType'>
AND (ie.AGENCY_ID = #{orgId} or ie.AGENCY_PIDS like concat('%',#{orgId},'%'))
</if>
<if test='null==orgType or "" == orgType'>
AND (
ie.AGENCY_ID = #{staffAgencyId}
OR ie.AGENCY_PIDS LIKE concat( '%', #{staffAgencyId}, '%' )
)
</if>
<if test='null != gridId and "" != gridId'>
AND ie.GRID_ID = #{gridId}
</if>
@ -108,4 +116,24 @@
and ie.id != #{enterpriseId}
</if>
</select>
<!-- 按场所类型 -->
<select id="selectCountByPlaceType" parameterType="map" resultType="com.epmet.dto.result.yt.EnterpriseCountPlaceTypeDetailDTO">
SELECT
ie.PLACE_TYPE as placeType,
count( ie.id ) AS total
FROM
ic_enterprise ie
WHERE
ie.CUSTOMER_ID = #{customerId}
AND ie.DEL_FLAG = '0'
<if test="orgType == 'grid'">
and ie.GRID_ID= #{orgId}
</if>
<if test="orgType == 'agency'">
and ( ie.AGENCY_ID=#{orgId} or ie.AGENCY_PIDS like CONCAT('%',#{orgId},'%') )
</if>
GROUP BY
ie.PLACE_TYPE
</select>
</mapper>

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save