蔡德晨 5 gadi atpakaļ
vecāks
revīzija
11092978d9

+ 2 - 2
src/main/java/com/jeeplus/modules/sg/overheadline/mapper/OverheadLineMapper.java

@@ -9,11 +9,11 @@ import java.util.List;
 
 @MyBatisMapper
 public interface OverheadLineMapper {
-    List<JkxlDetailFee> getList(String id);
+    List<JkxlDetailFee> getList(@Param("id") String id,@Param("type") String type);
     JkxlDetailFee getData(@Param("id")String id, @Param("wbsCode")String wbsCode);
     void save(JkxlDetailFee jkxlDetailFee);
     void saveProject(WbsProject project);
-    List<JkxlDetailFee> findList(String id);
+    List<JkxlDetailFee> findList(@Param("id") String id,@Param("type")String type);
     void updateDate(JkxlDetailFee jkxlDetailFee);
     void delete(String id);
 }

+ 6 - 18
src/main/java/com/jeeplus/modules/sg/overheadline/mapper/xml/OverheadLineMapper.xml

@@ -2,7 +2,7 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.jeeplus.modules.sg.overheadline.mapper.OverheadLineMapper">
 
-	<select id="getList" parameterType="String" resultType="com.jeeplus.modules.sg.overheadline.entity.JkxlDetailFee">
+	<select id="getList"  resultType="com.jeeplus.modules.sg.overheadline.entity.JkxlDetailFee">
         SELECT
          a.simple_describe as 'describe',
          a.short_id as wbsCode,
@@ -34,7 +34,7 @@
          FROM sg_wbs_elements a LEFT JOIN sg_fee_detail_jkxl b on a.short_id = b.wbs_code
          and b.id = #{id}
          <where>
-			 a.state = '1' and project_type = '1'
+			 a.state = '1' and project_type = #{type}
 		 </where>
 	</select>
 
@@ -74,7 +74,7 @@
 	</select>
 
 
-	<select id="findList" parameterType="String" resultType="com.jeeplus.modules.sg.overheadline.entity.JkxlDetailFee">
+	<select id="findList"  resultType="com.jeeplus.modules.sg.overheadline.entity.JkxlDetailFee">
 		 SELECT
 		 a.id as wbsId,
          a.project_id as projectId,
@@ -103,7 +103,9 @@
          FROM sg_wbs_elements a LEFT JOIN sg_fee_detail_jkxl b on a.short_id = b.wbs_code
          and b.id = #{id}
          <where>
-			 project_type = '1'
+			 <if test="type != ''">
+			 project_type = #{type}
+			 </if>
 		 </where>
          order by a.id
 	</select>
@@ -210,20 +212,6 @@
 
 
 
-
-
-	<insert id="saveProject" parameterType="com.jeeplus.modules.sg.overheadline.entity.WbsProject">
-		insert into sg_wbs_project
-		(id,
-		 project_name,
-		 create_date
-		) values (
-		 #{id},
-		 #{name},
-		 #{createDate}
-		)
-	</insert>
-
 	<delete id="delete" parameterType="String">
 		delete  from  sg_fee_detail_jkxl
 		<where>

+ 214 - 33
src/main/java/com/jeeplus/modules/sg/overheadline/service/OverheadLineService.java

@@ -10,6 +10,7 @@ import com.jeeplus.modules.sg.overheadline.mapper.OverheadLineMapper;
 import com.jeeplus.modules.sg.overheadline.util.BashInfo;
 import com.jeeplus.modules.sg.project.entity.WbsItem;
 import com.jeeplus.modules.sg.project.service.ItemService;
