Commit 6b5c8c19 authored by zhangch's avatar zhangch

护理人员详情页面相关接口以及调试

parent 6ab0c3b0
package com.hungraim.ltc.controller; package com.hungraim.ltc.controller;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.pojo.entity.SysConfig.ChCfgSrvOrganType; import com.hungraim.ltc.pojo.entity.SysConfig.ChCfgSrvOrganType;
import com.hungraim.ltc.pojo.entity.SysConfig.ChFndSrvOrganLevel; import com.hungraim.ltc.pojo.entity.SysConfig.ChFndSrvOrganLevel;
import com.hungraim.ltc.pojo.entity.disable.ChCfgSrvEmpCate;
import com.hungraim.ltc.pojo.entity.disable.ChCfgSrvEmpType; import com.hungraim.ltc.pojo.entity.disable.ChCfgSrvEmpType;
import com.hungraim.ltc.pojo.vo.disable.SrvOrganEmpListVo; import com.hungraim.ltc.pojo.vo.disable.SrvOrganEmpListVo;
import com.hungraim.ltc.pojo.vo.disable.SrvOrganEmpVo;
import com.hungraim.ltc.pojo.vo.disable.SrvOrganListVo; import com.hungraim.ltc.pojo.vo.disable.SrvOrganListVo;
import com.hungraim.ltc.pojo.vo.system.SrvOrganVo; import com.hungraim.ltc.pojo.vo.system.SrvOrganVo;
import com.hungraim.ltc.service.SrvEmpCateService;
import com.hungraim.ltc.service.SrvEmpTypeService; import com.hungraim.ltc.service.SrvEmpTypeService;
import com.hungraim.ltc.service.SrvOrganEmpService; import com.hungraim.ltc.service.SrvOrganEmpService;
import com.hungraim.ltc.service.SrvOrganService; import com.hungraim.ltc.service.SrvOrganService;
...@@ -29,6 +33,8 @@ public class SrvOrganController { ...@@ -29,6 +33,8 @@ public class SrvOrganController {
private final SrvOrganEmpService srvOrganEmpService; private final SrvOrganEmpService srvOrganEmpService;
private final SrvEmpCateService srvEmpCateService;
/** /**
* 分页查询护理机构列表 * 分页查询护理机构列表
* *
...@@ -156,11 +162,12 @@ public class SrvOrganController { ...@@ -156,11 +162,12 @@ public class SrvOrganController {
/** /**
* 获取护理人员的资质列表 * 获取护理人员的资质列表
* *
* @param empCateId 护理人员类别id
* @return 返回列表 * @return 返回列表
*/ */
@GetMapping("/srvEmpTypeList") @GetMapping("/srvEmpTypeList")
public Result<List<ChCfgSrvEmpType>> getSrvEmpTypeList() { public Result<List<ChCfgSrvEmpType>> getSrvEmpTypeList(Integer empCateId) {
List<ChCfgSrvEmpType> chCfgSrvEmpTypes = srvEmpTypeService.list(); List<ChCfgSrvEmpType> chCfgSrvEmpTypes = srvEmpTypeService.list(new LambdaQueryWrapper<ChCfgSrvEmpType>().eq(null != empCateId, ChCfgSrvEmpType::getEmpCateId, empCateId));
return Result.success(chCfgSrvEmpTypes); return Result.success(chCfgSrvEmpTypes);
} }
...@@ -181,5 +188,56 @@ public class SrvOrganController { ...@@ -181,5 +188,56 @@ public class SrvOrganController {
return Result.success(); return Result.success();
} }
/**
* 获取护理人员类别信息
*
* @return 返回护理人员类别列表
*/
@GetMapping("/srvEmpCateList")
public Result<List<ChCfgSrvEmpCate>> getSrvEmpCateList() {
return Result.success(srvEmpCateService.list());
}
/**
* 获取护理人员相关信息
*
* @param empId 护理人员id
* @return 返回护理人员信息
*/
@GetMapping("/srvOrganEmp")
public Result<SrvOrganEmpVo> getSrvOrganEmp(Long empId) {
SrvOrganEmpVo srvOrganEmpVo = srvOrganEmpService.getSrvOrganEmp(empId);
return Result.success(srvOrganEmpVo);
}
/**
* 保存或修改护理人员对象
*
* @param srvOrganEmpVo 护理人员对象参数
* empId:"", // 护理人员id
* organId: "", // 适用机构id
* srvOrganId: "", // 护理机构id
* unifiedSocialCreditCode: "", // 统一社会信用代码
* empName: "", // 护理人员姓名
* certifType: "", // 护理人员证件类型
* certifNum: "", // 护理人员证件号码
* gender: "", // 护理人员性别
* age: "", // 护理人员年龄
* mobilePhone: "", // 护理人员手机号
* empTypeId: "", // 护理人员资质
* srvCateId: "", // 护理人员类别
* empType: '', // 人员类型
* eduId: "", // 文化水平
* fileDataList: [], // 对应数据库中的文件数据列表
* @return 返回操作结果
*/
@PostMapping("/srvOrganEmp")
public Result saveOrUpdateSrvOrganEmp(SrvOrganEmpVo srvOrganEmpVo) {
if (null == srvOrganEmpVo.getOrganId() || null == srvOrganEmpVo.getSrvOrganId() || StrUtil.isBlank(srvOrganEmpVo.getEmpName()) || StrUtil.isBlank(srvOrganEmpVo.getCertifType()) || StrUtil.isBlank(srvOrganEmpVo.getCertifNum()) || StrUtil.isBlank(srvOrganEmpVo.getGender()) || null == srvOrganEmpVo.getAge() || StrUtil.isBlank(srvOrganEmpVo.getMobilePhone()) || null == srvOrganEmpVo.getEmpTypeId() || null == srvOrganEmpVo.getEmpType() || null == srvOrganEmpVo.getEduId()) {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
srvOrganEmpService.saveOrUpdateSrvOrganEmp(srvOrganEmpVo);
return Result.success();
}
} }
package com.hungraim.ltc.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hungraim.ltc.pojo.entity.disable.ChCfgSrvEmpCate;
import org.apache.ibatis.annotations.Mapper;
/**
* @Entity com.hungraim.ltc.dao.ChCfgSrvEmpCate
*/
@Mapper
public interface ChCfgSrvEmpCateMapper extends BaseMapper<ChCfgSrvEmpCate> {
}
...@@ -26,4 +26,7 @@ public interface ChSrvOrganEmpMapper extends BaseMapper<ChSrvOrganEmp> { ...@@ -26,4 +26,7 @@ public interface ChSrvOrganEmpMapper extends BaseMapper<ChSrvOrganEmp> {
* @return 返回列表 * @return 返回列表
*/ */
Page<SrvOrganEmpListVo> getSrvOrganEmpListVo(Page<SrvOrganEmpListVo> page, List<Long> organIds, String empName, String srvOrganName, String certifNum, Short isLock, Short empType); Page<SrvOrganEmpListVo> getSrvOrganEmpListVo(Page<SrvOrganEmpListVo> page, List<Long> organIds, String empName, String srvOrganName, String certifNum, Short isLock, Short empType);
} }
\ No newline at end of file
package com.hungraim.ltc.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hungraim.ltc.pojo.entity.disable.ChCfgSrvEmpCate;
public interface SrvEmpCateService extends IService<ChCfgSrvEmpCate> {
}
...@@ -2,6 +2,7 @@ package com.hungraim.ltc.service; ...@@ -2,6 +2,7 @@ package com.hungraim.ltc.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.pojo.vo.disable.SrvOrganEmpListVo; import com.hungraim.ltc.pojo.vo.disable.SrvOrganEmpListVo;
import com.hungraim.ltc.pojo.vo.disable.SrvOrganEmpVo;
public interface SrvOrganEmpService { public interface SrvOrganEmpService {
...@@ -28,4 +29,34 @@ public interface SrvOrganEmpService { ...@@ -28,4 +29,34 @@ public interface SrvOrganEmpService {
* @return 返回操作状态 * @return 返回操作状态
*/ */
void updateSrvEmpStatus(Long empId, Short isLock); void updateSrvEmpStatus(Long empId, Short isLock);
/**
* 获取护理人员相关信息
*
* @param empId 护理人员id
* @return 返回护理人员信息
*/
SrvOrganEmpVo getSrvOrganEmp(Long empId);
/**
* 保存或修改护理人员对象
*
* @param srvOrganEmpVo 护理人员对象参数
* empId:"", // 护理人员id
* organId: "", // 适用机构id
* srvOrganId: "", // 护理机构id
* unifiedSocialCreditCode: "", // 统一社会信用代码
* empName: "", // 护理人员姓名
* certifType: "", // 护理人员证件类型
* certifNum: "", // 护理人员证件号码
* gender: "", // 护理人员性别
* age: "", // 护理人员年龄
* mobilePhone: "", // 护理人员手机号
* empTypeId: "", // 护理人员资质
* srvCateId: "", // 护理人员类别
* empType: '', // 人员类型
* eduId: "", // 文化水平
* fileDataList: [], // 对应数据库中的文件数据列表
*/
void saveOrUpdateSrvOrganEmp(SrvOrganEmpVo srvOrganEmpVo);
} }
package com.hungraim.ltc.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hungraim.ltc.dao.ChCfgSrvEmpCateMapper;
import com.hungraim.ltc.pojo.entity.disable.ChCfgSrvEmpCate;
import com.hungraim.ltc.service.SrvEmpCateService;
import org.springframework.stereotype.Service;
@Service
public class SrvEmpCateServiceImpl extends ServiceImpl<ChCfgSrvEmpCateMapper, ChCfgSrvEmpCate> implements SrvEmpCateService {
}
package com.hungraim.ltc.service.impl; package com.hungraim.ltc.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.api.AttachFeignService;
import com.hungraim.ltc.dao.ChSrvOrganEmpMapper; import com.hungraim.ltc.dao.ChSrvOrganEmpMapper;
import com.hungraim.ltc.dao.SrvEmpTypeMapper;
import com.hungraim.ltc.dao.SrvOrganMapper;
import com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach;
import com.hungraim.ltc.pojo.entity.disable.ChCfgSrvEmpType;
import com.hungraim.ltc.pojo.entity.disable.ChSrvOrgan;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvOrganEmp; import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvOrganEmp;
import com.hungraim.ltc.pojo.vo.disable.SrvOrganEmpListVo; import com.hungraim.ltc.pojo.vo.disable.SrvOrganEmpListVo;
import com.hungraim.ltc.pojo.vo.disable.SrvOrganEmpVo;
import com.hungraim.ltc.pojo.vo.system.AttachUpdateVo;
import com.hungraim.ltc.pojo.vo.system.AttachVo;
import com.hungraim.ltc.service.OrganService; import com.hungraim.ltc.service.OrganService;
import com.hungraim.ltc.service.SrvOrganEmpService; import com.hungraim.ltc.service.SrvOrganEmpService;
import com.hungraim.ltc.util.AttachType;
import com.hungraim.ltc.util.Result;
import com.hungraim.ltc.util.ResultCode;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List; import java.util.List;
@Service @Service
@AllArgsConstructor @AllArgsConstructor
@Slf4j
public class SrvOrganEmpServiceImpl implements SrvOrganEmpService { public class SrvOrganEmpServiceImpl implements SrvOrganEmpService {
private final ChSrvOrganEmpMapper chSrvOrganEmpMapper; private final ChSrvOrganEmpMapper chSrvOrganEmpMapper;
private final OrganService organService; private final OrganService organService;
private final AttachFeignService attachFeignService;
private final SrvEmpTypeMapper srvEmpTypeMapper;
private final SrvOrganMapper srvOrganMapper;
@Override @Override
public Page<SrvOrganEmpListVo> getSrvOrganEmpListVo(Page<SrvOrganEmpListVo> page, Long organId, Boolean isInvolveChild, String empName, String srvOrganName, String certifNum, Short isLock, Short empType) { public Page<SrvOrganEmpListVo> getSrvOrganEmpListVo(Page<SrvOrganEmpListVo> page, Long organId, Boolean isInvolveChild, String empName, String srvOrganName, String certifNum, Short isLock, Short empType) {
List<Long> organIds = organService.getOrganIds(organId, isInvolveChild); List<Long> organIds = organService.getOrganIds(organId, isInvolveChild);
...@@ -32,4 +55,61 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService { ...@@ -32,4 +55,61 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService {
chSrvOrganEmp.setIsLock(isLock); chSrvOrganEmp.setIsLock(isLock);
chSrvOrganEmpMapper.updateById(chSrvOrganEmp); chSrvOrganEmpMapper.updateById(chSrvOrganEmp);
} }
@Override
public SrvOrganEmpVo getSrvOrganEmp(Long empId) {
SrvOrganEmpVo srvOrganEmpVo = new SrvOrganEmpVo();
ChSrvOrganEmp chSrvOrganEmp = chSrvOrganEmpMapper.selectById(empId);
Long empTypeId = chSrvOrganEmp.getEmpTypeId();
ChCfgSrvEmpType chCfgSrvEmpType = srvEmpTypeMapper.selectById(empTypeId);
Long srvOrganId = chSrvOrganEmp.getSrvOrganId();
ChSrvOrgan chSrvOrgan = srvOrganMapper.selectById(srvOrganId);
BeanUtils.copyProperties(chSrvOrganEmp, srvOrganEmpVo);
srvOrganEmpVo.setEmpCateId(chCfgSrvEmpType.getEmpCateId());
srvOrganEmpVo.setUnifiedSocialCreditCode(chSrvOrgan.getUnifiedSocialCreditCode());
try {
Result<List<AttachVo>> listResult = attachFeignService.selectAttachs(empId, AttachType.SRV_ORGAN_EMP.getUploadType());
if (ResultCode.SUCCESS.getCode().equals(listResult.getCode())) {
List<ChFndAttach> attaches = new ArrayList<>();
List<AttachVo> data = listResult.getData();
for (AttachVo datum : data) {
ChFndAttach attach = new ChFndAttach();
BeanUtils.copyProperties(datum, attach);
attaches.add(attach);
}
srvOrganEmpVo.setFileDataList(attaches);
} else {
log.error("请求获取护理人员上传文件出错,出错信息:{}", listResult.getMsg());
}
} catch (Exception e) {
log.error("请求获取护理人员上传文件出错,出错信息:{}", e.getMessage());
}
return srvOrganEmpVo;
}
@Transactional(rollbackFor = Exception.class)
@Override
public void saveOrUpdateSrvOrganEmp(SrvOrganEmpVo srvOrganEmpVo) {
Long empId = srvOrganEmpVo.getEmpId();
ChSrvOrganEmp chSrvOrganEmp = new ChSrvOrganEmp();
BeanUtils.copyProperties(srvOrganEmpVo, chSrvOrganEmp);
if (null == empId) {
// 新增
chSrvOrganEmpMapper.insert(chSrvOrganEmp);
updateAttachs(srvOrganEmpVo, chSrvOrganEmp.getEmpId());
} else {
// 修改
chSrvOrganEmpMapper.updateById(chSrvOrganEmp);
updateAttachs(srvOrganEmpVo, empId);
}
}
// 抽取方法
private void updateAttachs(SrvOrganEmpVo srvOrganEmpVo, Long empId) {
AttachUpdateVo attachUpdateVo = new AttachUpdateVo();
attachUpdateVo.setChFndAttachs(srvOrganEmpVo.getFileDataList());
attachUpdateVo.setCtrlId(empId);
attachUpdateVo.setAttachType(AttachType.SRV_ORGAN_EMP.getUploadType());
attachFeignService.updateAttachs(attachUpdateVo);
}
} }
package com.hungraim.ltc.pojo.entity.disable;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
*
* @TableName CH_CFG_SRV_EMP_CATE
*/
@TableName(value ="CH_CFG_SRV_EMP_CATE")
@Data
public class ChCfgSrvEmpCate implements Serializable {
/**
* 人员类别id
*/
@TableId
private Integer empCateId;
/**
* 人员类型名称
*/
private String cateName;
/**
* 备注
*/
private String remark;
/**
* 基础参数配置id
*/
private Integer paraId;
/**
* 首次操作时间
*/
private Date fcd;
/**
* 首次操作人
*/
private Integer fcu;
/**
* 人员资质ID
*/
private Integer qualificationsId;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
...@@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.annotation.IdType; ...@@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.KeySequence; import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
...@@ -71,6 +73,8 @@ public class ChSrvOrganEmp implements Serializable { ...@@ -71,6 +73,8 @@ public class ChSrvOrganEmp implements Serializable {
/** /**
* 创建时间 * 创建时间
*/ */
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date effTime; private Date effTime;
/** /**
...@@ -81,11 +85,15 @@ public class ChSrvOrganEmp implements Serializable { ...@@ -81,11 +85,15 @@ public class ChSrvOrganEmp implements Serializable {
/** /**
* 终止时间 * 终止时间
*/ */
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date endTime; private Date endTime;
/** /**
* 首次操作时间 * 首次操作时间
*/ */
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date fcd; private Date fcd;
/** /**
...@@ -96,6 +104,8 @@ public class ChSrvOrganEmp implements Serializable { ...@@ -96,6 +104,8 @@ public class ChSrvOrganEmp implements Serializable {
/** /**
* 末次操作时间 * 末次操作时间
*/ */
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date lcd; private Date lcd;
/** /**
......
package com.hungraim.ltc.pojo.vo.disable;
import com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvOrganEmp;
import lombok.Data;
import java.util.List;
@Data
public class SrvOrganEmpVo extends ChSrvOrganEmp {
private String unifiedSocialCreditCode;
private Integer empCateId;
/**
* 文件列表数据对象
*/
private List<ChFndAttach> fileDataList;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment