Merge remote-tracking branch 'origin/test' into txb
| | |
| | | import com.panzhihua.common.model.dtos.community.CancelRecordDTO; |
| | | import com.panzhihua.common.model.dtos.community.OperationDetailDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageUserReserveDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActReserveCommitVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | |
| | | @ApiOperation("取消预约/登记") |
| | | @PostMapping("/cancelReserve") |
| | | public R userCancelReserve(@RequestBody CancelRecordDTO cancelRecordDTO){ |
| | | cancelRecordDTO.setUserId(this.getUserId()); |
| | | return communityService.userCancelReserve(cancelRecordDTO); |
| | | } |
| | | |
| | |
| | | comActReserveOperationRecordDO.setUserId(this.getUserId()); |
| | | return communityService.reserveOperation(comActReserveOperationRecordDO); |
| | | } |
| | | |
| | | @ApiOperation("预约登记列表") |
| | | @GetMapping("/list") |
| | | public R list(@RequestParam("communityId") Long communityId){ |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if(loginUserInfo != null){ |
| | | communityId = loginUserInfo.getCommunityId(); |
| | | } |
| | | return communityService.reserveListApplets(communityId); |
| | | } |
| | | } |
| | |
| | | @ApiOperation(value = "社区活动/志愿者活动签到") |
| | | @PostMapping("activity/sign-in") |
| | | public R activitySignIn(@RequestBody ComActActRegistVO comActActRegistVO) { |
| | | comActActRegistVO.setUserId(this.getUserId()); |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | comActActRegistVO.setUserId(loginUserInfo.getUserId()); |
| | | comActActRegistVO.setIsVolunteer(loginUserInfo.getIsVolunteer()); |
| | | return communityService.activitySignIn(comActActRegistVO); |
| | | } |
| | | |
| | |
| | | } |
| | | comActMicroWishVO.setIsApplets(1); |
| | | comActMicroWishVO.setIsPageMyWish(null); |
| | | return communityService.pageMicroWish(comActMicroWishVO); |
| | | return communityService.pageMicroWishApplets(comActMicroWishVO); |
| | | } |
| | | |
| | | @ApiOperation("发布微心愿") |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import static java.util.stream.Collectors.toList; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Comparator; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | import java.util.TreeSet; |
| | | import java.util.concurrent.atomic.AtomicBoolean; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.vos.community.ComActActEvaluateVO; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.util.ObjectUtils; |
| | |
| | | import com.panzhihua.common.model.dtos.user.SysUserFeedbackDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActActEvaluateVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActRegistVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActivityVO; |
| | | import com.panzhihua.common.model.vos.community.ComActEasyPhotoVO; |
| | |
| | | if (!ObjectUtils.isEmpty(comActActivityVOS)) { |
| | | List<ComActActivityVO> collect = comActActivityVOS.stream() |
| | | .sorted(Comparator.comparing(ComActActivityVO::getSingDate).reversed()).collect(Collectors.toList()); |
| | | //当前用户最近签到时间 |
| | | //当前用户签到记录列表 |
| | | R r2 = communityService.listSignInActivity(userId); |
| | | if (R.isOk(r2) && !ObjectUtils.isEmpty(r2.getData())) { |
| | | ArrayList<ComActActRegistVO> comActActRegistVOS = JSONArray.parseArray(JSONArray.toJSONString(r2.getData()), ComActActRegistVO.class).stream() |
| | | .sorted(Comparator.comparing(ComActActRegistVO::getCreateAt).reversed()) |
| | | .collect(Collectors.collectingAndThen(Collectors.toCollection(() -> |
| | | new TreeSet<>(Comparator.comparing(f -> String.join("", f.getUserId().toString(), f.getActivityId().toString())))), ArrayList::new)); |
| | | collect.forEach(comActActivityVO -> comActActRegistVOS.forEach(activitySignInVO -> { |
| | | if (comActActivityVO.getId().equals(activitySignInVO.getActivityId())) { |
| | | comActActivityVO.setActivitySignInDate(activitySignInVO.getCreateAt()); |
| | | List<ComActActRegistVO> comActActRegistVOS = JSONArray.parseArray(JSONArray.toJSONString(r2.getData()), ComActActRegistVO.class).stream() |
| | | .sorted(Comparator.comparing(ComActActRegistVO::getCreateAt).reversed()).collect(toList()); |
| | | collect.forEach(comActActivityVO -> { |
| | | ArrayList<ComActActRegistVO> currentList = new ArrayList<>(); |
| | | comActActRegistVOS.forEach(activitySignInVO -> { |
| | | if (comActActivityVO.getId().equals(activitySignInVO.getActivityId())) { |
| | | currentList.add(activitySignInVO); |
| | | } |
| | | }); |
| | | if (currentList.size() > 10) { |
| | | comActActivityVO.setActivitySignInList(currentList.subList(0, 10)); |
| | | } else { |
| | | comActActivityVO.setActivitySignInList(currentList); |
| | | } |
| | | })); |
| | | }); |
| | | } |
| | | //当前用户活动评分 |
| | | R r3 = communityService.listEvaluate(userId); |
| | |
| | | private String remark; |
| | | |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "用户id",hidden = true) |
| | | private Long userId; |
| | | } |
| | |
| | | private Integer type; |
| | | @ApiModelProperty(value = "认证时间(月份)", example = "1") |
| | | private Integer month; |
| | | @ApiModelProperty(value = "认证时间(年份)", example = "2021") |
| | | private Integer year; |
| | | |
| | | @ApiModelProperty(value = "排序列", example = "create_at", hidden = true) |
| | | public String getSortColumns() { |
| | |
| | | @ApiModelProperty("是否二维码签到 1 是 0否") |
| | | private Integer isQrCode; |
| | | |
| | | @ApiModelProperty("用户最近签到时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date activitySignInDate; |
| | | @ApiModelProperty("用户签到记录列表") |
| | | private List<ComActActRegistVO> activitySignInList; |
| | | |
| | | @ApiModelProperty("联系人姓名") |
| | | private String contactName; |
| | |
| | | /** |
| | | * 操作类型 1已提交 2审核通过 3 驳回 4完成集心 5 分配 6 完成 |
| | | */ |
| | | @ApiModelProperty("操作类型 1已提交 2审核通过 3 驳回 4完成集心 5 分配 6 完成") |
| | | @ApiModelProperty("操作类型 1已提交 2审核通过 3 驳回 4完成集心 5 分配 6 完成 7反馈 8自动确认") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("操作备注") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty("反馈图片") |
| | | private String imgUrl; |
| | | |
| | | } |
| | |
| | | private String photoPathList; |
| | | |
| | | @ApiModelProperty("当前页数") |
| | | private Long pageNum; |
| | | private Long pageNum = 1L; |
| | | |
| | | @ApiModelProperty("每页记录数") |
| | | private Long pageSize; |
| | | private Long pageSize = 10L; |
| | | |
| | | @ApiModelProperty(value = "社区id",hidden = true) |
| | | private Long communityId; |
| | |
| | | |
| | | @ApiModelProperty(value = "选项key") |
| | | private String key; |
| | | |
| | | @ApiModelProperty(value = "图片选择组件url地址") |
| | | private String url; |
| | | } |
| | |
| | | private int sort; |
| | | @ApiModelProperty(value = "题目内容") |
| | | private String label; |
| | | @ApiModelProperty(value = "类型 0 单选 1 多选 2 输入框 3 手机号 4 身份证 5 文字描述 6 日期选择 7 时间选择 8 可换行的输入框 9姓名输入框", example = "0") |
| | | @ApiModelProperty(value = "类型 0 单选 1 多选 2 输入框 3 手机号 4 身份证 5 文字描述 6 日期选择 7 时间选择 8 可换行的输入框 9姓名输入框 10图片选择", example = "0") |
| | | private Integer type; |
| | | @ApiModelProperty(value = "问卷题目选项") |
| | | private List<QuestnaiteSubSelectionVO> options; |
| | |
| | | private String values; |
| | | |
| | | /** |
| | | * 类型 0 单选 1 多选 2 输入框 3 手机号 4 身份证 5 文字描述 6 日期选择 7 时间选择 8 可换行的输入框 9姓名输入框 |
| | | * 类型 0 单选 1 多选 2 输入框 3 手机号 4 身份证 5 文字描述 6 日期选择 7 时间选择 8 可换行的输入框 9姓名输入框 10图片选择 |
| | | */ |
| | | public interface type { |
| | | int danxuan = 0; |
| | |
| | | int time = 7; |
| | | int input = 8; |
| | | int name = 9; |
| | | int imgselect = 10; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.reserve; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-08-23 10:33:11 |
| | | * @describe 预约登记信息 |
| | | */ |
| | | |
| | | @Data |
| | | public class ComActReserveAppletsVO{ |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | private Long id; |
| | | |
| | | /** |
| | | * 社区id |
| | | */ |
| | | private Long communityId; |
| | | |
| | | /** |
| | | * 类型(1.预约 2.登记) |
| | | */ |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 主题 |
| | | */ |
| | | private String title; |
| | | |
| | | /** |
| | | * 浏览量 |
| | | */ |
| | | private Integer viewNum; |
| | | |
| | | /** |
| | | * 总参加人数 |
| | | */ |
| | | private Integer joinAllCount; |
| | | |
| | | /** |
| | | * 参加人数 |
| | | */ |
| | | private Integer joinCount; |
| | | |
| | | /** |
| | | * 图标类型(1.预设1 2.预设2 3.预设3 4.预设4 5.用户自定义图片) |
| | | */ |
| | | private Integer imgType; |
| | | |
| | | /** |
| | | * 图标url(当img_type为5时,此字段的值为图标url地址) |
| | | */ |
| | | private String imgUrl; |
| | | |
| | | /** |
| | | * 状态(1.待发布 2.进行中 3.已停止) |
| | | */ |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 发布时间 |
| | | */ |
| | | private Date publishTime; |
| | | |
| | | /** |
| | | * 是否可重复提交(1.是 2.否) |
| | | */ |
| | | private Integer isRepeat; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String remark; |
| | | |
| | | /** |
| | | * 组件json数据 |
| | | */ |
| | | private String jsonObject; |
| | | |
| | | /** |
| | | * 是否是首页顶部(1.是 2.否) |
| | | */ |
| | | private Integer adverPositionTop; |
| | | |
| | | /** |
| | | * 是否是首页应用(1.是 2.否) |
| | | */ |
| | | private Integer adverPositionApplication; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | private Date updateAt; |
| | | |
| | | /** |
| | | * 修改人 |
| | | */ |
| | | private Long updateBy; |
| | | |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | private Date endTime; |
| | | |
| | | /** |
| | | * 是否已删除(1.是 2.否) |
| | | */ |
| | | private Integer isDel; |
| | | |
| | | /** |
| | | * 操作记录 |
| | | */ |
| | | private List<ComOperationListVO> operationList; |
| | | } |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | @ApiModelProperty("随手拍条数") |
| | | private Integer count; |
| | | } |
| | |
| | | R pageMicroWish(@RequestBody ComActMicroWishVO comActMicroWishVO); |
| | | |
| | | /** |
| | | * 小程序分页查询微心愿 |
| | | * |
| | | * @param comActMicroWishVO |
| | | * 查询参数 |
| | | * @return 分页集合 |
| | | */ |
| | | @PostMapping("pagemicrowish/applets") |
| | | R pageMicroWishApplets(@RequestBody ComActMicroWishVO comActMicroWishVO); |
| | | |
| | | /** |
| | | * 心愿详情 |
| | | * |
| | | * @param id |
| | |
| | | */ |
| | | @GetMapping("/listworkguide/classify") |
| | | R listWorkGuideByClassifyId(@RequestParam("classifyId") Long classifyId); |
| | | |
| | | /** |
| | | * 小程序查询所有进行中的预约登记 |
| | | * @param communityId 社区id |
| | | * @return 社区所有进行中的预约登记列表 |
| | | */ |
| | | @GetMapping("/reserve/list") |
| | | R reserveListApplets(@RequestParam("communityId") Long communityId); |
| | | } |
| | |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | Long userId = loginUserInfo.getUserId(); |
| | | comActMicroWishVO.setCommunityId(communityId); |
| | | comActMicroWishVO.setBackUserId(userId); |
| | | // comActMicroWishVO.setBackUserId(userId); |
| | | comActMicroWishVO.setIsPageMyWish(null); |
| | | return communityService.pageMicroWish(comActMicroWishVO); |
| | | } |
| | |
| | | public R registerDetailedDetailAdmin(@RequestParam("reserveRecordId") Long reserveRecordId){ |
| | | return comActReserveRecordService.registerDetailedDetailAdmin(reserveRecordId); |
| | | } |
| | | |
| | | /** |
| | | * 小程序查询所有进行中的预约登记 |
| | | * @param communityId 社区id |
| | | * @return 社区所有进行中的预约登记列表 |
| | | */ |
| | | @GetMapping("/list") |
| | | public R list(@RequestParam("communityId") Long communityId){ |
| | | return comActReserveService.reserveListApplets(communityId); |
| | | } |
| | | } |
| | |
| | | package com.panzhihua.service_community.api; |
| | | |
| | | import static java.util.stream.Collectors.toList; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Comparator; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.panzhihua.service_community.model.dos.*; |
| | | import com.panzhihua.service_community.service.*; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | import com.panzhihua.common.model.dtos.community.questnaire.StatisticsSummaryDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.SystemmanagementConfigVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActRegistVO; |
| | | import com.panzhihua.common.model.vos.community.ActivitySignVO; |
| | | import com.panzhihua.common.model.vos.community.BatchhouseVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActEvaluateVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActPrizeVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActRegistVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActivityVO; |
| | | import com.panzhihua.common.model.vos.community.ComActDynVO; |
| | | import com.panzhihua.common.model.vos.community.ComActEasyPhotoVO; |
| | |
| | | import com.panzhihua.service_community.dao.ComEldersAuthHistoryRecordMapper; |
| | | import com.panzhihua.service_community.dao.ComMngPopulationDAO; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.IdcardUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | |
| | | private ComActActEvaluateService comActActEvaluateService; |
| | | @Resource |
| | | private ComEldersAuthElderlyService comEldersAuthElderlyService; |
| | | @Resource |
| | | private ComActMicroWishOperationRecordService wishOperationRecordService; |
| | | |
| | | /** |
| | | * 新增社区活动 |
| | |
| | | } else { |
| | | comActActivityVO1.setType(2); |
| | | } |
| | | fillActivitySignList(id, comActActivityVO1); |
| | | }); |
| | | page.setRecords(content); |
| | | } |
| | |
| | | } |
| | | }); |
| | | } |
| | | //签到时间 |
| | | Optional.ofNullable(userId).ifPresent(currentUserId -> { |
| | | R listSignInResult = comActActivityService.listSignInActivity(currentUserId); |
| | | if (R.isOk(listSignInResult) && !ObjectUtils.isEmpty(listSignInResult.getData())) { |
| | | Optional<ComActActRegistVO> optional = JSONArray.parseArray(JSONArray.toJSONString(listSignInResult.getData()), ComActActRegistVO.class).stream() |
| | | .filter(activitySignInVO -> activitySignInVO.getActivityId().equals(id)) |
| | | .sorted(Comparator.comparing(ComActActRegistVO::getCreateAt).reversed()).findFirst(); |
| | | if (optional.isPresent()) { |
| | | comActActivityVO.setActivitySignInDate(optional.get().getCreateAt()); |
| | | } |
| | | } |
| | | }); |
| | | fillActivitySignList(id, comActActivityVO); |
| | | comActActivityVO.setIntegral(0); |
| | | return R.ok(comActActivityVO); |
| | | } |
| | | |
| | | /** |
| | | * 填充活动报名名单 |
| | | * @param activityId 活动id |
| | | * @param comActActivityVO 需填充VO |
| | | */ |
| | | private void fillActivitySignList(Long activityId, ComActActivityVO comActActivityVO) { |
| | | //活动报名名单 |
| | | ActivitySignVO activitySignVO = new ActivitySignVO(); |
| | | activitySignVO.setActivityId(id); |
| | | activitySignVO.setActivityId(activityId); |
| | | R r = comActActivityService.listActivitySigns(activitySignVO); |
| | | if (R.isOk(r)) { |
| | | List<ActivitySignVO> activitySignVOS = |
| | |
| | | } |
| | | } |
| | | List<ActivitySignVO> collect = activitySignVOS.stream() |
| | | .filter(activitySignVO1 -> activitySignVO1.getIsVolunteer() == 1).collect(Collectors.toList()); |
| | | .filter(activitySignVO1 -> activitySignVO1.getIsVolunteer() == 1).collect(toList()); |
| | | if (!ObjectUtils.isEmpty(collect)) { |
| | | int size = collect.size(); |
| | | if (size >= 6) { |
| | |
| | | } |
| | | } |
| | | List<ActivitySignVO> collect1 = activitySignVOS.stream() |
| | | .filter(activitySignVO1 -> activitySignVO1.getIsVolunteer() == 0).collect(Collectors.toList()); |
| | | .filter(activitySignVO1 -> activitySignVO1.getIsVolunteer() == 0).collect(toList()); |
| | | if (!ObjectUtils.isEmpty(collect1)) { |
| | | int size = collect1.size(); |
| | | if (size >= 6) { |
| | |
| | | } |
| | | |
| | | } |
| | | comActActivityVO.setIntegral(0); |
| | | return R.ok(comActActivityVO); |
| | | } |
| | | |
| | | /** |
| | |
| | | int size = list.size(); |
| | | if (size == 4) { |
| | | List<ComActDynDO> collect = list.stream().sorted(Comparator.comparing(ComActDynDO::getCreateAt)) |
| | | .collect(Collectors.toList()); |
| | | .collect(toList()); |
| | | ComActDynDO comActDynDO1 = collect.get(0); |
| | | comActDynDO1.setIsTopping(0); |
| | | boolean update = comActDynService.updateById(comActDynDO1); |
| | |
| | | int size = list.size(); |
| | | if (size == 4) { |
| | | List<ComActDynDO> collect = list.stream().sorted(Comparator.comparing(ComActDynDO::getUpdateAt)) |
| | | .collect(Collectors.toList()); |
| | | .collect(toList()); |
| | | ComActDynDO comActDynDO1 = collect.get(0); |
| | | comActDynDO1.setIsTopping(0); |
| | | boolean updateById = comActDynService.updateById(comActDynDO1); |
| | |
| | | return comActMicroWishService.pageMicroWish(comActMicroWishVO); |
| | | } |
| | | |
| | | @PostMapping("pagemicrowish/applets") |
| | | public R pageMicroWishApplets(@RequestBody ComActMicroWishVO comActMicroWishVO) { |
| | | return comActMicroWishService.pageMicroWishApplets(comActMicroWishVO); |
| | | } |
| | | |
| | | /** |
| | | * 心愿详情 |
| | | * |
| | |
| | | BeanUtils.copyProperties(comActMicroWishVO, comActMicroWishDO); |
| | | boolean save = comActMicroWishService.save(comActMicroWishDO); |
| | | if (save) { |
| | | wishOperationRecordService.addOperationRecord("用户提交微心愿",comActMicroWishVO.getSponsorId() |
| | | ,comActMicroWishDO.getId(), ComActMicroWishOperationRecordDO.type.ytj,"用户提交微心愿",null); |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | |
| | | // " </if> " + |
| | | // " </where>" + |
| | | // "</script>") |
| | | @Select("<script> " + "SELECT " + "a.id, " + "a.activity_name, " + "u.`name` sponsorName, " + "a.activity_addr, " |
| | | @Select("<script> " + "SELECT " + "a.id, " + "a.activity_name, " + "u.`name` sponsorName, " |
| | | + "a.activity_addr, " + "a.aattend_people," |
| | | + "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 " |
| | | + "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 1=1 " + |
| | | |
| | | "<if test='comActActivityVO.choice == 0 '>" + "AND a.community_id=#{comActActivityVO.communityId} " + " </if> " |
| | |
| | | "w.`detail`, " + |
| | | "w.form, " + |
| | | "w.reject_reason, " + |
| | | "su.`name` responsible_name, " + |
| | | "su1.`name` responsible_name, " + |
| | | "w.score, " + |
| | | "w.img_width, " + |
| | | "w.finish_at, " + |
| | |
| | | "FROM " + |
| | | "com_act_micro_wish w " + |
| | | "left join com_act_micro_wish_user wu on w.id=wu.micro_wish_id "+ |
| | | "JOIN sys_user u ON w.sponsor_id = u.user_id " + |
| | | "left JOIN sys_user u ON w.sponsor_id = u.user_id " + |
| | | "<if test='comActMicroWishVO.sponsorName != null and comActMicroWishVO.sponsorName.trim() != ""'>" + |
| | | "AND u.name like concat(#{comActMicroWishVO.sponsorName},'%') " + |
| | | " </if> " + |
| | | "<if test='comActMicroWishVO.responsibleName == null or comActMicroWishVO.responsibleName.trim() == ""'>" + |
| | | "LEFT JOIN com_pb_service_team su ON w.responsible_id = su.id " + |
| | | "LEFT JOIN sys_user su1 ON w.responsible_id = su1.user_id " + |
| | | " </if> " + |
| | | "<if test='comActMicroWishVO.responsibleName != null and comActMicroWishVO.responsibleName.trim() != ""'>" + |
| | | " JOIN com_pb_service_team su ON w.responsible_id = su.id " + |
| | | "AND su.`name` like concat(#{comActMicroWishVO.responsibleName},'%') " + |
| | | " JOIN sys_user su1 ON w.responsible_id = su1.user_id " + |
| | | "AND su1.`name` like concat(#{comActMicroWishVO.responsibleName},'%') " + |
| | | " </if> " + |
| | | " <where>" + |
| | | "<if test='comActMicroWishVO.communityId != null and comActMicroWishVO.communityId != 0'>" + |
| | |
| | | "ORDER BY w.create_at desc "+ |
| | | "</script>") |
| | | IPage<ComActMicroWishVO> pageMicroWish(Page page, @Param("comActMicroWishVO") ComActMicroWishVO comActMicroWishVO); |
| | | |
| | | IPage<ComActMicroWishVO> pageMicroWishApplets(Page page, @Param("comActMicroWishVO") ComActMicroWishVO comActMicroWishVO); |
| | | @Select("SELECT " + |
| | | "w.id, " + |
| | | "u.name sponsor_name, " + |
| | |
| | | "w.evaluate " + |
| | | "FROM " + |
| | | "com_act_micro_wish w " + |
| | | "JOIN sys_user u ON w.sponsor_id = u.user_id " + |
| | | "LEFT JOIN sys_user u ON w.sponsor_id = u.user_id " + |
| | | "LEFT JOIN com_pb_service_team su ON w.responsible_id = su.id " + |
| | | "LEFT JOIN com_act_micro_wish_user wu ON w.id = wu.micro_wish_id " + |
| | | "WHERE " + |
| | |
| | | " w.community_id ") |
| | | List<TodoEventsVO> selectNeedToDo(@Param("communityId") Long communityId, @Param("userId") Long userId); |
| | | |
| | | @Update("update com_act_micro_wish set `status`=6, evaluate_at=now() where `status`=5 and TIMESTAMPDIFF(HOUR, feedback_at, SYSDATE())>=72") |
| | | @Update("update com_act_micro_wish set `status`=6, evaluate_at=now() where `status`=5 and TIMESTAMPDIFF(HOUR, finish_at, SYSDATE())>=72") |
| | | int updateStatusAutoConfirm(); |
| | | |
| | | @Select("select id from com_act_micro_wish where `status`=5 and TIMESTAMPDIFF(HOUR, feedback_at, SYSDATE())>=72 ") |
| | | List<Long> getWishAutoConfirmIds(); |
| | | |
| | | @Select("SELECT COUNT(id) AS completedNum," + |
| | | "(SELECT COUNT(id) FROM com_act_micro_wish WHERE community_id = #{communityId} AND (status =1 OR status =2 OR status = 3 OR status = 5)) AS willNum ," + |
| | | "(SELECT COUNT(id) FROM com_act_micro_wish WHERE community_id = #{communityId} AND (status =1 OR status =2 OR status = 3 OR status = 5 OR status = 6) AND create_at LIKE CONCAT(#{nowDate},'%')) AS currentNum " + |
| | |
| | | */ |
| | | void addReserveCountById(@Param("reserveId") Long reserveId); |
| | | |
| | | /** |
| | | * 小程序查询所有进行中的预约登记 |
| | | * @param communityId 社区id |
| | | * @return 社区所有进行中的预约登记列表 |
| | | */ |
| | | List<ComActReserveIndexVo> getReserveIndexList(@Param("communityId") Long communityId); |
| | | |
| | | } |
| | |
| | | */ |
| | | @Mapper |
| | | public interface ComActReserveRecordMapper extends BaseMapper<ComActReserveRecordDO> { |
| | | IPage<ComActReserveRecordDO> pageReserveList(Page page, @Param("pageUserReserveDTO") PageUserReserveDTO pageUserReserveDTO); |
| | | IPage<ComActReserveAppletsVO> pageReserveList(Page page, @Param("pageUserReserveDTO") PageUserReserveDTO pageUserReserveDTO); |
| | | |
| | | /** |
| | | * 社区后台-根据预约id查询预约明细 |
| | |
| | | private Date createTime; |
| | | |
| | | /** |
| | | *操作类型 1已提交 2审核通过 3 驳回 4完成集心 5 分配 6 完成 |
| | | *操作类型 1已提交 2审核通过 3 驳回 4完成集心 5 分配 6 完成 7反馈 8系统自动确认 |
| | | */ |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 操作备注 |
| | | */ |
| | | private String remark; |
| | | |
| | | /** |
| | | * 反馈图片url |
| | | */ |
| | | private String imgUrl; |
| | | |
| | | @Override |
| | | public String toString() { |
| | |
| | | '}'; |
| | | } |
| | | /** |
| | | *操作类型 1已提交 2审核通过 3 驳回 4完成集心 5 分配 6 完成 |
| | | *操作类型 1已提交 2审核通过 3 驳回 4完成集心 5 分配 6 完成 7反馈 8系统自动确认 |
| | | */ |
| | | public interface type{ |
| | | int ytj=1; |
| | |
| | | int jx=4; |
| | | int fp=5; |
| | | int wc=6; |
| | | int fk=7; |
| | | int zd=8; |
| | | } |
| | | } |
| | |
| | | @TableField("`key`") |
| | | private String key; |
| | | |
| | | /** |
| | | * 组件文件上传保存路径 |
| | | */ |
| | | private String url; |
| | | |
| | | } |
| | |
| | | */ |
| | | private Long updateBy; |
| | | |
| | | /** |
| | | * 组件文件上传保存路径 |
| | | */ |
| | | private String url; |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComActReserveSubSelectionDO{" + |
| | |
| | | * @return |
| | | */ |
| | | R getByWishId(Long id); |
| | | |
| | | /** |
| | | * 添加微心愿操作记录 |
| | | * @param content 操作内容 |
| | | * @param userId 操作用户id |
| | | * @param wishId 微心愿id |
| | | * @param type 操作类型 |
| | | * @param remark 操作备注 |
| | | * @param imgUrl 反馈图片 |
| | | */ |
| | | void addOperationRecord(String content,Long userId,Long wishId,Integer type,String remark,String imgUrl); |
| | | } |
| | |
| | | */ |
| | | R pageMicroWish(ComActMicroWishVO comActMicroWishVO); |
| | | |
| | | R pageMicroWishApplets(ComActMicroWishVO comActMicroWishVO); |
| | | |
| | | /** |
| | | * 心愿详情 |
| | | * |
| | |
| | | */ |
| | | R getById(Long id,Long userId,Long recordId,Integer isBack); |
| | | |
| | | /** |
| | | * 小程序查询所有进行中的预约登记 |
| | | * @param communityId 社区id |
| | | * @return 社区所有进行中的预约登记列表 |
| | | */ |
| | | R reserveListApplets(Long communityId); |
| | | |
| | | } |
| | |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | import static org.apache.commons.lang3.StringUtils.isBlank; |
| | | import static org.apache.commons.lang3.StringUtils.isNotBlank; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 社区活动 |
| | |
| | | Integer type = signactivityVO.getType(); |
| | | Long userId = signactivityVO.getUserId(); |
| | | Integer isVolunteer = signactivityVO.getIsVolunteer(); |
| | | |
| | | // 查询社区活动 |
| | | ComActActivityDO actActivityDO = this.baseMapper.selectById(activityId); |
| | | if (isNull(actActivityDO)) { |
| | | return R.fail("活动不存在"); |
| | | } |
| | | int num = 0; |
| | | if (1 == type) { |
| | | R<LoginUserInfoVO> userInfoR = userService.getUserInfoByUserId(String.valueOf(userId)); |
| | |
| | | return R.fail("只有志愿者才能报名"); |
| | | } |
| | | |
| | | // 查询社区活动 |
| | | ComActActivityDO actActivityDO = this.baseMapper.selectById(activityId); |
| | | if (actActivityDO != null) { |
| | | // 查询当前活动下参与志愿者/居民数量 |
| | | Integer count = comActActSignDAO.selectCount(new QueryWrapper<ComActActSignDO>().lambda() |
| | | .eq(ComActActSignDO::getActivityId, activityId).eq(ComActActSignDO::getIsVolunteer, isVolunteer)); |
| | | if (isVolunteer.equals(1) && actActivityDO.getVolunteerMax() <= count |
| | | && !actActivityDO.getVolunteerMax().equals(-1)) { |
| | | return R.fail("志愿者报名人数已满"); |
| | | } |
| | | // 查询当前活动下参与志愿者/居民数量 |
| | | Integer count = comActActSignDAO.selectCount(new QueryWrapper<ComActActSignDO>().lambda() |
| | | .eq(ComActActSignDO::getActivityId, activityId).eq(ComActActSignDO::getIsVolunteer, isVolunteer)); |
| | | if (isVolunteer.equals(1) && actActivityDO.getVolunteerMax() <= count |
| | | && !actActivityDO.getVolunteerMax().equals(-1)) { |
| | | return R.fail("志愿者报名人数已满"); |
| | | } |
| | | |
| | | if (isVolunteer.equals(0) && actActivityDO.getParticipantMax() <= count |
| | | && !actActivityDO.getParticipantMax().equals(-1)) { |
| | | return R.fail("居民报名人数已满"); |
| | | //审查用户是否有该活动报名权限(是否活动指定参与人群) |
| | | String currentUserTags = loginUserInfoVO.getTags(); |
| | | String attendPeople = actActivityDO.getAattendPeople(); |
| | | if (isNotBlank(attendPeople)) { |
| | | if (isBlank(currentUserTags)) { |
| | | return R.fail("您不是指定参与人群!"); |
| | | } |
| | | List<String> currentUserTagList = Arrays.asList(currentUserTags.split(",")); |
| | | boolean checkResult = currentUserTagList.stream().anyMatch(currentUserTag -> attendPeople.contains(currentUserTag)); |
| | | if (!checkResult) { |
| | | return R.fail("您不是指定参与人群!"); |
| | | } |
| | | } |
| | | |
| | | if (isVolunteer.equals(0) && actActivityDO.getParticipantMax() <= count |
| | | && !actActivityDO.getParticipantMax().equals(-1)) { |
| | | return R.fail("居民报名人数已满"); |
| | | } |
| | | |
| | | ComActActSignDO comActActSignDO = new ComActActSignDO(); |
| | |
| | | @Override |
| | | public R activitySignIn(ComActActRegistVO comActActRegistVO) { |
| | | Long activityId = comActActRegistVO.getActivityId(); |
| | | if (isNull(activityId)) { |
| | | return R.fail("签到所属活动id不能为空!"); |
| | | } |
| | | ComActActivityDO comActActivityDO = comActActivityDAO.selectById(activityId); |
| | | if (isNull(comActActivityDO)) { |
| | | return R.fail("活动不存在!"); |
| | | } |
| | | Long userId = comActActRegistVO.getUserId(); |
| | | String activitySignInKey = String.join(DELIMITER, ACTIVITY_SIGN_IN, userId.toString(), activityId.toString()); |
| | | if (stringRedisTemplate.hasKey(activitySignInKey)) { |
| | |
| | | cmActEasyPhotoDO.setIsReportUrban(ComActEasyPhotoVO.isReportUrban.yes); |
| | | cmActEasyPhotoDO.setTransferReason(comActEasyPhotoVO.getTransferReason()); |
| | | cmActEasyPhotoDO.setTransferTime(nowDate); |
| | | |
| | | } else { |
| | | cmActEasyPhotoDO.setIsReportUrban(ComActEasyPhotoVO.isReportUrban.no); |
| | | } |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_community.model.dos.ComActMicroWishOperationRecordDO; |
| | | import com.panzhihua.service_community.dao.ComActMicroWishOperationRecordMapper; |
| | | import com.panzhihua.service_community.service.ComActMicroWishOperationRecordService; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @auther lyq |
| | |
| | | public R getByWishId(Long id) { |
| | | return R.ok(comActMicroWishOperationRecordMapper.getByWishId(id)); |
| | | } |
| | | |
| | | /** |
| | | * 微心愿添加操作记录 |
| | | * @param content 操作内容 |
| | | * @param userId 操作用户id |
| | | * @param wishId 微心愿id |
| | | * @param type 操作类型 |
| | | * @param remark 操作备注 |
| | | * @param imgUrl 反馈图片 |
| | | */ |
| | | @Override |
| | | public void addOperationRecord(String content,Long userId,Long wishId,Integer type,String remark,String imgUrl){ |
| | | ComActMicroWishOperationRecordDO wishOperationRecordDO = new ComActMicroWishOperationRecordDO(); |
| | | wishOperationRecordDO.setWishId(wishId); |
| | | wishOperationRecordDO.setUserId(userId); |
| | | wishOperationRecordDO.setType(type); |
| | | wishOperationRecordDO.setRemark(remark); |
| | | wishOperationRecordDO.setContent(content); |
| | | wishOperationRecordDO.setCreateTime(new Date()); |
| | | if(StringUtils.isNotEmpty(imgUrl)){ |
| | | wishOperationRecordDO.setImgUrl(imgUrl); |
| | | } |
| | | this.baseMapper.insert(wishOperationRecordDO); |
| | | } |
| | | } |
| | |
| | | import com.panzhihua.service_community.model.dos.ComActMicroWishFeedbackDO; |
| | | import com.panzhihua.service_community.model.dos.ComActMicroWishOperationRecordDO; |
| | | import com.panzhihua.service_community.model.dos.ComActMicroWishUserDO; |
| | | import com.panzhihua.service_community.service.ComActMicroWishOperationRecordService; |
| | | import com.panzhihua.service_community.service.ComActMicroWishService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private ComActMicroWishFeedbackMapper comActMicroWishFeedbackMapper; |
| | | @Resource |
| | | private ComActMicroWishOperationRecordMapper comActMicroWishOperationRecordMapper; |
| | | @Resource |
| | | private ComActMicroWishOperationRecordService wishOperationRecordService; |
| | | /** |
| | | * 分页查询微心愿 |
| | | * |
| | |
| | | page.setCurrent(pageNum); |
| | | IPage<ComActMicroWishVO> iPage = comActMicroWishDAO.pageMicroWish(page, comActMicroWishVO); |
| | | |
| | | List<ComActMicroWishVO> records = iPage.getRecords(); |
| | | if (!ObjectUtils.isEmpty(records)) { |
| | | records.forEach(comActMicroWishVO1 -> { |
| | | if(userId != null){ |
| | | Long id = comActMicroWishVO1.getId(); |
| | | ComActMicroWishUserDO comActMicroWishUserDO = comActMicroWishUserDAO.selectOne(new QueryWrapper<ComActMicroWishUserDO>().lambda().eq(ComActMicroWishUserDO::getMicroWishId, id) |
| | | .eq(ComActMicroWishUserDO::getUserId, userId)); |
| | | if (ObjectUtils.isEmpty(comActMicroWishUserDO)) { |
| | | comActMicroWishVO1.setHaveGiveThumbsUp(0); |
| | | } else { |
| | | comActMicroWishVO1.setHaveGiveThumbsUp(1); |
| | | } |
| | | } |
| | | comActMicroWishVO1.setSponsorPhone(SensitiveUtil.desensitizedPhoneNumber(comActMicroWishVO1.getSponsorPhone())); |
| | | }); |
| | | iPage.setRecords(records); |
| | | } |
| | | return R.ok(iPage); |
| | | } |
| | | |
| | | @Override |
| | | public R pageMicroWishApplets(ComActMicroWishVO comActMicroWishVO) { |
| | | Long userId = comActMicroWishVO.getResponsibleId(); |
| | | IPage<ComActMicroWishVO> iPage = comActMicroWishDAO.pageMicroWishApplets(new Page(comActMicroWishVO.getPageNum() |
| | | ,comActMicroWishVO.getPageSize()), comActMicroWishVO); |
| | | List<ComActMicroWishVO> records = iPage.getRecords(); |
| | | if (!ObjectUtils.isEmpty(records)) { |
| | | records.forEach(comActMicroWishVO1 -> { |
| | |
| | | comActMicroWishDO.setStatus(7);//集心中 |
| | | comActMicroWishOperationRecordDO.setType(ComActMicroWishOperationRecordDO.type.sh); |
| | | comActMicroWishOperationRecordDO.setContent("审核通过"); |
| | | comActMicroWishOperationRecordDO.setRemark("微心愿审核通过"); |
| | | comActMicroWishOperationRecordMapper.insert(comActMicroWishOperationRecordDO); |
| | | break; |
| | | case 2: |
| | |
| | | comActMicroWishDO.setStatus(4);//驳回 |
| | | comActMicroWishOperationRecordDO.setType(ComActMicroWishOperationRecordDO.type.bh); |
| | | comActMicroWishOperationRecordDO.setContent(rejectReason); |
| | | comActMicroWishOperationRecordDO.setRemark("微心愿审核未通过"); |
| | | comActMicroWishOperationRecordMapper.insert(comActMicroWishOperationRecordDO); |
| | | break; |
| | | case 3: |
| | |
| | | comActMicroWishDO.setResponsibleId(responsibleId); |
| | | comActMicroWishDO.setStatus(3);//进行中 |
| | | comActMicroWishDO.setForm(1); |
| | | //添加操作记录 |
| | | comActMicroWishOperationRecordDO.setType(ComActMicroWishOperationRecordDO.type.fp); |
| | | comActMicroWishOperationRecordDO.setContent("分配心愿"); |
| | | comActMicroWishOperationRecordDO.setRemark("分配心愿"); |
| | | comActMicroWishOperationRecordDO.setUserId(responsibleId); |
| | | comActMicroWishOperationRecordMapper.insert(comActMicroWishOperationRecordDO); |
| | | break; |
| | | case 4: |
| | | isUpdate = true; |
| | |
| | | comActMicroWishDO.setResponsibleId(responsibleId); |
| | | comActMicroWishDO.setStatus(3);//待确认 |
| | | comActMicroWishDO.setForm(2); |
| | | //添加操作记录 |
| | | comActMicroWishOperationRecordDO.setType(ComActMicroWishOperationRecordDO.type.fp); |
| | | comActMicroWishOperationRecordDO.setContent("分配心愿"); |
| | | comActMicroWishOperationRecordDO.setRemark("分配心愿"); |
| | | comActMicroWishOperationRecordDO.setUserId(responsibleId); |
| | | comActMicroWishOperationRecordMapper.insert(comActMicroWishOperationRecordDO); |
| | | break; |
| | | case 5: |
| | | if(comActMicroWishVO.getFeedback().length() > 200){ |
| | |
| | | comActMicroWishFeedbackDO.setImgUrl(feedbackPhotoPathList); |
| | | comActMicroWishFeedbackDO.setMicroId(comActMicroWishVO.getId()); |
| | | comActMicroWishFeedbackDO.setUserId(comActMicroWishVO.getUserId()); |
| | | if(comActMicroWishVO.getStatus() != null && comActMicroWishVO.getStatus().equals(ComActMicroWishDO.status.ywc)){ |
| | | if(comActMicroWishVO.getStatus() != null && comActMicroWishVO.getStatus().equals(ComActMicroWishDO.status.dqr)){ |
| | | isUpdate = true; |
| | | comActMicroWishDO.setStatus(ComActMicroWishDO.status.ywc); |
| | | comActMicroWishDO.setStatus(ComActMicroWishDO.status.dqr); |
| | | comActMicroWishDO.setFinishAt(date); |
| | | comActMicroWishDO.setFinish(feedback); |
| | | comActMicroWishDO.setFinishPhotoPathList(feedbackPhotoPathList); |
| | | |
| | | //添加操作记录 |
| | | comActMicroWishOperationRecordDO.setType(ComActMicroWishOperationRecordDO.type.fk); |
| | | comActMicroWishOperationRecordDO.setContent(feedback); |
| | | comActMicroWishOperationRecordDO.setRemark("心愿已完成"); |
| | | comActMicroWishOperationRecordDO.setImgUrl(feedbackPhotoPathList); |
| | | comActMicroWishOperationRecordMapper.insert(comActMicroWishOperationRecordDO); |
| | | }else{ |
| | | //添加操作记录 |
| | | comActMicroWishOperationRecordDO.setType(ComActMicroWishOperationRecordDO.type.fk); |
| | | comActMicroWishOperationRecordDO.setContent(feedback); |
| | | comActMicroWishOperationRecordDO.setRemark("社区反馈"); |
| | | comActMicroWishOperationRecordDO.setImgUrl(feedbackPhotoPathList); |
| | | comActMicroWishOperationRecordMapper.insert(comActMicroWishOperationRecordDO); |
| | | } |
| | | // else { |
| | | // comActMicroWishDO.setStatus(3); |
| | |
| | | comActMicroWishDO.setStatus(ComActMicroWishDO.status.dfp); |
| | | comActMicroWishDO.setFeedbackAt(DateUtil.date()); |
| | | comActMicroWishDAO.updateById(comActMicroWishDO); |
| | | |
| | | //完成集心添加操作记录 |
| | | wishOperationRecordService.addOperationRecord("完成集心",comActMicroWishDO.getSponsorId() |
| | | ,comActMicroWishDO.getId(),ComActMicroWishOperationRecordDO.type.jx,"用户完成集心",null); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | return R.fail("心愿不存在"); |
| | | } |
| | | Integer status = comActMicroWishDO1.getStatus(); |
| | | if (!status.equals(ComActMicroWishDO.status.ywc)) { |
| | | return R.fail("心愿状态不是已完成状态"); |
| | | if (!status.equals(ComActMicroWishDO.status.dqr)) { |
| | | return R.fail("心愿状态不是待确认状态"); |
| | | } |
| | | ComActMicroWishDO comActMicroWishDO=new ComActMicroWishDO(); |
| | | comActMicroWishDO.setId(comActMicroWishVO.getId()); |
| | |
| | | comActMicroWishDO.setEvaluate(comActMicroWishVO.getEvaluate()); |
| | | int update = comActMicroWishDAO.updateById(comActMicroWishDO); |
| | | if (update>0) { |
| | | //用户确认心愿添加操作记录 |
| | | wishOperationRecordService.addOperationRecord(comActMicroWishVO.getEvaluate(),comActMicroWishDO1.getSponsorId() |
| | | ,comActMicroWishDO1.getId(),ComActMicroWishOperationRecordDO.type.wc,"用户已确认",null); |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | |
| | | |
| | | @Override |
| | | public R timedTaskActMicroWishAll() { |
| | | |
| | | //微心愿自动确认前需要添加操作记录 |
| | | List<Long> wishIds = comActMicroWishDAO.getWishAutoConfirmIds(); |
| | | wishIds.forEach(wishId -> { |
| | | //需要添加操作记录 |
| | | wishOperationRecordService.addOperationRecord("系统自动确认微心愿",null |
| | | ,wishId, ComActMicroWishOperationRecordDO.type.zd,"系统自动确认微心愿",null); |
| | | }); |
| | | int num=comActMicroWishDAO.updateStatusAutoConfirm(); |
| | | log.info("定时任务--修改待自动确认微心愿状态数量【{}】",num); |
| | | return R.ok(); |
| | |
| | | BeanUtils.copyProperties(commentDO, vo); |
| | | String name = user.getName() == null ? user.getNickName() : user.getName(); |
| | | vo.setUserName(name); |
| | | vo.setUserPhone(user.getPhone()); |
| | | return R.ok(vo); |
| | | } |
| | | |
| | |
| | | subSelectionDO.setCreateBy(userId); |
| | | subSelectionDO.setType(subSelect.getType()); |
| | | subSelectionDO.setKey(subSelect.getKey()); |
| | | subSelectionDO.setKey(subSelect.getUrl()); |
| | | subSelectionList.add(subSelectionDO); |
| | | } |
| | | } |
| | |
| | | @Override |
| | | public R pageQuestnaireAnswer(PageQuestnaireAnswerDTO pageQuestnaireAnswerDTO) { |
| | | if (pageQuestnaireAnswerDTO.getPageNum() == null || pageQuestnaireAnswerDTO.getPageNum().longValue() == 0) { |
| | | pageQuestnaireAnswerDTO.setPageNum(1l); |
| | | pageQuestnaireAnswerDTO.setPageNum(1L); |
| | | } |
| | | if (pageQuestnaireAnswerDTO.getPageSize() == null || pageQuestnaireAnswerDTO.getPageSize().longValue() == 0) { |
| | | pageQuestnaireAnswerDTO.setPageSize(10l); |
| | | pageQuestnaireAnswerDTO.setPageSize(10L); |
| | | } |
| | | Page userPage = new Page(pageQuestnaireAnswerDTO.getPageNum(), pageQuestnaireAnswerDTO.getPageSize()); |
| | | IPage<ComActQuestnaireAnswerContentVO> doPager = |
| | |
| | | |
| | | Long queSubId = questnaireSubDO.getId(); |
| | | // 根据上传的类型查询不同的题目选项 |
| | | if (questnaiteSub.getType().equals(QuestnaiteSubVO.type.danxuan)) { |
| | | if (questnaiteSub.getType().equals(QuestnaiteSubVO.type.danxuan) || questnaiteSub.getType().equals(QuestnaiteSubVO.type.imgselect)) { |
| | | // 单选题处理 |
| | | ComActQuestnaireSubSelectionDO subSelectionDO = |
| | | questnaireSubSelectionDAO.selectOne(new QueryWrapper<ComActQuestnaireSubSelectionDO>().lambda() |
| | |
| | | */ |
| | | @Override |
| | | public R registerDetailedListAdmin(PageReserveRegisterDetailedAdminDTO detailedAdminDTO){ |
| | | IPage<HashMap<String,Object>> resultPage = new Page<>(); |
| | | IPage<HashMap<String,String>> resultPage = new Page<>(); |
| | | |
| | | IPage<ComActReserveRegisterDetailedVO> registerDetailedPage = this.baseMapper.pageRegisterDetailedListAdmin(new Page(detailedAdminDTO.getPageNum(),detailedAdminDTO.getPageSize()),detailedAdminDTO); |
| | | resultPage.setCurrent(registerDetailedPage.getCurrent()); |
| | |
| | | resultPage.setSize(registerDetailedPage.getSize()); |
| | | resultPage.setPages(registerDetailedPage.getPages()); |
| | | |
| | | List<HashMap<String,Object>> resultMapList = new ArrayList<>(); |
| | | Integer nub = 1; |
| | | List<HashMap<String,String>> resultMapList = new ArrayList<>(); |
| | | int nub = 1; |
| | | if(!registerDetailedPage.getRecords().isEmpty()){ |
| | | for (ComActReserveRegisterDetailedVO registerDetailed:registerDetailedPage.getRecords()) { |
| | | //渲染序号 |
| | | HashMap<String,Object> map = new HashMap<>(); |
| | | map.put("nub",nub); |
| | | HashMap<String,String> map = new HashMap<>(); |
| | | map.put("nub",nub + ""); |
| | | //渲染用户昵称 |
| | | map.put("nickName",registerDetailed.getNickName()); |
| | | //查询记录填写答案并装载到数据集中 |
| | |
| | | if(!detailed.getType().equals(5)){ |
| | | if(detailed.getType().equals(1)){ |
| | | String key = detailed.getReserveSubId() + ""; |
| | | String value = map.get(key).toString(); |
| | | String value = map.get(key); |
| | | if(StringUtils.isNotEmpty(value)){ |
| | | value = value + "," + detailed.getAnswerContent(); |
| | | }else{ |
| | |
| | | } |
| | | } |
| | | //渲染登记流水号 |
| | | map.put("id",registerDetailed.getId()); |
| | | map.put("id",registerDetailed.getId() + ""); |
| | | //渲染登记时间 |
| | | map.put("time", DateUtils.format(registerDetailed.getCreateAt(),DateUtils.ymdhms_format)); |
| | | resultMapList.add(map); |
| | |
| | | comActReserveOperationRecordDO.setReserveContent(CANCEL); |
| | | comActReserveOperationRecordDO.setPhone(comActReserveRecordDO.getPhone()); |
| | | comActReserveOperationRecordDO.setStatus(ComActReserveOperationRecordDO.status.qx); |
| | | comActReserveOperationRecordDO.setUserId(comActReserveRecordDO.getUserId()); |
| | | comActReserveOperationRecordDO.setUserId(comActReserveRecord.getUserId()); |
| | | comActReserveOperationRecordDO.setReserveTime(DateUtil.date()); |
| | | comActReserveOperationRecordMapper.insert(comActReserveOperationRecordDO); |
| | | return R.ok(); |
| | |
| | | if(reserveRecordDO != null){ |
| | | //更新预约记录社区备注字段 |
| | | reserveRecordDO.setActRemark(reserveRecordDTO.getRemark()); |
| | | reserveRecordDO.setHandleId(userId); |
| | | comActReserveRecordMapper.updateById(reserveRecordDO); |
| | | //取消预约返还可参加名额 |
| | | comActReserveMapper.addReserveCountById(reserveRecordDO.getReserveId()); |
| | | //添加操作记录 |
| | | comActReserveOperationRecordService.addReserveOperationRecord(reserveRecordDO.getReserveId() |
| | | ,reserveRecordDO.getId(),reserveRecordDO.getUserId(),ComActReserveOperationRecordDO.type.sq,null |
| | | ,"社区管理员取消预约",reserveRecordDTO.getRemark(),ComActReserveOperationRecordDO.status.qx,userId,null); |
| | | ,"社区管理员取消预约",reserveRecordDTO.getRemark(),ComActReserveOperationRecordDO.status.qx,userId,new Date()); |
| | | } |
| | | }); |
| | | return R.ok(); |
| | |
| | | log.error("消息推送失败,失败原因:" + e.getMessage()); |
| | | } |
| | | } |
| | | //预约失败时需要更新预约登记参与人数 |
| | | comActReserveMapper.addReserveCountById(reserveRecordDO.getReserveId()); |
| | | } |
| | | reserveRecordDO.setActRemark(remark); |
| | | reserveRecordDO.setReserveTime(reserveTime); |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.google.common.collect.Lists; |
| | | import com.panzhihua.common.model.dtos.community.OperationDetailDTO; |
| | | import com.panzhihua.common.model.dtos.community.reserve.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActReserveIndexVo; |
| | | import com.panzhihua.common.model.vos.community.questnaire.QuestnaiteSubSelectionVO; |
| | | import com.panzhihua.common.model.vos.community.questnaire.QuestnaiteSubVO; |
| | | import com.panzhihua.common.model.vos.community.reserve.*; |
| | |
| | | |
| | | Long queSubId = questnaireSubDO.getId(); |
| | | //根据上传的类型查询不同的题目选项 |
| | | if(questnaiteSub.getType().equals(QuestnaiteSubVO.type.danxuan)){ |
| | | if(questnaiteSub.getType().equals(QuestnaiteSubVO.type.danxuan) || questnaiteSub.getType().equals(QuestnaiteSubVO.type.imgselect)){ |
| | | |
| | | //单选题处理 |
| | | ComActReserveSubSelectionDO subSelectionDO = comActReserveSubSelectionMapper.selectOne(new QueryWrapper<ComActReserveSubSelectionDO>() |
| | |
| | | subSelectionDO.setCreateAt(nowDate); |
| | | subSelectionDO.setType(subSelect.getType()); |
| | | subSelectionDO.setKey(subSelect.getKey()); |
| | | subSelectionDO.setUrl(subSelect.getUrl()); |
| | | subSelectionList.add(subSelectionDO); |
| | | } |
| | | } |
| | |
| | | |
| | | @Override |
| | | public R pageReserveList(PageUserReserveDTO pageUserReserveDTO) { |
| | | return R.ok(comActReserveRecordMapper.pageReserveList(new Page<ComActReserveDO>(pageUserReserveDTO.getPageNum(), pageUserReserveDTO.getPageSize()),pageUserReserveDTO)); |
| | | IPage<ComActReserveAppletsVO> ipage = comActReserveRecordMapper.pageReserveList(new Page<>(pageUserReserveDTO.getPageNum(), pageUserReserveDTO.getPageSize()),pageUserReserveDTO); |
| | | OperationDetailDTO operationDetailDTO = new OperationDetailDTO(); |
| | | ipage.getRecords().forEach(page -> { |
| | | operationDetailDTO.setReserveRecordId(page.getId()); |
| | | List<ComOperationListVO> operationList = comActReserveRecordMapper.queryAll(operationDetailDTO); |
| | | page.setOperationList(operationList); |
| | | }); |
| | | return R.ok(ipage); |
| | | } |
| | | |
| | | /** |
| | | * 小程序查询所有进行中的预约登记 |
| | | * @param communityId 社区id |
| | | * @return 社区所有进行中的预约登记列表 |
| | | */ |
| | | @Override |
| | | public R reserveListApplets(Long communityId){ |
| | | return R.ok(this.baseMapper.getReserveIndexList(communityId)); |
| | | } |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_community.dao.ComActMicroWishDAO"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComActMicroWishDO"> |
| | | <id column="id" property="id" /> |
| | | <result column="sponsor_id" property="sponsorId" /> |
| | | <result column="sponsor_phone" property="sponsorPhone" /> |
| | | <result column="wish_name" property="wishName" /> |
| | | <result column="status" property="status" /> |
| | | <result column="form" property="form" /> |
| | | <result column="responsible_id" property="responsibleId" /> |
| | | <result column="create_at" property="createAt" /> |
| | | <result column="examine_at" property="examineAt" /> |
| | | <result column="distribution_at" property="distributionAt" /> |
| | | <result column="feedback_at" property="feedbackAt" /> |
| | | <result column="evaluate_at" property="evaluateAt" /> |
| | | <result column="score" property="score" /> |
| | | <result column="detail" property="detail" /> |
| | | <result column="photo_path_list" property="photoPathList" /> |
| | | <result column="community_id" property="communityId" /> |
| | | <result column="evaluate" property="evaluate" /> |
| | | <result column="finish_at" property="finishAt" /> |
| | | <result column="finish_photo_path_list" property="finishPhotoPathList" /> |
| | | <result column="finish" property="finish" /> |
| | | <result column="reject_reason" property="rejectReason" /> |
| | | <result column="feedback" property="feedback" /> |
| | | <result column="feedback_photo_path_list" property="feedbackPhotoPathList" /> |
| | | <result column="aim_num" property="aimNum" /> |
| | | <result column="img_width" property="imgWidth" /> |
| | | <result column="img_height" property="imgHeight" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, sponsor_id, sponsor_phone, wish_name, status, form, responsible_id, create_at, examine_at, distribution_at, feedback_at, evaluate_at, score, detail, photo_path_list, community_id, evaluate, finish_at, finish_photo_path_list, finish, reject_reason, feedback, feedback_photo_path_list, aim_num, img_width, img_height |
| | | </sql> |
| | | |
| | | <select id="pageMicroWishApplets" parameterType="com.panzhihua.common.model.vos.community.ComActMicroWishVO" |
| | | resultType="com.panzhihua.common.model.vos.community.ComActMicroWishVO"> |
| | | SELECT |
| | | w.id, |
| | | u.name sponsor_name, |
| | | u.nick_name userNickName, |
| | | u.image_url , |
| | | w.sponsor_phone, |
| | | w.wish_name, |
| | | w.`status`, |
| | | w.`feedback_at`, |
| | | w.`examine_at`, |
| | | w.`distribution_at`, |
| | | w.`evaluate_at`, |
| | | w.`photo_path_list`, |
| | | count(wu.id)star_num, |
| | | w.`detail`, |
| | | w.form, |
| | | w.reject_reason, |
| | | su.`name` responsible_name, |
| | | w.score, |
| | | w.img_width, |
| | | w.finish_at, |
| | | w.aim_num, |
| | | w.img_height, |
| | | w.create_at |
| | | FROM |
| | | 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 com_pb_service_team su ON w.responsible_id = su.id |
| | | <where> |
| | | <if test='comActMicroWishVO.communityId != null and comActMicroWishVO.communityId != 0'> |
| | | and w.community_id=#{comActMicroWishVO.communityId} |
| | | </if> |
| | | <if test='comActMicroWishVO.status == 3 and comActMicroWishVO.isApplets != null and comActMicroWishVO.isApplets != 0'> |
| | | AND w.`status` in (2,3) |
| | | </if> |
| | | <if test='comActMicroWishVO.status == 6 and comActMicroWishVO.isApplets != null and comActMicroWishVO.isApplets != 0'> |
| | | AND w.`status` in (5,6) |
| | | </if> |
| | | <if test='comActMicroWishVO.status == 7 and comActMicroWishVO.isApplets != null and comActMicroWishVO.isApplets != 0'> |
| | | AND w.`status` = 7 |
| | | </if> |
| | | <if test='comActMicroWishVO.isApplets != null and comActMicroWishVO.isApplets != 0 and comActMicroWishVO.status != null and comActMicroWishVO.status != 7 and comActMicroWishVO.status != 6 and comActMicroWishVO.status != 3'> |
| | | AND w.status in (3, 5, 6) |
| | | </if> |
| | | <if test='comActMicroWishVO.userId != null and comActMicroWishVO.userId != 0'> |
| | | AND w.sponsor_id =#{comActMicroWishVO.userId} |
| | | </if> |
| | | </where> |
| | | group by w.id |
| | | ORDER BY w.create_at desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <result column="user_id" property="userId" /> |
| | | <result column="wish_id" property="wishId" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="remark" property="remark" /> |
| | | <result column="img_url" property="imgUrl" /> |
| | | <result column="type" property="type"/> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, content, user_id, wish_id, create_time |
| | | id, content, user_id, wish_id, create_time, remark, img_url |
| | | </sql> |
| | | |
| | | <select id="getByWishId" resultType="com.panzhihua.common.model.vos.community.ComActMicroWishOperationRecordVO"> |
| | |
| | | su.nick_name like concat (#{neighborCircleAppDTO.keyWord},'%') or |
| | | canc.release_content like concat (#{neighborCircleAppDTO.keyWord},'%')) |
| | | </if> |
| | | <if test='neighborCircleAppDTO.type != null and neighborCircleAppDTO.type == 1'> |
| | | order by canc.hot_num desc |
| | | </if> |
| | | <if test='neighborCircleAppDTO.type != null and neighborCircleAppDTO.type == 2'> |
| | | order by canc.create_at desc |
| | | </if> |
| | | <if test='neighborCircleAppDTO.type != null and neighborCircleAppDTO.type == 3'> |
| | | order by canc.is_boutique asc |
| | | </if> |
| | | order by canc.create_at desc |
| | | </select> |
| | | |
| | | <update id="addHotNum"> |
| | |
| | | canct.`name`, |
| | | canct.`status`, |
| | | canct.create_at, |
| | | ( SELECT count( id ) FROM com_act_neighbor_circle WHERE is_del = 2 AND `status` = 2 and topic_id = canct.id) AS `count`, |
| | | su.`name` as createBy |
| | | FROM |
| | | com_act_neighbor_circle_topic AS canct |
| | |
| | | </select> |
| | | |
| | | <select id="getNeighborTopicByApp" resultType="com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleTopicAppVO"> |
| | | select id,`name`,hot_num,`count` from com_act_neighbor_circle_topic where `status` = 1 and community_id = #{communityId} |
| | | SELECT canct.id, canct.`name`, canct.hot_num,( SELECT count( id ) FROM com_act_neighbor_circle WHERE is_del = 2 AND `status` = 2 and topic_id = canct.id) AS `count` |
| | | from com_act_neighbor_circle_topic as canct where canct.`status` = 1 and canct.community_id = #{communityId} |
| | | <if test="isZero != null and isZero == 1"> |
| | | and `count` > 0 |
| | | </if> |
| | | <if test="name != null and name != """> |
| | | and `name` like concat('%',#{name},'%') |
| | | and canct.`name` like concat('%',#{name},'%') |
| | | </if> |
| | | order by hot_num desc |
| | | order by `count` desc |
| | | </select> |
| | | |
| | | <update id="addHotNum"> |
| | |
| | | <update id="addReserveCountById"> |
| | | update com_act_reserve set join_count = join_count - 1 where id = #{reserveId} |
| | | </update> |
| | | |
| | | <select id="getReserveIndexList" resultType="com.panzhihua.common.model.vos.community.ComActReserveIndexVo"> |
| | | select id,title,type,img_type,img_url,adver_position_top,adver_position_application from com_act_reserve where `status` = 2 and is_del = 2 |
| | | and community_id = #{communityId} |
| | | </select> |
| | | </mapper> |
| | |
| | | id, user_id, reserve_id, community_id, type, name, phone, status, content, remark, act_remark, reserve_time, json_object, create_at, create_by, update_at, update_by, handle_id |
| | | </sql> |
| | | |
| | | <select id="pageReserveList" resultType="com.panzhihua.common.model.vos.community.reserve.ComActReserveRecordListVO"> |
| | | <select id="pageReserveList" resultType="com.panzhihua.common.model.vos.community.reserve.ComActReserveAppletsVO"> |
| | | select t.*,t1.title from com_act_reserve_record t left join com_act_reserve t1 on t.reserve_id = t1.id |
| | | <where> |
| | | 1=1 |
| | |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="update_at" property="updateAt" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | <result column="url" property="url" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, reserve_id, reserve_sub_id, key, type, sort, option_name, content, create_at, create_by, update_at, update_by |
| | | id, reserve_id, reserve_sub_id, key, type, sort, option_name, content, create_at, create_by, update_at, update_by, url |
| | | </sql> |
| | | |
| | | </mapper> |
| | |
| | | SELECT cawgc.id, cawgc.classify_name, cawgc.picture_url,( SELECT count( id ) FROM com_act_work_guide WHERE classify = cawgc.id ) AS `count` |
| | | FROM |
| | | com_act_work_guide_classify AS cawgc |
| | | order by `count` asc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | order by cea.CREATE_AT desc |
| | | </select> |
| | | |
| | | <select id="selectCommunityEldersRecordByPage" parameterType="com.panzhihua.common.model.dtos.community.PageEldersAuthRecordDTO" |
| | | resultType="com.panzhihua.common.model.vos.community.ComEldersAuthRecordForCommunityVO"> |
| | | SELECT e.ID,e.CREATE_BY,e.CREATE_AT, e.UPDATE_BY, e.UPDATE_AT, e.ID_CARD, e.AUTH_USER_NAME, e.VIDEO_URL, |
| | | e.SUMIT_USER_ID, e.DOMICILE, e.STATUS, e.BIRTH_DAY, e.type, e.age, e.verification_result, u.name as sumitUserName, u.phone as sumitUserAccount |
| | | FROM ( SELECT MAX(id) AS id , DATE_FORMAT(create_at, '%Y-%m') AS yearMonth |
| | | FROM com_elders_auth GROUP BY id_card, yearMonth ) t |
| | | left join com_elders_auth e on t.id = e.id LEFT JOIN sys_user u ON e.SUMIT_USER_ID = u.user_id |
| | | <where> |
| | | <if test='pageEldersAuthRecordDTO.name!=null'> |
| | | AND e.AUTH_USER_NAME like concat('%', #{pageEldersAuthRecordDTO.name}, '%') |
| | | </if> |
| | | <if test='pageEldersAuthRecordDTO.idCard!=null and pageEldersAuthRecordDTO.idCard!=""'> |
| | | AND e.ID_CARD = #{pageEldersAuthRecordDTO.idCard} |
| | | </if> |
| | | <if test='pageEldersAuthRecordDTO.type!=null'> |
| | | AND e.type = #{pageEldersAuthRecordDTO.type} |
| | | </if> |
| | | <if test='pageEldersAuthRecordDTO.month!=null'> |
| | | AND month(e.CREATE_AT) = #{pageEldersAuthRecordDTO.month} |
| | | </if> |
| | | <if test='pageEldersAuthRecordDTO.year!=null'> |
| | | AND year(e.CREATE_AT) = #{pageEldersAuthRecordDTO.year} |
| | | </if> |
| | | </where> |
| | | <if test='pageEldersAuthRecordDTO.sortColumns!=null'> |
| | | ORDER BY e.${pageEldersAuthRecordDTO.sortColumns} ${pageEldersAuthRecordDTO.sortType} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |