Commit 5bb529e6 authored by zengxiaoli@yeah.net's avatar zengxiaoli@yeah.net

护理人员录入前校验数据唯一性

parent 8eae8ca3
......@@ -260,15 +260,15 @@ public class SrvOrganController {
|| null == srvOrganEmpVo.getEduId()) {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
srvOrganEmpService.saveOrUpdateSrvOrganEmp(srvOrganEmpVo);
return Result.success();
int result= srvOrganEmpService.saveOrUpdateSrvOrganEmp(srvOrganEmpVo);
return result>0?Result.failed("该护理人员已存在于系统,请勿重复录入"):Result.success();
}
/**
* 护理人员导出
*
* @param organId 适用机构id
*
* @param isInvolveChild 是否包含子机构
* @param empName 人员姓名
* @param srvOrganName 护理机构名称
......
......@@ -64,7 +64,7 @@ public interface SrvOrganEmpService {
* eduId: "", // 文化水平
* fileDataList: [], // 对应数据库中的文件数据列表
*/
void saveOrUpdateSrvOrganEmp(SrvOrganEmpVo srvOrganEmpVo);
int saveOrUpdateSrvOrganEmp(SrvOrganEmpVo srvOrganEmpVo);
Workbook srvOrganExport(Long organId,Long srvOrganId, Boolean isInvolveChild, String empName, String srvOrganName, String certifNum,
Short isLock, Short empType);
......
......@@ -3,6 +3,7 @@ package com.hungraim.ltc.service.impl;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.api.AttachFeignService;
......@@ -103,11 +104,19 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService {
@Transactional(rollbackFor = Exception.class)
@Override
public void saveOrUpdateSrvOrganEmp(SrvOrganEmpVo srvOrganEmpVo) {
public int saveOrUpdateSrvOrganEmp(SrvOrganEmpVo srvOrganEmpVo) {
Long empId = srvOrganEmpVo.getEmpId();
ChSrvOrganEmp chSrvOrganEmp = new ChSrvOrganEmp();
BeanUtils.copyProperties(srvOrganEmpVo, chSrvOrganEmp);
int queryResult = 0;
if (null == empId) {
QueryWrapper<ChSrvOrganEmp> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("CERTIF_NUM", chSrvOrganEmp.getCertifNum());
queryWrapper.eq("IS_LOCK",0);
queryResult = chSrvOrganEmpMapper.selectCount(queryWrapper);
if(queryResult>0){
return queryResult;
}
// 新增
chSrvOrganEmp.setEffTime(new Date());
chSrvOrganEmp.setIsLock((short) 0);
......@@ -120,12 +129,12 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService {
chSrvempRiskLevel.setStatus(0);
chSrvempRiskLevel.setFcd(new Date());
chSrvempRiskLevelMapper.insert(chSrvempRiskLevel);
} else {
// 修改
chSrvOrganEmpMapper.updateById(chSrvOrganEmp);
updateAttachs(srvOrganEmpVo, empId);
}
return queryResult;
}
// 抽取方法
......
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