From c07584dbd7ba288ccff6e69f7313cd30a6192b30 Mon Sep 17 00:00:00 2001 From: youxilong Date: Mon, 11 Mar 2024 17:50:27 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=AD=97=E6=AE=B5=E4=BF=A1=E6=81=AF=E7=9A=84?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E3=80=81=E6=96=B0=E5=A2=9E=E3=80=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E3=80=81=E5=88=A0=E9=99=A4=E5=88=9D=E6=AD=A5=E5=AE=8C?= =?UTF-8?q?=E6=88=90=202.=E5=AD=97=E6=AE=B5=E5=86=85=E5=AE=B9=E7=9A=84?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E3=80=81=E6=96=B0=E5=A2=9E=E3=80=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E3=80=81=E5=88=A0=E9=99=A4=E5=88=9D=E6=AD=A5=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xinelu/common/constant/Constants.java | 28 ++- .../LabelFieldInfoFieldTypeConstants.java | 29 +++ .../LabelFieldContentController.java | 92 ++++++++ .../LabelFieldInfoController.java | 101 ++++++++ .../labelfieldcontent/LabelFieldContent.java | 89 ++++++++ .../domain/labelfieldinfo/LabelFieldInfo.java | 73 ++++++ .../LabelFieldContentAddDTO.java | 42 ++++ .../LabelFieldContentDTO.java | 58 +++++ .../labelfieldinfo/LabelFieldInfoAddDTO.java | 22 ++ .../servicepackage/ServicePackageAddDTO.java | 2 + .../ServiceWayContentAddDTO.java | 12 + .../LabelFieldContentMapper.java | 81 +++++++ .../labelfieldinfo/LabelFieldInfoMapper.java | 81 +++++++ .../ILabelFieldContentService.java | 69 ++++++ .../impl/LabelFieldContentServiceImpl.java | 143 ++++++++++++ .../ILabelFieldInfoService.java | 70 ++++++ .../impl/LabelFieldInfoServiceImpl.java | 157 +++++++++++++ .../impl/OperationInfoServiceImpl.java | 7 +- .../IServicePackageService.java | 3 - .../impl/ServicePackageServiceImpl.java | 6 + .../impl/ServiceWayContentServiceImpl.java | 12 +- .../LabelFieldContentMapper.xml | 215 ++++++++++++++++++ .../labelfieldinfo/LabelFieldInfoMapper.xml | 176 ++++++++++++++ .../wechattemplate/WechatTemplateMapper.xml | 2 +- 24 files changed, 1550 insertions(+), 20 deletions(-) create mode 100644 postdischarge-common/src/main/java/com/xinelu/common/constant/LabelFieldInfoFieldTypeConstants.java create mode 100644 postdischarge-manage/src/main/java/com/xinelu/manage/controller/labelfieldcontent/LabelFieldContentController.java create mode 100644 postdischarge-manage/src/main/java/com/xinelu/manage/controller/labelfieldinfo/LabelFieldInfoController.java create mode 100644 postdischarge-manage/src/main/java/com/xinelu/manage/domain/labelfieldcontent/LabelFieldContent.java create mode 100644 postdischarge-manage/src/main/java/com/xinelu/manage/domain/labelfieldinfo/LabelFieldInfo.java create mode 100644 postdischarge-manage/src/main/java/com/xinelu/manage/dto/labelfieldcontent/LabelFieldContentAddDTO.java create mode 100644 postdischarge-manage/src/main/java/com/xinelu/manage/dto/labelfieldcontent/LabelFieldContentDTO.java create mode 100644 postdischarge-manage/src/main/java/com/xinelu/manage/dto/labelfieldinfo/LabelFieldInfoAddDTO.java create mode 100644 postdischarge-manage/src/main/java/com/xinelu/manage/mapper/labelfieldcontent/LabelFieldContentMapper.java create mode 100644 postdischarge-manage/src/main/java/com/xinelu/manage/mapper/labelfieldinfo/LabelFieldInfoMapper.java create mode 100644 postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/ILabelFieldContentService.java create mode 100644 postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/impl/LabelFieldContentServiceImpl.java create mode 100644 postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldinfo/ILabelFieldInfoService.java create mode 100644 postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldinfo/impl/LabelFieldInfoServiceImpl.java create mode 100644 postdischarge-manage/src/main/resources/mapper/manage/labelfieldcontent/LabelFieldContentMapper.xml create mode 100644 postdischarge-manage/src/main/resources/mapper/manage/labelfieldinfo/LabelFieldInfoMapper.xml diff --git a/postdischarge-common/src/main/java/com/xinelu/common/constant/Constants.java b/postdischarge-common/src/main/java/com/xinelu/common/constant/Constants.java index b4445747..358ea4db 100644 --- a/postdischarge-common/src/main/java/com/xinelu/common/constant/Constants.java +++ b/postdischarge-common/src/main/java/com/xinelu/common/constant/Constants.java @@ -134,15 +134,15 @@ public class Constants { public static final String[] JOB_ERROR_STR = {"java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml", "org.springframework", "org.apache", "com.xinelu.common.utils.file"}; - /** - * 图片上传文件带.的 - */ - public static final String FILE_NAME_SPOT = "."; + /** + * 图片上传文件带.的 + */ + public static final String FILE_NAME_SPOT = "."; - /** - * 字符串空格标识 - */ - public static final String EMPTY = " "; + /** + * 字符串空格标识 + */ + public static final String EMPTY = " "; /** * Excel文件格式后缀 @@ -168,4 +168,16 @@ public class Constants { * 科室信息导入标识 */ public static final String DEPARTMENT = "department"; + + /** + * 手术编号 + */ + public static final String SURGERY_ENCODING = "SE"; + + /** + * 服务方式编码 + */ + public static final String SERVICE_MODE_ENCODING = "SME"; + + } diff --git a/postdischarge-common/src/main/java/com/xinelu/common/constant/LabelFieldInfoFieldTypeConstants.java b/postdischarge-common/src/main/java/com/xinelu/common/constant/LabelFieldInfoFieldTypeConstants.java new file mode 100644 index 00000000..0bbaa866 --- /dev/null +++ b/postdischarge-common/src/main/java/com/xinelu/common/constant/LabelFieldInfoFieldTypeConstants.java @@ -0,0 +1,29 @@ +package com.xinelu.common.constant; + +/** + * 字段标签信息字段类型 + * + * @author : youxilong + * @date : 2024/3/11 10:19 + */ +public class LabelFieldInfoFieldTypeConstants { + /** + * 画像标签字段 + */ + public static final String PORTRAIT_LABEL_FIELD = "PORTRAIT_LABEL_FIELD"; + + /** + * 知识库字段 + */ + public static final String KNOWLEDGE_FIELD = "KNOWLEDGE_FIELD"; + + /** + * 字段信息编码前缀 + */ + public static final String FIELD_ENCODING = "FE"; + + /** + * 字段内容编码前缀 + */ + public static final String CONTENT_ENCODING = "CE"; +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/labelfieldcontent/LabelFieldContentController.java b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/labelfieldcontent/LabelFieldContentController.java new file mode 100644 index 00000000..4a6d2259 --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/labelfieldcontent/LabelFieldContentController.java @@ -0,0 +1,92 @@ +package com.xinelu.manage.controller.labelfieldcontent; + +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.labelfieldcontent.LabelFieldContent; +import com.xinelu.manage.dto.labelfieldcontent.LabelFieldContentAddDTO; +import com.xinelu.manage.service.labelfieldcontent.ILabelFieldContentService; +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-11 + */ +@RestController +@RequestMapping("/manage/labelfieldcontent") +public class LabelFieldContentController extends BaseController { + @Resource + private ILabelFieldContentService labelFieldContentService; + + /** + * 查询标签字段内容信息列表 + */ + @PreAuthorize("@ss.hasPermi('manage:labelfieldcontent:list')") + @GetMapping("/list") + public TableDataInfo list(LabelFieldContent labelFieldContent) { + startPage(); + List list = labelFieldContentService.selectLabelFieldContentList(labelFieldContent); + return getDataTable(list); + } + + /** + * 导出标签字段内容信息列表 + */ + @PreAuthorize("@ss.hasPermi('manage:labelfieldcontent:export')") + @Log(title = "标签字段内容信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, LabelFieldContent labelFieldContent) { + List list = labelFieldContentService.selectLabelFieldContentList(labelFieldContent); + ExcelUtil util = new ExcelUtil(LabelFieldContent.class); + util.exportExcel(response, list, "标签字段内容信息数据"); + } + + /** + * 获取标签字段内容信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('manage:labelfieldcontent:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return AjaxResult.success(labelFieldContentService.selectLabelFieldContentById(id)); + } + + /** + * 批量新增标签字段内容信息 + */ + @PreAuthorize("@ss.hasPermi('manage:labelfieldcontent:add')") + @Log(title = "标签字段内容信息", businessType = BusinessType.INSERT) + @PostMapping("/add") + public AjaxResult add(@RequestBody LabelFieldContentAddDTO labelFieldContentAddDTO) { + return toAjax(labelFieldContentService.insertLabelFieldContents(labelFieldContentAddDTO)); + } + + /** + * 修改标签字段内容信息 + */ + @PreAuthorize("@ss.hasPermi('manage:labelfieldcontent:edit')") + @Log(title = "标签字段内容信息", businessType = BusinessType.UPDATE) + @PutMapping("/edit") + public AjaxResult edit(@RequestBody LabelFieldContent labelFieldContent) { + return toAjax(labelFieldContentService.updateLabelFieldContent(labelFieldContent)); + } + + /** + * 删除标签字段内容信息 + */ + @PreAuthorize("@ss.hasPermi('manage:labelfieldcontent:remove')") + @Log(title = "标签字段内容信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(labelFieldContentService.deleteLabelFieldContentByIds(ids)); + } +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/labelfieldinfo/LabelFieldInfoController.java b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/labelfieldinfo/LabelFieldInfoController.java new file mode 100644 index 00000000..185f35cf --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/labelfieldinfo/LabelFieldInfoController.java @@ -0,0 +1,101 @@ +package com.xinelu.manage.controller.labelfieldinfo; + +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.labelfieldinfo.LabelFieldInfo; +import com.xinelu.manage.dto.labelfieldinfo.LabelFieldInfoAddDTO; +import com.xinelu.manage.service.labelfieldinfo.ILabelFieldInfoService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +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-11 + */ +@Api(tags = "字段信息控制器") +@RestController +@RequestMapping("/manage/labelfieldinfo") +public class LabelFieldInfoController extends BaseController { + @Resource + private ILabelFieldInfoService labelFieldInfoService; + + /** + * 查询标签字段信息列表 + */ + @ApiOperation("查询标签字段信息列表") + @PreAuthorize("@ss.hasPermi('manage:labelfieldinfo:list')") + @GetMapping("/list") + public TableDataInfo list(LabelFieldInfo labelFieldInfo) { + startPage(); + List list = labelFieldInfoService.selectLabelFieldInfoList(labelFieldInfo); + return getDataTable(list); + } + + /** + * 导出标签字段信息列表 + */ + @ApiOperation("导出标签字段信息列表") + @PreAuthorize("@ss.hasPermi('manage:labelfieldinfo:export')") + @Log(title = "标签字段信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, LabelFieldInfo labelFieldInfo) { + List list = labelFieldInfoService.selectLabelFieldInfoList(labelFieldInfo); + ExcelUtil util = new ExcelUtil(LabelFieldInfo.class); + util.exportExcel(response, list, "标签字段信息数据"); + } + + /** + * 获取标签字段信息详细信息 + */ + @ApiOperation("获取标签字段信息详细信息") + @PreAuthorize("@ss.hasPermi('manage:labelfieldinfo:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return AjaxResult.success(labelFieldInfoService.selectLabelFieldInfoById(id)); + } + + /** + * 批量新增标签字段信息 + */ + @ApiOperation("批量新增标签字段信息") + @PreAuthorize("@ss.hasPermi('manage:labelfieldinfo:add')") + @Log(title = "标签字段信息", businessType = BusinessType.INSERT) + @PostMapping("/add") + public AjaxResult add(@RequestBody LabelFieldInfoAddDTO labelFieldInfoAddDTO) { + return toAjax(labelFieldInfoService.insertLabelFieldInfoList(labelFieldInfoAddDTO)); + } + + /** + * 修改标签字段信息 + */ + @ApiOperation("修改标签字段信息") + @PreAuthorize("@ss.hasPermi('manage:labelfieldinfo:edit')") + @Log(title = "标签字段信息", businessType = BusinessType.UPDATE) + @PutMapping("/edit") + public AjaxResult edit(@RequestBody LabelFieldInfo labelFieldInfo) { + return toAjax(labelFieldInfoService.updateLabelFieldInfo(labelFieldInfo)); + } + + /** + * 删除标签字段信息 + */ + @ApiOperation("删除标签字段信息") + @PreAuthorize("@ss.hasPermi('manage:labelfieldinfo:remove')") + @Log(title = "标签字段信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(labelFieldInfoService.deleteLabelFieldInfoByIds(ids)); + } +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/labelfieldcontent/LabelFieldContent.java b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/labelfieldcontent/LabelFieldContent.java new file mode 100644 index 00000000..68834ef9 --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/labelfieldcontent/LabelFieldContent.java @@ -0,0 +1,89 @@ +package com.xinelu.manage.domain.labelfieldcontent; + +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; + +/** + * 标签字段内容信息对象 label_field_content + * + * @author xinelu + * @date 2024-03-11 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "标签字段内容信息对象", description = "label_field_content") +public class LabelFieldContent extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键id + */ + private Long id; + + /** + * 画像标签和知识库字段表id + */ + @ApiModelProperty(value = "画像标签和知识库字段表id") + @Excel(name = "画像标签和知识库字段表id") + private Long fieldId; + + /** + * 字段名称 + */ + @ApiModelProperty(value = "字段名称") + @Excel(name = "字段名称") + private String fieldName; + + /** + * 内容名称 + */ + @ApiModelProperty(value = "内容名称") + @Excel(name = "内容名称") + private String contentName; + + /** + * 内容编码 + */ + @ApiModelProperty(value = "内容编码") + @Excel(name = "内容编码") + private String contentCode; + + /** + * 结果预览 + */ + @ApiModelProperty(value = "结果预览") + @Excel(name = "结果预览") + private String resultPreview; + + /** + * 内容排序 + */ + @ApiModelProperty(value = "内容排序") + @Excel(name = "内容排序") + private Integer contentSort; + + /** + * 内容备注信息 + */ + @ApiModelProperty(value = "内容备注信息") + @Excel(name = "内容备注信息") + private String contentRemark; + + /** + * 画像字段标识,存储方式例子:${content} + */ + @ApiModelProperty(value = "画像字段标识,存储方式例子:${content}") + @Excel(name = "画像字段标识,存储方式例子:${content}") + private String fieldMark; + +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/labelfieldinfo/LabelFieldInfo.java b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/labelfieldinfo/LabelFieldInfo.java new file mode 100644 index 00000000..f91434c3 --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/labelfieldinfo/LabelFieldInfo.java @@ -0,0 +1,73 @@ +package com.xinelu.manage.domain.labelfieldinfo; + +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.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import javax.validation.constraints.NotBlank; + +/** + * 标签字段信息对象 label_field_info + * + * @author xinelu + * @date 2024-03-11 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "标签字段信息对象", description = "label_field_info") +public class LabelFieldInfo extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键id + */ + private Long id; + + /** + * 字段名称 + */ + @ApiModelProperty(value = "字段名称") + @Excel(name = "字段名称") + @NotBlank(message = "字段名称不能为空", groups = {Insert.class, Update.class}) + private String fieldName; + + /** + * 字段编码 + */ + @ApiModelProperty(value = "字段编码") + @Excel(name = "字段编码") + private String fieldCode; + + /** + * 字段类型,画像标签字段:PORTRAIT_LABEL_FIELD,知识库字段:KNOWLEDGE_FIELD + */ + @ApiModelProperty(value = "字段类型,画像标签字段:PORTRAIT_LABEL_FIELD,知识库字段:KNOWLEDGE_FIELD") + @Excel(name = "字段类型,画像标签字段:PORTRAIT_LABEL_FIELD,知识库字段:KNOWLEDGE_FIELD") + @NotBlank(message = "字段类型不能为空", groups = {Insert.class, Update.class}) + private String fieldType; + + /** + * 字段排序 + */ + @ApiModelProperty(value = "字段排序") + @Excel(name = "字段排序") + private Integer fieldSort; + + /** + * 字段备注信息 + */ + @ApiModelProperty(value = "字段备注信息") + @Excel(name = "字段备注信息") + private String fieldRemark; +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/dto/labelfieldcontent/LabelFieldContentAddDTO.java b/postdischarge-manage/src/main/java/com/xinelu/manage/dto/labelfieldcontent/LabelFieldContentAddDTO.java new file mode 100644 index 00000000..c1e315a9 --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/dto/labelfieldcontent/LabelFieldContentAddDTO.java @@ -0,0 +1,42 @@ +package com.xinelu.manage.dto.labelfieldcontent; + +import com.xinelu.common.custominterface.Insert; +import com.xinelu.common.custominterface.Update; +import com.xinelu.manage.domain.labelfieldcontent.LabelFieldContent; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.util.List; + +/** + * 标签字段内容AddDTO + * + * @author : youxilong + * @date : 2024/3/11 17:09 + */ +@Data +public class LabelFieldContentAddDTO { + + /** + * 画像标签和知识库字段表id + */ + @NotBlank(message = "画像标签和知识库字段表id不能为空", groups = {Insert.class, Update.class}) + @ApiModelProperty(value = "画像标签和知识库字段表id") + private Long fieldId; + + /** + * 字段名称 + */ + @NotBlank(message = "字段名称不能为空", groups = {Insert.class, Update.class}) + @ApiModelProperty(value = "字段名称") + private String fieldName; + + + /** + * 标签字段内容对象集合 + */ + @ApiModelProperty(value = "标签字段内容对象集合") + private List fieldContentList; + +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/dto/labelfieldcontent/LabelFieldContentDTO.java b/postdischarge-manage/src/main/java/com/xinelu/manage/dto/labelfieldcontent/LabelFieldContentDTO.java new file mode 100644 index 00000000..6d315ec6 --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/dto/labelfieldcontent/LabelFieldContentDTO.java @@ -0,0 +1,58 @@ +package com.xinelu.manage.dto.labelfieldcontent; + +import com.xinelu.common.annotation.Excel; +import com.xinelu.common.core.domain.BaseEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 标签字段内容DTO + * + * @author : youxilong + * @date : 2024/3/11 17:20 + */ +@Data +public class LabelFieldContentDTO extends BaseEntity { + + /** + * 内容名称 + */ + @ApiModelProperty(value = "内容名称") + @Excel(name = "内容名称") + private String contentName; + + /** + * 内容编码 + */ + @ApiModelProperty(value = "内容编码") + @Excel(name = "内容编码") + private String contentCode; + + /** + * 结果预览 + */ + @ApiModelProperty(value = "结果预览") + @Excel(name = "结果预览") + private String resultPreview; + + /** + * 内容排序 + */ + @ApiModelProperty(value = "内容排序") + @Excel(name = "内容排序") + private Integer contentSort; + + /** + * 内容备注信息 + */ + @ApiModelProperty(value = "内容备注信息") + @Excel(name = "内容备注信息") + private String contentRemark; + + /** + * 画像字段标识,存储方式例子:${content} + */ + @ApiModelProperty(value = "画像字段标识,存储方式例子:${content}") + @Excel(name = "画像字段标识,存储方式例子:${content}") + private String fieldMark; +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/dto/labelfieldinfo/LabelFieldInfoAddDTO.java b/postdischarge-manage/src/main/java/com/xinelu/manage/dto/labelfieldinfo/LabelFieldInfoAddDTO.java new file mode 100644 index 00000000..6fc9dcac --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/dto/labelfieldinfo/LabelFieldInfoAddDTO.java @@ -0,0 +1,22 @@ +package com.xinelu.manage.dto.labelfieldinfo; + +import com.xinelu.manage.domain.labelfieldinfo.LabelFieldInfo; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * 标签字段信息AddDTO + * @author : youxilong + * @date : 2024/3/11 13:05 + */ +@Data +public class LabelFieldInfoAddDTO { + + /** + * 标签字段信息对象集合 + */ + @ApiModelProperty(value = "标签字段信息对象集合") + private List labelFieldInfoList; +} 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 index 109bf405..f790686f 100644 --- 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 @@ -136,6 +136,8 @@ public class ServicePackageAddDTO { @Excel(name = "是否发布,0:否,1:是") private Integer whetherRelease; + + /** * 服务内容列表 */ diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/dto/servicewaycontent/ServiceWayContentAddDTO.java b/postdischarge-manage/src/main/java/com/xinelu/manage/dto/servicewaycontent/ServiceWayContentAddDTO.java index dceb02e6..370822e8 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/dto/servicewaycontent/ServiceWayContentAddDTO.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/dto/servicewaycontent/ServiceWayContentAddDTO.java @@ -1,12 +1,16 @@ package com.xinelu.manage.dto.servicewaycontent; import com.xinelu.common.annotation.Excel; +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.NoArgsConstructor; +import javax.validation.constraints.NotBlank; + /** * @author : youxilong * @date : 2024/3/1 14:52 @@ -27,6 +31,7 @@ public class ServiceWayContentAddDTO { */ @ApiModelProperty(value = "服务内容") @Excel(name = "服务内容") + @NotBlank(message = "服务内容不能为空", groups = {Insert.class, Update.class}) private String serviceContent; /** @@ -56,4 +61,11 @@ public class ServiceWayContentAddDTO { @ApiModelProperty(value = "服务频次数字结束值") @Excel(name = "服务频次数字结束值") private Integer serviceFrequencyEnd; + + /** + * 排序 + */ + @ApiModelProperty(value = "排序") + @Excel(name = "排序") + private Integer serviceSort; } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/labelfieldcontent/LabelFieldContentMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/labelfieldcontent/LabelFieldContentMapper.java new file mode 100644 index 00000000..9fe5aadc --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/labelfieldcontent/LabelFieldContentMapper.java @@ -0,0 +1,81 @@ +package com.xinelu.manage.mapper.labelfieldcontent; + +import com.xinelu.manage.domain.labelfieldcontent.LabelFieldContent; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 标签字段内容信息Mapper接口 + * + * @author xinelu + * @date 2024-03-11 + */ +public interface LabelFieldContentMapper { + /** + * 查询标签字段内容信息 + * + * @param id 标签字段内容信息主键 + * @return 标签字段内容信息 + */ + public LabelFieldContent selectLabelFieldContentById(Long id); + + /** + * 查询标签字段内容信息列表 + * + * @param labelFieldContent 标签字段内容信息 + * @return 标签字段内容信息集合 + */ + public List selectLabelFieldContentList(LabelFieldContent labelFieldContent); + + /** + * 新增标签字段内容信息 + * + * @param labelFieldContent 标签字段内容信息 + * @return 结果 + */ + public int insertLabelFieldContent(LabelFieldContent labelFieldContent); + + /** + * 修改标签字段内容信息 + * + * @param labelFieldContent 标签字段内容信息 + * @return 结果 + */ + public int updateLabelFieldContent(LabelFieldContent labelFieldContent); + + /** + * 删除标签字段内容信息 + * + * @param id 标签字段内容信息主键 + * @return 结果 + */ + public int deleteLabelFieldContentById(Long id); + + /** + * 批量删除标签字段内容信息 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteLabelFieldContentByIds(Long[] ids); + + /** + * 检查数据库中同一个fieldId下内容名称的重复性 + * + * @param fieldId + * @param contentName + * @return + */ + int existCountByFieldIdAndContentName(@Param("fieldId") Long fieldId, @Param("contentName") String contentName); + + /** + * 检查除去当前记录外有没有重复内容名称 + * + * @param id + * @param fieldId + * @param contentName + * @return + */ + int existCountByContentNameExcludingId(@Param("id") Long id, @Param("fieldId") Long fieldId, @Param("contentName") String contentName); +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/labelfieldinfo/LabelFieldInfoMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/labelfieldinfo/LabelFieldInfoMapper.java new file mode 100644 index 00000000..bc5a6a2d --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/labelfieldinfo/LabelFieldInfoMapper.java @@ -0,0 +1,81 @@ +package com.xinelu.manage.mapper.labelfieldinfo; + +import com.xinelu.manage.domain.labelfieldinfo.LabelFieldInfo; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 标签字段信息Mapper接口 + * + * @author xinelu + * @date 2024-03-11 + */ +public interface LabelFieldInfoMapper { + /** + * 查询标签字段信息 + * + * @param id 标签字段信息主键 + * @return 标签字段信息 + */ + public LabelFieldInfo selectLabelFieldInfoById(Long id); + + /** + * 查询标签字段信息列表 + * + * @param labelFieldInfo 标签字段信息 + * @return 标签字段信息集合 + */ + public List selectLabelFieldInfoList(LabelFieldInfo labelFieldInfo); + + /** + * 新增标签字段信息 + * + * @param labelFieldInfo 标签字段信息 + * @return 结果 + */ + public int insertLabelFieldInfo(LabelFieldInfo labelFieldInfo); + + /** + * 修改标签字段信息 + * + * @param labelFieldInfo 标签字段信息 + * @return 结果 + */ + public int updateLabelFieldInfo(LabelFieldInfo labelFieldInfo); + + /** + * 删除标签字段信息 + * + * @param id 标签字段信息主键 + * @return 结果 + */ + public int deleteLabelFieldInfoById(Long id); + + /** + * 批量删除标签字段信息 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteLabelFieldInfoByIds(Long[] ids); + + /** + * 检查同类型下有没有重复字段名称 + * + * @param fieldType + * @param fieldNames + * @return + */ + int countDuplicateFieldNamesByType(@Param("fieldType") String fieldType, @Param("fieldNames") List fieldNames); + + /** + * 检查除当前记录外有没有同名的字段信息名称 + * + * @param id + * @param fieldType + * @param fieldName + * @return + */ + int countByFieldNameExcludingId(@Param("id") Long id, @Param("fieldType") String fieldType, @Param("fieldName") String fieldName); +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/ILabelFieldContentService.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/ILabelFieldContentService.java new file mode 100644 index 00000000..c56f26f2 --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/ILabelFieldContentService.java @@ -0,0 +1,69 @@ +package com.xinelu.manage.service.labelfieldcontent; + +import com.xinelu.manage.domain.labelfieldcontent.LabelFieldContent; +import com.xinelu.manage.dto.labelfieldcontent.LabelFieldContentAddDTO; + +import java.util.List; + +/** + * 标签字段内容信息Service接口 + * + * @author xinelu + * @date 2024-03-11 + */ +public interface ILabelFieldContentService { + /** + * 查询标签字段内容信息 + * + * @param id 标签字段内容信息主键 + * @return 标签字段内容信息 + */ + public LabelFieldContent selectLabelFieldContentById(Long id); + + /** + * 查询标签字段内容信息列表 + * + * @param labelFieldContent 标签字段内容信息 + * @return 标签字段内容信息集合 + */ + public List selectLabelFieldContentList(LabelFieldContent labelFieldContent); + + /** + * 新增标签字段内容信息 + * + * @param labelFieldContent 标签字段内容信息 + * @return 结果 + */ + public int insertLabelFieldContent(LabelFieldContent labelFieldContent); + + /** + * 修改标签字段内容信息 + * + * @param labelFieldContent 标签字段内容信息 + * @return 结果 + */ + public int updateLabelFieldContent(LabelFieldContent labelFieldContent); + + /** + * 批量删除标签字段内容信息 + * + * @param ids 需要删除的标签字段内容信息主键集合 + * @return 结果 + */ + public int deleteLabelFieldContentByIds(Long[] ids); + + /** + * 删除标签字段内容信息 + * + * @param id 标签字段内容信息主键 + * @return 结果 + */ + public int deleteLabelFieldContentById(Long id); + + /** + * 批量新增标签字段内容信息 + * @param labelFieldContentAddDTO + * @return + */ + int insertLabelFieldContents(LabelFieldContentAddDTO labelFieldContentAddDTO); +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/impl/LabelFieldContentServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/impl/LabelFieldContentServiceImpl.java new file mode 100644 index 00000000..ab447cb5 --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/impl/LabelFieldContentServiceImpl.java @@ -0,0 +1,143 @@ +package com.xinelu.manage.service.labelfieldcontent.impl; + +import com.xinelu.common.constant.LabelFieldInfoFieldTypeConstants; +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.common.utils.codes.GenerateSystemCodeUtil; +import com.xinelu.manage.domain.labelfieldcontent.LabelFieldContent; +import com.xinelu.manage.dto.labelfieldcontent.LabelFieldContentAddDTO; +import com.xinelu.manage.dto.labelfieldcontent.LabelFieldContentDTO; +import com.xinelu.manage.mapper.labelfieldcontent.LabelFieldContentMapper; +import com.xinelu.manage.service.labelfieldcontent.ILabelFieldContentService; +import org.apache.commons.lang3.ObjectUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 标签字段内容信息Service业务层处理 + * + * @author xinelu + * @date 2024-03-11 + */ +@Service +public class LabelFieldContentServiceImpl implements ILabelFieldContentService { + @Resource + private LabelFieldContentMapper labelFieldContentMapper; + + @Resource + private GenerateSystemCodeUtil systemCodeUtil; + + /** + * 查询标签字段内容信息 + * + * @param id 标签字段内容信息主键 + * @return 标签字段内容信息 + */ + @Override + public LabelFieldContent selectLabelFieldContentById(Long id) { + return labelFieldContentMapper.selectLabelFieldContentById(id); + } + + /** + * 查询标签字段内容信息列表 + * + * @param labelFieldContent 标签字段内容信息 + * @return 标签字段内容信息 + */ + @Override + public List selectLabelFieldContentList(LabelFieldContent labelFieldContent) { + return labelFieldContentMapper.selectLabelFieldContentList(labelFieldContent); + } + + /** + * 新增标签字段内容信息 + * + * @param labelFieldContent 标签字段内容信息 + * @return 结果 + */ + @Override + public int insertLabelFieldContent(LabelFieldContent labelFieldContent) { + labelFieldContent.setCreateTime(DateUtils.getNowDate()); + return labelFieldContentMapper.insertLabelFieldContent(labelFieldContent); + } + + /** + * 修改标签字段内容信息 + * + * @param labelFieldContent 标签字段内容信息 + * @return 结果 + */ + @Override + public int updateLabelFieldContent(LabelFieldContent labelFieldContent) { + if (ObjectUtils.isEmpty(labelFieldContentMapper.selectLabelFieldContentById(labelFieldContent.getId()))) { + throw new ServiceException("当前字段内容不存在,无法修改,请联系管理员"); + } + // 检查除去当前记录外有没有重复内容名称 + int existCount = labelFieldContentMapper.existCountByContentNameExcludingId(labelFieldContent.getId(), labelFieldContent.getFieldId(), labelFieldContent.getContentName()); + if (existCount > 0) { + throw new ServiceException("当前标签字段类型下字段内容名称已存在"); + } + labelFieldContent.setUpdateBy(SecurityUtils.getUsername()); + labelFieldContent.setUpdateTime(DateUtils.getNowDate()); + return labelFieldContentMapper.updateLabelFieldContent(labelFieldContent); + } + + /** + * 批量删除标签字段内容信息 + * + * @param ids 需要删除的标签字段内容信息主键 + * @return 结果 + */ + @Override + public int deleteLabelFieldContentByIds(Long[] ids) { + return labelFieldContentMapper.deleteLabelFieldContentByIds(ids); + } + + /** + * 删除标签字段内容信息信息 + * + * @param id 标签字段内容信息主键 + * @return 结果 + */ + @Override + public int deleteLabelFieldContentById(Long id) { + return labelFieldContentMapper.deleteLabelFieldContentById(id); + } + + /** + * 批量新增标签字段内容信息 + * + * @param labelFieldContentAddDTO + * @return + */ + @Override + public int insertLabelFieldContents(LabelFieldContentAddDTO labelFieldContentAddDTO) { + // 获取到标签字段内容信息集合 + List fieldContentList = labelFieldContentAddDTO.getFieldContentList(); + // 获取到标签字段信息Id + Long fieldId = labelFieldContentAddDTO.getFieldId(); + // 检查数据库中同一个fieldId下内容名称的重复性 + for (LabelFieldContentDTO contentDTO : fieldContentList) { + // 如果存在,报错-已存在字段内容名称 + if (labelFieldContentMapper.existCountByFieldIdAndContentName(fieldId, contentDTO.getContentName()) > 0) { + throw new ServiceException("当前标签字段类型下字段内容名称已存在"); + } + // 不存在,执行新增 + LabelFieldContent labelFieldContent = new LabelFieldContent(); + BeanUtils.copyProperties(contentDTO, labelFieldContent); + labelFieldContent.setFieldId(labelFieldContentAddDTO.getFieldId()); + labelFieldContent.setFieldName(labelFieldContentAddDTO.getFieldName()); + labelFieldContent.setContentCode(LabelFieldInfoFieldTypeConstants.CONTENT_ENCODING + systemCodeUtil.generateDepartCode(LabelFieldInfoFieldTypeConstants.CONTENT_ENCODING)); + labelFieldContent.setCreateBy(SecurityUtils.getUsername()); + labelFieldContent.setCreateTime(DateUtils.getNowDate()); + if (labelFieldContentMapper.insertLabelFieldContent(labelFieldContent) <= 0) { + throw new ServiceException("新增标签字段内容信息失败"); + } + } + return 1; + } +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldinfo/ILabelFieldInfoService.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldinfo/ILabelFieldInfoService.java new file mode 100644 index 00000000..5a6c31fc --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldinfo/ILabelFieldInfoService.java @@ -0,0 +1,70 @@ +package com.xinelu.manage.service.labelfieldinfo; + +import com.xinelu.manage.domain.labelfieldinfo.LabelFieldInfo; +import com.xinelu.manage.dto.labelfieldinfo.LabelFieldInfoAddDTO; + +import java.util.List; + +/** + * 标签字段信息Service接口 + * + * @author xinelu + * @date 2024-03-11 + */ +public interface ILabelFieldInfoService { + /** + * 查询标签字段信息 + * + * @param id 标签字段信息主键 + * @return 标签字段信息 + */ + public LabelFieldInfo selectLabelFieldInfoById(Long id); + + /** + * 查询标签字段信息列表 + * + * @param labelFieldInfo 标签字段信息 + * @return 标签字段信息集合 + */ + public List selectLabelFieldInfoList(LabelFieldInfo labelFieldInfo); + + /** + * 新增标签字段信息 + * + * @param labelFieldInfo 标签字段信息 + * @return 结果 + */ + public int insertLabelFieldInfo(LabelFieldInfo labelFieldInfo); + + /** + * 修改标签字段信息 + * + * @param labelFieldInfo 标签字段信息 + * @return 结果 + */ + public int updateLabelFieldInfo(LabelFieldInfo labelFieldInfo); + + /** + * 批量删除标签字段信息 + * + * @param ids 需要删除的标签字段信息主键集合 + * @return 结果 + */ + public int deleteLabelFieldInfoByIds(Long[] ids); + + /** + * 删除标签字段信息信息 + * + * @param id 标签字段信息主键 + * @return 结果 + */ + public int deleteLabelFieldInfoById(Long id); + + /** + * 批量新增标签字段信息 + * @param labelFieldInfoAddDTO + * @return + */ + int insertLabelFieldInfoList(LabelFieldInfoAddDTO labelFieldInfoAddDTO); + +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldinfo/impl/LabelFieldInfoServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldinfo/impl/LabelFieldInfoServiceImpl.java new file mode 100644 index 00000000..0bdc1cc4 --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldinfo/impl/LabelFieldInfoServiceImpl.java @@ -0,0 +1,157 @@ +package com.xinelu.manage.service.labelfieldinfo.impl; + +import com.xinelu.common.constant.LabelFieldInfoFieldTypeConstants; +import com.xinelu.common.exception.ServiceException; +import com.xinelu.common.utils.DateUtils; +import com.xinelu.common.utils.SecurityUtils; +import com.xinelu.common.utils.codes.GenerateSystemCodeUtil; +import com.xinelu.manage.domain.labelfieldinfo.LabelFieldInfo; +import com.xinelu.manage.dto.labelfieldinfo.LabelFieldInfoAddDTO; +import com.xinelu.manage.mapper.labelfieldinfo.LabelFieldInfoMapper; +import com.xinelu.manage.service.labelfieldinfo.ILabelFieldInfoService; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.ObjectUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 标签字段信息Service业务层处理 + * + * @author xinelu + * @date 2024-03-11 + */ +@Service +public class LabelFieldInfoServiceImpl implements ILabelFieldInfoService { + @Resource + private LabelFieldInfoMapper labelFieldInfoMapper; + + @Resource + private GenerateSystemCodeUtil systemCodeUtil; + + /** + * 查询标签字段信息 + * + * @param id 标签字段信息主键 + * @return 标签字段信息 + */ + @Override + public LabelFieldInfo selectLabelFieldInfoById(Long id) { + return labelFieldInfoMapper.selectLabelFieldInfoById(id); + } + + /** + * 查询标签字段信息列表 + * + * @param labelFieldInfo 标签字段信息 + * @return 标签字段信息 + */ + @Override + public List selectLabelFieldInfoList(LabelFieldInfo labelFieldInfo) { + return labelFieldInfoMapper.selectLabelFieldInfoList(labelFieldInfo); + } + + /** + * 新增标签字段信息 + * + * @param labelFieldInfo 标签字段信息 + * @return 结果 + */ + @Override + public int insertLabelFieldInfo(LabelFieldInfo labelFieldInfo) { + labelFieldInfo.setCreateTime(DateUtils.getNowDate()); + return labelFieldInfoMapper.insertLabelFieldInfo(labelFieldInfo); + } + + /** + * 修改标签字段信息 + * + * @param labelFieldInfo 标签字段信息 + * @return 结果 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public int updateLabelFieldInfo(LabelFieldInfo labelFieldInfo) { + // 检查id对应的标签信息是否存在 + LabelFieldInfo fieldInfo = labelFieldInfoMapper.selectLabelFieldInfoById(labelFieldInfo.getId()); + if (ObjectUtils.isEmpty(fieldInfo)) { + throw new ServiceException("当前标签信息不存在,无法修改,请联系管理员"); + } + // 检查除当前记录外有没有重复的标签信息名称 + if (labelFieldInfoMapper.countByFieldNameExcludingId(labelFieldInfo.getId(), labelFieldInfo.getFieldType(), labelFieldInfo.getFieldName()) > 0) { + throw new ServiceException("当前字段类型下字段名称已存在"); + } + // 执行修改操作 + labelFieldInfo.setUpdateBy(SecurityUtils.getUsername()); + labelFieldInfo.setUpdateTime(DateUtils.getNowDate()); + return labelFieldInfoMapper.updateLabelFieldInfo(labelFieldInfo); + } + + /** + * 批量删除标签字段信息 + * + * @param ids 需要删除的标签字段信息主键 + * @return 结果 + */ + @Override + public int deleteLabelFieldInfoByIds(Long[] ids) { + return labelFieldInfoMapper.deleteLabelFieldInfoByIds(ids); + } + + /** + * 删除标签字段信息信息 + * + * @param id 标签字段信息主键 + * @return 结果 + */ + @Override + public int deleteLabelFieldInfoById(Long id) { + return labelFieldInfoMapper.deleteLabelFieldInfoById(id); + } + + /** + * 批量新增标签字段信息 + * + * @param labelFieldInfoAddDTO + * @return + */ + @Transactional(rollbackFor = Exception.class) + @Override + public int insertLabelFieldInfoList(LabelFieldInfoAddDTO labelFieldInfoAddDTO) { + // 如果对象为空,提示请填加标签字段信息 + List fieldInfoList = labelFieldInfoAddDTO.getLabelFieldInfoList(); + if (CollectionUtils.isEmpty(fieldInfoList)) { + throw new ServiceException("请填加标签字段信息"); + } + // 如果不为空,按字段类型分组并且收集每个类型下的字段名称 + Map> fieldTypeToNamesMap = fieldInfoList.stream(). + collect(Collectors.groupingBy(LabelFieldInfo::getFieldType, + Collectors.mapping(LabelFieldInfo::getFieldName, Collectors.toList()))); + // 对于每个字段类型下字段名称进行重复性检查 + for (Map.Entry> entry : fieldTypeToNamesMap.entrySet()) { + // 获取字段类型和字段名称集合 + String fieldType = entry.getKey(); + List fieldNames = entry.getValue(); + // 查询数据库中是否存在同字段类型下字段名称 + int duplicateCount = labelFieldInfoMapper.countDuplicateFieldNamesByType(fieldType, fieldNames); + // 如果存在,提示该字段类型下已存在 + if (duplicateCount > 0) { + throw new ServiceException("当前字段类型下字段名称已存在"); + } + } + // 如果不存在,执行新增操作 + for (LabelFieldInfo labelFieldInfo : fieldInfoList) { + labelFieldInfo.setFieldCode(LabelFieldInfoFieldTypeConstants.FIELD_ENCODING + systemCodeUtil.generateDepartCode(LabelFieldInfoFieldTypeConstants.FIELD_ENCODING)); + labelFieldInfo.setCreateBy(SecurityUtils.getUsername()); + labelFieldInfo.setCreateTime(DateUtils.getNowDate()); + if (labelFieldInfoMapper.insertLabelFieldInfo(labelFieldInfo) <= 0) { + throw new ServiceException("新增标签字段信息失败"); + } + } + return 1; + } +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/operationInfo/impl/OperationInfoServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/operationInfo/impl/OperationInfoServiceImpl.java index 9713445f..adfa3c6b 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/operationInfo/impl/OperationInfoServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/operationInfo/impl/OperationInfoServiceImpl.java @@ -1,9 +1,10 @@ package com.xinelu.manage.service.operationInfo.impl; +import com.xinelu.common.constant.Constants; import com.xinelu.common.exception.ServiceException; import com.xinelu.common.utils.DateUtils; import com.xinelu.common.utils.SecurityUtils; -import com.xinelu.common.utils.StringUtils; +import com.xinelu.common.utils.codes.GenerateSystemCodeUtil; import com.xinelu.manage.domain.operationInfo.OperationInfo; import com.xinelu.manage.mapper.operationInfo.OperationInfoMapper; import com.xinelu.manage.service.operationInfo.IOperationInfoService; @@ -24,6 +25,9 @@ public class OperationInfoServiceImpl implements IOperationInfoService { @Resource private OperationInfoMapper operationInfoMapper; + @Resource + private GenerateSystemCodeUtil systemCodeUtil; + /** * 查询手术信息 * @@ -61,6 +65,7 @@ public class OperationInfoServiceImpl implements IOperationInfoService { throw new ServiceException("手术名称已存在"); } // 设置创建人、创建时间 + operationInfo.setOperationCode(Constants.SURGERY_ENCODING + systemCodeUtil.generateDepartCode(Constants.SURGERY_ENCODING)); operationInfo.setCreateBy(SecurityUtils.getUsername()); operationInfo.setCreateTime(DateUtils.getNowDate()); return operationInfoMapper.insertOperationInfo(operationInfo); 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 cbf1814c..2d42d9dc 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 @@ -4,9 +4,6 @@ import com.xinelu.common.core.page.TableDataInfo; 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; - -import java.util.List; /** * 服务包基础信息Service接口 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 42fbb738..6aa47a66 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,13 @@ package com.xinelu.manage.service.servicepackage.impl; +import com.xinelu.common.constant.Constants; import com.xinelu.common.core.page.TableDataInfo; import com.xinelu.common.exception.ServiceException; import com.xinelu.common.utils.DateUtils; import com.xinelu.common.utils.PageServiceUtil; import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.bean.BeanUtils; +import com.xinelu.common.utils.codes.GenerateSystemCodeUtil; import com.xinelu.manage.domain.servicepackage.ServicePackage; import com.xinelu.manage.domain.servicepackagecontent.ServicePackageContent; import com.xinelu.manage.dto.servicepackage.ServicePackageAddDTO; @@ -40,6 +42,9 @@ public class ServicePackageServiceImpl implements IServicePackageService { @Resource private PageServiceUtil pageServiceUtil; + @Resource + private GenerateSystemCodeUtil systemCodeUtil; + /** * 查询服务包基础信息 * @@ -152,6 +157,7 @@ public class ServicePackageServiceImpl implements IServicePackageService { Long serviceWayId = servicePackageContentMapper.countByPackageIdAndServiceWayName(servicePackage.getId(), vo.getServiceWayName()); if (serviceWayId == null) { ServicePackageContent serviceWay = new ServicePackageContent(); + serviceWay.setServiceWayCode(Constants.SERVICE_MODE_ENCODING + systemCodeUtil.generateDepartCode(Constants.SERVICE_MODE_ENCODING)); serviceWay.setServicePackageId(servicePackage.getId()); serviceWay.setServiceWayName(vo.getServiceWayName()); serviceWay.setCreateBy(username); 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 3bf90fee..bd05f245 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 @@ -1,10 +1,12 @@ package com.xinelu.manage.service.servicewaycontent.impl; +import com.xinelu.common.constant.Constants; import com.xinelu.common.enums.ServiceWayContentServiceType; 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.common.utils.codes.GenerateSystemCodeUtil; import com.xinelu.manage.domain.servicewaycontent.ServiceWayContent; import com.xinelu.manage.dto.servicefrequency.ServiceFrequencyDTO; import com.xinelu.manage.dto.servicewaycontent.ServiceWayContentAddDTO; @@ -37,7 +39,7 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService { private ServiceWayContentMapper serviceWayContentMapper; @Resource - private SysDictDataMapper sysDictDataMapper; + private GenerateSystemCodeUtil systemCodeUtil; /** * 查询服务方式内容 @@ -118,6 +120,7 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService { serviceFrequency.setServiceFrequencyEnd(serviceWayContentAddDTO.getServiceFrequencyEnd()); serviceFrequency.setCreateBy(username); serviceFrequency.setCreateTime(date); + serviceFrequency.setServiceSort(serviceWayContentAddDTO.getServiceSort()); if (serviceWayContentMapper.insertServiceWayContent(serviceFrequency) <= 0) { throw new ServiceException("新增服务频次失败"); } @@ -253,9 +256,7 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService { throw new ServiceException("服务方式名称已存在"); } // 如果不存在,执行新增功能 - Long dictCodeByName = sysDictDataMapper.selectDictCodeByName(serviceWayContent.getServiceWayName()); - String serviceWayCode = (dictCodeByName != null) ? dictCodeByName.toString() : null; - serviceWayContent.setServiceWayCode(serviceWayCode); + serviceWayContent.setServiceWayCode(Constants.SERVICE_MODE_ENCODING + systemCodeUtil.generateDepartCode(Constants.SERVICE_MODE_ENCODING)); serviceWayContent.setServiceType(ServiceWayContentServiceType.SERVICE_WRY.toString()); serviceWayContent.setCreateBy(SecurityUtils.getUsername()); serviceWayContent.setCreateTime(DateUtils.getNowDate()); @@ -278,9 +279,6 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService { throw new ServiceException("服务方式名称已存在"); } // 如果不存在,执行修改功能 - Long dictCodeByName = sysDictDataMapper.selectDictCodeByName(serviceWayContent.getServiceWayName()); - String serviceWayCode = (dictCodeByName != null) ? dictCodeByName.toString() : null; - serviceWayContent.setServiceWayCode(serviceWayCode); serviceWayContent.setUpdateBy(SecurityUtils.getUsername()); serviceWayContent.setUpdateTime(DateUtils.getNowDate()); return serviceWayContentMapper.updateServiceWay(serviceWayContent); diff --git a/postdischarge-manage/src/main/resources/mapper/manage/labelfieldcontent/LabelFieldContentMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/labelfieldcontent/LabelFieldContentMapper.xml new file mode 100644 index 00000000..1ec4b231 --- /dev/null +++ b/postdischarge-manage/src/main/resources/mapper/manage/labelfieldcontent/LabelFieldContentMapper.xml @@ -0,0 +1,215 @@ + + + + + + + + + + + + + + + + + + + + + + select id, + field_id, + field_name, + content_name, + content_code, + result_preview, + content_sort, + content_remark, + field_mark, + create_by, + create_time, + update_by, + update_time + from label_field_content + + + + + + + + + + + + insert into label_field_content + + field_id, + + field_name, + + content_name, + + content_code, + + result_preview, + + content_sort, + + content_remark, + + field_mark, + + create_by, + + create_time, + + update_by, + + update_time, + + + + #{fieldId}, + + #{fieldName}, + + #{contentName}, + + #{contentCode}, + + #{resultPreview}, + + #{contentSort}, + + #{contentRemark}, + + #{fieldMark}, + + #{createBy}, + + #{createTime}, + + #{updateBy}, + + #{updateTime}, + + + + + + update label_field_content + + field_id = + #{fieldId}, + + field_name = + #{fieldName}, + + content_name = + #{contentName}, + + content_code = + #{contentCode}, + + result_preview = + #{resultPreview}, + + content_sort = + #{contentSort}, + + content_remark = + #{contentRemark}, + + field_mark = + #{fieldMark}, + + create_by = + #{createBy}, + + create_time = + #{createTime}, + + update_by = + #{updateBy}, + + update_time = + #{updateTime}, + + + where id = #{id} + + + + delete + from label_field_content + where id = #{id} + + + + delete from label_field_content where id in + + #{id} + + + \ No newline at end of file diff --git a/postdischarge-manage/src/main/resources/mapper/manage/labelfieldinfo/LabelFieldInfoMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/labelfieldinfo/LabelFieldInfoMapper.xml new file mode 100644 index 00000000..cd9ad500 --- /dev/null +++ b/postdischarge-manage/src/main/resources/mapper/manage/labelfieldinfo/LabelFieldInfoMapper.xml @@ -0,0 +1,176 @@ + + + + + + + + + + + + + + + + + + + select id, + field_name, + field_code, + field_type, + field_sort, + field_remark, + create_by, + create_time, + update_by, + update_time + from label_field_info + + + + + + + + + + + + insert into label_field_info + + field_name, + + field_code, + + field_type, + + field_sort, + + field_remark, + + create_by, + + create_time, + + update_by, + + update_time, + + + + #{fieldName}, + + #{fieldCode}, + + #{fieldType}, + + #{fieldSort}, + + #{fieldRemark}, + + #{createBy}, + + #{createTime}, + + #{updateBy}, + + #{updateTime}, + + + + + + update label_field_info + + field_name = + #{fieldName}, + + field_code = + #{fieldCode}, + + field_type = + #{fieldType}, + + field_sort = + #{fieldSort}, + + field_remark = + #{fieldRemark}, + + create_by = + #{createBy}, + + create_time = + #{createTime}, + + update_by = + #{updateBy}, + + update_time = + #{updateTime}, + + + where id = #{id} + + + + delete + from label_field_info + where id = #{id} + + + + delete from label_field_info where id in + + #{id} + + + \ No newline at end of file diff --git a/postdischarge-manage/src/main/resources/mapper/manage/wechattemplate/WechatTemplateMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/wechattemplate/WechatTemplateMapper.xml index 99327284..ca72b4b7 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/wechattemplate/WechatTemplateMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/wechattemplate/WechatTemplateMapper.xml @@ -177,7 +177,7 @@