From e7230f8bf081a346b5f1a05128e86eeb269fa476 Mon Sep 17 00:00:00 2001 From: haown <454902499@qq.com> Date: Wed, 10 Jul 2024 18:09:00 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9F=A5=E8=AF=86=E5=BA=93=E5=A4=8D=E5=88=B6?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xinelu/common/constant/Constants.java | 5 + .../constant/KnowledgeBaseConstants.java | 13 + .../domain/propagandainfo/PropagandaInfo.java | 5 + .../domain/questioninfo/QuestionInfo.java | 5 + .../dto/operationinfo/BaseInfoQueryDto.java | 44 ++++ .../impl/KnowledgeBaseServiceImpl.java | 242 ++++++++++++++++++ .../impl/PropagandaInfoServiceImpl.java | 5 + .../impl/ServicePackageServiceImpl.java | 5 - .../propagandainfo/PropagandaInfoMapper.xml | 12 +- .../questioninfo/QuestionInfoMapper.xml | 9 + .../servicepackage/ServicePackageMapper.xml | 1 + .../SpecialDiseaseRouteMapper.xml | 2 +- .../wechattemplate/WechatTemplateMapper.xml | 3 +- 13 files changed, 342 insertions(+), 9 deletions(-) diff --git a/postdischarge-common/src/main/java/com/xinelu/common/constant/Constants.java b/postdischarge-common/src/main/java/com/xinelu/common/constant/Constants.java index bcea6215..3bfa89ec 100644 --- a/postdischarge-common/src/main/java/com/xinelu/common/constant/Constants.java +++ b/postdischarge-common/src/main/java/com/xinelu/common/constant/Constants.java @@ -209,6 +209,11 @@ public class Constants { */ public static final String DEPARTMENT_CODE = "DTC"; + /** + * 宣教编码 + */ + public static final String PROPAGANDA_INFO_CODE = "PIC"; + /** * 门诊患者 */ diff --git a/postdischarge-common/src/main/java/com/xinelu/common/constant/KnowledgeBaseConstants.java b/postdischarge-common/src/main/java/com/xinelu/common/constant/KnowledgeBaseConstants.java index cd2768f3..5c44c9bd 100644 --- a/postdischarge-common/src/main/java/com/xinelu/common/constant/KnowledgeBaseConstants.java +++ b/postdischarge-common/src/main/java/com/xinelu/common/constant/KnowledgeBaseConstants.java @@ -23,4 +23,17 @@ public class KnowledgeBaseConstants { * 短信库 */ public static final String MESSAGE = "MESSAGE"; + /** + * 宣教库 + */ + public static final String PROPAGANDA = "PROPAGANDA"; + /** + * 服务包 + */ + public static final String SERVICEPACKAGE = "SERVICEPACKAGE"; + + /** + * 问卷 + */ + public static final String QUESTION = "QUESTION"; } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/propagandainfo/PropagandaInfo.java b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/propagandainfo/PropagandaInfo.java index 6faf54aa..e5e1f259 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/propagandainfo/PropagandaInfo.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/propagandainfo/PropagandaInfo.java @@ -100,4 +100,9 @@ public class PropagandaInfo extends BaseEntity { /** 删除标识,0:未删除,1:已删除 */ private Integer delFlag; + + /** + * 公共库模板id + */ + private Long sourceTemplateId; } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/questioninfo/QuestionInfo.java b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/questioninfo/QuestionInfo.java index 89a66ff9..e20b0850 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/questioninfo/QuestionInfo.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/questioninfo/QuestionInfo.java @@ -130,6 +130,11 @@ public class QuestionInfo extends BaseEntity { @Excel(name = "问卷类型") private String questionType; + /** + * 公共库模板id + */ + private Long sourceTemplateId; + @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/dto/operationinfo/BaseInfoQueryDto.java b/postdischarge-manage/src/main/java/com/xinelu/manage/dto/operationinfo/BaseInfoQueryDto.java index ed0c61ff..9fbf535a 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/dto/operationinfo/BaseInfoQueryDto.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/dto/operationinfo/BaseInfoQueryDto.java @@ -65,4 +65,48 @@ public class BaseInfoQueryDto { @ApiModelProperty(value = "短信状态,上架:GROUNDING,下架:OFF_SHELF") private String textMessageStatus; + + /** 宣教标题(宣教名称) */ + @ApiModelProperty(value = "宣教标题") + private String propagandaTitle; + + /** 宣教类型,用药知识:MEDICATION_KNOWLEDGE,疾病科普:DISEASE_POPULARIZATION,运动营养:SPORT_NUTRITION,其他知识:OTHER_KNOWLEDGE, + 定制内容:CUSTOMIZED_CONTENT */ + @ApiModelProperty(value = "宣教类型,用药知识:MEDICATION_KNOWLEDGE,疾病科普:DISEASE_POPULARIZATION,运动营养:SPORT_NUTRITION,其他知识:OTHER_KNOWLEDGE,定制内容:CUSTOMIZED_CONTENT") + private String propagandaType; + + /** 宣教状态,创作中:CREATE_PROCESS,创作完成:CREATE_COMPLETE,审核中:IN_REVIEW,审核通过:APPROVED,审核不通过:REVIEW_FAILED */ + @ApiModelProperty(value = "宣教状态,创作中:CREATE_PROCESS,创作完成:CREATE_COMPLETE,审核中:IN_REVIEW,审核通过:APPROVED,审核不通过:REVIEW_FAILED") + private String propagandaStatus; + + /** + * 服务包名称 + */ + @ApiModelProperty(value = "服务包名称") + private String packageName; + + /** + * 是否发布,0:否,1:是 + */ + @ApiModelProperty(value = "是否发布,0:否,1:是") + private Integer whetherRelease; + + /** + * 病种名称 + */ + @ApiModelProperty(value = "病种名称") + private String diseaseTypeName; + + /** + * 问卷标题 + */ + @ApiModelProperty(value = "问卷标题") + private String questionnaireName; + + /** + * 问卷状态,已发布:PUBLISHED,未发布:UNPUBLISHED + */ + @ApiModelProperty(value = "问卷状态,已发布:PUBLISHED,未发布:UNPUBLISHED") + private String questionnaireStatus; + } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/knowledgebase/impl/KnowledgeBaseServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/knowledgebase/impl/KnowledgeBaseServiceImpl.java index d7c55653..de8d1374 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/knowledgebase/impl/KnowledgeBaseServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/knowledgebase/impl/KnowledgeBaseServiceImpl.java @@ -1,16 +1,26 @@ package com.xinelu.manage.service.knowledgebase.impl; import com.github.pagehelper.PageInfo; +import com.xinelu.common.constant.Constants; import com.xinelu.common.constant.HttpStatus; import com.xinelu.common.constant.KnowledgeBaseConstants; import com.xinelu.common.core.page.TableDataInfo; import com.xinelu.common.exception.ServiceException; import com.xinelu.common.utils.PageUtils; +import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.StringUtils; import com.xinelu.common.utils.bean.BeanUtils; +import com.xinelu.common.utils.codes.GenerateSystemCodeUtil; +import com.xinelu.manage.domain.agency.Agency; +import com.xinelu.manage.domain.department.Department; import com.xinelu.manage.domain.departmentdiseasetype.DepartmentDiseaseType; import com.xinelu.manage.domain.operationInfo.OperationInfo; +import com.xinelu.manage.domain.propagandainfo.PropagandaInfo; +import com.xinelu.manage.domain.propagandamaterials.PropagandaMaterials; +import com.xinelu.manage.domain.questioninfo.QuestionInfo; import com.xinelu.manage.domain.scriptInfo.ScriptInfo; +import com.xinelu.manage.domain.servicepackage.ServicePackage; +import com.xinelu.manage.domain.servicepackagecontent.ServicePackageContent; import com.xinelu.manage.domain.textmessage.TextMessage; import com.xinelu.manage.domain.textmessagesuittask.TextMessageSuitTask; import com.xinelu.manage.domain.wechattemplate.WechatTemplate; @@ -18,30 +28,52 @@ import com.xinelu.manage.domain.wechattemplatesuittask.WechatTemplateSuitTask; import com.xinelu.manage.dto.knowledgebase.KnowledgeBaseSaveDto; import com.xinelu.manage.dto.operationinfo.BaseInfoQueryDto; import com.xinelu.manage.dto.operationinfo.OperationInfoDto; +import com.xinelu.manage.dto.propagandainfo.PropagandaInfoDto; +import com.xinelu.manage.dto.questioninfo.QuestionInfoDto; import com.xinelu.manage.dto.script.ScriptInfoDto; +import com.xinelu.manage.dto.servicepackage.ServicePackageAddDTO; +import com.xinelu.manage.dto.servicepackage.ServicePackageDto; import com.xinelu.manage.dto.textmessage.TextMessageDTO; import com.xinelu.manage.dto.textmessage.TextMessageTaskDTO; import com.xinelu.manage.dto.wechattemplate.WechatTemplateDTO; import com.xinelu.manage.dto.wechattemplate.WechatTemplateTaskDTO; +import com.xinelu.manage.mapper.agency.AgencyMapper; +import com.xinelu.manage.mapper.department.DepartmentMapper; import com.xinelu.manage.mapper.operationInfo.OperationInfoMapper; +import com.xinelu.manage.mapper.propagandainfo.PropagandaInfoMapper; +import com.xinelu.manage.mapper.propagandamaterials.PropagandaMaterialsMapper; +import com.xinelu.manage.mapper.questionsubjectoption.QuestionSubjectOptionMapper; import com.xinelu.manage.mapper.scriptInfo.ScriptInfoMapper; +import com.xinelu.manage.mapper.servicepackage.ServicePackageMapper; +import com.xinelu.manage.mapper.servicepackagecontent.ServicePackageContentMapper; import com.xinelu.manage.mapper.textmessage.TextMessageMapper; import com.xinelu.manage.mapper.wechattemplate.WechatTemplateMapper; import com.xinelu.manage.mapper.wechattemplatesuittask.WechatTemplateSuitTaskMapper; import com.xinelu.manage.service.departmentdiseasetype.IDepartmentDiseaseTypeService; import com.xinelu.manage.service.knowledgebase.IKnowledgeBaseService; import com.xinelu.manage.service.operationInfo.IOperationInfoService; +import com.xinelu.manage.service.propagandainfo.IPropagandaInfoService; +import com.xinelu.manage.service.questioninfo.IQuestionInfoService; import com.xinelu.manage.service.scriptInfo.IScriptInfoService; +import com.xinelu.manage.service.servicepackage.IServicePackageService; import com.xinelu.manage.service.textmessage.ITextMessageService; import com.xinelu.manage.service.wechattemplate.IWechatTemplateService; +import com.xinelu.manage.vo.questionInfo.QuestionVO; +import com.xinelu.manage.vo.questionsubject.QuestionSubjectVO; +import com.xinelu.manage.vo.questionsubjectoption.QuestionSubjectOptionVO; +import com.xinelu.manage.vo.servicepackage.ServicePackageVO; +import com.xinelu.manage.vo.servicepackagecontent.ServicePackageContentVO; import com.xinelu.manage.vo.textmessage.TextMessageVO; import com.xinelu.manage.vo.wechattemplate.WechatTemplateTaskVO; +import java.time.LocalDateTime; +import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; import javax.annotation.Resource; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; /** * @description: 知识库Service业务层处理 @@ -71,9 +103,34 @@ public class KnowledgeBaseServiceImpl implements IKnowledgeBaseService { private ITextMessageService textMessageService; @Resource private IDepartmentDiseaseTypeService departmentDiseaseTypeService; + @Resource + private IPropagandaInfoService propagandaInfoService; + @Resource + private PropagandaInfoMapper propagandaInfoMapper; + @Resource + private GenerateSystemCodeUtil generateSystemCodeUtil; + @Resource + private PropagandaMaterialsMapper propagandaMaterialsMapper; + @Resource + private DepartmentMapper departmentMapper; + @Resource + private AgencyMapper agencyMapper; + @Resource + private ServicePackageMapper servicePackageMapper; + @Resource + private IServicePackageService servicePackageService; + @Resource + private ServicePackageContentMapper servicePackageContentMapper; + @Resource + private IQuestionInfoService questionInfoService; + @Resource + private QuestionSubjectOptionMapper questionSubjectOptionMapper; @Override public TableDataInfo getBaseInfoList(BaseInfoQueryDto baseInfoQueryDto) { + if (StringUtils.isBlank(baseInfoQueryDto.getType())) { + throw new ServiceException("知识库类型不能为空"); + } TableDataInfo rspData = new TableDataInfo(); switch(baseInfoQueryDto.getType()){ case KnowledgeBaseConstants.OPERATOR: @@ -124,6 +181,42 @@ public class KnowledgeBaseServiceImpl implements IKnowledgeBaseService { rspData.setPageNum(new PageInfo(messageList).getPageNum()); rspData.setTotal(new PageInfo(messageList).getTotal()); break; + case KnowledgeBaseConstants.PROPAGANDA: + PropagandaInfoDto propagandaInfo = new PropagandaInfoDto(); + BeanUtils.copyBeanProp(propagandaInfo, baseInfoQueryDto); + PageUtils.startPage(); + List propagandaList = propagandaInfoService.selectPropagandaInfoList(propagandaInfo); + rspData.setCode(HttpStatus.SUCCESS); + rspData.setMsg("查询成功"); + rspData.setRows(propagandaList); + // 返回 页码 + rspData.setPageNum(new PageInfo(propagandaList).getPageNum()); + rspData.setTotal(new PageInfo(propagandaList).getTotal()); + break; + case KnowledgeBaseConstants.SERVICEPACKAGE: + ServicePackageDto servicePackage = new ServicePackageDto(); + BeanUtils.copyBeanProp(servicePackage, baseInfoQueryDto); + PageUtils.startPage(); + List servicePackageList = servicePackageMapper.selectServicePackageLists(servicePackage); + rspData.setCode(HttpStatus.SUCCESS); + rspData.setMsg("查询成功"); + rspData.setRows(servicePackageList); + // 返回 页码 + rspData.setPageNum(new PageInfo(servicePackageList).getPageNum()); + rspData.setTotal(new PageInfo(servicePackageList).getTotal()); + break; + case KnowledgeBaseConstants.QUESTION: + QuestionInfoDto questionInfo = new QuestionInfoDto(); + BeanUtils.copyBeanProp(questionInfo, baseInfoQueryDto); + PageUtils.startPage(); + List questionInfoList = questionInfoService.selectQuestionInfoList(questionInfo); + rspData.setCode(HttpStatus.SUCCESS); + rspData.setMsg("查询成功"); + rspData.setRows(questionInfoList); + // 返回 页码 + rspData.setPageNum(new PageInfo(questionInfoList).getPageNum()); + rspData.setTotal(new PageInfo(questionInfoList).getTotal()); + break; } return rspData; } @@ -152,6 +245,15 @@ public class KnowledgeBaseServiceImpl implements IKnowledgeBaseService { case KnowledgeBaseConstants.MESSAGE: saveMessage(knowledgeBaseSaveDto); break; + case KnowledgeBaseConstants.PROPAGANDA: + savePropaganda(knowledgeBaseSaveDto); + break; + case KnowledgeBaseConstants.SERVICEPACKAGE: + saveServicePackage(knowledgeBaseSaveDto); + break; + case KnowledgeBaseConstants.QUESTION: + saveQuestionInfo(knowledgeBaseSaveDto); + break; } } @@ -276,4 +378,144 @@ public class KnowledgeBaseServiceImpl implements IKnowledgeBaseService { textMessageService.insertTextMessage(textMessageTaskDTO); }); } + + @Transactional(rollbackFor = Exception.class) + public void savePropaganda(KnowledgeBaseSaveDto knowledgeBaseSaveDto) { + knowledgeBaseSaveDto.getSourceTemplateIds().forEach(sourceId -> { + PropagandaInfo propagandaInfo = propagandaInfoMapper.selectPropagandaInfoById(sourceId); + propagandaInfo.setId(null); + propagandaInfo.setSourceTemplateId(sourceId); + propagandaInfo.setDepartmentId(knowledgeBaseSaveDto.getDepartmentId()); + propagandaInfo.setDepartmentName(knowledgeBaseSaveDto.getDepartmentName()); + Department department = departmentMapper.selectDepartment(knowledgeBaseSaveDto.getDepartmentId()); + if (ObjectUtils.isEmpty(department)) { + throw new ServiceException("未找到科室,请联系管理员"); + } + Agency agency = agencyMapper.selectAgencyById(department.getHospitalAgencyId()); + if (ObjectUtils.isEmpty(agency)) { + throw new ServiceException("未找到机构,请联系管理员"); + } + propagandaInfo.setHospitalAgencyId(agency.getId()); + propagandaInfo.setHospitalAgencyName(agency.getAgencyName()); + propagandaInfo.setDelFlag(0); + propagandaInfo.setCreateTime(LocalDateTime.now()); + propagandaInfo.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); + propagandaInfo.setUpdateTime(null); + propagandaInfo.setUpdateBy(null); + propagandaInfo.setPropagandaCode(Constants.PROPAGANDA_INFO_CODE + generateSystemCodeUtil.generateSystemCode(Constants.PROPAGANDA_INFO_CODE)); + int flag = propagandaInfoMapper.insertPropagandaInfo(propagandaInfo); + if (flag > 0) { + // 查询宣教素材关联关系 + PropagandaMaterials query = new PropagandaMaterials(); + query.setPropagandaId(sourceId); + List propagandaMaterialsList = propagandaMaterialsMapper.selectPropagandaMaterialsList(query); + if (CollectionUtils.isNotEmpty(propagandaMaterialsList)) { + for (PropagandaMaterials propagandaMaterials : propagandaMaterialsList) { + propagandaMaterials.setPropagandaId(propagandaInfo.getId()); + propagandaMaterials.setPropagandaTitle(propagandaInfo.getPropagandaTitle()); + propagandaMaterials.setDelFlag(0); + propagandaMaterials.setCreateBy(SecurityUtils.getLoginUser().getUser().getCreateBy()); + propagandaMaterials.setCreateTime(LocalDateTime.now()); + propagandaMaterialsMapper.insertPropagandaMaterials(propagandaMaterials); + } + } + } + }); + } + + private void saveServicePackage(KnowledgeBaseSaveDto knowledgeBaseSaveDto) { + knowledgeBaseSaveDto.getSourceTemplateIds().forEach(sourceId -> { + ServicePackageAddDTO servicePackageAddDTO = new ServicePackageAddDTO(); + ServicePackage servicePackage = servicePackageMapper.selectServicePackageById(sourceId); + + BeanUtils.copyBeanProp(servicePackageAddDTO, servicePackage); + servicePackageAddDTO.setDepartmentId(knowledgeBaseSaveDto.getDepartmentId()); + servicePackageAddDTO.setDepartmentName(knowledgeBaseSaveDto.getDepartmentName()); + + if (servicePackage.getDiseaseTypeId() != null) { + DepartmentDiseaseType departmentDiseaseType = new DepartmentDiseaseType(); + departmentDiseaseType.setDepartmentId(knowledgeBaseSaveDto.getDepartmentId()); + departmentDiseaseType.setDiseaseTypeName(servicePackage.getDiseaseTypeName()); + List diseaseTypeList = departmentDiseaseTypeService.selectDepartmentDiseaseTypeList(departmentDiseaseType); + if (CollectionUtils.isEmpty(diseaseTypeList)) { + // 新增病种 + DepartmentDiseaseType diseaseTypeSaveObj = new DepartmentDiseaseType(); + diseaseTypeSaveObj.setDiseaseTypeName(servicePackage.getDiseaseTypeName()); + diseaseTypeSaveObj.setDepartmentId(knowledgeBaseSaveDto.getDepartmentId()); + diseaseTypeSaveObj.setDepartmentName(knowledgeBaseSaveDto.getDepartmentName()); + departmentDiseaseTypeService.insertDepartmentDiseaseType(diseaseTypeSaveObj); + servicePackageAddDTO.setDiseaseTypeId(diseaseTypeSaveObj.getId()); + servicePackageAddDTO.setDiseaseTypeName(diseaseTypeSaveObj.getDiseaseTypeName()); + } else { + servicePackageAddDTO.setDiseaseTypeId(diseaseTypeList.get(0).getId()); + servicePackageAddDTO.setDiseaseTypeName(diseaseTypeList.get(0).getDiseaseTypeName()); + } + } + + ServicePackageContent servicePackageContent = new ServicePackageContent(); + servicePackageContent.setServicePackageId(sourceId); + List servicePackageContentList = servicePackageContentMapper.selectServicePackageContentList(servicePackageContent); + List voList = new ArrayList<>(); + servicePackageContentList.forEach(content -> { + ServicePackageContentVO servicePackageContentVO = new ServicePackageContentVO(); + BeanUtils.copyBeanProp(servicePackageContentVO, content); + voList.add(servicePackageContentVO); + }); + servicePackageAddDTO.setVoList(voList); + servicePackageService.insertServicePackage(servicePackageAddDTO); + }); + } + + private void saveQuestionInfo(KnowledgeBaseSaveDto knowledgeBaseSaveDto) { + knowledgeBaseSaveDto.getSourceTemplateIds().forEach(sourceId -> { + QuestionVO questionVO = questionInfoService.selectQuestionInfoById(sourceId); + QuestionVO saveObj = new QuestionVO(); + BeanUtils.copyBeanProp(saveObj, questionVO); + saveObj.setId(null); + saveObj.setDepartmentId(knowledgeBaseSaveDto.getDepartmentId()); + saveObj.setDepartmentName(knowledgeBaseSaveDto.getDepartmentName()); + saveObj.setSourceTemplateId(sourceId); + if (questionVO.getDiseaseTypeId() != null) { + DepartmentDiseaseType departmentDiseaseType = new DepartmentDiseaseType(); + departmentDiseaseType.setDepartmentId(knowledgeBaseSaveDto.getDepartmentId()); + departmentDiseaseType.setDiseaseTypeName(questionVO.getDiseaseTypeName()); + List diseaseTypeList = departmentDiseaseTypeService.selectDepartmentDiseaseTypeList(departmentDiseaseType); + if (CollectionUtils.isEmpty(diseaseTypeList)) { + // 新增病种 + DepartmentDiseaseType diseaseTypeSaveObj = new DepartmentDiseaseType(); + diseaseTypeSaveObj.setDiseaseTypeName(questionVO.getDiseaseTypeName()); + diseaseTypeSaveObj.setDepartmentId(knowledgeBaseSaveDto.getDepartmentId()); + diseaseTypeSaveObj.setDepartmentName(knowledgeBaseSaveDto.getDepartmentName()); + departmentDiseaseTypeService.insertDepartmentDiseaseType(diseaseTypeSaveObj); + saveObj.setDiseaseTypeId(diseaseTypeSaveObj.getId()); + saveObj.setDiseaseTypeName(diseaseTypeSaveObj.getDiseaseTypeName()); + } else { + saveObj.setDiseaseTypeId(diseaseTypeList.get(0).getId()); + saveObj.setDiseaseTypeName(diseaseTypeList.get(0).getDiseaseTypeName()); + } + } + // 题目保存 + if (CollectionUtils.isNotEmpty(questionVO.getQuestionSubjectList())) { + List questionSubjectList = new ArrayList<>(); + questionVO.getQuestionSubjectList().forEach(subject -> { + Long subjectId = subject.getId(); + subject.setId(null); + subject.setQuestionInfoId(null); + // 查询题目选项 + List questionSubjectIds = new ArrayList<>(); + questionSubjectIds.add(subjectId); + List options = questionSubjectOptionMapper.selectQuestionSubjectOptions(questionSubjectIds); + options.forEach(option -> { + option.setId(null); + option.setQuestionNumber(subject.getQuestionNumber()); + }); + subject.setQuestionSubjectOptionList(options); + questionSubjectList.add(subject); + }); + saveObj.setQuestionSubjectList(questionSubjectList); + } + // 保存 + questionInfoService.insertQuestionInfo(saveObj); + }); + } } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/propagandainfo/impl/PropagandaInfoServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/propagandainfo/impl/PropagandaInfoServiceImpl.java index 56267ba6..57165fd6 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/propagandainfo/impl/PropagandaInfoServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/propagandainfo/impl/PropagandaInfoServiceImpl.java @@ -1,9 +1,11 @@ package com.xinelu.manage.service.propagandainfo.impl; import com.xinelu.common.annotation.DataScope; +import com.xinelu.common.constant.Constants; import com.xinelu.common.exception.ServiceException; import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.bean.BeanUtils; +import com.xinelu.common.utils.codes.GenerateSystemCodeUtil; import com.xinelu.manage.domain.agency.Agency; import com.xinelu.manage.domain.materialsinfo.MaterialsInfo; import com.xinelu.manage.domain.propagandainfo.PropagandaInfo; @@ -44,6 +46,8 @@ public class PropagandaInfoServiceImpl implements IPropagandaInfoService { private MaterialsInfoMapper materialsInfoMapper; @Resource private AgencyMapper agencyMapper; + @Resource + private GenerateSystemCodeUtil generateSystemCodeUtil; /** * 查询宣教库管理 @@ -101,6 +105,7 @@ public class PropagandaInfoServiceImpl implements IPropagandaInfoService { public int insertPropagandaInfo(PropagandaInfoSaveDto propagandaInfoSaveDto) { PropagandaInfo propagandaInfo = new PropagandaInfo(); BeanUtils.copyBeanProp(propagandaInfo, propagandaInfoSaveDto); + propagandaInfo.setPropagandaCode(Constants.PROPAGANDA_INFO_CODE + generateSystemCodeUtil.generateSystemCode(Constants.PROPAGANDA_INFO_CODE)); propagandaInfo.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); propagandaInfo.setCreateTime(LocalDateTime.now()); propagandaInfo.setDelFlag(0); diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicepackage/impl/ServicePackageServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicepackage/impl/ServicePackageServiceImpl.java index 44132104..5bdd7a0f 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicepackage/impl/ServicePackageServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicepackage/impl/ServicePackageServiceImpl.java @@ -90,11 +90,6 @@ public class ServicePackageServiceImpl implements IServicePackageService { public TableDataInfo selectServicePackageList(ServicePackageDto servicePackage) { pageServiceUtil.startPage(); List voList = servicePackageMapper.selectServicePackageLists(servicePackage); - voList.forEach(vo -> { - // 拼接服务包期限+服务包单位 - String packageTermAndUnit = vo.getPackageTerm() + vo.getPackageTermUnit(); - vo.setPackageTermAndUnit(packageTermAndUnit); - }); return pageServiceUtil.getDataTable(voList); } diff --git a/postdischarge-manage/src/main/resources/mapper/manage/propagandainfo/PropagandaInfoMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/propagandainfo/PropagandaInfoMapper.xml index 8929860b..e42a58a0 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/propagandainfo/PropagandaInfoMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/propagandainfo/PropagandaInfoMapper.xml @@ -23,6 +23,7 @@ + @@ -30,13 +31,13 @@ - select id, hospital_agency_id, hospital_agency_name, department_id, department_name, propaganda_title, propaganda_type, propaganda_code, propaganda_status, propaganda_content, propaganda_cover_path, article_summary, voicebroadcast, disease_type_id, disease_type_name, propaganda_link, propaganda_barcode_path,del_flag, create_by, create_time, update_by, update_time from propaganda_info + select id, hospital_agency_id, hospital_agency_name, department_id, department_name, propaganda_title, propaganda_type, propaganda_code, propaganda_status, propaganda_content, propaganda_cover_path, article_summary, voicebroadcast, disease_type_id, disease_type_name, propaganda_link, propaganda_barcode_path,del_flag, source_template_id, create_by, create_time, update_by, update_time from propaganda_info