Pārlūkot izejas kodu

Merge branch 'master' of http://47.110.251.215:3000/java_org/bladex

huangtf 2 gadi atpakaļ
vecāks
revīzija
bf9366fa61

+ 1 - 5
blade-service/blade-business/src/main/java/org/springblade/business/controller/MetadataController.java

@@ -52,11 +52,7 @@ public class MetadataController extends BladeController {
     @ApiOperationSupport(order = 3)
     @ApiOperation(value = "逻辑删除", notes = "传入ids")
     public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
-        boolean b = iMetadataClassificationService.deleteLogic(Func.toLongList(ids));
-        if(b){
-            return R.status(iMetadataClassificationService.deleteTableField(Func.toLongList(ids).get(0)));
-        }
-        return R.status(false);
+        return R.status(iMetadataClassificationService.deleteTableField(Func.toLongList(ids).get(0)));
     }
 
     /**

+ 1 - 2
blade-service/blade-business/src/main/java/org/springblade/business/mapper/MetadataClassificationMapper.xml

@@ -77,10 +77,9 @@
         <foreach collection="ids" item="ids" index="ids" open="(" separator="," close=")">
             ${ids}
         </foreach>
---         and locate(#{type},file_storage_type) = 0
     </update>
     <update id="removeMetadataBytype">
         update u_metadata_classification set file_storage_type = REPLACE(file_storage_type,#{type},'')
-        where  locate(#{type},file_storage_type) = 0
+        where  locate(#{type},file_storage_type) > 0
     </update>
 </mapper>

+ 2 - 1
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/MetadataClassificationServiceImpl.java

@@ -65,7 +65,7 @@ public class MetadataClassificationServiceImpl
             }else{
                 MetadataClassification metadataClassification = baseMapper.selectMetadaOne(obj.getContainerName(), obj.getCode(),
                         "file_key_" + obj.getCode().toLowerCase(),obj.getId());
-                if(metadataClassification == null){
+                if(metadataClassification != null){
                     return false;
                 }
                 String filetype = "varchar";
@@ -106,6 +106,7 @@ public class MetadataClassificationServiceImpl
         try {
             MetadataClassification metadataClassification = baseMapper.selectById(ids);
             baseMapper.deleteTableField(metadataClassification.getContainerInitTabName(),metadataClassification.getFieldKey());
+            baseMapper.deleteById(ids);
         } catch (Exception e) {
             e.printStackTrace();
             return false;