Просмотр исходного кода

Merge remote-tracking branch 'origin/master'

user5 5 лет назад
Родитель
Сommit
3f4214fc77

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

@@ -42,7 +42,8 @@ public class WorkContentDetailFactory {
     private static WorkContentProjectpriceService projectpriceService = SpringContextHolder.getBean(WorkContentProjectpriceService.class);
     //合约动态生成
     private static WorkContentContractSumService contractsumService = SpringContextHolder.getBean(WorkContentContractSumService.class);
-
+    //输变电功能分布结算
+    private static WorkContentBranchAccountService workContentBranchAccountService=SpringContextHolder.getBean(WorkContentBranchAccountService.class);
     public static WorkContentDetailBaseService getDetailService(String type){
         switch (type){
             case "22":
@@ -82,6 +83,8 @@ public class WorkContentDetailFactory {
                 return workConcealProjectService;
             case "411":
                 return workFiveDirectionsAffirmService;
+            case "412":
+                return workContentBranchAccountService;
             default:
                 return null;
         }

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

+ 280 - 0
src/main/java/com/jeeplus/modules/workcontent/entity/WorkContentBranchAccount.java

@@ -0,0 +1,280 @@
+/**
+ * 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 WorkContentBranchAccount extends DataEntity<WorkContentBranchAccount> {
+
+	private static final long serialVersionUID = 1L;
+	private String projectId;		// 项目id
+	private String contentId;		// 工作内容ID
+
+	private String AccountName;		// 工程费用名称
+    @NumberFormat(style = NumberFormat.Style.CURRENCY)
+	private Double contractAccount;		// 合同价(元)
+    @NumberFormat(style = NumberFormat.Style.CURRENCY)
+	private Double submitAccount;		// 送审价(元)
+    @NumberFormat(style = NumberFormat.Style.CURRENCY)
+	private Double setAccount;		// 定审价(元)
+    @NumberFormat(style = NumberFormat.Style.CURRENCY)
+	private Double businessAdd;		// 核增额(元)
+    @NumberFormat(style = NumberFormat.Style.CURRENCY)
+	private Double businessReduce;		// 核减额(元)
+    @NumberFormat(style = NumberFormat.Style.CURRENCY)
+	private Double businessRate;		// 核增减率%
+
+	private String type;		// 节点类型
+
+	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 getAccountName() {
+		return AccountName;
+	}
+
+	public void setAccountName(String accountName) {
+		AccountName = accountName;
+	}
+
+	public Double getContractAccount() {
+		return contractAccount;
+	}
+
+	public void setContractAccount(Double contractAccount) {
+		this.contractAccount = contractAccount;
+	}
+
+	public Double getSubmitAccount() {
+		return submitAccount;
+	}
+
+	public void setSubmitAccount(Double submitAccount) {
+		this.submitAccount = submitAccount;
+	}
+
+	public Double getSetAccount() {
+		return setAccount;
+	}
+
+	public void setSetAccount(Double setAccount) {
+		this.setAccount = setAccount;
+	}
+
+	public Double getBusinessAdd() {
+		return businessAdd;
+	}
+
+	public void setBusinessAdd(Double businessAdd) {
+		this.businessAdd = businessAdd;
+	}
+
+	public Double getBusinessReduce() {
+		return businessReduce;
+	}
+
+	public void setBusinessReduce(Double businessReduce) {
+		this.businessReduce = businessReduce;
+	}
+
+	public Double getBusinessRate() {
+		return businessRate;
+	}
+
+	public void setBusinessRate(Double businessRate) {
+		this.businessRate = businessRate;
+	}
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+
+	 /*private static final long serialVersionUID = 1L;
+	private String projectId;		// 项目id
+	private String contentId;		// 工作内容ID
+	private String costType;		// 类型:估算-1、概算-2、预算-3
+	private String costNum;		// 编号
+	private String costName;		// 工程费用名称
+	@NumberFormat(style = NumberFormat.Style.CURRENCY)
+	private Double buildindCost;		// 建筑工程费
+	@NumberFormat(style = NumberFormat.Style.CURRENCY)
+	private Double equipmentCost;		// 设备购置费
+	@NumberFormat(style = NumberFormat.Style.CURRENCY)
+	private Double installationCost;		// 安装工程费
+	@NumberFormat(style = NumberFormat.Style.CURRENCY)
+	private Double otherExpenses;		// 其他费用
+	@NumberFormat(style = NumberFormat.Style.CURRENCY)
+	private Double totalCost;		// 合计(万元)
+	private Integer count;		// 数量
+	private String unit;		// 单位
+	private String target;		// 指标
+	private String expenseType;		// 费用类型
+	private String nodeTypes;		// 节点类型
+
+	public WorkContentInvestmentCost() {
+		super();
+	}
+
+	public WorkContentInvestmentCost(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 getCostType() {
+		return costType;
+	}
+
+	public void setCostType(String costType) {
+		this.costType = costType;
+	}
+
+	@ExcelField(title="编号", align=2, sort=10)
+	public String getCostNum() {
+		return costNum;
+	}
+
+	public void setCostNum(String costNum) {
+		this.costNum = costNum;
+	}
+
+	@ExcelField(title="工程费用名称", align=2, sort=11)
+	public String getCostName() {
+		return costName;
+	}
+
+	public void setCostName(String costName) {
+		this.costName = costName;
+	}
+
+	@ExcelField(title="建筑工程费", align=2, sort=12)
+	public Double getBuildindCost() {
+		return buildindCost;
+	}
+
+	public void setBuildindCost(Double buildindCost) {
+		this.buildindCost = buildindCost;
+	}
+
+	@ExcelField(title="设备购置费", align=2, sort=13)
+	public Double getEquipmentCost() {
+		return equipmentCost;
+	}
+
+	public void setEquipmentCost(Double equipmentCost) {
+		this.equipmentCost = equipmentCost;
+	}
+
+	@ExcelField(title="安装工程费", align=2, sort=14)
+	public Double getInstallationCost() {
+		return installationCost;
+	}
+
+	public void setInstallationCost(Double installationCost) {
+		this.installationCost = installationCost;
+	}
+
+	@ExcelField(title="其他费用", align=2, sort=15)
+	public Double getOtherExpenses() {
+		return otherExpenses;
+	}
+
+	public void setOtherExpenses(Double otherExpenses) {
+		this.otherExpenses = otherExpenses;
+	}
+
+	@ExcelField(title="合计(万元)", align=2, sort=16)
+	public Double getTotalCost() {
+		return totalCost;
+	}
+
+	public void setTotalCost(Double totalCost) {
+		this.totalCost = totalCost;
+	}
+
+	@ExcelField(title="数量", align=2, sort=17)
+	public Integer getCount() {
+		return count;
+	}
+
+	public void setCount(Integer count) {
+		this.count = count;
+	}
+
+	@ExcelField(title="单位", align=2, sort=18)
+	public String getUnit() {
+		return unit;
+	}
+
+	public void setUnit(String unit) {
+		this.unit = unit;
+	}
+
+	@ExcelField(title="指标", align=2, sort=19)
+	public String getTarget() {
+		return target;
+	}
+
+	public void setTarget(String target) {
+		this.target = target;
+	}
+
+	@ExcelField(title="费用类型", align=2, sort=20)
+	public String getExpenseType() {
+		return expenseType;
+	}
+
+	public void setExpenseType(String expenseType) {
+		this.expenseType = expenseType;
+	}
+
+	@ExcelField(title="节点类型", align=2, sort=21)
+	public String getNodeTypes() {
+		return nodeTypes;
+	}
+
+	public void setNodeTypes(String nodeTypes) {
+		this.nodeTypes = nodeTypes;
+	}*/
+	
+}

+ 75 - 0
src/main/java/com/jeeplus/modules/workcontent/service/WorkContentBranchAccountService.java

@@ -0,0 +1,75 @@
+/**
+ * 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.WorkContentBranchAccountDao;
+import com.jeeplus.modules.workcontent.entity.WorkContentBranchAccount;
+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 WorkContentBranchAccountService extends CrudService<WorkContentBranchAccountDao, WorkContentBranchAccount> implements WorkContentDetailBaseService{
+
+	public WorkContentBranchAccount get(String id) {
+		return super.get(id);
+	}
+	
+	public List<WorkContentBranchAccount> findList(WorkContentBranchAccount workContentBranchAccount) {
+		return super.findList(workContentBranchAccount);
+	}
+	
+	public Page<WorkContentBranchAccount> findPage(Page<WorkContentBranchAccount> page, WorkContentBranchAccount workContentBranchAccount) {
+		return super.findPage(page, workContentBranchAccount);
+	}
+	
+	@Transactional(readOnly = false)
+	public void save(WorkContentBranchAccount workContentBranchAccount) {
+		super.save(workContentBranchAccount);
+	}
+	
+	@Transactional(readOnly = false)
+	public void delete(WorkContentBranchAccount workContentBranchAccount) {
+		super.delete(workContentBranchAccount);
+	}
+	
+    @Override
+    @Transactional(readOnly = false)
+    public void saveDetails(String detailStr, String projectId, String contentId) {
+	    if(StringUtils.isBlank(detailStr)){
+	        return;
+        }
+        List<WorkContentBranchAccount> investmentCostList = JSON.parseArray(detailStr, WorkContentBranchAccount.class);
+        for (WorkContentBranchAccount investmentCost : investmentCostList) {
+            if(WorkContentBranchAccount.DEL_FLAG_DELETE.equals(investmentCost.getDelFlag())){
+                dao.delete(investmentCost);
+                continue;
+            }
+            investmentCost.setContentId(contentId);
+            investmentCost.setProjectId(projectId);
+            this.save(investmentCost);
+        }
+    }
+
+	/**
+	 * 查询数据表中的所有数据类型
+	 * @return
+	 */
+	public List<String> getTableType(String contentId){
+		List<String> tableType = dao.getTableType(contentId);
+		return tableType;
+	}
+
+}

+ 138 - 0
src/main/java/com/jeeplus/modules/workcontent/web/WorkContentBranchAccountController.java

@@ -0,0 +1,138 @@
+/**
+ * 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.WorkContentBranchAccount;
+import com.jeeplus.modules.workcontent.entity.WorkContentInvestmentCost;
+import com.jeeplus.modules.workcontent.service.WorkContentBranchAccountService;
+import com.jeeplus.modules.workcontent.service.WorkContentInvestmentCostService;
+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}/workcontentbranchaccount/workcontentBranchAccount")
+public class WorkContentBranchAccountController extends BaseController {
+
+	@Autowired
+	private WorkContentBranchAccountService workContentBranchAccountService;
+
+	
+	@ModelAttribute
+	public WorkContentBranchAccount get(@RequestParam(required=false) String id) {
+		WorkContentBranchAccount entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = workContentBranchAccountService.get(id);
+		}
+		if (entity == null){
+			entity = new WorkContentBranchAccount();
+		}
+		return entity;
+	}
+	
+	/**
+	 * 工程分部结算页面
+	 */
+	/*@RequiresPermissions("workcontentinvestmentcost:workContentInvestmentCost:list")*/
+	@RequestMapping(value = {"list", ""})
+	public String list(WorkContentBranchAccount workContentBranchAccount, String view, HttpServletRequest request, HttpServletResponse response, Model model) {
+		String sign = request.getParameter("sign");
+		List<String> signList = new ArrayList();
+		if (StringUtils.isNotBlank(sign)){
+			signList = Arrays.asList(sign.split(","));
+		}
+		List<WorkContentBranchAccount> list = new ArrayList<>();
+        if(StringUtils.isNotBlank(workContentBranchAccount.getContentId())){
+            list = workContentBranchAccountService.findList(workContentBranchAccount);
+        }
+        model.addAttribute("signList", signList);
+        model.addAttribute("investmentCostList", list);
+        String viewPath = "modules/workcontent/workContentBranchAccountList";
+        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;
+	}
+
+	/**
+	 * 导入Excel数据
+	*/
+	@ResponseBody
+    @RequestMapping(value = "import", method=RequestMethod.POST)
+    public Object importFile(MultipartFile file, RedirectAttributes redirectAttributes) {
+        ResponseEntity<WorkContentBranchAccount> responseEntity = new ResponseEntity<>();
+		try {
+			ImportExcel ei = new ImportExcel(file, 1, 0);
+            List<WorkContentBranchAccount> list = ei.getDataList(WorkContentBranchAccount.class);
+			List<WorkContentBranchAccount> listAll = new ArrayList<>();
+			for (WorkContentBranchAccount investmentCost : list) {
+				if(StringUtils.isNotBlank(investmentCost.getAccountName()) && null != investmentCost.getContractAccount() && null != investmentCost.getBusinessAdd() && null != investmentCost.getBusinessReduce()&& null != investmentCost.getBusinessRate()&& null != investmentCost.getSubmitAccount()){
+					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<WorkContentBranchAccount> list = Lists.newArrayList();
+    		new ExportExcel("工程分部结算数据", WorkContentBranchAccount.class, 1).setDataList(list).write(response, fileName).dispose();
+    		return null;
+		} catch (Exception e) {
+			addMessage(redirectAttributes, "导入模板下载失败!失败信息:"+e.getMessage());
+		}
+		return "redirect:"+Global.getAdminPath()+"/workcontentbranchAccount/workContentBranchAccount/?repage";
+    }
+	/**
+	 * 查询数据表中的所有数据类型
+	 * @return
+	 */
+	@ResponseBody
+	@RequestMapping(value = "getTableType")
+	public List<String> getTableType(String contentId){
+		List<String> tableType = workContentBranchAccountService.getTableType(contentId);
+		return tableType;
+	}
+	
+}

+ 205 - 0
src/main/resources/mappings/modules/workcontent/WorkContentBranchAccountDao.xml

@@ -0,0 +1,205 @@
+<?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.WorkContentBranchAccountDao">
+    
+	<sql id="workContentBranchAccountColumns">
+		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.account_name AS "accountName",
+		a.contract_account AS "contractAccount",
+		a.submit_account AS "submitAccount",
+		a.set_account AS "setAccount",
+		a.business_add AS "businessAdd",
+		a.business_reduce AS "businessReduce",
+		a.business_rate AS "businessRate",
+		a.type AS "type"
+	</sql>
+	
+    
+	<select id="get" resultType="WorkContentBranchAccount" >
+		SELECT 
+			<include refid="workContentBranchAccountColumns"/>
+		FROM work_content_branchaccount a
+		WHERE a.id = #{id}
+	</select>
+	
+	<select id="findList" resultType="WorkContentBranchAccount" >
+		SELECT 
+			<include refid="workContentBranchAccountColumns"/>
+		FROM work_content_branchaccount 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="WorkContentBranchAccount" >
+		SELECT 
+			<include refid="workContentBranchAccountColumns"/>
+		FROM work_content_branchaccount 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_content_branchaccount(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag,
+			project_id,
+			content_id,
+			account_name,
+			contract_account,
+			submit_account,
+			set_account,
+			business_add,
+			business_reduce,
+			business_rate,
+			type
+		) VALUES (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag},
+			#{projectId},
+			#{contentId},
+            #{accountName},
+            #{contractAccount},
+            #{submitAccount},
+            #{setAccount},
+            #{businessAdd},
+            #{businessReduce},
+            #{businessRate},
+            #{type}
+		)
+	</insert>
+
+    <insert id="batchInsert" parameterType="java.util.List">
+		INSERT INTO work_content_branchaccount(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag,
+			project_id,
+			content_id,
+			account_name,
+			contract_account,
+			submit_account,
+			set_account,
+			business_add,
+			business_reduce,
+			business_rate,
+			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.accountName},
+            #{item.contractAccount},
+            #{item.submitAccount},
+            #{item.setAccount},
+            #{item.businessAdd},
+            #{item.businessReduce},
+            #{item.businessRate},
+            #{item.type}
+            )
+        </foreach>
+	</insert>
+	
+	<update id="update">
+		UPDATE work_content_branchaccount SET
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			remarks = #{remarks},
+			project_id = #{projectId},
+			content_id = #{contentId},
+			account_name = #{accountName},
+			contract_account = #{contractAccount},
+			submit_account = #{submitAccount},
+			set_account = #{setAccount},
+			business_add = #{businessAdd},
+			business_reduce = #{businessReduce},
+			business_rate = #{businessRate},
+			type = #{type}
+		WHERE id = #{id}
+	</update>
+	
+	
+	<!--物理删除-->
+	<update id="delete">
+		DELETE FROM work_content_branchaccount
+		WHERE id = #{id}
+	</update>
+	
+	<!--逻辑删除-->
+	<update id="deleteByLogic">
+		UPDATE work_content_branchaccount SET
+			del_flag = #{DEL_FLAG_DELETE}
+		WHERE id = #{id}
+	</update>
+
+	<delete id="deleteByContentId">
+		DELETE FROM work_content_branchaccount
+		WHERE content_id = #{id}
+	</delete>
+	
+	
+	<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
+	<select id="findUniqueByProperty" resultType="WorkContentBranchAccount" statementType="STATEMENT">
+		select * FROM work_content_branchaccount  where ${propertyName} = '${value}'
+	</select>
+
+	<select id="getTableType" resultType="java.lang.String">
+		select a.type from(
+		select DISTINCT(wwpic.type) as type from work_content_branchaccount wwpic where wwpic.del_flag = 0 and wwpic.content_id = #{contentId}
+		) a
+	</select>
+
+	
+</mapper>

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

