From 503dd09f0636860a95ec5170f92969892a877ffc Mon Sep 17 00:00:00 2001 From: "jiakun.lin" Date: Sun, 25 Apr 2021 11:20:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=91=98=E5=B7=A5=E6=9E=B6?= =?UTF-8?q?=E6=9E=84=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9=E4=BA=8B=E5=8A=A1?= =?UTF-8?q?=E5=9B=9E=E6=BB=9A=20=E6=96=B0=E5=A2=9E=E5=91=98=E5=B7=A5?= =?UTF-8?q?=E6=9E=B6=E6=9E=84=E6=A0=A1=E9=AA=8C=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/msdw/tms/api/SystemSetttingApi.java | 7 +++- .../controller/SystemSettingController.java | 6 +++ .../tms/service/SystemSetttingService.java | 2 + .../impl/SystemSettingServiceImpl.java | 40 +++++++++++++++++-- src/main/resources/mapper/tms/UserInfoDao.xml | 2 +- 5 files changed, 50 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/msdw/tms/api/SystemSetttingApi.java b/src/main/java/com/msdw/tms/api/SystemSetttingApi.java index 85fe3c9..4524c35 100644 --- a/src/main/java/com/msdw/tms/api/SystemSetttingApi.java +++ b/src/main/java/com/msdw/tms/api/SystemSetttingApi.java @@ -23,10 +23,10 @@ public interface SystemSetttingApi { public R queryStaff(StaffVo staffVo); @ApiOperation(value = "查看员工详情",notes = "查看员工详情") - public R querystaffDetail( Integer userId); + public R querystaffDetail(Integer userId); @ApiOperation(value = "编辑员工信息",notes = "编辑员工信息") - public R updateStaff( StaffVo staffVo); + public R updateStaff(StaffVo staffVo); @ApiOperation(value = "删除员工信息",notes = "删除员工信息") public R deleteStaff(StaffVo staffVo); @@ -48,6 +48,9 @@ public interface SystemSetttingApi { @ApiOperation(value = "查询账号信息",notes = "查询账号信息") public R queryAccount(String account,Integer schoolId); + + @ApiOperation(value = "验证架构账号信息返回具体错误信息",notes = "验证架构账号信息返回具体错误信息") + public R queryStaffInfo(StaffVo staffVo); } diff --git a/src/main/java/com/msdw/tms/controller/SystemSettingController.java b/src/main/java/com/msdw/tms/controller/SystemSettingController.java index 8ce92a7..3a25dfa 100644 --- a/src/main/java/com/msdw/tms/controller/SystemSettingController.java +++ b/src/main/java/com/msdw/tms/controller/SystemSettingController.java @@ -183,6 +183,12 @@ public class SystemSettingController implements SystemSetttingApi { return result; } + @Override + @PostMapping("/queryStaffInfo") + public R queryStaffInfo(@RequestBody StaffVo staffVo) { + return systemSetttingService.queryStaffInfo(staffVo); + } + /** * 重置密码 * @param userId diff --git a/src/main/java/com/msdw/tms/service/SystemSetttingService.java b/src/main/java/com/msdw/tms/service/SystemSetttingService.java index 64864be..28dc400 100644 --- a/src/main/java/com/msdw/tms/service/SystemSetttingService.java +++ b/src/main/java/com/msdw/tms/service/SystemSetttingService.java @@ -40,4 +40,6 @@ public interface SystemSetttingService { List queryUserIdsByGradeId(Integer staffGradeId); List queryUserIdsByProfessionalId(Integer staffProfessionalArchitectureId); + + R queryStaffInfo(StaffVo staffVo); } diff --git a/src/main/java/com/msdw/tms/service/impl/SystemSettingServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/SystemSettingServiceImpl.java index 0dff1d7..d7c3f47 100644 --- a/src/main/java/com/msdw/tms/service/impl/SystemSettingServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/SystemSettingServiceImpl.java @@ -184,19 +184,19 @@ public class SystemSettingServiceImpl implements SystemSetttingService { if (phone != null && phone != "") { List resultP = userInfoDao.queryPhone(phone); if (resultP.size() > 0) { - return R.error(400, "手机号不能重复"); + throw new RuntimeException("手机号不能重复"); } } if (email != null && email != "") { List resultE = userInfoDao.queryEmail(email); if (resultE.size() > 0) { - return R.error(400, "手机号不能重复"); + throw new RuntimeException("邮箱不能重复"); } } if (resultA.size() > 0) { - return R.error(400, "账号不能重复"); + throw new RuntimeException("账号不能重复"); } else if (resultW.size() > 0) { - return R.error(400, "工号不能重复"); + throw new RuntimeException("工号不能重复"); } boolean resultUserInfo = userInfoDao.updateUserInfo(staffVo); // String[] split = staffVo.getRoleId().split(","); @@ -761,4 +761,36 @@ public class SystemSettingServiceImpl implements SystemSetttingService { return systemSetttingDao.queryUserIdsByProfessionalId(staffProfessionalArchitectureId); } + @Override + public R queryStaffInfo(StaffVo staffVo) { + staffVo.setPlatformId(ConstantUtils.PLATFORMID); + String account = staffVo.getAccount(); + String phone = staffVo.getPhone(); + String email = staffVo.getEmail(); + String workNumber = staffVo.getWorkNumber(); + + userInfoDao.setNUM(staffVo.getUserId());//重置账号、手机号码为00 + + List resultA = userInfoDao.queryAccount(account); + List resultW = systemSetttingDao.queryWorkNumber(workNumber); + if (phone != null && phone != "") { + List resultP = userInfoDao.queryPhone(phone); + if (resultP.size() > 0) { + return R.error(400,"手机号不能重复"); + } + } + if (email != null && email != "") { + List resultE = userInfoDao.queryEmail(email); + if (resultE.size() > 0) { + return R.error(400,"邮箱不能重复"); + } + } + if (resultA.size() > 0) { + return R.error(400,"账号不能重复"); + } else if (resultW.size() > 0) { + return R.error(400,"工号不能重复"); + } + return R.ok(); + } + } \ No newline at end of file diff --git a/src/main/resources/mapper/tms/UserInfoDao.xml b/src/main/resources/mapper/tms/UserInfoDao.xml index b8160b5..1104149 100644 --- a/src/main/resources/mapper/tms/UserInfoDao.xml +++ b/src/main/resources/mapper/tms/UserInfoDao.xml @@ -204,7 +204,7 @@ UPDATE hr_user_info u SET - u.account = '00',u.phone = null + u.account = '00',u.phone = null,u.email = null WHERE userId = #{userId}