Authored by mali

鉴定视频优化

... ... @@ -25,7 +25,7 @@ import java.util.Map;
public class LoginController {
private static final Logger logger = LoggerFactory.getLogger("erpService");
private static final int SESSION_TIMEOUT_SECONDS = 3 * 60 * 60;
private static final int SESSION_TIMEOUT_SECONDS = 20 * 60;
@Resource
private LoginService loginService;
... ...
package com.yoho.order.dal;
import com.yoho.order.model.ManualInputPermission;
import org.apache.ibatis.annotations.Param;
public interface ManualInputPermissionMapper {
ManualInputPermission selectByPid(@Param("pid")Integer pid);
}
\ No newline at end of file
... ...
package com.yoho.order.model;
import lombok.Data;
import lombok.ToString;
@Data
@ToString
public class ManualInputPermission {
private Integer id;
private Integer pid;
private String pidName;
}
\ No newline at end of file
... ...
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yoho.order.dal.ManualInputPermissionMapper" >
<resultMap id="BaseResultMap" type="com.yoho.order.model.ManualInputPermission" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="pid" property="pid" jdbcType="INTEGER" />
<result column="pid_name" property="pidName" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
id, pid, pid_name
</sql>
<select id="selectByPid" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from manual_input_permission
where pid = #{pid,jdbcType=INTEGER} limit 1
</select>
</mapper>
\ No newline at end of file
... ...
... ... @@ -2,6 +2,8 @@ package com.yoho.ufo.order.controller;
import java.util.List;
import com.yoho.ufo.order.service.impl.*;
import com.yohobuy.ufo.model.order.resp.ManualInputPermissionVo;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ... @@ -14,10 +16,6 @@ import com.yoho.order.model.Area;
import com.yoho.order.model.BuyerOrderReq;
import com.yoho.order.model.QiniuLiveRecord;
import com.yoho.ufo.exception.PlatformException;
import com.yoho.ufo.order.service.impl.AsynVideoLiveService;
import com.yoho.ufo.order.service.impl.PhoneUidCameraService;
import com.yoho.ufo.order.service.impl.PhoneUidDepotService;
import com.yoho.ufo.order.service.impl.UfoLiveService;
import com.yoho.ufo.service.model.ApiResponse;
import com.yohobuy.ufo.model.order.bo.PhoneUidCameraBo;
import com.yohobuy.ufo.model.order.bo.PhoneUidDepotBo;
... ... @@ -44,6 +42,9 @@ public class UfoLiveController {
@Autowired
private PhoneUidDepotService phoneUidDepotService;
@Autowired
private ManualInputPermissionService manualInputPermissionService;
@RequestMapping(value = "/generateMp4Vedio")
public ApiResponse generateMp4Vedio(BuyerOrderReq req) {
LOGGER.info("generateMp4Vedio in. req is {}", req);
... ... @@ -223,4 +224,11 @@ public class UfoLiveController {
}
return new ApiResponse.ApiResponseBuilder().code(200).data(reslut).message("查询成功").build();
}
@RequestMapping(value = "/permissionSelecetByPid")
public ApiResponse permissionSelecetByPid() {
LOGGER.info("permissionSelecetByPid in.");
ManualInputPermissionVo vo = manualInputPermissionService.selectPermissionByPid();
return new ApiResponse.ApiResponseBuilder().code(200).data(vo).message("查询成功").build();
}
}
... ...
... ... @@ -864,6 +864,9 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
if (Constant.BUYER_ORDER_STATUS_PLATFORM_RECEIVE.getByteVal() != buyerOrder.getStatus().byteValue()) {
throw new ServiceException(400, "错误:订单状态已变化");
}
ufoLiveService.checkHasLiveVedioTime(Long.valueOf(orderCode)); // 检查是否有录制视频
int operateType = OperateTypeEnum.ONLY_JUDGE_UNSURE.getCode();
UserHelper userHelper = new UserHelper();
saveOrderOperateRecord(buyerOrder.getOrderCode(), userHelper, operateType, "");
... ... @@ -1085,6 +1088,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
throw new ServiceException(400,"错误:订单状态变化,操作[鉴定通过]失败,请重新刷新列表");
}
ufoLiveService.checkHasLiveVedioTime(Long.valueOf(orderCode)); // 检查是否有录制视频
//记录操作日志
int operateType =OperateTypeEnum.ONLY_JUDGE_PASS.getCode();
UserHelper userHelper = new UserHelper();
... ... @@ -1114,6 +1119,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
throw new ServiceException(400,"错误:订单状态变化,操作[鉴定不通过]失败,请重新刷新列表");
}
ufoLiveService.checkHasLiveVedioTime(Long.valueOf(orderCode)); // 检查是否有录制视频
//记录操作日志
int operateType =OperateTypeEnum.ONLY_JUDGE_REJECT.getCode();
UserHelper userHelper = new UserHelper();
... ...
package com.yoho.ufo.order.service.impl;
import com.yoho.order.dal.ManualInputPermissionMapper;
import com.yoho.order.model.ManualInputPermission;
import com.yoho.ufo.service.impl.UserHelper;
import com.yohobuy.ufo.model.order.resp.ManualInputPermissionVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* Created by li.ma on 2019/6/11.
*/
@Service
public class ManualInputPermissionService {
@Autowired
private ManualInputPermissionMapper manualInputPermissionMapper;
public ManualInputPermissionVo selectPermissionByPid() {
Integer pid = new UserHelper().getUserId();
ManualInputPermission manualInputPermission = manualInputPermissionMapper.selectByPid(pid);
ManualInputPermissionVo vo = new ManualInputPermissionVo();
vo.setHasPermission(null == manualInputPermission ? 0 : 1);
return vo;
}
}
... ...
... ... @@ -307,4 +307,15 @@ public class UfoLiveService {
public List<QiniuLiveRecord> queryVideoInfo(Integer startTime, Integer endTime) {
return qiniuLiveRecordMapper.selectByTime(startTime, endTime);
}
public boolean isStartLiveTime(Long orderCode) {
Integer startTime = liveRecordTimeMapper.selectByOrderCode(orderCode);
return null == startTime ? false : true;
}
public void checkHasLiveVedioTime(Long orderCode) {
if (!isStartLiveTime(orderCode)) {
throw new ServiceException(400, "请先录制视频再进行其他操作");
}
}
}
... ...
... ... @@ -52,6 +52,7 @@ datasources:
- com.yoho.order.dal.OrderConfigMapper
- com.yoho.order.dal.PhoneUidCameraMapper
- com.yoho.order.dal.PhoneUidDepotMapper
- com.yoho.order.dal.ManualInputPermissionMapper
ufo_resource:
servers:
... ...
... ... @@ -52,6 +52,7 @@ datasources:
- com.yoho.order.dal.OrderConfigMapper
- com.yoho.order.dal.PhoneUidCameraMapper
- com.yoho.order.dal.PhoneUidDepotMapper
- com.yoho.order.dal.ManualInputPermissionMapper
ufo_resource:
servers:
... ...