Commit 071faad7 authored by hezhen's avatar hezhen

Merge branch 'dev' into hz_dev

parents 260bab35 cb5eede2
...@@ -10,6 +10,8 @@ import com.github.wxiaoqi.security.common.util.EntityUtils; ...@@ -10,6 +10,8 @@ import com.github.wxiaoqi.security.common.util.EntityUtils;
import com.github.wxiaoqi.security.common.util.IpUtil; import com.github.wxiaoqi.security.common.util.IpUtil;
import com.github.wxiaoqi.security.common.util.process.ResultCode; import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.util.result.JsonResultUtil; import com.github.wxiaoqi.security.common.util.result.JsonResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -22,6 +24,7 @@ import org.springframework.web.context.request.ServletRequestAttributes; ...@@ -22,6 +24,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
@Api(tags = "用户登录")
@RestController @RestController
@RequestMapping("jwt") @RequestMapping("jwt")
@Slf4j @Slf4j
......
...@@ -77,4 +77,7 @@ public class BaseUserMemberVO implements Serializable { ...@@ -77,4 +77,7 @@ public class BaseUserMemberVO implements Serializable {
@Column(name = "member_name") @Column(name = "member_name")
private String memberName; private String memberName;
private Integer discount;
} }
...@@ -38,8 +38,8 @@ public class BaseUserMemberController extends BaseController<BaseUserMemberBiz, ...@@ -38,8 +38,8 @@ public class BaseUserMemberController extends BaseController<BaseUserMemberBiz,
* @return * @return
*/ */
@ApiOperation(value = "根据用户id获取用户会员信息") @ApiOperation(value = "根据用户id获取用户会员信息")
@RequestMapping("/findOne/{userId}") @GetMapping("/findOne/{userId}")
public ObjectRestResponse<BaseUserMemberVO> findOneByUserId(@PathVariable Integer userId){ public ObjectRestResponse<BaseUserMemberVO> findOneByUserId(@PathVariable Integer userId)throws Exception{
return ObjectRestResponse.succ(baseBiz.findOneByUserId(userId)); return ObjectRestResponse.succ(baseBiz.findOneByUserId(userId));
} }
...@@ -49,7 +49,7 @@ public class BaseUserMemberController extends BaseController<BaseUserMemberBiz, ...@@ -49,7 +49,7 @@ public class BaseUserMemberController extends BaseController<BaseUserMemberBiz,
* @return * @return
*/ */
@RequestMapping("/getUserMember") @GetMapping("app/getUserMember")
@ApiOperation(value = "根据token获取用户会员信息") @ApiOperation(value = "根据token获取用户会员信息")
public ObjectRestResponse<BaseUserMemberVO> findOneByToken(){ public ObjectRestResponse<BaseUserMemberVO> findOneByToken(){
try { try {
......
...@@ -37,7 +37,8 @@ ...@@ -37,7 +37,8 @@
m.total_number as totalNumber, m.total_number as totalNumber,
m.buy_count as buyCount, m.buy_count as buyCount,
m.valid_time as validTime, m.valid_time as validTime,
m.member_name as `memberName`, m.member_name as memberName,
m.discount as discount,
ml.name as name ml.name as name
from from
base_user_member m base_user_member m
...@@ -49,7 +50,6 @@ ...@@ -49,7 +50,6 @@
m.user_id=#{userId} m.user_id=#{userId}
and and
m.is_del=0 m.is_del=0
limit 1 limit 1
</select> </select>
......
...@@ -85,7 +85,7 @@ public class OrderRefundBiz extends BaseBiz<OrderRefundMapper,OrderRefund> { ...@@ -85,7 +85,7 @@ public class OrderRefundBiz extends BaseBiz<OrderRefundMapper,OrderRefund> {
//判断是否定损过 //判断是否定损过
if(SYS_TRUE.equals(orderMQDTO.getOrderRentVehicleDetail().getFixedLossStatus())) { if(SYS_TRUE.equals(orderMQDTO.getOrderRentVehicleDetail().getFixedLossStatus())) {
crosstownTypeEnum = CrosstownTypeEnum.FIXED_LOSS.getCode(); crosstownTypeEnum = CrosstownTypeEnum.FIXED_LOSS.getCode();
depositRefundRecordStatus = DepositRefundStatus.FIXLOSSREFUND; depositRefundRecordStatus = DepositRefundStatus.FIXLOSSREFUNDARRIVAL;
}else { }else {
crosstownTypeEnum = CrosstownTypeEnum.ARRIVE.getCode(); crosstownTypeEnum = CrosstownTypeEnum.ARRIVE.getCode();
depositRefundRecordStatus = DepositRefundStatus.REFUNDARRIVAL; depositRefundRecordStatus = DepositRefundStatus.REFUNDARRIVAL;
......
...@@ -320,6 +320,7 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp ...@@ -320,6 +320,7 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
depositRefundRecord.setTotalAmount(totalAmount.subtract(getAmount())); depositRefundRecord.setTotalAmount(totalAmount.subtract(getAmount()));
depositRefundRecord.setCrosstownId(orderVehicleCrosstown.getId()); depositRefundRecord.setCrosstownId(orderVehicleCrosstown.getId());
orderDepositRefundRecordBiz.saveFixLossRecord(depositRefundRecord); orderDepositRefundRecordBiz.saveFixLossRecord(depositRefundRecord);
//修改訂單狀態為定損
baseOrder.setStatus(OrderStatusEnum.ORDER_FIXED_LOSS.getCode()); baseOrder.setStatus(OrderStatusEnum.ORDER_FIXED_LOSS.getCode());
baseOrderBiz.updateSelectiveByIdReT(baseOrder); baseOrderBiz.updateSelectiveByIdReT(baseOrder);
orderRentVehicleDetail.setFixedLossStatus(1); orderRentVehicleDetail.setFixedLossStatus(1);
......
package com.xxfc.platform.tour.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* 旅游商品
*
* @author zjw
* @email nishijjo@qq.com
* @date 2019-06-06 11:41:51
*/
@Data
public class TourVerificationInfoVo implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("旅游线路核销id")
private Integer verificationId;
@ApiModelProperty(value = "旅游商品规格id")
private Integer speId;
@ApiModelProperty(value = "开始时间")
private Date startTime;
//结束时间
@ApiModelProperty(value = "结束时间")
private Date endTime;
@ApiModelProperty(value = "时间区间")
private String time;
@ApiModelProperty(value = "出发路线id")
private Integer siteId;
@ApiModelProperty(value = "出发路线名称")
private String siteName;
@ApiModelProperty(value = "出发路线分公司id")
private Integer companyId;
@ApiModelProperty(value = "旅游路线id")
private Integer goodId;
@ApiModelProperty(value = "旅游路线名称")
private String goodName;
@ApiModelProperty(value = "出发路线分公司ids")
private List<Integer> companyList;
}
package com.xxfc.platform.tour.biz; package com.xxfc.platform.tour.biz;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.vo.PageDataVO; import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.tour.vo.TourGoodOrderFindVo; import com.xxfc.platform.tour.vo.TourGoodOrderFindVo;
import com.xxfc.platform.tour.vo.TourGoodOrderVo; import com.xxfc.platform.tour.vo.TourGoodOrderVo;
import com.xxfc.platform.tour.vo.TourVerificationInfoVo;
import org.omg.CORBA.PUBLIC_MEMBER;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.xxfc.platform.tour.entity.TourGoodVerification; import com.xxfc.platform.tour.entity.TourGoodVerification;
import com.xxfc.platform.tour.mapper.TourGoodVerificationMapper; import com.xxfc.platform.tour.mapper.TourGoodVerificationMapper;
...@@ -90,4 +93,42 @@ public class TourGoodVerificationBiz extends BaseBiz<TourGoodVerificationMapper, ...@@ -90,4 +93,42 @@ public class TourGoodVerificationBiz extends BaseBiz<TourGoodVerificationMapper,
TourGoodVerification verfication = mapper.selectByPrimaryKey(tourGoodVerification); TourGoodVerification verfication = mapper.selectByPrimaryKey(tourGoodVerification);
return verfication.getStatus(); return verfication.getStatus();
} }
//获取路线核销id
public ObjectRestResponse getVerificationList(TourVerificationInfoVo tourVerificationInfoVo){
Integer companyId=tourVerificationInfoVo.getCompanyId();
Integer goodId=tourVerificationInfoVo.getGoodId();
Integer siteId=tourVerificationInfoVo.getSiteId();
List<Integer> companyIds=tourVerificationInfoVo.getCompanyList();
List<TourVerificationInfoVo> list=null;
if (goodId==null||goodId==0){
if (companyId!=null&&companyId!=0){
list=mapper.getSiteList(null,companyId,null);
if (list.size()==0){
return ObjectRestResponse.succ();
}
}else if (list!=null&&companyIds.size()>0){
list=mapper.getSiteList(null,null,companyIds);
}
list=mapper.getGoodList(list);
}else {
if (siteId==null||siteId==0){
if (companyId==null||companyId==0){
list=mapper.getSiteList(goodId,null,companyIds);
}else {
list=mapper.getSpeList(goodId,null,companyId);
}
}else {
list= mapper.getSpeList(goodId,siteId,null);
}
}
return ObjectRestResponse.succ(list);
}
//获取路线核销信息
public ObjectRestResponse getVerification(Integer verificationId){
return ObjectRestResponse.succ(mapper.getVerification(verificationId));
}
} }
\ No newline at end of file
...@@ -4,6 +4,7 @@ package com.xxfc.platform.tour.mapper; ...@@ -4,6 +4,7 @@ package com.xxfc.platform.tour.mapper;
import com.xxfc.platform.tour.entity.TourGoodVerification; import com.xxfc.platform.tour.entity.TourGoodVerification;
import com.xxfc.platform.tour.vo.TourGoodOrderFindVo; import com.xxfc.platform.tour.vo.TourGoodOrderFindVo;
import com.xxfc.platform.tour.vo.TourGoodOrderVo; import com.xxfc.platform.tour.vo.TourGoodOrderVo;
import com.xxfc.platform.tour.vo.TourVerificationInfoVo;
import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update; import org.apache.ibatis.annotations.Update;
...@@ -55,4 +56,16 @@ public interface TourGoodVerificationMapper extends Mapper<TourGoodVerification> ...@@ -55,4 +56,16 @@ public interface TourGoodVerificationMapper extends Mapper<TourGoodVerification>
* @return * @return
*/ */
List<TourGoodOrderVo> findVerificationAll(TourGoodOrderFindVo tourGoodOrderFindVo ); List<TourGoodOrderVo> findVerificationAll(TourGoodOrderFindVo tourGoodOrderFindVo );
//获取旅游路线
List<TourVerificationInfoVo> getGoodList(@Param("list")List<TourVerificationInfoVo> list);
//获取路线id列表
List<TourVerificationInfoVo> getSiteList(@Param("goodId")Integer goodId,@Param("companyId")Integer companyId,@Param("companyList")List<Integer> companyIds);
//获取时间列表
List<TourVerificationInfoVo> getSpeList(@Param("goodId")Integer goodId,@Param("siteId")Integer siteId,@Param("companyId")Integer companyId);
//获取核销路线信息
TourVerificationInfoVo getVerification(@Param("verificationId")Integer verificationId);
} }
...@@ -5,16 +5,22 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; ...@@ -5,16 +5,22 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController; import com.github.wxiaoqi.security.common.rest.BaseController;
import com.github.wxiaoqi.security.common.vo.PageDataVO; import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.tour.biz.TourGoodVerificationBiz; import com.xxfc.platform.tour.biz.TourGoodVerificationBiz;
import com.xxfc.platform.tour.common.TourBaseController;
import com.xxfc.platform.tour.entity.TourGoodVerification; import com.xxfc.platform.tour.entity.TourGoodVerification;
import com.xxfc.platform.tour.vo.TourGoodOrderFindVo; import com.xxfc.platform.tour.vo.TourGoodOrderFindVo;
import com.xxfc.platform.tour.vo.TourGoodOrderVo; import com.xxfc.platform.tour.vo.TourGoodOrderVo;
import com.xxfc.platform.tour.vo.TourVerificationInfoVo;
import com.xxfc.platform.vehicle.feign.VehicleFeign;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@RestController @RestController
@RequestMapping("/tourGood/verfication") @RequestMapping("/tourGood/verfication")
@IgnoreClientToken @IgnoreClientToken
public class TourGoodVerificationController extends BaseController<TourGoodVerificationBiz, TourGoodVerification> { public class TourGoodVerificationController extends TourBaseController<TourGoodVerificationBiz> {
/** /**
* 查询订单列表 * 查询订单列表
* @param tourGoodOrderFindVo * @param tourGoodOrderFindVo
...@@ -67,4 +73,5 @@ public class TourGoodVerificationController extends BaseController<TourGoodVerif ...@@ -67,4 +73,5 @@ public class TourGoodVerificationController extends BaseController<TourGoodVerif
public Integer selectDepartureStatusByVerificationId(@RequestParam(value = "verificationId") Integer verificationId){ public Integer selectDepartureStatusByVerificationId(@RequestParam(value = "verificationId") Integer verificationId){
return baseBiz.selectDepartureStatusByVerificationId(verificationId); return baseBiz.selectDepartureStatusByVerificationId(verificationId);
} }
} }
\ No newline at end of file
package com.xxfc.platform.tour.rest;
import com.github.wxiaoqi.security.admin.feign.dto.UserDTO;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.tour.biz.TourGoodVerificationBiz;
import com.xxfc.platform.tour.common.TourBaseController;
import com.xxfc.platform.tour.vo.TourGoodOrderFindVo;
import com.xxfc.platform.tour.vo.TourGoodOrderVo;
import com.xxfc.platform.tour.vo.TourVerificationInfoVo;
import com.xxfc.platform.vehicle.entity.BranchCompany;
import com.xxfc.platform.vehicle.feign.VehicleFeign;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.stream.Collectors;
import static com.github.wxiaoqi.security.auth.common.constatns.CommonConstants.DATA_ALL_FALSE;
@RestController
@RequestMapping("/verfication")
@IgnoreClientToken
public class TourVerificationController extends TourBaseController<TourGoodVerificationBiz> {
@Autowired
VehicleFeign vehicleFeign;
@GetMapping("/getList")
public ObjectRestResponse getList(TourVerificationInfoVo tourVerificationInfoVo){
Integer companyId=tourVerificationInfoVo.getCompanyId();
if (companyId==null){
UserDTO userDTO=userinfoByToken();
if ( userDTO!=null&&DATA_ALL_FALSE.equals(userDTO.getDataAll())) {
List<BranchCompany> companyList= vehicleFeign.companyAll(userDTO.getDataAll(),userDTO.getDataCompany(),userDTO.getDataZone());
if (companyList.size()>0){
List<Integer> companyIds = companyList.stream().map(BranchCompany::getId).collect(Collectors.toList());
tourVerificationInfoVo.setCompanyList(companyIds);
}
}
}
return baseBiz.getVerificationList(tourVerificationInfoVo);
}
@GetMapping("/info/{id}")
public ObjectRestResponse getList(@PathVariable Integer id){
return baseBiz.getVerification(id);
}
}
\ No newline at end of file
...@@ -38,4 +38,99 @@ ...@@ -38,4 +38,99 @@
LEFT JOIN tour_good_spe_price p ON v.spe_id=p.id LEFT JOIN tour_good_spe_price p ON v.spe_id=p.id
WHERE s.company_id=#{companyId} and v.status=#{orderStatus} and p.start_time=#{travelDate} ORDER BY s.depart_time ) as `goodOrder` WHERE s.company_id=#{companyId} and v.status=#{orderStatus} and p.start_time=#{travelDate} ORDER BY s.depart_time ) as `goodOrder`
</select> </select>
<!-- 获取旅游路线id-->
<select id="getGoodList" resultType="com.xxfc.platform.tour.vo.TourVerificationInfoVo">
SELECT
v.good_id as goodId,
g.`name` as goodName
FROM
tour_good_verification v
LEFT JOIN tour_good g ON v.good_id = g.id
WHERE
v.is_del = 0
<if test="list!=null and list.size != 0">
and v.site_id in (
<trim suffixOverrides=",">
<foreach collection="list" item="item">
#{item.siteId},
</foreach>
</trim>
)
</if>
GROUP BY
v.good_id
</select>
<!--获取路线id-->
<select id="getSiteList" resultType="com.xxfc.platform.tour.vo.TourVerificationInfoVo">
SELECT
id as siteId,
name as siteName,
company_id as companyId
FROM tour_good_site
WHERE is_del=0
and type=0
<if test="goodId!=null and goodId!='' ">
and good_id=#{goodId}
</if>
<if test="companyId!=null and companyId!='' ">
and company_id=#{companyId}
</if>
<if test="companyList!=null and companyList.size != 0">
and company_id in (
<trim suffixOverrides=",">
<foreach collection="companyList" item="id">
#{id},
</foreach>
</trim>
)
</if>
order by rank desc
</select>
<!--获取时间-->
<select id="getSpeList" resultType="com.xxfc.platform.tour.vo.TourVerificationInfoVo">
SELECT
DISTINCT
v.id as verificationId,
v.spe_id as speId,
p.start_time as startTime,
p.end_time as endTime,
CONCAT(date_format(p.start_time,'%Y-%m-%d'), '~', date_format(p.end_time, '%Y-%m-%d')) as time
FROM
tour_good_verification v
LEFT JOIN tour_good_site s on v.site_id=s.id
LEFT JOIN tour_good_spe_price p ON v.spe_id=p.id
WHERE
v.is_del = 0 and v.good_id=#{goodId} and DATEDIFF(p.start_time,NOW())>0
<if test="siteId!=null and siteId!='' ">
and v.site_id=#{siteId}
</if>
<if test="companyId!=null and companyId!='' ">
and s.company_id=#{companyId}
</if>
ORDER BY
p.start_time
</select>
<!--获取核销信息-->
<select id="getVerification" resultType="com.xxfc.platform.tour.vo.TourVerificationInfoVo">
SELECT
DISTINCT
v.id as verificationId,
v.spe_id as speId,
p.start_time as startTime,
p.end_time as endTime,
CONCAT(date_format(p.start_time,'%Y-%m-%d'), '~', date_format(p.end_time, '%Y-%m-%d')) as time,
s.id as siteId,
s.name as siteName,
s.company_id as companyId,
v.good_id as goodId,
g.`name` as goodName
FROM
tour_good_verification v
LEFT JOIN tour_good_site s on v.site_id=s.id
LEFT JOIN tour_good_spe_price p ON v.spe_id=p.id
LEFT JOIN tour_good g ON v.good_id=g.id
WHERE v.id=#{verificationId}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -13,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -13,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
import java.util.Objects;
import static com.github.wxiaoqi.security.auth.common.constatns.CommonConstants.DATA_ALL_FALSE; import static com.github.wxiaoqi.security.auth.common.constatns.CommonConstants.DATA_ALL_FALSE;
...@@ -48,8 +49,12 @@ public class AreaBiz extends BaseBiz<AreaMapper, Area> implements UserRestInterf ...@@ -48,8 +49,12 @@ public class AreaBiz extends BaseBiz<AreaMapper, Area> implements UserRestInterf
return RestResponse.suc(mapper.findAllByIds(list)); return RestResponse.suc(mapper.findAllByIds(list));
} else { } else {
Area area = mapper.selectByPrimaryKey(ids);
if (Objects.isNull(area)){
return null;
}
List<Area> areas = Lists.newArrayList(); List<Area> areas = Lists.newArrayList();
areas.add(mapper.selectByPrimaryKey(ids)); areas.add(area);
return RestResponse.suc(areas); return RestResponse.suc(areas);
} }
} else { //拥有全部权限 } else { //拥有全部权限
......
...@@ -66,10 +66,6 @@ public class VehicleActiveService { ...@@ -66,10 +66,6 @@ public class VehicleActiveService {
throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNEXIST.getDesc(), throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNEXIST.getDesc(),
ResCode.VEHICLE_DEPARTURE_VEHICLE_UNEXIST.getCode()); ResCode.VEHICLE_DEPARTURE_VEHICLE_UNEXIST.getCode());
} }
if(StringUtils.isBlank(departureVo.getUser()) || StringUtils.isBlank(departureVo.getUserTel())) {
throw new BaseException(ResCode.USERNAME_AND_TELE_NOT_NULL.getDesc(),
ResCode.USERNAME_AND_TELE_NOT_NULL.getCode());
}
if(StringUtils.isBlank(departureVo.getCheckMan()) || StringUtils.isBlank(departureVo.getCheckManTel())) { if(StringUtils.isBlank(departureVo.getCheckMan()) || StringUtils.isBlank(departureVo.getCheckManTel())) {
throw new BaseException(ResCode.CHECKUSER_AND_PHONE_NOT_NULL.getDesc(), throw new BaseException(ResCode.CHECKUSER_AND_PHONE_NOT_NULL.getDesc(),
ResCode.CHECKUSER_AND_PHONE_NOT_NULL.getCode()); ResCode.CHECKUSER_AND_PHONE_NOT_NULL.getCode());
...@@ -261,21 +257,21 @@ public class VehicleActiveService { ...@@ -261,21 +257,21 @@ public class VehicleActiveService {
vehicleActiveLogMapper.updateByPrimaryKeySelective(activeLog); vehicleActiveLogMapper.updateByPrimaryKeySelective(activeLog);
//取消预定时间 bookInfo和bookRecord //取消预定时间 bookInfo和bookRecord
BookVehicleVO bookVehicleVo = new BookVehicleVO(); // BookVehicleVO bookVehicleVo = new BookVehicleVO();
BeanUtils.copyProperties(vehicleBookRecord, bookVehicleVo); // BeanUtils.copyProperties(vehicleBookRecord, bookVehicleVo);
bookVehicleVo.setNotCheckTimeLegal(Boolean.TRUE); // bookVehicleVo.setNotCheckTimeLegal(Boolean.TRUE);
bookVehicleVo.setBookStartDate(null); // bookVehicleVo.setBookStartDate(null);
bookVehicleVo.setBookEndDate(null); // bookVehicleVo.setBookEndDate(null);
bookVehicleVo.setUnbookStartDate(new DateTime(vehicleBookRecord.getBookStartDate()).toString(DATE_TIME_FORMATTER)); // bookVehicleVo.setUnbookStartDate(new DateTime(vehicleBookRecord.getBookStartDate()).toString(DATE_TIME_FORMATTER));
bookVehicleVo.setUnbookEndDate(new DateTime(vehicleBookRecord.getBookEndDate()).toString(DATE_TIME_FORMATTER)); // bookVehicleVo.setUnbookEndDate(new DateTime(vehicleBookRecord.getBookEndDate()).toString(DATE_TIME_FORMATTER));
try { // try {
Boolean hasSuc = vehicleBiz.unbookVehicle(bookVehicleVo); // Boolean hasSuc = vehicleBiz.unbookVehicle(bookVehicleVo);
if(!hasSuc){ // if(!hasSuc){
throw new BaseException(ResCode.VEHICLE_UNBOOK_FAIL.getDesc(), ResCode.VEHICLE_UNBOOK_FAIL.getCode()); // throw new BaseException(ResCode.VEHICLE_UNBOOK_FAIL.getDesc(), ResCode.VEHICLE_UNBOOK_FAIL.getCode());
} // }
} catch ( Exception e) { // } catch ( Exception e) {
e.printStackTrace(); // e.printStackTrace();
} // }
} else { } else {
throw new BaseException(ResCode.VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED.getDesc(), throw new BaseException(ResCode.VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED.getDesc(),
ResCode.VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED.getCode()); ResCode.VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED.getCode());
...@@ -289,19 +285,17 @@ public class VehicleActiveService { ...@@ -289,19 +285,17 @@ public class VehicleActiveService {
if(vehicleBookRecord != null) { if(vehicleBookRecord != null) {
DateTime startDate = new DateTime(vehicleBookRecord.getBookStartDate()); DateTime startDate = new DateTime(vehicleBookRecord.getBookStartDate());
DateTime endDate = new DateTime(vehicleBookRecord.getBookEndDate()); DateTime endDate = new DateTime(vehicleBookRecord.getBookEndDate());
if(!(startDate.minusDays(1).compareTo(DateTime.now()) <= 0 && DateTime.now().compareTo(endDate) <= 0 && vehicleBookRecord.getStatus() == VehicleBookRecordStatus.APPROVE.getCode())) {
Map<String, Object> param = new HashMap<>(); Map<String, Object> param = new HashMap<>();
param.put("vehicleId", vehicleBookRecord.getVehicleId()); param.put("vehicleId", vehicleBookRecord.getVehicleId());
param.put("time", vehicleBookRecord.getBookStartDate()); param.put("bookedEndDate", vehicleBookRecord.getBookStartDate());
List<VehicleBookRecord> list = vehicleBookRecordBiz.selectByVehicleIdAndTime(param); List<VehicleBookRecordVo> list = vehicleBookRecordBiz.selectByVehicleIdAndTime(param);
if(list != null && list.size() > 0) { 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(), throw new BaseException(ResCode.VEHICLE_DEPARTURE_DATE_IS_NOT_ABLED.getDesc(),
ResCode.VEHICLE_DEPARTURE_DATE_IS_NOT_ABLED.getCode()); ResCode.VEHICLE_DEPARTURE_DATE_IS_NOT_ABLED.getCode());
} }
} }
} }
} }
}
public void updateBookRecordStatus(VehicleBookRecord vehicleBookRecord, Integer type) { public void updateBookRecordStatus(VehicleBookRecord vehicleBookRecord, Integer type) {
...@@ -416,4 +410,12 @@ public class VehicleActiveService { ...@@ -416,4 +410,12 @@ public class VehicleActiveService {
} }
public static void main(String[] args) {
DateTime startDate = DateTime.parse("2019-08-21 17:00:00", DATE_TIME_FORMATTER);
DateTime endDate = DateTime.parse("2019-08-21 21:00:00", DATE_TIME_FORMATTER);
System.out.println();
System.out.println(!(DateTime.now().compareTo(endDate) <= 0) && (startDate.minusDays(1).compareTo(DateTime.now()) <= 0));
}
} }
...@@ -510,9 +510,11 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR ...@@ -510,9 +510,11 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
Integer andOperationFactor = andOpratorParam.get("andOperationFactor"); Integer andOperationFactor = andOpratorParam.get("andOperationFactor");
Integer andOperationRs = andOpratorParam.get("andOperationRs"); Integer andOperationRs = andOpratorParam.get("andOperationRs");
if(vehicleBookInfo != null && vehicleBookInfo.getBookedDate() != null && if(vehicleBookInfo != null && vehicleBookInfo.getBookedDate() != null &&
((vehicleBookInfo.getBookedDate() & andOperationFactor) != andOperationRs)){ ((vehicleBookInfo.getBookedDate() & andOperationFactor) != andOperationRs)){//已经被预定
//当天已经被预定检查小时是否也被预定 //当天已经被预定检查小时是否也被预定
return filterHourInfoBooked(vehicleId, hourInfo); return filterHourInfoBooked(vehicleId, hourInfo);
} else if ((vehicleBookInfo.getBookedDate() & andOperationFactor) == 0){//未被预定,查看时间是否被预定
return filterHourInfoBooked(vehicleId, hourInfo);
} }
return Boolean.TRUE; return Boolean.TRUE;
} }
...@@ -787,13 +789,13 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR ...@@ -787,13 +789,13 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
stringBuilder.append("保养"); stringBuilder.append("保养");
break; break;
} }
// List<VehicleBookRecordVo> vehicleBookRecordVos = vehicleBookRecordBiz.selectByVehicleId(vehicleId); List<VehicleBookRecordVo> vehicleBookRecordVos = vehicleBookRecordBiz.selectByVehicleId(vehicleId);
// if(vehicleBookRecordVos != null && vehicleBookRecordVos.size() > 0) { if(vehicleBookRecordVos != null && vehicleBookRecordVos.size() > 0) {
// stringBuilder.append("中,使用人:"); stringBuilder.append("中,使用人:");
// stringBuilder.append(vehicleBookRecordVos.get(0).getVehicleUsername()); stringBuilder.append(vehicleBookRecordVos.get(0).getVehicleUsername());
// stringBuilder.append(" 使用人电话:"); stringBuilder.append(" 使用人电话:");
// stringBuilder.append(vehicleBookRecordVos.get(0).getVehicleUserPhone()); stringBuilder.append(vehicleBookRecordVos.get(0).getVehicleUserPhone());
// } }
return stringBuilder.toString(); return stringBuilder.toString();
} }
...@@ -1158,8 +1160,10 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR ...@@ -1158,8 +1160,10 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
List<String> notBookedDates = Lists.newArrayList(); List<String> notBookedDates = Lists.newArrayList();
if(StringUtils.isNotBlank(dto.getStartDate())&& if(StringUtils.isNotBlank(dto.getStartDate())&&
StringUtils.isNotBlank(dto.getEndDate())) { StringUtils.isNotBlank(dto.getEndDate())) {
notBookedDates = convertDatePeriod2List(dto.getStartDate(), // notBookedDates = convertDatePeriod2List(dto.getStartDate(),
dto.getEndDate()); // dto.getEndDate());
notBookedDates = convertDatePeriod2List(dto.getStartDateExtend(),
dto.getEndDateExtend());
} }
//若传入预定信息查询条件,则查询对应月份预定信息查询条件(不超过3个月) //若传入预定信息查询条件,则查询对应月份预定信息查询条件(不超过3个月)
......
...@@ -71,7 +71,11 @@ public class VehicleBookHourInfoBiz extends BaseBiz<VehicleBookHourInfoMapper, V ...@@ -71,7 +71,11 @@ public class VehicleBookHourInfoBiz extends BaseBiz<VehicleBookHourInfoMapper, V
} }
} }
if(DateTime.parse(bookStartDate, DEFAULT_DATE_TIME_FORMATTER).toString(DATE_TIME_FORMATTER).equals(DateTime.parse(bookEndDate, DEFAULT_DATE_TIME_FORMATTER).toString(DATE_TIME_FORMATTER))) {//同一天预定 if(DateTime.parse(bookStartDate, DEFAULT_DATE_TIME_FORMATTER).toString(DATE_TIME_FORMATTER).equals(DateTime.parse(bookEndDate, DEFAULT_DATE_TIME_FORMATTER).toString(DATE_TIME_FORMATTER))) {//同一天预定
if(startPredictableHour == 0 || endPredictableHour == 0) {
predictableHours.put(DateTime.parse(bookStartDate, DEFAULT_DATE_TIME_FORMATTER).toString(DATE_TIME_FORMATTER), startPredictableHour | endPredictableHour);
} else {
predictableHours.put(DateTime.parse(bookStartDate, DEFAULT_DATE_TIME_FORMATTER).toString(DATE_TIME_FORMATTER), startPredictableHour & endPredictableHour); predictableHours.put(DateTime.parse(bookStartDate, DEFAULT_DATE_TIME_FORMATTER).toString(DATE_TIME_FORMATTER), startPredictableHour & endPredictableHour);
}
} else { } else {
predictableHours.put(DateTime.parse(bookStartDate, DEFAULT_DATE_TIME_FORMATTER).toString(DATE_TIME_FORMATTER), startPredictableHour); predictableHours.put(DateTime.parse(bookStartDate, DEFAULT_DATE_TIME_FORMATTER).toString(DATE_TIME_FORMATTER), startPredictableHour);
predictableHours.put(DateTime.parse(bookEndDate, DEFAULT_DATE_TIME_FORMATTER).toString(DATE_TIME_FORMATTER), endPredictableHour); predictableHours.put(DateTime.parse(bookEndDate, DEFAULT_DATE_TIME_FORMATTER).toString(DATE_TIME_FORMATTER), endPredictableHour);
...@@ -147,8 +151,8 @@ public class VehicleBookHourInfoBiz extends BaseBiz<VehicleBookHourInfoMapper, V ...@@ -147,8 +151,8 @@ public class VehicleBookHourInfoBiz extends BaseBiz<VehicleBookHourInfoMapper, V
} }
public static void main(String[] args) throws Exception{ public static void main(String[] args) throws Exception{
int b = 24;
Integer a = b & 4; Integer a = 7936 & 2047;
System.out.println(a); System.out.println(a);
} }
......
...@@ -87,8 +87,10 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic ...@@ -87,8 +87,10 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic
insertSelectiveRe(vehicleBookRecord); insertSelectiveRe(vehicleBookRecord);
} }
public List<VehicleBookRecord> selectByVehicleIdAndTime(Map<String, Object> param) { public List<VehicleBookRecordVo> selectByVehicleIdAndTime(Map<String, Object> param) {
return mapper.selectByVehicleIdAndTime(param); List<VehicleBookRecordVo> list = mapper.selectByVehicleIdAndTime(param);
removeStatus2(list);
return list;
} }
public int changeRecordStatus(Map<String, Object> updateParam) { public int changeRecordStatus(Map<String, Object> updateParam) {
...@@ -204,13 +206,14 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic ...@@ -204,13 +206,14 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic
} }
public void removeStatus2(List<VehicleBookRecordVo> list) { public void removeStatus2(List<VehicleBookRecordVo> list) {
if(list != null && list.size() > 0) {
Iterator<VehicleBookRecordVo> iterator = list.iterator(); Iterator<VehicleBookRecordVo> iterator = list.iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
if (iterator.next().getVehicleDepartureLogVo() != null) { if (iterator.next().getVehicleDepartureLogVo() != null) {
iterator.remove(); iterator.remove();
} }
} }
}
} }
/** /**
......
...@@ -36,5 +36,5 @@ public interface VehicleBookRecordMapper extends Mapper<VehicleBookRecord> { ...@@ -36,5 +36,5 @@ public interface VehicleBookRecordMapper extends Mapper<VehicleBookRecord> {
public List<VehicleBookRecordVo> getBookRecordInfo(Map<String, Object> param); public List<VehicleBookRecordVo> getBookRecordInfo(Map<String, Object> param);
public List<VehicleBookRecord> selectByVehicleIdAndTime(Map<String, Object> param); public List<VehicleBookRecordVo> selectByVehicleIdAndTime(Map<String, Object> param);
} }
\ No newline at end of file
...@@ -325,9 +325,9 @@ ...@@ -325,9 +325,9 @@
order by vbr.id desc order by vbr.id desc
</select> </select>
<select id="selectByVehicleIdAndTime" parameterType="java.util.Map" resultType="com.xxfc.platform.vehicle.entity.VehicleBookRecord"> <select id="selectByVehicleIdAndTime" parameterType="java.util.Map" resultMap="searchBookRecord">
select v1.* from vehicle_book_record v1 select v1.* from vehicle_book_record v1
where v1.vehicle_id = #{vehicleId} and v1.status BETWEEN 1 and 2 and v1.book_end_date >= #{time} where v1.vehicle_id = #{vehicleId} and v1.book_end_date &lt;= #{bookedEndDate} and v1.status BETWEEN 1 and 2
</select> </select>
<select id="getById" parameterType="java.util.Map" resultType="com.xxfc.platform.vehicle.entity.VehicleBookRecord"> <select id="getById" parameterType="java.util.Map" resultType="com.xxfc.platform.vehicle.entity.VehicleBookRecord">
......
...@@ -639,9 +639,9 @@ ...@@ -639,9 +639,9 @@
<!-- yearNo4Where 标识时间参数是否用于where条件 --> <!-- yearNo4Where 标识时间参数是否用于where条件 -->
<if test="startCompanyId != null and endCompanyId != null "> <if test="startCompanyId != null and endCompanyId != null ">
and ( and (
(abr.to_lift_company = null or abr.to_lift_company = #{startCompanyId}) (abr.to_lift_company is null or abr.to_lift_company = #{startCompanyId})
and and
(abr.to_return_company = null or abr.to_return_company = #{endCompanyId}) (abr.to_return_company is null or abr.to_return_company = #{endCompanyId})
) )
</if> </if>
<if test=" modelId != null "> <if test=" modelId != null ">
......
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