Commit 02dbe3d0 authored by 陈嘉强's avatar 陈嘉强

入出站落表存档,细节判断

parent 52de6995
......@@ -24,9 +24,9 @@ public class RabbitmqMapper {
// }
public void sendTopic(){
String message = "ASYNUP|uploadParkingTradingRecord|{\"terminalId\": \"主终端\", \"plateNo\": \"豫H33333\", \"entryTime\": 1646639417620, \"entryId\": \"入口\", \"vehicleType\": \"小型车\", \"entryPhoto\":\"\", \"booking\": false, \"plateParseInfo\": \"{\\\"etcPlateNo\\\": [], \\\"videoPlateNo\\\": \\\"豫H33333\\\", \\\"state\\\": \\\"NORMAL\\\", \\\"idenType\\\": \\\"PLATE\\\"}\", \"parkingDetail\": {}, \"exitTime\": 1646639418573, \"requestId\": \"3bad40149deb11ec8f1ccaab5cf7fc68\", \"username\": \"ftp94\", \"password\": \"1\", \"parkUUID\": \"ypark2\", \"parkType\": \"路外\"}";
String message1 = "ASYNUP|uploadParkingTradingRecord|{\"plateNo\": \"豫H11111\", \"vehicleType\": \"小型车\", \"entryTime\": 1646373838476, \"entryId\": \"入口\", \"booking\": false, \"exitTime\": 1646373842172, \"exitId\": \"出口\", \"tradeTime\": 1646373842172, \"tollRateVersion\": \"\", \"tollCollectorName\": \"默认收费员\", \"tradeType\": \"FREE\", \"accounts\": 0, \"cash\": 0, \"entryPhoto\": null, \"exitPhoto\": null, \"plateParseInfo\": \"{\\\"etcPlateNo\\\": [], \\\"videoPlateNo\\\": \\\"豫H11111\\\", \\\"state\\\": \\\"NORMAL\\\", \\\"idenType\\\": \\\"PLATE\\\"}\", \"useType\": \"\", \"parkingDetail\": {\"couponList\": [], \"payList\": [], \"negotiate\": false, \"parkingFeeBeforeNegotiate\": 0}, \"terminalId\": \"主终端\", \"time\": 1646373845403, \"requestId\": \"e5bb7e809b8011ec88d6d64e40ddb35c\", \"username\": \"ftp94\", \"password\": \"1\", \"parkUUID\": \"ypark2\", \"parkType\": \"路外\"}";
rabbitTemplate.convertAndSend("global.parking.topic.exchange","ASYNUP.uploadParkingTradingRecord.ypark2",message1);
String message = "ASYNUP|uploadParkingTradingRecord|{\"terminalId\": \"主终端\", \"plateNo\": \"豫H11111\", \"entryTime\": 1646373838476, \"entryId\": \"入口\", \"vehicleType\": \"小型车\", \"entryPhoto\": null, \"booking\": false, \"plateParseInfo\": \"{\\\"etcPlateNo\\\": [], \\\"videoPlateNo\\\": \\\"豫H11111\\\", \\\"state\\\": \\\"NORMAL\\\", \\\"idenType\\\": \\\"PLATE\\\"}\", \"parkingDetail\": {}, \"time\": 1646373838792, \"requestId\": \"e1caa8d29b8011ec88d6d64e40ddb35c\", \"username\": \"ftp94\", \"password\": \"1\", \"parkUUID\": \"ypark2\", \"parkType\": \"路外\"}";
String message1 = "ASYNUP|uploadParkingTradingRecord|{\"plateNo\": \"豫H11111\", \"vehicleType\": \"小型车\", \"entryTime\": 1646373838476, \"entryId\": \"入口\", \"booking\": false, \"exitTime\": 1646373842172, \"exitId\": \"出口\", \"tradeTime\": 1646373842172, \"tollRateVersion\": \"\", \"tollCollectorName\": \"默认收费员\", \"tradeType\": \"FREE\", \"accounts\": 100, \"cash\": 0, \"entryPhoto\": null, \"exitPhoto\": null, \"plateParseInfo\": \"{\\\"etcPlateNo\\\": [], \\\"videoPlateNo\\\": \\\"豫H11111\\\", \\\"state\\\": \\\"NORMAL\\\", \\\"idenType\\\": \\\"PLATE\\\"}\", \"useType\": \"\", \"parkingDetail\": {\"couponList\": [], \"payList\": [], \"negotiate\": false, \"parkingFeeBeforeNegotiate\": 0}, \"terminalId\": \"主终端\", \"time\": 1646373845403, \"requestId\": \"e5bb7e809b8011ec88d6d64e40ddb35c\", \"username\": \"ftp94\", \"password\": \"1\", \"parkUUID\": \"ypark2\", \"parkType\": \"路外\"}";
rabbitTemplate.convertAndSend("global.parking.topic.exchange","ASYNUP.uploadParkingTradingRecord.ypark2",message);
for (int i =0; i<10; i++){
// rabbitTemplate.convertAndSend("global.parking.topic.exchange","ASYNUP.uploadParkingTradingRecord.ypark2","测试发布订阅模型: " + i);
......
......@@ -15,13 +15,12 @@ public interface InterfaceParkingGateMapper {
List<InterfaceParkingGate> selectAllByRequestIdOrExitRequestId(@Param("requestId") String requestId);
List<InterfaceParkingGate> selectByEntryTimeAndEntryId(@Param("entryTime") Object entryTime, @Param("entryId") String entryId);
InterfaceParkingGate selectOneByExitFlagNum(@Param("exitFlagNum") String exitFlagNum);
int insertAll(InterfaceParkingGate interfaceParkingGate);
int updateExitInfo(InterfaceParkingGate interfaceParkingGate);
int updateExitId(@Param("exitId") String exitId);
}
......
......@@ -40,13 +40,20 @@ public class ParkingGateServiceImpl implements ParkingGateService {
int id = interfaceParkingGateMapper.insertAll(parkingGate);
}else {
// 出站逻辑
List<InterfaceParkingGate> interfaceParkingGates = interfaceParkingGateMapper.selectByEntryTimeAndEntryId(parkingGate.getEntryTime(), parkingGate.getEntryId());
int i = interfaceParkingGateMapper.updateExitInfo(parkingGate);
InterfaceParkingGate exitInfo = interfaceParkingGateMapper.selectOneByExitFlagNum(parkingGate.getExitFlagNum());
exitInfo.setExitId(parkingGate.getExitId());
exitInfo.setExitTime(parkingGate.getExitTime());
exitInfo.setExitRequestId(parkingGate.getRequestId());
exitInfo.setExitRequestTime(parkingGate.getRequestTime());
exitInfo.setUpdateUser("interface");
exitInfo.setUpdateDate(new Date());
int i = interfaceParkingGateMapper.updateExitInfo(exitInfo);
}
parkingGate.setUpdateUser("cjq");
return null;
}
}
......@@ -48,7 +48,7 @@
slot_id,booking,parking_detail,
domain_name,version,deleted,
insert_user,insert_date,update_user,
update_date,exit_request_id,exit_request_time,exitFlagNum
update_date,exit_request_id,exit_request_time,exit_flag_num
</sql>
<insert id="insertAll">
insert into t01_interface_parking_gate
......@@ -69,32 +69,117 @@
#{tollCollectorName,jdbcType=VARCHAR}, #{useType,jdbcType=VARCHAR}, #{areaId,jdbcType=VARCHAR},
#{slotId,jdbcType=VARCHAR}, #{booking,jdbcType=BOOLEAN}, #{parkingDetail,jdbcType=VARCHAR},
#{domainName,jdbcType=VARCHAR}, #{version}, #{deleted,jdbcType=BOOLEAN},
#{insertUser,jdbcType=VARCHAR}, #{insertDate,jdbcType=TIMESTAMP}), #{exitFlagNum,jdbcType=VARCHAR}
#{insertUser,jdbcType=VARCHAR}, #{insertDate,jdbcType=TIMESTAMP}, #{exitFlagNum,jdbcType=VARCHAR})
</insert>
<update id="updateExitInfo" parameterType="interfaceParkingGate">
update t01_interface_parking_gate
<set>
update_user = #{updateUser}
<if test="requestTime != null">
request_time = #{requestTime,jdbcType=OTHER},
</if>
<if test="requestId != null">
request_id = #{requestId,jdbcType=VARCHAR},
</if>
<if test="plateNo != null">
plate_no = #{plateNo,jdbcType=VARCHAR},
</if>
<if test="vehicleType != null">
vehicle_type = #{vehicleType,jdbcType=VARCHAR},
</if>
<if test="plateParseInfo != null">
plate_parse_info = #{plateParseInfo,jdbcType=VARCHAR},
</if>
<if test="entryTime != null">
entry_time = #{entryTime,jdbcType=BIGINT},
</if>
<if test="entryId != null">
entry_id = #{entryId,jdbcType=VARCHAR},
</if>
<if test="exitTime != null">
exit_time = #{exitTime,jdbcType=BIGINT},
</if>
<if test="exitId != null">
exit_id = #{exitId,jdbcType=VARCHAR},
</if>
<if test="tradeTime != null">
trade_time = #{tradeTime,jdbcType=OTHER},
</if>
<if test="tollRateVersion != null">
toll_rate_version = #{tollRateVersion,jdbcType=VARCHAR},
</if>
<if test="tradeType != null">
trade_type = #{tradeType,jdbcType=VARCHAR},
</if>
<if test="account != null">
account = #{account,jdbcType=NUMERIC},
</if>
<if test="cash != null">
cash = #{cash,jdbcType=NUMERIC},
</if>
<if test="tollCollectorName != null">
toll_collector_name = #{tollCollectorName,jdbcType=VARCHAR},
</if>
<if test="useType != null">
use_type = #{useType,jdbcType=VARCHAR},
</if>
<if test="areaId != null">
area_id = #{areaId,jdbcType=VARCHAR},
</if>
<if test="slotId != null">
slot_id = #{slotId,jdbcType=VARCHAR},
</if>
<if test="booking != null">
booking = #{booking,jdbcType=BOOLEAN},
</if>
<if test="parkingDetail != null">
parking_detail = #{parkingDetail,jdbcType=VARCHAR},
</if>
<if test="domainName != null">
domain_name = #{domainName,jdbcType=VARCHAR},
</if>
<if test="version != null">
version = #{version,jdbcType=OTHER},
</if>
<if test="deleted != null">
deleted = #{deleted,jdbcType=BOOLEAN},
</if>
<if test="insertUser != null">
insert_user = #{insertUser,jdbcType=VARCHAR},
</if>
<if test="insertDate != null">
insert_date = #{insertDate,jdbcType=TIMESTAMP},
</if>
<if test="updateUser != null">
update_user = #{updateUser,jdbcType=VARCHAR},
</if>
<if test="updateDate != null">
update_date = #{updateDate,jdbcType=TIMESTAMP},
</if>
<if test="exitRequestId != null">
exit_request_id = #{exitRequestId,jdbcType=VARCHAR},
</if>
<if test="exitRequestTime != null">
exit_request_time = #{exitRequestTime,jdbcType=BIGINT},
</if>
<if test="exitFlagNum != null">
exit_flag_num = #{exitFlagNum,jdbcType=VARCHAR},
</if>
</set>
where id = #{id}
</update>
<select id="selectByEntryTimeAndEntryId" resultMap="BaseResultMap">
<select id="selectAllByRequestIdOrExitRequestId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from t01_interface_parking_gate
where
entry_time = #{entryTime}
AND entry_id = #{entryId,jdbcType=VARCHAR}
request_id = #{requestId,jdbcType=VARCHAR} OR exit_request_id = #{requestId,jdbcType=VARCHAR}
</select>
<update id="updateExitId">
update t01_interface_parking_gate
set exit_id = #{exitId,jdbcType=VARCHAR}
</update>
<select id="selectAllByRequestIdOrExitRequestId" resultMap="BaseResultMap">
<select id="selectOneByExitFlagNum" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from t01_interface_parking_gate
where
request_id = #{requestId,jdbcType=VARCHAR} OR exit_request_id = #{requestId,jdbcType=VARCHAR}
exit_flag_num = #{exitFlagNum,jdbcType=VARCHAR}
limit 1
</select>
</mapper>
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