@@ -242,6 +242,10 @@
                 case '411':
                     $("#contentDetail").load("${ctx}/fiveDirectionsAffirm/workFiveDirectionsAffirm/list",param2);
                     break;
+                    /*新加代码*/
+                case '412':
+                    $("#contentDetail").load("${ctx}/workcontentbranchaccount/workcontentBranchAccount/list",param2);
+                    break;
                 default:
                     detailFlag=0;
                     $("#contentDetail").html("");
@@ -1021,6 +1025,9 @@
                 return "${ctx}/workConcealProject/workConcealProject/getTableType";
             case '411':
                 return "${ctx}/fiveDirectionsAffirm/workFiveDirectionsAffirm/getTableType";
+            /*新加代码*/
+            case '412':
+                return  "${ctx}/workcontentbranchaccount/workcontentBranchAccount/getTableType";
             default:
                 return "";
         }
@@ -1095,6 +1102,10 @@
             case '411':
                 $("#contentDetail").load("${ctx}/fiveDirectionsAffirm/workFiveDirectionsAffirm/list",param2);
                 break;
+            /*新加代码*/
+            case '412':
+                $("#contentDetail").load("${ctx}/workcontentbranchaccount/workcontentBranchAccount/list",param2);
+                break;
             default:
                 detailFlag=0;
                 $("#contentDetail").html("");
