|
|
@ -8,6 +8,7 @@ import com.dsic.gj_erp.exception.CustomException;
|
|
|
|
import com.dsic.gj_erp.mapper.SyuserMapper;
|
|
|
|
import com.dsic.gj_erp.mapper.SyuserMapper;
|
|
|
|
import com.dsic.gj_erp.service.ApiService;
|
|
|
|
import com.dsic.gj_erp.service.ApiService;
|
|
|
|
import com.dsic.gj_erp.service.sy.SYService;
|
|
|
|
import com.dsic.gj_erp.service.sy.SYService;
|
|
|
|
|
|
|
|
import com.dsic.gj_erp.util.IPUtils;
|
|
|
|
import com.dsic.gj_erp.util.MD5Util;
|
|
|
|
import com.dsic.gj_erp.util.MD5Util;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@ -18,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
|
|
import java.net.InetAddress;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
@Api(tags = "系统级API")
|
|
|
|
@Api(tags = "系统级API")
|
|
|
@ -33,7 +35,7 @@ public class ApiController {
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
SYService syService;
|
|
|
|
SYService syService;
|
|
|
|
@RequestMapping(value = "/login")
|
|
|
|
@RequestMapping(value = "/login")
|
|
|
|
public ResultBean login(@RequestBody @Validated LoginBean loginBean) throws CustomException {
|
|
|
|
public ResultBean login(@RequestBody @Validated LoginBean loginBean) throws Exception {
|
|
|
|
// List<String> list=new ArrayList<>();
|
|
|
|
// List<String> list=new ArrayList<>();
|
|
|
|
// for (int i = 0; i < 10; i++) {
|
|
|
|
// for (int i = 0; i < 10; i++) {
|
|
|
|
// String a= syService.f_getpjh("DM","DM","CZPL");
|
|
|
|
// String a= syService.f_getpjh("DM","DM","CZPL");
|
|
|
@ -42,7 +44,9 @@ public class ApiController {
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// System.out.println(list);
|
|
|
|
// System.out.println(list);
|
|
|
|
// //
|
|
|
|
// //
|
|
|
|
|
|
|
|
// String hostAddress = InetAddress.getLocalHost().getHostAddress();
|
|
|
|
|
|
|
|
// System.out.print("hostAddress ");
|
|
|
|
|
|
|
|
// System.out.println(hostAddress);
|
|
|
|
return new ResultBean(apiService.userLogin(loginBean));
|
|
|
|
return new ResultBean(apiService.userLogin(loginBean));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -51,7 +55,11 @@ public class ApiController {
|
|
|
|
public ResultBean getInfo(HttpServletRequest request) {
|
|
|
|
public ResultBean getInfo(HttpServletRequest request) {
|
|
|
|
String yhdm = (String) request.getAttribute("yhdm");
|
|
|
|
String yhdm = (String) request.getAttribute("yhdm");
|
|
|
|
String zxtdm = (String) request.getAttribute("zxtdm");
|
|
|
|
String zxtdm = (String) request.getAttribute("zxtdm");
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
|
|
|
System.out.print("IpAddr ");
|
|
|
|
|
|
|
|
System.out.println(IPUtils.getIpAddr(request));
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> map= apiService.getInfo(yhdm);
|
|
|
|
Map<String, Object> map= apiService.getInfo(yhdm);
|
|
|
|
map.put("menu", syuserMapper.getUserMenu(yhdm, zxtdm));
|
|
|
|
map.put("menu", syuserMapper.getUserMenu(yhdm, zxtdm));
|
|
|
|
return new ResultBean(map);
|
|
|
|
return new ResultBean(map);
|
|
|
|