Commit 7955212e authored by hanfeng's avatar hanfeng

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

parents 63892349 29a10af7
...@@ -22,6 +22,7 @@ public class AppUserDetail { ...@@ -22,6 +22,7 @@ public class AppUserDetail {
private Integer isMember; private Integer isMember;
@Column(name = "wx_nickname") @Column(name = "wx_nickname")
private String wxNickname; private String wxNickname;
private String qqNickname;
private String nickname; private String nickname;
private String realname; private String realname;
private String headimgurl; private String headimgurl;
......
...@@ -59,11 +59,17 @@ public class UserCouponVo { ...@@ -59,11 +59,17 @@ public class UserCouponVo {
@ApiModelProperty(value = "开始时间", hidden = true ) @ApiModelProperty(value = "开始时间", hidden = true )
private Long startTime; private Long startTime;
/** /**
* 到期时间 * 到期时间
*/ */
@ApiModelProperty(value = "到期时间", hidden = true ) @ApiModelProperty(value = "到期时间", hidden = true )
private Long expireTime; private Long expireTime;
@ApiModelProperty(value = "到期时间字符串")
private String expireDate;
/** /**
* 使用时间 * 使用时间
......
...@@ -124,9 +124,12 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> { ...@@ -124,9 +124,12 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
if(type==1){ if(type==1){
startTime=coupon.getStartTime(); startTime=coupon.getStartTime();
expireTime=coupon.getValidEndTime(); expireTime=coupon.getValidEndTime();
}else { }else if (type==2){
startTime=expireTime; startTime=expireTime;
expireTime+=DAY*coupon.getValidDays(); expireTime+=DAY*coupon.getValidDays();
} else {
startTime=expireTime;
expireTime=-1L;
} }
String ticker_no=Snowflake.build()+""; String ticker_no=Snowflake.build()+"";
UserCoupon userCoupon=new UserCoupon(); UserCoupon userCoupon=new UserCoupon();
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<result property="crtTime" column="crt_time"/> <result property="crtTime" column="crt_time"/>
<result property="startTime" column="start_time"/> <result property="startTime" column="start_time"/>
<result property="expireTime" column="expire_time"/> <result property="expireTime" column="expire_time"/>
<result property="expireDate" column="expireDate"/>
<result property="useTime" column="use_time"/> <result property="useTime" column="use_time"/>
<result property="title" column="title"/> <result property="title" column="title"/>
<result property="subtitle" column="subtitle"/> <result property="subtitle" column="subtitle"/>
...@@ -32,20 +33,20 @@ ...@@ -32,20 +33,20 @@
<select id="getUserCouponsByType" resultMap="userCouponMap"> <select id="getUserCouponsByType" resultMap="userCouponMap">
SELECT SELECT
* *,IF(expire_time=-1,'永久有效',CONCAT('有效期至',FROM_UNIXTIME(expire_time/1000,'%Y-%m-%d'))) as expireDate
FROM FROM
user_coupon u user_coupon u
LEFT JOIN coupon c ON u.coupon_id = c.id LEFT JOIN coupon c ON u.coupon_id = c.id
WHERE WHERE
u.is_del = 0 and u.user_id=#{userId} u.is_del = 0 and u.user_id=#{userId}
<if test="type==0"> <if test="type==0">
and u.is_use=0 and u.expire_time >=#{time} and u.is_use=0 and (u.expire_time >=#{time} or u.expire_time=-1)
</if> </if>
<if test="type==1"> <if test="type==1">
and u.is_use=1 and u.is_use=1
</if> </if>
<if test="type==2"> <if test="type==2">
and u.is_use=0 and u.expire_time &lt;#{time} and u.is_use=0 and u.expire_time &lt;#{time} and u.expire_time!=-1
</if> </if>
<if test="channel!=null and channel!=''"> <if test="channel!=null and channel!=''">
and (c.channel=#{channel} or c.channel=0 ) and (c.channel=#{channel} or c.channel=0 )
......
...@@ -155,6 +155,9 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> { ...@@ -155,6 +155,9 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
if(null != orderViolateCoverAmount) { if(null != orderViolateCoverAmount) {
depositDeductAmount = orderViolateCoverAmount; depositDeductAmount = orderViolateCoverAmount;
} }
if (null != depositViolateCoverAmount) {
depositDeductAmount = depositViolateCoverAmount;
}
if(topAmount.compareTo(depositDeductAmount) > 0) { if(topAmount.compareTo(depositDeductAmount) > 0) {
totalDeductAmount = totalDeductAmount.add(depositDeductAmount); totalDeductAmount = totalDeductAmount.add(depositDeductAmount);
topAmount = topAmount.subtract(depositDeductAmount); topAmount = topAmount.subtract(depositDeductAmount);
...@@ -214,6 +217,23 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> { ...@@ -214,6 +217,23 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
orv.setOrderNo(baseOrder.getNo()); orv.setOrderNo(baseOrder.getNo());
orv.setRefundDesc(refundDesc+ refundAmount.toString()); orv.setRefundDesc(refundDesc+ refundAmount.toString());
orv.setRefundAmount(refundAmount.multiply(new BigDecimal("100")).intValue()); orv.setRefundAmount(refundAmount.multiply(new BigDecimal("100")).intValue());
// originalRefundAmount - refundAmount
Integer freeze2PayAmount = originalRefundAmount.subtract(refundAmount).multiply(new BigDecimal("100")).intValue();
if(AccountTypeEnum.OUT_PART_DEPOSIT.getCode().equals(refundType)) {
// freeze2PayAmount - 违章保证金
for(OrderAccountDeduction deduction : oad.getDeductions()) {
if(DeductionTypeEnum.VIOLATE_TRAFFIC_KEEP.getCode().equals(deduction.getType())) {
freeze2PayAmount -= deduction.getAmount().multiply(new BigDecimal("100")).intValue();
break;
}
}
}
orv.setFreeze2PayAmount(freeze2PayAmount);
orv.setFreeze2PayDesc("");
ObjectRestResponse<String> result = thirdFeign.refund(orv); ObjectRestResponse<String> result = thirdFeign.refund(orv);
refundTradeNo = result.getData(); refundTradeNo = result.getData();
if(null == refundTradeNo) { if(null == refundTradeNo) {
...@@ -398,9 +418,7 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> { ...@@ -398,9 +418,7 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
BigDecimal originalRefundAmount = oad.getOriginDepositAmount().add(oad.getOriginOrderAmount()); BigDecimal originalRefundAmount = oad.getOriginDepositAmount().add(oad.getOriginOrderAmount());
//crosstown.getRestDeposit().add(crosstown.getDeductionCost()).subtract(illegalReserve); //crosstown.getRestDeposit().add(crosstown.getDeductionCost()).subtract(illegalReserve);
String refundDesc = "退还押金:"+ refundAmont.toString()+ "(已扣除 违章预备金:"+ illegalReserve.toString(); String refundDesc = "退还车辆押金:"+ refundAmont.toString();
refundDesc += handleDedRefundDesc;
refundDesc += ")";
//还车扣除款 剩余的 钱,再减去违章预备金 //还车扣除款 剩余的 钱,再减去违章预备金
oad.getDeductions().add( oad.getDeductions().add(
......
...@@ -170,7 +170,7 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp ...@@ -170,7 +170,7 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
OrderRentVehicleDetail orderRentVehicleDetail = orderRentVehicleBiz.selectById(baseOrder.getDetailId()); OrderRentVehicleDetail orderRentVehicleDetail = orderRentVehicleBiz.selectById(baseOrder.getDetailId());
if (orderVehicleCrosstownDto.getType() == CrosstownTypeEnum.DEPARTURE.getCode()) { if (orderVehicleCrosstownDto.getType() == CrosstownTypeEnum.DEPARTURE.getCode()) {
boolean flag = getTodayTime(orderRentVehicleDetail.getStartTime()); boolean flag = getTodayTime(orderRentVehicleDetail.getStartTime(), orderRentVehicleDetail.getEndTime());
if (!flag) { if (!flag) {
return ObjectRestResponse.createFailedResult(3502, "已超过预定还车时间,不能进行交车操作!"); return ObjectRestResponse.createFailedResult(3502, "已超过预定还车时间,不能进行交车操作!");
} }
...@@ -438,9 +438,15 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp ...@@ -438,9 +438,15 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
return illegalReserve; return illegalReserve;
} }
public boolean getTodayTime(Long time) { /**
* 当前时间大于预定开始时间当天0点,小于结束时间当天时间24点 2019.11.04
* @param startTime
* @param endTime
* @return
*/
public boolean getTodayTime(Long startTime, Long endTime) {
long current = System.currentTimeMillis(); long current = System.currentTimeMillis();
if (current <= (getDayStart(time) + 24 * 60 * 60 * 1000 - 1) && current >= getDayStart(time)) { if (getDayStart(startTime) <= (current) && current <= getDayStart(endTime) + 1000 * 3600 * 24 - 1) {
return true; return true;
} }
return false; return false;
......
...@@ -3,8 +3,6 @@ package com.xxfc.platform.order.biz.inner; ...@@ -3,8 +3,6 @@ package com.xxfc.platform.order.biz.inner;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.github.wxiaoqi.security.admin.feign.UserFeign; import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO; import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
...@@ -32,7 +30,6 @@ import org.springframework.stereotype.Service; ...@@ -32,7 +30,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.HashMap; import java.util.HashMap;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
...@@ -199,6 +196,10 @@ public class OrderCancelBiz { ...@@ -199,6 +196,10 @@ public class OrderCancelBiz {
//违约金封顶 租车身份价 * 2天 //违约金封顶 租车身份价 * 2天
BigDecimal topAmount = orderItem.getUnitPrice().multiply(new BigDecimal(2+ "")); BigDecimal topAmount = orderItem.getUnitPrice().multiply(new BigDecimal(2+ ""));
//判断是否修改违约金
if(null != changeViolateAmount) {
oad.changeCancelViolate(changeViolateAmount);
}
//退款流程 //退款流程
orderAccountBiz.rentRefundProcessCancel(baseOrder, BigDecimal.ZERO, timeLag, APP_ORDER+ "_"+ RENT_REFUND, orvd.getDeposit(), orderItem.getBuyAmount(), oad, topAmount, null, changeViolateAmount); orderAccountBiz.rentRefundProcessCancel(baseOrder, BigDecimal.ZERO, timeLag, APP_ORDER+ "_"+ RENT_REFUND, orvd.getDeposit(), orderItem.getBuyAmount(), oad, topAmount, null, changeViolateAmount);
......
...@@ -110,7 +110,7 @@ public class RentDepositJobHandler extends IJobHandler { ...@@ -110,7 +110,7 @@ public class RentDepositJobHandler extends IJobHandler {
OrderAccountDetail oad = new OrderAccountDetail(); OrderAccountDetail oad = new OrderAccountDetail();
String refundDesc = "退还押金:"; String refundDesc = "退还违章押金:";
BigDecimal refundAmont; BigDecimal refundAmont;
if(null != orderViolation) { if(null != orderViolation) {
//设置扣款项 //设置扣款项
...@@ -120,8 +120,7 @@ public class RentDepositJobHandler extends IJobHandler { ...@@ -120,8 +120,7 @@ public class RentDepositJobHandler extends IJobHandler {
//还车扣除款 剩余的 钱,再减去违章预备金 //还车扣除款 剩余的 钱,再减去违章预备金
refundAmont = orvd.getReturnPayResidue().subtract(orderViolation.getPrice()); refundAmont = orvd.getReturnPayResidue().subtract(orderViolation.getPrice());
refundDesc += refundAmont.toString()+ "(已扣除 违章扣款:"+ refundAmont.toString(); refundDesc += refundAmont.toString();
refundDesc += ")";
}else { }else {
refundAmont = orvd.getReturnPayResidue(); refundAmont = orvd.getReturnPayResidue();
refundDesc += refundAmont.toString(); refundDesc += refundAmont.toString();
......
...@@ -74,7 +74,7 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe ...@@ -74,7 +74,7 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
@ResponseBody @ResponseBody
@IgnoreClientToken @IgnoreClientToken
public ObjectRestResponse<BigDecimal> getViolatePrice(@PathVariable(value = "no") String no) { public ObjectRestResponse<BigDecimal> getViolatePrice(@PathVariable(value = "no") String no) {
checkAppUser(); checkAdminUser();
OrderPageVO orderPageVO = baseOrderBiz.pageByParm(new Query(new PageParam(){{ OrderPageVO orderPageVO = baseOrderBiz.pageByParm(new Query(new PageParam(){{
setLimit(1); setLimit(1);
setPage(1); setPage(1);
......
package com.xxfc.platform.universal.entity; package com.xxfc.platform.universal.entity;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
/** /**
* 订单支付 * 订单支付
...@@ -44,7 +47,11 @@ public class OrderPay implements Serializable { ...@@ -44,7 +47,11 @@ public class OrderPay implements Serializable {
@Column(name = "pay_way") @Column(name = "pay_way")
@ApiModelProperty(value = "1:微信公众号支付 2.支付宝即时到账,3,银联") @ApiModelProperty(value = "1:微信公众号支付 2.支付宝即时到账,3,银联")
private Integer payWay; private Integer payWay;
@Column(name = "pay_type")
@ApiModelProperty(value = "1:支付宝APP支付,2:支付宝预授权支付")
private Integer payType;
//渠道:1-租车;2-旅游 //渠道:1-租车;2-旅游
@Column(name = "channel") @Column(name = "channel")
@ApiModelProperty(value = "渠道:1-租车;2-旅游") @ApiModelProperty(value = "渠道:1-租车;2-旅游")
......
...@@ -4,10 +4,6 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -4,10 +4,6 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
/** /**
...@@ -69,5 +65,11 @@ public class OrderPayVo{ ...@@ -69,5 +65,11 @@ public class OrderPayVo{
private String tradeNo; private String tradeNo;
//支付接口返回的流水号
@Column(name = "serial_number")
@ApiModelProperty(value = "支付接口返回的流水号")
private String serialNumber;
@ApiModelProperty(value = "1:支付宝APP支付,2:支付宝预授权支付")
private Integer payType;
} }
...@@ -8,6 +8,7 @@ import javax.persistence.GeneratedValue; ...@@ -8,6 +8,7 @@ import javax.persistence.GeneratedValue;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Table; import javax.persistence.Table;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
/** /**
...@@ -37,5 +38,12 @@ public class OrderRefundVo{ ...@@ -37,5 +38,12 @@ public class OrderRefundVo{
@ApiModelProperty(value = "退款描述") @ApiModelProperty(value = "退款描述")
private String refundDesc; private String refundDesc;
//冻结转支付描述 只用于预支付相关
@ApiModelProperty(value = "冻结转支付描述")
private String freeze2PayDesc;
//冻结转支付金额 只用于预支付相关
@ApiModelProperty(value = "冻结转支付金额")
private Integer freeze2PayAmount;
} }
...@@ -5,7 +5,6 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz; ...@@ -5,7 +5,6 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
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.process.SystemConfig; import com.github.wxiaoqi.security.common.util.process.SystemConfig;
import com.github.wxiaoqi.security.common.util.result.JsonResultUtil; import com.github.wxiaoqi.security.common.util.result.JsonResultUtil;
import com.xxfc.platform.universal.entity.Dictionary;
import com.xxfc.platform.universal.entity.OrderPay; import com.xxfc.platform.universal.entity.OrderPay;
import com.xxfc.platform.universal.entity.OrderRefund; import com.xxfc.platform.universal.entity.OrderRefund;
import com.xxfc.platform.universal.mapper.OrderRefundMapper; import com.xxfc.platform.universal.mapper.OrderRefundMapper;
...@@ -21,10 +20,6 @@ import org.springframework.stereotype.Service; ...@@ -21,10 +20,6 @@ import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example; import tk.mybatis.mapper.entity.Example;
import java.util.List; import java.util.List;
import java.util.Map;
import static com.xxfc.platform.universal.constant.DictionaryKey.PAY_DEMOTION;
import static com.xxfc.platform.universal.constant.DictionaryKey.UNIVERSAL_PAY;
/** /**
* 订单支付退款表 * 订单支付退款表
...@@ -59,17 +54,17 @@ public class OrderRefundBiz extends BaseBiz<OrderRefundMapper, OrderRefund> { ...@@ -59,17 +54,17 @@ public class OrderRefundBiz extends BaseBiz<OrderRefundMapper, OrderRefund> {
Integer refundAmount = orderRefundVo.getRefundAmount(); Integer refundAmount = orderRefundVo.getRefundAmount();
//临时处理 //临时处理
Map<String, Dictionary> dictionaryMap = dictionaryBiz.getAll4Map(); // Map<String, Dictionary> dictionaryMap = dictionaryBiz.getAll4Map();
Integer demotion = Integer.valueOf(dictionaryMap.get(UNIVERSAL_PAY + "_" + PAY_DEMOTION).getDetail()); // Integer demotion = Integer.valueOf(dictionaryMap.get(UNIVERSAL_PAY + "_" + PAY_DEMOTION).getDetail());
payAmount = payAmount / demotion; // payAmount = payAmount / demotion;
if (payAmount <= 0) { // if (payAmount <= 0) {
payAmount = 1; // payAmount = 1;
} // }
//
refundAmount = refundAmount / demotion; // refundAmount = refundAmount / demotion;
if (refundAmount <= 0) { // if (refundAmount <= 0) {
refundAmount = 1; // refundAmount = 1;
} // }
String refundDesc = StringUtils.isNotBlank(orderRefundVo.getRefundDesc()) ? orderRefundVo.getRefundDesc() : "审核通过,退款"; String refundDesc = StringUtils.isNotBlank(orderRefundVo.getRefundDesc()) ? orderRefundVo.getRefundDesc() : "审核通过,退款";
String out_refund_no = Snowflake.build() + ""; String out_refund_no = Snowflake.build() + "";
...@@ -89,9 +84,19 @@ public class OrderRefundBiz extends BaseBiz<OrderRefundMapper, OrderRefund> { ...@@ -89,9 +84,19 @@ public class OrderRefundBiz extends BaseBiz<OrderRefundMapper, OrderRefund> {
OrderPay orderPay = list.get(0); OrderPay orderPay = list.get(0);
String out_trade_no = orderPay.getTradeNo(); String out_trade_no = orderPay.getTradeNo();
boolean flag = false; boolean flag = false;
if (orderPay.getPayWay() == 2) { if (orderPay.getPayWay() == 2 && orderPay.getPayType() == 1) {
log.info("======支付宝退款中==========="); log.info("======支付宝APP支付退款中===========");
flag = payBiz.alipayOrderRefund(out_trade_no, orderPay.getSerialNumber(), refundAmount, refundDesc, out_trade_no + System.currentTimeMillis()); flag = payBiz.alipayOrderRefund(out_trade_no, orderPay.getSerialNumber(), refundAmount, refundDesc, out_trade_no + System.currentTimeMillis());
} else if (orderPay.getPayWay() == 2 && orderPay.getPayType() == 2) {
log.info("======支付宝预授权支付退款中===========");
//需要根据实际传过来的参数类型来进行解冻或者预授权转支付
if (orderRefundVo.getRefundAmount() != 0) { //解冻金额
flag = payBiz.fundAuthOrderUnFreeze(orderPay.getTradeNo() + System.currentTimeMillis(), orderPay.getSerialNumber(), orderRefundVo.getRefundAmount(), orderRefundVo.getRefundDesc());
}
//预授权转支付
if(orderRefundVo.getFreeze2PayAmount() != 0) {
flag = payBiz.tradePay(orderPay.getTradeNo() + System.currentTimeMillis(), orderPay.getSerialNumber(), orderRefundVo.getFreeze2PayAmount(), orderRefundVo.getFreeze2PayDesc(), orderRefundVo.getFreeze2PayDesc());
}
} else if(orderPay.getPayWay() == 1){ } else if(orderPay.getPayWay() == 1){
log.info("======微信退款中==========="); log.info("======微信退款中===========");
flag = WxPayRefundUtils.refund(appid, mchId, partnerKey, out_trade_no, out_refund_no, payAmount + "", flag = WxPayRefundUtils.refund(appid, mchId, partnerKey, out_trade_no, out_refund_no, payAmount + "",
......
...@@ -27,22 +27,16 @@ import java.util.Map; ...@@ -27,22 +27,16 @@ import java.util.Map;
@Slf4j @Slf4j
public class XCFQPictureParsingImpl implements UserPictureParsing { public class XCFQPictureParsingImpl implements UserPictureParsing {
private String appcode = "acea1c8811f748b3a65815f11db357c4"; // private String appcode = "acea1c8811f748b3a65815f11db357c4";
private String appcode2 = "ee7710ce92054cae9f6c040f6864e6a7"; private String appcode2 = "ee7710ce92054cae9f6c040f6864e6a7";
/** /**
* 认证相关的数据 * 认证相关的数据
*/ */
private String host = "https://ocridcard.market.alicloudapi.com"; private String host = "https://ocridcards.market.alicloudapi.com";
private String path = "/idimages";
private String path = "/idcard";
private String methd = "POST";
private String imageRet = "code"; private String method = "POST";
private String resultCode = "1";
private String dataNam = "result"; private String dataNam = "result";
...@@ -81,18 +75,32 @@ public class XCFQPictureParsingImpl implements UserPictureParsing { ...@@ -81,18 +75,32 @@ public class XCFQPictureParsingImpl implements UserPictureParsing {
} }
private Map<String,String> judgeAccordingToAnalyticalData(String imageUrl, String type) { private Map<String,String> judgeAccordingToAnalyticalData(String imageUrl, String type) {
String json = imageParse(imageUrl, type); String json = imageParse(imageUrl);
log.info("json:" + json); log.info("json:" + json);
if (StringUtils.isBlank(json)) { if (StringUtils.isBlank(json)) {
return null; return null;
} }
Map reuslt = (Map) JSONObject.parse(json); Map reuslt = (Map) JSONObject.parse(json);
//判断是否调用图片解析的接口是否异常,若果两个次认证都没结果 //判断是否调用图片解析的接口是否异常,若果两个次认证都没结果
if (MapUtil.isEmpty(reuslt) if ("front".equals(type)) {
|| !(reuslt.get(imageRet).equals(resultCode)) if (MapUtil.isEmpty(reuslt)
) { || !(reuslt.get("code").equals("1"))
return null; ) {
return null;
}
}
if ("back".equals(type)) {
if (MapUtil.isEmpty(reuslt)
|| !(reuslt.get("code").equals("2"))
) {
return null;
}
} }
Map<String,String> map = (Map) reuslt.get(dataNam); Map<String,String> map = (Map) reuslt.get(dataNam);
log.info("map:" + map); log.info("map:" + map);
if (MapUtils.isNotEmpty(map)) { if (MapUtils.isNotEmpty(map)) {
...@@ -103,14 +111,12 @@ public class XCFQPictureParsingImpl implements UserPictureParsing { ...@@ -103,14 +111,12 @@ public class XCFQPictureParsingImpl implements UserPictureParsing {
//身份证照片解析 //身份证照片解析
private String imageParse(String imageUrl, String type) { private String imageParse(String imageUrl) {
Map<String, String> headers = new HashMap<String, String>(); Map<String, String> headers = new HashMap<String, String>();
headers.put("Authorization", "APPCODE " + appcode2); headers.put("Authorization", "APPCODE " + appcode2);
Map<String, String> querys = new HashMap<String, String>(); Map<String, String> querys = new HashMap<String, String>();
Map<String, String> bodys = new HashMap<String, String>(); Map<String, String> bodys = new HashMap<String, String>();
bodys.put("image", imageUrl); bodys.put("image", imageUrl);
//默认正面front,背面请传back
bodys.put("idCardSide", type);
try { try {
return callExternalRequest(headers,querys,bodys,1); return callExternalRequest(headers,querys,bodys,1);
} catch (Exception e) { } catch (Exception e) {
...@@ -125,7 +131,7 @@ public class XCFQPictureParsingImpl implements UserPictureParsing { ...@@ -125,7 +131,7 @@ public class XCFQPictureParsingImpl implements UserPictureParsing {
Map<String, String> bodys, Map<String, String> bodys,
int type) throws Exception { int type) throws Exception {
HttpResponse response = CertifHttpUtils.doPost(host, path, methd, headers, querys, bodys); HttpResponse response = CertifHttpUtils.doPost(host, path, method, headers, querys, bodys);
log.info("response:"+response); log.info("response:"+response);
StatusLine statusLine = response.getStatusLine(); StatusLine statusLine = response.getStatusLine();
int statusCode = statusLine.getStatusCode(); int statusCode = statusLine.getStatusCode();
...@@ -140,13 +146,7 @@ public class XCFQPictureParsingImpl implements UserPictureParsing { ...@@ -140,13 +146,7 @@ public class XCFQPictureParsingImpl implements UserPictureParsing {
} }
if (403==statusCode){ if (403==statusCode){
if (type==2){
log.error("验证次数已用完"); log.error("验证次数已用完");
return null;
}
Map<String, String> headers2 = new HashMap<String, String>();
headers.put("Authorization", "APPCODE " + appcode);
return callExternalRequest(headers2,querys,bodys,2);
} }
return null; return null;
......
...@@ -28,9 +28,8 @@ import java.util.Map; ...@@ -28,9 +28,8 @@ import java.util.Map;
@Primary @Primary
public class XCFQAuthentication implements UserAuthentication { public class XCFQAuthentication implements UserAuthentication {
private String appcode="acea1c8811f748b3a65815f11db357c4"; // private String appcode="acea1c8811f748b3a65815f11db357c4";
private String appcode2="ee7710ce92054cae9f6c040f6864e6a7"; private String appcode2 = "ee7710ce92054cae9f6c040f6864e6a7";
/** /**
* 认证相关的数据 * 认证相关的数据
...@@ -39,7 +38,7 @@ public class XCFQAuthentication implements UserAuthentication { ...@@ -39,7 +38,7 @@ public class XCFQAuthentication implements UserAuthentication {
private String path = "/idcard"; private String path = "/idcard";
private String methd = "GET"; private String method = "GET";
//响应:认证错误码字段名 //响应:认证错误码字段名
private String certifRet = "status"; private String certifRet = "status";
...@@ -59,7 +58,7 @@ public class XCFQAuthentication implements UserAuthentication { ...@@ -59,7 +58,7 @@ public class XCFQAuthentication implements UserAuthentication {
Map<String, String> headers = new HashMap<String, String>(); Map<String, String> headers = new HashMap<String, String>();
headers.put("Authorization", "APPCODE " + appcode2); headers.put("Authorization", "APPCODE " + appcode2);
try { try {
callExternalRequest(message,headers,1); return callExternalRequest(message, headers, 1);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -67,19 +66,19 @@ public class XCFQAuthentication implements UserAuthentication { ...@@ -67,19 +66,19 @@ public class XCFQAuthentication implements UserAuthentication {
} }
private boolean callExternalRequest(UserMessage message, Map<String, String> headers,int type) throws Exception { private boolean callExternalRequest(UserMessage message, Map<String, String> headers, int type) throws Exception {
//map携带身份证和姓名进行认证 //map携带身份证和姓名进行认证
Map<String, String> querys = new HashMap<>(); Map<String, String> querys = new HashMap<>();
querys.put(idCardName, message.getIdNumber()); querys.put(idCardName, message.getIdNumber());
querys.put(cName, message.getName()); querys.put(cName, message.getName());
log.info("----querys=========" + querys); log.info("----querys=========" + querys);
HttpResponse response = HttpUtils.doGet(hsot, path, methd, headers, querys); HttpResponse response = HttpUtils.doGet(hsot, path, method, headers, querys);
StatusLine statusLine = response.getStatusLine(); StatusLine statusLine = response.getStatusLine();
int statusCode = statusLine.getStatusCode(); int statusCode = statusLine.getStatusCode();
/** /**
* 状态码: 200 正常;400 URL无效;401 appCode错误; 403 次数用完; 500 API网管错误 * 状态码: 200 正常;400 URL无效;401 appCode错误; 403 次数用完; 500 API网管错误
*/ */
log.info("外部接口响应状态码:"+statusCode); log.info("外部接口响应状态码:" + statusCode);
//获取response的body //获取response的body
if (statusCode == 200) { if (statusCode == 200) {
...@@ -87,22 +86,17 @@ public class XCFQAuthentication implements UserAuthentication { ...@@ -87,22 +86,17 @@ public class XCFQAuthentication implements UserAuthentication {
log.info("----认证结果result=========" + result); log.info("----认证结果result=========" + result);
//认证返回的参数是否为空 //认证返回的参数是否为空
if (!StringUtils.isBlank(result)) { if (!StringUtils.isBlank(result)) {
Map<String, Object> map = (Map<String, Object>) JSONObject.parse(result); Map<String,String> map = (Map<String, String>) JSONObject.parse(result);
log.info("----响应数据=========" + map); log.info("----响应数据=========" + map);
if (MapUtil.isNotEmpty(map) || certifResultCode.equals(map.get(certifRet))) { if (MapUtil.isNotEmpty(map) && certifResultCode.equals(map.get("status"))) {
log.info("认证成功");
return true; return true;
} }
} }
} }
if (403==statusCode){ if (403 == statusCode) {
if (type==2){ log.error("验证次数已用完");
log.error("验证次数已用完");
return false;
}
Map<String, String> headers2 = new HashMap<String, String>();
headers.put("Authorization", "APPCODE " + appcode);
return callExternalRequest(message,headers2,2);
} }
return false; return false;
......
...@@ -64,11 +64,17 @@ public class Vehicle { ...@@ -64,11 +64,17 @@ public class Vehicle {
*/ */
private Integer insuranceCompany; private Integer insuranceCompany;
private Integer strongInsuranceCompany;
/** /**
* 保险单号 * 保险单号
*/ */
private String insuranceNo; private String insuranceNo;
/**
* 强险单号
*/
private String strongInsuranceNo;
/** /**
* 保险开始时间 * 保险开始时间
...@@ -80,6 +86,11 @@ public class Vehicle { ...@@ -80,6 +86,11 @@ public class Vehicle {
*/ */
private Date insuranceEndDate; private Date insuranceEndDate;
/**
* 强险的结束时间
*/
private Date strongInsuranceEndDate;
/** /**
* 年审时间 * 年审时间
*/ */
......
...@@ -176,6 +176,4 @@ public interface VehicleFeign { ...@@ -176,6 +176,4 @@ public interface VehicleFeign {
@GetMapping(value = "/bookRecord/get") @GetMapping(value = "/bookRecord/get")
public ObjectRestResponse<List<BookRecordUpdateLog>> get(@RequestParam(value = "bookRecordId")Long bookRecordId); public ObjectRestResponse<List<BookRecordUpdateLog>> get(@RequestParam(value = "bookRecordId")Long bookRecordId);
@RequestMapping(value ="/branchCompany/app/unauth/getCompanyIds",method = RequestMethod.GET)
RestResponse<List<Integer>> getCompanyIds();
} }
...@@ -68,12 +68,14 @@ public class AddOrUpdateVehicleVo { ...@@ -68,12 +68,14 @@ public class AddOrUpdateVehicleVo {
* 保险公司,见常量表 * 保险公司,见常量表
*/ */
private Integer insuranceCompany; private Integer insuranceCompany;
private Integer strongInsuranceCompany;
/** /**
* 保险单号 * 保险单号
*/ */
private String insuranceNo; private String insuranceNo;
private String strongInsuranceNo;
/** /**
* 保险开始时间 * 保险开始时间
...@@ -84,6 +86,7 @@ public class AddOrUpdateVehicleVo { ...@@ -84,6 +86,7 @@ public class AddOrUpdateVehicleVo {
* 保险结束时间 * 保险结束时间
*/ */
private Date insuranceEndDate; private Date insuranceEndDate;
private Date strongInsuranceEndDate;
/** /**
* 年审时间 * 年审时间
......
...@@ -138,4 +138,6 @@ public class VehiclePageQueryVo { ...@@ -138,4 +138,6 @@ public class VehiclePageQueryVo {
*/ */
private Integer modelId; private Integer modelId;
} }
...@@ -85,8 +85,12 @@ public class VehicleActiveService { ...@@ -85,8 +85,12 @@ public class VehicleActiveService {
// 写入车辆公里数,预计目的地 // 写入车辆公里数,预计目的地
vehicle.setMileageLastUpdate(MileageLift1); vehicle.setMileageLastUpdate(MileageLift1);
// 修改车辆状态,确认是空闲状态 // 修改车辆状态,确认是空闲状态
int result = vehicleMapper.updateStatusByIdAndStatus(departureVo.getVehicleId(), VehicleStatus.DEPARTURE.getCode(), if (vehicle.getStatus().equals(VehicleStatus.NORMAL.getCode())) {
VehicleStatus.NORMAL.getCode()); vehicle.setStatus(VehicleStatus.DEPARTURE.getCode());
}
vehicleMapper.updateByPrimaryKeySelective(vehicle);
//修改预约记录状态 //修改预约记录状态
VehicleBookRecord vehicleBookRecord = null; VehicleBookRecord vehicleBookRecord = null;
...@@ -211,7 +215,6 @@ public class VehicleActiveService { ...@@ -211,7 +215,6 @@ public class VehicleActiveService {
} }
// 写入车辆公里数,还车分公司id // 写入车辆公里数,还车分公司id
vehicle.setMileageLastUpdate(MileageRest1); vehicle.setMileageLastUpdate(MileageRest1);
vehicleMapper.updateByPrimaryKeySelective(vehicle);
// 出车记录 // 出车记录
VehicleDepartureLogVo departureLogVo = vehicleDepartureLogMapper.selectByBookRecordId(arrivalVo.getBookRecordId()); VehicleDepartureLogVo departureLogVo = vehicleDepartureLogMapper.selectByBookRecordId(arrivalVo.getBookRecordId());
...@@ -230,13 +233,13 @@ public class VehicleActiveService { ...@@ -230,13 +233,13 @@ public class VehicleActiveService {
} }
} }
if (flag) { //如果此条记录后面还有未收车记录,就不修改车辆状态 if (flag) { //如果此条记录后面还有未收车记录,就不修改车辆状态
int result = vehicleMapper.updateStatus(arrivalVo.getVehicleId(), VehicleStatus.NORMAL.getCode()); vehicle.setStatus(VehicleStatus.NORMAL.getCode());
// if (result == 0) { // if (result == 0) {
// throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getDesc(), // throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getDesc(),
// ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getCode()); // ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getCode());
// } // }
} }
vehicleMapper.updateByPrimaryKeySelective(vehicle);
DateTime arrivalDate = new DateTime(vehicleBookRecord.getBookEndDate()); DateTime arrivalDate = new DateTime(vehicleBookRecord.getBookEndDate());
DateTime actualArrivalDate = new DateTime(new Date()); DateTime actualArrivalDate = new DateTime(new Date());
//提前还车处理 //提前还车处理
......
...@@ -1173,7 +1173,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR ...@@ -1173,7 +1173,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
public PageDataVO<UsableVehicleModelVO> searchUsableModel(UsableVeicleDTO dto) { public PageDataVO<UsableVehicleModelVO> searchUsableModel(UsableVeicleDTO dto) {
Map<String, Object> params = BeanUtil.beanToMap(dto); Map<String, Object> params = BeanUtil.beanToMap(dto);
if (StrUtil.isNotBlank(dto.getStartDate()) && StrUtil.isNotBlank(dto.getEndDate())) { if (StrUtil.isNotBlank(dto.getStartDate()) && StrUtil.isNotBlank(dto.getEndDate())) {
initBookSearchParam(dto, params, Boolean.TRUE); initBookSearchParam(dto, params, Boolean.FALSE);
} }
return PageDataVO.pageInfo(dto.getPage(), dto.getLimit(), () -> mapper.searchUsableModel(params)); return PageDataVO.pageInfo(dto.getPage(), dto.getLimit(), () -> mapper.searchUsableModel(params));
} }
...@@ -1233,10 +1233,10 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR ...@@ -1233,10 +1233,10 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
List<String> notBookedDates = Lists.newArrayList(); List<String> notBookedDates = Lists.newArrayList();
if (StringUtils.isNotBlank(dto.getBookEndDate()) && if (StringUtils.isNotBlank(dto.getBookEndDate()) &&
StringUtils.isNotBlank(dto.getBookEndDate())) { StringUtils.isNotBlank(dto.getBookEndDate())) {
// notBookedDates = convertDatePeriod2List(dto.getBookStartDate(), notBookedDates = convertDatePeriod2List(dto.getBookStartDate(),
// dto.getBookEndDate()); dto.getBookEndDate());
notBookedDates = convertDatePeriod2List(dto.getStartDateExtend(), // notBookedDates = convertDatePeriod2List(dto.getStartDateExtend(),
dto.getEndDateExtend()); // dto.getEndDateExtend());
} }
//若传入预定信息查询条件,则查询对应月份预定信息查询条件(不超过3个月) //若传入预定信息查询条件,则查询对应月份预定信息查询条件(不超过3个月)
......
...@@ -83,6 +83,9 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic ...@@ -83,6 +83,9 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic
@Autowired @Autowired
VehicleActiveService vehicleActiveService; VehicleActiveService vehicleActiveService;
@Autowired
VehicleBiz vehicleBiz;
@Override @Override
public UserFeign getUserFeign() { public UserFeign getUserFeign() {
return userFeign; return userFeign;
...@@ -248,10 +251,15 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic ...@@ -248,10 +251,15 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic
if(vehicleBookRecord != null) { if(vehicleBookRecord != null) {
vehicleBookRecord.setRetCompany(bookRecordUpdateLog.getNewRetCompanyId()); vehicleBookRecord.setRetCompany(bookRecordUpdateLog.getNewRetCompanyId());
int a = updateSelectiveByIdRe(vehicleBookRecord); int a = updateSelectiveByIdRe(vehicleBookRecord);
log.info(vehicleBookRecord.toString()); log.info("修改停靠分公司后预定记录: {}" + vehicleBookRecord.toString());
if(a <= 0) { if(a <= 0) {
return ObjectRestResponse.createDefaultFail(); return ObjectRestResponse.createDefaultFail();
} }
Vehicle vehicle = vehicleBiz.selectById(vehicleBookRecord.getVehicleId());
if (vehicle != null) {
vehicle.setParkBranchCompanyId(vehicleBookRecord.getRetCompany());
vehicleBiz.updateSelectiveByIdRe(vehicle);
}
return bookRecordUpdateLogBiz.save(bookRecordUpdateLog); return bookRecordUpdateLogBiz.save(bookRecordUpdateLog);
} else { } else {
return ObjectRestResponse.createFailedResult(ResCode.VEHICLE_BOOK_RECORD_IS_NOT_EXIST.getCode(), ResCode.VEHICLE_BOOK_RECORD_IS_NOT_EXIST.getDesc()); return ObjectRestResponse.createFailedResult(ResCode.VEHICLE_BOOK_RECORD_IS_NOT_EXIST.getCode(), ResCode.VEHICLE_BOOK_RECORD_IS_NOT_EXIST.getDesc());
......
...@@ -335,6 +335,11 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use ...@@ -335,6 +335,11 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
bookRecordUpdateLog.setOperaterId(userDTO.getId()); bookRecordUpdateLog.setOperaterId(userDTO.getId());
bookRecordUpdateLog.setOperaterName(userDTO.getName()); bookRecordUpdateLog.setOperaterName(userDTO.getName());
bookRecordUpdateLog.setCreateTime(new Date()); bookRecordUpdateLog.setCreateTime(new Date());
Vehicle vehicle = vehicleBiz.selectById(oldValue.getVehicleId());
if (vehicle != null) {
vehicle.setParkBranchCompanyId(oldValue.getRetCompany());
vehicleBiz.updateSelectiveByIdRe(vehicle);
}
vehicleBookRecordBiz.updateSelectiveByIdRe(vehicleBookRecord); vehicleBookRecordBiz.updateSelectiveByIdRe(vehicleBookRecord);
return bookRecordUpdateLogBiz.save(bookRecordUpdateLog); return bookRecordUpdateLogBiz.save(bookRecordUpdateLog);
} else { } else {
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
from branch_company from branch_company
<where> <where>
<if test="addrCity != null"> <if test="addrCity != null">
and addr_city = #{addrCity} and (addr_city = #{addrCity} or addr_province = #{addrCity} or addr_town = #{addrCity})
</if> </if>
<if test="lon != null and lat != null"> <if test="lon != null and lat != null">
and longitude is not null and latitude is not null and longitude is not null and latitude is not null
......
...@@ -487,7 +487,7 @@ ...@@ -487,7 +487,7 @@
and (v3.number_plate like concat('%', #{keywords}, '%') or v3.code like concat('%', #{keywords}, '%')) and (v3.number_plate like concat('%', #{keywords}, '%') or v3.code like concat('%', #{keywords}, '%'))
</if> </if>
<if test="zoneId != null"> <if test="zoneId != null">
and bc3.zone_id = #{zoneId} and bc1.zone_id = #{zoneId}
</if> </if>
<if test="companyIds != null and companyIds.size > 0"> <if test="companyIds != null and companyIds.size > 0">
and (v1.lift_company in and (v1.lift_company in
......
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
and v.belong_to_name like concat('%',#{belongToName},'%') and v.belong_to_name like concat('%',#{belongToName},'%')
</if> </if>
<if test="vin !=null and vin != ''"> <if test="vin !=null and vin != ''">
and v.vin = #{vin} and v.vin like CONCAT('%',#{vin},'%')
</if> </if>
<!-- <if test="subordinateBranch !=null">--> <!-- <if test="subordinateBranch !=null">-->
<!-- and v.subordinate_branch = #{subordinateBranch}--> <!-- and v.subordinate_branch = #{subordinateBranch}-->
...@@ -173,6 +173,7 @@ ...@@ -173,6 +173,7 @@
and bc.zone_id=#{zoneId} and bc.zone_id=#{zoneId}
</if> </if>
</if> </if>
order by v.code
) r ORDER BY r.parkBranchCompanyName ) r ORDER BY r.parkBranchCompanyName
</select> </select>
...@@ -232,29 +233,30 @@ ...@@ -232,29 +233,30 @@
LEFT JOIN vehicle_book_record v2 on v2.id = (select id from vehicle_book_record where vehicle_id = v.id order by update_time DESC LIMIT 1) LEFT JOIN vehicle_book_record v2 on v2.id = (select id from vehicle_book_record where vehicle_id = v.id order by update_time DESC LIMIT 1)
LEFT JOIN vehicle_departure_log v3 on v2.id = v3.book_record_id LEFT JOIN vehicle_departure_log v3 on v2.id = v3.book_record_id
LEFT JOIN vehicle_model vm ON v.model_id = vm.id LEFT JOIN vehicle_model vm ON v.model_id = vm.id
LEFT JOIN (select * from constant where type = 2) c ON v.use_type = c.code
where where
v.is_del=0 v.is_del=0
<if test="companyList != null"> <if test="companyList != null">
and ( v.park_branch_company_id in ( and ( v.park_branch_company_id in (
<trim suffixOverrides=","> <trim suffixOverrides=",">
<foreach collection="companyList" item="companyId"> <foreach collection="companyList" item="companyId">
#{companyId}, #{companyId},
</foreach> </foreach>
</trim> </trim>
) )
<!--or v.expect_destination_branch_company_id in ( <!--or v.expect_destination_branch_company_id in (
<trim suffixOverrides=","> <trim suffixOverrides=",">
<foreach collection="companyList" item="companyId"> <foreach collection="companyList" item="companyId">
#{companyId}, #{companyId},
</foreach> </foreach>
</trim> </trim>
)--> )-->
<!-- or v.subordinate_branch in (--> <!-- or v.subordinate_branch in (-->
<!-- <trim suffixOverrides=",">--> <!-- <trim suffixOverrides=",">-->
<!-- <foreach collection="companyList" item="companyId">--> <!-- <foreach collection="companyList" item="companyId">-->
<!-- #{companyId},--> <!-- #{companyId},-->
<!-- </foreach>--> <!-- </foreach>-->
<!-- </trim>--> <!-- </trim>-->
) )
</if> </if>
<if test="mRangeDateEnd !=null"> <if test="mRangeDateEnd !=null">
...@@ -281,27 +283,21 @@ ...@@ -281,27 +283,21 @@
<if test="insuranceCompany !=null"> <if test="insuranceCompany !=null">
and v.insurance_company = #{insuranceCompany} and v.insurance_company = #{insuranceCompany}
</if> </if>
<if test="belongToName !=null and belongToName != ''"> <if test="belongToName !=null">
and v.belong_to_name like concat('%',#{belongToName},'%') and v.belong_to_name = #{belongToName}
</if> </if>
<if test="vin !=null and vin != ''"> <if test="vin !=null and vin != ''">
and v.vin = #{vin} and v.vin = #{vin}
</if> </if>
<!-- <if test="subordinateBranch !=null">--> <!-- <if test="subordinateBranch !=null">-->
<!-- and v.subordinate_branch = #{subordinateBranch}--> <!-- and v.subordinate_branch = #{subordinateBranch}-->
<!-- </if>--> <!-- </if>-->
<if test="code !=null"> <if test="code !=null">
and v.code = #{code} and v.code = #{code}
</if> </if>
<if test="status !=null and status != 6 and status != 7"> <if test="status !=null">
and v.status = #{status} and v.status = #{status}
</if> </if>
<if test="status !=null and status == 6">
and v3.id is not NULL and v2.book_type = 3 and v3.state = 0
</if>
<if test="status !=null and status == 7">
and v3.id is not NULL and v2.book_type = 6 and v3.state = 0
</if>
<if test="numberPlate !=null and numberPlate != ''"> <if test="numberPlate !=null and numberPlate != ''">
and v.number_plate like concat('%',#{numberPlate},'%') and v.number_plate like concat('%',#{numberPlate},'%')
</if> </if>
...@@ -339,6 +335,7 @@ ...@@ -339,6 +335,7 @@
and bc.zone_id=#{zoneId} and bc.zone_id=#{zoneId}
</if> </if>
</if> </if>
order by v.code
) r ORDER BY r.parkBranchCompanyName ) r ORDER BY r.parkBranchCompanyName
</select> </select>
...@@ -526,11 +523,11 @@ ...@@ -526,11 +523,11 @@
<if test="insuranceCompany !=null"> <if test="insuranceCompany !=null">
and v.insurance_company = #{insuranceCompany} and v.insurance_company = #{insuranceCompany}
</if> </if>
<if test="belongToName !=null"> <if test="belongToName !=null and belongToName != ''">
and v.belong_to_name = #{belongToName} and v.belong_to_name like concat('%',#{belongToName},'%')
</if> </if>
<if test="vin !=null and vin != ''"> <if test="vin !=null and vin != ''">
and v.vin = #{vin} and v.vin like CONCAT('%',#{vin},'%')
</if> </if>
<!-- <if test="subordinateBranch !=null">--> <!-- <if test="subordinateBranch !=null">-->
<!-- and v.subordinate_branch = #{subordinateBranch}--> <!-- and v.subordinate_branch = #{subordinateBranch}-->
...@@ -538,9 +535,15 @@ ...@@ -538,9 +535,15 @@
<if test="code !=null"> <if test="code !=null">
and v.code = #{code} and v.code = #{code}
</if> </if>
<if test="status !=null"> <if test="status !=null and status != 6 and status != 7">
and v.status = #{status} and v.status = #{status}
</if> </if>
<if test="status !=null and status == 6">
and v3.id is not NULL and v2.book_type = 3 and v3.state = 0
</if>
<if test="status !=null and status == 7">
and v3.id is not NULL and v2.book_type = 6 and v3.state = 0
</if>
<if test="numberPlate !=null and numberPlate != ''"> <if test="numberPlate !=null and numberPlate != ''">
and v.number_plate like concat('%',#{numberPlate},'%') and v.number_plate like concat('%',#{numberPlate},'%')
</if> </if>
...@@ -799,14 +802,14 @@ ...@@ -799,14 +802,14 @@
</if> </if>
<!-- yearNo4Where 标识时间参数不用于where条件,用于select部分 --> <!-- yearNo4Where 标识时间参数不用于where条件,用于select部分 -->
<if test=" yearMonthAndParam !=null and yearNo4Where != null and yearNo4Where == true"> <if test=" yearMonthAndParam !=null and yearNo4Where != null and yearNo4Where == true">
,(max( ,(ifnull(max(
vbi.bit_str = #{yearMonthAndParamBitStr} vbi.bit_str = #{yearMonthAndParamBitStr}
<!-- 租车列表 不过滤前后预约记录不符的车辆 但是合并标示车型是否有车 即 hasVehicle--> <!-- 租车列表 不过滤前后预约记录不符的车辆 但是合并标示车型是否有车 即 hasVehicle-->
<if test="withoutRecordWhere != null and withoutRecordWhere = 1 and startCompanyId != null and endCompanyId != null "> <if test="withoutRecordWhere != null and withoutRecordWhere = 1 and startCompanyId != null and endCompanyId != null ">
and (abr.to_lift_company is null or abr.to_lift_company = #{startCompanyId}) and (abr.to_lift_company is null or abr.to_lift_company = #{startCompanyId})
and (abr.to_return_company is null or abr.to_return_company = #{endCompanyId}) and (abr.to_return_company is null or abr.to_return_company = #{endCompanyId})
</if> </if>
) ), 1)
) as hasVehicle ) as hasVehicle
</if> </if>
<if test="lon != null and lat != null"> <if test="lon != null and lat != null">
...@@ -817,6 +820,7 @@ ...@@ -817,6 +820,7 @@
and vm.id is not null and vm.id is not null
and vm.status = 1 and vm.status = 1
and vm.isdel = 0 and vm.isdel = 0
and vm.app_show = 1
and bc.id is not null and bc.id is not null
GROUP BY model_id, company_id GROUP BY model_id, company_id
<if test="lon != null and lat != null">, distance</if> <if test="lon != null and lat != null">, distance</if>
......
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