+import org.apache.commons.lang3.ArrayUtils;
 import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -37,12 +38,12 @@ public class OverheadLineService {
 
 
 
-   public List<JkxlDetailFee> getList(String id){
-       return overheadLineMapper.getList(id);
+   public List<JkxlDetailFee> getList(String id,String type){
+       return overheadLineMapper.getList(id,type);
    }
 
-   public List<JkxlDetailFee> findList(String id){
-       List<JkxlDetailFee> list = overheadLineMapper.findList(id);
+   public List<JkxlDetailFee> findList(String id,String type){
+       List<JkxlDetailFee> list = overheadLineMapper.findList(id,type);
        JkxlAdjustFee jkxlAdjustFee = new JkxlAdjustFee();
        jkxlAdjustFee.setId(id);
        jkxlAdjustFee.setType(BashInfo.CE);
@@ -121,8 +122,9 @@ public class OverheadLineService {
        overheadLineMapper.saveProject(wbsProject);
    }
 
+   //架空线路保存数据
     @Transactional(readOnly = false)
-   public void save(MultipartFile file,String name,String id,String projectId,String type) throws IOException, InvalidFormatException {
+   public void saveJk(MultipartFile file,String name,String id,String projectId,String type) throws IOException, InvalidFormatException {
        WbsItem wbsItem = itemService.get(id);
        if(wbsItem == null){
            WbsItem wbsItem1 = new WbsItem();
@@ -133,7 +135,7 @@ public class OverheadLineService {
            //保存项目
            itemService.save(wbsItem1);
        }
-       List<JkxlDetailFee> jkxlDetailFees = overheadLineMapper.findList(id);
+       List<JkxlDetailFee> jkxlDetailFees = overheadLineMapper.findList(id,type);
        if(jkxlDetailFees != null && jkxlDetailFees.size()>0){
            overheadLineMapper.delete(id);
            feeAdjustService.delete(id);
@@ -231,32 +233,6 @@ public class OverheadLineService {
            tz += jkxlDetailFee.getTotalFee();
        }
        double gxFee = Math.abs(gcjsFee-tz-qtFees[0]-qtFees[1]-wsbFees[0]-wsbFees[1]);
-//       if(gcjsFee>tz){
-//           double gxFee = gcjsFee-tz-qtFees[0]-qtFees[1]-wsbFees[0]-wsbFees[1];
-//           double rate1 = 0.00;
-//           double gxFee1 = 0.00;
-//           double totalF = 0.00;
-//           for(JkxlDetailFee jkxlDetailFee : list){
-//               rate1 = jkxlDetailFee.getTotalFee()/tz;
-//               gxFee1 = gxFee*rate1;
-//               totalF = gxFee1 + jkxlDetailFee.getTotalFee();
-//               jkxlDetailFee.setGxFee(Math.abs(gxFee1));
-//               jkxlDetailFee.setTotalFee(totalF);
-//           }
-//       }else {
-//           double gxFee = tz+qtFees[0]+qtFees[1]+wsbFees[0]+wsbFees[1]-gcjsFee;
-//           double rate1 = 0.00;
-//           double gxFee1 = 0.00;
-//           double totalF = 0.00;
-//           for(JkxlDetailFee jkxlDetailFee : list){
-//               rate1 = jkxlDetailFee.getTotalFee()/tz;
-//               gxFee1 = gxFee*rate1;
-//               totalF = jkxlDetailFee.getTotalFee()-gxFee1;
-//               jkxlDetailFee.setGxFee(Math.abs(gxFee1));
-//               jkxlDetailFee.setTotalFee(totalF);
-//           }
-//
-//       }
        //将其他费用存入集合
        JkxlDetailFee jkxlDetailFee1 = new JkxlDetailFee();
        JkxlDetailFee jkxlDetailFee2 = new JkxlDetailFee();
@@ -297,7 +273,212 @@ public class OverheadLineService {
        }
    }
 
-
+    //电缆线路保存数据
+    @Transactional(readOnly = false)
+    public void saveDl(MultipartFile file,String name,String id,String projectId,String type) throws IOException, InvalidFormatException {
+        WbsItem wbsItem = itemService.get(id);
+        if(wbsItem == null){
+            WbsItem wbsItem1 = new WbsItem();
+            wbsItem1.setProjectId(projectId);
+            wbsItem1.setId(id);
+            wbsItem1.setItemName(name);
+            wbsItem1.setType(type);
+            //保存项目
+            itemService.save(wbsItem1);
+        }
+        List<JkxlDetailFee> jkxlDetailFees = overheadLineMapper.findList(id,type);
+        if(jkxlDetailFees != null && jkxlDetailFees.size()>0){
+            overheadLineMapper.delete(id);
+            feeAdjustService.delete(id);
+            settlementService.delete(id);
+        }
+        //获取调差系数
+        double[] tcRate = new double[3];
+        tcRate[0] = ruleRatioService.getValueByName(BashInfo.RATIO_RGTC).getValue()/100;
+        tcRate[1] = ruleRatioService.getValueByName(BashInfo.RATIO_CLTC).getValue()/100;
+        tcRate[2] = ruleRatioService.getValueByName(BashInfo.RATIO_JXTC).getValue()/100;
+        //读取表格
+        ImportExcel jzqd = new ImportExcel(file,1,BashInfo.SHEET_JZFBFXJJ);  //建筑分部分项工程量清单计价表
+        ImportExcel azqd = new ImportExcel(file,1,BashInfo.SHEET_AZFBFXJJ);  //安装分部分项工程量清单计价表
+        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 jzhz = new ImportExcel(file,1,BashInfo.SHEET_JZHZB );   //电缆线路建筑工程费用汇总表
+        ImportExcel azhz = new ImportExcel(file,1,BashInfo.SHEET_HZHZB );   //电缆线路安装工程费用汇总表
+        ImportExcel fbrcg = new ImportExcel(file,1,BashInfo.SHEET_FBRCG);   //发包人采购材料设备计价表
+//        ImportExcel cbrcgsb = new ImportExcel(file,1,BashInfo.SHEET_FBRCG);   //发包人采购设备计价表
+        //数据核验数据
+//        Map<String,Object[]> builtMap = BashInfo.getCompletionWorks(total);//获取工程项目竣工所有数据
+//        double builtTotal = ExcelUtil.getDouble(gzhz,BashInfo.QT_HJ,0,2);//获取架空线路工程费用汇总表 分部分项 合计
+//        double wordtotal =  ExcelUtil.getDouble(csqd,BashInfo.QT_HJ,0,4);//获取措施费清单计价表
+//        double otherTotal =  ExcelUtil.getDouble(qt,BashInfo.QT_HJ,0,2);//获取其他项目费合计
+//        double cbperson =  ExcelUtil.getDouble(cbrcgsb,BashInfo.SHEET_CBRCG,0,2);//获取其他项目费合计
+//        int[] comlumn2 = {12,14,15};//定义所要数组
+//        double[] divisiontotal=ExcelUtil.getDoubleArray(importExcel,BashInfo.PROJECTNAME,2,comlumn2);//获取分部分项比对数据清单
+//        double feescount =  ExcelUtil.getDouble(gf,BashInfo.QT_HJ,0,4);//获取规费合计
+        //数据核验并保存数据库
+//        settlementService.save(builtMap,builtTotal,divisiontotal,wordtotal,otherTotal,feescount,cbperson,id);
+        //获取补增值税税率调整差额和扣减甲供材超供材料费
+        double wsbFees = ExcelUtil.getDouble(total, BashInfo.KJYJSG,1,2);
+//        double csFee = ExcelUtil.getDouble(gzhz,BashInfo.HZ_CH,1,2);  //措施项目费
+        double[] originalTotalJzFees = ExcelUtil.getDoubleArray(jzhz,BashInfo.HZ_JZ,1,2); //获取建筑合计费
+        double[] originalTotalAzFees = ExcelUtil.getDoubleArray(azhz,BashInfo.HZ_AZ,1,2); //获取安装合计费
+        double[] zjgcJzFees = ExcelUtil.getDoubleArray(jzhz,BashInfo.HZ_JZ,1,3);  //获取建筑直接工程费
+        double[][] zjgcAzFees = ExcelUtil.getDoubleArrays(azhz,BashInfo.HZ_AZ,1,new int[]{3,4});  //获取安装直接工程费和人工费
+        double[][] originalJzFees = ExcelUtil.getDoubleArrays(jzqd,BashInfo.MX_JZ,2, new int[]{13, 14, 15, 17}); //获取建筑原始费用
+        double[][] originalAzFees = ExcelUtil.getDoubleArrays(azqd,BashInfo.MX_AZ,2, new int[]{13, 14, 15, 17}); //获取安装原始费用
+        double texRate = ExcelUtil.getTexRate(total); //获取税率
+        double fbfxFee = ExcelUtil.getDouble(total,BashInfo.JS_FBFX,1,2);  //分部分项工程费
+        double totalJzFee = ExcelUtil.getDouble(jzqd,BashInfo.DLJZ,2,12);  //获取电缆建筑合计金额
+        double totalAzFee = ExcelUtil.getDouble(jzqd,BashInfo.DLAZ,2,12);  //获取电缆安装合计金额
+//        double totalFee = totalJzFee + totalAzFee;
+        double jzcsRate = BashInfo.getJzRate(csqd); //获取建筑措施费率
+        double[] azcsRate = BashInfo.getAzRate(csqd); //获取安装措施费率
+        double[] jzgfRate = BashInfo.getJzGfRate(gf);  //获取建筑规费率
+        double[] azgfRate = BashInfo.getAzGfRate(gf);  //获取安装规费率
+        double[] qtFees = BashInfo.getQtFees(qt);  //获取其他费用
+        double gcjsFee = BashInfo.getGcjsFee(total);  //获取工程结算价
+        double fbrJzFee = ExcelUtil.getDouble(fbrcg,BashInfo.QT_XJ,0,6); //建筑发包人采购计价表合计金额
+        double fbrAzFee = BashInfo.getFbrAzFee(fbrcg);  //安装发包人采购计价表合计金额
+        double zjgcJzTotal = ExcelUtil.getDouble(jzhz,BashInfo.QT_HJ,0,3);//建筑直接工程费合计
+        double zjgcAzTotal = ExcelUtil.getDouble(azhz,BashInfo.QT_HJ,0,3);//安装直接工程费合计
+        double[] aqwmJzFees = ExcelUtil.getDoubleArray(csqd,BashInfo.CS_AQWM,1, new int[]{3, 4});  //建筑安全文明施工费
+        double[] aqwmAzFees = BashInfo.getAqwfAzFee(csqd);  //建筑安全文明施工费
+        double zgJz = zjgcJzTotal-(aqwmJzFees[1]/(aqwmJzFees[0]/100));
+        double zgAz = zjgcAzTotal-(aqwmAzFees[1]/(aqwmAzFees[0]/100));
+        double jxslJz = new BigDecimal(zgJz/(fbrJzFee-zgJz)).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); //建筑进项税率
+        double jxslAz = new BigDecimal(zgAz/(fbrAzFee-zgAz)).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); //安装进项税率
+        //将本体工程费用明细存入集合
+        List<JkxlDetailFee> list = new ArrayList<>();
+        for(int i=0;i<originalTotalJzFees.length;i++){
+            JkxlDetailFee jkxlDetailFee = new JkxlDetailFee();
+            double originalTotalCost = originalTotalJzFees[i]; //原合计
+//            double otherRate = originalTotalCost/totalFee;   //其他费用分摊比例
+//            double orRate = new BigDecimal(otherRate).setScale(4, BigDecimal.ROUND_HALF_UP).doubleValue(); //四舍五入
+            double otherFee = qtFees[2]/fbfxFee*originalTotalCost;  //其他费用
+            double zjgcJzFee = zjgcJzFees[i];//直接工程费
+            double originalRgCost = originalJzFees[i][0];// 原人工费
+            double rgCost = originalRgCost/(1+tcRate[0]);  //后人工费
+            double originalCbrCost = originalJzFees[i][1];  //原承包人采购
+            double cbrCost = originalCbrCost/(1+tcRate[1]);  //后承包人采购
+            double originalFbrCost = originalJzFees[i][2];  //原发包人采购
+            double fbrCost = originalFbrCost/(1+jxslJz); //后发包人采购
+            double originalJxrCost = originalJzFees[i][3];   //原机械费
+            double jxCost = originalJxrCost/(1+tcRate[2]); //后机械费
+            double measuresFee1 = (zjgcJzFee-originalFbrCost)*jzcsRate; //措施费一(2)
+            double measuresFee2 = 0.00;   //措施费一(1)
+            double measuresFee3 = 0.00; //措施费二
+            double fees = (zjgcJzFee-originalFbrCost)*jzgfRate[0]+(zjgcJzFee-originalFbrCost)*jzgfRate[1]*0.2;  //规费
+            double tax = (originalTotalCost+measuresFee1+measuresFee2+measuresFee3+fees+otherFee)*texRate; //税金
+            double totalfee = originalTotalCost+measuresFee1+measuresFee2+measuresFee3+fees+otherFee+tax; //合计
+            jkxlDetailFee.setOriginalTotalCost(originalTotalCost);
+//            jkxlDetailFee.setOriginalRate(orRate);
+            jkxlDetailFee.setOriginalRgCost(originalRgCost);
+            jkxlDetailFee.setRgCost(rgCost);
+            jkxlDetailFee.setOriginalCbrCost(originalCbrCost);
+            jkxlDetailFee.setCbrCost(cbrCost);
+            jkxlDetailFee.setOriginalFbrCost(originalFbrCost);
+            jkxlDetailFee.setFbrCost(fbrCost);
+            jkxlDetailFee.setOriginalJxCost(originalJxrCost);
+            jkxlDetailFee.setJxCost(jxCost);
+            jkxlDetailFee.setMeasuresFee1(measuresFee1);
+            jkxlDetailFee.setMeasuresFee2(measuresFee2);
+            jkxlDetailFee.setMeasuresFee3(measuresFee3);
+            jkxlDetailFee.setFees(fees);
+            jkxlDetailFee.setOtherCost(otherFee);
+            jkxlDetailFee.setTex(tax);
+            jkxlDetailFee.setTotalFee(totalfee);
+            jkxlDetailFee.setZjgcFee(zjgcJzFee);
+            jkxlDetailFee.setWbsCode(BashInfo.JZWBSIDS [i]);
+            jkxlDetailFee.setId(id);
+            list.add(jkxlDetailFee);
+        }
+        for(int i=0;i<originalTotalAzFees.length;i++){
+            JkxlDetailFee jkxlDetailFee = new JkxlDetailFee();
+            double originalTotalCost = originalTotalAzFees[i]; //原合计
+            double otherFee = qtFees[2]/fbfxFee*originalTotalCost;  //其他费用
+            double zjgcAzFee = zjgcAzFees[i][0];//直接工程费
+            double rgAzFee = zjgcAzFees[i][1];//人工费
+            double originalRgCost = originalAzFees[i][0];// 原人工费
+            double rgCost = originalRgCost/(1+tcRate[0]);  //后人工费
+            double originalCbrCost = originalAzFees[i][1];  //原承包人采购
+            double cbrCost = originalCbrCost/(1+tcRate[1]);  //后承包人采购
+            double originalFbrCost = originalAzFees[i][2];  //原发包人采购
+            double fbrCost = originalFbrCost/(1+jxslJz); //后发包人采购
+            double originalJxrCost = originalAzFees[i][3];   //原机械费
+            double jxCost = originalJxrCost/(1+tcRate[2]); //后机械费
+            double measuresFee1 = (zjgcAzFee-originalFbrCost/(1+jxslAz)*jxslAz)*azcsRate[0]+(rgAzFee/(1+tcRate[0])*azcsRate[1]); //措施费一(2)
+            double measuresFee2 = 0.00;   //措施费一(1)
+            double measuresFee3 = 0.00; //措施费二
+            double fees = rgAzFee/(1+tcRate[0])*azgfRate[0]+rgAzFee/(1+tcRate[0])*azgfRate[1]*1.2;  //规费
+            double tax = (originalTotalCost+measuresFee1+measuresFee2+measuresFee3+fees+otherFee)*texRate; //税金
+            double totalfee = originalTotalCost+measuresFee1+measuresFee2+measuresFee3+fees+otherFee+tax; //合计
+            jkxlDetailFee.setOriginalTotalCost(originalTotalCost);
+            jkxlDetailFee.setOriginalRgCost(originalRgCost);
+            jkxlDetailFee.setRgCost(rgCost);
+            jkxlDetailFee.setOriginalCbrCost(originalCbrCost);
+            jkxlDetailFee.setCbrCost(cbrCost);
+            jkxlDetailFee.setOriginalFbrCost(originalFbrCost);
+            jkxlDetailFee.setFbrCost(fbrCost);
+            jkxlDetailFee.setOriginalJxCost(originalJxrCost);
+            jkxlDetailFee.setJxCost(jxCost);
+            jkxlDetailFee.setMeasuresFee1(measuresFee1);
+            jkxlDetailFee.setMeasuresFee2(measuresFee2);
+            jkxlDetailFee.setMeasuresFee3(measuresFee3);
+            jkxlDetailFee.setFees(fees);
+            jkxlDetailFee.setOtherCost(otherFee);
+            jkxlDetailFee.setTex(tax);
+            jkxlDetailFee.setTotalFee(totalfee);
+            jkxlDetailFee.setZjgcFee(zjgcAzFee);
+            jkxlDetailFee.setWbsCode(BashInfo.AZWBSIDS[i]);
+            jkxlDetailFee.setId(id);
+            list.add(jkxlDetailFee);
+        }
+        double tz = 0.00; //总合计金额
+        for(JkxlDetailFee jkxlDetailFee : list){
+            tz += jkxlDetailFee.getTotalFee();
+        }
+        double gxFee = Math.abs(gcjsFee-tz-qtFees[0]-qtFees[1]-wsbFees);
+        //将其他费用存入集合
+        JkxlDetailFee jkxlDetailFee1 = new JkxlDetailFee();
+        JkxlDetailFee jkxlDetailFee2 = new JkxlDetailFee();
+        jkxlDetailFee1.setId(id);
+        jkxlDetailFee1.setWbsCode("44120000");
+        jkxlDetailFee1.setTotalFee(qtFees[0]);
+        jkxlDetailFee2.setWbsCode("44220000");
+        jkxlDetailFee2.setTotalFee(qtFees[1]);
+        jkxlDetailFee2.setId(id);
+        list.add(jkxlDetailFee1);
+        list.add(jkxlDetailFee2);
+        //保存费用明细
+        for(JkxlDetailFee jkxlDetailFee:list){
+            overheadLineMapper.save(jkxlDetailFee);
+        }
+        //保存未识别费用
+        JkxlAdjustFee jkxlAdjustFee = new JkxlAdjustFee();
+        jkxlAdjustFee.setId(id);
+        jkxlAdjustFee.setType(BashInfo.KJYJSG);
+        jkxlAdjustFee.setFee(wsbFees);
+        feeAdjustService.save(jkxlAdjustFee);
+//        JkxlAdjustFee jkxlAdjustFee1 = new JkxlAdjustFee();
+//        jkxlAdjustFee1.setId(id);
+//        jkxlAdjustFee1.setType(BashInfo.KJJGCC);
+//        jkxlAdjustFee1.setFee(wsbFees[1]);
+//        feeAdjustService.save(jkxlAdjustFee1);
+        JkxlAdjustFee jkxlAdjustFee2 = new JkxlAdjustFee();
+        jkxlAdjustFee2.setId(id);
+        jkxlAdjustFee2.setType(BashInfo.CE);
+        jkxlAdjustFee2.setFee(gxFee);
+        feeAdjustService.save(jkxlAdjustFee2);
+//        if(csFee!= 0.00){
+//            JkxlAdjustFee jkxlAdjustFee3 = new JkxlAdjustFee();
+//            jkxlAdjustFee3.setId(id);
+//            jkxlAdjustFee3.setType(BashInfo.HZ_CH);
+//            jkxlAdjustFee3.setFee(csFee);
+//            feeAdjustService.save(jkxlAdjustFee3);
+//        }
+    }
 
 
 }

+ 193 - 3
src/main/java/com/jeeplus/modules/sg/overheadline/util/BashInfo.java

@@ -18,6 +18,10 @@ public class BashInfo {
     public static final String SHEET_GCHZ = "架空线路工程费用汇总表";
     public static final String SHEET_FBRCG = "发包人采购材料设备计价表";
     public static final String SHEET_CBRCG = "承包人采购设备计价表";
+    public static final String SHEET_JZFBFXJJ = "建筑分部分项工程量清单计价表";
+    public static final String SHEET_AZFBFXJJ = "安装分部分项工程量清单计价表";
+    public static final String SHEET_JZHZB = "电缆线路建筑工程费用汇总表";
+    public static final String SHEET_HZHZB = "电缆线路安装工程费用汇总表";
 
     public static final String JCGC = "1 基础工程";
     public static final String GTGC = "2 杆塔工程";
@@ -26,6 +30,16 @@ public class BashInfo {
     public static final String FJAZGC = "5 附件安装工程";
     public static final String FZGC = "6 辅助工程";
 
+    public static final String MX_TSF = "1 土石方";
+    public static final String MX_GZW = "2 构筑物";
+    public static final String MX_FZGC = "3 辅助工程";
+    public static final String MX_DLQ = "1 电缆桥、支架制作安装";
+    public static final String MX_DLFS = "2 电缆敷设";
+    public static final String MX_DLFJ = "3 电缆附件";
+    public static final String MX_DLFH= "电缆防火";
+    public static final String MX_TSJSY = "5 调试及试验";
+    public static final String MX_DLJC = "6 电缆监测(控)系统";
+
     public static final String RATIO_RGTC = "人工调差系数";
     public static final String RATIO_CLTC = "材料调差系数";
     public static final String RATIO_JXTC = "机械调差系数";
@@ -39,12 +53,21 @@ public class BashInfo {
     public static final String QT_SGCDZY = "施工场地租用费";
     public static final String QT_ZBDL = "招标代理";
     public static final String QT_HJ = "合计";
+    public static final String QT_XJ = "小计";
     public static final String BZZSSL = "补增值税税率调整差额";
     public static final String KJJGCC = "扣减甲供材超供材料费";
+    public static final String KJYJSG = "扣夜间施工增加费";
     public static final String GCJS = "工程结算价";
     public static final String TBJG = "竣工结算价合计";
     public static final String TBJG1 = "投标报价";
     public static final String CE = "差额";
+    public static final String CS_JZ = "建筑措施项目";
+    public static final String CS_AZ = "安装措施项目";
+    public static final String GF_AZ = "安装规费项目";
+
+
+    public static final String DLJZ = "电缆建筑";
+    public static final String DLAZ = "电缆安装";
 
     public static final String HZ_JCGC = "基础工程";
     public static final String HZ_GTGC = "杆塔工程";
@@ -54,6 +77,16 @@ public class BashInfo {
     public static final String HZ_FZ = "辅助工程";
     public static final String HZ_CH = "措施项目";
 
+    public static final String HZ_TSF = "土石方";
+    public static final String HZ_GZW = "构筑物";
+    public static final String HZ_FZGC= "辅助工程";
+    public static final String HZ_DLQ = "电缆桥、支架制作安装";
+    public static final String HZ_DLFS = "电缆敷设";
+    public static final String HZ_DLFJ = "电缆附件";
+    public static final String HZ_DLFH= "电缆防火";
+    public static final String HZ_TSJSY = "调试及试验";
+    public static final String HZ_DLJC = "电缆监测(控)系统";
+
 
     public static final String TZ_RGF = "人工费";
     public static final String TZ_CBRCG = "承包分采购";
@@ -94,15 +127,25 @@ public class BashInfo {
 
 
 
-    //主体模块WBSID
+    //架空线路主体模块WBSID
     public static final String[] WBSIDS = {"39100000","39200000","39300000","39400000","39500000","39600000"};
 
     public static final String[] HZ_ALL = {HZ_JCGC,HZ_GTGC,HZ_JDGC,HZ_JXGC,HZ_FJAZGC,HZ_FZ};
     public static final String[] MX_ALL ={JCGC,GTGC,JDGC,JXGC,FJAZGC,FZGC};
 
 
+    //电缆项目
+    public static final String[] JZWBSIDS = {"49110000","49120000","49130000"};
+    public static final String[] AZWBSIDS = {"49310000","49320000","49330000","49340000","49350000","49360000"};
+    public static final String[] HZ_JZ = {HZ_TSF,HZ_GZW,HZ_FZGC};
+    public static final String[] HZ_AZ = {HZ_DLQ,HZ_DLFS,HZ_DLFJ,HZ_DLFH,HZ_TSJSY,HZ_DLJC};
+    public static final String[] MX_JZ = {MX_TSF,MX_GZW,MX_FZGC};
+    public static final String[] MX_AZ = {MX_DLQ,MX_DLFS,MX_DLFJ,MX_DLFH,MX_TSJSY,MX_DLJC};
+
+
+
     /**
-     *获取措施费率
+     *获取架线工程措施费率
      */
     public static double[] getCsRate(ImportExcel importExcel){
         int lastRow = importExcel.getLastDataRowNum();
@@ -126,7 +169,57 @@ public class BashInfo {
     }
 
     /**
-     *获取规费率
+     * 获取电缆建筑工程措施费率
+     */
+     public static double getJzRate(ImportExcel importExcel){
+         int lastRow = importExcel.getLastDataRowNum();
+         double rate = 0.00;
+         for(int i=2;i<lastRow;i++){
+             String type = importExcel.getValue(i+1,1);
+             if(type.equals(CS_AZ)){
+                 break;
+             }
+             rate += importExcel.getDouble(i+1,3);
+         }
+       return rate/100;
+     }
+
+    /**
+     * 获取电缆安装工程措施费率
+     */
+    public static double[] getAzRate(ImportExcel importExcel){
+        int lastRow = importExcel.getLastDataRowNum();
+        int azRow = 0;
+        for(int i=0;i<lastRow;i++){
+            String type = importExcel.getValue(i+1,1);
+            if(type.equals(CS_AZ)){
+                azRow = i+1;
+                break;
+            }
+        }
+        double lsRate = 0.00;
+        double aqRate = 0.00;
+        double totalRate = 0.00;
+        for(int i=azRow;i<lastRow;i++){
+            String type = importExcel.getValue(i+1,1);
+            if(type.equals(CS_LS)){
+                lsRate = importExcel.getDouble(i+1,3);
+            }
+            if(type.equals(CS_AQWM)){
+                aqRate = importExcel.getDouble(i+1,3);
+            }
+            totalRate += importExcel.getDouble(i+1,3);
+        }
+        double[] rate = new double[2];
+        rate[0] = (lsRate+aqRate)/100;
+        rate[1] = (totalRate-lsRate-aqRate)/100;
+        return  rate;
+    }
+
+
+
+    /**
+     *架空线路获取规费率
      */
     public static double[] getGfRate(ImportExcel importExcel) {
         int lastRow = importExcel.getLastDataRowNum();
@@ -148,6 +241,61 @@ public class BashInfo {
     }
 
     /**
+     *电缆建筑获取规费率
+     */
+    public static double[] getJzGfRate(ImportExcel importExcel) {
+        int lastRow = importExcel.getLastDataRowNum();
+        double totalRate = 0.00;
+        double wxzyRate = 0.00;
+        for (int i = 2; i < lastRow; i++) {
+            String type = importExcel.getValue(i + 1, 1);
+            if (type.equals(GF_WXZY)) {
+                wxzyRate = importExcel.getDouble(i + 1, 3);
+            }
+            if (!importExcel.getValue(i + 1, 2).equals("")) {
+                totalRate += importExcel.getDouble(i + 1, 3);
+            }
+            if(type.equals(GF_AZ)){
+                break;
+            }
+        }
+        double[] rate = new double[2];
+        rate[0] = wxzyRate / 100;
+        rate[1] = (totalRate - wxzyRate) / 100;
+        return rate;
+    }
+
+    /**
+     *电缆安装获取规费率
+     */
+    public static double[] getAzGfRate(ImportExcel importExcel) {
+        int lastRow = importExcel.getLastDataRowNum();
+        int azRow = 0;
+        for(int i=0;i<lastRow;i++){
+            String type = importExcel.getValue(i+1,1);
+            if(type.equals(GF_AZ)){
+                azRow = i+1;
+                break;
+            }
+        }
+        double totalRate = 0.00;
+        double wxzyRate = 0.00;
+        for (int i = azRow; i < lastRow; i++) {
+            String type = importExcel.getValue(i + 1, 1);
+            if (type.equals(GF_WXZY)) {
+                wxzyRate = importExcel.getDouble(i + 1, 3);
+            }
+            if (!importExcel.getValue(i + 1, 2).equals("")) {
+                totalRate += importExcel.getDouble(i + 1, 3);
+            }
+        }
+        double[] rate = new double[2];
+        rate[0] = wxzyRate / 100;
+        rate[1] = (totalRate - wxzyRate) / 100;
+        return rate;
+    }
+
+    /**
      * 获取其他费用
      */
     public static double[] getQtFees(ImportExcel importExcel) {
@@ -179,6 +327,48 @@ public class BashInfo {
     }
 
     /**
+     * 获取发包人安装费
+     * @param importExcel
+     * @return
+     */
+    public static double getFbrAzFee(ImportExcel importExcel){
+        int lastRow = importExcel.getLastDataRowNum();
+        double d = 0.00;
+        for(int i=0;i<lastRow;i++){
+            String type = importExcel.getValue(i+1,0);
+            if(type.equals("")){
+                continue;
+            }
+            if(type.equals(QT_XJ)){
+                d = importExcel.getDouble(i+1,6);
+            }
+        }
+        return d;
+    }
+
+
+    public static double[] getAqwfAzFee(ImportExcel importExcel){
+        int lastRow = importExcel.getLastDataRowNum();
+        double d = 0.00;
+        double e = 0.00;
+        for(int i=0;i<lastRow;i++){
+            String type = importExcel.getValue(i+1,1);
+            if(type.equals("")){
+                continue;
+            }
+            if(type.equals(CS_AQWM)){
+                d = importExcel.getDouble(i+1,3);
+                e = importExcel.getDouble(i+1,4);
+            }
+        }
+        double[] r = new double[2];
+        r[0] = d;
+        r[1] = e;
+
+        return r;
+    }
+
+    /**
      * 获取工程结算价
      */
     public static double getGcjsFee(ImportExcel importExcel){

+ 58 - 44
src/main/java/com/jeeplus/modules/sg/overheadline/web/OverheadLineController.java

@@ -12,6 +12,7 @@ import com.jeeplus.modules.sg.overheadline.service.OverheadLineService;
 import com.jeeplus.modules.sg.overheadline.service.RuleRatioService;
 import com.jeeplus.modules.sg.overheadline.service.SettlementService;
 import com.jeeplus.modules.sg.overheadline.util.BashInfo;
+import com.jeeplus.modules.sg.project.entity.WbsItem;
 import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
@@ -52,40 +53,42 @@ public class OverheadLineController extends BaseController {
   /**
    *数据导入
    */
-  @RequestMapping("/import")
-  public String importFile(MultipartFile file, RedirectAttributes redirectAttributes, HttpServletRequest request, Model model) throws IOException, InvalidFormatException {
-    String projectName = request.getParameter("name");     //项目名称
-    String projectId = request.getParameter("projectId");    //工程ID
-    String type = request.getParameter("type");     //工程类型
-    String id = getId();
-    try {
-      //保存数据到数据库
-      overheadLineService.save(file,projectName,id,projectId,type);
-    } catch (RuntimeException e) {
-      addMessage(redirectAttributes, "导入失败,"+e.getMessage());
-      return "redirect:/a/project/list";
-    }   catch (Exception e){
-      addMessage(redirectAttributes, "导入失败");
-      return "redirect:/a/project/list";
-    }
-    addMessage(redirectAttributes, "导入成功");
-    return "redirect:/a/jkxl/list?id="+id;
-  }
+//  @RequestMapping("/import")
+//  public String importFile(MultipartFile file, RedirectAttributes redirectAttributes, HttpServletRequest request, Model model) {
+//    String projectName = request.getParameter("name");     //项目名称
+//    String projectId = request.getParameter("projectId");    //工程ID
+//    String type = request.getParameter("type");     //工程类型
+//    String id = getId();
+//    try {
+//      //保存数据到数据库
+//      overheadLineService.saveJk(file,projectName,id,projectId,type);
+//    } catch (RuntimeException e) {
+//      addMessage(redirectAttributes, "导入失败,"+e.getMessage());
+//      return "redirect:/a/project/list";
+//    }   catch (Exception e){
+//      addMessage(redirectAttributes, "导入失败");
+//      return "redirect:/a/project/list";
+//    }
+//    addMessage(redirectAttributes, "导入成功");
+//    return "redirect:/a/jkxl/list?id="+id;
+//  }
 
 
   @RequestMapping("/list")
   public String list(HttpServletRequest request,Model model){
     String id = request.getParameter("id");
-    JkxlDetailFee jkxlDetailFee = new JkxlDetailFee();
+    String type = request.getParameter("type");
+    WbsItem wbsItem = new WbsItem();
     JkxlAdjustFee jkxlAdjustFee = new JkxlAdjustFee();
-    jkxlDetailFee.setId(id);
+    wbsItem.setId(id);
+    wbsItem.setType(type);
     jkxlAdjustFee.setId(id);
-    List<JkxlDetailFee> list1 = new ArrayList<>();
-    list1.add(jkxlDetailFee);
+    List<WbsItem> list1 = new ArrayList<>();
+    list1.add(wbsItem);
     //查询费用明细
-    List<JkxlDetailFee> list = overheadLineService.getList(id);
+    List<JkxlDetailFee> list = overheadLineService.getList(id,type);
     //求和
-    list.addAll(getTotal(list));
+    list.addAll(getTotal(list,type));
     //查询未识别数据
     List<JkxlAdjustFee> list2 = feeAdjustService.getTzFee(jkxlAdjustFee);
     //数据校验展示
@@ -112,7 +115,7 @@ public class OverheadLineController extends BaseController {
       double fee = ftData.getFee();
       double total = 0.00;
       try {
-        List<JkxlDetailFee> jkxl = overheadLineService.getList(id);
+        List<JkxlDetailFee> jkxl = overheadLineService.getList(id,type);
         //获取本体部分费用明细
         List<JkxlDetailFee> jkxlDetailFees = new ArrayList<>();
         for(JkxlDetailFee jkxlDetailFee : jkxl){
@@ -425,9 +428,10 @@ public class OverheadLineController extends BaseController {
   @RequestMapping("/export")
   public String export(HttpServletRequest request, HttpServletResponse response,Model model,RedirectAttributes redirectAttributes) {
     String id = request.getParameter("id");
+    String type = request.getParameter("type");
     try{
       String fileName = "架空线路"+ DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
-      List<JkxlDetailFee> list = overheadLineService.findList(id);
+      List<JkxlDetailFee> list = overheadLineService.findList(id,type);
       //导出
       new ExportExcel(null, JkxlDetailFee.class).setDataList(list).write(response, fileName).dispose();
       return null;
@@ -435,30 +439,30 @@ public class OverheadLineController extends BaseController {
       addMessage(redirectAttributes, "导出失败");
     }
      addMessage(redirectAttributes, "导出成功");
-    return "redirect:/a/jkxl/list?id="+id;
+    return "redirect:/a/jkxl/list?id="+id+"&type="+type;
   }
 
 
 
-    /**
-     * 创建项目ID
-     */
-  public String getId() {
-     SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMddHHmmss");
-     String newDate=sdf.format(new Date());
-     String result="";
-      Random random=new Random();
-     for(int i=0;i<3;i++){
-       result+=random.nextInt(10);
-     }
-     return newDate+result;
- }
+//    /**
+//     * 创建项目ID
+//     */
+//  public String getId() {
+//     SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMddHHmmss");
+//     String newDate=sdf.format(new Date());
+//     String result="";
+//      Random random=new Random();
+//     for(int i=0;i<3;i++){
+//       result+=random.nextInt(10);
+//     }
+//     return newDate+result;
+// }
 
 
   /**
    *求和
    */
-  private List<JkxlDetailFee> getTotal(List<JkxlDetailFee> list) {
+  private List<JkxlDetailFee> getTotal(List<JkxlDetailFee> list,String type) {
     List<JkxlDetailFee> list1 = new ArrayList<>();
     List<JkxlDetailFee> list2  = new ArrayList<>();
     //获取主体部分list集合
@@ -530,10 +534,20 @@ public class OverheadLineController extends BaseController {
 //    jkxlDetailFee.setGxFee(new BigDecimal(zFee[20]).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
     jkxlDetailFee.setTotalFee(new BigDecimal(NF.format(zFee[21])).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
     jkxlDetailFee.setWbsCode("合计");
-    jkxlDetailFee.setParentNode("30000000");
+    if(type.equals("1")) {
+      jkxlDetailFee.setParentNode("30000000");
+    }
+    if(type.equals("2")) {
+      jkxlDetailFee.setParentNode("40000000");
+    }
     jkxlDetailFee.setFeeType("1");
     jkxlDetailFee1.setWbsCode("合计");
-    jkxlDetailFee1.setParentNode("34000000");
+    if(type.equals("1")) {
+      jkxlDetailFee1.setParentNode("34000000");
+    }
+    if(type.equals("2")) {
+      jkxlDetailFee1.setParentNode("44000000");
+    }
     jkxlDetailFee1.setFeeType("0");
     jkxlDetailFee1.setTotalFee(total1);
     List<JkxlDetailFee> list3 = new ArrayList<>();

+ 50 - 2
src/main/java/com/jeeplus/modules/sg/project/web/ProjectController.java

@@ -11,20 +11,25 @@ import com.jeeplus.modules.sg.project.entity.WbsProject;
 import com.jeeplus.modules.sg.project.entity.WbsSelection;
 import com.jeeplus.modules.sg.project.service.ProjectService;
 import com.jeeplus.modules.sg.project.util.ExportUtil;
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.ModelAttribute;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 import org.springframework.ui.Model;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
+import java.util.Random;
 
 
 @Controller
@@ -92,6 +97,34 @@ public class ProjectController extends BaseController {
         return j;
     }
 
+    /**
+     *数据导入
+     */
+    @RequestMapping("/import")
+    public String importFile(MultipartFile file, RedirectAttributes redirectAttributes, HttpServletRequest request, Model model) {
+        String projectName = request.getParameter("name");     //项目名称
+        String projectId = request.getParameter("projectId");    //工程ID
+        String type = request.getParameter("type");     //工程类型
+        String id = getId();
+        try {
+            //保存数据到数据库
+            if(type.equals("1")) {
+                overheadLineService.saveJk(file, projectName, id, projectId, type);
+            }
+            if (type.equals("2")) {
+                overheadLineService.saveDl(file, projectName, id, projectId, type);
+            }
+        } catch (RuntimeException e) {
+            addMessage(redirectAttributes, "导入失败,"+e.getMessage());
+            return "redirect:/a/project/list";
+        }   catch (Exception e){
+            addMessage(redirectAttributes, "导入失败");
+            return "redirect:/a/project/list";
+        }
+        addMessage(redirectAttributes, "导入成功");
+        return "redirect:/a/jkxl/list?id="+id+"&type="+type;
+    }
+
     //导出
     @RequestMapping("/export")
     public String toList(HttpServletRequest request,Model model,HttpServletResponse response) throws IOException {
@@ -106,14 +139,14 @@ public class ProjectController extends BaseController {
         }
         List<JkxlDetailFee> list = new ArrayList<>();
         for(WbsItem wbsItem :wbsItems){
-            List<JkxlDetailFee> jkxlDetailFees = overheadLineService.findList(wbsItem.getId());
+            List<JkxlDetailFee> jkxlDetailFees = overheadLineService.findList(wbsItem.getId(),wbsItem.getType());
             list.addAll(jkxlDetailFees);
         }
         List<JkxlDetailFee> list1 = getNewList(list);
         ExportUtil exportUtil = new ExportUtil(null, JkxlDetailFee.class,sts);
         exportUtil.setDataList(list1,0);
         for(int j=0;j<wbsItems.size();j++){
-            List<JkxlDetailFee> jkxlDetailFees = overheadLineService.findList(wbsItems.get(j).getId());
+            List<JkxlDetailFee> jkxlDetailFees = overheadLineService.findList(wbsItems.get(j).getId(),wbsItems.get(j).getType());
             exportUtil.setDataList(jkxlDetailFees,j+1);
         }
         exportUtil.write(response,fileName).dispose();
@@ -177,4 +210,19 @@ public class ProjectController extends BaseController {
         return "redirect:/a/project/list";
     }
 
+
+    /**
+     * 创建项目ID
+     */
+    public String getId() {
+        SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMddHHmmss");
+        String newDate=sdf.format(new Date());
+        String result="";
+        Random random=new Random();
+        for(int i=0;i<3;i++){
+            result+=random.nextInt(10);
+        }
+        return newDate+result;
+    }
+
 }

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

@@ -49,7 +49,7 @@
     </fieldset>
     <div class="" style="margin-left: 10px;margin-right: 10px;margin-top: 10px;">
        <c:forEach items="${map.list1}" var="data1" varStatus="index">
-         <a class="layui-btn" href="${ctx}/jkxl/export?id=${data1.id}">导出</a>
+         <a class="layui-btn" href="${ctx}/jkxl/export?id=${data1.id}&type=${data1.type}">导出</a>
            <a class="layui-btn" href="${ctx}/project/tolist">返回</a>
        </c:forEach>
             <%--<table:importExcel url="${ctx}/propertycostreminder/propertyCostReminder/import"></table:importExcel>--%>

+ 2 - 2
src/main/webapp/webpage/modules/sg/project/addItemForm.jsp

@@ -22,7 +22,7 @@
     </style>
 </head>
 <body style="text-align: center;">
-<form id="inputForm"class="layui-form" action="${ctx}/jkxl/import" method="post" enctype="multipart/form-data">
+<form id="inputForm"class="layui-form" action="${ctx}/project/import" method="post" enctype="multipart/form-data">
     <input id="newText1" hidden name="projectId" value=""/>
     <div class="layui-form-item">
         <div class="layui-inline" style="margin-left:30px;margin-top: 10px;">
@@ -39,7 +39,7 @@
                 <select name="type" lay-verify="required" lay-search="">
                     <option value="">请选择</option>
                     <option value="1">架空线路工程</option>
-                    <option value="2">-空-</option>
+                    <option value="2">电缆线路工程</option>
                 </select>
             </div>
         </div>

+ 5 - 4
src/main/webapp/webpage/modules/sg/project/lookItemForm.jsp

@@ -69,7 +69,7 @@
                 ,{field:'xmlx',width:100,title:'项目类型'}
                 ,{field:'op',align:'center',title:"操作",width:100,templet:function(d){
                         ////对操作进行初始化
-                        var xml = "<a class='layui-btn layui-btn-xs' onclick=\"view( '" + d.id + "')\">编辑</a>";
+                        var xml = "<a class='layui-btn layui-btn-xs' onclick=\"view( '" + d.id + "','" + d.type + "')\">编辑</a>";
                         return xml;
                     }}
             ]]
@@ -78,9 +78,10 @@
             <c:forEach items="${data.wbsItems}" var="data1" varStatus="index">
                 {
                     "id":"${data1.id}",
+                    "type":"${data1.type}",
                     "xmmc": "${data1.itemName}",
                     "sgdw": "某施工单位一",
-                    "xmlx":"架空线路"
+                    "xmlx":<c:if test="${data1.type eq '1'}">"架空线路"</c:if><c:if test="${data1.type eq '2'}">"电缆线路"</c:if>
                 },
                 </c:forEach>
                 </c:if>
@@ -99,8 +100,8 @@
     </c:forEach>
 </c:if>
 <script>
-    function view(id) {
-        var url = '${ctx}/jkxl/list?id='+id;
+    function view(id,type) {
+        var url = '${ctx}/jkxl/list?id='+id+'&type='+type;
         parent.location.href=url;
     }
 </script>

+ 4 - 2
src/main/webapp/webpage/modules/sg/project/management.jsp

@@ -211,7 +211,7 @@
                                 xml +="<span class='myspan'>操作</span>";
                             }
                             if(d.status==3){
-                                xml +="<a class='layui-btn layui-btn-xs' href=\"${ctx}/jkxl/list?id="+d.id+"\">编辑</a>";
+                                xml +="<a class='layui-btn layui-btn-xs' href=\"${ctx}/jkxl/list?id="+d.id+"&type="+d.type+"\">编辑</a>";
                             }
 
                             return xml;
@@ -244,9 +244,11 @@
                       <c:forEach items="${item.wbsItems}" var="items" varStatus="index">
                     {
                         "id": "${items.id}",
+                        "type":"${items.type}",
                         "gcmc":"${items.itemName}",
                         "xmsl": "某施工单位一",
-                        "cjsq": "架空线路",
+                        <%--"cjsq": <c:if test="${items.type eq '1'}">"架空线路"</c:if><c:if test="${items.type eq '2'}">"电缆线路"</c:if>,--%>
+                        "cjsq":<c:if test="${items.type eq '1'}">"架空线路"</c:if><c:if test="${items.type eq '2'}">"电缆线路"</c:if>,
                         "djr":"<fmt:formatDate value="${items.createDate}" pattern="yyyy/MM/dd"/>",
                         "status":"3",
                         "pid": "${items.projectId}"

+ 5 - 4
src/main/webapp/webpage/modules/sg/project/updateItemForm.jsp

@@ -81,7 +81,7 @@
                 ,{field:'xmlx',width:100,title:'项目类型'}
                 ,{field:'op',align:'center',title:"操作",width:100,templet:function(d){
                         ////对操作进行初始化
-                        var xml = "<a  class='layui-btn layui-btn-xs'  onclick=\"view( '" + d.id + "')\">编辑</a>";
+                        var xml = "<a  class='layui-btn layui-btn-xs'  onclick=\"view( '" + d.id +",'" + d.type + "')\">编辑</a>";
                         return xml;
                     }}
             ]]
@@ -90,9 +90,10 @@
                <c:forEach items="${data.wbsItems}" var="data1" varStatus="index">
                 {
                     "id":"${data1.id}",
+                    "type":"${data1.type}",
                     "xmmc": "${data1.itemName}",
                     "sgdw": "某施工单位一",
-                    "xmlx":"架空线路"
+                    "xmlx":<c:if test="${data1.type eq '1'}">"架空线路"</c:if><c:if test="${data1.type eq '2'}">"电缆线路"</c:if>
                 },
                 </c:forEach>
                 </c:if>
@@ -120,8 +121,8 @@
             }
         });
     }
-    function view(id) {
-        var url = '${ctx}/jkxl/list?id='+id;
+    function view(id,type) {
+        var url = '${ctx}/jkxl/list?id='+id+'&type='+type;
         parent.location.href=url;
     }
 </script>