From 58eb697fb758bff54b4e70a45149ba621ecdd313 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 12 Apr 2023 10:30:54 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E3=80=90=E7=81=B5=E5=B1=B1=E8=A1=97?= =?UTF-8?q?=E9=81=93=E3=80=91=E5=85=9A=E5=BB=BA=E5=A3=B0=E9=9F=B3=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E5=AD=97=E5=85=B8curd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.yml | 2 +- .../java/com/epmet/dto/CategoryDictDTO.java | 74 +++++++++ .../controller/CategoryDictController.java | 72 +++++++++ .../java/com/epmet/dao/CategoryDictDao.java | 16 ++ .../com/epmet/entity/CategoryDictEntity.java | 44 ++++++ .../epmet/service/CategoryDictService.java | 88 +++++++++++ .../service/impl/CategoryDictServiceImpl.java | 149 ++++++++++++++++++ .../main/resources/mapper/CategoryDictDao.xml | 21 +++ 8 files changed, 465 insertions(+), 1 deletion(-) create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/CategoryDictDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/CategoryDictController.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/CategoryDictDao.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/CategoryDictEntity.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/CategoryDictService.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/CategoryDictServiceImpl.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/CategoryDictDao.xml diff --git a/epmet-cloud-generator/src/main/resources/application.yml b/epmet-cloud-generator/src/main/resources/application.yml index 86b39b69c8..28e9fae188 100644 --- a/epmet-cloud-generator/src/main/resources/application.yml +++ b/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配置 diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/CategoryDictDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/CategoryDictDTO.java new file mode 100644 index 0000000000..bbbce73e60 --- /dev/null +++ b/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; + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/CategoryDictController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/CategoryDictController.java new file mode 100644 index 0000000000..40d67f975f --- /dev/null +++ b/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(@RequestParam Integer pageNo, @RequestParam Integer pageSize){ + List list = categoryDictService.list(pageNo, pageSize); + return new Result>().ok(list); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + CategoryDictDTO data = categoryDictService.get(id); + return new Result().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(); + } + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/CategoryDictDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/CategoryDictDao.java new file mode 100644 index 0000000000..6797882a8a --- /dev/null +++ b/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 { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/CategoryDictEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/CategoryDictEntity.java new file mode 100644 index 0000000000..e6cd84571c --- /dev/null +++ b/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; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/CategoryDictService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/CategoryDictService.java new file mode 100644 index 0000000000..b070fd1c34 --- /dev/null +++ b/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 { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2023-04-11 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2023-04-11 + */ + List list(Map 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 + * @author: WangXianZhang + * @date: 2023/4/11 7:06 PM + */ + List list(Integer pageNo, Integer pageSize); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/CategoryDictServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/CategoryDictServiceImpl.java new file mode 100644 index 0000000000..e48f6fd893 --- /dev/null +++ b/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 implements CategoryDictService { + + @Autowired + private DistributedLock distributedLock; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CategoryDictDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CategoryDictDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public 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 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 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 list(Integer pageNo, Integer pageSize) { + List list = baseDao.selectList(null); + return ConvertUtils.sourceToTarget(list, CategoryDictDTO.class); + } +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/CategoryDictDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/CategoryDictDao.xml new file mode 100644 index 0000000000..5a7231a4c7 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/CategoryDictDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 97e94fac5febe84ff794a86e30572c7a7c59f9be Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 13 Apr 2023 10:02:59 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E3=80=90=E7=81=B5=E5=B1=B1=E8=A1=97?= =?UTF-8?q?=E9=81=93=E3=80=911.=E6=96=87=E7=AB=A0=E5=92=8C=E8=8D=89?= =?UTF-8?q?=E7=A8=BF=E7=9A=84=E6=96=B0=E5=A2=9E=E3=80=81=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E3=80=81=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=A0=8F=E7=9B=AE=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/form/AddOrSaveDraftFormDTO.java | 3 +++ .../java/com/epmet/dto/form/UpdateArticleFormDTO.java | 3 +++ .../java/com/epmet/dto/result/DraftPcListResultDTO.java | 5 +++++ .../com/epmet/dto/result/PublishedListResultDTO.java | 5 +++++ .../src/main/java/com/epmet/entity/ArticleEntity.java | 9 +++++++++ .../src/main/java/com/epmet/entity/DraftEntity.java | 9 +++++++++ .../java/com/epmet/service/impl/ArticleServiceImpl.java | 3 +++ .../src/main/resources/mapper/ArticleDao.xml | 1 + .../src/main/resources/mapper/DraftDao.xml | 1 + 9 files changed, 39 insertions(+) diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/AddOrSaveDraftFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/AddOrSaveDraftFormDTO.java index 568943b537..207fb75bcc 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/AddOrSaveDraftFormDTO.java +++ b/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 */ diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/UpdateArticleFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/UpdateArticleFormDTO.java index b575bf90c6..860e0fd6e6 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/UpdateArticleFormDTO.java +++ b/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; diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftPcListResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftPcListResultDTO.java index 2f14da3dc6..814d1e797c 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftPcListResultDTO.java +++ b/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 */ diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/PublishedListResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/PublishedListResultDTO.java index e73acb6294..78ff5fe7f9 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/PublishedListResultDTO.java +++ b/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 */ diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleEntity.java index 87a4c76078..828bc985a6 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleEntity.java +++ b/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 */ diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftEntity.java index 1c93cfc7cf..354ea0e01a 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftEntity.java +++ b/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; + /** * 标题审核状态 */ diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java index a1777b5056..14e3054801 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java @@ -1538,6 +1538,7 @@ public class ArticleServiceImpl extends BaseServiceImpl 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 +1618,7 @@ public class ArticleServiceImpl extends BaseServiceImpl 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 +1843,7 @@ public class ArticleServiceImpl extends BaseServiceImpl 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()); diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml index 5e67b953a0..2440451d7b 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml @@ -433,6 +433,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", diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml index ab61a224e1..8d8e396aac 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml @@ -183,6 +183,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", From 64e14e3f383b3a212cbd15edc32d16c9c20f7abc Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 13 Apr 2023 10:41:07 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E3=80=90=E7=81=B5=E5=B1=B1=E8=A1=97?= =?UTF-8?q?=E9=81=93=E3=80=911.=E5=B0=8F=E7=A8=8B=E5=BA=8F=E7=AB=AF+PC?= =?UTF-8?q?=E7=AB=AF=E7=9A=84=E6=96=87=E7=AB=A0=E5=92=8C=E8=8D=89=E7=A8=BF?= =?UTF-8?q?=E7=9A=84=E6=96=B0=E5=A2=9E=E3=80=81=E5=88=97=E8=A1=A8=E3=80=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3=EF=BC=8C=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=A0=8F=E7=9B=AE=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/form/DraftAttrFromDTO.java | 5 +++++ .../main/java/com/epmet/dto/form/DraftContentFromDTO.java | 5 +++++ .../main/java/com/epmet/dto/result/DraftListResultDTO.java | 4 ++++ .../com/epmet/dto/result/GovArticleDetailResultDTO.java | 5 ++++- .../java/com/epmet/dto/result/OfflineListResultDTO.java | 5 +++++ .../main/java/com/epmet/controller/DraftController.java | 2 +- .../java/com/epmet/service/impl/ArticleServiceImpl.java | 7 +++++-- .../src/main/resources/mapper/ArticleDao.xml | 3 +++ .../src/main/resources/mapper/DraftDao.xml | 1 + 9 files changed, 33 insertions(+), 4 deletions(-) diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftAttrFromDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftAttrFromDTO.java index 6d4b81cc2a..fb472b3096 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftAttrFromDTO.java +++ b/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; + /** * 封面图片地址 */ diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java index 09c6818ac2..717930c62e 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java +++ b/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; + /** * 文章标题 */ diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftListResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftListResultDTO.java index e3f62d12d5..f3c5e77a86 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftListResultDTO.java +++ b/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; /** * 文章标题 */ diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleDetailResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleDetailResultDTO.java index 5ca995d10e..9e30604875 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleDetailResultDTO.java +++ b/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; /** * 标题 */ diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/OfflineListResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/OfflineListResultDTO.java index e277f6cd7a..c7e86d113f 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/OfflineListResultDTO.java +++ b/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; /** * 文章标题 */ diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java index 6cf5a28000..39e70e953e 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java +++ b/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> draftList(@LoginUser TokenDto tokenDto, @RequestBody DraftListFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); return new Result>().ok(draftService.draftList(tokenDto, formDTO).getList()); diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java index 14e3054801..c8146140d2 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java +++ b/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 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 publishRangeEntityList = buildDraftPublishRange(draftEntity, tokenDto, fromDTO); - - + // 栏目 + draftEntity.setCategory(fromDTO.getCategory()); executeSaveDraftAttr(draftEntity, coverEntity, publishRangeEntityList); return true; } @@ -933,6 +935,7 @@ public class ArticleServiceImpl extends BaseServiceImpl 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" diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml index 8d8e396aac..28b4aa5e0b 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml +++ b/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 From bf48683ca1cb690a6269c3ba3b602a6424fe0fe9 Mon Sep 17 00:00:00 2001 From: wxz Date: Fri, 14 Apr 2023 15:18:24 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E3=80=90=E7=81=B5=E5=B1=B1=E5=A4=A7?= =?UTF-8?q?=E5=B1=8F=E3=80=911.=E5=85=9A=E7=BB=84=E7=BB=87=EF=BC=8C?= =?UTF-8?q?=E5=85=9A=E5=BB=BA=E6=B4=BB=E5=8A=A8=E6=95=B0=E9=87=8F=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2.=20=202.=E5=85=9A=E7=BB=84=E7=BB=87=E6=A0=91=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/enums/PartyOrgTypeEnum.java | 15 ++ .../group/feign/ResiGroupOpenFeignClient.java | 10 ++ .../ResiGroupOpenFeignClientFallback.java | 4 + .../group/controller/ResiGroupController.java | 12 ++ .../modules/group/entity/ResiGroupEntity.java | 3 + .../group/service/ResiGroupService.java | 9 ++ .../service/impl/ResiGroupServiceImpl.java | 20 ++- ...ShanScreenPartyActTypeAndQtyResultDTO.java | 15 ++ ...ngShanScreenPartyOrgCategoryResultDTO.java | 17 +++ .../LingShanScreenPartyOrgTreeResultDTO.java | 60 ++++++++ .../modules/partyOrg/dao/IcPartyActDao.java | 10 ++ .../modules/partyOrg/dao/IcPartyOrgDao.java | 22 +++ .../controller/LingShanScreenController.java | 65 +++++++++ .../service/LingShanScreenService.java | 36 +++++ .../impl/LingShanScreenServiceImpl.java | 130 ++++++++++++++++++ .../impl/PartymemberBaseInfoServiceImpl.java | 2 - .../mapper/partyOrg/IcPartyActDao.xml | 14 ++ .../mapper/partyOrg/IcPartyOrgDao.xml | 44 ++++++ 18 files changed, 482 insertions(+), 6 deletions(-) create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/LingShanScreenPartyActTypeAndQtyResultDTO.java create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/LingShanScreenPartyOrgCategoryResultDTO.java create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/LingShanScreenPartyOrgTreeResultDTO.java create mode 100644 epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/LingShanScreenController.java create mode 100644 epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/LingShanScreenService.java create mode 100644 epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/LingShanScreenServiceImpl.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/PartyOrgTypeEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/PartyOrgTypeEnum.java index a0d1520e43..a245051765 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/PartyOrgTypeEnum.java +++ b/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; + } } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java index 2adf4c9ddc..052009b266 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java +++ b/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> 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 getPartyGroupQuantityByAgencyId(@PathVariable("agencyId") String agencyId); } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java index e3c6b08c47..1a7abe3f8f 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java +++ b/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 getPartyGroupQuantityByAgencyId(String agencyId) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "getPartyGroupQuantityByAgencyId", agencyId); + } } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java index 94da912a7b..14317334be 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java +++ b/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>().ok(resiGroupService.partyGroupList(partyOrgId)); } + /** + * @description: 使用行政组织,查询党小组数量 + * @param agencyId: 行政组织单位id + * @return + * @author: WangXianZhang + * @date: 2023/4/14 12:33 PM + */ + @GetMapping("partyGroupQuantity/byAgencyId/{agencyId}") + Result getPartyGroupQuantityByAgencyId(@PathVariable("agencyId") String agencyId) { + return new Result().ok(resiGroupService.getPartyGroupQuantityByAgencyId(agencyId)); + } + } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupEntity.java index cc35c91b5b..8f19b14076 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupEntity.java +++ b/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; } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java index e03178d06b..a4a264a23d 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java +++ b/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 { Map> getBranchGroupList(String customerId); List partyGroupList(String partyOrgId); + + /** + * @description: 使用行政组织,查询党小组列表 + * @param agencyId: + * @return + * @author: WangXianZhang + * @date: 2023/4/14 12:34 PM + */ + Integer getPartyGroupQuantityByAgencyId(String agencyId); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java index 8c2d43f75f..08435a803c 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java +++ b/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 query = new LambdaQueryWrapper<>(); + query.eq(ResiGroupEntity::getCustomerId, EpmetRequestHolder.getLoginUserCustomerId()); + query.eq(ResiGroupEntity::getPids, PidUtils.convertPid2OrgIdPath(agencyId, agencyInfo.getPids())); + return baseDao.selectCount(query); + } } diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/LingShanScreenPartyActTypeAndQtyResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/LingShanScreenPartyActTypeAndQtyResultDTO.java new file mode 100644 index 0000000000..10387d8143 --- /dev/null +++ b/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; + +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/LingShanScreenPartyOrgCategoryResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/LingShanScreenPartyOrgCategoryResultDTO.java new file mode 100644 index 0000000000..92e58400e5 --- /dev/null +++ b/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; + +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/LingShanScreenPartyOrgTreeResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/LingShanScreenPartyOrgTreeResultDTO.java new file mode 100644 index 0000000000..3b8469f066 --- /dev/null +++ b/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 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 children = new ArrayList<>(); + + /** + * 党员列表 + */ + private List 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; + } + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyActDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyActDao.java index d3bdd9d957..6d852616a1 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyActDao.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyActDao.java @@ -11,6 +11,7 @@ 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.LingShanScreenPartyActTypeAndQtyResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -52,4 +53,13 @@ public interface IcPartyActDao extends BaseDao { List selectNoPublishList(String dateId); List getPartActStatis(PartyActStatisFormDTO formDTO); + + /** + * @description: 党建活动类型和数量 + * @return + * @author: WangXianZhang + * @date: 2023/4/14 12:12 PM + */ + List getPartyActTypeAndQuantity(@Param("customerId") String customerId, + @Param("orgIdPath") String orgIdPath); } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java index 88fe00f0ad..91b8f5500d 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java +++ b/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 { * @date 2022/9/7 15:04 */ void editPrincipal(EditPrincipalFormDTO formDTO); + + /** + * @description: 灵山大屏,党建引领,党组织和数量 + * @param agencyId: + * @param agencyOrgIdPath: + * @return java.util.List + * @author: WangXianZhang + * @date: 2023/4/14 11:15 AM + */ + List listPartyOrgCategoryAndQuantity(@Param("customerId") String customerId, + @Param("agencyId") String agencyId, + @Param("agencyOrgIdPath") String agencyOrgIdPath); + + List getPartyOrgsLteDangwei(@Param("customerId") String customerId, + @Param("agencyId") String agencyId, + @Param("orgIdpath") String orgIdpath); + + List getPartyOrgsOfBranch(@Param("customerId") String customerId, + @Param("agencyId") String agencyId, + @Param("orgIdpath") String orgIdpath); } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/LingShanScreenController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/LingShanScreenController.java new file mode 100644 index 0000000000..49a43329ca --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/LingShanScreenController.java @@ -0,0 +1,65 @@ +package com.epmet.modules.partymember.controller; + +import com.epmet.commons.tools.enums.PartyOrgTypeEnum; +import com.epmet.commons.tools.utils.Result; +import com.epmet.modules.partymember.service.LingShanScreenService; +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.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> listPartyOrgCategoryAndQuantity(@RequestParam("agencyId") String agencyId) { + List l = lingShanScreenService.listPartyOrgCategoryAndQuantity(agencyId); + return new Result().ok(l); + } + + /** + * @description: 党建活动类型和数量 + * @param agencyId: 组织id + * @return com.epmet.commons.tools.utils.Result> + * @author: WangXianZhang + * @date: 2023/4/14 12:03 PM + */ + @GetMapping("partyActTypeAndQuantity") + public Result> partyActTypeAndQuantity(@RequestParam("agencyId") String agencyId) { + List 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 getPartyOrgTree(@RequestParam("agencyId") String agencyId) { + LingShanScreenPartyOrgTreeResultDTO l = lingShanScreenService.getPartyOrgTree(agencyId); + return new Result().ok(l); + } + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/LingShanScreenService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/LingShanScreenService.java new file mode 100644 index 0000000000..55bb9dd082 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/LingShanScreenService.java @@ -0,0 +1,36 @@ +package com.epmet.modules.partymember.service; + +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.List; + +public interface LingShanScreenService { + /** + * @description: 党建引领,党组织和数量 + * @param agencyId: 组织id + * @return java.util.List + * @author: WangXianZhang + * @date: 2023/4/14 11:02 AM + */ + List listPartyOrgCategoryAndQuantity(String agencyId); + + /** + * @description: 党建活动类型和数量 + * @param agencyId: 组织id + * @return + * @author: WangXianZhang + * @date: 2023/4/14 12:05 PM + */ + List partyActTypeAndQuantity(String agencyId); + + /** + * @description: + * @param agencyId: + * @return + * @author: WangXianZhang + * @date: 2023/4/14 1:09 PM + */ + LingShanScreenPartyOrgTreeResultDTO getPartyOrgTree(String agencyId); +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/LingShanScreenServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/LingShanScreenServiceImpl.java new file mode 100644 index 0000000000..37e4663790 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/LingShanScreenServiceImpl.java @@ -0,0 +1,130 @@ +package com.epmet.modules.partymember.service.impl; + +import com.epmet.commons.tools.constant.ServiceConstant; +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.bean.AgencyInfoCache; +import com.epmet.commons.tools.utils.EpmetRequestHolder; +import com.epmet.commons.tools.utils.PidUtils; +import com.epmet.modules.partyOrg.dao.IcPartyActDao; +import com.epmet.modules.partyOrg.dao.IcPartyOrgDao; +import com.epmet.modules.partymember.service.LingShanScreenService; +import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; +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.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Iterator; +import java.util.List; +import java.util.Map; +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 ResiGroupOpenFeignClient groupOpenFeignClient; + + @Override + public List listPartyOrgCategoryAndQuantity(String agencyId) { + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(agencyId); + if (agencyInfo == null) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询当前组织信息失败,agencyId:" + agencyId, "查询当前组织信息失败"); + } + + // 1.查询党组织 + List 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 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 l = icPartyOrgDao.getPartyOrgsLteDangwei(EpmetRequestHolder.getLoginUserCustomerId(), agencyId, orgIdpath); + // 再查党支部的。因为党委查询的时候使用pids和党支部的时候使用起来不一样,所以要分开 + List s = icPartyOrgDao.getPartyOrgsOfBranch(EpmetRequestHolder.getLoginUserCustomerId(), agencyId, orgIdpath); + + l.addAll(s); + + // 2.组装树了开始 + Map lMap = l.stream().collect(Collectors.toMap(e -> e.getId(), Function.identity())); + + String parentPartyOrgId = null; + + Integer maxLevel = 100; + // 将组织放入到父组织的children列表中 + for (Iterator 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; + } +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java index 35e890d7b7..3265cff8c0 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java +++ b/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 + + + \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml index 410a074121..0f096e641d 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml @@ -249,4 +249,48 @@ ORDER BY org_pids ASC + + + + + + + + + From e3f89b422bb376a76ff9d083ec00fef51f74e57e Mon Sep 17 00:00:00 2001 From: wxz Date: Fri, 14 Apr 2023 23:58:54 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E3=80=90=E7=81=B5=E5=B1=B1=E5=A4=A7?= =?UTF-8?q?=E5=B1=8F=E3=80=911.=E5=85=9A=E5=91=98=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E3=80=822.=E6=9F=B1=E7=8A=B6=E7=BB=9F=E8=AE=A1=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/partymember/IcPartyMemberDTO.java | 10 ++ ...ngShanScreenPartyActQtyStatsResultDTO.java | 33 ++++ .../modules/partyOrg/dao/IcPartyActDao.java | 17 ++ .../controller/LingShanScreenController.java | 43 +++++ .../partymember/dao/IcPartyMemberDao.java | 2 +- .../entity/IcPartyMemberEntity.java | 3 + .../service/LingShanScreenService.java | 23 +++ .../impl/IcPartyMemberServiceImpl.java | 2 +- .../impl/LingShanScreenServiceImpl.java | 166 +++++++++++++++++- .../mapper/partyOrg/IcPartyActDao.xml | 13 ++ .../mapper/partymember/IcPartyMemberDao.xml | 3 +- 11 files changed, 308 insertions(+), 7 deletions(-) create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/LingShanScreenPartyActQtyStatsResultDTO.java diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyMemberDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyMemberDTO.java index d242b1b526..20e109d604 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyMemberDTO.java +++ b/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; + } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/LingShanScreenPartyActQtyStatsResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/LingShanScreenPartyActQtyStatsResultDTO.java new file mode 100644 index 0000000000..5b84eee8c6 --- /dev/null +++ b/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 data; + + @Data + public static class StatsData { + @JsonIgnore + private String orgId; + private String name; + @JsonIgnore + private String actType; + private Integer value; + } +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyActDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyActDao.java index 6d852616a1..4d6fa73c2c 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyActDao.java +++ b/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,10 +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; /** @@ -62,4 +65,18 @@ public interface IcPartyActDao extends BaseDao { */ List 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 actQtyOfPartyOrgStats(@Param("currentPartyOrgId") String currentPartyOrgId, + @Param("holdTimeStart") Date holdTimeStart, + @Param("holdTimeEnd") Date holdTimeEnd); } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/LingShanScreenController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/LingShanScreenController.java index 49a43329ca..4196d68859 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/LingShanScreenController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/LingShanScreenController.java @@ -1,8 +1,12 @@ 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; @@ -13,6 +17,7 @@ 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 @@ -62,4 +67,42 @@ public class LingShanScreenController { return new Result().ok(l); } + /** + * @description: 党员列表 + * @param partyOrgId: 党组织id + * @return + * @author: WangXianZhang + * @date: 2023/4/14 3:20 PM + */ + @GetMapping("partymemberList") + public Result> partymemberList(@RequestParam("partyOrgId") String partyOrgId) { + List 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> 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 l = lingShanScreenService.actQtyOfPartyOrgStats(agencyId, holdTimeStart, holdTimeEnd); + return new Result>().ok(l); + } + } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberDao.java index 0f18a60ac5..ea835cddec 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberDao.java +++ b/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 { * @Author zhaoqifeng * @Date 2022/5/18 17:01 */ - List selectList(IcPartyMemberFromDTO formDTO); + List selectListZqf(IcPartyMemberFromDTO formDTO); /** * @describe: 查询该组织下的党员信息 diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/IcPartyMemberEntity.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/IcPartyMemberEntity.java index 1133a77bc1..1c55206f3b 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/IcPartyMemberEntity.java +++ b/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; } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/LingShanScreenService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/LingShanScreenService.java index 55bb9dd082..8bff76abff 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/LingShanScreenService.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/LingShanScreenService.java @@ -1,9 +1,12 @@ 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 { @@ -33,4 +36,24 @@ public interface LingShanScreenService { * @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 partymemberListByPartyOrgId(String partyOrgId); + + /** + * @description: agencyId下的党组织活动数统计 + * @param agencyId: + * @param holdTimeStart: + * @param holdTimeEnd: + * @return + * @author: WangXianZhang + * @date: 2023/4/14 7:27 PM + */ + List actQtyOfPartyOrgStats(String agencyId, Date holdTimeStart, Date holdTimeEnd); } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberServiceImpl.java index d9d43ea387..98d737728d 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberServiceImpl.java +++ b/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 list = baseDao.selectList(formDTO); + List list = baseDao.selectListZqf(formDTO); PageInfo pageInfo = new PageInfo<>(list); //获取文化程度字典 diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/LingShanScreenServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/LingShanScreenServiceImpl.java index 37e4663790..876a1471e4 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/LingShanScreenServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/LingShanScreenServiceImpl.java @@ -1,6 +1,8 @@ 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; @@ -9,19 +11,25 @@ import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.utils.EpmetRequestHolder; import com.epmet.commons.tools.utils.PidUtils; +import com.epmet.commons.tools.utils.Result; 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.util.Iterator; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; @@ -34,6 +42,12 @@ public class LingShanScreenServiceImpl implements LingShanScreenService, ResultD @Autowired private IcPartyActDao partyActDao; + @Autowired + private IcPartyMemberDao icPartyMemberDao; + + @Autowired + private IcPartyActTypeDictDao partyActTypeDictDao; + @Autowired private ResiGroupOpenFeignClient groupOpenFeignClient; @@ -101,8 +115,9 @@ public class LingShanScreenServiceImpl implements LingShanScreenService, ResultD // 2.组装树了开始 Map lMap = l.stream().collect(Collectors.toMap(e -> e.getId(), Function.identity())); + // 树根组织的id String parentPartyOrgId = null; - + // 最高的组织级别,用于找到树根。初始值给个100,大一点,不影响 Integer maxLevel = 100; // 将组织放入到父组织的children列表中 for (Iterator it = l.iterator(); it.hasNext();) { @@ -116,6 +131,7 @@ public class LingShanScreenServiceImpl implements LingShanScreenService, ResultD if (pOrg != null) { pOrg.getChildren().add(e); + // 修剪枝叶 it.remove(); } } @@ -127,4 +143,146 @@ public class LingShanScreenServiceImpl implements LingShanScreenService, ResultD r.setList(parentOrg.getChildren()); return r; } + + @Override + public List partymemberListByPartyOrgId(String partyOrgId) { + IcPartyOrgEntity partyOrg = icPartyOrgDao.selectById(partyOrgId); + LambdaQueryWrapper 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 l = icPartyMemberDao.selectList(query); + + // 党员列表转化为需要的dto返回 + return l.stream().map(e -> { + // 查询支部 + IcPartyOrgEntity branch = icPartyOrgDao.selectById(e.getSszb()); + + LingShanScreenPartyOrgTreeResultDTO.Partymember t = new LingShanScreenPartyOrgTreeResultDTO.Partymember(); + t.setName(e.getName()); + t.setAge(e.getAgencyId()); + 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 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 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 l = partyActDao.actQtyOfPartyOrgStats(currentPartyOrg.getId(), holdTimeStart, holdTimeEnd); + + // 将结果遍历,分成2个纬度,分别建立地址引用 + // Map> + Map> orgDimMap = new HashMap<>(); + HashMap orgIdAndName = new HashMap<>(); + + l.forEach(e -> { + orgIdAndName.put(e.getOrgId(), e.getName()); + String actType = e.getActType(); + if (StringUtils.isNotBlank(actType)) { + // 不为空,说明该类型有活动数据 + Map m = orgDimMap.get(actType); + if (m == null) { + m = new HashMap<>(); + orgDimMap.put(actType, m); + } + m.put(e.getOrgId(), e); + } + }); + + // 所有的活动类型,并且建立字典,供后续使用 + LambdaQueryWrapper actTypeQuery = new LambdaQueryWrapper<>(); + actTypeQuery.eq(IcPartyActTypeDictEntity::getCustomerId, EpmetRequestHolder.getLoginUserCustomerId()); + List actTypes = partyActTypeDictDao.selectList(actTypeQuery); + + Map actTypeKeyAndName = actTypes.stream().collect(Collectors.toMap(IcPartyActTypeDictEntity::getTypeKey, IcPartyActTypeDictEntity::getTypeName)); + + // 二维遍历,外层活动类型,内层组织id。确保两个维度的坐标都是全的(哪怕value=0) + for (IcPartyActTypeDictEntity actType : actTypes) { + // 补全外层活动类型 + Map orgIdAndStats = orgDimMap.get(actType.getTypeKey()); + if (orgIdAndStats == null) { + orgIdAndStats = new HashMap<>(); + orgDimMap.put(actType.getTypeKey(), orgIdAndStats); + } + + // 为活动类型补全组织列表(没有活动的组织赋值0) + for (Map.Entry 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 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; + } } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyActDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyActDao.xml index 6520ed005f..0fe90e0949 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyActDao.xml +++ b/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, @@ -282,4 +283,16 @@ group by t.TYPE_KEY + + + \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberDao.xml index a9d4f8c583..b33c53a9d0 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberDao.xml @@ -35,8 +35,9 @@ + - SELECT * FROM ( From 5e1ea951da44f132c2b1212a6af5d47621426424 Mon Sep 17 00:00:00 2001 From: wxz Date: Mon, 17 Apr 2023 10:04:10 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E3=80=90=E7=81=B5=E5=B1=B1=E5=A4=A7?= =?UTF-8?q?=E5=B1=8F=E3=80=91fix=201.=E5=85=9A=E5=91=98=E5=88=97=E8=A1=A8-?= =?UTF-8?q?=E5=B9=B4=E9=BE=84=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/LingShanScreenServiceImpl.java | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/LingShanScreenServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/LingShanScreenServiceImpl.java index 876a1471e4..92af453b13 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/LingShanScreenServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/LingShanScreenServiceImpl.java @@ -8,10 +8,14 @@ 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; @@ -29,6 +33,7 @@ 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; @@ -51,6 +56,9 @@ public class LingShanScreenServiceImpl implements LingShanScreenService, ResultD @Autowired private ResiGroupOpenFeignClient groupOpenFeignClient; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + @Override public List listPartyOrgCategoryAndQuantity(String agencyId) { AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(agencyId); @@ -169,10 +177,22 @@ public class LingShanScreenServiceImpl implements LingShanScreenService, ResultD 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()); - t.setAge(e.getAgencyId()); Integer gender = e.getGender(); t.setGender(gender != null ? GenderEnum.getName(gender.toString()) : "未知"); t.setOrgname(branch != null ? branch.getPartyOrgName() : null); From 560ae03b31dcf62511aad2b86a261a84228b5530 Mon Sep 17 00:00:00 2001 From: wxz Date: Mon, 17 Apr 2023 14:47:38 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E3=80=90=E7=81=B5=E5=B1=B1=E5=A4=A7?= =?UTF-8?q?=E5=B1=8F=E3=80=911.=E6=96=B0=E5=A2=9E=EF=BC=9A=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E7=BB=84=E7=BB=87id=E6=9F=A5=E8=AF=A2=E5=85=9A?= =?UTF-8?q?=E5=91=98=E6=95=B0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/LingShanScreenController.java | 12 ++++++++++++ .../service/LingShanScreenService.java | 9 +++++++++ .../service/impl/LingShanScreenServiceImpl.java | 15 +++++++++++++++ 3 files changed, 36 insertions(+) diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/LingShanScreenController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/LingShanScreenController.java index 4196d68859..71e0e3ae75 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/LingShanScreenController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/LingShanScreenController.java @@ -105,4 +105,16 @@ public class LingShanScreenController { return new Result>().ok(l); } + /** + * @description: 大屏地图-党员数 + * @param agencyId: + * @return + * @author: WangXianZhang + * @date: 2023/4/17 1:54 PM + */ + @GetMapping("partymemberQty") + public Result getPartymemberQtyOfOrg(@RequestParam("agencyId") String agencyId) { + return new Result().ok(lingShanScreenService.getPartymemberQtyOfOrg(agencyId)); + } + } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/LingShanScreenService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/LingShanScreenService.java index 8bff76abff..265467a062 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/LingShanScreenService.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/LingShanScreenService.java @@ -56,4 +56,13 @@ public interface LingShanScreenService { * @date: 2023/4/14 7:27 PM */ List actQtyOfPartyOrgStats(String agencyId, Date holdTimeStart, Date holdTimeEnd); + + /** + * @description: 大屏地图-党员数 + * @param agencyId: + * @return + * @author: WangXianZhang + * @date: 2023/4/17 1:55 PM + */ + Integer getPartymemberQtyOfOrg(String agencyId); } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/LingShanScreenServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/LingShanScreenServiceImpl.java index 92af453b13..74332828cd 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/LingShanScreenServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/LingShanScreenServiceImpl.java @@ -305,4 +305,19 @@ public class LingShanScreenServiceImpl implements LingShanScreenService, ResultD 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 query = new LambdaQueryWrapper<>(); + query.likeRight(IcPartyMemberEntity::getAgencyPids, PidUtils.convertPid2OrgIdPath(agencyId, agencyInfo.getPids())) + .or() + .eq(IcPartyMemberEntity::getAgencyId, agencyId); + return icPartyMemberDao.selectCount(query); + } } From e1919a76930b8fad94b90ba6aad9ce1951cb2c7c Mon Sep 17 00:00:00 2001 From: luyan Date: Mon, 17 Apr 2023 16:33:51 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E8=85=BE=E8=AE=AF=E5=91=BC=E5=8F=AB?= =?UTF-8?q?=E4=B8=AD=E5=BF=83=E8=8E=B7=E5=8F=96sdkUrl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/utils/net/TCCCClientUtils.java | 49 +++++++++++++++++++ .../controller/tccc/TCCCAuthController.java | 24 +++++++++ 2 files changed, 73 insertions(+) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/net/TCCCClientUtils.java create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/tccc/TCCCAuthController.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/net/TCCCClientUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/net/TCCCClientUtils.java new file mode 100644 index 0000000000..34647de7ec --- /dev/null +++ b/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(); + } + } +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/tccc/TCCCAuthController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/tccc/TCCCAuthController.java new file mode 100644 index 0000000000..18c2baba6e --- /dev/null +++ b/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(); + } + } +} From 51c566fdd2811a8dcb42c41a48bd26d4fb10aab6 Mon Sep 17 00:00:00 2001 From: luyan Date: Mon, 17 Apr 2023 16:53:50 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E8=85=BE=E8=AE=AF=E5=91=BC=E5=8F=AB?= =?UTF-8?q?=E4=B8=AD=E5=BF=83=E8=8E=B7=E5=8F=96sdk?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-commons/epmet-commons-tools/pom.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/epmet-commons/epmet-commons-tools/pom.xml b/epmet-commons/epmet-commons-tools/pom.xml index b0f7737940..4cd073f977 100644 --- a/epmet-commons/epmet-commons-tools/pom.xml +++ b/epmet-commons/epmet-commons-tools/pom.xml @@ -197,6 +197,11 @@ + + com.tencentcloudapi + tencentcloud-sdk-java + 3.1.322 +