Browse Source

app上报事件,添加图片排序

lyq 1 year ago
parent
commit
428e3cd9c3

+ 0 - 11
src/main/java/com/sooka/sponest/data/system/attach/controller/CenterdataTAttachController.java

@@ -129,15 +129,4 @@ public class CenterdataTAttachController extends BaseController {
     public R<List<AppDataTAttach>> urlAttchMpF(@PathVariable String busId) {
         return R.ok(centerdataTAttachMapper.urlAttchMpF(busId));
     }
-
-
-    @GetMapping("attachBFireLogById/{id}")
-    public R<List<AppDataTAttach>> attachBFireLogById(@PathVariable String id) {
-        return R.ok(centerdataTAttachMapper.attachBFireLogById(id));
-    }
-
-    @GetMapping("attachBFireLogByIdMp/{id}")
-    public R<List<AppDataTAttach>> attachBFireLogByIdMp(@PathVariable String id) {
-        return R.ok(centerdataTAttachMapper.attachBFireLogByIdMp(id));
-    }
 }

+ 1 - 5
src/main/java/com/sooka/sponest/data/system/attach/mapper/CenterdataTAttachMapper.java

@@ -71,17 +71,13 @@ public interface CenterdataTAttachMapper {
 
     List<AppDataTAttach> urlAttchMpF(String busId);
 
-    List<AppDataTAttach> attachBFireLogById(String id);
-
-    List<AppDataTAttach> attachBFireLogByIdMp(String id);
-
     int insertEventFileLog(CenterdataTAttach res);
 
     int insertListCenterdataTAttach(List<CenterdataTAttach> list);
 
     List<Map<String, Object>> selectFailUpattah();
 
-    int deleteListCenterdataTAttach(@Param("busId") String busId,@Param("list") List<CenterdataTAttach> list);
+    int deleteListCenterdataTAttach(@Param("busId") String busId, @Param("list") List<CenterdataTAttach> list);
 
     List<String> selectDataAttachPathByBusId(String busId);
 }

+ 3 - 3
src/main/java/com/sooka/sponest/data/system/attach/service/ICenterdataTAttachService.java

@@ -65,9 +65,9 @@ public interface ICenterdataTAttachService {
 
     List<Map<String, Object>> selectFailUpattah();
 
-    void updateEventAttachSchedule(Map<String, Object> paramMap,SysFile sysFile) throws Exception;
+    void updateEventAttachSchedule(Map<String, Object> paramMap, SysFile sysFile) throws Exception;
 
-    int deleteListCenterdataTAttach (String busId, List<CenterdataTAttach> list);
+    int deleteListCenterdataTAttach(String busId, List<CenterdataTAttach> list);
 
-    List<String> selectDataAttachPathByBusId (String busId);
+    List<String> selectDataAttachPathByBusId(String busId);
 }

+ 6 - 7
src/main/java/com/sooka/sponest/data/system/attach/service/impl/CenterdataTAttachServiceImpl.java

@@ -135,17 +135,17 @@ public class CenterdataTAttachServiceImpl extends BaseServiceImpl implements ICe
 
     @Transactional
     @Override
-    public void updateEventAttachSchedule(Map<String, Object> paramMap,SysFile sysFile) throws Exception{
-        CenterdataTAttach centerdataTAttach=new CenterdataTAttach();
-        centerdataTAttach.setFileName(MapUtils.getString(paramMap,"url"));
+    public void updateEventAttachSchedule(Map<String, Object> paramMap, SysFile sysFile) throws Exception {
+        CenterdataTAttach centerdataTAttach = new CenterdataTAttach();
+        centerdataTAttach.setFileName(MapUtils.getString(paramMap, "url"));
         centerdataTAttach.setAttachPath(sysFile.getUrl());
         centerdataTAttach.setBusSource("PC");
-        centerdataTAttach.setBusId(MapUtils.getString(paramMap,"busId"));
-       centerdataTAttachMapper.updateEventAttach(centerdataTAttach);
+        centerdataTAttach.setBusId(MapUtils.getString(paramMap, "busId"));
+        centerdataTAttachMapper.updateEventAttach(centerdataTAttach);
         setSookaDataBase(centerdataTAttach);
         centerdataTAttach.setFileName(JSON.toJSONString(centerdataTAttach));
         centerdataTAttach.setCreateTime(DateUtils.getNowDate());
-       centerdataTAttachMapper.insertEventFileLog(centerdataTAttach);
+        centerdataTAttachMapper.insertEventFileLog(centerdataTAttach);
     }
 
     @Override
@@ -172,5 +172,4 @@ public class CenterdataTAttachServiceImpl extends BaseServiceImpl implements ICe
     public List<String> selectDataAttachPathByBusId(String busId) {
         return centerdataTAttachMapper.selectDataAttachPathByBusId(busId);
     }
-
 }

+ 10 - 15
src/main/resources/mapper/system/attach/CenterdataTAttachMapper.xml

@@ -102,23 +102,17 @@
 
     <select id="urlAttch" parameterType="java.lang.String"
             resultType="com.sooka.sponest.data.system.attach.domain.AppDataTAttach">
-        select attach_path as attachPath,file_name as fileName,bus_source as busSource from centerdata_t_attach where bus_id = #{busId} and attach_path
-        not like concat('%', 'mp4', '%')
+        select attach_path attachPath,file_name fileName,bus_source busSource
+        from centerdata_t_attach
+        where bus_id = #{busId} and attach_path not like concat('%', 'mp4', '%')
+        order by create_time,attach_sorts
     </select>
 
     <select id="urlAttchMpF" parameterType="java.lang.String"
             resultType="com.sooka.sponest.data.system.attach.domain.AppDataTAttach">
-        select attach_path as attachPath,file_name as fileName,bus_source as busSource from centerdata_t_attach where bus_id = #{busId} and  attach_path like concat('%', 'mp4', '%')
-    </select>
-
-    <select id="attachBFireLogById" parameterType="java.lang.String"
-            resultType="com.sooka.sponest.data.system.attach.domain.AppDataTAttach">
-        select attach_path as  attachPath,file_name as fileName ,bus_source as busSource from  centerdata_t_attach where bus_id = #{id} and attach_path  not like concat('%', 'mp4', '%')
-    </select>
-
-    <select id="attachBFireLogByIdMp" parameterType="java.lang.String"
-            resultType="com.sooka.sponest.data.system.attach.domain.AppDataTAttach">
-        select attach_path as  attachPath,file_name as fileName ,bus_source as busSource from  centerdata_t_attach where bus_id = #{id} and attach_path   like concat('%', 'mp4', '%')
+        select attach_path attachPath,file_name fileName,bus_source busSource
+        from centerdata_t_attach
+        where bus_id = #{busId} and attach_path like concat('%', 'mp4', '%')
     </select>
 
     <insert id="insertEventFileLog" parameterType="CenterdataTAttach">
@@ -158,7 +152,8 @@
             )
         </foreach>
     </insert>
-    <select id="selectFailUpattah"  resultType="map">
+
+    <select id="selectFailUpattah" resultType="map">
         SELECT
         ch.bus_id busId,
         ch.attach_path url,
@@ -187,7 +182,7 @@
         order by a.create_time
     </select>
 
-    <delete id="deleteListCenterdataTAttach"  parameterType="CenterdataTAttach">
+    <delete id="deleteListCenterdataTAttach" parameterType="CenterdataTAttach">
         delete from centerdata_t_attach where bus_id = #{busId} and attach_path in
         <foreach collection="list" item="item" index="index" open="(" separator="," close=")">
             #{item.attachPath}