|
@@ -76,19 +76,22 @@ public class MetadataController extends BladeController {
|
|
@ApiOperation(value = "取消捕获", notes = "传入ids")
|
|
@ApiOperation(value = "取消捕获", notes = "传入ids")
|
|
public R cancelAllocation(@ApiParam(value = "主键集合", required = true) @RequestParam String ids,@RequestParam String type) {
|
|
public R cancelAllocation(@ApiParam(value = "主键集合", required = true) @RequestParam String ids,@RequestParam String type) {
|
|
MetadataClassification byId = iMetadataClassificationService.getById(Func.toLongList(ids).get(0));
|
|
MetadataClassification byId = iMetadataClassificationService.getById(Func.toLongList(ids).get(0));
|
|
-// String[] split = byId.getFileStorageType().split(",");
|
|
|
|
-// StringBuffer str = new StringBuffer();
|
|
|
|
-// for(String s :split){
|
|
|
|
-// if(s.isEmpty()){
|
|
|
|
-// continue;
|
|
|
|
-// }
|
|
|
|
-// if(s.equals(type)){
|
|
|
|
-// continue;
|
|
|
|
-// }
|
|
|
|
-// str.append(s+",");
|
|
|
|
-// }
|
|
|
|
-// String substring = str.toString().substring(0, str.lastIndexOf(","));
|
|
|
|
- byId.setFileStorageType(byId.getFileStorageType().replace(type,""));
|
|
|
|
|
|
+ String[] split = byId.getFileStorageType().split(",");
|
|
|
|
+ StringBuffer str = new StringBuffer();
|
|
|
|
+ for(String s :split){
|
|
|
|
+ if(s.isEmpty()){
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ if(s.equals(type)){
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ str.append(s+",");
|
|
|
|
+ }
|
|
|
|
+ String substring = str.toString();
|
|
|
|
+ if(str.lastIndexOf(",") > 0){
|
|
|
|
+ substring = str.toString().substring(0, str.lastIndexOf(","));
|
|
|
|
+ }
|
|
|
|
+ byId.setFileStorageType(substring);
|
|
iMetadataClassificationService.updateById(byId);
|
|
iMetadataClassificationService.updateById(byId);
|
|
return R.status(iMetadataClassificationService.updateById(byId));
|
|
return R.status(iMetadataClassificationService.updateById(byId));
|
|
}
|
|
}
|