springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActReserveCommitVO.java
@@ -27,4 +27,6 @@ private Date reserveTime; @ApiModelProperty("姓名") private String name; @ApiModelProperty("预约内容") private String content; } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActReserveMapper.java
@@ -81,5 +81,10 @@ */ List<ComActReserveListAdminVO> listReserveAdmin(@Param("communityId") Long communityId); /** * 取消预约时,预约登记参加人数减少 * @param reserveId 预约登记id */ void addReserveCountById(@Param("reserveId") Long reserveId); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActReserveRecordServiceImpl.java
@@ -8,12 +8,10 @@ import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.reserve.*; import com.panzhihua.common.utlis.DateUtils; import com.panzhihua.service_community.dao.ComActReserveAnswerContentMapper; import com.panzhihua.service_community.dao.ComActReserveOperationRecordMapper; import com.panzhihua.service_community.dao.*; import com.panzhihua.common.model.dtos.community.CancelRecordDTO; import com.panzhihua.common.model.vos.R; import com.panzhihua.service_community.dao.ComActReserveOperationRecordMapper; import com.panzhihua.service_community.dao.ComActReserveRecordMapper; import com.panzhihua.service_community.model.dos.ComActReserveOperationRecordDO; import com.panzhihua.service_community.model.dos.ComActReserveRecordDO; import com.panzhihua.service_community.service.ComActReserveOperationRecordService; @@ -42,6 +40,8 @@ public class ComActReserveRecordServiceImpl extends ServiceImpl<ComActReserveRecordMapper, ComActReserveRecordDO> implements ComActReserveRecordService { @Resource private ComActReserveRecordMapper comActReserveRecordMapper; @Resource private ComActReserveMapper comActReserveMapper; @Resource private ComActReserveAnswerContentMapper comActReserveAnswerContentMapper; @Resource @@ -120,13 +120,15 @@ public R makeCancelAdmin(CancelReserveRecordDTO reserveRecordDTO){ Integer count = this.baseMapper.getReserveStatusById(reserveRecordDTO.getIds()); if(count > 0){ return R.ok("您选择的记录中存在未预约成功,不可进行批量取消"); return R.fail("仅预约成功的可以进行取消操作"); } if(this.baseMapper.editReserveStatusById(reserveRecordDTO.getIds()) > 0){ Long userId = reserveRecordDTO.getUserId(); reserveRecordDTO.getIds().forEach(id -> { ComActReserveRecordDO reserveRecordDO = comActReserveRecordMapper.selectById(id); if(reserveRecordDO != null){ //取消预约返还可参加名额 comActReserveMapper.addReserveCountById(reserveRecordDO.getReserveId()); //添加操作记录 comActReserveOperationRecordService.addReserveOperationRecord(reserveRecordDO.getReserveId() ,reserveRecordDO.getId(),reserveRecordDO.getUserId(),ComActReserveOperationRecordDO.type.sq,null springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActReserveServiceImpl.java
@@ -175,6 +175,7 @@ comActReserveMapper.updateById(comActReserveDO); //新增用户答题记录 ComActReserveRecordDO userAnswerDO = new ComActReserveRecordDO(); userAnswerDO.setContent(comActReserveCommitVO.getContent()); userAnswerDO.setName(comActReserveCommitVO.getName()); userAnswerDO.setCommunityId(comActReserveCommitVO.getCommunityId()); userAnswerDO.setPhone(comActReserveCommitVO.getPhone()); springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActReserveMapper.xml
@@ -179,4 +179,8 @@ com_act_reserve where is_del = 2 and `type` = 1 and community_id = #{communityId} </select> <update id="addReserveCountById"> update com_act_reserve set join_count = join_count - 1 where id = #{reserveId} </update> </mapper> springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActReserveRecordMapper.xml
@@ -87,7 +87,7 @@ </select> <select id="getReserveStatusById" resultType="integer"> select count(id) from com_act_reserve_record where `status` != 2 and id in select count(id) from com_act_reserve_record where `status` in (3,4) and id in <foreach collection='ids' item='id' index='index' open='(' close=')' separator=',' > #{id} </foreach>