Commit 06d66466 authored by 周健威's avatar 周健威

Merge branch 'dev' into base-modify

# Conflicts:
#	xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderTourVerificationBiz.java
#	xx-tour/xx-tour-api/src/main/java/com/xxfc/platform/tour/feign/TourFeign.java
#	xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
#	xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/SysRegionController.java
parents 878a553b 0d17be44
package com.xxfc.platform.order.biz; 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.admin.feign.dto.UserDTO;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.process.ResultCode; import com.github.wxiaoqi.security.common.util.process.ResultCode;
...@@ -18,6 +17,9 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -18,6 +17,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.time.Instant; import java.time.Instant;
import java.time.LocalTime;
import java.time.temporal.ChronoUnit;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
...@@ -90,15 +92,30 @@ public class OrderTourVerificationBiz{ ...@@ -90,15 +92,30 @@ public class OrderTourVerificationBiz{
} }
// 出发时间 是否已经发车 // 出发时间 是否已经发车
Long departureTime = tourFeign.selectDepartureTimeByStartCompanyIdAndRouteId(tourDetail.getStartCompanyId(),tourDetail.getGoodId()); Date departureDate = tourFeign.selectDepartureDataBySpeId(tourDetail.getSpePriceId());
if (Instant.now().toEpochMilli()<departureTime){ 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); 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){ if (departureStatus==1){
return ObjectRestResponse.createFailedResultWithObj(400,"已经发车",1); return ObjectRestResponse.createFailedResultWithObj(400,"已经发车",1);
} }
baseOrder=new BaseOrder(); baseOrder=new BaseOrder();
baseOrder.setId(orderId); baseOrder.setId(orderId);
baseOrder.setStatus(OrderStatusEnum.ORDER_FINISH.getCode()); baseOrder.setStatus(OrderStatusEnum.ORDER_FINISH.getCode());
......
...@@ -15,6 +15,7 @@ import io.swagger.annotations.ApiOperation; ...@@ -15,6 +15,7 @@ import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -100,4 +101,7 @@ public interface TourFeign { ...@@ -100,4 +101,7 @@ public interface TourFeign {
@GetMapping("/tourGood/verfication/departure_status") @GetMapping("/tourGood/verfication/departure_status")
Integer selectDepartureStatusByVerificationId(@RequestParam(value = "verificationId") Integer verificationId); 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; ...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.process.ResultCode; import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.xxfc.platform.tour.dto.TourSpePriceDTO; 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.entity.TourGoodSpePrice;
import com.xxfc.platform.tour.mapper.TourGoodSpePriceMapper; import com.xxfc.platform.tour.mapper.TourGoodSpePriceMapper;
import com.xxfc.platform.tour.vo.TourSpePriceVo; import com.xxfc.platform.tour.vo.TourSpePriceVo;
...@@ -15,6 +16,7 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz; ...@@ -15,6 +16,7 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
...@@ -101,4 +103,10 @@ public class TourGoodSpeBiz extends BaseBiz<TourGoodSpePriceMapper, TourGoodSpeP ...@@ -101,4 +103,10 @@ public class TourGoodSpeBiz extends BaseBiz<TourGoodSpePriceMapper, TourGoodSpeP
public void delGoodSpe(Integer goodId, List<Integer> ids){ mapper.delSpe(goodId,ids);} 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; ...@@ -8,6 +8,8 @@ import com.xxfc.platform.tour.dto.TourSpePriceDTO;
import com.xxfc.platform.tour.vo.TourSpePriceVo; import com.xxfc.platform.tour.vo.TourSpePriceVo;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.Date;
@RestController @RestController
@RequestMapping("spe") @RequestMapping("spe")
@IgnoreClientToken @IgnoreClientToken
...@@ -32,4 +34,8 @@ public class TourGoodSpeController extends TourBaseController<TourGoodSpeBiz> { ...@@ -32,4 +34,8 @@ public class TourGoodSpeController extends TourBaseController<TourGoodSpeBiz> {
return baseBiz.cutStock(speId,number,type); 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
...@@ -67,7 +67,7 @@ public interface VehicleFeign { ...@@ -67,7 +67,7 @@ public interface VehicleFeign {
@RequestMapping(value = "/user/license/company/getOne", method = RequestMethod.GET) @RequestMapping(value = "/user/license/company/getOne", method = RequestMethod.GET)
public RestResponse<VehicleUserLicense> getOne( public RestResponse<VehicleUserLicense> getOne(
@RequestParam(value="id",defaultValue="0")Integer id) throws Exception; @RequestParam(value="id",defaultValue="0")Integer id) throws Exception ;
/** /**
* 获取优质车型接口 * 获取优质车型接口
......
...@@ -78,4 +78,12 @@ public class BranchCompanyVo { ...@@ -78,4 +78,12 @@ public class BranchCompanyVo {
*/ */
private Integer zoneId; private Integer zoneId;
/**
* 租车客服电话
*/
private String vehiceServicePhone;
/**
* 旅游客服电话
*/
private String tourServicePhone;
} }
\ No newline at end of file
...@@ -9,13 +9,16 @@ ...@@ -9,13 +9,16 @@
<result column="name" property="name" jdbcType="VARCHAR" /> <result column="name" property="name" jdbcType="VARCHAR" />
<result column="branch_type" property="branchType" jdbcType="INTEGER" /> <result column="branch_type" property="branchType" jdbcType="INTEGER" />
<result column="subordinate_branch" property="subordinateBranch" jdbcType="INTEGER" /> <result column="subordinate_branch" property="subordinateBranch" jdbcType="INTEGER" />
<result column="location" property="location" jdbcType="VARCHAR" />
<result column="addr_province" property="addrProvince" jdbcType="INTEGER" /> <result column="addr_province" property="addrProvince" jdbcType="INTEGER" />
<result column="addr_city" property="addrCity" jdbcType="INTEGER" /> <result column="addr_city" property="addrCity" jdbcType="INTEGER" />
<result column="addr_town" property="addrTown" jdbcType="INTEGER" /> <result column="addr_town" property="addrTown" jdbcType="INTEGER" />
<result column="addr_detail" property="addrDetail" jdbcType="VARCHAR" /> <result column="addr_detail" property="addrDetail" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" /> <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" /> <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
<result column="vehice_service_phone" property="vehiceServicePhone"/>
<result column="tour_service_phone" property="tourServicePhone"/>
<result column="longitude" property="longitude"/>
<result column="latitude" property="latitude"/>
</resultMap> </resultMap>
<select id="search" resultType="com.xxfc.platform.vehicle.pojo.CompanySearchVO"> <select id="search" resultType="com.xxfc.platform.vehicle.pojo.CompanySearchVO">
......
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