Browse Source

Merge branch 'lingshan_master' into dev

master
luyan 2 years ago
parent
commit
3fb2c8dddc
  1. 2
      epmet-cloud-generator/src/main/resources/application.yml
  2. 5
      epmet-commons/epmet-commons-tools/pom.xml
  3. 15
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/PartyOrgTypeEnum.java
  4. 49
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/net/TCCCClientUtils.java
  5. 24
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/tccc/TCCCAuthController.java
  6. 74
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/CategoryDictDTO.java
  7. 3
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/AddOrSaveDraftFormDTO.java
  8. 5
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftAttrFromDTO.java
  9. 5
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java
  10. 3
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/UpdateArticleFormDTO.java
  11. 4
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftListResultDTO.java
  12. 5
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftPcListResultDTO.java
  13. 5
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleDetailResultDTO.java
  14. 5
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/OfflineListResultDTO.java
  15. 5
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/PublishedListResultDTO.java
  16. 72
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/CategoryDictController.java
  17. 2
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java
  18. 16
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/CategoryDictDao.java
  19. 9
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleEntity.java
  20. 44
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/CategoryDictEntity.java
  21. 9
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftEntity.java
  22. 88
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/CategoryDictService.java
  23. 10
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java
  24. 149
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/CategoryDictServiceImpl.java
  25. 4
      epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml
  26. 21
      epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/CategoryDictDao.xml
  27. 2
      epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml
  28. 10
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java
  29. 4
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java
  30. 12
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java
  31. 3
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupEntity.java
  32. 9
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java
  33. 20
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java
  34. 10
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyMemberDTO.java
  35. 33
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/LingShanScreenPartyActQtyStatsResultDTO.java
  36. 15
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/LingShanScreenPartyActTypeAndQtyResultDTO.java
  37. 17
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/LingShanScreenPartyOrgCategoryResultDTO.java
  38. 60
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/LingShanScreenPartyOrgTreeResultDTO.java
  39. 27
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyActDao.java
  40. 22
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java
  41. 120
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/LingShanScreenController.java
  42. 2
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberDao.java
  43. 3
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/IcPartyMemberEntity.java
  44. 68
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/LingShanScreenService.java
  45. 2
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberServiceImpl.java
  46. 323
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/LingShanScreenServiceImpl.java
  47. 2
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java
  48. 27
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyActDao.xml
  49. 44
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml
  50. 3
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberDao.xml

2
epmet-cloud-generator/src/main/resources/application.yml

@ -9,7 +9,7 @@ spring:
type: com.alibaba.druid.pool.DruidDataSource
#MySQL配置
driverClassName: com.mysql.jdbc.Driver
url: jdbc:mysql://118.190.150.119:43306/epmet_gov_org?useUnicode=true&characterEncoding=UTF-8&useSSL=false
url: jdbc:mysql://192.168.1.140:3306/epmet_gov_voice?useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root
password: root
#oracle配置

5
epmet-commons/epmet-commons-tools/pom.xml

@ -197,6 +197,11 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.tencentcloudapi</groupId>
<artifactId>tencentcloud-sdk-java</artifactId>
<version>3.1.322</version>
</dependency>
</dependencies>
<build>

15
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/PartyOrgTypeEnum.java

@ -1,5 +1,7 @@
package com.epmet.commons.tools.enums;
import org.apache.commons.lang3.StringUtils;
public enum PartyOrgTypeEnum {
PROVINCIAL("0", "省委"),
@ -34,4 +36,17 @@ public enum PartyOrgTypeEnum {
public void setName(String name) {
this.name = name;
}
public static PartyOrgTypeEnum getEnumByCode(String code) {
if (StringUtils.isBlank(code)) {
return null;
}
for (PartyOrgTypeEnum en : PartyOrgTypeEnum.values()) {
if (en.getCode().equals(code)) {
return en;
}
}
return null;
}
}

49
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/net/TCCCClientUtils.java

@ -0,0 +1,49 @@
package com.epmet.commons.tools.utils.net;
import com.tencentcloudapi.ccc.v20200210.CccClient;
import com.tencentcloudapi.ccc.v20200210.models.CreateSDKLoginTokenRequest;
import com.tencentcloudapi.ccc.v20200210.models.CreateSDKLoginTokenResponse;
import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
import com.tencentcloudapi.common.profile.ClientProfile;
import com.tencentcloudapi.common.profile.HttpProfile;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class TCCCClientUtils {
private static String SDKAPPID = "1400801042";
private static String USERID = "286388969@qq.com";
private static String SECRETID = "AKIDynW4oQr6ED0a2dIn6EC3wgFlDVjrqIbg";
private static String SECRETKEY = "ymRuDJI8mCRUUPFvQqCPQME0c2MbfaM2";
public static String getToken() {
try {
Credential cred = new Credential(SECRETID, SECRETKEY);
// 实例化一个http选项,可选的,没有特殊需求可以跳过
HttpProfile httpProfile = new HttpProfile();
httpProfile.setEndpoint("ccc.ap-shanghai.tencentcloudapi.com");
// 实例化一个client选项,可选的,没有特殊需求可以跳过
ClientProfile clientProfile = new ClientProfile();
clientProfile.setHttpProfile(httpProfile);
// 实例化要请求产品的client对象,clientProfile是可选的
CccClient client = new CccClient(cred, "", clientProfile);
// 实例化一个请求对象,每个接口都会对应一个request对象
CreateSDKLoginTokenRequest req = new CreateSDKLoginTokenRequest();
req.setSdkAppId(1400801042L);
req.setSeatUserId("286388969@qq.com");
// 返回的resp是一个CreateSDKLoginTokenResponse的实例,与请求对象对应
CreateSDKLoginTokenResponse resp = client.CreateSDKLoginToken(req);
// 输出json格式的字符串回包
System.out.println(CreateSDKLoginTokenResponse.toJsonString(resp));
return CreateSDKLoginTokenResponse.toJsonString(resp);
} catch (TencentCloudSDKException e) {
log.error(e.toString());
return e.toString();
}
}
}

24
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/tccc/TCCCAuthController.java

@ -0,0 +1,24 @@
package com.epmet.controller.tccc;
import com.epmet.commons.tools.utils.net.TCCCClientUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController
@RequestMapping("tccc")
public class TCCCAuthController {
@RequestMapping("getTcccAuth")
public String getTcccAuth() {
try {
String tcccAuth = TCCCClientUtils.getToken();
System.out.println(tcccAuth);
return tcccAuth;
} catch (Exception e) {
log.error(e.toString());
return e.toString();
}
}
}

74
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/CategoryDictDTO.java

@ -0,0 +1,74 @@
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 文章栏目表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-04-11
*/
@Data
public class CategoryDictDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 分类栏目名称
*/
private String categoryName;
/**
* 父栏目ID
*/
private String pid;
/**
* 排序
*/
private Integer sort;
/**
* 删除标识 0.未删除 1.已删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

3
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/AddOrSaveDraftFormDTO.java

@ -31,6 +31,9 @@ public class AddOrSaveDraftFormDTO implements Serializable {
@Length(max = 50, message = "标题最长为50个字")
private String title;
@NotBlank(message = "栏目分类不能为空",groups = {AddArticleForm.class})
private String category;
/**
* 发布范围IDs
*/

5
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftAttrFromDTO.java

@ -42,6 +42,11 @@ public class DraftAttrFromDTO implements Serializable {
@NotBlank(message = "草稿ID不能为空")
private String draftId;
/**
* 栏目
*/
private String category;
/**
* 封面图片地址
*/

5
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java

@ -43,6 +43,11 @@ public class DraftContentFromDTO implements Serializable {
*/
private String draftId;
/**
* 栏目
*/
private String category;
/**
* 文章标题
*/

3
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/UpdateArticleFormDTO.java

@ -28,6 +28,9 @@ public class UpdateArticleFormDTO {
@NotBlank(message = "articleId不能为空", groups = {AddUserInternalGroup.class})
private String articleId;
@NotBlank(message = "栏目不能为空", groups = {AddUserInternalGroup.class})
private String category;
@NotBlank(message = "文章标题不能为空", groups = {AddUserShowGroup.class})
@Length(max = 50, message = "文章标题最长为50个字")
private String title;

4
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftListResultDTO.java

@ -19,6 +19,10 @@ public class DraftListResultDTO implements Serializable {
* 文章ID
*/
private String draftId;
/**
* 栏目
*/
private String category;
/**
* 文章标题
*/

5
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftPcListResultDTO.java

@ -19,6 +19,11 @@ public class DraftPcListResultDTO implements Serializable {
* 文章草稿ID
*/
private String draftId;
/**
* 栏目
*/
private String category;
/**
* 组织Id
*/

5
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleDetailResultDTO.java

@ -21,7 +21,10 @@ public class GovArticleDetailResultDTO implements Serializable {
* 文章id
*/
private String articleId;
/**
* 栏目
*/
private String category;
/**
* 标题
*/

5
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/OfflineListResultDTO.java

@ -19,6 +19,11 @@ public class OfflineListResultDTO implements Serializable {
* 文章ID
*/
private String articleId;
/**
* 栏目
*/
private String category;
/**
* 文章标题
*/

5
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/PublishedListResultDTO.java

@ -21,6 +21,11 @@ public class PublishedListResultDTO implements Serializable {
* 文章ID
*/
private String articleId;
/**
* 分类
*/
private String category;
/**
* 组织Id
*/

72
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/CategoryDictController.java

@ -0,0 +1,72 @@
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.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.CategoryDictDTO;
import com.epmet.service.CategoryDictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 文章栏目表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-04-11
*/
@RestController
@RequestMapping("categoryDict")
public class CategoryDictController {
@Autowired
private CategoryDictService categoryDictService;
@RequestMapping("list")
public Result<List<CategoryDictDTO>> list(@RequestParam Integer pageNo, @RequestParam Integer pageSize){
List<CategoryDictDTO> list = categoryDictService.list(pageNo, pageSize);
return new Result<List<CategoryDictDTO>>().ok(list);
}
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET})
public Result<CategoryDictDTO> get(@PathVariable("id") String id){
CategoryDictDTO data = categoryDictService.get(id);
return new Result<CategoryDictDTO>().ok(data);
}
@NoRepeatSubmit
@PostMapping("save")
public Result save(@RequestBody CategoryDictDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
categoryDictService.save(dto);
return new Result();
}
@NoRepeatSubmit
@PostMapping("update")
public Result update(@RequestBody CategoryDictDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
categoryDictService.update(dto);
return new Result();
}
@PostMapping("delete")
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
categoryDictService.delete(ids);
return new Result();
}
}

2
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java

@ -68,7 +68,7 @@ public class DraftController {
}
@PostMapping("draftlist")
@RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_DRAFT_LIST)
// @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_DRAFT_LIST)
public Result<List<DraftListResultDTO>> draftList(@LoginUser TokenDto tokenDto, @RequestBody DraftListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
return new Result<List<DraftListResultDTO>>().ok(draftService.draftList(tokenDto, formDTO).getList());

16
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/CategoryDictDao.java

@ -0,0 +1,16 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.CategoryDictEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 文章栏目表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-04-11
*/
@Mapper
public interface CategoryDictDao extends BaseDao<CategoryDictEntity> {
}

9
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleEntity.java

@ -42,6 +42,15 @@ public class ArticleEntity extends BaseEpmetEntity {
*/
private String customerId;
/**
* @description: 分类
* @param null:
* @return
* @author: WangXianZhang
* @date: 2023/4/12 4:39 PM
*/
private String category;
/**
* 草稿ID
*/

44
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/CategoryDictEntity.java

@ -0,0 +1,44 @@
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-11
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("category_dict")
public class CategoryDictEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 分类栏目名称
*/
private String categoryName;
/**
* 父栏目ID
*/
private String pid;
/**
* 排序
*/
private Integer sort;
}

9
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftEntity.java

@ -47,6 +47,15 @@ public class DraftEntity extends BaseEpmetEntity {
*/
private String title;
/**
* @description: 分类
* @param null:
* @return
* @author: WangXianZhang
* @date: 2023/4/12 2:09 PM
*/
private String category;
/**
* 标题审核状态
*/

88
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/CategoryDictService.java

@ -0,0 +1,88 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.CategoryDictDTO;
import com.epmet.entity.CategoryDictEntity;
import java.util.List;
import java.util.Map;
/**
* 文章栏目表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-04-11
*/
public interface CategoryDictService extends BaseService<CategoryDictEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<CategoryDictDTO>
* @author generator
* @date 2023-04-11
*/
PageData<CategoryDictDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<CategoryDictDTO>
* @author generator
* @date 2023-04-11
*/
List<CategoryDictDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return CategoryDictDTO
* @author generator
* @date 2023-04-11
*/
CategoryDictDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2023-04-11
*/
void save(CategoryDictDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2023-04-11
*/
void update(CategoryDictDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2023-04-11
*/
void delete(String[] ids);
/**
* @description: 列表
* @param pageNo:
* @param pageSize:
* @return java.util.List<com.epmet.dto.CategoryDictDTO>
* @author: WangXianZhang
* @date: 2023/4/11 7:06 PM
*/
List<CategoryDictDTO> list(Integer pageNo, Integer pageSize);
}

10
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java

@ -187,6 +187,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
List<DraftContentEntity> draftContentList = null;
if (StringUtils.isNotBlank(fromDTO.getDraftId())) {
draftEntity = this.checkDraftStatus(fromDTO.getDraftId());
draftEntity.setCategory(fromDTO.getCategory());
draftEntity.setTitle(StringUtils.isBlank(fromDTO.getTitle()) ? "" : fromDTO.getTitle());
buildPreviewContent(fromDTO, draftEntity);
draftDao.updateById(draftEntity);
@ -212,6 +213,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
draftEntity.setGridId("");
draftEntity.setDepartmentId(loginUserDetails.getData().getCustomerId());
draftEntity.setDelFlag(NumConstant.ZERO_STR);
draftEntity.setCategory(fromDTO.getCategory());
buildPreviewContent(fromDTO, draftEntity);
draftDao.insert(draftEntity);
}
@ -306,8 +308,8 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
DraftCoverEntity coverEntity = buildCoverEntity(tokenDto, fromDTO);
//发布范围
List<DraftPublishRangeEntity> publishRangeEntityList = buildDraftPublishRange(draftEntity, tokenDto, fromDTO);
// 栏目
draftEntity.setCategory(fromDTO.getCategory());
executeSaveDraftAttr(draftEntity, coverEntity, publishRangeEntityList);
return true;
}
@ -933,6 +935,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
article.setId(null);
article.setDraftId(draftId);
article.setStatusFlag(DraftConstant.PUBLISHED);
article.setCategory(draft.getCategory());
if (StringUtils.isNotBlank(publishWay)) {
article.setPublishWay(publishWay);
}
@ -1538,6 +1541,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
if (formDTO.getPublisherType().equals(DraftConstant.GRID)){
article.setGridId(formDTO.getPublisher());
}
article.setCategory(formDTO.getCategory());
article.setPreviewContent(getPreviewContent(formDTO.getContent()).length() > DraftConstant.PREVIEW_CONTENT_MAX_LENGTH ? getPreviewContent(formDTO.getContent()).substring(NumConstant.ZERO,DraftConstant.PREVIEW_CONTENT_MAX_LENGTH) : getPreviewContent(formDTO.getContent()));
article.setPublishDate(DateUtils.stringToDate(formDTO.getPublishDate(),DateUtils.DATE_PATTERN));
article.setPublisherId(formDTO.getPublisher());
@ -1617,6 +1621,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
// 1.草稿
DraftEntity draft = ConvertUtils.sourceToTarget(formDTO, DraftEntity.class);
draft.setDepartmentId(customerId);
draft.setCategory(formDTO.getCategory());
draft.setPreviewContent(StringUtils.isBlank(formDTO.getContent()) ? "" : getPreviewContent(formDTO.getContent()).length() > DraftConstant.PREVIEW_CONTENT_MAX_LENGTH ? getPreviewContent(formDTO.getContent()).substring(NumConstant.ZERO,DraftConstant.PREVIEW_CONTENT_MAX_LENGTH) : getPreviewContent(formDTO.getContent()));
draft.setPublisherId(StringUtils.isBlank(formDTO.getPublisher()) ? "" : formDTO.getPublisher());
draft.setPublishDate(StringUtils.isBlank(formDTO.getPublishDate()) ? null : DateUtils.stringToDate(formDTO.getPublishDate(),DateUtils.DATE_PATTERN));
@ -1841,6 +1846,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
if (formDTO.getPublisherType().equals(DraftConstant.GRID)){
articleEntity.setGridId(formDTO.getPublisher());
}
articleEntity.setCategory(formDTO.getCategory());
articleEntity.setPreviewContent(getPreviewContent(formDTO.getContent()).length() > DraftConstant.PREVIEW_CONTENT_MAX_LENGTH ? getPreviewContent(formDTO.getContent()).substring(NumConstant.ZERO,DraftConstant.PREVIEW_CONTENT_MAX_LENGTH) : getPreviewContent(formDTO.getContent()));
articleEntity.setPublishDate(DateUtils.stringToDate(formDTO.getPublishDate(),DateUtils.DATE_PATTERN));
articleEntity.setPublisherId(formDTO.getPublisher());

149
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/CategoryDictServiceImpl.java

@ -0,0 +1,149 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.distributedlock.DistributedLock;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.EpmetRequestHolder;
import com.epmet.dao.CategoryDictDao;
import com.epmet.dto.CategoryDictDTO;
import com.epmet.entity.CategoryDictEntity;
import com.epmet.service.CategoryDictService;
import org.apache.commons.lang3.StringUtils;
import org.redisson.api.RLock;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 文章栏目表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-04-11
*/
@Service
public class CategoryDictServiceImpl extends BaseServiceImpl<CategoryDictDao, CategoryDictEntity> implements CategoryDictService {
@Autowired
private DistributedLock distributedLock;
@Override
public PageData<CategoryDictDTO> page(Map<String, Object> params) {
IPage<CategoryDictEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, CategoryDictDTO.class);
}
@Override
public List<CategoryDictDTO> list(Map<String, Object> params) {
List<CategoryDictEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, CategoryDictDTO.class);
}
private QueryWrapper<CategoryDictEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<CategoryDictEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public CategoryDictDTO get(String id) {
CategoryDictEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, CategoryDictDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(CategoryDictDTO dto) {
String customerId = EpmetRequestHolder.getLoginUserCustomerId();
// 重名检查,客户下不能重名
LambdaQueryWrapper<CategoryDictEntity> query = new LambdaQueryWrapper<>();
query.eq(CategoryDictEntity::getCustomerId, customerId);
query.eq(CategoryDictEntity::getCategoryName, dto.getCategoryName());
// 加锁
RLock lock = distributedLock.getLock("voice:categorydict");
try {
if (baseDao.selectCount(query) > 0) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "栏目名称已存在");
}
dto.setCustomerId(customerId);
CategoryDictEntity entity = ConvertUtils.sourceToTarget(dto, CategoryDictEntity.class);
insert(entity);
} catch (EpmetException ee) {
throw ee;
} catch (Exception e) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "【文章】新增文章栏目失败:" + ExceptionUtils.getErrorStackTrace(e));
} finally {
// 解锁
lock.unlock();
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(CategoryDictDTO dto) {
String customerId = EpmetRequestHolder.getLoginUserCustomerId();
// 重名检查,客户下不能重名
LambdaQueryWrapper<CategoryDictEntity> query = new LambdaQueryWrapper<>();
query.eq(CategoryDictEntity::getCustomerId, customerId);
query.eq(CategoryDictEntity::getCategoryName, dto.getCategoryName());
RLock lock = distributedLock.getLock("voice:categorydict");
try {
CategoryDictEntity inDb = null;
// 能查询到一条数据,并且该条数据的ID不是当前修改的这条数据的ID,说明已存在同名的其他标签,该名字已被其他标签占用
if ((inDb = baseDao.selectOne(query)) != null
&& !inDb.getId().equals(dto.getId())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "栏目名称已存在");
}
dto.setCustomerId(customerId);
CategoryDictEntity entity = ConvertUtils.sourceToTarget(dto, CategoryDictEntity.class);
updateById(entity);
} catch (EpmetException ee) {
throw ee;
} catch (Exception e) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "【文章】新增文章栏目失败:" + ExceptionUtils.getErrorStackTrace(e));
} finally {
// 解锁
lock.unlock();
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public List<CategoryDictDTO> list(Integer pageNo, Integer pageSize) {
List<CategoryDictEntity> list = baseDao.selectList(null);
return ConvertUtils.sourceToTarget(list, CategoryDictDTO.class);
}
}

4
epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml

@ -7,6 +7,7 @@
SELECT
id AS ARTICLE_ID,
TITLE,
CATEGORY AS "category",
PUBLISHER_NAME,
PUBLISH_DATE,
( SELECT count( 1 ) FROM article_visit_record avr WHERE avr.DEL_FLAG = '0' AND avr.ARTICLE_ID =#{articleId}) AS VISIT_RECORD_COUNT,
@ -51,6 +52,7 @@
<select id="selectArticleListForAgency" resultType="com.epmet.dto.result.PublishedListResultDTO">
SELECT
a.ID AS "articleId",
a.CATEGORY AS "category",
a.TITLE AS "title",
IFNULL(a.PREVIEW_CONTENT, "") AS "previewContent",
a.PUBLISHER_NAME AS "publisherName",
@ -135,6 +137,7 @@
SELECT DISTINCT
a.ID AS "articleId",
a.TITLE AS "title",
a.CATEGORY AS "category",
IFNULL(a.PREVIEW_CONTENT, "") AS "previewContent",
a.PUBLISHER_NAME AS "publisherName",
a.OFF_LINE_TIME AS "publishDate"
@ -433,6 +436,7 @@
a.id AS "articleId",
a.org_id AS "agencyId",
a.title AS "title",
a.category AS "category",
IFNULL(a.preview_content, "") AS "previewContent",
a.publish_range_desc AS "publishRangeDesc",
a.publisher_id AS "publisher",

21
epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/CategoryDictDao.xml

@ -0,0 +1,21 @@
<?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.CategoryDictDao">
<resultMap type="com.epmet.entity.CategoryDictEntity" id="categoryDictMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="categoryName" column="CATEGORY_NAME"/>
<result property="pid" column="PID"/>
<result property="sort" column="SORT"/>
<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>
</mapper>

2
epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml

@ -135,6 +135,7 @@
SELECT
ID AS "draftId",
TITLE AS "title",
CATEGORY AS "category",
IFNULL(PREVIEW_CONTENT, "") AS "content",
UNIX_TIMESTAMP(CREATED_TIME) AS "createdTime",
STATUS_FLAG AS auditStatus
@ -183,6 +184,7 @@
a.id AS "draftId",
a.org_id AS "agencyId",
a.title AS "title",
a.CATEGORY AS "category",
IFNULL(a.preview_content, "") AS "previewContent",
a.publish_range_desc AS "publishRangeDesc",
a.publisher_id AS "publisher",

10
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java

@ -348,4 +348,14 @@ public interface ResiGroupOpenFeignClient {
**/
@PostMapping("/resi/group/group/partygrouplist/{partyOrgId}")
Result<List<ResiGroupDTO>> partyGroupList(@PathVariable String partyOrgId);
/**
* @description: 使用行政组织查询党小组数量
* @param agencyId: 行政组织单位id
* @return
* @author: WangXianZhang
* @date: 2023/4/14 12:33 PM
*/
@GetMapping("/resi/group/group/partyGroupQuantity/byAgencyId/{agencyId}")
Result<Integer> getPartyGroupQuantityByAgencyId(@PathVariable("agencyId") String agencyId);
}

4
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java

@ -253,4 +253,8 @@ public class ResiGroupOpenFeignClientFallback implements ResiGroupOpenFeignClien
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "partyGroupList", partyOrgId);
}
@Override
public Result<Integer> getPartyGroupQuantityByAgencyId(String agencyId) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "getPartyGroupQuantityByAgencyId", agencyId);
}
}

