diff --git a/src/main/java/com/msdw/tms/api/SystemSetttingApi.java b/src/main/java/com/msdw/tms/api/SystemSetttingApi.java index 85fe3c9..4941aaa 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,8 @@ public interface SystemSetttingApi { @ApiOperation(value = "查询账号信息",notes = "查询账号信息") public R queryAccount(String account,Integer schoolId); + + } diff --git a/src/main/java/com/msdw/tms/controller/AchievementManagementController.java b/src/main/java/com/msdw/tms/controller/AchievementManagementController.java index 269de60..9e7e683 100644 --- a/src/main/java/com/msdw/tms/controller/AchievementManagementController.java +++ b/src/main/java/com/msdw/tms/controller/AchievementManagementController.java @@ -2,14 +2,15 @@ package com.msdw.tms.controller; import com.github.pagehelper.PageInfo; import com.msdw.tms.api.AchievementManagementApi; -import com.msdw.tms.common.utils.PageUtils; import com.msdw.tms.common.utils.R; -import com.msdw.tms.entity.*; +import com.msdw.tms.entity.ExperimentalReportEntity; +import com.msdw.tms.entity.ProjectRecordEntity; +import com.msdw.tms.entity.ReportEntity; +import com.msdw.tms.entity.ResultsEntity; import com.msdw.tms.entity.vo.AchievementManagementVO; import com.msdw.tms.entity.vo.ResultsVo; import com.msdw.tms.service.AchievementManagementService; import com.msdw.tms.service.ProjectRecordService; -import com.msdw.tms.util.ListPageUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; diff --git a/src/main/java/com/msdw/tms/controller/SystemSettingController.java b/src/main/java/com/msdw/tms/controller/SystemSettingController.java index 8ce92a7..48f3346 100644 --- a/src/main/java/com/msdw/tms/controller/SystemSettingController.java +++ b/src/main/java/com/msdw/tms/controller/SystemSettingController.java @@ -183,6 +183,7 @@ public class SystemSettingController implements SystemSetttingApi { return result; } + /** * 重置密码 * @param userId diff --git a/src/main/java/com/msdw/tms/controller/UserInfoController.java b/src/main/java/com/msdw/tms/controller/UserInfoController.java index 1ea72ce..b15eabe 100644 --- a/src/main/java/com/msdw/tms/controller/UserInfoController.java +++ b/src/main/java/com/msdw/tms/controller/UserInfoController.java @@ -184,7 +184,7 @@ public class UserInfoController implements UserInfoControllerApi { String password = userInfo.getPassword(); //验证账号是否存在 - int num = userInfoService.queryAccountExist(userInfo.getAccount()); + int num = userInfoService.queryAccountExist(userInfo.getAccount(),userInfo.getUserId()); if (num >= 1){ return R.error(500,"更新失败,账号不能重复"); } diff --git a/src/main/java/com/msdw/tms/dao/UserInfoDao.java b/src/main/java/com/msdw/tms/dao/UserInfoDao.java index ccdb1fc..ab8e947 100644 --- a/src/main/java/com/msdw/tms/dao/UserInfoDao.java +++ b/src/main/java/com/msdw/tms/dao/UserInfoDao.java @@ -5,6 +5,7 @@ import com.msdw.tms.entity.StudentEntity; import com.msdw.tms.entity.UserInfoEntity; import com.msdw.tms.entity.vo.*; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -67,5 +68,5 @@ public interface UserInfoDao extends BaseMapper { Integer getUserId(String token); - Integer queryAccountExist(String account); + Integer queryAccountExist(@Param("account") String account,@Param("userId") Integer 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..93f0865 100644 --- a/src/main/java/com/msdw/tms/service/SystemSetttingService.java +++ b/src/main/java/com/msdw/tms/service/SystemSetttingService.java @@ -40,4 +40,5 @@ public interface SystemSetttingService { List queryUserIdsByGradeId(Integer staffGradeId); List queryUserIdsByProfessionalId(Integer staffProfessionalArchitectureId); + } diff --git a/src/main/java/com/msdw/tms/service/UserInfoService.java b/src/main/java/com/msdw/tms/service/UserInfoService.java index 59b44e0..fa0e25c 100644 --- a/src/main/java/com/msdw/tms/service/UserInfoService.java +++ b/src/main/java/com/msdw/tms/service/UserInfoService.java @@ -9,7 +9,6 @@ import com.msdw.tms.entity.vo.StudentVo; import com.msdw.tms.entity.vo.UserProsonalEntityVo; import java.util.HashMap; -import java.util.List; import java.util.Map; public interface UserInfoService extends IService { @@ -50,5 +49,5 @@ public interface UserInfoService extends IService { R getUserId(String token); - Integer queryAccountExist(String account); + Integer queryAccountExist(String account,Integer userId); } 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 a0fc518..4c7199c 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(","); @@ -760,5 +760,4 @@ public class SystemSettingServiceImpl implements SystemSetttingService { public List queryUserIdsByProfessionalId(Integer staffProfessionalArchitectureId) { return systemSetttingDao.queryUserIdsByProfessionalId(staffProfessionalArchitectureId); } - } \ No newline at end of file diff --git a/src/main/java/com/msdw/tms/service/impl/UserInfoServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/UserInfoServiceImpl.java index 3559522..507194e 100644 --- a/src/main/java/com/msdw/tms/service/impl/UserInfoServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/UserInfoServiceImpl.java @@ -11,11 +11,7 @@ import com.msdw.tms.dao.UserDao; import com.msdw.tms.dao.UserInfoDao; import com.msdw.tms.entity.StudentEntity; import com.msdw.tms.entity.UserInfoEntity; -import com.msdw.tms.entity.response.CommonCode; -import com.msdw.tms.entity.response.ResponseResult; -import com.msdw.tms.entity.response.ResultCode; import com.msdw.tms.entity.vo.CheckVo; -import com.msdw.tms.entity.vo.StaffVo; import com.msdw.tms.entity.vo.StudentVo; import com.msdw.tms.entity.vo.UserProsonalEntityVo; import com.msdw.tms.service.UserInfoService; @@ -229,7 +225,7 @@ public class UserInfoServiceImpl extends ServiceImpl diff --git a/src/main/resources/mapper/tms/UserInfoDao.xml b/src/main/resources/mapper/tms/UserInfoDao.xml index b8160b5..f047cd7 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} @@ -292,7 +292,7 @@ \ No newline at end of file