参与者重写 - 部分
This commit is contained in:
@@ -1,8 +1,18 @@
|
||||
package com.openhis.web.basedatamanage.appservice;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.doctorstation.dto.UserAndPractitionerDto;
|
||||
|
||||
/**
|
||||
* 参与者 应该服务类
|
||||
*/
|
||||
public interface IPractitionerAppService {
|
||||
|
||||
/**
|
||||
* 新增用户及参与者
|
||||
* @param userAndPractitionerDto 用户及参与者dto
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> saveUserPractitioner(UserAndPractitionerDto userAndPractitionerDto);
|
||||
|
||||
}
|
||||
|
||||
@@ -2,10 +2,18 @@ package com.openhis.web.basedatamanage.appservice.impl;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import com.openhis.administration.service.IBizUserRoleService;
|
||||
import com.openhis.administration.service.IBizUserService;
|
||||
import com.openhis.administration.service.IPractitionerRoleService;
|
||||
import com.openhis.administration.service.IPractitionerService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.web.basedatamanage.appservice.IPractitionerAppService;
|
||||
import com.openhis.web.basedatamanage.mapper.PractitionerAppAppMapper;
|
||||
import com.openhis.web.doctorstation.dto.UserAndPractitionerDto;
|
||||
|
||||
@Service
|
||||
public class PractitionerAppServiceImpl implements IPractitionerAppService {
|
||||
@@ -13,4 +21,38 @@ public class PractitionerAppServiceImpl implements IPractitionerAppService {
|
||||
@Resource
|
||||
PractitionerAppAppMapper practitionerAppAppMapper;
|
||||
|
||||
@Resource
|
||||
IBizUserService iBizUserService;
|
||||
|
||||
@Resource
|
||||
IBizUserRoleService iBizUserRoleService;
|
||||
|
||||
@Resource
|
||||
IPractitionerService iPractitionerService;
|
||||
|
||||
@Resource
|
||||
IPractitionerRoleService iPractitionerRoleService;
|
||||
|
||||
|
||||
/**
|
||||
* 新增用户及参与者
|
||||
*
|
||||
* @param userAndPractitionerDto 用户及参与者dto
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> saveUserPractitioner(UserAndPractitionerDto userAndPractitionerDto) {
|
||||
// 数据有效性校验 : 账号唯一性
|
||||
|
||||
// 新增 sys_user
|
||||
|
||||
// 新增 sys_user_role
|
||||
|
||||
// 新增 adm_practitioner
|
||||
|
||||
// 新增 adm_practitioner_role
|
||||
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"人员信息"}));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,10 +3,14 @@
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.basedatamanage.appservice.IPractitionerAppService;
|
||||
import com.openhis.web.doctorstation.dto.UserAndPractitionerDto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -22,4 +26,15 @@ public class PractitionerController {
|
||||
|
||||
private final IPractitionerAppService practitionerAppService;
|
||||
|
||||
/**
|
||||
* 新增用户及参与者
|
||||
*
|
||||
* @param userAndPractitionerDto 用户及参与者dto
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping(value = "/save-user-practitioner")
|
||||
public R<?> saveUserPractitioner(@RequestBody UserAndPractitionerDto userAndPractitionerDto) {
|
||||
return practitionerAppService.saveUserPractitioner(userAndPractitionerDto);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.openhis.web.doctorstation.dto;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 用户 及 参与者 dto
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class UserAndPractitionerDto {
|
||||
|
||||
/**
|
||||
* 账号
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String nickName;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 电话
|
||||
*/
|
||||
private String phonenumber;
|
||||
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
private String sex;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 出生日期
|
||||
*/
|
||||
private Date birthDate;
|
||||
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 医保码
|
||||
*/
|
||||
private String ybNo;
|
||||
|
||||
/**
|
||||
* 机构id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long orgId;
|
||||
|
||||
/**
|
||||
* 位置id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long locationId;
|
||||
|
||||
/**
|
||||
* 角色id集合
|
||||
*/
|
||||
private List<Long> roleIds;
|
||||
|
||||
/**
|
||||
* 角色code集合
|
||||
*/
|
||||
private List<String> roleCodes;
|
||||
|
||||
}
|
||||
@@ -1,16 +1,23 @@
|
||||
package com.openhis.common.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 性别 0=男,1=女,2=未知(和若依框架保持一致)
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum AdministrativeGender implements HisEnumInterface {
|
||||
MALE(1, "male", "男性"),
|
||||
FEMALE(2, "female", "女性"),
|
||||
OTHER(3, "other", "其他"),
|
||||
UNKNOWN(9, "unknown", "未知");
|
||||
|
||||
MALE(0, "male", "男性"),
|
||||
|
||||
FEMALE(1, "female", "女性"),
|
||||
|
||||
UNKNOWN(2, "unknown", "未知");
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
private final String code;
|
||||
|
||||
Reference in New Issue
Block a user