查询服务包,删除服务包及服务内容,根据服务包id查询详情

This commit is contained in:
youxilong 2024-03-04 17:32:03 +08:00
parent 19e10ea376
commit 560551791c
20 changed files with 1074 additions and 64 deletions

View File

@ -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));
}
/**

View File

@ -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<ServicePackageContent> 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<ServicePackageContent> list = servicePackageContentService.selectServicePackageContentList(servicePackageContent);
ExcelUtil<ServicePackageContent> util = new ExcelUtil<ServicePackageContent>(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));
}
}

View File

@ -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));
}

View File

@ -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;
/**

View File

@ -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();
}
}

View File

@ -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;
/**
* 是否发布01
*/
@ApiModelProperty(value = "是否发布01")
@Excel(name = "是否发布01")
private Integer whetherRelease;
/**
* 服务内容列表
*/
@ApiModelProperty(value = "服务内容列表")
private List<ServicePackageContentVO> voList;
}

View File

@ -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;
/**

View File

@ -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<ServicePackageVO> selectServicePackageLists(ServicePackage servicePackage);
/**
* 根据服务包id查询服务包内容
* @param id
* @return
*/
List<ServicePackageContentVO> selectServicePackageVOListById(Long id);
}

View File

@ -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<ServicePackageContent> 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);
}

View File

@ -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);
/**
* 修改服务包基础信息

View File

@ -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<ServicePackageContentVO> voList = servicePackageMapper.selectServicePackageVOListById(id);
servicePackageDetailVO.setVoList(voList);
return servicePackageDetailVO;
}
/**
@ -42,7 +55,7 @@ public class ServicePackageServiceImpl implements IServicePackageService {
*/
@Override
public List<ServicePackageVO> selectServicePackageList(ServicePackage servicePackage) {
List<ServicePackageVO> voList = servicePackageMapper.selectServicePackageList(servicePackage);
List<ServicePackageVO> 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;
}
/**

View File

@ -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<ServicePackageContent> 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);
}

View File

@ -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<ServicePackageContent> 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);
}
}

View File

@ -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());

View File

@ -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) {

View File

@ -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<ServiceWayVO> serviceWayList;
@ApiModelProperty(value = "服务内容列表")
private List<ServicePackageContentVO> voList;
}

View File

@ -88,4 +88,11 @@ public class ServicePackageVO {
@Excel(name = "是否发布01")
private Integer whetherRelease;
/**
* 病种名称
*/
@ApiModelProperty(value = "病种名称")
@Excel(name = "病种名称")
private String diseaseTypeName;
}

View File

@ -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;
}

View File