@@ -1165,6 +1176,10 @@
             case '411':
                 $("#contentDetail").load("${ctx}/fiveDirectionsAffirm/workFiveDirectionsAffirm/list",param2);
                 break;
+            /*新加代码*/
+            case '412':
+                $("#contentDetail").load("${ctx}/workcontentbranchaccount/workcontentBranchAccount/list",param2);
+                break;
             default:
                 detailFlag=0;
                 $("#contentDetail").html("");

+ 15 - 1
src/main/webapp/webpage/modules/projectcontentinfo/workContentView.jsp

@@ -153,11 +153,13 @@
             contentDetailTypeShow(obj);
             $("#contentDetailTypeDiv").show();
             $("#projectContentDataSign").val(obj);
-            var param2 = {'contentId':"${projectcontentinfo.projectContentData.id}",'projectId':"${projectcontentinfo.project.id}"};
+            var param2 = {'contentId':"${projectcontentinfo.projectContentData.id}",'projectId':"${projectcontentinfo.project.id}",view:"view"};
             detailFlag=1;
             switch (obj){
                 case '13':
                 case '22':
+                    $("#contentDetail").load("${ctx}/workPreliminary/workPreliminaryDesignEstimate/list",param2);
+                    break;
                 case '25':
                     $("#contentDetail").load("${ctx}/workcontentinvestmentcost/workContentInvestmentCost/list",param2);
                     break;
@@ -209,6 +211,10 @@
                 case '411':
                     $("#contentDetail").load("${ctx}/fiveDirectionsAffirm/workFiveDirectionsAffirm/list",param2);
                     break;
+                /*新加代码*/
+                case '412':
+                    $("#contentDetail").load("${ctx}/workcontentbranchaccount/workcontentBranchAccount/list",param2);
+                    break;
                 default:
                     detailFlag=0;
                     $("#contentDetail").html("");
@@ -921,6 +927,8 @@
                 return "${ctx}/workConcealProject/workConcealProject/getTableType";
             case '411':
                 return "${ctx}/fiveDirectionsAffirm/workFiveDirectionsAffirm/getTableType";
+            case '412':
+                return "${ctx}/workcontentbranchaccount/workcontentBranchAccount/getTableType";
             default:
                 return "";
         }