12
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java

@ -674,5 +674,17 @@ public class ResiGroupController {
return new Result<List<ResiGroupDTO>>().ok(resiGroupService.partyGroupList(partyOrgId));
}
/**
* @description: 使用行政组织查询党小组数量
* @param agencyId: 行政组织单位id
* @return
* @author: WangXianZhang
* @date: 2023/4/14 12:33 PM
*/
@GetMapping("partyGroupQuantity/byAgencyId/{agencyId}")
Result<Integer> getPartyGroupQuantityByAgencyId(@PathVariable("agencyId") String agencyId) {
return new Result<Integer>().ok(resiGroupService.getPartyGroupQuantityByAgencyId(agencyId));
}
}

3
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupEntity.java

@ -98,4 +98,7 @@ Ps: 如果一个小组被拒绝,当前小组的状态将永久停留在“审
* 小组等级
*/
private Integer level;
private String agencyId;
private String pids;
}

9
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java

@ -483,4 +483,13 @@ public interface ResiGroupService extends BaseService<ResiGroupEntity> {
Map<String, List<IcPartyOrgTreeDTO>> getBranchGroupList(String customerId);
List<ResiGroupDTO> partyGroupList(String partyOrgId);
/**
* @description: 使用行政组织查询党小组列表
* @param agencyId:
* @return
* @author: WangXianZhang
* @date: 2023/4/14 12:34 PM
*/
Integer getPartyGroupQuantityByAgencyId(String agencyId);
}

