Переглянути джерело

设计概算编制审核与调整根据类型选择表格功能

user5 5 роки тому
батько
коміт
4d0a153325

+ 37 - 0
src/main/java/com/jeeplus/modules/workcontent/dao/WorkPreliminaryDesignEstimateDao.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.WorkContentInvestmentCost;
+import com.jeeplus.modules.workcontent.entity.WorkPreliminaryDesignEstimate;
+
+import java.util.List;
+
+
+/**
+ * 设计概算编制审核调整DAO接口
+ * @author ssrh
+ * @version 2018-06-05
+ */
+@MyBatisDao
+public interface WorkPreliminaryDesignEstimateDao extends CrudDao<WorkPreliminaryDesignEstimate> {
+
+
+    void batchInsert(List<WorkPreliminaryDesignEstimate> wlist);
+
+    /**
+     * 根据contentId删除数据
+     * @param contentId
+     * @return
+     */
+    int deleteByContentId(String contentId);
+
+    /**
+     * 查询数据表中的所有数据类型
+     * @return
+     */
+    List<String> getTableType(String contentId);
+}

+ 195 - 0
src/main/java/com/jeeplus/modules/workcontent/entity/WorkPreliminaryDesignEstimate.java

@@ -0,0 +1,195 @@
+/**
+ * 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 com.jeeplus.common.utils.excel.annotation.ExcelField;
+import org.springframework.format.annotation.NumberFormat;
+
+/**
+ * 设计概算编制审核调整Entity
+ * @author ssrh
+ * @version 2018-06-05
+ */
+public class WorkPreliminaryDesignEstimate extends DataEntity<WorkPreliminaryDesignEstimate> {
+
+	private static final long serialVersionUID = 1L;
+	private String projectId;		// 项目id
+	private String contentId;		// 工作内容ID
+
+	private String costName;		// 工程费用名称
+	@NumberFormat(style = NumberFormat.Style.CURRENCY)
+	private Double jiananBeforeCost;		// 建安工程评审前
+    @NumberFormat(style = NumberFormat.Style.CURRENCY)
+	private Double jiananAfterArchitectureCost;		// 建安工程评审后建筑工程费
+    @NumberFormat(style = NumberFormat.Style.CURRENCY)
+	private Double jiananAfterInstallCost;		// 建安工程评审后安装工程费
+    @NumberFormat(style = NumberFormat.Style.CURRENCY)
+	private Double jiananAfterOtherCost;		// 建安工程评审后其他费用
+    @NumberFormat(style = NumberFormat.Style.CURRENCY)
+	private Double jiananAfterTotalCost;		// 建安工程评审后合计
+	private String jiananRemark;		// 建安工程备注
+    @NumberFormat(style = NumberFormat.Style.CURRENCY)
+	private Double otherBeforeCost;		// 其他费用评审前
+	@NumberFormat(style = NumberFormat.Style.CURRENCY)
+	private Double otherAfterArchitectureCost;		// 其他费用评审后建设工程费
+	@NumberFormat(style = NumberFormat.Style.CURRENCY)
+	private Double otherAfterClearCost;		// 其他费用评审后场地征用清理费
+	@NumberFormat(style = NumberFormat.Style.CURRENCY)
+	private Double otherAfterOtherCost;		// 其他费用评审后其他费用
+	@NumberFormat(style = NumberFormat.Style.CURRENCY)
+	private Double otherAfterTotalCost;		// 其他费用评审后合计
+	private String otherRemark;		// 其他费用备注
+	private String type;          //数据状态
+
+	public WorkPreliminaryDesignEstimate() {
+		super();
+	}
+
+	public WorkPreliminaryDesignEstimate(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;
+	}
+	
+	@ExcelField(title="工程费用名称", align=2, sort=10)
+	public String getCostName() {
+		return costName;
+	}
+
+	public void setCostName(String costName) {
+		this.costName = costName;
+	}
+
+	@ExcelField(title="建安工程评审前", align=2, sort=11)
+	public Double getJiananBeforeCost() {
+		return jiananBeforeCost;
+	}
+
+	public void setJiananBeforeCost(Double jiananBeforeCost) {
+		this.jiananBeforeCost = jiananBeforeCost;
+	}
+
+	@ExcelField(title="建安工程评审后建筑工程费", align=2, sort=12)
+	public Double getJiananAfterArchitectureCost() {
+		return jiananAfterArchitectureCost;
+	}
+
+	public void setJiananAfterArchitectureCost(Double jiananAfterArchitectureCost) {
+		this.jiananAfterArchitectureCost = jiananAfterArchitectureCost;
+	}
+
+	@ExcelField(title="建安工程评审后安装工程费", align=2, sort=13)
+	public Double getJiananAfterInstallCost() {
+		return jiananAfterInstallCost;
+	}
+
+	public void setJiananAfterInstallCost(Double jiananAfterInstallCost) {
+		this.jiananAfterInstallCost = jiananAfterInstallCost;
+	}
+
+	@ExcelField(title="建安工程评审后其他费用", align=2, sort=14)
+	public Double getJiananAfterOtherCost() {
+		return jiananAfterOtherCost;
+	}
+
+	public void setJiananAfterOtherCost(Double jiananAfterOtherCost) {
+		this.jiananAfterOtherCost = jiananAfterOtherCost;
+	}
+
+	@ExcelField(title="建安工程评审后合计", align=2, sort=15)
+	public Double getJiananAfterTotalCost() {
+		return jiananAfterTotalCost;
+	}
+
+	public void setJiananAfterTotalCost(Double jiananAfterTotalCost) {
+		this.jiananAfterTotalCost = jiananAfterTotalCost;
+	}
+
+	@ExcelField(title="建安工程备注", align=2, sort=16)
+	public String getJiananRemark() {
+		return jiananRemark;
+	}
+
+	public void setJiananRemark(String jiananRemark) {
+		this.jiananRemark = jiananRemark;
+	}
+
+	@ExcelField(title="其他费用评审前", align=2, sort=17)
+	public Double getOtherBeforeCost() {
+		return otherBeforeCost;
+	}
+
+	public void setOtherBeforeCost(Double otherBeforeCost) {
+		this.otherBeforeCost = otherBeforeCost;
+	}
+
+	@ExcelField(title="其他费用评审后建设工程费", align=2, sort=18)
+	public Double getOtherAfterArchitectureCost() {
+		return otherAfterArchitectureCost;
+	}
+
+	public void setOtherAfterArchitectureCost(Double otherAfterArchitectureCost) {
+		this.otherAfterArchitectureCost = otherAfterArchitectureCost;
+	}
+
+	@ExcelField(title="其他费用评审后场地征用清理费", align=2, sort=19)
+	public Double getOtherAfterClearCost() {
+		return otherAfterClearCost;
+	}
+
+	public void setOtherAfterClearCost(Double otherAfterClearCost) {
+		this.otherAfterClearCost = otherAfterClearCost;
+	}
+
+	@ExcelField(title="其他费用评审后其他费用", align=2, sort=20)
+	public Double getOtherAfterOtherCost() {
+		return otherAfterOtherCost;
+	}
+
+	public void setOtherAfterOtherCost(Double otherAfterOtherCost) {
+		this.otherAfterOtherCost = otherAfterOtherCost;
+	}
+
+	@ExcelField(title="其他费用评审后合计", align=2, sort=21)
+	public Double getOtherAfterTotalCost() {
+		return otherAfterTotalCost;
+	}
+
+	public void setOtherAfterTotalCost(Double otherAfterTotalCost) {
+		this.otherAfterTotalCost = otherAfterTotalCost;
+	}
+
+	@ExcelField(title="其他费用备注", align=2, sort=22)
+	public String getOtherRemark() {
+		return otherRemark;
+	}
+
+	public void setOtherRemark(String otherRemark) {
+		this.otherRemark = otherRemark;
+	}
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+}

