蔡德晨 %!s(int64=5) %!d(string=hai) anos
pai
achega
3741575958

+ 1 - 1
src/main/java/com/jeeplus/modules/sg/mapper/xml/JkxlMapper.xml

@@ -92,7 +92,7 @@
          b.total_fee as totalFee
          FROM sg_wbs_elements a LEFT JOIN sg_wbs_fee b on a.short_id = b.wbs_code
          and b.id = #{id}
-         order by short_id
+         order by a.id
 	</select>
 
 

+ 20 - 1
src/main/java/com/jeeplus/modules/sg/web/JkxlController.java

@@ -441,6 +441,7 @@ public class JkxlController extends BaseController {
     double[] qtFees = getQtFees(qt);
     double[] wsbFees = getFees(total);
     int[] zjgcFee = getZjgcFee(gzhz);
+    double texRate = getTexRate(total);
     double totalFee = 0.00;
     List<JkxlData> list = new ArrayList<>();
     int lastRow = importExcel.getLastDataRowNum();
@@ -497,7 +498,7 @@ public class JkxlController extends BaseController {
 //      double measuresFee1 = (rgCost+cbrCost+fbrCost+jxCost)*csRate[0]; //措施费1
       double measuresFee2 = rgCost*csRate[1];   //措施费2
       double fees = rgCost*gfRate[1]*1.12+rgCost*gfRate[0];  //规费
-      double tax = (originalTotalCost+measuresFee1+measuresFee2+fees+otherFee-originalFbrCost)*0.09; //税金
+      double tax = (originalTotalCost+measuresFee1+measuresFee2+fees+otherFee-originalFbrCost)*texRate; //税金
       double totalfee = originalTotalCost+measuresFee1+measuresFee2+fees+otherFee+tax-originalFbrCost; //合计
       jkxlData.setOriginalTotalCost(originalTotalCost);
       jkxlData.setOriginalRate(orRate);
@@ -564,6 +565,24 @@ public class JkxlController extends BaseController {
   }
 
   /**
+   * 读取税率
+   */
+  public double getTexRate(ImportExcel importExcel){
+    double rate = 0.00;
+    int lastRow = importExcel.getLastDataRowNum();
+    for(int i=2;i<lastRow;i++){
+      String st = importExcel.getValue(i+1,1);
+      if(st.contains("税金")){
+        int a = st.indexOf(":");
+        int a1 = st.indexOf("%");
+        String st1 = st.substring(a+2,a1);
+        rate = Double.valueOf(st1)/100;
+      }
+    }
+    return rate;
+   }
+
+  /**
    *获取规费率
    */
   public double[] getGfRate(ImportExcel importExcel) {

+ 2 - 2
src/main/resources/j2cache/j2cache.properties

@@ -88,8 +88,8 @@ redis.cluster_name = j2cache
 redis.namespace = 
 
 ## connection
-#redis.hosts = 192.168.2.4:6379
-redis.hosts = 127.0.0.1:6379
+redis.hosts = 192.168.2.4:6379
+#redis.hosts = 127.0.0.1:6379
 redis.timeout = 2000
 redis.password =
 redis.database = 0

+ 2 - 2
src/main/resources/properties/jeeplus.properties

@@ -14,8 +14,8 @@
 #mysql database setting
 jdbc.type=mysql
 jdbc.driver=com.mysql.jdbc.Driver
-jdbc.url=jdbc:mysql://localhost:3306/guowang?useUnicode=true&characterEncoding=utf-8
-#jdbc.url=jdbc:mysql://192.168.2.4:3306/guowang?useUnicode=true&characterEncoding=utf-8
+#jdbc.url=jdbc:mysql://localhost:3306/guowang?useUnicode=true&characterEncoding=utf-8
+jdbc.url=jdbc:mysql://192.168.2.4:3306/guowang?useUnicode=true&characterEncoding=utf-8
 jdbc.username=root
 jdbc.password=root
 jdbc.testSql=SELECT 'x'

+ 0 - 222
src/main/webapp/webpage/modules/sg/free/alongst.jsp

@@ -1,222 +0,0 @@
-<%--
-  Created by IntelliJ IDEA.
-  User: user
-  Date: 2019/8/11
-  Time: 9:30
-  To change this template use File | Settings | File Templates.
---%>
-<%@ page contentType="text/html;charset=UTF-8" language="java" %>
-<%@ include file="/webpage/include/taglib.jsp"%>
-<html>
-<head>
-    <title>单独调整</title>
-    <link rel="stylesheet" href="${ctxp}/static/plugin/assets/layui/css/layui.css">
-    <link rel="stylesheet" href="${ctxp}/static/plugin/assets/common.css"/>
-    <script type="text/javascript" src="${ctxp}/static/plugin/assets/jquery-3.2.1.min.js"></script>
-    <script src="${ctxp}/static/plugin/assets/layui/layui.js"></script>
-</head>
-<style>
-    .layui-table-view .layui-table {width:100%}
-</style>
-<body>
-<form class="layui-form" action="">
-    <div class="layui-form-item">
-        <div class="" style="margin-left: 10px;margin-top: 10px;">
-            <span id="mylable2">项目调整</span>
-            <span>:</span>
-            <span id="readid2">200</span>
-        </div>
-        <div class="" style="margin-left: 10px;">
-            <input type="radio" name="mydiv" value="1" title="增加">
-            <input type="radio" name="mydiv" value="2" title="减少">
-        </div>
-    </div>
-</form>
-<!--<div>-->
-<table class="layui-hide" id="longtable" lay-filter="longtable"></table>
-<!--</div>-->
-
-<div class="layui-btn-group suretable" style="display: none;">
-    <button class="layui-btn"  data-type="getCheckData" id="freenl">确定</button>
-</div>
-
-<script>
-    layui.use(['table','form','layedit', 'laydate'], function(){
-        var table = layui.table
-            ,form = layui.form;
-        form.render();
-        table.render({
-            elem: '#longtable'
-            ,title: '单独调整页'
-            ,id:'checktable'
-            ,cols: [[
-                {type: 'checkbox'}
-                ,{field:'wbsys',width:100,title:'分布分项'}
-                ,{field:'wbsCode',width:120,title:'WBS识别码'}
-                ,{field:'bl',width:100,title:'比例',edit: 'text'}
-                ,{field:'fee',width:100,title:'分摊金额',edit: 'text'}
-            ]]
-            ,data:[
-                {
-                    "id":"1",
-                    "wbsys": "基础工程",
-                    "wbsCode": "39100000",
-                    "bl":'',
-                    "fee":''
-                },
-                {
-                    "id":"2",
-                    "wbsys": "杆塔工程",
-                    "wbsCode": "39200000",
-                    "bl":'',
-                    "fee":''
-                },
-                {
-                    "id":"3",
-                    "wbsys": "接地工程",
-                    "wbsCode": "39300000",
-                    "bl":'',
-                    "fee":''
-                },
-                {
-                    "id":"4",
-                    "wbsys": "架线工程",
-                    "wbsCode": "39400000",
-                    "bl":'',
-                    "fee":''
-                },
-                {
-                    "id":"5",
-                    "wbsys": "附件安装工程",
-                    "wbsCode": "39500000",
-                    "bl":'',
-                    "fee":''
-                },
-                {
-                    "id":"6",
-                    "wbsys": "辅助工程",
-                    "wbsCode": "39600000",
-                    "bl":'',
-                    "fee":''
-                }
-            ]
-            ,page: false
-        });
-        table.on('edit(longtable)', function(obj){
-
-            var field = obj.field;
-            var moneycount = $("#readid2").text();
-            if(field == 'bl'){
-                var value = obj.value;
-                var data = obj.data;
-                var blvalue = value.substring(0,value.length-1);
-                var ofvalue = value.substring(value.length-1,value.length);
-                if(value==''){
-                    $(this).html(value);
-                    var w = $(this).closest("tr").find("td").eq("4").html();
-                    data.fee="";
-                    return false;
-                }
-                if(isNaN(blvalue)||ofvalue!="%"){
-                    layer.msg('请输入正确的格式(-%-)');
-                    return false;
-                }
-                var bfb = changeTwoDecimal((blvalue/100)* moneycount);
-                $(this).html(value);
-                var w = $(this).closest("tr").find("td").eq("4").html(bfb);
-                data.fee=bfb;
-            }else{
-                var value = obj.value;
-                var data = obj.data;
-                if(value==''){
-                    $(this).html(value);
-                    $(this).closest("tr").find("td").eq("3").html("");
-                    data.bl="";
-                    return false;
-                }
-                if(isNaN(value)){
-                    layer.msg('请输入有效数字');
-                    return false;
-                }
-                var ftf= changeTwoDecimal(value/moneycount);
-//		    	alert(ftf);
-                var bfb2 = (ftf*100)+"%";
-                $(this).html(value);
-                $(this).closest("tr").find("td").eq("3").html(bfb2);
-                data.bl=bfb2;
-            }
-        });
-        var $ = layui.$, active = {
-            getCheckData: function(){ //获取选中数据
-                var checkStatus = table.checkStatus('checktable'),
-                    data = checkStatus.data;
-                var moneycount2 = $("#readid2").text();
-                var val = $('input[name="mydiv"]:checked').val();
-                if(val==null){
-                    layer.msg('请选择操作方式');
-                    return false;
-                }
-                var jsondata=JSON.stringify(data);
-		     // var e= jsondata.stringify(jsondata);
-                var objdata = JSON.parse(jsondata);
-             //    var objdata = JSON.stringify(jsondata);
-
-                var blcount = 0;
-                var feecount = 0;
-                for (var i = 0;i<objdata.length;i++) {
-                    blcount=Number(blcount)+Number(parseFloat(objdata[i].bl.substring(0,objdata[i].bl.length-1)).toFixed(2));
-                    feecount=Number(feecount)+Number(parseFloat(objdata[i].fee).toFixed(2));
-                }
-                if(blcount!=100||feecount!=moneycount2){
-                    layer.msg('比例/金额分配不正确!');
-                    return false;
-                }
-                var newid2 = parent.$('#newid').val();
-                var xmmc2 = parent.$('#xmmc1').val();
-                var fyje2 = parent.$('#fyje1').val();
-
-                $.ajax({
-                    type:"post",
-                    url:"${ctx}/jkxl/ddtz",
-                    // data:JSON.stringify({id:newid2,type:xmmc2,fee:fyje2}),
-                    data:{id:newid2,type:xmmc2,fee:fyje2,data1:jsondata,state:val },
-                    success:function(result){
-                        parent.location.reload();
-                    }
-                });
-            }
-        };
-
-        $('.suretable .layui-btn').on('click', function(){
-            var type = $(this).data('type');
-            active[type] ? active[type].call(this) : '';
-        });
-//		  -----
-        var newid2 = parent.$('#newid').val();
-        var xmmc2 = parent.$('#xmmc1').val();
-        var fyje2 = parent.$('#fyje1').val();
-        $("#mylable2").text(xmmc2);
-        $("#readid2").text(fyje2);
-    });
-</script>
-<script>
-    function changeTwoDecimal(v) {
-//		if (isNaN(v))
-//		return 0;
-//		}
-        var fv = parseFloat(v);
-        fv = Math.round(fv * 100) / 100; //四舍五入,保留两位小数
-        var fs = fv.toString();
-        var fp = fs.indexOf('.');
-        if (fp < 0) {
-            fp = fs.length;
-            fs += '.';
-        }
-        while (fs.length <= fp + 2) { //小数位小于两位,则补0
-            fs += '0';
-        }
-        return fs;
-    }
-</script>
-</body>
-</html>

+ 2 - 2
src/main/webapp/webpage/modules/sg/free/wbslist.jsp

@@ -289,7 +289,7 @@
             layer.open({
                 type: 2,
                 title: '单独调整',
-                area: ['700px', '500px'],
+                area: ['700px', '400px'],
                 shade: 0.8,
 //		  closeBtn: 0,
 //      fixed: true, //不固定
@@ -322,7 +322,7 @@
            layer.open({
                 type: 2,
                 title: xmmc,
-                area: ['400px', '500px'],
+                area: ['400px', '400px'],
                 shade: 0.8,
                 shadeClose: true,
                 content: '${ctxp}/webpage/modules/sg/free/avgpage.jsp'