更新员工架构接口修改事务回滚

新增员工架构校验接口
hehai
jiakun.lin 4 years ago
parent d3fc5e5ad1
commit 503dd09f06
  1. 7
      src/main/java/com/msdw/tms/api/SystemSetttingApi.java
  2. 6
      src/main/java/com/msdw/tms/controller/SystemSettingController.java
  3. 2
      src/main/java/com/msdw/tms/service/SystemSetttingService.java
  4. 40
      src/main/java/com/msdw/tms/service/impl/SystemSettingServiceImpl.java
  5. 2
      src/main/resources/mapper/tms/UserInfoDao.xml

@ -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);
}

@ -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

@ -40,4 +40,6 @@ public interface SystemSetttingService {
List<Integer> queryUserIdsByGradeId(Integer staffGradeId);
List<Integer> queryUserIdsByProfessionalId(Integer staffProfessionalArchitectureId);
R queryStaffInfo(StaffVo staffVo);
}

@ -184,19 +184,19 @@ public class SystemSettingServiceImpl implements SystemSetttingService {
if (phone != null && phone != "") {
List<Integer> resultP = userInfoDao.queryPhone(phone);
if (resultP.size() > 0) {
return R.error(400, "手机号不能重复");
throw new RuntimeException("手机号不能重复");
}
}
if (email != null && email != "") {
List<Integer> 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<StaffVo> resultA = userInfoDao.queryAccount(account);
List<Integer> resultW = systemSetttingDao.queryWorkNumber(workNumber);
if (phone != null && phone != "") {
List<Integer> resultP = userInfoDao.queryPhone(phone);
if (resultP.size() > 0) {
return R.error(400,"手机号不能重复");
}
}
if (email != null && email != "") {
List<Integer> 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();
}
}

@ -204,7 +204,7 @@
<update id="setNUM">
UPDATE hr_user_info u
SET
u.account = '00',u.phone = null
u.account = '00',u.phone = null,u.email = null
WHERE userId = #{userId}
</update>
<update id="resetPassword">

Loading…
Cancel
Save