diff --git a/postdischarge-admin/src/main/java/com/xinelu/web/controller/common/CommonController.java b/postdischarge-admin/src/main/java/com/xinelu/web/controller/common/CommonController.java index 0ad83249..d326bcb2 100644 --- a/postdischarge-admin/src/main/java/com/xinelu/web/controller/common/CommonController.java +++ b/postdischarge-admin/src/main/java/com/xinelu/web/controller/common/CommonController.java @@ -6,6 +6,7 @@ import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.utils.StringUtils; import com.xinelu.common.utils.file.FileUploadUtils; import com.xinelu.common.utils.file.FileUtils; +import com.xinelu.common.utils.file.MimeTypeUtils; import com.xinelu.framework.config.ServerConfig; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -37,6 +38,9 @@ public class CommonController { private static final String FILE_DELIMETER = ","; + @Resource + private SystemBusinessConfig systemBusinessConfig; + /** * 通用下载请求 * @@ -140,4 +144,23 @@ public class CommonController { log.error("下载文件失败", e); } } + + /** + * 通用管理端富文本上传请求(单个) + */ + @PostMapping("/richTextPictureUrl") + public AjaxResult richTextPictureUrl(MultipartFile file) throws Exception { + // 上传文件路径 + String filePath = SystemBusinessConfig.getProfile() + systemBusinessConfig.getRichTextPictureUrl(); + // 上传并返回新文件名称 + String fileName = FileUploadUtils.upload(filePath, file, MimeTypeUtils.IMAGE_EXTENSION); + //拼接路径 + String url = serverConfig.getUrl() + fileName; + AjaxResult ajax = AjaxResult.success(); + ajax.put("url", url); + ajax.put("fileName", fileName); + ajax.put("newFileName", FileUtils.getName(fileName)); + ajax.put("originalFilename", file.getOriginalFilename()); + return ajax; + } } diff --git a/postdischarge-admin/src/main/resources/application.yml b/postdischarge-admin/src/main/resources/application.yml index ad357f09..b68e18b0 100644 --- a/postdischarge-admin/src/main/resources/application.yml +++ b/postdischarge-admin/src/main/resources/application.yml @@ -24,6 +24,8 @@ xinelu: captchaType: math # 话术图片路径图片上传 script-file-url: /scriptFileUrl + # 获取管理端富文本的上传路径 + rich-text-picture-url: /richTextPictureUrl # 开发环境配置 server: @@ -179,6 +181,6 @@ xss: # 过滤开关 enabled: true # 排除链接(多个用逗号分隔) - excludes: /system/notice + excludes: /system/notice,/system/specialDiseaseNode/add,/system/specialDiseaseNode/edit # 匹配链接 urlPatterns: /system/*,/monitor/*,/tool/* diff --git a/postdischarge-common/src/main/java/com/xinelu/common/config/SystemBusinessConfig.java b/postdischarge-common/src/main/java/com/xinelu/common/config/SystemBusinessConfig.java index 6f2222d2..a58a3a17 100644 --- a/postdischarge-common/src/main/java/com/xinelu/common/config/SystemBusinessConfig.java +++ b/postdischarge-common/src/main/java/com/xinelu/common/config/SystemBusinessConfig.java @@ -71,6 +71,11 @@ public class SystemBusinessConfig { */ private String scriptFileUrl; + /** + * 获取管理端富文本的上传路径 + */ + private String richTextPictureUrl; + public String getName() { return name; } @@ -193,4 +198,12 @@ public class SystemBusinessConfig { public void setMaterialsVideoUrl(String materialsVideoUrl) { this.materialsVideoUrl = materialsVideoUrl; } + + public String getRichTextPictureUrl() { + return richTextPictureUrl; + } + + public void setRichTextPictureUrl(String richTextPictureUrl) { + this.richTextPictureUrl = richTextPictureUrl; + } } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/agency/AgencyController.java b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/agency/AgencyController.java index fd670f1f..75578486 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/agency/AgencyController.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/agency/AgencyController.java @@ -146,6 +146,9 @@ public class AgencyController extends BaseController { return agencyService.insertAgencyImportList(list); } + /** + * 医院园区科室病区联动查询 + */ @GetMapping("/getAgencyList") public AjaxResult getAgencyList(HospitalDTO hospitalDTO) { return agencyService.getAgencyList(hospitalDTO); diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/signpatientmanageroute/SignPatientManageRouteController.java b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/signpatientmanageroute/SignPatientManageRouteController.java index 04624567..7f19c915 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/signpatientmanageroute/SignPatientManageRouteController.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/signpatientmanageroute/SignPatientManageRouteController.java @@ -10,6 +10,7 @@ import com.xinelu.manage.domain.signpatientmanageroute.SignPatientManageRoute; import com.xinelu.manage.dto.manualfollowup.ManualFollowUpDTO; import com.xinelu.manage.service.signpatientmanageroute.ISignPatientManageRouteService; import com.xinelu.manage.vo.manualfollowup.ManualFollowUpVO; +import com.xinelu.manage.vo.signpatientmanageroute.SignPatientManageRouteVO; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; @@ -66,9 +67,9 @@ public class SignPatientManageRouteController extends BaseController { */ @PreAuthorize("@ss.hasPermi('manage:signroute:add')") @Log(title = "签约患者管理任务路径", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@RequestBody SignPatientManageRoute signPatientManageRoute) { - return toAjax(signPatientManageRouteService.insertSignPatientManageRoute(signPatientManageRoute)); + @PostMapping("/add") + public AjaxResult add(@RequestBody SignPatientManageRouteVO signPatientManageRoute) { + return signPatientManageRouteService.insertSignPatientManageRoute(signPatientManageRoute); } /** @@ -76,9 +77,9 @@ public class SignPatientManageRouteController extends BaseController { */ @PreAuthorize("@ss.hasPermi('manage:signroute:edit')") @Log(title = "签约患者管理任务路径", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@RequestBody SignPatientManageRoute signPatientManageRoute) { - return toAjax(signPatientManageRouteService.updateSignPatientManageRoute(signPatientManageRoute)); + @PutMapping("/edit") + public AjaxResult edit(@RequestBody SignPatientManageRouteVO signPatientManageRoute) { + return signPatientManageRouteService.updateSignPatientManageRoute(signPatientManageRoute); } /** diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/signpatientmanageroutenode/SignPatientManageRouteNodeMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/signpatientmanageroutenode/SignPatientManageRouteNodeMapper.java index 0174be35..d3198be2 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/signpatientmanageroutenode/SignPatientManageRouteNodeMapper.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/signpatientmanageroutenode/SignPatientManageRouteNodeMapper.java @@ -1,9 +1,10 @@ package com.xinelu.manage.mapper.signpatientmanageroutenode; import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode; -import java.util.List; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 签约患者管理任务路径节点Mapper接口 * @@ -60,4 +61,12 @@ public interface SignPatientManageRouteNodeMapper { * @return 结果 */ public int deleteSignPatientManageRouteNodeByIds(Long[] ids); + + /** + * 批量删除签约患者管理任务路径节点 + * + * @param manageRouteId 需要删除的数据 + * @return 结果 + */ + int deleteRouteNodeByManageRouteId(Long manageRouteId); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/agency/IAgencyService.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/agency/IAgencyService.java index f0e90cd4..b7925abd 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/agency/IAgencyService.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/agency/IAgencyService.java @@ -88,5 +88,11 @@ public interface IAgencyService { **/ AjaxResult insertAgencyImportList(List agencyList); + /** + * 医院园区科室病区联动查询 + * + * @param hospitalDTO 信息 + * @return AjaxResult + */ AjaxResult getAgencyList(HospitalDTO hospitalDTO); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/agency/impl/AgencyServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/agency/impl/AgencyServiceImpl.java index 6b58c9d5..443309c3 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/agency/impl/AgencyServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/agency/impl/AgencyServiceImpl.java @@ -224,8 +224,15 @@ public class AgencyServiceImpl implements IAgencyService { return AjaxResult.success(); } + /** + * 医院园区科室病区联动查询 + * + * @param hospitalDTO 信息 + * @return AjaxResult + */ @Override public AjaxResult getAgencyList(HospitalDTO hospitalDTO) { + //只选医院 HospitalVO hospitalVO = new HospitalVO(); if (StringUtils.isNotBlank(hospitalDTO.getNodeType()) && NodeTypeEnum.HOSPITAL.getInfo().equals(hospitalDTO.getNodeType()) && Objects.nonNull(hospitalDTO.getHospitalId())) { Agency agency = new Agency(); @@ -242,6 +249,7 @@ public class AgencyServiceImpl implements IAgencyService { List wardList = departmentMapper.selectDepartmentList(department); hospitalVO.setWardList(wardList); } + //选到园区 if (StringUtils.isNotBlank(hospitalDTO.getNodeType()) && NodeTypeEnum.CAMPUS.getInfo().equals(hospitalDTO.getNodeType()) && Objects.nonNull(hospitalDTO.getCampusId())) { Department department = new Department(); department.setNodeType(NodeTypeEnum.DEPARTMENT.getInfo()); @@ -252,6 +260,7 @@ public class AgencyServiceImpl implements IAgencyService { List wardList = departmentMapper.selectDepartmentList(department); hospitalVO.setWardList(wardList); } + //选到科室 if (StringUtils.isNotBlank(hospitalDTO.getNodeType()) && NodeTypeEnum.DEPARTMENT.getInfo().equals(hospitalDTO.getNodeType()) && Objects.nonNull(hospitalDTO.getDepartmentId())) { Department department = new Department(); department.setNodeType(NodeTypeEnum.WARD.getInfo()); diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/ISignPatientManageRouteService.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/ISignPatientManageRouteService.java index c18bdfca..153e19c4 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/ISignPatientManageRouteService.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/ISignPatientManageRouteService.java @@ -1,8 +1,10 @@ package com.xinelu.manage.service.signpatientmanageroute; +import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.manage.domain.signpatientmanageroute.SignPatientManageRoute; import com.xinelu.manage.dto.manualfollowup.ManualFollowUpDTO; import com.xinelu.manage.vo.manualfollowup.ManualFollowUpVO; +import com.xinelu.manage.vo.signpatientmanageroute.SignPatientManageRouteVO; import java.util.List; @@ -20,7 +22,7 @@ public interface ISignPatientManageRouteService { * @param id 签约患者管理任务路径主键 * @return 签约患者管理任务路径 */ - public SignPatientManageRoute selectSignPatientManageRouteById(Long id); + SignPatientManageRoute selectSignPatientManageRouteById(Long id); /** * 查询签约患者管理任务路径列表 @@ -28,7 +30,7 @@ public interface ISignPatientManageRouteService { * @param signPatientManageRoute 签约患者管理任务路径 * @return 签约患者管理任务路径集合 */ - public List selectSignPatientManageRouteList(SignPatientManageRoute signPatientManageRoute); + List selectSignPatientManageRouteList(SignPatientManageRoute signPatientManageRoute); /** * 新增签约患者管理任务路径 @@ -36,7 +38,7 @@ public interface ISignPatientManageRouteService { * @param signPatientManageRoute 签约患者管理任务路径 * @return 结果 */ - public int insertSignPatientManageRoute(SignPatientManageRoute signPatientManageRoute); + AjaxResult insertSignPatientManageRoute(SignPatientManageRouteVO signPatientManageRoute); /** * 修改签约患者管理任务路径 @@ -44,7 +46,7 @@ public interface ISignPatientManageRouteService { * @param signPatientManageRoute 签约患者管理任务路径 * @return 结果 */ - public int updateSignPatientManageRoute(SignPatientManageRoute signPatientManageRoute); + AjaxResult updateSignPatientManageRoute(SignPatientManageRouteVO signPatientManageRoute); /** * 批量删除签约患者管理任务路径 @@ -52,7 +54,7 @@ public interface ISignPatientManageRouteService { * @param ids 需要删除的签约患者管理任务路径主键集合 * @return 结果 */ - public int deleteSignPatientManageRouteByIds(Long[] ids); + int deleteSignPatientManageRouteByIds(Long[] ids); /** * 删除签约患者管理任务路径信息 diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/impl/SignPatientManageRouteServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/impl/SignPatientManageRouteServiceImpl.java index e84e4874..74f7de4e 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/impl/SignPatientManageRouteServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/impl/SignPatientManageRouteServiceImpl.java @@ -1,16 +1,22 @@ package com.xinelu.manage.service.signpatientmanageroute.impl; +import com.xinelu.common.core.domain.AjaxResult; +import com.xinelu.common.utils.SecurityUtils; import com.xinelu.manage.domain.signpatientmanageroute.SignPatientManageRoute; +import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode; import com.xinelu.manage.dto.manualfollowup.ManualFollowUpDTO; import com.xinelu.manage.mapper.signpatientmanageroute.SignPatientManageRouteMapper; +import com.xinelu.manage.mapper.signpatientmanageroutenode.SignPatientManageRouteNodeMapper; import com.xinelu.manage.service.signpatientmanageroute.ISignPatientManageRouteService; +import com.xinelu.manage.vo.manualfollowup.ManualFollowUpVO; +import com.xinelu.manage.vo.signpatientmanageroute.SignPatientManageRouteVO; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import javax.annotation.Resource; import java.time.LocalDateTime; import java.util.List; -import javax.annotation.Resource; -import com.xinelu.manage.vo.manualfollowup.ManualFollowUpVO; -import org.springframework.stereotype.Service; /** * 签约患者管理任务路径Service业务层处理 @@ -22,6 +28,8 @@ import org.springframework.stereotype.Service; public class SignPatientManageRouteServiceImpl implements ISignPatientManageRouteService { @Resource private SignPatientManageRouteMapper signPatientManageRouteMapper; + @Resource + private SignPatientManageRouteNodeMapper signPatientManageRouteNodeMapper; /** * 查询签约患者管理任务路径 @@ -51,10 +59,26 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout * @param signPatientManageRoute 签约患者管理任务路径 * @return 结果 */ + @Transactional(rollbackFor = Exception.class) @Override - public int insertSignPatientManageRoute(SignPatientManageRoute signPatientManageRoute) { + public AjaxResult insertSignPatientManageRoute(SignPatientManageRouteVO signPatientManageRoute) { + signPatientManageRoute.setCreateBy(SecurityUtils.getUsername()); signPatientManageRoute.setCreateTime(LocalDateTime.now()); - return signPatientManageRouteMapper.insertSignPatientManageRoute(signPatientManageRoute); + int insertRoute = signPatientManageRouteMapper.insertSignPatientManageRoute(signPatientManageRoute); + if (insertRoute < 0) { + return AjaxResult.error("新增签约患者管理任务路径失败!请联系管理员!"); + } + List routeNodeList = signPatientManageRoute.getRouteNodeList(); + for (SignPatientManageRouteNode signPatientManageRouteNode : routeNodeList) { + signPatientManageRouteNode.setManageRouteId(signPatientManageRoute.getId()); + signPatientManageRouteNode.setCreateTime(LocalDateTime.now()); + signPatientManageRouteNode.setCreateBy(SecurityUtils.getUsername()); + } + int insertBatchCount = signPatientManageRouteNodeMapper.insertBatch(routeNodeList); + if (insertBatchCount < 0) { + return AjaxResult.error("新增签约患者管理任务路径失败!请联系管理员!"); + } + return AjaxResult.success(); } /** @@ -64,9 +88,28 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout * @return 结果 */ @Override - public int updateSignPatientManageRoute(SignPatientManageRoute signPatientManageRoute) { + public AjaxResult updateSignPatientManageRoute(SignPatientManageRouteVO signPatientManageRoute) { + signPatientManageRoute.setUpdateBy(SecurityUtils.getUsername()); signPatientManageRoute.setUpdateTime(LocalDateTime.now()); - return signPatientManageRouteMapper.updateSignPatientManageRoute(signPatientManageRoute); + int updateCount = signPatientManageRouteMapper.updateSignPatientManageRoute(signPatientManageRoute); + if (updateCount < 0) { + return AjaxResult.error("修改签约患者管理任务路径失败!请联系管理员!"); + } + int deleteCount = signPatientManageRouteNodeMapper.deleteRouteNodeByManageRouteId(signPatientManageRoute.getSignPatientManageRouteId()); + if (deleteCount < 0) { + return AjaxResult.error("修改签约患者管理任务路径失败!请联系管理员!"); + } + List routeNodeList = signPatientManageRoute.getRouteNodeList(); + for (SignPatientManageRouteNode signPatientManageRouteNode : routeNodeList) { + signPatientManageRouteNode.setManageRouteId(signPatientManageRoute.getSignPatientManageRouteId()); + signPatientManageRouteNode.setCreateTime(LocalDateTime.now()); + signPatientManageRouteNode.setCreateBy(SecurityUtils.getUsername()); + } + int insertBatchCount = signPatientManageRouteNodeMapper.insertBatch(routeNodeList); + if (insertBatchCount < 0) { + return AjaxResult.error("新增签约患者管理任务路径失败!请联系管理员!"); + } + return AjaxResult.success(); } /** @@ -93,6 +136,7 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout /** * 查询人工随访代办列表 + * * @param manualFollowUpDTO 人工随访查询DTO * @return ManualFollowUpVO 人工随访代办VO */ diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/signpatientmanageroute/SignPatientManageRouteVO.java b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/signpatientmanageroute/SignPatientManageRouteVO.java new file mode 100644 index 00000000..1be11586 --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/signpatientmanageroute/SignPatientManageRouteVO.java @@ -0,0 +1,30 @@ +package com.xinelu.manage.vo.signpatientmanageroute; + +import com.xinelu.manage.domain.signpatientmanageroute.SignPatientManageRoute; +import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * 签约患者管理任务路径对象 sign_patient_manage_route + * + * @author haown + * @date 2024-03-18 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class SignPatientManageRouteVO extends SignPatientManageRoute { + + /** + * 患者管理任务路径id + */ + private Long SignPatientManageRouteId; + + /** + * 节点信息 + */ + List routeNodeList; + +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/specialdiseaseroute/SpecialDiseaseRouteVO.java b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/specialdiseaseroute/SpecialDiseaseRouteVO.java index 0d3dcc69..2dffbb03 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/specialdiseaseroute/SpecialDiseaseRouteVO.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/specialdiseaseroute/SpecialDiseaseRouteVO.java @@ -23,6 +23,15 @@ public class SpecialDiseaseRouteVO extends SpecialDiseaseRoute { */ private Long specialDiseaseRouteId; + /** + * 总数 + */ + private Long totalNumber; + + /** + * 进度 + */ + private Long agreeNumber; /** * 节点信息 diff --git a/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroutenode/SignPatientManageRouteNodeMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroutenode/SignPatientManageRouteNodeMapper.xml index ad5eae43..2131d9d3 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroutenode/SignPatientManageRouteNodeMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroutenode/SignPatientManageRouteNodeMapper.xml @@ -716,4 +716,10 @@ #{id} + + + delete + from sign_patient_manage_route_node + where manage_route_id = #{manageRouteId} + \ No newline at end of file diff --git a/postdischarge-manage/src/main/resources/mapper/manage/specialdiseaseroute/SpecialDiseaseRouteMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/specialdiseaseroute/SpecialDiseaseRouteMapper.xml index 0b1d1af7..f78aedb9 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/specialdiseaseroute/SpecialDiseaseRouteMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/specialdiseaseroute/SpecialDiseaseRouteMapper.xml @@ -37,6 +37,8 @@ + + @@ -282,7 +284,7 @@