user5 4 роки тому
батько
коміт
6959c2b0fd

+ 11 - 0
pom.xml

@@ -995,6 +995,17 @@
             <artifactId>guava</artifactId>
             <version>25.1-jre</version>
         </dependency>
+
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-frontend-jaxws</artifactId>
+            <version>3.1.10</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-transports-http</artifactId>
+            <version>3.1.10</version>
+        </dependency>
     </dependencies>
 
 </project>

+ 9 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/RuralProjectRecordsReported.java

@@ -24,6 +24,7 @@ public class RuralProjectRecordsReported extends ActEntity<RuralProjectRecordsRe
 	public static final String SERIAL_BIZCODE ="1";
 	private WorkContractInfo workContractInfo;		// 合同信息
 	private String projectId;		// 项目id
+	private String projectRecordId;		// 项目编号
 	private List<User> projectLeaders; //项目负责人
 	private String ProjectName;		// 项目名称
 	private String xmFZR;		//项目负责人
@@ -626,4 +627,12 @@ public class RuralProjectRecordsReported extends ActEntity<RuralProjectRecordsRe
 	public void setProvince(String province) {
 		this.province = province;
 	}
+
+	public String getProjectRecordId() {
+		return projectRecordId;
+	}
+
+	public void setProjectRecordId(String projectRecordId) {
+		this.projectRecordId = projectRecordId;
+	}
 }

+ 10 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageService.java

@@ -26,11 +26,13 @@ import com.jeeplus.modules.ruralprojectrecords.entity.ReportedConsultant;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecordsReported;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectReportData;
+import com.jeeplus.modules.ruralprojectrecords.utils.RuralProjectReportedUtil;
 import com.jeeplus.modules.sys.dao.WorkattachmentDao;
 import com.jeeplus.modules.sys.entity.*;
 import com.jeeplus.modules.sys.service.OfficeService;
 import com.jeeplus.modules.sys.utils.DictUtils;
 import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.utils.MapToXmlUtil;
 import com.jeeplus.modules.workactivity.dao.WorkActivityProcessDao;
 import com.jeeplus.modules.workactivity.entity.Activity;
 import com.jeeplus.modules.workactivity.entity.WorkActivityProcess;
