Commit 17acf772 by lixian7

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

parents 7b09a483 a456118f
...@@ -95,16 +95,16 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, ParkBindInfo> i ...@@ -95,16 +95,16 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, ParkBindInfo> i
PlateNumQueryReq req = new PlateNumQueryReq(); PlateNumQueryReq req = new PlateNumQueryReq();
req.setPlateNum(info.getPlateNum()); req.setPlateNum(info.getPlateNum());
List<VehicleRes> byPlateNum = vechicleCache.getByPlateNum(req); List<VehicleRes> byPlateNum = vechicleCache.getByPlateNum(req);
if (byPlateNum==null || byPlateNum.size()==0){ if (byPlateNum == null || byPlateNum.size() == 0) {
return ResponseGenerator.fail(StatusCode.DATA_ERROR,"车辆信息不存在"); return ResponseGenerator.fail(StatusCode.DATA_ERROR, "车辆信息不存在");
} }
for (VehicleRes res : byPlateNum) { for (VehicleRes res : byPlateNum) {
if (info.getPhone().equals(res.getSjhm())) { if (info.getPhone().equals(res.getSjhm())) {
info.setPlateType(res.getHpzl()); info.setPlateType(res.getHpzl());
} }
} }
if (info.getPlateType() == null || info.getPlateType().equals("")) { if (info.getPlateType() == null || "".equals(info.getPlateType())) {
return ResponseGenerator.fail(StatusCode.DATA_ERROR,"当前手机号,与车辆备案手机号不一致"); return ResponseGenerator.fail(StatusCode.DATA_ERROR, "当前手机号,与车辆备案手机号不一致");
} }
//规则3:判断当前车牌号是否已绑定 //规则3:判断当前车牌号是否已绑定
...@@ -115,7 +115,7 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, ParkBindInfo> i ...@@ -115,7 +115,7 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, ParkBindInfo> i
queryWrapper.eq("status", "1"); queryWrapper.eq("status", "1");
ParkBindInfo bindExist = mapper.selectOne(queryWrapper); ParkBindInfo bindExist = mapper.selectOne(queryWrapper);
if (bindExist != null) { if (bindExist != null) {
return ResponseGenerator.fail(StatusCode.DATA_ERROR,"此车牌号已绑定"); return ResponseGenerator.fail(StatusCode.DATA_ERROR, "此车牌号已绑定");
} else { } else {
info.setUnqId(UUID.randomUUID().toString()); info.setUnqId(UUID.randomUUID().toString());
mapper.insert(info); mapper.insert(info);
......
...@@ -19,8 +19,6 @@ public interface BindInfoMapper extends BaseMapper<ParkBindInfo> { ...@@ -19,8 +19,6 @@ public interface BindInfoMapper extends BaseMapper<ParkBindInfo> {
Integer bindInfoInsert( ParkBindInfo info); Integer bindInfoInsert( ParkBindInfo info);
Integer clearPast(@Param("dateTime") Date dateTime);
Integer unbind( ParkBindInfo info); Integer unbind( ParkBindInfo info);
} }
...@@ -4,6 +4,7 @@ import lombok.Data; ...@@ -4,6 +4,7 @@ import lombok.Data;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
/** /**
* @author lixian * @author lixian
...@@ -27,6 +28,7 @@ public class BindInfoReq { ...@@ -27,6 +28,7 @@ public class BindInfoReq {
* F:紫,G:绿,H:蓝,I:棕,J:黑', * F:紫,G:绿,H:蓝,I:棕,J:黑',
*/ */
@NotBlank(message = "车牌颜色不能为空") @NotBlank(message = "车牌颜色不能为空")
@Pattern(regexp = "[ABCDEFGHIJ]")
private String plateColor; private String plateColor;
/** /**
* 车牌号 * 车牌号
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<mapper namespace="com.hikcreate.edl.pub.web.mobile.infra.data.mapper.BindInfoMapper"> <mapper namespace="com.hikcreate.edl.pub.web.mobile.infra.data.mapper.BindInfoMapper">
<insert id="bindInfoInsert" parameterType="com.hikcreate.edl.pub.web.mobile.infra.model.entity.ParkBindInfo"> <insert id="bindInfoInsert" parameterType="com.hikcreate.edl.pub.web.mobile.infra.model.entity.ParkBindInfo">
insert ignore into edl_public.bind_info(unq_id,user_id,phone,plate_color,plate_num,plate_type,gmt_bind_time) insert ignore into park_bind_info(unq_id,user_id,phone,plate_color,plate_num,plate_type,gmt_bind_time)
values (#{unqId},#{userId},#{phone},#{plateColor},#{plateNum},#{plateType},#{gmtBindTime}) values (#{unqId},#{userId},#{phone},#{plateColor},#{plateNum},#{plateType},#{gmtBindTime})
</insert> </insert>
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
when '1' then '已绑定' when '1' then '已绑定'
end status, end status,
b.plate_num,b.plate_type,b.gmt_bind_time b.plate_num,b.plate_type,b.gmt_bind_time
from edl_public.park_bind_info as b from park_bind_info as b
where b.status='1' where b.status='1'
<if test="userId!=null and userId!=''"> <if test="userId!=null and userId!=''">
and b.user_id=#{userId} and b.user_id=#{userId}
...@@ -36,13 +36,9 @@ ...@@ -36,13 +36,9 @@
</select> </select>
<update id="unbind"> <update id="unbind">
update edl_public.park_bind_info as b set b.status="0",b.unbind_time=#{unbindTime} where b.unq_id=#{unqId} update park_bind_info as b set b.status="0",b.unbind_time=#{unbindTime} where b.unq_id=#{unqId}
</update> </update>
<delete id="clearPast" parameterType="java.util.Date">
delete from edl_public.bind_info where unbind_time <![CDATA[<=]]> #{dateTime} and status='0'
</delete>
</mapper> </mapper>
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<select id="checkValidity" resultType="com.hikcreate.edl.pub.web.mobile.infra.model.entity.ParkVerifyInfo"> <select id="checkValidity" resultType="com.hikcreate.edl.pub.web.mobile.infra.model.entity.ParkVerifyInfo">
select id, user_id, verify_code, phone,pass_time from edl_public.park_verify_info as v select id, user_id, verify_code, phone,pass_time from park_verify_info as v
where pass_time <![CDATA[ >= ]]> #{time} and phone=#{phone} and user_id=#{userId} where pass_time <![CDATA[ >= ]]> #{time} and phone=#{phone} and user_id=#{userId}
</select> </select>
</mapper> </mapper>
-- auto-generated definition -- auto-generated definition
...@@ -10,7 +10,9 @@ create table bind_info ...@@ -10,7 +10,9 @@ create table bind_info
plate_type varchar(20) not null comment '车牌类型', plate_type varchar(20) not null comment '车牌类型',
status varchar(10) default '1' null comment '绑定状态:0,未绑定,1,已绑定', status varchar(10) default '1' null comment '绑定状态:0,未绑定,1,已绑定',
gmt_bind_time datetime null comment '绑定时间', gmt_bind_time datetime null comment '绑定时间',
unbind_time datetime null comment '解绑时间' unbind_time datetime null comment '解绑时间',
constraint bind_info_pk
unique (user_id, unbind_time)
) )
comment '用户车辆绑定信息'; comment '用户车辆绑定信息';
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