diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java index c4f43a03b2..b4a31a96d1 100644 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java @@ -36,6 +36,11 @@ public interface ConsomerGroupConstants { */ String AUTH_OPERATION_LOG_GROUP = "auth_operation_log_group"; + /** + * 数字社区web端工作人员登录 + */ + String STAFF_LOGIN_LOG_GROUP = "staff_login_log_group"; + /** * 项目操作日志消费组 */ diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoCache.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoCache.java index 87e53edcb0..bb5526afe6 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoCache.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoCache.java @@ -32,6 +32,11 @@ public class CustomerStaffInfoCache implements Serializable { */ private String agencyName; + /** + * 组织级别 + */ + private String level; + /** * 2级组织名称 根据添加的来源返回(xx组织-组织/网格/部门) */ diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java index 1217ea6875..e84928739d 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java @@ -110,17 +110,30 @@ public class IcPartyActivityDTO implements Serializable { private String content; /** - * 服务人数 + * 服务人数;烟台:服务人数是活动限制名额,如果是0代表不限制 */ private Integer peopleCount; /** - * 活动时间 + * 活动时间;烟台:此列作为活动开始时间 */ @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") - @JsonFormat(pattern="yyyy-MM-dd HH:mm") + @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss") private Date activityTime; + /** + * 烟台:此列作为活动结束时间;必填; + */ + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date activityEndTime; + + /** + * 烟台:活动封面;必填 + */ + private String coverUrl; + + /** * 活动地址 */ diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyActivityFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyActivityFormDTO.java index 76f6d485db..76fef2c33b 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyActivityFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyActivityFormDTO.java @@ -18,8 +18,16 @@ import java.util.Date; @Data public class PartyActivityFormDTO extends PageFormDTO implements Serializable { private static final long serialVersionUID = -2510068555703677L; - @NotBlank(message = "组织Id不能为空" ) + + public interface ResiDingQueryInternalGroup { + } + + + @NotBlank(message = "组织Id不能为空",groups = {ResiDingQueryInternalGroup.class}) private String agencyId; + + @NotBlank(message = "gridId不能为空",groups = {ResiDingQueryInternalGroup.class}) + private String gridId; private String unitId; private String title; @@ -31,4 +39,10 @@ public class PartyActivityFormDTO extends PageFormDTO implements Serializable { // private Integer pageNo; // private Integer pageSize; private String customerId; + + /** + * 居民端钉钉,传userId + */ + @NotBlank(message = "userId不能为空",groups = {ResiDingQueryInternalGroup.class}) + private String userId; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyActivitySignUpRecordFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyActivitySignUpRecordFormDTO.java new file mode 100644 index 0000000000..bb4dcc834f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyActivitySignUpRecordFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 人员名单 + * @Author yzm + * @Date 2023/3/29 13:42 + */ +@Data +public class PartyActivitySignUpRecordFormDTO extends PageFormDTO implements Serializable { + /** + * 联建活动ID + */ + @NotBlank(message = "activityId不能为空", groups = AddUserInternalGroup.class) + private String activityId; +} + diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/SignUpParyActFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/SignUpParyActFormDTO.java new file mode 100644 index 0000000000..88a97b5cbb --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/SignUpParyActFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.QueryGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * @Description + * @Author yzm + * @Date 2023/3/29 15:27 + */ +@Data +public class SignUpParyActFormDTO { + /** + * + */ + @NotBlank(message = "userId不能为空", groups = QueryGroup.class) + private String userId; + @NotBlank(message = "activityId不能为空", groups = QueryGroup.class) + private String activityId; + @NotBlank(message = "gridId不能为空", groups = QueryGroup.class) + private String gridId; +} + diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyActivityResDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyActivityResDTO.java new file mode 100644 index 0000000000..bb10867388 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyActivityResDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * @Description 居民端钉钉,查看联建活动详情 + * @Author yzm + * @Date 2023/3/29 15:59 + */ +@Data +public class PartyActivityResDTO { + private String activityId; + private String agencyName; + private String agencyId; + private List unitNameList; + private List serviceMatterNameList; + private String title; + private String target; + private String content; + private Integer peopleCount; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date activityTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date activityEndTime; + private String coverUrl; + private String address; + private String result; + /** + * 报名记录id + */ + private String signUpId; + /** + * 已报名总人数 + */ + private Integer signUpCount; + /** + * 是否报名:true:已报名;false:未报名 + */ + private Boolean signUpFlag; + +} + diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyActivitySignUpRecordResDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyActivitySignUpRecordResDTO.java new file mode 100644 index 0000000000..6151e149dc --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyActivitySignUpRecordResDTO.java @@ -0,0 +1,61 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 联建活动报名记录表(烟台需求) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-03-29 + */ +@Data +public class PartyActivitySignUpRecordResDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 联建活动ID + */ + private String activityId; + + /** + * 居民端用户id + */ + private String userId; + + /** + * 姓名 + */ + private String userName; + private String mobile; + /** + * 报名时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date signUpTime; + + /** + * 用户报名时所在的网格 + */ + private String gridId; + /** + * 网格名称:XXX社区-xxx网格 + */ + private String gridName; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java index e26bfa68cc..0ed2488b12 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java @@ -24,6 +24,7 @@ import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.dto.form.PageFormDTO; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.ExceptionUtils; @@ -35,11 +36,16 @@ import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.QueryGroup; import com.epmet.constants.ImportTaskConstants; import com.epmet.dto.IcPartyActivityDTO; import com.epmet.dto.form.ImportTaskCommonFormDTO; import com.epmet.dto.form.PartyActivityFormDTO; +import com.epmet.dto.form.PartyActivitySignUpRecordFormDTO; +import com.epmet.dto.form.SignUpParyActFormDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; +import com.epmet.dto.result.PartyActivityResDTO; +import com.epmet.dto.result.PartyActivitySignUpRecordResDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.excel.IcPartyActivityExcel; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; @@ -47,6 +53,7 @@ import com.epmet.service.IcPartyActivityService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpHeaders; import org.springframework.web.bind.annotation.*; @@ -60,9 +67,7 @@ import java.io.IOException; import java.io.InputStream; import java.net.URLEncoder; import java.nio.file.Path; -import java.util.Date; -import java.util.List; -import java.util.UUID; +import java.util.*; /** @@ -253,5 +258,79 @@ public class IcPartyActivityController implements ResultDataResolver { } } + /** + * 人员名单 + * + * @param formDTO + * @return + */ + @PostMapping("querySignUpRecord") + public Result> querySignUpRecord(@RequestBody PartyActivitySignUpRecordFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserShowGroup.class,PageFormDTO.AddUserInternalGroup.class); + return new Result>().ok(icPartyActivityService.querySignUpRecord(formDTO.getActivityId(),formDTO.getPageNo(),formDTO.getPageSize())); + } + + /** + * 居民端钉钉,报名联建活动 + * + * @param formDTO + * @return + */ + @PostMapping("signUp") + public Result signUp(@RequestBody SignUpParyActFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, QueryGroup.class); + String signUpId = icPartyActivityService.signUp(formDTO.getActivityId(), formDTO.getUserId(), formDTO.getGridId()); + Map resultMap = new HashMap<>(); + resultMap.put("signUpId", signUpId); + return new Result().ok(resultMap); + } + + /** + * 居民端钉钉,查看联建活动详情 + * + * @param tokenDto + * @param activityId + * @return + */ + @PostMapping("act-detail-resi/{activityId}") + public Result queryActDetailForResi(@LoginUser TokenDto tokenDto, @PathVariable("activityId") String activityId) { + if (StringUtils.isBlank(activityId)) { + return new Result(); + } + return new Result().ok(icPartyActivityService.queryActDetailForResi(tokenDto.getCustomerId(),tokenDto.getUserId(),activityId)); + } + + /** + * 居民端钉钉,分页查询联建活动 + * + * @param formDTO + * @return + */ + @PostMapping("page-all-act") + public Result> pageAllAct(@RequestBody PartyActivityFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, PartyActivityFormDTO.ResiDingQueryInternalGroup.class); + return new Result>().ok( + icPartyActivityService.pageAllAct(formDTO.getPageNo(), + formDTO.getPageSize(), + formDTO.getGridId(), + formDTO.getAgencyId(), + formDTO.getUserId())); + } + + /** + * 居民端钉钉,已报名列表 + * @param formDTO + * @return + */ + @PostMapping("applied-act") + public Result> appliedAct(@RequestBody PartyActivityFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, PartyActivityFormDTO.ResiDingQueryInternalGroup.class); + return new Result>().ok( + icPartyActivityService.appliedAct(formDTO.getPageNo(), + formDTO.getPageSize(), + formDTO.getGridId(), + formDTO.getAgencyId(), + formDTO.getUserId())); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcActivityUnitRelationDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcActivityUnitRelationDao.java index be27ce119b..9fb70cfb2b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcActivityUnitRelationDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcActivityUnitRelationDao.java @@ -5,6 +5,8 @@ import com.epmet.entity.IcActivityUnitRelationEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 联建活动与单位关联表 * @@ -22,4 +24,11 @@ public interface IcActivityUnitRelationDao extends BaseDao selectActivityUntiNames(String activityId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyActivityDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyActivityDao.java index c8fba2ffed..23e764e4ec 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyActivityDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyActivityDao.java @@ -20,8 +20,10 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.form.PartyActivityFormDTO; import com.epmet.dto.result.ActivityStatisticsDTO; +import com.epmet.dto.result.PartyActivityResDTO; import com.epmet.entity.IcPartyActivityEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -54,4 +56,29 @@ public interface IcPartyActivityDao extends BaseDao { List getActivityList(PartyActivityFormDTO formDTO); + + /** + * + * @param gridId 当前用户所在网格id + * @param agencyId 当前用户所在网格所属组织id + * @param userId 居民端用户id,校验当前用户是否报名 + * @return 居民端钉钉-分页查询全部联建活动 + */ + List pageAllAct(@Param("customerId")String customerId, + @Param("gridId") String gridId, + @Param("agencyId")String agencyId, + @Param("userId")String userId); + + /** + * 居民端钉钉,已报名列表 + * @param customerId + * @param gridId + * @param agencyId + * @param userId + * @return + */ + List selectAppliedAct(@Param("customerId")String customerId, + @Param("gridId") String gridId, + @Param("agencyId")String agencyId, + @Param("userId")String userId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyActivitySignUpRecordDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyActivitySignUpRecordDao.java new file mode 100644 index 0000000000..a28ec3565a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyActivitySignUpRecordDao.java @@ -0,0 +1,24 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.PartyActivitySignUpRecordResDTO; +import com.epmet.entity.IcPartyActivitySignUpRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 联建活动报名记录表(烟台需求) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-03-29 + */ +@Mapper +public interface IcPartyActivitySignUpRecordDao extends BaseDao { + /** + * 人员名单 + * @param activityId + * @return + */ + List querySignUpRecord(String activityId); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceItemDictDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceItemDictDao.java index c01c80b4d4..7a0ef4f766 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceItemDictDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceItemDictDao.java @@ -39,4 +39,13 @@ public interface IcServiceItemDictDao extends BaseDao { IcServiceItemDictEntity selectMax(String customerId); String selectName(@Param("customerId") String customerId, @Param("categoryCode") String categoryCode); + + /** + * 查询联建活动的服务事项名称 + * @param activityId + * @param customerId + * @return + */ + List selectActivityServiceItemName(@Param("activityId") String activityId, + @Param("customerId") String customerId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyActivityEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyActivityEntity.java index 28a588f6f4..630e95732d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyActivityEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyActivityEntity.java @@ -83,14 +83,24 @@ public class IcPartyActivityEntity extends BaseEpmetEntity { private String content; /** - * 服务人数 + * 服务人数;烟台:服务人数是活动限制名额,如果是0代表不限制 */ private Integer peopleCount; /** - * 活动时间 + * 活动时间;烟台:此列作为活动开始时间 */ private Date activityTime; + /** + * 烟台:此列作为活动结束时间;必填; + */ + private Date activityEndTime; + + /** + * 烟台:活动封面;必填 + */ + private String coverUrl; + /** * 活动地址 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyActivitySignUpRecordEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyActivitySignUpRecordEntity.java new file mode 100644 index 0000000000..4917b0adf6 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyActivitySignUpRecordEntity.java @@ -0,0 +1,54 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 联建活动报名记录表(烟台需求) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-03-29 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_party_activity_sign_up_record") +public class IcPartyActivitySignUpRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 联建活动ID + */ + private String activityId; + + /** + * 居民端用户id + */ + private String userId; + + /** + * 姓名 + */ + private String userName; + private String mobile; + /** + * 报名时间 + */ + private Date signUpTime; + + /** + * 用户报名时所在的网格 + */ + private String gridId; + private String gridName; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityExcel.java index 4b52917350..e7bdcaf3b8 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityExcel.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityExcel.java @@ -49,9 +49,20 @@ public class IcPartyActivityExcel { private Integer peopleCount; @ColumnWidth(20) - @ExcelProperty(value = "活动时间") + @ExcelProperty(value = "活动开始时间") @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss") private Date activityTime; + + + /** + * 烟台:此列作为活动结束时间;必填; + */ + @ColumnWidth(20) + @ExcelProperty(value = "活动结束时间") + @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date activityEndTime; + + /** * actId不为空小程序 * 为空管理平台 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityImportExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityImportExcel.java index 6998d20078..346993a2d0 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityImportExcel.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityImportExcel.java @@ -51,11 +51,20 @@ public class IcPartyActivityImportExcel extends ExcelVerifyInfo { @ExcelProperty(value = "服务人数*") private Integer peopleCount; - @NotNull(message = "活动时间不能为空") - @ExcelProperty("活动时间*") + @NotNull(message = "活动开始时间不能为空") + @ExcelProperty("活动开始时间*") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date activityTime; + /** + * 烟台:此列作为活动结束时间;必填; + */ + @NotNull(message = "活动结束时间不能为空") + @ExcelProperty("活动结束时间*") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date activityEndTime; + + @NotBlank(message = "详细地址") @Length(max = 250, message = "详细地址最多输入250字") @ExcelProperty(value = "详细地址*") diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcActivityUnitRelationService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcActivityUnitRelationService.java index 3d109db98b..fdc06e08bc 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcActivityUnitRelationService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcActivityUnitRelationService.java @@ -22,6 +22,13 @@ public interface IcActivityUnitRelationService extends BaseService getUnitList(String activityId); + /** + * 获取联建活动关联的联建单位名称 + * @param activityId + * @return + */ + List getActivityUntiNames(String activityId); + /** * 物理删除删除活动所属单位 * diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java index 22c559aace..41f597fb07 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java @@ -22,6 +22,8 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.IcPartyActivityDTO; import com.epmet.dto.form.PartyActivityFormDTO; +import com.epmet.dto.result.PartyActivityResDTO; +import com.epmet.dto.result.PartyActivitySignUpRecordResDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.entity.IcPartyActivityEntity; @@ -127,4 +129,54 @@ public interface IcPartyActivityService extends BaseService querySignUpRecord(String activityId,Integer pageNo,Integer pageSize); + + /** + * 居民端钉钉,报名联建活动 + * @param activityId + * @param userId + * @param gridId + */ + String signUp(String activityId, String userId, String gridId); + + /** + * 居民端钉钉,查看联建活动详情 + * @param customerId + * @param userId + * @param activityId + * @return + */ + PartyActivityResDTO queryActDetailForResi(String customerId, String userId, String activityId); + + /** + * 居民端钉钉-分页查询全部联建活动 + * + * @param pageNo + * @param pageSize + * @param gridId + * @param userId + * @return + */ + PageData pageAllAct(Integer pageNo, Integer pageSize, String gridId, String agencyId,String userId); + + /** + * 居民端钉钉,已报名列表 + * @param pageNo + * @param pageSize + * @param gridId + * @param agencyId + * @param userId + * @return + */ + PageData appliedAct(Integer pageNo, + Integer pageSize, + String gridId, + String agencyId, + String userId); } \ 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 92a6dc4ef6..9178b98d03 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 @@ -83,4 +83,12 @@ public interface IcServiceItemDictService extends BaseService queryDictOption(String type, String customerId); + + /** + * 查询联建活动的,服务事项名称列表 + * @param activityId + * @param customerId + * @return + */ + List getByActivityId(String activityId, 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/IcActivityUnitRelationServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcActivityUnitRelationServiceImpl.java index d7bedf1d0b..a52e4dd0bf 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcActivityUnitRelationServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcActivityUnitRelationServiceImpl.java @@ -43,6 +43,17 @@ public class IcActivityUnitRelationServiceImpl extends BaseServiceImpl getActivityUntiNames(String activityId) { + return baseDao.selectActivityUntiNames(activityId); + } + /** * 删除活动所属单位 * diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java index 180877f027..70996fe308 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java @@ -24,28 +24,33 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.*; import com.epmet.constants.ImportTaskConstants; import com.epmet.dao.IcPartyActivityDao; +import com.epmet.dao.IcPartyActivitySignUpRecordDao; import com.epmet.dto.IcPartyActivityDTO; import com.epmet.dto.IcPartyUnitDTO; import com.epmet.dto.form.ImportTaskCommonFormDTO; import com.epmet.dto.form.PartyActivityFormDTO; -import com.epmet.dto.result.ActivityStatisticsDTO; -import com.epmet.dto.result.UploadImgResultDTO; +import com.epmet.dto.result.*; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.entity.IcActivityServiceRelationEntity; import com.epmet.entity.IcActivityUnitRelationEntity; import com.epmet.entity.IcPartyActivityEntity; +import com.epmet.entity.IcPartyActivitySignUpRecordEntity; import com.epmet.excel.IcPartyActivityImportExcel; import com.epmet.excel.handler.IcPartyActivityImportListener; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; +import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.OssFeignClient; import com.epmet.service.*; import com.github.pagehelper.PageHelper; @@ -57,6 +62,7 @@ import org.apache.commons.fileupload.FileItemFactory; import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.lang3.StringUtils; import org.apache.http.entity.ContentType; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -83,8 +89,8 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl serviceMatterid = Arrays.asList(dto.getServiceMatter().split(StrConstant.COMMA)); List serviceMatterNameList=new ArrayList<>(); for(String id:serviceMatterid){ - String categoryName=icServiceItemDictService.getCategoryName(dto.getCustomerId(),id); + String categoryName=SpringContextUtils.getBean(IcServiceItemDictService.class).getCategoryName(dto.getCustomerId(),id); if(StringUtils.isNotBlank(categoryName)){ serviceMatterNameList.add(categoryName); } @@ -156,7 +166,7 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl(dtoList, pageInfo.getTotal()); + return new PageData<>(dtoList, pageInfo.getTotal(),formDTO.getPageSize()); } @Override @@ -201,7 +211,7 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl serviceItemList = icServiceItemDictService.queryDictList(entity.getCustomerId()); + List serviceItemList = SpringContextUtils.getBean(IcServiceItemDictService.class).queryDictList(entity.getCustomerId()); Map categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); List services = icActivityServiceRelationService.getServiceList(id); List serviceNames = services.stream().map(categoryMap::get).collect(Collectors.toList()); @@ -335,7 +345,7 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl option = icPartyUnitService.options(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); //获取服务事项字典 - List serviceItemList = icServiceItemDictService.queryDictList(tokenDto.getCustomerId()); + List serviceItemList = SpringContextUtils.getBean(IcServiceItemDictService.class).queryDictList(tokenDto.getCustomerId()); Map categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); //数据组装 dtoList.forEach(dto -> { @@ -509,4 +519,164 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl querySignUpRecord(String activityId, Integer pageNo, Integer pageSize) { + PageHelper.startPage(pageNo, pageSize); + List list = partyActivitySignUpRecordDao.querySignUpRecord(activityId); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal(), pageSize); + } + + /** + * 居民端钉钉,报名联建活动 + * + * @param activityId + * @param userId + * @param gridId + */ + @Override + public String signUp(String activityId, String userId, String gridId) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(IcPartyActivitySignUpRecordEntity::getActivityId, activityId) + .eq(IcPartyActivitySignUpRecordEntity::getUserId, userId) + .select(IcPartyActivitySignUpRecordEntity::getId); + IcPartyActivitySignUpRecordEntity entity = partyActivitySignUpRecordDao.selectOne(queryWrapper); + if (null != entity) { + return entity.getId(); + } + // 查询网格名称 + GridInfoCache gridInfoCache = CustomerOrgRedis.getGridInfo(gridId); + if (null == gridInfoCache) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "网格信息查询异常gridId:" + gridId, "网格信息查询异常"); + } + // 查询用户姓名和手机号 + List userIdList=new ArrayList<>(); + userIdList.add(userId); + Result> userRes = epmetUserOpenFeignClient.queryUserBaseInfo(userIdList); + if (!userRes.success() || CollectionUtils.isEmpty(userRes.getData())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "网格信息查询异常gridId:" + gridId, "查询用户信息异常"); + } + UserBaseInfoResultDTO userBaseInfoResultDTO=userRes.getData().get(NumConstant.ZERO); + IcPartyActivitySignUpRecordEntity insert = new IcPartyActivitySignUpRecordEntity(); + insert.setActivityId(activityId); + insert.setCustomerId(EpmetRequestHolder.getLoginUserCustomerId()); + insert.setGridId(gridId); + insert.setGridName(gridInfoCache.getGridNamePath()); + insert.setUserId(userId); + insert.setUserName(userBaseInfoResultDTO.getRealName()); + insert.setMobile(userBaseInfoResultDTO.getMobile()); + insert.setSignUpTime(new Date()); + partyActivitySignUpRecordDao.insert(insert); + return insert.getId(); + } + + + /** + * 居民端钉钉,查看联建活动详情 + * + * @param customerId + * @param userId + * @param activityId + * @return + */ + @Override + public PartyActivityResDTO queryActDetailForResi(String customerId, String userId, String activityId) { + IcPartyActivityEntity activityEntity = baseDao.selectById(activityId); + if (null == activityEntity) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "联建活动不存在,activityId:" + activityId, "联建活动不存在"); + } + PartyActivityResDTO resDTO = ConvertUtils.sourceToTarget(activityEntity, PartyActivityResDTO.class); + resDTO.setSignUpFlag(false); + resDTO.setActivityId(activityId); + + // 当前用户是否报名 + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(IcPartyActivitySignUpRecordEntity::getActivityId, activityId) + .eq(IcPartyActivitySignUpRecordEntity::getUserId, userId) + .select(IcPartyActivitySignUpRecordEntity::getId); + IcPartyActivitySignUpRecordEntity signUpRecordEntity = partyActivitySignUpRecordDao.selectOne(queryWrapper); + if (null != signUpRecordEntity) { + resDTO.setSignUpId(signUpRecordEntity.getId()); + resDTO.setSignUpFlag(true); + } + // 主办方:组织名称 + AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(resDTO.getAgencyId()); + if (null != agencyInfoCache) { + resDTO.setAgencyName(agencyInfoCache.getOrganizationName()); + } + // 联建单位: + resDTO.setUnitNameList(icActivityUnitRelationService.getActivityUntiNames(activityId)); + // 服务事项 + resDTO.setServiceMatterNameList(SpringContextUtils.getBean(IcServiceItemDictService.class).getByActivityId(activityId,activityEntity.getCustomerId())); + // 报名总人数 + LambdaQueryWrapper countWrapper = new LambdaQueryWrapper<>(); + countWrapper.eq(IcPartyActivitySignUpRecordEntity::getActivityId, activityId); + resDTO.setSignUpCount(partyActivitySignUpRecordDao.selectCount(countWrapper)); + return resDTO; + } + + + /** + * 居民端钉钉-分页查询全部联建活动 + * + * @param pageNo + * @param pageSize + * @param gridId + * @param userId + * @return + */ + @Override + public PageData pageAllAct(Integer pageNo, Integer pageSize, String gridId,String agencyId, String userId) { + PageHelper.startPage(pageNo,pageSize); + List list=baseDao.pageAllAct(EpmetRequestHolder.getLoginUserCustomerId(),gridId,agencyId,userId); + list.forEach(resDTO->{ + // 主办方:组织名称 + AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(resDTO.getAgencyId()); + if (null != agencyInfoCache) { + resDTO.setAgencyName(agencyInfoCache.getOrganizationName()); + } + // 联建单位: + resDTO.setUnitNameList(icActivityUnitRelationService.getActivityUntiNames(resDTO.getActivityId())); + // 服务事项 + resDTO.setServiceMatterNameList(SpringContextUtils.getBean(IcServiceItemDictService.class).getByActivityId(resDTO.getActivityId(),EpmetRequestHolder.getLoginUserCustomerId())); + }); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal(),pageSize); + } + + /** + * 居民端钉钉,已报名列表 + * + * @param pageNo + * @param pageSize + * @param gridId + * @param agencyId + * @param userId + * @return + */ + @Override + public PageData appliedAct(Integer pageNo, Integer pageSize, String gridId, String agencyId, String userId) { + PageHelper.startPage(pageNo, pageSize); + List list = baseDao.selectAppliedAct(EpmetRequestHolder.getLoginUserCustomerId(), gridId, agencyId, userId); + list.forEach(resDTO -> { + // 主办方:组织名称 + AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(resDTO.getAgencyId()); + if (null != agencyInfoCache) { + resDTO.setAgencyName(agencyInfoCache.getOrganizationName()); + } + // 联建单位: + resDTO.setUnitNameList(icActivityUnitRelationService.getActivityUntiNames(resDTO.getActivityId())); + // 服务事项 + resDTO.setServiceMatterNameList(SpringContextUtils.getBean(IcServiceItemDictService.class).getByActivityId(resDTO.getActivityId(), EpmetRequestHolder.getLoginUserCustomerId())); + }); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal(), pageSize); + } } 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 1e7b7f0271..a8516d398a 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 @@ -226,5 +226,15 @@ public class IcServiceItemDictServiceImpl extends BaseServiceImpl getByActivityId(String activityId, String customerId) { + return baseDao.selectActivityServiceItemName(activityId,customerId); + } } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcActivityUnitRelationDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcActivityUnitRelationDao.xml index f8947c98e4..e25faa3e66 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcActivityUnitRelationDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcActivityUnitRelationDao.xml @@ -22,5 +22,14 @@ DELETE FROM ic_activity_unit_relation WHERE ACTIVITY_ID = #{activityId} + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml index 3a59b3c1d0..0d96fac179 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml @@ -63,7 +63,9 @@ a.LATITUDE, a.RESULT, a.AGENCY_ID, - a.CUSTOMER_ID + a.CUSTOMER_ID, + a.COVER_URL, + a.ACTIVITY_END_TIME FROM ic_party_activity a left join ic_activity_unit_relation ur @@ -89,8 +91,11 @@ AND sr.SERVICE_MATTER = #{serviceMatter} - - AND a.ACTIVITY_TIME BETWEEN #{startTime} AND #{endTime} + + AND a.ACTIVITY_TIME >= #{startTime} + + + AND a.ACTIVITY_TIME <= #{endTime} GROUP BY a.id ORDER BY a.ACTIVITY_TIME DESC @@ -159,4 +164,83 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivitySignUpRecordDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivitySignUpRecordDao.xml new file mode 100644 index 0000000000..c28b63da6c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivitySignUpRecordDao.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceItemDictDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceItemDictDao.xml index 4582741dbb..8359370be2 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceItemDictDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceItemDictDao.xml @@ -41,4 +41,19 @@ d.CUSTOMER_ID = #{customerId} AND d.CATEGORY_CODE = #{categoryCode} + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/templates/icpartyactivity_import_tem.xlsx b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/templates/icpartyactivity_import_tem.xlsx index 143cdaa637..a17cefb941 100644 Binary files a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/templates/icpartyactivity_import_tem.xlsx and b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/templates/icpartyactivity_import_tem.xlsx differ 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-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/CommunityCountCensusFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CommunityCountCensusFormDTO.java new file mode 100644 index 0000000000..d9e7f7d4e4 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CommunityCountCensusFormDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + +/** + * @ClassName AgencyCountCensus$ + * @Description + * @Date 2023/4/6 16:46 + * @Author lichao + **/ +@Data +public class CommunityCountCensusFormDTO implements Serializable { + + + + private static final long serialVersionUID = 4360690752084258055L; + + @NotBlank(message = "组织Id不能为空") + private String agencyId; + + private Date timeStart; + + private Date timeEnd; + + private Integer pageNum; + + private Integer pageSize; +} 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/EnterprisePageFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EnterprisePageFormDTO.java index 15bf7a402a..623af190db 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EnterprisePageFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EnterprisePageFormDTO.java @@ -10,6 +10,19 @@ import java.io.Serializable; */ @Data public class EnterprisePageFormDTO implements Serializable { + + /** + * 组织id或者网格id + * 04.10添加次入参,原型地址:https://modao.cc/app/DUshpXWirii6amoDQsb8OP#screen=slfbvzaghxlqxhe + */ + private String orgId; + /** + * 组织:agency + * 网格:grid + * 04.10添加次入参,原型地址:https://modao.cc/app/DUshpXWirii6amoDQsb8OP#screen=slfbvzaghxlqxhe + */ + private String orgType; + /** * 场所区域 */ diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GroupRentHouseFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GroupRentHouseFormDTO.java new file mode 100644 index 0000000000..97c8832968 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GroupRentHouseFormDTO.java @@ -0,0 +1,48 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author yzm + * @Date 2023/3/2 17:35 + */ +@Data +public class GroupRentHouseFormDTO extends PageFormDTO implements Serializable { + private static final long serialVersionUID = -953729855530434972L; + /** + * 组织ID + */ + private String orgId; + private String orgType; + + /** + * 房主姓名 + */ + private String ownerName; + /** + * 房主电话 + */ + private String ownerPhone; + + /** + * 房屋用途 + */ + private String purpose; + + /** + * 备注 + */ + private String remark; + + + /** + * tokenDto获取 + */ + private String customerId; + private String staffId; +} + diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseCountPictureFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseCountPictureFormDTO.java new file mode 100644 index 0000000000..e71cf1dfd6 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseCountPictureFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Description 根据小区,楼宇,单元名称校验是否存在 + * @Author wgf + * @Date 2022/8/24 9:03 + */ +@Data +public class HouseCountPictureFormDTO implements Serializable { + private static final long serialVersionUID = 2636608477324780974L; + + private String orgIdPath; + + private Date timeStart; + + private Date timeEnd; + + private String purpose; + + private Integer rentFlag; + + private Integer pageSize; + + private Integer pageNo; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/CommunityLoginFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/CommunityLoginFormDTO.java new file mode 100644 index 0000000000..5fc00d0691 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/CommunityLoginFormDTO.java @@ -0,0 +1,41 @@ +package com.epmet.dto.form.yt; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +/** + * @Description 下级社区账号登录次数排名入参 + * @Author yzm + * @Date 2023/4/6 14:18 + */ +@Data +public class CommunityLoginFormDTO extends PageFormDTO { + /** + * 所选择的组织id + */ + private String orgId; + + /** + * 组织类型 + */ + private String level; + + /** + * 开始日期:yyyy-MM-dd + */ + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date startDate; + + /** + * 截止日期:yyyy-MM-dd + */ + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date endDate; +} + diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/CountActivityFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/CountActivityFormDTO.java new file mode 100644 index 0000000000..a1ef997fc0 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/CountActivityFormDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dto.form.yt; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +/** + * @Description 下级社区账号登录次数排名入参 + * @Author yzm + * @Date 2023/4/6 14:18 + */ +@Data +public class CountActivityFormDTO extends PageFormDTO { + /** + * 所选择的组织id + */ + private String orgId; + + /** + * 是否活跃 1 活跃 0 不活跃 + */ + private String isActivity; + + + /** + * 开始日期:yyyy-MM-dd + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date startDate; + + /** + * 截止日期:yyyy-MM-dd + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date endDate; +} + diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/EnterpriseCountPlaceTypeFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/EnterpriseCountPlaceTypeFormDTO.java new file mode 100644 index 0000000000..be4e1aac78 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/EnterpriseCountPlaceTypeFormDTO.java @@ -0,0 +1,15 @@ +package com.epmet.dto.form.yt; + +import lombok.Data; + +/** + * @Description 九小场所分析 + * @Author yzm + * @Date 2023/4/7 16:47 + */ +@Data +public class EnterpriseCountPlaceTypeFormDTO { + private String orgId; + private String orgType; +} + diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/LoginLogCountByLevelFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/LoginLogCountByLevelFormDTO.java new file mode 100644 index 0000000000..c115f530c9 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/LoginLogCountByLevelFormDTO.java @@ -0,0 +1,41 @@ +package com.epmet.dto.form.yt; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +/** + * @Description 账号登录情况,查询市级账号/区县级账号/镇街级账号/社区级账号登录次数,入参dto + * @Author yzm + * @Date 2023/4/6 10:09 + */ +@Data +public class LoginLogCountByLevelFormDTO { + /** + * 所选择的组织id + */ + private String orgId; + + /** + * 组织类型 + */ + private String level; + + /** + * 开始日期:yyyy-MM-dd + */ + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date startDate; + + /** + * 截止日期:yyyy-MM-dd + */ + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date endDate; + +} + diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyCountCensusResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyCountCensusResultDTO.java new file mode 100644 index 0000000000..4599d00793 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyCountCensusResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @ClassName AgencyCountCensus$ + * @Description + * @Date 2023/4/6 16:46 + * @Author lichao + **/ +@Data +public class AgencyCountCensusResultDTO implements Serializable { + + private static final long serialVersionUID = 4360690752084258055L; + + private String level; + private Integer count; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyResultDTO.java index a7aec4fa28..c40b7448d6 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyResultDTO.java @@ -47,5 +47,8 @@ public class AgencyResultDTO implements Serializable { private String longitude; //维度【没值则取跟客户的值】 private String latitude; - + /** + * agencyId的全路径,包含自身 + */ + private String orgIdPath; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencySubResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencySubResultDTO.java index 08bd0683b1..1461c66fa1 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencySubResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencySubResultDTO.java @@ -61,4 +61,8 @@ public class AgencySubResultDTO implements Serializable { * 组织维度【没值取根组织的值】 */ private String latitude = ""; + /** + * agencyId的全路径,包含自身 + */ + private String orgIdPath; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java index 4d48b54960..ab12b7bac2 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java @@ -35,6 +35,10 @@ public class AgencyTreeResultDTO implements Serializable { * orgId-orgLevel */ private String orgLevel; + /** + * agencyId的全路径,包含自身 + */ + private String orgIdPath; /** * 下级机关组织 */ 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/CommunityCountCensusResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityCountCensusResultDTO.java new file mode 100644 index 0000000000..5788007304 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityCountCensusResultDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @ClassName AgencyCountCensus$ + * @Description + * @Date 2023/4/6 16:46 + * @Author lichao + **/ +@Data +public class CommunityCountCensusResultDTO implements Serializable { + + private static final long serialVersionUID = 4360690752084258055L; + + private String agencyId; + + private String agencyName; + + private Integer count; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityListByAgencyIdResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityListByAgencyIdResultDTO.java new file mode 100644 index 0000000000..f256fbe316 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityListByAgencyIdResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Description: + * @Author: lichao + * @Date: 2023/4/7 16:43 + */ +@Data +public class CommunityListByAgencyIdResultDTO implements Serializable { + private static final long serialVersionUID = -1677303397440121269L; + + private String id; + + private String pids; + + private String name; + + private String streeName; + +// private String streeId; + + private String districtName; + +// private String districtId; + + private Date createTime; +} 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-client/src/main/java/com/epmet/dto/result/GroupRentHouseResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GroupRentHouseResultDTO.java new file mode 100644 index 0000000000..febcd6e4fc --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GroupRentHouseResultDTO.java @@ -0,0 +1,77 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 群租房列表 + * @Author yzm + * @Date 2023/3/3 9:27 + */ +@Data +public class GroupRentHouseResultDTO implements Serializable { + private static final long serialVersionUID = 3671964765109154117L; + private String houseId; + + /** + * 所属组织 + */ + private String agencyName; + private String agencyId; + /** + * 所属网格 + */ + private String gridName; + private String gridId; + + /** + * 所属小区 + */ + private String neighborHoodName; + /** + * 所属楼栋 + */ + private String buildingName; + + private String houseName; + /** + * 房屋类型 + */ + private String houseType; + private String houseTypeKey; + /** + * 房屋用途 + */ + private String purpose; + private String purposeKey; + + /** + * 房屋状态:房屋状态:1:出租 0:自住 2:闲置 3:未售出 + */ + private String rentFlag; + + /** + * 房主姓名 + */ + private String ownerName; + /** + * 房主电话 + */ + private String ownerPhone; + /** + * 房主身份证 + */ + private String ownerIdCard; + + /** + * 备注 + */ + private String remark; + + /** + * 排序 + */ + private Double sort; +} + diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseCountPictureListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseCountPictureListResultDTO.java new file mode 100644 index 0000000000..e90cd207a7 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseCountPictureListResultDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description: + * @Author: lichao + * @Date: 2023/4/11 15:05 + */ +@NoArgsConstructor +@Data +public class HouseCountPictureListResultDTO implements Serializable { + + private static final long serialVersionUID = 2063032844842070847L; + + private String type; + + private Integer count; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseCountPictureResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseCountPictureResultDTO.java new file mode 100644 index 0000000000..998776fffb --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseCountPictureResultDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description: + * @Author: lichao + * @Date: 2023/4/11 15:05 + */ +@NoArgsConstructor +@Data +public class HouseCountPictureResultDTO implements Serializable { + + private static final long serialVersionUID = 2063032844842070847L; + + private Integer total; + + private List list; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HousePictureListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HousePictureListResultDTO.java new file mode 100644 index 0000000000..b511488220 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HousePictureListResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dto.result; + + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Description: + * @Author: lichao + * @Date: 2023/4/11 14:41 + */ +@NoArgsConstructor +@Data +public class HousePictureListResultDTO implements Serializable { + + private static final long serialVersionUID = 2063032844842070847L; + + private String houseId; + + private String districtName; + + private String streetName; + + private String communityName; + + private String gridName; + + private String houseName; + + private String purposeName; + + private String rentFlagName; + + private String orgIdPath; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/AccountActivityInfo.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/AccountActivityInfo.java new file mode 100644 index 0000000000..b63ed0c20f --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/AccountActivityInfo.java @@ -0,0 +1,44 @@ +package com.epmet.dto.result.yt; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * @author: qushutong + * @Date: 2023/4/6 13:33 + * @Description: 账户活跃情况 + */ +@Data +public class AccountActivityInfo implements Serializable { + private static final long serialVersionUID = -918630886413844674L; + + /** + * 组织名称 + */ + private String agencyName = ""; + + /** + * 登陆次数 + */ + private String loginCount = ""; + + /** + * 活跃账号数 + */ + private String accountActivityCount = ""; + + + /** + * 总账号数 + */ + private String accountCount = ""; + + /** + * 组织id + */ + private String agencyId = ""; + + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/ActivityTatalInfo.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/ActivityTatalInfo.java new file mode 100644 index 0000000000..a92b42661d --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/ActivityTatalInfo.java @@ -0,0 +1,30 @@ +package com.epmet.dto.result.yt; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * @author: qushutong + * @Date: 2023/4/6 13:33 + * @Description: 账户活跃总数 + */ +@Data +public class ActivityTatalInfo implements Serializable { + private static final long serialVersionUID = -918630886413844674L; + + + /** + * 不活跃账号总数 + */ + private String inactivityCount = ""; + + /** + * 活跃账号总数 + */ + private String activityCount = ""; + + + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/CommunityLoginResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/CommunityLoginResultDTO.java new file mode 100644 index 0000000000..e1cb00a765 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/CommunityLoginResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dto.result.yt; + +import lombok.Data; + +/** + * @Description 下级社区账号登录次数排名 + * @Author yzm + * @Date 2023/4/6 14:15 + */ +@Data +public class CommunityLoginResultDTO { + /** + * 组织id + */ + private String agencyId; + /** + * 组织名称 + */ + private String agencyName; + /** + * 组织级别(社区级:community, 乡(镇、街道)级:street, 区县级: district, 市级: city 省级:province) + */ + private String agencyLevel; + /** + * 所属街道名称; + */ + private String streetName; + /** + * 所属区县名称; + */ + private String districtName; + /** + * 登录次数 + */ + private Integer count; +} + diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/EnterpriseCountPlaceTypeDetailDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/EnterpriseCountPlaceTypeDetailDTO.java new file mode 100644 index 0000000000..f92834a43b --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/EnterpriseCountPlaceTypeDetailDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.result.yt; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +/** + * @Description 九小场所分析 + * @Author yzm + * @Date 2023/4/7 16:48 + */ +@Data +public class EnterpriseCountPlaceTypeDetailDTO { + private String placeType; + private String placeTypeName; + private Integer total; + + + public EnterpriseCountPlaceTypeDetailDTO() { + this.total = NumConstant.ZERO; + } + + +} + diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/EnterpriseCountPlaceTypeResDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/EnterpriseCountPlaceTypeResDTO.java new file mode 100644 index 0000000000..865a2f481a --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/EnterpriseCountPlaceTypeResDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.result.yt; + +import lombok.Data; + +import java.util.List; + +/** + * @Description 九小场所分析 + * @Author yzm + * @Date 2023/4/7 16:47 + */ +@Data +public class EnterpriseCountPlaceTypeResDTO { + private Integer total; + private List list; +} + diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/LoginLogCountByLevelResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/LoginLogCountByLevelResultDTO.java new file mode 100644 index 0000000000..b1a4c33c42 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/LoginLogCountByLevelResultDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.result.yt; + +import lombok.Data; + +/** + * @Description 账号登录情况,查询市级账号/区县级账号/镇街级账号/社区级账号登录次数,返参dto + * @Author yzm + * @Date 2023/4/6 10:13 + */ +@Data +public class LoginLogCountByLevelResultDTO { + /** + * 市级账号登录总次数;-1时不展示 + */ + private Integer cityCount; + /** + * 区县级账号登录总次数;-1时不展示 + */ + private Integer districtCount; + /** + * 镇街级账号登录总次数;-1时不展示 + */ + private Integer streetCount; + /** + * 社区级账号登录总次数;-1时不展示 + */ + private Integer communityCount; +} + diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index 9818f7f832..0ded926d87 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -21,7 +21,7 @@ import java.util.Set; * @author yinzuomei@elink-cn.com * @date 2020/6/4 13:37 */ - //@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallbackFactory = GovOrgOpenFeignClientFallbackFactory.class, url = "localhost:8092") + // @FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallbackFactory = GovOrgOpenFeignClientFallbackFactory.class, url = "localhost:8092") @FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallbackFactory = GovOrgOpenFeignClientFallbackFactory.class) public interface GovOrgOpenFeignClient { @@ -757,4 +757,12 @@ public interface GovOrgOpenFeignClient { @PostMapping("/gov/org/enterprise/sendEnterprisePatrolRemindMessage") Result sendEnterprisePatrolRemindMessage(); + + /** + * 获取当前客户下所有的社区组织,只返回id,orgIdPath,agencyName + * @param customerId + * @return + */ + @PostMapping("/gov/org/agency/getAllCommunity/{customerId}") + Result> getAllCommunity(@PathVariable(value = "customerId") String customerId); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index befef36cf5..52cf691d6e 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java @@ -474,4 +474,14 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "gridStaffList", dto); } + /** + * 获取当前客户下所有的社区组织,只返回id,orgIdPath,agencyName + * + * @param customerId + * @return + */ + @Override + public Result> getAllCommunity(String customerId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAllCommunity", customerId); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java index c6576dde5e..5624c39127 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java @@ -624,4 +624,17 @@ public class AgencyController { String orgType = input.getOrgType(); return new Result().ok(agencyService.usingCommunityStats(orgId, orgType)); } + + /** + * @param customerId + * @return 获取当前客户下所有的社区组织,只返回id,orgIdPath,agencyName + */ + @PostMapping("getAllCommunity/{customerId}") + public Result> getAllCommunity(@PathVariable(value = "customerId") String customerId) { + if (StringUtils.isBlank(customerId)) { + return new Result<>(); + } + return new Result>().ok(agencyService.getAllCommunity(customerId)); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index ba94cc12ab..e0d4f9f644 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -251,6 +251,17 @@ public class CustomerAgencyController { return new Result().ok(customerAgencyService.staffInAgencyList(tokenDTO.getUserId())); } + /** + * @param tokenDTO + * @return + * @Author sun + * @Description 工作端-查询当前人员所属组织及所有下级组织(到区县级) + **/ + @PostMapping("staffinAgencyLevelList") + public Result staffinAgencyLevelList(@LoginUser TokenDto tokenDTO) { + return new Result().ok(customerAgencyService.staffinAgencyLevelList(tokenDTO.getUserId())); + } + /** * @Description 对外接口,根据customerId返回Element UI中Tree结构的agency列表 * @param map @@ -517,5 +528,40 @@ public class CustomerAgencyController { return customerAgencyService.getCurrentUserCommunityInfo(tokenDTO); } + /** + * @Description: 返回下级数量统计 + * @param agencyId: + * @Return com.epmet.commons.tools.utils.Result> + * @Author: lichao + * @Date: 2023/4/7 14:48 + */ + @GetMapping("getAgencyCountList") + public Result> getAgencyCountList(@RequestParam String agencyId){ + return new Result>().ok(customerAgencyService.getAgencyCountList(agencyId)); + } + + /** + * @Description: 获取下级组织数量统计 + * @param dto: + * @Return com.epmet.commons.tools.utils.Result> + * @Author: lichao + * @Date: 2023/4/7 15:08 + */ + @PostMapping("getCommunityCountList") + public Result> getCommunityCountList(@RequestBody CommunityCountCensusFormDTO dto){ + return new Result>().ok(customerAgencyService.getCommunityCountList(dto)); + } + + /** + * @Description: 根据agencyId获取下级社区列表 + * @param dto: + * @Return com.epmet.commons.tools.utils.Result> + * @Author: lichao + * @Date: 2023/4/7 16:49 + */ + @PostMapping("getCommunityList") + public Result> getCommunityList(@RequestBody CommunityCountCensusFormDTO dto){ + return new Result>().ok(customerAgencyService.getCommunityList(dto)); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java index 53738a3d4c..32062f26c5 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java @@ -691,4 +691,21 @@ public class HouseController implements ResultDataResolver { return new Result>().ok(r); } + /** + * 群租房列表来源于烟台需求 + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("group-rent-house-list") + @MaskResponse(fieldNames = {"ownerIdCard", "ownerPhone"}, + fieldsMaskType = {MaskResponse.MASK_TYPE_ID_CARD, MaskResponse.MASK_TYPE_MOBILE}) + public Result> groupRentHouseList(@LoginUser TokenDto tokenDto, @RequestBody GroupRentHouseFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + return new Result>().ok(houseService.groupRentHouseList(formDTO)); + } + + + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcEnterpriseController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcEnterpriseController.java index 7d9afd1a83..ab66b5aa4f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcEnterpriseController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcEnterpriseController.java @@ -22,14 +22,15 @@ import com.epmet.commons.tools.utils.*; import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.constants.ImportTaskConstants; -import com.epmet.dto.IcEnterpriseChangeRecordDTO; import com.epmet.dto.form.EnterpriseFormDTO; import com.epmet.dto.form.EnterprisePageFormDTO; import com.epmet.dto.form.EnterprisePatrolFormDTO; import com.epmet.dto.form.ImportTaskCommonFormDTO; +import com.epmet.dto.form.yt.EnterpriseCountPlaceTypeFormDTO; import com.epmet.dto.result.EnterpriseDetailDTO; import com.epmet.dto.result.EnterprisePatrolResultDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; +import com.epmet.dto.result.yt.EnterpriseCountPlaceTypeResDTO; import com.epmet.excel.EnterpriseExportExcelDTO; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.service.IcEnterpriseService; @@ -69,6 +70,7 @@ public class IcEnterpriseController implements ResultDataResolver { private IcEnterpriseService icEnterpriseService; @Autowired private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; + /** * 企事业单位巡查】新增/编辑 * @@ -359,4 +361,17 @@ public class IcEnterpriseController implements ResultDataResolver { icEnterpriseService.qrCodeExport(formDTO,response); } + /** + * 九小场所分析:返回各个场所类型的数量 + * + * @param formDTO + * @return + */ + @PostMapping("count-type") + public Result countType(@RequestBody EnterpriseCountPlaceTypeFormDTO formDTO) { + return new Result().ok(icEnterpriseService.countType(formDTO.getOrgId(), formDTO.getOrgType())); + } + + + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java index c2420c0832..7c8bdc939f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java @@ -17,24 +17,47 @@ package com.epmet.controller; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.write.metadata.WriteSheet; +import com.alibaba.excel.write.metadata.style.WriteCellStyle; +import com.alibaba.excel.write.style.HorizontalCellStyleStrategy; +import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; +import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.MaskResponse; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.dto.form.PageFormDTO; import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.IcHouseDTO; import com.epmet.dto.form.CheckHouseInfoFormDTO; +import com.epmet.dto.form.HouseCountPictureFormDTO; import com.epmet.dto.form.HouseFormDTO; -import com.epmet.dto.result.HouseAgencyInfoResultDTO; -import com.epmet.dto.result.HouseInfoDTO; -import com.epmet.dto.result.HouseListResultDTO; -import com.epmet.dto.result.HousesNameResultDTO; +import com.epmet.dto.result.*; +import com.epmet.excel.EnterpriseExportExcelDTO; +import com.epmet.excel.HousePictureListExcelDTO; import com.epmet.service.IcHouseService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.poi.ss.usermodel.IndexedColors; +import org.apache.poi.ss.usermodel.VerticalAlignment; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.Date; import java.util.List; import java.util.Map; @@ -45,6 +68,7 @@ import java.util.Map; * @author generator generator@elink-cn.com * @since v1.0.0 2021-10-25 */ +@Slf4j @RestController @RequestMapping("ichouse") public class IcHouseController { @@ -161,4 +185,85 @@ public class IcHouseController { return icHouseService.checkHomeInfo(formDTO); } + /** + * @Description: 房屋画像-用途统计 + * @param dto: + * @Return com.epmet.commons.tools.utils.Result + * @Author: lichao + * @Date: 2023/4/11 15:08 + */ + @PostMapping("getHousePurposeCount") + public Result getHousePurposeCount(@RequestBody HouseCountPictureFormDTO dto){ + return new Result().ok(icHouseService.getHousePurposeCount(dto)); + } + + + /** + * @Description: 房屋画像-状态统计 + * @param dto: + * @Return com.epmet.commons.tools.utils.Result + * @Author: lichao + * @Date: 2023/4/11 15:07 + */ + @PostMapping("getHouseStatusCount") + public Result getHouseStatusCount(@RequestBody HouseCountPictureFormDTO dto){ + return new Result().ok(icHouseService.getHouseStatusCount(dto)); + } + + /** + * @Description: 房屋画像-列表 + * @param dto: + * @Return com.epmet.commons.tools.utils.Result> + * @Author: lichao + * @Date: 2023/4/11 16:20 + */ + @PostMapping("getHousePictureList") + public Result> getHousePictureList(@RequestBody HouseCountPictureFormDTO dto){ + return new Result>().ok(icHouseService.getHousePictureList(dto)); + } + + @PostMapping("export") + public void export(@RequestBody HouseCountPictureFormDTO formDTO, HttpServletResponse response) throws IOException { + ExcelWriter excelWriter = null; + formDTO.setPageNo(NumConstant.ONE); + formDTO.setPageSize(NumConstant.TEN_THOUSAND); + try { + String fileName = "房屋列表" + DateUtils.format(new Date()) + ".xlsx"; + // 头的策略 + WriteCellStyle headWriteCellStyle = new WriteCellStyle(); + // 背景设置为红色 + headWriteCellStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex()); + WriteCellStyle contentWriteCellStyle = new WriteCellStyle(); + contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER); + HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle); + FreezeAndFilter writeHandler = new FreezeAndFilter(); + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), HousePictureListExcelDTO.class) + .registerWriteHandler(horizontalCellStyleStrategy) + .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) + .registerWriteHandler(writeHandler).build(); + WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build(); + PageData data = null; + List list = null; + do { + data = icHouseService.getHousePictureList(formDTO); + list = ConvertUtils.sourceToTarget(data.getList(), HousePictureListExcelDTO.class); + formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE); + excelWriter.write(list, writeSheet); + } while (CollectionUtils.isNotEmpty(list) && list.size() == formDTO.getPageSize()); + } catch (EpmetException e) { + response.reset(); + response.setCharacterEncoding("UTF-8"); + response.setHeader("content-type", "application/json; charset=UTF-8"); + PrintWriter printWriter = response.getWriter(); + Result result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), e.getMsg()); + printWriter.write(JSON.toJSONString(result)); + printWriter.close(); + } catch (Exception e) { + log.error("房屋列表导出异常export exception", e); + } finally { + if (excelWriter != null) { + excelWriter.finish(); + } + } + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffLoginLogController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffLoginLogController.java new file mode 100644 index 0000000000..c2967945f7 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffLoginLogController.java @@ -0,0 +1,154 @@ +package com.epmet.controller; + +import com.alibaba.nacos.client.naming.utils.CollectionUtils; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.yt.CommunityLoginFormDTO; +import com.epmet.dto.form.yt.CountActivityFormDTO; +import com.epmet.dto.form.yt.LoginLogCountByLevelFormDTO; +import com.epmet.dto.result.yt.ActivityTatalInfo; +import com.epmet.dto.result.yt.CommunityLoginResultDTO; +import com.epmet.dto.result.yt.LoginLogCountByLevelResultDTO; +import com.epmet.excel.yt.AccountActivityExcel; +import com.epmet.excel.yt.AccountInactivityExcel; +import com.epmet.service.StaffLoginLogService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.epmet.dto.result.yt.AccountActivityInfo; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + + +/** + * 工作人员登录日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-04 + */ +@RestController +@RequestMapping("staffLoginLog") +public class StaffLoginLogController { + + @Autowired + private StaffLoginLogService staffLoginLogService; + + + /** + * 返回市级账号登录总次数、区县级账号登录总次数、镇街级账号登录总次数、社区级账号登录总次数 + * + * @param formDTO + * @return + */ + @PostMapping("count-level") + public Result countLevel(@RequestBody LoginLogCountByLevelFormDTO formDTO) { + return new Result().ok(staffLoginLogService.countLevel(formDTO.getOrgId(), formDTO.getLevel(), formDTO.getStartDate(), formDTO.getEndDate())); + } + + /** + * 下级社区账号登录次数排名 + * + * @return + */ + @PostMapping("community-count") + public Result> communityCount(@RequestBody CommunityLoginFormDTO formDTO) { + return new Result>().ok(staffLoginLogService.pageCommunityCount(formDTO)); + } + + /** + * 柱状图:下级组织账号登录次数汇总 + * + * @param formDTO + * @return + */ + @PostMapping("sub-count") + public Result> querySubCount(@RequestBody LoginLogCountByLevelFormDTO formDTO) { + return new Result>().ok(staffLoginLogService.querySubCount(formDTO.getOrgId(), formDTO.getLevel(), formDTO.getStartDate(), formDTO.getEndDate())); + } + + /** + * 查看区县 + * + * @param formDTO + * @return + */ + @PostMapping("district-count") + public Result> districtCount(@RequestBody CommunityLoginFormDTO formDTO) { + return new Result>().ok(staffLoginLogService.pageDistrictCount(formDTO.getOrgId(), + formDTO.getLevel(), formDTO.getStartDate(), + formDTO.getEndDate(), formDTO.getIsPage(), + formDTO.getPageNo(), formDTO.getPageSize())); + } + + /** + * 查看街镇 + * + * @param formDTO + * @return + */ + @PostMapping("street-count") + public Result> streetCount(@RequestBody CommunityLoginFormDTO formDTO) { + return new Result>().ok(staffLoginLogService.streetCount(formDTO.getOrgId(), + formDTO.getStartDate(), + formDTO.getEndDate(), formDTO.getIsPage(), + formDTO.getPageNo(), formDTO.getPageSize())); + } + + /*** + * 获取当前agencyid下 下级组织活跃情况 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author qushutong + * @date 2023/4/6 13:41 + */ + @PostMapping("getAccountActivityInfo") + public Result> getAccountActivityInfo(@RequestBody CountActivityFormDTO formDTO) { + return new Result>().ok(staffLoginLogService.getAccountActivityInfo(formDTO)); + } + + /*** + * 获取活跃度总数 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author qushutong + * @date 2023/4/6 17:35 + */ + @PostMapping("getActivityTotal") + public Result getActivityTotal(@RequestBody CountActivityFormDTO formDTO) { + return new Result().ok(staffLoginLogService.getActivityTotal(formDTO)); + } + + + /*** + * 导出活跃 + * @param response + * @param tokenDto + * @param formDTO + * @return void + * @author qushutong + * @date 2023/4/6 18:04 + */ + @PostMapping("accountActivityInfo-export") + public void analysisExport(HttpServletResponse response, @LoginUser TokenDto tokenDto, @RequestBody CountActivityFormDTO formDTO) throws Exception { + formDTO.setIsPage(false); + PageData res = staffLoginLogService.getAccountActivityInfo(formDTO); + if (!CollectionUtils.isEmpty(res.getList())) { + if("1".equals(formDTO.getIsActivity())){ +// List accountActivityExcels = ConvertUtils.sourceToTarget(res.getList(), AccountActivityExcel.class); + ExcelUtils.exportExcelToTarget(response, null, res.getList(), AccountActivityExcel.class); + }else { +// List accountActivityExcels = ConvertUtils.sourceToTarget(res.getList(), AccountInactivityExcel.class); + ExcelUtils.exportExcelToTarget(response, null, res.getList(), AccountInactivityExcel.class); + } + + } + } + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java index 7e98f598f8..5639d33894 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java @@ -108,6 +108,8 @@ public interface CustomerAgencyDao extends BaseDao { **/ List selectSubAgencyList(@Param("subAgencyPids") String subAgencyPids); + List selectSubAgencyLevelList(@Param("subAgencyPids") String subAgencyPids); + /** * 查询客户根级组织 * @@ -195,6 +197,8 @@ public interface CustomerAgencyDao extends BaseDao { **/ AgencyResultDTO selectAgencyByStaffId(@Param("staffId") String staffId); +// AgencyResultDTO selectAgencyByLevelStaffId(@Param("staffId") String staffId); + /** * @param customerId * @param pid @@ -422,5 +426,22 @@ public interface CustomerAgencyDao extends BaseDao { * @return */ Integer selectTotalNext(String agencyId); + + /** + * 获取当前客户下所有的社区组织,只返回id,orgIdPath,agencyName + * @param customerId + * @return + */ + List getAllCommunity(String customerId); + + List agencyCount(@Param("pids") String pids); + + Integer agencyGridCount(@Param("pids") String pids); + + Integer agencyStaffCount(@Param("pids") String pids); + + Integer getCommunityCount(@Param("pids")String pids,@Param("timeStart")Date timeStart,@Param("timeEnd")Date timeEnd); + + List getCommunityByPidList (@Param("pids")String pids,@Param("timeStart")Date timeStart,@Param("timeEnd")Date timeEnd); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcEnterpriseDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcEnterpriseDao.java index 40bdde151e..95d7119471 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcEnterpriseDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcEnterpriseDao.java @@ -3,6 +3,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.form.EnterprisePageFormDTO; import com.epmet.dto.result.EnterpriseDetailDTO; +import com.epmet.dto.result.yt.EnterpriseCountPlaceTypeDetailDTO; import com.epmet.entity.IcEnterpriseEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -32,4 +33,14 @@ public interface IcEnterpriseDao extends BaseDao { List selectList(EnterprisePageFormDTO formDTO); List selectForUniqueName(@Param("gridId") String gridId, @Param("placeOrgName") String placeOrgName, @Param("enterpriseId") String enterpriseId); + + /** + * 按场所类型 + * @param orgId + * @param orgType + * @return + */ + List selectCountByPlaceType(@Param("customerId")String customerId, + @Param("orgId") String orgId, + @Param("orgType") String orgType); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java index 1f3ceacfe5..f28987ad72 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java @@ -2,10 +2,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.ImportGeneralDTO; -import com.epmet.dto.form.CheckHouseInfoFormDTO; -import com.epmet.dto.form.GetHouseInfoToCollectFormDTO; -import com.epmet.dto.form.HouseChartFormDTO; -import com.epmet.dto.form.IcHouseListFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.CustomerOrgParameterEntity; import com.epmet.entity.IcHouseEntity; @@ -13,6 +10,7 @@ import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.math.BigDecimal; +import java.util.Date; import java.util.List; import java.util.Set; @@ -213,4 +211,18 @@ public interface IcHouseDao extends BaseDao { List houseStatisListDetail(HouseChartFormDTO formDTO); List selectListForRenFangStats(@Param("buildingId") String buildingId); + + /** + * 群租房列表 + * 群租房:出租状态并超过5人(≥5) + * @param formDTO + * @return + */ + List selectGroupRentHouseList(GroupRentHouseFormDTO formDTO); + + List getHousePurposeCount(@Param("orgId") String orgId, @Param("timeStart")Date timeStart,@Param("timeEnd")Date timeEnd); + + List getHouseStatusCount(@Param("orgId") String orgId, @Param("timeStart")Date timeStart,@Param("timeEnd")Date timeEnd); + + List getHousePictureList(@Param("orgId") String orgId, @Param("timeStart")Date timeStart,@Param("timeEnd")Date timeEnd,@Param("purpose") String purpose,@Param("rentFlag") Integer rentFlag); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffLoginLogDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffLoginLogDao.java new file mode 100644 index 0000000000..0db1338752 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffLoginLogDao.java @@ -0,0 +1,75 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.yt.CountActivityFormDTO; +import com.epmet.dto.result.yt.ActivityTatalInfo; +import com.epmet.dto.result.yt.CommunityLoginResultDTO; +import com.epmet.dto.result.yt.AccountActivityInfo; +import com.epmet.entity.StaffLoginLogEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +/** + * 工作人员登录日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-04 + */ +@Mapper +public interface StaffLoginLogDao extends BaseDao { + + /** + * 各社区登录总次数 + * + * @param orgId + * @param startDate + * @param endDate + * @return + */ + List pageCommunityCount(@Param("orgId") String orgId, + @Param("startDate") Date startDate, + @Param("endDate") Date endDate); + + /** + * 柱状图:下级组织账号登录次数汇总 + * + * @param orgId + * @param startDate + * @param endDate + * @return + */ + List querySubCount(@Param("orgId") String orgId, + @Param("startDate") Date startDate, + @Param("endDate") Date endDate); + + /** + * 各区县登录总次数 + * + * @param orgId + * @param startDate + * @param endDate + * @return + */ + List pageDistrictCount(@Param("orgId") String orgId, + @Param("startDate") Date startDate, + @Param("endDate") Date endDate); + + List pageStreetCount(@Param("orgId") String orgId, + @Param("startDate") Date startDate, + @Param("endDate") Date endDate); + + /*** + * 获取登陆情况 + * @param formDTO + * @return com.epmet.dto.result.yt.AccountActivityInfo + * @author qushutong + * @date 2023/4/6 13:47 + */ + List selectListActivityInfo(CountActivityFormDTO formDTO); + + + ActivityTatalInfo selectOneActivityTotal(CountActivityFormDTO formDTO); +} \ No newline at end of file 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/StaffLoginLogEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/StaffLoginLogEntity.java new file mode 100644 index 0000000000..35926c1c78 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/StaffLoginLogEntity.java @@ -0,0 +1,73 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 工作人员登录日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-04 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("staff_login_log") +public class StaffLoginLogEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 工作端用户id + */ + private String staffId; + + /** + * 工作人员姓名 + */ + private String staffName; + + /** + * 工作人员手机号 + */ + private String mobile; + + /** + * 工作人员所属组织id;组织名称在customer_agency + */ + private String agencyId; + + /** + * 组织级别(社区级:community, +乡(镇、街道)级:street, +区县级: district, +市级: city +省级:province) + */ + private String agencyLevel; + + /** + * agency_id的直属上级;如果是根组织的用户登录,pid=0或者pid='' + */ + private String pid; + + /** + * AGENCY_ID全路径,包含agency_id自身 + */ + private String orgIdPath; + + /** + * 登录时间 + */ + private Date loginTime; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/HousePictureListExcelDTO.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/HousePictureListExcelDTO.java new file mode 100644 index 0000000000..b6cc195a81 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/HousePictureListExcelDTO.java @@ -0,0 +1,50 @@ +package com.epmet.excel; + +import com.alibaba.excel.annotation.ExcelIgnore; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.Data; + +import java.util.Date; + +/** + * 企事业单位导出excel + */ +@Data +public class HousePictureListExcelDTO { + + + @ExcelIgnore + private String houseId; + + @ExcelProperty(value = "区县") + @ColumnWidth(25) + private String districtName; + + @ExcelProperty(value = "镇街") + @ColumnWidth(25) + private String streetName; + + @ExcelProperty(value = "社区") + @ColumnWidth(25) + private String communityName; + + @ExcelProperty(value = "网格") + @ColumnWidth(25) + private String gridName; + + @ExcelProperty(value = "房屋名称") + @ColumnWidth(25) + private String houseName; + + @ExcelProperty(value = "房屋用途") + @ColumnWidth(25) + private String purposeName; + + @ExcelProperty(value = "房屋状态") + @ColumnWidth(25) + private String rentFlagName; + @ExcelIgnore + private String orgIdPath; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/yt/AccountActivityExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/yt/AccountActivityExcel.java new file mode 100644 index 0000000000..4c7d6bd6f5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/yt/AccountActivityExcel.java @@ -0,0 +1,45 @@ +package com.epmet.excel.yt; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.io.Serializable; + + +/** + * @author: qushutong + * @Date: 2023/4/6 13:33 + * @Description: 账户活跃情况 + */ +@Data +public class AccountActivityExcel implements Serializable { + private static final long serialVersionUID = -918630886413844674L; + + /** + * 组织名称 + */ + @Excel(name = "组织名称") + private String agencyName = ""; + + /** + * 登陆次数 + */ + @Excel(name = "登陆次数") + private String loginCount = ""; + + /** + * 活跃账号数 + */ + @Excel(name = "活跃账号数") + private String accountActivityCount = ""; + + + /** + * 总账号数 + */ + @Excel(name = "总账号数") + private String accountCount = ""; + + + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/yt/AccountInactivityExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/yt/AccountInactivityExcel.java new file mode 100644 index 0000000000..6635ab63c9 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/yt/AccountInactivityExcel.java @@ -0,0 +1,28 @@ +package com.epmet.excel.yt; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.io.Serializable; + + +/** + * @author: qushutong + * @Date: 2023/4/6 13:33 + * @Description: 账户不活跃情况 + */ +@Data +public class AccountInactivityExcel implements Serializable { + private static final long serialVersionUID = -918630886413844674L; + + /** + * 组织名称 + */ + @Excel(name = "组织名称") + private String agencyName = ""; + + + + + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java index 86f257d9aa..f05f5e0098 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java @@ -5,6 +5,7 @@ import com.epmet.commons.rocketmq.constants.TopicConstants; import com.epmet.commons.rocketmq.register.MQAbstractRegister; import com.epmet.commons.rocketmq.register.MQConsumerProperties; import com.epmet.mq.listener.InitCustomerOrgRolesListener; +import com.epmet.mq.listener.StaffLoginLogListener; import org.apache.rocketmq.common.protocol.heartbeat.MessageModel; import org.springframework.stereotype.Component; @@ -32,5 +33,10 @@ public class RocketMQConsumerRegister extends MQAbstractRegister { new InitCustomerOrgRolesListener()); // ...其他监听器类似 + register(consumerProperties, + ConsomerGroupConstants.STAFF_LOGIN_LOG_GROUP, + MessageModel.CLUSTERING, + TopicConstants.AUTH, "login", + new StaffLoginLogListener()); } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/mq/listener/StaffLoginLogListener.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/mq/listener/StaffLoginLogListener.java new file mode 100644 index 0000000000..6f850bf554 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/mq/listener/StaffLoginLogListener.java @@ -0,0 +1,110 @@ +package com.epmet.mq.listener; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.rocketmq.constants.MQUserPropertys; +import com.epmet.commons.rocketmq.messages.LoginMQMsg; +import com.epmet.commons.tools.distributedlock.DistributedLock; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.utils.SpringContextUtils; +import com.epmet.service.StaffLoginLogService; +import org.apache.commons.lang3.StringUtils; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; +import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; +import org.apache.rocketmq.common.message.MessageExt; +import org.redisson.api.RLock; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; +import java.util.concurrent.TimeUnit; + +/** + * @author wxz + * @Description 登录操作日志监听器 + + * @return + * @date 2021.06.07 16:12 + */ +public class StaffLoginLogListener implements MessageListenerConcurrently { + + private Logger logger = LoggerFactory.getLogger(getClass()); + + private RedisUtils redisUtils; + + @Override + public ConsumeConcurrentlyStatus consumeMessage(List msgs, ConsumeConcurrentlyContext context) { + + if (redisUtils == null) { + redisUtils = SpringContextUtils.getBean(RedisUtils.class); + } + + try { + msgs.forEach(msg -> consumeMessage(msg)); + } catch (Exception e) { + logger.error(ExceptionUtils.getErrorStackTrace(e)); + return ConsumeConcurrentlyStatus.RECONSUME_LATER; + } + return ConsumeConcurrentlyStatus.CONSUME_SUCCESS; + } + + private void consumeMessage(MessageExt messageExt) { + String tags = messageExt.getTags(); + // msg示例: + // { + // "userId": "5198ef9e3644c4f49457d2b551a1432e", + // "appId": "数字社区登录", + // "loginTime": "2023-04-04 14:05:37", + // "ip": "219.146.91.110", + // "fromApp": "gov", + // "fromClient": "web" + // } + String msg = new String(messageExt.getBody()); + String pendingMsgLabel = messageExt.getUserProperty(MQUserPropertys.BLOCKED_MSG_LABEL); + logger.info("工作人员登录操作日志监听器-收到消息内容:{}", msg); + LoginMQMsg msgObj = JSON.parseObject(msg, LoginMQMsg.class); + + DistributedLock distributedLock = null; + RLock lock = null; + try { + distributedLock = SpringContextUtils.getBean(DistributedLock.class); + lock = distributedLock.getLock(String.format("lock:staff_login_log:%s:%s", tags, msgObj.getUserId()), + 30L, 30L, TimeUnit.SECONDS); + SpringContextUtils.getBean(StaffLoginLogService.class).saveLog(msgObj.getUserId(),msgObj.getLoginTime()); + } catch (RenException e) { + // 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试 + logger.error("【RocketMQ】工作人员登录添加操作日志失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + } catch (Exception e) { + // 不是我们自己抛出的异常,可以让MQ重试 + logger.error("【RocketMQ】工作人员登录添加操作日志失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + throw e; + } finally { + distributedLock.unLock(lock); + } + + if (StringUtils.isNotBlank(pendingMsgLabel)) { + try { + removePendingMqMsgCache(pendingMsgLabel); + } catch (Exception e) { + logger.error("【工作人员登录操作事件监听器】-删除mq阻塞消息缓存失败:{}", ExceptionUtils.getErrorStackTrace(e)); + } + } + } + + /** + * @description + * + * @param pendingMsgLabel + * @return + * @author wxz + * @date 2021.10.14 16:32:32 + */ + private void removePendingMqMsgCache(String pendingMsgLabel) { + String key = RedisKeys.blockedMqMsgKey(pendingMsgLabel); + redisUtils.delete(key); + //logger.info("【登录操作事件监听器】删除pendingMsgLabel成功:{}", pendingMsgLabel); + } +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java index d7bb4b2564..5d2a97ba5c 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java @@ -204,4 +204,11 @@ public interface AgencyService { * @return */ UsingCommunityStatsResultDTO usingCommunityStats(String orgId, String orgType); + + /** + * 获取当前客户下所有的社区组织,只返回id,orgIdPath,agencyName + * @param customerId + * @return + */ + List getAllCommunity(String customerId); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java index f9ac7182e7..f43de77102 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java @@ -18,7 +18,6 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; @@ -216,6 +215,9 @@ public interface CustomerAgencyService extends BaseService **/ StaffInAgencyListResultDTO staffInAgencyList(String staffId); + StaffInAgencyListResultDTO staffinAgencyLevelList(String staffId); + + /** * @Description 运营端-返回element ui - tree 结构agency列表 * @param customerId @@ -355,4 +357,37 @@ public interface CustomerAgencyService extends BaseService * @Date 2022/11/30 22:41 **/ Result> getCurrentUserCommunityInfo(TokenDto tokenDTO); + + /** + * 返回组织的orgIdPath:包含自身 + * + * @param orgId + * @return + */ + String getOrgIdPath(String orgId); + + /** + * 返回下级数量 + * @param agencyId + * @return + */ + List getAgencyCountList(String agencyId); + + /** + * @Description: 获取下级组织的社区数量 + * @param dto: + * @Return java.util.List + * @Author: lichao + * @Date: 2023/4/7 15:09 + */ + List getCommunityCountList(CommunityCountCensusFormDTO dto); + + /** + * @Description: 根据agencyId获取下级社区列表 + * @param dto: + * @Return java.util.List + * @Author: lichao + * @Date: 2023/4/7 16:49 + */ + PageData getCommunityList(CommunityCountCensusFormDTO dto); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java index 1161a1ee9f..8499b55722 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java @@ -204,4 +204,11 @@ public interface HouseService { PageData houseStatisListDetail(HouseChartFormDTO formDTO); PageData usingCommunityUserHouseStats(String orgId, String orgType, Integer pageNo, Integer pageSize); + + /** + * 群租房列表来源于烟台需求 + * @param formDTO + * @return + */ + PageData groupRentHouseList(GroupRentHouseFormDTO formDTO); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcEnterpriseService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcEnterpriseService.java index e141e008e3..5868cb805b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcEnterpriseService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcEnterpriseService.java @@ -2,19 +2,17 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; -import com.epmet.dto.IcEnterpriseChangeRecordDTO; import com.epmet.dto.form.EnterpriseFormDTO; import com.epmet.dto.form.EnterprisePageFormDTO; import com.epmet.dto.form.EnterprisePatrolFormDTO; import com.epmet.dto.result.EnterpriseDetailDTO; import com.epmet.dto.result.EnterprisePatrolResultDTO; +import com.epmet.dto.result.yt.EnterpriseCountPlaceTypeResDTO; import com.epmet.entity.IcEnterpriseEntity; import javax.servlet.http.HttpServletResponse; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.nio.file.Path; -import java.util.List; import java.util.Map; /** @@ -103,4 +101,12 @@ public interface IcEnterpriseService extends BaseService { */ void qrCodeExport(EnterprisePageFormDTO formDTO, HttpServletResponse response) throws IOException; + /** + * 九小场所分析:返回各个场所类型的数量 + * + * @param orgId + * @param orgType + * @return + */ + EnterpriseCountPlaceTypeResDTO countType(String orgId, String orgType); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java index 0855d78104..72fa7d2674 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java @@ -2,12 +2,14 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.IcHouseDTO; import com.epmet.dto.ImportGeneralDTO; import com.epmet.dto.form.CheckHouseInfoFormDTO; import com.epmet.dto.form.DetailByTypeFormDTO; +import com.epmet.dto.form.HouseCountPictureFormDTO; import com.epmet.dto.form.HouseFormDTO; import com.epmet.dto.result.*; import com.epmet.entity.IcHouseEntity; @@ -139,4 +141,9 @@ public interface IcHouseService extends BaseService { Result checkHomeInfo(CheckHouseInfoFormDTO formDTO); + HouseCountPictureResultDTO getHousePurposeCount(HouseCountPictureFormDTO dto); + + HouseCountPictureResultDTO getHouseStatusCount(HouseCountPictureFormDTO dto); + + PageData getHousePictureList(HouseCountPictureFormDTO dto); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffLoginLogService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffLoginLogService.java new file mode 100644 index 0000000000..5d39463647 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffLoginLogService.java @@ -0,0 +1,97 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.form.yt.CommunityLoginFormDTO; +import com.epmet.dto.form.yt.CountActivityFormDTO; +import com.epmet.dto.result.yt.ActivityTatalInfo; +import com.epmet.dto.result.yt.CommunityLoginResultDTO; +import com.epmet.dto.result.yt.LoginLogCountByLevelResultDTO; +import com.epmet.dto.result.yt.AccountActivityInfo; +import com.epmet.entity.StaffLoginLogEntity; + +import java.util.Date; + +/** + * 工作人员登录日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-04 + */ +public interface StaffLoginLogService extends BaseService { + /** + * 登录,插入记录 + * + * @param staffId + * @param loginTime + */ + void saveLog(String staffId, Date loginTime); + + /** + * 返回市级账号登录总次数、区县级账号登录总次数、镇街级账号登录总次数、社区级账号登录总次数 + * + * @param orgId 为空时,默认当前登录用户所属组织id + * @param level + * @param startDate yyyy-MM-dd + * @param endDate yyyy-MM-dd + * @return + */ + LoginLogCountByLevelResultDTO countLevel(String orgId, String level, Date startDate, Date endDate); + + /** + * 下级社区账号登录次数排名 + * + * @param formDTO + * @return + */ + PageData pageCommunityCount(CommunityLoginFormDTO formDTO); + + /** + * 柱状图:下级组织账号登录次数汇总 + * + * @param orgId + * @param level + * @param startDate + * @param endDate + * @return + */ + PageData querySubCount(String orgId, String level, Date startDate, Date endDate); + + /** + * 查看区县 + * + * @param orgId + * @param level + * @param startDate + * @param endDate + * @param isPage + * @param pageNo + * @param pageSize + * @return + */ + PageData pageDistrictCount(String orgId, String level, Date startDate, Date endDate, Boolean isPage, Integer pageNo, Integer pageSize); + + /** + * 查看街镇 + * + * @param orgId + * @param startDate + * @param endDate + * @param isPage + * @param pageNo + * @param pageSize + * @return + */ + PageData streetCount(String orgId, Date startDate, Date endDate, Boolean isPage, Integer pageNo, Integer pageSize); + + /*** + * 获取登陆情况 + * @param formDTO + * @return com.epmet.dto.result.yt.AccountActivityInfo + * @author qushutong + * @date 2023/4/6 13:47 + */ + PageData getAccountActivityInfo(CountActivityFormDTO formDTO); + + ActivityTatalInfo getActivityTotal(CountActivityFormDTO formDTO); +} \ 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..31d49852b7 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); @@ -1167,4 +1168,15 @@ public class AgencyServiceImpl implements AgencyService { return orgPids.concat(":").concat(orgId); } + + /** + * 获取当前客户下所有的社区组织,只返回id,orgIdPath,agencyName + * + * @param customerId + * @return + */ + @Override + public List getAllCommunity(String customerId) { + return customerAgencyDao.getAllCommunity(customerId); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index a6702963c4..91a6a52dc8 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -17,6 +17,7 @@ package com.epmet.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -37,12 +38,14 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.PidUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.CustomerAgencyConstant; import com.epmet.constant.CustomerGridConstant; import com.epmet.dao.*; import com.epmet.dto.*; import com.epmet.dto.form.*; +import com.epmet.dto.region.LogOperationResultDTO; import com.epmet.dto.result.*; import com.epmet.entity.CustomerAgencyEntity; import com.epmet.entity.CustomerDepartmentEntity; @@ -56,6 +59,8 @@ import com.epmet.feign.OperCrmFeignClient; import com.epmet.redis.CustomerAgencyRedis; import com.epmet.service.CustomerAgencyService; import com.epmet.util.ModuleConstant; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -681,6 +686,17 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl getDepartmentLevelList(String subAgencyPids) { + List subAgencyList = baseDao.selectSubAgencyLevelList(subAgencyPids); + if (subAgencyList.size() > NumConstant.ZERO) { + for (AgencySubResultDTO sub : subAgencyList) { + List subAgency = getDepartmentLevelList(sub.getPids() + ":" + sub.getAgencyId()); + sub.setSubAgencyList(subAgency); + } + } + return subAgencyList; + } + /** * @param staffId * @return @@ -1052,6 +1068,24 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl%s", staffId)); + throw new RenException(CustomerAgencyConstant.SELECT_STAFF_AGENCY_EXCEPTION); + } + resultDTO.setAgencyList(agencyList); + + //2.递归查询所有下级组织信息 + List subAgencyList = getDepartmentLevelList(("".equals(agencyList.getPids()) ? "" : agencyList.getPids() + ":") + agencyList.getAgencyId()); + resultDTO.setSubAgencyList(subAgencyList); + + return resultDTO; + } + /** * @param customerId * @return com.epmet.dto.result.AgencyElementTreeResultDTO @@ -1193,6 +1227,7 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl>().ok(list); } + /** + * 返回组织的orgIdPath:包含自身 + * + * @param orgId + * @return + */ + @Override + public String getOrgIdPath(String orgId) { + CustomerAgencyEntity customerAgencyEntity = baseDao.selectById(orgId); + if (null == customerAgencyEntity) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode()); + } + if (StringUtils.isBlank(customerAgencyEntity.getPid()) || NumConstant.ZERO_STR.equals(customerAgencyEntity.getPid())) { + return orgId; + } + return customerAgencyEntity.getPids().concat(StrConstant.COLON).concat(orgId); + } + + /** + * @Description: + * @param agencyId: + * @Return java.util.List + * @Author: lichao + * @Date: 2023/4/7 14:17 + */ + @Override + public List getAgencyCountList(String agencyId) { + + List agencyCountCensusResultDTOS = new ArrayList<>(); + + CustomerAgencyEntity customerAgency = baseDao.selectById(agencyId); + if (customerAgency != null){ + String pids = PidUtils.convertPid2OrgIdPath(customerAgency.getId(),customerAgency.getPids()); + + agencyCountCensusResultDTOS = baseDao.agencyCount(pids); + AgencyCountCensusResultDTO agencyCountCensusResultDTOGrid = new AgencyCountCensusResultDTO(); + agencyCountCensusResultDTOGrid.setLevel("grid"); + agencyCountCensusResultDTOGrid.setCount(baseDao.agencyGridCount(pids)); + agencyCountCensusResultDTOS.add(agencyCountCensusResultDTOGrid); + + AgencyCountCensusResultDTO agencyCountCensusResultDTOStaff = new AgencyCountCensusResultDTO(); + agencyCountCensusResultDTOStaff.setLevel("staff"); + agencyCountCensusResultDTOStaff.setCount(baseDao.agencyStaffCount(pids)); + agencyCountCensusResultDTOS.add(agencyCountCensusResultDTOStaff); + + }else{ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"获取用户组织信息异常","获取用户组织信息异常"); + } + return agencyCountCensusResultDTOS; + } + + @Override + public List getCommunityCountList(CommunityCountCensusFormDTO dto) { + + List resultDTOS = new ArrayList<>(); + + CustomerAgencyEntity customerAgency = baseDao.selectById(dto.getAgencyId()); + if (customerAgency!=null){ + String pids = PidUtils.convertPid2OrgIdPath(customerAgency.getId(),customerAgency.getPids()); + + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper().eq(CustomerAgencyEntity::getPids,pids); + List agencyEntityList = baseDao.selectList(queryWrapper); + agencyEntityList.forEach( + entity->{ + CommunityCountCensusResultDTO communityCountCensusResultDTO = new CommunityCountCensusResultDTO(); + communityCountCensusResultDTO.setAgencyId(entity.getId()); + communityCountCensusResultDTO.setAgencyName(entity.getOrganizationName()); + String agencyPids = PidUtils.convertPid2OrgIdPath(entity.getId(),entity.getPids()); + communityCountCensusResultDTO.setCount(baseDao.getCommunityCount(agencyPids,dto.getTimeStart(),dto.getTimeEnd())); + resultDTOS.add(communityCountCensusResultDTO); + } + ); + + }else { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"获取用户组织信息异常","获取用户组织信息异常"); + } + + return resultDTOS; + } + + @Override + public PageData getCommunityList(CommunityCountCensusFormDTO dto) { + + CustomerAgencyEntity customerAgency = baseDao.selectById(dto.getAgencyId()); + if (customerAgency!=null){ + + String pids = PidUtils.convertPid2OrgIdPath(customerAgency.getId(),customerAgency.getPids()); + + PageHelper.startPage(dto.getPageNum(), dto.getPageSize()); + List entityList = baseDao.getCommunityByPidList(pids,dto.getTimeStart(),dto.getTimeEnd()); + + entityList.forEach( + entity->{ + String[] pidArray = entity.getPids().split(":"); + + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper().in(CustomerAgencyEntity::getId,pidArray); + List customerAgencyEntities = baseDao.selectList(queryWrapper); + for (CustomerAgencyEntity customerAgencyEntity : customerAgencyEntities) { + if (customerAgencyEntity.getLevel().equals("district")){ + entity.setDistrictName(customerAgencyEntity.getOrganizationName()); + } + if (customerAgencyEntity.getLevel().equals("street")){ + entity.setStreeName(customerAgencyEntity.getOrganizationName()); + } + } + } + ); + + PageInfo pageInfo = new PageInfo<>(entityList); + return new PageData<>(entityList, pageInfo.getTotal(),dto.getPageSize()); + + + }else { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"获取用户组织信息异常","获取用户组织信息异常"); + } + + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java index baf6ad7abd..10b1be7d14 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java @@ -1485,4 +1485,30 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { agencyNamePathList.add(agencyInfo.getOrganizationName()); return String.join("-", agencyNamePathList); } + + + /** + * 群租房列表来源于烟台需求 + * + * @param formDTO + * @return + */ + @Override + public PageData groupRentHouseList(GroupRentHouseFormDTO formDTO) { + if(StringUtils.isBlank(formDTO.getOrgId())){ + //默认查询当前组织及下级 + formDTO.setOrgType("agency"); + CustomerStaffInfoCacheResult staffInfoCacheResult=CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(),formDTO.getStaffId()); + formDTO.setOrgId(staffInfoCacheResult.getAgencyId()); + } + //群租房:出租状态并超过5人(≥5) + PageHelper.startPage(formDTO.getPageNo(),formDTO.getPageSize()); + List list=icHouseDao.selectGroupRentHouseList(formDTO); + list.forEach(item -> { + item.setHouseType(HouseTypeEnums.getTypeValue(item.getHouseTypeKey())); + item.setPurpose(HousePurposeEnums.getTypeValue(item.getPurposeKey())); + }); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseServiceImpl.java index 7867b1434b..f5da256144 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseServiceImpl.java @@ -29,10 +29,11 @@ import com.epmet.constants.ImportTaskConstants; import com.epmet.dao.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; +import com.epmet.dto.result.yt.EnterpriseCountPlaceTypeDetailDTO; +import com.epmet.dto.result.yt.EnterpriseCountPlaceTypeResDTO; import com.epmet.entity.*; import com.epmet.excel.EnterpriseImportExcelDTO; import com.epmet.excel.handler.IcEnterpriseExcelImportListener; -import com.epmet.feign.EpmetAdminOpenFeignClient; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.OssFeignClient; @@ -85,8 +86,6 @@ public class IcEnterpriseServiceImpl extends BaseServiceImpl dictList = SpringContextUtils.getBean(CoverageService.class).dictMap(EpmetRequestHolder.getLoginUserCustomerId(), CoveragePlaceTypeEnum.ENTERPRISE_PATROL.getCode()); + if (CollectionUtils.isEmpty(dictList)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "场所类型字典为空", "场所类型字典为空"); + } + // + List placeTypeCountList = baseDao.selectCountByPlaceType(EpmetRequestHolder.getLoginUserCustomerId(),orgId, orgType); + Map map = CollectionUtils.isEmpty(placeTypeCountList) ? new HashMap<>() : placeTypeCountList.stream().collect(Collectors.toMap(EnterpriseCountPlaceTypeDetailDTO::getPlaceType, o -> o));; + List list = new ArrayList<>(); + int total = 0; + for (IcCoverageCategoryDictListResultDTO placeType : dictList) { + EnterpriseCountPlaceTypeDetailDTO detailDTO = new EnterpriseCountPlaceTypeDetailDTO(); + detailDTO.setPlaceType(placeType.getValue()); + detailDTO.setPlaceTypeName(placeType.getLabel()); + detailDTO.setTotal(NumConstant.ZERO); + if (map.containsKey(placeType.getValue())) { + detailDTO.setTotal(map.get(placeType.getValue()).getTotal()); + } + list.add(detailDTO); + total += detailDTO.getTotal(); + } + EnterpriseCountPlaceTypeResDTO resDTO = new EnterpriseCountPlaceTypeResDTO(); + resDTO.setList(list); + resDTO.setTotal(total); + + return resDTO; + } + + + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java index 93322c7ed6..654304466c 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java @@ -9,26 +9,23 @@ import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis; import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.dao.IcBuildingDao; -import com.epmet.dao.IcBuildingUnitDao; -import com.epmet.dao.IcHouseDao; -import com.epmet.dao.IcNeighborHoodDao; +import com.epmet.dao.*; import com.epmet.dto.IcHouseDTO; import com.epmet.dto.IcResiCategoryStatsConfigDTO; import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.ImportGeneralDTO; import com.epmet.dto.form.CheckHouseInfoFormDTO; +import com.epmet.dto.form.HouseCountPictureFormDTO; import com.epmet.dto.form.HouseFormDTO; +import com.epmet.dto.region.LogOperationResultDTO; import com.epmet.dto.result.*; -import com.epmet.entity.IcBuildingEntity; -import com.epmet.entity.IcBuildingUnitEntity; -import com.epmet.entity.IcHouseEntity; -import com.epmet.entity.IcNeighborHoodEntity; +import com.epmet.entity.*; import com.epmet.enums.HousePurposeEnums; import com.epmet.enums.HouseRentFlagEnums; import com.epmet.enums.HouseTypeEnums; @@ -36,10 +33,14 @@ import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.OperCustomizeOpenFeignClient; import com.epmet.redis.IcHouseRedis; +import com.epmet.service.CustomerAgencyService; import com.epmet.service.IcHouseService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.poi.hssf.record.PageBreakRecord; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -73,6 +74,10 @@ public class IcHouseServiceImpl extends BaseServiceImpl().ok(checkHomeInfoResultInfo); } + + @Override + public HouseCountPictureResultDTO getHousePurposeCount(HouseCountPictureFormDTO dto) { + + HouseCountPictureResultDTO resultDTO = new HouseCountPictureResultDTO(); + + resultDTO.setTotal(0); + + resultDTO.setList(baseDao.getHousePurposeCount(dto.getOrgIdPath(),dto.getTimeStart(),dto.getTimeEnd())); + + resultDTO.getList().forEach( + result->resultDTO.setTotal(resultDTO.getTotal()+result.getCount()) + ); + + return resultDTO; + } + + @Override + public HouseCountPictureResultDTO getHouseStatusCount(HouseCountPictureFormDTO dto) { + + HouseCountPictureResultDTO resultDTO = new HouseCountPictureResultDTO(); + + resultDTO.setTotal(0); + + resultDTO.setList(baseDao.getHouseStatusCount(dto.getOrgIdPath(),dto.getTimeStart(),dto.getTimeEnd())); + + resultDTO.getList().forEach( + result->resultDTO.setTotal(resultDTO.getTotal()+result.getCount()) + ); + + return resultDTO; + } + + @Override + public PageData getHousePictureList(HouseCountPictureFormDTO dto) { + // 列表/导出查询 + PageHelper.startPage(dto.getPageNo(), dto.getPageSize()); + List list = baseDao.getHousePictureList(dto.getOrgIdPath(),dto.getTimeStart(),dto.getTimeEnd(),dto.getPurpose(),dto.getRentFlag()); + + list.forEach(entity->{ + String[] agencyIds = entity.getOrgIdPath().split(":"); + LambdaQueryWrapper queryWrapperAgency = new LambdaQueryWrapper().in(CustomerAgencyEntity::getId,agencyIds); + List customerAgencyEntities = customerAgencyDao.selectList(queryWrapperAgency); + customerAgencyEntities.forEach(agency->{ + if (agency.getLevel().equals("district")){ + entity.setDistrictName(agency.getOrganizationName()); + }else if (agency.getLevel().equals("street")){ + entity.setStreetName(agency.getOrganizationName()); + }else if (agency.getLevel().equals("community")){ + entity.setCommunityName(agency.getOrganizationName()); + } + }); + }); + + PageInfo pageInfo = new PageInfo<>(list); + + return new PageData<>(list,pageInfo.getTotal()); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffLoginLogServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffLoginLogServiceImpl.java new file mode 100644 index 0000000000..f1a00216b5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffLoginLogServiceImpl.java @@ -0,0 +1,310 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.Constant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.EpmetRequestHolder; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.SpringContextUtils; +import com.epmet.dao.StaffLoginLogDao; +import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.dto.CustomerStaffDTO; +import com.epmet.dto.form.yt.CommunityLoginFormDTO; +import com.epmet.dto.form.yt.CountActivityFormDTO; +import com.epmet.dto.result.yt.ActivityTatalInfo; +import com.epmet.dto.result.yt.CommunityLoginResultDTO; +import com.epmet.dto.result.yt.LoginLogCountByLevelResultDTO; +import com.epmet.dto.result.yt.AccountActivityInfo; +import com.epmet.entity.StaffLoginLogEntity; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.service.CustomerAgencyService; +import com.epmet.service.StaffLoginLogService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.Date; +import java.util.List; + +/** + * 工作人员登录日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-04 + */ +@Service +public class StaffLoginLogServiceImpl extends BaseServiceImpl implements StaffLoginLogService { + @Autowired + private EpmetUserOpenFeignClient userOpenFeignClient; + + + /** + * 登录,插入记录 + * + * @param staffId + * @param loginTime + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void saveLog(String staffId, Date loginTime) { + CustomerStaffDTO form = new CustomerStaffDTO(); + form.setUserId(staffId); + Result result = userOpenFeignClient.getCustomerStaffInfoByUserId(form); + if (!result.success() || null == result.getData()) { + return; + } + CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(result.getData().getCustomerId(), staffId); + + StaffLoginLogEntity logEntity = new StaffLoginLogEntity(); + logEntity.setCustomerId(result.getData().getCustomerId()); + logEntity.setStaffId(staffId); + logEntity.setStaffName(staffInfoCacheResult.getRealName()); + logEntity.setMobile(staffInfoCacheResult.getMobile()); + logEntity.setAgencyId(staffInfoCacheResult.getAgencyId()); + CustomerAgencyDTO customerAgencyDTO = SpringContextUtils.getBean(CustomerAgencyService.class).get(staffInfoCacheResult.getAgencyId()); + logEntity.setAgencyLevel(customerAgencyDTO.getLevel()); + logEntity.setPid(customerAgencyDTO.getPid()); + if (StringUtils.isBlank(customerAgencyDTO.getPid()) || NumConstant.ZERO_STR.equals(customerAgencyDTO.getPid())) { + logEntity.setOrgIdPath(customerAgencyDTO.getId()); + } else { + logEntity.setOrgIdPath(customerAgencyDTO.getPids().concat(StrConstant.COLON).concat(customerAgencyDTO.getId())); + } + logEntity.setLoginTime(loginTime); + baseDao.insert(logEntity); + } + + + /** + * 返回市级账号登录总次数、区县级账号登录总次数、镇街级账号登录总次数、社区级账号登录总次数 + * + * @param orgId 为空时,默认当前登录用户所属组织id + * @param level :组织级别(社区级:community, 乡(镇、街道)级:street,区县级: district,市级: city;省级:province) + * @param startDate yyyy-MM-dd + * @param endDate yyyy-MM-dd + * @return + */ + @Override + public LoginLogCountByLevelResultDTO countLevel(String orgId, String level, Date startDate, Date endDate) { + if (StringUtils.isBlank(orgId)) { + CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), EpmetRequestHolder.getLoginUserId()); + orgId = staffInfoCacheResult.getAgencyId(); + level = staffInfoCacheResult.getLevel(); + } + String orgIdPath = SpringContextUtils.getBean(CustomerAgencyService.class).getOrgIdPath(orgId); + LoginLogCountByLevelResultDTO resultDTO = new LoginLogCountByLevelResultDTO(); + if (Constant.CITY.equals(level)) { + //市级账号登录 + LambdaQueryWrapper cityWrapper = new LambdaQueryWrapper<>(); + cityWrapper.eq(StaffLoginLogEntity::getAgencyId, orgId) + .between(null != startDate && null != endDate, StaffLoginLogEntity::getLoginTime, startDate, endDate); + resultDTO.setCityCount(baseDao.selectCount(cityWrapper)); + + // 市下面区县账号 + LambdaQueryWrapper districtWrapper = new LambdaQueryWrapper<>(); + districtWrapper.eq(StaffLoginLogEntity::getPid, orgId) + .eq(StaffLoginLogEntity::getAgencyLevel, Constant.DISTRICT) + .between(null != startDate && null != endDate, StaffLoginLogEntity::getLoginTime, startDate, endDate); + resultDTO.setDistrictCount(baseDao.selectCount(districtWrapper)); + + // 市级下面所有街道 + LambdaQueryWrapper streetWrapper = new LambdaQueryWrapper<>(); + streetWrapper.like(StaffLoginLogEntity::getOrgIdPath, orgIdPath) + .eq(StaffLoginLogEntity::getAgencyLevel, Constant.STREET) + .between(null != startDate && null != endDate, StaffLoginLogEntity::getLoginTime, startDate, endDate); + resultDTO.setStreetCount(baseDao.selectCount(streetWrapper)); + + // 市级下面所有社区 + LambdaQueryWrapper communityWrapper = new LambdaQueryWrapper<>(); + communityWrapper.like(StaffLoginLogEntity::getOrgIdPath, orgIdPath) + .eq(StaffLoginLogEntity::getAgencyLevel, Constant.COMMUNITY) + .between(null != startDate && null != endDate, StaffLoginLogEntity::getLoginTime, startDate, endDate); + resultDTO.setCommunityCount(baseDao.selectCount(communityWrapper)); + + } else if (Constant.DISTRICT.equals(level)) { + resultDTO.setCityCount(NumConstant.ONE_NEG); + + //只展示本区县的登录情况 + LambdaQueryWrapper districtWrapper = new LambdaQueryWrapper<>(); + districtWrapper.eq(StaffLoginLogEntity::getAgencyId, orgId) + .between(null != startDate && null != endDate, StaffLoginLogEntity::getLoginTime, startDate, endDate); + resultDTO.setDistrictCount(baseDao.selectCount(districtWrapper)); + + // 区县下所有的街道 + LambdaQueryWrapper streetWrapper = new LambdaQueryWrapper<>(); + streetWrapper.like(StaffLoginLogEntity::getOrgIdPath, orgIdPath) + .eq(StaffLoginLogEntity::getAgencyLevel, Constant.STREET) + .between(null != startDate && null != endDate, StaffLoginLogEntity::getLoginTime, startDate, endDate); + resultDTO.setStreetCount(baseDao.selectCount(streetWrapper)); + + // 去线下所有社区 + LambdaQueryWrapper communityWrapper = new LambdaQueryWrapper<>(); + communityWrapper.like(StaffLoginLogEntity::getOrgIdPath, orgIdPath) + .eq(StaffLoginLogEntity::getAgencyLevel, Constant.COMMUNITY) + .between(null != startDate && null != endDate, StaffLoginLogEntity::getLoginTime, startDate, endDate); + resultDTO.setCommunityCount(baseDao.selectCount(communityWrapper)); + + } else if (Constant.STREET.equals(level)) { + resultDTO.setCityCount(NumConstant.ONE_NEG); + resultDTO.setDistrictCount(NumConstant.ONE_NEG); + + // 只展示本街道的登录情况 + LambdaQueryWrapper streetWrapper = new LambdaQueryWrapper<>(); + streetWrapper.eq(StaffLoginLogEntity::getAgencyId, orgId) + .between(null != startDate && null != endDate, StaffLoginLogEntity::getLoginTime, startDate, endDate); + resultDTO.setStreetCount(baseDao.selectCount(streetWrapper)); + + + // 街道下所有社区 + LambdaQueryWrapper communityWrapper = new LambdaQueryWrapper<>(); + communityWrapper.like(StaffLoginLogEntity::getOrgIdPath, orgIdPath) + .eq(StaffLoginLogEntity::getAgencyLevel, Constant.COMMUNITY) + .between(null != startDate && null != endDate, StaffLoginLogEntity::getLoginTime, startDate, endDate); + resultDTO.setCommunityCount(baseDao.selectCount(communityWrapper)); + + } else if (Constant.COMMUNITY.equals(level)) { + resultDTO.setCityCount(NumConstant.ONE_NEG); + resultDTO.setDistrictCount(NumConstant.ONE_NEG); + resultDTO.setStreetCount(NumConstant.ONE_NEG); + + // 只展示本社区的登录情况 + LambdaQueryWrapper communityWrapper = new LambdaQueryWrapper<>(); + communityWrapper.eq(StaffLoginLogEntity::getAgencyId, orgId) + .between(null != startDate && null != endDate, StaffLoginLogEntity::getLoginTime, startDate, endDate); + resultDTO.setCommunityCount(baseDao.selectCount(communityWrapper)); + } + return resultDTO; + } + + @Override + public PageData getAccountActivityInfo(CountActivityFormDTO formDTO) { + if (formDTO.getIsPage()) { + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + List accountActivityInfos = baseDao.selectListActivityInfo(formDTO); + int total = CollectionUtils.isEmpty(accountActivityInfos) ? NumConstant.ZERO : accountActivityInfos.size(); + return new PageData<>(accountActivityInfos, total); + } + List accountActivityInfos = baseDao.selectListActivityInfo(formDTO); + int total = CollectionUtils.isEmpty(accountActivityInfos) ? NumConstant.ZERO : accountActivityInfos.size(); + return new PageData<>(accountActivityInfos, total); + } + + @Override + public ActivityTatalInfo getActivityTotal(CountActivityFormDTO formDTO) { + return baseDao.selectOneActivityTotal(formDTO); + } + + /** + * 下级社区账号登录次数排名 + * + * @param formDTO + * @return + */ + @Override + public PageData pageCommunityCount(CommunityLoginFormDTO formDTO) { + if (StringUtils.isBlank(formDTO.getOrgId())) { + CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), EpmetRequestHolder.getLoginUserId()); + formDTO.setOrgId(staffInfoCacheResult.getAgencyId()); + // formDTO.setLevel(staffInfoCacheResult.getLevel()); + } + if (formDTO.getIsPage()) { + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + List list = baseDao.pageCommunityCount(formDTO.getOrgId(), formDTO.getStartDate(), formDTO.getEndDate()); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal(), formDTO.getPageSize()); + } + // 不分页 + List list = baseDao.pageCommunityCount(formDTO.getOrgId(), formDTO.getStartDate(), formDTO.getEndDate()); + int total = CollectionUtils.isEmpty(list) ? NumConstant.ZERO : list.size(); + return new PageData<>(list, total, total); + } + + + /** + * 柱状图:下级组织账号登录次数汇总 + * + * @param orgId + * @param level + * @param startDate + * @param endDate + * @return + */ + @Override + public PageData querySubCount(String orgId, String level, Date startDate, Date endDate) { + if (StringUtils.isBlank(orgId)) { + CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), EpmetRequestHolder.getLoginUserId()); + orgId = staffInfoCacheResult.getAgencyId(); + } + List list = baseDao.querySubCount(orgId, startDate, endDate); + int total = CollectionUtils.isEmpty(list) ? NumConstant.ZERO : list.size(); + return new PageData(list, total, total); + } + + + /** + * 查看区县 + * + * @param orgId + * @param level + * @param startDate + * @param endDate + * @param isPage + * @param pageNo + * @param pageSize + * @return 返回agencyId,agencyName,count + */ + @Override + public PageData pageDistrictCount(String orgId, String level, Date startDate, Date endDate, Boolean isPage, Integer pageNo, Integer pageSize) { + if (StringUtils.isBlank(orgId)) { + CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), EpmetRequestHolder.getLoginUserId()); + orgId = staffInfoCacheResult.getAgencyId(); + } + if (isPage) { + PageHelper.startPage(pageNo, pageSize); + List list = baseDao.pageDistrictCount(orgId, startDate, endDate); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal(), pageSize); + } + // 不分页 + List list = baseDao.pageDistrictCount(orgId, startDate, endDate); + int total = CollectionUtils.isEmpty(list) ? NumConstant.ZERO : list.size(); + return new PageData<>(list, total, total); + } + + /** + * 查看街镇 + * + * @param orgId + * @param startDate + * @param endDate + * @param isPage + * @param pageNo + * @param pageSize + * @return + */ + @Override + public PageData streetCount(String orgId, Date startDate, Date endDate, Boolean isPage, Integer pageNo, Integer pageSize) { + if (StringUtils.isBlank(orgId)) { + CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), EpmetRequestHolder.getLoginUserId()); + orgId = staffInfoCacheResult.getAgencyId(); + } + if (isPage) { + PageHelper.startPage(pageNo, pageSize); + List list = baseDao.pageStreetCount(orgId, startDate, endDate); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal(), pageSize); + } + // 不分页 + List list = baseDao.pageStreetCount(orgId, startDate, endDate); + int total = CollectionUtils.isEmpty(list) ? NumConstant.ZERO : list.size(); + return new PageData<>(list, total, total); + } +} \ 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/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index 37964a6e2c..7f3f76b2d0 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -198,7 +198,11 @@ ca.pids AS "pids", ca.level level, IFNULL(ca.longitude, cc.longitude) longitude, - IFNULL(ca.latitude, cc.latitude) latitude + IFNULL(ca.latitude, cc.latitude) latitude, + ( + case when ca.pid is null or ca.pid='0' or ca.pid='' then ca.id + else concat(ca.pids,':',ca.id) + end)as orgIdPath FROM customer_agency ca INNER JOIN customer_agency cc ON cc.pid = '0' AND ca.customer_id = cc.customer_id WHERE ca.del_flag = '0' @@ -206,6 +210,26 @@ ORDER BY ca.created_time DESC + + + + select level as level,count(*) as count + from customer_agency + where DEL_FLAG = 0 + and PIDS like concat(#{pids},'%') + group by level + + + + + + + + + + + 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/IcEnterpriseDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcEnterpriseDao.xml index 2b14cedbbb..029fb23169 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcEnterpriseDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcEnterpriseDao.xml @@ -66,10 +66,18 @@ LEFT JOIN ic_enterprise_patrol_record r ON ( ie.id = r.ENTERPRISE_ID AND r.DEL_FLAG = '0' ) WHERE ie.DEL_FLAG = '0' - AND ( - ie.AGENCY_ID = #{staffAgencyId} - OR ie.AGENCY_PIDS LIKE concat( '%', #{staffAgencyId}, '%' ) - ) + + AND ie.GRID_ID = #{orgId} + + + AND (ie.AGENCY_ID = #{orgId} or ie.AGENCY_PIDS like concat('%',#{orgId},'%')) + + + AND ( + ie.AGENCY_ID = #{staffAgencyId} + OR ie.AGENCY_PIDS LIKE concat( '%', #{staffAgencyId}, '%' ) + ) + AND ie.GRID_ID = #{gridId} @@ -108,4 +116,24 @@ and ie.id != #{enterpriseId} + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml index 6eac8ed9fd..4e90e15af8 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml @@ -700,5 +700,139 @@ CONVERT(d.UNIT_NAME USING gbk), CAST(a.DOOR_NAME AS SIGNED), CONVERT(a.DOOR_NAME using gbk) + + + + + + diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffLoginLogDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffLoginLogDao.xml new file mode 100644 index 0000000000..13a1b5da8e --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffLoginLogDao.xml @@ -0,0 +1,189 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/TagCustomerDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/TagCustomerDTO.java index 0e7f1a5e20..15e4d22232 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/TagCustomerDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/TagCustomerDTO.java @@ -17,10 +17,15 @@ package com.epmet.dto; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; import java.util.Date; +import java.util.List; /** @@ -34,9 +39,12 @@ public class TagCustomerDTO implements Serializable { private static final long serialVersionUID = 1L; + public interface ChangeShowFlagGroup extends CustomerClientShowGroup { + } /** * 主键ID */ + @NotBlank(message = "id不能为空",groups = ChangeShowFlagGroup.class) private String id; /** @@ -48,40 +56,60 @@ public class TagCustomerDTO implements Serializable { * 标签名称 */ private String tagName; + /** + * 标签颜色 + */ + private String tagColor; /** * 使用计数 */ private Integer useCount; + /** + * 1:展示;0:隐藏;0302因烟台需求增加此列默认1 + */ + @NotNull(message = "showFlag不能为空",groups = ChangeShowFlagGroup.class) + private Integer showFlag; + /** * 删除标识 0.未删除 1.已删除 */ + @JsonIgnore private Integer delFlag; /** * 乐观锁 */ + @JsonIgnore private Integer revision; /** * 创建人 */ + @JsonIgnore private String createdBy; /** * 创建时间 */ + @JsonIgnore private Date createdTime; /** * 更新人 */ + @JsonIgnore private String updatedBy; /** * 更新时间 */ + @JsonIgnore private Date updatedTime; + /** + * 应用范围 + */ + private List agencyList; } diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/TagScopeDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/TagScopeDTO.java new file mode 100644 index 0000000000..bda0ab9c9b --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/TagScopeDTO.java @@ -0,0 +1,43 @@ +package com.epmet.dto; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description + * @Author yzm + * @Date 2023/3/2 13:52 + */ +@Data +public class TagScopeDTO implements Serializable { + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + /** + * 标签ID + */ + private String tagId; + + /** + * 应用范围,这里只能是社区id + */ + @NotBlank(message = "agencyId不能为空",groups = AddUserShowGroup.class) + private String agencyId; + /** + * agency_id全路径,包含自身 + */ + @NotBlank(message = "orgIdPath不能为空",groups = AddUserShowGroup.class) + private String orgIdPath; + + /** + * agencyId的直属上级 + */ + private String pid; + /** + * 社区名称 + */ + private String agencyName; +} + 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 6be60b5d1e..c7addb73e8 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 @@ -26,12 +26,12 @@ public class CommonArticleListFormDTO implements Serializable { * 烟台需求:周边疫情 就业服务 警民互动 物业通知 党务公开 居务公开 财务公开 以上标签在实时动态里写死吧 * */ - public interface YanTaiShowGroup extends CustomerClientShowGroup { + public interface YanTaiDingShowGroup extends CustomerClientShowGroup { } /** * 网格Id * */ - @NotBlank(message = "网格Id不能为空" , groups = {ArticleBannerInternalGroup.class,YanTaiShowGroup.class}) + @NotBlank(message = "网格Id不能为空" , groups = {ArticleBannerInternalGroup.class,YanTaiDingShowGroup.class}) private String gridId; /** @@ -42,7 +42,7 @@ public class CommonArticleListFormDTO implements Serializable { /** * 标签名称(高级配置里的参数) * */ - @NotBlank(message = "标签名称不能为空",groups = YanTaiShowGroup.class) + @NotBlank(message = "标签名称不能为空",groups = YanTaiDingShowGroup.class) private String tagName; /** * 排除的标签名称(高级配置里的参数) @@ -53,8 +53,10 @@ public class CommonArticleListFormDTO implements Serializable { */ private Integer isTop; - @NotNull(message = "pageNo不能为空", groups = YanTaiShowGroup.class) + @NotNull(message = "pageNo不能为空", groups = YanTaiDingShowGroup.class) private Integer pageNo; - @NotNull(message = "pageSize不能为空", groups = YanTaiShowGroup.class) + @NotNull(message = "pageSize不能为空", groups = YanTaiDingShowGroup.class) private Integer pageSize; + @NotBlank(message = "tagId不能为空",groups = YanTaiDingShowGroup.class) + private String tagId; } diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/TagCustomerFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/TagCustomerFormDTO.java new file mode 100644 index 0000000000..d27d57e3f4 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/TagCustomerFormDTO.java @@ -0,0 +1,56 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.epmet.dto.TagScopeDTO; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author yzm + * @Date 2023/3/2 12:47 + */ +@Data +public class TagCustomerFormDTO implements Serializable { + private static final long serialVersionUID = -5631868409077026783L; + + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + public interface UpdateUserInternalGroup { + } + + public interface UpdateUserShowGroup extends CustomerClientShowGroup { + } + + + /** + * 主键ID + */ + @NotBlank(message = "id不能为空", groups = {UpdateUserInternalGroup.class}) + private String id; + + /** + * 标签名称 + */ + @Length(max = 30, message = "标签名称最多输入30字", groups = {AddUserShowGroup.class, UpdateUserShowGroup.class}) + @NotBlank(message = "标签名称不能为空", groups = {AddUserShowGroup.class, UpdateUserShowGroup.class}) + private String tagName; + + /** + * 应用范围,只能选社区 + */ + private List agencyList; + /** + * 客户ID + */ + private String customerId; +} + diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/TagCustomerPageFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/TagCustomerPageFormDTO.java new file mode 100644 index 0000000000..04ee2370eb --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/TagCustomerPageFormDTO.java @@ -0,0 +1,44 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @Description pc标签管理-分页查询入参 + * @Author yzm + * @Date 2023/3/2 11:34 + */ +@Data +public class TagCustomerPageFormDTO implements Serializable { + private static final long serialVersionUID = -2311491158902019019L; + + public interface PageUserInternalGroup { + } + + public interface PageUserShowGroup extends CustomerClientShowGroup { + } + + + /** + * 客户ID + */ + @NotBlank(message = "customerId不能为空", groups = PageUserInternalGroup.class) + private String customerId; + + /** + * 标签名称 + */ + private String tagName; + + + @NotNull(message = "页码不能为空", groups = PageUserInternalGroup.class) + private Integer pageNo; + + @NotNull(message = "每页数量不能为空", groups = PageUserInternalGroup.class) + private Integer pageSize; +} + diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java index a984a8a42a..77ef7f4361 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -338,11 +338,12 @@ public class ArticleController { */ @PostMapping("article-list-ytding") public Result> pageArticleListByTagName(@RequestBody CommonArticleListFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO, CommonArticleListFormDTO.YanTaiShowGroup.class); + ValidatorUtils.validateEntity(formDTO, CommonArticleListFormDTO.YanTaiDingShowGroup.class); return new Result>().ok(articleService.pageArticleListByTagName(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getGridId(), - formDTO.getTagName())); + formDTO.getTagName(), + formDTO.getTagId())); } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java index bd2603685b..42b845210c 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java @@ -1,21 +1,21 @@ 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.form.CorrelationTagListFormDTO; -import com.epmet.dto.form.InitTagFormDTO; -import com.epmet.dto.form.ResiTagListFormDTO; -import com.epmet.dto.form.TagCascadeListFormDTO; +import com.epmet.dto.TagCustomerDTO; +import com.epmet.dto.TagScopeDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.CorrelationTagListResultDTO; import com.epmet.dto.result.TagInfoResultDTO; +import com.epmet.service.TagCustomerService; import com.epmet.service.TagService; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; 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 org.springframework.web.bind.annotation.*; import java.util.List; @@ -25,11 +25,14 @@ public class TagController { @Autowired private TagService tagService; + @Autowired + private TagCustomerService tagCustomerService; /** * @Description 已发布列表页的标签——政府端 * @param tokenDto * @author zxc + * 补充:pc党建声音查询条件、新增弹框中的标签下拉框也调用的此接口 */ @PostMapping("taglist") // @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISHED_LIST) @@ -81,4 +84,96 @@ public class TagController { return new Result().ok(tagService.initTag(formDto)); } + /** + * pc标签管理-分页查询 + * @param formDTO + * @return + */ + @PostMapping("page-list") + public Result> pageList(@LoginUser TokenDto tokenDto,@RequestBody TagCustomerPageFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO,TagCustomerPageFormDTO.PageUserInternalGroup.class,TagCustomerPageFormDTO.PageUserShowGroup.class); + return new Result>().ok(tagCustomerService.page(formDTO)); + } + + /** + * 新增标签 + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("save") + public Result save(@LoginUser TokenDto tokenDto,@RequestBody TagCustomerFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + if(CollectionUtils.isNotEmpty(formDTO.getAgencyList())){ + ValidatorUtils.validateEntity(formDTO.getAgencyList(), TagScopeDTO.AddUserShowGroup.class); + } + ValidatorUtils.validateEntity(formDTO,TagCustomerFormDTO.AddUserShowGroup.class,TagCustomerFormDTO.AddUserInternalGroup.class); + tagCustomerService.save(formDTO); + return new Result(); + } + + /** + * 修改标签 + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("update") + public Result update(@LoginUser TokenDto tokenDto,@RequestBody TagCustomerFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + if(CollectionUtils.isNotEmpty(formDTO.getAgencyList())){ + ValidatorUtils.validateEntity(formDTO.getAgencyList(), TagScopeDTO.AddUserShowGroup.class); + } + ValidatorUtils.validateEntity(formDTO,TagCustomerFormDTO.UpdateUserShowGroup.class,TagCustomerFormDTO.UpdateUserInternalGroup.class); + tagCustomerService.update(formDTO); + return new Result(); + } + + /** + * 隐藏、显示 + * @param tagCustomerDTO + * @return + */ + @PostMapping("change-show-flag") + public Result changeShowFlag(@RequestBody TagCustomerDTO tagCustomerDTO){ + tagCustomerService.changeShowFlag(tagCustomerDTO.getId(),tagCustomerDTO.getShowFlag()); + return new Result(); + } + + /** + * 初始化标签应用范围, + * 每个标签,和当前客户下所有社区关联 + * @param tokenDto + * @return + */ + @PostMapping("initTagScope") + public Result initTagScope(@LoginUser TokenDto tokenDto){ + tagCustomerService.initTagScope(tokenDto.getCustomerId()); + return new Result(); + } + + /** + * 钉钉实时动态,获取网格所属社区下, 的标签列表 只返回tagId,tagName + * @param gridId + * @return + */ + @PostMapping("getAgencyTag/{gridId}") + public Result> getAgencyTag(@PathVariable("gridId")String gridId){ + if(StringUtils.isBlank(gridId)){ + return new Result<>(); + } + return new Result>().ok(tagCustomerService.getAgencyTag(gridId)); + } + + /** + * 工作端获取登录用户所属组织下的标签列表 + * + * @param tokenDto + * @return + */ + @PostMapping("queryAgencyTag") + public Result> queryAgencyTag(@LoginUser TokenDto tokenDto) { + return new Result>().ok(tagCustomerService.queryAgencyTag(tokenDto.getCustomerId(),tokenDto.getUserId())); + } } 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 53524c9bb7..c974947186 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 @@ -178,5 +178,6 @@ public interface ArticleDao extends BaseDao { List pageArticleListByTagName(@Param("gridId")String gridId, @Param("tagName")String tagName, @Param("customerId")String customerId, - @Param("agencyId")String agencyId); + @Param("agencyId")String agencyId, + @Param("tagId")String tagId); } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagCustomerDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagCustomerDao.java index 595f2a9a18..fcc0e268a7 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagCustomerDao.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagCustomerDao.java @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.TagCustomerDTO; import com.epmet.dto.form.InitTagsFormDTO; import com.epmet.dto.form.UpdateTagFormDTO; import com.epmet.entity.TagCustomerEntity; @@ -55,4 +56,18 @@ public interface TagCustomerDao extends BaseDao { * @return */ List selectInitData(@Param("customerIdList") List customerIdList); + + /** + * pc标签管理-分页查询 + * @param customerId + * @param tagName + * @return + */ + List pageList(@Param("customerId") String customerId, @Param("tagName")String tagName); + + /** + * 钉钉实时动态,获取网格所属社区下, 的标签列表 + * 只返回tagId,tagName + */ + List getAgencyTag(@Param("agencyId")String agencyId,@Param("customerId") String customerId); } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagScopeDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagScopeDao.java new file mode 100644 index 0000000000..411801f4b5 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagScopeDao.java @@ -0,0 +1,23 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.TagScopeDTO; +import com.epmet.entity.TagScopeEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 标签应用范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-03-02 + */ +@Mapper +public interface TagScopeDao extends BaseDao { + + int deleteByTagId(@Param("tagId") String tagId, @Param("customerId") String customerId); + + List selectScope(String tagId); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/TagCustomerEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/TagCustomerEntity.java index 7a2a54d7ae..e86fbb2231 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/TagCustomerEntity.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/TagCustomerEntity.java @@ -55,4 +55,8 @@ public class TagCustomerEntity extends BaseEpmetEntity { */ private Integer useCount; + /** + * 1:展示;0:隐藏;0302因烟台需求增加此列默认1 + */ + private Integer showFlag; } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/TagScopeEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/TagScopeEntity.java new file mode 100644 index 0000000000..309d677c3b --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/TagScopeEntity.java @@ -0,0 +1,48 @@ +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-03-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("tag_scope") +public class TagScopeEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID(0302因烟台需求增加此表) + */ + private String customerId; + + /** + * 标签ID + */ + private String tagId; + + /** + * 应用范围,这里只能是社区id + */ + private String agencyId; + + /** + * agency_id全路径,包含自身 + */ + private String orgIdPath; + /** + * agencyId的直属上级 + */ + private String pid; + /** + * 社区名称 + */ + private String agencyName; +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java index d9374b1263..499ed51ab9 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java @@ -291,5 +291,6 @@ public interface ArticleService extends BaseService { PageData pageArticleListByTagName(Integer pageNo, Integer pageSize, String gridId, - String tagName); + String tagName, + String tagId); } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagCustomerService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagCustomerService.java index 3ecb3c49c1..9bf4022967 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagCustomerService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagCustomerService.java @@ -20,11 +20,13 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.TagCustomerDTO; +import com.epmet.dto.form.TagCustomerFormDTO; +import com.epmet.dto.form.TagCustomerPageFormDTO; +import com.epmet.dto.result.TagInfoResultDTO; import com.epmet.dto.result.UpdateTagUseCountsResultDTO; import com.epmet.entity.TagCustomerEntity; import java.util.List; -import java.util.Map; /** * 客户标签表 @@ -35,24 +37,14 @@ import java.util.Map; public interface TagCustomerService extends BaseService { /** - * 默认分页 + * pc标签管理-分页查询 * - * @param params + * @param formDTO * @return PageData * @author generator * @date 2020-06-02 */ - PageData page(Map params); - - /** - * 默认查询 - * - * @param params - * @return java.util.List - * @author generator - * @date 2020-06-02 - */ - List list(Map params); + PageData page(TagCustomerPageFormDTO formDTO); /** * 单条查询 @@ -65,24 +57,24 @@ public interface TagCustomerService extends BaseService { TagCustomerDTO get(String id); /** - * 默认保存 + * 新增标签 * * @param dto * @return void * @author generator * @date 2020-06-02 */ - void save(TagCustomerDTO dto); + void save(TagCustomerFormDTO dto); /** - * 默认更新 + * 修改标签 * * @param dto * @return void * @author generator * @date 2020-06-02 */ - void update(TagCustomerDTO dto); + void update(TagCustomerFormDTO dto); /** * 批量删除 @@ -100,4 +92,34 @@ public interface TagCustomerService extends BaseService { * @author zxc */ UpdateTagUseCountsResultDTO checkTagInfo(String tagName,String customerId,String userId); + + /** + * 隐藏、显示 + * @param id + * @param showFlag + */ + void changeShowFlag(String id, Integer showFlag); + + /** + * 初始化标签应用范围, + * 每个标签,和当前客户下所有社区关联 + * @param tokenDto + * @return + */ + void initTagScope(String customerId); + + /** + * 钉钉实时动态,获取网格所属社区下, 的标签列表 + * 只返回tagId,tagName + * @param gridId + * @return + */ + List getAgencyTag(String gridId); + + /** + * 工作端获取登录用户所属组织下的标签列表 + * @param staffId + * @return + */ + List queryAgencyTag(String customerId,String staffId); } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java index a1777b5056..f51705afdd 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 @@ -2014,13 +2014,14 @@ public class ArticleServiceImpl extends BaseServiceImpl pageArticleListByTagName(Integer pageNo, Integer pageSize, String gridId, String tagName) { + public PageData pageArticleListByTagName(Integer pageNo, Integer pageSize, String gridId, String tagName,String tagId) { PageHelper.startPage(pageNo, pageSize); List list = baseDao.pageArticleListByTagName( gridId, tagName, EpmetRequestHolder.getLoginUserCustomerId(), - null); + null, + tagId); PageInfo pageInfo = new PageInfo<>(list); return new PageData<>(list, pageInfo.getTotal()); } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagCustomerServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagCustomerServiceImpl.java index b5c69d76c1..380ac1c679 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagCustomerServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagCustomerServiceImpl.java @@ -17,26 +17,50 @@ package com.epmet.service.impl; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; 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.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.GridInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.EpmetRequestHolder; +import com.epmet.commons.tools.utils.Result; import com.epmet.dao.TagCustomerDao; +import com.epmet.dao.TagScopeDao; import com.epmet.dto.TagCustomerDTO; +import com.epmet.dto.form.TagCustomerFormDTO; +import com.epmet.dto.form.TagCustomerPageFormDTO; import com.epmet.dto.form.UpdateTagFormDTO; +import com.epmet.dto.result.AgencyResultDTO; +import com.epmet.dto.result.TagInfoResultDTO; import com.epmet.dto.result.UpdateTagUseCountsResultDTO; import com.epmet.entity.TagCustomerEntity; +import com.epmet.entity.TagScopeEntity; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.redis.TagRedis; import com.epmet.service.TagCustomerService; import com.epmet.utils.TagColorUtils; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.Arrays; +import java.util.Date; import java.util.List; -import java.util.Map; /** * 客户标签表 @@ -44,32 +68,27 @@ import java.util.Map; * @author generator generator@elink-cn.com * @since v1.0.0 2020-06-02 */ +@Slf4j @Service public class TagCustomerServiceImpl extends BaseServiceImpl implements TagCustomerService { + @Autowired + private TagScopeDao tagScopeDao; + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private TagRedis tagRedis; + /** + * pc标签管理-分页查询 + * @param formDTO + * @return + */ @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, TagCustomerDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, TagCustomerDTO.class); - } - - private QueryWrapper getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); - - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); - - return wrapper; + public PageData page(TagCustomerPageFormDTO formDTO) { + PageHelper.startPage(formDTO.getPageNo(),formDTO.getPageSize()); + List list=baseDao.pageList(formDTO.getCustomerId(),formDTO.getTagName()); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); } @Override @@ -78,18 +97,73 @@ public class TagCustomerServiceImpl extends BaseServiceImpl queryWrapper=new LambdaQueryWrapper<>(); + queryWrapper.eq(TagCustomerEntity::getCustomerId,dto.getCustomerId()) + .eq(TagCustomerEntity::getTagName,dto.getTagName()); + if(baseDao.selectCount(queryWrapper)>0){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"标签名称已存在","标签名称已存在"); + } TagCustomerEntity entity = ConvertUtils.sourceToTarget(dto, TagCustomerEntity.class); + entity.setTagColor(StrConstant.EPMETY_STR); + entity.setUseCount(NumConstant.ZERO); + entity.setShowFlag(NumConstant.ONE); insert(entity); + if(CollectionUtils.isNotEmpty(dto.getAgencyList())){ + dto.getAgencyList().forEach(tagScopeDTO->{ + TagScopeEntity tagScopeEntity=new TagScopeEntity(); + tagScopeEntity.setCustomerId(entity.getCustomerId()); + tagScopeEntity.setTagId(entity.getId()); + tagScopeEntity.setAgencyId(tagScopeDTO.getAgencyId()); + tagScopeEntity.setOrgIdPath(tagScopeDTO.getOrgIdPath()); + tagScopeEntity.setAgencyName(tagScopeDTO.getAgencyName()); + tagScopeEntity.setPid(tagScopeDTO.getPid()); + tagScopeDao.insert(tagScopeEntity); + }); + } + //删除redis缓存 + tagRedis.clearCustomerTag(dto.getCustomerId()); } + /** + * pc标签管理-修改 + * @param dto + */ @Override @Transactional(rollbackFor = Exception.class) - public void update(TagCustomerDTO dto) { + public void update(TagCustomerFormDTO dto) { + // 标签名称是否存在 + LambdaQueryWrapper queryWrapper=new LambdaQueryWrapper<>(); + queryWrapper.eq(TagCustomerEntity::getCustomerId,dto.getCustomerId()) + .eq(TagCustomerEntity::getTagName,dto.getTagName()) + .ne(TagCustomerEntity::getId,dto.getId()); + if(baseDao.selectCount(queryWrapper)>0){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"标签名称已存在","标签名称已存在"); + } TagCustomerEntity entity = ConvertUtils.sourceToTarget(dto, TagCustomerEntity.class); updateById(entity); + //删除应用范围 + tagScopeDao.deleteByTagId(entity.getId(),entity.getCustomerId()); + if(CollectionUtils.isNotEmpty(dto.getAgencyList())){ + dto.getAgencyList().forEach(tagScopeDTO->{ + TagScopeEntity tagScopeEntity=new TagScopeEntity(); + tagScopeEntity.setCustomerId(entity.getCustomerId()); + tagScopeEntity.setTagId(entity.getId()); + tagScopeEntity.setAgencyId(tagScopeDTO.getAgencyId()); + tagScopeEntity.setOrgIdPath(tagScopeDTO.getOrgIdPath()); + tagScopeEntity.setAgencyName(tagScopeDTO.getAgencyName()); + tagScopeEntity.setPid(tagScopeDTO.getPid()); + tagScopeDao.insert(tagScopeEntity); + }); + } + tagRedis.clearCustomerTag(dto.getCustomerId()); } @Override @@ -126,4 +200,102 @@ public class TagCustomerServiceImpl extends BaseServiceImpl tagCustomerUpdateWrapper = new LambdaUpdateWrapper<>(); + tagCustomerUpdateWrapper.eq(TagCustomerEntity::getId, id) + .set(TagCustomerEntity::getUpdatedBy, EpmetRequestHolder.getLoginUserId()) + .set(TagCustomerEntity::getUpdatedTime, new Date()) + .set(TagCustomerEntity::getShowFlag,showFlag); + baseDao.update(null,tagCustomerUpdateWrapper); + tagRedis.clearCustomerTag(EpmetRequestHolder.getLoginUserCustomerId()); + } + + /** + * 初始化标签应用范围, + * 每个标签,和当前客户下所有社区关联 + * + * @param customerId@return + */ + @Async + @Override + public void initTagScope(String customerId) { + if (StringUtils.isBlank(customerId)) { + return; + } + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper(); + queryWrapper.eq(TagCustomerEntity::getCustomerId, customerId); + List tagList = baseDao.selectList(queryWrapper); + if (CollectionUtils.isEmpty(tagList)) { + return; + } + int tagTotal = tagList.size(); + // 获取当前客户下所有的社区组织 + Result> communityRes = govOrgOpenFeignClient.getAllCommunity(customerId); + if (communityRes.success() && CollectionUtils.isNotEmpty(communityRes.getData())) { + int communityTotal = communityRes.getData().size(); + int num = 0; + for (TagCustomerEntity tag : tagList) { + tagScopeDao.deleteByTagId(tag.getId(),tag.getCustomerId()); + for (AgencyResultDTO agencyResultDTO : communityRes.getData()) { + TagScopeEntity tagScopeEntity = new TagScopeEntity(); + tagScopeEntity.setCustomerId(tag.getCustomerId()); + tagScopeEntity.setTagId(tag.getId()); + tagScopeEntity.setAgencyId(agencyResultDTO.getAgencyId()); + tagScopeEntity.setOrgIdPath(agencyResultDTO.getOrgIdPath()); + tagScopeEntity.setAgencyName(agencyResultDTO.getAgencyName()); + tagScopeEntity.setPid(agencyResultDTO.getPid()); + tagScopeDao.insert(tagScopeEntity); + num++; + } + } + log.error(String.format("customerId:%s,已经将%s个标签应用给%s个社区,tag_scope产生%s条记录", customerId, tagTotal, communityTotal, num)); + } + + } + + + /** + * 钉钉实时动态,获取网格所属社区下, 的标签列表 + * 只返回tagId,tagName + * + * @param gridId + * @return + */ + @Override + public List getAgencyTag(String gridId) { + GridInfoCache gridInfoCache= CustomerOrgRedis.getGridInfo(gridId); + if(null==gridInfoCache){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"查询网格信息异常gridId:"+gridId,"查询网格信息异常"); + } + List list=baseDao.getAgencyTag(gridInfoCache.getPid(),gridInfoCache.getCustomerId()); + return list; + } + + /** + * 工作端获取登录用户所属组织下的标签列表 + * + * @param staffId + * @return + */ + @Override + public List queryAgencyTag(String customerId,String staffId) { + CustomerStaffInfoCacheResult staffInfoCacheResult= CustomerStaffRedis.getStaffInfo(customerId,staffId); + List list=baseDao.getAgencyTag(staffInfoCacheResult.getAgencyId(),customerId); + List resultDTOList=new ArrayList<>(); + list.forEach(tagCustomerDTO->{ + TagInfoResultDTO resultDTO=new TagInfoResultDTO(); + resultDTO.setTagId(tagCustomerDTO.getId()); + resultDTO.setTagColor(tagCustomerDTO.getTagColor()); + resultDTO.setTagName(tagCustomerDTO.getTagName()); + resultDTOList.add(resultDTO); + }); + return resultDTOList; + } } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagServiceImpl.java index cbfba74bb5..b85a637634 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagServiceImpl.java @@ -57,6 +57,7 @@ public class TagServiceImpl implements TagService { * @Description 已发布列表页的标签——政府端 * @param tokenDto * @author zxc + * 补充:pc党建声音查询条件、新增弹框中的标签下拉框也调用的此接口 */ @Override @Transactional(rollbackFor = Exception.class) @@ -64,6 +65,7 @@ public class TagServiceImpl implements TagService { String customerId = tokenDto.getCustomerId(); List resultDtos = tagRedis.zRevRange(customerId); if (resultDtos.size() == NumConstant.ZERO){ + //初始化标签 resultDtos = this.initTags(customerId); } return resultDtos; diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml index 5e67b953a0..04b8d0d712 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 @@ -543,6 +543,9 @@ AND art.org_id_path like concat('%',#{agencyId},'%') + + AND t.tag_id =#{tagId} + ORDER BY art.PUBLISH_DATE DESC, art.CREATED_TIME DESC diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagCustomerDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagCustomerDao.xml index ea0aff95c3..1697ee494a 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagCustomerDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagCustomerDao.xml @@ -56,4 +56,41 @@ ORDER BY CUSTOMER_ID + + + + + + + + + + + + + + diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagScopeDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagScopeDao.xml new file mode 100644 index 0000000000..a298dc5db0 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagScopeDao.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + delete from tag_scope + where TAG_ID=#{tagId} + and CUSTOMER_ID=#{customerId} + + + + \ 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/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/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/YtTopicServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/YtTopicServiceImpl.java new file mode 100644 index 0000000000..acbb9d0c62 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/YtTopicServiceImpl.java @@ -0,0 +1,384 @@ +package com.epmet.modules.topic.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.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.CustomerResiUserRedis; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; +import com.epmet.commons.tools.redis.common.bean.ResiUserInfoCache; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.modules.topic.dao.*; +import com.epmet.modules.topic.entity.*; +import com.epmet.modules.topic.service.YtTopicService; +import com.epmet.modules.utils.ModuleConstant; +import com.epmet.resi.group.constant.TopicConstant; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; +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 com.github.pagehelper.PageInfo; +import com.github.pagehelper.page.PageMethod; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; + +/** + * 烟台话题信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-01-30 + */ +@Slf4j +@Service +public class YtTopicServiceImpl 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/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-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/OperListResultDTO.java b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/OperListResultDTO.java index d202918818..178c11390b 100644 --- a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/OperListResultDTO.java +++ b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/OperListResultDTO.java @@ -48,4 +48,9 @@ public class OperListResultDTO implements Serializable { */ private String badgeType; + /** + * 认证(审核)状态 待审核:auditing;审核通过: approved;驳回:rejected; + */ + // @JsonIgnore + private String auditStatus; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserBadgeCertificateRecordDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserBadgeCertificateRecordDTO.java index 820f0fa45c..7cef9e768f 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserBadgeCertificateRecordDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserBadgeCertificateRecordDTO.java @@ -16,6 +16,10 @@ public class UserBadgeCertificateRecordDTO implements Serializable { private String id; private String customerId; private String gridId; + /** + * 组织id;0306烟台需求增加 + */ + private String agencyId; private String userId; private String badgeId; private String surname; diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeAuditPageFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeAuditPageFormDTO.java new file mode 100644 index 0000000000..804f22ee8b --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeAuditPageFormDTO.java @@ -0,0 +1,58 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @Description + * @Author yzm + * @Date 2023/3/6 9:58 + */ +@Data +public class BadgeAuditPageFormDTO implements Serializable { + private static final long serialVersionUID = -6908967598027076330L; + + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + @NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) + private String customerId; + /** + * 页码 + */ + @NotNull(message = "pageNo不能为空", groups = AddUserInternalGroup.class) + private Integer pageNo; + /** + * 每页显示数量 + */ + @NotNull(message = "pageSize不能为空", groups = AddUserInternalGroup.class) + private Integer pageSize; + /** + * 当前用户所属的组织id + */ + @NotBlank(message = "agencyId不能为空", groups = AddUserInternalGroup.class) + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + /** + * 徽章id + */ + private String badgeId; + /** + * 审核状态 approved:审核通过,rejected:审核驳回;auditing:审核中 + */ + private String auditStatus; + + +} + 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 85ed907b4a..48365aa8a6 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 @@ -60,10 +60,11 @@ public class CertificationAddFormDTO implements Serializable { */ private String remark; - /** - * 验证码 - */ - private String code; + // 烟台不校验验证码 + // /** + // * 验证码 + // */ + // private String code; /** * 是否需要发送站内信: 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/form/resi/ResiPortrayalCommonFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/resi/ResiPortrayalCommonFormDTO.java new file mode 100644 index 0000000000..9679258c91 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/resi/ResiPortrayalCommonFormDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.form.resi; + +import lombok.Data; + +/** + * @Description 烟台居民画像入参 + * @Author yzm + * @Date 2023/4/11 17:03 + */ +@Data +public class ResiPortrayalCommonFormDTO { + /** + * /gov/org/customeragency/agencygridtree返回的agencyId + */ + private String orgId; + /** + * /gov/org/customeragency/agencygridtree返回level=grid时,orgType:grid;其他情况orgType:agency + */ + private String orgType; +} + diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditRecordResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditRecordResultDTO.java index 7ae47fdbca..2ea48afe64 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditRecordResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditRecordResultDTO.java @@ -37,7 +37,7 @@ public class BadgeAuditRecordResultDTO implements Serializable { */ private Long createTime; /** - * 用户名 + * 审核状态 approved:审核通过,rejected:审核驳回;auditing:审核中 */ private String auditStatus; @@ -50,4 +50,16 @@ public class BadgeAuditRecordResultDTO implements Serializable { * 审核记录ID */ private String recordId; + + /** + * pc端徽章审核-分页列表赋值 + * 03.07:烟台需求pc端增加徽章审核 + */ + private String gridId; + /** + * pc端徽章审核-分页列表赋值 + * 03.07:烟台需求pc端增加徽章审核 + * 网格名称:社区-网格 + */ + private String gridName; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeListResultDTO.java index 8374a6497e..015f0d9422 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeListResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeListResultDTO.java @@ -32,4 +32,5 @@ public class BadgeListResultDTO { * 固有徽章类型 党员徽章:party;无:none */ private String type; + private String customerId; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertificationDetailResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertificationDetailResultDTO.java index 63783adc2c..575302ac5c 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertificationDetailResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertificationDetailResultDTO.java @@ -1,8 +1,10 @@ package com.epmet.dto.result; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.io.Serializable; +import java.util.Date; /** * @Author zxc @@ -63,6 +65,14 @@ public class CertificationDetailResultDTO implements Serializable { */ private String recordId; + private String gridId; + private String gridName; + + private String badgeId; + private String badgeName; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createdTime; + public CertificationDetailResultDTO() { this.surname = ""; this.name = ""; @@ -74,5 +84,10 @@ public class CertificationDetailResultDTO implements Serializable { this.authResult = ""; this.authReason = ""; this.recordId = ""; + this.gridId=""; + this.gridName=""; + this.badgeId=""; + this.badgeName=""; + this.createdTime=null; } } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserOperListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserOperListResultDTO.java index 49bbf6be77..88e7216b47 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserOperListResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserOperListResultDTO.java @@ -51,10 +51,17 @@ public class UserOperListResultDTO implements Serializable { @JsonIgnore private String customerId; + /** + * 是否开启(点亮) 1:点亮;0:未点亮 + */ @JsonIgnore private String isOpened; - @JsonIgnore + /** + * 认证(审核)状态 待审核:auditing;审核通过: approved;驳回:rejected; + */ + // @JsonIgnore private String auditStatus; + @JsonIgnore private Integer sort; 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-client/src/main/java/com/epmet/dto/result/resi/ResiPortrayalResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/resi/ResiPortrayalResultDTO.java new file mode 100644 index 0000000000..4f0b95072a --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/resi/ResiPortrayalResultDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.result.resi; + +import lombok.Data; + +/** + * @Description 烟台居民画像返参 + * @Author yzm + * @Date 2023/4/11 17:04 + */ +@Data +public class ResiPortrayalResultDTO { + /** + * 居民数量 + */ + private Integer totalResi; + /** + * 年龄分布:50岁以下:0;50-59岁:1;60-69岁:2;70-79岁:3;80岁以上:4 + * 学历分布:学历key + */ + private String code; + + /** + * 学历分布:小学及文盲/初中..... + * 年龄分布:50岁以下/50-59岁/60-69岁/70-79岁/80岁以上 + */ + private String codeName; +} + 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 7f58178ffe..151302844d 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 @@ -4,6 +4,7 @@ import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.RequirePermission; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.enums.RequirePermissionEnum; +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; @@ -140,6 +141,20 @@ public class BadgeController { return new Result>().ok(result); } + /** + * pc端徽章审核-分页列表 + * + * @param formDTO + * @return + */ + @PostMapping("audit-page-list") + public Result> auditPageList(@LoginUser TokenDto tokenDto,@RequestBody BadgeAuditPageFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO, BadgeAuditPageFormDTO.AddUserInternalGroup.class, BadgeAuditPageFormDTO.AddUserShowGroup.class); + return new Result>().ok(badgeService.auditPageList(formDTO)); + } + + /** * 审核 * @author zhaoqifeng @@ -232,4 +247,12 @@ public class BadgeController { return new Result().ok(badgeService.deleteBadgeCertificateAuditing(customerId,gridId)); } + /** + * 查询当前客户下,所有的徽章,用于pc徽章审核查询条件 + * @return + */ + @PostMapping("badge-options") + public Result> queryBadgeOptions(@LoginUser TokenDto tokenDto){ + return new Result>().ok(badgeService.queryBadgeOptions(tokenDto.getCustomerId())); + } } 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/IcResiUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java index 440a440fd4..e0e653a016 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java @@ -59,9 +59,11 @@ import com.epmet.constants.ImportTaskConstants; import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.form.*; import com.epmet.dto.form.resi.IcResiPageNonDynamicFormDTO; +import com.epmet.dto.form.resi.ResiPortrayalCommonFormDTO; import com.epmet.dto.result.*; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.resi.IcResiNonDynamicResultDTO; +import com.epmet.dto.result.resi.ResiPortrayalResultDTO; import com.epmet.enums.IcResiUserTableEnum; import com.epmet.excel.PartyMemberAgeExportExcel; import com.epmet.excel.PartyMemberEducationExportExcel; @@ -1217,6 +1219,25 @@ public class IcResiUserController implements ResultDataResolver { return new Result().ok(r); } + /** + * 根据房屋主键查询户内家庭成员简信息 + * 返回的手机号、身份证加密 + * + * @param houseId 房屋主键 + * @param loginUser 登录用户 + * @return com.epmet.commons.tools.utils.Result> + * @author work@yujt.net.cn + * @date 2022/4/21/0021 15:00 + */ + @MaskResponse(fieldNames = {"mobile","idCard"}, fieldsMaskType = {MaskResponse.MASK_TYPE_MOBILE,MaskResponse.MASK_TYPE_ID_CARD}) + @PostMapping("listhomeuserbrief-encrypt/{houseId}") + public Result> listHomeUserBriefEncrypt(@PathVariable("houseId") String houseId, @LoginUser TokenDto loginUser) { + String customerId = loginUser.getCustomerId(); + List r = icResiUserService.listHomeUserBrief(houseId, customerId); + return new Result().ok(r); + } + + /** * 根据房屋id,查询居民信息表中-家庭信息-本人 的居民。如果有多个,返回最近一个 * @@ -1508,4 +1529,31 @@ public class IcResiUserController implements ResultDataResolver { return new Result>().ok(icResiUserService.renHuConditionList(formDTO)); } + /** + * 烟台需求:https://modao.cc/app/DUshpXWirii6amoDQsb8OP#screen=slfbvoz5w4z9f98 + * 接口地址:http://yapi.elinkservice.cn/project/356/interface/api/cat_1370 + * 居民年龄分布饼图 + * + * @param formDTO + * @return + */ + @PostMapping("age-distribute") + public Result> queryAgeDistribute(@RequestBody ResiPortrayalCommonFormDTO formDTO) { + return new Result>().ok(icResiUserService.queryAgeDistribute(formDTO.getOrgId(), formDTO.getOrgType())); + } + + /** + * 烟台需求:https://modao.cc/app/DUshpXWirii6amoDQsb8OP#screen=slfbvoz5w4z9f98 + * 接口地址:http://yapi.elinkservice.cn/project/356/interface/api/cat_1370 + * 居民学历分布饼图 + * + * @param formDTO + * @return + */ + @PostMapping("education-distribute") + public Result> queryEducationDistribute(@LoginUser TokenDto tokenDto,@RequestBody ResiPortrayalCommonFormDTO formDTO) { + return new Result>().ok(icResiUserService.queryEducationDistribute(tokenDto.getCustomerId(),tokenDto.getUserId(),formDTO.getOrgId(), formDTO.getOrgType())); + } + + } 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 637da83ce0..e421212c73 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 @@ -77,7 +77,7 @@ public class UserBadgeController { certificationAddFormDTO.setUserId(tokenDto.getUserId()); certificationAddFormDTO.setSendMsgFlag(false); // 是否自动通过 - certificationAddFormDTO.setAutoPassFlag(true); + certificationAddFormDTO.setAutoPassFlag(false); ValidatorUtils.validateEntity(certificationAddFormDTO, CertificationAddFormDTO.CertificationAdd.class); return userBadgeService.authBadgeRecord(certificationAddFormDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java index 113ed28dee..528c00c45a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java @@ -213,4 +213,19 @@ public interface BadgeDao extends BaseDao { */ Integer badgeAuditReset(@Param("gridId") String gridId); + /** + * pc端徽章审核-分页列表 + * + * @param customerId + * @param agencyId + * @param gridId + * @param badgeId + * @param auditStatus + * @return + */ + List auditPageList(@Param("customerId") String customerId, + @Param("agencyId") String agencyId, + @Param("gridId") String gridId, + @Param("badgeId") String badgeId, + @Param("auditStatus") String auditStatus); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java index 9930c7338f..c6693389d6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java @@ -24,6 +24,7 @@ import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.IcVolunteerPolyDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; +import com.epmet.dto.result.resi.ResiPortrayalResultDTO; import com.epmet.entity.IcResiUserEntity; import org.apache.ibatis.annotations.MapKey; import org.apache.ibatis.annotations.Mapper; @@ -453,4 +454,14 @@ public interface IcResiUserDao extends BaseDao { List getImportUserList(@Param("customerId")String customerId,@Param("agencyId")String agencyId); + /** + * 烟台居民画像:按照学历分组,查询居民数量 + * @param customerId + * @param orgId + * @param orgType:agency/grid + * @return + */ + List queryEducationDistribute(@Param("customerId") String customerId, + @Param("orgId") String orgId, + @Param("orgType") String orgType); } 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/UserBadgeCertificateRecordDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeCertificateRecordDao.java index 2d73b4bac6..947fc5fb02 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeCertificateRecordDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeCertificateRecordDao.java @@ -40,4 +40,6 @@ public interface UserBadgeCertificateRecordDao extends BaseDao { * @return */ Integer deleteBadgeCertificateAuditing(String customerId, String gridId); + + /** + * pc端徽章审核-分页列表 + * @param formDTO + * @return + */ + PageData auditPageList(BadgeAuditPageFormDTO formDTO); + + /** + * 查询当前客户下,所有的徽章,用于pc徽章审核查询条件 + * @param customerId + * @return + */ + List queryBadgeOptions(String customerId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java index 563365d414..ef2a04d8d9 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java @@ -28,6 +28,7 @@ import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.resi.IcResiNonDynamicResultDTO; +import com.epmet.dto.result.resi.ResiPortrayalResultDTO; import com.epmet.entity.IcResiUserEntity; import com.epmet.excel.support.ExportResiUserItemDTO; import com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO; @@ -549,4 +550,25 @@ public interface IcResiUserService extends BaseService { List renHuConditionList(RHZKStatisticsFormDTO formDTO); + /** + * 烟台需求:https://modao.cc/app/DUshpXWirii6amoDQsb8OP#screen=slfbvoz5w4z9f98 + * 接口地址:http://yapi.elinkservice.cn/project/356/interface/api/cat_1370 + * 居民年龄分布饼图 + * + * @param orgId + * @param orgType + * @return + */ + List queryAgeDistribute(String orgId, String orgType); + + /** + * 烟台需求:https://modao.cc/app/DUshpXWirii6amoDQsb8OP#screen=slfbvoz5w4z9f98 + * 接口地址:http://yapi.elinkservice.cn/project/356/interface/api/cat_1370 + * 居民学历分布饼图 + * + * @param orgId + * @param orgType agency/grid + * @return + */ + List queryEducationDistribute(String customerId,String staffId,String orgId, String orgType); } 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/impl/BadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java index 39359b29ea..e6721412b8 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 @@ -30,6 +30,8 @@ import com.epmet.commons.tools.exception.ValidateException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; @@ -49,6 +51,8 @@ import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.MessageFeignClient; import com.epmet.redis.UserBadgeRedis; import com.epmet.service.*; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -516,4 +520,40 @@ public class BadgeServiceImpl extends BaseServiceImpl imp public Integer deleteBadgeCertificateAuditing(String customerId, String gridId) { return userBadgeCertificateRecordService.deleteBadgeCertificateAuditing(customerId,gridId); } + + /** + * pc端徽章审核-分页列表 + * + * @param formDTO + * @return + */ + @Override + public PageData auditPageList(BadgeAuditPageFormDTO formDTO) { + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + List list = baseDao.auditPageList(formDTO.getCustomerId(), + formDTO.getAgencyId(), + formDTO.getGridId(), + formDTO.getBadgeId(), + formDTO.getAuditStatus()); + list.forEach(dto -> { + GridInfoCache gridInfoCache = CustomerOrgRedis.getGridInfo(dto.getGridId()); + if (null != gridInfoCache) { + dto.setGridName(gridInfoCache.getGridNamePath()); + } + }); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); + } + + /** + * 查询当前客户下,所有的徽章,用于pc徽章审核查询条件 + * + * @param customerId + * @return + */ + @Override + public List queryBadgeOptions(String customerId) { + List list=baseDao.selectList(customerId); + return list; + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserExportServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserExportServiceImpl.java index 49ac9c8d2a..261687fcbd 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserExportServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserExportServiceImpl.java @@ -7,8 +7,6 @@ import com.alibaba.excel.write.metadata.style.WriteCellStyle; import com.alibaba.excel.write.style.HorizontalCellStyleStrategy; import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; import com.alibaba.fastjson.JSON; -import com.epmet.commons.rocketmq.constants.TopicConstants; -import com.epmet.commons.rocketmq.messages.CheckMQMsg; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; @@ -29,7 +27,10 @@ import com.epmet.commons.tools.utils.poi.excel.handler.ExcelFillCellMergeStrateg import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.constant.IcResiUserConstant; -import com.epmet.dto.form.*; +import com.epmet.dto.form.ExportResiUserFormDTO; +import com.epmet.dto.form.IcExportTemplateQueryFormDTO; +import com.epmet.dto.form.IcResiUserPageFormDTO; +import com.epmet.dto.form.ResiUserQueryValueDTO; import com.epmet.dto.result.FormItemResult; import com.epmet.dto.result.IcCustomExportResultDTO; import com.epmet.dto.result.OptionDTO; @@ -52,10 +53,7 @@ import org.apache.poi.ss.usermodel.VerticalAlignment; import org.jetbrains.annotations.Nullable; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import org.springframework.web.context.request.RequestContextHolder; -import org.springframework.web.context.request.ServletRequestAttributes; -import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.*; @@ -243,8 +241,14 @@ public class IcResiUserExportServiceImpl implements IcResiUserExportService { List showSqlColumns = exportConfigData.getShowSqlColumns(); Set hiddenColumnSet = exportConfigData.getHiddenSqlColumns().stream().map(IcCustomExportResultDTO.SqlColumn::getColumnName).collect(Collectors.toSet()); result.forEach(o -> { + log.info("!@#>>>>>>>>>>"+o.toString()); getDataForResi(itemOriginMap, staffInfoCacheResult, resultData, showSqlColumns, hiddenColumnSet, o); }); + log.info("!@#>>>>>>>>>>"+itemOriginMap.toString()); + log.info("!@#>>>>>>>>>>"+staffInfoCacheResult.toString()); + log.info("!@#>>>>>>>>>>"+resultData.toString()); + log.info("!@#>>>>>>>>>>"+showSqlColumns.toString()); + log.info("!@#>>>>>>>>>>"+hiddenColumnSet.toString()); if (!onlyGetData){ excelWriter.write(resultData, writeSheet); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index c49ecc7554..3c56aa244d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -62,6 +62,7 @@ import com.epmet.dto.result.*; import com.epmet.dto.result.demand.IcResiDemandDictDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.resi.IcResiNonDynamicResultDTO; +import com.epmet.dto.result.resi.ResiPortrayalResultDTO; import com.epmet.entity.*; import com.epmet.enums.RenHuConditionEnum; import com.epmet.excel.EpidemicPreventionExportExcel; @@ -81,6 +82,7 @@ import com.google.common.cache.CacheBuilder; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; import org.apache.commons.compress.utils.Lists; import org.apache.commons.lang3.StringUtils; import org.jetbrains.annotations.NotNull; @@ -3899,4 +3901,62 @@ public class IcResiUserServiceImpl extends BaseServiceImpl queryAgeDistribute(String orgId, String orgType) { + // todo + + + return null; + } + + /** + * 烟台需求:https://modao.cc/app/DUshpXWirii6amoDQsb8OP#screen=slfbvoz5w4z9f98 + * 接口地址:http://yapi.elinkservice.cn/project/356/interface/api/cat_1370 + * 居民学历分布饼图 + * + * @param orgId + * @param orgType agency/grid + * @return + */ + @Override + public List queryEducationDistribute(String customerId, String staffId, String orgId, String orgType) { + if (StringUtils.isBlank(orgId)) { + orgId = CustomerStaffRedis.getStaffInfo(customerId, staffId).getAgencyId(); + orgType = OrgTypeEnum.AGENCY.getCode(); + } + // 获取文化程度字典 + DictListFormDTO dictFormDTO = new DictListFormDTO(); + dictFormDTO.setDictType(DictTypeEnum.EDUCATION.getCode()); + Result> dictResult = epmetAdminOpenFeignClient.dictList(dictFormDTO); + if (!dictResult.success() || CollectionUtils.isEmpty(dictResult.getData())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "学历字典获取失败", "学历字典获取失败"); + } + //按照学历分组,查询居民数量 + List totalList = baseDao.queryEducationDistribute(customerId, orgId, orgType); + Map map = totalList.stream().collect(Collectors.toMap(ResiPortrayalResultDTO::getCode,ResiPortrayalResultDTO::getTotalResi)); + List resultDTOList = new ArrayList<>(); + dictResult.getData().forEach(dict -> { + ResiPortrayalResultDTO resultDTO = new ResiPortrayalResultDTO(); + resultDTO.setCode(dict.getValue()); + resultDTO.setCodeName(dict.getLabel()); + resultDTO.setTotalResi(NumConstant.ZERO); + if(MapUtils.isNotEmpty(map)&&map.containsKey(dict.getValue())){ + resultDTO.setTotalResi(map.get(dict.getValue())); + } + resultDTOList.add(resultDTO); + }); + return resultDTOList; + } + + + } 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/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java index 009870cb44..faf959d7a7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java @@ -3,11 +3,15 @@ package com.epmet.service.impl; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.epmet.commons.tools.constant.NumConstant; +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.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.EpmetRequestHolder; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.SpringContextUtils; import com.epmet.commons.tools.validator.PhoneValidatorUtils; @@ -17,19 +21,19 @@ import com.epmet.constant.ReadFlagConstant; import com.epmet.constant.SmsTemplateConstant; import com.epmet.constant.UserMessageTypeConstant; import com.epmet.dao.*; +import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.ResiUserBadgeDTO; import com.epmet.dto.UserBadgeCertificateRecordDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; +import com.epmet.entity.BadgeEntity; +import com.epmet.entity.UserBadgeCertificateRecordEntity; import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovOrgFeignClient; import com.epmet.redis.UserBadgeRedis; import com.epmet.redis.UserBaseInfoRedis; -import com.epmet.service.ResiUserBadgeService; -import com.epmet.service.UserBadgeCertificateRecordService; -import com.epmet.service.UserBadgeService; -import com.epmet.service.UserBaseInfoService; +import com.epmet.service.*; import com.epmet.util.ModuleConstant; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -138,17 +142,39 @@ public class UserBadgeServiceImpl implements UserBadgeService { u.setIsLighted(u.getIsOpened().equals(NumConstant.ZERO_STR) ? BadgeConstant.NO : BadgeConstant.YES); u.setIsCertificated(BadgeConstant.NO); u.setIsReject(false); + u.setAuditStatus(StrConstant.EPMETY_STR); }); return userOperListResultDTOS; } userOperListResultDTOS.forEach(ub -> { - userAuthBadgeList.forEach(u -> { - if (ub.getBadgeId().equals(u.getBadgeId())){ + Boolean authFlag=false; + for (UserOperListResultDTO u : userAuthBadgeList) { + ub.setAuditStatus(StrConstant.EPMETY_STR); + if (ub.getBadgeId().equals(u.getBadgeId())) { ub.setIsReject(u.getAuditStatus().equals(BadgeConstant.REJECTED)); ub.setIsCertificated(u.getAuditStatus().equals(BadgeConstant.APPROVED) ? BadgeConstant.YES : BadgeConstant.NO); ub.setIsLighted(u.getIsOpened().equals(NumConstant.ZERO_STR) ? BadgeConstant.NO : BadgeConstant.YES); + ub.setAuditStatus(u.getAuditStatus()); + authFlag = true; } - }); + } + if (!authFlag) { + UserBadgeCertificateRecordEntity entity = userBadgeCertificateRecordDao.selectCertificateRecord(ub.getBadgeId(), userOperListFormDTO.getUserId()); + if (null == entity) { + //未申请 + ub.setIsReject(null); + ub.setIsLighted(BadgeConstant.NO); + ub.setAuditStatus(StrConstant.EPMETY_STR); + ub.setIsCertificated(BadgeConstant.NO); + } else { + //申请了,但是未通过的:rejected:审核驳回;auditing:审核中 + ub.setIsReject(entity.getAuditStatus().equals(BadgeConstant.REJECTED)); + ub.setIsLighted(BadgeConstant.NO); + ub.setAuditStatus(entity.getAuditStatus()); + ub.setIsCertificated(BadgeConstant.NO); + } + } + }); Map> collect = userOperListResultDTOS.stream().collect(Collectors.groupingBy(UserOperListResultDTO::getIsLighted)); List result = collect.get(BadgeConstant.YES); @@ -272,11 +298,26 @@ public class UserBadgeServiceImpl implements UserBadgeService { authFieldFormDTO.setBadgeId(certificationAddFormDTO.getBadgeId()); validateParams(certificationAddFormDTO, authFieldFormDTO); - if (StringUtils.isNotBlank(certificationAddFormDTO.getMobile())) { + //烟台不校验验证码 + /*if (StringUtils.isNotBlank(certificationAddFormDTO.getMobile())) { String smsCode = userBadgeRedis.getBadgeSmsCode(certificationAddFormDTO.getMobile()); if (!StringUtils.isNotBlank(smsCode)) { return new Result().error(EpmetErrorCode.MOBILE_CODE_ERROR.getCode()); } + }*/ + // 0309:如果是党员徽章去判断居民信息-类别是否是党员 + String auditRemark=""; + BadgeEntity badgeEntity = badgeDao.selectBadgeInfo(EpmetRequestHolder.getLoginUserCustomerId(),certificationAddFormDTO.getBadgeId()); + if (null == badgeEntity) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "徽章信息查询异常", "徽章信息查询异常"); + } + if (BadgeConstant.PARTY.equals(badgeEntity.getFixationBadgeType())) { + // 如果是党员徽章,去查看居民信息-类别 + IcResiUserDTO icResiUserDTO = SpringContextUtils.getBean(IcResiUserService.class).getByResiId(certificationAddFormDTO.getIdcard()); + if (null != icResiUserDTO && NumConstant.ONE_STR.equals(icResiUserDTO.getIsParty())) { + auditRemark ="居民信息是党员,徽章申请自动通过"; + certificationAddFormDTO.setAutoPassFlag(true); + } } UserBadgeCertificateRecordDTO form = ConvertUtils.sourceToTarget(certificationAddFormDTO, UserBadgeCertificateRecordDTO.class); List userIds = new ArrayList<>(); @@ -296,6 +337,11 @@ public class UserBadgeServiceImpl implements UserBadgeService { log.info(JSON.toJSONString(form)); String recordId=IdWorker.getIdStr(); form.setId(recordId); + GridInfoCache gridInfoCache=CustomerOrgRedis.getGridInfo(form.getGridId()); + if(null==gridInfoCache||StringUtils.isBlank(gridInfoCache.getPid())){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"查询网格缓存异常","查询网格缓存异常"); + } + form.setAgencyId(gridInfoCache.getPid()); userBadgeDao.insertUserBadgeCertificateRecord(form); if(certificationAddFormDTO.getSendMsgFlag()){ //TODO 站内信发送 @@ -314,6 +360,7 @@ public class UserBadgeServiceImpl implements UserBadgeService { //审核状态 approved:审核通过,rejected:审核驳回;auditing:审核中 badgeAuditFormDTO.setAuditStatus(BadgeConstant.APPROVED); badgeAuditFormDTO.setCurrentUserId("APP_USER"); + badgeAuditFormDTO.setAuditRemark(auditRemark); autoPassBadge(badgeAuditFormDTO); } Map resultMap=new HashMap(); @@ -332,6 +379,7 @@ public class UserBadgeServiceImpl implements UserBadgeService { dto.setStaffId(badgeAuditFormDTO.getCurrentUserId()); dto.setIsLast(BadgeConstant.YES); dto.setAuditTime(new Date()); + dto.setAuditRemark(badgeAuditFormDTO.getAuditRemark()); SpringContextUtils.getBean(UserBadgeCertificateRecordService.class).update(dto); ResiUserBadgeDTO resiUserBadgeDTO = new ResiUserBadgeDTO(); @@ -402,7 +450,12 @@ public class UserBadgeServiceImpl implements UserBadgeService { public CertificationDetailResultDTO certificationDetail(TokenDto tokenDto, CertificationDetailFormDTO certificationDetailFormDTO) { //工作端 if (StringUtils.isNotBlank(certificationDetailFormDTO.getRecordId())){ - return userBadgeDao.selectBadgeAuthRecord(null, certificationDetailFormDTO.getBadgeId(),certificationDetailFormDTO.getRecordId()); + CertificationDetailResultDTO res= userBadgeDao.selectBadgeAuthRecord(null, certificationDetailFormDTO.getBadgeId(),certificationDetailFormDTO.getRecordId()); + GridInfoCache gridInfoCache= CustomerOrgRedis.getGridInfo(res.getGridId()); + if(null!=gridInfoCache){ + res.setGridName(gridInfoCache.getGridNamePath()); + } + return res; } //居民端 CertificationDetailResultDTO resiResult = userBadgeDao.selectBadgeAuthRecord(tokenDto.getUserId(), certificationDetailFormDTO.getBadgeId(),certificationDetailFormDTO.getRecordId()); @@ -413,6 +466,10 @@ public class UserBadgeServiceImpl implements UserBadgeService { resiResult.setIdcard(userInfo.getIdNum()); } } + GridInfoCache gridInfoCache= CustomerOrgRedis.getGridInfo(resiResult.getGridId()); + if(null!=gridInfoCache){ + resiResult.setGridName(gridInfoCache.getGridNamePath()); + } return resiResult; } 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 1d5b46b1ca..52930c1242 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 @@ -26,6 +26,7 @@ import com.epmet.commons.tools.constant.AppClientConstant; 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.distributedlock.DistributedLock; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; @@ -61,6 +62,7 @@ import com.github.pagehelper.PageInfo; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.redisson.api.RLock; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -68,6 +70,7 @@ import org.springframework.util.CollectionUtils; import javax.annotation.Resource; import java.util.*; +import java.util.concurrent.TimeUnit; /** * 用户基础信息 @@ -102,6 +105,8 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl page(Map params) { @@ -550,65 +555,72 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl registerWrapper = new LambdaQueryWrapper<>(); - registerWrapper.eq(RegisterRelationEntity::getCustomerId, formDTO.getCustomerId()); - registerWrapper.eq(RegisterRelationEntity::getUserId, baseInfo.getUserId()); - registerWrapper.eq(RegisterRelationEntity::getFirstRegister, NumConstant.ONE_STR); - RegisterRelationEntity registerRelation = registerRelationDao.selectOne(registerWrapper); - if (null != registerRelation) { - result.setAgencyId(registerRelation.getAgencyId()); - result.setGridId(registerRelation.getGridId()); - GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(registerRelation.getGridId()); - if (null == gridInfo) { - logger.error(String.format("获取用户注册网格信息为空,userId:%s,gridId:%s", baseInfo.getUserId(), registerRelation.getGridId())); - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取网格信息为空", "获取小程序注册网格信息失败"); + baseInfo.setGender(NumConstant.ZERO_STR); + baseDao.insert(baseInfo); + + result.setEpmetUserId(userEntity.getId()); + result.setRegFlag(false); + } else { + // 更新下user_Base_info信息 + if (StringUtils.isNotBlank(formDTO.getNick()) && StringUtils.isBlank(baseInfo.getRealName())) { + baseInfo.setRealName(formDTO.getNick()); + } + if (StringUtils.isNotBlank(formDTO.getNick()) && StringUtils.isBlank(baseInfo.getSurname())) { + baseInfo.setSurname(NameUtils.getSurNameComplex(formDTO.getNick())); + } + if (StringUtils.isNotBlank(formDTO.getNick()) && StringUtils.isBlank(baseInfo.getName())) { + baseInfo.setName(NameUtils.getNameComplex(formDTO.getNick())); + } + if (StringUtils.isNotBlank(formDTO.getNick()) && StringUtils.isBlank(baseInfo.getNickname())) { + baseInfo.setNickname(formDTO.getNick()); + } + if (StringUtils.isNotBlank(formDTO.getAvatarUrl()) && StringUtils.isBlank(baseInfo.getHeadImgUrl())) { + baseInfo.setHeadImgUrl(formDTO.getAvatarUrl()); + } + baseDao.updateById(baseInfo); + + result.setEpmetUserId(baseInfo.getUserId()); + LambdaQueryWrapper registerWrapper = new LambdaQueryWrapper<>(); + registerWrapper.eq(RegisterRelationEntity::getCustomerId, formDTO.getCustomerId()); + registerWrapper.eq(RegisterRelationEntity::getUserId, baseInfo.getUserId()); + registerWrapper.eq(RegisterRelationEntity::getFirstRegister, NumConstant.ONE_STR); + RegisterRelationEntity registerRelation = registerRelationDao.selectOne(registerWrapper); + if (null != registerRelation) { + result.setAgencyId(registerRelation.getAgencyId()); + result.setGridId(registerRelation.getGridId()); + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(registerRelation.getGridId()); + if (null == gridInfo) { + logger.error(String.format("获取用户注册网格信息为空,userId:%s,gridId:%s", baseInfo.getUserId(), registerRelation.getGridId())); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取网格信息为空", "获取小程序注册网格信息失败"); + } + result.setGridName(gridInfo.getGridNamePath()); + result.setRegFlag(true); } - result.setGridName(gridInfo.getGridNamePath()); - result.setRegFlag(true); } + } finally { + distributedLock.unLock(lock); } return result; } 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 6101e9c2d5..99ffac21ba 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 @@ -619,14 +619,14 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl registerWrapper = new LambdaQueryWrapper<>(); diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml index 275babd61f..2d9d49fd74 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml @@ -67,7 +67,8 @@ BADGE_NAME, BADGE_ICON, BADGE_STATUS, - FIXATION_BADGE_TYPE AS "type" + FIXATION_BADGE_TYPE AS "type", + CUSTOMER_ID as customerId FROM ( SELECT * FROM badge @@ -340,4 +341,59 @@ AND AUDIT_STATUS = 'auditing' AND GRID_ID = #{gridId} + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index 2d2e30535f..07278b80aa 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -493,7 +493,8 @@ mobile, agency_id, grid_id, - home_id + home_id, + IS_PARTY as isParty FROM ic_resi_user WHERE @@ -1514,4 +1515,28 @@ + + + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccineDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccineDao.xml index ea56bb20b6..882a0c421e 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccineDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccineDao.xml @@ -252,4 +252,43 @@ select ID from ic_vaccine where CUSTOMER_ID = #{customerId} and ID_CARD = #{idCard} + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeCertificateRecordDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeCertificateRecordDao.xml index 2a58027d9c..bd895279b0 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeCertificateRecordDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeCertificateRecordDao.xml @@ -40,5 +40,17 @@ AND (AUDIT_STATUS = 'approved' OR AUDIT_STATUS = 'auditing') - + \ No newline at end of file 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 95b77d51a7..fb8acd52bb 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 @@ -73,7 +73,7 @@ CREATED_TIME DESC - + SELECT - SURNAME, - NAME, - ID_NUM AS idcard, - ( CASE WHEN AUDIT_STATUS = 'approved' THEN 'yes' ELSE 'no' END ) AS isCertificated, - MOBILE, - CERTIFICATION_IMG, - REMAEK AS remark, - CUSTOMER_ID, - BADGE_ID, - CERTIFICATION_IMG, - AUDIT_STATUS, - AUDIT_STATUS AS authResult, - AUDIT_REMARK AS authReason, - ID AS recordId + r.SURNAME, + r.NAME, + r.ID_NUM AS idcard, + ( CASE WHEN r.AUDIT_STATUS = 'approved' THEN 'yes' ELSE 'no' END ) AS isCertificated, + r.MOBILE, + r.CERTIFICATION_IMG, + r.REMAEK AS remark, + r.CUSTOMER_ID, + r.BADGE_ID, + r.CERTIFICATION_IMG, + r.AUDIT_STATUS, + r.AUDIT_STATUS AS authResult, + r.AUDIT_REMARK AS authReason, + r.ID AS recordId, + r.GRID_ID as gridId, + r.BADGE_ID as badgeId, + b.BADGE_NAME as badgeName, + r.CREATED_TIME as createdTime FROM - user_badge_certificate_record + user_badge_certificate_record r + left join badge b on(r.BADGE_ID=b.id and r.CUSTOMER_ID=b.CUSTOMER_ID) WHERE - DEL_FLAG = 0 - AND BADGE_ID = #{badgeId} + r.DEL_FLAG = 0 + AND r.BADGE_ID = #{badgeId} - AND USER_ID = #{userId} - AND IS_LAST = 'yes' + AND r.USER_ID = #{userId} + AND r.IS_LAST = 'yes' - AND ID = #{recordId} + AND r.ID = #{recordId} @@ -175,6 +180,7 @@ ID, CUSTOMER_ID, GRID_ID, + AGENCY_ID, USER_ID, BADGE_ID, SURNAME, @@ -200,6 +206,7 @@ #{id}, #{customerId}, #{gridId}, + #{agencyId}, #{userId}, #{badgeId}, #{surname},