|
@ -12,6 +12,7 @@ import io.swagger.annotations.Api; |
|
|
import io.swagger.annotations.ApiOperation; |
|
|
import io.swagger.annotations.ApiOperation; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.nl.common.exception.BadRequestException; |
|
|
import org.nl.common.exception.BadRequestException; |
|
|
|
|
|
import org.nl.common.logging.annotation.Log; |
|
|
import org.nl.common.utils.RsaUtils; |
|
|
import org.nl.common.utils.RsaUtils; |
|
|
import org.nl.common.utils.dto.CurrentUser; |
|
|
import org.nl.common.utils.dto.CurrentUser; |
|
|
import org.nl.config.RsaProperties; |
|
|
import org.nl.config.RsaProperties; |
|
@ -19,7 +20,10 @@ import org.nl.system.service.role.ISysRoleService; |
|
|
import org.nl.system.service.secutiry.dto.AuthUserDto; |
|
|
import org.nl.system.service.secutiry.dto.AuthUserDto; |
|
|
import org.nl.system.service.user.ISysUserService; |
|
|
import org.nl.system.service.user.ISysUserService; |
|
|
import org.nl.system.service.user.dao.SysUser; |
|
|
import org.nl.system.service.user.dao.SysUser; |
|
|
|
|
|
import org.nl.wms.sch.point.service.ISchBasePointService; |
|
|
|
|
|
import org.nl.wms.sch.point.service.dao.SchBasePoint; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
|
import org.springframework.http.HttpStatus; |
|
|
import org.springframework.http.ResponseEntity; |
|
|
import org.springframework.http.ResponseEntity; |
|
|
import org.springframework.validation.annotation.Validated; |
|
|
import org.springframework.validation.annotation.Validated; |
|
|
import org.springframework.web.bind.annotation.PostMapping; |
|
|
import org.springframework.web.bind.annotation.PostMapping; |
|
@ -29,6 +33,7 @@ import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @Author: lyd |
|
|
* @Author: lyd |
|
@ -37,15 +42,17 @@ import java.util.List; |
|
|
*/ |
|
|
*/ |
|
|
@Slf4j |
|
|
@Slf4j |
|
|
@RestController |
|
|
@RestController |
|
|
@RequestMapping("/mobile/auth") |
|
|
@RequestMapping("/api/pda") |
|
|
@Api(tags = "手持:系统授权接口") |
|
|
@Api(tags = "手持:系统授权接口") |
|
|
public class MobileAuthorizationController { |
|
|
public class MobileAuthorizationController { |
|
|
@Autowired |
|
|
@Autowired |
|
|
private ISysUserService userService; |
|
|
private ISysUserService userService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private ISysRoleService roleService; |
|
|
private ISysRoleService roleService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private ISchBasePointService pointService; |
|
|
@ApiOperation("登录授权") |
|
|
@ApiOperation("登录授权") |
|
|
@PostMapping(value = "/login") |
|
|
@PostMapping(value = "/handlogin") |
|
|
@SaIgnore |
|
|
@SaIgnore |
|
|
public ResponseEntity<Object> login(@Validated @RequestBody AuthUserDto authUser, HttpServletRequest request) throws Exception { |
|
|
public ResponseEntity<Object> login(@Validated @RequestBody AuthUserDto authUser, HttpServletRequest request) throws Exception { |
|
|
// 密码解密 - 前端的加密规则: encrypt(根据实际更改)
|
|
|
// 密码解密 - 前端的加密规则: encrypt(根据实际更改)
|
|
@ -89,4 +96,16 @@ public class MobileAuthorizationController { |
|
|
|
|
|
|
|
|
return ResponseEntity.ok(authInfo); |
|
|
return ResponseEntity.ok(authInfo); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/point") |
|
|
|
|
|
@Log("查询设备编号及状态") |
|
|
|
|
|
@ApiOperation("查询设备编号及状态") |
|
|
|
|
|
@SaIgnore |
|
|
|
|
|
//@PreAuthorize("@el.check('sect:list')")
|
|
|
|
|
|
//@RequestBody JSONObject json
|
|
|
|
|
|
public ResponseEntity<Object> queryPoint(@RequestBody Map<String, String> whereJson) { |
|
|
|
|
|
SchBasePoint region = new SchBasePoint(); |
|
|
|
|
|
region.setRegion_code(whereJson.get("region_code")); |
|
|
|
|
|
return new ResponseEntity<>(pointService.getPointList(region), HttpStatus.OK); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|