| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | @ApiModelProperty("所属活动id") |
| | | private Long activityId; |
| | | |
| | | @ApiModelProperty("类型(1.党建 2.节日 3.天气预报 4.疫情 5.灾害预警 6.志愿者)") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("用户id, 和用户信息表的相关id关联") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty("上传时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | @ApiModelProperty("上传图片") |
| | |
| | | |
| | | @ApiModelProperty("图片名称") |
| | | private String pictureName; |
| | | |
| | | @ApiModelProperty("是否系统预置(1.是 0.否)") |
| | | private Integer sysFlag; |
| | | } |
| | |
| | | } |
| | | |
| | | @ApiOperation(value = "excel导出活动签到统计") |
| | | @GetMapping("statistics/export") |
| | | @PostMapping("statistics/export") |
| | | public R activityStatisticsExport(@RequestBody ComActActRegistVO comActActRegistVO){ |
| | | String name = "活动签到统计导出数据.xlsx"; |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | |
| | | } |
| | | |
| | | @ApiOperation(value = "社区活动签到二维码下载") |
| | | @GetMapping("qrCode/export") |
| | | @PostMapping("qrCode/export") |
| | | public R activityRegistQRCodeExport(@RequestParam("activityId") Long activityId){ |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | |
| | | if(!file0.isDirectory()&&!file0.exists()){ |
| | | file0.mkdirs(); |
| | | } |
| | | sftp.download("/mnt/data/web/", "社区活动二维码.ftl", "d:/comActivity/file/社区活动二维码.ftl"); |
| | | sftp.download("/mnt/data/web/excel/", "社区活动二维码.ftl", "d:/comActivity/file/社区活动二维码.ftl"); |
| | | try { |
| | | String text = String.valueOf(activityId); |
| | | String destPath = "d:/comActivity/file/"; |
| | |
| | | return communityService.getPictureList(userId); |
| | | } |
| | | |
| | | /** |
| | | * 获取系统预置图库 getSysPictureList |
| | | * @param type 图片类型 |
| | | * @return R 系统图库集 |
| | | * @author txb |
| | | * @date 2021/8/27 13:33 |
| | | */ |
| | | @ApiOperation(value = "获取社区活动系统预置图库", response = ComActActPictureVO.class) |
| | | @GetMapping("sysPicture/getList") |
| | | public R getSysPictureList(@RequestParam(value = "type") Integer type){ |
| | | return communityService.getSysPictureList(type); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询当前社区标签列表") |
| | | @GetMapping("userTags/getList") |
| | | public R getUserTagsList() { |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | return userService.listTags(communityId); |
| | | return userService.listTags(); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增社区动态") |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取系统预置图库 getSysPictureList |
| | | * @param type 图库类型 |
| | | * @return R 系统图库集 |
| | | * @author txb |
| | | * @date 2021/8/27 13:33 |
| | | */ |
| | | @GetMapping("/activity/sysPicture/getList") |
| | | public R getSysPictureList(@RequestParam(value = "type") Integer type){ |
| | | return comActActivityService.getSysPictureList(type); |
| | | } |
| | | |
| | | /** |
| | | * 新增社区动态 |
| | | * |
| | | * @param comActDynVO |
| | |
| | | // " </where>" + |
| | | // "</script>") |
| | | @Select("<script> " + "SELECT " + "a.id, " + "a.activity_name, " + "u.`name` sponsorName, " + "a.activity_addr, " |
| | | + "a.`status`, " + "a.publish_at, " + "a.begin_at, " + "a.cover, " + "a.end_at, " + "a.volunteer_max, " |
| | | + "a.`status`, " + "a.is_qr_code, " + "a.publish_at, " + "a.begin_at, " + "a.cover, " + "a.end_at, " + "a.volunteer_max, " |
| | | + "count(if(s.is_volunteer=1,s.id,null))volunteer_now, " |
| | | + "count(if(s.is_volunteer=0,s.id,null))participant_now, " + "a.participant_max, " + "a.sign_up_begin, " |
| | | + "a.sign_up_end, " + "ca.name as communityName " + "FROM " + "com_act_activity a " |
| | |
| | | @Select("SELECT " + "u.name sponsorName, " + "ca.name communityName, " |
| | | + "count(if(s.is_volunteer=1,s.id,null))volunteer_now, " |
| | | + "count(if(s.is_volunteer=0,s.id,null))participant_now, " + "a.* " + "FROM " + "com_act_activity a " |
| | | + "join sys_user u on a.sponsor_id=u.user_id " + "left join com_act_act_sign s on a.id=s.activity_id " |
| | | + "left join sys_user u on a.sponsor_id=u.user_id " + "left join com_act_act_sign s on a.id=s.activity_id " |
| | | + "left join com_act ca on a.community_id=ca.community_id " + "where a.id=#{id} " + " group by a.id ") |
| | | ComActActivityVO inforActivity(Long id); |
| | | |
| | |
| | | @Select("<script> " + "select t.* from ( " + "SELECT " + "a.id, " + "a.activity_name, " + "u.`name` sponsorName, " |
| | | + "a.activity_addr, " + "a.participant_max, " + "count(if(s.is_volunteer=1,null,s.id))participant_now, " |
| | | + "a.volunteer_max, " + "count(if(s.is_volunteer=1,s.id,null))volunteer_now, " + "a.`status`, " |
| | | + "a.publish_at, " + "a.begin_at, " + "a.end_at, " + "a.sign_up_begin, " + "a.sign_up_end " + "FROM " |
| | | + "a.publish_at, " + "a.is_qr_code, " + "a.begin_at, " + "a.end_at, " + "a.sign_up_begin, " + "a.sign_up_end " + "FROM " |
| | | + " com_act_activity a " + " LEFT JOIN sys_user u on a.sponsor_id=u.user_id " |
| | | + " LEFT JOIN com_act_act_sign s on a.id=s.activity_id " + "WHERE " |
| | | + " a.`status` = 1 and a.community_id=#{comActActivityVO.communityId} " |
| | |
| | | + " </if> " + "group by a.id " + " " + " union all " + "select t1.* from ( " + " " + " SELECT " + "a.id, " |
| | | + "a.activity_name, " + "u.`name` sponsorName, " + "a.activity_addr, " + "a.participant_max, " |
| | | + "count(if(s.is_volunteer=1,null,s.id))participant_now, " + "a.volunteer_max, " |
| | | + "count(if(s.is_volunteer=1,s.id,null))volunteer_now, " + "a.`status`, " + "a.publish_at, " + "a.begin_at, " |
| | | + "count(if(s.is_volunteer=1,s.id,null))volunteer_now, " + "a.`status`, " + "a.publish_at, " + "a.is_qr_code, " + "a.begin_at, " |
| | | + "a.end_at, " + "a.sign_up_begin, " + "a.sign_up_end " + "FROM " + " com_act_activity a " |
| | | + " LEFT JOIN sys_user u on a.sponsor_id=u.user_id " + " LEFT JOIN com_act_act_sign s on a.id=s.activity_id " |
| | | + "WHERE " + " a.`status` != 1 and a.community_id=#{comActActivityVO.communityId} " |
| | |
| | | private Long activityId; |
| | | |
| | | /** |
| | | * 类型(1.党建 2.节日 3.天气预报 4.疫情 5.灾害预警 6.志愿者) |
| | | */ |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 用户id, 和用户信息表的相关id关联 |
| | | */ |
| | | private Long userId; |
| | |
| | | */ |
| | | private String pictureName; |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComActActPictureDO{" + |
| | | "id=" + id + |
| | | ", activityId=" + activityId + |
| | | ", userId=" + userId + |
| | | ", createAt=" + createAt + |
| | | ", uploadPicture=" + uploadPicture + |
| | | ", pictureName=" + pictureName + |
| | | "}"; |
| | | } |
| | | /** |
| | | * 是否系统预置(1.是 0.否) |
| | | */ |
| | | private Integer sysFlag; |
| | | |
| | | } |
| | |
| | | R getPictureList(Long userId); |
| | | |
| | | /** |
| | | * 获取系统预置图库 getSysPictureList |
| | | * @return R 系统图库集 |
| | | * @author txb |
| | | * @date 2021/8/27 13:33 |
| | | */ |
| | | R getSysPictureList(Integer type); |
| | | |
| | | /** |
| | | * 分页展示我的所有活动 时间倒序排列 |
| | | * |
| | | * @param comActActivityVO |
| | |
| | | comActActPictureDO.setActivityId(activityId); |
| | | comActActPictureDO.setUserId(comActActivityVO.getUserId()); |
| | | comActActPictureDO.setUploadPicture(comActActivityVO.getCover()); |
| | | comActActPictureDO.setSysFlag(0); |
| | | comActActPictureDAO.insert(comActActPictureDO); |
| | | return R.ok(activityId); |
| | | } |
| | |
| | | return R.ok(comActActPictureVOS); |
| | | } |
| | | |
| | | @Override |
| | | public R getSysPictureList(Integer type) { |
| | | List<ComActActPictureVO> comActActPictureVOS = new ArrayList<>(); |
| | | List<ComActActPictureDO> comActActPictureDOS = comActActPictureDAO.selectList(new QueryWrapper<ComActActPictureDO>().lambda(). |
| | | eq(ComActActPictureDO::getSysFlag, 1).eq(ComActActPictureDO :: getType, type)); |
| | | if (comActActPictureDOS != null && comActActPictureDOS.size() != 0) { |
| | | comActActPictureDOS.forEach(comActActPictureDO -> { |
| | | ComActActPictureVO comActActPictureVO = new ComActActPictureVO(); |
| | | BeanUtils.copyProperties(comActActPictureDO, comActActPictureVO); |
| | | comActActPictureVOS.add(comActActPictureVO); |
| | | }); |
| | | } |
| | | return R.ok(comActActPictureVOS); |
| | | } |
| | | |
| | | /** |
| | | * 分页展示我的所有活动 时间倒序排列 |
| | | * |