Authored by mali

鉴定服务

... ... @@ -9,6 +9,16 @@ public class LiveRecordTime {
private Integer startTime;
private Integer cameraCode;
public Integer getCameraCode() {
return cameraCode;
}
public void setCameraCode(Integer cameraCode) {
this.cameraCode = cameraCode;
}
public Integer getId() {
return id;
}
... ... @@ -36,9 +46,10 @@ public class LiveRecordTime {
public LiveRecordTime() {
}
public LiveRecordTime(Long orderCode, Integer startTime) {
public LiveRecordTime(Long orderCode, Integer startTime, Integer cameraCode) {
this.orderCode = orderCode;
this.startTime = startTime;
this.cameraCode = cameraCode;
}
@Override
... ...
... ... @@ -5,15 +5,17 @@
<id column="id" property="id" jdbcType="INTEGER" />
<result column="order_code" property="orderCode" jdbcType="BIGINT" />
<result column="start_time" property="startTime" jdbcType="INTEGER" />
<result column="camera_code" property="cameraCode" javaType="INTEGER" />
</resultMap>
<sql id="Base_Column_List" >
id, order_code, start_time
id, order_code, start_time, camera_code
</sql>
<select id="selectByOrderCode" resultType="java.lang.Integer">
select start_time from live_record_time where order_code = #{orderCode,jdbcType=BIGINT} limit 1
</select>
<insert id="insertOrUpdate" parameterType="com.yoho.order.model.LiveRecordTime" >
insert into live_record_time (order_code, start_time)
values (#{orderCode,jdbcType=BIGINT}, #{startTime,jdbcType=INTEGER})ON DUPLICATE KEY UPDATE start_time=#{startTime,jdbcType=INTEGER}
insert into live_record_time (order_code, start_time, camera_code)
values (#{orderCode,jdbcType=BIGINT}, #{startTime,jdbcType=INTEGER}, #{cameraCode,jdbcType=INTEGER})
ON DUPLICATE KEY UPDATE start_time=#{startTime,jdbcType=INTEGER}, camera_code = #{cameraCode,jdbcType=INTEGER}
</insert>
</mapper>
\ No newline at end of file
... ...
... ... @@ -229,12 +229,13 @@ public class UfoLiveService {
public Integer queryCurrentTime(Long orderCode, String phoneUid) throws PlatformException {
if (StringUtils.isNotEmpty(phoneUid)) { // 如果启动手机唯一标识来关联摄像头,则走此流程
if (null == phoneUidCameraService.selectByphoneUid(phoneUid)) {
PhoneUidCameraBo phoneUidCameraBo = phoneUidCameraService.selectByphoneUid(phoneUid);
if (null == phoneUidCameraBo) {
throw new PlatformException("没有选择摄像头", 400);
} else {
int currentTimeSeconds = DateUtil.getCurrentTimeSeconds();
if (!Objects.isNull(orderCode)) {
liveRecordTimeMapper.insertOrUpdate(new LiveRecordTime(orderCode, currentTimeSeconds));
liveRecordTimeMapper.insertOrUpdate(new LiveRecordTime(orderCode, currentTimeSeconds, phoneUidCameraBo.getCameraCode()));
}
return currentTimeSeconds;
}
... ... @@ -246,7 +247,7 @@ public class UfoLiveService {
int currentTimeSeconds = DateUtil.getCurrentTimeSeconds();
if (!Objects.isNull(orderCode)) {
liveRecordTimeMapper.insertOrUpdate(new LiveRecordTime(orderCode, currentTimeSeconds));
liveRecordTimeMapper.insertOrUpdate(new LiveRecordTime(orderCode, currentTimeSeconds, 0));
}
return currentTimeSeconds;
... ...