Commit 18e00fd8 authored by libin's avatar libin

旅游核销

parent 3abf9761
......@@ -16,6 +16,7 @@ import com.xxfc.platform.vehicle.entity.BranchCompany;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.Instant;
import java.util.List;
/**
......@@ -49,6 +50,13 @@ public class OrderTourVerificationBiz{
return PageDataVO.pageInfo(page,limit,()->verificationMapper.pageByParm(verificationId));
}
/**
*
* @param no 订单号
* @param list 分公司列表
* @param userDTO
* @return
*/
//核销
public ObjectRestResponse VerificationByOrder(String no, List<BranchCompany> list, UserDTO userDTO){
BaseOrder baseOrder=new BaseOrder();
......@@ -79,6 +87,17 @@ public class OrderTourVerificationBiz{
}
}
}
// 出发时间 是否已经发车
Long departureTime = tourFeign.selectDepartureTimeByStartCompanyIdAndRouteId(tourDetail.getStartCompanyId(),tourDetail.getGoodId());
if (Instant.now().toEpochMilli()<departureTime){
return ObjectRestResponse.createFailedResultWithObj(400,"还未到发车时间",0);
}
Integer departureStatus = tourFeign.selectDepartureStatusByVerificationId(verificationId);
if (departureStatus==1){
return ObjectRestResponse.createFailedResultWithObj(400,"已经发车",1);
}
baseOrder=new BaseOrder();
baseOrder.setId(orderId);
baseOrder.setStatus(OrderStatusEnum.ORDER_FINISH.getCode());
......
......@@ -79,11 +79,4 @@ public class OrderTourVerificationController extends CommonBaseController {
public ObjectRestResponse list(@RequestBody TourGoodOrderFindVo tourGoodOrderFindVo) {
return verificationBiz.getVerifications(tourGoodOrderFindVo);
}
}
\ No newline at end of file
......@@ -94,4 +94,10 @@ public interface TourFeign {
//获取商品信息
@RequestMapping(value = "/good/app/unauth/one", method = RequestMethod.GET)
public TourGood one(@RequestParam(value = "goodId",defaultValue = "0") Integer goodId);
@GetMapping("/tourGoodSite/departure_time")
Long selectDepartureTimeByStartCompanyIdAndRouteId(@RequestParam(value = "companyId") Integer companyId, @RequestParam(value = "goodId") Integer routeId);
@GetMapping("/tourGood/verfication/departure_status")
Integer selectDepartureStatusByVerificationId(@RequestParam(value = "verificationId") Integer verificationId);
}
......@@ -21,4 +21,12 @@ public class TourGoodSiteBiz extends BaseBiz<TourGoodSiteMapper,TourGoodSite> {
//删除站点
public void delGoodSite(Integer goodId, List<Integer> ids){ mapper.delSite(goodId,ids);}
public Long selectDepartureTimeByStartCompanyIdAndRouteId(Integer companyId, Integer routeId) {
TourGoodSite tourGoodSite = new TourGoodSite();
tourGoodSite.setCompanyId(companyId);
tourGoodSite.setGoodId(routeId);
TourGoodSite site = mapper.selectOne(tourGoodSite);
return site.getDepartTime();
}
}
\ No newline at end of file
......@@ -9,9 +9,7 @@ import com.xxfc.platform.tour.entity.TourGoodVerification;
import com.xxfc.platform.tour.mapper.TourGoodVerificationMapper;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.time.LocalTime;
import java.util.*;
/**
......@@ -85,4 +83,11 @@ public class TourGoodVerificationBiz extends BaseBiz<TourGoodVerificationMapper,
return mapper.updateTourGoodPerNumbs(verficationId,properties,number);
}
public Integer selectDepartureStatusByVerificationId(Integer verificationId) {
TourGoodVerification tourGoodVerification = new TourGoodVerification();
tourGoodVerification.setId(verificationId);
TourGoodVerification verfication = mapper.selectByPrimaryKey(tourGoodVerification);
return verfication.getStatus();
}
}
\ No newline at end of file
......@@ -3,11 +3,19 @@ package com.xxfc.platform.tour.rest;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.xxfc.platform.tour.biz.TourGoodSiteBiz;
import com.xxfc.platform.tour.entity.TourGoodSite;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("tourGoodSite")
public class TourGoodSiteController extends BaseController<TourGoodSiteBiz,TourGoodSite> {
@GetMapping("/departure_time")
public Long selectDepartureTimeByStartCompanyIdAndRouteId(@RequestParam(value = "companyId") Integer companyId,
@RequestParam(value = "goodId") Integer routeId){
return baseBiz.selectDepartureTimeByStartCompanyIdAndRouteId(companyId,routeId);
}
}
\ No newline at end of file
......@@ -62,4 +62,9 @@ public class TourGoodVerificationController extends BaseController<TourGoodVerif
}
return ObjectRestResponse.createDefaultFail();
}
@GetMapping("/departure_status")
public Integer selectDepartureStatusByVerificationId(@RequestParam(value = "verificationId") Integer verificationId){
return baseBiz.selectDepartureStatusByVerificationId(verificationId);
}
}
\ 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