@ -47,6 +47,27 @@
from service_package
</sql>
<resultMap id="ServicePackageVOMap" type="com.xinelu.manage.vo.servicepackage.ServicePackageDetailVO">
<id property="id" column="id"/>
<result column="disease_type_id" property="diseaseTypeId"/>
<result column="disease_type_name" property="diseaseTypeName"/>
<result column="package_name" property="packageName"/>
<result column="package_term" property="packageTerm"/>
<result column="package_term_unit" property="packageTermUnit"/>
<result column="package_price" property="packagePrice"/>
<result column="hardware_type" property="hardwareType"/>
<collection property="voList" ofType="com.xinelu.manage.vo.servicepackagecontent.ServicePackageContentVO">
<id column="spc1Id" property="id"/>
<result column="service_way_name" property="serviceWayName"/>
<result column="spc2Id" property="serviceContentId"/>
<result column="service_content" property="serviceContent"/>
<result column="spc3Id" property="serviceFrequencyId"/>
<result column="service_frequency_text" property="serviceFrequencyText"/>
<result column="service_frequency_start" property="serviceFrequencyStart"/>
<result column="service_frequency_end" property="serviceFrequencyEnd"/>
</collection>
</resultMap>
<select id="selectServicePackageList" parameterType="com.xinelu.manage.mapper.servicepackage.ServicePackageMapper"
resultMap="ServicePackageResult">
<include refid="selectServicePackageVo"/>
@ -118,35 +139,7 @@
where id = #{id}
</select>
<resultMap id="ServicePackageVOMap" type="com.xinelu.manage.vo.servicepackage.ServicePackageDetailVO">
<id property="id" column="id"/>
<result column="disease_type_id" property="diseaseTypeId"/>
<result column="disease_type_name" property="diseaseTypeName"/>
<result column="package_name" property="packageName"/>
<result column="package_term" property="packageTerm"/>
<result column="package_term_unit" property="packageTermUnit"/>
<result column="package_price" property="packagePrice"/>
<result column="hardware_type" property="hardwareType"/>
<collection property="serviceWayList"
ofType="com.xinelu.manage.vo.serviceway.ServiceWayVO">
<id column="spc1Id" property="id"/>
<result column="service_way_name" property="serviceWayName"/>
<collection property="serviceWayContentList"
ofType="com.xinelu.manage.vo.servicewaycontent.ServiceWayContentVO">
<id column="spc2Id" property="id"/>
<result column="service_content" property="serviceContent"/>
<collection property="serviceWayFrequencyList"
ofType="com.xinelu.manage.vo.servicefrequency.ServiceFrequencyVO">
<id column="spc3Id" property="id"/>
<result column="service_frequency_text" property="serviceFrequencyText"/>
<result column="service_frequency_start" property="serviceFrequencyStart"/>
<result column="service_frequency_end" property="serviceFrequencyEnd"/>
</collection>
</collection>
</collection>
</resultMap>
<select id="selectServicePackagesById" resultMap="ServicePackageVOMap"
<select id="selectServicePackagesById"
resultType="com.xinelu.manage.vo.servicepackage.ServicePackageDetailVO">
select sp.id,
sp.disease_type_id,
@ -155,23 +148,80 @@
sp.package_term,
sp.package_term_unit,
sp.package_price,
sp.hardware_type,
spc1.id AS spc1Id,
sp.hardware_type
from service_package sp
where sp.id = #{id}
</select>
<select id="selectServicePackageLists" resultType="com.xinelu.manage.vo.servicepackage.ServicePackageVO"
parameterType="com.xinelu.manage.domain.servicepackage.ServicePackage">
select id,
disease_type_id,
disease_type_name,
package_name,
package_introduction,
package_version,
package_term,
package_term_unit,
package_price,
package_remark,
whether_release
from service_package
<where>
<if test="departmentId != null ">
and department_id =
#{departmentId}
</if>
<if test="diseaseTypeId != null ">
and disease_type_id =
#{diseaseTypeId}
</if>
<if test="diseaseTypeName != null and diseaseTypeName != ''">
and disease_type_name like concat('%',
#{diseaseTypeName},
'%'
)
</if>
<if test="packageName != null and packageName != ''">
and package_name like concat('%',
#{packageName},
'%'
)
</if>
<if test="packageVersion != null and packageVersion != ''">
and package_version like concat('%',
#{packageVersion}
},
'%'
)
</if>
<if test="packagePrice != null ">
and package_price =
#{packagePrice}
</if>
<if test="whetherRelease != null ">
and whether_release =
#{whetherRelease}
</if>
</where>
</select>
<select id="selectServicePackageVOListById"
resultType="com.xinelu.manage.vo.servicepackagecontent.ServicePackageContentVO">
select spc1.id ,
spc1.service_way_name,
spc2.id AS spc2Id,
spc2.id AS serviceContentId,
spc2.service_content,
spc3.id AS spc3Id,
spc3.id AS serviceFrequencyId,
spc3.service_frequency_text,
spc3.service_frequency_start,
spc3.service_frequency_end
from service_package sp
left join service_package_content spc1
on sp.id = #{spc1.service_package_id} and spc1.service_type = 'SERVICE_WRY'
left join service_package_content spc2
on spc1.id = spc2.service_way_id and spc2.service_type = 'SERVICE_CONTENT'
left join service_package_content spc3
on spc2.id = spc3.service_content_id and spc3.service_type = 'SERVICE_FREQUENCY'
where sp.id = #{id}
from service_package_content spc1
join service_package_content spc2
on spc1.id = spc2.service_way_id
join service_package_content spc3
on spc2.id = spc3.service_content_id
where spc1.service_package_id = #{id}
</select>
<insert id="insertServicePackage" parameterType="ServicePackage" useGeneratedKeys="true"

View File