+ 78 - 0
src/main/java/com/jeeplus/modules/workcontent/service/WorkPreliminaryDesignEstimateService.java

@@ -0,0 +1,78 @@
+/**
+ * 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.WorkContentInvestmentCostDao;
+import com.jeeplus.modules.workcontent.dao.WorkPreliminaryDesignEstimateDao;
+import com.jeeplus.modules.workcontent.entity.WorkContentInvestmentCost;
+import com.jeeplus.modules.workcontent.entity.WorkPreliminaryDesignEstimate;
+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 WorkPreliminaryDesignEstimateService extends CrudService<WorkPreliminaryDesignEstimateDao, WorkPreliminaryDesignEstimate> implements WorkContentDetailBaseService{
+
+	public WorkPreliminaryDesignEstimate get(String id) {
+		return super.get(id);
+	}
+	
+	public List<WorkPreliminaryDesignEstimate> findList(WorkPreliminaryDesignEstimate workPreliminaryDesignEstimate) {
+		return super.findList(workPreliminaryDesignEstimate);
+	}
+	
+	public Page<WorkPreliminaryDesignEstimate> findPage(Page<WorkPreliminaryDesignEstimate> page, WorkPreliminaryDesignEstimate workPreliminaryDesignEstimate) {
+		return super.findPage(page, workPreliminaryDesignEstimate);
+	}
+	
+	@Transactional(readOnly = false)
+	public void save(WorkPreliminaryDesignEstimate workPreliminaryDesignEstimate) {
+		super.save(workPreliminaryDesignEstimate);
+	}
+	
+	@Transactional(readOnly = false)
+	public void delete(WorkPreliminaryDesignEstimate 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<WorkPreliminaryDesignEstimate> preliminaryDesignEstimateList = JSON.parseArray(detailStr, WorkPreliminaryDesignEstimate.class);
+        for (WorkPreliminaryDesignEstimate preliminaryDesignEstimate : preliminaryDesignEstimateList) {
+            if(WorkPreliminaryDesignEstimate.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;
+	}
+
+}

+ 141 - 0
src/main/java/com/jeeplus/modules/workcontent/web/WorkPreliminaryDesignEstimateController.java

@@ -0,0 +1,141 @@
+/**
+ * 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.projectcontentinfo.service.ProjectcontentinfoService;
+import com.jeeplus.modules.sys.entity.MainDictDetail;
+import com.jeeplus.modules.sys.utils.DictUtils;
+import com.jeeplus.modules.workcontent.entity.WorkContentInvestmentCost;
+import com.jeeplus.modules.workcontent.entity.WorkPreliminaryDesignEstimate;
+import com.jeeplus.modules.workcontent.service.WorkContentInvestmentCostService;
+import com.jeeplus.modules.workcontent.service.WorkPreliminaryDesignEstimateService;
+import com.jeeplus.modules.workreceiptsregister.entity.ResponseEntity;
+import org.aspectj.apache.bcel.generic.RET;
+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}/workPreliminary/workPreliminaryDesignEstimate")
+public class WorkPreliminaryDesignEstimateController extends BaseController {
+
+	@Autowired
+	private WorkPreliminaryDesignEstimateService workPreliminaryDesignEstimateService;
+	
+	@ModelAttribute
+	public WorkPreliminaryDesignEstimate get(@RequestParam(required=false) String id) {
+		WorkPreliminaryDesignEstimate entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = workPreliminaryDesignEstimateService.get(id);
+		}
+		if (entity == null){
+			entity = new WorkPreliminaryDesignEstimate();
+		}
+		return entity;
+	}
+	
+	/**
+	 * 工程费用列表页面
+	 */
+	/*@RequiresPermissions("workcontentinvestmentcost:workContentInvestmentCost:list")*/
+	@RequestMapping(value = {"list", ""})
+	public String list(WorkPreliminaryDesignEstimate workPreliminaryDesignEstimate,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<WorkPreliminaryDesignEstimate> list = new ArrayList<>();
+        if(StringUtils.isNotBlank(workPreliminaryDesignEstimate.getContentId())){
+            list = workPreliminaryDesignEstimateService.findList(workPreliminaryDesignEstimate);
+        }
+        model.addAttribute("signList", signList);
+        model.addAttribute("preliminaryList", list);
+        String viewPath = "modules/workcontent/workPreliminaryDesignEstimateList";
+        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 = workPreliminaryDesignEstimateService.getTableType(contentId);
+		return tableType;
+	}
+
+	/**
+	 * 导入Excel数据
+	 */
+	@ResponseBody
+    @RequestMapping(value = "import", method=RequestMethod.POST)
+    public Object importFile(MultipartFile file, RedirectAttributes redirectAttributes) {
+        ResponseEntity<WorkPreliminaryDesignEstimate> responseEntity = new ResponseEntity<>();
+		try {
+			ImportExcel ei = new ImportExcel(file, 1, 0);
+            List<WorkPreliminaryDesignEstimate> list = ei.getDataList(WorkPreliminaryDesignEstimate.class);
+			List<WorkPreliminaryDesignEstimate> listAll = new ArrayList<>();
+			for (WorkPreliminaryDesignEstimate investmentCost : list) {
+				if(StringUtils.isNotBlank(investmentCost.getCostName()) && null != investmentCost.getJiananBeforeCost() && null != investmentCost.getJiananAfterArchitectureCost() && null != investmentCost.getJiananAfterInstallCost()){
+					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<WorkPreliminaryDesignEstimate> list = Lists.newArrayList();
+    		new ExportExcel("设计概算编制审核调整数据", WorkPreliminaryDesignEstimate.class, 1).setDataList(list).write(response, fileName).dispose();
+    		return null;
+		} catch (Exception e) {
+			addMessage(redirectAttributes, "导入模板下载失败!失败信息:"+e.getMessage());
+		}
+		return "redirect:"+Global.getAdminPath()+"/workPreliminary/workPreliminaryDesignEstimate/?repage";
+    }
+	
+}

+ 241 - 0
src/main/resources/mappings/modules/workcontent/WorkPreliminaryDesignEstimateDao.xml

@@ -0,0 +1,241 @@
+<?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.WorkPreliminaryDesignEstimateDao">
+    
+	<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.cost_name AS "costName",
+		a.jianan_before_cost as "jiananBeforeCost",
+		a.jianan_after_architecture_cost as "jiananAfterArchitectureCost",
+		a.jianan_after_install_cost as "jiananAfterInstallCost",
+		a.jianan_after_other_cost as "jiananAfterOtherCost",
+		a.jianan_after_total_cost as "jiananAfterTotalCost",
+		a.jianan_remark as "jiananRemark",
+		a.other_before_cost as "otherBeforeCost",
+		a.other_after_architecture_cost as "otherAfterArchitectureCost",
+		a.other_after_clear_cost as "otherAfterClearCost",
+		a.other_after_other_cost as "otherAfterOtherCost",
+		a.other_after_total_cost as "otherAfterTotalCost",
+		a.other_remark as "otherRemark",
+		a.type as "type"
+	</sql>
+	
+
+	<select id="get" resultType="com.jeeplus.modules.workcontent.entity.WorkPreliminaryDesignEstimate" >
+		SELECT 
+			<include refid="workPreliminaryDesignEstimateColumns"/>
+		FROM work_preliminary_design_estimate a
+		WHERE a.id = #{id}
+	</select>
+	
+	<select id="findList" resultType="com.jeeplus.modules.workcontent.entity.WorkPreliminaryDesignEstimate" >
+		SELECT 
+			<include refid="workPreliminaryDesignEstimateColumns"/>
+		FROM work_preliminary_design_estimate 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.WorkPreliminaryDesignEstimate" >
+		SELECT 
+			<include refid="workPreliminaryDesignEstimateColumns"/>
+		FROM work_preliminary_design_estimate 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_preliminary_design_estimate(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag,
+			project_id,
+			content_id,
+			cost_name,
+			jianan_before_cost,
+			jianan_after_architecture_cost,
+			jianan_after_install_cost,
+			jianan_after_other_cost,
+			jianan_after_total_cost,
+			jianan_remark,
+			other_before_cost,
+			other_after_architecture_cost,
+			other_after_clear_cost,
+			other_after_other_cost,
+			other_after_total_cost,
+			other_remark,
+			type
+		) VALUES (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag},
+			#{projectId},
+			#{contentId},
+            #{costName},
+            #{jiananBeforeCost},
+            #{jiananAfterArchitectureCost},
+            #{jiananAfterInstallCost},
+            #{jiananAfterOtherCost},
+            #{jiananAfterTotalCost},
+            #{jiananRemark},
+            #{otherBeforeCost},
+            #{otherAfterArchitectureCost},
+            #{otherAfterClearCost},
+            #{otherAfterOtherCost},
+            #{otherAfterTotalCost},
+            #{otherRemark},
+            #{type}
+		)
+	</insert>
+
+    <insert id="batchInsert" parameterType="java.util.List">
+		INSERT INTO work_preliminary_design_estimate(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag,
+			project_id,
+			content_id,
+			cost_name,
+			jianan_before_cost,
+			jianan_after_architecture_cost,
+			jianan_after_install_cost,
+			jianan_after_other_cost,
+			jianan_after_total_cost,
+			jianan_remark,
+			other_before_cost,
+			other_after_architecture_cost,
+			other_after_clear_cost,
+			other_after_other_cost,
+			other_after_total_cost,
+			other_remark,
+			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.costName},
+			#{item.jiananBeforeCost},
+			#{item.jiananAfterArchitectureCost},
+			#{item.jiananAfterInstallCost},
+			#{item.jiananAfterOtherCost},
+			#{item.jiananAfterTotalCost},
+			#{item.jiananRemark},
+			#{item.otherBeforeCost},
+			#{item.otherAfterArchitectureCost},
+			#{item.otherAfterClearCost},
+			#{item.otherAfterOtherCost},
+			#{item.otherAfterTotalCost},
+			#{item.otherRemark},
+			#{item.type}
+			)
+        </foreach>
+	</insert>
+	
+	<update id="update">
+		UPDATE work_preliminary_design_estimate SET
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			remarks = #{remarks},
+			del_flag = #{delFlag},
+			project_id = #{projectId},
+			content_id = #{contentId},
+			cost_name = #{costName},
+			jianan_before_cost = #{jiananBeforeCost},
+			jianan_after_architecture_cost = #{jiananAfterArchitectureCost},
+			jianan_after_install_cost = #{jiananAfterInstallCost},
+			jianan_after_other_cost = #{jiananAfterOtherCost},
+			jianan_after_total_cost = #{jiananAfterTotalCost},
+			jianan_remark = #{jiananRemark},
+			other_before_cost = #{otherBeforeCost},
+			other_after_architecture_cost = #{otherAfterArchitectureCost},
+			other_after_clear_cost = #{otherAfterClearCost},
+			other_after_other_cost = #{otherAfterOtherCost},
+			other_after_total_cost = #{otherAfterTotalCost},
+			other_remark = #{otherRemark},
+			type = #{type}
+		WHERE id = #{id}
+	</update>
+	
+	
+	<!--物理删除-->
+	<update id="delete">
+		DELETE FROM work_preliminary_design_estimate
+		WHERE id = #{id}
+	</update>
+	
+	<!--逻辑删除-->
+	<update id="deleteByLogic">
+		UPDATE work_preliminary_design_estimate SET
+			del_flag = #{DEL_FLAG_DELETE}
+		WHERE id = #{id}
+	</update>
+
+	<delete id="deleteByContentId">
+		DELETE FROM work_preliminary_design_estimate
+		WHERE content_id = #{id}
+	</delete>
+	
+	
+	<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
+	<select id="findUniqueByProperty" resultType="com.jeeplus.modules.workcontent.entity.WorkPreliminaryDesignEstimate" statementType="STATEMENT">
+		select * FROM work_preliminary_design_estimate  where ${propertyName} = '${value}'
+	</select>
+
+	<select id="getTableType" resultType="java.lang.String">
+		select a.type from(
+		select DISTINCT(wpde.type) as type from work_preliminary_design_estimate wpde where wpde.del_flag = 0 and wpde.content_id = #{contentId}
+		) a
+	</select>
+
+</mapper>

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

