参与者重写 - 初始化
This commit is contained in:
@@ -121,8 +121,18 @@
|
||||
<if test="roleKey != null and roleKey != ''">#{roleKey},</if>
|
||||
<if test="roleSort != null">#{roleSort},</if>
|
||||
<if test="dataScope != null and dataScope != ''">#{dataScope},</if>
|
||||
<if test="menuCheckStrictly != null">#{menuCheckStrictly},</if>
|
||||
<if test="deptCheckStrictly != null">#{deptCheckStrictly},</if>
|
||||
<if test="menuCheckStrictly != null">
|
||||
<choose>
|
||||
<when test="menuCheckStrictly == true">1,</when>
|
||||
<otherwise>0,</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
<if test="deptCheckStrictly != null">
|
||||
<choose>
|
||||
<when test="deptCheckStrictly == true">1,</when>
|
||||
<otherwise>0,</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
@@ -137,8 +147,18 @@
|
||||
<if test="roleKey != null and roleKey != ''">role_key = #{roleKey},</if>
|
||||
<if test="roleSort != null">role_sort = #{roleSort},</if>
|
||||
<if test="dataScope != null and dataScope != ''">data_scope = #{dataScope},</if>
|
||||
<if test="menuCheckStrictly != null">menu_check_strictly = #{menuCheckStrictly},</if>
|
||||
<if test="deptCheckStrictly != null">dept_check_strictly = #{deptCheckStrictly},</if>
|
||||
<if test="menuCheckStrictly != null">
|
||||
<choose>
|
||||
<when test="menuCheckStrictly == true">1,</when>
|
||||
<otherwise>0,</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
<if test="deptCheckStrictly != null">
|
||||
<choose>
|
||||
<when test="deptCheckStrictly == true">1,</when>
|
||||
<otherwise>0,</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
|
||||
@@ -1,47 +1,8 @@
|
||||
package com.openhis.web.basedatamanage.appservice;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.basedatamanage.dto.PractSearchParam;
|
||||
import com.openhis.web.basedatamanage.dto.PractitionerDto;
|
||||
|
||||
/**
|
||||
* Practitioner 应该服务类
|
||||
* 参与者 应该服务类
|
||||
*/
|
||||
public interface IPractitionerAppService {
|
||||
/**
|
||||
* 查询员工信息
|
||||
*
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
* @return 员工分页列表
|
||||
*/
|
||||
R<?> getPractitionerPage(PractSearchParam practSearchParam, String searchKey, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 员工信息详情
|
||||
*
|
||||
* @param practitionerId 员工信息id
|
||||
* @return 员工信息详情
|
||||
*/
|
||||
R<?> getPractitionerById(Long practitionerId);
|
||||
|
||||
/**
|
||||
* 添加/编辑员工信息
|
||||
*
|
||||
* @param practitionerDto 员工信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> addOrEditPractitioner(PractitionerDto practitionerDto);
|
||||
|
||||
/**
|
||||
* 员工信息
|
||||
*
|
||||
* @param practitionerId 员工信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> deletePractitioner(Long practitionerId);
|
||||
}
|
||||
|
||||
@@ -1,117 +1,16 @@
|
||||
package com.openhis.web.basedatamanage.appservice.impl;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.openhis.administration.domain.Practitioner;
|
||||
import com.openhis.administration.domain.PractitionerRole;
|
||||
import com.openhis.administration.mapper.PractitionerMapper;
|
||||
import com.openhis.administration.service.IPractitionerRoleService;
|
||||
import com.openhis.administration.service.IPractitionerService;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.utils.HisPageUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.web.basedatamanage.appservice.IPractitionerAppService;
|
||||
import com.openhis.web.basedatamanage.dto.PractSearchParam;
|
||||
import com.openhis.web.basedatamanage.dto.PractitionerDto;
|
||||
import com.openhis.web.basedatamanage.mapper.PractitionerAppAppMapper;
|
||||
|
||||
@Service
|
||||
public class PractitionerAppServiceImpl implements IPractitionerAppService {
|
||||
|
||||
@Autowired
|
||||
private IPractitionerService practitionerService;
|
||||
@Resource
|
||||
PractitionerAppAppMapper practitionerAppAppMapper;
|
||||
|
||||
@Autowired
|
||||
private PractitionerMapper practitionerMapper;
|
||||
|
||||
@Autowired
|
||||
private IPractitionerRoleService practitionerRoleService;
|
||||
|
||||
@Override
|
||||
public R<?> getPractitionerPage(PractSearchParam practSearchParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<Practitioner> queryWrapper = HisQueryUtils.buildQueryWrapper(practSearchParam, searchKey,
|
||||
new HashSet<>(Arrays.asList("name", "py_str", "wb_str")), request);
|
||||
|
||||
// 查询员工分页列表
|
||||
Page<PractitionerDto> practitionerDtoPage =
|
||||
HisPageUtils.selectPage(practitionerMapper, queryWrapper, pageNo, pageSize, PractitionerDto.class);
|
||||
|
||||
return R.ok(practitionerDtoPage,
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00009, new Object[] {"员工信息"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 员工信息详情
|
||||
*
|
||||
* @param practitionerId 员工信息id
|
||||
* @return 员工信息详情
|
||||
*/
|
||||
@Override
|
||||
public R<?> getPractitionerById(Long practitionerId) {
|
||||
Practitioner practitioner = practitionerService.getById(practitionerId);
|
||||
if (practitioner != null) {
|
||||
return R.ok(practitioner,
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00009, new Object[] {"员工信息"}));
|
||||
} else {
|
||||
return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"员工信息查询失败"}));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加/编辑员工信息
|
||||
*
|
||||
* @param practitionerDto 员工信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> addOrEditPractitioner(PractitionerDto practitionerDto) {
|
||||
|
||||
Practitioner practitioner = new Practitioner();
|
||||
BeanUtils.copyProperties(practitionerDto, practitioner);
|
||||
PractitionerRole practitionerRole = new PractitionerRole();
|
||||
|
||||
if (practitionerDto.getId() != null) {
|
||||
// 更新员工信息
|
||||
practitionerService.updateById(practitioner);
|
||||
} else {
|
||||
// 新增员工信息
|
||||
practitionerService.save(practitioner);
|
||||
|
||||
// 新增员工岗位信息
|
||||
practitionerRole.setPractitionerId(practitioner.getId());
|
||||
practitionerRole.setName(practitioner.getName());
|
||||
practitionerRoleService.save(practitionerRole);
|
||||
}
|
||||
// 返回员工id
|
||||
return R.ok(practitioner.getId(),
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"员工信息更新添加"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除员工
|
||||
*
|
||||
* @param practitionerId 员工信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> deletePractitioner(Long practitionerId) {
|
||||
// 删除员工信息
|
||||
boolean deletepractitioner = practitionerService.removeById(practitionerId);
|
||||
return deletepractitioner
|
||||
? R.ok(practitionerId, MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[] {"员工信息"}))
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"员工信息"}));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,25 +3,16 @@
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.controller;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.basedatamanage.appservice.IPractitionerAppService;
|
||||
import com.openhis.web.basedatamanage.dto.PractSearchParam;
|
||||
import com.openhis.web.basedatamanage.dto.PractitionerDto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 员工管理Controller业务层处理
|
||||
*
|
||||
* @author
|
||||
* @date 2025-02-21
|
||||
* 参与者 Controller业务层处理
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/base-data-manage/practitioner")
|
||||
@@ -29,54 +20,6 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@AllArgsConstructor
|
||||
public class PractitionerController {
|
||||
|
||||
@Autowired
|
||||
private IPractitionerAppService practitionerAppService;
|
||||
|
||||
/**
|
||||
* 员工分页列表
|
||||
*
|
||||
* @param practSearchParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
* @return 员工分页列表
|
||||
*/
|
||||
@GetMapping(value = "/practitioner")
|
||||
public R<?> getPractitionerPage(PractSearchParam practSearchParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
return practitionerAppService.getPractitionerPage(practSearchParam, searchKey, pageNo, pageSize, request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取员工需要编辑的信息
|
||||
*
|
||||
* @param practitionerId 员工信息
|
||||
*/
|
||||
@GetMapping("/practitioner-getById")
|
||||
public R<?> getPractitionerById(@Validated @RequestParam Long practitionerId) {
|
||||
return practitionerAppService.getPractitionerById(practitionerId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑员工信息
|
||||
*
|
||||
* @param practitionerDto 员工信息
|
||||
*/
|
||||
@PutMapping("/practitioner")
|
||||
public R<?> addOrEditPractitioner(@Validated @RequestBody PractitionerDto practitionerDto) {
|
||||
return practitionerAppService.addOrEditPractitioner(practitionerDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除员工信息
|
||||
*
|
||||
* @param practitionerId 主表id
|
||||
*/
|
||||
@DeleteMapping("/practitioner")
|
||||
public R<?> deletePractitioner(@RequestParam Long practitionerId) {
|
||||
return practitionerAppService.deletePractitioner(practitionerId);
|
||||
}
|
||||
private final IPractitionerAppService practitionerAppService;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.openhis.web.basedatamanage.mapper;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 参与者 应用Mapper
|
||||
*/
|
||||
@Repository
|
||||
public interface PractitionerAppAppMapper {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.openhis.web.basedatamanage.mapper.PractitionerAppAppMapper">
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -6,11 +6,12 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 参与者角色
|
||||
* 参与者角色 : 对应 sys_role表的角色标识 ; 需要补充业务数据时在该枚举类添加
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum PractitionerRole implements HisEnumInterface {
|
||||
|
||||
DOCTOR(1, "doctor", "医生"),
|
||||
|
||||
NURSE(2, "nurse", "护士"),
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.openhis.administration.domain;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 用户管理Entity实体
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_user")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class BizUser extends HisBaseEntity {
|
||||
|
||||
/** 用户ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long userId;
|
||||
|
||||
/** 部门ID */
|
||||
private Long deptId;
|
||||
|
||||
/** 用户账号 */
|
||||
private String userName;
|
||||
|
||||
/** 用户昵称 */
|
||||
private String nickName;
|
||||
|
||||
/** 用户类型 */
|
||||
private String userType;
|
||||
|
||||
/** 用户邮箱 */
|
||||
private String email;
|
||||
|
||||
/** 手机号码 */
|
||||
private String phonenumber;
|
||||
|
||||
/** 用户性别 */
|
||||
private String sex;
|
||||
|
||||
/** 用户头像 */
|
||||
private String avatar;
|
||||
|
||||
/** 密码 */
|
||||
private String password;
|
||||
|
||||
/** 帐号状态(0正常 1停用) */
|
||||
private String status;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
/** 最后登录IP */
|
||||
private String loginIp;
|
||||
|
||||
/** 最后登录时间 */
|
||||
private Date loginDate;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.openhis.administration.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 用户角色Entity实体
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_user_role")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class BizUserRole {
|
||||
|
||||
/** 用户ID */
|
||||
private Long userId;
|
||||
|
||||
/** 角色ID */
|
||||
private Long roleId;
|
||||
|
||||
}
|
||||
@@ -80,6 +80,9 @@ public class Practitioner extends HisBaseEntity {
|
||||
/** 医保码 */
|
||||
private String ybNo;
|
||||
|
||||
/** 机构id */
|
||||
private Long orgId;
|
||||
|
||||
/** 系统用户id */
|
||||
private Long userId;
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.openhis.administration.mapper;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.administration.domain.BizUser;
|
||||
|
||||
/**
|
||||
* 用户管理Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Repository
|
||||
public interface BizUserMapper extends BaseMapper<BizUser> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.openhis.administration.mapper;
|
||||
|
||||
import com.openhis.administration.domain.BizUserRole;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.administration.domain.BizUser;
|
||||
|
||||
/**
|
||||
* 用户角色Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Repository
|
||||
public interface BizUserRoleMapper extends BaseMapper<BizUserRole> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.openhis.administration.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.administration.domain.BizUserRole;
|
||||
|
||||
/**
|
||||
* 用户角色Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public interface IBizUserRoleService extends IService<BizUserRole> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.openhis.administration.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.administration.domain.BizUser;
|
||||
|
||||
/**
|
||||
* 用户管理Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public interface IBizUserService extends IService<BizUser> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.openhis.administration.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.administration.domain.BizUserRole;
|
||||
import com.openhis.administration.mapper.BizUserRoleMapper;
|
||||
import com.openhis.administration.service.IBizUserRoleService;
|
||||
|
||||
/**
|
||||
* 用户角色Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Service
|
||||
public class BizUserRoleServiceImpl extends ServiceImpl<BizUserRoleMapper, BizUserRole> implements IBizUserRoleService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.openhis.administration.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.administration.domain.BizUser;
|
||||
import com.openhis.administration.mapper.BizUserMapper;
|
||||
import com.openhis.administration.service.IBizUserService;
|
||||
|
||||
/**
|
||||
* 用户管理Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Service
|
||||
public class BizUserServiceImpl extends ServiceImpl<BizUserMapper, BizUser> implements IBizUserService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.openhis.administration.mapper.BizUserMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.openhis.administration.mapper.BizUserRoleMapper">
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user