ソースを参照

修改模型方法调整

wangchangsheng 2 年 前
コミット
5b287054b2

+ 1 - 1
gyee-sample-impala/src/main/java/com/gyee/impala/service/impl/master/diagnose/DiagnosetrainhistoryServiceImpl.java

@@ -91,7 +91,7 @@ public class DiagnosetrainhistoryServiceImpl extends ServiceImpl<Diagnosetrainhi
     public void editDiagnosetrainhistory(Diagnosetrainhistory history) {
         try {
             List<Diagnosetrainhistory> list = getList(true,"","", history.getModel());
-            if (list.size() <= 1 && !history.isEnable()) {
+            if (null != list && list.size() == 1 && !history.isEnable() && history.getId().equals(list.get(0).getId())) {
                 throw new CustomException(ResultCode.ERROR_MODEL);
             }
             for (Diagnosetrainhistory h : list) {

+ 1 - 1
gyee-sample-impala/src/main/java/com/gyee/impala/service/master/diagnose/DiagnosetrainhistoryService.java

@@ -42,7 +42,7 @@ public interface DiagnosetrainhistoryService extends IService<Diagnosetrainhisto
      * 编辑模型
      * @param history
      */
-    void editDiagnosetrainhistory(Diagnosetrainhistory history);
+    void editDiagnosetrainhistory(Diagnosetrainhistory history) throws CustomException;
 
 
     /**