20
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java

@ -30,6 +30,8 @@ import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.scan.param.ImgScanParamDTO;
import com.epmet.commons.tools.scan.param.ImgTaskDTO;
import com.epmet.commons.tools.scan.param.TextScanParamDTO;
@ -37,10 +39,7 @@ import com.epmet.commons.tools.scan.param.TextTaskDTO;
import com.epmet.commons.tools.scan.result.SyncScanResult;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.commons.tools.utils.*;
import com.epmet.constant.ReadFlagConstant;
import com.epmet.constant.UserMessageTypeConstant;
import com.epmet.dto.form.*;
@ -1994,4 +1993,17 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
return ConvertUtils.sourceToTarget(entityList, ResiGroupDTO.class);
}
@Override
public Integer getPartyGroupQuantityByAgencyId(String agencyId) {
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(agencyId);
if (agencyInfo == null) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),
"【查询党小组数量】查询组织信息失败:" + agencyId, "【查询党小组数量】查询组织信息失败");
}
LambdaQueryWrapper<ResiGroupEntity> query = new LambdaQueryWrapper<>();
query.eq(ResiGroupEntity::getCustomerId, EpmetRequestHolder.getLoginUserCustomerId());
query.eq(ResiGroupEntity::getPids, PidUtils.convertPid2OrgIdPath(agencyId, agencyInfo.getPids()));
return baseDao.selectCount(query);
}
}

10
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyMemberDTO.java

@ -201,4 +201,14 @@ public class IcPartyMemberDTO implements Serializable {
*/
private Date updatedTime;
/**
* 头像
*/
private String headPhoto;
/**
* 性别
*/
private Integer gender;
}

33
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/LingShanScreenPartyActQtyStatsResultDTO.java

@ -0,0 +1,33 @@
package com.epmet.resi.partymember.dto.partymember.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
/**
* @description: agencyId下的党组织活动数统计
* @param null:
* @return
* @author: WangXianZhang
* @date: 2023/4/14 7:09 PM
*/
@Data
public class LingShanScreenPartyActQtyStatsResultDTO {
private String type;
private Collection<StatsData> data;
@Data
public static class StatsData {
@JsonIgnore
private String orgId;
private String name;
@JsonIgnore
private String actType;
private Integer value;
}
}

15
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/LingShanScreenPartyActTypeAndQtyResultDTO.java

@ -0,0 +1,15 @@
package com.epmet.resi.partymember.dto.partymember.result;
import lombok.Data;
/**
* 灵山大屏党建活动和数量
*/
@Data
public class LingShanScreenPartyActTypeAndQtyResultDTO {
private String actTypeKey;
private String name;
private Integer value;
}

17
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/LingShanScreenPartyOrgCategoryResultDTO.java

@ -0,0 +1,17 @@
package com.epmet.resi.partymember.dto.partymember.result;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 灵山大屏党组织和数量dto
*/
@Data
public class LingShanScreenPartyOrgCategoryResultDTO {
private String partyOrgType;
private String name;
private Integer value;
}

60
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/LingShanScreenPartyOrgTreeResultDTO.java

@ -0,0 +1,60 @@
package com.epmet.resi.partymember.dto.partymember.result;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
* 灵山大屏-党组织树
*/
@Data
public class LingShanScreenPartyOrgTreeResultDTO {
// 中共青岛市即墨区委灵山街道工作委员会
private String title;
private List<PartyOrg> list;
private Integer num;
@Data
public static class PartyOrg {
private String id;
private String pid;
private String name;
private Integer num;
private Integer orgType;
/**
* 子级组织列表
*/
private List<PartyOrg> children = new ArrayList<>();
/**
* 党员列表
*/
private List<Partymember> list = new ArrayList<>();;
}
/**
* @description: 党员信息
*/
@Data
public static class Partymember {
private String name;
private String gender;
private String age;
private String phone;
private String orgname;
private String photo;
private String remarks;
private Integer workStatus;
private Integer isDby;
private Integer isLhdy;
private Integer worknumber;
private Integer workEvent;
}
}

27
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyActDao.java

