知识库复制。

This commit is contained in:
haown 2024-07-10 18:09:00 +08:00
parent af9a5ed6a1
commit e7230f8bf0
13 changed files with 342 additions and 9 deletions

View File

@ -209,6 +209,11 @@ public class Constants {
*/ */
public static final String DEPARTMENT_CODE = "DTC"; public static final String DEPARTMENT_CODE = "DTC";
/**
* 宣教编码
*/
public static final String PROPAGANDA_INFO_CODE = "PIC";
/** /**
* 门诊患者 * 门诊患者
*/ */

View File

@ -23,4 +23,17 @@ public class KnowledgeBaseConstants {
* 短信库 * 短信库
*/ */
public static final String MESSAGE = "MESSAGE"; public static final String MESSAGE = "MESSAGE";
/**
* 宣教库
*/
public static final String PROPAGANDA = "PROPAGANDA";
/**
* 服务包
*/
public static final String SERVICEPACKAGE = "SERVICEPACKAGE";
/**
* 问卷
*/
public static final String QUESTION = "QUESTION";
} }

View File

@ -100,4 +100,9 @@ public class PropagandaInfo extends BaseEntity {
/** 删除标识0未删除1已删除 */ /** 删除标识0未删除1已删除 */
private Integer delFlag; private Integer delFlag;
/**
* 公共库模板id
*/
private Long sourceTemplateId;
} }

View File

@ -130,6 +130,11 @@ public class QuestionInfo extends BaseEntity {
@Excel(name = "问卷类型") @Excel(name = "问卷类型")
private String questionType; private String questionType;
/**
* 公共库模板id
*/
private Long sourceTemplateId;
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

View File

@ -65,4 +65,48 @@ public class BaseInfoQueryDto {
@ApiModelProperty(value = "短信状态上架GROUNDING下架OFF_SHELF") @ApiModelProperty(value = "短信状态上架GROUNDING下架OFF_SHELF")
private String textMessageStatus; 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;
/**
* 是否发布01
*/
@ApiModelProperty(value = "是否发布01")
private Integer whetherRelease;
/**
* 病种名称
*/
@ApiModelProperty(value = "病种名称")
private String diseaseTypeName;
/**
* 问卷标题
*/
@ApiModelProperty(value = "问卷标题")
private String questionnaireName;
/**
* 问卷状态已发布PUBLISHED未发布UNPUBLISHED
*/
@ApiModelProperty(value = "问卷状态已发布PUBLISHED未发布UNPUBLISHED")
private String questionnaireStatus;
} }

View File

