|
@@ -232,4 +232,34 @@ public class EvaluationNoticeServiceImpl extends ServiceImpl<EvaluationNoticeMap
|
|
|
}
|
|
|
return list;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean removeByIds(List<String> ids, HttpServletRequest request) {
|
|
|
+ for (String id : ids) {
|
|
|
+ EvaluationNotice evaluationNotice = baseMapper.selectById(id);
|
|
|
+ if (null != evaluationNotice) {
|
|
|
+ if (evaluationNotice.getNoticeAnnex().length() > 0) {
|
|
|
+ String[] docPaths = evaluationNotice.getNoticeAnnex().split(",");
|
|
|
+ for (String docPath : docPaths) {
|
|
|
+ HttpHeaders headers = new HttpHeaders();
|
|
|
+ headers.add("iamAccessToken", request.getHeader("Blade-Auth"));
|
|
|
+ headers.add("iamCode", request.getHeader("code"));
|
|
|
+ HttpEntity<Map> param = new HttpEntity<>(null, headers);
|
|
|
+ ResponseEntity<String> responseEntity2 = restTemplate.exchange(imaConfig.getGatewayUrl() + "f-center/dm/dmDoc/remove?docPath={1}", HttpMethod.GET, param, String.class, docPath);
|
|
|
+ log.info("\n code:{}\n header:{}\n body:{}\n", responseEntity2.getStatusCodeValue(), responseEntity2.getHeaders(), responseEntity2.getBody());
|
|
|
+ if (200 == responseEntity2.getStatusCodeValue()) {
|
|
|
+ ResultInfo resultInfo = JSON.parseObject(responseEntity2.getBody(), ResultInfo.class);
|
|
|
+ if ("删除成功".equals(resultInfo.getMessage())) {
|
|
|
+ System.out.println("删除" + docPath + "文件成功!");
|
|
|
+ } else {
|
|
|
+ System.out.println("删除" + docPath + "文件失败!失败原因为" + resultInfo.getMessage() + "!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ baseMapper.deleteBatchIds(ids);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|