Commit 69a2b4d8 by xmh

<feat> 导出任务批量删除接口

1 parent f3a5e598
......@@ -38,7 +38,7 @@ public class PicKeepRunner {
private VionConfig vionConfig;
@Scheduled(cron = "0 1 8 * * ?")
@Scheduled(cron = "13 05 01 * * ?")
public void run() {
JsonMessageUtil.JsonMessage<ImageKeepConfig> imageKeepConfigData = opsFeignClient.getImageKeepConfig();
ImageKeepConfig config = imageKeepConfigData.getData();
......
......@@ -4,8 +4,12 @@ import com.viontech.fanxing.commons.base.BaseExample;
import com.viontech.fanxing.commons.model.ExportDataExample;
import com.viontech.fanxing.commons.vo.ExportDataVo;
import com.viontech.fanxing.query.controller.base.ExportDataBaseController;
import com.viontech.keliu.util.JsonMessageUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@RequestMapping("/exportDatas")
......@@ -16,4 +20,13 @@ public class ExportDataController extends ExportDataBaseController {
ExportDataExample exportDataExample = (ExportDataExample) super.getExample(exportDataVo, type);
return exportDataExample;
}
@DeleteMapping("/batch")
@ResponseBody
public Object batchDelete(@RequestParam Long[] idArr) {
for (Long id : idArr) {
exportDataService.deleteByPrimaryKey(id);
}
return JsonMessageUtil.getSuccessJsonMsg("成功");
}
}
\ No newline at end of file
......@@ -33,7 +33,9 @@ public class ExportDataServiceImpl extends BaseServiceImpl<ExportData> implement
int i = super.deleteByPrimaryKey(b);
File file = new File(vionConfig.getImage().getPath() + "/export/" + b.toString());
try {
FileUtils.deleteDirectory(file);
if (file.exists()) {
FileUtils.deleteDirectory(file);
}
} catch (Exception e) {
throw new FanXingException("无法删除目录:{[]}", file.getPath());
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!