@ -2,6 +2,7 @@ package com.epmet.modules.partyOrg.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.modules.partyOrg.entity.IcPartyActEntity;
import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity;
import com.epmet.resi.partymember.dto.icpartyact.form.IcPartyActPageFormDTO;
import com.epmet.resi.partymember.dto.icpartyact.result.IcPartyActPageResultDTO;
import com.epmet.resi.partymember.dto.partyOrg.IcPartyActTypeDictDTO;
@ -11,9 +12,12 @@ import com.epmet.resi.partymember.dto.partyOrg.form.PartyActStatisFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyActListResultDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.PartyActStatisResultDTO;
import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyActQtyStatsResultDTO;
import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyActTypeAndQtyResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
/**
@ -52,4 +56,27 @@ public interface IcPartyActDao extends BaseDao<IcPartyActEntity> {
List<IcPartyActEntity> selectNoPublishList(String dateId);
List<PartyActStatisResultDTO> getPartActStatis(PartyActStatisFormDTO formDTO);
/**
* @description: 党建活动类型和数量
* @return
* @author: WangXianZhang
* @date: 2023/4/14 12:12 PM
*/
List<LingShanScreenPartyActTypeAndQtyResultDTO> getPartyActTypeAndQuantity(@Param("customerId") String customerId,
@Param("orgIdPath") String orgIdPath);
/**
* @description: 找出当前党组织的下级党组织及其对应的活动数量
* @param currentPartyOrg:
* @param holdTimeStart:
* @param holdTimeEnd:
* @return
* @author: WangXianZhang
* @date: 2023/4/14 8:36 PM
*/
List<LingShanScreenPartyActQtyStatsResultDTO.StatsData> actQtyOfPartyOrgStats(@Param("currentPartyOrgId") String currentPartyOrgId,
@Param("holdTimeStart") Date holdTimeStart,
@Param("holdTimeEnd") Date holdTimeEnd);
}

22
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java

@ -9,6 +9,8 @@ import com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDT
import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeSubDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.PartyOrgListResultDTO;
import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyOrgCategoryResultDTO;
import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyOrgTreeResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -126,4 +128,24 @@ public interface IcPartyOrgDao extends BaseDao<IcPartyOrgEntity> {
* @date 2022/9/7 15:04
*/
void editPrincipal(EditPrincipalFormDTO formDTO);
/**
* @description: 灵山大屏,党建引领党组织和数量
* @param agencyId:
* @param agencyOrgIdPath:
* @return java.util.List<com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyOrgCategoryResultDTO>
* @author: WangXianZhang
* @date: 2023/4/14 11:15 AM
*/
List<LingShanScreenPartyOrgCategoryResultDTO> listPartyOrgCategoryAndQuantity(@Param("customerId") String customerId,
@Param("agencyId") String agencyId,
@Param("agencyOrgIdPath") String agencyOrgIdPath);
List<LingShanScreenPartyOrgTreeResultDTO.PartyOrg> getPartyOrgsLteDangwei(@Param("customerId") String customerId,
@Param("agencyId") String agencyId,
@Param("orgIdpath") String orgIdpath);
List<LingShanScreenPartyOrgTreeResultDTO.PartyOrg> getPartyOrgsOfBranch(@Param("customerId") String customerId,
@Param("agencyId") String agencyId,
@Param("orgIdpath") String orgIdpath);
}

120
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/LingShanScreenController.java

@ -0,0 +1,120 @@
package com.epmet.modules.partymember.controller;
import com.epmet.commons.tools.enums.PartyOrgTypeEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.modules.partymember.service.LingShanScreenService;
import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyActQtyStatsResultDTO;
import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyActTypeAndQtyResultDTO;
import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyOrgCategoryResultDTO;
import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyOrgTreeResultDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
import java.util.List;
@RestController
@RequestMapping("lingshanScreen")
@Slf4j
public class LingShanScreenController {
@Autowired
private LingShanScreenService lingShanScreenService;
/**
* @description: 党建引领党组织和数量
* @param agencyId: 当前组织id
* @return com.epmet.commons.tools.utils.Result
* @author: WangXianZhang
* @date: 2023/4/14 10:57 AM
*/
@GetMapping("partyOrgCategoryAndQuantity")
public Result<List<LingShanScreenPartyOrgCategoryResultDTO>> listPartyOrgCategoryAndQuantity(@RequestParam("agencyId") String agencyId) {
List<LingShanScreenPartyOrgCategoryResultDTO> l = lingShanScreenService.listPartyOrgCategoryAndQuantity(agencyId);
return new Result().ok(l);
}
/**
* @description: 党建活动类型和数量
* @param agencyId: 组织id
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyOrgCategoryResultDTO>>
* @author: WangXianZhang
* @date: 2023/4/14 12:03 PM
*/
@GetMapping("partyActTypeAndQuantity")
public Result<List<LingShanScreenPartyActTypeAndQtyResultDTO>> partyActTypeAndQuantity(@RequestParam("agencyId") String agencyId) {
List<LingShanScreenPartyActTypeAndQtyResultDTO> l = lingShanScreenService.partyActTypeAndQuantity(agencyId);
return new Result().ok(l);
}
/**
* @description: 党组织数(只到党支部没有小组)
* @param agencyId:
* @return
* @author: WangXianZhang
* @date: 2023/4/14 1:00 PM
*/
@GetMapping("partyOrgTree")
public Result<LingShanScreenPartyOrgTreeResultDTO> getPartyOrgTree(@RequestParam("agencyId") String agencyId) {
LingShanScreenPartyOrgTreeResultDTO l = lingShanScreenService.getPartyOrgTree(agencyId);
return new Result().ok(l);
}
/**
* @description: 党员列表
* @param partyOrgId: 党组织id
* @return
* @author: WangXianZhang
* @date: 2023/4/14 3:20 PM
*/
@GetMapping("partymemberList")
public Result<List<LingShanScreenPartyOrgTreeResultDTO.Partymember>> partymemberList(@RequestParam("partyOrgId") String partyOrgId) {
List<LingShanScreenPartyOrgTreeResultDTO.Partymember> l = lingShanScreenService.partymemberListByPartyOrgId(partyOrgId);
return new Result().ok(l);
}
/**
* @description: agencyId下的党组织活动数统计
* @param agencyId: 行政组织id
* @return
* @author: WangXianZhang
* @date: 2023/4/14 7:07 PM
*/
@GetMapping("partyActStats/actQtyOfPartyOrg")
public Result<List<LingShanScreenPartyActQtyStatsResultDTO>> actQtyOfPartyOrgStats(@RequestParam("agencyId") String agencyId,
@RequestParam("holdTimeStart") String holdTimeStartStr,
@RequestParam("holdTimeEnd") String holdTimeEndStr) {
Date holdTimeStart;
Date holdTimeEnd;
try {
holdTimeStart = DateUtils.parse(holdTimeStartStr, DateUtils.DATE_TIME_PATTERN);
holdTimeEnd = DateUtils.parse(holdTimeEndStr, DateUtils.DATE_TIME_PATTERN);
} catch (Exception e) {
log.error("日期解析失败,请按指定格式传输:yyyy-MM-dd HH:mm:ss");
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "日期解析失败");
}
List<LingShanScreenPartyActQtyStatsResultDTO> l = lingShanScreenService.actQtyOfPartyOrgStats(agencyId, holdTimeStart, holdTimeEnd);
return new Result<List<LingShanScreenPartyActQtyStatsResultDTO>>().ok(l);
}
/**
* @description: 大屏地图-党员数
* @param agencyId:
* @return
* @author: WangXianZhang
* @date: 2023/4/17 1:54 PM
*/
@GetMapping("partymemberQty")
public Result<Integer> getPartymemberQtyOfOrg(@RequestParam("agencyId") String agencyId) {
return new Result<Integer>().ok(lingShanScreenService.getPartymemberQtyOfOrg(agencyId));
}
}

2
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberDao.java

@ -29,7 +29,7 @@ public interface IcPartyMemberDao extends BaseDao<IcPartyMemberEntity> {
* @Author zhaoqifeng
* @Date 2022/5/18 17:01
*/
List<IcPartyMemberResultDTO> selectList(IcPartyMemberFromDTO formDTO);
List<IcPartyMemberResultDTO> selectListZqf(IcPartyMemberFromDTO formDTO);
/**
* @describe: 查询该组织下的党员信息

3
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/IcPartyMemberEntity.java

@ -158,4 +158,7 @@ public class IcPartyMemberEntity extends BaseEpmetEntity {
*/
private String field5;
private String headPhoto;
private Integer gender;
}

