Commit 42b35c8a authored by libin's avatar libin

Merge remote-tracking branch 'origin/base-modify' into base-modify

parents 6e293b5f 2a9f6aa9
......@@ -7,6 +7,7 @@ import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.tour.dto.TourSpePriceDTO;
import com.xxfc.platform.tour.entity.TourGood;
import com.xxfc.platform.tour.entity.TourGoodVerification;
import com.xxfc.platform.tour.entity.TourTag;
import com.xxfc.platform.tour.entity.TourUser;
import com.xxfc.platform.tour.vo.TourGoodOrderFindVo;
import com.xxfc.platform.tour.vo.TourGoodOrderVo;
......@@ -107,4 +108,24 @@ public interface TourFeign {
@GetMapping(value = "/tourGood/app/unauth/findRandomVehicle")
public ObjectRestResponse findRandomVehicle(@RequestParam(value = "number")Integer number);
//查询旅游路线列表
@RequestMapping(value = "/gw/app/unauth/getGoodList", method = RequestMethod.GET)
ObjectRestResponse getGoodList(@RequestParam(value = "page",defaultValue = "1") Integer page,
@RequestParam(value = "limit",defaultValue = "10") Integer limit,
@RequestParam(value = "tagId", required = false) Integer tagId);
//获取公司详情
@GetMapping("/gw/app/unauth/detail/{id}")
ObjectRestResponse getOne(@PathVariable Integer id);
//首页旅游列表
@GetMapping(value = "/gw/app/shopList")
List<GoodDataVO> goodListAll(@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "limit",defaultValue = "4") Integer limit);
//旅游标签列表
@GetMapping(value = "/gw/tagList")
List<TourTag> tagList(@RequestParam(value = "isHot",defaultValue = "0")Integer isHot);
}
......@@ -49,6 +49,16 @@ public class TourTagBiz extends BaseBiz<TourTagMapper,TourTag> {
return mapper.findHotListTag(tag);
}
public List<TourTag> getTagList(Integer isHot) {
TourTag tag = new TourTag();
tag.setIsDel(0);
if (isHot!=null&&isHot==1){
tag.setIsHot(1);
return mapper.findHotListTag(tag);
}
return mapper.findAllByIsDel(tag);
}
public PageDataVO<TourTag> findPage(Map map) {
......
package com.xxfc.platform.tour.rest;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.github.wxiaoqi.security.common.vo.GoodDataVO;
import com.xxfc.platform.tour.biz.TourGoodBiz;
import com.xxfc.platform.tour.biz.TourGoodDetailBiz;
import com.xxfc.platform.tour.biz.TourTagBiz;
import com.xxfc.platform.tour.entity.TourGood;
import com.xxfc.platform.tour.entity.TourTag;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("gw")
@IgnoreClientToken
@IgnoreUserToken
public class TourGwController extends BaseController<TourGoodBiz, TourGood> {
@Autowired
TourGoodDetailBiz goodDetailBiz;
@Autowired
TourTagBiz tourTagBiz;
/**
* 查询旅游路线列表
*
* @param page
* @param limit
* @param tagId
* @return
*/
@ApiOperation("查询旅游路线列表")
@RequestMapping(value = "/app/unauth/getGoodList", method = RequestMethod.GET)
public ObjectRestResponse getGoodList(@RequestParam(value = "page",defaultValue = "1") Integer page,
@RequestParam(value = "limit",defaultValue = "10") Integer limit,
@RequestParam(value = "tagId", required = false) Integer tagId) {
return baseBiz.getGoodList(page, limit, "", null, null, tagId, null);
}
@GetMapping("/app/unauth/detail/{id}")
public ObjectRestResponse getOne(@PathVariable Integer id) {
return goodDetailBiz.getGoodDetaileById(id);
}
@ApiOperation("首页旅游列表")
@GetMapping(value = "/shopList")
public List<GoodDataVO> goodListAll(@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "limit",defaultValue = "4") Integer limit) {
return baseBiz.getAllByHome(page,limit);
}
@ApiOperation("旅游标签列表")
@GetMapping(value = "/tagList")
public List<TourTag> tagList(@RequestParam(value = "isHot",defaultValue = "0")Integer isHot) {
return tourTagBiz.getTagList(isHot);
}
}
\ No newline at end of file
package com.xxfc.platform.uccn.dto;
import lombok.Data;
@Data
public class RandomListDto {
/**
* 列表类型 TypeEnum
*/
private Integer type;
/**
* 随机数量
*/
private Integer number;
/**
* 活动位置,1:欣欣官网 2:滴房车官网 0:无限制,
*/
private Integer location;
}
package com.xxfc.platform.uccn.vo;
import lombok.Data;
public enum TypeEnum {
VEHICLE(1, "车型"),
TOUR(2, "旅游"),
CAMPSITE(3, "营地"),
ACTIVITY(4, "活动");
private Integer code;
private String msg;
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
TypeEnum(Integer code, String msg) {
this.code = code;
this.msg = msg;
}
public static TypeEnum getByValue(Integer value){
for(TypeEnum typeEnum : values()){
if (typeEnum.getCode() == value) {
return typeEnum;
}
}
return null;
}
}
......@@ -33,6 +33,12 @@
<version>2.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.xxfc.platform</groupId>
<artifactId>xx-tour-api</artifactId>
<version>2.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.xxfc.platform</groupId>
<artifactId>xx-campsite-api</artifactId>
......
package com.xxfc.platform.uccn.biz;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.campsite.feign.CampsiteFeign;
import com.xxfc.platform.tour.feign.TourFeign;
import com.xxfc.platform.uccn.vo.TypeEnum;
import com.xxfc.platform.vehicle.feign.VehicleFeign;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* 获取随机数量的车型、旅游、营地、活动
*/
@Service
@Slf4j
public class RandomListBiz {
@Autowired
VehicleFeign vehicleFeign;
@Autowired
TourFeign tourFeign;
@Autowired
CampsiteFeign campsiteFeign;
@Autowired
SummitActivityBiz summitActivityBiz;
/**
* @param type 类型
* @param number 随机数,默认是2
* @return
*/
public ObjectRestResponse getRandomList(Integer type, Integer number, Integer location) {
if(type != null) {
number = number == null ? 2 : number;
switch (TypeEnum.getByValue(type)) {
case VEHICLE:
return vehicleFeign.findRandomVehicle(number);
case TOUR:
return tourFeign.findRandomVehicle(number);
case CAMPSITE:
return campsiteFeign.findRandomVehicle(number);
case ACTIVITY:
return ObjectRestResponse.succ(summitActivityBiz.getHostWithSummitActivity(number, location));
}
}
return ObjectRestResponse.succ();
}
}
package com.xxfc.platform.uccn.rest;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.CommonBaseController;
import com.xxfc.platform.tour.feign.TourFeign;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/tour")
@Slf4j
@IgnoreClientToken
public class GwTourController extends CommonBaseController {
@Autowired
TourFeign tourFeign;
@ApiOperation("查询旅游路线列表")
@RequestMapping(value = "/getGoodList", method = RequestMethod.GET)
@IgnoreUserToken
public ObjectRestResponse getGoodList(@RequestParam(value = "page",defaultValue = "1") Integer page, @RequestParam(value = "limit",defaultValue = "10") Integer limit,
@RequestParam(value = "tagId", required = false) Integer tagId) {
return tourFeign.getGoodList(page, limit, tagId);
}
@GetMapping("/detail/{id}")
@IgnoreUserToken
public ObjectRestResponse getOne(@PathVariable Integer id) {
return tourFeign.getOne(id);
}
@ApiOperation("首页旅游列表")
@GetMapping(value = "/shopList")
@IgnoreUserToken
public ObjectRestResponse goodListAll(@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "limit",defaultValue = "4") Integer limit) {
return ObjectRestResponse.succ(tourFeign.goodListAll(page,limit));
}
@GetMapping("/tagList")
@IgnoreUserToken
public ObjectRestResponse getTagList(@RequestParam(value = "isHot",defaultValue = "0")Integer isHot) {
return ObjectRestResponse.succ(tourFeign.tagList(isHot));
}
}
package com.xxfc.platform.uccn.rest;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.uccn.biz.RandomListBiz;
import com.xxfc.platform.uccn.dto.RandomListDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/random/list")
public class RandomListController {
@Autowired
RandomListBiz randomListBiz;
@GetMapping("/app/unauth/get")
public ObjectRestResponse getRandomList(RandomListDto randomListDto) {
if(randomListDto == null) {
return ObjectRestResponse.paramIsEmpty();
}
return randomListBiz.getRandomList(randomListDto.getType(), randomListDto.getNumber(), randomListDto.getLocation());
}
}
......@@ -10,6 +10,7 @@ import com.xxfc.platform.vehicle.feign.VehicleFeign;
import com.xxfc.platform.vehicle.pojo.VModelDetailVO;
import com.xxfc.platform.vehicle.pojo.VehicleModelQueryCondition;
import com.xxfc.platform.vehicle.pojo.VehicleModelVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
......@@ -20,9 +21,10 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
@RestController
@RequestMapping("/vehicleModel")
@RequestMapping("/vehicleModel/app/unauth")
@Slf4j
@IgnoreClientToken
@Api(tags = "房车车型", value = "房车车型")
public class VehicleModelController extends CommonBaseController {
@Autowired
......@@ -50,7 +52,7 @@ public class VehicleModelController extends CommonBaseController {
* @return
*/
@ApiOperation("车型列表")
@PostMapping(value = "/app/unauth/findVehicleModelPage")
@PostMapping(value = "/findVehicleModelPage")
@IgnoreUserToken
public ObjectRestResponse<VehicleModelVo> findVehicleModelPageUnauthfind(@RequestBody VehicleModelQueryCondition vmqc) {
return vehicleFeign.findVehicleModelPageUnauthfind(vmqc);
......
......@@ -9,6 +9,7 @@ import com.xxfc.platform.vehicle.constant.ResCode.ResCode;
import com.xxfc.platform.vehicle.entity.*;
import com.xxfc.platform.vehicle.mapper.*;
import com.xxfc.platform.vehicle.pojo.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
......@@ -20,12 +21,10 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
@Service
@Slf4j
public class VehicleActiveService {
@Autowired
......@@ -82,7 +81,7 @@ public class VehicleActiveService {
throw new BaseException(ResCode.VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED.getDesc(),
ResCode.VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED.getCode());
}
if(MileageLift==null||MileageLift1 >= MileageLift){
if(MileageLift == null || MileageLift1 >= MileageLift){
// 写入车辆公里数,预计目的地
vehicle.setMileageLastUpdate(MileageLift1);
vehicle.setExpectDestinationBranchCompanyId(departureVo.getExpectArrivalBranchCompanyId());
......@@ -177,7 +176,7 @@ public class VehicleActiveService {
stringBuilder.append(" 使用人电话:");
stringBuilder.append(vehicleBookRecordVos.get(0).getVehicleUserPhone());
} else {
stringBuilder.append("请联系管理员修改车辆状态为正常状态");
stringBuilder.append(", 请联系管理员修改车辆状态为正常状态");
}
return stringBuilder.toString();
}
......@@ -311,6 +310,15 @@ public class VehicleActiveService {
param.put("vehicleId", vehicleBookRecord.getVehicleId());
param.put("bookedEndDate", vehicleBookRecord.getBookStartDate());
List<VehicleBookRecordVo> list = vehicleBookRecordBiz.selectByVehicleIdAndTime(param);
if(list != null && list.size() > 0) {
Iterator<VehicleBookRecordVo> iterator = list.iterator();
while (iterator.hasNext()) {
VehicleBookRecordVo vehicleBookRecordVo = iterator.next();
if(vehicleBookRecordVo.getVehicleDepartureLogVo() == null && (vehicleBookRecordVo.getBookEndDate().getTime() - new Date().getTime()) < 0) {
iterator.remove();
}
}
}
if(!(startDate.minusDays(1).compareTo(DateTime.now()) <= 0 && DateTime.now().compareTo(endDate) <= 0 && vehicleBookRecord.getStatus() == VehicleBookRecordStatus.APPROVE.getCode() && (list == null || list.size() <= 0))) {
throw new BaseException(ResCode.VEHICLE_DEPARTURE_DATE_IS_NOT_ABLED.getDesc(),
ResCode.VEHICLE_DEPARTURE_DATE_IS_NOT_ABLED.getCode());
......
......@@ -823,7 +823,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
stringBuilder.append(" 使用人电话:");
stringBuilder.append(vehicleBookRecordVos.get(0).getVehicleUserPhone());
} else {
stringBuilder.append("请联系管理员修改车辆状态为正常状态");
stringBuilder.append(", 请联系管理员修改车辆状态为正常状态");
}
return stringBuilder.toString();
}
......
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