huanghongfa
2021-08-31 178c7386d73c53dd04f2a6c9b55c7d1307de6f96
bug修复
4个文件已修改
21 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActReserveMapper.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActReserveRecordServiceImpl.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActReserveMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActReserveRecordMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
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.ok("仅预约成功的可以进行取消操作");
        }
        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/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>