@ -1,16 +1,26 @@
package com.xinelu.manage.service.knowledgebase.impl; package com.xinelu.manage.service.knowledgebase.impl;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.xinelu.common.constant.Constants;
import com.xinelu.common.constant.HttpStatus; import com.xinelu.common.constant.HttpStatus;
import com.xinelu.common.constant.KnowledgeBaseConstants; import com.xinelu.common.constant.KnowledgeBaseConstants;
import com.xinelu.common.core.page.TableDataInfo; import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.common.exception.ServiceException; import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.PageUtils; import com.xinelu.common.utils.PageUtils;
import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.StringUtils; import com.xinelu.common.utils.StringUtils;
import com.xinelu.common.utils.bean.BeanUtils; 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.departmentdiseasetype.DepartmentDiseaseType;
import com.xinelu.manage.domain.operationInfo.OperationInfo; 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.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.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;
@ -18,30 +28,52 @@ import com.xinelu.manage.domain.wechattemplatesuittask.WechatTemplateSuitTask;
import com.xinelu.manage.dto.knowledgebase.KnowledgeBaseSaveDto; import com.xinelu.manage.dto.knowledgebase.KnowledgeBaseSaveDto;
import com.xinelu.manage.dto.operationinfo.BaseInfoQueryDto; import com.xinelu.manage.dto.operationinfo.BaseInfoQueryDto;
import com.xinelu.manage.dto.operationinfo.OperationInfoDto; 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.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.TextMessageDTO;
import com.xinelu.manage.dto.textmessage.TextMessageTaskDTO; import com.xinelu.manage.dto.textmessage.TextMessageTaskDTO;
import com.xinelu.manage.dto.wechattemplate.WechatTemplateDTO; import com.xinelu.manage.dto.wechattemplate.WechatTemplateDTO;
import com.xinelu.manage.dto.wechattemplate.WechatTemplateTaskDTO; 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.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.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.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;
import com.xinelu.manage.service.departmentdiseasetype.IDepartmentDiseaseTypeService; import com.xinelu.manage.service.departmentdiseasetype.IDepartmentDiseaseTypeService;
import com.xinelu.manage.service.knowledgebase.IKnowledgeBaseService; import com.xinelu.manage.service.knowledgebase.IKnowledgeBaseService;
import com.xinelu.manage.service.operationInfo.IOperationInfoService; 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.scriptInfo.IScriptInfoService;
import com.xinelu.manage.service.servicepackage.IServicePackageService;
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.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.textmessage.TextMessageVO;
import com.xinelu.manage.vo.wechattemplate.WechatTemplateTaskVO; import com.xinelu.manage.vo.wechattemplate.WechatTemplateTaskVO;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/** /**
* @description: 知识库Service业务层处理 * @description: 知识库Service业务层处理
@ -71,9 +103,34 @@ public class KnowledgeBaseServiceImpl implements IKnowledgeBaseService {
private ITextMessageService textMessageService; private ITextMessageService textMessageService;
@Resource @Resource
private IDepartmentDiseaseTypeService departmentDiseaseTypeService; 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 @Override
public TableDataInfo getBaseInfoList(BaseInfoQueryDto baseInfoQueryDto) { public TableDataInfo getBaseInfoList(BaseInfoQueryDto baseInfoQueryDto) {
if (StringUtils.isBlank(baseInfoQueryDto.getType())) {
throw new ServiceException("知识库类型不能为空");
}
TableDataInfo rspData = new TableDataInfo(); TableDataInfo rspData = new TableDataInfo();
switch(baseInfoQueryDto.getType()){ switch(baseInfoQueryDto.getType()){
case KnowledgeBaseConstants.OPERATOR: case KnowledgeBaseConstants.OPERATOR:
@ -124,6 +181,42 @@ public class KnowledgeBaseServiceImpl implements IKnowledgeBaseService {
rspData.setPageNum(new PageInfo(messageList).getPageNum()); rspData.setPageNum(new PageInfo(messageList).getPageNum());
rspData.setTotal(new PageInfo(messageList).getTotal()); rspData.setTotal(new PageInfo(messageList).getTotal());
break; break;
case KnowledgeBaseConstants.PROPAGANDA:
PropagandaInfoDto propagandaInfo = new PropagandaInfoDto();
BeanUtils.copyBeanProp(propagandaInfo, baseInfoQueryDto);
PageUtils.startPage();
List<PropagandaInfo> 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<ServicePackageVO> 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<QuestionInfo> 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; return rspData;
} }
@ -152,6 +245,15 @@ public class KnowledgeBaseServiceImpl implements IKnowledgeBaseService {
case KnowledgeBaseConstants.MESSAGE: case KnowledgeBaseConstants.MESSAGE:
saveMessage(knowledgeBaseSaveDto); saveMessage(knowledgeBaseSaveDto);
break; 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); 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<PropagandaMaterials> 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<DepartmentDiseaseType> 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<ServicePackageContent> servicePackageContentList = servicePackageContentMapper.selectServicePackageContentList(servicePackageContent);
List<ServicePackageContentVO> 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<DepartmentDiseaseType> 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<QuestionSubjectVO> questionSubjectList = new ArrayList<>();
questionVO.getQuestionSubjectList().forEach(subject -> {
Long subjectId = subject.getId();
subject.setId(null);
subject.setQuestionInfoId(null);
// 查询题目选项
List<Long> questionSubjectIds = new ArrayList<>();
questionSubjectIds.add(subjectId);
List<QuestionSubjectOptionVO> 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);
});
}
} }

View File

@ -1,9 +1,11 @@
package com.xinelu.manage.service.propagandainfo.impl; package com.xinelu.manage.service.propagandainfo.impl;
import com.xinelu.common.annotation.DataScope; import com.xinelu.common.annotation.DataScope;
import com.xinelu.common.constant.Constants;
import com.xinelu.common.exception.ServiceException; import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.bean.BeanUtils; 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.agency.Agency;
import com.xinelu.manage.domain.materialsinfo.MaterialsInfo; import com.xinelu.manage.domain.materialsinfo.MaterialsInfo;
import com.xinelu.manage.domain.propagandainfo.PropagandaInfo; import com.xinelu.manage.domain.propagandainfo.PropagandaInfo;
@ -44,6 +46,8 @@ public class PropagandaInfoServiceImpl implements IPropagandaInfoService {
private MaterialsInfoMapper materialsInfoMapper; private MaterialsInfoMapper materialsInfoMapper;
@Resource @Resource
private AgencyMapper agencyMapper; private AgencyMapper agencyMapper;
@Resource
private GenerateSystemCodeUtil generateSystemCodeUtil;
/** /**
* 查询宣教库管理 * 查询宣教库管理
@ -101,6 +105,7 @@ public class PropagandaInfoServiceImpl implements IPropagandaInfoService {
public int insertPropagandaInfo(PropagandaInfoSaveDto propagandaInfoSaveDto) { public int insertPropagandaInfo(PropagandaInfoSaveDto propagandaInfoSaveDto) {
PropagandaInfo propagandaInfo = new PropagandaInfo(); PropagandaInfo propagandaInfo = new PropagandaInfo();
BeanUtils.copyBeanProp(propagandaInfo, propagandaInfoSaveDto); BeanUtils.copyBeanProp(propagandaInfo, propagandaInfoSaveDto);
propagandaInfo.setPropagandaCode(Constants.PROPAGANDA_INFO_CODE + generateSystemCodeUtil.generateSystemCode(Constants.PROPAGANDA_INFO_CODE));
propagandaInfo.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); propagandaInfo.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName());
propagandaInfo.setCreateTime(LocalDateTime.now()); propagandaInfo.setCreateTime(LocalDateTime.now());
propagandaInfo.setDelFlag(0); propagandaInfo.setDelFlag(0);

View File

@ -90,11 +90,6 @@ public class ServicePackageServiceImpl implements IServicePackageService {
public TableDataInfo selectServicePackageList(ServicePackageDto servicePackage) { public TableDataInfo selectServicePackageList(ServicePackageDto servicePackage) {
pageServiceUtil.startPage(); pageServiceUtil.startPage();
List<ServicePackageVO> voList = servicePackageMapper.selectServicePackageLists(servicePackage); List<ServicePackageVO> voList = servicePackageMapper.selectServicePackageLists(servicePackage);
voList.forEach(vo -> {
// 拼接服务包期限+服务包单位
String packageTermAndUnit = vo.getPackageTerm() + vo.getPackageTermUnit();
vo.setPackageTermAndUnit(packageTermAndUnit);
});
return pageServiceUtil.getDataTable(voList); return pageServiceUtil.getDataTable(voList);
} }

View File

@ -23,6 +23,7 @@
<result property="propagandaLink" column="propaganda_link"/> <result property="propagandaLink" column="propaganda_link"/>
<result property="propagandaBarcodePath" column="propaganda_barcode_path"/> <result property="propagandaBarcodePath" column="propaganda_barcode_path"/>
<result property="delFlag" column="del_flag"/> <result property="delFlag" column="del_flag"/>
<result property="sourceTemplateId" column="source_template_id"/>
<result property="createBy" column="create_by"/> <result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/> <result property="updateBy" column="update_by"/>
@ -30,13 +31,13 @@
</resultMap> </resultMap>
<sql id="selectPropagandaInfoVo"> <sql id="selectPropagandaInfoVo">
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
</sql> </sql>
<select id="selectPropagandaInfoList" parameterType="com.xinelu.manage.dto.propagandainfo.PropagandaInfoDto" resultMap="PropagandaInfoResult"> <select id="selectPropagandaInfoList" parameterType="com.xinelu.manage.dto.propagandainfo.PropagandaInfoDto" resultMap="PropagandaInfoResult">
select p.id, p.hospital_agency_id, p.hospital_agency_name, p.department_id, p.department_name, p.propaganda_title, p.propaganda_type, p.propaganda_code, p.propaganda_status, select p.id, p.hospital_agency_id, p.hospital_agency_name, p.department_id, p.department_name, p.propaganda_title, p.propaganda_type, p.propaganda_code, p.propaganda_status,
p.propaganda_content, p.propaganda_cover_path, p.article_summary, p.voicebroadcast, p.disease_type_id, p.disease_type_name, p.propaganda_content, p.propaganda_cover_path, p.article_summary, p.voicebroadcast, p.disease_type_id, p.disease_type_name,
p.propaganda_link, p.propaganda_barcode_path,p.del_flag, p.create_by, p.create_time, p.update_by, p.update_time from propaganda_info p p.propaganda_link, p.propaganda_barcode_path,p.del_flag,p.source_template_id, p.create_by, p.create_time, p.update_by, p.update_time from propaganda_info p
<where> <where>
p.del_flag = 0 p.del_flag = 0
<if test="hospitalAgencyId != null "> <if test="hospitalAgencyId != null ">
@ -116,6 +117,8 @@
</if> </if>
<if test="delFlag != null">del_flag, <if test="delFlag != null">del_flag,
</if> </if>
<if test="sourceTemplateId != null">source_template_id,
</if>
<if test="createBy != null">create_by, <if test="createBy != null">create_by,
</if> </if>
<if test="createTime != null">create_time, <if test="createTime != null">create_time,
@ -160,6 +163,8 @@
</if> </if>
<if test="delFlag != null">#{delFlag}, <if test="delFlag != null">#{delFlag},
</if> </if>
<if test="sourceTemplateId != null">#{sourceTemplateId},
</if>
<if test="createBy != null">#{createBy}, <if test="createBy != null">#{createBy},
</if> </if>
<if test="createTime != null">#{createTime}, <if test="createTime != null">#{createTime},
@ -221,6 +226,9 @@
<if test="delFlag != null">del_flag = <if test="delFlag != null">del_flag =
#{delFlag}, #{delFlag},
</if> </if>
<if test="sourceTemplateId != null">source_template_id =
#{sourceTemplateId},
</if>
<if test="createBy != null">create_by = <if test="createBy != null">create_by =
#{createBy}, #{createBy},
</if> </if>

View File

@ -19,6 +19,7 @@
<result property="questionnaireStatus" column="questionnaire_status"/> <result property="questionnaireStatus" column="questionnaire_status"/>
<result property="questionnaireSort" column="questionnaire_sort"/> <result property="questionnaireSort" column="questionnaire_sort"/>
<result property="questionnaireRemark" column="questionnaire_remark"/> <result property="questionnaireRemark" column="questionnaire_remark"/>
<result property="sourceTemplateId" column="source_template_id"/>
<result property="questionType" column="question_type"/> <result property="questionType" column="question_type"/>
<result property="createBy" column="create_by"/> <result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
@ -41,6 +42,7 @@
questionnaire_status, questionnaire_status,
questionnaire_sort, questionnaire_sort,
questionnaire_remark, questionnaire_remark,
source_template_id,
question_type, question_type,
create_by, create_by,
create_time, create_time,
@ -199,6 +201,8 @@
<if test="questionnaireSort != null">questionnaire_sort, <if test="questionnaireSort != null">questionnaire_sort,
</if> </if>
<if test="questionnaireRemark != null">questionnaire_remark, <if test="questionnaireRemark != null">questionnaire_remark,
</if>
<if test="sourceTemplateId != null">source_template_id,
</if> </if>
<if test="questionType != null">question_type, <if test="questionType != null">question_type,
</if> </if>
@ -237,6 +241,8 @@
<if test="questionnaireSort != null">#{questionnaireSort}, <if test="questionnaireSort != null">#{questionnaireSort},
</if> </if>
<if test="questionnaireRemark != null">#{questionnaireRemark}, <if test="questionnaireRemark != null">#{questionnaireRemark},
</if>
<if test="sourceTemplateId != null">#{sourceTemplateId},
</if> </if>
<if test="questionType != null">#{questionType}, <if test="questionType != null">#{questionType},
</if> </if>
@ -293,6 +299,9 @@
<if test="questionnaireRemark != null">questionnaire_remark = <if test="questionnaireRemark != null">questionnaire_remark =
#{questionnaireRemark}, #{questionnaireRemark},
</if> </if>
<if test="sourceTemplateId != null">source_template_id =
#{sourceTemplateId},
</if>
<if test="questionType != null">question_type = <if test="questionType != null">question_type =
#{questionType}, #{questionType},
</if> </if>

View File

@ -169,6 +169,7 @@
sp.package_version, sp.package_version,
sp.package_term, sp.package_term,
sp.package_term_unit, sp.package_term_unit,
concat(sp.package_term,sp.package_term_unit) as packageTermAndUnit,
sp.package_price, sp.package_price,
sp.package_remark, sp.package_remark,
sp.whether_release sp.whether_release

View File

@ -458,7 +458,7 @@
and dt.hospital_agency_id = #{hospitalAgencyId} and dt.hospital_agency_id = #{hospitalAgencyId}
</if> </if>
<if test="departmentName != null and departmentName != ''"> <if test="departmentName != null and departmentName != ''">
dt.department_name like concat('%',#{departmentName},'%') and dt.department_name like concat('%',#{departmentName},'%')
</if> </if>
<if test="releaseStatus != null and releaseStatus != ''"> <if test="releaseStatus != null and releaseStatus != ''">
AND sdr.release_status= #{releaseStatus} AND sdr.release_status= #{releaseStatus}

View File

@ -49,6 +49,7 @@
department_name, department_name,
disease_type_id, disease_type_id,
disease_type_name, disease_type_name,
wechat_template_name,
template_id, template_id,
template_content, template_content,
template_source, template_source,
@ -158,7 +159,7 @@
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
${params.dataScope} ${params.dataScope}
</where> </where>
group by wt.id,wtst.id order by wt.create_time DESC,wtst.create_time DESC group by wt.id order by wt.create_time DESC,wtst.create_time DESC
</select> </select>
<select id="selectWechatTemplateDtoById" resultMap="WechatTemplateVOResultMap"> <select id="selectWechatTemplateDtoById" resultMap="WechatTemplateVOResultMap">
select wt.id, select wt.id,