Prechádzať zdrojové kódy

fix: 修复最新bugId的获得方式

181250114 3 rokov pred
rodič
commit
89bcdd5c17

+ 4 - 0
web/src/main/java/cn/seecoder/web/dao/bug_list/BugListMapper.java

@@ -4,6 +4,7 @@ import org.apache.ibatis.annotations.*;
 import org.springframework.stereotype.Repository;
 import cn.seecoder.web.dao.provider.GeneralInsertUpdateSqlProvider;
 import cn.seecoder.web.model.po.bug_list.BugListPO;
+import org.springframework.stereotype.Service;
 
 import java.util.List;
 
@@ -30,4 +31,7 @@ public interface BugListMapper {
 
     @Select("select * from bug_list where id = #{bugId}")
     BugListPO selectById(int bugId);
+
+    @Select("select max(id) from bug_list")
+    int selectMaxId();
 }

+ 2 - 2
web/src/main/java/cn/seecoder/web/service/impl/bug_list/BugListServiceImpl.java

@@ -66,7 +66,8 @@ public class BugListServiceImpl implements BugListService {
                 .projectId(vo.getProjectId())
                 .processorId(vo.getProcessorId())
                 .build();
-        int bugId = bugListMapper.insert(po);
+        bugListMapper.insert(po);
+        int bugId = bugListMapper.selectMaxId();
 
         //ANA 日志需要打出新建的bugInfo信息
 //        try{
@@ -86,7 +87,6 @@ public class BugListServiceImpl implements BugListService {
 //
 //        }catch (Exception e){}
         try{
-            BugListPO bugPo = bugListMapper.selectById(bugId);
             JSONObject object = new JSONObject();
 //            object.put("bug_id",123);
             object.put("bug_id",bugId);