@ -0,0 +1,227 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xinelu.manage.mapper.servicepackagecontent.ServicePackageContentMapper">
<resultMap type="ServicePackageContent" id="ServicePackageContentResult">
<result property="id" column="id"/>
<result property="servicePackageId" column="service_package_id"/>
<result property="serviceWayName" column="service_way_name"/>
<result property="serviceWayCode" column="service_way_code"/>
<result property="serviceWayId" column="service_way_id"/>
<result property="serviceContent" column="service_content"/>
<result property="serviceContentId" column="service_content_id"/>
<result property="serviceFrequencyText" column="service_frequency_text"/>
<result property="serviceFrequencyStart" column="service_frequency_start"/>
<result property="serviceFrequencyEnd" column="service_frequency_end"/>
<result property="remark" column="remark"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<sql id="selectServicePackageContentVo">
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
</sql>
<select id="selectServicePackageContentList" parameterType="ServicePackageContent"
resultMap="ServicePackageContentResult">
<include refid="selectServicePackageContentVo"/>
<where>
<if test="servicePackageId != null ">
and service_package_id =
#{servicePackageId}
</if>
<if test="serviceWayName != null and serviceWayName != ''">
and service_way_name like concat('%',
#{serviceWayName},
'%'
)
</if>
<if test="serviceWayCode != null and serviceWayCode != ''">
and service_way_code =
#{serviceWayCode}
</if>
<if test="serviceWayId != null ">
and service_way_id =
#{serviceWayId}
</if>
<if test="serviceContent != null and serviceContent != ''">
and service_content =
#{serviceContent}
</if>
<if test="serviceContentId != null ">
and service_content_id =
#{serviceContentId}
</if>
<if test="serviceFrequencyText != null and serviceFrequencyText != ''">
and service_frequency_text =
#{serviceFrequencyText}
</if>
<if test="serviceFrequencyStart != null ">
and service_frequency_start =
#{serviceFrequencyStart}
</if>
<if test="serviceFrequencyEnd != null ">
and service_frequency_end =
#{serviceFrequencyEnd}
</if>
</where>
</select>
<select id="selectServicePackageContentById" parameterType="Long"
resultMap="ServicePackageContentResult">
<include refid="selectServicePackageContentVo"/>
where id = #{id}
</select>
<insert id="insertServicePackageContent" parameterType="ServicePackageContent" useGeneratedKeys="true"
keyProperty="id">
insert into service_package_content
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="servicePackageId != null">service_package_id,
</if>
<if test="serviceWayName != null">service_way_name,
</if>
<if test="serviceWayCode != null">service_way_code,
</if>
<if test="serviceWayId != null">service_way_id,
</if>
<if test="serviceContent != null">service_content,
</if>
<if test="serviceContentId != null">service_content_id,
</if>
<if test="serviceFrequencyText != null">service_frequency_text,
</if>
<if test="serviceFrequencyStart != null">service_frequency_start,
</if>
<if test="serviceFrequencyEnd != null">service_frequency_end,
</if>
<if test="remark != null">remark,
</if>
<if test="createBy != null">create_by,
</if>
<if test="createTime != null">create_time,
</if>
<if test="updateBy != null">update_by,
</if>
<if test="updateTime != null">update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="servicePackageId != null">#{servicePackageId},
</if>
<if test="serviceWayName != null">#{serviceWayName},
</if>
<if test="serviceWayCode != null">#{serviceWayCode},
</if>
<if test="serviceWayId != null">#{serviceWayId},
</if>
<if test="serviceContent != null">#{serviceContent},
</if>
<if test="serviceContentId != null">#{serviceContentId},
</if>
<if test="serviceFrequencyText != null">#{serviceFrequencyText},
</if>
<if test="serviceFrequencyStart != null">#{serviceFrequencyStart},
</if>
<if test="serviceFrequencyEnd != null">#{serviceFrequencyEnd},
</if>
<if test="remark != null">#{remark},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="updateBy != null">#{updateBy},
</if>
<if test="updateTime != null">#{updateTime},
</if>
</trim>
</insert>
<update id="updateServicePackageContent" parameterType="ServicePackageContent">
update service_package_content
<trim prefix="SET" suffixOverrides=",">
<if test="servicePackageId != null">service_package_id =
#{servicePackageId},
</if>
<if test="serviceWayName != null">service_way_name =
#{serviceWayName},
</if>
<if test="serviceWayCode != null">service_way_code =
#{serviceWayCode},
</if>
<if test="serviceWayId != null">service_way_id =
#{serviceWayId},
</if>
<if test="serviceContent != null">service_content =
#{serviceContent},
</if>
<if test="serviceContentId != null">service_content_id =
#{serviceContentId},
</if>
<if test="serviceFrequencyText != null">service_frequency_text =
#{serviceFrequencyText},
</if>
<if test="serviceFrequencyStart != null">service_frequency_start =
#{serviceFrequencyStart},
</if>
<if test="serviceFrequencyEnd != null">service_frequency_end =
#{serviceFrequencyEnd},
</if>
<if test="remark != null">remark =
#{remark},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteServicePackageContentById" parameterType="Long">
delete
from service_package_content
where id = #{id}
</delete>
<delete id="deleteServicePackageContentByIds" parameterType="String">
delete from service_package_content where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteServicePackageContentByPackageIds">
delete from service_package_content where service_package_id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>