@@ -2016,6 +2018,14 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
                         if ("yes".equals(reported.getAct().getFlag())) {
                             notifyRole = "审批通过";
                             workActivityProcess.setIsApproval("1");
+                            //处理上报数据
+                            Map<String,String> map  = RuralProjectReportedUtil.reportedDataManage(reported);
+                            str = MapToXmlUtil.getMapToXML(map);
+                            //进行上报
+                            String client = RuralProjectReportedUtil.client(str);
+                            if(!"Success".equals(client)){
+                                return "上报失败!";
+                            }
                         } else {
                             notifyRole = "调整上报信息";
                             workActivityProcess.setIsApproval("2");

+ 390 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/utils/RuralProjectReportedUtil.java

@@ -0,0 +1,390 @@
+package com.jeeplus.modules.ruralprojectrecords.utils;
+
+import com.google.common.collect.Lists;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.modules.ruralprojectrecords.entity.ReportedConsultant;
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecordsReported;
+import com.jeeplus.modules.sys.entity.MainDictDetail;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.utils.DictUtils;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import org.apache.cxf.endpoint.Client;
+import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
+
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * @author: 大猫
+ * @create: 2020-12-18 10:42
+ **/
+public class RuralProjectReportedUtil {
+
+    /**
+     * 项目上报数据处理(转map)
+     * @param reported
+     * @return
+     */
+    public static Map<String ,String> reportedDataManage(RuralProjectRecordsReported reported){
+        Map<String,String> map = new LinkedHashMap<>();
+        //业务系统项目主键,consulting_project表rowguid字段
+        map.put("Project_Guid",reported.getId());
+        //咨询企业组织机构代码
+        map.put("JiGou_Guid","");
+        //咨询企业唯一标识,省站系统可以查询到
+        map.put("DanWei_Guid","46bc2ef1-5590-461a-8877-fc6c658c9cd1");
+        //项目名称,consulting_project表projectname字段
+        map.put("ProjectName",reported.getProjectName());
+        //项目档案编号,consulting_project表danganno字段
+        map.put("ProjectCode",reported.getProjectRecordId());
+        //工程用途,直接手填
+
+        List<MainDictDetail> PorjectUseList = DictUtils.getMainDictList("PorjectUse");
+        for (MainDictDetail info: PorjectUseList) {
+            if(info.getValue().equals(reported.getPorjectUse())) {
+                map.put("PorjectUse",info.getLabel());
+                break;
+            }
+        }
+        //工程结构,直接手填
+        List<MainDictDetail> PorjectStructList = DictUtils.getMainDictList("PorjectStruct");
+        for (MainDictDetail info: PorjectStructList) {
+            if(info.getValue().equals(reported.getPorjectStruct())) {
+                map.put("PorjectStruct",info.getLabel());
+                break;
+            }
+        }
+        //地上层数,直接手填
+        map.put("FloorUp",reported.getFloorUp().toString());
+        //地下层数,直接手填
+        map.put("FloorDown",reported.getFloorDown().toString());
+        //省份
+        map.put("SuoZaiDi_Sheng",reported.getProvince());
+        //地市
+        map.put("SuoZaiDi_Shi",reported.getCity());
+        //区县
+        map.put("SuoZaiDi_Xian",reported.getCounty());
+        //咨询项目类型,直接手填
+        List<MainDictDetail> ProjectTypeList = DictUtils.getMainDictList("ProjectType");
+        for (MainDictDetail info: ProjectTypeList) {
+            if(info.getValue().equals(reported.getProjectType())) {
+                map.put("ProjectType",info.getLabel());
+                break;
+            }
+        }
+
+        //建筑面积(m2),直接手填
+        map.put("GCGM_Value",reported.getGCGMValue().toString());
+        //计量单位,直接手填
+
+        List<MainDictDetail> GCGMUnitList = DictUtils.getMainDictList("GCGM_Unit");
+        for (MainDictDetail info: GCGMUnitList) {
+            if(info.getValue().equals(reported.getGCGMUnit())) {
+                map.put("GCGM_Unit",info.getLabel());
+                break;
+            }
+        }
+        //投资性质,直接手填
+        List<MainDictDetail> touZiXZList = DictUtils.getMainDictList("TouZiXZ");
+        for (MainDictDetail info: touZiXZList) {
+            if(info.getValue().equals(reported.getTouZiXZ())) {
+                map.put("TouZiXZ",info.getLabel());
+                break;
+            }
+        }
+
+        //咨询标的额(万元)
+        map.put("ZiXunBDE",reported.getZiXunBDE().toString());
+        //其中土建造价(万元)
+        map.put("ZiXunBDE_TJ",reported.getZiXunBDETJ().toString());
+        //其中安装造价(万元)
+        map.put("ZiXunBDE_AZ",reported.getZiXunBDEAZ().toString());
+        //合同估算价(万元)
+        map.put("HeTongJia",reported.getHeTongJia().toString());
+        //送审价(万元)
+        map.put("SongShenJia",reported.getSongShenJia().toString());
+        //审定价(万元)
+        map.put("ShenDingJia",reported.getShenDingJia().toString());
+        //审核增减额(万元)
+        map.put("JingHeJianE",reported.getJingHeJianE().toString());
+        //审核增减率(%)
+        map.put("JingHeJianLv",reported.getJingHeJianLv().toString());
+        //咨询营业收入(万元)
+        map.put("ZiXunShouRu",reported.getZiXunShouRu());
+        //项目合同编号,consulting表contractno字段
+        map.put("ZiXunHTBH",reported.getZiXunHTBH());
+        //报告签发日期,consulting_report表issuredate字段
+        map.put("BaoGaoShuQianFaDate",reported.getBaoGaoShuQianFaDate());
+        //报告号,consulting_report表reportno字段
+        map.put("DangABH",reported.getDangABH());
+        //造价师姓名,直接手填
+        User user = UserUtils.get(reported.getXmFZR());
+        map.put("ProjectFZR",user.getName());
+        //造价师注册证号,直接手填
+        map.put("ZJSZhuCeZH",reported.getZaoJiaShiZhengHao());
+
+        //咨询员
+        List<ReportedConsultant> reportedConsultantList = reported.getReportedConsultantList();
+
+        Iterator iterator = reportedConsultantList.iterator();
+        while (iterator.hasNext()) {
+            ReportedConsultant data = (ReportedConsultant) iterator.next();
+            if (null == data.getId()){
+                iterator.remove();
+            }
+        }
+        //获取填写的咨询员数量
+        Integer count = reportedConsultantList.size();
+        for (int i = 1;i<=count; i++){
+            User ziXunYuaUser = UserUtils.get(reportedConsultantList.get(i-1).getZixunyuan());
+            map.put("ZiXunYuan_"+i,ziXunYuaUser.getName());
+            map.put("ZhuCe_ZiGe_ZH"+i,reportedConsultantList.get(i-1).getZhucezigezhID());
+            map.put("WorkNR_"+i,reportedConsultantList.get(i-1).getWordnr());
+        }
+        //如果咨询员人数小于20人,则进行补齐
+        if(count<20){
+            for (int i = count+1;i<=20; i++){
+                map.put("ZiXunYuan_"+i,"");
+                map.put("ZhuCe_ZiGe_ZH"+i,"");
+                map.put("WorkNR_"+i,"");
+            }
+        }
+
+        //委托单位名称,consulting_project表clientname字段
+        map.put("WeiTuoDW",reported.getWeiTuoDW());
+        //委托单位联系电话
+        map.put("LianXiDH",reported.getLianXiDH());
+        //报告签发日期,consulting_report表issuredate字段
+        map.put("ReportDate",reported.getBaoGaoShuQianFaDate());
+        //上报日期,当天
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        String date = sdf.format(new Date());
+        map.put("UpdateDate",date);
+        //钢材用量
+        map.put("GCYL",reported.getGCYL().toString());
+        //水泥用量
+        map.put("SNYL",reported.getSNYL().toString());
+        //预拌砼用量
+        map.put("YBTYL",reported.getYBTYL().toString());
+        //人工工日用量
+        map.put("RGGRYL",reported.getRGGRYL().toString());
+        //状态,默认0
+        map.put("Status","0");
+        //合同类型
+        List<MainDictDetail> HeTongLeiXingList = DictUtils.getMainDictList("HeTongLeiXing");
+        for (MainDictDetail info: HeTongLeiXingList) {
+            if(info.getValue().equals(reported.getHeTongLeiXing())) {
+                map.put("HeTongLeiXing",info.getLabel());
+                break;
+            }
+        }
+
+        //土建
+        List<MainDictDetail> civilList = DictUtils.getMainDictList("civil_project");
+        String civilStr = getValue(civilList,reported.getTJProjectList());
+        //装饰
+        List<MainDictDetail> zsList = DictUtils.getMainDictList("decorate_project");
+        String zsStr = getValue(zsList,reported.getZSProjectList());
+
+        String tjzsStr = "";
+        //判断土建和装饰是否已选择值
+        if(StringUtils.isNotBlank(civilStr) && StringUtils.isNotBlank(zsStr)){
+            tjzsStr = civilStr+";"+zsStr;
+        }else if(StringUtils.isBlank(civilStr) && StringUtils.isNotBlank(zsStr)){
+            tjzsStr = zsStr;
+        }else if(StringUtils.isNotBlank(civilStr) && StringUtils.isBlank(zsStr)){
+            tjzsStr = civilStr;
+        }
+        //包含内容土建,包含内容装饰
+        map.put("ZxxmNr_TuJianAndZhuangShi",tjzsStr);
+
+        //安装
+        List<MainDictDetail> azList = DictUtils.getMainDictList("install_project");
+        String azStr = getValue(azList,reported.getAZProjectList());
+        //包含内容安装
+        map.put("ZxxmNr_AnZhuang",azStr);
+
+        //市政
+        List<MainDictDetail> szList = DictUtils.getMainDictList("services_project");
+        String szStr = getValue(szList,reported.getSZProjectList());
+        //包含内容市政
+        map.put("ZxxmNr_ShiZheng",szStr);
+
+        //园林
+        List<MainDictDetail> fgList = DictUtils.getMainDictList("park_project");
+        String fgStr = getValue(fgList,reported.getFGYLProjectList());
+        //包含内容仿古园林
+        map.put("ZxxmNr_FangGuYuanLin",fgStr);
+        //其它包含内容
+        map.put("GCTZ11",reported.getQTProjec());
+        return map;
+    }
+
+    /**
+     * 处理多选框内容
+     * @param detailList
+     * @param xmNrList
+     * @return
+     */
+    public static String getValue(List<MainDictDetail> detailList,List<String> xmNrList){
+        List<String> result = Lists.newArrayList();
+        if(xmNrList != null){
+            for (String xmNr: xmNrList) {
+                for (MainDictDetail detail: detailList) {
+                    if(xmNr.equals(detail.getValue())){
+                        result.add(detail.getLabel());
+                    }
+                }
+            }
+            String str = StringUtils.join(result.toArray(), ";");
+            return str;
+        }
+        return "";
+    }
+
+    public static String client(String xml) {
+        try {
+
+            JaxWsDynamicClientFactory factroy = JaxWsDynamicClientFactory.newInstance();
+            //DynamicClientFactory factroy = DynamicClientFactory.newInstance();
+            Client client = factroy.createClient("http://www.jszj.com.cn/SOA12345/UploadExpenseToConstract.asmx?wsdl");
+            Object[] results = client.invoke("InsertZjzxProject", xml);
+            System.out.println("client方式:" + results[0]);
+            return results[0].toString();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    public static void main(String[] args) {
+        try {
+            String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
+                    "<Data>\n" +
+                    "    <DataBody>\n" +
+                    "        <DATA>\n" +
+                    "            <ZiXunXM>\n" +
+                    "                <List>\n" +
+                    "                    <Row>\n" +
+                    "                        <Project_Guid>0f462eaebc9048c98567965dbdf727fa</Project_Guid>\n" +
+                    "                        <JiGou_Guid/>\n" +
+                    "                        <DanWei_Guid>46bc2ef1-5590-461a-8877-fc6c658c9cd1</DanWei_Guid>\n" +
+                    "                        <ProjectName>测试项目1204-03</ProjectName>\n" +
+                    "                        <ProjectCode>2020-咨询-0193</ProjectCode>\n" +
+                    "                        <PorjectUse>电力工程</PorjectUse>\n" +
+                    "                        <PorjectStruct>其他</PorjectStruct>\n" +
+                    "                        <FloorUp>0</FloorUp>\n" +
+                    "                        <FloorDown>0</FloorDown>\n" +
+                    "                        <SuoZaiDi_Sheng>江苏省</SuoZaiDi_Sheng>\n" +
+                    "                        <SuoZaiDi_Shi>苏州</SuoZaiDi_Shi>\n" +
+                    "                        <SuoZaiDi_Xian>太仓</SuoZaiDi_Xian>\n" +
+                    "                        <ProjectType>工程结算审核</ProjectType>\n" +
+                    "                        <GCGM_Value>1000.0</GCGM_Value>\n" +
+                    "                        <GCGM_Unit>项</GCGM_Unit>\n" +
+                    "                        <TouZiXZ>国有投资</TouZiXZ>\n" +
+                    "                        <ZiXunBDE>560.0</ZiXunBDE>\n" +
+                    "                        <ZiXunBDE_TJ>200.0</ZiXunBDE_TJ>\n" +
+                    "                        <ZiXunBDE_AZ>230.0</ZiXunBDE_AZ>\n" +
+                    "                        <HeTongJia>5000.0</HeTongJia>\n" +
+                    "                        <SongShenJia>4000.0</SongShenJia>\n" +
+                    "                        <ShenDingJia>5000.0</ShenDingJia>\n" +
+                    "                        <JingHeJianE>1000.0</JingHeJianE>\n" +
+                    "                        <JingHeJianLv>25.0</JingHeJianLv>\n" +
+                    "                        <ZiXunShouRu>14</ZiXunShouRu>\n" +
+                    "                        <ZiXunHTBH>2020兴光/工程咨询0005</ZiXunHTBH>\n" +
+                    "                        <BaoGaoShuQianFaDate>2020-12-18</BaoGaoShuQianFaDate>\n" +
+                    "                        <DangABH>苏兴咨字【2020】0092</DangABH>\n" +
+                    "                        <ProjectFZR>市场主任</ProjectFZR>\n" +
+                    "                        <ZJSZhuCeZH>KZ157310</ZJSZhuCeZH>\n" +
+                    "                        <ZiXunYuan_1>市场</ZiXunYuan_1>\n" +
+                    "                        <ZhuCe_ZiGe_ZH1>ZS12357</ZhuCe_ZiGe_ZH1>\n" +
+                    "                        <WorkNR_1>审核</WorkNR_1>\n" +
+                    "                        <ZiXunYuan_2/>\n" +
+                    "                        <ZhuCe_ZiGe_ZH2/>\n" +
+                    "                        <WorkNR_2/>\n" +
+                    "                        <ZiXunYuan_3/>\n" +
+                    "                        <ZhuCe_ZiGe_ZH3/>\n" +
+                    "                        <WorkNR_3/>\n" +
+                    "                        <ZiXunYuan_4/>\n" +
+                    "                        <ZhuCe_ZiGe_ZH4/>\n" +
+                    "                        <WorkNR_4/>\n" +
+                    "                        <ZiXunYuan_5/>\n" +
+                    "                        <ZhuCe_ZiGe_ZH5/>\n" +
+                    "                        <WorkNR_5/>\n" +
+                    "                        <ZiXunYuan_6/>\n" +
+                    "                        <ZhuCe_ZiGe_ZH6/>\n" +
+                    "                        <WorkNR_6/>\n" +
+                    "                        <ZiXunYuan_7/>\n" +
+                    "                        <ZhuCe_ZiGe_ZH7/>\n" +
+                    "                        <WorkNR_7/>\n" +
+                    "                        <ZiXunYuan_8/>\n" +
+                    "                        <ZhuCe_ZiGe_ZH8/>\n" +
+                    "                        <WorkNR_8/>\n" +
+                    "                        <ZiXunYuan_9/>\n" +
+                    "                        <ZhuCe_ZiGe_ZH9/>\n" +
+                    "                        <WorkNR_9/>\n" +
+                    "                        <ZiXunYuan_10/>\n" +
+                    "                        <ZhuCe_ZiGe_ZH10/>\n" +
+                    "                        <WorkNR_10/>\n" +
+                    "                        <ZiXunYuan_11/>\n" +
+                    "                        <ZhuCe_ZiGe_ZH11/>\n" +
+                    "                        <WorkNR_11/>\n" +
+                    "                        <ZiXunYuan_12/>\n" +
+                    "                        <ZhuCe_ZiGe_ZH12/>\n" +
+                    "                        <WorkNR_12/>\n" +
+                    "                        <ZiXunYuan_13/>\n" +
+                    "                        <ZhuCe_ZiGe_ZH13/>\n" +
+                    "                        <WorkNR_13/>\n" +
+                    "                        <ZiXunYuan_14/>\n" +
+                    "                        <ZhuCe_ZiGe_ZH14/>\n" +
+                    "                        <WorkNR_14/>\n" +
+                    "                        <ZiXunYuan_15/>\n" +
+                    "                        <ZhuCe_ZiGe_ZH15/>\n" +
+                    "                        <WorkNR_15/>\n" +
+                    "                        <ZiXunYuan_16/>\n" +
+                    "                        <ZhuCe_ZiGe_ZH16/>\n" +
+                    "                        <WorkNR_16/>\n" +
+                    "                        <ZiXunYuan_17/>\n" +
+                    "                        <ZhuCe_ZiGe_ZH17/>\n" +
+                    "                        <WorkNR_17/>\n" +
+                    "                        <ZiXunYuan_18/>\n" +
+                    "                        <ZhuCe_ZiGe_ZH18/>\n" +
+                    "                        <WorkNR_18/>\n" +
+                    "                        <ZiXunYuan_19/>\n" +
+                    "                        <ZhuCe_ZiGe_ZH19/>\n" +
+                    "                        <WorkNR_19/>\n" +
+                    "                        <ZiXunYuan_20/>\n" +
+                    "                        <ZhuCe_ZiGe_ZH20/>\n" +
+                    "                        <WorkNR_20/>\n" +
+                    "                        <WeiTuoDW>委托施工1125-01</WeiTuoDW>\n" +
+                    "                        <LianXiDH>025-8805213</LianXiDH>\n" +
+                    "                        <ReportDate>2020-12-18</ReportDate>\n" +
+                    "                        <UpdateDate>2020-12-18</UpdateDate>\n" +
+                    "                        <GCYL>0.0</GCYL>\n" +
+                    "                        <SNYL>0.0</SNYL>\n" +
+                    "                        <YBTYL>0.0</YBTYL>\n" +
+                    "                        <RGGRYL>1100.0</RGGRYL>\n" +
+                    "                        <Status>0</Status>\n" +
+                    "                        <HeTongLeiXing>造价咨询合同</HeTongLeiXing>\n" +
+                    "                        <ZxxmNr_TuJianAndZhuangShi>主体结构工程;外墙饰面(不含幕墙);门窗工程</ZxxmNr_TuJianAndZhuangShi>\n" +
+                    "                        <ZxxmNr_AnZhuang>通讯与智能化工程</ZxxmNr_AnZhuang>\n" +
+                    "                        <ZxxmNr_ShiZheng>防洪堤挡土墙</ZxxmNr_ShiZheng>\n" +
+                    "                        <ZxxmNr_FangGuYuanLin/>\n" +
+                    "                        <GCTZ11>其他专业工程咨询项目造价包含内容说明</GCTZ11>\n" +
+                    "                    </Row>\n" +
+                    "                </List>\n" +
+                    "            </ZiXunXM>\n" +
+                    "        </DATA>\n" +
+                    "    </DataBody>\n" +
+                    "</Data>\n";
+            JaxWsDynamicClientFactory factroy = JaxWsDynamicClientFactory.newInstance();
+            //DynamicClientFactory factroy = DynamicClientFactory.newInstance();
+            Client client = factroy.createClient("http://www.jszj.com.cn/SOA12345/UploadExpenseToConstract.asmx?wsdl");
+            Object[] results = client.invoke("InsertZjzxProject", xml);
+            System.out.println("client方式:" + results[0]);
+            System.out.println(results[0]);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}

+ 70 - 0
src/main/java/com/jeeplus/modules/utils/MapToXmlUtil.java

@@ -0,0 +1,70 @@
+package com.jeeplus.modules.utils;
+
+import org.dom4j.Document;
+import org.dom4j.io.OutputFormat;
+import org.dom4j.io.SAXReader;
+import org.dom4j.io.XMLWriter;
+
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * Map转Xml文件工具类
+ * @author: 大猫
+ * @create: 2020-12-18 10:37
+ **/
+public class MapToXmlUtil {
+
+    /**
+     * 格式化xml,显示为容易看的XML格式
+     * @param xml 需要格式化的xml字符串
+     * @return
+     */
+    public static String formatXML(String xml) {
+        String requestXML = null;
+        try {
+            // 拿取解析器
+            SAXReader reader = new SAXReader();
+            Document document = reader.read(new StringReader(xml));
+            if (null != document) {
+                StringWriter stringWriter = new StringWriter();
+                // 格式化,每一级前的空格
+                OutputFormat format = new OutputFormat("    ", true);
+                // xml声明与内容是否添加空行
+                format.setNewLineAfterDeclaration(false);
+                // 是否设置xml声明头部
+                format.setSuppressDeclaration(false);
+                // 是否分行
+                format.setNewlines(true);
+                XMLWriter writer = new XMLWriter(stringWriter, format);
+                writer.write(document);
+                writer.flush();
+                writer.close();
+                requestXML = stringWriter.getBuffer().toString();
+            }
+            return requestXML;
+        } catch (Exception e) {
+            return e.getMessage();
+        }
+    }
+
+    public  static String getMapToXML(Map<String, String> map){
+        StringBuilder xml = new StringBuilder();
+        xml.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
+        xml.append("<Data>").append("<DataBody>").append("<DATA>")
+                .append("<ZiXunXM>").append("<List>").append("<Row>");
+        Iterator iterator = map.entrySet().iterator();
+        while (iterator.hasNext()){
+            Map.Entry<String, String> entry = (Map.Entry<String, String>) iterator.next();
+            String key = entry.getKey();
+            String value = entry.getValue();
+            xml.append("<").append(key).append(">").append(value).append("</").append(key).append(">");
+        }
+        xml.append("</Row>").append("</List>").append("</ZiXunXM>")
+                .append("</DATA>").append("</DataBody>").append("</Data>");
+        String xmlStr = xml.toString();
+        return formatXML(xmlStr);
+    }
+}

+ 2 - 0
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsReported.xml

@@ -73,10 +73,12 @@
 		,pra.name as "city"
 		,pra2.name as "county"
 		,pra3.name as "province"
+		,rpr.project_id as "projectRecordId"
 		FROM rural_project_records_reported a
 		left join project_reported_area pra on a.s2 = pra.id
 		left join project_reported_area pra2 on a.s3 = pra2.id
 		left join project_reported_area pra3 on a.s1 = pra3.id
+		left join rural_project_records rpr on a.id = rpr.id
 		WHERE a.id = #{id}
 	</select>
 

+ 76 - 19
src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/reportedAudit.jsp

@@ -46,13 +46,30 @@
                 if(ZiXunBDE!= undefined && ZiXunBDE!= '' && ZiXunBDE>=500){
                     //人工工日用量
                     var RGGRYL = $("#RGGRYL").val();
+                    var GCGMValue = $("#GCGMValue").val();
                     if(RGGRYL== undefined || RGGRYL== null || RGGRYL == '' || RGGRYL == 0){
                         parent.layer.msg("咨询标的额大于500万,请填写人工工日用量!", {icon: 5});
                         return false;
                     }
+                    if(GCGMValue== undefined || GCGMValue== null || GCGMValue == '' || GCGMValue == 0){
+                        parent.layer.msg("咨询标的额大于500万,建筑面积回魔必须大于0!", {icon: 5});
+                        return false;
+                    }
+                }
+                //咨询营业收入
+                var ZiXunShouRu = $("#ZiXunShouRu").val();
+                //审定价
+                var ShenDingJia = $("#ShenDingJia").val();
+                if(parseFloat(ZiXunShouRu) >= parseFloat(ShenDingJia)){
+                    parent.layer.msg("咨询营业收入金额应小于审定价!", {icon: 5});
+                    return false;
                 }
                 var list = [];
                 var size = $("#reportedConsultantList tr").length;
+                if(size>20){
+                    parent.layer.msg("咨询员数量不得超过20人!", {icon: 5});
+                    return false;
+                }
                 if(size>0){
                     for (var i = 1;i<=50;i++){
                         var zixunyuan = $("#reportedConsultantList"+i+"_zixunyuanId").val();
@@ -85,6 +102,12 @@
                     return false;
                 }
 
+                var checkedCount = $('input[type=checkbox]:checked').length;
+                if(checkedCount == 0){
+                    parent.layer.msg("请选择咨询项目造价包含内容说明!", {icon: 5});
+                    return false;
+                }
+
                 if(obj == 1){
                     $('#flag').val('yes');
                 }else{
@@ -153,6 +176,22 @@
                 $("#RGGRYLPerUnit").val(0);
             }
 
+            //送审价
+            var SongShenJia = $("#SongShenJia").val();
+            //审定价
+            var ShenDingJia = $("#ShenDingJia").val();
+            if(SongShenJia !='' && ShenDingJia != ''){
+                //审核增减额
+                var JingHeJianE = parseFloat(ShenDingJia) - parseFloat(SongShenJia);
+                $("#JingHeJianE").val(JingHeJianE);
+                //审核增减率
+                var JingHeJianLv =(parseFloat(ShenDingJia) - parseFloat(SongShenJia)) * 100 / parseFloat(SongShenJia);
+                $("#JingHeJianLv").val(JingHeJianLv);
+            }else{
+                $("#JingHeJianE").val('');
+                $("#JingHeJianLv").val('');
+            }
+
             laydate.render({
                 elem: '#BaoGaoShuQianFaDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                 event: 'focus', //响应事件。如果没有传入event,则按照默认的click
@@ -190,21 +229,21 @@
             if(ZiXunBDE != ''){
                 //判断土建造价的值
                 if(ZiXunBDETJ != ''){
-                    var CalTJPercent = (Math.round(parseInt(ZiXunBDETJ) / parseInt(ZiXunBDE) * 100) / 100 * 100).toFixed(2);
+                    var CalTJPercent = (Math.round(parseFloat(ZiXunBDETJ) / parseFloat(ZiXunBDE) * 100) / 100 * 100).toFixed(2);
                     $("#CalTJPercent").val(CalTJPercent);
                 }else{
                     $("#CalTJPercent").val('');
                 }
                 //判断土建造价的值
                 if(ZiXunBDEAZ != ''){
-                    var CalAZPercent = (Math.round(parseInt(ZiXunBDEAZ) / parseInt(ZiXunBDE) * 100) / 100 * 100).toFixed(2);
+                    var CalAZPercent = (Math.round(parseFloat(ZiXunBDEAZ) / parseFloat(ZiXunBDE) * 100) / 100 * 100).toFixed(2);
                     $("#CalAZPercent").val(CalAZPercent);
                 }else{
                     $("#CalAZPercent").val('');
                 }
                 //判断建筑面积或规模
                 if(GCGMValue != ''){
-                    var CalZZJUnit = (Math.round(parseInt(ZiXunBDE) / parseInt(GCGMValue) * 100) * 100).toFixed(2);
+                    var CalZZJUnit = (Math.round(parseFloat(ZiXunBDE) / parseFloat(GCGMValue) * 100) * 100).toFixed(2);
                     $("#CalZZJUnit").val(CalZZJUnit);
                 }else{
                     $("#CalZZJUnit").val('');
@@ -214,42 +253,42 @@
             if(GCGMValue != ''){
                 //判断土建造价
                 if(ZiXunBDETJ != ''){
-                    var CalZZJTJUnit = (Math.round(parseInt(ZiXunBDETJ) / parseInt(GCGMValue) * 100) * 100).toFixed(2);
+                    var CalZZJTJUnit = (Math.round(parseFloat(ZiXunBDETJ) / parseFloat(GCGMValue) * 100) * 100).toFixed(2);
                     $("#CalZZJTJUnit").val(CalZZJTJUnit);
                 }else{
                     $("#CalZZJTJUnit").val('');
                 }
                 //判断安装造价
                 if(ZiXunBDEAZ != ''){
-                    var CalZZJAZUnit = (Math.round(parseInt(ZiXunBDEAZ) / parseInt(GCGMValue) * 100) * 100).toFixed(2);
+                    var CalZZJAZUnit = (Math.round(parseFloat(ZiXunBDEAZ) / parseFloat(GCGMValue) * 100) * 100).toFixed(2);
                     $("#CalZZJAZUnit").val(CalZZJAZUnit);
                 }else{
                     $("#CalZZJAZUnit").val('');
                 }
                 //判断钢材用量
                 if(GCYL != ''){
-                    var GCYLPerUnit = (Math.round(parseInt(GCYL) / parseInt(GCGMValue) * 100) * 10).toFixed(2);
+                    var GCYLPerUnit = (Math.round(parseFloat(GCYL) / parseFloat(GCGMValue) * 100) * 10).toFixed(2);
                     $("#GCYLPerUnit").val(GCYLPerUnit);
                 }else{
                     $("#GCYLPerUnit").val('');
                 }
                 //判断水泥用量
                 if(SNYL != ''){
-                    var SNYLPerUnit = (Math.round(parseInt(SNYL) / parseInt(GCGMValue) * 100) * 10).toFixed(2);
+                    var SNYLPerUnit = (Math.round(parseFloat(SNYL) / parseFloat(GCGMValue) * 100) * 10).toFixed(2);
                     $("#SNYLPerUnit").val(SNYLPerUnit);
                 }else{
                     $("#SNYLPerUnit").val('');
                 }
                 //判断预拌砼用量
                 if(YBTYL != ''){
-                    var YBTYLPerUnit = Math.round(parseInt(YBTYL) / parseInt(GCGMValue)).toFixed(2);
+                    var YBTYLPerUnit = Math.round(parseFloat(YBTYL) / parseFloat(GCGMValue)).toFixed(2);
                     $("#YBTYLPerUnit").val(YBTYLPerUnit);
                 }else{
                     $("#YBTYLPerUnit").val('');
                 }
                 //判断人工工日用量
                 if(RGGRYL != ''){
-                    var RGGRYLPerUnit = Math.round(parseInt(RGGRYL) / parseInt(GCGMValue)).toFixed(2);
+                    var RGGRYLPerUnit = Math.round(parseFloat(RGGRYL) / parseFloat(GCGMValue)).toFixed(2);
                     $("#RGGRYLPerUnit").val(RGGRYLPerUnit);
                 }else{
                     $("#RGGRYLPerUnit").val('');
@@ -259,14 +298,14 @@
             if(ZiXunBDETJ !=''){
                 //判断咨询标的额
                 if(ZiXunBDE != ''){
-                    var CalTJPercent = (Math.round(parseInt(ZiXunBDETJ) / parseInt(ZiXunBDE) * 100) / 100 * 100).toFixed(2);
+                    var CalTJPercent = (Math.round(parseFloat(ZiXunBDETJ) / parseFloat(ZiXunBDE) * 100) / 100 * 100).toFixed(2);
                     $("#CalTJPercent").val(CalTJPercent);
                 }else{
                     $("#CalTJPercent").val('');
                 }
                 //判断建筑面积或规模
                 if(GCGMValue != ''){
-                    var CalZZJTJUnit = (Math.round(parseInt(ZiXunBDETJ) / parseInt(GCGMValue) * 100) * 100).toFixed(2);
+                    var CalZZJTJUnit = (Math.round(parseFloat(ZiXunBDETJ) / parseFloat(GCGMValue) * 100) * 100).toFixed(2);
                     $("#CalZZJTJUnit").val(CalZZJTJUnit);
                 }else{
                     $("#CalZZJTJUnit").val('');
@@ -276,14 +315,14 @@
             if(ZiXunBDEAZ !=''){
                 //判断咨询标的额
                 if(ZiXunBDE != ''){
-                    var CalAZPercent = (Math.round(parseInt(ZiXunBDEAZ) / parseInt(ZiXunBDE) * 100) / 100 * 100).toFixed(2);
+                    var CalAZPercent = (Math.round(parseFloat(ZiXunBDEAZ) / parseFloat(ZiXunBDE) * 100) / 100 * 100).toFixed(2);
                     $("#CalAZPercent").val(CalAZPercent);
                 }else{
                     $("#CalAZPercent").val('');
                 }
                 //判断建筑面积或规模
                 if(GCGMValue != ''){
-                    var CalZZJAZUnit = (Math.round(parseInt(ZiXunBDEAZ) / parseInt(GCGMValue) * 100) * 100).toFixed(2);
+                    var CalZZJAZUnit = (Math.round(parseFloat(ZiXunBDEAZ) / parseFloat(GCGMValue) * 100) * 100).toFixed(2);
                     $("#CalZZJAZUnit").val(CalZZJAZUnit);
                 }else{
                     $("#CalZZJAZUnit").val('');
@@ -293,7 +332,7 @@
             if(GCYL !=''){
                 //判断建筑面积或规模
                 if(GCGMValue != ''){
-                    var GCYLPerUnit = (Math.round(parseInt(GCYL) / parseInt(GCGMValue) * 100) * 10).toFixed(2);
+                    var GCYLPerUnit = (Math.round(parseFloat(GCYL) / parseFloat(GCGMValue) * 100) * 10).toFixed(2);
                     $("#GCYLPerUnit").val(GCYLPerUnit);
                 }else{
                     $("#GCYLPerUnit").val('');
@@ -303,7 +342,7 @@
             if(SNYL !=''){
                 //判断建筑面积或规模
                 if(GCGMValue != ''){
-                    var SNYLPerUnit = (Math.round(parseInt(SNYL) / parseInt(GCGMValue) * 100) * 10).toFixed(2);
+                    var SNYLPerUnit = (Math.round(parseFloat(SNYL) / parseFloat(GCGMValue) * 100) * 10).toFixed(2);
                     $("#SNYLPerUnit").val(SNYLPerUnit);
                 }else{
                     $("#SNYLPerUnit").val('');
@@ -313,7 +352,7 @@
             if(YBTYL !=''){
                 //判断建筑面积或规模
                 if(GCGMValue != ''){
-                    var YBTYLPerUnit = (Math.round(parseInt(YBTYL) / parseInt(GCGMValue) * 100) * 10).toFixed(2);
+                    var YBTYLPerUnit = (Math.round(parseFloat(YBTYL) / parseFloat(GCGMValue) * 100) * 10).toFixed(2);
                     $("#YBTYLPerUnit").val(YBTYLPerUnit);
                 }else{
                     $("#YBTYLPerUnit").val('');
@@ -323,7 +362,7 @@
             if(RGGRYL !=''){
                 //判断建筑面积或规模
                 if(GCGMValue != ''){
-                    var RGGRYLPerUnit = Math.round(parseInt(RGGRYL) / parseInt(GCGMValue)).toFixed(2);
+                    var RGGRYLPerUnit = Math.round(parseFloat(RGGRYL) / parseFloat(GCGMValue)).toFixed(2);
                     $("#RGGRYLPerUnit").val(RGGRYLPerUnit);
                 }else{
                     $("#RGGRYLPerUnit").val('');
@@ -331,6 +370,24 @@
             }
         }
 
+        function JingHeJianValue() {
+            //送审价
+            var SongShenJia = $("#SongShenJia").val();
+            //审定价
+            var ShenDingJia = $("#ShenDingJia").val();
+            if(SongShenJia !='' && ShenDingJia != ''){
+                //审核增减额
+                var JingHeJianE = parseFloat(ShenDingJia) - parseFloat(SongShenJia);
+                $("#JingHeJianE").val(JingHeJianE);
+                //审核增减率
+                var JingHeJianLv =(parseFloat(ShenDingJia) - parseFloat(SongShenJia)) * 100 / parseFloat(SongShenJia);
+                $("#JingHeJianLv").val(JingHeJianLv);
+            }else{
+                $("#JingHeJianE").val('');
+                $("#JingHeJianLv").val('');
+            }
+        }
+
         function addRow(list, idx, tpl, row){
             // var idx1 = $("#workClientLinkmanList tr").length;
             idx +=1;
@@ -714,13 +771,13 @@
                 <div class="layui-item layui-col-sm6 lw6">
                     <label class="layui-form-label"><span class="require-item">*</span>送审价(元):</label>
                     <div class="layui-input-block with-icon">
-                        <form:input path="SongShenJia" htmlEscape="false"  class="form-control required layui-input number"/>
+                        <form:input path="SongShenJia" htmlEscape="false"  class="form-control required layui-input number" onchange="JingHeJianValue()"/>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6 lw6">
                     <label class="layui-form-label"><span class="require-item">*</span>审定价(元):</label>
                     <div class="layui-input-block with-icon">
-                        <form:input path="ShenDingJia" htmlEscape="false"  class="form-control required layui-input number"/>
+                        <form:input path="ShenDingJia" htmlEscape="false"  class="form-control required layui-input number" onchange="JingHeJianValue()"/>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6 lw6">

+ 78 - 19
src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/reportedForm.jsp

@@ -46,13 +46,30 @@
                 if(ZiXunBDE!= undefined && ZiXunBDE!= '' && ZiXunBDE>=500){
                     //人工工日用量
                     var RGGRYL = $("#RGGRYL").val();
+                    var GCGMValue = $("#GCGMValue").val();
                     if(RGGRYL== undefined || RGGRYL== null || RGGRYL == '' || RGGRYL == 0){
                         parent.layer.msg("咨询标的额大于500万,请填写人工工日用量!", {icon: 5});
                         return false;
                     }
+                    if(GCGMValue== undefined || GCGMValue== null || GCGMValue == '' || GCGMValue == 0){
+                        parent.layer.msg("咨询标的额大于500万,建筑面积回魔必须大于0!", {icon: 5});
+                        return false;
+                    }
+                }
+                //咨询营业收入
+                var ZiXunShouRu = $("#ZiXunShouRu").val();
+                //审定价
+                var ShenDingJia = $("#ShenDingJia").val();
+                if(parseFloat(ZiXunShouRu) >= parseFloat(ShenDingJia)){
+                    parent.layer.msg("咨询营业收入金额应小于审定价!", {icon: 5});
+                    return false;
                 }
                 var list = [];
                 var size = $("#reportedConsultantList tr").length;
+                if(size>20){
+                    parent.layer.msg("咨询员数量不得超过20人!", {icon: 5});
+                    return false;
+                }
                 if(size>0){
                     for (var i = 1;i<=50;i++){
                         var zixunyuan = $("#reportedConsultantList"+i+"_zixunyuanId").val();
@@ -84,6 +101,14 @@
                     parent.layer.msg("请选择工程所在区县!", {icon: 5});
                     return false;
                 }
+
+                var checkedCount = $('input[type=checkbox]:checked').length;
+                if(checkedCount == 0){
+                    parent.layer.msg("请选择咨询项目造价包含内容说明!", {icon: 5});
+                    return false;
+                }
+
+
                 $("#inputForm").submit();
                 return true;
             }else{
@@ -147,6 +172,22 @@
                 $("#RGGRYLPerUnit").val(0);
             }
 
+            //送审价
+            var SongShenJia = $("#SongShenJia").val();
+            //审定价
+            var ShenDingJia = $("#ShenDingJia").val();
+            if(SongShenJia !='' && ShenDingJia != ''){
+                //审核增减额
+                var JingHeJianE = parseFloat(ShenDingJia) - parseFloat(SongShenJia);
+                $("#JingHeJianE").val(JingHeJianE);
+                //审核增减率
+                var JingHeJianLv =(parseFloat(ShenDingJia) - parseFloat(SongShenJia)) * 100 / parseFloat(SongShenJia);
+                $("#JingHeJianLv").val(JingHeJianLv);
+            }else{
+                $("#JingHeJianE").val('');
+                $("#JingHeJianLv").val('');
+            }
+
             laydate.render({
                 elem: '#BaoGaoShuQianFaDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                 event: 'focus', //响应事件。如果没有传入event,则按照默认的click
@@ -184,21 +225,21 @@
             if(ZiXunBDE != ''){
                 //判断土建造价的值
                 if(ZiXunBDETJ != ''){
-                    var CalTJPercent = (Math.round(parseInt(ZiXunBDETJ) / parseInt(ZiXunBDE) * 100) / 100 * 100).toFixed(2);
+                    var CalTJPercent = (Math.round(parseFloat(ZiXunBDETJ) / parseFloat(ZiXunBDE) * 100) / 100 * 100).toFixed(2);
                     $("#CalTJPercent").val(CalTJPercent);
                 }else{
                     $("#CalTJPercent").val('');
                 }
                 //判断土建造价的值
                 if(ZiXunBDEAZ != ''){
-                    var CalAZPercent = (Math.round(parseInt(ZiXunBDEAZ) / parseInt(ZiXunBDE) * 100) / 100 * 100).toFixed(2);
+                    var CalAZPercent = (Math.round(parseFloat(ZiXunBDEAZ) / parseFloat(ZiXunBDE) * 100) / 100 * 100).toFixed(2);
                     $("#CalAZPercent").val(CalAZPercent);
                 }else{
                     $("#CalAZPercent").val('');
                 }
                 //判断建筑面积或规模
                 if(GCGMValue != ''){
-                    var CalZZJUnit = (Math.round(parseInt(ZiXunBDE) / parseInt(GCGMValue) * 100) * 100).toFixed(2);
+                    var CalZZJUnit = (Math.round(parseFloat(ZiXunBDE) / parseFloat(GCGMValue) * 100) * 100).toFixed(2);
                     $("#CalZZJUnit").val(CalZZJUnit);
                 }else{
                     $("#CalZZJUnit").val('');
@@ -208,42 +249,42 @@
             if(GCGMValue != ''){
                 //判断土建造价
                 if(ZiXunBDETJ != ''){
-                    var CalZZJTJUnit = (Math.round(parseInt(ZiXunBDETJ) / parseInt(GCGMValue) * 100) * 100).toFixed(2);
+                    var CalZZJTJUnit = (Math.round(parseFloat(ZiXunBDETJ) / parseFloat(GCGMValue) * 100) * 100).toFixed(2);
                     $("#CalZZJTJUnit").val(CalZZJTJUnit);
                 }else{
                     $("#CalZZJTJUnit").val('');
                 }
                 //判断安装造价
                 if(ZiXunBDEAZ != ''){
-                    var CalZZJAZUnit = (Math.round(parseInt(ZiXunBDEAZ) / parseInt(GCGMValue) * 100) * 100).toFixed(2);
+                    var CalZZJAZUnit = (Math.round(parseFloat(ZiXunBDEAZ) / parseFloat(GCGMValue) * 100) * 100).toFixed(2);
                     $("#CalZZJAZUnit").val(CalZZJAZUnit);
                 }else{
                     $("#CalZZJAZUnit").val('');
                 }
                 //判断钢材用量
                 if(GCYL != ''){
-                    var GCYLPerUnit = (Math.round(parseInt(GCYL) / parseInt(GCGMValue) * 100) * 10).toFixed(2);
+                    var GCYLPerUnit = (Math.round(parseFloat(GCYL) / parseFloat(GCGMValue) * 100) * 10).toFixed(2);
                     $("#GCYLPerUnit").val(GCYLPerUnit);
                 }else{
                     $("#GCYLPerUnit").val('');
                 }
                 //判断水泥用量
                 if(SNYL != ''){
-                    var SNYLPerUnit = (Math.round(parseInt(SNYL) / parseInt(GCGMValue) * 100) * 10).toFixed(2);
+                    var SNYLPerUnit = (Math.round(parseFloat(SNYL) / parseFloat(GCGMValue) * 100) * 10).toFixed(2);
                     $("#SNYLPerUnit").val(SNYLPerUnit);
                 }else{
                     $("#SNYLPerUnit").val('');
                 }
                 //判断预拌砼用量
                 if(YBTYL != ''){
-                    var YBTYLPerUnit = Math.round(parseInt(YBTYL) / parseInt(GCGMValue)).toFixed(2);
+                    var YBTYLPerUnit = Math.round(parseFloat(YBTYL) / parseFloat(GCGMValue)).toFixed(2);
                     $("#YBTYLPerUnit").val(YBTYLPerUnit);
                 }else{
                     $("#YBTYLPerUnit").val('');
                 }
                 //判断人工工日用量
                 if(RGGRYL != ''){
-                    var RGGRYLPerUnit = Math.round(parseInt(RGGRYL) / parseInt(GCGMValue)).toFixed(2);
+                    var RGGRYLPerUnit = Math.round(parseFloat(RGGRYL) / parseFloat(GCGMValue)).toFixed(2);
                     $("#RGGRYLPerUnit").val(RGGRYLPerUnit);
                 }else{
                     $("#RGGRYLPerUnit").val('');
@@ -253,14 +294,14 @@
             if(ZiXunBDETJ !=''){
                 //判断咨询标的额
                 if(ZiXunBDE != ''){
-                    var CalTJPercent = (Math.round(parseInt(ZiXunBDETJ) / parseInt(ZiXunBDE) * 100) / 100 * 100).toFixed(2);
+                    var CalTJPercent = (Math.round(parseFloat(ZiXunBDETJ) / parseFloat(ZiXunBDE) * 100) / 100 * 100).toFixed(2);
                     $("#CalTJPercent").val(CalTJPercent);
                 }else{
                     $("#CalTJPercent").val('');
                 }
                 //判断建筑面积或规模
                 if(GCGMValue != ''){
-                    var CalZZJTJUnit = (Math.round(parseInt(ZiXunBDETJ) / parseInt(GCGMValue) * 100) * 100).toFixed(2);
+                    var CalZZJTJUnit = (Math.round(parseFloat(ZiXunBDETJ) / parseFloat(GCGMValue) * 100) * 100).toFixed(2);
                     $("#CalZZJTJUnit").val(CalZZJTJUnit);
                 }else{
                     $("#CalZZJTJUnit").val('');
@@ -270,14 +311,14 @@
             if(ZiXunBDEAZ !=''){
                 //判断咨询标的额
                 if(ZiXunBDE != ''){
-                    var CalAZPercent = (Math.round(parseInt(ZiXunBDEAZ) / parseInt(ZiXunBDE) * 100) / 100 * 100).toFixed(2);
+                    var CalAZPercent = (Math.round(parseFloat(ZiXunBDEAZ) / parseFloat(ZiXunBDE) * 100) / 100 * 100).toFixed(2);
                     $("#CalAZPercent").val(CalAZPercent);
                 }else{
                     $("#CalAZPercent").val('');
                 }
                 //判断建筑面积或规模
                 if(GCGMValue != ''){
-                    var CalZZJAZUnit = (Math.round(parseInt(ZiXunBDEAZ) / parseInt(GCGMValue) * 100) * 100).toFixed(2);
+                    var CalZZJAZUnit = (Math.round(parseFloat(ZiXunBDEAZ) / parseFloat(GCGMValue) * 100) * 100).toFixed(2);
                     $("#CalZZJAZUnit").val(CalZZJAZUnit);
                 }else{
                     $("#CalZZJAZUnit").val('');
@@ -287,7 +328,7 @@
             if(GCYL !=''){
                 //判断建筑面积或规模
                 if(GCGMValue != ''){
-                    var GCYLPerUnit = (Math.round(parseInt(GCYL) / parseInt(GCGMValue) * 100) * 10).toFixed(2);
+                    var GCYLPerUnit = (Math.round(parseFloat(GCYL) / parseFloat(GCGMValue) * 100) * 10).toFixed(2);
                     $("#GCYLPerUnit").val(GCYLPerUnit);
                 }else{
                     $("#GCYLPerUnit").val('');
@@ -297,7 +338,7 @@
             if(SNYL !=''){
                 //判断建筑面积或规模
                 if(GCGMValue != ''){
-                    var SNYLPerUnit = (Math.round(parseInt(SNYL) / parseInt(GCGMValue) * 100) * 10).toFixed(2);
+                    var SNYLPerUnit = (Math.round(parseFloat(SNYL) / parseFloat(GCGMValue) * 100) * 10).toFixed(2);
                     $("#SNYLPerUnit").val(SNYLPerUnit);
                 }else{
                     $("#SNYLPerUnit").val('');
@@ -307,7 +348,7 @@
             if(YBTYL !=''){
                 //判断建筑面积或规模
                 if(GCGMValue != ''){
-                    var YBTYLPerUnit = (Math.round(parseInt(YBTYL) / parseInt(GCGMValue) * 100) * 10).toFixed(2);
+                    var YBTYLPerUnit = (Math.round(parseFloat(YBTYL) / parseFloat(GCGMValue) * 100) * 10).toFixed(2);
                     $("#YBTYLPerUnit").val(YBTYLPerUnit);
                 }else{
                     $("#YBTYLPerUnit").val('');
@@ -317,7 +358,7 @@
             if(RGGRYL !=''){
                 //判断建筑面积或规模
                 if(GCGMValue != ''){
-                    var RGGRYLPerUnit = Math.round(parseInt(RGGRYL) / parseInt(GCGMValue)).toFixed(2);
+                    var RGGRYLPerUnit = Math.round(parseFloat(RGGRYL) / parseFloat(GCGMValue)).toFixed(2);
                     $("#RGGRYLPerUnit").val(RGGRYLPerUnit);
                 }else{
                     $("#RGGRYLPerUnit").val('');
@@ -325,6 +366,24 @@
             }
         }
 
+        function JingHeJianValue() {
+            //送审价
+            var SongShenJia = $("#SongShenJia").val();
+            //审定价
+            var ShenDingJia = $("#ShenDingJia").val();
+            if(SongShenJia !='' && ShenDingJia != ''){
+                //审核增减额
+                var JingHeJianE = parseFloat(ShenDingJia) - parseFloat(SongShenJia);
+                $("#JingHeJianE").val(JingHeJianE);
+                //审核增减率
+                var JingHeJianLv =(parseFloat(ShenDingJia) - parseFloat(SongShenJia)) * 100 / parseFloat(SongShenJia);
+                $("#JingHeJianLv").val(JingHeJianLv);
+            }else{
+                $("#JingHeJianE").val('');
+                $("#JingHeJianLv").val('');
+            }
+        }
+
         function addRow(list, idx, tpl, row){
             // var idx1 = $("#workClientLinkmanList tr").length;
             idx +=1;
@@ -700,13 +759,13 @@
                 <div class="layui-item layui-col-sm6 lw6">
                     <label class="layui-form-label"><span class="require-item">*</span>送审价(元):</label>
                     <div class="layui-input-block with-icon">
-                        <form:input path="SongShenJia" htmlEscape="false"  class="form-control required layui-input number"/>
+                        <form:input path="SongShenJia" htmlEscape="false"  class="form-control required layui-input number" onchange="JingHeJianValue()"/>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6 lw6">
                     <label class="layui-form-label"><span class="require-item">*</span>审定价(元):</label>
                     <div class="layui-input-block with-icon">
-                        <form:input path="ShenDingJia" htmlEscape="false"  class="form-control required layui-input number"/>
+                        <form:input path="ShenDingJia" htmlEscape="false"  class="form-control required layui-input number" onchange="JingHeJianValue()"/>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6 lw6">

+ 76 - 19
src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/reportedModify.jsp

@@ -46,13 +46,30 @@
                 if(ZiXunBDE!= undefined && ZiXunBDE!= '' && ZiXunBDE>=500){
                     //人工工日用量
                     var RGGRYL = $("#RGGRYL").val();
+                    var GCGMValue = $("#GCGMValue").val();
                     if(RGGRYL== undefined || RGGRYL== null || RGGRYL == '' || RGGRYL == 0){
                         parent.layer.msg("咨询标的额大于500万,请填写人工工日用量!", {icon: 5});
                         return false;
                     }
+                    if(GCGMValue== undefined || GCGMValue== null || GCGMValue == '' || GCGMValue == 0){
+                        parent.layer.msg("咨询标的额大于500万,建筑面积回魔必须大于0!", {icon: 5});
+                        return false;
+                    }
+                }
+                //咨询营业收入
+                var ZiXunShouRu = $("#ZiXunShouRu").val();
+                //审定价
+                var ShenDingJia = $("#ShenDingJia").val();
+                if(parseFloat(ZiXunShouRu) >= parseFloat(ShenDingJia)){
+                    parent.layer.msg("咨询营业收入金额应小于审定价!", {icon: 5});
+                    return false;
                 }
                 var list = [];
                 var size = $("#reportedConsultantList tr").length;
+                if(size>20){
+                    parent.layer.msg("咨询员数量不得超过20人!", {icon: 5});
+                    return false;
+                }
                 if(size>0){
                     for (var i = 1;i<=50;i++){
                         var zixunyuan = $("#reportedConsultantList"+i+"_zixunyuanId").val();
@@ -84,6 +101,12 @@
                     parent.layer.msg("请选择工程所在区县!", {icon: 5});
                     return false;
                 }
+
+                var checkedCount = $('input[type=checkbox]:checked').length;
+                if(checkedCount == 0){
+                    parent.layer.msg("请选择咨询项目造价包含内容说明!", {icon: 5});
+                    return false;
+                }
                 $("#inputForm").submit();
                 return true;
             }else{
@@ -147,6 +170,22 @@
                 $("#RGGRYLPerUnit").val(0);
             }
 
+            //送审价
+            var SongShenJia = $("#SongShenJia").val();
+            //审定价
+            var ShenDingJia = $("#ShenDingJia").val();
+            if(SongShenJia !='' && ShenDingJia != ''){
+                //审核增减额
+                var JingHeJianE = parseFloat(ShenDingJia) - parseFloat(SongShenJia);
+                $("#JingHeJianE").val(JingHeJianE);
+                //审核增减率
+                var JingHeJianLv =(parseFloat(ShenDingJia) - parseFloat(SongShenJia)) * 100 / parseFloat(SongShenJia);
+                $("#JingHeJianLv").val(JingHeJianLv);
+            }else{
+                $("#JingHeJianE").val('');
+                $("#JingHeJianLv").val('');
+            }
+
             laydate.render({
                 elem: '#BaoGaoShuQianFaDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                 event: 'focus', //响应事件。如果没有传入event,则按照默认的click
@@ -184,21 +223,21 @@
             if(ZiXunBDE != ''){
                 //判断土建造价的值
                 if(ZiXunBDETJ != ''){
-                    var CalTJPercent = (Math.round(parseInt(ZiXunBDETJ) / parseInt(ZiXunBDE) * 100) / 100 * 100).toFixed(2);
+                    var CalTJPercent = (Math.round(parseFloat(ZiXunBDETJ) / parseFloat(ZiXunBDE) * 100) / 100 * 100).toFixed(2);
                     $("#CalTJPercent").val(CalTJPercent);
                 }else{
                     $("#CalTJPercent").val('');
                 }
                 //判断土建造价的值
                 if(ZiXunBDEAZ != ''){
-                    var CalAZPercent = (Math.round(parseInt(ZiXunBDEAZ) / parseInt(ZiXunBDE) * 100) / 100 * 100).toFixed(2);
+                    var CalAZPercent = (Math.round(parseFloat(ZiXunBDEAZ) / parseFloat(ZiXunBDE) * 100) / 100 * 100).toFixed(2);
                     $("#CalAZPercent").val(CalAZPercent);
                 }else{
                     $("#CalAZPercent").val('');
                 }
                 //判断建筑面积或规模
                 if(GCGMValue != ''){
-                    var CalZZJUnit = (Math.round(parseInt(ZiXunBDE) / parseInt(GCGMValue) * 100) * 100).toFixed(2);
+                    var CalZZJUnit = (Math.round(parseFloat(ZiXunBDE) / parseFloat(GCGMValue) * 100) * 100).toFixed(2);
                     $("#CalZZJUnit").val(CalZZJUnit);
                 }else{
                     $("#CalZZJUnit").val('');
@@ -208,42 +247,42 @@
             if(GCGMValue != ''){
                 //判断土建造价
                 if(ZiXunBDETJ != ''){
-                    var CalZZJTJUnit = (Math.round(parseInt(ZiXunBDETJ) / parseInt(GCGMValue) * 100) * 100).toFixed(2);
+                    var CalZZJTJUnit = (Math.round(parseFloat(ZiXunBDETJ) / parseFloat(GCGMValue) * 100) * 100).toFixed(2);
                     $("#CalZZJTJUnit").val(CalZZJTJUnit);
                 }else{
                     $("#CalZZJTJUnit").val('');
                 }
                 //判断安装造价
                 if(ZiXunBDEAZ != ''){
-                    var CalZZJAZUnit = (Math.round(parseInt(ZiXunBDEAZ) / parseInt(GCGMValue) * 100) * 100).toFixed(2);
+                    var CalZZJAZUnit = (Math.round(parseFloat(ZiXunBDEAZ) / parseFloat(GCGMValue) * 100) * 100).toFixed(2);
                     $("#CalZZJAZUnit").val(CalZZJAZUnit);
                 }else{
                     $("#CalZZJAZUnit").val('');
                 }
                 //判断钢材用量
                 if(GCYL != ''){
-                    var GCYLPerUnit = (Math.round(parseInt(GCYL) / parseInt(GCGMValue) * 100) * 10).toFixed(2);
+                    var GCYLPerUnit = (Math.round(parseFloat(GCYL) / parseFloat(GCGMValue) * 100) * 10).toFixed(2);
                     $("#GCYLPerUnit").val(GCYLPerUnit);
                 }else{
                     $("#GCYLPerUnit").val('');
                 }
                 //判断水泥用量
                 if(SNYL != ''){
-                    var SNYLPerUnit = (Math.round(parseInt(SNYL) / parseInt(GCGMValue) * 100) * 10).toFixed(2);
+                    var SNYLPerUnit = (Math.round(parseFloat(SNYL) / parseFloat(GCGMValue) * 100) * 10).toFixed(2);
                     $("#SNYLPerUnit").val(SNYLPerUnit);
                 }else{
                     $("#SNYLPerUnit").val('');
                 }
                 //判断预拌砼用量
                 if(YBTYL != ''){
-                    var YBTYLPerUnit = Math.round(parseInt(YBTYL) / parseInt(GCGMValue)).toFixed(2);
+                    var YBTYLPerUnit = Math.round(parseFloat(YBTYL) / parseFloat(GCGMValue)).toFixed(2);
                     $("#YBTYLPerUnit").val(YBTYLPerUnit);
                 }else{
                     $("#YBTYLPerUnit").val('');
                 }
                 //判断人工工日用量
                 if(RGGRYL != ''){
-                    var RGGRYLPerUnit = Math.round(parseInt(RGGRYL) / parseInt(GCGMValue)).toFixed(2);
+                    var RGGRYLPerUnit = Math.round(parseFloat(RGGRYL) / parseFloat(GCGMValue)).toFixed(2);
                     $("#RGGRYLPerUnit").val(RGGRYLPerUnit);
                 }else{
                     $("#RGGRYLPerUnit").val('');
@@ -253,14 +292,14 @@
             if(ZiXunBDETJ !=''){
                 //判断咨询标的额
                 if(ZiXunBDE != ''){
-                    var CalTJPercent = (Math.round(parseInt(ZiXunBDETJ) / parseInt(ZiXunBDE) * 100) / 100 * 100).toFixed(2);
+                    var CalTJPercent = (Math.round(parseFloat(ZiXunBDETJ) / parseFloat(ZiXunBDE) * 100) / 100 * 100).toFixed(2);
                     $("#CalTJPercent").val(CalTJPercent);
                 }else{
                     $("#CalTJPercent").val('');
                 }
                 //判断建筑面积或规模
                 if(GCGMValue != ''){
-                    var CalZZJTJUnit = (Math.round(parseInt(ZiXunBDETJ) / parseInt(GCGMValue) * 100) * 100).toFixed(2);
+                    var CalZZJTJUnit = (Math.round(parseFloat(ZiXunBDETJ) / parseFloat(GCGMValue) * 100) * 100).toFixed(2);
                     $("#CalZZJTJUnit").val(CalZZJTJUnit);
                 }else{
                     $("#CalZZJTJUnit").val('');
@@ -270,14 +309,14 @@
             if(ZiXunBDEAZ !=''){
                 //判断咨询标的额
                 if(ZiXunBDE != ''){
-                    var CalAZPercent = (Math.round(parseInt(ZiXunBDEAZ) / parseInt(ZiXunBDE) * 100) / 100 * 100).toFixed(2);
+                    var CalAZPercent = (Math.round(parseFloat(ZiXunBDEAZ) / parseFloat(ZiXunBDE) * 100) / 100 * 100).toFixed(2);
                     $("#CalAZPercent").val(CalAZPercent);
                 }else{
                     $("#CalAZPercent").val('');
                 }
                 //判断建筑面积或规模
                 if(GCGMValue != ''){
-                    var CalZZJAZUnit = (Math.round(parseInt(ZiXunBDEAZ) / parseInt(GCGMValue) * 100) * 100).toFixed(2);
+                    var CalZZJAZUnit = (Math.round(parseFloat(ZiXunBDEAZ) / parseFloat(GCGMValue) * 100) * 100).toFixed(2);
                     $("#CalZZJAZUnit").val(CalZZJAZUnit);
                 }else{
                     $("#CalZZJAZUnit").val('');
@@ -287,7 +326,7 @@
             if(GCYL !=''){
                 //判断建筑面积或规模
                 if(GCGMValue != ''){
-                    var GCYLPerUnit = (Math.round(parseInt(GCYL) / parseInt(GCGMValue) * 100) * 10).toFixed(2);
+                    var GCYLPerUnit = (Math.round(parseFloat(GCYL) / parseFloat(GCGMValue) * 100) * 10).toFixed(2);
                     $("#GCYLPerUnit").val(GCYLPerUnit);
                 }else{
                     $("#GCYLPerUnit").val('');
@@ -297,7 +336,7 @@
             if(SNYL !=''){
                 //判断建筑面积或规模
                 if(GCGMValue != ''){
-                    var SNYLPerUnit = (Math.round(parseInt(SNYL) / parseInt(GCGMValue) * 100) * 10).toFixed(2);
+                    var SNYLPerUnit = (Math.round(parseFloat(SNYL) / parseFloat(GCGMValue) * 100) * 10).toFixed(2);
                     $("#SNYLPerUnit").val(SNYLPerUnit);
                 }else{
                     $("#SNYLPerUnit").val('');
@@ -307,7 +346,7 @@
             if(YBTYL !=''){
                 //判断建筑面积或规模
                 if(GCGMValue != ''){
-                    var YBTYLPerUnit = (Math.round(parseInt(YBTYL) / parseInt(GCGMValue) * 100) * 10).toFixed(2);
+                    var YBTYLPerUnit = (Math.round(parseFloat(YBTYL) / parseFloat(GCGMValue) * 100) * 10).toFixed(2);
                     $("#YBTYLPerUnit").val(YBTYLPerUnit);
                 }else{
                     $("#YBTYLPerUnit").val('');
@@ -317,7 +356,7 @@
             if(RGGRYL !=''){
                 //判断建筑面积或规模
                 if(GCGMValue != ''){
-                    var RGGRYLPerUnit = Math.round(parseInt(RGGRYL) / parseInt(GCGMValue)).toFixed(2);
+                    var RGGRYLPerUnit = Math.round(parseFloat(RGGRYL) / parseFloat(GCGMValue)).toFixed(2);
                     $("#RGGRYLPerUnit").val(RGGRYLPerUnit);
                 }else{
                     $("#RGGRYLPerUnit").val('');
@@ -325,6 +364,24 @@
             }
         }
 
+        function JingHeJianValue() {
+            //送审价
+            var SongShenJia = $("#SongShenJia").val();
+            //审定价
+            var ShenDingJia = $("#ShenDingJia").val();
+            if(SongShenJia !='' && ShenDingJia != ''){
+                //审核增减额
+                var JingHeJianE = parseFloat(ShenDingJia) - parseFloat(SongShenJia);
+                $("#JingHeJianE").val(JingHeJianE);
+                //审核增减率
+                var JingHeJianLv =(parseFloat(ShenDingJia) - parseFloat(SongShenJia)) * 100 / parseFloat(SongShenJia);
+                $("#JingHeJianLv").val(JingHeJianLv);
+            }else{
+                $("#JingHeJianE").val('');
+                $("#JingHeJianLv").val('');
+            }
+        }
+
         function addRow(list, idx, tpl, row){
             // var idx1 = $("#workClientLinkmanList tr").length;
             idx +=1;
@@ -707,13 +764,13 @@
                 <div class="layui-item layui-col-sm6 lw6">
                     <label class="layui-form-label"><span class="require-item">*</span>送审价(元):</label>
                     <div class="layui-input-block with-icon">
-                        <form:input path="SongShenJia" htmlEscape="false"  class="form-control required layui-input number"/>
+                        <form:input path="SongShenJia" htmlEscape="false"  class="form-control required layui-input number" onchange="JingHeJianValue()"/>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6 lw6">
                     <label class="layui-form-label"><span class="require-item">*</span>审定价(元):</label>
                     <div class="layui-input-block with-icon">
-                        <form:input path="ShenDingJia" htmlEscape="false"  class="form-control required layui-input number"/>
+                        <form:input path="ShenDingJia" htmlEscape="false"  class="form-control required layui-input number" onchange="JingHeJianValue()"/>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6 lw6">