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 7e428aa6a0..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.*; /** @@ -88,7 +93,7 @@ public class IcPartyActivityController implements ResultDataResolver { */ @PostMapping("search") public Result> page(@LoginUser TokenDto tokenDto,@RequestBody PartyActivityFormDTO formDTO){ - formDTO.setCustomerId(formDTO.getCustomerId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); PageData page = icPartyActivityService.search(formDTO); return new Result>().ok(page); } @@ -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 e142f3680f..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 @@ -52,7 +52,7 @@ a.ACT_ID, a.GRID_ID, ur.UNIT_ID, - GROUP_CONCAT( sr.SERVICE_MATTER ) AS serviceMatter, + GROUP_CONCAT( distinct sr.SERVICE_MATTER ) AS serviceMatter, a.TITLE, a.TARGET, a.CONTENT, @@ -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