68
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/LingShanScreenService.java

@ -0,0 +1,68 @@
package com.epmet.modules.partymember.service;
import com.epmet.commons.tools.utils.Result;
import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyActQtyStatsResultDTO;
import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyActTypeAndQtyResultDTO;
import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyOrgCategoryResultDTO;
import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyOrgTreeResultDTO;
import java.util.Date;
import java.util.List;
public interface LingShanScreenService {
/**
* @description: 党建引领党组织和数量
* @param agencyId: 组织id
* @return java.util.List<com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyOrgCategoryResultDTO>
* @author: WangXianZhang
* @date: 2023/4/14 11:02 AM
*/
List<LingShanScreenPartyOrgCategoryResultDTO> listPartyOrgCategoryAndQuantity(String agencyId);
/**
* @description: 党建活动类型和数量
* @param agencyId: 组织id
* @return
* @author: WangXianZhang
* @date: 2023/4/14 12:05 PM
*/
List<LingShanScreenPartyActTypeAndQtyResultDTO> partyActTypeAndQuantity(String agencyId);
/**
* @description:
* @param agencyId:
* @return
* @author: WangXianZhang
* @date: 2023/4/14 1:09 PM
*/
LingShanScreenPartyOrgTreeResultDTO getPartyOrgTree(String agencyId);
/**
* @description: 党员列表
* @param partyOrgId:
* @return
* @author: WangXianZhang
* @date: 2023/4/14 3:22 PM
*/
List<LingShanScreenPartyOrgTreeResultDTO.Partymember> partymemberListByPartyOrgId(String partyOrgId);
/**
* @description: agencyId下的党组织活动数统计
* @param agencyId:
* @param holdTimeStart:
* @param holdTimeEnd:
* @return
* @author: WangXianZhang
* @date: 2023/4/14 7:27 PM
*/
List<LingShanScreenPartyActQtyStatsResultDTO> actQtyOfPartyOrgStats(String agencyId, Date holdTimeStart, Date holdTimeEnd);
/**
* @description: 大屏地图-党员数
* @param agencyId:
* @return
* @author: WangXianZhang
* @date: 2023/4/17 1:55 PM
*/
Integer getPartymemberQtyOfOrg(String agencyId);
}

2
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberServiceImpl.java

@ -127,7 +127,7 @@ public class IcPartyMemberServiceImpl extends BaseServiceImpl<IcPartyMemberDao,
formDTO.setYear(date.substring(0, 4));
formDTO.setMonth(date.substring(4, 6));
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage());
List<IcPartyMemberResultDTO> list = baseDao.selectList(formDTO);
List<IcPartyMemberResultDTO> list = baseDao.selectListZqf(formDTO);
PageInfo<IcPartyMemberResultDTO> pageInfo = new PageInfo<>(list);
//获取文化程度字典

323
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/LingShanScreenServiceImpl.java

