| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- package com.uas.platform.home.controller;
- import com.alibaba.fastjson.JSON;
- import com.alibaba.fastjson.JSONObject;
- import com.uas.platform.home.core.support.SystemSession;
- import com.uas.platform.home.model.HttpAddress;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- import org.springframework.web.servlet.ModelAndView;
- /**
- * created by shicr on 2017/11/23
- **/
- @RestController
- @RequestMapping("/finance")
- public class FinanceController {
- @Autowired
- private HttpAddress httpAddress;
- @RequestMapping
- public ModelAndView getFinancePage(){
- return new ModelAndView("finance");
- }
- @RequestMapping(value = "/loan")
- public String loan(String jsonStr) {
- JSONObject jsonObject = JSON.parseObject(jsonStr);
- String url = httpAddress.getLoanAddress();
- if (null != SystemSession.getUser() && null != SystemSession.getUser().getDialectUID()) {
- jsonObject.putAll(JSON.parseObject(JSON.toJSONString(SystemSession.getUser())));
- url = url + "?UID=" + Long.parseLong(SystemSession.getUser().getDialectUID());
- }
- com.uas.sso.common.util.HttpUtil.ResponseWrap res = null;
- try {
- res = com.uas.sso.common.util.HttpUtil.doPost(url, jsonObject);
- if(res.isSuccess()) {
- return "申请成功";
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- return "申请失败";
- }
- }
|