Procházet zdrojové kódy

加入finance部分到项目中

scr před 8 roky
rodič
revize
0185d22629

+ 41 - 0
src/main/java/com/uas/platform/home/controller/FinanceController.java

@@ -0,0 +1,41 @@
+package com.uas.platform.home.controller;
+
+
+import com.uas.platform.home.core.support.SystemSession;
+import com.uas.platform.home.core.util.HttpUtil;
+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 java.util.Map;
+
+/**
+ * created by shicr on 2017/11/23
+ **/
+@RestController
+@RequestMapping("/finance")
+public class FinanceController {
+
+    @Autowired
+    private HttpAddress httpAddress;
+
+    @RequestMapping(value = "/loan")
+    public String loan(String jsonStr) {
+        String url = httpAddress.getLoanAddress();
+        if (null != SystemSession.getUser() && null != SystemSession.getUser().getDialectUID()) {
+            url = url + "?UID=" + SystemSession.getUser().getDialectUID();
+        }
+        try {
+           HttpUtil.Response response =  HttpUtil.doPost(url + "?UID=" + "", jsonStr, 5000);
+           if(200 == response.getStatusCode())
+               return "success";
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return "申请失败";
+    }
+
+
+}

+ 4 - 2
src/main/java/com/uas/platform/home/controller/UuzcController.java

@@ -137,7 +137,9 @@ public class UuzcController extends BaseController {
      */
     @RequestMapping(value = "/hrInfo", method = RequestMethod.GET)
     public ModelMap getHrInfo() throws Exception {
-        User user = AccountUtils.getHrInfo(SystemSession.getUser().getSpaceUID());
-        return new ModelMap("user", user);
+        if(null != SystemSession.getUser()) {
+            return new ModelMap("user", AccountUtils.getHrInfo(SystemSession.getUser().getSpaceUID()));
+        }
+        return null;
     }
 }

+ 33 - 0
src/main/java/com/uas/platform/home/model/HttpAddress.java

@@ -0,0 +1,33 @@
+package com.uas.platform.home.model;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+/**
+ * created by shicr on 2017/11/27
+ **/
+@Component
+public class HttpAddress {
+    private static final long serialVersionUID = 1L;
+
+    private String sys;
+
+    @Value("#{url.loanAddress}")
+    private String loanAddress;
+
+    public String getLoanAddress() {
+        return loanAddress;
+    }
+
+    public void setLoanAddress(String loanAddress) {
+        this.loanAddress = loanAddress;
+    }
+
+    public String getSys() {
+        return sys;
+    }
+
+    public void setSys(String sys) {
+        this.sys = sys;
+    }
+}

+ 1 - 1
src/main/resources/conf/account.properties

@@ -12,4 +12,4 @@ sso.login.url=https://account.ubtob.com/sso/login
 account.us.save.url=http://10.10.100.133:8080/api/userspace
 account.user.save.url=http://10.10.100.133:8080/api/user
 account.user.getPartners.url = http://10.10.100.133:8080/api/partners
-account.user.getContactPage.url=https://account.ubtob.com/business/groups
+account.user.getContactPage.url=https://account.ubtob.com/business/groups

+ 1 - 0
src/main/resources/conf/httpAddress.properties

@@ -0,0 +1 @@
+loanAddress=http://192.168.253.227:8082/loan/saveInfo

+ 3 - 6
src/main/resources/spring/applicationContext.xml

@@ -1,16 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <beans xmlns="http://www.springframework.org/schema/beans"
 	xmlns:context="http://www.springframework.org/schema/context"
-	xmlns:aop="http://www.springframework.org/schema/aop" xmlns:task="http://www.springframework.org/schema/task"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
 	xmlns:cache="http://www.springframework.org/schema/cache" xmlns:util="http://www.springframework.org/schema/util"
 	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd   
 	http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd
-	http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.1.xsd
-	http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.1.xsd
-	http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.1.xsd
-	http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
-	http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache-4.1.xsd">
+	http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
 
 	<!-- 注册spring上下文对象 -->
 	<bean class="com.uas.platform.home.core.support.ApplicationContextRegister" />
@@ -26,4 +21,6 @@
 		<property name="configPath" value="classpath:conf/account.properties" />
 	</bean>
 
+	<util:properties id="url"
+					 location="classpath:conf/httpAddress.properties" />
 </beans>

+ 142 - 134
src/main/webapp/WEB-INF/views/normal/finance.html

@@ -9,64 +9,73 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width, initial-scale=1">
     <meta name="renderer" content="webkit">
-    <link href="static/images/icon.png" rel="icon" type="image/x-icon" />
-    <link rel="stylesheet" href="static/lib/bootstrap/css/bootstrap.min.css" />
-    <link rel="stylesheet" href="static/css/common.css" />
-    <link rel="stylesheet" href="static/css/index.css" />
+    <link href="static/images/icon.png" rel="icon" type="image/x-icon"/>
+    <link rel="stylesheet" href="static/lib/bootstrap/css/bootstrap.min.css"/>
+    <link rel="stylesheet" href="static/css/common.css"/>
+    <link rel="stylesheet" href="static/css/index.css"/>
 
 </head>
 <style>
-    .finance{
+    .finance {
         width: 100%;
         margin: 0 auto;
         z-index: 1;
     }
-    .width1170{
+
+    .width1170 {
         width: 1170px;
         margin: 0 auto;
     }
-    .finance .banner{
+
+    .finance .banner {
         width: 100%;
         margin: 0 auto;
         max-height: 600px;
     }
-    .finance .banner img{
+
+    .finance .banner img {
         width: 100%;
-        margin-top:20px;
+        margin-top: 20px;
     }
 
-    .finance .item{
+    .finance .item {
         width: 100%;
         margin: 0 auto;
         height: 540px;
     }
-    .finance .img{
+
+    .finance .img {
         float: left;
         margin: 0px 0 0 15px;
     }
-    .finance .title{
+
+    .finance .title {
         float: right;
         text-align: center;
         margin: 15px 180px 0 0
     }
-    .finance .title h2{
+
+    .finance .title h2 {
         font-size: 30px;
         color: #0080cc;
         line-height: 30px;
         text-align: left;
     }
-    .finance .title p{
+
+    .finance .title p {
         font-size: 14px;
         color: #666;
         line-height: 25px;
         text-align: left;
     }
-    .finance .item .title p.f18{
+
+    .finance .item .title p.f18 {
         font-size: 18px;
         color: #333;
         margin: 12px 0 6px 0;
     }
-    .finance .title a{
+
+    .finance .title a {
         display: inline-block;
         width: 200px;
         height: 50px;
@@ -81,68 +90,143 @@
 
         top: 12px;
     }
-    .finance .title a:hover{
+
+    .finance .title a:hover {
         text-decoration: none;
         background: #25a0cc;
         cursor: pointer;
     }
 
-    #loan{
-    z-index:20;
-    position:absolute;
-    width:800px;
-    height:720px;
-    margin-top:400px;
-    margin-left:240px;
-    padding:30px;
-    background-color:white;
-    border-radius: 5px;
-    box-shadow:0 0 15px rgba(0, 0, 0, 0.7);
-    background: linear-gradient(0deg, rgb(238, 238, 238) 0%, whitesmoke 100%)
-    }
-    #loan div input{
-        font: 13.3333px Arial;
-        color: initial;
-        letter-spacing: normal;
-        word-spacing: normal;
-    }
-    #loan button{
-        background-color: #56a2cf;
-        color: white;
-    }
-    #note{
-        padding-bottom: 12px;
-    }
-    #layer{
-        height:1500px;
-        display:block;
-        background-color:black;
-        z-index:10;
+    /*#loan{
+        z-index:20;
         position:absolute;
-        top:0px;
-        opacity: 0.4
+        width:800px;
+        height:720px;
+        margin-top:400px;
+        margin-left:240px;
+        padding:30px;
+        background-color:white;
+        border-radius: 5px;
+        box-shadow:0 0 15px rgba(0, 0, 0, 0.7);
+        background: linear-gradient(0deg, rgb(238, 238, 238) 0%, whitesmoke 100%)
+    }*/
+    /* #loan div input{
+         font: 13.3333px Arial;
+         color: initial;
+         letter-spacing: normal;
+         word-spacing: normal;
+     }
+     #loan button{
+         background-color: #56a2cf;
+         color: white;
+     }*/
+    #note {
+        padding-bottom: 12px;
     }
-    #span2{
+
+    /*  #layer{
+          height:1500px;
+          display:block;
+          background-color:black;
+          z-index:10;
+          position:absolute;
+          top:0px;
+          opacity: 0.4
+      }*/
+    #span2 {
         padding-left: 150px;
     }
-    #span4{
+
+    #span4 {
         padding-left: 95px;
     }
-    #span6{
+
+    #span6 {
         padding-left: 25px;
     }
-    #span11{
+
+    #span11 {
         padding-left: 65px;
     }
 
 </style>
 <body>
 
+<!-- Modal -->
+<div class="modal fade" id="applyModal" tabindex="-1" role="dialog" aria-labelledby="applyModalLabel">
+    <div class="modal-dialog modal-lg" role="document">
+        <div class="modal-content">
+            <div class="modal-header">
+                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
+                </button>
+                <h4 class="modal-title" id="applyModalLabel">立即申请</h4>
+            </div>
+            <div class="modal-body">
+                <div class="form-horizontal">
+                    <div class="form-group">
+                        <label class="col-sm-2 control-label">企业名称</label>
+                        <div class="col-sm-6">
+                            <input type="text" placeholder="请输入企业名称" class="form-control" id="loanCommpanyName">
+                        </div>
+                    </div>
+                    <div class="form-group">
+                        <label class="col-sm-2 control-label">拟融资金额</label>
+                        <div class="col-sm-4">
+                            <div class="input-group">
+                                <input type="text" placeholder="请输入融资金额" class="form-control" id="loanAmount"
+                                       onkeyup="if(isNaN(value))execCommand('undo')"
+                                       onafterpaste="if(isNaN(value))execCommand('undo')">
+                                <div class="input-group-addon">元</div>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="form-group">
+                        <label class="col-sm-2 control-label">联系人</label>
+                        <div class="col-sm-4">
+                            <input type="text" placeholder="请输入您的姓名" class="form-control" id="loanName">
+                        </div>
+                    </div>
+                    <div class="form-group">
+                        <label class="col-sm-2 control-label">联系方式</label>
+                        <div class="col-sm-4">
+                            <input type="text" placeholder="请输入您的手机号" class="form-control" id="loanTelphone">
+                        </div>
+                    </div>
+                    <div class="form-group">
+                        <div class="col-sm-10 col-sm-offset-2">
+                            <input type="checkbox" id="check">同意查询人民银行征信记录授权协议
+                        </div>
+                    </div>
+                    <div id="note">
+                        需提供以下资料清单(加盖公章)<br>
+                        <span>1、营业执照复印件</span> <span id="span2"> 2、组织机构代码证复印件</span><br>
+                        <span>3、国税、地税登记证复印件</span> <span id="span4"> 4、开户许可证复印件</span><br>
+                        <span>5、法人代表及实际控制人身份证复印件</span> <span id="span6">6、法人代表证明书(见附件1)</span><br>
+                        <span>7、公司近三年审计报告及最近一期的财务报表及科目明细(前五大)</span><br>
+                        <span>8、近1年主要结算银行流水对账单和用于公司账务结算的个人账户结算单复印件</span><br>
+                        <span>9、前五大上下游客户近一年贸易合同,货运证明或其他表明货物确已发运的单据;交易发票;提货单、质检证明(凭证)、预付款(定金)凭证复印件</span><br>
+                        <span>10、公司基本情况表(见附件2)</span><span id="span11">11、拟融资应收账款发票清单、采购合同明细(见附件3)</span><br>
+                        <span>12、拟融资应收账款客户近一年的付款凭证(银行回单)</span><br>
+                        <span>13、拟融资应收账款相关贸易合同,货运证明或其他表明货物确已发运的单据;交易发票;提货单、质检证明(凭证)、预付款(定金)凭证</span><br>
+                        <span> 14、近两年缴税完税凭证、水电费单、员工工资单等证明文件</span><br>
+                        <span>15、我公司要求的其他资料</span><br>
+                    </div>
+                </div>
+            </div>
+            <div class="modal-footer">
+                <button class="btn btn-default" data-dismiss="modal">取消</button>
+                <button class="btn btn-primary" id="loanSubmit">提交申请</button>
+            </div>
+        </div>
+    </div>
+</div>
+
+
 <!-- nav start -->
 <nav id="nav" class="navbar navbar-inverse navbar-fixed-top">
     <div class="container">
         <div class="navbar-header">
-            <a href="./" id="logo"><img src="static/img/logo.png" alt="" height="25px" /></a>
+            <a href="" id="logo"><img src="static/img/logo.png" alt="" height="25px"/></a>
         </div>
         <div class="collapse navbar-collapse">
             <ul class="nav navbar-nav navbar-left">
@@ -171,11 +255,6 @@
     </div>
 </nav>
 <!-- nav end -->
-
-<header class="finance">
-    <div class="banner"><img src="static/images/banner.jpg" /></div>
-</header>
-
 <section class="finance">
     <div class="container">
         <div>
@@ -196,7 +275,6 @@
         </div>
     </div>
 </section>
-
 <!-- footer start -->
 <footer>
     <div class="container">
@@ -205,7 +283,7 @@
                 <div class="qrcode qrcode-uu">
                     <div class="qrcode-img pull-left">
                         <img src="static/img/qrcode/uu.png" width="100px" height="100px"
-                             alt="UU互联" />
+                             alt="UU互联"/>
                     </div>
                     <div class="qrcode-text pull-left">
                         <div>手机UU</div>
@@ -218,7 +296,7 @@
                 <div class="qrcode qrcode-uas">
                     <div class="qrcode-img pull-left">
                         <img src="static/img/qrcode/uas.png" width="100px" height="100px"
-                             alt="优软公众号" />
+                             alt="优软公众号"/>
                     </div>
                     <div class="qrcode-text pull-left">
                         <div>微信扫描</div>
@@ -239,78 +317,8 @@
         </div>
     </div>
 </footer>
-
-<!-- Modal -->
-<div class="modal fade" id="applyModal" tabindex="-1" role="dialog" aria-labelledby="applyModalLabel">
-    <div class="modal-dialog modal-lg" role="document">
-        <div class="modal-content">
-            <div class="modal-header">
-                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
-                <h4 class="modal-title" id="applyModalLabel">立即申请</h4>
-            </div>
-            <div class="modal-body">
-                <form class="form-horizontal" action="">
-                    <div class="form-group">
-                        <input type="text" style="display: none" class="form-control" id="loanUserId">
-                    </div>
-                    <div class="form-group">
-                        <label class="col-sm-2 control-label">企业名称</label>
-                        <div class="col-sm-6">
-                            <input type="text" placeholder="请输入您的企业全称"  class="form-control" id="loanCommpanyName">
-                        </div>
-                    </div>
-                    <div class="form-group">
-                        <label class="col-sm-2 control-label">拟融资金额</label>
-                        <div class="col-sm-4">
-                            <div class="input-group">
-                                <input type="text" placeholder="请输入融资金额" class="form-control" id="loanAmount" onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')">
-                                <div class="input-group-addon">元</div>
-                            </div>
-                        </div>
-                    </div>
-                    <div class="form-group">
-                        <label class="col-sm-2 control-label">联系人</label>
-                        <div class="col-sm-4">
-                            <input type="text" placeholder="请输入您的姓名" class="form-control" id="loanName">
-                        </div>
-                    </div>
-                    <div class="form-group">
-                        <label class="col-sm-2 control-label">联系方式</label>
-                        <div class="col-sm-4">
-                            <input type="text" placeholder="请输入您的手机号" class="form-control" id="loanTelphone">
-                        </div>
-                    </div>
-                    <div class="form-group">
-                        <div class="col-sm-10 col-sm-offset-2">
-                            <input type="checkbox" id="check">同意查询人民银行征信记录授权协议
-                        </div>
-                    </div>
-                    <div id="note">
-                        需提供以下资料清单(加盖公章)<br>
-                        <span>1、营业执照复印件</span>        <span id="span2"> 2、组织机构代码证复印件</span><br>
-                        <span>3、国税、地税登记证复印件</span>  <span id="span4"> 4、开户许可证复印件</span><br>
-                        <span>5、法人代表及实际控制人身份证复印件</span> <span id="span6">6、法人代表证明书(见附件1)</span><br>
-                        <span>7、公司近三年审计报告及最近一期的财务报表及科目明细(前五大)</span><br>
-                        <span>8、近1年主要结算银行流水对账单和用于公司账务结算的个人账户结算单复印件</span><br>
-                        <span>9、前五大上下游客户近一年贸易合同,货运证明或其他表明货物确已发运的单据;交易发票;提货单、质检证明(凭证)、预付款(定金)凭证复印件</span><br>
-                        <span>10、公司基本情况表(见附件2)</span><span id="span11">11、拟融资应收账款发票清单、采购合同明细(见附件3)</span><br>
-                        <span>12、拟融资应收账款客户近一年的付款凭证(银行回单)</span><br>
-                        <span>13、拟融资应收账款相关贸易合同,货运证明或其他表明货物确已发运的单据;交易发票;提货单、质检证明(凭证)、预付款(定金)凭证</span><br>
-                        <span> 14、近两年缴税完税凭证、水电费单、员工工资单等证明文件</span><br>
-                        <span>15、我公司要求的其他资料</span><br>
-                    </div>
-                </form>
-            </div>
-            <div class="modal-footer">
-                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
-                <button type="button" class="btn btn-primary" id="applySubmit">提交申请</button>
-            </div>
-        </div>
-    </div>
-</div>
-
-<!-- footer end -->
 </body>
+
 <script type="text/javascript" src="static/lib/jquery/jquery.min.js"></script>
 <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
 <script type="text/javascript" src="static/js/common/common.js"></script>

+ 38 - 49
src/main/webapp/resources/js/finance/base.js

@@ -1,70 +1,59 @@
 $(function(){
-    $("#applyLoan").click(function(){
+    $("#applyLoan").click(function () {
         $('#applyModal').modal('toggle');
+        $("#loanAmount").val('');
     })
 
-    $("#applySubmit").click(function(){
-        var product=$("#applyLoan").siblings('h2').text();
-        var loanUserId=$("#loanUserId").val();//uuid
-        var loanName=$("#loanName").val();//姓名
-        var loanTelphone=$("#loanTelphone").val();//手机号
-        var loanCommpanyName=$("#loanCommpanyName").val();//公司名
-        var loanAmount=$("#loanAmount").val();//借款金额
-        var check=$("#check").is(":checked");//是否同意查询银行记录
+    $("#loanSubmit").click(function () {
+        var product = $("#applyLoan").siblings('h2').text();
+        var loanName = $("#loanName").val();//姓名
+        var loanTelphone = $("#loanTelphone").val();//手机号
+        var loanCommpanyName = $("#loanCommpanyName").val();//公司名
+        var loanAmount = $("#loanAmount").val();//借款金额
+        var check = $("#check").is(":checked");//是否同意查询银行记录
         var flag = false;
-        var message="";
-        if(loanUserId==''){
-            message='请先登录';
-        }else if(loanName==''){
-            message='姓名不能为空'
-        }else if(loanTelphone == ''){
-            message = "手机号码不能为空!";
-        }else if(loanTelphone.length !=11){
+        var message = "";
+        if (loanCommpanyName == '') {
+            message = '企业全称不能为空'
+        } else if (loanAmount == '') {
+            message = '借贷金额不能为空';
+        } else if (loanName == '') {
+            message = "联系人不能为空";
+        } else if (loanTelphone == '') {
+            message = "联系方式不能为空!";
+        } else if (loanTelphone.length != 11) {
             message = "请输入有效的手机号码!";
-        }else if(loanCommpanyName==''){
-            message="公司名不能为空";
-        }
-        else if(loanAmount==''){
-            message='借贷金额不能为空';
-        }else if(check!=true){
-            message='请同意查询人民银行征信记录';
+        } else if (check != true) {
+            message = '请同意查询人民银行征信记录';
         } else {
             flag = true;
         }
-        if(!flag){
+        if (!flag) {
             alert(message);
-        }else {
+        } else {
+            var jsonStr = {
+                product: product,
+                name: loanName,
+                telphone: loanTelphone,
+                companyName: loanCommpanyName,
+                amount: loanAmount
+            }
             $.ajax({
-                url: "http://192.168.253.227:8083/loan/save",
+                url: "/finance/loan",
                 type: "post",
                 dataType: "json",
-                data: {
-                    product:product,
-                    userId: loanUserId,
-                    name: loanName,
-                    telphone: loanTelphone,
-                    companyName: loanCommpanyName,
-                    amount: loanAmount
-                },
-                success: function (data) {
-                    alert('已申请');
-                    console.log("success");
-                    $("#loan").css("display", "none");
-                    $("#layer").css({
-                        "display": "none"
-                    })
+                data: {jsonStr: JSON.stringify(jsonStr)},
+                success: function () {
+                    alert('已申请 ');
+                    $('#applyModal').modal('toggle');
+
                 },
                 error: function (XMLHttpRequest) {
-                    alert("跨域请求错误");
-                    checkError(XMLHttpRequest);
-                    $("#loan").css("display", "none");
-                    $("#layer").css({
-                        "display": "none"
-                    })
+                    alert('申请失败');
+                    $('#applyModal').modal('toggle');
                 }
             })
         }
     })
-
 })