@ -0,0 +1,323 @@
package com.epmet.modules.partymember.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.enums.GenderEnum;
import com.epmet.commons.tools.enums.PartyOrgTypeEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerResiUserRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.IcResiUserInfoCache;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.EpmetRequestHolder;
import com.epmet.commons.tools.utils.PidUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.modules.partyOrg.dao.IcPartyActDao;
import com.epmet.modules.partyOrg.dao.IcPartyActTypeDictDao;
import com.epmet.modules.partyOrg.dao.IcPartyOrgDao;
import com.epmet.modules.partyOrg.entity.IcPartyActTypeDictEntity;
import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity;
import com.epmet.modules.partymember.dao.IcPartyMemberDao;
import com.epmet.modules.partymember.entity.IcPartyMemberEntity;
import com.epmet.modules.partymember.service.LingShanScreenService;
import com.epmet.resi.group.feign.ResiGroupOpenFeignClient;
import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyActQtyStatsResultDTO;
import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyActTypeAndQtyResultDTO;
import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyOrgCategoryResultDTO;
import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyOrgTreeResultDTO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@Service
public class LingShanScreenServiceImpl implements LingShanScreenService, ResultDataResolver {
@Autowired
private IcPartyOrgDao icPartyOrgDao;
@Autowired
private IcPartyActDao partyActDao;
@Autowired
private IcPartyMemberDao icPartyMemberDao;
@Autowired
private IcPartyActTypeDictDao partyActTypeDictDao;
@Autowired
private ResiGroupOpenFeignClient groupOpenFeignClient;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Override
public List<LingShanScreenPartyOrgCategoryResultDTO> listPartyOrgCategoryAndQuantity(String agencyId) {
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(agencyId);
if (agencyInfo == null) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询当前组织信息失败,agencyId:" + agencyId, "查询当前组织信息失败");
}
// 1.查询党组织
List<LingShanScreenPartyOrgCategoryResultDTO> l = icPartyOrgDao
.listPartyOrgCategoryAndQuantity(EpmetRequestHolder.getLoginUserCustomerId(), agencyId, PidUtils.convertPid2OrgIdPath(agencyId, agencyInfo.getPids()));
// 给组织类型名字赋值
l.forEach(i -> {
PartyOrgTypeEnum partyOrgTypeEnum = PartyOrgTypeEnum.getEnumByCode(i.getPartyOrgType());
if (partyOrgTypeEnum != null) {
i.setName(partyOrgTypeEnum.getName());
}
});
// 2.查询党小组
Integer groupQty = getResultDataOrReturnNull(groupOpenFeignClient.getPartyGroupQuantityByAgencyId(agencyId), ServiceConstant.RESI_GROUP_SERVER);
if (groupQty == null) {
logger.error("【灵山大屏】党建引领-查询党小组信息失败,agencyId:" + agencyId);
groupQty = 0;
}
LingShanScreenPartyOrgCategoryResultDTO gq = new LingShanScreenPartyOrgCategoryResultDTO();
gq.setName("党小组");
gq.setPartyOrgType(null);
gq.setValue(groupQty);
l.add(gq);
return l;
}
@Override
public List<LingShanScreenPartyActTypeAndQtyResultDTO> partyActTypeAndQuantity(String agencyId) {
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(agencyId);
if (agencyInfo == null) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询当前组织信息失败,agencyId:" + agencyId, "查询当前组织信息失败");
}
return partyActDao.getPartyActTypeAndQuantity(EpmetRequestHolder.getLoginUserCustomerId(), PidUtils.convertPid2OrgIdPath(agencyId, agencyInfo.getPids()));
}
@Override
public LingShanScreenPartyOrgTreeResultDTO getPartyOrgTree(String agencyId) {
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(agencyId);
if (agencyInfo == null) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询当前组织信息失败,agencyId:" + agencyId, "查询当前组织信息失败");
}
String orgIdpath = PidUtils.convertPid2OrgIdPath(agencyId, agencyInfo.getPids());
// 1。查询组织
// 先查党委以上级别的,含党委
List<LingShanScreenPartyOrgTreeResultDTO.PartyOrg> l = icPartyOrgDao.getPartyOrgsLteDangwei(EpmetRequestHolder.getLoginUserCustomerId(), agencyId, orgIdpath);
// 再查党支部的。因为党委查询的时候使用pids和党支部的时候使用起来不一样,所以要分开
List<LingShanScreenPartyOrgTreeResultDTO.PartyOrg> s = icPartyOrgDao.getPartyOrgsOfBranch(EpmetRequestHolder.getLoginUserCustomerId(), agencyId, orgIdpath);
l.addAll(s);
// 2.组装树了开始
Map<String, LingShanScreenPartyOrgTreeResultDTO.PartyOrg> lMap = l.stream().collect(Collectors.toMap(e -> e.getId(), Function.identity()));
// 树根组织的id
String parentPartyOrgId = null;
// 最高的组织级别,用于找到树根。初始值给个100,大一点,不影响
Integer maxLevel = 100;
// 将组织放入到父组织的children列表中
for (Iterator<LingShanScreenPartyOrgTreeResultDTO.PartyOrg> it = l.iterator(); it.hasNext();) {
LingShanScreenPartyOrgTreeResultDTO.PartyOrg e = it.next();
LingShanScreenPartyOrgTreeResultDTO.PartyOrg pOrg = lMap.get(e.getPid());
if (maxLevel > e.getOrgType()) {
maxLevel = e.getOrgType();
parentPartyOrgId = e.getId();
}
if (pOrg != null) {
pOrg.getChildren().add(e);
// 修剪枝叶
it.remove();
}
}
LingShanScreenPartyOrgTreeResultDTO.PartyOrg parentOrg = lMap.get(parentPartyOrgId);
LingShanScreenPartyOrgTreeResultDTO r = new LingShanScreenPartyOrgTreeResultDTO();
r.setTitle(parentOrg.getName());
r.setNum(parentOrg.getNum());
r.setList(parentOrg.getChildren());
return r;
}
@Override
public List<LingShanScreenPartyOrgTreeResultDTO.Partymember> partymemberListByPartyOrgId(String partyOrgId) {
IcPartyOrgEntity partyOrg = icPartyOrgDao.selectById(partyOrgId);
LambdaQueryWrapper<IcPartyMemberEntity> query = null;
if (partyOrg == null) {
String baseErrorMsg = "【灵山大屏】党组织下的党员列表-未找到党组织信息。";
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format(baseErrorMsg + "partyOrgId:" + partyOrg), baseErrorMsg);
} else if (Integer.valueOf(partyOrg.getPartyOrgType()) >= 4) {
// 0省委,1市委,2区委,3党工委,4党委,5支部。党委以上,除了支部
query = new LambdaQueryWrapper<>();
query.eq(IcPartyMemberEntity::getOrgPids, PidUtils.convertPid2OrgIdPath(partyOrgId, partyOrg.getOrgPids()));
query.eq(IcPartyMemberEntity::getCustomerId, EpmetRequestHolder.getLoginUserCustomerId());
} else {
// 5支部
query = new LambdaQueryWrapper<>();
query.eq(IcPartyMemberEntity::getOrgPids, partyOrg.getOrgPids());
query.eq(IcPartyMemberEntity::getCustomerId, EpmetRequestHolder.getLoginUserCustomerId());
}
List<IcPartyMemberEntity> l = icPartyMemberDao.selectList(query);
// 党员列表转化为需要的dto返回
return l.stream().map(e -> {
// 查询支部
IcPartyOrgEntity branch = icPartyOrgDao.selectById(e.getSszb());
// 查询居民信息,用于显示年龄
IcResiUserInfoCache resiInfo = CustomerResiUserRedis.getIcResiUserInfo(e.getIcResiUser());
LingShanScreenPartyOrgTreeResultDTO.Partymember t = new LingShanScreenPartyOrgTreeResultDTO.Partymember();
String birthDay;
if (resiInfo != null
&& StringUtils.isNotBlank(birthDay = resiInfo.getBirthday())) {
Date birthday = DateUtils.parse(birthDay, DateUtils.DATE_PATTERN);
Calendar ci = Calendar.getInstance();
ci.setTime(birthday);
int birthYear = ci.get(Calendar.YEAR);
t.setAge((LocalDate.now().getYear() - birthYear) + "");
}
t.setName(e.getName());
Integer gender = e.getGender();
t.setGender(gender != null ? GenderEnum.getName(gender.toString()) : "未知");
t.setOrgname(branch != null ? branch.getPartyOrgName() : null);
t.setPhone(e.getMobile());
t.setRemarks(e.getRemark());
t.setPhoto(e.getHeadPhoto());
// t.setIsDby();
// t.setIsLhdy();
// t.setWorkStatus();
// t.setWorknumber();
// t.setWorkEvent();
return t;
}).collect(Collectors.toList());
}
/**
* @description: 这个方法其实有更容易实现更容易阅读和理解的方式循环活动类型每个活动类型都查询一次统计数据即可
* 但是前期追求更少次数的数据库调用以提升效率越写越复杂既然已经这样了也懒得改了就这样吧
* 如果后面有人感觉维护不了了直接按照上述方式重写就行了不要犹豫不要徘徊很容易改没有暗雷
* @param agencyId: 行政组织id
* @return
* @author: WangXianZhang
* @date: 2023/4/14 11:33 PM
*/
@Override
public List<LingShanScreenPartyActQtyStatsResultDTO> actQtyOfPartyOrgStats(String agencyId, Date holdTimeStart, Date holdTimeEnd) {
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(agencyId);
if (agencyInfo == null) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询当前组织信息失败,agencyId:" + agencyId, "查询当前组织信息失败");
}
// String orgIdpath = PidUtils.convertPid2OrgIdPath(agencyId, agencyInfo.getPids());
// 先查当前党组织信息
LambdaQueryWrapper<IcPartyOrgEntity> currentPartyOrgQuery = new LambdaQueryWrapper<>();
currentPartyOrgQuery.eq(IcPartyOrgEntity::getAgencyId, agencyId);
currentPartyOrgQuery.orderByAsc(IcPartyOrgEntity::getPartyOrgType);
currentPartyOrgQuery.last(" limit 1 ");
IcPartyOrgEntity currentPartyOrg = icPartyOrgDao.selectOne(currentPartyOrgQuery);
if (currentPartyOrg == null) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "未找到党组织信息");
}
// ----------------------------要重写的话,上面建议保留噢,只重写下面就可以了,淦---------------------------------
// 找出当前党组织的下级党组织(全部),及其对应的活动数量
List<LingShanScreenPartyActQtyStatsResultDTO.StatsData> l = partyActDao.actQtyOfPartyOrgStats(currentPartyOrg.getId(), holdTimeStart, holdTimeEnd);
// 将结果遍历,分成2个纬度,分别建立地址引用
// Map<actType, Map<orgId, LingShanScreenPartyActQtyStatsResultDTO.StatsData>>
Map<String, Map<String, LingShanScreenPartyActQtyStatsResultDTO.StatsData>> orgDimMap = new HashMap<>();
HashMap<String, String> orgIdAndName = new HashMap<>();
l.forEach(e -> {
orgIdAndName.put(e.getOrgId(), e.getName());
String actType = e.getActType();
if (StringUtils.isNotBlank(actType)) {
// 不为空,说明该类型有活动数据
Map<String, LingShanScreenPartyActQtyStatsResultDTO.StatsData> m = orgDimMap.get(actType);
if (m == null) {
m = new HashMap<>();
orgDimMap.put(actType, m);
}
m.put(e.getOrgId(), e);
}
});
// 所有的活动类型,并且建立字典,供后续使用
LambdaQueryWrapper<IcPartyActTypeDictEntity> actTypeQuery = new LambdaQueryWrapper<>();
actTypeQuery.eq(IcPartyActTypeDictEntity::getCustomerId, EpmetRequestHolder.getLoginUserCustomerId());
List<IcPartyActTypeDictEntity> actTypes = partyActTypeDictDao.selectList(actTypeQuery);
Map<String, String> actTypeKeyAndName = actTypes.stream().collect(Collectors.toMap(IcPartyActTypeDictEntity::getTypeKey, IcPartyActTypeDictEntity::getTypeName));
// 二维遍历,外层活动类型,内层组织id。确保两个维度的坐标都是全的(哪怕value=0)
for (IcPartyActTypeDictEntity actType : actTypes) {
// 补全外层活动类型
Map<String, LingShanScreenPartyActQtyStatsResultDTO.StatsData> orgIdAndStats = orgDimMap.get(actType.getTypeKey());
if (orgIdAndStats == null) {
orgIdAndStats = new HashMap<>();
orgDimMap.put(actType.getTypeKey(), orgIdAndStats);
}
// 为活动类型补全组织列表(没有活动的组织赋值0)
for (Map.Entry<String, String> entry : orgIdAndName.entrySet()) {
String orgId = entry.getKey();
LingShanScreenPartyActQtyStatsResultDTO.StatsData statsData = orgIdAndStats.get(orgId);
if (statsData == null) {
LingShanScreenPartyActQtyStatsResultDTO.StatsData e = new LingShanScreenPartyActQtyStatsResultDTO.StatsData();
e.setOrgId(orgId);
e.setName(entry.getValue());
e.setValue(0);
e.setActType(actType.getTypeKey());
orgIdAndStats.put(orgId, e);
}
}
}
// 将结果map转化为list,返回
ArrayList<LingShanScreenPartyActQtyStatsResultDTO> rl = new ArrayList<>();
orgDimMap.forEach((actType, orgStatsMap) -> {
LingShanScreenPartyActQtyStatsResultDTO re = new LingShanScreenPartyActQtyStatsResultDTO();
re.setType(actTypeKeyAndName.get(actType));
re.setData(orgStatsMap.values());
rl.add(re);
});
return rl;
}
@Override
public Integer getPartymemberQtyOfOrg(String agencyId) {
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(agencyId);
if (agencyInfo == null) {
logger.error("getPartymemberQtyOfOrg查询组织信息失败agencyId:{}", agencyId);
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询当前组织信息失败,agencyId:" + agencyId, "查询当前组织信息失败");
}
LambdaQueryWrapper<IcPartyMemberEntity> query = new LambdaQueryWrapper<>();
query.likeRight(IcPartyMemberEntity::getAgencyPids, PidUtils.convertPid2OrgIdPath(agencyId, agencyInfo.getPids()))
.or()
.eq(IcPartyMemberEntity::getAgencyId, agencyId);
return icPartyMemberDao.selectCount(query);
}
}

