富文本框视频上传接口,专病路径复制。
This commit is contained in:
parent
395d2be780
commit
70b1dd0f05
@ -14,7 +14,9 @@ xinelu:
|
|||||||
sign-informed-file-url: /signInformed
|
sign-informed-file-url: /signInformed
|
||||||
# 素材库封面上传
|
# 素材库封面上传
|
||||||
propaganda-cover-url: /propagandaCover
|
propaganda-cover-url: /propagandaCover
|
||||||
# 宣教库封面上传
|
# 富文本框视频上传
|
||||||
|
common-video-url: /commonVideo
|
||||||
|
# 素材库封面上传
|
||||||
materials-cover-url: /materialsCover
|
materials-cover-url: /materialsCover
|
||||||
# 素材库封面上传
|
# 素材库封面上传
|
||||||
materials-video-url: /materialsVideo
|
materials-video-url: /materialsVideo
|
||||||
|
|||||||
@ -56,6 +56,11 @@ public class SystemBusinessConfig {
|
|||||||
*/
|
*/
|
||||||
private String propagandaCoverUrl;
|
private String propagandaCoverUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 富文本框视频
|
||||||
|
*/
|
||||||
|
private String commonVideoUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 素材库封面
|
* 素材库封面
|
||||||
*/
|
*/
|
||||||
@ -188,6 +193,14 @@ public class SystemBusinessConfig {
|
|||||||
this.propagandaCoverUrl = propagandaCoverUrl;
|
this.propagandaCoverUrl = propagandaCoverUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCommonVideoUrl() {
|
||||||
|
return commonVideoUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCommonVideoUrl(String commonVideoUrl) {
|
||||||
|
this.commonVideoUrl = commonVideoUrl;
|
||||||
|
}
|
||||||
|
|
||||||
public String getMaterialsCoverUrl() {
|
public String getMaterialsCoverUrl() {
|
||||||
return materialsCoverUrl;
|
return materialsCoverUrl;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,6 +17,11 @@ public class FileUploadPathConstants {
|
|||||||
*/
|
*/
|
||||||
public static final String PROPAGANDA_COVER_TYPE = "propagandaCoverUrl";
|
public static final String PROPAGANDA_COVER_TYPE = "propagandaCoverUrl";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 富文本框视频上传路径
|
||||||
|
*/
|
||||||
|
public static final String COMMON_VIDEO_TYPE = "commonVideoUrl";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 素材封面上传路径
|
* 素材封面上传路径
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -30,7 +30,7 @@ public class FileUploadController {
|
|||||||
* 文件上传
|
* 文件上传
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "文件上传", notes = "type:signInformedFileUrl:签约知情书上传,propagandaCoverUrl:宣教库封面上传,"
|
@ApiOperation(value = "文件上传", notes = "type:signInformedFileUrl:签约知情书上传,propagandaCoverUrl:宣教库封面上传,"
|
||||||
+ "materialsCoverUrl:宣教库封面上传,materialsVideoUrl:宣教库视频上传")
|
+ "materialsCoverUrl:素材库封面上传,materialsVideoUrl:素材库视频上传,commonVideoUrl:富文本框视频上传")
|
||||||
@PostMapping("/uploadFile")
|
@PostMapping("/uploadFile")
|
||||||
public AjaxResult uploadFile(@RequestParam("file") MultipartFile multipartFile, @RequestParam(value = "type") String type) throws Exception {
|
public AjaxResult uploadFile(@RequestParam("file") MultipartFile multipartFile, @RequestParam(value = "type") String type) throws Exception {
|
||||||
if (Objects.isNull(multipartFile) || StringUtils.isBlank(multipartFile.getOriginalFilename())) {
|
if (Objects.isNull(multipartFile) || StringUtils.isBlank(multipartFile.getOriginalFilename())) {
|
||||||
|
|||||||
@ -21,6 +21,8 @@ import com.xinelu.manage.domain.questioninfo.QuestionInfo;
|
|||||||
import com.xinelu.manage.domain.scriptInfo.ScriptInfo;
|
import com.xinelu.manage.domain.scriptInfo.ScriptInfo;
|
||||||
import com.xinelu.manage.domain.servicepackage.ServicePackage;
|
import com.xinelu.manage.domain.servicepackage.ServicePackage;
|
||||||
import com.xinelu.manage.domain.servicepackagecontent.ServicePackageContent;
|
import com.xinelu.manage.domain.servicepackagecontent.ServicePackageContent;
|
||||||
|
import com.xinelu.manage.domain.specialdiseasenode.SpecialDiseaseNode;
|
||||||
|
import com.xinelu.manage.domain.specialdiseasetriggercondition.SpecialDiseaseTriggerCondition;
|
||||||
import com.xinelu.manage.domain.textmessage.TextMessage;
|
import com.xinelu.manage.domain.textmessage.TextMessage;
|
||||||
import com.xinelu.manage.domain.textmessagesuittask.TextMessageSuitTask;
|
import com.xinelu.manage.domain.textmessagesuittask.TextMessageSuitTask;
|
||||||
import com.xinelu.manage.domain.wechattemplate.WechatTemplate;
|
import com.xinelu.manage.domain.wechattemplate.WechatTemplate;
|
||||||
@ -48,6 +50,7 @@ import com.xinelu.manage.mapper.questionsubjectoption.QuestionSubjectOptionMappe
|
|||||||
import com.xinelu.manage.mapper.scriptInfo.ScriptInfoMapper;
|
import com.xinelu.manage.mapper.scriptInfo.ScriptInfoMapper;
|
||||||
import com.xinelu.manage.mapper.servicepackage.ServicePackageMapper;
|
import com.xinelu.manage.mapper.servicepackage.ServicePackageMapper;
|
||||||
import com.xinelu.manage.mapper.servicepackagecontent.ServicePackageContentMapper;
|
import com.xinelu.manage.mapper.servicepackagecontent.ServicePackageContentMapper;
|
||||||
|
import com.xinelu.manage.mapper.specialdiseasetriggercondition.SpecialDiseaseTriggerConditionMapper;
|
||||||
import com.xinelu.manage.mapper.textmessage.TextMessageMapper;
|
import com.xinelu.manage.mapper.textmessage.TextMessageMapper;
|
||||||
import com.xinelu.manage.mapper.wechattemplate.WechatTemplateMapper;
|
import com.xinelu.manage.mapper.wechattemplate.WechatTemplateMapper;
|
||||||
import com.xinelu.manage.mapper.wechattemplatesuittask.WechatTemplateSuitTaskMapper;
|
import com.xinelu.manage.mapper.wechattemplatesuittask.WechatTemplateSuitTaskMapper;
|
||||||
@ -58,7 +61,9 @@ import com.xinelu.manage.service.propagandainfo.IPropagandaInfoService;
|
|||||||
import com.xinelu.manage.service.questioninfo.IQuestionInfoService;
|
import com.xinelu.manage.service.questioninfo.IQuestionInfoService;
|
||||||
import com.xinelu.manage.service.scriptInfo.IScriptInfoService;
|
import com.xinelu.manage.service.scriptInfo.IScriptInfoService;
|
||||||
import com.xinelu.manage.service.servicepackage.IServicePackageService;
|
import com.xinelu.manage.service.servicepackage.IServicePackageService;
|
||||||
|
import com.xinelu.manage.service.specialdiseasenode.ISpecialDiseaseNodeService;
|
||||||
import com.xinelu.manage.service.specialdiseaseroute.ISpecialDiseaseRouteService;
|
import com.xinelu.manage.service.specialdiseaseroute.ISpecialDiseaseRouteService;
|
||||||
|
import com.xinelu.manage.service.specialdiseasetriggercondition.ISpecialDiseaseTriggerConditionService;
|
||||||
import com.xinelu.manage.service.textmessage.ITextMessageService;
|
import com.xinelu.manage.service.textmessage.ITextMessageService;
|
||||||
import com.xinelu.manage.service.wechattemplate.IWechatTemplateService;
|
import com.xinelu.manage.service.wechattemplate.IWechatTemplateService;
|
||||||
import com.xinelu.manage.vo.questionInfo.QuestionVO;
|
import com.xinelu.manage.vo.questionInfo.QuestionVO;
|
||||||
@ -66,6 +71,7 @@ import com.xinelu.manage.vo.questionsubject.QuestionSubjectVO;
|
|||||||
import com.xinelu.manage.vo.questionsubjectoption.QuestionSubjectOptionVO;
|
import com.xinelu.manage.vo.questionsubjectoption.QuestionSubjectOptionVO;
|
||||||
import com.xinelu.manage.vo.servicepackage.ServicePackageVO;
|
import com.xinelu.manage.vo.servicepackage.ServicePackageVO;
|
||||||
import com.xinelu.manage.vo.servicepackagecontent.ServicePackageContentVO;
|
import com.xinelu.manage.vo.servicepackagecontent.ServicePackageContentVO;
|
||||||
|
import com.xinelu.manage.vo.specialdiseasenode.SpecialDiseaseNodeVO;
|
||||||
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteVO;
|
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteVO;
|
||||||
import com.xinelu.manage.vo.textmessage.TextMessageVO;
|
import com.xinelu.manage.vo.textmessage.TextMessageVO;
|
||||||
import com.xinelu.manage.vo.wechattemplate.WechatTemplateTaskVO;
|
import com.xinelu.manage.vo.wechattemplate.WechatTemplateTaskVO;
|
||||||
@ -131,6 +137,12 @@ public class KnowledgeBaseServiceImpl implements IKnowledgeBaseService {
|
|||||||
private QuestionSubjectOptionMapper questionSubjectOptionMapper;
|
private QuestionSubjectOptionMapper questionSubjectOptionMapper;
|
||||||
@Resource
|
@Resource
|
||||||
private ISpecialDiseaseRouteService specialDiseaseRouteService;
|
private ISpecialDiseaseRouteService specialDiseaseRouteService;
|
||||||
|
@Resource
|
||||||
|
private ISpecialDiseaseNodeService specialDiseaseNodeService;
|
||||||
|
@Resource
|
||||||
|
private ISpecialDiseaseTriggerConditionService specialDiseaseTriggerConditionService;
|
||||||
|
@Resource
|
||||||
|
private SpecialDiseaseTriggerConditionMapper specialDiseaseTriggerConditionMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TableDataInfo getBaseInfoList(BaseInfoQueryDto baseInfoQueryDto) {
|
public TableDataInfo getBaseInfoList(BaseInfoQueryDto baseInfoQueryDto) {
|
||||||
@ -542,16 +554,52 @@ public class KnowledgeBaseServiceImpl implements IKnowledgeBaseService {
|
|||||||
|
|
||||||
private void saveSpecialDiseaseRoute(KnowledgeBaseSaveDto knowledgeBaseSaveDto) {
|
private void saveSpecialDiseaseRoute(KnowledgeBaseSaveDto knowledgeBaseSaveDto) {
|
||||||
knowledgeBaseSaveDto.getSourceTemplateIds().forEach(sourceId -> {
|
knowledgeBaseSaveDto.getSourceTemplateIds().forEach(sourceId -> {
|
||||||
SpecialDiseaseRouteVO specialDiseaseRouteVO = specialDiseaseRouteService.selectSpecialDiseaseRouteById(sourceId);
|
Long saveRouteId = saveRoute(sourceId, null, knowledgeBaseSaveDto);
|
||||||
SpecialDiseaseRouteVO saveObj = new SpecialDiseaseRouteVO();
|
// 查询子路径
|
||||||
BeanUtils.copyBeanProp(saveObj, specialDiseaseRouteVO);
|
SpecialDiseaseRouteDTO specialDiseaseRoute = new SpecialDiseaseRouteDTO();
|
||||||
saveObj.setId(null);
|
specialDiseaseRoute.setParentRouteId(sourceId);
|
||||||
saveObj.setDepartmentId(knowledgeBaseSaveDto.getDepartmentId());
|
List<SpecialDiseaseRouteVO> childRouteList = specialDiseaseRouteService.selectSpecialDiseaseRouteList(specialDiseaseRoute);
|
||||||
saveObj.setDepartmentName(knowledgeBaseSaveDto.getDepartmentName());
|
childRouteList.forEach(childRoute -> {
|
||||||
// 节点信息
|
Long childRouteId = saveRoute(childRoute.getId(), saveRouteId, knowledgeBaseSaveDto);
|
||||||
|
// 触发条件保存
|
||||||
specialDiseaseRouteService.insertSpecialDiseaseRoute(saveObj);
|
SpecialDiseaseTriggerCondition specialDiseaseTriggerCondition = new SpecialDiseaseTriggerCondition();
|
||||||
|
specialDiseaseTriggerCondition.setRouteId(childRoute.getId());
|
||||||
|
List<SpecialDiseaseTriggerCondition> triggerConditionList = specialDiseaseTriggerConditionService.selectSpecialDiseaseTriggerConditionList(specialDiseaseTriggerCondition);
|
||||||
|
List<SpecialDiseaseTriggerCondition> triggerConditionSaveList = new ArrayList<>();
|
||||||
|
triggerConditionList.forEach(triggerCondition -> {
|
||||||
|
triggerCondition.setId(null);
|
||||||
|
triggerCondition.setRouteId(childRouteId);
|
||||||
|
triggerConditionSaveList.add(triggerCondition);
|
||||||
|
});
|
||||||
|
specialDiseaseTriggerConditionMapper.insertTriggerConditionList(triggerConditionSaveList);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Long saveRoute(Long specialDiseaseRouteId, Long parentRouteId, KnowledgeBaseSaveDto knowledgeBaseSaveDto) {
|
||||||
|
SpecialDiseaseRouteVO specialDiseaseRouteVO = specialDiseaseRouteService.selectSpecialDiseaseRouteById(specialDiseaseRouteId);
|
||||||
|
SpecialDiseaseRouteVO saveObj = new SpecialDiseaseRouteVO();
|
||||||
|
BeanUtils.copyBeanProp(saveObj, specialDiseaseRouteVO);
|
||||||
|
saveObj.setId(null);
|
||||||
|
saveObj.setParentRouteId(parentRouteId);
|
||||||
|
saveObj.setDepartmentId(knowledgeBaseSaveDto.getDepartmentId());
|
||||||
|
saveObj.setDepartmentName(knowledgeBaseSaveDto.getDepartmentName());
|
||||||
|
specialDiseaseRouteService.insertSpecialDiseaseRoute(saveObj);
|
||||||
|
// 节点信息
|
||||||
|
SpecialDiseaseNode specialDiseaseNode = new SpecialDiseaseNode();
|
||||||
|
specialDiseaseNode.setRouteId(specialDiseaseRouteId);
|
||||||
|
List<SpecialDiseaseNode> nodeList = specialDiseaseNodeService.selectSpecialDiseaseNodeList(specialDiseaseNode);
|
||||||
|
List<SpecialDiseaseNodeVO> specialDiseaseNodeVOs = new ArrayList<>();
|
||||||
|
nodeList.forEach(node -> {
|
||||||
|
SpecialDiseaseNodeVO specialDiseaseNodeVO = new SpecialDiseaseNodeVO();
|
||||||
|
BeanUtils.copyBeanProp(specialDiseaseNodeVO, node);
|
||||||
|
specialDiseaseNodeVO.setId(null);
|
||||||
|
specialDiseaseNodeVO.setRouteId(saveObj.getId());
|
||||||
|
specialDiseaseNodeVOs.add(specialDiseaseNodeVO);
|
||||||
|
});
|
||||||
|
saveObj.setSpecialDiseaseNodeList(specialDiseaseNodeVOs);
|
||||||
|
specialDiseaseRouteService.insertSpecialDiseaseRoute(saveObj);
|
||||||
|
return saveObj.getId();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,10 +31,14 @@ public class FileUplooadServiceImpl implements IFileUploadService {
|
|||||||
case FileUploadPathConstants.SIGN_INFORMED_TYPE:
|
case FileUploadPathConstants.SIGN_INFORMED_TYPE:
|
||||||
uploadPathUrl = SystemBusinessConfig.getProfile() + systemBusinessConfig.getSignInformedFileUrl();
|
uploadPathUrl = SystemBusinessConfig.getProfile() + systemBusinessConfig.getSignInformedFileUrl();
|
||||||
break;
|
break;
|
||||||
//护理宣教库封面路径上传
|
//宣教库封面路径上传
|
||||||
case FileUploadPathConstants.PROPAGANDA_COVER_TYPE:
|
case FileUploadPathConstants.PROPAGANDA_COVER_TYPE:
|
||||||
uploadPathUrl = SystemBusinessConfig.getProfile() + systemBusinessConfig.getPropagandaCoverUrl();
|
uploadPathUrl = SystemBusinessConfig.getProfile() + systemBusinessConfig.getPropagandaCoverUrl();
|
||||||
break;
|
break;
|
||||||
|
//宣教库视频路径上传
|
||||||
|
case FileUploadPathConstants.COMMON_VIDEO_TYPE:
|
||||||
|
uploadPathUrl = SystemBusinessConfig.getProfile() + systemBusinessConfig.getCommonVideoUrl();
|
||||||
|
break;
|
||||||
//素材库封面图片路径上传
|
//素材库封面图片路径上传
|
||||||
case FileUploadPathConstants.MATERIALS_COVER_TYPE:
|
case FileUploadPathConstants.MATERIALS_COVER_TYPE:
|
||||||
uploadPathUrl = SystemBusinessConfig.getProfile() + systemBusinessConfig.getMaterialsCoverUrl();
|
uploadPathUrl = SystemBusinessConfig.getProfile() + systemBusinessConfig.getMaterialsCoverUrl();
|
||||||
@ -51,13 +55,13 @@ public class FileUplooadServiceImpl implements IFileUploadService {
|
|||||||
}
|
}
|
||||||
//上传
|
//上传
|
||||||
String pictureName = "";
|
String pictureName = "";
|
||||||
if (StringUtils.equals(type, FileUploadPathConstants.MATERIALS_VIDEO_TYPE)) {
|
if (StringUtils.equals(type, FileUploadPathConstants.MATERIALS_VIDEO_TYPE) || StringUtils.equals(type, FileUploadPathConstants.COMMON_VIDEO_TYPE)) {
|
||||||
pictureName = FileUploadUtils.upload(uploadPathUrl, multipartFile, MimeTypeUtils.VIDEO_EXTENSION);
|
pictureName = FileUploadUtils.upload(uploadPathUrl, multipartFile, MimeTypeUtils.VIDEO_EXTENSION);
|
||||||
} else {
|
} else {
|
||||||
pictureName = FileUploadUtils.upload(uploadPathUrl, multipartFile, MimeTypeUtils.IMAGE_EXTENSION);
|
pictureName = FileUploadUtils.upload(uploadPathUrl, multipartFile, MimeTypeUtils.IMAGE_EXTENSION);
|
||||||
}
|
}
|
||||||
if (StringUtils.isBlank(pictureName)) {
|
if (StringUtils.isBlank(pictureName)) {
|
||||||
throw new ServiceException("图片上传失败,请联系管理员!");
|
throw new ServiceException("文件上传失败,请联系管理员!");
|
||||||
}
|
}
|
||||||
AjaxResult ajax = AjaxResult.success("上传成功!");
|
AjaxResult ajax = AjaxResult.success("上传成功!");
|
||||||
ajax.put("imgUrl", pictureName);
|
ajax.put("imgUrl", pictureName);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user