| | |
| | | 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("未查询到数据"); |
| | | } |
| | | |
| | | } |