|
|
@@ -1,20 +1,14 @@
|
|
|
package bus.service.impl;
|
|
|
|
|
|
-import bus.mapper.BPreBusMapper;
|
|
|
-import bus.mapper.BUserPreMapper;
|
|
|
-import bus.mapper.WChatUserMapper;
|
|
|
+import bus.mapper.*;
|
|
|
import bus.model.SnowflakeUtil;
|
|
|
import bus.model.dto.*;
|
|
|
import bus.model.dto.req.BCourseUserPrePageDto;
|
|
|
import bus.model.dto.req.BCourseUserPreReqDto;
|
|
|
import bus.model.dto.req.BUserPreDetailDto;
|
|
|
import bus.model.dto.req.PreBusStatusDto;
|
|
|
-import bus.model.po.BPreBusPo;
|
|
|
-import bus.model.po.BUserPrePo;
|
|
|
-import bus.model.po.WChatUserPo;
|
|
|
+import bus.model.po.*;
|
|
|
import bus.model.vo.BCoursePreVo;
|
|
|
-import bus.model.po.BCoursePrePo;
|
|
|
-import bus.mapper.BCoursePreMapper;
|
|
|
|
|
|
import bus.model.vo.BUserPreVo;
|
|
|
import bus.service.BCoursePreService;
|
|
|
@@ -22,11 +16,13 @@ import bus.service.BUserPreService;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.orcas.common.sso.model.ExtInfo;
|
|
|
import com.orcas.iso.config.common.user.CurrentUserHolder;
|
|
|
+import com.qzwisdom.qzframework.core.tool.exception.BusinessException;
|
|
|
import org.springframework.data.web.config.QuerydslWebConfiguration;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -48,6 +44,9 @@ public class BCoursePreServiceImpl extends ServiceImpl<BCoursePreMapper, BCourse
|
|
|
@Autowired
|
|
|
private BCoursePreMapper bCoursePreMapper;
|
|
|
@Autowired
|
|
|
+
|
|
|
+ private BBusInfoMapper bBusInfoMapper;
|
|
|
+ @Autowired
|
|
|
private BUserPreMapper bUserPreMapper;
|
|
|
@Autowired
|
|
|
private BPreBusMapper bPreBusMapper;
|
|
|
@@ -110,12 +109,13 @@ public class BCoursePreServiceImpl extends ServiceImpl<BCoursePreMapper, BCourse
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<BUserPreDetailDto> getPreUserByCourse(String courseId, String preId) {
|
|
|
+ public List<BUserPreDetailDto> getPreUserByCourse(String courseId, String preId,String preDate) {
|
|
|
List<BUserPreDetailDto> ss = new ArrayList<>();
|
|
|
QueryWrapper<BUserPrePo> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.select("distinct user_id");
|
|
|
queryWrapper.eq("pre_id",preId);
|
|
|
queryWrapper.eq("course_id",courseId);
|
|
|
+ queryWrapper.eq("pre_date",preDate);
|
|
|
List<BUserPrePo> list = bUserPreMapper.selectList(queryWrapper);
|
|
|
if(CollectionUtil.isEmpty(list)){
|
|
|
return CollectionUtil.newArrayList();
|
|
|
@@ -133,7 +133,7 @@ public class BCoursePreServiceImpl extends ServiceImpl<BCoursePreMapper, BCourse
|
|
|
if(wChatUserPo !=null) {
|
|
|
detailDto.setWxName(wChatUserPo.getWxName());
|
|
|
detailDto.setWxPhone(wChatUserPo.getWxPhone());
|
|
|
- detailDto.setPreDate(DateUtil.format(bUserPrePo.getPreDate(),"yyyy-MM-dd"));
|
|
|
+ detailDto.setPreDate(preDate);
|
|
|
ss.add(detailDto);
|
|
|
}
|
|
|
}
|
|
|
@@ -235,16 +235,38 @@ public class BCoursePreServiceImpl extends ServiceImpl<BCoursePreMapper, BCourse
|
|
|
|
|
|
@Override
|
|
|
public void selectBusFc(PreBusStatusDto preBusStatusDto) {
|
|
|
+
|
|
|
ExtInfo extInfo = CurrentUserHolder.get();
|
|
|
String preBusId = preBusStatusDto.getPreBusId();
|
|
|
BPreBusPo bPreBusPo = bPreBusMapper.selectById(preBusId);
|
|
|
- bPreBusPo.setBusId(preBusStatusDto.getBusId());
|
|
|
- bPreBusPo.setPreStatus(preBusStatusDto.getPreStatus());
|
|
|
+ List<String> busIdList = preBusStatusDto.getBusIdList();
|
|
|
+ if(CollectionUtil.isEmpty(busIdList)){
|
|
|
+ throw new BusinessException("请选择车辆");
|
|
|
+ }
|
|
|
+ String busIdStr = String.join(",", busIdList);
|
|
|
+ QueryWrapper<BBusInfoPo> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.in("id",busIdList);
|
|
|
+ List<BBusInfoPo> bBusInfoPos = bBusInfoMapper.selectList(queryWrapper);
|
|
|
+ if(CollectionUtil.isEmpty(bBusInfoPos) ||bBusInfoPos.size() != busIdList.size()){
|
|
|
+ throw new BusinessException("车辆信息异常");
|
|
|
+ }
|
|
|
+ List<String> busNoList = bBusInfoPos.stream().map(BBusInfoPo::getBusNo).collect(Collectors.toList());
|
|
|
+ String busNoStr = String.join(",", busNoList);
|
|
|
+ bPreBusPo.setBusId(busIdStr);
|
|
|
+ bPreBusPo.setBusNo(busNoStr);
|
|
|
+ bPreBusPo.setPreStatus("1");
|
|
|
bPreBusPo.setUpdaterId(extInfo.getUserId());
|
|
|
bPreBusPo.setUpdateTime(new Date());
|
|
|
bPreBusMapper.updateById(bPreBusPo);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void updateFcStatus(String preBusId ) {
|
|
|
+ BPreBusPo bPreBusPo = bPreBusMapper.selectById(preBusId);
|
|
|
+ bPreBusPo.setPreStatus("2");
|
|
|
+ bPreBusMapper.updateById(bPreBusPo);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 详情
|
|
|
* @param id
|