健康咨询-科室人员管理新增接口修改

This commit is contained in:
纪寒 2023-12-06 16:35:38 +08:00
parent 37bf823f0b
commit 877295bc2c

View File

@ -15,19 +15,10 @@ import com.xinelu.manage.dto.hospitalpersoninfo.HospitalPersonInfoDTO;
import com.xinelu.manage.dto.hospitalpersoninfo.HospitalPersonInfoDtoo;
import com.xinelu.manage.mapper.hospitalpersoncertificate.HospitalPersonCertificateMapper;
import com.xinelu.manage.mapper.hospitalpersoninfo.HospitalPersonInfoMapper;
import com.xinelu.manage.mapper.nursestationperson.NurseStationPersonMapper;
import com.xinelu.manage.service.hospitalpersoninfo.IHospitalPersonInfoService;
import com.xinelu.manage.vo.hospitalpersoninfo.HospitalPersonInfoVO;
import com.xinelu.system.mapper.SysUserMapper;
import java.io.File;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.compress.utils.Lists;
import org.apache.commons.lang3.BooleanUtils;
@ -35,6 +26,13 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.io.File;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
/**
* 健康咨询-科室人员信息Service业务层处理
*
@ -53,6 +51,8 @@ public class HospitalPersonInfoServiceImpl implements IHospitalPersonInfoService
private HospitalPersonCertificateMapper hospitalPersonCertificateMapper;
@Resource
private SysUserMapper userMapper;
@Resource
private NurseStationPersonMapper nurseStationPersonMapper;
/**
* 查询健康咨询-科室人员信息
@ -134,13 +134,14 @@ public class HospitalPersonInfoServiceImpl implements IHospitalPersonInfoService
throw new ServiceException("新增科室人员资质证书信息失败,请联系管理员!");
}
}
// 判断用户名是否重复
int count = userMapper.checkUserNameUnique(hospitalPersonInfo.getPersonAccount());
if (count > 0) {
throw new ServiceException("已存在用户名为" + hospitalPersonInfo.getPersonAccount() +"的用户,请重新输入用户名");
throw new ServiceException("已存在用户名为" + hospitalPersonInfo.getPersonAccount() + "的用户,请重新输入用户名");
}
// 保存到sys_user表
//保存到sys_user表,判断当前用户表中手机号是否存在,不存在再保存,存在不保存
int nurseStationUserCount = nurseStationPersonMapper.getNurseStationUserCount(hospitalPersonInfo.getPersonPhone());
if (nurseStationUserCount <= 0) {
SysUser sysUser = new SysUser();
sysUser.setUserName(hospitalPersonInfo.getPersonAccount());
sysUser.setPassword(SecurityUtils.encryptPassword(hospitalPersonInfo.getPersonPassword()));
@ -150,6 +151,7 @@ public class HospitalPersonInfoServiceImpl implements IHospitalPersonInfoService
sysUser.setStatus("0");
sysUser.setDelFlag("0");
userMapper.insertUser(sysUser);
}
return AjaxResult.success();
}
@ -186,7 +188,7 @@ public class HospitalPersonInfoServiceImpl implements IHospitalPersonInfoService
// 判断用户名是否重复
int count = userMapper.checkUserNameUnique(hospitalPersonInfo.getPersonAccount());
if (count > 0) {
throw new ServiceException("已存在用户名为" + hospitalPersonInfo.getPersonAccount() +"的用户,请重新输入用户名");
throw new ServiceException("已存在用户名为" + hospitalPersonInfo.getPersonAccount() + "的用户,请重新输入用户名");
}
SysUser newUser = new SysUser();
newUser.setUserName(hospitalPersonInfo.getPersonAccount());