Authored by mali

鉴定服务

@@ -9,6 +9,16 @@ public class LiveRecordTime { @@ -9,6 +9,16 @@ public class LiveRecordTime {
9 9
10 private Integer startTime; 10 private Integer startTime;
11 11
  12 + private Integer cameraCode;
  13 +
  14 + public Integer getCameraCode() {
  15 + return cameraCode;
  16 + }
  17 +
  18 + public void setCameraCode(Integer cameraCode) {
  19 + this.cameraCode = cameraCode;
  20 + }
  21 +
12 public Integer getId() { 22 public Integer getId() {
13 return id; 23 return id;
14 } 24 }
@@ -36,9 +46,10 @@ public class LiveRecordTime { @@ -36,9 +46,10 @@ public class LiveRecordTime {
36 public LiveRecordTime() { 46 public LiveRecordTime() {
37 } 47 }
38 48
39 - public LiveRecordTime(Long orderCode, Integer startTime) { 49 + public LiveRecordTime(Long orderCode, Integer startTime, Integer cameraCode) {
40 this.orderCode = orderCode; 50 this.orderCode = orderCode;
41 this.startTime = startTime; 51 this.startTime = startTime;
  52 + this.cameraCode = cameraCode;
42 } 53 }
43 54
44 @Override 55 @Override
@@ -5,15 +5,17 @@ @@ -5,15 +5,17 @@
5 <id column="id" property="id" jdbcType="INTEGER" /> 5 <id column="id" property="id" jdbcType="INTEGER" />
6 <result column="order_code" property="orderCode" jdbcType="BIGINT" /> 6 <result column="order_code" property="orderCode" jdbcType="BIGINT" />
7 <result column="start_time" property="startTime" jdbcType="INTEGER" /> 7 <result column="start_time" property="startTime" jdbcType="INTEGER" />
  8 + <result column="camera_code" property="cameraCode" javaType="INTEGER" />
8 </resultMap> 9 </resultMap>
9 <sql id="Base_Column_List" > 10 <sql id="Base_Column_List" >
10 - id, order_code, start_time 11 + id, order_code, start_time, camera_code
11 </sql> 12 </sql>
12 <select id="selectByOrderCode" resultType="java.lang.Integer"> 13 <select id="selectByOrderCode" resultType="java.lang.Integer">
13 select start_time from live_record_time where order_code = #{orderCode,jdbcType=BIGINT} limit 1 14 select start_time from live_record_time where order_code = #{orderCode,jdbcType=BIGINT} limit 1
14 </select> 15 </select>
15 <insert id="insertOrUpdate" parameterType="com.yoho.order.model.LiveRecordTime" > 16 <insert id="insertOrUpdate" parameterType="com.yoho.order.model.LiveRecordTime" >
16 - insert into live_record_time (order_code, start_time)  
17 - values (#{orderCode,jdbcType=BIGINT}, #{startTime,jdbcType=INTEGER})ON DUPLICATE KEY UPDATE start_time=#{startTime,jdbcType=INTEGER} 17 + insert into live_record_time (order_code, start_time, camera_code)
  18 + values (#{orderCode,jdbcType=BIGINT}, #{startTime,jdbcType=INTEGER}, #{cameraCode,jdbcType=INTEGER})
  19 + ON DUPLICATE KEY UPDATE start_time=#{startTime,jdbcType=INTEGER}, camera_code = #{cameraCode,jdbcType=INTEGER}
18 </insert> 20 </insert>
19 </mapper> 21 </mapper>
@@ -229,12 +229,13 @@ public class UfoLiveService { @@ -229,12 +229,13 @@ public class UfoLiveService {
229 229
230 public Integer queryCurrentTime(Long orderCode, String phoneUid) throws PlatformException { 230 public Integer queryCurrentTime(Long orderCode, String phoneUid) throws PlatformException {
231 if (StringUtils.isNotEmpty(phoneUid)) { // 如果启动手机唯一标识来关联摄像头,则走此流程 231 if (StringUtils.isNotEmpty(phoneUid)) { // 如果启动手机唯一标识来关联摄像头,则走此流程
232 - if (null == phoneUidCameraService.selectByphoneUid(phoneUid)) { 232 + PhoneUidCameraBo phoneUidCameraBo = phoneUidCameraService.selectByphoneUid(phoneUid);
  233 + if (null == phoneUidCameraBo) {
233 throw new PlatformException("没有选择摄像头", 400); 234 throw new PlatformException("没有选择摄像头", 400);
234 } else { 235 } else {
235 int currentTimeSeconds = DateUtil.getCurrentTimeSeconds(); 236 int currentTimeSeconds = DateUtil.getCurrentTimeSeconds();
236 if (!Objects.isNull(orderCode)) { 237 if (!Objects.isNull(orderCode)) {
237 - liveRecordTimeMapper.insertOrUpdate(new LiveRecordTime(orderCode, currentTimeSeconds)); 238 + liveRecordTimeMapper.insertOrUpdate(new LiveRecordTime(orderCode, currentTimeSeconds, phoneUidCameraBo.getCameraCode()));
238 } 239 }
239 return currentTimeSeconds; 240 return currentTimeSeconds;
240 } 241 }
@@ -246,7 +247,7 @@ public class UfoLiveService { @@ -246,7 +247,7 @@ public class UfoLiveService {
246 int currentTimeSeconds = DateUtil.getCurrentTimeSeconds(); 247 int currentTimeSeconds = DateUtil.getCurrentTimeSeconds();
247 248
248 if (!Objects.isNull(orderCode)) { 249 if (!Objects.isNull(orderCode)) {
249 - liveRecordTimeMapper.insertOrUpdate(new LiveRecordTime(orderCode, currentTimeSeconds)); 250 + liveRecordTimeMapper.insertOrUpdate(new LiveRecordTime(orderCode, currentTimeSeconds, 0));
250 } 251 }
251 252
252 return currentTimeSeconds; 253 return currentTimeSeconds;