@@ -49,6 +49,20 @@
             $(document.getElementById("projectContentDataType")).removeAttr("disabled");
         }
 
+        /*function beforeSubmit() {
+            var contentDetaStr = '';
+            if(null !=encodeURIComponent(genDetailStr()) && '' != encodeURIComponent(genDetailStr())){
+                contentDetaStr += encodeURIComponent(genDetailStr());
+            }
+            if(null !=encodeURIComponent(genDetailResultStr()) && '' != encodeURIComponent(genDetailResultStr())){
+                contentDetaStr += encodeURIComponent(genDetailResultStr());
+            }
+            if(detailFlag==1){
+                $("#contentDeta").val(contentDetaStr);
+            }
+            $(document.getElementById("projectContentDataType")).removeAttr("disabled");
+        }*/
+
         $(function() {
             var editVal = '${projectcontentinfo.edit}';
             // if('edit'==editVal){

+ 239 - 0
src/main/webapp/webpage/modules/workcontent/workPreliminaryDesignEstimateList.jsp

@@ -0,0 +1,239 @@
+<%@ 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 jiananAfterArchitectureCost=$("#preliminaryList"+index+"_jiananAfterArchitectureCost").val();
+        var jiananAfterInstallCost=$("#preliminaryList"+index+"_jiananAfterInstallCost").val();
+        var jiananAfterOtherCost=$("#preliminaryList"+index+"_jiananAfterOtherCost").val();
+        if(jiananAfterArchitectureCost==undefined||!isNumber(jiananAfterArchitectureCost)||jiananAfterArchitectureCost==''){
+            jiananAfterArchitectureCost=0;
+        }
+        if(jiananAfterInstallCost==undefined||!isNumber(jiananAfterInstallCost)||jiananAfterInstallCost==''){
+            jiananAfterInstallCost=0;
+        }
+        if(jiananAfterOtherCost==undefined||!isNumber(jiananAfterOtherCost)||jiananAfterOtherCost==''){
+            jiananAfterOtherCost=0;
+        }
+        var total=(parseFloat(jiananAfterArchitectureCost) + parseFloat(jiananAfterInstallCost)+parseFloat(jiananAfterOtherCost)).toFixed(2);
+        $("#preliminaryList"+index+"_jiananAfterTotalCost").val(total);
+
+        if(!isNumber(val))return;
+    }
+    function formatOtherNumMoney(obj,index) {
+        var val = $(obj).val();
+        var otherAfterArchitectureCost=$("#preliminaryList"+index+"_otherAfterArchitectureCost").val();
+        var otherAfterClearCost=$("#preliminaryList"+index+"_otherAfterClearCost").val();
+        var otherAfterOtherCost=$("#preliminaryList"+index+"_otherAfterOtherCost").val();
+        if(otherAfterArchitectureCost==undefined||!isNumber(otherAfterArchitectureCost)||otherAfterArchitectureCost==''){
+            otherAfterArchitectureCost=0;
+        }
+        if(otherAfterClearCost==undefined||!isNumber(otherAfterClearCost)||otherAfterClearCost==''){
+            otherAfterClearCost=0;
+        }
+        if(otherAfterOtherCost==undefined||!isNumber(otherAfterOtherCost)||otherAfterOtherCost==''){
+            otherAfterOtherCost=0;
+        }
+        var total=(parseFloat(otherAfterArchitectureCost) + parseFloat(otherAfterClearCost)+parseFloat(otherAfterOtherCost)).toFixed(2);
+        $("#preliminaryList"+index+"_otherAfterTotalCost").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 =='preliminary'}">
+            <div class="layui-item nav-btns" style="padding-left:0px;">
+                <a class="nav-btn nav-btn-add" onclick="addRowCost('#preliminaryList',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="15" style="font-size: 20px">输变电工程初步设计概算审查汇总表</th>
+                    </tr>
+                    <tr>
+                        <th rowspan="3" class="hide"></th>
+                        <th rowspan="3" >序号</th>
+                        <th rowspan="3" >工程或费用名称</th>
+                        <th colspan="6" >建安工程(万元)</th>
+                        <th colspan="6">其他费用(万元)</th>
+                        <th width="60" rowspan="3">操作</th>
+                    </tr>
+                    <tr>
+                        <th rowspan="2">评审前</th>
+                        <th colspan="4">评审后</th>
+                        <th rowspan="2">备注</th>
+                        <th rowspan="2">评审前</th>
+                        <th colspan="4">评审后</th>
+                        <th rowspan="2">备注</th>
+                    </tr>
+                    <tr>
+                        <th>建筑工程费</th>
+                        <th>安装工程费</th>
+                        <th>其他费用</th>
+                        <th>合计</th>
+                        <th>建设工程其他费用</th>
+                        <th>场地征用清理费用</th>
+                        <th>其他费用</th>
+                        <th>合计</th>
+                    </tr>
+                </thead>
+                <tbody id="preliminaryList">
+                </tbody>
+            </table>
+        </c:if>
+    </c:forEach>
+	<script type="text/template" id="preliminaryTpl">//<!--
+        <tr id="preliminaryList{{idx}}">
+            <td class="hide">
+                <input id="preliminaryList{{idx}}_id" subName="id" class="contentDetail" type="hidden" value="{{row.id}}"/>
+                <input id="preliminaryList{{idx}}_delFlag" subName="delFlag" class="contentDetail" type="hidden" value="0"/>
+                <input id="preliminaryList{{idx}}_costType" subName="costType" class="contentDetail"  type="hidden" value="{{row.costType}}"/>
+                <input id="preliminaryList{{idx}}_type" subName="type" class="contentDetail"  type="hidden" value="preliminary"/>
+            </td>
+            <td>
+                <input id="preliminaryList{{idx}}_costNum" subName="costNum" readonly="readonly" style="text-align: center"  value="{{idx}}" type="text" class="form-control contentDetail"/>
+            </td>
+            <td>
+                <input id="preliminaryList{{idx}}_costName" subName="costName" value="{{row.costName}}" type="text" class="form-control contentDetail"/>
+            </td>
+            <td>
+                <input id="preliminaryList{{idx}}_jiananBeforeCost" subName="jiananBeforeCost" type="text" value="{{row.jiananBeforeCost}}"  class="form-control number contentDetail money"/>
+            </td>
+            <td>
+                <input id="preliminaryList{{idx}}_jiananAfterArchitectureCost" subName="jiananAfterArchitectureCost" type="text" value="{{row.jiananAfterArchitectureCost}}"   onchange="formatJiananNumMoney(this,{{idx}});" class="form-control number contentDetail money"/>
+            </td>
+            <td>
+                <input id="preliminaryList{{idx}}_jiananAfterInstallCost" subName="jiananAfterInstallCost" type="text" value="{{row.jiananAfterInstallCost}}"  onchange="formatJiananNumMoney(this,{{idx}});"  class="form-control number contentDetail money"/>
+            </td>
+            <td>
+                <input id="preliminaryList{{idx}}_jiananAfterOtherCost" subName="jiananAfterOtherCost" type="text"  value="{{row.jiananAfterOtherCost}}"  onchange="formatJiananNumMoney(this,{{idx}});" class="form-control number  contentDetail money"/>
+            </td>
+            <td>
+                <input id="preliminaryList{{idx}}_jiananAfterTotalCost" readonly="readonly" subName="jiananAfterTotalCost" type="text"    value="{{row.jiananAfterTotalCost}}" class="form-control number contentDetail"/>
+            </td>
+            <td>
+                <input id="preliminaryList{{idx}}_jiananRemark" subName="jiananRemark" type="text"  value="{{row.jiananRemark}}" class="form-control contentDetail"/>
+            </td>
+            <td>
+                <input id="preliminaryList{{idx}}_otherBeforeCost" subName="otherBeforeCost" type="text"  value="{{row.otherBeforeCost}}" class="form-control number contentDetail"/>
+            </td>
+            <td>
+                <input id="preliminaryList{{idx}}_otherAfterArchitectureCost" subName="otherAfterArchitectureCost" type="text"  value="{{row.otherAfterArchitectureCost}}" onchange="formatOtherNumMoney(this,{{idx}});" class="form-control number contentDetail"/>
+            </td>
+            <td>
+                <input id="preliminaryList{{idx}}_otherAfterClearCost" subName="otherAfterClearCost" type="text"  value="{{row.otherAfterClearCost}}" onchange="formatOtherNumMoney(this,{{idx}});" class="form-control number contentDetail"/>
+            </td>
+            <td>
+                <input id="preliminaryList{{idx}}_otherAfterOtherCost" subName="otherAfterOtherCost" type="text"  value="{{row.otherAfterOtherCost}}" onchange="formatOtherNumMoney(this,{{idx}});" class="form-control  contentDetail"/>
+            </td>
+            <td>
+                <input id="preliminaryList{{idx}}_otherAfterTotalCost" readonly="readonly" subName="otherAfterTotalCost" type="text"  value="{{row.otherAfterTotalCost}}" class="form-control  contentDetail"/>
+            </td>
+            <td>
+                <input id="preliminaryList{{idx}}_otherRemark" subName="otherRemark" type="text"  value="{{row.otherRemark}}" class="form-control  contentDetail"/>
+            </td>
+            <td class="text-center op-td">
+                        <a href="#" onclick="delRow(this, '#preliminaryList{{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(preliminaryList)};
+            for (var i=0; i<data.length; i++){
+                addRowCost('#preliminaryList', preliminaryIdx, preliminaryTpl,data[i]);
+                $("#preliminaryList"+i+"_nodeTypes").val(data[i].nodeTypes);
+                $("#preliminaryList"+i+"_expenseType").val(data[i].expenseType);
+                $("#preliminaryList"+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 = $("#preliminaryList 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('#preliminaryList',preliminaryIdx,preliminaryTpl,data[i]);
+            }
+            $(":input.money").change();
+        }
+
+        function genDetailStr(){
+            var costList = $("#preliminaryList 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;
+        }
+    </script>
+</form>

+ 88 - 0
src/main/webapp/webpage/modules/workcontent/workPreliminaryDesignEstimateListView.jsp

@@ -0,0 +1,88 @@
+<%@ 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 =='preliminary'}">
+            <table id="contentTable" class="table table-bordered table-condensed">
+                <thead>
+                    <tr>
+                        <th colspan="14" style="font-size: 20px">输变电工程初步设计概算审查汇总表</th>
+                    </tr>
+                    <tr>
+                        <th rowspan="3" class="hide"></th>
+                        <th rowspan="3" >序号</th>
+                        <th rowspan="3" >工程或费用名称</th>
+                        <th colspan="6" >建安工程(万元)</th>
+                        <th colspan="6">其他费用(万元)</th>
+                    </tr>
+                    <tr>
+                        <th rowspan="2">评审前</th>
+                        <th colspan="4">评审后</th>
+                        <th rowspan="2">备注</th>
+                        <th rowspan="2">评审前</th>
+                        <th colspan="4">评审后</th>
+                        <th rowspan="2">备注</th>
+                    </tr>
+                    <tr>
+                        <th>建筑工程费</th>
+                        <th>安装工程费</th>
+                        <th>其他费用</th>
+                        <th>合计</th>
+                        <th>建设工程其他费用</th>
+                        <th>场地征用清理费用</th>
+                        <th>其他费用</th>
+                        <th>合计</th>
+                    </tr>
+                </thead>
+                <tbody id="preliminaryList">
+                <c:forEach items="${preliminaryList}" var="row" varStatus="status">
+                    <tr>
+                        <td style='text-align:center;'>
+                                ${status.index+1}
+                        </td>
+                        <td style='text-align:center;'>
+                                ${row.costName}
+                        </td>
+                        <td style='text-align:center;'>
+                            <fmt:formatNumber value="${row.jiananBeforeCost}" pattern="#,##0.00#"/>
+                        </td>
+                        <td style='text-align:center;'>
+                            <fmt:formatNumber value="${row.jiananAfterArchitectureCost}" pattern="#,##0.00#"/>
+                        </td>
+                        <td style='text-align:center;'>
+                            <fmt:formatNumber value="${row.jiananAfterInstallCost}" pattern="#,##0.00#"/>
+                        </td>
+                        <td style='text-align:center;'>
+                            <fmt:formatNumber value="${row.jiananAfterOtherCost}" pattern="#,##0.00#"/>
+                        </td>
+                        <td style='text-align:center;'>
+                            <fmt:formatNumber value="${row.jiananAfterTotalCost}" pattern="#,##0.00#"/>
+                        </td>
+                        <td style='text-align:center;'>
+                                 ${row.jiananRemark}
+                        </td>
+                        <td style='text-align:center;'>
+                            <fmt:formatNumber value="${row.otherBeforeCost}" pattern="#,##0.00#"/>
+                        </td>
+                        <td style='text-align:center;'>
+                            <fmt:formatNumber value="${row.otherAfterArchitectureCost}" pattern="#,##0.00#"/>
+                        </td>
+                        <td style='text-align:center;'>
+                            <fmt:formatNumber value="${row.otherAfterClearCost}" pattern="#,##0.00#"/>
+                        </td>
+                        <td style='text-align:center;'>
+                            <fmt:formatNumber value="${row.otherAfterOtherCost}" pattern="#,##0.00#"/>
+                        </td>
+                        <td style='text-align:center;'>
+                            <fmt:formatNumber value="${row.otherAfterTotalCost}" pattern="#,##0.00#"/>
+                        </td>
+                        <td style='text-align:center;'>
+                                ${row.otherRemark}
+                        </td>
+                    </tr>
+                </c:forEach>
+                </tbody>
+            </table>
+        </c:if>
+    </c:forEach>
+</form>