|
@@ -11,9 +11,7 @@ import com.fdkankan.fusion.exception.BusinessException;
|
|
|
import com.fdkankan.fusion.common.ResultData;
|
|
|
import com.fdkankan.fusion.entity.CaseFiles;
|
|
|
import com.fdkankan.fusion.request.AddByMediaLibraryParam;
|
|
|
-import com.fdkankan.fusion.service.ICaseFilesService;
|
|
|
-import com.fdkankan.fusion.service.ICaseService;
|
|
|
-import com.fdkankan.fusion.service.ICommonUploadService;
|
|
|
+import com.fdkankan.fusion.service.*;
|
|
|
import com.fdkankan.fusion.service.impl.UploadService;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -46,6 +44,10 @@ public class CaseFilesController extends BaseController{
|
|
|
UploadService uploadService;
|
|
|
@Autowired
|
|
|
ICommonUploadService commonUploadService;
|
|
|
+ @Autowired
|
|
|
+ ICaseOverviewService caseOverviewService;
|
|
|
+ @Autowired
|
|
|
+ ICaseTabulationService caseTabulationService;
|
|
|
|
|
|
@Value("${spring.profiles.active}")
|
|
|
private String environment;
|
|
@@ -168,10 +170,19 @@ public class CaseFilesController extends BaseController{
|
|
|
public ResultData updateTitle(
|
|
|
@RequestParam(required = false) Integer filesId ,
|
|
|
@RequestParam(required = false) String filesTitle ){
|
|
|
- if( StringUtils.isEmpty(filesTitle)
|
|
|
- || filesId== null ){
|
|
|
+ if( StringUtils.isEmpty(filesTitle) || filesId== null ){
|
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
}
|
|
|
+ CaseFiles caseFiles = caseFilesService.getById(filesId);
|
|
|
+ if(caseFiles == null){
|
|
|
+ throw new BusinessException(ResultCode.RECORD_NOT_EXIST);
|
|
|
+ }
|
|
|
+ if(caseFiles.getOverviewId() != null){
|
|
|
+ caseOverviewService.updateTitleById(caseFiles.getOverviewId(),filesTitle);
|
|
|
+ }
|
|
|
+ if(caseFiles.getTabulationId() != null){
|
|
|
+ caseTabulationService.updateTitleById(caseFiles.getTabulationId(),filesTitle);
|
|
|
+ }
|
|
|
LambdaUpdateWrapper<CaseFiles> wrapper = new LambdaUpdateWrapper<>();
|
|
|
wrapper.eq(CaseFiles::getFilesId,filesId);
|
|
|
wrapper.set(CaseFiles::getFilesTitle,filesTitle);
|