| | |
| | | |
| | | @ApiOperation("详情") |
| | | @GetMapping("/detail") |
| | | public R detail(@RequestParam("id") Long id){ |
| | | return communityService.reserveDetail(id); |
| | | public R detail(@RequestParam("id") Long id,@RequestParam("recordId") Long recordId){ |
| | | return communityService.reserveDetail(id,this.getUserId(),recordId); |
| | | } |
| | | |
| | | @ApiOperation("用户提交数据") |
| | |
| | | private String jsonObject; |
| | | |
| | | @ApiModelProperty("是否发布(1.是 2.否)") |
| | | private Integer isPublish; |
| | | private Integer isPublish = 2; |
| | | |
| | | } |
| | |
| | | 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; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel("提交预约/登记参数") |
| | |
| | | private String phone; |
| | | @ApiModelProperty("类型 1预约 2登记") |
| | | private Integer type; |
| | | @ApiModelProperty("预约时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date reserveTime; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.reserve; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class ComActReserveDetailVO { |
| | | 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; |
| | | |
| | | /** |
| | | * 发布时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | 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; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date updateAt; |
| | | |
| | | /** |
| | | * 修改人 |
| | | */ |
| | | private Long updateBy; |
| | | |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date endTime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date reserveTime; |
| | | |
| | | private Integer recordStatus; |
| | | |
| | | /** |
| | | * 是否已删除(1.是 2.否) |
| | | */ |
| | | private Integer isDel; |
| | | |
| | | private Integer isOk; |
| | | /** |
| | | * 是否重复(1.是 2.否) |
| | | */ |
| | | public interface isOk{ |
| | | int y=1; |
| | | int n=2; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.reserve; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class ComActReserveRecordListVO { |
| | | private Long id; |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 预约登记id |
| | | */ |
| | | private Long reserveId; |
| | | |
| | | /** |
| | | * 社区id |
| | | */ |
| | | private Long communityId; |
| | | |
| | | /** |
| | | * 类型(1.预约 2.登记) |
| | | */ |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 提交人名称 |
| | | */ |
| | | private String name; |
| | | |
| | | /** |
| | | * 提交人手机号 |
| | | */ |
| | | private String phone; |
| | | |
| | | /** |
| | | * 状态(1.待处理 2.预约成功 3.预约失败 4.已取消) |
| | | */ |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 内容 |
| | | */ |
| | | private String content; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String remark; |
| | | |
| | | /** |
| | | * 社区备注 |
| | | */ |
| | | private String actRemark; |
| | | |
| | | /** |
| | | * 预约时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date reserveTime; |
| | | |
| | | /** |
| | | * 用户填报json数据 |
| | | */ |
| | | private String jsonObject; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | private Date updateAt; |
| | | |
| | | /** |
| | | * 修改人 |
| | | */ |
| | | private Long updateBy; |
| | | |
| | | /** |
| | | * 标题 |
| | | */ |
| | | private String title; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.reserve; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel |
| | | public class ComOperationDetailVO { |
| | | private List<ComOperationListVO> list; |
| | | @ApiModelProperty("1可以继续 2不能继续") |
| | | private Integer isContinue =2; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.reserve; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class ComOperationListVO { |
| | | private Long id; |
| | | |
| | | /** |
| | | * 预约登记id |
| | | */ |
| | | private Long reserveId; |
| | | |
| | | /** |
| | | * 预约登记记录id |
| | | */ |
| | | private Long reserveRecordId; |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 类型(1.本人操作 2.社区操作) |
| | | */ |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 操作人手机号 |
| | | */ |
| | | private String phone; |
| | | |
| | | /** |
| | | * 操作时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date reserveTime; |
| | | |
| | | /** |
| | | * 操作内容 |
| | | */ |
| | | private String reserveContent; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String remark; |
| | | |
| | | /** |
| | | * 状态(1.提交 2.预约成功 3.预约失败 4.取消) |
| | | */ |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | private Long createBy; |
| | | } |
| | |
| | | R easyPhotoNoHandleList(@RequestParam("communityId") Long communityId); |
| | | |
| | | @GetMapping("/reserve/detail") |
| | | R reserveDetail(@RequestParam("id") Long id); |
| | | R reserveDetail(@RequestParam("id") Long id,@RequestParam("userId") Long userId,@RequestParam("recordId") Long recordId); |
| | | |
| | | @PostMapping("/reserve/commit") |
| | | R reserveCommit(@RequestBody ComActReserveCommitVO comActReserveCommitVO); |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/detail") |
| | | public R detail(@RequestParam("id") Long id){ |
| | | public R detail(@RequestParam("id") Long id,@RequestParam("userId") Long userId,@RequestParam("recordId") Long recordId){ |
| | | if(id!=null){ |
| | | return R.ok(comActReserveService.getById(id)); |
| | | return comActReserveService.getById(id,userId,recordId); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | |
| | | /** |
| | | * 小程序提交预约/登记 |
| | |
| | | */ |
| | | @PostMapping("/detailOperation") |
| | | public R reserveOperation(@RequestBody OperationDetailDTO comActReserveOperationRecordDO){ |
| | | if(comActReserveOperationRecordDO!=null){ |
| | | QueryWrapper<ComActReserveOperationRecordDO> queryWrapper=new QueryWrapper<>(); |
| | | if(comActReserveOperationRecordDO.getUserId()!=null){ |
| | | queryWrapper.eq("user_id",comActReserveOperationRecordDO.getUserId()); |
| | | } |
| | | if(comActReserveOperationRecordDO.getReserveRecordId()!=null){ |
| | | queryWrapper.eq("reserve_record_id",comActReserveOperationRecordDO.getReserveRecordId()); |
| | | } |
| | | if(comActReserveOperationRecordDO.getType()!=null){ |
| | | queryWrapper.eq("type",comActReserveOperationRecordDO.getType()); |
| | | } |
| | | queryWrapper.orderByDesc("reserve_time"); |
| | | return R.ok(comActReserveOperationRecordService.list(queryWrapper)); |
| | | } |
| | | return R.ok(); |
| | | return comActReserveOperationRecordService.detailOperationRecord(comActReserveOperationRecordDO); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.OperationDetailDTO; |
| | | import com.panzhihua.common.model.dtos.community.reserve.ComActReserveRegisterStatisticsDTO; |
| | | import com.panzhihua.common.model.dtos.community.reserve.PageReserveMakeAdminDTO; |
| | | import com.panzhihua.common.model.dtos.community.reserve.PageReserveMakeHandleAdminDTO; |
| | | import com.panzhihua.common.model.vos.community.reserve.ComActReserveMakeDetailAdminVO; |
| | | import com.panzhihua.common.model.vos.community.reserve.ComActReserveMakeHandleListAdminVO; |
| | | import com.panzhihua.common.model.vos.community.reserve.ComActReserveMakeListAdminVO; |
| | | import com.panzhihua.common.model.vos.community.reserve.ComActReserveRegisterStatisticsAdminVO; |
| | | import com.panzhihua.common.model.vos.community.reserve.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.PageUserReserveDTO; |
| | |
| | | * @return 预约处理列表 |
| | | */ |
| | | List<ComActReserveMakeHandleListAdminVO> exportMakeHandleAdmin(@Param("pageMakeHandleDTO") PageReserveMakeHandleAdminDTO pageMakeHandleDTO); |
| | | |
| | | /** |
| | | * 根据reserveRecordId查询操作记录 |
| | | * @param operationDetailDTO |
| | | * @return |
| | | */ |
| | | List<ComOperationListVO> queryAll(OperationDetailDTO operationDetailDTO); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | |
| | | /** |
| | | * 操作时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date reserveTime; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | /** |
| | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | |
| | | /** |
| | | * 预约时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date reserveTime; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | /** |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.community.OperationDetailDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.model.dos.ComActReserveOperationRecordDO; |
| | | |
| | | import java.util.Date; |
| | |
| | | * @param remark 备注 |
| | | * @param status 状态(1.提交 2.预约成功 3.预约失败 4.取消) |
| | | * @param createBy 创建人 |
| | | * @param reserveTime 成功预约时间 |
| | | */ |
| | | void addReserveOperationRecord(Long reserveId, Long reserveRecordId, Long userId, Integer type |
| | | , String phone, String reserveContent,String remark,Integer status,Long createBy); |
| | | , String phone, String reserveContent,String remark,Integer status,Long createBy,Date reserveTime); |
| | | |
| | | /** |
| | | * 多条件查询操作记录 |
| | | * @param operationDetailDTO |
| | | * @return |
| | | */ |
| | | R detailOperationRecord(OperationDetailDTO operationDetailDTO); |
| | | } |
| | |
| | | */ |
| | | R listReserveAdmin(Long communityId); |
| | | |
| | | /** |
| | | * 小程序预约登记查询详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | R getById(Long id,Long userId,Long recordId); |
| | | |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public R registerDetailedListAdmin(PageReserveRegisterDetailedAdminDTO detailedAdminDTO){ |
| | | IPage<List<Map<String,Object>>> resultPage = new Page<>(); |
| | | IPage<HashMap<String,Object>> 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<List<Map<String,Object>>> resultMapList = new ArrayList<>(); |
| | | List<HashMap<String,Object>> resultMapList = new ArrayList<>(); |
| | | Integer nub = 1; |
| | | for (ComActReserveRegisterDetailedVO registerDetailed:registerDetailedPage.getRecords()) { |
| | | List<Map<String,Object>> mapList = new ArrayList<>(); |
| | | //渲染序号 |
| | | Map<String,Object> nubMap = new HashMap<>(); |
| | | nubMap.put("nub",nub); |
| | | mapList.add(nubMap); |
| | | //渲染用户昵称 |
| | | Map<String,Object> nickNameMap = new HashMap<>(); |
| | | nickNameMap.put("nickName",registerDetailed.getNickName()); |
| | | mapList.add(nickNameMap); |
| | | |
| | | //查询记录填写答案并装载到数据集中 |
| | | List<ComActReserveRegisterDetailedAnswerVO> registerDetailedAnswerList = this.baseMapper.getRegisterDetailedAnswerList(registerDetailed.getId()); |
| | | registerDetailedAnswerList.forEach(detailed -> { |
| | | Map<String,Object> detailedMap = new HashMap<>(); |
| | | detailedMap.put(detailed.getReserveSubId() + "",detailed.getAnswerContent()); |
| | | mapList.add(detailedMap); |
| | | }); |
| | | |
| | | //渲染登记流水号 |
| | | Map<String,Object> idMap = new HashMap<>(); |
| | | idMap.put("id",registerDetailed.getId()); |
| | | mapList.add(idMap); |
| | | //渲染登记时间 |
| | | Map<String,Object> timeMap = new HashMap<>(); |
| | | timeMap.put("time",registerDetailed.getCreateAt()); |
| | | mapList.add(timeMap); |
| | | resultMapList.add(mapList); |
| | | nub++; |
| | | if(!registerDetailedPage.getRecords().isEmpty()){ |
| | | for (ComActReserveRegisterDetailedVO registerDetailed:registerDetailedPage.getRecords()) { |
| | | //渲染序号 |
| | | HashMap<String,Object> map = new HashMap<>(); |
| | | map.put("nub",nub); |
| | | //渲染用户昵称 |
| | | map.put("nickName",registerDetailed.getNickName()); |
| | | //查询记录填写答案并装载到数据集中 |
| | | List<ComActReserveRegisterDetailedAnswerVO> registerDetailedAnswerList = this.baseMapper.getRegisterDetailedAnswerList(registerDetailed.getId()); |
| | | if(!registerDetailedAnswerList.isEmpty()){ |
| | | for (ComActReserveRegisterDetailedAnswerVO detailed:registerDetailedAnswerList) { |
| | | map.put(detailed.getReserveSubId() + "",detailed.getAnswerContent()); |
| | | } |
| | | } |
| | | //渲染登记流水号 |
| | | map.put("id",registerDetailed.getId()); |
| | | //渲染登记时间 |
| | | map.put("time",registerDetailed.getCreateAt()); |
| | | resultMapList.add(map); |
| | | nub++; |
| | | } |
| | | } |
| | | resultPage.setRecords(resultMapList); |
| | | return R.ok(registerDetailedPage); |
| | | return R.ok(resultPage); |
| | | } |
| | | } |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.community.OperationDetailDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.reserve.ComOperationDetailVO; |
| | | import com.panzhihua.common.model.vos.community.reserve.ComOperationListVO; |
| | | import com.panzhihua.service_community.dao.ComActReserveMapper; |
| | | import com.panzhihua.service_community.dao.ComActReserveOperationRecordMapper; |
| | | import com.panzhihua.service_community.dao.ComActReserveRecordMapper; |
| | | import com.panzhihua.service_community.model.dos.ComActReserveDO; |
| | | import com.panzhihua.service_community.model.dos.ComActReserveOperationRecordDO; |
| | | import com.panzhihua.service_community.model.dos.ComActReserveRecordDO; |
| | | import com.panzhihua.service_community.service.ComActReserveOperationRecordService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther lyq |
| | |
| | | @Slf4j |
| | | @Service |
| | | public class ComActReserveOperationRecordServiceImpl extends ServiceImpl<ComActReserveOperationRecordMapper, ComActReserveOperationRecordDO> implements ComActReserveOperationRecordService { |
| | | |
| | | @Resource |
| | | private ComActReserveMapper comActReserveMapper; |
| | | @Resource |
| | | private ComActReserveRecordMapper comActReserveRecordMapper; |
| | | /** |
| | | * 添加预约登记操作记录 |
| | | * @param reserveId 预约登记id |
| | |
| | | * @param remark 备注 |
| | | * @param status 状态(1.提交 2.预约成功 3.预约失败 4.取消) |
| | | * @param createBy 创建人 |
| | | * @param reserveTime 预约成功时间 |
| | | */ |
| | | @Override |
| | | public void addReserveOperationRecord(Long reserveId, Long reserveRecordId, Long userId, Integer type |
| | | , String phone, String reserveContent,String remark,Integer status,Long createBy){ |
| | | , String phone, String reserveContent,String remark,Integer status,Long createBy,Date reserveTime){ |
| | | Date nowDate = new Date(); |
| | | ComActReserveOperationRecordDO operationRecordDO = new ComActReserveOperationRecordDO(); |
| | | operationRecordDO.setReserveId(reserveId); |
| | |
| | | operationRecordDO.setStatus(status); |
| | | operationRecordDO.setCreateBy(createBy); |
| | | operationRecordDO.setCreateAt(nowDate); |
| | | operationRecordDO.setReserveTime(nowDate); |
| | | operationRecordDO.setReserveTime(reserveTime); |
| | | this.baseMapper.insert(operationRecordDO); |
| | | } |
| | | |
| | | @Override |
| | | public R detailOperationRecord(OperationDetailDTO comActReserveOperationRecordDO) { |
| | | if(comActReserveOperationRecordDO!=null){ |
| | | ComOperationDetailVO comOperationDetailVO=new ComOperationDetailVO(); |
| | | List<ComOperationListVO> comOperationListVOS=comActReserveRecordMapper.queryAll(comActReserveOperationRecordDO); |
| | | if(!comOperationListVOS.isEmpty()){ |
| | | comOperationDetailVO.setList(comOperationListVOS); |
| | | ComActReserveRecordDO comActReserveRecordDO= comActReserveRecordMapper.selectById(comActReserveOperationRecordDO.getReserveRecordId()); |
| | | if(comActReserveRecordDO.getStatus()==ComActReserveRecordDO.status.yqx||comActReserveRecordDO.getStatus()==ComActReserveRecordDO.status.sb){ |
| | | ComActReserveDO com=comActReserveMapper.selectById(comOperationListVOS.get(0).getReserveId()); |
| | | if(com!=null&&com.getStatus()==ComActReserveDO.status.jxz){ |
| | | comOperationDetailVO.setIsContinue(1); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return R.ok(comOperationDetailVO); |
| | | } |
| | | return R.fail("未查询到数据"); |
| | | } |
| | | |
| | | } |
| | |
| | | comActReserveOperationRecordDO.setReserveId(comActReserveRecordDO.getReserveId()); |
| | | comActReserveOperationRecordDO.setReserveRecordId(comActReserveRecordDO.getId()); |
| | | comActReserveOperationRecordDO.setType(ComActReserveOperationRecordDO.type.br); |
| | | comActReserveOperationRecordDO.setReserveTime(DateUtil.date()); |
| | | comActReserveOperationRecordDO.setCreateAt(DateUtil.date()); |
| | | comActReserveOperationRecordDO.setReserveContent(CANCEL); |
| | | comActReserveOperationRecordDO.setPhone(comActReserveRecordDO.getPhone()); |
| | | comActReserveOperationRecordDO.setStatus(ComActReserveOperationRecordDO.status.qx); |
| | |
| | | //添加操作记录 |
| | | comActReserveOperationRecordService.addReserveOperationRecord(reserveRecordDO.getReserveId() |
| | | ,reserveRecordDO.getId(),reserveRecordDO.getUserId(),ComActReserveOperationRecordDO.type.sq,null |
| | | ,"社区管理员取消预约",reserveRecordDTO.getRemark(),ComActReserveOperationRecordDO.status.qx,userId); |
| | | ,"社区管理员取消预约",reserveRecordDTO.getRemark(),ComActReserveOperationRecordDO.status.qx,userId,null); |
| | | } |
| | | }); |
| | | return R.ok(); |
| | |
| | | makeHandleDTO.getIds().forEach(id -> { |
| | | ComActReserveRecordDO reserveRecordDO = this.baseMapper.selectById(id); |
| | | if(reserveRecordDO != null){ |
| | | Date reserveTime = DateUtils.stringToDate(makeHandleDTO.getMakeTime(),DateUtils.ymdhms_format); |
| | | //判断处理是否通过 |
| | | if(makeHandleDTO.getIsOk().equals(MakeHandleAdminDTO.isOk.yes)){ |
| | | reserveRecordDO.setStatus(ComActReserveRecordDO.status.cg); |
| | | comActReserveOperationRecordService.addReserveOperationRecord(reserveRecordDO.getReserveId() |
| | | ,id,reserveRecordDO.getUserId(),ComActReserveOperationRecordDO.type.sq,null |
| | | ,"社区管理员处理预约成功",remark,ComActReserveOperationRecordDO.status.cg,userId); |
| | | ,"社区管理员处理预约成功",remark,ComActReserveOperationRecordDO.status.cg,userId,reserveTime); |
| | | }else if(makeHandleDTO.getIsOk().equals(MakeHandleAdminDTO.isOk.no)){ |
| | | reserveRecordDO.setStatus(ComActReserveRecordDO.status.sb); |
| | | comActReserveOperationRecordService.addReserveOperationRecord(reserveRecordDO.getReserveId() |
| | | ,id,reserveRecordDO.getUserId(),ComActReserveOperationRecordDO.type.sq,null |
| | | ,"社区管理员处理预约失败",remark,ComActReserveOperationRecordDO.status.sb,userId); |
| | | ,"社区管理员处理预约失败",remark,ComActReserveOperationRecordDO.status.sb,userId,null); |
| | | } |
| | | reserveRecordDO.setActRemark(remark); |
| | | reserveRecordDO.setReserveTime(DateUtils.stringToDate(makeHandleDTO.getMakeTime(),DateUtils.ymdhms_format)); |
| | | reserveRecordDO.setReserveTime(reserveTime); |
| | | reserveRecordDO.setUpdateAt(nowDate); |
| | | reserveRecordDO.setUpdateBy(userId); |
| | | updateList.add(reserveRecordDO); |
| | |
| | | import com.panzhihua.service_community.dao.*; |
| | | import com.panzhihua.service_community.model.dos.*; |
| | | import com.panzhihua.service_community.service.ComActReserveAnswerContentService; |
| | | import com.panzhihua.service_community.service.ComActReserveRecordService; |
| | | import com.panzhihua.service_community.service.ComActReserveService; |
| | | import com.panzhihua.service_community.service.ComActReserveSubSelectionService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | private ComActReserveOperationRecordMapper comActReserveOperationRecordMapper; |
| | | @Resource |
| | | private ComActReserveSubSelectionService comActReserveSubSelectionService; |
| | | @Resource |
| | | private ComActReserveRecordService comActReserveRecordService; |
| | | |
| | | private final static String COMMIT="用户已提交"; |
| | | @Override |
| | |
| | | if(comActReserveDO!=null){ |
| | | //查询当前用户是否已预约并判断是否能继续预约 |
| | | List<ComActReserveRecordDO> list=comActReserveRecordMapper.selectList(new QueryWrapper<ComActReserveRecordDO>().eq("reserve_id",comActReserveCommitVO.getId()).eq("user_id",comActReserveCommitVO.getUserId()).in("status",1,2,3)); |
| | | if(!list.isEmpty()&&comActReserveDO.getIsRepeat()==ComActReserveDO.isRepeat.no){ |
| | | if(!list.isEmpty()&&list.size()>1&&comActReserveDO.getIsRepeat()==ComActReserveDO.isRepeat.no){ |
| | | return R.fail("提交失败,不可重复预约"); |
| | | } |
| | | else { |
| | |
| | | answerContentDO.setAnswerContent(subSelectionDO.getContent()); |
| | | answerContentList.add(answerContentDO); |
| | | } |
| | | }else if(questnaiteSub.getType().equals(QuestnaiteSubVO.type.wenda)){ |
| | | }else{ |
| | | //问答题处理 |
| | | String values = questnaiteSub.getValues(); |
| | | ComActReserveAnswerContentDO answerContentDO = new ComActReserveAnswerContentDO(); |
| | |
| | | Integer joinCount = comActReserveDO.getJoinCount(); |
| | | comActReserveDO.setJoinCount(joinCount != null ? joinCount + 1 : 1); |
| | | comActReserveMapper.updateById(comActReserveDO); |
| | | |
| | | //新增用户答题记录 |
| | | ComActReserveRecordDO userAnswerDO = new ComActReserveRecordDO(); |
| | | userAnswerDO.setPhone(comActReserveCommitVO.getPhone()); |
| | | userAnswerDO.setReserveId(questId); |
| | | userAnswerDO.setReserveTime(comActReserveCommitVO.getReserveTime()); |
| | | userAnswerDO.setUserId(userId); |
| | | userAnswerDO.setType(comActReserveCommitVO.getType()); |
| | | userAnswerDO.setCreateAt(nowDate); |
| | |
| | | else { |
| | | userAnswerDO.setStatus(ComActReserveRecordDO.status.cg); |
| | | } |
| | | comActReserveRecordMapper.insert(userAnswerDO); |
| | | comActReserveRecordService.saveOrUpdate(userAnswerDO); |
| | | |
| | | //给答题记录赋值预约登记记录id |
| | | answerContentList.forEach(answerContent -> { |
| | |
| | | comActReserveOperationRecordDO.setReserveId(comActReserveCommitVO.getId()); |
| | | comActReserveOperationRecordDO.setReserveRecordId(userAnswerDO.getId()); |
| | | comActReserveOperationRecordDO.setType(ComActReserveOperationRecordDO.type.br); |
| | | comActReserveOperationRecordDO.setReserveTime(DateUtil.date()); |
| | | comActReserveOperationRecordDO.setCreateAt(DateUtil.date()); |
| | | comActReserveOperationRecordDO.setReserveTime(comActReserveCommitVO.getReserveTime()); |
| | | comActReserveOperationRecordDO.setReserveContent(COMMIT); |
| | | comActReserveOperationRecordDO.setPhone(comActReserveCommitVO.getPhone()); |
| | | comActReserveOperationRecordDO.setStatus(ComActReserveOperationRecordDO.status.ytj); |
| | | comActReserveOperationRecordDO.setUserId(comActReserveCommitVO.getUserId()); |
| | | comActReserveOperationRecordMapper.insert(comActReserveOperationRecordDO); |
| | | return R.ok("提交成功"); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R getById(Long id,Long userId,Long recordId) { |
| | | ComActReserveDO comActReserveDO=comActReserveMapper.selectById(id); |
| | | if(comActReserveDO!=null){ |
| | | ComActReserveDetailVO comActReserveDetailVO=new ComActReserveDetailVO(); |
| | | BeanUtils.copyProperties(comActReserveDO,comActReserveDetailVO); |
| | | List<ComActReserveRecordDO> list=comActReserveRecordMapper.selectList(new QueryWrapper<ComActReserveRecordDO>().eq("user_id",userId).eq("reserve_id",id).in("status",1,2).orderByDesc("reserve_time")); |
| | | List<ComActReserveRecordDO> secondlist=comActReserveRecordMapper.selectList(new QueryWrapper<ComActReserveRecordDO>().eq("user_id",userId).eq("reserve_id",id).orderByDesc("reserve_time")); |
| | | //判断当前数据是否可重复提交 |
| | | if(comActReserveDO.getIsRepeat()==ComActReserveDetailVO.isOk.y||list.isEmpty()){ |
| | | comActReserveDetailVO.setIsOk(ComActReserveDetailVO.isOk.n); |
| | | }else { |
| | | comActReserveDetailVO.setIsOk(ComActReserveDetailVO.isOk.y); |
| | | } |
| | | //如果用户已提交返回最新一条记录 列表时间倒序排列 |
| | | if(!list.isEmpty()){ |
| | | comActReserveDetailVO.setJsonObject(list.get(0).getJsonObject()); |
| | | comActReserveDetailVO.setReserveTime(list.get(0).getReserveTime()); |
| | | } |
| | | if(!secondlist.isEmpty()&&recordId!=null){ |
| | | secondlist.forEach(comActReserveRecordDO -> { |
| | | if(comActReserveRecordDO.getId().equals(recordId)){ |
| | | comActReserveDetailVO.setRecordStatus(comActReserveRecordDO.getStatus()); |
| | | } |
| | | }); |
| | | } |
| | | return R.ok(comActReserveDetailVO); |
| | | } |
| | | return R.fail("未查询到数据"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public R pageReserveList(PageUserReserveDTO pageUserReserveDTO) { |
| | | return R.ok(comActReserveRecordMapper.pageReserveList(new Page<ComActReserveDO>(pageUserReserveDTO.getPageNum(), pageUserReserveDTO.getPageSize()),pageUserReserveDTO)); |
| | | } |
| | |
| | | <select id="indexBanner" 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 = 1 and adver_position_top = 1 |
| | | status = 2 and adver_position_top = 1 |
| | | <if test="communityId !=null"> |
| | | and community_id =#{communityId} |
| | | </if> |
| | |
| | | <select id="indexApplication" 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 = 1 and adver_position_application = 1 |
| | | status = 2 and adver_position_application = 1 |
| | | <if test="communityId !=null"> |
| | | and community_id =#{communityId} |
| | | </if> |
| | |
| | | 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 |
| | | </sql> |
| | | |
| | | <select id="pageReserveList" resultMap="BaseResultMap"> |
| | | select * from com_act_reserve_record |
| | | <select id="pageReserveList" resultType="com.panzhihua.common.model.vos.community.reserve.ComActReserveRecordListVO"> |
| | | 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 |
| | | <if test="pageUserReserveDTO.type !=null"> |
| | | and type =#{pageUserReserveDTO.type} |
| | | and t.type =#{pageUserReserveDTO.type} |
| | | </if> |
| | | <if test="pageUserReserveDTO.status !=null"> |
| | | and status =#{pageUserReserveDTO.status} |
| | | and t.status =#{pageUserReserveDTO.status} |
| | | </if> |
| | | <if test="pageUserReserveDTO.userId !=null"> |
| | | and user_id =#{pageUserReserveDTO.userId} |
| | | and t.user_id =#{pageUserReserveDTO.userId} |
| | | </if> |
| | | </where> |
| | | </select> |
| | |
| | | </if> |
| | | order by carr.create_at desc |
| | | </select> |
| | | |
| | | <select id="queryAll" resultType="com.panzhihua.common.model.vos.community.reserve.ComOperationListVO" parameterType="com.panzhihua.common.model.dtos.community.OperationDetailDTO"> |
| | | select * from com_act_reserve_operation_record |
| | | <where> |
| | | <if test="reserveRecordId!=null"> |
| | | and reserve_record_id =#{reserveRecordId} |
| | | </if> |
| | | <if test="userId!=null"> |
| | | and user_id =#{userId} |
| | | </if> |
| | | <if test="type!=null"> |
| | | and type =#{type} |
| | | </if> |
| | | </where> |
| | | order by create_at desc |
| | | </select> |
| | | </mapper> |