提交 ee7cd6b9 编写于 作者: rushui.chen's avatar rushui.chen

20190925 客服系统添加医生接口完善

上级 ae0e3c92
流水线 #15130 已失败 于阶段
in 1 second
...@@ -70,12 +70,10 @@ public class DoctorController extends AccountBaseController { ...@@ -70,12 +70,10 @@ public class DoctorController extends AccountBaseController {
@ApiOperation("客服系统新增医生") @ApiOperation("客服系统新增医生")
@PostMapping(value = "/info", produces = "application/json;charset=utf-8") @PostMapping(value = "/info", produces = "application/json;charset=utf-8")
public PicaResponse addDoctorInfo(@RequestBody Doctor doctor) { public PicaResponse addDoctorInfo(@RequestBody Doctor doctor) {
AccountUser accountUser = super.getAccountUser();
Integer userId = accountUser.getId();
if (doctor != null && doctor.getMobilePhone() != null) { if (doctor != null && doctor.getMobilePhone() != null) {
AccountUtils.checkMobilePhone(doctor.getMobilePhone()); AccountUtils.checkMobilePhone(doctor.getMobilePhone());
AccountUtils.checkPassword(doctor.getPassword()); AccountUtils.checkPassword(doctor.getPassword());
doctorService.addDoctorInfo(doctor, userId); doctorService.addDoctorInfo(doctor);
return PicaResponse.toResponse(); return PicaResponse.toResponse();
} else { } else {
throw new AccountException(AccountExceptionEnum.PICA_PARAMS_ERROR); throw new AccountException(AccountExceptionEnum.PICA_PARAMS_ERROR);
......
...@@ -29,5 +29,5 @@ public interface DoctorService { ...@@ -29,5 +29,5 @@ public interface DoctorService {
* *
* @param doctor 新的医生数据 * @param doctor 新的医生数据
*/ */
void addDoctorInfo(Doctor doctor, Integer userId); void addDoctorInfo(Doctor doctor);
} }
...@@ -47,11 +47,10 @@ public class DoctorServiceImpl implements DoctorService { ...@@ -47,11 +47,10 @@ public class DoctorServiceImpl implements DoctorService {
* 4)账户基本信息的处理:姓名,性别,年龄,生日,身份证号; * 4)账户基本信息的处理:姓名,性别,年龄,生日,身份证号;
* *
* @param doctor 新的医生数据 * @param doctor 新的医生数据
* @param userId
*/ */
@Override @Override
@Transactional @Transactional
public void addDoctorInfo(Doctor doctor, Integer userId) { public void addDoctorInfo(Doctor doctor) {
String mobilePhone = doctor.getMobilePhone(); String mobilePhone = doctor.getMobilePhone();
String mobileEncrypt = AESUtil.encryptV0(mobilePhone); String mobileEncrypt = AESUtil.encryptV0(mobilePhone);
AccountInfoEntity accountInfoEntity = accountInfoDetailMapper.selectByMobile(mobileEncrypt); AccountInfoEntity accountInfoEntity = accountInfoDetailMapper.selectByMobile(mobileEncrypt);
...@@ -65,11 +64,11 @@ public class DoctorServiceImpl implements DoctorService { ...@@ -65,11 +64,11 @@ public class DoctorServiceImpl implements DoctorService {
entity.setPassword(password); entity.setPassword(password);
entity.setCreatedTime(currentTime); entity.setCreatedTime(currentTime);
entity.setModifiedTime(currentTime); entity.setModifiedTime(currentTime);
entity.setModifiedId(userId); entity.setModifiedId(0);
entity.setRegisterProduct(1); entity.setRegisterProduct(1);
entity.setRegTime(currentTime); entity.setRegTime(currentTime);
entity.setRegisterSource(3); entity.setRegisterSource(3);
entity.setCreatedId(userId); entity.setCreatedId(0);
entity.setDeleteFlag(1); entity.setDeleteFlag(1);
entity.setSex(doctor.getSex()); entity.setSex(doctor.getSex());
entity.setName(doctor.getName()); entity.setName(doctor.getName());
...@@ -79,8 +78,8 @@ public class DoctorServiceImpl implements DoctorService { ...@@ -79,8 +78,8 @@ public class DoctorServiceImpl implements DoctorService {
accountInfoDetailMapper.insertSelective(entity); accountInfoDetailMapper.insertSelective(entity);
doctor.setAcctId(entity.getId()); doctor.setAcctId(entity.getId());
doctor.setMobilePhone(mobileEncrypt); doctor.setMobilePhone(mobileEncrypt);
doctor.setModifyId(userId); doctor.setModifyId(0);
doctor.setCreatId(userId); doctor.setCreatId(0);
doctor.setCreatTime(currentTime); doctor.setCreatTime(currentTime);
doctor.setModifyTime(new Date()); doctor.setModifyTime(new Date());
doctor.setDeleteFlag(1); doctor.setDeleteFlag(1);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册