diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/servicepackage/ServicePackageController.java b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/servicepackage/ServicePackageController.java index 7fdec169..a62e64a7 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/servicepackage/ServicePackageController.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/servicepackage/ServicePackageController.java @@ -7,6 +7,7 @@ import com.xinelu.common.core.page.TableDataInfo; import com.xinelu.common.enums.BusinessType; import com.xinelu.common.utils.poi.ExcelUtil; import com.xinelu.manage.domain.servicepackage.ServicePackage; +import com.xinelu.manage.dto.servicepackage.ServicePackageAddDTO; import com.xinelu.manage.service.servicepackage.IServicePackageService; import com.xinelu.manage.vo.servicepackage.ServicePackageVO; import org.springframework.security.access.prepost.PreAuthorize; @@ -66,8 +67,8 @@ public class ServicePackageController extends BaseController { @PreAuthorize("@ss.hasPermi('manage:servicepackage:add')") @Log(title = "服务包基础信息", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@RequestBody ServicePackage servicePackage) { - return toAjax(servicePackageService.insertServicePackage(servicePackage)); + public AjaxResult add(@RequestBody ServicePackageAddDTO servicePackageAddDTO) { + return toAjax(servicePackageService.insertServicePackage(servicePackageAddDTO)); } /** diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/servicepackagecontent/ServicePackageContentController.java b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/servicepackagecontent/ServicePackageContentController.java new file mode 100644 index 00000000..ce20544f --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/servicepackagecontent/ServicePackageContentController.java @@ -0,0 +1,91 @@ +package com.xinelu.manage.controller.servicepackagecontent; + +import com.xinelu.common.annotation.Log; +import com.xinelu.common.core.controller.BaseController; +import com.xinelu.common.core.domain.AjaxResult; +import com.xinelu.common.core.page.TableDataInfo; +import com.xinelu.common.enums.BusinessType; +import com.xinelu.common.utils.poi.ExcelUtil; +import com.xinelu.manage.domain.servicepackagecontent.ServicePackageContent; +import com.xinelu.manage.service.servicepackagecontent.IServicePackageContentService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 服务包内容Controller + * + * @author xinelu + * @date 2024-03-04 + */ +@RestController +@RequestMapping("/manage/servicepackagecontent") +public class ServicePackageContentController extends BaseController { + @Resource + private IServicePackageContentService servicePackageContentService; + + /** + * 查询服务包内容列表 + */ + @PreAuthorize("@ss.hasPermi('manage:servicepackagecontent:list')") + @GetMapping("/list") + public TableDataInfo list(ServicePackageContent servicePackageContent) { + startPage(); + List list = servicePackageContentService.selectServicePackageContentList(servicePackageContent); + return getDataTable(list); + } + + /** + * 导出服务包内容列表 + */ + @PreAuthorize("@ss.hasPermi('manage:servicepackagecontent:export')") + @Log(title = "服务包内容", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ServicePackageContent servicePackageContent) { + List list = servicePackageContentService.selectServicePackageContentList(servicePackageContent); + ExcelUtil util = new ExcelUtil(ServicePackageContent.class); + util.exportExcel(response, list, "服务包内容数据"); + } + + /** + * 获取服务包内容详细信息 + */ + @PreAuthorize("@ss.hasPermi('manage:servicepackagecontent:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return AjaxResult.success(servicePackageContentService.selectServicePackageContentById(id)); + } + + /** + * 新增服务包内容 + */ + @PreAuthorize("@ss.hasPermi('manage:servicepackagecontent:add')") + @Log(title = "服务包内容", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ServicePackageContent servicePackageContent) { + return toAjax(servicePackageContentService.insertServicePackageContent(servicePackageContent)); + } + + /** + * 修改服务包内容 + */ + @PreAuthorize("@ss.hasPermi('manage:servicepackagecontent:edit')") + @Log(title = "服务包内容", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ServicePackageContent servicePackageContent) { + return toAjax(servicePackageContentService.updateServicePackageContent(servicePackageContent)); + } + + /** + * 删除服务包内容 + */ + @PreAuthorize("@ss.hasPermi('manage:servicepackagecontent:remove')") + @Log(title = "服务包内容", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(servicePackageContentService.deleteServicePackageContentByIds(ids)); + } +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/servicewaycontent/ServiceWayContentController.java b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/servicewaycontent/ServiceWayContentController.java index ad5b2bf0..7e5ce134 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/servicewaycontent/ServiceWayContentController.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/servicewaycontent/ServiceWayContentController.java @@ -92,8 +92,8 @@ public class ServiceWayContentController extends BaseController { * @return */ @ApiOperation("根据id删除服务方式") - @DeleteMapping("/removeServiceWay") - public AjaxResult removeServiceWay(Long id) { + @DeleteMapping("/removeServiceWay/{id}") + public AjaxResult removeServiceWay(@PathVariable Long id) { return toAjax(serviceWayContentService.deleteServiceWayById(id)); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/scriptInfo/ScriptInfo.java b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/scriptInfo/ScriptInfo.java index f7a0d7f0..e2f27b11 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/scriptInfo/ScriptInfo.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/scriptInfo/ScriptInfo.java @@ -71,7 +71,7 @@ public class ScriptInfo extends BaseEntity { @ApiModelProperty(value = "通用话术名称") @Excel(name = "通用话术名称") @NotBlank(message = "通用话术名称不能为空", groups = {Insert.class, Update.class}) - @Length(max = 100, message = "通用话术名称名称不能超过100个字符", groups = {Insert.class, Update.class}) + @Length(max = 100, message = "通用话术名称不能超过100个字符", groups = {Insert.class, Update.class}) private String commonScriptName; /** diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/servicepackagecontent/ServicePackageContent.java b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/servicepackagecontent/ServicePackageContent.java new file mode 100644 index 00000000..af553fd2 --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/servicepackagecontent/ServicePackageContent.java @@ -0,0 +1,117 @@ +package com.xinelu.manage.domain.servicepackagecontent; + +import com.xinelu.common.annotation.Excel; +import com.xinelu.common.core.domain.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 服务包内容对象 service_package_content + * + * @author xinelu + * @date 2024-03-04 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "服务包内容对象", description = "service_package_content") +public class ServicePackageContent extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键id + */ + private Long id; + + /** + * 服务包表id + */ + @ApiModelProperty(value = "服务包表id") + @Excel(name = "服务包表id") + private Long servicePackageId; + + /** + * 服务方式名称 + */ + @ApiModelProperty(value = "服务方式名称") + @Excel(name = "服务方式名称") + private String serviceWayName; + + /** + * 服务方式编码 + */ + @ApiModelProperty(value = "服务方式编码") + @Excel(name = "服务方式编码") + private String serviceWayCode; + + /** + * 所属服务方式id + */ + @ApiModelProperty(value = "所属服务方式id") + @Excel(name = "所属服务方式id") + private Long serviceWayId; + + /** + * 服务内容 + */ + @ApiModelProperty(value = "服务内容") + @Excel(name = "服务内容") + private String serviceContent; + + /** + * 所属服务内容id + */ + @ApiModelProperty(value = "所属服务内容id") + @Excel(name = "所属服务内容id") + private Long serviceContentId; + + /** + * 服务频次文本 + */ + @ApiModelProperty(value = "服务频次文本") + @Excel(name = "服务频次文本") + private String serviceFrequencyText; + + /** + * 服务频次数字起始值 + */ + @ApiModelProperty(value = "服务频次数字起始值") + @Excel(name = "服务频次数字起始值") + private Integer serviceFrequencyStart; + + /** + * 服务频次数字结束值 + */ + @ApiModelProperty(value = "服务频次数字结束值") + @Excel(name = "服务频次数字结束值") + private Integer serviceFrequencyEnd; + + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("servicePackageId", getServicePackageId()) + .append("serviceWayName", getServiceWayName()) + .append("serviceWayCode", getServiceWayCode()) + .append("serviceWayId", getServiceWayId()) + .append("serviceContent", getServiceContent()) + .append("serviceContentId", getServiceContentId()) + .append("serviceFrequencyText", getServiceFrequencyText()) + .append("serviceFrequencyStart", getServiceFrequencyStart()) + .append("serviceFrequencyEnd", getServiceFrequencyEnd()) + .append("remark", getRemark()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/dto/servicepackage/ServicePackageAddDTO.java b/postdischarge-manage/src/main/java/com/xinelu/manage/dto/servicepackage/ServicePackageAddDTO.java new file mode 100644 index 00000000..c2178c6c --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/dto/servicepackage/ServicePackageAddDTO.java @@ -0,0 +1,138 @@ +package com.xinelu.manage.dto.servicepackage; + +import com.xinelu.common.annotation.Excel; +import com.xinelu.common.custominterface.Insert; +import com.xinelu.common.custominterface.Update; +import com.xinelu.manage.vo.servicepackagecontent.ServicePackageContentVO; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.math.BigDecimal; +import java.util.List; + +/** + * @author : youxilong + * @date : 2024/3/4 17:02 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@ApiModel(value = "服务包新增DTO") +public class ServicePackageAddDTO { + + /** + * 科室id + */ + @ApiModelProperty(value = "科室id") + @Excel(name = "科室id") + @NotBlank(message = "科室id不能为空", groups = {Insert.class, Update.class}) + private Long departmentId; + + /** + * 科室名称 + */ + @ApiModelProperty(value = "科室名称") + @Excel(name = "科室名称") + @NotBlank(message = "科室名称不能为空", groups = {Insert.class, Update.class}) + private String departmentName; + + /** + * 科室病种信息表id + */ + @ApiModelProperty(value = "科室病种信息表id") + @Excel(name = "科室病种信息表id") + @NotBlank(message = "科室病种信息表id不能为空", groups = {Insert.class, Update.class}) + private Long diseaseTypeId; + + /** + * 病种名称 + */ + @ApiModelProperty(value = "病种名称") + @Excel(name = "病种名称") + @NotBlank(message = "病种名称不能为空", groups = {Insert.class, Update.class}) + private String diseaseTypeName; + + /** + * 服务包名称 + */ + @ApiModelProperty(value = "服务包名称") + @Excel(name = "服务包名称") + @NotBlank(message = "服务包名称不能为空", groups = {Insert.class, Update.class}) + @Length(max = 50, message = "服务包名称不能超过50个字符", groups = {Insert.class, Update.class}) + private String packageName; + + /** + * 服务包简介 + */ + @ApiModelProperty(value = "服务包简介") + @Excel(name = "服务包简介") + @NotBlank(message = "服务包简介不能为空", groups = {Insert.class, Update.class}) + @Length(max = 100, message = "服务包简介不能超过100个字符", groups = {Insert.class, Update.class}) + private String packageIntroduction; + + /** + * 服务包价格,单位为:元 + */ + @ApiModelProperty(value = "服务包价格,单位为:元") + @Excel(name = "服务包价格,单位为:元") + @NotBlank(message = "服务包价格不能为空", groups = {Insert.class, Update.class}) + private BigDecimal packagePrice; + + /** + * 服务包版本号 + */ + @ApiModelProperty(value = "服务包版本号") + @Excel(name = "服务包版本号") + @NotBlank(message = "服务包版本号不能为空", groups = {Insert.class, Update.class}) + private String packageVersion; + + /** + * 硬件类型,血压仪:BLOOD_PRESSURE,血糖仪:GLUCOSE_METER,心电仪:ELECTROCARDIOGRA + */ + @ApiModelProperty(value = "硬件类型,血压仪:BLOOD_PRESSURE,血糖仪:GLUCOSE_METER,心电仪:ELECTROCARDIOGRA") + @Excel(name = "硬件类型,血压仪:BLOOD_PRESSURE,血糖仪:GLUCOSE_METER,心电仪:ELECTROCARDIOGRA") + @NotBlank(message = "硬件类型不能为空", groups = {Insert.class, Update.class}) + private String hardwareType; + + /** + * 服务包期限 + */ + @ApiModelProperty(value = "服务包期限") + @Excel(name = "服务包期限") + @NotBlank(message = "服务包期限不能为空", groups = {Insert.class, Update.class}) + private Integer packageTerm; + + /** + * 服务包期限单位,年,月,日 + */ + @ApiModelProperty(value = "服务包期限单位,年,月,日") + @Excel(name = "服务包期限单位,年,月,日") + private String packageTermUnit; + + + /** + * 服务包备注 + */ + @ApiModelProperty(value = "服务包备注") + @Excel(name = "服务包备注") + private String packageRemark; + + + /** + * 是否发布,0:否,1:是 + */ + @ApiModelProperty(value = "是否发布,0:否,1:是") + @Excel(name = "是否发布,0:否,1:是") + private Integer whetherRelease; + + /** + * 服务内容列表 + */ + @ApiModelProperty(value = "服务内容列表") + private List voList; +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/dto/textmessage/TextMessageTaskDTO.java b/postdischarge-manage/src/main/java/com/xinelu/manage/dto/textmessage/TextMessageTaskDTO.java index 81e27354..82ed8fbd 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/dto/textmessage/TextMessageTaskDTO.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/dto/textmessage/TextMessageTaskDTO.java @@ -2,12 +2,17 @@ package com.xinelu.manage.dto.textmessage; import com.xinelu.common.annotation.Excel; import com.xinelu.common.core.domain.BaseEntity; +import com.xinelu.common.custominterface.Insert; +import com.xinelu.common.custominterface.Update; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; /** * @author : youxilong @@ -37,6 +42,7 @@ public class TextMessageTaskDTO extends BaseEntity { */ @ApiModelProperty(value = "所属科室名称") @Excel(name = "所属科室名称") + @NotBlank(message = "所属科室名称不能为空", groups = {Insert.class, Update.class}) private String departmentName; /** @@ -58,6 +64,8 @@ public class TextMessageTaskDTO extends BaseEntity { */ @ApiModelProperty(value = "短信模板名称") @Excel(name = "短信模板名称") + @NotBlank(message = "短信模板名称不能为空", groups = {Insert.class, Update.class}) + @Length(max = 100, message = "短信模板名称不能超过100个字符", groups = {Insert.class, Update.class}) private String textMessageName; /** @@ -65,6 +73,7 @@ public class TextMessageTaskDTO extends BaseEntity { */ @ApiModelProperty(value = "短信ID") @Excel(name = "短信ID") + @NotBlank(message = "短信ID不能为空", groups = {Insert.class, Update.class}) private String textMessageId; /** @@ -72,6 +81,8 @@ public class TextMessageTaskDTO extends BaseEntity { */ @ApiModelProperty(value = "短信内容") @Excel(name = "短信内容") + @NotBlank(message = "短信内容不能为空", groups = {Insert.class, Update.class}) + @Length(max = 300, message = "短信内容不能超过300个字符", groups = {Insert.class, Update.class}) private String textMessageContent; /** diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/servicepackage/ServicePackageMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/servicepackage/ServicePackageMapper.java index e43a439c..bdf986ab 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/servicepackage/ServicePackageMapper.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/servicepackage/ServicePackageMapper.java @@ -3,6 +3,7 @@ package com.xinelu.manage.mapper.servicepackage; import com.xinelu.manage.domain.servicepackage.ServicePackage; import com.xinelu.manage.vo.servicepackage.ServicePackageDetailVO; import com.xinelu.manage.vo.servicepackage.ServicePackageVO; +import com.xinelu.manage.vo.servicepackagecontent.ServicePackageContentVO; import java.util.List; @@ -67,4 +68,19 @@ public interface ServicePackageMapper { * @return */ ServicePackageDetailVO selectServicePackagesById(Long id); + + /** + * 查询服务包列表 + * @param servicePackage + * @return + */ + List selectServicePackageLists(ServicePackage servicePackage); + + /** + * 根据服务包id查询服务包内容 + * @param id + * @return + */ + List selectServicePackageVOListById(Long id); + } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/servicepackagecontent/ServicePackageContentMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/servicepackagecontent/ServicePackageContentMapper.java new file mode 100644 index 00000000..d13cef4d --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/servicepackagecontent/ServicePackageContentMapper.java @@ -0,0 +1,68 @@ +package com.xinelu.manage.mapper.servicepackagecontent; + +import com.xinelu.manage.domain.servicepackagecontent.ServicePackageContent; + +import java.util.List; + +/** + * 服务包内容Mapper接口 + * + * @author xinelu + * @date 2024-03-04 + */ +public interface ServicePackageContentMapper { + /** + * 查询服务包内容 + * + * @param id 服务包内容主键 + * @return 服务包内容 + */ + public ServicePackageContent selectServicePackageContentById(Long id); + + /** + * 查询服务包内容列表 + * + * @param servicePackageContent 服务包内容 + * @return 服务包内容集合 + */ + public List selectServicePackageContentList(ServicePackageContent servicePackageContent); + + /** + * 新增服务包内容 + * + * @param servicePackageContent 服务包内容 + * @return 结果 + */ + public int insertServicePackageContent(ServicePackageContent servicePackageContent); + + /** + * 修改服务包内容 + * + * @param servicePackageContent 服务包内容 + * @return 结果 + */ + public int updateServicePackageContent(ServicePackageContent servicePackageContent); + + /** + * 删除服务包内容 + * + * @param id 服务包内容主键 + * @return 结果 + */ + public int deleteServicePackageContentById(Long id); + + /** + * 批量删除服务包内容 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteServicePackageContentByIds(Long[] ids); + + /** + * 根据服务包id删除服务包内容 + * @param ids + * @return + */ + int deleteServicePackageContentByPackageIds(Long[] ids); +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicepackage/IServicePackageService.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicepackage/IServicePackageService.java index b0ca612d..81d23f4d 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicepackage/IServicePackageService.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicepackage/IServicePackageService.java @@ -1,6 +1,7 @@ package com.xinelu.manage.service.servicepackage; import com.xinelu.manage.domain.servicepackage.ServicePackage; +import com.xinelu.manage.dto.servicepackage.ServicePackageAddDTO; import com.xinelu.manage.vo.servicepackage.ServicePackageDetailVO; import com.xinelu.manage.vo.servicepackage.ServicePackageVO; @@ -32,10 +33,10 @@ public interface IServicePackageService { /** * 新增服务包基础信息 * - * @param servicePackage 服务包基础信息 + * @param servicePackageAddDTO 服务包基础信息 * @return 结果 */ - public int insertServicePackage(ServicePackage servicePackage); + public int insertServicePackage(ServicePackageAddDTO servicePackageAddDTO); /** * 修改服务包基础信息 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 74aea6f2..881caec1 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 @@ -1,11 +1,15 @@ package com.xinelu.manage.service.servicepackage.impl; +import com.xinelu.common.exception.ServiceException; import com.xinelu.common.utils.DateUtils; import com.xinelu.manage.domain.servicepackage.ServicePackage; +import com.xinelu.manage.dto.servicepackage.ServicePackageAddDTO; import com.xinelu.manage.mapper.servicepackage.ServicePackageMapper; +import com.xinelu.manage.mapper.servicepackagecontent.ServicePackageContentMapper; import com.xinelu.manage.service.servicepackage.IServicePackageService; import com.xinelu.manage.vo.servicepackage.ServicePackageDetailVO; import com.xinelu.manage.vo.servicepackage.ServicePackageVO; +import com.xinelu.manage.vo.servicepackagecontent.ServicePackageContentVO; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -23,6 +27,9 @@ public class ServicePackageServiceImpl implements IServicePackageService { @Resource private ServicePackageMapper servicePackageMapper; + @Resource + private ServicePackageContentMapper servicePackageContentMapper; + /** * 查询服务包基础信息 * @@ -31,7 +38,13 @@ public class ServicePackageServiceImpl implements IServicePackageService { */ @Override public ServicePackageDetailVO selectServicePackageById(Long id) { - return servicePackageMapper.selectServicePackagesById(id); + // 根据服务包id查询服务包基础信息 + ServicePackageDetailVO servicePackageDetailVO = servicePackageMapper.selectServicePackagesById(id); + servicePackageDetailVO.setPackageTermAndUnit(servicePackageDetailVO.getPackageTerm() + servicePackageDetailVO.getPackageTermUnit()); + // 根据服务包id查询服务包内容 + List voList = servicePackageMapper.selectServicePackageVOListById(id); + servicePackageDetailVO.setVoList(voList); + return servicePackageDetailVO; } /** @@ -42,7 +55,7 @@ public class ServicePackageServiceImpl implements IServicePackageService { */ @Override public List selectServicePackageList(ServicePackage servicePackage) { - List voList = servicePackageMapper.selectServicePackageList(servicePackage); + List voList = servicePackageMapper.selectServicePackageLists(servicePackage); return voList.stream().map(vo -> { String packageTermAndUnit = vo.getPackageTerm() + vo.getPackageTermUnit(); vo.setPackageTermAndUnit(packageTermAndUnit); @@ -53,11 +66,37 @@ public class ServicePackageServiceImpl implements IServicePackageService { /** * 新增服务包基础信息 * - * @param servicePackage 服务包基础信息 + * @param servicePackageAddDTO 服务包基础信息 * @return 结果 */ @Override - public int insertServicePackage(ServicePackage servicePackage) { + public int insertServicePackage(ServicePackageAddDTO servicePackageAddDTO) { + // TODO + // 1.判断所属科室下服务包名称是否重复 + // 1.1如果重复,报错:当时科室下服务包名称重复 + + // 1.2如果不重复,初始化ServicePackage,将servicePackageAddDTO赋值给ServicePackage,新增服务包 + + // 2.新增服务内容 + // 2.1根据服务包id,服务方式名称判断服务方式表中有没有存在 + + // 2.1.1 如果存在,返回服务方式id + + // 2.2 根据服务包id,服务方式id,服务内容名称判断服务内容表中有没有存在 + + // 2.2.1 如果存在,返回服务内容id + + // 2.3 根据服务包id,服务内容id,服务频次判断服务频次表中有没有存在 + + // 2.3.1 如果存在,报错:请勿重复添加服务包内容 + + // 2.3.2 如果不存在,新增服务频次 + + // 2.2.2 如果不存在,新增服务内容,新增服务频次 + + // 2.1.2 如果不存在,新增服务方式,服务内容,服务频次 + + ServicePackage servicePackage = new ServicePackage(); servicePackage.setCreateTime(DateUtils.getNowDate()); return servicePackageMapper.insertServicePackage(servicePackage); } @@ -70,6 +109,10 @@ public class ServicePackageServiceImpl implements IServicePackageService { */ @Override public int updateServicePackage(ServicePackage servicePackage) { + // 按照全增全删的原则 + // 根据服务包id删除服务包对应的服务包内容 + + // 执行新增的操作 servicePackage.setUpdateTime(DateUtils.getNowDate()); return servicePackageMapper.updateServicePackage(servicePackage); } @@ -82,7 +125,16 @@ public class ServicePackageServiceImpl implements IServicePackageService { */ @Override public int deleteServicePackageByIds(Long[] ids) { - return servicePackageMapper.deleteServicePackageByIds(ids); + // 删除服务包基础信息 + if (servicePackageMapper.deleteServicePackageByIds(ids) <= 0) { + throw new ServiceException("删除服务包失败"); + } + // 删除服务包内容 + if (servicePackageContentMapper.deleteServicePackageContentByPackageIds(ids) <= 0) { + throw new ServiceException("删除服务包内容失败"); + } + return 1; + } /** diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicepackagecontent/IServicePackageContentService.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicepackagecontent/IServicePackageContentService.java new file mode 100644 index 00000000..4fd42fd6 --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicepackagecontent/IServicePackageContentService.java @@ -0,0 +1,61 @@ +package com.xinelu.manage.service.servicepackagecontent; + +import com.xinelu.manage.domain.servicepackagecontent.ServicePackageContent; + +import java.util.List; + +/** + * 服务包内容Service接口 + * + * @author xinelu + * @date 2024-03-04 + */ +public interface IServicePackageContentService { + /** + * 查询服务包内容 + * + * @param id 服务包内容主键 + * @return 服务包内容 + */ + public ServicePackageContent selectServicePackageContentById(Long id); + + /** + * 查询服务包内容列表 + * + * @param servicePackageContent 服务包内容 + * @return 服务包内容集合 + */ + public List selectServicePackageContentList(ServicePackageContent servicePackageContent); + + /** + * 新增服务包内容 + * + * @param servicePackageContent 服务包内容 + * @return 结果 + */ + public int insertServicePackageContent(ServicePackageContent servicePackageContent); + + /** + * 修改服务包内容 + * + * @param servicePackageContent 服务包内容 + * @return 结果 + */ + public int updateServicePackageContent(ServicePackageContent servicePackageContent); + + /** + * 批量删除服务包内容 + * + * @param ids 需要删除的服务包内容主键集合 + * @return 结果 + */ + public int deleteServicePackageContentByIds(Long[] ids); + + /** + * 删除服务包内容信息 + * + * @param id 服务包内容主键 + * @return 结果 + */ + public int deleteServicePackageContentById(Long id); +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicepackagecontent/impl/ServicePackageContentServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicepackagecontent/impl/ServicePackageContentServiceImpl.java new file mode 100644 index 00000000..5fb820c9 --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicepackagecontent/impl/ServicePackageContentServiceImpl.java @@ -0,0 +1,90 @@ +package com.xinelu.manage.service.servicepackagecontent.impl; + +import com.xinelu.common.utils.DateUtils; +import com.xinelu.manage.domain.servicepackagecontent.ServicePackageContent; +import com.xinelu.manage.mapper.servicepackagecontent.ServicePackageContentMapper; +import com.xinelu.manage.service.servicepackagecontent.IServicePackageContentService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 服务包内容Service业务层处理 + * + * @author xinelu + * @date 2024-03-04 + */ +@Service +public class ServicePackageContentServiceImpl implements IServicePackageContentService { + @Resource + private ServicePackageContentMapper servicePackageContentMapper; + + /** + * 查询服务包内容 + * + * @param id 服务包内容主键 + * @return 服务包内容 + */ + @Override + public ServicePackageContent selectServicePackageContentById(Long id) { + return servicePackageContentMapper.selectServicePackageContentById(id); + } + + /** + * 查询服务包内容列表 + * + * @param servicePackageContent 服务包内容 + * @return 服务包内容 + */ + @Override + public List selectServicePackageContentList(ServicePackageContent servicePackageContent) { + return servicePackageContentMapper.selectServicePackageContentList(servicePackageContent); + } + + /** + * 新增服务包内容 + * + * @param servicePackageContent 服务包内容 + * @return 结果 + */ + @Override + public int insertServicePackageContent(ServicePackageContent servicePackageContent) { + servicePackageContent.setCreateTime(DateUtils.getNowDate()); + return servicePackageContentMapper.insertServicePackageContent(servicePackageContent); + } + + /** + * 修改服务包内容 + * + * @param servicePackageContent 服务包内容 + * @return 结果 + */ + @Override + public int updateServicePackageContent(ServicePackageContent servicePackageContent) { + servicePackageContent.setUpdateTime(DateUtils.getNowDate()); + return servicePackageContentMapper.updateServicePackageContent(servicePackageContent); + } + + /** + * 批量删除服务包内容 + * + * @param ids 需要删除的服务包内容主键 + * @return 结果 + */ + @Override + public int deleteServicePackageContentByIds(Long[] ids) { + return servicePackageContentMapper.deleteServicePackageContentByIds(ids); + } + + /** + * 删除服务包内容信息 + * + * @param id 服务包内容主键 + * @return 结果 + */ + @Override + public int deleteServicePackageContentById(Long id) { + return servicePackageContentMapper.deleteServicePackageContentById(id); + } +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicewaycontent/impl/ServiceWayContentServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicewaycontent/impl/ServiceWayContentServiceImpl.java index f98827ff..68bcee67 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicewaycontent/impl/ServiceWayContentServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicewaycontent/impl/ServiceWayContentServiceImpl.java @@ -18,6 +18,7 @@ import com.xinelu.manage.vo.servicewaycontent.ServiceWayContentVO; import com.xinelu.system.mapper.SysDictDataMapper; import org.apache.commons.lang3.ObjectUtils; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.util.Date; @@ -158,16 +159,16 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService { throw new ServiceException("更新服务频次失败"); } } else { - // 如果服务内容在服务内容表不存在,新增服务内容,更新服务频次 - // 新增服务内容 + // 如果服务内容在服务内容表不存在,更新服务内容,更新服务频次 + // 更新服务内容 ServiceWayContent serviceContent = new ServiceWayContent(); - serviceContent.setServiceType(ServiceWayContentServiceType.SERVICE_CONTENT.toString()); + serviceContent.setId(serviceWayContentEditDTO.getServiceContentId()); serviceContent.setServiceWayId(serviceWayContentEditDTO.getServiceWayId()); serviceContent.setServiceContent(serviceWayContentEditDTO.getServiceContent()); - serviceContent.setCreateBy(username); - serviceContent.setCreateTime(date); - if (serviceWayContentMapper.insertServiceWayContent(serviceContent) <= 0) { - throw new ServiceException("新增服务内容失败"); + serviceContent.setUpdateBy(username); + serviceContent.setUpdateTime(date); + if (serviceWayContentMapper.updateServiceWayContent(serviceContent) <= 0) { + throw new ServiceException("更新服务内容失败"); } // 修改服务频次 serviceFrequency.setId(serviceWayContentEditDTO.getId()); @@ -226,6 +227,7 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService { * @return */ @Override + @Transactional(rollbackFor = Exception.class) public int insertServiceWay(ServiceWayContent serviceWayContent) { // 查询服务方式名称是否存在 int existNameCount = serviceWayContentMapper.countByServiceName(serviceWayContent.getServiceWayName()); @@ -250,6 +252,7 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService { * @return */ @Override + @Transactional(rollbackFor = Exception.class) public int editServiceWay(ServiceWayContent serviceWayContent) { // 查询服务方式名称是否存在 int existNameCount = serviceWayContentMapper.countByServiceName(serviceWayContent.getServiceWayName()); diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/wechattemplate/impl/WechatTemplateServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/wechattemplate/impl/WechatTemplateServiceImpl.java index a88664f0..b54261ab 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/wechattemplate/impl/WechatTemplateServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/wechattemplate/impl/WechatTemplateServiceImpl.java @@ -5,7 +5,6 @@ import com.xinelu.common.exception.ServiceException; import com.xinelu.common.utils.DateUtils; import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.bean.BeanUtils; -import com.xinelu.manage.domain.textmessagesuittask.TextMessageSuitTask; import com.xinelu.manage.domain.wechattemplate.WechatTemplate; import com.xinelu.manage.domain.wechattemplatesuittask.WechatTemplateSuitTask; import com.xinelu.manage.dto.wechattemplate.WechatTemplateDTO; @@ -16,6 +15,7 @@ import com.xinelu.manage.vo.wechattemplate.WechatTemplateTaskVO; import com.xinelu.manage.vo.wechattemplate.WechatTemplateVO; import com.xinelu.system.mapper.SysDictDataMapper; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.util.ArrayList; @@ -89,6 +89,7 @@ public class WechatTemplateServiceImpl implements IWechatTemplateService { * @return 结果 */ @Override + @Transactional(rollbackFor = Exception.class) public int insertWechatTemplate(WechatTemplateTaskDTO wechatTemplateTaskDTO) { // 检查微信名称是否已存在 if (wechatTemplateMapper.countByWechatTemplateTaskDTO(wechatTemplateTaskDTO) > 0) { @@ -144,6 +145,7 @@ public class WechatTemplateServiceImpl implements IWechatTemplateService { * @return 结果 */ @Override + @Transactional(rollbackFor = Exception.class) public int updateWechatTemplate(WechatTemplateTaskDTO wechatTemplateTaskDTO) { // 检查微信模板名称是否已存在 if (wechatTemplateMapper.countByWechatTemplateTaskDTO(wechatTemplateTaskDTO) > 0) { diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/servicepackage/ServicePackageDetailVO.java b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/servicepackage/ServicePackageDetailVO.java index 46f20745..ad21c195 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/servicepackage/ServicePackageDetailVO.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/servicepackage/ServicePackageDetailVO.java @@ -1,6 +1,7 @@ package com.xinelu.manage.vo.servicepackage; import com.xinelu.common.annotation.Excel; +import com.xinelu.manage.vo.servicepackagecontent.ServicePackageContentVO; import com.xinelu.manage.vo.serviceway.ServiceWayVO; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -84,8 +85,8 @@ public class ServicePackageDetailVO { private String hardwareType; /** - * 服务方式列表 + * 服务内容列表 */ - @ApiModelProperty(value = "服务方式列表") - private List serviceWayList; + @ApiModelProperty(value = "服务内容列表") + private List voList; } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/servicepackage/ServicePackageVO.java b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/servicepackage/ServicePackageVO.java index 54c4086a..ddd69cdd 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/servicepackage/ServicePackageVO.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/servicepackage/ServicePackageVO.java @@ -88,4 +88,11 @@ public class ServicePackageVO { @Excel(name = "是否发布,0:否,1:是") private Integer whetherRelease; + /** + * 病种名称 + */ + @ApiModelProperty(value = "病种名称") + @Excel(name = "病种名称") + private String diseaseTypeName; + } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/servicepackagecontent/ServicePackageContentVO.java b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/servicepackagecontent/ServicePackageContentVO.java new file mode 100644 index 00000000..2550245e --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/servicepackagecontent/ServicePackageContentVO.java @@ -0,0 +1,74 @@ +package com.xinelu.manage.vo.servicepackagecontent; + +import com.xinelu.common.annotation.Excel; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @author : youxilong + * @date : 2024/3/4 15:46 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@ApiModel(value = "服务方式内容VO") +public class ServicePackageContentVO { + + /** + * 服务方式id + */ + private Long id; + + /** + * 服务方式名称 + */ + @ApiModelProperty(value = "服务方式名称") + @Excel(name = "服务方式名称") + private String serviceWayName; + + /** + * 服务内容id + */ + @ApiModelProperty(value = "服务内容id") + @Excel(name = "服务内容id") + private Long serviceContentId; + + /** + * 服务内容 + */ + @ApiModelProperty(value = "服务内容") + @Excel(name = "服务内容") + private String serviceContent; + + /** + * 服务频次id + */ + @ApiModelProperty(value = "服务频次id") + @Excel(name = "服务频次id") + private Long serviceFrequencyId; + + /** + * 服务频次文本 + */ + @ApiModelProperty(value = "服务频次文本") + @Excel(name = "服务频次文本") + private String serviceFrequencyText; + + /** + * 服务频次数字起始值 + */ + @ApiModelProperty(value = "服务频次数字起始值") + @Excel(name = "服务频次数字起始值") + private Integer serviceFrequencyStart; + + /** + * 服务频次数字结束值 + */ + @ApiModelProperty(value = "服务频次数字结束值") + @Excel(name = "服务频次数字结束值") + private Integer serviceFrequencyEnd; + +} diff --git a/postdischarge-manage/src/main/resources/mapper/manage/servicepackage/ServicePackageMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/servicepackage/ServicePackageMapper.xml index cda72bdc..e06eed28 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/servicepackage/ServicePackageMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/servicepackage/ServicePackageMapper.xml @@ -47,6 +47,27 @@ from service_package + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, + service_package_id, + service_way_name, + service_way_code, + service_way_id, + service_content, + service_content_id, + service_frequency_text, + service_frequency_start, + service_frequency_end, + remark, + create_by, + create_time, + update_by, + update_time + from service_package_content + + + + + + + + insert into service_package_content + + service_package_id, + + service_way_name, + + service_way_code, + + service_way_id, + + service_content, + + service_content_id, + + service_frequency_text, + + service_frequency_start, + + service_frequency_end, + + remark, + + create_by, + + create_time, + + update_by, + + update_time, + + + + #{servicePackageId}, + + #{serviceWayName}, + + #{serviceWayCode}, + + #{serviceWayId}, + + #{serviceContent}, + + #{serviceContentId}, + + #{serviceFrequencyText}, + + #{serviceFrequencyStart}, + + #{serviceFrequencyEnd}, + + #{remark}, + + #{createBy}, + + #{createTime}, + + #{updateBy}, + + #{updateTime}, + + + + + + update service_package_content + + service_package_id = + #{servicePackageId}, + + service_way_name = + #{serviceWayName}, + + service_way_code = + #{serviceWayCode}, + + service_way_id = + #{serviceWayId}, + + service_content = + #{serviceContent}, + + service_content_id = + #{serviceContentId}, + + service_frequency_text = + #{serviceFrequencyText}, + + service_frequency_start = + #{serviceFrequencyStart}, + + service_frequency_end = + #{serviceFrequencyEnd}, + + remark = + #{remark}, + + create_by = + #{createBy}, + + create_time = + #{createTime}, + + update_by = + #{updateBy}, + + update_time = + #{updateTime}, + + + where id = #{id} + + + + delete + from service_package_content + where id = #{id} + + + + delete from service_package_content where id in + + #{id} + + + + delete from service_package_content where service_package_id in + + #{id} + + + \ No newline at end of file