修改车牌业务

This commit is contained in:
yuyang 2023-10-24 17:03:46 +08:00
parent b046dacaa2
commit eeaa426795
6 changed files with 65 additions and 16 deletions

View File

@ -387,6 +387,7 @@
service_facilities as serviceFacilities,
img_id as imgId,
remark as remark,
ifnull(barrier_gate_id,0) as barrierGateType,
ROUND(ACOS(SIN((#{latitude} * 3.141593) / 180) * SIN((latitude * 3.141593) / 180) + COS((#{latitude} * 3.141593) / 180) * COS((latitude * 3.141593) / 180) * COS((#{longitude} * 3.141593) / 180 - (longitude * 3.141593) / 180)) * 6370.9968,
2) AS distance
from xhpc_charging_station

View File

@ -21,6 +21,7 @@ import com.xhpc.common.core.web.page.TableDataInfo;
import com.xhpc.common.log.annotation.Log;
import com.xhpc.common.log.enums.BusinessType;
import com.xhpc.common.redis.service.RedisService;
import com.xhpc.user.domain.XhpcUserVehicle;
import com.xhpc.user.service.IXhpcAppUserUserService;
import com.xhpc.user.service.IXhpcUserVehicleService;
import com.xhpc.user.util.WechatDecryptDataUtil;
@ -590,10 +591,15 @@ public class XhpcAppUserController extends BaseController {
}
//获取用户车牌号
@ApiOperation("获取用户车牌号")
@GetMapping("/getXhpcUserVehicleMessage")
public R getXhpcUserVehicleMessage(Long userId, Integer source){
return xhpcUserVehicleService.getXhpcUserVehicleMessage(userId, source);
}
@ApiOperation("添加车牌号")
@PostMapping("/addUserVehicle")
public R addUserVehicle(@RequestBody XhpcUserVehicle xhpcUserVehicle){
return xhpcUserVehicleService.addUserVehicle(xhpcUserVehicle);
}
}

View File

@ -0,0 +1,40 @@
package com.xhpc.user.controller;
import com.xhpc.common.core.domain.R;
import com.xhpc.common.core.web.controller.BaseController;
import com.xhpc.user.domain.XhpcUserVehicle;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
* 道闸日志
*/
@RestController
@RequestMapping("/app/barrierGateLog")
public class XhpcBarrierGateLog extends BaseController {
@ApiOperation("添加车辆出站信息")
@PostMapping("/massage")
public R massage(@RequestBody Map<String, Object> map){
if(map.get("plateNo") ==null || "".equals(map.get("plateNo").toString())){
return R.fail(40003,"车牌号为空");
}
if(map.get("inTime") ==null || "".equals(map.get("inTime").toString())){
return R.fail(40003,"进场为空");
}
if(map.get("outTime") ==null || "".equals(map.get("outTime").toString())){
return R.fail(40003,"出场为空");
}
return R.ok(null,"数据已接受");
}
}

View File

@ -13,7 +13,7 @@ import java.util.Map;
public interface XhpcUserVehicleMapper {
void deleteUserVehicle(@Param("userId") Long userId,@Param("vehicleId") Long vehicleId);
void deleteUserVehicle(@Param("userId") Long userId,@Param("vehicleId") Long vehicleId,@Param("source")Integer source);
void addUserVehicle(XhpcUserVehicle xhpcUserVehicle);

View File

@ -33,11 +33,11 @@ public class XhpcUserVehicleServiceImpl extends BaseService implements IXhpcUser
@Override
public R addUserVehicle(XhpcUserVehicle xhpcUserVehicle) {
//标记该用户其他车牌号为空
xhpcUserVehicleMapper.deleteUserVehicle(xhpcUserVehicle.getAppUserId(),xhpcUserVehicle.getVehicleId());
if(xhpcUserVehicle.getVehicleId() !=null){
xhpcUserVehicleMapper.addUserVehicle(xhpcUserVehicle);
}else{
xhpcUserVehicleMapper.updateUserVehicle(xhpcUserVehicle);
}else{
xhpcUserVehicleMapper.deleteUserVehicle(xhpcUserVehicle.getAppUserId(),xhpcUserVehicle.getVehicleId(),xhpcUserVehicle.getSource());
xhpcUserVehicleMapper.addUserVehicle(xhpcUserVehicle);
}
return R.ok();
}

View File

@ -21,7 +21,7 @@
</resultMap>
<update id="deleteUserVehicle">
update xhpc_user_vehicle set del_flag =1 where app_user_id=#{userId}
update xhpc_user_vehicle set del_flag =1 where app_user_id=#{userId} and source=#{source}
<if test="vehicleId !=null">
and vehicle_id !=#{vehicleId}
</if>
@ -51,7 +51,7 @@
<if test="phone !=null and phone !=''">
and (xau.phone like CONCAT('%',#{phone},'%') or
xcop.phone like CONCAT('%',#{phone},'%') or
xcup.phone like CONCAT('%',#{phone},'%') or
xcup.phone like CONCAT('%',#{phone},'%')
)
</if>
<if test="type ==1">
@ -68,14 +68,11 @@
<update id="updateUserVehicle" parameterType="com.xhpc.user.domain.XhpcUserVehicle">
UPDATE xhpc_user_vehicle
<set>
<if test="null != appUserId ">vehicle_id = #{appUserId},</if>
<if test="null != appUserId ">app_user_id = #{appUserId},</if>
<if test="source != null ">source =#{source},</if>
<if test="chargingStationId != null ">charging_station_id =#{chargingStationId},</if>
<if test="null != vehicleName and '' != vehicleName">vehicle_name = #{vehicleName},</if>
<if test="null != type ">type = #{type},</if>
<if test="null != delFlag and '' != delFlag">del_flag = #{delFlag},</if>
<if test="null != createBy and '' != createBy">create_by = #{createBy},</if>
<if test="null != createTime ">create_time = #{createTime},</if>
<if test="null != updateBy and '' != updateBy">update_by = #{updateBy},</if>
<if test="null != updateTime ">update_time = #{updateTime},</if>
<if test="null != remark and '' != remark">remark = #{remark}</if>
</set>
WHERE vehicle_id = #{vehicleId}
@ -85,26 +82,31 @@
keyProperty="vehicleId">
insert into xhpc_user_vehicle(
<if test="appUserId != null ">app_user_id,</if>
<if test="source != null ">source,</if>
<if test="chargingStationId != null ">charging_station_id,</if>
<if test="vehicleName != null and vehicleName != ''">vehicle_name,</if>
<if test="type != null ">type,</if>
<if test="delFlag != null ">del_flag,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null ">update_by,</if>
<if test="updateTime != null ">update_time,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="tenantId != null ">tenant_id,</if>
)values(
create_time
)
values(
<if test="appUserId != null ">#{appUserId},</if>
<if test="source != null ">#{source},</if>
<if test="chargingStationId != null ">#{chargingStationId},</if>
<if test="vehicleName != null and vehicleName != ''">#{vehicleName},</if>
<if test="type != null ">#{type},</if>
<if test="delFlag != null ">#{delFlag},</if>
<if test="createBy != null ">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null ">#{updateTime},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="tenantId != null ">#{tenantId},</if>
sysdate()
)
</insert>