Merge branch 'hemenkou_dev' into dev
# Conflicts:
# springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/UserApi.java
| | |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | commonPage.setCommunityId(this.getCommunityId()); |
| | | commonPage.setType(1); |
| | | return this.communityService.selectAllComActRaffle(commonPage); |
| | | } |
| | | |
| | |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | commonPage.setCommunityId(this.getCommunityId()); |
| | | commonPage.setParamId2(0); |
| | | return communityService.selectAllComActSocialProject(commonPage); |
| | | } |
| | | |
| | |
| | | import com.panzhihua.common.model.vos.common.ComMngVolunteerServiceTypeVo; |
| | | import com.panzhihua.common.model.vos.common.ComMngVolunteerSkillVo; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | public R detailCommunity() { |
| | | return communityService.detailCommunity(this.getCommunityId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询活动报名名单集合",response = ActivitySignVO.class) |
| | | @PostMapping("listactivitysign") |
| | | public R listActivitySign(@RequestBody ActivitySignVO activitySignVO) { |
| | | if (ObjectUtils.isEmpty(activitySignVO.getActivityId())) { |
| | | return R.fail("活动id主键不能为空"); |
| | | } |
| | | return communityService.listActivitySign(activitySignVO); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @ApiOperation(value = "我的活动", response = ComActActivityVO.class) |
| | | @ApiImplicitParam(name = "status", value = "活动状态(4 进行中 5 已结束 6 已取消)", required = false) |
| | | @GetMapping("listactivity") |
| | | public R listActivity(@RequestParam(value = "status", required = false) Integer status) { |
| | | public R listActivity(@RequestParam(value = "status", required = false) Integer status,@RequestParam(value = "type", required = false) Integer type) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | Long userId = loginUserInfo.getUserId(); |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | List<ComActActivityVO> comActActivityVOS = new ArrayList<>(); |
| | | R r = communityService.listActivity(userId, status); |
| | | R r = communityService.listActivity(userId, status,type); |
| | | if (R.isOk(r)&&r.getData()!=null) { |
| | | comActActivityVOS = (List<ComActActivityVO>)r.getData(); |
| | | } |
| | |
| | | |
| | | @ApiModelProperty("单次活动时长") |
| | | private Integer activityTime; |
| | | |
| | | @ApiModelProperty("1签到 2签退") |
| | | private Integer signType; |
| | | } |
| | |
| | | @ExcelProperty(value = "奖品名称",index = 4) |
| | | private String prizeName; |
| | | |
| | | @ApiModelProperty(value = "奖品图片") |
| | | @ExcelProperty(value = "奖品图片",index = 5) |
| | | private URL imageUrl; |
| | | |
| | | @ApiModelProperty(value = "核销人名称") |
| | | @ExcelProperty(value = "核销人",index = 6) |
| | | @ExcelProperty(value = "核销人",index = 5) |
| | | private String staffName; |
| | | |
| | | @ApiModelProperty(value = "核销时间") |
| | | @ExcelProperty(value = "核销时间",index = 7) |
| | | @ExcelProperty(value = "核销时间",index = 6) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date staffTime; |
| | | |
| | | @ExcelProperty(value = "状态",index = 7) |
| | | private String status; |
| | | |
| | | public String getStatus() { |
| | | if("1".equals(this.status)){ |
| | | return "待兑奖"; |
| | | } |
| | | if("2".equals(this.status)){ |
| | | return "已兑奖"; |
| | | } |
| | | if("3".equals(this.status)){ |
| | | return "已失效"; |
| | | } |
| | | return ""; |
| | | } |
| | | } |
| | |
| | | * @return 活动列表 |
| | | */ |
| | | @PostMapping("listactivity") |
| | | R listActivity(@RequestParam("userId") Long userId, @RequestParam(value = "status", required = false) Integer status); |
| | | R listActivity(@RequestParam("userId") Long userId, @RequestParam(value = "status", required = false) Integer status,@RequestParam(value = "type",required = false)Integer type); |
| | | |
| | | /** |
| | | * 用户确认心愿 |
| | |
| | | @ApiOperation("项目分类级联查询") |
| | | @PostMapping("/queryLevel") |
| | | public R queryLevel(@RequestBody ComActColumnVO comActColumnVO){ |
| | | comActColumnVO.setCommunityId(this.getCommunityId()); |
| | | return this.communityService.queryLevel(comActColumnVO); |
| | | } |
| | | } |
| | |
| | | @ApiOperation("分页查询所有数据") |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | commonPage.setCommunityId(this.getCommunityId()); |
| | | return communityService.selectAllComActSocialProjectMember(commonPage); |
| | | } |
| | | |
| | |
| | | @GetMapping() |
| | | @ApiOperation(value = "查询社工", response= ComActSocialWorkerVO.class) |
| | | R query(@Validated @ModelAttribute PageComActSocialWorkerDTO pageComActSocialWorkerDTO){ |
| | | pageComActSocialWorkerDTO.setCommunityId(this.getCommunityId()); |
| | | if(this.getLoginUserInfo().getStreetId()!=null){ |
| | | pageComActSocialWorkerDTO.setStreetId(this.getLoginUserInfo().getStreetId().toString()); |
| | | } |
| | | else { |
| | | pageComActSocialWorkerDTO.setCommunityId(this.getCommunityId()); |
| | | } |
| | | return communityService.queryComactsocialworker(pageComActSocialWorkerDTO); |
| | | } |
| | | |
| | |
| | | */ |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Long id) { |
| | | return R.ok(this.comActRaffleRecordService.selectById(id)); |
| | | return this.comActRaffleRecordService.selectById(id); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | comActActivityVO1.setComActActPrizeVOList(comActActPrizeVOList); |
| | | Integer volunteerMax = comActActivityVO1.getVolunteerMax(); |
| | | if (volunteerMax.intValue() != 0) { |
| | | comActActivityVO1.setType(1); |
| | | } else { |
| | | comActActivityVO1.setType(2); |
| | | if(comActActivityVO1.getType()==null){ |
| | | if (volunteerMax.intValue() != 0) { |
| | | comActActivityVO1.setType(1); |
| | | } else { |
| | | comActActivityVO1.setType(2); |
| | | } |
| | | } |
| | | fillActivitySignList(id, comActActivityVO1); |
| | | }); |
| | |
| | | */ |
| | | @PostMapping("listactivity") |
| | | public R listActivity(@RequestParam("userId") Long userId, |
| | | @RequestParam(value = "status", required = false) Integer status) { |
| | | return comActActivityService.listActivity(userId, status); |
| | | @RequestParam(value = "status", required = false) Integer status,@RequestParam(value = "type", required = false) Integer type) { |
| | | return comActActivityService.listActivity(userId, status,type); |
| | | } |
| | | |
| | | /** |
| | |
| | | + "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 " |
| | | + "a.sign_up_end, " + "ca.name as communityName,a.type " + "FROM " + "com_act_activity a " |
| | | + "left join sys_user u on a.sponsor_id=u.user_id " + "left join (select * from com_act_act_sign where `status` = 1) s on a.id=s.activity_id " |
| | | + "left join com_act ca on a.community_id=ca.community_id " + " where 1=1 " + |
| | | |
| | |
| | | + "AND a.begin_at <![CDATA[ >= ]]> #{comActActivityVO.beginAt} AND a.end_at <![CDATA[ <= ]]> #{comActActivityVO.endAt} " |
| | | + " </if> " + "<if test='comActActivityVO.type != null'>" |
| | | + "AND a.type=#{comActActivityVO.type} " + " </if> " |
| | | + " group by a.id " + " order by a.status asc,a.publish_at desc " + "</script>") |
| | | + " group by a.id " + " ORDER BY a.status = 99 desc,a.publish_at DESC " + "</script>") |
| | | IPage<ComActActivityVO> pageActivity(Page page, @Param("comActActivityVO") ComActActivityVO comActActivityVO); |
| | | |
| | | // @Select("SELECT " + "u.name sponsorName, " + "ca.name communityName, " |
| | |
| | | */ |
| | | IPage<ComActSocialWorkerVO> selectActivity(Page page,@Param("id") Long id); |
| | | |
| | | /** |
| | | * 查询社工详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | ComActSocialWorkerVO selectOneById(Long id); |
| | | } |
| | |
| | | * @param status |
| | | * @return 活动列表 |
| | | */ |
| | | R listActivity(Long userId, Integer status); |
| | | R listActivity(Long userId, Integer status,Integer type); |
| | | |
| | | /** |
| | | * 查询志愿者参与的所有已经完成的活动 |
| | |
| | | comActActivityVO.setIsVolunteer(comActActSignDO.getIsVolunteer()); |
| | | } |
| | | List<ComActActRegistDO> regList = comActActRegistDAO.selectList(new QueryWrapper<ComActActRegistDO>().lambda() |
| | | .eq(ComActActRegistDO::getUserId, userId).eq(ComActActRegistDO::getActivityId, id).eq(ComActActRegistDO::getType, 1)); |
| | | .eq(ComActActRegistDO::getUserId, userId).eq(ComActActRegistDO::getActivityId, id)); |
| | | if (!regList.isEmpty()) { |
| | | List<ComActActRegistDO> collect = regList.stream().sorted(Comparator.comparing(ComActActRegistDO::getId).reversed()).collect(Collectors.toList()); |
| | | comActActivityVO.setTimes(collect.get(0).getTimes()); |
| | | ComActActRegistDO comActActRegistDO=collect.get(0); |
| | | if(comActActRegistDO.getType()==2){ |
| | | if(comActActRegistDO.getEndTime()==null){ |
| | | comActActivityVO.setSignType(2); |
| | | } |
| | | else { |
| | | comActActivityVO.setSignType(1); |
| | | } |
| | | } |
| | | } |
| | | else { |
| | | comActActivityVO.setSignType(1); |
| | | } |
| | | } |
| | | } |
| | |
| | | * @return 活动列表 |
| | | */ |
| | | @Override |
| | | public R listActivity(Long userId, Integer status) { |
| | | public R listActivity(Long userId, Integer status,Integer type) { |
| | | List<ActivitySignVO> activitySignVOList = comActActSignDAO.selectList(userId); |
| | | if (ObjectUtils.isEmpty(activitySignVOList)) { |
| | | return R.ok(); |
| | |
| | | .filter(activityDO -> activityDO.getStatus().equals(status)).collect(Collectors.toList()); |
| | | } |
| | | } |
| | | if(isNull(type)){ |
| | | comActActivityDOS=comActActivityDOS.stream().filter(comActActivityDO -> comActActivityDO.getType().equals(type)).collect(Collectors.toList()); |
| | | } |
| | | if (!comActActivityDOS.isEmpty()) { |
| | | comActActivityDOS.forEach(comActActivityDO -> { |
| | | ComActActivityVO comActActivityVO = new ComActActivityVO(); |
| | |
| | | |
| | | @Override |
| | | public R selectById(Long id) { |
| | | return R.ok(this.baseMapper.selectById(id)); |
| | | return R.ok(this.baseMapper.selectOneById(id)); |
| | | } |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.social.SocialProjectVO; |
| | | import com.panzhihua.service_community.dao.ComActDAO; |
| | | import com.panzhihua.service_community.entity.ComActSocialProject; |
| | | import com.panzhihua.service_community.dao.ComActSocialProjectDao; |
| | | import com.panzhihua.service_community.entity.ProjectRelationVO; |
| | | import com.panzhihua.service_community.model.dos.ComActDO; |
| | | import com.panzhihua.service_community.service.ComActSocialProjectService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | |
| | | @Resource |
| | | private ComActSocialProjectDao comActSocialProjectDao; |
| | | @Resource |
| | | private ComActDAO comActDAO; |
| | | @Override |
| | | public R pageList(CommonPage commonPage) { |
| | | if(commonPage.getParamId2()!=null){ |
| | | ComActDO comActDO=comActDAO.selectById(commonPage.getCommunityId()); |
| | | if(comActDO!=null){ |
| | | commonPage.setStreetId(comActDO.getStreetId()); |
| | | } |
| | | } |
| | | return R.ok(comActSocialProjectDao.pageList(new Page(commonPage.getPage(),commonPage.getSize()),commonPage)); |
| | | } |
| | | |
| | |
| | | |
| | | <select id="pageList" resultType="com.panzhihua.common.model.vos.community.raffle.ComActRaffleVO"> |
| | | select t.*,t2.waitRaffleCount,t3.joinCount,t4.name as createName,t5.raffleCount,t6.prizeCount from com_act_raffle t |
| | | LEFT JOIN (select sum(surplus) as waitRaffleCount,raffle_id from com_act_raffle_prize GROUP BY raffle_id) t2 on t.id = t2.raffle_id |
| | | LEFT JOIN (select count(*) waitRaffleCount,raffle_id from com_act_raffle_record where status = 1 group by raffle_id) t2 on t.id = t2.raffle_id |
| | | LEFT JOIN (select count(*) as joinCount,raffle_id from com_act_raffle_record GROUP BY raffle_id) t3 on t.id = t3.raffle_id |
| | | LEFT JOIN sys_user t4 on t.create_by = t4.user_id |
| | | LEFT JOIN (select count(*) as raffleCount,raffle_id from com_act_raffle_record where status >0 GROUP BY raffle_id) t5 on t.id = t5.raffle_id |
| | |
| | | <if test="commonPage.keyword !=null"> |
| | | and t.name like concat('%',#{commonPage.keyword},'%') |
| | | </if> |
| | | <if test="commonPage.type!=null"> |
| | | and t.status > 0 |
| | | </if> |
| | | </where> |
| | | order by t.create_time desc |
| | | </select> |
| | |
| | | </select> |
| | | |
| | | <select id="selectOneById" resultType="com.panzhihua.common.model.vos.community.raffle.ComActRaffleRecordVO"> |
| | | select t.*, t1.`name`, t1.image |
| | | select t.*, t1.`name`, t1.image,t2.phone, t2.`name` as username, t3.name as staffName |
| | | from com_act_raffle_record t |
| | | LEFT JOIN com_act_raffle_prize t1 on t.prize_id = t1.id |
| | | left join sys_user t2 on t.user_id = t2.user_id |
| | | left join sys_user t3 on t.staff_id = t3.user_id |
| | | where t.id=#{id} |
| | | </select> |
| | | |
| | |
| | | left join com_act_column t2 on t.second_column_id = t2.id |
| | | <where> |
| | | 1=1 |
| | | <if test="commonPage.communityId !=0 and commonPage.communityId !=null"> |
| | | and t.community_id =#{commonPage.communityId} |
| | | <if test="commonPage.paramId2==null"> |
| | | <if test="commonPage.communityId !=0 and commonPage.communityId !=null"> |
| | | and t.community_id =#{commonPage.communityId} |
| | | </if> |
| | | <if test="commonPage.streetId !=0 and commonPage.streetId !=null"> |
| | | and t.street_id =#{commonPage.streetId} |
| | | </if> |
| | | </if> |
| | | <if test="commonPage.streetId !=0 and commonPage.streetId !=null"> |
| | | and t.street_id =#{commonPage.streetId} |
| | | <if test="commonPage.paramId2!=null"> |
| | | and (t.street_id = #{commonPage.streetId} or t.community_id =#{commonPage.communityId}) |
| | | </if> |
| | | <if test="commonPage.status !=null"> |
| | | and t.status =#{commonPage.status} |
| | |
| | | SELECT a.*,b.name as socialOrgId,c.name as communityName,e.name as streetId |
| | | FROM com_act_social_worker a left join com_act_social_org b on a.social_org_id = b.id |
| | | left join com_act c on a.community_id = c.community_id |
| | | left join com_street e on a.street_id = e.street_id |
| | | left join com_street e on c.street_id = e.street_id |
| | | <where> |
| | | <if test="pageComActSocialWorkerDTO.id!=null"> |
| | | AND a.id = #{pageComActSocialWorkerDTO.id} |
| | |
| | | AND a.name like concat('%',#{pageComActSocialWorkerDTO.name},'%') |
| | | </if> |
| | | <if test="pageComActSocialWorkerDTO.keyword!=null and pageComActSocialWorkerDTO.keyword!=''"> |
| | | AND (a.name like concat('%',#{pageComActSocialWorkerDTO.keyword},'%') or a.telephone like concat('%',#{pageComActSocialWorkerDTO.keyword},'%') ) |
| | | AND (a.name like concat('%',#{pageComActSocialWorkerDTO.keyword},'%') or a.telephone like |
| | | concat('%',#{pageComActSocialWorkerDTO.keyword},'%') ) |
| | | </if> |
| | | <if test="pageComActSocialWorkerDTO.ageBegin!=null"> |
| | | AND a.age>=#{pageComActSocialWorkerDTO.ageBegin} |
| | |
| | | AND a.gen = #{pageComActSocialWorkerDTO.gen} |
| | | </if> |
| | | <if test="pageComActSocialWorkerDTO.streetId!=null"> |
| | | AND a.street_id = #{pageComActSocialWorkerDTO.streetId} |
| | | AND e.street_id = #{pageComActSocialWorkerDTO.streetId} |
| | | </if> |
| | | <if test="pageComActSocialWorkerDTO.communityId!=null and pageComActSocialWorkerDTO.communityId!=0"> |
| | | AND a.community_id = #{pageComActSocialWorkerDTO.communityId} |
| | |
| | | </select> |
| | | |
| | | <select id="queryAll" resultType="com.panzhihua.common.model.dtos.civil.ComActSocialWorkerExcelVO"> |
| | | SELECT a.social_org_id,a.name as name,a.birthday,a.telephone,a.gen,a.social_worker_code,a.skill_field,a.business_scope,b.name as socialOrgId,c.name as communityId,e.name as streetId |
| | | SELECT a.social_org_id,a.name as |
| | | name,a.birthday,a.telephone,a.gen,a.social_worker_code,a.skill_field,a.business_scope,b.name as |
| | | socialOrgId,c.name as communityId,e.name as streetId |
| | | FROM com_act_social_worker a left join com_act_social_org b on a.social_org_id = b.id |
| | | left join com_act c on a.community_id = c.community_id |
| | | left join com_street e on a.street_id = e.street_id |
| | |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | <select id="selectType" resultType="Integer"> |
| | | select count(id) from com_act_social_worker where street_id = 15 |
| | | <if test="type ==1"> |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectSkillType" resultType="com.panzhihua.common.model.vos.community.bigscreen.BigScreenHmkProjectTypeInfo"> |
| | | select count(*) count,t1.name from com_act_social_worker t INNER JOIN com_act_column t1 on t.skill_type = t1.id where t.street_id = 15 <if test="communityId!=null"> and t.community_id = #{communityId}</if> GROUP BY t1.id |
| | | <select id="selectSkillType" |
| | | resultType="com.panzhihua.common.model.vos.community.bigscreen.BigScreenHmkProjectTypeInfo"> |
| | | select count(*) count,t1.name from com_act_social_worker t INNER JOIN com_act_column t1 on t.skill_type = t1.id |
| | | where t.street_id = 15 <if test="communityId!=null">and t.community_id = #{communityId}</if> GROUP BY t1.id |
| | | </select> |
| | | |
| | | <select id="selectActivity" resultType="com.panzhihua.common.model.vos.civil.ComActSocialWorkerVO"> |
| | | select t.* from com_act_social_worker t LEFT JOIN sys_user t1 on t.telephone = t1.phone where t1.user_id in (select distinct user_id from com_act_act_regist where activity_id =#{id} ) |
| | | select t.* |
| | | from com_act_social_worker t |
| | | LEFT JOIN sys_user t1 on t.telephone = t1.phone |
| | | where t1.user_id in (select distinct user_id from com_act_act_regist where activity_id = #{id}) |
| | | </select> |
| | | |
| | | <select id="selectOneById" resultType="com.panzhihua.common.model.vos.civil.ComActSocialWorkerVO"> |
| | | SELECT a.*, b.name as socialOrgId, c.name as communityName, e.name as streetId |
| | | FROM com_act_social_worker a |
| | | left join com_act_social_org b on a.social_org_id = b.id |
| | | left join com_act c on a.community_id = c.community_id |
| | | left join com_street e on c.street_id = e.street_id |
| | | where a.id =#{id} |
| | | </select> |
| | | </mapper> |