@@ -995,6 +1003,9 @@
             case '411':
                 $("#contentDetail").load("${ctx}/fiveDirectionsAffirm/workFiveDirectionsAffirm/list",param2);
                 break;
+            case '412':
+                $("#contentDetail").load("${ctx}/workcontentbranchaccount/workContentBranchAccount/list",param2);
+                break;
             default:
                 detailFlag=0;
                 $("#contentDetail").html("");
@@ -1064,6 +1075,9 @@
             case '411':
                 $("#contentDetail").load("${ctx}/fiveDirectionsAffirm/workFiveDirectionsAffirm/list",param2);
                 break;
+            case '412':
+                $("#contentDetail").load("${ctx}/workcontentbranchaccount/workcontentBranchAccount/list",param2);
+                break;
             default:
                 detailFlag=0;
                 $("#contentDetail").html("");

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

@@ -0,0 +1,188 @@
+<%@ 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 =='branchAccount'}">
+            <div class="layui-item nav-btns" style="padding-left:0px;">
+                <a class="nav-btn nav-btn-add" onclick="addRowCost('#investmentCostList',investmentCostIdx,investmentCostTpl)" title="新增"><i class="fa fa-plus"></i> 新增</a>
+                <table:importExcelCost url="${ctx}/workcontentbranchaccount/workContentBranchAccount/import"></table:importExcelCost><!-- 导入按钮 -->
+            </div>
+
+            <table id="contentTable" class="table table-bordered table-condensed can-edit">
+                <thead>
+                    <%--<tr>
+                        <th class="hide"></th>
+                        <th>编号</th>
+                        <th>工程费用名称</th>
+                        <th>建筑工程费</th>
+                        <th>设备购置费</th>
+                        <th>安装工程费</th>
+                        <th>其他费用</th>
+                        <th>合计(万元)</th>
+                        <th>数量</th>
+                        <th>单位</th>
+                        <th>指标</th>
+                        <th>费用类型</th>
+                        <th>节点类型</th>
+                        <th>备注</th>
+                        <th width="60">操作</th>
+                    </tr>--%>
+                    <tr>
+                        <th colspan="9" 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>核增、核减额(%)</th>
+                        <th width="60" rowspan="3">操作</th>
+                    </tr>
+                </thead>
+                <tbody id="investmentCostList">
+                </tbody>
+            </table>
+        </c:if>
+    </c:forEach>
+	<script type="text/template" id="investmentCostTpl">//<!--
+        <tr id="investmentCostList{{idx}}">
+            <td class="hide">
+                <input id="investmentCostList{{idx}}_id" subName="id" class="contentDetail" type="hidden" value="{{row.id}}"/>
+                <input id="investmentCostList{{idx}}_delFlag" subName="delFlag" class="contentDetail" type="hidden" value="0"/>
+                <input id="investmentCostList{{idx}}_type" subName="type" class="contentDetail" type="hidden" value="branchAccount"/>
+                <input id="investmentCostList{{idx}}_costType" subName="costType" class="contentDetail"  type="hidden" value="{{row.costType}}"/>
+            </td>
+            <td>
+                <input id="investmentCostList{{idx}}_costNum" subName="costNum" readonly="readonly" style="text-align: center"  value="{{idx}}" type="text" class="form-control contentDetail"/>
+            </td>
+            <td>
+                <input id="investmentCostList{{idx}}_accountName" subName="accountName" value="{{row.accountName}}" type="text" class="form-control contentDetail"/>
+            </td>
+            <td>
+                <input id="investmentCostList{{idx}}_contractAccount" subName="contractAccount" type="text" value="{{row.contractAccount}}"  class="form-control number contentDetail money"/>
+            </td>
+            <td>
+                <input id="investmentCostList{{idx}}_submitAccount" subName="submitAccount" type="text" value="{{row.submitAccount}}"   class="form-control number contentDetail money"/>
+            </td>
+            <td>
+                <input id="investmentCostList{{idx}}_setAccount" subName="setAccount" type="text" value="{{row.setAccount}}"   class="form-control number contentDetail money"/>
+            </td>
+            <td>
+                <input id="investmentCostList{{idx}}_businessAdd" subName="businessAdd" type="text"  value="{{row.businessAdd}}"  class="form-control number  contentDetail money"/>
+            </td>
+            <td>
+                <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}}" readonly="readonly"  class="form-control number contentDetail"/>
+            </td>
+
+            <td class="text-center op-td">
+                        <a href="#" onclick="delRow(this, '#investmentCostList{{idx}}')"   class="op-btn op-btn-delete"><i class="fa fa-trash"></i> 取消</a>
+            </td>
+        </tr>//-->
+    </script>
+    <script type="text/javascript">
+        var investmentCostIdx = 0, investmentCostTpl = $("#investmentCostTpl").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(investmentCostList)};
+            for (var i=0; i<data.length; i++){
+                addRowCost('#investmentCostList', investmentCostIdx, investmentCostTpl,data[i]);
+                $("#investmentCostList"+i+"_nodeTypes").val(data[i].nodeTypes);
+                $("#investmentCostList"+i+"_expenseType").val(data[i].expenseType);
+                $("#investmentCostList"+i+"_unit").val(data[i].unit);
+            }
+            $(":input.money").change();
+        })
+
+        function addRowCost(list, idx, tpl, row){
+            idx = idx+1;
+            bornTemplete(list, idx, tpl, row, idx);
+            investmentCostIdx +=1;
+        }
+
+        function bornTemplete(list, idx, tpl, row, idx1){
+            var idx1 = $("#investmentCostList 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('#investmentCostList',investmentCostIdx,investmentCostTpl,data[i]);
+            }
+            $(":input.money").change();
+        }
+
+        function genDetailStr(){
+            var costList = $("#investmentCostList 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>

+ 58 - 0
src/main/webapp/webpage/modules/workcontent/workContentBranchAccountListView.jsp

@@ -0,0 +1,58 @@
+<%@ 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 =='branchAccount'}">
+        <table id="contentTable" class="table table-bordered table-condensed">
+            <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>核增、核减额(%)</th>
+                </tr>
+            </thead>
+            <tbody id="investmentCostList">
+            <c:forEach items="${investmentCostList}" var="row" varStatus="status">
+                <tr>
+                    <td style='text-align:center;'>
+                        ${status.index+1}
+                    </td>
+                    <td style='text-align:center;'>
+                        ${row.accountName}
+                    </td>
+                    <td style='text-align:center;'>
+                        <fmt:formatNumber value="${row.contractAccount}" pattern="#,##0.00#"/>
+                    </td>
+                    <td style='text-align:center;'>
+                        <fmt:formatNumber value="${row.submitAccount}" pattern="#,##0.00#"/>
+                    </td>
+                    <td style='text-align:center;'>
+                        <fmt:formatNumber value="${row.setAccount}" pattern="#,##0.00#"/>
+                    </td>
+                    <td style='text-align:center;'>
+                        <fmt:formatNumber value="${row.businessAdd}" pattern="#,##0.00#"/>
+                    </td>
+                    <td style='text-align:center;'>
+                        <fmt:formatNumber value="${row.businessReduce}" pattern="#,##0.00#"/>
+                    </td>
+                    <td style='text-align:center;'>
+                        <fmt:formatNumber value="${row.businessRate}" pattern="#,##0.00#"/>
+                    </td>
+
+
+                </tr>
+            </c:forEach>
+            </tbody>
+        </table>
+    </c:if>
+    </c:forEach>
+</form>