Commit bf3f7cbb authored by libin's avatar libin

旅游核销

parent 6054aafa
package com.xxfc.platform.order.biz;
import cn.hutool.core.bean.BeanUtil;
import com.github.wxiaoqi.security.admin.feign.dto.UserDTO;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
......@@ -17,6 +16,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.Instant;
import java.time.LocalTime;
import java.time.temporal.ChronoUnit;
import java.util.Date;
import java.util.List;
/**
......@@ -89,15 +91,30 @@ public class OrderTourVerificationBiz{
}
// 出发时间 是否已经发车
Long departureTime = tourFeign.selectDepartureTimeByStartCompanyIdAndRouteId(tourDetail.getStartCompanyId(),tourDetail.getGoodId());
if (Instant.now().toEpochMilli()<departureTime){
Date departureDate = tourFeign.selectDepartureDataBySpeId(tourDetail.getSpePriceId());
Long departureTime = tourFeign.selectDepartureTimeByStartCompanyIdAndRouteId(tourDetail.getStartCompanyId(), tourDetail.getGoodId());
Integer departureStatus = tourFeign.selectDepartureStatusByVerificationId(verificationId);
LocalTime localDepartureTime = LocalTime.ofSecondOfDay(departureTime);
departureDate.setHours(localDepartureTime.getHour());
departureDate.setMinutes(localDepartureTime.getMinute());
departureDate.setSeconds(localDepartureTime.getSecond());
if (Instant.now().toEpochMilli()<departureDate.toInstant().toEpochMilli()){
return ObjectRestResponse.createFailedResultWithObj(400,"还未到发车时间",0);
}
Integer departureStatus = tourFeign.selectDepartureStatusByVerificationId(verificationId);
departureDate.setHours(0);
departureDate.setMinutes(0);
departureDate.setSeconds(0);
Instant seconddayInstant = departureDate.toInstant().plus(1, ChronoUnit.DAYS);
if(Instant.now().toEpochMilli()>seconddayInstant.toEpochMilli()){
return ObjectRestResponse.createFailedResultWithObj(400,"该票已无效",2);
}
if (departureStatus==1){
return ObjectRestResponse.createFailedResultWithObj(400,"已经发车",1);
}
baseOrder=new BaseOrder();
baseOrder.setId(orderId);
baseOrder.setStatus(OrderStatusEnum.ORDER_FINISH.getCode());
......
......@@ -15,6 +15,7 @@ import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -100,4 +101,7 @@ public interface TourFeign {
@GetMapping("/tourGood/verfication/departure_status")
Integer selectDepartureStatusByVerificationId(@RequestParam(value = "verificationId") Integer verificationId);
@GetMapping("/spe/departure_date")
Date selectDepartureDataBySpeId(@RequestParam(value = "speIds") Integer speIds);
}
......@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.xxfc.platform.tour.dto.TourSpePriceDTO;
import com.xxfc.platform.tour.entity.TourGoodSpe;
import com.xxfc.platform.tour.entity.TourGoodSpePrice;
import com.xxfc.platform.tour.mapper.TourGoodSpePriceMapper;
import com.xxfc.platform.tour.vo.TourSpePriceVo;
......@@ -15,6 +16,7 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Date;
import java.util.List;
/**
......@@ -101,4 +103,10 @@ public class TourGoodSpeBiz extends BaseBiz<TourGoodSpePriceMapper, TourGoodSpeP
public void delGoodSpe(Integer goodId, List<Integer> ids){ mapper.delSpe(goodId,ids);}
public Date selectDepartureDataBySpeId(Integer speIds) {
TourGoodSpePrice tourGoodSpePrice = new TourGoodSpePrice();
tourGoodSpePrice.setId(speIds);
TourGoodSpePrice spePrice = mapper.selectOne(tourGoodSpePrice);
return spePrice.getStartTime();
}
}
\ No newline at end of file
......@@ -8,6 +8,8 @@ import com.xxfc.platform.tour.dto.TourSpePriceDTO;
import com.xxfc.platform.tour.vo.TourSpePriceVo;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
@RestController
@RequestMapping("spe")
@IgnoreClientToken
......@@ -32,4 +34,8 @@ public class TourGoodSpeController extends TourBaseController<TourGoodSpeBiz> {
return baseBiz.cutStock(speId,number,type);
}
@GetMapping("/departure_date")
public Date selectDepartureDataBySpeId(@RequestParam(value = "speIds")Integer spePriceId){
return baseBiz.selectDepartureDataBySpeId(spePriceId);
}
}
\ No newline at end of file
......@@ -105,4 +105,18 @@ public class BranchCompany {
private Integer zoneId;
private String phone;
/**
* 租车客服电话
*/
@Column(name = "vehice_service_phone")
@ApiModelProperty("租车客服电话")
private String vehiceServicePhone;
/**
* 旅游客服电话
*/
@Column(name = "tour_service_phone")
@ApiModelProperty("旅游客服电话")
private String tourServicePhone;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment