| | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActivityTypeVO; |
| | | import com.panzhihua.common.model.vos.community.volunteer.ComMngVolunteerExcelVO; |
| | | import com.panzhihua.common.model.vos.user.SysTemplateConfigVO; |
| | |
| | | */ |
| | | @PostMapping("addvolunteer") |
| | | R addVolunteer(@RequestBody ComMngVolunteerMngVO comMngVolunteerMngVO) { |
| | | Long submitUserId = comMngVolunteerMngVO.getSubmitUserId(); |
| | | if (Objects.nonNull(submitUserId)) { |
| | | //获取小程序用户信息 |
| | | R<LoginUserInfoVO> userInfoR = userService.getUserInfoByUserId(submitUserId.toString()); |
| | | LoginUserInfoVO userInfo = userInfoR.getData(); |
| | | if (Objects.nonNull(userInfo)) { |
| | | comMngVolunteerMngVO.setIdCard(userInfo.getIdCard()); |
| | | } |
| | | } |
| | | return comMngVolunteerMngService.addVolunteer(comMngVolunteerMngVO); |
| | | } |
| | | |
| | |
| | | IPage<ComMngVolunteerMngVO> pageVolunteer(Page page, |
| | | @Param("comMngVolunteerMngVO") ComMngVolunteerMngVO comMngVolunteerMngVO); |
| | | |
| | | @Select("<script> " + "SELECT\n" + "t.id,\n" + "t.`name`,\n" + "t.state,\n" + "t.phone,\n" + "t.apply_reson,\n" |
| | | + "t.create_at, " + "t.submit_user_id \n" + "FROM\n" + "com_mng_volunteer_mng t\n" + " RIGHT JOIN \n" |
| | | + "(select submit_user_id, MAX(create_at)create_at from com_mng_volunteer_mng where state IN ( 1, 3 ) GROUP BY submit_user_id ) tmp \n" |
| | | + "on t.create_at = tmp.create_at and t.submit_user_id=tmp.submit_user_id " + "WHERE\n" |
| | | + "state in (1,3) and community_id = ${comMngVolunteerMngVO.communityId} \n" |
| | | + "<if test='comMngVolunteerMngVO.name != null and comMngVolunteerMngVO.name.trim() != ""'>" |
| | | + "and t.name like concat(#{comMngVolunteerMngVO.name},'%') \n" + " </if> " |
| | | + "<if test='comMngVolunteerMngVO.phone != null and comMngVolunteerMngVO.phone.trim() != ""'>" |
| | | + "AND t.phone like concat(#{comMngVolunteerMngVO.phone},'%')\n" + " </if> " |
| | | + "<if test='comMngVolunteerMngVO.state != null and comMngVolunteerMngVO.state != 0'>" |
| | | + "and t.state=#{comMngVolunteerMngVO.state}\n" + " </if> " + " \tORDER BY t.state asc " + "</script>") |
| | | IPage<ComMngVolunteerMngVO> pageVolunteerExamine(Page page, |
| | | @Param("comMngVolunteerMngVO") ComMngVolunteerMngVO comMngVolunteerMngVO); |
| | | |
| | |
| | | * @return |
| | | */ |
| | | List<ComMngVolunteerMngVO> selectVolunteerByCommunityId(@Param("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 志愿者审核详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | ComMngVolunteerMngVO detailVolunteerExamine(@Param("communityId") Long id); |
| | | } |
| | |
| | | @Override |
| | | public R addVolunteer(ComMngVolunteerMngVO comMngVolunteerMngVO) { |
| | | String phone = comMngVolunteerMngVO.getPhone(); |
| | | String idCard = comMngVolunteerMngVO.getIdCard(); |
| | | Integer integer = comMngVolunteerMngDAO.selectCount(new QueryWrapper<ComMngVolunteerMngDO>().lambda() |
| | | .eq(ComMngVolunteerMngDO::getPhone, phone).in(ComMngVolunteerMngDO::getState, Arrays.asList(1, 2))); |
| | | .and(wrapper -> wrapper.eq(ComMngVolunteerMngDO::getPhone, phone).or().eq(ComMngVolunteerMngDO::getIdCard, idCard)) |
| | | .in(ComMngVolunteerMngDO::getState, Arrays.asList(1, 2))); |
| | | if (null != integer && integer.intValue() > 0) { |
| | | return R.fail("请勿重复申请"); |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public R detailVolunteerExamine(Long id) { |
| | | ComMngVolunteerMngDO comMngVolunteerMngDO = comMngVolunteerMngDAO.selectById(id); |
| | | if (ObjectUtils.isEmpty(comMngVolunteerMngDO)) { |
| | | return R.fail("审核不存在"); |
| | | } |
| | | ComMngVolunteerMngVO comMngVolunteerMngVO = new ComMngVolunteerMngVO(); |
| | | BeanUtils.copyProperties(comMngVolunteerMngDO, comMngVolunteerMngVO); |
| | | ComMngVolunteerMngVO comMngVolunteerMngVO = comMngVolunteerMngDAO.detailVolunteerExamine(id); |
| | | // String phone = comMngVolunteerMngVO.getPhone(); |
| | | // comMngVolunteerMngVO.setUserId(comMngVolunteerMngDAO.selectUserIdByPhone(phone)); |
| | | return R.ok(comMngVolunteerMngVO); |
| | |
| | | w.`detail`, |
| | | w.form, |
| | | w.reject_reason, |
| | | su1.`name` responsible_name, |
| | | w.score, |
| | | w.img_width, |
| | | w.finish_at, |
| | |
| | | com_act_micro_wish w |
| | | left join com_act_micro_wish_user wu on w.id=wu.micro_wish_id |
| | | left JOIN sys_user u ON w.sponsor_id = u.user_id |
| | | LEFT JOIN sys_user su1 ON w.responsible_id = su1.user_id |
| | | LEFT JOIN (SELECT * FROM com_act_easy_photo_handler WHERE service_type = 2) ch ON w.id = ch.service_id |
| | | LEFT JOIN sys_user u2 ON ch.user_id = u2.user_id |
| | | <where> |
| | | <if test='comActMicroWishVO.communityId != null and comActMicroWishVO.communityId != 0'> |
| | | and w.community_id = ${comActMicroWishVO.communityId} |
| | |
| | | AND u.`name` like concat(#{comActMicroWishVO.sponsorName},'%') |
| | | </if> |
| | | <if test='comActMicroWishVO.responsibleName != null and comActMicroWishVO.responsibleName != ""'> |
| | | AND su1.`name` like concat(#{comActMicroWishVO.responsibleName},'%') |
| | | AND u2.`name` like concat(#{comActMicroWishVO.responsibleName},'%') |
| | | </if> |
| | | <if test='comActMicroWishVO.status != null'> |
| | | AND w.`status` = #{comActMicroWishVO.status} |
| | |
| | | cmvm.org_id, |
| | | cmvm.team_id, |
| | | cmvm.is_university, |
| | | cmvm.university_name, |
| | | IF(cmvm.is_university = 1,cmvm.university_name,null) AS university_name, |
| | | cmvot.`name` as orgName, |
| | | cmvot1.`name` as teamName, |
| | | cmvot1.`service_type_id`, |
| | |
| | | cmvm.name like concat(#{comMngVolunteerMngVO.keyWord},'%') or |
| | | cmvm.phone like concat(#{comMngVolunteerMngVO.keyWord},'%') or |
| | | cmvm.id_card = #{comMngVolunteerMngVO.keyWord} or |
| | | cmvm.university_name like concat(#{comMngVolunteerMngVO.keyWord},'%') |
| | | cmvm.university_name like concat(#{comMngVolunteerMngVO.keyWord},'%') or |
| | | TIMESTAMPDIFF(YEAR, SUBSTRING(cmvm.id_card, 7, 8), NOW()) = #{comMngVolunteerMngVO.keyWord} |
| | | ) |
| | | </if> |
| | | <if test="comMngVolunteerMngVO.orgId != null"> |
| | |
| | | INNER JOIN com_mng_volunteer_org_team t3 ON t1.org_id = t3.id |
| | | WHERE t1.community_id = #{communityId} |
| | | </select> |
| | | <select id="pageVolunteerExamine" |
| | | resultType="com.panzhihua.common.model.vos.community.ComMngVolunteerMngVO"> |
| | | SELECT |
| | | t.id, |
| | | t.`name`, |
| | | t.state, |
| | | t.phone, |
| | | t.apply_reson, |
| | | t.create_at, |
| | | t.submit_user_id |
| | | FROM |
| | | com_mng_volunteer_mng t |
| | | RIGHT JOIN ( SELECT submit_user_id, MAX( create_at ) create_at FROM com_mng_volunteer_mng WHERE state IN ( 1, 3 ) GROUP BY submit_user_id ) tmp ON t.create_at = tmp.create_at |
| | | AND t.submit_user_id = tmp.submit_user_id |
| | | WHERE |
| | | state IN ( 1, 3 ) |
| | | AND community_id = $ { comMngVolunteerMngVO.communityId } |
| | | <if test = 'comMngVolunteerMngVO.name != null and comMngVolunteerMngVO.name.trim() != ""' > |
| | | AND t.NAME LIKE concat(#{comMngVolunteerMngVO.name},'%') |
| | | </if> |
| | | <if test = 'comMngVolunteerMngVO.phone != null and comMngVolunteerMngVO.phone.trim() != ""' > |
| | | AND t.phone LIKE concat(#{comMngVolunteerMngVO.phone},'%') |
| | | </if> |
| | | <if test = 'comMngVolunteerMngVO.state != null and comMngVolunteerMngVO.state != 0' > |
| | | AND t.state = #{comMngVolunteerMngVO.state} |
| | | </if> |
| | | <if test="comMngVolunteerMngVO.isUniversity != null"> |
| | | and t.is_university = #{comMngVolunteerMngVO.isUniversity} |
| | | </if> |
| | | ORDER BY |
| | | t.state ASC |
| | | </select> |
| | | <select id="detailVolunteerExamine" |
| | | resultType="com.panzhihua.common.model.vos.community.ComMngVolunteerMngVO"> |
| | | |
| | | </select> |
| | | |
| | | </mapper> |