Bladeren bron

Merge remote-tracking branch 'origin/master'

xs 5 jaren geleden
bovenliggende
commit
b739221a4f

+ 9 - 0
src/main/java/com/jeeplus/modules/sg/entity/JkxlData.java

@@ -6,6 +6,7 @@ public class JkxlData {
     private String id;
     private String wbsCode;
     private Double originalTotalCost;
+    private Double zjgcFee;
     private Double originalRgCost;
     private Double originalCbrCost;
     private Double originalFbrCost;
@@ -148,6 +149,14 @@ public class JkxlData {
         this.originalTotalCost = originalTotalCost;
     }
 
+    public Double getZjgcFee() {
+        return zjgcFee;
+    }
+
+    public void setZjgcFee(Double zjgcFee) {
+        this.zjgcFee = zjgcFee;
+    }
+
     public Double getOriginalRate() {
         return originalRate;
     }

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

@@ -15,6 +15,7 @@ public interface JkxlMapper {
     void save(JkxlData jkxlData);
     void saveProject(WbsProject project);
     List<JkxlData> findList(String id);
+    void updateDate(JkxlData jkxlData);
 
     List<TzData> getTzFee(TzData tzData);
     void updateTzFee(TzData tzData);

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

@@ -29,6 +29,7 @@
          b.other_cost as otherCost,
          b.tex as tex,
          b.fees as fees,
+         b.zjgc_fee as zjgcFee,
          b.total_fee as totalFee,
          b.original_rate as originalRate,
          b.bz_fee as bzFee,
@@ -75,7 +76,8 @@
 		 tex,
 		 total_fee,
 		 bz_fee,
-		 jk_fee
+		 jk_fee,
+		 zjgc_fee
 		) values (
 		 #{id},
 		 #{wbsCode},
@@ -96,7 +98,8 @@
 		 #{tex},
 		 #{totalFee},
 		 #{bzFee},
-		 #{jkFee}
+		 #{jkFee},
+		 #{zjgcFee}
 		)
 	</insert>
 
@@ -112,8 +115,16 @@
 		)
 	</insert>
 
+    <!--<update id="updateData" parameterType="com.jeeplus.modules.sg.entity.WbsProject">-->
+          <!--update sg_wbs_fee set-->
+
+          <!--<where>-->
+              <!--id = #{id} and wbs_code = #{wbsCode}-->
+          <!--</where>-->
+    <!--</update>-->
+
 	<select id="getTzFee" parameterType="com.jeeplus.modules.sg.entity.TzData" resultType="com.jeeplus.modules.sg.entity.TzData">
-		select * from sg_wbs_fee_tz
+		select id,type,fee from sg_wbs_fee_tz
 		<where>
 			<if test="type != null and type != ''">
 				type = #{type} and

+ 5 - 0
src/main/java/com/jeeplus/modules/sg/service/JkxlService.java

@@ -35,6 +35,11 @@ public class JkxlService {
    }
 
     @Transactional
+    public void updataDate(JkxlData jkxlData){
+        jkxlMapper.updateDate(jkxlData);
+    }
+
+    @Transactional
    public void saveProject(WbsProject wbsProject){
        jkxlMapper.saveProject(wbsProject);
    }

+ 9 - 0
src/main/java/com/jeeplus/modules/sg/util/BashInfo.java

