Commit 2491e3ad authored by jiaorz's avatar jiaorz

Merge branch 'base-modify' into dev

# Conflicts:
#	xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleMapper.xml
parents b6bd31ae 158aa388
package com.github.wxiaoqi.security.common.util;
import org.apache.commons.lang3.StringUtils;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class StringToolsUtil {
/**
* 验证手机号码
* @param mobiles
* @return
*/
public static boolean isMobileNO( String mobiles){
boolean flag = false;
try{
if(StringUtils.isBlank(mobiles)) {
flag = false;
}
Pattern regex = Pattern.compile("^((16[0-9])|(13[0-9])|(15[^4,\\D])|(17[0-9])|(18[0-9])|(19[0-9]))\\d{8}$");
Matcher m = regex .matcher(mobiles);
flag = m.matches();
}catch(Exception e){
flag = false;
}
return flag;
}
/**
* 校验身份证
*
* @param idCard
* @return 校验通过返回true,否则返回false
*/
public static boolean isIDCard(String idCard) {
if(StringUtils.isBlank(idCard)) {
return false;
}
String REGEX_ID_CARD = "(^\\d{18}$)|(^\\d{15}$)";
return Pattern.matches(REGEX_ID_CARD, idCard);
}
}
...@@ -150,24 +150,26 @@ public class CustomerBehaviorNotesBiz extends BaseBiz<CustomerBehaviorNotesMappe ...@@ -150,24 +150,26 @@ public class CustomerBehaviorNotesBiz extends BaseBiz<CustomerBehaviorNotesMappe
behaviorNoteCollectVo.setU_avg_count(actionAcount.getDefault_u_avg()); behaviorNoteCollectVo.setU_avg_count(actionAcount.getDefault_u_avg());
behaviorNoteCollectVos.add(behaviorNoteCollectVo); behaviorNoteCollectVos.add(behaviorNoteCollectVo);
} }
behaviorNoteCollectVos.sort(Comparator.comparing(BehaviorNoteCollectVo::getBehavior));
return behaviorNoteCollectVos; return behaviorNoteCollectVos;
} }
/** /**
* 获取时间间隔 和 开始与结束时间的处理 * 获取时间间隔 和 开始与结束时间的处理
* @param activityId 活动id *
* @param startTime 筛选的开始时间 * @param activityId 活动id
* @param endTime 筛选的结束时间 * @param startTime 筛选的开始时间
* @param endTime 筛选的结束时间
* @return * @return
*/ */
private long getBetweenDayAndprocessStartTimeAndEndTime(Integer activityId, AtomicLong startTime, AtomicLong endTime) { private long getBetweenDayAndprocessStartTimeAndEndTime(Integer activityId, AtomicLong startTime, AtomicLong endTime) {
if (startTime.get() == 0 || endTime.get() == 0) { if (startTime.get() == 0 || endTime.get() == 0) {
ActivityListDTO activityListDTO = activityFeign.findActivityStartTimeAndEndTimeById(activityId); ActivityListDTO activityListDTO = activityFeign.findActivityStartTimeAndEndTimeById(activityId);
Instant now = Instant.now(); Instant now = Instant.now();
if (startTime.get() != 0) { if (startTime.get() != 0 && endTime.get() == 0) {
endTime.set(now.toEpochMilli()); endTime.set(now.toEpochMilli());
} }
if (endTime.get() != 0) { if (endTime.get() != 0 && startTime.get() == 0) {
startTime.set(activityListDTO.getActivity_startTime()); startTime.set(activityListDTO.getActivity_startTime());
} }
if (startTime.get() == 0 && endTime.get() == 0) { if (startTime.get() == 0 && endTime.get() == 0) {
......
...@@ -24,6 +24,8 @@ public enum ResCode { ...@@ -24,6 +24,8 @@ public enum ResCode {
VEHICLE_BOOKED_RECORD_STATUS_CHANGED(103002,"车辆预定申请状态已变更"), VEHICLE_BOOKED_RECORD_STATUS_CHANGED(103002,"车辆预定申请状态已变更"),
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED(103003,"请输入仪表盘内当前显示的公里数"), VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED(103003,"请输入仪表盘内当前显示的公里数"),
CHECKUSER_AND_PHONE_NOT_NULL(103999, "收车或交车人姓名和电话不能为空"),
USERNAME_AND_TELE_NOT_NULL(104000, "使用人和电话不能为空"),
VEHICLE_DEPARTURE_VEHICLE_UNEXIST(104001,"车辆不存在"), VEHICLE_DEPARTURE_VEHICLE_UNEXIST(104001,"车辆不存在"),
VEHICLE_DEPARTURE_VEHICLE_DISABLE(104002,"车辆不可用"), VEHICLE_DEPARTURE_VEHICLE_DISABLE(104002,"车辆不可用"),
VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE(104003,"车辆未出车"), VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE(104003,"车辆未出车"),
......
...@@ -10,6 +10,7 @@ import com.xxfc.platform.vehicle.constant.VehicleStatus; ...@@ -10,6 +10,7 @@ import com.xxfc.platform.vehicle.constant.VehicleStatus;
import com.xxfc.platform.vehicle.entity.*; import com.xxfc.platform.vehicle.entity.*;
import com.xxfc.platform.vehicle.mapper.*; import com.xxfc.platform.vehicle.mapper.*;
import com.xxfc.platform.vehicle.pojo.*; import com.xxfc.platform.vehicle.pojo.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -55,6 +56,14 @@ public class VehicleActiveService { ...@@ -55,6 +56,14 @@ 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())) {
throw new BaseException(ResCode.CHECKUSER_AND_PHONE_NOT_NULL.getDesc(),
ResCode.CHECKUSER_AND_PHONE_NOT_NULL.getCode());
}
if (!vehicle.getStatus().equals(VehicleStatus.NORMAL.getCode())) { if (!vehicle.getStatus().equals(VehicleStatus.NORMAL.getCode())) {
throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_DISABLE.getDesc() + ", 车辆状态是:" + getVehicleStatus(vehicle.getStatus(), vehicle.getId()), throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_DISABLE.getDesc() + ", 车辆状态是:" + getVehicleStatus(vehicle.getStatus(), vehicle.getId()),
ResCode.VEHICLE_DEPARTURE_VEHICLE_DISABLE.getCode()); ResCode.VEHICLE_DEPARTURE_VEHICLE_DISABLE.getCode());
...@@ -155,6 +164,10 @@ public class VehicleActiveService { ...@@ -155,6 +164,10 @@ 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(arrivalVo.getRecycleMan()) || StringUtils.isBlank(arrivalVo.getRecycleManTel())) {
throw new BaseException(ResCode.CHECKUSER_AND_PHONE_NOT_NULL.getDesc(),
ResCode.CHECKUSER_AND_PHONE_NOT_NULL.getCode());
}
if (!vehicle.getStatus().equals(VehicleStatus.DEPARTURE.getCode())) { if (!vehicle.getStatus().equals(VehicleStatus.DEPARTURE.getCode())) {
throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getDesc() + ", 车辆状态是:" + getVehicleStatus(vehicle.getStatus(), vehicle.getId()), throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getDesc() + ", 车辆状态是:" + getVehicleStatus(vehicle.getStatus(), vehicle.getId()),
ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getCode()); ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getCode());
......
...@@ -389,7 +389,7 @@ ...@@ -389,7 +389,7 @@
<if test="zoneId !=null"> <if test="zoneId !=null">
and bc2.zone_id = #{zoneId} and bc2.zone_id = #{zoneId}
</if> </if>
and is_del != 1 and v1.is_del != 1
</where> </where>
</select> </select>
...@@ -412,7 +412,7 @@ ...@@ -412,7 +412,7 @@
#{id} #{id}
</foreach> </foreach>
</if> </if>
and is_del != 1 and v1.is_del != 1
</where> </where>
ORDER BY parkCompanyName ORDER BY parkCompanyName
</select> </select>
...@@ -490,7 +490,7 @@ ...@@ -490,7 +490,7 @@
#{id} #{id}
</foreach> </foreach>
</if> </if>
and v1.is_del != 1 and v2.is_del != 1
</where> </where>
</select> </select>
......
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