Commit 75fd0975 authored by 周健威's avatar 周健威

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

parents 7b31b136 e041efcc
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);
}
}
......@@ -77,7 +77,7 @@ public class CofigBiz extends BaseBiz<CofigMapper, Cofig> {
Example example = new Example(Cofig.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("isDel", 0);
example.setOrderByClause("type");
PageDataVO<Cofig> cofigPage = PageDataVO.pageInfo(query.getPage(), query.getLimit(), () -> mapper.selectByExample(example));
return new TableResultResponse<>(cofigPage.getTotalCount(), cofigPage.getData());
......
......@@ -199,6 +199,7 @@ public class BackStageOrderController extends CommonBaseController implements Us
companyIds.add(dto.getStartCompanyId());
}
}
dto.setCompanyIds(companyIds);
Query query = new Query(dto);
PageDataVO<OrderPageVO> pageDataVO = PageDataVO.pageInfo(query, () -> baseOrderBiz.getRentVehicle(query.getSuper()));
for (OrderPageVO orderPageVO : pageDataVO.getData()) {
......
......@@ -125,7 +125,7 @@ public class CustomerBehaviorNotesBiz extends BaseBiz<CustomerBehaviorNotesMappe
//App访问量统计
case APP_VISIT_COUNT:
actionAcount = new ActionAcount();
default_p_total = mapper.selectAppVvisitsByType(BehaviorEnum.APP_VISIT_COUNT.getCode());
default_p_total = mapper.selectAppVvisitsByTypeAndTime(BehaviorEnum.APP_VISIT_COUNT.getCode(),startAtomic.get(),endAtomic.get());
default_p_avg = default_p_total / between_day;
actionAcount.setDefault_p_total(default_p_total);
actionAcount.setDefault_p_avg(default_p_avg);
......
......@@ -17,7 +17,7 @@ public interface CustomerBehaviorNotesMapper extends Mapper<CustomerBehaviorNote
List<CustomerBehaviorNotes> selectByActivityIdAndTime(@Param("activityId") Integer activityId,@Param("startTime") Long startTime,@Param("endTime") Long endTime);
long selectAppVvisitsByType(@Param("code") int code);
long selectAppVvisitsByTypeAndTime(@Param("code") int code,@Param("startTime") Long startTime,@Param("endTime") Long endTime);
List<CustomerBehaviorNotes> selectAllByTypeIdsAndTime(@Param("bizIds") List<Integer> bizIds,@Param("startTime") Long startTime,@Param("endTime") Long endTime);
}
......@@ -27,8 +27,17 @@
</if>
</select>
<select id="selectAppVvisitsByType" resultType="long">
<select id="selectAppVvisitsByTypeAndTime" resultType="long">
select count(id) from `customer_behavior_notes` where `type`=#{code}
<if test="startTime != null != null and endTime !=null">
and `crt_time` between #{startTime} and #{endTime}
</if>
<if test="startTime != null and endTime == null">
and <![CDATA[`crt_time` >= #{startTime}]]>
</if>
<if test="endTime != null and startTime == null">
and <![CDATA[ `crt_time` <= #{endTime}]]>
</if>
</select>
<select id="selectAllByTypeIdsAndTime" resultMap="customerBehaviorNotesMap">
......
......@@ -24,6 +24,8 @@ public enum ResCode {
VEHICLE_BOOKED_RECORD_STATUS_CHANGED(103002,"车辆预定申请状态已变更"),
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_DISABLE(104002,"车辆不可用"),
VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE(104003,"车辆未出车"),
......
......@@ -2,6 +2,8 @@ package com.xxfc.platform.vehicle.pojo;
import lombok.Data;
import java.util.List;
/**
*车辆相关预警消息
*
......@@ -31,4 +33,6 @@ public class QueryVehicleWarningMsgVo {
private Integer limit;
private Integer colorType;
private List<Integer> companyIds;
}
......@@ -10,6 +10,7 @@ import com.xxfc.platform.vehicle.constant.VehicleStatus;
import com.xxfc.platform.vehicle.entity.*;
import com.xxfc.platform.vehicle.mapper.*;
import com.xxfc.platform.vehicle.pojo.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -55,6 +56,14 @@ public class VehicleActiveService {
throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNEXIST.getDesc(),
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())) {
throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_DISABLE.getDesc() + ", 车辆状态是:" + getVehicleStatus(vehicle.getStatus(), vehicle.getId()),
ResCode.VEHICLE_DEPARTURE_VEHICLE_DISABLE.getCode());
......@@ -155,6 +164,10 @@ public class VehicleActiveService {
throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNEXIST.getDesc(),
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())) {
throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getDesc() + ", 车辆状态是:" + getVehicleStatus(vehicle.getStatus(), vehicle.getId()),
ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getCode());
......
......@@ -4,6 +4,9 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONException;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.dto.UserDTO;
import com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.google.common.collect.Maps;
......@@ -44,7 +47,7 @@ import java.util.concurrent.TimeUnit;
@Slf4j
@Service
public class VehicleWarningMsgBiz extends BaseBiz<VehicleWarningMsgMapper, VehicleWarningMsg> {
public class VehicleWarningMsgBiz extends BaseBiz<VehicleWarningMsgMapper, VehicleWarningMsg> implements UserRestInterface {
private static final Integer CHECK_BATCH_SIZE_VEHICLE = 100;//每批次检查多少辆车
......@@ -67,7 +70,15 @@ public class VehicleWarningMsgBiz extends BaseBiz<VehicleWarningMsgMapper, Vehic
@Autowired
private RedisTemplate customRedisTemplate;
@Autowired
UserFeign userFeign;
@Autowired
VehicleBiz vehicleBiz;
@Override
public UserFeign getUserFeign() {
return userFeign;
}
/**
* 增加自定义预警消息
* @param addVehicleWarningMsgVo
......@@ -94,7 +105,18 @@ public class VehicleWarningMsgBiz extends BaseBiz<VehicleWarningMsgMapper, Vehic
try {
QueryVehicleWarningMsgVo queryVehicleWarningMsgVo = JSON.parseObject(queryVehicleWarningMsgVoJson, QueryVehicleWarningMsgVo.class);
PageHelper.startPage(queryVehicleWarningMsgVo.getPage(),queryVehicleWarningMsgVo.getLimit());
List<VehicleWarningMsg> vehicleWarningMsgs = mapper.getByPages(queryVehicleWarningMsgVo);
UserDTO userDTO = getAdminUserInfo();
if (userDTO != null) {
if (userDTO.getDataAll() == 2) {
List<Integer> companyList = vehicleBiz.dataCompany(userDTO.getDataZone(), userDTO.getDataCompany());
if(companyList != null && companyList.size() > 0) {
queryVehicleWarningMsgVo.setCompanyIds(companyList);
}
}
} else {
return RestResponse.codeAndMessage(1032,"token失效");
}
List<VehicleWarningMsg> vehicleWarningMsgs = mapper.getByPage(queryVehicleWarningMsgVo);
PageInfo<VehicleWarningMsg> vehicleWarningMsgPageInfo = new PageInfo<>(vehicleWarningMsgs);
return RestResponse.data(PageDataVO.pageInfo(vehicleWarningMsgPageInfo));
} catch (JSONException ex) {
......@@ -230,4 +252,5 @@ public class VehicleWarningMsgBiz extends BaseBiz<VehicleWarningMsgMapper, Vehic
return list;
}
}
......@@ -389,7 +389,7 @@
<if test="zoneId !=null">
and bc2.zone_id = #{zoneId}
</if>
and is_del != 1
and v1.is_del != 1
</where>
</select>
......@@ -412,7 +412,7 @@
#{id}
</foreach>
</if>
and is_del != 1
and v1.is_del != 1
</where>
ORDER BY parkCompanyName
</select>
......@@ -490,7 +490,7 @@
#{id}
</foreach>
</if>
and v1.is_del != 1
and v2.is_del != 1
</where>
</select>
......
......@@ -22,9 +22,17 @@
and v.number_plate = #{numberPlate}
</if>
<if test="type != null">
and type = #{type}
and vwn.type = #{type}
</if>
<if test="colorType != null">
and vwn.color_type = #{colorType}
</if>
<if test="companyIds != null and companyIds.size > 0">
and v.park_branch_company_id in
<foreach collection="companyIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</select>
<select id="getMsgByVehicle" parameterType="java.util.Map" resultType="com.xxfc.platform.vehicle.entity.VehicleWarningMsg" >
......@@ -73,12 +81,6 @@
<if test="numberPlate != null and numberPlate != '' ">
and number_plate = #{numberPlate}
</if>
<if test="type != null">
and type = #{type}
</if>
<if test="colorType != null">
and color_type = #{colorType}
</if>
</select>
</mapper>
\ No newline at end of file
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