@@ -7,6 +7,7 @@ public class BashInfo {
     public static final String SHEET_CSB = "措施项目清单计价表(一)";
     public static final String SHEET_QTFY = "其他项目清单计价表";
     public static final String SHEET_GFQD = "规费项目清单计价表";
+    public static final String SHEET_GCHZ = "架空线路工程费用汇总表";
     public static final String JCGC = "1 基础工程";
     public static final String GTGC = "2 杆塔工程";
     public static final String JDGC = "3 接地工程";
@@ -27,6 +28,14 @@ public class BashInfo {
     public static final String QT_HJ = "合计";
     public static final String BZZSSL = "补增值税税率调整差额";
     public static final String KJJGCC = "扣减甲供材超供材料费";
+    public static final String HZ_JCGC = "基础工程";
+    public static final String HZ_GTGC = "杆塔工程";
+    public static final String HZ_JDGC = "接地工程";
+    public static final String HZ_JXGC = "架线工程";
+    public static final String HZ_FJAZGC = "附件安装工程";
+    public static final String HZ_FZ = "辅助工程";
+
+
     public static final String[] ids = {"39100000","39200000","39300000","39400000","39500000","39600000"};
 
 

+ 55 - 7
src/main/java/com/jeeplus/modules/sg/web/JkxlController.java

@@ -126,15 +126,17 @@ public class JkxlController extends BaseController {
 
 
   public List<JkxlData> getData(MultipartFile file,double[] rate,String id,double sl) throws IOException, InvalidFormatException {
-    ImportExcel importExcel = new ImportExcel(file,1,BashInfo.SHEET_FBFXJJ);
-    ImportExcel csqd = new ImportExcel(file,1,BashInfo.SHEET_CSB);
-    ImportExcel gf = new ImportExcel(file,1,BashInfo.SHEET_GFQD);
-    ImportExcel qt = new ImportExcel(file,1,BashInfo.SHEET_QTFY);
-    ImportExcel total = new ImportExcel(file,1,BashInfo.SHEET_HZB );
+    ImportExcel importExcel = new ImportExcel(file,1,BashInfo.SHEET_FBFXJJ);  //分部分项工程量清单计价表
+    ImportExcel csqd = new ImportExcel(file,1,BashInfo.SHEET_CSB);  // 措施项目清单计价表(一)
+    ImportExcel gf = new ImportExcel(file,1,BashInfo.SHEET_GFQD);  //规费项目清单计价表
+    ImportExcel qt = new ImportExcel(file,1,BashInfo.SHEET_QTFY);  //其他项目清单计价表
+    ImportExcel total = new ImportExcel(file,1,BashInfo.SHEET_HZB );  //工程项目竣工结算汇总表
+    ImportExcel gzhz = new ImportExcel(file,1,BashInfo.SHEET_GCHZ );   //架空线路工程费用汇总表
     double[] csRate = getCsRate(csqd);
     double[] gfRate = getGfRate(gf);
     double[] qtFees = getQtFees(qt);
     double[] wsbFees = getFees(total);
+    int[] zjgcFee = getZjgcFee(gzhz);
     double totalFee = 0.00;
     List<JkxlData> list = new ArrayList<>();
     int lastRow = importExcel.getLastDataRowNum();
@@ -178,6 +180,7 @@ public class JkxlController extends BaseController {
       double btc = wsbFees[0]*orRate;       //补调差额
       double jcl = wsbFees[1]*orRate;        //减材料费
       double otherFee = qtFees[2]*otherRate;  //其他费用
+      double zjgcFees = gzhz.getDouble(zjgcFee[i],3);//直接工程费
       double originalRgCost = importExcel.getDouble(row[i],13); //原人工费
       double rgCost = originalRgCost/(1+rate[0]);  //后人工费
       double originalCbrCost = importExcel.getDouble(row[i],14); //原承包人采购
@@ -186,11 +189,12 @@ public class JkxlController extends BaseController {
       double fbrCost = originalFbrCost/(1+sl); //后发包人采购
       double originalJxrCost = importExcel.getDouble(row[i],17); //原机械费
       double jxCost = originalJxrCost/(1+rate[2]); //后机械费
-      double measuresFee1 = (rgCost+cbrCost+fbrCost+jxCost)*csRate[0]; //措施费1
+      double measuresFee1 = ((zjgcFees-fbrCost)/(1+sl)*sl)*csRate[0]; //措施费1
+//      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)*0.09; //税金
-      double totalfee = originalTotalCost+measuresFee1+measuresFee2+fees+otherFee+tax-originalFbrCost; //合计
+      double totalfee = rgCost+cbrCost+fbrCost+jxCost+measuresFee1+measuresFee2+fees+otherFee+tax-fbrCost; //合计
       jkxlData.setOriginalTotalCost(originalTotalCost);
       jkxlData.setOriginalRate(orRate);
       jkxlData.setOriginalRgCost(originalRgCost);
@@ -209,6 +213,7 @@ public class JkxlController extends BaseController {
       jkxlData.setTotalFee(totalfee);
       jkxlData.setBzFee(btc);
       jkxlData.setJkFee(jcl);
+      jkxlData.setZjgcFee(zjgcFees);
       jkxlData.setWbsCode(BashInfo.ids[i]);
       jkxlData.setId(id);
       list.add(jkxlData);
@@ -228,6 +233,8 @@ public class JkxlController extends BaseController {
   }
 
 
+
+
   /**
    *获取措施费率
    */
@@ -339,12 +346,53 @@ public class JkxlController extends BaseController {
 
   }
 
+  /**
+   *获取直接工程费
+   */
+  public int[] getZjgcFee(ImportExcel importExcel) {
+    int lastRow = importExcel.getLastDataRowNum();
+    int[] row = new int[6];
+    for(int i=0;i<lastRow;i++){
+      String type =  importExcel.getValue(i+1,1);
+      if(type.equals(BashInfo.HZ_JCGC)){
+        row[0] = i+1;
+        continue;
+      }
+      if(type.equals(BashInfo.HZ_GTGC)){
+        row[1] = i+1;
+        continue;
+      }
+      if(type.equals(BashInfo.HZ_JDGC)){
+        row[2] = i+1;
+        continue;
+      }
+      if(type.equals(BashInfo.HZ_JXGC)){
+        row[3] = i+1;
+        continue;
+      }
+      if(type.equals(BashInfo.HZ_FJAZGC)){
+        row[4] = i+1;
+        continue;
+      }
+      if(type.equals(BashInfo.HZ_FZ)){
+        row[5] = i+1;
+        break;
+      }
+    }
+    return  row;
+
+  }
+
+
   public double[] getTzFee(MultipartFile file) throws IOException, InvalidFormatException {
     ImportExcel total = new ImportExcel(file,1,BashInfo.SHEET_HZB );
     double[] wsb = getFees(total);
     return wsb;
   }
 
+    /**
+     * 创建项目ID
+     */
   public String getId() {
      SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMddHHmmss");
      String newDate=sdf.format(new Date());

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

@@ -67,14 +67,15 @@
             </thead>
             <tbody>
             <c:if test="${ not empty map.list2}">
-                <c:forEach items="${map.list2}" var="data" varStatus="index">
+                <c:forEach items="${map.list2}" var="data2" varStatus="index">
             <tr>
-                <td id=""><c:if test="${data.type eq '1'}">补增值税税率调整差额</c:if><c:if test="${data.type eq '2'}">扣减甲供材超供材料费</c:if></td>
-                <td>${data.fee}</td>
+
+                <td id=""><c:if test="${data2.type eq '1'}">补增值税税率调整差额</c:if><c:if test="${data2.type eq '2'}">扣减甲供材超供材料费</c:if></td>
+                <td>${data2.fee}</td>
                 <td>
-                 <c:forEach items="${map.list1}" var="data2" varStatus="index">
-                    <input type="button" class="layui-btn layui-btn-primary layui-btn-xs" value="调整" onclick="wbsup(${data2.id});"/>
-                 </c:forEach>
+                    <%--<input id="type1" hidden value="${data2.type}">--%>
+                    <input id ="id1" hidden value="${data2.id}">
+                    <input type="button" class="layui-btn layui-btn-primary layui-btn-xs" value="调整" onclick="wbsup(${data2.type});"/>
                 </td>
             </tr>
                 </c:forEach>
@@ -305,22 +306,24 @@
     });
 </script>
 <script>
-    function wbsup(id){
+    function wbsup(type){
+        var id = $("#id1").val();
+        // var type = $("#type1").val();
         $.post(
             // type : "post",
             "${ctx}/jkxl/gettz",
             {"id":id},
             function(result) {
                 var trlue="";
-                // if(type === '1') {
-                    for (var i = 0; i <= result.length; i++) {
-                        trlue = trlue + "<tr><td>" + result.describe + "</td><td>" + result.wbsCode + "</td><td>" + result.originalRate + "</td><td>" + result.bzFee + "</td></tr>";
+                if(type == '1') {
+                    for (var i = 0; i < result.length; i++) {
+                        trlue = trlue + "<tr><td>" + result[i].describe + "</td><td>" + result[i].wbsCode + "</td><td>" + result[i].originalRate + "</td><td>" + result[i].bzFee + "</td></tr>";
+                    }
+                } else {
+                    for (var i = 0; i < result.length; i++) {
+                        trlue = trlue + "<tr><td>" + result[i].describe + "</td><td>" + result[i].wbsCode + "</td><td>" + result[i].originalRate + "</td><td>" + result[i].jkFee + "</td></tr>";
                     }
-                // } else {
-                //     for (var i = 0; i <= result.length; i++) {
-                //         trlue = trlue + "<tr><td>" + result.describe + "</td><td>" + result.wbsCode + "</td><td>" + result.originalRate + "</td><td>" + result.jkFee + "</td></tr>";
-                //     }
-                // }
+                }
 
                 trlue=trlue+"<tr><td>合计</td><td></td><td>100%</td><td></td></tr>";
                 $("#mytbody").html(trlue);