diff --git a/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java b/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java index dbf4156922..3dadb32519 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java @@ -198,6 +198,7 @@ public class ThirdLoginController { * * @param formDTO * @return + * 目前烟台用的这个!!!!!! */ @PostMapping("resilogin-internalding") public Result resiLoginInternalDing(@RequestBody DingAppLoginMdFormDTO formDTO) { diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java index 50494598ac..87b6eec666 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java @@ -4,6 +4,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.distributedlock.DistributedLock; import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.redis.RedisKeys; import lombok.extern.slf4j.Slf4j; @@ -57,7 +58,8 @@ public class NoRepeatSubmitAop { //因为getLock如果获取失败抛异常 所以不做锁状态的判断 } } catch (Exception e) { - log.warn("noRepeatSubmit key:{},msg:{}", key, e.getMessage()); + String error = ExceptionUtils.getErrorStackTrace(e); + log.warn("noRepeatSubmit key:{},msg:{}", key, error); //"未获取到锁,重复提交了 throw new RenException(EpmetErrorCode.REPEAT_SUBMIT.getCode()); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/pom.xml b/epmet-module/data-aggregator/data-aggregator-server/pom.xml index 8be76c9cff..bdd3fcda4f 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/pom.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/pom.xml @@ -245,11 +245,11 @@ epmet_evaluation_index_user EpmEt-db-UsEr - + - - root - root + + root + root @@ -390,12 +390,6 @@ epmet_evaluation_index_user EpmEt-db-UsEr - - - - root - root - @@ -534,12 +528,6 @@ epmet elink@833066 - - - - epmet - elink@833066 - @@ -679,12 +667,6 @@ epmet_evaluation_index_user EpmEt-db-UsEr - - - - epmet_cloud_viewer - EpmEtclOUdvIEwEr@w - diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml index b9a5485ae3..7f041b60f0 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml @@ -174,11 +174,6 @@ dynamic: url: @datasource.druid.partymember.url@ username: @datasource.druid.partymember.username@ password: @datasource.druid.partymember.password@ - evaluationIndexRead: - driver-class-name: com.mysql.cj.jdbc.Driver - url: @datasource.druid.evaluationIndex1.url@ - username: @datasource.druid.evaluationIndex1.username@ - password: @datasource.druid.evaluationIndex1.password@ feign: hystrix: enabled: true diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPublicServiceOrgDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPublicServiceOrgDTO.java new file mode 100644 index 0000000000..255d395e0a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPublicServiceOrgDTO.java @@ -0,0 +1,110 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + + +/** + * 公共服务组织管理(烟台需求) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-03 + */ +@Data +public class IcPublicServiceOrgDTO implements Serializable { + + private static final long serialVersionUID = 1L; + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * AGENCY_ID的pids + */ + private String pids; + + /** + * 名称 + */ + private String name; + + /** + * 1:实有单位;2:社会服务组织3:志愿团队 + */ + private String type; + + /** + * 联系人 + */ + private String contact; + + /** + * 联系电话 + */ + private String contactMobile; + + /** + * 地址 + */ + private String address; + + /** + * 中心位置经度 + */ + private String longitude; + + /** + * 中心位置纬度 + */ + private String latitude; + + /** + * 备注 + */ + private String remark; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + private List serviceMatterList; +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPublicServiceOrgServiceMatterDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPublicServiceOrgServiceMatterDTO.java new file mode 100644 index 0000000000..64a993efa9 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPublicServiceOrgServiceMatterDTO.java @@ -0,0 +1,90 @@ +package com.epmet.dto; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 公共服务组织服务事项(烟台需求) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-03 + */ +@Data +public class IcPublicServiceOrgServiceMatterDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @JsonIgnore + private String id; + + /** + * 客户id + */ + @JsonIgnore + private String customerId; + + /** + * ic_public_service_org.ID + */ + @JsonIgnore + private String orgId; + + /** + * ic_service_item_dict.ID + */ + private String categoryId; + + /** + * 服务事项编码ic_service_item_dict.CATEGORY_CODE + */ + private String categoryCode; + + /** + * 删除标识 0未删除、1已删除 + */ + @JsonIgnore + private String delFlag; + + /** + * 乐观锁 + */ + @JsonIgnore + private Integer revision; + + /** + * 创建人 + */ + @JsonIgnore + private String createdBy; + + /** + * 创建时间 + */ + @JsonIgnore + private Date createdTime; + + /** + * 更新人 + */ + @JsonIgnore + private String updatedBy; + + /** + * 更新时间 + */ + @JsonIgnore + private Date updatedTime; + + /** + * 详情页面显示 + */ + private String categoryName; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcPublicServiceOrgFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcPublicServiceOrgFormDTO.java new file mode 100644 index 0000000000..f5aa42b008 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcPublicServiceOrgFormDTO.java @@ -0,0 +1,133 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.epmet.dto.IcPublicServiceOrgServiceMatterDTO; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.util.Date; +import java.util.List; + +/** + * @Description + * @Author yzm + * @Date 2023/2/3 15:04 + */ +@Data +public class IcPublicServiceOrgFormDTO { + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + public interface UpdateUserInternalGroup { + } + + public interface UpdateUserShowGroup extends CustomerClientShowGroup { + } + + /** + * 主键 + */ + @NotBlank(message = "id为空", groups = UpdateUserInternalGroup.class) + private String id; + + /** + * 客户id + */ + @NotBlank(message = "customerId不能为空", groups = {AddUserInternalGroup.class, UpdateUserInternalGroup.class}) + private String customerId; + + /** + * 组织ID + */ + @NotBlank(message = "agencyId不能为空",groups =UpdateUserInternalGroup.class ) + private String agencyId; + + /** + * AGENCY_ID的pids + */ + private String pids; + + /** + * 名称 + */ + @Length(max = 100, groups = AddUserShowGroup.class, message = "最多输入100字") + @NotBlank(message = "名称不能为空", groups = {UpdateUserShowGroup.class, AddUserShowGroup.class}) + private String name; + + /** + * 1:实有单位;2:社会服务组织3:志愿团队 + */ + @NotBlank(message = "类别不能为空", groups = {UpdateUserShowGroup.class, AddUserShowGroup.class}) + private String type; + + /** + * 联系人 + */ + @NotBlank(message = "联系人不能为空", groups = {UpdateUserShowGroup.class, AddUserShowGroup.class}) + private String contact; + + /** + * 联系电话 + */ + @NotBlank(message = "联系电话不能为空", groups = {UpdateUserShowGroup.class, AddUserShowGroup.class}) + private String contactMobile; + + /** + * 地址 + */ + @NotBlank(message = "地址不能为空", groups = {UpdateUserShowGroup.class, AddUserShowGroup.class}) + private String address; + + /** + * 中心位置经度 + */ + private String longitude; + + /** + * 中心位置纬度 + */ + private String latitude; + + /** + * 备注 + */ + @Length(max = 500,message = "最多输入500字",groups ={UpdateUserShowGroup.class,AddUserShowGroup.class} ) + private String remark; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + private List serviceMatterList; +} + diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcPublicServiceOrgPageFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcPublicServiceOrgPageFormDTO.java new file mode 100644 index 0000000000..d056c4af1d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcPublicServiceOrgPageFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import java.util.List; + +/** + * @Description + * @Author yzm + * @Date 2023/2/3 16:02 + */ +@Data +public class IcPublicServiceOrgPageFormDTO extends PageFormDTO { + private String customerId; + private String agencyId; + private String name; + private List categoryIds; + private String type; + private String contact; + private String contactMobile; + + /** + * 工作端当前登录人员 + */ + private String currentStaffId; +} + diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcPublicServiceOrgDetailResDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcPublicServiceOrgDetailResDTO.java new file mode 100644 index 0000000000..a596953035 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcPublicServiceOrgDetailResDTO.java @@ -0,0 +1,87 @@ +package com.epmet.dto.result; + +import com.epmet.dto.IcPublicServiceOrgServiceMatterDTO; +import lombok.Data; + +import java.util.List; + +/** + * @Description + * @Author yzm + * @Date 2023/2/3 15:52 + */ +@Data +public class IcPublicServiceOrgDetailResDTO { + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + + private String agencyName; + + /** + * AGENCY_ID的pids + */ + private String pids; + + /** + * 名称 + */ + private String name; + + /** + * 1:实有单位;2:社会服务组织3:志愿团队 + */ + private String type; + + private String typeName; + + /** + * 联系人 + */ + private String contact; + + /** + * 联系电话 + */ + private String contactMobile; + + /** + * 地址 + */ + private String address; + + /** + * 中心位置经度 + */ + private String longitude; + + /** + * 中心位置纬度 + */ + private String latitude; + + /** + * 备注 + */ + private String remark; + /** + * 服务事项名称 + * 多个,按照英文逗号隔开 + */ + private String serviceMatterName; + + private List serviceMatterList; +} + diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ServiceItemResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ServiceItemResultDTO.java index 3408b5f724..7a745fa207 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ServiceItemResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ServiceItemResultDTO.java @@ -13,6 +13,10 @@ import java.io.Serializable; public class ServiceItemResultDTO implements Serializable { private static final long serialVersionUID = -590440160577071133L; private String categoryId; + /** + * 分类编码 + */ + private String categoryCode; private String categoryName; private Integer awardPoint; private Boolean usableFlag; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPublicServiceOrgController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPublicServiceOrgController.java new file mode 100644 index 0000000000..ddfd674cfd --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPublicServiceOrgController.java @@ -0,0 +1,101 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.IcPublicServiceOrgFormDTO; +import com.epmet.dto.form.IcPublicServiceOrgPageFormDTO; +import com.epmet.dto.result.IcPublicServiceOrgDetailResDTO; +import com.epmet.service.IcPublicServiceOrgService; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + + +/** + * 公共服务组织管理(烟台需求) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-03 + */ +@RestController +@RequestMapping("icPublicServiceOrg") +public class IcPublicServiceOrgController { + + @Autowired + private IcPublicServiceOrgService icPublicServiceOrgService; + + /** + * + * @param tokenDto + * @param formDTO + * @return + */ + @RequestMapping("page") + public Result> page(@LoginUser TokenDto tokenDto, @RequestBody IcPublicServiceOrgPageFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + //工作端调用的话,赋值当前登录用户id + if(AppClientConstant.APP_GOV.equals(tokenDto.getApp())){ + formDTO.setCurrentStaffId(tokenDto.getUserId()); + } + PageData page = icPublicServiceOrgService.page(formDTO); + return new Result>().ok(page); + } + + @PostMapping("detail/{id}") + public Result get(@PathVariable("id") String id){ + IcPublicServiceOrgDetailResDTO data = icPublicServiceOrgService.get(id); + return new Result().ok(data); + } + + /** + * 新增;名称组织下唯一 + * @param formDTO + * @return + */ + @NoRepeatSubmit + @PostMapping("save") + public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcPublicServiceOrgFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setCreatedBy(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, IcPublicServiceOrgFormDTO.AddUserShowGroup.class, IcPublicServiceOrgFormDTO.AddUserInternalGroup.class); + icPublicServiceOrgService.save(formDTO); + return new Result(); + } + + /** + * + * @param tokenDto + * @param formDTO + * @return + */ + @NoRepeatSubmit + @PostMapping("update") + public Result update(@LoginUser TokenDto tokenDto,@RequestBody IcPublicServiceOrgFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setCreatedBy(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, IcPublicServiceOrgFormDTO.UpdateUserShowGroup.class, IcPublicServiceOrgFormDTO.UpdateUserInternalGroup.class); + icPublicServiceOrgService.update(formDTO); + return new Result(); + } + + /** + * 同时删除服务事项表 + * @param ids + * @return + */ + @PostMapping("delete") + public Result delete(@RequestBody List ids){ + if(CollectionUtils.isNotEmpty(ids)){ + icPublicServiceOrgService.delete(ids); + } + return new Result(); + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java index 7608069b76..b2b12c40e8 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java @@ -87,6 +87,18 @@ public class IcServiceItemDictController { return new Result>().ok(icServiceItemDictService.queryDictListForSelect(formDTO)); } + /** + * 烟台的公共服务组织:服务事项列表 + * + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("dict-options") + public Result> queryDictOption(@LoginUser TokenDto tokenDto, @RequestBody ServiceItemSelectFormDTO formDTO) { + return new Result>().ok(icServiceItemDictService.queryDictOption(formDTO.getType(), tokenDto.getCustomerId())); + } + /** * 客户初始化数据 * @Param customerId diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPublicServiceOrgDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPublicServiceOrgDao.java new file mode 100644 index 0000000000..227091f5cc --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPublicServiceOrgDao.java @@ -0,0 +1,21 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.IcPublicServiceOrgPageFormDTO; +import com.epmet.dto.result.IcPublicServiceOrgDetailResDTO; +import com.epmet.entity.IcPublicServiceOrgEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 公共服务组织管理(烟台需求) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-03 + */ +@Mapper +public interface IcPublicServiceOrgDao extends BaseDao { + + List pageList(IcPublicServiceOrgPageFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPublicServiceOrgServiceMatterDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPublicServiceOrgServiceMatterDao.java new file mode 100644 index 0000000000..3994195445 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPublicServiceOrgServiceMatterDao.java @@ -0,0 +1,20 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.IcPublicServiceOrgServiceMatterDTO; +import com.epmet.entity.IcPublicServiceOrgServiceMatterEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 公共服务组织服务事项(烟台需求) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-03 + */ +@Mapper +public interface IcPublicServiceOrgServiceMatterDao extends BaseDao { + + List selectServiceMatter(String orgId); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPublicServiceOrgEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPublicServiceOrgEntity.java new file mode 100644 index 0000000000..4c044abd5b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPublicServiceOrgEntity.java @@ -0,0 +1,76 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 公共服务组织管理(烟台需求) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-03 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_public_service_org") +public class IcPublicServiceOrgEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * AGENCY_ID的pids + */ + private String pids; + + /** + * 名称 + */ + private String name; + + /** + * 1:实有单位;2:社会服务组织3:志愿团队 + */ + private String type; + + /** + * 联系人 + */ + private String contact; + + /** + * 联系电话 + */ + private String contactMobile; + + /** + * 地址 + */ + private String address; + + /** + * 中心位置经度 + */ + private String longitude; + + /** + * 中心位置纬度 + */ + private String latitude; + + /** + * 备注 + */ + private String remark; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPublicServiceOrgServiceMatterEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPublicServiceOrgServiceMatterEntity.java new file mode 100644 index 0000000000..98dd6ebc71 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPublicServiceOrgServiceMatterEntity.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-02-03 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_public_service_org_service_matter") +public class IcPublicServiceOrgServiceMatterEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * ic_public_service_org.ID + */ + private String orgId; + + /** + * ic_service_item_dict.ID + */ + private String categoryId; + + /** + * 服务事项编码ic_service_item_dict.CATEGORY_CODE + */ + private String categoryCode; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPublicServiceOrgService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPublicServiceOrgService.java new file mode 100644 index 0000000000..79bf76d182 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPublicServiceOrgService.java @@ -0,0 +1,34 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.form.IcPublicServiceOrgFormDTO; +import com.epmet.dto.form.IcPublicServiceOrgPageFormDTO; +import com.epmet.dto.result.IcPublicServiceOrgDetailResDTO; +import com.epmet.entity.IcPublicServiceOrgEntity; + +import java.util.List; + +/** + * 公共服务组织管理(烟台需求) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-03 + */ +public interface IcPublicServiceOrgService extends BaseService { + + /** + * 公共服务组织 + * @param dto + * @return + */ + String save(IcPublicServiceOrgFormDTO dto); + + String update(IcPublicServiceOrgFormDTO formDTO); + + void delete(List orgIds); + + IcPublicServiceOrgDetailResDTO get(String id); + + PageData page(IcPublicServiceOrgPageFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java index 6ed62cbdf2..92a6dc4ef6 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java @@ -81,4 +81,6 @@ public interface IcServiceItemDictService extends BaseService queryDictOption(String type, String customerId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPublicServiceOrgServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPublicServiceOrgServiceImpl.java new file mode 100644 index 0000000000..7dd3dbc851 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPublicServiceOrgServiceImpl.java @@ -0,0 +1,171 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcPublicServiceOrgDao; +import com.epmet.dao.IcPublicServiceOrgServiceMatterDao; +import com.epmet.dto.form.IcPublicServiceOrgFormDTO; +import com.epmet.dto.form.IcPublicServiceOrgPageFormDTO; +import com.epmet.dto.result.IcPublicServiceOrgDetailResDTO; +import com.epmet.entity.IcPublicServiceOrgEntity; +import com.epmet.entity.IcPublicServiceOrgServiceMatterEntity; +import com.epmet.service.IcPublicServiceOrgService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * 公共服务组织管理(烟台需求) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-03 + */ +@Service +public class IcPublicServiceOrgServiceImpl extends BaseServiceImpl implements IcPublicServiceOrgService { + @Autowired + private IcPublicServiceOrgServiceMatterDao icPublicServiceOrgServiceMatterDao; + + + @Transactional(rollbackFor = EpmetException.class) + @Override + public String save(IcPublicServiceOrgFormDTO formDto) { + CustomerStaffInfoCacheResult staffInfo= CustomerStaffRedis.getStaffInfo(formDto.getCustomerId(),formDto.getCreatedBy()); + if(null==staffInfo|| StringUtils.isBlank(staffInfo.getAgencyId())){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode()); + } + checkUnqiueName(formDto.getName(),staffInfo.getAgencyId(),null); + formDto.setAgencyId(staffInfo.getAgencyId()); + formDto.setPids(staffInfo.getAgencyPIds()); + IcPublicServiceOrgEntity entity=ConvertUtils.sourceToTarget(formDto,IcPublicServiceOrgEntity.class); + baseDao.insert(entity); + if(CollectionUtils.isNotEmpty(formDto.getServiceMatterList())){ + formDto.getServiceMatterList().forEach(dto->{ + IcPublicServiceOrgServiceMatterEntity serviceOrgServiceMatterEntity=ConvertUtils.sourceToTarget(dto,IcPublicServiceOrgServiceMatterEntity.class); + serviceOrgServiceMatterEntity.setOrgId(entity.getId()); + serviceOrgServiceMatterEntity.setCustomerId(formDto.getCustomerId()); + icPublicServiceOrgServiceMatterDao.insert(serviceOrgServiceMatterEntity); + }); + } + return entity.getId(); + } + + /** + * + * @param name + * @param agencyId + * @param id + */ + private void checkUnqiueName(String name, String agencyId, String id) { + LambdaQueryWrapper queryWrapper=new LambdaQueryWrapper<>(); + queryWrapper.eq(IcPublicServiceOrgEntity::getName,name) + .eq(IcPublicServiceOrgEntity::getAgencyId,agencyId) + .ne(StringUtils.isNotBlank(id),IcPublicServiceOrgEntity::getId,id); + int count=baseDao.selectCount(queryWrapper); + if(count>0){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"名称已存在","名称已存在"); + } + } + + @Transactional(rollbackFor = EpmetException.class) + @Override + public String update(IcPublicServiceOrgFormDTO formDTO) { + checkUnqiueName(formDTO.getName(),formDTO.getAgencyId(),formDTO.getId()); + IcPublicServiceOrgEntity entity=ConvertUtils.sourceToTarget(formDTO,IcPublicServiceOrgEntity.class); + baseDao.updateById(entity); + //先删除 + LambdaQueryWrapper deleteWrapper=new LambdaQueryWrapper<>(); + deleteWrapper.eq(IcPublicServiceOrgServiceMatterEntity::getOrgId,formDTO.getId()); + icPublicServiceOrgServiceMatterDao.delete(deleteWrapper); + if(CollectionUtils.isNotEmpty(formDTO.getServiceMatterList())){ + formDTO.getServiceMatterList().forEach(dto->{ + IcPublicServiceOrgServiceMatterEntity serviceOrgServiceMatterEntity=ConvertUtils.sourceToTarget(dto,IcPublicServiceOrgServiceMatterEntity.class); + serviceOrgServiceMatterEntity.setOrgId(entity.getId()); + serviceOrgServiceMatterEntity.setCustomerId(formDTO.getCustomerId()); + icPublicServiceOrgServiceMatterDao.insert(serviceOrgServiceMatterEntity); + }); + } + return entity.getId(); + } + + @Transactional(rollbackFor = EpmetException.class) + @Override + public void delete(List orgIds) { + orgIds.forEach(orgId->{ + baseDao.deleteById(orgId); + //先删除 + LambdaQueryWrapper deleteWrapper=new LambdaQueryWrapper<>(); + deleteWrapper.eq(IcPublicServiceOrgServiceMatterEntity::getOrgId,orgId); + icPublicServiceOrgServiceMatterDao.delete(deleteWrapper); + }); + } + + + @Override + public IcPublicServiceOrgDetailResDTO get(String id) { + IcPublicServiceOrgEntity entity = baseDao.selectById(id); + if (null == entity) { + return null; + } + IcPublicServiceOrgDetailResDTO result = ConvertUtils.sourceToTarget(entity, IcPublicServiceOrgDetailResDTO.class); + // 1:实有单位;2:社会服务组织3:志愿团队 + if(NumConstant.ONE_STR.equals(result.getType())){ + result.setTypeName("实有单位"); + }else if(NumConstant.TWO_STR.equals(result.getType())){ + result.setTypeName("社会服务组织"); + }else if(NumConstant.THREE_STR.equals(result.getType())){ + result.setTypeName("志愿团队"); + } + AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(result.getAgencyId()); + if (null != agencyInfoCache) { + result.setAgencyName(agencyInfoCache.getOrganizationName()); + } + result.setServiceMatterList(icPublicServiceOrgServiceMatterDao.selectServiceMatter(id)); + List nameList=result.getServiceMatterList().stream().map(m->m.getCategoryName()).collect(Collectors.toList()); + if(CollectionUtils.isNotEmpty(nameList)){ + result.setServiceMatterName(StringUtils.joinWith(StrConstant.SEMICOLON,nameList.toArray())); + } + return result; + } + + + + @Override + public PageData page(IcPublicServiceOrgPageFormDTO formDTO) { + if (StringUtils.isNotBlank(formDTO.getCurrentStaffId()) && StringUtils.isBlank(formDTO.getAgencyId())) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getCurrentStaffId()); + formDTO.setAgencyId(staffInfo.getAgencyId()); + } + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + List list = baseDao.pageList(formDTO); + PageInfo pageInfo = new PageInfo<>(list); + list.forEach(item -> { + AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(item.getAgencyId()); + item.setAgencyName(null != agencyInfoCache ? agencyInfoCache.getOrganizationName() : StrConstant.EPMETY_STR); + List nameList=item.getServiceMatterList().stream().map(m->m.getCategoryName()).collect(Collectors.toList()); + if(CollectionUtils.isNotEmpty(nameList)){ + item.setServiceMatterName(StringUtils.joinWith(StrConstant.SEMICOLON,nameList.toArray())); + } + }); + return new PageData<>(list, pageInfo.getTotal()); + } + + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java index a34bb83907..1e7b7f0271 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java @@ -205,4 +205,26 @@ public class IcServiceItemDictServiceImpl extends BaseServiceImpl queryDictOption(String type, String customerId) { + List resultList = new ArrayList<>(); + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(IcServiceItemDictEntity::getCustomerId, customerId) + .eq(StringUtils.isNotBlank(type) && "usable".equals(type), IcServiceItemDictEntity::getUsableFlag, true) + .orderByAsc(IcServiceItemDictEntity::getSort); + List list = baseDao.selectList(query); + for (IcServiceItemDictEntity entity : list) { + ServiceItemResultDTO dto = new ServiceItemResultDTO(); + dto.setCategoryName(entity.getCategoryName()); + dto.setCategoryId(entity.getId()); + dto.setCategoryCode(entity.getCategoryCode()); + dto.setUsableFlag(entity.getUsableFlag()); + dto.setAwardPoint(entity.getAwardPoint()); + resultList.add(dto); + } + return resultList; + } + + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.29__public_service_org.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.29__public_service_org.sql new file mode 100644 index 0000000000..25ce6a5fc2 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.29__public_service_org.sql @@ -0,0 +1,38 @@ +CREATE TABLE `ic_public_service_org` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '组织ID', + `PIDS` varchar(255) NOT NULL COMMENT 'AGENCY_ID的pids', + `NAME` varchar(128) NOT NULL COMMENT '名称', + `TYPE` varchar(64) NOT NULL COMMENT '1:实有单位;2:社会服务组织3:志愿团队', + `CONTACT` varchar(32) NOT NULL COMMENT '联系人', + `CONTACT_MOBILE` varchar(32) NOT NULL COMMENT '联系电话', + `ADDRESS` varchar(255) NOT NULL COMMENT '地址', + `LONGITUDE` varchar(32) DEFAULT NULL COMMENT '中心位置经度', + `LATITUDE` varchar(32) DEFAULT NULL COMMENT '中心位置纬度', + `REMARK` varchar(512) DEFAULT NULL COMMENT '备注', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='公共服务组织管理(烟台需求)'; + + + +CREATE TABLE `ic_public_service_org_service_matter` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `ORG_ID` varchar(64) NOT NULL COMMENT 'ic_public_service_org.ID', + `CATEGORY_ID` varchar(64) NOT NULL COMMENT 'ic_service_item_dict.ID', + `CATEGORY_CODE` varchar(255) NOT NULL COMMENT '服务事项编码ic_service_item_dict.CATEGORY_CODE', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='公共服务组织服务事项(烟台需求)'; \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPublicServiceOrgDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPublicServiceOrgDao.xml new file mode 100644 index 0000000000..a877134331 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPublicServiceOrgDao.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPublicServiceOrgServiceMatterDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPublicServiceOrgServiceMatterDao.xml new file mode 100644 index 0000000000..9603aab514 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPublicServiceOrgServiceMatterDao.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/ThirdAppManageDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/ThirdAppManageDTO.java new file mode 100644 index 0000000000..782e21231f --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/ThirdAppManageDTO.java @@ -0,0 +1,112 @@ +package com.epmet.dto; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + + +/** + * 烟台第三方应用管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-03 + */ +@Data +public class ThirdAppManageDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 应用名称 + */ + @NotBlank(message = "应用名称不能为空") + private String name; + + /** + * 应用链接 + */ + @NotBlank(message = "应用链接不能为空") + private String link; + + /** + * 账号 + */ + @NotBlank(message = "测试账号不能为空") + private String account; + + /** + * 密码 + */ + @NotBlank(message = "测试密码不能为空") + private String password; + + /** + * 应用介绍 + */ + private String remark; + + /** + * 第三方公司名 + */ + private String companyName; + + /** + * 联系人 + */ + @NotBlank(message = "联系人不能为空") + private String contacts; + + /** + * 联系电话 + */ + @NotBlank(message = "联系电话不能为空") + private String mobile; + + /** + * 状态【0:未审核;1:审核不通过;2:审核通过;3:已发布】 + */ + private String status; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 删除标识 0:未删除 1:删除 + */ + private Integer delFlag; + + /** + * 创建者 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新者 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/ThirdAppManageFormDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/ThirdAppManageFormDTO.java new file mode 100644 index 0000000000..6b9398b62e --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/ThirdAppManageFormDTO.java @@ -0,0 +1,50 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import java.io.Serializable; + + +/** + * 烟台第三方应用管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-03 + */ +@Data +public class ThirdAppManageFormDTO extends PageFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + + /** + * 应用名称 + */ + private String name; + + /** + * 第三方公司名 + */ + private String companyName; + + /** + * 联系人 + */ + private String contacts; + + /** + * 联系电话 + */ + private String mobile; + + /** + * 状态【0:未审核;1:审核不通过;2:审核通过;3:已发布】 + */ + private String status; +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/ThirdAppManageController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/ThirdAppManageController.java new file mode 100644 index 0000000000..2c5b143236 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/ThirdAppManageController.java @@ -0,0 +1,83 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.ThirdAppManageDTO; +import com.epmet.dto.form.ThirdAppManageFormDTO; +import com.epmet.service.ThirdAppManageService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + + +/** + * 烟台第三方应用管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-03 + */ +@RestController +@RequestMapping("thirdAppManage") +public class ThirdAppManageController { + + @Autowired + private ThirdAppManageService thirdAppManageService; + + @PostMapping("page") + public Result> page(@RequestBody ThirdAppManageFormDTO formDTO){ + PageData page = thirdAppManageService.page(formDTO); + return new Result>().ok(page); + } + + @PostMapping("detail/{id}") + public Result get(@PathVariable("id") String id){ + ThirdAppManageDTO data = thirdAppManageService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody ThirdAppManageDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + thirdAppManageService.save(dto); + return new Result(); + } + + /** + * 审核 + * + * @Param dto + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2023/2/3 14:18 + */ + @NoRepeatSubmit + @PostMapping("audit") + public Result audit(@RequestBody ThirdAppManageDTO dto){ + //效验数据 + thirdAppManageService.audit(dto); + return new Result(); + } + + /** + * 发布 + * + * @Param dto + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2023/2/3 14:18 + */ + @NoRepeatSubmit + @PostMapping("release") + public Result release(@RequestBody ThirdAppManageDTO dto){ + //效验数据 + thirdAppManageService.release(dto); + return new Result(); + } + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/ThirdAppManageDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/ThirdAppManageDao.java new file mode 100644 index 0000000000..e930e21767 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/ThirdAppManageDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ThirdAppManageEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 烟台第三方应用管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-03 + */ +@Mapper +public interface ThirdAppManageDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/ThirdAppManageEntity.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/ThirdAppManageEntity.java new file mode 100644 index 0000000000..a44b474fc4 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/ThirdAppManageEntity.java @@ -0,0 +1,71 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 烟台第三方应用管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-03 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("third_app_manage") +public class ThirdAppManageEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 应用名称 + */ + private String name; + + /** + * 应用链接 + */ + private String link; + + /** + * 账号 + */ + private String account; + + /** + * 密码 + */ + private String password; + + /** + * 应用介绍 + */ + private String remark; + + /** + * 第三方公司名 + */ + private String companyName; + + /** + * 联系人 + */ + private String contacts; + + /** + * 联系电话 + */ + private String mobile; + + /** + * 状态【0:未审核;1:审核不通过;2:审核通过;3:已发布】 + */ + private String status; + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/ThirdAppManageService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/ThirdAppManageService.java new file mode 100644 index 0000000000..fbc7216cb8 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/ThirdAppManageService.java @@ -0,0 +1,66 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ThirdAppManageDTO; +import com.epmet.dto.form.ThirdAppManageFormDTO; +import com.epmet.entity.ThirdAppManageEntity; + +/** + * 烟台第三方应用管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-03 + */ +public interface ThirdAppManageService extends BaseService { + + /** + * 默认分页 + * + * @param formDTO + * @return PageData + * @author generator + * @date 2023-02-03 + */ + PageData page(ThirdAppManageFormDTO formDTO); + + /** + * 单条查询 + * + * @param id + * @return ThirdAppManageDTO + * @author generator + * @date 2023-02-03 + */ + ThirdAppManageDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2023-02-03 + */ + void save(ThirdAppManageDTO dto); + + /** + * 审核 + * + * @Param dto + * @Return + * @Author zhaoqifeng + * @Date 2023/2/3 14:19 + */ + void audit(ThirdAppManageDTO dto); + + /** + * 发布 + * + * @Param dto + * @Return + * @Author zhaoqifeng + * @Date 2023/2/3 14:19 + */ + void release(ThirdAppManageDTO dto); +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/ThirdAppManageServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/ThirdAppManageServiceImpl.java new file mode 100644 index 0000000000..db9affc717 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/ThirdAppManageServiceImpl.java @@ -0,0 +1,112 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.ThirdAppManageDao; +import com.epmet.dto.ThirdAppManageDTO; +import com.epmet.dto.form.ThirdAppManageFormDTO; +import com.epmet.entity.ThirdAppManageEntity; +import com.epmet.service.ThirdAppManageService; +import com.github.pagehelper.PageInfo; +import com.github.pagehelper.page.PageMethod; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * 烟台第三方应用管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-03 + */ +@Service +public class ThirdAppManageServiceImpl extends BaseServiceImpl implements ThirdAppManageService { + + @Override + public PageData page(ThirdAppManageFormDTO formDTO) { + PageMethod.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.like(StringUtils.isNotBlank(formDTO.getName()), ThirdAppManageEntity::getName, formDTO.getName()); + wrapper.like(StringUtils.isNotBlank(formDTO.getCompanyName()), ThirdAppManageEntity::getCompanyName, formDTO.getCompanyName()); + wrapper.like(StringUtils.isNotBlank(formDTO.getContacts()), ThirdAppManageEntity::getContacts, formDTO.getContacts()); + wrapper.like(StringUtils.isNotBlank(formDTO.getMobile()), ThirdAppManageEntity::getMobile, formDTO.getMobile()); + wrapper.eq(StringUtils.isNotBlank(formDTO.getStatus()), ThirdAppManageEntity::getStatus, formDTO.getStatus()); + wrapper.orderByDesc(ThirdAppManageEntity::getCreatedTime); + List list = baseDao.selectList(wrapper); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(ConvertUtils.sourceToTarget(list, ThirdAppManageDTO.class), pageInfo.getTotal()); + } + + @Override + public ThirdAppManageDTO get(String id) { + ThirdAppManageEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ThirdAppManageDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ThirdAppManageDTO dto) { + ThirdAppManageEntity entity = ConvertUtils.sourceToTarget(dto, ThirdAppManageEntity.class); + insert(entity); + } + + /** + * 审核 + * + * @param dto + * @Param dto + * @Return + * @Author zhaoqifeng + * @Date 2023/2/3 14:19 + */ + @Override + public void audit(ThirdAppManageDTO dto) { + ThirdAppManageEntity info = baseDao.selectById(dto.getId()); + if (!NumConstant.ZERO_STR.equals(info.getStatus())) { + String errorMsg = "应用已审核"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); + } + + ThirdAppManageEntity entity = new ThirdAppManageEntity(); + entity.setId(dto.getId()); + entity.setStatus(dto.getStatus()); + baseDao.updateById(entity); + } + + /** + * 发布 + * + * @param dto + * @Param dto + * @Return + * @Author zhaoqifeng + * @Date 2023/2/3 14:19 + */ + @Override + public void release(ThirdAppManageDTO dto) { + ThirdAppManageEntity info = baseDao.selectById(dto.getId()); + if (NumConstant.ZERO_STR.equals(info.getStatus())) { + String errorMsg = "应用未审核,请先审核"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); + } else if (NumConstant.ONE_STR.equals(info.getStatus())) { + String errorMsg = "应用审核不通过,不能发布"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); + } else if (NumConstant.THREE_STR.equals(info.getStatus())) { + String errorMsg = "应用已发布"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); + } + + ThirdAppManageEntity entity = new ThirdAppManageEntity(); + entity.setId(dto.getId()); + entity.setStatus(NumConstant.THREE_STR); + baseDao.updateById(entity); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.10__third_app.sql b/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.10__third_app.sql new file mode 100644 index 0000000000..563fcf3815 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.10__third_app.sql @@ -0,0 +1,20 @@ +CREATE TABLE `third_app_manage` ( + `ID` varchar(64) NOT NULL COMMENT 'id', + `CUSTOMER_ID` varchar(64) DEFAULT NULL COMMENT '客户ID', + `NAME` varchar(64) NOT NULL COMMENT '应用名称', + `LINK` varchar(128) NOT NULL COMMENT '应用链接', + `ACCOUNT` varchar(64) NOT NULL COMMENT '账号', + `PASSWORD` varchar(64) NOT NULL COMMENT '密码', + `REMARK` text COMMENT '应用介绍', + `COMPANY_NAME` varchar(64) DEFAULT '0' COMMENT '第三方公司名', + `CONTACTS` varchar(64) NOT NULL COMMENT '联系人', + `MOBILE` varchar(32) NOT NULL COMMENT '联系电话', + `STATUS` varchar(1) DEFAULT '0' COMMENT '状态【0:未审核;1:审核不通过;2:审核通过;3:已发布】', + `REVISION` int(11) DEFAULT NULL COMMENT '乐观锁', + `DEL_FLAG` tinyint(1) unsigned DEFAULT NULL COMMENT '删除标识 0:未删除 1:删除', + `CREATED_BY` varchar(32) DEFAULT NULL COMMENT '创建者', + `CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新者', + `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='烟台第三方应用管理'; \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/ThirdAppManageDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/ThirdAppManageDao.xml new file mode 100644 index 0000000000..afbc2b77fa --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/ThirdAppManageDao.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueCommentDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueCommentDTO.java new file mode 100644 index 0000000000..45b27c1eba --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueCommentDTO.java @@ -0,0 +1,100 @@ +package com.epmet.dto; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + + +/** + * 议题评论表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-02 + */ +@Data +public class IssueCommentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + /** + * 议题ID + */ + @NotBlank(message = "issueId不能为空",groups = AddUserInternalGroup.class) + private String issueId; + + /** + * 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 评论内容至多200字 + */ + @Length(max = 200,message = "评论内容最多输入200字",groups = AddUserShowGroup.class) + @NotBlank(message = "content不能为空",groups = AddUserInternalGroup.class) + private String content; + + /** + * 评论用户id + */ + private String userId; + + /** + * 姓名 + */ + private String userName; + + /** + * 头像 + */ + private String headPhoto; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + private String commentId; + +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueCommentPageFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueCommentPageFormDTO.java new file mode 100644 index 0000000000..90e7fa79a8 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueCommentPageFormDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * @Description + * @Author yzm + * @Date 2023/2/2 13:45 + */ +@Data +public class IssueCommentPageFormDTO extends PageFormDTO { + @NotBlank(message = "issueId不能为空",groups = AddUserInternalGroup.class) + private String issueId; +} + diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueDetailFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueDetailFormDTO.java index 84b0d8f5e6..11532b097f 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueDetailFormDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueDetailFormDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -13,8 +14,9 @@ import java.io.Serializable; @Data public class IssueDetailFormDTO implements Serializable { private static final long serialVersionUID = 4859779755214503489L; - - @NotBlank(message = "议题id不能为空") + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + @NotBlank(message = "议题id不能为空",groups =AddUserShowGroup.class ) private String issueId; } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueShiftedFromTopicFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueShiftedFromTopicFormDTO.java index 872eb43772..b41592a829 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueShiftedFromTopicFormDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueShiftedFromTopicFormDTO.java @@ -122,4 +122,19 @@ public class IssueShiftedFromTopicFormDTO implements Serializable { private String groupId; private String issueId; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 地址 + */ + private String address; } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueCommentController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueCommentController.java new file mode 100644 index 0000000000..f579c9d1fe --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueCommentController.java @@ -0,0 +1,61 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.IssueCommentDTO; +import com.epmet.dto.form.IssueCommentPageFormDTO; +import com.epmet.service.IssueCommentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 议题评论表 + * 目前只有烟台客户,钉钉居民端,议事厅,可以发表评论 + * 产品没有此功能 + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-02 + */ +@RestController +@RequestMapping("issuecomment") +public class IssueCommentController { + + @Autowired + private IssueCommentService issueCommentService; + + /** + * 议题评论列表 + * @param formDTO + * @return + */ + @RequestMapping("page") + public Result> page(@RequestBody IssueCommentPageFormDTO formDTO){ + PageData page = issueCommentService.page(formDTO); + return new Result>().ok(page); + } + + /** + * 议题评论 + * @param tokenDto + * @param dto + * @return + */ + @NoRepeatSubmit + @PostMapping("save") + public Result save(@LoginUser TokenDto tokenDto, @RequestBody IssueCommentDTO dto){ + dto.setCustomerId(tokenDto.getCustomerId()); + dto.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(dto,IssueCommentDTO.AddUserShowGroup.class,IssueCommentDTO.AddUserInternalGroup.class); + issueCommentService.save(dto); + return new Result(); + } + + +} diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java index efb1ede9f1..1f642c9790 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java @@ -43,6 +43,7 @@ public class IssueController { */ @PostMapping(value = "detail") public Result detail(@RequestBody IssueDetailFormDTO issueDetail){ + ValidatorUtils.validateEntity(issueDetail,IssueDetailFormDTO.AddUserShowGroup.class); return new Result().ok(issueService.detail(issueDetail)); } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueCommentDao.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueCommentDao.java new file mode 100644 index 0000000000..beaca75c6a --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueCommentDao.java @@ -0,0 +1,20 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.IssueCommentDTO; +import com.epmet.entity.IssueCommentEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 议题评论表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-02 + */ +@Mapper +public interface IssueCommentDao extends BaseDao { + + List selectCommentList(String issueId); +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueCommentEntity.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueCommentEntity.java new file mode 100644 index 0000000000..4ad01c7038 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueCommentEntity.java @@ -0,0 +1,54 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 议题评论表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("issue_comment") +public class IssueCommentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 议题ID + */ + private String issueId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 评论内容至多200字 + */ + private String content; + + /** + * 评论用户id + */ + private String userId; + + /** + * 姓名 + */ + private String userName; + + /** + * 头像 + */ + private String headPhoto; + +} diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueCommentService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueCommentService.java new file mode 100644 index 0000000000..3fa35a8077 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueCommentService.java @@ -0,0 +1,37 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IssueCommentDTO; +import com.epmet.dto.form.IssueCommentPageFormDTO; +import com.epmet.entity.IssueCommentEntity; + +/** + * 议题评论表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-02 + */ +public interface IssueCommentService extends BaseService { + + /** + * 默认分页 + * + * @param formDTO + * @return PageData + * @author generator + * @date 2023-02-02 + */ + PageData page(IssueCommentPageFormDTO formDTO); + + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2023-02-02 + */ + void save(IssueCommentDTO dto); +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueCommentServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueCommentServiceImpl.java new file mode 100644 index 0000000000..61df62df96 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueCommentServiceImpl.java @@ -0,0 +1,75 @@ +package com.epmet.service.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.IssueCommentDao; +import com.epmet.dto.IssueCommentDTO; +import com.epmet.dto.form.IssueCommentPageFormDTO; +import com.epmet.dto.result.UserBaseInfoResultDTO; +import com.epmet.entity.IssueCommentEntity; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.service.IssueCommentService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; + +/** + * 议题评论表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-02 + */ +@Slf4j +@Service +public class IssueCommentServiceImpl extends BaseServiceImpl implements IssueCommentService { + @Autowired + private EpmetUserOpenFeignClient userOpenFeignClient; + + /** + * 议题评论列表 + * @param formDTO + * @return + */ + @Override + public PageData page(IssueCommentPageFormDTO formDTO) { + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + List list = baseDao.selectCommentList(formDTO.getIssueId()); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); + } + + /** + * 议题评论 + * 需求来源于烟台:https://modao.cc/app/Uz9nPVerhvcupzLnhoiY#screen=sl8mfpxd863xmb5 + * @param dto + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IssueCommentDTO dto) { + //查询用户信息 + List userIdList=new ArrayList<>(); + userIdList.add(dto.getUserId()); + Result> userInfoRes= userOpenFeignClient.queryUserBaseInfo(userIdList); + if(!userInfoRes.success()|| CollectionUtils.isEmpty(userInfoRes.getData())){ + log.error("议题评论查询用户信息异常userId: "+dto.getUserId()); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"查询用户信息异常userId:"+dto.getUserId(),"查询用户信息异常"); + } + IssueCommentEntity entity = ConvertUtils.sourceToTarget(dto, IssueCommentEntity.class); + entity.setHeadPhoto(userInfoRes.getData().get(NumConstant.ZERO).getHeadImgUrl()); + entity.setUserName(userInfoRes.getData().get(NumConstant.ZERO).getRealName()); + insert(entity); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index b576a0f1ca..ac11b644fc 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -510,23 +510,7 @@ public class IssueServiceImpl extends BaseServiceImpl imp @Override @Transactional(rollbackFor = Exception.class) public String audit(TokenDto token, IssueAuditionFormDTO param){ - - if (StringUtils.isNotBlank(param.getReason())) { - TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); - TextTaskDTO taskDTO = new TextTaskDTO(); - taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); - taskDTO.setContent(param.getReason()); - textScanParamDTO.getTasks().add(taskDTO); - Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); - if (!textSyncScanResult.success()){ - throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); - } else { - if (!textSyncScanResult.getData().isAllPass()) { - throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); - } - } - } - + scanReason(param.getReason()); Date unifiedDate = new Date(); IssueApplicationDTO application = applicationService.get(param.getIssueApplicationId()); @@ -613,6 +597,24 @@ public class IssueServiceImpl extends BaseServiceImpl imp return app2update.getIssueId(); } + private void scanReason(String reason) { + if (StringUtils.isNotBlank(reason)) { + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + TextTaskDTO taskDTO = new TextTaskDTO(); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); + taskDTO.setContent(reason); + textScanParamDTO.getTasks().add(taskDTO); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()){ + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + } + } + } + } + /** * @Description 表决中列表 * @param issueListForm diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.21__issue_comment.sql b/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.21__issue_comment.sql new file mode 100644 index 0000000000..3897a5369d --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.21__issue_comment.sql @@ -0,0 +1,16 @@ +CREATE TABLE `issue_comment` ( + `ID` varchar(32) NOT NULL COMMENT '主键ID', + `ISSUE_ID` varchar(32) NOT NULL COMMENT '议题ID', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `CONTENT` varchar(255) NOT NULL COMMENT '评论内容至多200字', + `USER_ID` varchar(64) NOT NULL COMMENT '评论用户id', + `USER_NAME` varchar(64) DEFAULT NULL COMMENT '姓名', + `HEAD_PHOTO` varchar(255) DEFAULT NULL COMMENT '头像', + `DEL_FLAG` varchar(2) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='议题评论表'; \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueCommentDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueCommentDao.xml new file mode 100644 index 0000000000..fc7676ed60 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueCommentDao.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml index 77e9db60da..5f7be12f1b 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml @@ -115,6 +115,15 @@ suggestion, + + ADDRESS, + + + LONGITUDE, + + + LATITUDE, + customer_id, @@ -186,6 +195,15 @@ #{suggestion}, + + #{address}, + + + #{longitude}, + + + #{latitude}, + #{customerId}, diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPropertyManagementDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPropertyManagementDTO.java index 3554df553f..a276e36387 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPropertyManagementDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPropertyManagementDTO.java @@ -43,6 +43,10 @@ public class IcPropertyManagementDTO implements Serializable { * 物业名称 */ private String name; + /** + * 客户id + */ + private String customerId; /** * 删除标识 0未删除、1已删除 @@ -73,5 +77,8 @@ public class IcPropertyManagementDTO implements Serializable { * 更新时间 */ private Date updatedTime; - + /** + * 关联的小区数量 + */ + private Integer totalNeighborHood; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyV2FormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyV2FormDTO.java index 0cbb5c1ab5..63bf3c6e55 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyV2FormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyV2FormDTO.java @@ -118,4 +118,10 @@ public class AddAgencyV2FormDTO implements Serializable { * 中心点位位置 */ private String centerAddress; + + /** + * 社区简介 + */ + @Length(max = 500,message ="最多输入500字",groups =DefaultUserShowGroup.class ) + private String remark; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java index 57e535ad25..2d0da966d0 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java @@ -110,4 +110,7 @@ public class EditAgencyFormDTO implements Serializable { private String centerAddress; private String customerId; + + @Length(max = 500,message = "最多输入500字",groups =DefaultUserShowGroup.class ) + private String remark; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPropertyManagementFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPropertyManagementFormDTO.java index 63ea329d22..bbc2cd7152 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPropertyManagementFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPropertyManagementFormDTO.java @@ -22,6 +22,7 @@ import lombok.Data; import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; @@ -39,6 +40,8 @@ public class IcPropertyManagementFormDTO implements Serializable { public interface UpdateShowGroup extends CustomerClientShowGroup { } + public interface PageGroup extends CustomerClientShowGroup { + } @NotBlank(message = "物业id不能为空", groups = {DeleteGroup.class, UpdateShowGroup.class}) private String id; @@ -49,5 +52,11 @@ public class IcPropertyManagementFormDTO implements Serializable { @Length(max = 50, message = "物业名称不能超过50个字", groups = {AddShowGroup.class}) private String name; + private String customerId; + + @NotNull(message = "pageNo不能为空", groups = PageGroup.class) + private Integer pageNo; + @NotNull(message = "pageSize不能为空", groups = PageGroup.class) + private Integer pageSize; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java index 99028d23bb..f95c6349a4 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java @@ -133,4 +133,8 @@ public class AgencysResultDTO implements Serializable { * 中心点位位置 */ private String centerAddress; + + private String remark; + + private String coordinates; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridDetailResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridDetailResultDTO.java index 22d4951210..ab9256c1b2 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridDetailResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridDetailResultDTO.java @@ -96,4 +96,6 @@ public class GridDetailResultDTO implements Serializable { */ private Integer gridSort = 0; + private String coordinates; + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java index 878200dc01..0e5c5ffccb 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java @@ -43,7 +43,7 @@ public class GridController { * @return */ @PostMapping("griddetail") - public Result gridDetail(@LoginUser TokenDto tokenDto,@RequestBody CustomerGridFormDTO customerGridFormDTO){ + public Result gridDetail(@RequestBody CustomerGridFormDTO customerGridFormDTO){ Result griddetail = customerGridService.griddetail(customerGridFormDTO); return griddetail; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PropertyManagementController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PropertyManagementController.java index 6a38dd3e39..ba24389143 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PropertyManagementController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PropertyManagementController.java @@ -18,12 +18,13 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.IcPropertyManagementDTO; import com.epmet.dto.form.IcPropertyManagementFormDTO; import com.epmet.dto.result.IcPropertyManagementResultDTO; -import com.epmet.service.IcPropertyManagementService; import com.epmet.service.PropertyManagementService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -45,33 +46,46 @@ import java.util.Map; @RestController @RequestMapping("propertymanagement") public class PropertyManagementController { - - @Autowired - private IcPropertyManagementService icPropertyManagementService; @Autowired private PropertyManagementService propertyManagementService; + /** + * 分页查询物业列表 + */ + @PostMapping("page") + public Result> page(@RequestBody IcPropertyManagementFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,IcPropertyManagementFormDTO.PageGroup.class); + return new Result>().ok(propertyManagementService.page(formDTO.getPageNo(),formDTO.getPageSize(),formDTO.getName())); + } - + /** + * 新增小区时,下拉框调用此接口 + * @return + */ @PostMapping("list") public Result> list(){ return new Result>().ok(propertyManagementService.getList()); } - + /** + * 新增物业 + * 新增小区页面,添加小区也调用此接口 + * @param tokenDTO + * @param formDTO + * @return + */ @PostMapping("add") public Result add(@LoginUser TokenDto tokenDTO, @RequestBody IcPropertyManagementFormDTO formDTO){ //效验数据 + formDTO.setCustomerId(tokenDTO.getCustomerId()); ValidatorUtils.validateEntity(formDTO, IcPropertyManagementFormDTO.AddShowGroup.class); Map map=new HashMap<>(); map.put("propertyId",propertyManagementService.add(formDTO)); return new Result().ok(map); } - - @PostMapping("update") - public Result update(@LoginUser TokenDto tokenDTO, @RequestBody IcPropertyManagementFormDTO formDTO){ + public Result update(@RequestBody IcPropertyManagementFormDTO formDTO){ //效验数据 ValidatorUtils.validateEntity(formDTO, IcPropertyManagementFormDTO.UpdateShowGroup.class); propertyManagementService.update(formDTO); @@ -79,7 +93,7 @@ public class PropertyManagementController { } @PostMapping("delete") - public Result delete(@LoginUser TokenDto tokenDTO, @RequestBody IcPropertyManagementFormDTO formDTO){ + public Result delete(@RequestBody IcPropertyManagementFormDTO formDTO){ //效验数据 ValidatorUtils.validateEntity(formDTO, IcPropertyManagementFormDTO.DeleteGroup.class); propertyManagementService.delete(formDTO); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPropertyManagementDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPropertyManagementDao.java index 52a038ab3b..915b2f6d7d 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPropertyManagementDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPropertyManagementDao.java @@ -34,7 +34,7 @@ import java.util.List; @Mapper public interface IcPropertyManagementDao extends BaseDao { - IcPropertyManagementEntity selectByName(String name); + IcPropertyManagementEntity selectByName(String customerId,String name,String id); /** * @Description 根据物业名查询已存在的物业名 @@ -58,4 +58,6 @@ public interface IcPropertyManagementDao extends BaseDao selectPropertyNameList(String neighborhoodId); + + List queryList(@Param("customerId") String customerId,@Param("name")String name); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java index fda8070609..a2668ae5fd 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java @@ -143,4 +143,10 @@ public class CustomerAgencyEntity extends BaseEpmetEntity { * 联系电话 */ private String mobile; + + /** + * 备注 + */ + private String remark; + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPropertyManagementEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPropertyManagementEntity.java index ff8b648d6a..239fce61cc 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPropertyManagementEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPropertyManagementEntity.java @@ -39,5 +39,5 @@ public class IcPropertyManagementEntity extends BaseEpmetEntity { * 物业名称 */ private String name; - + private String customerId; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/PropertyManagementService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/PropertyManagementService.java index 7bbbad3616..f3f77cde27 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/PropertyManagementService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/PropertyManagementService.java @@ -17,6 +17,8 @@ package com.epmet.service; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcPropertyManagementDTO; import com.epmet.dto.form.IcPropertyManagementFormDTO; import com.epmet.dto.result.IcPropertyManagementResultDTO; @@ -36,4 +38,6 @@ public interface PropertyManagementService { void update(IcPropertyManagementFormDTO formDTO); void delete(IcPropertyManagementFormDTO formDTO); + + PageData page(Integer pageNo, Integer pageSize, String name); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java index fcb04db161..04d8dfb98b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java @@ -166,6 +166,7 @@ public class AgencyServiceImpl implements AgencyService { originalEntity.setCode(formDTO.getCode()); originalEntity.setContacts(formDTO.getContacts()); originalEntity.setMobile(formDTO.getMobile()); + originalEntity.setRemark(formDTO.getRemark()); //利用mybatis 拦截器填充值 originalEntity.setUpdatedTime(null); originalEntity.setUpdatedBy(null); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index dd1f8866fd..ab5e4ce22c 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -239,6 +239,9 @@ public class CustomerGridServiceImpl extends BaseServiceImpl griddetail(CustomerGridFormDTO customerGridFormDTO) { GridDetailResultDTO griddetail = baseDao.griddetail(customerGridFormDTO); + if(null==griddetail){ + return new Result<>(); + } List customerStaffGridDTOS = baseDao.selectUserIdByGridId(customerGridFormDTO); //获取人员具体信息(头像、名字...) Result> staffGridList = epmetUserFeignClient.getStaffGridList(customerStaffGridDTOS); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/PropertyManagementServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/PropertyManagementServiceImpl.java index bfc46dd0b6..41d2f7bfbc 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/PropertyManagementServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/PropertyManagementServiceImpl.java @@ -1,19 +1,24 @@ package com.epmet.service.impl; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.epmet.commons.tools.exception.RenException; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.EpmetRequestHolder; import com.epmet.dao.IcNeighborHoodPropertyDao; import com.epmet.dao.IcPropertyManagementDao; +import com.epmet.dto.IcPropertyManagementDTO; import com.epmet.dto.form.IcPropertyManagementFormDTO; import com.epmet.dto.result.IcPropertyManagementResultDTO; import com.epmet.entity.IcNeighborHoodPropertyEntity; import com.epmet.entity.IcPropertyManagementEntity; import com.epmet.service.PropertyManagementService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.CollectionUtils; import javax.annotation.Resource; import java.util.ArrayList; @@ -28,9 +33,15 @@ public class PropertyManagementServiceImpl implements PropertyManagementService @Resource private IcNeighborHoodPropertyDao icNeighborHoodPropertyDao; + /** + * 查询当前客户下的物业 + * @return + */ @Override public List getList() { - List propertyManagementEntityList = icPropertyManagementDao.selectList(null); + LambdaQueryWrapper queryWrapper=new LambdaQueryWrapper<>(); + queryWrapper.eq(IcPropertyManagementEntity::getCustomerId, EpmetRequestHolder.getLoginUserCustomerId()); + List propertyManagementEntityList = icPropertyManagementDao.selectList(queryWrapper); List list = new ArrayList<>(); propertyManagementEntityList.forEach(item->{ IcPropertyManagementResultDTO propertyManagementResultDTO = new IcPropertyManagementResultDTO(); @@ -41,13 +52,19 @@ public class PropertyManagementServiceImpl implements PropertyManagementService return list; } + /** + * 新增物业 + * 名称客户下唯一 + * @param formDTO + * @return + */ @Override @Transactional(rollbackFor = Exception.class) public String add(IcPropertyManagementFormDTO formDTO) { //物业名字平台内唯一 //如果输入的物业名字已经存在,直接返回物业id formDTO.setName(formDTO.getName().trim()); - IcPropertyManagementEntity entity = icPropertyManagementDao.selectByName(formDTO.getName()); + IcPropertyManagementEntity entity = icPropertyManagementDao.selectByName(formDTO.getCustomerId(),formDTO.getName(),null); if (null != entity) { return entity.getId(); } @@ -59,17 +76,34 @@ public class PropertyManagementServiceImpl implements PropertyManagementService @Override @Transactional(rollbackFor = Exception.class) public void update(IcPropertyManagementFormDTO formDTO) { + IcPropertyManagementEntity entity = icPropertyManagementDao.selectByName(EpmetRequestHolder.getLoginUserCustomerId(),formDTO.getName(),formDTO.getId()); + if (null != entity) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"物业名称已存在","物业名称已存在"); + } IcPropertyManagementEntity icPropertyManagementEntity = ConvertUtils.sourceToTarget(formDTO, IcPropertyManagementEntity.class); icPropertyManagementDao.updateById(icPropertyManagementEntity); } + /** + * 单个删除 + * @param formDTO + */ @Override @Transactional(rollbackFor = Exception.class) public void delete(IcPropertyManagementFormDTO formDTO) { - List list = icNeighborHoodPropertyDao.selectList(new QueryWrapper().lambda().eq(IcNeighborHoodPropertyEntity::getPropertyId, formDTO.getId())); - if(!CollectionUtils.isEmpty(list)){ - throw new RenException("物业存在与小区关联,无法删除"); + LambdaQueryWrapper queryWrapper=new LambdaQueryWrapper<>(); + queryWrapper.eq(IcNeighborHoodPropertyEntity::getPropertyId,formDTO.getId()); + if (icNeighborHoodPropertyDao.selectCount(queryWrapper) > 0) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"物业存在与小区关联,无法删除","已与小区关联,无法删除"); } icPropertyManagementDao.deleteById(formDTO.getId()); } + + @Override + public PageData page(Integer pageNo, Integer pageSize, String name) { + PageHelper.startPage(pageNo,pageSize); + List list=icPropertyManagementDao.queryList(EpmetRequestHolder.getLoginUserCustomerId(),name); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.48__ic_property_management.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.48__ic_property_management.sql new file mode 100644 index 0000000000..14ec16f9b4 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.48__ic_property_management.sql @@ -0,0 +1,8 @@ +alter table ic_property_management add COLUMN `CUSTOMER_ID` varchar(64) DEFAULT NULL COMMENT '客户id' after NAME; + + +update ic_property_management p,ic_neighbor_hood_property pr,ic_neighbor_hood h +set p.CUSTOMER_ID=h.CUSTOMER_ID +where p.DEL_FLAG='0' + and p.id=pr.PROPERTY_ID + and pr.NEIGHBOR_HOOD_ID=h.id; \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.49__alter_agency.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.49__alter_agency.sql new file mode 100644 index 0000000000..bcfc36cf16 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.49__alter_agency.sql @@ -0,0 +1,2 @@ +ALTER TABLE `epmet_gov_org`.`customer_agency` + ADD COLUMN `REMARK` varchar(512) NULL COMMENT '备注说明' AFTER `REVISION`; \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml index 9febecf227..fcd7f78600 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml @@ -197,7 +197,8 @@ grid_type AS 'gridType', contacts AS 'contacts', mobile AS 'mobile', - sort AS gridSort + sort AS gridSort, + COORDINATES AS coordinates FROM customer_grid WHERE diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPropertyManagementDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPropertyManagementDao.xml index 0b0aba046c..045514482f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPropertyManagementDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPropertyManagementDao.xml @@ -14,14 +14,18 @@ - SELECT m.id FROM ic_property_management m WHERE m.DEL_FLAG = '0' + and m.customer_id = #{customerId} AND m.`NAME` = #{name} + + and m.id !=#{id} + @@ -65,4 +69,17 @@ AND p.DEL_FLAG = '0' ) + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java index d40ff78a46..e5bf477bc6 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java @@ -1870,6 +1870,28 @@ public class IcEventServiceImpl extends BaseServiceImpl msgList = new ArrayList<>(); + UserMessageFormDTO messageFormDTO = new UserMessageFormDTO(); + messageFormDTO.setCustomerId(formDTO.getCustomerId()); + messageFormDTO.setApp(ProjectConstant.RESI); + messageFormDTO.setGridId(icEventEntity.getGridId()); + messageFormDTO.setUserId(icEventEntity.getCreatedBy()); + messageFormDTO.setTitle(UserMessageConstant.EVENT_TITILE); + // 获取当前工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo = getStaffInfo(formDTO.getCustomerId(), formDTO.getCurrentUserId()); + messageFormDTO.setMessageContent(String.format("%s将您上报的事件转为议题,请查看。", staffInfo.getAgencyName())); + messageFormDTO.setReadFlag(Constant.UNREAD); + messageFormDTO.setMessageType(UserMessageTypeConstant.IC_EVENT); + messageFormDTO.setTargetId(icEventEntity.getId()); + msgList.add(messageFormDTO); + Result sendMessageRes = messageOpenFeignClient.saveUserMessageList(msgList); + if (!sendMessageRes.success()) { + log.warn(String.format("事件转议题,给居民端用户发送站内信异常,事件Id->%s", icEventEntity.getId())); + } + } } /** diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java index e86357966e..a0cb76ed86 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java @@ -39,5 +39,9 @@ public class CommonArticleListFormDTO implements Serializable { * 排除的标签名称(高级配置里的参数) * */ private String excludeTagName; + /** + * 是否置顶 1是;0否; + */ + private Integer isTop; } diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideListFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideListFormDTO.java index d8edcf1308..212cfd9a7a 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideListFormDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideListFormDTO.java @@ -16,7 +16,15 @@ import java.io.Serializable; public class GuideListFormDTO extends PageFormDTO implements Serializable { private static final long serialVersionUID = -4471422632936288213L; + /** + * tokenDto.customerId + */ private String customerId; + + /** + * tokenDto.userId + */ + private String userId; /** * 组织ID */ diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GuideListResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GuideListResultDTO.java index 7cd2400afa..f4b2403608 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GuideListResultDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GuideListResultDTO.java @@ -32,4 +32,10 @@ public class GuideListResultDTO implements Serializable { * 更新时间 */ private Date updatedTime; + + /** + * 1:已读 + * 0:未读 + */ + private Integer readFlag; } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideController.java index 8fe57c6f76..a1586ee736 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideController.java @@ -100,8 +100,10 @@ public class GuideController { */ @PostMapping("list") public Result> guideList(@LoginUser TokenDto tokenDto, @RequestBody GuideListFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class); - PageData page = guideService.guideList(tokenDto, formDTO); + PageData page = guideService.guideList(formDTO); return new Result>().ok(page); } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java index 2c19c2aa38..3a549dfa61 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java @@ -114,7 +114,11 @@ public interface ArticleDao extends BaseDao { * @author wangc * @date 2020.06.02 16:04 **/ - List selectLatestArticleMsg(@Param("gridId") String gridId, @Param("tagName") String tagName, @Param("excludeTagName") String excludeTagName, @Param("num") Integer num); + List selectLatestArticleMsg(@Param("gridId") String gridId, + @Param("tagName") String tagName, + @Param("excludeTagName") String excludeTagName, + @Param("num") Integer num, + @Param("isTop")Integer isTop); /** * @param gridId diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideReaderDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideReaderDao.java new file mode 100644 index 0000000000..a7f5887077 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideReaderDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.GuideReaderEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 办事指南阅读记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-02 + */ +@Mapper +public interface GuideReaderDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideReaderEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideReaderEntity.java new file mode 100644 index 0000000000..b5b1f881fc --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideReaderEntity.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-02-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("guide_reader") +public class GuideReaderEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 办事指南id + */ + private String guideId; + + /** + * 用户id;进入过办事指南详情就算是已读 + */ + private String userId; + + /** + * 工作端:gov;居民端:resi + */ + private String userType; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideReaderService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideReaderService.java new file mode 100644 index 0000000000..646a578a72 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideReaderService.java @@ -0,0 +1,34 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.GuideReaderEntity; + +/** + * 办事指南阅读记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-02 + */ +public interface GuideReaderService extends BaseService { + + /** + * 单条查询 + * + * @param guideId + * @param userId + * @return GuideReaderDTO + * @author generator + * @date 2023-02-02 + */ + GuideReaderEntity get(String guideId,String userId); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2023-02-02 + */ + void save(GuideReaderEntity dto); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideService.java index a2493a88ac..6f5d3c7071 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideService.java @@ -109,7 +109,7 @@ public interface GuideService extends BaseService { * @Author zhaoqifeng * @Date 2021/9/7 14:00 */ - PageData guideList(TokenDto tokenDto, GuideListFormDTO formDTO); + PageData guideList(GuideListFormDTO formDTO); /** * 添加指南 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 8c8d695d51..b0e780209a 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 @@ -537,8 +537,10 @@ public class ArticleServiceImpl extends BaseServiceImpl getLatestArticleList(CommonArticleListFormDTO commonArticleListFormDTO) { - return baseDao.selectLatestArticleMsg(commonArticleListFormDTO.getGridId(),commonArticleListFormDTO.getTagName(),commonArticleListFormDTO.getExcludeTagName(), + return baseDao.selectLatestArticleMsg(commonArticleListFormDTO.getGridId(), + commonArticleListFormDTO.getTagName(), + commonArticleListFormDTO.getExcludeTagName(), null == commonArticleListFormDTO.getNum() || commonArticleListFormDTO.getNum() <= NumConstant.ZERO ? - NumConstant.FIVE : commonArticleListFormDTO.getNum()); + NumConstant.FIVE : commonArticleListFormDTO.getNum(), + commonArticleListFormDTO.getIsTop()); } /** @@ -1740,47 +1745,47 @@ public class ArticleServiceImpl extends BaseServiceImpl list = baseDao.selectAllArticle(formDTO); - - if (!CollectionUtils.isEmpty(list)) { - resultDTO = list.get(NumConstant.ZERO); - resultDTO.setTagNameList(StringUtils.isNotBlank(resultDTO.getTags())?Arrays.asList(resultDTO.getTags().split("[|]")):new ArrayList<>()); - resultDTO.setIsMePublished(resultDTO.getCreatedBy().equals(formDTO.getStaffId())?true:false); - //查询文章涉及的发布范围网络Id列表 - LambdaQueryWrapper tWrapper = new LambdaQueryWrapper<>(); - tWrapper.eq(ArticlePublishRangeEntity::getArticleId, formDTO.getArticleId()); - tWrapper.eq(ArticlePublishRangeEntity::getDelFlag, NumConstant.ZERO_STR); - //【文章下线的查所有发布范围,文章没下线的只查还没下线的发布范围】 - if("offline".equals(resultDTO.getStatusFlag())){ - tWrapper.eq(ArticlePublishRangeEntity::getPublishStatus, "offline"); - }else { - tWrapper.eq(ArticlePublishRangeEntity::getPublishStatus, "published"); - } - List entityList = articlePublishRangeDao.selectList(tWrapper); - if (!CollectionUtils.isEmpty(entityList)) { - List contentList = entityList.stream().map(ArticlePublishRangeEntity::getGridId).collect(Collectors.toList()); - resultDTO.setGridIdList(contentList); - } - - //查询文章内容 - LambdaQueryWrapper tWrapper1 = new LambdaQueryWrapper<>(); - tWrapper1.eq(ArticleContentEntity::getArticleId, formDTO.getArticleId()); - tWrapper1.eq(ArticleContentEntity::getDelFlag, NumConstant.ZERO_STR); - tWrapper1.orderByDesc(ArticleContentEntity::getOrderNum); - List contentEntityList = articleContentDao.selectList(tWrapper1); - if (!CollectionUtils.isEmpty(contentEntityList)) { - List contentList = ConvertUtils.sourceToTarget(contentEntityList, PublishedListResultDTO.Content.class); - resultDTO.setContentList(contentList); - } - - //标签列表 - LambdaQueryWrapper tWrapper2 = new LambdaQueryWrapper<>(); - tWrapper2.eq(ArticleTagsEntity::getArticleId, formDTO.getArticleId()); - tWrapper2.eq(ArticleTagsEntity::getDelFlag, NumConstant.ZERO_STR); - List tagsEntityList = articleTagsDao.selectList(tWrapper2); - if (!CollectionUtils.isEmpty(tagsEntityList)) { - List contentList = tagsEntityList.stream().map(ArticleTagsEntity::getTagId).collect(Collectors.toList()); - resultDTO.setTagIdList(contentList); - } + if(CollectionUtils.isEmpty(list)){ + return null; + } + resultDTO = list.get(NumConstant.ZERO); + resultDTO.setTagNameList(StringUtils.isNotBlank(resultDTO.getTags())?Arrays.asList(resultDTO.getTags().split("[|]")):new ArrayList<>()); + resultDTO.setIsMePublished(resultDTO.getCreatedBy().equals(formDTO.getStaffId())?true:false); + //查询文章涉及的发布范围网络Id列表 + LambdaQueryWrapper tWrapper = new LambdaQueryWrapper<>(); + tWrapper.eq(ArticlePublishRangeEntity::getArticleId, formDTO.getArticleId()); + tWrapper.eq(ArticlePublishRangeEntity::getDelFlag, NumConstant.ZERO_STR); + //【文章下线的查所有发布范围,文章没下线的只查还没下线的发布范围】 + if("offline".equals(resultDTO.getStatusFlag())){ + tWrapper.eq(ArticlePublishRangeEntity::getPublishStatus, "offline"); + }else { + tWrapper.eq(ArticlePublishRangeEntity::getPublishStatus, "published"); + } + List entityList = articlePublishRangeDao.selectList(tWrapper); + if (!CollectionUtils.isEmpty(entityList)) { + List contentList = entityList.stream().map(ArticlePublishRangeEntity::getGridId).collect(Collectors.toList()); + resultDTO.setGridIdList(contentList); + } + + //查询文章内容 + LambdaQueryWrapper tWrapper1 = new LambdaQueryWrapper<>(); + tWrapper1.eq(ArticleContentEntity::getArticleId, formDTO.getArticleId()); + tWrapper1.eq(ArticleContentEntity::getDelFlag, NumConstant.ZERO_STR); + tWrapper1.orderByDesc(ArticleContentEntity::getOrderNum); + List contentEntityList = articleContentDao.selectList(tWrapper1); + if (!CollectionUtils.isEmpty(contentEntityList)) { + List contentList = ConvertUtils.sourceToTarget(contentEntityList, PublishedListResultDTO.Content.class); + resultDTO.setContentList(contentList); + } + + //标签列表 + LambdaQueryWrapper tWrapper2 = new LambdaQueryWrapper<>(); + tWrapper2.eq(ArticleTagsEntity::getArticleId, formDTO.getArticleId()); + tWrapper2.eq(ArticleTagsEntity::getDelFlag, NumConstant.ZERO_STR); + List tagsEntityList = articleTagsDao.selectList(tWrapper2); + if (!CollectionUtils.isEmpty(tagsEntityList)) { + List contentList = tagsEntityList.stream().map(ArticleTagsEntity::getTagId).collect(Collectors.toList()); + resultDTO.setTagIdList(contentList); } return resultDTO; @@ -1799,7 +1804,7 @@ public class ArticleServiceImpl extends BaseServiceImpl queryWrapper=new LambdaQueryWrapper(); - queryWrapper.eq(ArticleCoverEntity::getArticleId,articleEntity); + queryWrapper.eq(ArticleCoverEntity::getArticleId,articleId); if (articleCoverDao.selectCount(queryWrapper) == 0) { ArticleCoverEntity articleCoverEntity=new ArticleCoverEntity(); articleCoverEntity.setCustomerId(articleEntity.getCustomerId()); @@ -1847,6 +1852,7 @@ public class ArticleServiceImpl extends BaseServiceImpl implements GuideReaderService { + + @Override + public GuideReaderEntity get(String guideId,String userId) { + LambdaQueryWrapper queryWrapper=new LambdaQueryWrapper<>(); + queryWrapper.eq(GuideReaderEntity::getGuideId,guideId) + .eq(GuideReaderEntity::getUserId,userId); + GuideReaderEntity entity = baseDao.selectOne(queryWrapper); + return entity; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GuideReaderEntity entity) { + insert(entity); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java index d93f21b2af..eadca17c92 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java @@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.form.PageFormDTO; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.exception.EpmetErrorCode; @@ -31,6 +32,7 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.SpringContextUtils; import com.epmet.constant.OrgInfoConstant; import com.epmet.dao.GuideDao; import com.epmet.dto.GuideDTO; @@ -38,10 +40,7 @@ import com.epmet.dto.form.*; import com.epmet.dto.result.GuideDetailResultDTO; import com.epmet.dto.result.GuideListResultDTO; import com.epmet.dto.result.OrgResultDTO; -import com.epmet.entity.GuideAttachmentEntity; -import com.epmet.entity.GuideEntity; -import com.epmet.entity.GuideExternalLinkEntity; -import com.epmet.entity.GuideModuleEntity; +import com.epmet.entity.*; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.service.*; import com.github.pagehelper.PageHelper; @@ -140,15 +139,14 @@ public class GuideServiceImpl extends BaseServiceImpl imp * @Date 2021/9/7 14:00 */ @Override - public PageData guideList(TokenDto tokenDto, GuideListFormDTO formDTO) { + public PageData guideList(GuideListFormDTO formDTO) { PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); - formDTO.setCustomerId(tokenDto.getCustomerId()); List list = baseDao.getGuideList(formDTO); if (CollectionUtils.isNotEmpty(list)) { list.forEach(item -> { - CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), item.getCreatedId()); + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), item.getCreatedId()); if (null == staffInfoCache) { - item.setCategoryName(""); + item.setCategoryName(StrConstant.EPMETY_STR); } else { item.setCreatedName(staffInfoCache.getRealName()); } @@ -390,6 +388,15 @@ public class GuideServiceImpl extends BaseServiceImpl imp if (null != guideCollectionService.getCollection(tokenDto, formDTO.getGuideId())) { result.setCollectionFlag(NumConstant.ONE_STR); } + //记录已读未读 来源于烟台 + if (null == SpringContextUtils.getBean(GuideReaderService.class).get(formDTO.getGuideId(), tokenDto.getUserId())) { + GuideReaderEntity guideReaderEntity=new GuideReaderEntity(); + guideReaderEntity.setGuideId(formDTO.getGuideId()); + guideReaderEntity.setCustomerId(formDTO.getCustomerId()); + guideReaderEntity.setUserId(tokenDto.getUserId()); + guideReaderEntity.setUserType(tokenDto.getApp()); + SpringContextUtils.getBean(GuideReaderService.class).save(guideReaderEntity); + } return result; } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.12__guide_reader.sql b/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.12__guide_reader.sql new file mode 100644 index 0000000000..eb1fb181c0 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.12__guide_reader.sql @@ -0,0 +1,14 @@ +CREATE TABLE `guide_reader` ( + `ID` varchar(64) NOT NULL COMMENT 'ID', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `GUIDE_ID` varchar(64) NOT NULL COMMENT '办事指南id', + `USER_ID` varchar(64) NOT NULL COMMENT '用户id;进入过办事指南详情就算是已读', + `USER_TYPE` varchar(10) NOT NULL COMMENT '工作端:gov;居民端:resi', + `DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='办事指南阅读记录'; \ No newline at end of file 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 61c6e4c517..379e7fbbc1 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 @@ -187,7 +187,7 @@ - SELECT art.ID AS articleId, art.TITLE AS articleTitle , @@ -224,7 +224,9 @@ art.DEL_FLAG = '0' AND art.STATUS_FLAG = 'published' - + + AND art.IS_TOP=#{isTop} + GROUP BY art.ID HAVING 1 = 1 diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideDao.xml index d3d5c34a56..c93cf14e36 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideDao.xml @@ -26,7 +26,11 @@ g.TITLE AS "title", gc.CATEGORY_NAME AS "categoryName", g.CREATED_BY AS "createdId", - g.UPDATED_TIME AS "updatedTime" + g.UPDATED_TIME AS "updatedTime", + if(exists( select gr.id from guide_reader gr + where gr.del_flag='0' + and gr.GUIDE_ID=g.id + and gr.USER_ID = #{userId}),1,0) AS readFlag FROM guide g INNER JOIN guide_category gc ON g.CATEGORY_CODE = gc.CATEGORY_CODE AND gc.DEL_FLAG = 0 AND gc.CUSTOMER_ID = #{customerId} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideReaderDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideReaderDao.xml new file mode 100644 index 0000000000..0c1d006449 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideReaderDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/TopicConstant.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/TopicConstant.java index 457e794443..1ba2bee6fe 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/TopicConstant.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/TopicConstant.java @@ -120,4 +120,16 @@ public interface TopicConstant { String RESOLVED = "resolved"; String MEMBER = "member"; + /** + * 反对 + */ + String OPPOSITION = "opposition"; + /** + * 赞成 + */ + String SUPPORT = "support"; + /** + * 无 + */ + String NONE = "none"; } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicAttachmentDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicAttachmentDTO.java new file mode 100644 index 0000000000..dddb6d1c4c --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicAttachmentDTO.java @@ -0,0 +1,95 @@ +package com.epmet.resi.group.dto.topic; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 烟台话题附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-01-30 + */ +@Data +public class YtTopicAttachmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 话题Id,关联resi_topic的id + */ + private String topicId; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String 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/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicCommentAttachmentDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicCommentAttachmentDTO.java new file mode 100644 index 0000000000..ff5b669689 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicCommentAttachmentDTO.java @@ -0,0 +1,109 @@ +package com.epmet.resi.group.dto.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 烟台话题评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-01-30 + */ +@Data +public class YtTopicCommentAttachmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 话题Id + */ + private String topicId; + + /** + * 评论Id + */ + private String topicCommentId; + + /** + * 文件名 + */ + private String fileName; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件大小,单位b + */ + private Integer attachmentSize; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String 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/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicCommentDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicCommentDTO.java new file mode 100644 index 0000000000..b397d26fef --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicCommentDTO.java @@ -0,0 +1,74 @@ +package com.epmet.resi.group.dto.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 烟台话题评论表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-01-30 + */ +@Data +public class YtTopicCommentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 话题Id,来自resi_topic + */ + private String topicId; + + /** + * + */ + private String commentContent; + + /** + * 评论状态:讨论中:discussing;已屏蔽 :hidden + */ + private String status; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人,评论人Id,来自user + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicDTO.java new file mode 100644 index 0000000000..8e4fa3add3 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicDTO.java @@ -0,0 +1,125 @@ +package com.epmet.resi.group.dto.topic; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 烟台话题信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-01-30 + */ +@Data +public class YtTopicDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * + */ + private String topicContent; + + /** + * 话题状态(讨论中 - discussing、 已屏蔽 - hidden、 已关闭 - closed) + */ + private String status; + + /** + * 关闭状态:已解决 resolved,未解决 unresolved + */ + private String closedStatus; + + /** + * 省 + */ + private String province; + + /** + * 市 + */ + private String city; + + /** + * 区 + */ + private String area; + + /** + * 地址 + */ + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 维度 + */ + private String latitude; + + /** + * 定位地址 + */ + private String locateAddress; + + /** + * 定位经度 + */ + private String locateLongitude; + + /** + * 定位维度 + */ + private String locateLatitude; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人,发布人Id来源于user + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicVoteDetailDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicVoteDetailDTO.java new file mode 100644 index 0000000000..bf8d7c10b1 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicVoteDetailDTO.java @@ -0,0 +1,70 @@ +package com.epmet.resi.group.dto.topic; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 话题表决记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-01-30 + */ +@Data +public class YtTopicVoteDetailDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 话题ID + */ + private String topicId; + + /** + * 态度 - opposition(反对)support(赞成) + */ + private String attitude; + + /** + * 删除标识 0未删除、1已删除 + */ + private String 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/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/CreateYtTopicFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/CreateYtTopicFormDTO.java new file mode 100644 index 0000000000..de00da7503 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/CreateYtTopicFormDTO.java @@ -0,0 +1,100 @@ +package com.epmet.resi.group.dto.topic.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Author zhaoqifeng + * @Date 2023/1/30 16:17 + */ +@Data +public class CreateYtTopicFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + @NotBlank(message = "customerId不能为空",groups =AddUserInternalGroup.class ) + private String customerId; + + @NotBlank(message ="网格不能为空",groups =AddUserShowGroup.class ) + private String gridId; + + @Length(max=3000,message ="话题内容最多输入3000字",groups =AddUserShowGroup.class ) + private String topicContent; + + /** + * 经度 + * */ + private String longitude; + + /** + * 纬度 + * */ + private String latitude; + + /** + * 地址 + * */ + @NotBlank(message = "地址信息不能为空") + private String address; + + /** + * 经度 + * */ + private String locateLongitude; + + /** + * 纬度 + * */ + private String locateLatitude; + + /** + * 地址 + * */ + private String locateAddress; + + /** + * 省份 + * */ + private String province; + + /** + * 城市 + * */ + private String city; + + /** + * 地区 + * */ + private String area; + + /** + * 图片附件 + */ + private List imageList; + // /** + // * 文件附件 + // */ + // private List docList; + /** + * 语音附件 + */ + private List voiceList; + // /** + // * 视频附件 + // */ + // private List videoList; + /** + * tokenDto.getUserId + */ + @NotBlank(message = "userId不能为空",groups =AddUserInternalGroup.class ) + private String userId; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/IssueShiftedFromTopicFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/IssueShiftedFromTopicFormDTO.java index 6eba4678d7..ac45f7b351 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/IssueShiftedFromTopicFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/IssueShiftedFromTopicFormDTO.java @@ -122,4 +122,19 @@ public class IssueShiftedFromTopicFormDTO implements Serializable { private String groupId; private String issueId; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 地址 + */ + private String address; } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/YtTopicCommentFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/YtTopicCommentFormDTO.java new file mode 100644 index 0000000000..e047e12eae --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/YtTopicCommentFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.resi.group.dto.topic.form; + +import com.epmet.resi.group.dto.notice.form.NoticeFileDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @ClassName ResiPublishCommentFormDTO + * @Author wangc + * @date 2020.03.31 17:32 + */ +@Data +public class YtTopicCommentFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + @NotBlank(message = "话题Id不能为空") + private String topicId; + + //@NotBlank(message = "评论内容不能为空") + private String commentContent; + + /** + * 图片附件集合 + */ + private List imageList; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/YtTopicDetailFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/YtTopicDetailFormDTO.java new file mode 100644 index 0000000000..61b03690ba --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/YtTopicDetailFormDTO.java @@ -0,0 +1,36 @@ +package com.epmet.resi.group.dto.topic.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description + * @ClassName ResiTopicDetailFormDTO + * @Author wangc + * @date 2020.04.07 09:07 + */ +@Data +public class YtTopicDetailFormDTO extends PageFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + /** + * 话题Id + * */ + @NotBlank(message = "话题Id不能为空",groups = AddUserShowGroup.class) + private String topicId; + + /** + * tokenDto.getUserId + */ + @NotBlank(message = "userId不能为空",groups = AddUserInternalGroup.class ) + private String userId; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/YtTopicPageFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/YtTopicPageFormDTO.java new file mode 100644 index 0000000000..b0649e5cc8 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/YtTopicPageFormDTO.java @@ -0,0 +1,61 @@ +package com.epmet.resi.group.dto.topic.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @author Administrator + */ +@Data +public class YtTopicPageFormDTO extends PageFormDTO implements Serializable{ + + private static final long serialVersionUID = 1L; + /** + * 组织Id + * */ + private String agencyId; + + /** + * 网格Id,source是居民端时必填 + * */ + @NotBlank(message = "网格Id不能为空") + private String gridId; + + /** + * 搜索时可以带状态的查询,也可以不带 + * */ + private String status; + + /** + * 用户Id + * */ + private String userId; + + /** + * 请求来源0 居民端,1 PC端 + * */ + private String source; + + /** + * 话题内容 + * */ + private String topicContent; + + /** + * 话题发表人 + * */ + private String userName; + + /** + * 发布时间 + * */ + private String startDate; + + /** + * 发布时间 + * */ + private String endDate; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/YtTopicVoteFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/YtTopicVoteFormDTO.java new file mode 100644 index 0000000000..153467c7a2 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/YtTopicVoteFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.resi.group.dto.topic.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description + * @ClassName ResiPublishCommentFormDTO + * @Author wangc + * @date 2020.03.31 17:32 + */ +@Data +public class YtTopicVoteFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + @NotBlank(message = "话题Id不能为空") + private String topicId; + + /** + * 态度opposition(反对)support(赞成) + */ + @NotBlank(message = "投票结果不能为空") + private String attitude; + +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicAndGroupResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicAndGroupResultDTO.java index ac3516418d..8577b8493b 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicAndGroupResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicAndGroupResultDTO.java @@ -33,4 +33,19 @@ public class ResiTopicAndGroupResultDTO implements Serializable { * 客户Id * */ private String customerId; + + /** + * 定位地址 + * */ + private String locateAddress; + + /** + * 定位经度 + * */ + private String locateLongitude; + + /** + * 定位纬度 + * */ + private String locateDimension; } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/YtTopicCommentResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/YtTopicCommentResultDTO.java new file mode 100644 index 0000000000..cf18c2d385 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/YtTopicCommentResultDTO.java @@ -0,0 +1,65 @@ +package com.epmet.resi.group.dto.topic.result; + +import com.alibaba.fastjson.annotation.JSONField; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * @Description + * @ClassName ResiCommentResultDTO + * @Author wangc + * @date 2020.04.01 17:07 + */ +@Data +public class YtTopicCommentResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 评论Id + * */ + private String commentId; + + /** + * 评论内容 + * */ + private String commentContent; + + /** + * 评论者头像 + * */ + private String commentUserHeadPhoto; + + /** + * 评论者姓名 + * */ + private String commentUserName; + + /** + * 用户Id 评论者Id + * */ + @JsonIgnore + private String userId; + + /** + * 评论时间 yyyy-MM-dd HH:mm + * */ + @JSONField(format="yyyy-MM-dd HH:mm") + private Date commentTime; + + /** + * 评论状态 + * */ + private String commentStatus; + + /** + * 图片附件集合 + */ + private List imageList = new ArrayList<>(); +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/YtTopicDetailResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/YtTopicDetailResultDTO.java new file mode 100644 index 0000000000..d5e4675af0 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/YtTopicDetailResultDTO.java @@ -0,0 +1,86 @@ +package com.epmet.resi.group.dto.topic.result; + +import com.epmet.resi.group.dto.topic.form.FileDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author Administrator + */ +@Data +public class YtTopicDetailResultDTO implements Serializable { + private static final long serialVersionUID = -6790536784979922200L; + + /** + * 话题Id + * */ + private String topicId; + + + /** + * 发布人名称 + * */ + private String releaseUserName; + + /** + * 发布人头像 + * */ + private String releaseUserHeadPhoto; + + /** + * 发布时间 yyyy-MM-dd HH:mm + * */ + private String releaseTime; + + /** + * 发布地址 + * */ + private String releaseAddress; + + /** + * 经度 + */ + private String longitude; + + /** + * 维度 + */ + private String latitude; + + /** + * 话题内容 + * */ + private String topicContent; + + /** + * 话题状态 + * */ + private String topicStatus; + + /** + * 图片访问地址 + * */ + private List topicImages; + + /** + * 话题语音详情 + * */ + private List topicVoices; + + /** + * 本人投票状态opposition(反对)support(赞成) none(未投票) + * */ + private String voteStatus; + /** + * 投票支持数 + * */ + private String supportCount; + /** + * 投票反对数 + * */ + private String oppositionCount; + private String userName; + private String gridName; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/YtTopicInfoResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/YtTopicInfoResultDTO.java new file mode 100644 index 0000000000..a1ede2ebc7 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/YtTopicInfoResultDTO.java @@ -0,0 +1,75 @@ +package com.epmet.resi.group.dto.topic.result; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + + +/** + * @author Administrator + */ +@Data +public class YtTopicInfoResultDTO implements Serializable { + private static final long serialVersionUID = -7029232911456325417L; + + /** + * 话题Id + * */ + private String topicId; + + /** + * 用户Id 话题发布人 + * */ + private String userId; + + /** + * 发布人名称 + * */ + private String releaseUserName; + private String userName; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格名 + */ + private String gridName; + + /** + * 发布人头像 + * */ + private String releaseUserHeadPhoto; + + /** + * 发布时间 yyyy-MM-dd HH:mm + * */ + @JSONField(format="yyyy-MM-dd HH:mm") + private Date releaseTime; + + /** + * 话题内容 + * */ + private String topicContent; + + /** + * 话题状态 讨论中 已关闭 + * */ + private String status; + + /** + * 是否本人 me other + * */ + private String releaseUserFlag; + + /** + * 第一张图片 + * */ + private List imageList; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/YtTopicController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/YtTopicController.java new file mode 100644 index 0000000000..d7ac74fd3b --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/YtTopicController.java @@ -0,0 +1,142 @@ +package com.epmet.modules.topic.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.annotation.MaskResponse; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.modules.topic.service.YtTopicService; +import com.epmet.resi.group.dto.comment.result.ResiCommentResultDTO; +import com.epmet.resi.group.dto.topic.form.*; +import com.epmet.resi.group.dto.topic.result.YtTopicCommentResultDTO; +import com.epmet.resi.group.dto.topic.result.YtTopicDetailResultDTO; +import com.epmet.resi.group.dto.topic.result.YtTopicInfoResultDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + + +/** + * 烟台话题信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-01-30 + */ +@RestController +@RequestMapping("ytTopic") +public class YtTopicController { + + @Autowired + private YtTopicService ytTopicService; + + /** + * 发布话题 + * + * @Param tokenDto + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2023/1/30 16:32 + */ + @PostMapping("createTopic") + @NoRepeatSubmit + public Result createTopic(@LoginUser TokenDto tokenDto, @RequestBody CreateYtTopicFormDTO formDTO) { + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO,CreateYtTopicFormDTO.AddUserShowGroup.class,CreateYtTopicFormDTO.AddUserInternalGroup.class); + ytTopicService.createTopic(formDTO); + return new Result(); + } + + /** + * 话题详情 + * + * @Param tokenDto + * @Param topicDetailFormDTO + * @Return {@link Result< YtTopicDetailResultDTO>} + * @Author zhaoqifeng + * @Date 2023/1/30 16:39 + */ + @PostMapping("topicDetail") + public Result getTopicDetail(@LoginUser TokenDto tokenDto, @RequestBody YtTopicDetailFormDTO topicDetailFormDTO) { + topicDetailFormDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(topicDetailFormDTO,YtTopicDetailFormDTO.AddUserShowGroup.class,YtTopicDetailFormDTO.AddUserInternalGroup.class); + return new Result().ok(ytTopicService.getTopicDetail(topicDetailFormDTO)); + } + + /** + * 话题列表 + * + * @Param tokenDto + * @Param topicPageFormDTO + * @Return {@link Result< PageData< YtTopicInfoResultDTO>>} + * @Author zhaoqifeng + * @Date 2023/1/30 16:55 + */ + @PostMapping("topicList") + @MaskResponse(fieldNames = "userName", fieldsMaskType = {MaskResponse.MASK_TYPE_CHINESE_NAME}) + public Result> getTopicList(@LoginUser TokenDto tokenDto, @RequestBody YtTopicPageFormDTO topicPageFormDTO) { + topicPageFormDTO.setUserId(tokenDto.getUserId()); + if (NumConstant.ZERO_STR.equals(topicPageFormDTO.getSource())) { + ValidatorUtils.validateEntity(topicPageFormDTO); + } + return new Result>().ok(ytTopicService.getTopicList(tokenDto, topicPageFormDTO)); + } + + /** + * 话题详情评论列表 + * + * @Param tokenDto + * @Param queryCommentFormDTO + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2023/1/30 16:57 + */ + @PostMapping("topicCommentList") + public Result> getTopiCommentList(@LoginUser TokenDto tokenDto, @RequestBody YtTopicDetailFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(ytTopicService.getTopicCommentList(tokenDto, formDTO)); + } + + /** + * 评论话题 + * + * @Param tokenDto + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2023/1/30 17:06 + */ + @PostMapping("topicComment") + @NoRepeatSubmit + public Result topiComment(@LoginUser TokenDto tokenDto, @RequestBody YtTopicCommentFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + ytTopicService.topicComment(tokenDto, formDTO); + return new Result(); + } + + /** + * 话题投票 + * + * @Param tokenDto + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2023/1/30 17:08 + */ + @PostMapping("topicVote") + @NoRepeatSubmit + public Result topicVote(@LoginUser TokenDto tokenDto, @RequestBody YtTopicVoteFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + ytTopicService.topicVote(tokenDto, formDTO); + return new Result(); + } + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/YtTopicAttachmentDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/YtTopicAttachmentDao.java new file mode 100644 index 0000000000..332f1ce641 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/YtTopicAttachmentDao.java @@ -0,0 +1,16 @@ +package com.epmet.modules.topic.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.topic.entity.YtTopicAttachmentEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 烟台话题附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-01-30 + */ +@Mapper +public interface YtTopicAttachmentDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/YtTopicCommentAttachmentDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/YtTopicCommentAttachmentDao.java new file mode 100644 index 0000000000..25ba6fe8a0 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/YtTopicCommentAttachmentDao.java @@ -0,0 +1,16 @@ +package com.epmet.modules.topic.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.topic.entity.YtTopicCommentAttachmentEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 烟台话题评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-01-30 + */ +@Mapper +public interface YtTopicCommentAttachmentDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/YtTopicCommentDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/YtTopicCommentDao.java new file mode 100644 index 0000000000..2167e676cf --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/YtTopicCommentDao.java @@ -0,0 +1,29 @@ +package com.epmet.modules.topic.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.topic.entity.YtTopicCommentEntity; +import com.epmet.resi.group.dto.topic.form.YtTopicDetailFormDTO; +import com.epmet.resi.group.dto.topic.result.YtTopicCommentResultDTO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 烟台话题评论表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-01-30 + */ +@Mapper +public interface YtTopicCommentDao extends BaseDao { + + /** + * 获取评论列表 + * + * @Param formDTO + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2023/1/31 14:11 + */ + List selectCommentList(YtTopicDetailFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/YtTopicDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/YtTopicDao.java new file mode 100644 index 0000000000..42cf49bcd1 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/YtTopicDao.java @@ -0,0 +1,28 @@ +package com.epmet.modules.topic.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.topic.entity.YtTopicEntity; +import com.epmet.resi.group.dto.topic.form.YtTopicPageFormDTO; +import com.epmet.resi.group.dto.topic.result.YtTopicInfoResultDTO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 烟台话题信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-01-30 + */ +@Mapper +public interface YtTopicDao extends BaseDao { + /** + * 话题列表 + * + * @Param topicPageFormDTO + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2023/1/31 13:52 + */ + List selectTopicList(YtTopicPageFormDTO topicPageFormDTO); +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/YtTopicVoteDetailDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/YtTopicVoteDetailDao.java new file mode 100644 index 0000000000..c947aef1fc --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/YtTopicVoteDetailDao.java @@ -0,0 +1,16 @@ +package com.epmet.modules.topic.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.topic.entity.YtTopicVoteDetailEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 话题表决记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-01-30 + */ +@Mapper +public interface YtTopicVoteDetailDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/YtTopicAttachmentEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/YtTopicAttachmentEntity.java new file mode 100644 index 0000000000..b7da282f42 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/YtTopicAttachmentEntity.java @@ -0,0 +1,61 @@ +package com.epmet.modules.topic.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 烟台话题附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-01-30 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("yt_topic_attachment") +public class YtTopicAttachmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 话题Id,关联resi_topic的id + */ + private String topicId; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/YtTopicCommentAttachmentEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/YtTopicCommentAttachmentEntity.java new file mode 100644 index 0000000000..687b276579 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/YtTopicCommentAttachmentEntity.java @@ -0,0 +1,79 @@ +package com.epmet.modules.topic.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-01-30 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("yt_topic_comment_attachment") +public class YtTopicCommentAttachmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 话题Id + */ + private String topicId; + + /** + * 评论Id + */ + private String topicCommentId; + + /** + * 文件名 + */ + private String fileName; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件大小,单位b + */ + private Integer attachmentSize; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/YtTopicCommentEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/YtTopicCommentEntity.java new file mode 100644 index 0000000000..52a60634d2 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/YtTopicCommentEntity.java @@ -0,0 +1,41 @@ +package com.epmet.modules.topic.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 烟台话题评论表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-01-30 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("yt_topic_comment") +public class YtTopicCommentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 话题Id,来自resi_topic + */ + private String topicId; + + /** + * + */ + private String commentContent; + + /** + * 评论状态:讨论中:discussing;已屏蔽 :hidden + */ + private String status; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/YtTopicEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/YtTopicEntity.java new file mode 100644 index 0000000000..df7773368d --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/YtTopicEntity.java @@ -0,0 +1,101 @@ +package com.epmet.modules.topic.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 烟台话题信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-01-30 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("yt_topic") +public class YtTopicEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格所有上级组织ID + */ + private String pids; + + /** + * + */ + private String topicContent; + + /** + * 话题状态(讨论中 - discussing、 已屏蔽 - hidden、 已关闭 - closed) + */ + private String status; + + /** + * 关闭状态:已解决 resolved,未解决 unresolved + */ + private String closedStatus; + + /** + * 省 + */ + private String province; + + /** + * 市 + */ + private String city; + + /** + * 区 + */ + private String area; + + /** + * 地址 + */ + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 维度 + */ + private String latitude; + + /** + * 定位地址 + */ + private String locateAddress; + + /** + * 定位经度 + */ + private String locateLongitude; + + /** + * 定位维度 + */ + private String locateLatitude; + + /** + * 话题发表人姓名 + */ + private String userName; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/YtTopicVoteDetailEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/YtTopicVoteDetailEntity.java new file mode 100644 index 0000000000..837b34641a --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/YtTopicVoteDetailEntity.java @@ -0,0 +1,36 @@ +package com.epmet.modules.topic.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 话题表决记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-01-30 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("yt_topic_vote_detail") +public class YtTopicVoteDetailEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 话题ID + */ + private String topicId; + + /** + * 态度 - opposition(反对)support(赞成) + */ + private String attitude; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/YtTopicService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/YtTopicService.java new file mode 100644 index 0000000000..23741a8a09 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/YtTopicService.java @@ -0,0 +1,85 @@ +package com.epmet.modules.topic.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.modules.topic.entity.YtTopicEntity; +import com.epmet.resi.group.dto.topic.form.*; +import com.epmet.resi.group.dto.topic.result.YtTopicCommentResultDTO; +import com.epmet.resi.group.dto.topic.result.YtTopicDetailResultDTO; +import com.epmet.resi.group.dto.topic.result.YtTopicInfoResultDTO; + +/** + * 烟台话题信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-01-30 + */ +public interface YtTopicService extends BaseService { + + /** + * 发布话题 + * + * @Param tokenDto + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2023/1/30 16:18 + */ + void createTopic(CreateYtTopicFormDTO formDTO); + + /** + * 话题详情 + * + * @Param tokenDto + * @Param formDTO + * @Return {@link YtTopicDetailResultDTO} + * @Author zhaoqifeng + * @Date 2023/1/30 16:39 + */ + YtTopicDetailResultDTO getTopicDetail(YtTopicDetailFormDTO formDTO); + + /** + * 话题列表 + * + * @Param tokenDto + * @Param topicPageFormDTO + * @Return {@link PageData} + * @Author zhaoqifeng + * @Date 2023/1/30 16:56 + */ + PageData getTopicList(TokenDto tokenDto, YtTopicPageFormDTO topicPageFormDTO); + + /** + * 话题详情评论列表 + * + * @Param tokenDto + * @Param formDTO + * @Return {@link PageData} + * @Author zhaoqifeng + * @Date 2023/1/30 17:02 + */ + PageData getTopicCommentList(TokenDto tokenDto, YtTopicDetailFormDTO formDTO); + + /** + * 评论话题 + * + * @Param tokenDto + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2023/1/30 17:05 + */ + void topicComment(TokenDto tokenDto, YtTopicCommentFormDTO formDTO); + + /** + * 话题投票 + * + * @Param tokenDto + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2023/1/30 17:08 + */ + void topicVote(TokenDto tokenDto, YtTopicVoteFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java index 1592aa0fe7..eeda789667 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java @@ -1797,38 +1797,10 @@ public class ResiTopicServiceImpl extends BaseServiceImpl textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScan); - if (!textSyncScanResult.success()) { - throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); - } else { - if (!textSyncScanResult.getData().isAllPass()) { - log.error(String.format(TopicConstant.SHIFT_ISSUE, issueTitle, suggestion)); - throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); - } - } - } + // 是否已经转议题? + checkShiftedIssue(topicTurnIssueFromDTO.getTopicId()); + // 话题转议题审核:标题、建议 + scanIssueContent(topicTurnIssueFromDTO.getIssueTitle(),topicTurnIssueFromDTO.getSuggestion()); FirstTopicShiftedToIssueApplicationResultDTO result = null; //1.统一时间(群组服务 -> 议题服务) @@ -1856,6 +1828,9 @@ public class ResiTopicServiceImpl extends BaseServiceImpl issueResult = issueOpenFeignClient.topicShiftedToIssueV2(issueInfo); if (issueResult == null || !issueResult.success() || null == issueResult.getData()) { @@ -1994,6 +1969,53 @@ public class ResiTopicServiceImpl extends BaseServiceImpl result = govIssueFeignClient.checkTopicShiftIssue(topicInfoFormDTO); + if (result.success()) { + Integer issueCount = result.getData(); + if (issueCount != NumConstant.ZERO) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), ModuleConstant.ALREADY_SHIFT_ISSUE, ModuleConstant.ALREADY_SHIFT_ISSUE); + } + } + } + + /** + * 审核提出来 + * @param issueTitle + * @param suggestion + */ + private void scanIssueContent(String issueTitle, String suggestion) { + //话题转议题审核:标题、建议 + if (StringUtils.isNotBlank(issueTitle) || StringUtils.isNotBlank(suggestion)) { + TextScanParamDTO textScan = new TextScanParamDTO(); + //标题 + TextTaskDTO taskTitle = new TextTaskDTO(); + taskTitle.setContent(issueTitle); + taskTitle.setDataId(UUID.randomUUID().toString().replace("-", "")); + textScan.getTasks().add(taskTitle); + //建议 + TextTaskDTO taskSuggestion = new TextTaskDTO(); + taskSuggestion.setDataId(UUID.randomUUID().toString().replace("-", "")); + taskSuggestion.setContent(suggestion); + textScan.getTasks().add(taskSuggestion); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScan); + if (!textSyncScanResult.success()) { + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + log.error(String.format(TopicConstant.SHIFT_ISSUE, issueTitle, suggestion)); + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + } + } + } + } + /** * @Description 工作端审核议题通过时获取一些议题相关信息 * @param param @@ -2019,7 +2041,9 @@ public class ResiTopicServiceImpl extends BaseServiceImpl implements YtTopicService { + + @Resource + private YtTopicAttachmentDao ytTopicAttachmentDao; + @Resource + private YtTopicCommentDao ytTopicCommentDao; + @Resource + private YtTopicCommentAttachmentDao ytTopicCommentAttachmentDao; + @Resource + private YtTopicVoteDetailDao ytTopicVoteDetailDao; + + /** + * 发布话题 + * + * @Param tokenDto + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2023/1/30 16:18 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void createTopic(CreateYtTopicFormDTO formDTO) { + if(StringUtils.isBlank(formDTO.getTopicContent()) && CollectionUtils.isEmpty(formDTO.getVoiceList())) { + //话题内容和语音不能同时为空 + log.error(ModuleConstant.TOPIC_CONTENT_AND_VOICE_IS_NULL); + throw new EpmetException(ModuleConstant.TOPIC_CONTENT_AND_VOICE_IS_NULL); + } + //1.保存话题 + YtTopicEntity topic = ConvertUtils.sourceToTarget(formDTO, YtTopicEntity.class); + //如果只有语音,则话题内容为语音话题 + if (CollectionUtils.isNotEmpty(formDTO.getVoiceList()) && StringUtils.isBlank(formDTO.getTopicContent())) { + topic.setTopicContent("语音话题"); + } + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(formDTO.getGridId()); + if (null == gridInfo) { + String msg = "获取网格信息失败"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg); + } + ResiUserInfoCache userInfo = CustomerResiUserRedis.getUserBaseInfo(formDTO.getUserId()); + if (null == userInfo) { + String msg = "获取用户信息失败"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg); + } + topic.setCustomerId(formDTO.getCustomerId()); + topic.setStatus(TopicConstant.PUBLISHMENT); + topic.setPids(gridInfo.getPids()); + topic.setUserName(userInfo.getRealName()); + baseDao.insert(topic); + + //保存图片附件 + if(CollectionUtils.isNotEmpty(formDTO.getImageList())){ + int sort = 0; + for(String url : formDTO.getImageList()){ + YtTopicAttachmentEntity attachment = new YtTopicAttachmentEntity(); + attachment.setCustomerId(formDTO.getCustomerId()); + attachment.setAttachmentUrl(url); + attachment.setTopicId(topic.getId()); + attachment.setAttachmentFormat(url.substring(url.lastIndexOf(".") + NumConstant.ONE).toLowerCase()); + attachment.setSort(sort++); + attachment.setAttachmentType(TopicConstant.IMAGE); + ytTopicAttachmentDao.insert(attachment); + } + } + + //保存语音附件 + if(CollectionUtils.isNotEmpty(formDTO.getVoiceList())){ + int sort = 0; + for(FileDTO file : formDTO.getVoiceList()){ + YtTopicAttachmentEntity attachment = new YtTopicAttachmentEntity(); + attachment.setCustomerId(formDTO.getCustomerId()); + attachment.setAttachmentUrl(file.getUrl()); + attachment.setTopicId(topic.getId()); + attachment.setCreatedBy(formDTO.getUserId()); + attachment.setAttachmentFormat(file.getUrl().substring(file.getUrl().lastIndexOf(".") + NumConstant.ONE).toLowerCase()); + attachment.setSort(sort++); + attachment.setAttachmentType(TopicConstant.VOICE); + attachment.setDuration(file.getDuration()); + ytTopicAttachmentDao.insert(attachment); + } + } + + + + } + + /** + * 话题详情 + * + * @Param formDTO + * @Return {@link YtTopicDetailResultDTO} + * @Author zhaoqifeng + * @Date 2023/1/30 16:39 + */ + @Override + public YtTopicDetailResultDTO getTopicDetail(YtTopicDetailFormDTO formDTO) { + //1.查询话题信息 + YtTopicEntity entity = baseDao.selectById(formDTO.getTopicId()); + if(null == entity){ + log.error(ModuleConstant.NO_SUCH_TOPIC); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), ModuleConstant.NO_SUCH_TOPIC, ModuleConstant.NO_SUCH_TOPIC); + } + YtTopicDetailResultDTO result = ConvertUtils.sourceToTarget(entity, YtTopicDetailResultDTO.class); + result.setTopicId(formDTO.getTopicId()); + result.setTopicStatus(entity.getStatus()); + result.setReleaseTime(DateUtils.format(entity.getCreatedTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE)); + result.setReleaseAddress(entity.getAddress()); + + //2.查询话题图片附件 + LambdaQueryWrapper imgWrapper = new LambdaQueryWrapper<>(); + imgWrapper.eq(YtTopicAttachmentEntity::getTopicId, formDTO.getTopicId()); + imgWrapper.eq(YtTopicAttachmentEntity::getAttachmentType, TopicConstant.IMAGE); + imgWrapper.orderByAsc(YtTopicAttachmentEntity::getSort); + List imgList = ytTopicAttachmentDao.selectList(imgWrapper); + if (CollectionUtils.isNotEmpty(imgList)) { + List imageUrls = imgList.stream().map(YtTopicAttachmentEntity::getAttachmentUrl).collect(Collectors.toList()); + result.setTopicImages(imageUrls); + } + + //3.查询话题音频附件 + LambdaQueryWrapper voiceWrapper = new LambdaQueryWrapper<>(); + voiceWrapper.eq(YtTopicAttachmentEntity::getTopicId, formDTO.getTopicId()); + voiceWrapper.eq(YtTopicAttachmentEntity::getAttachmentType, TopicConstant.VOICE); + voiceWrapper.orderByAsc(YtTopicAttachmentEntity::getSort); + List voiceList = ytTopicAttachmentDao.selectList(voiceWrapper); + if (CollectionUtils.isNotEmpty(voiceList)) { + List voiceUrls = voiceList.stream().map(item ->{ + FileDTO fileDTO = new FileDTO(); + fileDTO.setUrl(item.getAttachmentUrl()); + fileDTO.setDuration(item.getDuration()); + return fileDTO; + }).collect(Collectors.toList()); + result.setTopicVoices(voiceUrls); + } + + + //4.获取发布人信息 + ResiUserInfoCache userInfo = CustomerResiUserRedis.getUserBaseInfo(entity.getCreatedBy()); + if (null == userInfo) { + String msg = "获取发布人信息失败"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg); + } + result.setReleaseUserName(userInfo.getShowName()); + result.setReleaseUserHeadPhoto(userInfo.getHeadImgUrl()); + //5.获取投票信息 + result.setOppositionCount(NumConstant.ZERO_STR); + result.setSupportCount(NumConstant.ZERO_STR); + LambdaQueryWrapper voteWrapper = new LambdaQueryWrapper<>(); + voteWrapper.eq(YtTopicVoteDetailEntity::getTopicId, formDTO.getTopicId()); + List voteList = ytTopicVoteDetailDao.selectList(voteWrapper); + if (CollectionUtils.isNotEmpty(voteList)) { + Map voteMap = voteList.stream().collect(Collectors.groupingBy(YtTopicVoteDetailEntity::getAttitude, Collectors.counting())); + if (voteMap.containsKey(TopicConstant.OPPOSITION)) { + result.setOppositionCount(String.valueOf(voteMap.get(TopicConstant.OPPOSITION))); + } + if (voteMap.containsKey(TopicConstant.SUPPORT)) { + result.setSupportCount(String.valueOf(voteMap.get(TopicConstant.SUPPORT))); + } + } + voteWrapper.eq(YtTopicVoteDetailEntity::getCreatedBy, formDTO.getUserId()); + voteList = ytTopicVoteDetailDao.selectList(voteWrapper); + if (CollectionUtils.isNotEmpty(voteList)) { + result.setVoteStatus(voteList.get(NumConstant.ZERO).getAttitude()); + } else { + result.setVoteStatus(TopicConstant.NONE); + } + + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(entity.getGridId()); + if (null != gridInfo) { + result.setGridName(gridInfo.getGridNamePath()); + } + + return result; + } + + /** + * 话题列表 + * + * @Param tokenDto + * @Param topicPageFormDTO + * @Return {@link PageData} + * @Author zhaoqifeng + * @Date 2023/1/30 16:56 + */ + @Override + public PageData getTopicList(TokenDto tokenDto, YtTopicPageFormDTO topicPageFormDTO) { + if (NumConstant.ONE_STR.equals(topicPageFormDTO.getSource())) { + if (StringUtils.isBlank(topicPageFormDTO.getGridId())) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + if (null == staffInfo) { + String msg = "获取工作人员信息失败"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg); + } + topicPageFormDTO.setAgencyId(staffInfo.getAgencyId()); + } + } + PageMethod.startPage(topicPageFormDTO.getPageNo(), topicPageFormDTO.getPageSize()); + List list = baseDao.selectTopicList(topicPageFormDTO); + PageInfo pageInfo = new PageInfo<>(list); + if (CollectionUtils.isNotEmpty(list)) { + list.forEach(item -> { + ResiUserInfoCache userInfo = CustomerResiUserRedis.getUserBaseInfo(item.getUserId()); + if (null != userInfo) { + item.setReleaseUserName(userInfo.getShowName()); + item.setReleaseUserHeadPhoto(userInfo.getHeadImgUrl()); + } + if (tokenDto.getUserId().equals(item.getUserId())) { + item.setReleaseUserFlag("me"); + } else { + item.setReleaseUserFlag("other"); + } + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(item.getGridId()); + if (null != gridInfo) { + item.setGridName(gridInfo.getGridNamePath()); + } + //获取附件图片 + LambdaQueryWrapper imgWrapper = new LambdaQueryWrapper<>(); + imgWrapper.eq(YtTopicAttachmentEntity::getTopicId, item.getTopicId()); + imgWrapper.eq(YtTopicAttachmentEntity::getAttachmentType, TopicConstant.IMAGE); + imgWrapper.orderByAsc(YtTopicAttachmentEntity::getSort); + imgWrapper.last("limit 3"); + List imgList = ytTopicAttachmentDao.selectList(imgWrapper); + if (CollectionUtils.isNotEmpty(imgList)) { + List imageUrls = imgList.stream().map(YtTopicAttachmentEntity::getAttachmentUrl).collect(Collectors.toList()); + item.setImageList(imageUrls); + } + }); + } + return new PageData<>(list, pageInfo.getTotal()); + } + + /** + * 话题详情评论列表 + * + * @Param tokenDto + * @Param formDTO + * @Return {@link PageData} + * @Author zhaoqifeng + * @Date 2023/1/30 17:02 + */ + @Override + public PageData getTopicCommentList(TokenDto tokenDto, YtTopicDetailFormDTO formDTO) { + PageMethod.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + List list = ytTopicCommentDao.selectCommentList(formDTO); + PageInfo pageInfo = new PageInfo<>(list); + if (CollectionUtils.isNotEmpty(list)) { + //获取评论附件信息 + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(YtTopicCommentAttachmentEntity::getTopicId, formDTO.getTopicId()); + List attachmentList = ytTopicCommentAttachmentDao.selectList(wrapper); + Map> map = new HashMap<>(); + if (CollectionUtils.isNotEmpty(attachmentList)) { + map = attachmentList.stream().sorted(Comparator.comparingInt(YtTopicCommentAttachmentEntity::getSort)) + .collect(Collectors.groupingBy(YtTopicCommentAttachmentEntity::getTopicCommentId, LinkedHashMap::new, Collectors.toList())); + } + Map> finalMap = map; + list.forEach(item -> { + ResiUserInfoCache userInfo = CustomerResiUserRedis.getUserBaseInfo(item.getUserId()); + if (null != userInfo) { + item.setCommentUserName(userInfo.getShowName()); + item.setCommentUserHeadPhoto(userInfo.getHeadImgUrl()); + } + if (finalMap.containsKey(item.getCommentId())) { + List fileList = finalMap.get(item.getCommentId()).stream().map(i -> { + CommentFileDTO file = new CommentFileDTO(); + file.setName(i.getAttachmentName()); + file.setUrl(i.getAttachmentUrl()); + file.setDuration(i.getDuration()); + file.setSize(i.getAttachmentSize()); + file.setFormat(i.getAttachmentFormat()); + file.setType(i.getAttachmentType()); + return file; + }).collect(Collectors.toList()); + item.setImageList(fileList); + } + }); + } + return new PageData<>(list, pageInfo.getTotal()); + } + + /** + * 评论话题 + * + * @Param tokenDto + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2023/1/30 17:05 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void topicComment(TokenDto tokenDto, YtTopicCommentFormDTO formDTO) { + YtTopicCommentEntity comment = ConvertUtils.sourceToTarget(formDTO, YtTopicCommentEntity.class); + comment.setStatus(TopicConstant.PUBLISHMENT); + comment.setCustomerId(tokenDto.getCustomerId()); + ytTopicCommentDao.insert(comment); + //保存评论附件 + //图片 + if (CollectionUtils.isNotEmpty(formDTO.getImageList())) { + AtomicInteger sort = new AtomicInteger(); + formDTO.getImageList().forEach(img -> { + YtTopicCommentAttachmentEntity attachment = new YtTopicCommentAttachmentEntity(); + attachment.setCustomerId(tokenDto.getCustomerId()); + attachment.setTopicId(formDTO.getTopicId()); + attachment.setTopicCommentId(comment.getId()); + attachment.setFileName(img.getName()); + attachment.setAttachmentName(""); + attachment.setAttachmentSize(img.getSize()); + attachment.setAttachmentFormat(img.getFormat()); + attachment.setAttachmentType(img.getType()); + attachment.setAttachmentUrl(img.getUrl()); + attachment.setSort(sort.get()); + attachment.setDuration(img.getDuration()); + sort.getAndIncrement(); + ytTopicCommentAttachmentDao.insert(attachment); + }); + } + } + + /** + * 话题投票 + * + * @Param tokenDto + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2023/1/30 17:08 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void topicVote(TokenDto tokenDto, YtTopicVoteFormDTO formDTO) { + YtTopicVoteDetailEntity entity = ConvertUtils.sourceToTarget(formDTO, YtTopicVoteDetailEntity.class); + entity.setCustomerId(tokenDto.getCustomerId()); + ytTopicVoteDetailDao.insert(entity); + } +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.28__yt_topic.sql b/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.28__yt_topic.sql new file mode 100644 index 0000000000..d73eeef70f --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.28__yt_topic.sql @@ -0,0 +1,94 @@ +CREATE TABLE `yt_topic` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) DEFAULT NULL COMMENT '客户ID', + `GRID_ID` varchar(64) DEFAULT NULL COMMENT '网格ID', + `PIDS` varchar(255) DEFAULT NULL COMMENT '网格所有上级组织ID', + `TOPIC_CONTENT` text COMMENT '话题内容', + `STATUS` varchar(32) NOT NULL COMMENT '话题状态(讨论中 - discussing、 已屏蔽 - hidden、 已关闭 - closed)', + `CLOSED_STATUS` varchar(32) DEFAULT NULL COMMENT '关闭状态:已解决 resolved,未解决 unresolved', + `PROVINCE` varchar(32) DEFAULT NULL COMMENT '省', + `CITY` varchar(32) DEFAULT NULL COMMENT '市', + `AREA` varchar(32) DEFAULT NULL COMMENT '区 ', + `ADDRESS` varchar(255) NOT NULL COMMENT '地址', + `LONGITUDE` varchar(32) DEFAULT NULL COMMENT '经度', + `LATITUDE` varchar(32) DEFAULT NULL COMMENT '维度', + `LOCATE_ADDRESS` varchar(255) DEFAULT NULL COMMENT '定位地址', + `LOCATE_LONGITUDE` varchar(32) DEFAULT NULL COMMENT '定位经度', + `LOCATE_LATITUDE` varchar(32) DEFAULT NULL COMMENT '定位维度', + `USER_NAME` varchar(20) DEFAULT NULL COMMENT '话题发表人姓名', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人,发布人Id来源于user', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='烟台话题信息表'; +CREATE TABLE `yt_topic_attachment` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) DEFAULT NULL COMMENT '客户ID', + `TOPIC_ID` varchar(64) NOT NULL COMMENT '话题Id,关联resi_topic的id', + `ATTACHMENT_NAME` varchar(64) DEFAULT NULL COMMENT '附件名(uuid随机生成)', + `ATTACHMENT_FORMAT` varchar(64) DEFAULT NULL COMMENT '文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS)', + `ATTACHMENT_TYPE` varchar(64) DEFAULT NULL COMMENT '附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc))', + `ATTACHMENT_URL` varchar(255) NOT NULL COMMENT '附件地址', + `SORT` int(1) NOT NULL COMMENT '排序字段', + `DURATION` int(11) unsigned zerofill DEFAULT '00000000000' COMMENT '语音或视频时长,秒', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE, + KEY `idx_topic_id` (`TOPIC_ID`) USING BTREE COMMENT '话题主键' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='烟台话题附件表'; +CREATE TABLE `yt_topic_comment` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) DEFAULT NULL COMMENT '客户ID', + `TOPIC_ID` varchar(64) NOT NULL COMMENT '话题Id,来自resi_topic', + `COMMENT_CONTENT` varchar(300) DEFAULT NULL, + `STATUS` varchar(32) DEFAULT NULL COMMENT '评论状态:讨论中:discussing;已屏蔽 :hidden', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人,评论人Id,来自user', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='烟台话题评论表'; +CREATE TABLE `yt_topic_comment_attachment` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `TOPIC_ID` varchar(64) NOT NULL COMMENT '话题Id', + `TOPIC_COMMENT_ID` varchar(64) NOT NULL COMMENT '评论Id', + `FILE_NAME` varchar(255) DEFAULT NULL COMMENT '文件名', + `ATTACHMENT_NAME` varchar(64) DEFAULT NULL COMMENT '附件名(uuid随机生成)', + `ATTACHMENT_SIZE` int(11) DEFAULT NULL COMMENT '文件大小,单位b', + `ATTACHMENT_FORMAT` varchar(64) DEFAULT NULL COMMENT '文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS)', + `ATTACHMENT_TYPE` varchar(64) DEFAULT NULL COMMENT '附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc))', + `ATTACHMENT_URL` varchar(255) NOT NULL COMMENT '附件地址', + `SORT` int(1) NOT NULL COMMENT '排序字段', + `DURATION` int(11) unsigned zerofill DEFAULT '00000000000' COMMENT '语音或视频时长,秒', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='烟台话题评论附件表'; +CREATE TABLE `yt_topic_vote_detail` ( + `ID` varchar(32) NOT NULL COMMENT '主键ID', + `CUSTOMER_ID` varchar(64) DEFAULT NULL COMMENT '客户ID', + `TOPIC_ID` varchar(32) NOT NULL COMMENT '话题ID', + `ATTITUDE` varchar(32) NOT NULL COMMENT '态度 - opposition(反对)support(赞成)', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`), + KEY `idx_topic_id` (`TOPIC_ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='话题表决记录表'; \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml index 2610b429eb..c5ebbc64ea 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml @@ -400,7 +400,10 @@ groupp.ID AS groupId, IFNULL(groupp.GRID_ID,'') AS gridId, IFNULL(groupp.CUSTOMER_ID,'') AS customerId, - topic.CREATED_BY AS topicAuthorId + topic.CREATED_BY AS topicAuthorId, + topic.LOCATE_ADDRESS as locateAddress, + topic.LOCATE_LONGITUDE as locateLongitude, + topic.LOCATE_DIMENSION as locateDimension FROM RESI_TOPIC topic INNER JOIN RESI_GROUP groupp ON topic.GROUP_ID = groupp.ID diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/YtTopicAttachmentDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/YtTopicAttachmentDao.xml new file mode 100644 index 0000000000..1ce30b7819 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/YtTopicAttachmentDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/YtTopicCommentAttachmentDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/YtTopicCommentAttachmentDao.xml new file mode 100644 index 0000000000..7046356677 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/YtTopicCommentAttachmentDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/YtTopicCommentDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/YtTopicCommentDao.xml new file mode 100644 index 0000000000..8751ea8bb9 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/YtTopicCommentDao.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/YtTopicDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/YtTopicDao.xml new file mode 100644 index 0000000000..1d922ef955 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/YtTopicDao.xml @@ -0,0 +1,36 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/YtTopicVoteDetailDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/YtTopicVoteDetailDao.xml new file mode 100644 index 0000000000..81277dd963 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/YtTopicVoteDetailDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/form/IssueDetailFormDTO.java b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/form/IssueDetailFormDTO.java index 84b0d8f5e6..22e0323ed6 100644 --- a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/form/IssueDetailFormDTO.java +++ b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/form/IssueDetailFormDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -13,8 +14,9 @@ import java.io.Serializable; @Data public class IssueDetailFormDTO implements Serializable { private static final long serialVersionUID = 4859779755214503489L; - - @NotBlank(message = "议题id不能为空") + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + @NotBlank(message = "议题id不能为空",groups = AddUserShowGroup.class) private String issueId; } diff --git a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/controller/IssueController.java b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/controller/IssueController.java index 881b45bb13..fe7136134b 100644 --- a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/controller/IssueController.java +++ b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/controller/IssueController.java @@ -36,7 +36,7 @@ public class IssueController { @PostMapping(value = "/detail") // @RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_ISSUE_DETAIL) public Result detail(@LoginUser TokenDto tokenDto,@RequestBody IssueDetailFormDTO issueDetail){ - ValidatorUtils.validateEntity(issueDetail); + ValidatorUtils.validateEntity(issueDetail,IssueDetailFormDTO.AddUserShowGroup.class); return new Result().ok(issueService.detail(tokenDto,issueDetail)); } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/BadgeController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/BadgeController.java index e11c3cd8a6..8c6da67576 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/BadgeController.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/BadgeController.java @@ -1,6 +1,7 @@ package com.epmet.modules.person.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -63,8 +64,10 @@ public class BadgeController { * @author zxc * @date 2020/11/4 11:16 上午 */ + @NoRepeatSubmit @PostMapping("certification/add") public Result certificationAdd(@LoginUser TokenDto tokenDto,@RequestBody CertificationAddFormDTO certificationAddFormDTO){ + certificationAddFormDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(certificationAddFormDTO, CertificationAddFormDTO.CertificationAdd.class); return badgeService.certificationAdd(tokenDto,certificationAddFormDTO); } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/BadgeServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/BadgeServiceImpl.java index 40433eae67..9f98136a82 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/BadgeServiceImpl.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/BadgeServiceImpl.java @@ -85,7 +85,6 @@ public class BadgeServiceImpl implements BadgeService { */ @Override public Result certificationAdd(TokenDto tokenDto, CertificationAddFormDTO certificationAddFormDTO) { - certificationAddFormDTO.setUserId(tokenDto.getUserId()); Result result = epmetUserOpenFeignClient.authBadgeRecord(certificationAddFormDTO); return result; } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java index a980778c64..2aa897402d 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java @@ -114,17 +114,20 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService UserResiInfoFormDTO userResiInfoFormDTO = new UserResiInfoFormDTO(); userResiInfoFormDTO.setCustomerId(fromDto.getCustomerId()); userResiInfoFormDTO.setUserId(fromDto.getUserId()); - UserResiInfoResultDTO userResiInfoResult = epmetUserFeignClient.getUserResiInfoDTO(userResiInfoFormDTO).getData(); - if (null != userResiInfoResult) { - PartymemberInfoDTO partyMemberInfo = ConvertUtils.sourceToTarget(userResiInfoResult, - PartymemberInfoDTO.class); - partyMemberInfo.setId(""); - partyMemberInfo.setMobile(userResiInfoResult.getRegMobile()); - partyMemberInfo.setEstate(userResiInfoResult.getDistrict()); - partyMemberInfo.setBuilding(userResiInfoResult.getBuildingAddress()); - result.setPartyMemberInfo(partyMemberInfo); + Result res = epmetUserFeignClient.getUserResiInfoDTO(userResiInfoFormDTO); + if (res.success() && null != res) { + UserResiInfoResultDTO userResiInfoResult = res.getData(); + if (null != userResiInfoResult) { + PartymemberInfoDTO partyMemberInfo = ConvertUtils.sourceToTarget(userResiInfoResult, + PartymemberInfoDTO.class); + partyMemberInfo.setId(""); + partyMemberInfo.setMobile(userResiInfoResult.getRegMobile()); + partyMemberInfo.setEstate(userResiInfoResult.getDistrict()); + partyMemberInfo.setBuilding(userResiInfoResult.getBuildingAddress()); + partyMemberInfo.setIdCard(userResiInfoResult.getIdNum()); + result.setPartyMemberInfo(partyMemberInfo); + } } - } // 将访问行为存入热心居民申请行为记录表 String visitId = saveOrUpdateVisit(null, fromDto, PartyMemberConstant.OPERATE_INITIALIZE); diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/BadgeConstant.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/BadgeConstant.java index 5d461dbe41..204ba9650b 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/BadgeConstant.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/BadgeConstant.java @@ -36,7 +36,7 @@ public interface BadgeConstant { String GET_BADGE_NAME_FAILURE = "获取徽章名称失败......"; - String MESSAGE_CONTENT = "您有一条徽章认证消,,%s申请认证%s,请审核"; + String MESSAGE_CONTENT = "您有一条徽章认证消息,,%s申请认证%s,请审核"; String READ_FLAG = "unread"; diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AdviceListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AdviceListFormDTO.java index 39ca1de27d..9bf7351837 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AdviceListFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AdviceListFormDTO.java @@ -1,8 +1,11 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; /** * @description: @@ -11,9 +14,15 @@ import javax.validation.constraints.Min; */ @Data public class AdviceListFormDTO { + /** + * 工作端pc调用此接口,校验参数 + */ + public interface WorkPcGroup extends CustomerClientShowGroup { + } /** * 客户id 不填查询所有 */ + @NotBlank(message = "customerId不能为空",groups = WorkPcGroup.class) private String customerId; /** @@ -21,6 +30,11 @@ public class AdviceListFormDTO { */ private String agencyId; + /** + * 网格id + */ + private String gridId; + /** * 是否被回复,0未回复,1回复, 传空查询所有 */ @@ -44,12 +58,14 @@ public class AdviceListFormDTO { /** * 页码 */ + @NotNull(message = "pageNo不能为空",groups = WorkPcGroup.class) @Min(1) - private int pageNo; + private Integer pageNo; /** * 页大小 */ + @NotNull(message = "pageSize不能为空",groups = WorkPcGroup.class) @Min(1) - private int pageSize; + private Integer pageSize; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeAuditFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeAuditFormDTO.java index c3748fe49f..9803eb3c25 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeAuditFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeAuditFormDTO.java @@ -20,4 +20,9 @@ public class BadgeAuditFormDTO implements Serializable { @NotBlank(message = "审核结果不能为空") private String auditStatus; private String auditRemark; + + /** + * tokenDto.getUserId + */ + private String currentUserId; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationAddFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationAddFormDTO.java index da021d64f0..85ed907b4a 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationAddFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationAddFormDTO.java @@ -65,4 +65,20 @@ public class CertificationAddFormDTO implements Serializable { */ private String code; + /** + * 是否需要发送站内信: + * 您有一条徽章认证消息,,%s申请认证%s,请审核 + * true:发送 + * false:不发送 + * 微信小程序发送 + * 烟台钉钉自动通过,默认false不发送 + */ + private Boolean sendMsgFlag; + + /** + * 自动通过标识 + * true:自动通过,目前只有烟台这么搞 + */ + private Boolean autoPassFlag; + } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PageRegUserFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PageRegUserFormDTO.java new file mode 100644 index 0000000000..fa4fb4878c --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PageRegUserFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 来源于烟台需求,pc端新增菜单:用户完善信息列表 + * @Author yzm + * @Date 2023/1/31 14:37 + */ +@Data +public class PageRegUserFormDTO extends PageFormDTO implements Serializable { + private String agencyId; + private String gridId; + private String regStartTime; + private String regEndTime; + private String name; + + /** + * 查询详情时也调用此接口 + */ + private String userId; +} + diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ReplyAdviceFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ReplyAdviceFormDTO.java index f353919247..a602634f6f 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ReplyAdviceFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ReplyAdviceFormDTO.java @@ -24,4 +24,15 @@ public class ReplyAdviceFormDTO implements Serializable { private List govImgList; private String govContent; + + /** + * 回复人id + * 工作端回复:customer_staff.user_id + * 运营端回复:oper_user.user_id + */ + private String replyUserId; + /** + * 政府端:gov、居民端:resi、运营端:oper + */ + private String app; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinePieFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinePieFormDTO.java new file mode 100644 index 0000000000..f1374ada46 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinePieFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.form;/** + * @author ZhaoQiFeng + * @date 2023/2/2 + * @apiNote + */ + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2023/2/2 15:20 + */ +@Data +public class VaccinePieFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + private String customerId; + private String agencyId; + private String gridId; + /** + * 接种次数 + */ + private String vaccineCount; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/ResiUserBaseInfoResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/ResiUserBaseInfoResultDTO.java index 5fb44fd6af..59ffdc648c 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/ResiUserBaseInfoResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/ResiUserBaseInfoResultDTO.java @@ -1,7 +1,10 @@ package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.io.Serializable; +import java.util.Date; /** * 用户基础信息 返回值 @@ -73,4 +76,19 @@ public class ResiUserBaseInfoResultDTO implements Serializable { * 头像(目前来源于微信,后续系统顾客支持上传头像) */ private String headImgUrl; + + /** + * 注册时间 + * user_Base_info.CREATED_TIME + * register_relation.CREATED_TIME + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date regTime; + + /** + * 用户完善信息列表返回 + */ + private String gridId; + private String agencyId; + private String showIdNum; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserResiInfoResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserResiInfoResultDTO.java index a4be7e8745..4dc667ec51 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserResiInfoResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserResiInfoResultDTO.java @@ -59,4 +59,8 @@ public class UserResiInfoResultDTO implements Serializable { private String nickName; private String realName; + /** + * 身份证号 + */ + private String idNum; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinePieResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinePieResultDTO.java new file mode 100644 index 0000000000..59599b5261 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinePieResultDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.result;/** + * @author ZhaoQiFeng + * @date 2023/2/2 + * @apiNote + */ + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2023/2/2 15:20 + */ +@Data +public class VaccinePieResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + private String code; + private String value; + private String label; + private String ratio; + private String remark; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java index eace8b90b0..7f58178ffe 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java @@ -152,7 +152,8 @@ public class BadgeController { @NoRepeatSubmit public Result audit(@LoginUser TokenDto tokenDto, @RequestBody BadgeAuditFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); - badgeService.audit(tokenDto, formDTO); + formDTO.setCurrentUserId(tokenDto.getUserId()); + badgeService.audit(formDTO); return new Result(); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicPreventionController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicPreventionController.java index e00f730bfc..db0fa3b6c0 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicPreventionController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicPreventionController.java @@ -23,9 +23,12 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.EpidemicPreventionFormDTO; +import com.epmet.dto.form.VaccinePieFormDTO; import com.epmet.dto.result.EpidemicPreventionInfoDTO; import com.epmet.dto.result.EpidemicPreventionResultDTO; +import com.epmet.dto.result.VaccinePieResultDTO; import com.epmet.service.IcResiUserService; +import com.epmet.service.IcVaccineService; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -35,6 +38,7 @@ import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.util.List; /** @@ -50,6 +54,8 @@ public class IcEpidemicPreventionController{ @Resource private IcResiUserService icResiUserService; + @Resource + private IcVaccineService icVaccineService; /** @@ -112,4 +118,8 @@ public class IcEpidemicPreventionController{ return new Result().ok(result); } + @PostMapping("vaccinePie") + public Result> getVaccinePie(@LoginUser TokenDto tokenDto, @RequestBody VaccinePieFormDTO formDTO) { + return new Result>().ok(icVaccineService.getVaccinePie(tokenDto, formDTO)); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java index 8ad9e5da00..885099e001 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java @@ -17,8 +17,11 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; @@ -115,9 +118,11 @@ public class UserAdviceController { * @Date 2020/11/10 9:34 */ @PostMapping("replyadvice") - public Result replyAdvice(@RequestBody ReplyAdviceFormDTO dto) { + public Result replyAdvice(@LoginUser TokenDto tokenDto,@RequestBody ReplyAdviceFormDTO dto) { + dto.setReplyUserId(tokenDto.getUserId()); + dto.setApp(tokenDto.getApp()); ValidatorUtils.validateEntity(dto); - userAdviceService.replyAdvice(dto, loginUserUtil.getLoginUserId()); + userAdviceService.replyAdvice(dto); return new Result(); } @@ -145,8 +150,11 @@ public class UserAdviceController { * @Date 2020/11/10 9:32 */ @PostMapping("advicelist") - public Result> adviceList(@RequestBody AdviceListFormDTO dto) { - ValidatorUtils.validateEntity(dto); + public Result> adviceList(@LoginUser TokenDto tokenDto, @RequestBody AdviceListFormDTO dto) { + if (AppClientConstant.APP_GOV.equals(tokenDto.getApp())) { + //工作端调用,校验参数 + ValidatorUtils.validateEntity(dto, AdviceListFormDTO.WorkPcGroup.class); + } //校验时间 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java index e4ad4a63b0..637da83ce0 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java @@ -1,6 +1,7 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -56,6 +57,27 @@ public class UserBadgeController { */ @PostMapping("authbadgerecord") public Result authBadgeRecord(@RequestBody CertificationAddFormDTO certificationAddFormDTO){ + //发送微信站内信 + certificationAddFormDTO.setSendMsgFlag(true); + certificationAddFormDTO.setAutoPassFlag(false); + ValidatorUtils.validateEntity(certificationAddFormDTO, CertificationAddFormDTO.CertificationAdd.class); + return userBadgeService.authBadgeRecord(certificationAddFormDTO); + } + + /** + * 烟台钉钉居民端应用 + * + * @param tokenDto + * @param certificationAddFormDTO + * @return + */ + @NoRepeatSubmit + @PostMapping("certification/add-autopass") + public Result certificationAddAutoPass(@LoginUser TokenDto tokenDto, @RequestBody CertificationAddFormDTO certificationAddFormDTO) { + certificationAddFormDTO.setUserId(tokenDto.getUserId()); + certificationAddFormDTO.setSendMsgFlag(false); + // 是否自动通过 + certificationAddFormDTO.setAutoPassFlag(true); ValidatorUtils.validateEntity(certificationAddFormDTO, CertificationAddFormDTO.CertificationAdd.class); return userBadgeService.authBadgeRecord(certificationAddFormDTO); } @@ -82,6 +104,7 @@ public class UserBadgeController { */ @PostMapping("certification/detail") public Result certificationDetail(@LoginUser TokenDto tokenDto,@RequestBody CertificationDetailFormDTO certificationDetailFormDTO){ + certificationDetailFormDTO.setCustomerId(tokenDto.getCustomerId()); ValidatorUtils.validateEntity(certificationDetailFormDTO); return new Result().ok(userBadgeService.certificationDetail(tokenDto,certificationDetailFormDTO)); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java index edd488e9e4..252195a076 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java @@ -18,6 +18,8 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.annotation.MaskResponse; +import com.epmet.commons.tools.dto.form.PageFormDTO; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.bean.ResiUserInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; @@ -30,10 +32,7 @@ import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.RegisterRelationDTO; import com.epmet.dto.UserBaseInfoDTO; -import com.epmet.dto.form.CommonUserIdFormDTO; -import com.epmet.dto.form.DingLoginResiFormDTO; -import com.epmet.dto.form.IssueInitiatorFormDTO; -import com.epmet.dto.form.VolunteerRegResiFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.UserBaseInfoEntity; import com.epmet.excel.UserBaseInfoExcel; @@ -238,5 +237,16 @@ public class UserBaseInfoController { public Result dingResiLogin(@RequestBody DingLoginResiFormDTO formDTO){ return new Result().ok(userBaseInfoService.dingResiLogin(formDTO)); } + + /** + * 来源于烟台需求,pc端新增菜单:用户完善信息列表 + * @return + */ + @MaskResponse(fieldNames = { "showIdNum"}, fieldsMaskType = {MaskResponse.MASK_TYPE_ID_CARD }) + @PostMapping("page-reguser") + public Result> pageRegUser(@RequestBody PageRegUserFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class); + return new Result>().ok(userBaseInfoService.pageRegUser(formDTO)); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccineDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccineDao.java index a479866fea..ec6a1e07b6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccineDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccineDao.java @@ -6,9 +6,11 @@ import com.epmet.dto.IcVaccineDTO; import com.epmet.dto.YTVaccineListDTO; import com.epmet.dto.form.MyNatListFormDTO; import com.epmet.dto.form.VaccineListFormDTO; +import com.epmet.dto.form.VaccinePieFormDTO; import com.epmet.dto.result.IcVaccineListResultDTO; import com.epmet.dto.result.MyNatListResultDTO; import com.epmet.dto.result.RelationAndNatResultDTO; +import com.epmet.dto.result.VaccinePieResultDTO; import com.epmet.entity.IcVaccineEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -91,4 +93,6 @@ public interface IcVaccineDao extends BaseDao { List setDeleteByIdCard(@Param("idCard") String idCard,@Param("customerId") String customerId); + List getVaccinePieData(VaccinePieFormDTO formDTO); + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java index 3fd6a4f205..02409f8dac 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java @@ -19,6 +19,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.UserAdviceDTO; +import com.epmet.dto.form.AdviceListFormDTO; import com.epmet.dto.result.MyAdviceListResultDTO; import com.epmet.entity.UserAdviceEntity; import org.apache.ibatis.annotations.Mapper; @@ -37,11 +38,14 @@ public interface UserAdviceDao extends BaseDao { void replyAdvice(@Param("adviceId") String adviceId, @Param("replyContent") String replyContent, @Param("govContent") String govContent, - @Param("replyUserId") String loginUserId); + @Param("replyUserId") String replyUserId, + @Param("replyUserName")String replyUserName); List myAdviceList(@Param("pageSize") int pageSize, @Param("pageNo") int pageNo, @Param("userId") String loginUserId); int saveUserAdvice(UserAdviceDTO dto); + + List selectListAdvice(AdviceListFormDTO dto); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBaseInfoDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBaseInfoDao.java index b415ca67c8..01d7fa11d7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBaseInfoDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBaseInfoDao.java @@ -94,4 +94,12 @@ public interface UserBaseInfoDao extends BaseDao { String selectIdCard(String userId); UserBaseInfoEntity selectUserByMobile(@Param("customerId") String customerId, @Param("mobile")String mobile); + + List pageRegUser(@Param("customerId") String customerId, + @Param("agencyId") String agencyId, + @Param("gridId") String gridId, + @Param("name") String name, + @Param("regStartTime") String regStartTime, + @Param("regEndTime") String regEndTime, + @Param("userId") String userId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java index 0322d7b528..8b42599906 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java @@ -131,15 +131,19 @@ public class UserBaseInfoRedis { String gridFullName = gridInfoCache.getGridNamePath(); baseInfo.setRegisteredGridName(gridFullName); StringBuffer buffer = new StringBuffer(baseInfo.getSurname()); - switch (baseInfo.getGender()) { - case NumConstant.ONE_STR: - buffer.append(ModuleConstant.RESI_USER_NICKNAME_SUFFIX_MALE); - break; - case NumConstant.TWO_STR: - buffer.append(ModuleConstant.RESI_USER_NICKNAME_SUFFIX_FEMALE); - break; - default: - buffer.append(ModuleConstant.RESI_USER_NICKNAME_SUFFIX_GENDER_UNKNOWN); + if(StringUtils.isNotBlank(baseInfo.getGender())){ + switch (baseInfo.getGender()) { + case NumConstant.ONE_STR: + buffer.append(ModuleConstant.RESI_USER_NICKNAME_SUFFIX_MALE); + break; + case NumConstant.TWO_STR: + buffer.append(ModuleConstant.RESI_USER_NICKNAME_SUFFIX_FEMALE); + break; + default: + buffer.append(ModuleConstant.RESI_USER_NICKNAME_SUFFIX_GENDER_UNKNOWN); + } + }else{ + buffer.append(ModuleConstant.RESI_USER_NICKNAME_SUFFIX_GENDER_UNKNOWN); } baseInfo.setShowName(buffer.toString()); } @@ -179,7 +183,7 @@ public class UserBaseInfoRedis { } } } - + set(baseInfo); return baseInfo; } @@ -266,7 +270,7 @@ public class UserBaseInfoRedis { } } } - + set(baseInfo); return baseInfo; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java index 34defc0541..379d3c8fad 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java @@ -169,11 +169,10 @@ public interface BadgeService extends BaseService { * 审核 * @author zhaoqifeng * @date 2020/11/5 11:08 - * @param tokenDto * @param formDTO * @return void */ - void audit(TokenDto tokenDto, BadgeAuditFormDTO formDTO); + void audit(BadgeAuditFormDTO formDTO); void testCache(); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVaccineService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVaccineService.java index 609297b255..37e64b8f35 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVaccineService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVaccineService.java @@ -2,12 +2,15 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.IcVaccineDTO; import com.epmet.dto.form.AddIcVaccineFormDTO; import com.epmet.dto.form.IcVaccineFormDTO; import com.epmet.dto.form.VaccineListFormDTO; +import com.epmet.dto.form.VaccinePieFormDTO; import com.epmet.dto.result.IcVaccineListResultDTO; import com.epmet.dto.result.VaccineListDTO; +import com.epmet.dto.result.VaccinePieResultDTO; import com.epmet.entity.IcVaccineEntity; import java.nio.file.Path; @@ -70,4 +73,15 @@ public interface IcVaccineService extends BaseService { void del(IcVaccineFormDTO formDTO); void initVaccineLocal(); + + /** + * 辖区疫苗接种情况 + * + * @Param tokenDto + * @Param formDTO + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2023/2/2 15:35 + */ + List getVaccinePie(TokenDto tokenDto, VaccinePieFormDTO formDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/OperUserService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/OperUserService.java index 4aff1ed012..852192ceb0 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/OperUserService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/OperUserService.java @@ -107,4 +107,11 @@ public interface OperUserService extends BaseService { * @param dto */ void updatePwd(String userId, PasswordDTO dto); + + /** + * 查询运营人员信息 + * @param userId + * @return + */ + OperUserDTO getOperUserDTO(String userId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java index 4bfc5d5307..7edb2de544 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java @@ -102,12 +102,11 @@ public interface UserAdviceService extends BaseService { /** * @Description 回复建议 * @param dto - * @param loginUserId * @return void * @Author liushaowen * @Date 2020/11/6 16:44 */ - void replyAdvice(ReplyAdviceFormDTO dto, String loginUserId); + void replyAdvice(ReplyAdviceFormDTO dto); /** * @Description 建议详情 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java index ccd55f362c..b97e4aa3a8 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java @@ -25,6 +25,7 @@ import com.epmet.dto.RegisterRelationDTO; import com.epmet.dto.UserBaseInfoDTO; import com.epmet.dto.form.CommonUserIdFormDTO; import com.epmet.dto.form.DingLoginResiFormDTO; +import com.epmet.dto.form.PageRegUserFormDTO; import com.epmet.dto.form.VolunteerRegResiFormDTO; import com.epmet.dto.result.*; import com.epmet.entity.UserBaseInfoEntity; @@ -220,4 +221,11 @@ public interface UserBaseInfoService extends BaseService { * @Date 2022/9/15 11:17 */ DingLoginResiResDTO dingResiLogin(DingLoginResiFormDTO formDTO); + + /** + * 用户完善信息列表 + * @param formDTO + * @return + */ + PageData pageRegUser(PageRegUserFormDTO formDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java index 2a3809feb3..39359b29ea 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java @@ -356,32 +356,30 @@ public class BadgeServiceImpl extends BaseServiceImpl imp /** * 审核 * - * @param tokenDto token * @param formDTO 入参 * @return void * @author zhaoqifeng * @date 2020/11/5 11:08 */ @Override - public void audit(TokenDto tokenDto, BadgeAuditFormDTO formDTO) { + public void audit(BadgeAuditFormDTO formDTO) { if(BadgeConstant.REJECTED.equals(formDTO.getAuditStatus())) { if (StringUtils.isEmpty(formDTO.getAuditRemark())) { throw new ValidateException(EpmetErrorCode.CUSTOMER_VALIDATE_ERROR.getCode(), "驳回理由不能为空"); } } UserBadgeCertificateRecordDTO dto = userBadgeCertificateRecordService.get(formDTO.getRecordId()); - BadgeDetailResultDTO detail = baseDao.selectDetail(dto.getCustomerId(), dto.getBadgeId()); dto.setAuditStatus(formDTO.getAuditStatus()); dto.setAuditRemark(formDTO.getAuditRemark()); - dto.setStaffId(tokenDto.getUserId()); + dto.setStaffId(formDTO.getCurrentUserId()); dto.setIsLast(BadgeConstant.YES); dto.setAuditTime(new Date()); userBadgeCertificateRecordService.update(dto); + BadgeDetailResultDTO detail = baseDao.selectDetail(dto.getCustomerId(), dto.getBadgeId()); List msgList = new ArrayList<>(); List wxmpMsgList = new ArrayList<>(); if(BadgeConstant.APPROVED.equals(formDTO.getAuditStatus())) { - ResiUserBadgeDTO resiUserBadgeDTO = new ResiUserBadgeDTO(); resiUserBadgeDTO.setCustomerId(dto.getCustomerId()); resiUserBadgeDTO.setBadgeId(dto.getBadgeId()); @@ -435,12 +433,16 @@ public class BadgeServiceImpl extends BaseServiceImpl imp wxmp.setGridId(dto.getGridId()); wxmpMsgList.add(wxmp); } - messageFeignClient.saveUserMessageList(msgList); - log.info("徽章消息,开始推送微信订阅消息"); - Result result = epmetMessageOpenFeignClient.sendWxSubscribeMessage(wxmpMsgList); - if (!result.success()) { - log.error("徽章消息,发送微信订阅消息失败" + JSON.toJSONString(result)); - } + if(CollectionUtils.isNotEmpty(msgList)){ + messageFeignClient.saveUserMessageList(msgList); + } + if(CollectionUtils.isNotEmpty(wxmpMsgList)){ + log.info("徽章消息,开始推送微信订阅消息"); + Result result = epmetMessageOpenFeignClient.sendWxSubscribeMessage(wxmpMsgList); + if (!result.success()) { + log.error("徽章消息,发送微信订阅消息失败" + JSON.toJSONString(result)); + } + } } @Override diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVaccineServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVaccineServiceImpl.java index 0d6b3418bd..0e9c1faaf8 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVaccineServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVaccineServiceImpl.java @@ -16,6 +16,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.*; import com.epmet.constants.ImportTaskConstants; import com.epmet.dao.IcNatDao; @@ -53,9 +54,12 @@ import org.springframework.web.multipart.commons.CommonsMultipartFile; import java.io.IOException; import java.io.OutputStream; +import java.math.BigDecimal; +import java.math.RoundingMode; import java.nio.file.Files; import java.nio.file.Path; import java.util.*; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Collectors; /** @@ -601,6 +605,72 @@ public class IcVaccineServiceImpl extends BaseServiceImpl} + * @Author zhaoqifeng + * @Date 2023/2/2 15:35 + */ + @Override + public List getVaccinePie(TokenDto tokenDto, VaccinePieFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + if(org.apache.commons.lang3.StringUtils.isBlank(formDTO.getAgencyId())){ + //没有指定查询某个组织时,默认查询当前用户所属组织及下级 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + if (null != staffInfo) { + formDTO.setAgencyId(staffInfo.getAgencyId()); + } + } + List list = baseDao.getVaccinePieData(formDTO); + int total = 0; + if (CollectionUtils.isNotEmpty(list)) { + total = list.stream().mapToInt(item -> Integer.parseInt(item.getValue())).sum(); + AtomicBoolean flag = new AtomicBoolean(false); + int finalTotal = total; + list.forEach(item -> { + if (NumConstant.ZERO_STR.equals(item.getCode())) { + item.setLabel("未接种人数"); + item.setRemark("未接种"+ item.getValue() +"人"); + flag.set(true); + } else { + item.setLabel("接种" + item.getCode() + "针人数"); + item.setRemark("接种" + item.getCode() + "针" + item.getValue() + "人"); + } + BigDecimal radio = new BigDecimal("0.00"); + if (NumConstant.ZERO != finalTotal) { + BigDecimal sum = new BigDecimal(finalTotal); + BigDecimal count = new BigDecimal(item.getValue()); + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + radio = count.multiply(hundred).divide(sum, NumConstant.TWO, RoundingMode.HALF_UP); + } + item.setRatio(radio.stripTrailingZeros().toPlainString().concat("%")); + }); + if (!flag.get()) { + VaccinePieResultDTO dto = new VaccinePieResultDTO(); + dto.setLabel("未接种人数"); + dto.setCode(NumConstant.ZERO_STR); + dto.setValue(NumConstant.ZERO_STR); + dto.setRatio("0%"); + dto.setRemark("未接种0人"); + list.add(dto); + } + } else { + VaccinePieResultDTO dto = new VaccinePieResultDTO(); + dto.setLabel("未接种人数"); + dto.setCode(NumConstant.ZERO_STR); + dto.setValue(NumConstant.ZERO_STR); + dto.setRatio("0%"); + dto.setRemark("未接种0人"); + list.add(dto); + } + return list; + } + @Transactional(rollbackFor = Exception.class) public void updateRelation(List list,String type){ if (NumConstant.ONE_STR.equals(type)){ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/MyHomeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/MyHomeServiceImpl.java index 9f5df02195..de655b5c3c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/MyHomeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/MyHomeServiceImpl.java @@ -196,20 +196,23 @@ public class MyHomeServiceImpl implements MyHomeService { */ @Override public HomeInfoResultDTO getHomeInfo(TokenDto tokenDto) { - HomeInfoResultDTO resultDto = new HomeInfoResultDTO(); //通过用户ID获取居民端用户信息 ResiUserBaseInfoResultDTO baseInfo = userBaseInfoDao.selecUserBaseInfoByUserId(tokenDto.getUserId()); - if (null == baseInfo) { - return resultDto; + if (null == baseInfo||StringUtils.isBlank(baseInfo.getIdNum())) { + log.warn(String.format("user_base_info.id_num is null userId:%s",tokenDto.getUserId())); + return null; } //通过居民身份证号获取居民信息 LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(IcResiUserEntity::getCustomerId, tokenDto.getCustomerId()); wrapper.eq(IcResiUserEntity::getIdCard, baseInfo.getIdNum()); + wrapper.select(IcResiUserEntity::getId,IcResiUserEntity::getHomeId,IcResiUserEntity::getIdCard); IcResiUserEntity icUser = icResiUserDao.selectOne(wrapper); - if (null == icUser) { - return resultDto; + if (null == icUser||StringUtils.isBlank(icUser.getHomeId())) { + log.warn(String.format("ic_resi_user is null id_card:%s",baseInfo.getIdNum())); + return null; } + HomeInfoResultDTO resultDto = new HomeInfoResultDTO(); resultDto.setIcResiUserId(icUser.getId()); //通过房屋ID获取房屋信息 HouseInfoCache houseInfo = CustomerIcHouseRedis.getHouseInfo(tokenDto.getCustomerId(), icUser.getHomeId()); @@ -221,17 +224,12 @@ public class MyHomeServiceImpl implements MyHomeService { resultDto.setHouseCode(houseInfo.getHouseCode()); resultDto.setQrCodeUrl(houseInfo.getHouseQrcodeUrl()); resultDto.setCoding(houseInfo.getCoding()); - //获取房屋房主信息,判断是否是房主 - Result icHouseResult = govOrgOpenFeignClient.get(icUser.getHomeId()); - if (!icHouseResult.success() || null == icHouseResult.getData()) { - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取房屋信息失败", "获取房屋信息失败"); - } - if (icUser.getIdCard().equals(icHouseResult.getData().getOwnerIdCard())) { + if (icUser.getIdCard().equals(houseInfo.getOwnerIdCard())) { resultDto.setIsOwner(NumConstant.ONE_STR); } else { resultDto.setIsOwner(NumConstant.ZERO_STR); } - resultDto.setOwnerIdCard(icHouseResult.getData().getOwnerIdCard()); + resultDto.setOwnerIdCard(houseInfo.getOwnerIdCard()); return resultDto; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/OperUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/OperUserServiceImpl.java index d44fe607eb..4758d01cd1 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/OperUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/OperUserServiceImpl.java @@ -196,4 +196,20 @@ public class OperUserServiceImpl extends BaseServiceImpl queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(OperUserEntity::getUserId, userId); + OperUserEntity entity = baseDao.selectOne(queryWrapper); + if (null != entity) { + return ConvertUtils.sourceToTarget(entity, OperUserDTO.class); + } + return null; + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java index a6480dca76..b3ac688a0f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java @@ -20,13 +20,15 @@ package com.epmet.service.impl; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.core.metadata.OrderItem; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.StrConstant; 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.CustomerStaffRedis; import com.epmet.commons.tools.scan.param.ImgScanParamDTO; import com.epmet.commons.tools.scan.param.ImgTaskDTO; import com.epmet.commons.tools.scan.param.TextScanParamDTO; @@ -35,10 +37,12 @@ import com.epmet.commons.tools.scan.result.SyncScanResult; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.ScanContentUtils; +import com.epmet.commons.tools.utils.SpringContextUtils; import com.epmet.constant.UserAdviceConstant; import com.epmet.dao.UserAdviceDao; import com.epmet.dto.CustomerDTO; import com.epmet.dto.CustomerGridDTO; +import com.epmet.dto.OperUserDTO; import com.epmet.dto.UserAdviceDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.AdviceDetailResultDTO; @@ -52,6 +56,8 @@ import com.epmet.feign.OperCrmOpenFeignClient; import com.epmet.service.UserAdviceImgService; import com.epmet.service.UserAdviceService; import com.epmet.service.UserResiInfoService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import io.jsonwebtoken.lang.Collections; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; @@ -148,25 +154,31 @@ public class UserAdviceServiceImpl extends BaseServiceImpl govImgList = dto.getGovImgList(); if (!Collections.isEmpty(govImgList)) { @@ -179,7 +191,7 @@ public class UserAdviceServiceImpl extends BaseServiceImpl govImgList = new ArrayList<>(); List resiImgList = new ArrayList<>(); for (UserAdviceImgEntity entity : imgsByAdviceId) { - if ("resi".equals(entity.getType())) { + if (AppClientConstant.APP_RESI.equals(entity.getType())) { resiImgList.add(entity.getImgUrl()); - } else if ("oper".equals(entity.getType())) { + } else if (AppClientConstant.APP_OPER.equals(entity.getType())||AppClientConstant.APP_GOV.equals(entity.getType())) { govImgList.add(entity.getImgUrl()); } } @@ -242,7 +254,7 @@ public class UserAdviceServiceImpl extends BaseServiceImpl adviceList(AdviceListFormDTO dto) { - //page分页 + /*//page分页 Page page = new Page<>(dto.getPageNo(), dto.getPageSize()); //时间降序 page.addOrder(OrderItem.desc(FieldConstant.CREATED_TIME)); @@ -300,7 +312,30 @@ public class UserAdviceServiceImpl extends BaseServiceImpl list = baseDao.selectListAdvice(dto); + List records=ConvertUtils.sourceToTarget(list,AdviceListResultDTO.class); + //拼接type + + for (int i = 0; i < records.size(); i++) { + if (!"*".equals(records.get(i).getAdviceType())) { + StringBuilder type = new StringBuilder(); + if (records.get(i).getAdviceType().contains("gov")) { + type.append(UserAdviceConstant.GOV_TYPE_TEXT); + } + if (records.get(i).getAdviceType().contains("software")) { + if (type.length() != 0) { + type.append("\n"); + } + type.append(UserAdviceConstant.SOFTWARE_TYPE_TEXT); + } + records.get(i).setAdviceType(type.toString()); + } + } + PageInfo pageInfo = new PageInfo<>(records); + return new PageData<>(records, pageInfo.getTotal()); } /** @@ -387,7 +422,7 @@ public class UserAdviceServiceImpl extends BaseServiceImplNumConstant.ZERO){ - throw new RenException("不允许重复提交审核"); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"不允许重复提交审核","已存在认证记录,不允许重复提交审核"); } log.info(JSON.toJSONString(certificationAddFormDTO)); AuthFieldFormDTO authFieldFormDTO = new AuthFieldFormDTO(); @@ -273,8 +278,11 @@ public class UserBadgeServiceImpl implements UserBadgeService { List userIds = new ArrayList<>(); userIds.add(certificationAddFormDTO.getUserId()); List userBaseInfoResultDTOS = userBaseInfoService.queryUserBaseInfo(userIds); - if (CollectionUtils.isEmpty(userBaseInfoResultDTOS)) { - throw new RenException("查询用户基本信息集合为空......"); + if (CollectionUtils.isEmpty(userBaseInfoResultDTOS)||null==userBaseInfoResultDTOS.get(NumConstant.ZERO)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),String.format("查询用户基本信息集合为空,userId:%s",certificationAddFormDTO.getUserId()),"查询用户基本信息异常"); + } + if(StringUtils.isBlank(userBaseInfoResultDTOS.get(NumConstant.ZERO).getRegisteredGridId())){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"异常信息:注册网格为空","服务器开小差了...注册网格为空"); } userBadgeDao.updateCertificateRecordIsLast(form.getBadgeId(),form.getUserId()); form.setGridId(userBaseInfoResultDTOS.get(NumConstant.ZERO).getRegisteredGridId()); @@ -282,17 +290,57 @@ public class UserBadgeServiceImpl implements UserBadgeService { form.setCertificationImg(certificationAddFormDTO.getCertificationImg()); form.setSurname(certificationAddFormDTO.getSurname()); log.info(JSON.toJSONString(form)); + String recordId=IdWorker.getIdStr(); + form.setId(recordId); userBadgeDao.insertUserBadgeCertificateRecord(form); - //TODO 站内信发送 - String badgeName = badgeDao.selectBadgeName(form.getCustomerId(), form.getBadgeId()); - String s = StringUtils.isBlank(userBaseInfoResultDTOS.get(NumConstant.ZERO).getDistrict()) ? userBaseInfoResultDTOS.get(NumConstant.ZERO).getRealName() : userBaseInfoResultDTOS.get(NumConstant.ZERO).getDistrict().concat(userBaseInfoResultDTOS.get(NumConstant.ZERO).getRealName()); - String msg = String.format(BadgeConstant.MESSAGE_CONTENT, s, badgeName); - // 记录待审核id,和消息类型 - sendMessage(BadgeConstant.AUTH_TITLE,msg,form.getGridId(),form.getUserId(),form.getCustomerId(), - UserMessageTypeConstant.BADGE_AUTH_APPLY, - form.getId()); + if(certificationAddFormDTO.getSendMsgFlag()){ + //TODO 站内信发送 + String badgeName = badgeDao.selectBadgeName(form.getCustomerId(), form.getBadgeId()); + String s = StringUtils.isBlank(userBaseInfoResultDTOS.get(NumConstant.ZERO).getDistrict()) ? userBaseInfoResultDTOS.get(NumConstant.ZERO).getRealName() : userBaseInfoResultDTOS.get(NumConstant.ZERO).getDistrict().concat(userBaseInfoResultDTOS.get(NumConstant.ZERO).getRealName()); + String msg = String.format(BadgeConstant.MESSAGE_CONTENT, s, badgeName); + // 记录待审核id,和消息类型 + sendMessage(BadgeConstant.AUTH_TITLE,msg,form.getGridId(),form.getUserId(),form.getCustomerId(), + UserMessageTypeConstant.BADGE_AUTH_APPLY, + form.getId()); + } + //烟台:徽章认证自动审核通过 + if(certificationAddFormDTO.getAutoPassFlag()){ + BadgeAuditFormDTO badgeAuditFormDTO=new BadgeAuditFormDTO(); + badgeAuditFormDTO.setRecordId(recordId); + //审核状态 approved:审核通过,rejected:审核驳回;auditing:审核中 + badgeAuditFormDTO.setAuditStatus(BadgeConstant.APPROVED); + badgeAuditFormDTO.setCurrentUserId("APP_USER"); + autoPassBadge(badgeAuditFormDTO); + } + Map resultMap=new HashMap(); + resultMap.put("recordId",recordId); + return new Result().ok(resultMap); + } + + /** + * 烟台:徽章认证,自动审核通过 + * @param badgeAuditFormDTO + */ + private void autoPassBadge(BadgeAuditFormDTO badgeAuditFormDTO) { + UserBadgeCertificateRecordDTO dto = SpringContextUtils.getBean(UserBadgeCertificateRecordService.class).get(badgeAuditFormDTO.getRecordId()); + dto.setAuditStatus(badgeAuditFormDTO.getAuditStatus()); + dto.setAuditRemark(badgeAuditFormDTO.getAuditRemark()); + dto.setStaffId(badgeAuditFormDTO.getCurrentUserId()); + dto.setIsLast(BadgeConstant.YES); + dto.setAuditTime(new Date()); + SpringContextUtils.getBean(UserBadgeCertificateRecordService.class).update(dto); + + ResiUserBadgeDTO resiUserBadgeDTO = new ResiUserBadgeDTO(); + resiUserBadgeDTO.setCustomerId(dto.getCustomerId()); + resiUserBadgeDTO.setBadgeId(dto.getBadgeId()); + resiUserBadgeDTO.setGridId(dto.getGridId()); + resiUserBadgeDTO.setUserId(dto.getUserId()); + resiUserBadgeDTO.setIsOpened(NumConstant.ONE); + resiUserBadgeDTO.setCertificationAutidStatus(dto.getAuditStatus()); + SpringContextUtils.getBean(ResiUserBadgeService.class).save(resiUserBadgeDTO); + //更新Redis + userBadgeRedis.pushOrRemoveUserBadge4List(dto.getUserId(),dto.getBadgeId(),dto.getCustomerId()); - return new Result(); } private void validateParams(CertificationAddFormDTO certificationAddFormDTO, AuthFieldFormDTO authFieldFormDTO) { diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java index a328399810..3e6203d2c6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java @@ -34,6 +34,7 @@ import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.redis.common.bean.ResiUserInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.EpmetRequestHolder; import com.epmet.commons.tools.utils.NameUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.*; @@ -41,10 +42,7 @@ import com.epmet.dto.RegisterRelationDTO; import com.epmet.dto.UserBaseInfoDTO; import com.epmet.dto.UserResiInfoDTO; import com.epmet.dto.UserWechatDTO; -import com.epmet.dto.form.CommonUserIdFormDTO; -import com.epmet.dto.form.DingLoginResiFormDTO; -import com.epmet.dto.form.UserRoleFormDTO; -import com.epmet.dto.form.VolunteerRegResiFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.RegisterRelationEntity; import com.epmet.entity.UserBaseInfoEntity; @@ -58,6 +56,8 @@ import com.epmet.service.RegisterRelationService; import com.epmet.service.UserBaseInfoService; import com.epmet.service.UserResiInfoService; import com.epmet.util.ModuleConstant; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -569,17 +569,28 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl pageRegUser(PageRegUserFormDTO formDTO) { + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()); + List list = baseDao.pageRegUser(EpmetRequestHolder.getLoginUserCustomerId(), + formDTO.getAgencyId(), + formDTO.getGridId(), + formDTO.getName(), + formDTO.getRegStartTime(), + formDTO.getRegEndTime(), + formDTO.getUserId()); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java index 3efd7e01fa..6101e9c2d5 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java @@ -186,6 +186,7 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml index 53433e05ec..ab6d729adf 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml @@ -39,7 +39,7 @@ reply_user_id = #{replyUserId}, reply_time = now(), gov_content = #{govContent}, - reply_user_name = (select real_name from oper_user where user_id = #{replyUserId} and del_flag = 0), + reply_user_name = #{replyUserName}, updated_by = #{replyUserId}, updated_time = now() where id = #{adviceId} and del_flag = 0 @@ -116,4 +116,40 @@ 0,0,#{userId},#{adviceTime},#{userId},#{adviceTime} ) + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml index c42a648c62..95b77d51a7 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml @@ -171,9 +171,6 @@ - - select replace(uuid(),'-','') AS ID - INSERT INTO user_badge_certificate_record ( ID, CUSTOMER_ID, diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml index c8f4d403a1..7cdcdc0913 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml @@ -83,7 +83,8 @@ DISTRICT district, BUILDING_ADDRESS buildingAddress, NICKNAME nickname, - HEAD_IMG_URL headImgUrl + HEAD_IMG_URL headImgUrl, + CREATED_TIME as regTime FROM user_base_info WHERE DEL_FLAG = '0' AND USER_ID = #{userId} @@ -167,4 +168,50 @@ AND ubi.DEL_FLAG = '0' order by ubi.CREATED_TIME desc limit 1 + +