15143018065 5 mesi fa
parent
commit
4db0335ac6

+ 11 - 9
okc/src/main/java/com/ruoyi/okc/service/IOkcVideoRecService.java

@@ -1,19 +1,21 @@
 package com.ruoyi.okc.service;
 
 import java.util.List;
+import java.util.Map;
+
 import com.ruoyi.okc.domain.OkcVideoRec;
 
 /**
  * 视频项目编码记录信息Service接口
- * 
+ *
  * @author sun
  * @date 2022-12-30
  */
-public interface IOkcVideoRecService 
+public interface IOkcVideoRecService
 {
     /**
      * 查询视频项目编码记录信息
-     * 
+     *
      * @param id 视频项目编码记录信息主键
      * @return 视频项目编码记录信息
      */
@@ -21,7 +23,7 @@ public interface IOkcVideoRecService
 
     /**
      * 查询视频项目编码记录信息列表
-     * 
+     *
      * @param okcVideoRec 视频项目编码记录信息
      * @return 视频项目编码记录信息集合
      */
@@ -29,7 +31,7 @@ public interface IOkcVideoRecService
 
     /**
      * 新增视频项目编码记录信息
-     * 
+     *
      * @param okcVideoRec 视频项目编码记录信息
      * @return 结果
      */
@@ -37,15 +39,15 @@ public interface IOkcVideoRecService
 
     /**
      * 修改视频项目编码记录信息
-     * 
+     *
      * @param okcVideoRec 视频项目编码记录信息
      * @return 结果
      */
-    public int updateOkcVideoRec(OkcVideoRec okcVideoRec);
+    public Map<String, String> updateOkcVideoRec(OkcVideoRec okcVideoRec);
 
     /**
      * 批量删除视频项目编码记录信息
-     * 
+     *
      * @param ids 需要删除的视频项目编码记录信息主键集合
      * @return 结果
      */
@@ -53,7 +55,7 @@ public interface IOkcVideoRecService
 
     /**
      * 删除视频项目编码记录信息信息
-     * 
+     *
      * @param id 视频项目编码记录信息主键
      * @return 结果
      */

+ 12 - 6
okc/src/main/java/com/ruoyi/okc/service/impl/OkcVideoRecServiceImpl.java

@@ -1,9 +1,8 @@
 package com.ruoyi.okc.service.impl;
 
 import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
+import java.util.stream.Collectors;
 
 import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.utils.DateUtils;
@@ -11,6 +10,7 @@ import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.uuid.IdUtils;
 import com.ruoyi.okc.mapper.OkcVideoProMapper;
+import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruoyi.okc.mapper.OkcVideoRecMapper;
@@ -93,8 +93,8 @@ public class OkcVideoRecServiceImpl implements IOkcVideoRecService
      * @return 结果
      */
     @Override
-    public int updateOkcVideoRec(OkcVideoRec okcVideoRec)
-    {
+    public Map<String, String> updateOkcVideoRec(OkcVideoRec okcVideoRec) {
+        Map<String, String> res = new LinkedHashMap<>();
         if (StringUtils.isNotEmpty(okcVideoRec.getVideoId())) {
             if (ObjectUtils.isEmpty(okcVideoProMapper.selectOkcVideoProById(okcVideoRec.getVideoId()))) {
                 throw new ServiceException("该项目已经被删除,请重新新建项目");
@@ -104,7 +104,13 @@ public class OkcVideoRecServiceImpl implements IOkcVideoRecService
         okcVideoRec.setUpdateTimeStr(DateUtils.parseDateToStr(YYYYMMDDHHMMSS, new Date()));
         okcVideoRec.setUpdateBy(SecurityUtils.getUsername());
         okcVideoRec.setUpdateUnit(String.valueOf(SecurityUtils.getDeptId()));
-        return okcVideoRecMapper.updateOkcVideoRec(okcVideoRec);
+        okcVideoRecMapper.updateOkcVideoRec(okcVideoRec);
+        List<OkcVideoRec> recList = okcVideoRecMapper.selectOkcVideoRecList(okcVideoRec);
+        if (CollectionUtils.isNotEmpty(recList)) {
+            recList.sort((o1, o2) -> new Double(o2.getEndTime()).compareTo(new Double(o1.getEndTime())));
+            res.put("endTime", recList.get(0).getEndTime());
+        }
+        return res;
     }
 
     /**

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/okc/OkcVideoRecController.java

@@ -23,7 +23,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
 
 /**
  * 视频项目编码记录信息Controller
- * 
+ *
  * @author sun
  * @date 2022-12-30
  */
@@ -88,7 +88,7 @@ public class OkcVideoRecController extends BaseController
     @PutMapping
     public AjaxResult edit(@RequestBody OkcVideoRec okcVideoRec)
     {
-        return toAjax(okcVideoRecService.updateOkcVideoRec(okcVideoRec));
+        return success(okcVideoRecService.updateOkcVideoRec(okcVideoRec));
     }
 
     /**