From ac7d9dc1982f2f50f2fb943b081e9b99b19bf6bc Mon Sep 17 00:00:00 2001 From: lxd <1004405501@qq.com> Date: Fri, 26 Jul 2024 12:47:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=BE=AE=E4=BF=A1=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E6=A8=A1=E5=9D=97=20=E5=92=8C=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E6=9C=BA=E6=9E=84=E7=9B=B8=E5=85=B3=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/org/OrgUnitController.java | 114 ++++++++++++++++++ .../admin/org/vo/OrgUnitPageReqVO.java | 51 ++++++++ .../admin/org/vo/OrgUnitRespVO.java | 62 ++++++++++ .../admin/org/vo/OrgUnitSaveReqVO.java | 48 ++++++++ .../controller/admin/wx/WxController.java | 99 +++++++++++++++ .../controller/admin/wx/vo/WxPageReqVO.java | 27 +++++ .../controller/admin/wx/vo/WxRespVO.java | 44 +++++++ .../controller/admin/wx/vo/WxSaveReqVO.java | 35 ++++++ .../system/dal/dataobject/org/OrgUnitDO.java | 83 +++++++++++++ .../module/system/dal/dataobject/wx/WxDO.java | 59 +++++++++ .../system/dal/mysql/org/OrgUnitMapper.java | 38 ++++++ .../module/system/dal/mysql/wx/WxMapper.java | 30 +++++ .../system/service/org/OrgUnitService.java | 56 +++++++++ .../service/org/OrgUnitServiceImpl.java | 81 +++++++++++++ .../module/system/service/wx/WxService.java | 56 +++++++++ .../system/service/wx/WxServiceImpl.java | 76 ++++++++++++ .../resources/mapper/org/OrgUnitMapper.xml | 15 +++ .../src/main/resources/mapper/wx/WxMapper.xml | 12 ++ 18 files changed, 986 insertions(+) create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/org/OrgUnitController.java create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/org/vo/OrgUnitPageReqVO.java create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/org/vo/OrgUnitRespVO.java create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/org/vo/OrgUnitSaveReqVO.java create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/wx/WxController.java create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/wx/vo/WxPageReqVO.java create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/wx/vo/WxRespVO.java create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/wx/vo/WxSaveReqVO.java create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/org/OrgUnitDO.java create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/wx/WxDO.java create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/org/OrgUnitMapper.java create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/wx/WxMapper.java create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/org/OrgUnitService.java create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/org/OrgUnitServiceImpl.java create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/wx/WxService.java create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/wx/WxServiceImpl.java create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/org/OrgUnitMapper.xml create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/wx/WxMapper.xml diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/org/OrgUnitController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/org/OrgUnitController.java new file mode 100644 index 000000000..25c72ed3e --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/org/OrgUnitController.java @@ -0,0 +1,114 @@ +package cn.iocoder.yudao.module.system.controller.admin.org; + +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.io.IOException; + +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; + +import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; +import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*; + +import cn.iocoder.yudao.module.system.controller.admin.org.vo.*; +import cn.iocoder.yudao.module.system.dal.dataobject.org.OrgUnitDO; +import cn.iocoder.yudao.module.system.service.org.OrgUnitService; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; + +@Tag(name = "管理后台 - 机构管理") +@RestController +@RequestMapping("/org/org/") +@Validated +public class OrgUnitController { + + @Resource + private OrgUnitService Service; + + @PostMapping("/create") + @Operation(summary = "创建机构管理") + @PreAuthorize("@ss.hasPermission('org::create')") + public CommonResult create(@Valid @RequestBody OrgUnitSaveReqVO createReqVO) { + + String msg=""; + if(!Service.getOrgUnitIDISExist(createReqVO.getOrgID())) + { + //当前时间 + LocalDateTime dateTime= LocalDateTime.parse(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")), + DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); + createReqVO.setCreateDate(dateTime); + Service.create(createReqVO); + } + else + { + msg="机构ID已经存在"; + } + + return success(msg); + } + + @PutMapping("/update") + @Operation(summary = "更新机构管理") + @PreAuthorize("@ss.hasPermission('org::update')") + public CommonResult update(@Valid @RequestBody OrgUnitSaveReqVO updateReqVO) { + Service.update(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除机构管理") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('org::delete')") + public CommonResult delete(@RequestParam("id") String id) { + Service.delete(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得机构管理") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('org::query')") + public CommonResult get(@RequestParam("id") String id) { + OrgUnitDO aDo = Service.get(id); + return success(BeanUtils.toBean(aDo, OrgUnitRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得机构管理分页") + @PreAuthorize("@ss.hasPermission('org::query')") + public CommonResult> getPage(@Valid OrgUnitPageReqVO pageReqVO) { + PageResult pageResult = Service.getPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, OrgUnitRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出机构管理 Excel") + @PreAuthorize("@ss.hasPermission('org::export')") + @ApiAccessLog(operateType = EXPORT) + public void exportExcel(@Valid OrgUnitPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = Service.getPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "机构管理.xls", "数据", OrgUnitRespVO.class, + BeanUtils.toBean(list, OrgUnitRespVO.class)); + } + + + +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/org/vo/OrgUnitPageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/org/vo/OrgUnitPageReqVO.java new file mode 100644 index 000000000..9bbf38100 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/org/vo/OrgUnitPageReqVO.java @@ -0,0 +1,51 @@ +package cn.iocoder.yudao.module.system.controller.admin.org.vo; + +import lombok.*; +import io.swagger.v3.oas.annotations.media.Schema; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 机构管理分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class OrgUnitPageReqVO extends PageParam { + + @Schema(description = "机构名称", example = "王五") + private String orgName; + + @Schema(description = "机构地址") + private String address; + + @Schema(description = "联系电话") + private String contactTel; + + @Schema(description = "联系人姓名") + private String contactPerson; + + @Schema(description = "报告上显示的名称:一般跟机构名称一致", example = "赵六") + private String reportName; + + @Schema(description = "上级判读医院机构ID", example = "28957") + private String highLevelOrgID; + + @Schema(description = "能收到微信消息提醒的微信列表,格式为:wxopenid1,wxopenid2,wxopenid3") + private String wxOpenidlist; + + @Schema(description = "机构编号:通常为一个4位数的短号 用于与其他系统的对接之用") + private String orgSN; + + @Schema(description = "创建时间:年月日时分秒") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createDate; + + @Schema(description = "上级机构的机构名称", example = "王五") + private String highLevelOrgName; + + @Schema(description = "机构logo的URL", example = "https://www.iocoder.cn") + private String orgLogoUrl; + +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/org/vo/OrgUnitRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/org/vo/OrgUnitRespVO.java new file mode 100644 index 000000000..49144e1e9 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/org/vo/OrgUnitRespVO.java @@ -0,0 +1,62 @@ +package cn.iocoder.yudao.module.system.controller.admin.org.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 机构管理 Response VO") +@Data +@ExcelIgnoreUnannotated +public class OrgUnitRespVO { + + @Schema(description = "机构ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7824") + @ExcelProperty("机构ID") + private String orgID; + + @Schema(description = "机构名称", example = "王五") + @ExcelProperty("机构名称") + private String orgName; + + @Schema(description = "机构地址") + @ExcelProperty("机构地址") + private String address; + + @Schema(description = "联系电话") + @ExcelProperty("联系电话") + private String contactTel; + + @Schema(description = "联系人姓名") + @ExcelProperty("联系人姓名") + private String contactPerson; + + @Schema(description = "报告上显示的名称:一般跟机构名称一致", example = "赵六") + @ExcelProperty("报告上显示的名称:一般跟机构名称一致") + private String reportName; + + @Schema(description = "上级判读医院机构ID", example = "28957") + @ExcelProperty("上级判读医院机构ID") + private String highLevelOrgID; + + @Schema(description = "能收到微信消息提醒的微信列表,格式为:wxopenid1,wxopenid2,wxopenid3") + @ExcelProperty("能收到微信消息提醒的微信列表,格式为:wxopenid1,wxopenid2,wxopenid3") + private String wxOpenidlist; + + @Schema(description = "机构编号:通常为一个4位数的短号 用于与其他系统的对接之用") + @ExcelProperty("机构编号:通常为一个4位数的短号 用于与其他系统的对接之用") + private String orgSN; + + @Schema(description = "创建时间:年月日时分秒") + @ExcelProperty("创建时间:年月日时分秒") + private LocalDateTime createDate; + + @Schema(description = "上级机构的机构名称", example = "王五") + @ExcelProperty("上级机构的机构名称") + private String highLevelOrgName; + + @Schema(description = "机构logo的URL", example = "https://www.iocoder.cn") + @ExcelProperty("机构logo的URL") + private String orgLogoUrl; + +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/org/vo/OrgUnitSaveReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/org/vo/OrgUnitSaveReqVO.java new file mode 100644 index 000000000..44ecccc49 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/org/vo/OrgUnitSaveReqVO.java @@ -0,0 +1,48 @@ +package cn.iocoder.yudao.module.system.controller.admin.org.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 机构管理新增/修改 Request VO") +@Data +public class OrgUnitSaveReqVO { + + @Schema(description = "机构ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7824") + private String orgID; + + @Schema(description = "机构名称", example = "王五") + private String orgName; + + @Schema(description = "机构地址") + private String address; + + @Schema(description = "联系电话") + private String contactTel; + + @Schema(description = "联系人姓名") + private String contactPerson; + + @Schema(description = "报告上显示的名称:一般跟机构名称一致", example = "赵六") + private String reportName; + + @Schema(description = "上级判读医院机构ID", example = "28957") + private String highLevelOrgID; + + @Schema(description = "能收到微信消息提醒的微信列表,格式为:wxopenid1,wxopenid2,wxopenid3") + private String wxOpenidlist; + + @Schema(description = "机构编号:通常为一个4位数的短号 用于与其他系统的对接之用") + private String orgSN; + + @Schema(description = "创建时间:年月日时分秒") + private LocalDateTime createDate; + + @Schema(description = "上级机构的机构名称", example = "王五") + private String highLevelOrgName; + + @Schema(description = "机构logo的URL", example = "https://www.iocoder.cn") + private String orgLogoUrl; + +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/wx/WxController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/wx/WxController.java new file mode 100644 index 000000000..59a405030 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/wx/WxController.java @@ -0,0 +1,99 @@ +package cn.iocoder.yudao.module.system.controller.admin.wx; + +import org.springframework.web.bind.annotation.*; + +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + + +import java.util.*; +import java.io.IOException; + +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; + +import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; +import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*; + +import cn.iocoder.yudao.module.system.controller.admin.wx.vo.*; +import cn.iocoder.yudao.module.system.dal.dataobject.wx.WxDO; +import cn.iocoder.yudao.module.system.service.wx.WxService; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; + +@Tag(name = "管理后台 - 微信通知管理") +@RestController +@RequestMapping("/system/wx") +@Validated +public class WxController { + + @Resource + private WxService wxService; + + @PostMapping("/create") + @Operation(summary = "创建微信通知管理") + @PreAuthorize("@ss.hasPermission('system:wx:create')") + public CommonResult createWx(@Valid @RequestBody WxSaveReqVO createReqVO) { + UUID guid = UUID.randomUUID(); + createReqVO.setId(guid.toString()); + return success(wxService.createWx(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新微信通知管理") + @PreAuthorize("@ss.hasPermission('system:wx:update')") + public CommonResult updateWx(@Valid @RequestBody WxSaveReqVO updateReqVO) { + wxService.updateWx(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除微信通知管理") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('system:wx:delete')") + public CommonResult deleteWx(@RequestParam("id") String id) { + wxService.deleteWx(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得微信通知管理") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('system:wx:query')") + public CommonResult getWx(@RequestParam("id") String id) { + WxDO wx = wxService.getWx(id); + return success(BeanUtils.toBean(wx, WxRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得微信通知管理分页") + @PreAuthorize("@ss.hasPermission('system:wx:query')") + public CommonResult> getWxPage(@Valid WxPageReqVO pageReqVO) { + PageResult pageResult = wxService.getWxPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, WxRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出微信通知管理 Excel") + @PreAuthorize("@ss.hasPermission('system:wx:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportWxExcel(@Valid WxPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = wxService.getWxPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "微信通知管理.xls", "数据", WxRespVO.class, + BeanUtils.toBean(list, WxRespVO.class)); + } + +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/wx/vo/WxPageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/wx/vo/WxPageReqVO.java new file mode 100644 index 000000000..c4c11cd16 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/wx/vo/WxPageReqVO.java @@ -0,0 +1,27 @@ +package cn.iocoder.yudao.module.system.controller.admin.wx.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 微信通知管理分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class WxPageReqVO extends PageParam { + + @Schema(description = "个人微信号的userid,唯一值,通过公众号发固定格式命令获取", example = "27699") + private String wxUserid; + + @Schema(description = "电话号码,通过公众号发固定格式命令获取") + private String bindTel; + + @Schema(description = "微信号所属人的姓名,通过公众号发固定格式命令获取", example = "王五") + private String personName; + +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/wx/vo/WxRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/wx/vo/WxRespVO.java new file mode 100644 index 000000000..6724b06d0 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/wx/vo/WxRespVO.java @@ -0,0 +1,44 @@ +package cn.iocoder.yudao.module.system.controller.admin.wx.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 微信通知管理 Response VO") +@Data +@ExcelIgnoreUnannotated +public class WxRespVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "11081") + @ExcelProperty("主键") + private String id; + + @Schema(description = "个人微信号的userid,唯一值,通过公众号发固定格式命令获取", example = "27699") + @ExcelProperty("个人微信号的userid,唯一值,通过公众号发固定格式命令获取") + private String wxUserid; + + @Schema(description = "电话号码,通过公众号发固定格式命令获取") + @ExcelProperty("电话号码,通过公众号发固定格式命令获取") + private String bindTel; + + @Schema(description = "微信号所属人的姓名,通过公众号发固定格式命令获取", example = "王五") + @ExcelProperty("微信号所属人的姓名,通过公众号发固定格式命令获取") + private String personName; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createDate; + + @Schema(description = "备注", example = "你猜") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "机构ID", example = "4736") + @ExcelProperty("机构ID") + private String orgId; + +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/wx/vo/WxSaveReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/wx/vo/WxSaveReqVO.java new file mode 100644 index 000000000..8bc24c01c --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/wx/vo/WxSaveReqVO.java @@ -0,0 +1,35 @@ +package cn.iocoder.yudao.module.system.controller.admin.wx.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; + +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 微信通知管理新增/修改 Request VO") +@Data +public class WxSaveReqVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "11081") + private String id; + + @Schema(description = "个人微信号的userid,唯一值,通过公众号发固定格式命令获取", example = "27699") + private String wxUserid; + + @Schema(description = "电话号码,通过公众号发固定格式命令获取") + private String bindTel; + + @Schema(description = "微信号所属人的姓名,通过公众号发固定格式命令获取", example = "王五") + private String personName; + + @Schema(description = "创建时间") + private LocalDateTime createDate; + + @Schema(description = "备注", example = "你猜") + private String remark; + + @Schema(description = "机构ID", example = "4736") + private String orgId; + +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/org/OrgUnitDO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/org/OrgUnitDO.java new file mode 100644 index 000000000..a3a1a7ec4 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/org/OrgUnitDO.java @@ -0,0 +1,83 @@ +package cn.iocoder.yudao.module.system.dal.dataobject.org; + +import lombok.*; + +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; + +/** + * 机构管理 DO + * + * @author 李晓东 + */ +@TableName("tb_org") +@KeySequence("tb_org_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class OrgUnitDO { + + /** + * 机构ID + */ + @TableId(value ="orgID",type = IdType.INPUT) + private String orgID; + /** + * 机构名称 + */ + @TableField("orgName") + private String orgName; + /** + * 机构地址 + */ + @TableField("address") + private String address; + /** + * 联系电话 + */ + @TableField("contactTel") + private String contactTel; + /** + * 联系人姓名 + */ + @TableField("contactPerson") + private String contactPerson; + /** + * 报告上显示的名称:一般跟机构名称一致 + */ + @TableField("reportName") + private String reportName; + /** + * 上级判读医院机构ID + */ + @TableField("highLevelOrgID") + private String highLevelOrgID; + /** + * 能收到微信消息提醒的微信列表,格式为:wxopenid1,wxopenid2,wxopenid3 + */ + @TableField("wx_openIdList") + private String wxOpenidlist; + /** + * 机构编号:通常为一个4位数的短号 用于与其他系统的对接之用 + */ + @TableField("orgSN") + private String orgSN; + /** + * 创建时间:年月日时分秒 + */ + @TableField("createDate") + private LocalDateTime createDate; + /** + * 上级机构的机构名称 + */ + @TableField("highLevelOrgName") + private String highLevelOrgName; + /** + * 机构logo的URL + */ + @TableField("orgLogoUrl") + private String orgLogoUrl; + +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/wx/WxDO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/wx/WxDO.java new file mode 100644 index 000000000..8c1e67157 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/wx/WxDO.java @@ -0,0 +1,59 @@ +package cn.iocoder.yudao.module.system.dal.dataobject.wx; + +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; + +/** + * 微信通知管理 DO + * + * @author 李晓东 + */ +@TableName("tb_wx") +@KeySequence("tb_wx_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class WxDO { + + /** + * 主键 + */ + @TableId(type = IdType.INPUT) + private String id; + /** + * 个人微信号的userid,唯一值,通过公众号发固定格式命令获取 + */ + @TableField("wx_Userid") + private String wxUserid; + /** + * 电话号码,通过公众号发固定格式命令获取 + */ + @TableField("bindTel") + private String bindTel; + /** + * 微信号所属人的姓名,通过公众号发固定格式命令获取 + */ + @TableField("personName") + private String personName; + /** + * 创建时间 + */ + @TableField("createDate") + private LocalDateTime createDate; + /** + * 备注 + */ + @TableField("remark") + private String remark; + /** + * 机构ID + */ + @TableField("orgId") + private String orgId; + +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/org/OrgUnitMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/org/OrgUnitMapper.java new file mode 100644 index 000000000..053337052 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/org/OrgUnitMapper.java @@ -0,0 +1,38 @@ +package cn.iocoder.yudao.module.system.dal.mysql.org; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.module.system.dal.dataobject.org.OrgUnitDO; +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; +import org.apache.ibatis.annotations.Mapper; +import cn.iocoder.yudao.module.system.controller.admin.org.vo.*; +import org.apache.ibatis.annotations.Param; + +/** + * 机构管理 Mapper + * + * @author 李晓东 + */ +@InterceptorIgnore(tenantLine = "true") +@Mapper +public interface OrgUnitMapper extends BaseMapperX { + + default PageResult selectPage(OrgUnitPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .likeIfPresent(OrgUnitDO::getOrgName, reqVO.getOrgName()) + .eqIfPresent(OrgUnitDO::getAddress, reqVO.getAddress()) + .eqIfPresent(OrgUnitDO::getContactTel, reqVO.getContactTel()) + .eqIfPresent(OrgUnitDO::getContactPerson, reqVO.getContactPerson()) + .likeIfPresent(OrgUnitDO::getReportName, reqVO.getReportName()) + .eqIfPresent(OrgUnitDO::getHighLevelOrgID, reqVO.getHighLevelOrgID()) + .eqIfPresent(OrgUnitDO::getWxOpenidlist, reqVO.getWxOpenidlist()) + .eqIfPresent(OrgUnitDO::getOrgSN, reqVO.getOrgSN()) + .betweenIfPresent(OrgUnitDO::getCreateDate, reqVO.getCreateDate()) + .likeIfPresent(OrgUnitDO::getHighLevelOrgName, reqVO.getHighLevelOrgName()) + .eqIfPresent(OrgUnitDO::getOrgLogoUrl, reqVO.getOrgLogoUrl()) + .orderByDesc(OrgUnitDO::getOrgID)); + } + //查询当前ID 是否存在 + int getOrgUnitIDExist(@Param("orgID") String orgID); +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/wx/WxMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/wx/WxMapper.java new file mode 100644 index 000000000..f38e63e1b --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/wx/WxMapper.java @@ -0,0 +1,30 @@ +package cn.iocoder.yudao.module.system.dal.mysql.wx; + +import java.util.*; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.module.system.dal.dataobject.wx.WxDO; +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; +import org.apache.ibatis.annotations.Mapper; +import cn.iocoder.yudao.module.system.controller.admin.wx.vo.*; + +/** + * 微信通知管理 Mapper + * + * @author 李晓东 + */ +@InterceptorIgnore(tenantLine = "true") +@Mapper +public interface WxMapper extends BaseMapperX { + + default PageResult selectPage(WxPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .likeIfPresent(WxDO::getWxUserid, reqVO.getWxUserid()) + .likeIfPresent(WxDO::getBindTel, reqVO.getBindTel()) + .likeIfPresent(WxDO::getPersonName, reqVO.getPersonName()) + .orderByDesc(WxDO::getId)); + } + +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/org/OrgUnitService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/org/OrgUnitService.java new file mode 100644 index 000000000..6555f190f --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/org/OrgUnitService.java @@ -0,0 +1,56 @@ +package cn.iocoder.yudao.module.system.service.org; + +import cn.iocoder.yudao.module.system.controller.admin.org.vo.*; +import cn.iocoder.yudao.module.system.dal.dataobject.org.OrgUnitDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import org.apache.ibatis.annotations.Param; + +import javax.validation.Valid; + +/** + * 机构管理 Service 接口 + * + * @author 李晓东 + */ +public interface OrgUnitService { + + /** + * 创建机构管理 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + String create(@Valid OrgUnitSaveReqVO createReqVO); + + /** + * 更新机构管理 + * + * @param updateReqVO 更新信息 + */ + void update(@Valid OrgUnitSaveReqVO updateReqVO); + + /** + * 删除机构管理 + * + * @param id 编号 + */ + void delete(String id); + + /** + * 获得机构管理 + * + * @param id 编号 + * @return 机构管理 + */ + OrgUnitDO get(String id); + + /** + * 获得机构管理分页 + * + * @param pageReqVO 分页查询 + * @return 机构管理分页 + */ + PageResult getPage(OrgUnitPageReqVO pageReqVO); + + boolean getOrgUnitIDISExist(String orgID); +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/org/OrgUnitServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/org/OrgUnitServiceImpl.java new file mode 100644 index 000000000..a68a74eae --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/org/OrgUnitServiceImpl.java @@ -0,0 +1,81 @@ +package cn.iocoder.yudao.module.system.service.org; + +import cn.iocoder.yudao.framework.common.exception.ErrorCode; +import org.springframework.stereotype.Service; + +import org.springframework.validation.annotation.Validated; + +import cn.iocoder.yudao.module.system.controller.admin.org.vo.*; +import cn.iocoder.yudao.module.system.dal.dataobject.org.OrgUnitDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; + +import cn.iocoder.yudao.module.system.dal.mysql.org.OrgUnitMapper; + +import javax.annotation.Resource; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; + +/** + * 机构管理 Service 实现类 + * + * @author 李晓东 + */ +@Service +@Validated +public class OrgUnitServiceImpl implements OrgUnitService { + + @Resource + private OrgUnitMapper Mapper; + + @Override + public String create(OrgUnitSaveReqVO createReqVO) { + // 插入 + OrgUnitDO aDo = BeanUtils.toBean(createReqVO, OrgUnitDO.class); + Mapper.insert(aDo); + // 返回 + return aDo.getOrgID(); + } + + @Override + public void update(OrgUnitSaveReqVO updateReqVO) { + // 校验存在 + validateExists(updateReqVO.getOrgID()); + // 更新 + OrgUnitDO updateObj = BeanUtils.toBean(updateReqVO, OrgUnitDO.class); + Mapper.updateById(updateObj); + } + + @Override + public void delete(String id) { + // 校验存在 + validateExists(id); + // 删除 + Mapper.deleteById(id); + } + + private void validateExists(String id) { + if (Mapper.selectById(id) == null) { + throw exception(new ErrorCode(1,"没有机构ID")); + } + } + + @Override + public OrgUnitDO get(String id) { + return Mapper.selectById(id); + } + + @Override + public PageResult getPage(OrgUnitPageReqVO pageReqVO) { + return Mapper.selectPage(pageReqVO); + } + + @Override + public boolean getOrgUnitIDISExist(String orgID) { + boolean bol=false; + int count= Mapper.getOrgUnitIDExist(orgID); + bol= count > 0; + return bol; + } + +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/wx/WxService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/wx/WxService.java new file mode 100644 index 000000000..c3c5f0a64 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/wx/WxService.java @@ -0,0 +1,56 @@ +package cn.iocoder.yudao.module.system.service.wx; + +import java.util.*; +import cn.iocoder.yudao.module.system.controller.admin.wx.vo.*; +import cn.iocoder.yudao.module.system.dal.dataobject.wx.WxDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.pojo.PageParam; + +import javax.validation.Valid; + +/** + * 微信通知管理 Service 接口 + * + * @author 李晓东 + */ +public interface WxService { + + /** + * 创建微信通知管理 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + String createWx(@Valid WxSaveReqVO createReqVO); + + /** + * 更新微信通知管理 + * + * @param updateReqVO 更新信息 + */ + void updateWx(@Valid WxSaveReqVO updateReqVO); + + /** + * 删除微信通知管理 + * + * @param id 编号 + */ + void deleteWx(String id); + + /** + * 获得微信通知管理 + * + * @param id 编号 + * @return 微信通知管理 + */ + WxDO getWx(String id); + + /** + * 获得微信通知管理分页 + * + * @param pageReqVO 分页查询 + * @return 微信通知管理分页 + */ + PageResult getWxPage(WxPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/wx/WxServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/wx/WxServiceImpl.java new file mode 100644 index 000000000..ec34e2ec0 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/wx/WxServiceImpl.java @@ -0,0 +1,76 @@ +package cn.iocoder.yudao.module.system.service.wx; + +import cn.iocoder.yudao.framework.common.exception.ErrorCode; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import cn.iocoder.yudao.module.system.controller.admin.wx.vo.*; +import cn.iocoder.yudao.module.system.dal.dataobject.wx.WxDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; + +import cn.iocoder.yudao.module.system.dal.mysql.wx.WxMapper; + +import javax.annotation.Resource; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; + +/** + * 微信通知管理 Service 实现类 + * + * @author 李晓东 + */ +@Service +@Validated +public class WxServiceImpl implements WxService { + + @Resource + private WxMapper wxMapper; + + @Override + public String createWx(WxSaveReqVO createReqVO) { + // 插入 + WxDO wx = BeanUtils.toBean(createReqVO, WxDO.class); + wxMapper.insert(wx); + // 返回 + return wx.getId(); + } + + @Override + public void updateWx(WxSaveReqVO updateReqVO) { + // 校验存在 + validateWxExists(updateReqVO.getId()); + // 更新 + WxDO updateObj = BeanUtils.toBean(updateReqVO, WxDO.class); + wxMapper.updateById(updateObj); + } + + @Override + public void deleteWx(String id) { + // 校验存在 + validateWxExists(id); + // 删除 + wxMapper.deleteById(id); + } + + private void validateWxExists(String id) { + if (wxMapper.selectById(id) == null) { + throw exception(new ErrorCode(1,"ID不存在")); + } + } + + @Override + public WxDO getWx(String id) { + return wxMapper.selectById(id); + } + + @Override + public PageResult getWxPage(WxPageReqVO pageReqVO) { + return wxMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/org/OrgUnitMapper.xml b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/org/OrgUnitMapper.xml new file mode 100644 index 000000000..d16701626 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/org/OrgUnitMapper.xml @@ -0,0 +1,15 @@ + + + + + + + + \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/wx/WxMapper.xml b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/wx/WxMapper.xml new file mode 100644 index 000000000..66307a841 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/wx/WxMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file