Commit 856daf6f authored by hanfeng's avatar hanfeng

Merge remote-tracking branch 'origin/dev' into dev

parents 6f18077a 234d532c
......@@ -344,7 +344,7 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
default:
break;
}
return ObjectRestResponse.succ();
return ObjectRestResponse.succ(accountBindDTO.getNickName());
}
/**
......@@ -354,14 +354,14 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
*/
private void wxBinding(AccountBindDTO accountBindDTO, Integer userId) {
//检查微信是否绑定
Example example = new Example(AppUserLogin.class);
/* Example example = new Example(AppUserLogin.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("id", userId);
criteria.andEqualTo("wxOpenid", accountBindDTO.getOpendId());
List<AppUserLogin> appUserLogins = mapper.selectByExample(example);
if (CollectionUtils.isNotEmpty(appUserLogins)) {
throw new BaseException("该微信已经绑定过了");
}
}*/
AppUserLogin appUserLogin = new AppUserLogin();
appUserLogin.setId(userId);
......@@ -378,14 +378,14 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
*/
private void qqBinding(AccountBindDTO accountBindDTO, Integer userId) {
//检查qq是否绑定
Example example = new Example(AppUserLogin.class);
/* Example example = new Example(AppUserLogin.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("id", userId);
criteria.andEqualTo("openid", accountBindDTO.getOpendId());
List<AppUserLogin> appUserLogins = mapper.selectByExample(example);
if (CollectionUtils.isNotEmpty(appUserLogins)) {
throw new BaseException("该微信已经绑定过了");
}
throw new BaseException("该qq已经绑定过了");
}*/
AppUserLogin appUserLogin = new AppUserLogin();
appUserLogin.setId(userId);
appUserLogin.setWxOpenid(accountBindDTO.getOpendId());
......
......@@ -229,6 +229,7 @@ public class AppUserController extends CommonBaseController{
appUserAlipayBiz.getUserInfo(userVo.getAliCode(),request);
}
}
return ObjectRestResponse.succ();
}
......@@ -337,7 +338,7 @@ public class AppUserController extends CommonBaseController{
}
@PostMapping("/bind")
private ObjectRestResponse accountBinding(AccountBindDTO accountBindDTO, HttpServletRequest request){
private ObjectRestResponse accountBinding(@RequestBody AccountBindDTO accountBindDTO,HttpServletRequest request){
try {
IJWTInfo infoFromToken = userAuthUtil.getInfoFromToken(userAuthConfig.getToken(request));
return appUserLoginBiz.bindAccount(accountBindDTO, Integer.valueOf(infoFromToken.getId()), request);
......
......@@ -182,16 +182,19 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
return ObjectRestResponse.createFailedResult(3503, "无收车权限");
}
}
Vehicle vehicle = null;
RestResponse<Vehicle> vehicleRestResponse = vehicleFeign.findById(orderRentVehicleDetail.getVehicleId());
log.info("获取车辆信息返回消息:{}", vehicleRestResponse.getMessage());
if (vehicleRestResponse.getData() != null) {
vehicle = vehicleRestResponse.getData();
}
if (vehicle == null) {
return ObjectRestResponse.createFailedResult(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNEXIST.getCode(), ResCode.VEHICLE_DEPARTURE_VEHICLE_UNEXIST.getDesc());
}
// if (vehicle.getStatus().equals(VehicleStatus.DEPARTURE.getCode())) {
// return ObjectRestResponse.createFailedResult(ResCode.VEHICLE_DEPARTURE_VEHICLE_DISABLE.getCode(), ResCode.VEHICLE_DEPARTURE_VEHICLE_DISABLE.getDesc());
// }
if (baseOrder.getStatus() != -1) {
Vehicle vehicle = null;
RestResponse<Vehicle> restResponse = vehicleFeign.findById(orderRentVehicleDetail.getVehicleId());
log.info("获取车辆信息返回消息:{}", restResponse.getMessage());
if (restResponse.getData() != null) {
vehicle = restResponse.getData();
}
if (vehicle == null) {
return ObjectRestResponse.createFailedResult(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNEXIST.getCode(), ResCode.VEHICLE_DEPARTURE_VEHICLE_UNEXIST.getDesc());
}
if (vehicle.getMileageLastUpdate() != null) {
//判断车辆公里数
if (orderVehicleCrosstownDto.getMileage() == null || orderVehicleCrosstownDto.getMileage() < vehicle.getMileageLastUpdate()) {
......
......@@ -287,6 +287,15 @@ public class OrderCancelBiz {
//站点总人数减少
tourFeign.updateTourGoodPersonNum(otd.getVerificationId(), TourFeign.TOTAL_PERSON, (otd.getTotalNumber() * -1));
//已付款的取消订单发送消息
try {
AppUserDTO appUserDTO = userFeign.userDetailById(baseOrder.getUserId()).getData();
//处理后台用户提醒短信的发送
orderMsgBiz.handelMsgCancel(orvd, otd, omd, baseOrder, appUserDTO);
}catch (Exception e) {
log.error(e.getMessage(), e);
}
}
}
......
......@@ -326,7 +326,7 @@ public class OrderMsgBiz {
//后台发送消息(客服)
Cofig cofig = configFeign.getAllByType(ConfigFeign.TYPE_CUS_SER+ "").getData().get(0);
smsParams.clear();
sms2BgUser(cofig.getValue(), startCompanyDetailTour, null, orvd, otd, baseOrder, appUserDTO, SmsTemplateDTO.PAY_C, smsParams);
sms2BgUser(cofig.getValue(), startCompanyDetailTour, null, orvd, otd, baseOrder, appUserDTO, SmsTemplateDTO.CANCEL_F, smsParams);
break;
case MEMBER:
break;
......@@ -577,10 +577,14 @@ public class OrderMsgBiz {
smsParams.add(startCompanyDetail.getAddrDetail());
break;
case SmsTemplateDTO.PAY_J :
String realName = appUserDTO.getRealname();
if(StrUtil.isBlank(realName)){
realName = "";
}
if(SYS_TRUE.equals(appUserDTO.getIsMember()) && !NONE.getCode().equals(appUserDTO.getMemberLevel()) ) {
smsParams.add(USER_M+ appUserDTO.getRealname());
smsParams.add(USER_M+ realName);
}else {
smsParams.add(USER_N+ appUserDTO.getRealname());
smsParams.add(USER_N+ realName);
}
smsParams.add(baseOrder.getName());
smsParams.add(HOUR_MINUTE_FORMATTE_HUTOOL.format(DateUtil.date(otd.getStartTime())));
......@@ -684,7 +688,11 @@ public class OrderMsgBiz {
smsParams.add(orvd.getDayNum().toString());
break;
case SmsTemplateDTO.PAY_H :
smsParams.add(appUserDTO.getRealname());
String realName = appUserDTO.getRealname();
if(StrUtil.isBlank(realName)){
realName = "匿名";
}
smsParams.add(realName);
smsParams.add(appUserDTO.getUsername());
smsParams.add(baseOrder.getName());
smsParams.add(sCompany.getName());
......@@ -692,7 +700,11 @@ public class OrderMsgBiz {
smsParams.add(DateUtil.formatDateTime(DateUtil.date(otd.getStartTime())));
break;
case SmsTemplateDTO.CANCEL_F :
smsParams.add(appUserDTO.getRealname());
String realName2 = appUserDTO.getRealname();
if(StrUtil.isBlank(realName2)){
realName2 = "匿名";
}
smsParams.add(realName2);
smsParams.add(appUserDTO.getUsername());
smsParams.add(baseOrder.getName());
smsParams.add(sCompany.getName());
......
......@@ -49,6 +49,8 @@ public enum ResCode {
VEHICLE_UPKEEP_VEHICLE_DISABLE(106002,"车辆不可用"),
VEHICLE_UPKEEP_ITEM_UNEXIST(106003, "保养项目不存在"),
VEHICLE_UPKEEP_VEHICLE_UNUPKEEP(106004, "车辆不在保养中"),
VEHICLE_STATUS_IS_NOT_NORMAL(106005, "上次的出行未做收车操作, 请先收车"),
VEHICLE_IS_BOOKED_TODAY(106006, "车辆当前时段已经被预定"),
FIND_VEHICLE_PLAT_FAILE(106007, "获取车型列表失败"),
......
......@@ -64,11 +64,17 @@ public class Vehicle {
*/
private Integer insuranceCompany;
private Integer strongInsuranceCompany;
/**
* 保险单号
*/
private String insuranceNo;
/**
* 强险单号
*/
private String strongInsuranceNo;
/**
* 保险开始时间
......@@ -80,6 +86,11 @@ public class Vehicle {
*/
private Date insuranceEndDate;
/**
* 强险的结束时间
*/
private Date strongInsuranceEndDate;
/**
* 年审时间
*/
......
......@@ -68,12 +68,14 @@ public class AddOrUpdateVehicleVo {
* 保险公司,见常量表
*/
private Integer insuranceCompany;
private Integer strongInsuranceCompany;
/**
* 保险单号
*/
private String insuranceNo;
private String strongInsuranceNo;
/**
* 保险开始时间
......@@ -84,6 +86,7 @@ public class AddOrUpdateVehicleVo {
* 保险结束时间
*/
private Date insuranceEndDate;
private Date strongInsuranceEndDate;
/**
* 年审时间
......
......@@ -138,4 +138,6 @@ public class VehiclePageQueryVo {
*/
private Integer modelId;
}
......@@ -69,10 +69,6 @@ public class VehicleActiveService {
throw new BaseException(ResCode.CHECKUSER_AND_PHONE_NOT_NULL.getDesc(),
ResCode.CHECKUSER_AND_PHONE_NOT_NULL.getCode());
}
if (vehicle.getStatus().equals(VehicleStatus.DISCARD.getCode()) || vehicle.getIsDel() == 1) {
throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_DISABLE.getDesc() + ", 车辆状态是:" + getVehicleStatus(vehicle.getStatus(), vehicle.getId()),
ResCode.VEHICLE_DEPARTURE_VEHICLE_DISABLE.getCode());
}
//添加出车时间过滤 再出车开始时间前一天至结束时间内可以出车,并且预定记录为已审核状态
checkDateInvalid(departureVo);
Integer MileageLift = vehicle.getMileageLastUpdate();
......
......@@ -491,6 +491,25 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
return Boolean.TRUE;
}
/**
*
* @param vehicleId
* @return
*/
public ObjectRestResponse checkVehicleStatus(String vehicleId) {
if (StringUtils.isBlank(vehicleId)) {
return ObjectRestResponse.paramIsEmpty();
}
Vehicle vehicle = mapper.selectByPrimaryKey(vehicleId);
if (vehicle == null) {
return ObjectRestResponse.createFailedResult(ResCode.VEHICLE_UPKEEP_VEHICLE_UNEXIST.getCode(), ResCode.VEHICLE_UPKEEP_VEHICLE_UNUPKEEP.getDesc());
}
if (vehicle.getStatus().equals(VehicleStatus.DEPARTURE.getCode()) || vehicle.getStatus().equals(VehicleStatus.DISCARD.getCode()) || vehicle.getIsDel() != 0) {
return ObjectRestResponse.createFailedResult(ResCode.VEHICLE_STATUS_IS_NOT_NORMAL.getCode(), ResCode.VEHICLE_STATUS_IS_NOT_NORMAL.getDesc());
}
return ObjectRestResponse.succ();
}
public boolean filterHourInfoBooked(String vehicleId, Map<String, Integer> hourInfo) {
if (MapUtils.isEmpty(hourInfo)) {
......
package com.xxfc.platform.vehicle.rest;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.vehicle.biz.VehicleActiveService;
import com.xxfc.platform.vehicle.biz.VehicleBiz;
import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.constant.ResCode.ResCode;
import com.xxfc.platform.vehicle.constant.VehicleStatus;
import com.xxfc.platform.vehicle.entity.Vehicle;
import com.xxfc.platform.vehicle.pojo.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
......@@ -17,7 +22,8 @@ public class VehicleActiveController {
@Autowired
VehicleActiveService vehicleActiveService;
@Autowired
VehicleBiz vehicleBiz;
/**
* 发车
......@@ -32,6 +38,19 @@ public class VehicleActiveController {
return RestResponse.codeAndMessage(ResCode.INVALID_REST_REQ_PARAM.getCode(),
ResCode.INVALID_REST_REQ_PARAM.getDesc());
}
Vehicle vehicle = vehicleBiz.selectById(departureVo.getVehicleId());
if (vehicle == null) {
throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNEXIST.getDesc(),
ResCode.VEHICLE_DEPARTURE_VEHICLE_UNEXIST.getCode());
}
if (StringUtils.isBlank(departureVo.getCheckMan()) || StringUtils.isBlank(departureVo.getCheckManTel())) {
throw new BaseException(ResCode.CHECKUSER_AND_PHONE_NOT_NULL.getDesc(),
ResCode.CHECKUSER_AND_PHONE_NOT_NULL.getCode());
}
if (vehicle.getStatus().equals(VehicleStatus.DISCARD.getCode()) || vehicle.getIsDel() == 1 || vehicle.getStatus().equals(VehicleStatus.DEPARTURE.getCode())) {
throw new BaseException(ResCode.VEHICLE_STATUS_IS_NOT_NORMAL.getDesc(),
ResCode.VEHICLE_STATUS_IS_NOT_NORMAL.getCode());
}
vehicleActiveService.departure(departureVo);
return RestResponse.suc();
}
......@@ -50,6 +69,19 @@ public class VehicleActiveController {
return RestResponse.codeAndMessage(ResCode.INVALID_REST_REQ_PARAM.getCode(),
ResCode.INVALID_REST_REQ_PARAM.getDesc());
}
Vehicle vehicle = vehicleBiz.selectById(departureVo.getVehicleId());
if (vehicle == null) {
throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNEXIST.getDesc(),
ResCode.VEHICLE_DEPARTURE_VEHICLE_UNEXIST.getCode());
}
if (StringUtils.isBlank(departureVo.getCheckMan()) || StringUtils.isBlank(departureVo.getCheckManTel())) {
throw new BaseException(ResCode.CHECKUSER_AND_PHONE_NOT_NULL.getDesc(),
ResCode.CHECKUSER_AND_PHONE_NOT_NULL.getCode());
}
if (vehicle.getStatus().equals(VehicleStatus.DISCARD.getCode()) || vehicle.getIsDel() == 1) {
throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_DISABLE.getDesc(),
ResCode.VEHICLE_DEPARTURE_VEHICLE_DISABLE.getCode());
}
vehicleActiveService.departure(departureVo);
return RestResponse.suc();
}
......
......@@ -485,6 +485,12 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
return ObjectRestResponse.succ(map);
}
@GetMapping(value = "/app/unauth/checkVehicleStatus")
@ApiOperation(value = "检车车辆状态是否是正常状态")
public ObjectRestResponse checkVehicleStatus(String vehicleId) {
return vehicleBiz.checkVehicleStatus(vehicleId);
}
/**
* 保存
*
......
......@@ -526,7 +526,7 @@
</if>
<!--增加时间限制,已审核的未出车小于当前时间的不显示, 已出车的结束时间延后两天小于当前时间的不显示-->
<if test="flag == true and status == 2">
and ( v4.id IS NOT NULL OR (v4.id IS NULL AND v1.book_end_date &gt;= now()))
and ( (v4.id IS NOT NULL and DATE_ADD(v1.book_end_date,INTERVAL '2' DAY) >= now()) OR (v4.id IS NULL AND v1.book_end_date &gt;= now()))
</if>
and v1.book_user != -2
</where>
......
......@@ -121,7 +121,7 @@
and v.belong_to_name like concat('%',#{belongToName},'%')
</if>
<if test="vin !=null and vin != ''">
and v.vin = #{vin}
and v.vin like CONCAT('%',#{vin},'%')
</if>
<!-- <if test="subordinateBranch !=null">-->
<!-- and v.subordinate_branch = #{subordinateBranch}-->
......@@ -289,7 +289,7 @@
and v.belong_to_name = #{belongToName}
</if>
<if test="vin !=null and vin != ''">
and v.vin = #{vin}
and v.vin like CONCAT('%',#{vin},'%')
</if>
<!-- <if test="subordinateBranch !=null">-->
<!-- and v.subordinate_branch = #{subordinateBranch}-->
......
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