新增微信设置模块 和完善机构相关功能
Some checks are pending
Java CI with Maven / build (11) (push) Waiting to run
Java CI with Maven / build (17) (push) Waiting to run
Java CI with Maven / build (8) (push) Waiting to run
yudao-ui-admin CI / build (14.x) (push) Waiting to run
yudao-ui-admin CI / build (16.x) (push) Waiting to run

This commit is contained in:
lxd 2024-07-26 12:47:45 +08:00
parent c226139fd4
commit ac7d9dc198
18 changed files with 986 additions and 0 deletions

View File

@ -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<String> 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<Boolean> 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<Boolean> 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<OrgUnitRespVO> 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<PageResult<OrgUnitRespVO>> getPage(@Valid OrgUnitPageReqVO pageReqVO) {
PageResult<OrgUnitDO> 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<OrgUnitDO> list = Service.getPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "机构管理.xls", "数据", OrgUnitRespVO.class,
BeanUtils.toBean(list, OrgUnitRespVO.class));
}
}

View File

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

View File

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

View File

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

View File

@ -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<String> 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<Boolean> 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<Boolean> 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<WxRespVO> 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<PageResult<WxRespVO>> getWxPage(@Valid WxPageReqVO pageReqVO) {
PageResult<WxDO> 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<WxDO> list = wxService.getWxPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "微信通知管理.xls", "数据", WxRespVO.class,
BeanUtils.toBean(list, WxRespVO.class));
}
}

View File

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

View File

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

View File

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

View File

@ -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") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 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;
}

View File

@ -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") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 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;
}

View File

@ -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<OrgUnitDO> {
default PageResult<OrgUnitDO> selectPage(OrgUnitPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<OrgUnitDO>()
.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);
}

View File

@ -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<WxDO> {
default PageResult<WxDO> selectPage(WxPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<WxDO>()
.likeIfPresent(WxDO::getWxUserid, reqVO.getWxUserid())
.likeIfPresent(WxDO::getBindTel, reqVO.getBindTel())
.likeIfPresent(WxDO::getPersonName, reqVO.getPersonName())
.orderByDesc(WxDO::getId));
}
}

View File

@ -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<OrgUnitDO> getPage(OrgUnitPageReqVO pageReqVO);
boolean getOrgUnitIDISExist(String orgID);
}

View File

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

View File

@ -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<WxDO> getWxPage(WxPageReqVO pageReqVO);
}

View File

@ -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<WxDO> getWxPage(WxPageReqVO pageReqVO) {
return wxMapper.selectPage(pageReqVO);
}
}

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.system.dal.mysql.org.OrgUnitMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
<select id="getOrgUnitIDExist" resultType="java.lang.Integer">
select count(*) from tb_org where orgID=#{orgID}
</select>
</mapper>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.system.dal.mysql.wx.WxMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>