|
@@ -2,6 +2,7 @@ package cn.com.qmth.examcloud.service.core.api;
|
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -12,6 +13,7 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
import org.apache.commons.lang.StringEscapeUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.data.domain.PageImpl;
|
|
|
import org.springframework.data.domain.PageRequest;
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
@@ -188,15 +190,12 @@ public class UserApi {
|
|
|
@RequestParam("newPassword") String newPassword,
|
|
|
HttpServletRequest request) {
|
|
|
AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
|
|
|
-// String oldPassword = params.get("oldPassword");
|
|
|
-// String newPassword = params.get("newPassword");
|
|
|
if (StringUtils.isEmpty(oldPassword) || StringUtils.isEmpty(newPassword)) {
|
|
|
return new ResponseEntity(new ErrorMsg("原密码不正确"), HttpStatus.BAD_REQUEST);
|
|
|
} else {
|
|
|
Long userId = accessUser.getUserId();
|
|
|
User user = userRepo.findOne(userId);
|
|
|
if (!oldPassword.equals(user.getPassword())) {
|
|
|
-
|
|
|
return new ResponseEntity(new ErrorMsg("原密码不正确"), HttpStatus.BAD_REQUEST);
|
|
|
}
|
|
|
userRepo.updatePasswordById(userId, newPassword);
|
|
@@ -263,19 +262,6 @@ public class UserApi {
|
|
|
return new ResponseEntity(userService.saveMarker(accessUser.getRootOrgId(),loginName,name), HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "校验token", notes = "校验token")
|
|
|
- @GetMapping("/checkToken")
|
|
|
- public ResponseEntity checkToken(HttpServletRequest request) {
|
|
|
- AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
|
|
|
- if (accessUser == null) {
|
|
|
- return new ResponseEntity(HttpStatus.NOT_FOUND);
|
|
|
- } else if (StringUtils.isEmpty(accessUser.getToken())) {
|
|
|
- return new ResponseEntity(HttpStatus.NOT_FOUND);
|
|
|
- } else {
|
|
|
- return new ResponseEntity(HttpStatus.OK);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
@ApiOperation(value="查询评卷员带分页",notes="查询评卷员带分页")
|
|
|
@GetMapping("/all/marker/{curPage}/{pageSize}")
|
|
|
public ResponseEntity getAllMark(@ModelAttribute User user,
|
|
@@ -286,7 +272,14 @@ public class UserApi {
|
|
|
if(accessUser != null){
|
|
|
user.setRootOrgId(accessUser.getRootOrgId());
|
|
|
return new ResponseEntity(userService.getAllMaker(user,new PageRequest(curPage-1, pageSize)),HttpStatus.OK);
|
|
|
- }
|
|
|
- return new ResponseEntity(HttpStatus.NOT_FOUND);
|
|
|
+ }else{
|
|
|
+ return new ResponseEntity(new PageImpl<User>(new ArrayList<User>()),HttpStatus.OK);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value="查询印刷项目经理",notes="查询印刷项目经理")
|
|
|
+ @GetMapping("/allPrintPm")
|
|
|
+ public ResponseEntity getAllPrintPm(){
|
|
|
+ return new ResponseEntity(userRepo.findPrintPm(),HttpStatus.OK);
|
|
|
}
|
|
|
}
|