|
|
@@ -19,6 +19,7 @@ import org.springblade.core.tool.utils.BeanUtil;
|
|
|
import org.springblade.core.tool.utils.Func;
|
|
|
import org.springblade.manager.entity.WbsTreePrivate;
|
|
|
import org.springblade.manager.feign.WbsTreePrivateClient;
|
|
|
+import org.springblade.resource.feign.NewIOSSClient;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
@@ -39,6 +40,7 @@ public class ContractLogClientImpl implements ContractLogClient {
|
|
|
|
|
|
private final WbsTreePrivateClient wbsTreePrivateClient;
|
|
|
private final JdbcTemplate jdbcTemplate;
|
|
|
+ private final NewIOSSClient newIOSSClient;
|
|
|
|
|
|
@Override
|
|
|
public List<JSONObject> queryContractLogWbsByBusinessId(String businessId) {
|
|
|
@@ -90,6 +92,16 @@ public class ContractLogClientImpl implements ContractLogClient {
|
|
|
@Override
|
|
|
public void updateTheLogPdfUrlByIds(String theLogId, String pdfUrl) {
|
|
|
for (String id : theLogId.split(",")) {
|
|
|
+ ContractLog log = this.contractLogService.getById(id);
|
|
|
+ //将原来的OSS文件删除
|
|
|
+ if(StringUtils.isNotEmpty(pdfUrl)&&log!=null&&StringUtils.isNotEmpty(log.getPdfUrl())){
|
|
|
+ String pdfUrlResult = log.getPdfUrl();
|
|
|
+ int lastIndex = pdfUrlResult.lastIndexOf("upload");
|
|
|
+ if (lastIndex != -1) {
|
|
|
+ String fileName = pdfUrlResult.substring(lastIndex);
|
|
|
+ this.newIOSSClient.removeFile(fileName);
|
|
|
+ }
|
|
|
+ }
|
|
|
this.contractLogService.update(Wrappers.<ContractLog>lambdaUpdate().set(ContractLog::getPdfUrl, pdfUrl).eq(ContractLog::getId, id));
|
|
|
}
|
|
|
}
|