Ver código fonte

工作内容-分部结算审核功能

user5 5 anos atrás
pai
commit
86c11319a9

+ 4 - 0
src/main/java/com/jeeplus/modules/workcontent/common/WorkContentDetailFactory.java

@@ -48,6 +48,8 @@ public class WorkContentDetailFactory {
     private static WorkContentCompleteAccountService workContentCompleteAccountService=SpringContextHolder.getBean(WorkContentCompleteAccountService.class);
     //施工单位工程款支付明细表
     private static WorkScheduleService workScheduleService=SpringContextHolder.getBean(WorkScheduleService.class);
+    //施工单位工程款支付明细表
+    private static WorkMaterialsPriceService workMaterialsPriceService=SpringContextHolder.getBean(WorkMaterialsPriceService.class);
 
     public static WorkContentDetailBaseService getDetailService(String type){
         switch (type){
@@ -94,6 +96,8 @@ public class WorkContentDetailFactory {
                 return workContentCompleteAccountService;
             case "420":
                 return workScheduleService;
+            case "421":
+                return workMaterialsPriceService;
             default:
                 return null;
         }

+ 37 - 0
src/main/java/com/jeeplus/modules/workcontent/dao/WorkMaterialsPriceDao.java

@@ -0,0 +1,37 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.workcontent.dao;
+
+import com.jeeplus.common.persistence.CrudDao;
+import com.jeeplus.common.persistence.annotation.MyBatisDao;
+import com.jeeplus.modules.workcontent.entity.WorkMaterialsPrice;
+import com.jeeplus.modules.workcontent.entity.WorkScheduleInfo;
+
+import java.util.List;
+
+
+/**
+ * 设计概算编制审核调整DAO接口
+ * @author ssrh
+ * @version 2018-06-05
+ */
+@MyBatisDao
+public interface WorkMaterialsPriceDao extends CrudDao<WorkMaterialsPrice> {
+
+
+    void batchInsert(List<WorkScheduleInfo> wlist);
+
+    /**
+     * 根据contentId删除数据
+     * @param contentId
+     * @return
+     */
+    int deleteByContentId(String contentId);
+
+    /**
+     * 查询数据表中的所有数据类型
+     * @return
+     */
+    List<String> getTableType(String contentId);
+}

+ 101 - 0
src/main/java/com/jeeplus/modules/workcontent/entity/WorkMaterialsPrice.java

@@ -0,0 +1,101 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.workcontent.entity;
+
+
+import com.jeeplus.common.persistence.DataEntity;
+import org.springframework.format.annotation.NumberFormat;
+
+/**
+ * 设计概算编制审核调整Entity
+ * @author ssrh
+ * @version 2018-06-05
+ */
+public class WorkMaterialsPrice extends DataEntity<WorkMaterialsPrice> {
+
+	private static final long serialVersionUID = 1L;
+	private String projectId;		// 项目id
+	private String contentId;		// 工作内容ID
+
+	private String materialsName;		// 材料名称
+	private String specificationName;		// 规格及名称
+	private String partUsed;		// 施工工艺使用部分
+	private String materialPrice;		// 材料单价
+
+    @NumberFormat(style = NumberFormat.Style.CURRENCY)
+	private Double nuclearPrice;		// 甲方、咨询核定价(不含税价)
+	private String type;          //数据状态
+
+	public WorkMaterialsPrice() {
+		super();
+	}
+
+	public WorkMaterialsPrice(String id){
+		super(id);
+	}
+
+	public String getProjectId() {
+		return projectId;
+	}
+
+	public void setProjectId(String projectId) {
+		this.projectId = projectId;
+	}
+
+	public String getContentId() {
+		return contentId;
+	}
+
+	public void setContentId(String contentId) {
+		this.contentId = contentId;
+	}
+
+	public String getMaterialsName() {
+		return materialsName;
+	}
+
+	public void setMaterialsName(String materialsName) {
+		this.materialsName = materialsName;
+	}
+
+	public String getSpecificationName() {
+		return specificationName;
+	}
+
+	public void setSpecificationName(String specificationName) {
+		this.specificationName = specificationName;
+	}
+
+	public String getPartUsed() {
+		return partUsed;
+	}
+
+	public void setPartUsed(String partUsed) {
+		this.partUsed = partUsed;
+	}
+
+	public String getMaterialPrice() {
+		return materialPrice;
+	}
+
+	public void setMaterialPrice(String materialPrice) {
+		this.materialPrice = materialPrice;
+	}
+
+	public Double getNuclearPrice() {
+		return nuclearPrice;
+	}
+
+	public void setNuclearPrice(Double nuclearPrice) {
+		this.nuclearPrice = nuclearPrice;
+	}
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+}

+ 79 - 0
src/main/java/com/jeeplus/modules/workcontent/service/WorkMaterialsPriceService.java

@@ -0,0 +1,79 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.workcontent.service;
+
+import com.alibaba.fastjson.JSON;
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.service.CrudService;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.modules.workcontent.dao.WorkMaterialsPriceDao;
+import com.jeeplus.modules.workcontent.dao.WorkScheduleDao;
+import com.jeeplus.modules.workcontent.entity.WorkMaterialsPrice;
+import com.jeeplus.modules.workcontent.entity.WorkPreliminaryDesignEstimate;
+import com.jeeplus.modules.workcontent.entity.WorkScheduleInfo;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * 设计概算编制审核调整Service
+ * @author ssrh
+ * @version 2018-06-05
+ */
+@Service
+@Transactional(readOnly = true)
+public class WorkMaterialsPriceService extends CrudService<WorkMaterialsPriceDao, WorkMaterialsPrice> implements WorkContentDetailBaseService{
+
+	public WorkMaterialsPrice get(String id) {
+		return super.get(id);
+	}
+	
+	public List<WorkMaterialsPrice> findList(WorkMaterialsPrice workPreliminaryDesignEstimate) {
+		return super.findList(workPreliminaryDesignEstimate);
+	}
+	
+	public Page<WorkMaterialsPrice> findPage(Page<WorkMaterialsPrice> page, WorkMaterialsPrice workPreliminaryDesignEstimate) {
+		return super.findPage(page, workPreliminaryDesignEstimate);
+	}
+	
+	@Transactional(readOnly = false)
+	public void save(WorkMaterialsPrice workPreliminaryDesignEstimate) {
+		super.save(workPreliminaryDesignEstimate);
+	}
+	
+	@Transactional(readOnly = false)
+	public void delete(WorkMaterialsPrice workPreliminaryDesignEstimate) {
+		super.delete(workPreliminaryDesignEstimate);
+	}
+	
+    @Override
+    @Transactional(readOnly = false)
+    public void saveDetails(String detailStr, String projectId, String contentId) {
+	    if(StringUtils.isBlank(detailStr)){
+	        return;
+        }
+		/*detailStr = detailStr.replace("][",",");*/
+        List<WorkMaterialsPrice> preliminaryDesignEstimateList = JSON.parseArray(detailStr, WorkMaterialsPrice.class);
+        for (WorkMaterialsPrice preliminaryDesignEstimate : preliminaryDesignEstimateList) {
+            if(WorkMaterialsPrice.DEL_FLAG_DELETE.equals(preliminaryDesignEstimate.getDelFlag())){
+                dao.delete(preliminaryDesignEstimate);
+                continue;
+            }
+			preliminaryDesignEstimate.setContentId(contentId);
+			preliminaryDesignEstimate.setProjectId(projectId);
+            this.save(preliminaryDesignEstimate);
+        }
+    }
+
+	/**
+	 * 查询数据表中的所有数据类型
+	 * @return
+	 */
+    public List<String> getTableType(String contentId){
+		List<String> tableType = dao.getTableType(contentId);
+		return tableType;
+	}
+
+}

+ 1 - 1
src/main/java/com/jeeplus/modules/workcontent/service/WorkScheduleService.java

@@ -56,7 +56,7 @@ public class WorkScheduleService extends CrudService<WorkScheduleDao, WorkSchedu
 		/*detailStr = detailStr.replace("][",",");*/
         List<WorkScheduleInfo> preliminaryDesignEstimateList = JSON.parseArray(detailStr, WorkScheduleInfo.class);
         for (WorkScheduleInfo preliminaryDesignEstimate : preliminaryDesignEstimateList) {
-            if(WorkPreliminaryDesignEstimate.DEL_FLAG_DELETE.equals(preliminaryDesignEstimate.getDelFlag())){
+            if(WorkScheduleInfo.DEL_FLAG_DELETE.equals(preliminaryDesignEstimate.getDelFlag())){
                 dao.delete(preliminaryDesignEstimate);
                 continue;
             }

+ 139 - 0
src/main/java/com/jeeplus/modules/workcontent/web/WorkMaterialsPriceController.java

@@ -0,0 +1,139 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.workcontent.web;
+
+import com.google.common.collect.Lists;
+import com.jeeplus.common.config.Global;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.utils.excel.ExportExcel;
+import com.jeeplus.common.utils.excel.ImportExcel;
+import com.jeeplus.common.web.BaseController;
+import com.jeeplus.modules.sys.entity.MainDictDetail;
+import com.jeeplus.modules.sys.utils.DictUtils;
+import com.jeeplus.modules.workcontent.entity.WorkMaterialsPrice;
+import com.jeeplus.modules.workcontent.entity.WorkPreliminaryDesignEstimate;
+import com.jeeplus.modules.workcontent.entity.WorkScheduleInfo;
+import com.jeeplus.modules.workcontent.service.WorkMaterialsPriceService;
+import com.jeeplus.modules.workcontent.service.WorkScheduleService;
+import com.jeeplus.modules.workreceiptsregister.entity.ResponseEntity;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 工程费用Controller
+ * @author ssrh
+ * @version 2018-06-05
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/workMaterialsPrice/workMaterialsPrice")
+public class WorkMaterialsPriceController extends BaseController {
+
+	@Autowired
+	private WorkMaterialsPriceService workMaterialsPriceService;
+	
+	@ModelAttribute
+	public WorkMaterialsPrice get(@RequestParam(required=false) String id) {
+		WorkMaterialsPrice entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = workMaterialsPriceService.get(id);
+		}
+		if (entity == null){
+			entity = new WorkMaterialsPrice();
+		}
+		return entity;
+	}
+	
+	/**
+	 * 工程费用列表页面
+	 */
+	@RequestMapping(value = {"list", ""})
+	public String list(WorkMaterialsPrice workScheduleInfo,String view, HttpServletRequest request, Model model) {
+		String sign = request.getParameter("sign");
+		List<String> signList = new ArrayList();
+		if (StringUtils.isNotBlank(sign)){
+			signList = Arrays.asList(sign.split(","));
+		}
+		List<WorkMaterialsPrice> list = new ArrayList<>();
+        if(StringUtils.isNotBlank(workScheduleInfo.getContentId())){
+            list = workMaterialsPriceService.findList(workScheduleInfo);
+        }
+        model.addAttribute("signList", signList);
+        model.addAttribute("workScheduleList", list);
+        String viewPath = "modules/workcontent/workMaterialsPriceList";
+        if("view".equals(view)){
+            viewPath+="View";
+        }
+		List<MainDictDetail> unitList=DictUtils.getMainDictList("unit_type");
+		model.addAttribute("unitList", unitList);
+		List<MainDictDetail> nodeList=DictUtils.getMainDictList("node_type");
+		model.addAttribute("nodeList", nodeList);
+		List<MainDictDetail> costList=DictUtils.getMainDictList("cost_type");
+		model.addAttribute("costList", costList);
+        return viewPath;
+	}
+
+
+	/**
+	 * 查询数据表中的所有数据类型
+	 * @return
+	 */
+	@ResponseBody
+	@RequestMapping(value = "getTableType", method=RequestMethod.POST)
+	public List<String> getTableType(String contentId){
+		List<String> tableType = workMaterialsPriceService.getTableType(contentId);
+		return tableType;
+	}
+
+	/**
+	 * 导入Excel数据
+	 */
+	@ResponseBody
+    @RequestMapping(value = "import", method=RequestMethod.POST)
+    public Object importFile(MultipartFile file, RedirectAttributes redirectAttributes) {
+        ResponseEntity<WorkMaterialsPrice> responseEntity = new ResponseEntity<>();
+		try {
+			ImportExcel ei = new ImportExcel(file, 1, 0);
+            List<WorkMaterialsPrice> list = ei.getDataList(WorkMaterialsPrice.class);
+			List<WorkMaterialsPrice> listAll = new ArrayList<>();
+			for (WorkMaterialsPrice investmentCost : list) {
+				if(null != investmentCost.getMaterialsName() && null != investmentCost.getSpecificationName() && null != investmentCost.getPartUsed() && null != investmentCost.getMaterialPrice()){
+					listAll.add(investmentCost);
+				}
+			}
+            responseEntity.setData(listAll);
+		} catch (Exception e) {
+		    logger.error("暂定材料价审核审核表失败!",e);
+		    responseEntity.setCode(400);
+		    responseEntity.setMessage("暂定材料价审核审核表失败!"+e.getMessage());
+		}
+		return responseEntity;
+    }
+	
+	/**
+	 * 下载导入设计概算编制审核调整数据模板
+	 */
+    @RequestMapping(value = "import/template")
+    public String importFileTemplate(HttpServletResponse response, RedirectAttributes redirectAttributes) {
+		try {
+            String fileName = "暂定材料价审核导入模板.xlsx";
+    		List<WorkMaterialsPrice> list = Lists.newArrayList();
+    		new ExportExcel("暂定材料价审核调整数据", WorkMaterialsPrice.class, 1).setDataList(list).write(response, fileName).dispose();
+    		return null;
+		} catch (Exception e) {
+			addMessage(redirectAttributes, "导入模板下载失败!失败信息:"+e.getMessage());
+		}
+		return "redirect:"+Global.getAdminPath()+"/workMaterialsPrice/workMaterialsPrice/?repage";
+    }
+	
+}

+ 3 - 2
src/main/java/com/jeeplus/modules/workcontent/web/WorkScheduleController.java

@@ -11,6 +11,7 @@ import com.jeeplus.common.utils.excel.ImportExcel;
 import com.jeeplus.common.web.BaseController;
 import com.jeeplus.modules.sys.entity.MainDictDetail;
 import com.jeeplus.modules.sys.utils.DictUtils;
+import com.jeeplus.modules.workcontent.entity.WorkMaterialsPrice;
 import com.jeeplus.modules.workcontent.entity.WorkPreliminaryDesignEstimate;
 import com.jeeplus.modules.workcontent.entity.WorkScheduleInfo;
 import com.jeeplus.modules.workcontent.service.WorkPreliminaryDesignEstimateService;
@@ -126,8 +127,8 @@ public class WorkScheduleController extends BaseController {
     public String importFileTemplate(HttpServletResponse response, RedirectAttributes redirectAttributes) {
 		try {
             String fileName = "工程进度款审核导入模板.xlsx";
-    		List<WorkPreliminaryDesignEstimate> list = Lists.newArrayList();
-    		new ExportExcel("工程进度款审核调整数据", WorkPreliminaryDesignEstimate.class, 1).setDataList(list).write(response, fileName).dispose();
+    		List<WorkMaterialsPrice> list = Lists.newArrayList();
+    		new ExportExcel("工程进度款审核调整数据", WorkMaterialsPrice.class, 1).setDataList(list).write(response, fileName).dispose();
     		return null;
 		} catch (Exception e) {
 			addMessage(redirectAttributes, "导入模板下载失败!失败信息:"+e.getMessage());

+ 195 - 0
src/main/resources/mappings/modules/workcontent/WorkMaterialsPriceDao.xml

@@ -0,0 +1,195 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.modules.workcontent.dao.WorkMaterialsPriceDao">
+    
+	<sql id="workPreliminaryDesignEstimateColumns">
+		a.id AS "id",
+		a.create_by AS "createBy.id",
+		a.create_date AS "createDate",
+		a.update_by AS "updateBy.id",
+		a.update_date AS "updateDate",
+		a.remarks AS "remarks",
+		a.del_flag AS "delFlag",
+		a.project_id AS "projectId",
+		a.content_id AS "contentId",
+
+		a.materials_name as "materialsName",
+		a.specification_name as "specificationName",
+		a.part_used as "partUsed",
+		a.material_price as "materialPrice",
+		a.nuclear_price as "nuclearPrice",
+		a.type as "type"
+	</sql>
+	
+
+	<select id="get" resultType="com.jeeplus.modules.workcontent.entity.WorkMaterialsPrice" >
+		SELECT 
+			<include refid="workPreliminaryDesignEstimateColumns"/>
+		FROM work_materials_price a
+		WHERE a.id = #{id}
+	</select>
+	
+	<select id="findList" resultType="com.jeeplus.modules.workcontent.entity.WorkMaterialsPrice" >
+		SELECT 
+			<include refid="workPreliminaryDesignEstimateColumns"/>
+		FROM work_materials_price a
+		<where>
+            <if test="projectId!=null and projectId !=''">
+                AND a.project_id = #{projectId}
+            </if>
+            <if test="contentId!=null and contentId !=''">
+                AND a.content_id = #{contentId}
+            </if>
+			AND a.del_flag = #{DEL_FLAG_NORMAL}
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY a.update_date DESC
+			</otherwise>
+		</choose>
+	</select>
+	
+	<select id="findAllList" resultType="com.jeeplus.modules.workcontent.entity.WorkMaterialsPrice" >
+		SELECT 
+			<include refid="workPreliminaryDesignEstimateColumns"/>
+		FROM work_materials_price a
+		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY a.update_date DESC
+			</otherwise>
+		</choose>
+	</select>
+	
+	<insert id="insert">
+		INSERT INTO work_materials_price(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag,
+			project_id,
+			content_id,
+			materials_name,
+			specification_name,
+			part_used,
+			material_price,
+			Nuclear_price,
+			type
+		) VALUES (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag},
+			#{projectId},
+			#{contentId},
+            #{materialsName},
+			#{specificationName},
+			#{partUsed},
+			#{materialPrice},
+			#{nuclearPrice},
+            #{type}
+		)
+	</insert>
+
+    <insert id="batchInsert" parameterType="java.util.List">
+		INSERT INTO work_materials_price(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag,
+			project_id,
+			content_id,
+			materials_name,
+			specification_name,
+			part_used,
+			material_price,
+			Nuclear_price,
+			type
+		) VALUES
+		<foreach collection="list" item="item" separator=",">
+            ( #{item.id},
+            #{item.createBy.id},
+            #{item.createDate},
+            #{item.updateBy.id},
+            #{item.updateDate},
+            #{item.remarks},
+            #{item.delFlag},
+            #{item.projectId},
+            #{item.contentId},
+            #{item.materialsName},
+			#{item.specificationName},
+			#{item.partUsed},
+			#{item.materialPrice},
+			#{item.nuclearPrice},
+			#{item.type}
+			)
+        </foreach>
+	</insert>
+	
+	<update id="update">
+		UPDATE work_materials_price SET
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			remarks = #{remarks},
+			del_flag = #{delFlag},
+			project_id = #{projectId},
+			content_id = #{contentId},
+
+			materials_name = #{materialsName},
+			specification_name = #{specificationName},
+			part_used = #{partUsed},
+			material_price = #{materialPrice},
+			nuclear_price = #{nuclearPrice},
+			type = #{type}
+		WHERE id = #{id}
+	</update>
+	
+	
+	<!--物理删除-->
+	<update id="delete">
+		DELETE FROM work_materials_price
+		WHERE id = #{id}
+	</update>
+	
+	<!--逻辑删除-->
+	<update id="deleteByLogic">
+		UPDATE work_materials_price SET
+			del_flag = #{DEL_FLAG_DELETE}
+		WHERE id = #{id}
+	</update>
+
+	<delete id="deleteByContentId">
+		DELETE FROM work_materials_price
+		WHERE content_id = #{id}
+	</delete>
+	
+	
+	<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
+	<select id="findUniqueByProperty" resultType="com.jeeplus.modules.workcontent.entity.WorkMaterialsPrice" statementType="STATEMENT">
+		select * FROM work_materials_price  where ${propertyName} = '${value}'
+	</select>
+
+	<select id="getTableType" resultType="java.lang.String">
+		select a.type from(
+		select DISTINCT(wpde.type) as type from work_materials_price wpde where wpde.del_flag = 0 and wpde.content_id = #{contentId}
+		) a
+	</select>
+
+</mapper>

+ 11 - 0
src/main/webapp/webpage/modules/projectcontentinfo/workContentForm.jsp

@@ -253,6 +253,9 @@
                 case '420':
                     $("#contentDetail").load("${ctx}/workSchedule/workSchedule/list",param2);
                     break;
+                case '421':
+                    $("#contentDetail").load("${ctx}/workMaterialsPrice/workMaterialsPrice/list",param2);
+                    break;
                 default:
                     detailFlag=0;
                     $("#contentDetail").html("");
@@ -1040,6 +1043,8 @@
                 return  "${ctx}/workContent/workContentCompleteAccount/getTableType";
             case '420':
                 return "${ctx}/workSchedule/workSchedule/getTableType";
+            case '421':
+                return "${ctx}/workMaterialsPrice/workMaterialsPrice/getTableType";
             default:
                 return "";
         }
@@ -1124,6 +1129,9 @@
             case '420':
                 $("#contentDetail").load("${ctx}/workSchedule/workSchedule/list",param2);
                 break;
+            case '421':
+                $("#contentDetail").load("${ctx}/workMaterialsPrice/workMaterialsPrice/list",param2);
+                break;
             default:
                 detailFlag=0;
                 $("#contentDetail").html("");
@@ -1209,6 +1217,9 @@
             case '420':
                 $("#contentDetail").load("${ctx}/workSchedule/workSchedule/list",param2);
                 break;
+            case '421':
+                $("#contentDetail").load("${ctx}/workMaterialsPrice/workMaterialsPrice/list",param2);
+                break;
             default:
                 detailFlag=0;
                 $("#contentDetail").html("");

+ 11 - 0
src/main/webapp/webpage/modules/projectcontentinfo/workContentView.jsp

@@ -222,6 +222,9 @@
                 case '420':
                     $("#contentDetail").load("${ctx}/workSchedule/workSchedule/list",param2);
                     break;
+                case '421':
+                    $("#contentDetail").load("${ctx}/workMaterialsPrice/workMaterialsPrice/list",param2);
+                    break;
                 default:
                     detailFlag=0;
                     $("#contentDetail").html("");
@@ -940,6 +943,8 @@
                 return "${ctx}/workContent/workContentCompleteAccount/getTableType";
             case '420':
                 return "${ctx}/workSchedule/workSchedule/getTableType";
+            case '421':
+                return "${ctx}/workMaterialsPrice/workMaterialsPrice/getTableType";
                 default:
                 return "";
         }
@@ -1023,6 +1028,9 @@
             case '420':
                 $("#contentDetail").load("${ctx}/workSchedule/workSchedule/list",param2);
                 break;
+            case '421':
+                $("#contentDetail").load("${ctx}/workMaterialsPrice/workMaterialsPrice/list",param2);
+                break;
             default:
                 detailFlag=0;
                 $("#contentDetail").html("");
@@ -1101,6 +1109,9 @@
             case '420':
                 $("#contentDetail").load("${ctx}/workSchedule/workSchedule/list",param2);
                 break;
+            case '421':
+                $("#contentDetail").load("${ctx}/workMaterialsPrice/workMaterialsPrice/list",param2);
+                break;
             default:
                 detailFlag=0;
                 $("#contentDetail").html("");

+ 9 - 9
src/main/webapp/webpage/modules/projectreportnum/projectReportNumStageForm.jsp

@@ -75,18 +75,18 @@
 					<div class="layui-input-block">
 						<form:select id="stageId" path="stageId"  htmlEscape="false" class="form-control simple-select required">
 							<form:option value=""></form:option>
-							<optgroup label="决策阶段"/>
-							<form:options items="${fns:getContentTypeList('1')}" itemLabel="typeName" itemValue="typeId"></form:options>
-							<optgroup label="设计阶段"/>
+							<%--<optgroup label="决策阶段"/>
+							<form:options items="${fns:getContentTypeList('1')}" itemLabel="typeName" itemValue="typeId"></form:options>--%>
+							<optgroup label="项目实施前期"/>
 							<form:options items="${fns:getContentTypeList('2')}" itemLabel="typeName" itemValue="typeId"></form:options>
-							<optgroup label="发承包阶段"/>
-							<form:options items="${fns:getContentTypeList('3')}" itemLabel="typeName" itemValue="typeId"></form:options>
-							<optgroup label="实施阶段"/>
+							<%--<optgroup label="发承包阶段"/>
+							<form:options items="${fns:getContentTypeList('3')}" itemLabel="typeName" itemValue="typeId"></form:options>--%>
+							<optgroup label="项目实施阶段"/>
 							<form:options items="${fns:getContentTypeList('4')}" itemLabel="typeName" itemValue="typeId"></form:options>
-							<optgroup label="竣工阶段"/>
+							<optgroup label="项目竣工阶段"/>
 							<form:options items="${fns:getContentTypeList('5')}" itemLabel="typeName" itemValue="typeId"></form:options>
-							<optgroup label="运营阶段"/>
-							<form:options items="${fns:getContentTypeList('6')}" itemLabel="typeName" itemValue="typeId"></form:options>
+							<%--<optgroup label="运营阶段"/>
+							<form:options items="${fns:getContentTypeList('6')}" itemLabel="typeName" itemValue="typeId"></form:options>--%>
 						</form:select>
 					</div>
 				</div>

+ 1 - 1
src/main/webapp/webpage/modules/workcontent/workConcealProjectList.jsp

@@ -14,7 +14,7 @@
             <table id="contentTable" class="table table-bordered table-condensed can-edit">
                 <thead>
                     <tr>
-                        <th colspan="6" style="font-size: 20px">蔽工程量确认单</th>
+                        <th colspan="6" style="font-size: 20px">蔽工程量确认单</th>
                     </tr>
                     <tr>
                         <th>序号</th>

+ 2 - 2
src/main/webapp/webpage/modules/workcontent/workConcealProjectListView.jsp

@@ -6,7 +6,7 @@
             <table id="contentTable" class="table table-bordered table-condensed">
                 <thead>
                 <tr>
-                    <th colspan="5" style="font-size: 20px">蔽工程量确认单</th>
+                    <th colspan="5" style="font-size: 20px">蔽工程量确认单</th>
                 </tr>
                 <tr>
                     <th>序号</th>
@@ -48,7 +48,7 @@
             <table id="contentTable" class="table table-bordered table-condensed">
                 <thead>
                 <tr>
-                    <th colspan="5" style="font-size: 20px">屏蔽工程量确认单</th>
+                    <th colspan="5" style="font-size: 20px">场平工程量确认单</th>
                 </tr>
                 <tr>
                     <th>序号</th>

+ 1 - 1
src/main/webapp/webpage/modules/workcontent/workContentBranchAccountList.jsp

@@ -79,7 +79,7 @@
                 <input id="investmentCostList{{idx}}_businessReduce" subName="businessReduce" type="text"    value="{{row.businessReduce}}"  class="form-control number contentDetail"/>
             </td>
             <td>
-                <input id="investmentCostList{{idx}}_businessRate" subName="businessRate" type="text"  value="{{row._businessRate}}"  class="form-control number contentDetail"/>
+                <input id="investmentCostList{{idx}}_businessRate" subName="businessRate" type="text"  value="{{row.businessRate}}"  class="form-control number contentDetail"/>
             </td>
 
             <td class="text-center op-td">

+ 201 - 0
src/main/webapp/webpage/modules/workcontent/workMaterialsPriceList.jsp

@@ -0,0 +1,201 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<script type="text/javascript">
+    function formatJiananNumMoney(obj,index) {
+        var val = $(obj).val();
+        var beforeCumulativeCompletionMoney=$("#workScheduleList"+index+"_beforeCumulativeCompletionMoney").val();
+        var beforeTotalPaymentMoney=$("#workScheduleList"+index+"_beforeTotalPaymentMoney").val();
+        if(beforeCumulativeCompletionMoney==undefined||!isNumber(beforeCumulativeCompletionMoney)||beforeCumulativeCompletionMoney==''){
+            beforeCumulativeCompletionMoney=0;
+        }
+        if(beforeTotalPaymentMoney==undefined||!isNumber(beforeTotalPaymentMoney)||beforeTotalPaymentMoney==''){
+            beforeTotalPaymentMoney=0;
+        }
+        var total=(parseFloat(beforeTotalPaymentMoney) / parseFloat(beforeCumulativeCompletionMoney)).toFixed(2);
+        $("#workScheduleList"+index+"_beforePayRatio").val(total);
+
+        if(!isNumber(val))return;
+    }
+    function formatOtherNumMoney(obj,index) {
+        var val = $(obj).val();
+        var currentCumulativeCompletionMoney=$("#workScheduleList"+index+"_currentCumulativeCompletionMoney").val();
+        var currentTotalPaymentMoney=$("#workScheduleList"+index+"_currentTotalPaymentMoney").val();
+        if(currentCumulativeCompletionMoney==undefined||!isNumber(currentCumulativeCompletionMoney)||currentCumulativeCompletionMoney==''){
+            currentCumulativeCompletionMoney=0;
+        }
+        if(currentTotalPaymentMoney==undefined||!isNumber(currentTotalPaymentMoney)||currentTotalPaymentMoney==''){
+            currentTotalPaymentMoney=0;
+        }
+        var total=(parseFloat(currentTotalPaymentMoney) / parseFloat(currentCumulativeCompletionMoney)).toFixed(2);
+        $("#workScheduleList"+index+"_currentPayRatio").val(total);
+
+        if(!isNumber(val))return;
+    }
+</script>
+<form id="subForm"  action="#" onsubmit="return false;" method="post" class="form-horizontal">
+    <c:forEach items="${signList}" var="sign">
+        <c:if test="${sign =='materialsPrice'}">
+            <div class="layui-item nav-btns" style="padding-left:0px;">
+                <a class="nav-btn nav-btn-add" onclick="addRowCost('#workScheduleList',preliminaryIdx,preliminaryTpl)" title="新增"><i class="fa fa-plus"></i> 新增</a>
+                <table:importExcelCost url="${ctx}/workPreliminary/workPreliminaryDesignEstimate/import"></table:importExcelCost><!-- 导入按钮 -->
+            </div>
+
+            <table id="contentTable" class="table table-bordered table-condensed can-edit">
+                <thead>
+                    <tr>
+                        <th colspan="8" style="font-size: 20px">暂定材料价的审核、特殊材料价格的询价审核</th>
+                    </tr>
+                    <tr>
+                        <th class="hide"></th>
+                        <th>序号</th>
+                        <th>材料名称</th>
+                        <th>规格及名称</th>
+                        <th>施工工艺使用部位</th>
+                        <th>材料单价</th>
+                        <th>甲方、咨询核定价(不含税价)</th>
+                        <th>备注</th>
+                        <th width="60">操作</th>
+                    </tr>
+                </thead>
+                <tbody id="workScheduleList">
+                </tbody>
+            </table>
+        </c:if>
+    </c:forEach>
+	<script type="text/template" id="preliminaryTpl">//<!--
+        <tr id="workScheduleList{{idx}}">
+            <td class="hide">
+                <input id="workScheduleList{{idx}}_id" subName="id" class="contentDetail" type="hidden" value="{{row.id}}"/>
+                <input id="workScheduleList{{idx}}_delFlag" subName="delFlag" class="contentDetail" type="hidden" value="0"/>
+                <input id="workScheduleList{{idx}}_costType" subName="costType" class="contentDetail"  type="hidden" value="{{row.costType}}"/>
+                <input id="workScheduleList{{idx}}_type" subName="type" class="contentDetail"  type="hidden" value="materialsPrice"/>
+            </td>
+            <td>
+                <input id="workScheduleList{{idx}}_costNum" subName="costNum" readonly="readonly" style="text-align: center"  value="{{idx}}" type="text" class="form-control contentDetail"/>
+            </td>
+
+            <td>
+                <input id="workScheduleList{{idx}}_materialsName" subName="materialsName" style="text-align: center"  value="{{row.materialsName}}" type="text" class="form-control contentDetail"/>
+            </td>
+            <td>
+                <input id="workScheduleList{{idx}}_specificationName" subName="specificationName" type="text" value="{{row.specificationName}}" class="form-control contentDetail"/>
+            </td>
+            <td>
+                <input id="workScheduleList{{idx}}_partUsed" subName="partUsed" type="text" value="{{row.partUsed}}" class="form-control contentDetail"/>
+            </td>
+            <td>
+                <input id="workScheduleList{{idx}}_materialPrice" subName="materialPrice" type="text" value="{{row.materialPrice}}" class="form-control contentDetail"/>
+            </td>
+            <td>
+                <input id="workScheduleList{{idx}}_nuclearPrice" subName="nuclearPrice" type="text"  value="{{row.nuclearPrice}}" class="form-control number  contentDetail money"/>
+            </td>
+            <td>
+                <input id="workScheduleList{{idx}}_remarks" subName="remarks" type="text"  value="{{row.remarks}}" class="form-control  contentDetail"/>
+            </td>
+            <td class="text-center op-td">
+                        <a href="#" onclick="delRow(this, '#workScheduleList{{idx}}')"   class="op-btn op-btn-delete"><i class="fa fa-trash"></i> 取消</a>
+            </td>
+        </tr>//-->
+    </script>
+    <script type="text/javascript">
+        var preliminaryIdx = 0, preliminaryTpl = $("#preliminaryTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+        var validateForm2;
+        $(function(){
+            validateForm2 = $("#subForm").validate({
+                errorContainer: "#messageBox",
+                errorPlacement: function(error, element) {
+                    $("#messageBox").text("输入有误,请先更正。");
+                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+                        error.appendTo(element.parent().parent());
+                    } else {
+                        error.insertAfter(element);
+                    }
+                }
+            });
+
+            var data = ${fns:toJson(workScheduleList)};
+            console.log(data);
+            for (var i=0; i<data.length; i++){
+                addRowCost('#workScheduleList', preliminaryIdx, preliminaryTpl,data[i]);
+                $("#workScheduleList"+i+"_nodeTypes").val(data[i].nodeTypes);
+                $("#workScheduleList"+i+"_expenseType").val(data[i].expenseType);
+                $("#workScheduleList"+i+"_unit").val(data[i].unit);
+            }
+            $(":input.money").change();
+        })
+
+        function addRowCost(list, idx, tpl, row){
+            idx = idx+1;
+            bornTemplete(list, idx, tpl, row, idx);
+            preliminaryIdx +=1;
+        }
+
+        function bornTemplete(list, idx, tpl, row, idx1){
+            var idx1 = $("#workScheduleList tr").length +1;
+            $(list).append(Mustache.render(tpl, {
+                idx: idx, delBtn: true, row: row,
+                order:idx1 + 1, idx1:idx1
+            }));
+            $(list+idx).find("select").each(function(){
+                $(this).val($(this).attr("data-value"));
+            });
+            $(list+idx).find("input[type='checkbox'], input[type='radio']").each(function(){
+                var ss = $(this).attr("data-value").split(',');
+                for (var i=0; i<ss.length; i++){
+                    if($(this).val() == ss[i]){
+                        $(this).attr("checked","checked");
+                    }
+                }
+            });
+        }
+        function delRow(obj, prefix,idx){
+            var id = $(prefix+"_id");
+            var delFlag = $(prefix+"_delFlag");
+            if(id.val()==null||id.val()==''){
+                $(obj).parent().parent().remove();
+            }else {
+                delFlag.val("1");
+                $(obj).parent().parent().hide();
+            }
+        }
+
+        function genRow(data) {
+            for (var i = 0; i < data.length; i++) {
+                addRowCost('#workScheduleList',preliminaryIdx,preliminaryTpl,data[i]);
+            }
+            $(":input.money").change();
+        }
+
+        function genDetailStr(){
+            var costList = $("#workScheduleList tr");
+            var contentStr = "[";
+            for(var j=0; j<costList.length;j++){
+                contentStr+="{"
+                var idstr = $(costList[j]).attr("id");
+                var detail = $("tr[id="+idstr+"] .contentDetail");
+                for(var i=0; i<detail.length;i++){
+                    contentStr+="'"
+                    contentStr+=$(detail[i]).attr("subName");
+                    contentStr+="'"
+                    contentStr+=":";
+                    contentStr+="'"
+                    contentStr+=$(detail[i]).val();
+                    contentStr+="'"
+                    if(i!=detail.length-1){
+                        contentStr+=","
+                    }
+                }
+                contentStr+="}"
+                if(j!=costList.length-1){
+                    contentStr+=","
+                }
+            }
+            contentStr += "]";
+            return contentStr;
+        }
+
+        function genSecondDetailStr(){
+            return '';
+        }
+    </script>
+</form>

+ 52 - 0
src/main/webapp/webpage/modules/workcontent/workMaterialsPriceListView.jsp

@@ -0,0 +1,52 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<form id="subForm"  action="#" onsubmit="return false;" method="post" class="form-horizontal">
+    <c:forEach items="${signList}" var="sign">
+        <c:if test="${sign =='materialsPrice'}">
+            <table id="contentTable" class="table table-bordered table-condensed">
+                <thead>
+                    <tr>
+                        <th colspan="7" style="font-size: 20px">暂定材料价的审核、特殊材料价格的询价审核</th>
+                    </tr>
+                    <tr>
+                        <th class="hide"></th>
+                        <th>序号</th>
+                        <th>材料名称</th>
+                        <th>规格及名称</th>
+                        <th>施工工艺使用部位</th>
+                        <th>材料单价</th>
+                        <th>甲方、咨询核定价(不含税价)</th>
+                        <th>备注</th>
+                    </tr>
+                </thead>
+                <tbody id="preliminaryList">
+                <c:forEach items="${workScheduleList}" var="row" varStatus="status">
+                    <tr>
+                        <td style='text-align:center;'>
+                                ${status.index+1}
+                        </td>
+                        <td style='text-align:center;'>
+                                ${row.materialsName}
+                        </td>
+                        <td style='text-align:center;'>
+                                ${row.specificationName}
+                        </td>
+                        <td style='text-align:center;'>
+                                ${row.partUsed}
+                        </td>
+                        <td style='text-align:center;'>
+                                ${row.materialPrice}
+                        </td>
+                        <td style='text-align:center;'>
+                            <fmt:formatNumber value="${row.nuclearPrice}" pattern="#,##0.00#"/>
+                        </td>
+                        <td style='text-align:center;'>
+                                ${row.remarks}
+                        </td>
+                    </tr>
+                </c:forEach>
+                </tbody>
+            </table>
+        </c:if>
+    </c:forEach>
+</form>