2
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java

@ -58,7 +58,6 @@ import com.epmet.resi.partymember.dto.partymember.result.ReviewedParyMemberResul
import com.epmet.resi.partymember.dto.partymember.result.UnderReviewParyMemberResultDTO;
import info.debatty.java.stringsimilarity.Levenshtein;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -534,7 +533,6 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl<PartymemberB
}
@NotNull
private String getString(String result, double comparisonResult, double most, double small) {
if (comparisonResult == PartyMemberConstant.EQUALS) {
result = result + "11";

27
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyActDao.xml

@ -99,6 +99,7 @@
SELECT
a.ID AS icPartyActId,
a.TOPIC,
a.ORG_ID as orgId,
a.PUBLISH_PARTY_ORG_NAME AS publishPartyOrgName,
a.PUBLISH_STAFF_NAME AS publishStaffName,
d.TYPE_NAME AS actTypeName,
@ -268,4 +269,30 @@
ipao.join_org_id
</select>
<!--党建活动类型和数量-->
<select id="getPartyActTypeAndQuantity"
resultType="com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyActTypeAndQtyResultDTO">
select t.TYPE_KEY actTypeKey
, t.TYPE_NAME name
, count(*) as value
from ic_party_act a
inner join ic_party_act_type_dict t on (a.ACT_TYPE = t.TYPE_KEY and t.DEL_FLAG = 0)
where a.DEL_FLAG = 0
and a.CUSTOMER_ID = #{customerId}
and a.ORG_ID_PATH like CONCAT(#{orgIdPath}, '%')
group by t.TYPE_KEY
</select>
<!--找出当前党组织的下级党组织,及其对应的活动数量-->
<select id="actQtyOfPartyOrgStats"
resultType="com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyActQtyStatsResultDTO$StatsData">
select
o.ID org_id , o.PARTY_ORG_NAME name, a.ACT_TYPE act_type, count(a.ID) as value
from ic_party_org o
left join ic_party_act a on (a.PUBLISH_ORG_PATH like concat(o.ORG_PIDS, ':', o.ID, '%') and a.DEL_FLAG = 0
and a.HOLD_TIME >= #{holdTimeStart} and a.HOLD_TIME &lt;= #{holdTimeEnd})
where o.ORG_PID = #{currentPartyOrgId}
group by o.ID, o.PARTY_ORG_NAME, o.PARTY_ORG_TYPE, a.ACT_TYPE
</select>
</mapper>

44
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml

@ -249,4 +249,48 @@
ORDER BY org_pids ASC
</select>
<!--党建引领,党组织和数量。AGENCY_PIDS和AGENCY_ID双条件组合。agencyId的所有下级+agencyId的本级-->
<select id="listPartyOrgCategoryAndQuantity"
resultType="com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyOrgCategoryResultDTO">
select PARTY_ORG_TYPE partyOrgType, count(*) as 'value'
from ic_party_org
where CUSTOMER_ID=#{customerId}
and (AGENCY_PIDS like CONCAT(#{agencyOrgIdPath}, '%') or AGENCY_ID = #{agencyId})
and DEL_FLAG = 0
group by PARTY_ORG_TYPE
order by PARTY_ORG_TYPE asc
</select>
<!--获取党委以上组织列表-->
<select id="getPartyOrgsLteDangwei"
resultType="com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyOrgTreeResultDTO$PartyOrg">
select org.ID id
, org.ORG_PID pid
, org.PARTY_ORG_TYPE org_type
, org.PARTY_ORG_NAME name
, count(mem.ID) num
from ic_party_org org
left join ic_party_member mem on (mem.DEL_FLAG = 0 and mem.ORG_PIDS like concat(org.ORG_PIDS, ':', org.ID, '%'))
where org.DEL_FLAG = 0
and org.PARTY_ORG_TYPE &lt;= '4'
and (org.AGENCY_ID = #{agencyId} or org.AGENCY_PIDS like CONCAT(#{orgIdpath}, '%'))
group by org.ID, org.PARTY_ORG_NAME
</select>
<!--获取支部列表-->
<select id="getPartyOrgsOfBranch"
resultType="com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyOrgTreeResultDTO$PartyOrg">
select org.ID id
, org.ORG_PID pid
, org.PARTY_ORG_TYPE org_type
, org.PARTY_ORG_NAME name
, count(mem.ID) num
from ic_party_org org
left join ic_party_member mem on (mem.DEL_FLAG = 0 and mem.SSZB = org.ID)
where org.DEL_FLAG = 0
and org.PARTY_ORG_TYPE = '5'
and (org.AGENCY_ID = #{agencyId} or org.AGENCY_PIDS like CONCAT(#{orgIdpath}, '%'))
group by org.ID, org.PARTY_ORG_NAME
</select>
</mapper>

3
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberDao.xml

@ -35,8 +35,9 @@
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
<result property="headPhoto" column="HEAD_PHOTO"/>
</resultMap>
<select id="selectList" resultType="com.epmet.resi.partymember.dto.partymember.result.IcPartyMemberResultDTO">
<select id="selectListZqf" resultType="com.epmet.resi.partymember.dto.partymember.result.IcPartyMemberResultDTO">
SELECT
*
FROM (

Loading…
Cancel
Save