Selaa lähdekoodia

工作内容-施工单位工程款支付明细表页面

user5 5 vuotta sitten
vanhempi
commit
1ebb81678d

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

@@ -46,6 +46,8 @@ public class WorkContentDetailFactory {
     private static WorkContentBranchAccountService workContentBranchAccountService=SpringContextHolder.getBean(WorkContentBranchAccountService.class);
     //输变电工程竣工结算
     private static WorkContentCompleteAccountService workContentCompleteAccountService=SpringContextHolder.getBean(WorkContentCompleteAccountService.class);
+    //施工单位工程款支付明细表
+    private static WorkScheduleService workScheduleService=SpringContextHolder.getBean(WorkScheduleService.class);
 
     public static WorkContentDetailBaseService getDetailService(String type){
         switch (type){
@@ -90,6 +92,8 @@ public class WorkContentDetailFactory {
                 return workContentBranchAccountService;
             case "510":
                 return workContentCompleteAccountService;
+            case "420":
+                return workScheduleService;
             default:
                 return null;
         }

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

+ 176 - 0
src/main/java/com/jeeplus/modules/workcontent/entity/WorkScheduleInfo.java

@@ -0,0 +1,176 @@
+/**
+ * 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 WorkScheduleInfo extends DataEntity<WorkScheduleInfo> {
+
+	private static final long serialVersionUID = 1L;
+	private String projectId;		// 项目id
+	private String contentId;		// 工作内容ID
+
+	@NumberFormat(style = NumberFormat.Style.CURRENCY)
+	private Double contractMoney;		// 签约合同价款
+    @NumberFormat(style = NumberFormat.Style.CURRENCY)
+	private Double beforeCumulativeCompletionMoney;		// 已累计完成价款
+    @NumberFormat(style = NumberFormat.Style.CURRENCY)
+	private Double beforeTotalPaymentMoney;		// 已累计支付价款
+	@NumberFormat(style = NumberFormat.Style.CURRENCY)
+	private Double beforePayRatio;		// 支付比例
+
+    @NumberFormat(style = NumberFormat.Style.CURRENCY)
+	private Double currentAccomplishMoney;		// 完成价款
+    @NumberFormat(style = NumberFormat.Style.CURRENCY)
+	private Double currentAppointPayMoney;		// 按约定比例应支付价款
+	@NumberFormat(style = NumberFormat.Style.CURRENCY)
+	private Double currentShouldDeductPrepayMoney;		// 应扣预付款
+	@NumberFormat(style = NumberFormat.Style.CURRENCY)
+	private Double currentShouldDeductMoney;		// 其他应扣款
+	@NumberFormat(style = NumberFormat.Style.CURRENCY)
+	private Double currentPracticalPayMoney;		// 实际应支付
+
+	@NumberFormat(style = NumberFormat.Style.CURRENCY)
+	private Double currentCumulativeCompletionMoney;		// 已累计完成价款
+	@NumberFormat(style = NumberFormat.Style.CURRENCY)
+	private Double currentTotalPaymentMoney;		// 已累计支付价款
+	private String currentPayRatio;		// 支付比例
+	private String type;          //数据状态
+
+	public WorkScheduleInfo() {
+		super();
+	}
+
+	public WorkScheduleInfo(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 Double getContractMoney() {
+		return contractMoney;
+	}
+
+	public void setContractMoney(Double contractMoney) {
+		this.contractMoney = contractMoney;
+	}
+
+	public Double getBeforeCumulativeCompletionMoney() {
+		return beforeCumulativeCompletionMoney;
+	}
+
+	public void setBeforeCumulativeCompletionMoney(Double beforeCumulativeCompletionMoney) {
+		this.beforeCumulativeCompletionMoney = beforeCumulativeCompletionMoney;
+	}
+
+	public Double getBeforeTotalPaymentMoney() {
+		return beforeTotalPaymentMoney;
+	}
+
+	public void setBeforeTotalPaymentMoney(Double beforeTotalPaymentMoney) {
+		this.beforeTotalPaymentMoney = beforeTotalPaymentMoney;
+	}
+
+	public Double getBeforePayRatio() {
+		return beforePayRatio;
+	}
+
+	public void setBeforePayRatio(Double beforePayRatio) {
+		this.beforePayRatio = beforePayRatio;
+	}
+
+	public Double getCurrentAccomplishMoney() {
+		return currentAccomplishMoney;
+	}
+
+	public void setCurrentAccomplishMoney(Double currentAccomplishMoney) {
+		this.currentAccomplishMoney = currentAccomplishMoney;
+	}
+
+	public Double getCurrentAppointPayMoney() {
+		return currentAppointPayMoney;
+	}
+
+	public void setCurrentAppointPayMoney(Double currentAppointPayMoney) {
+		this.currentAppointPayMoney = currentAppointPayMoney;
+	}
+
+	public Double getCurrentShouldDeductMoney() {
+		return currentShouldDeductMoney;
+	}
+
+	public void setCurrentShouldDeductMoney(Double currentShouldDeductMoney) {
+		this.currentShouldDeductMoney = currentShouldDeductMoney;
+	}
+
+	public Double getCurrentPracticalPayMoney() {
+		return currentPracticalPayMoney;
+	}
+
+	public void setCurrentPracticalPayMoney(Double currentPracticalPayMoney) {
+		this.currentPracticalPayMoney = currentPracticalPayMoney;
+	}
+
+	public Double getCurrentCumulativeCompletionMoney() {
+		return currentCumulativeCompletionMoney;
+	}
+
+	public void setCurrentCumulativeCompletionMoney(Double currentCumulativeCompletionMoney) {
+		this.currentCumulativeCompletionMoney = currentCumulativeCompletionMoney;
+	}
+
+	public Double getCurrentTotalPaymentMoney() {
+		return currentTotalPaymentMoney;
+	}
+
+	public void setCurrentTotalPaymentMoney(Double currentTotalPaymentMoney) {
+		this.currentTotalPaymentMoney = currentTotalPaymentMoney;
+	}
+
+	public String getCurrentPayRatio() {
+		return currentPayRatio;
+	}
+
+	public void setCurrentPayRatio(String currentPayRatio) {
+		this.currentPayRatio = currentPayRatio;
+	}
+
+	public Double getCurrentShouldDeductPrepayMoney() {
+		return currentShouldDeductPrepayMoney;
+	}
+
+	public void setCurrentShouldDeductPrepayMoney(Double currentShouldDeductPrepayMoney) {
+		this.currentShouldDeductPrepayMoney = currentShouldDeductPrepayMoney;
+	}
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+}

+ 78 - 0
src/main/java/com/jeeplus/modules/workcontent/service/WorkScheduleService.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.WorkPreliminaryDesignEstimateDao;
+import com.jeeplus.modules.workcontent.dao.WorkScheduleDao;
+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 WorkScheduleService extends CrudService<WorkScheduleDao, WorkScheduleInfo> implements WorkContentDetailBaseService{
+
+	public WorkScheduleInfo get(String id) {
+		return super.get(id);
+	}
+	
+	public List<WorkScheduleInfo> findList(WorkScheduleInfo workPreliminaryDesignEstimate) {
+		return super.findList(workPreliminaryDesignEstimate);
+	}
+	
+	public Page<WorkScheduleInfo> findPage(Page<WorkScheduleInfo> page, WorkScheduleInfo workPreliminaryDesignEstimate) {
+		return super.findPage(page, workPreliminaryDesignEstimate);
+	}
+	
+	@Transactional(readOnly = false)
+	public void save(WorkScheduleInfo workPreliminaryDesignEstimate) {
+		super.save(workPreliminaryDesignEstimate);
+	}
+	
+	@Transactional(readOnly = false)
+	public void delete(WorkScheduleInfo 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<WorkScheduleInfo> preliminaryDesignEstimateList = JSON.parseArray(detailStr, WorkScheduleInfo.class);
+        for (WorkScheduleInfo 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;
+	}
+
+}

+ 138 - 0
src/main/java/com/jeeplus/modules/workcontent/web/WorkScheduleController.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.WorkPreliminaryDesignEstimate;
+import com.jeeplus.modules.workcontent.entity.WorkScheduleInfo;
+import com.jeeplus.modules.workcontent.service.WorkPreliminaryDesignEstimateService;
+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}/workSchedule/workSchedule")
+public class WorkScheduleController extends BaseController {
+
+	@Autowired
+	private WorkScheduleService workScheduleService;
+	
+	@ModelAttribute
+	public WorkScheduleInfo get(@RequestParam(required=false) String id) {
+		WorkScheduleInfo entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = workScheduleService.get(id);
+		}
+		if (entity == null){
+			entity = new WorkScheduleInfo();
+		}
+		return entity;
+	}
+	
+	/**
+	 * 工程费用列表页面
+	 */
+	@RequestMapping(value = {"list", ""})
+	public String list(WorkScheduleInfo 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<WorkScheduleInfo> list = new ArrayList<>();
+        if(StringUtils.isNotBlank(workScheduleInfo.getContentId())){
+            list = workScheduleService.findList(workScheduleInfo);
+        }
+        model.addAttribute("signList", signList);
+        model.addAttribute("workScheduleList", list);
+        String viewPath = "modules/workcontent/workScheduleList";
+        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 = workScheduleService.getTableType(contentId);
+		return tableType;
+	}
+
+	/**
+	 * 导入Excel数据
+	 */
+	@ResponseBody
+    @RequestMapping(value = "import", method=RequestMethod.POST)
+    public Object importFile(MultipartFile file, RedirectAttributes redirectAttributes) {
+        ResponseEntity<WorkScheduleInfo> responseEntity = new ResponseEntity<>();
+		try {
+			ImportExcel ei = new ImportExcel(file, 1, 0);
+            List<WorkScheduleInfo> list = ei.getDataList(WorkScheduleInfo.class);
+			List<WorkScheduleInfo> listAll = new ArrayList<>();
+			for (WorkScheduleInfo investmentCost : list) {
+				if(null != investmentCost.getContractMoney() && null != investmentCost.getBeforeCumulativeCompletionMoney() && null != investmentCost.getBeforeTotalPaymentMoney() && null != investmentCost.getBeforePayRatio()){
+					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()+"/workSchedule/workSchedule/?repage";
+    }
+	
+}

+ 235 - 0
src/main/resources/mappings/modules/workcontent/WorkScheduleDao.xml

@@ -0,0 +1,235 @@
+<?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.WorkScheduleDao">
+    
+	<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.contract_money as "contractMoney",
+		a.before_cumulative_completion_money as "beforeCumulativeCompletionMoney",
+		a.before_total_payment_money as "beforeTotalPaymentMoney",
+		a.before_pay_ratio as "beforePayRatio",
+		a.current_accomplish_money as "currentAccomplishMoney",
+		a.current_appoint_pay_money as "currentAppointPayMoney",
+		a.current_should_deduct_prepay_money as "currentShouldDeductPrepayMoney",
+		a.current_should_deduct_money as "currentShouldDeductMoney",
+		a.current_practical_pay_money as "currentPracticalPayMoney",
+		a.current_cumulative_completion_money as "currentCumulativeCompletionMoney",
+		a.current_total_payment_money as "currentTotalPaymentMoney",
+		a.current_pay_ratio as "currentPayRatio",
+		a.type as "type"
+	</sql>
+	
+
+	<select id="get" resultType="com.jeeplus.modules.workcontent.entity.WorkScheduleInfo" >
+		SELECT 
+			<include refid="workPreliminaryDesignEstimateColumns"/>
+		FROM work_schedule_info a
+		WHERE a.id = #{id}
+	</select>
+	
+	<select id="findList" resultType="com.jeeplus.modules.workcontent.entity.WorkScheduleInfo" >
+		SELECT 
+			<include refid="workPreliminaryDesignEstimateColumns"/>
+		FROM work_schedule_info 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.WorkScheduleInfo" >
+		SELECT 
+			<include refid="workPreliminaryDesignEstimateColumns"/>
+		FROM work_schedule_info 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_schedule_info(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag,
+			project_id,
+			content_id,
+			contract_money,
+			before_cumulative_completion_money,
+			before_total_payment_money,
+			before_pay_ratio,
+			current_accomplish_money,
+			current_appoint_pay_money,
+			current_should_deduct_prepay_money,
+			current_should_deduct_money,
+			current_practical_pay_money,
+			current_cumulative_completion_money,
+			current_total_payment_money,
+			current_pay_ratio,
+			type
+		) VALUES (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag},
+			#{projectId},
+			#{contentId},
+            #{contractMoney},
+			#{beforeCumulativeCompletionMoney},
+			#{beforeTotalPaymentMoney},
+			#{beforePayRatio},
+			#{currentAccomplishMoney},
+			#{currentAppointPayMoney},
+			#{currentShouldDeductPrepayMoney},
+			#{currentShouldDeductMoney},
+			#{currentPracticalPayMoney},
+			#{currentCumulativeCompletionMoney},
+			#{currentTotalPaymentMoney},
+			#{currentPayRatio},
+            #{type}
+		)
+	</insert>
+
+    <insert id="batchInsert" parameterType="java.util.List">
+		INSERT INTO work_schedule_info(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag,
+			project_id,
+			content_id,
+			contract_money,
+			before_cumulative_completion_money,
+			before_total_payment_money,
+			before_pay_ratio,
+			current_accomplish_money,
+			current_appoint_pay_money,
+			current_should_deduct_prepay_money,
+			current_should_deduct_money,
+			current_practical_pay_money,
+			current_cumulative_completion_money,
+			current_total_payment_money,
+			current_pay_ratio,
+			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.contractMoney},
+			#{item.beforeCumulativeCompletionMoney},
+			#{item.beforeTotalPaymentMoney},
+			#{item.beforePayRatio},
+			#{item.currentAccomplishMoney},
+			#{item.currentAppointPayMoney},
+			#{item.currentShouldDeductPrepayMoney},
+			#{item.currentShouldDeductMoney},
+			#{item.currentPracticalPayMoney},
+			#{item.currentCumulativeCompletionMoney},
+			#{item.currentTotalPaymentMoney},
+			#{item.currentPayRatio},
+			#{item.type}
+			)
+        </foreach>
+	</insert>
+	
+	<update id="update">
+		UPDATE work_schedule_info SET
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			remarks = #{remarks},
+			del_flag = #{delFlag},
+			project_id = #{projectId},
+			content_id = #{contentId},
+			contract_money = #{contractMoney},
+			before_cumulative_completion_money = #{beforeCumulativeCompletionMoney},
+			before_total_payment_money = #{beforeTotalPaymentMoney},
+			before_pay_ratio = #{beforePayRatio},
+			current_accomplish_money = #{currentAccomplishMoney},
+			current_appoint_pay_money = #{currentAppointPayMoney},
+			current_should_deduct_prepay_money = #{currentShouldDeductPrepayMoney},
+			current_should_deduct_money = #{currentShouldDeductMoney},
+			current_practical_pay_money = #{currentPracticalPayMoney},
+			current_cumulative_completion_money = #{currentCumulativeCompletionMoney},
+			current_total_payment_money = #{currentTotalPaymentMoney},
+			current_pay_ratio = #{currentPayRatio},
+			type = #{type}
+		WHERE id = #{id}
+	</update>
+	
+	
+	<!--物理删除-->
+	<update id="delete">
+		DELETE FROM work_schedule_info
+		WHERE id = #{id}
+	</update>
+	
+	<!--逻辑删除-->
+	<update id="deleteByLogic">
+		UPDATE work_schedule_info SET
+			del_flag = #{DEL_FLAG_DELETE}
+		WHERE id = #{id}
+	</update>
+
+	<delete id="deleteByContentId">
+		DELETE FROM work_schedule_info
+		WHERE content_id = #{id}
+	</delete>
+	
+	
+	<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
+	<select id="findUniqueByProperty" resultType="com.jeeplus.modules.workcontent.entity.WorkScheduleInfo" statementType="STATEMENT">
+		select * FROM work_schedule_info  where ${propertyName} = '${value}'
+	</select>
+
+	<select id="getTableType" resultType="java.lang.String">
+		select a.type from(
+		select DISTINCT(wpde.type) as type from work_schedule_info wpde where wpde.del_flag = 0 and wpde.content_id = #{contentId}
+		) a
+	</select>
+
+</mapper>

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

@@ -250,6 +250,9 @@
                 case '510':
                     $("#contentDetail").load("${ctx}/workContent/workContentCompleteAccount/list",param2);
                     break;
+                case '420':
+                    $("#contentDetail").load("${ctx}/workSchedule/workSchedule/list",param2);
+                    break;
                 default:
                     detailFlag=0;
                     $("#contentDetail").html("");
@@ -1035,6 +1038,8 @@
             /*新加代码*/
             case '510':
                 return  "${ctx}/workContent/workContentCompleteAccount/getTableType";
+            case '420':
+                return "${ctx}/workSchedule/workSchedule/getTableType";
             default:
                 return "";
         }
@@ -1116,6 +1121,9 @@
             case '510':
                 $("#contentDetail").load("${ctx}/workContent/workContentCompleteAccount/list",param2);
                 break;
+            case '420':
+                $("#contentDetail").load("${ctx}/workSchedule/workSchedule/list",param2);
+                break;
             default:
                 detailFlag=0;
                 $("#contentDetail").html("");
@@ -1198,6 +1206,9 @@
             case '510':
                 $("#contentDetail").load("${ctx}/workContent/workContentCompleteAccount/list",param2);
                 break;
+            case '420':
+                $("#contentDetail").load("${ctx}/workSchedule/workSchedule/list",param2);
+                break;
             default:
                 detailFlag=0;
                 $("#contentDetail").html("");

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

@@ -219,6 +219,9 @@
                 case '510':
                     $("#contentDetail").load("${ctx}/workContent/workContentCompleteAccount/list",param2);
                     break;
+                case '420':
+                    $("#contentDetail").load("${ctx}/workSchedule/workSchedule/list",param2);
+                    break;
                 default:
                     detailFlag=0;
                     $("#contentDetail").html("");
@@ -935,6 +938,8 @@
                 return "${ctx}/workcontentbranchaccount/workcontentBranchAccount/getTableType";
             case '510':
                 return "${ctx}/workContent/workContentCompleteAccount/getTableType";
+            case '420':
+                return "${ctx}/workSchedule/workSchedule/getTableType";
                 default:
                 return "";
         }
@@ -1015,6 +1020,9 @@
             case '510':
                 $("#contentDetail").load("${ctx}/workContent/workContentCompleteAccount/list",param2);
                 break;
+            case '420':
+                $("#contentDetail").load("${ctx}/workSchedule/workSchedule/list",param2);
+                break;
             default:
                 detailFlag=0;
                 $("#contentDetail").html("");
@@ -1090,6 +1098,9 @@
             case '510':
                 $("#contentDetail").load("${ctx}/workContent/workContentCompleteAccount/list",param2);
                 break;
+            case '420':
+                $("#contentDetail").load("${ctx}/workSchedule/workSchedule/list",param2);
+                break;
             default:
                 detailFlag=0;
                 $("#contentDetail").html("");

+ 9 - 9
src/main/webapp/webpage/modules/sys/mainDictDetailForm.jsp

@@ -190,18 +190,18 @@
 					<div class="layui-input-block">
 						<form:select id="achievementParentId" path="achievementParentId"  htmlEscape="false"   onchange="changeContentDetail(this)"  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>

+ 238 - 0
src/main/webapp/webpage/modules/workcontent/workScheduleList.jsp

@@ -0,0 +1,238 @@
+<%@ 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 =='workSchedule'}">
+            <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="15" style="font-size: 20px">施工单位工程款支付明细表</th>
+                    </tr>
+                    <tr>
+                        <th rowspan="2" class="hide"></th>
+                        <th rowspan="2" >序号</th>
+                        <th rowspan="2" >签约合同价款</th>
+                        <th colspan="3" >截至上期末</th>
+                        <th colspan="5">本期</th>
+                        <th colspan="3">截至本期末</th>
+                        <th rowspan="2" >备注</th>
+                        <th width="60" rowspan="2">操作</th>
+                    </tr>
+                    <tr>
+                        <th>已累计完成价款</th>
+                        <th>已累计支付价款</th>
+                        <th>支付比例</th>
+                        <th>完成价款</th>
+                        <th>按约定比例应支付价款</th>
+                        <th>应扣预付款</th>
+                        <th>其他应扣款</th>
+                        <th>实际应支付</th>
+                        <th>已累计完成价款</th>
+                        <th>已累计支付价款</th>
+                        <th>支付比例</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="workSchedule"/>
+            </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}}_contractMoney" subName="contractMoney" style="text-align: center"  value="{{row.contractMoney}}" type="text" class="form-control number contentDetail money"/>
+            </td>
+
+            <td>
+                <input id="workScheduleList{{idx}}_beforeCumulativeCompletionMoney" subName="beforeCumulativeCompletionMoney" type="text" value="{{row.beforeCumulativeCompletionMoney}}" onchange="formatJiananNumMoney(this,{{idx}});"  class="form-control number contentDetail money"/>
+            </td>
+            <td>
+                <input id="workScheduleList{{idx}}_beforeTotalPaymentMoney" subName="beforeTotalPaymentMoney" type="text" value="{{row.beforeTotalPaymentMoney}}" onchange="formatJiananNumMoney(this,{{idx}});" class="form-control number contentDetail money"/>
+            </td>
+            <td>
+                <input id="workScheduleList{{idx}}_beforePayRatio" subName="beforePayRatio"  readonly="readonly" type="text" value="{{row.beforePayRatio}}" onchange="formatJiananNumMoney(this,{{idx}});" class="form-control number contentDetail money"/>
+            </td>
+
+            <td>
+                <input id="workScheduleList{{idx}}_currentAccomplishMoney" subName="currentAccomplishMoney" type="text"  value="{{row.currentAccomplishMoney}}" class="form-control number  contentDetail money"/>
+            </td>
+            <td>
+                <input id="workScheduleList{{idx}}_currentAppointPayMoney" subName="currentAppointPayMoney" type="text"    value="{{row.currentAppointPayMoney}}" class="form-control number contentDetail"/>
+            </td>
+            <td>
+                <input id="workScheduleList{{idx}}_currentShouldDeductPrepayMoney" subName="currentShouldDeductPrepayMoney" type="text"    value="{{row.currentShouldDeductPrepayMoney}}" class="form-control number contentDetail"/>
+            </td>
+
+            <td>
+                <input id="workScheduleList{{idx}}_currentShouldDeductMoney" subName="currentShouldDeductMoney" type="text"  value="{{row.currentShouldDeductMoney}}" class="form-control contentDetail"/>
+            </td>
+            <td>
+                <input id="workScheduleList{{idx}}_currentPracticalPayMoney" subName="currentPracticalPayMoney" type="text"  value="{{row.currentPracticalPayMoney}}" class="form-control number contentDetail"/>
+            </td>
+
+            <td>
+                <input id="workScheduleList{{idx}}_currentCumulativeCompletionMoney" subName="currentCumulativeCompletionMoney" type="text"  value="{{row.currentCumulativeCompletionMoney}}" onchange="formatOtherNumMoney(this,{{idx}});" class="form-control number contentDetail"/>
+            </td>
+            <td>
+                <input id="workScheduleList{{idx}}_currentTotalPaymentMoney" subName="currentTotalPaymentMoney" type="text"  value="{{row.currentTotalPaymentMoney}}" onchange="formatOtherNumMoney(this,{{idx}});" class="form-control number contentDetail"/>
+            </td>
+            <td>
+                <input id="workScheduleList{{idx}}_currentPayRatio"  readonly="readonly" subName="currentPayRatio" type="text"  value="{{row.currentPayRatio}}" onchange="formatOtherNumMoney(this,{{idx}});" class="form-control  contentDetail"/>
+            </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>

+ 85 - 0
src/main/webapp/webpage/modules/workcontent/workScheduleListView.jsp

@@ -0,0 +1,85 @@
+<%@ 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 =='workSchedule'}">
+            <table id="contentTable" class="table table-bordered table-condensed">
+                <thead>
+                    <tr>
+                        <th colspan="14" style="font-size: 20px">施工单位工程款支付明细表</th>
+                    </tr>
+                    <tr>
+                        <th rowspan="2" class="hide"></th>
+                        <th rowspan="2" >序号</th>
+                        <th rowspan="2" >签约合同价款</th>
+                        <th colspan="3" >截至上期末</th>
+                        <th colspan="5">本期</th>
+                        <th colspan="3">截至本期末</th>
+                        <th rowspan="2" >备注</th>
+                    </tr>
+                    <tr>
+                        <th>已累计完成价款</th>
+                        <th>已累计支付价款</th>
+                        <th>支付比例</th>
+                        <th>完成价款</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;'>
+                            <fmt:formatNumber value="${row.contractMoney}" pattern="#,##0.00#"/>
+                        </td>
+                        <td style='text-align:center;'>
+                            <fmt:formatNumber value="${row.beforeCumulativeCompletionMoney}" pattern="#,##0.00#"/>
+                        </td>
+                        <td style='text-align:center;'>
+                            <fmt:formatNumber value="${row.beforeTotalPaymentMoney}" pattern="#,##0.00#"/>
+                        </td>
+                        <td style='text-align:center;'>
+                            <fmt:formatNumber value="${row.beforePayRatio}" pattern="#,##0.00#"/>
+                        </td>
+                        <td style='text-align:center;'>
+                            <fmt:formatNumber value="${row.currentAccomplishMoney}" pattern="#,##0.00#"/>
+                        </td>
+                        <td style='text-align:center;'>
+                            <fmt:formatNumber value="${row.currentAppointPayMoney}" pattern="#,##0.00#"/>
+                        </td>
+                        <td style='text-align:center;'>
+                            <fmt:formatNumber value="${row.currentShouldDeductPrepayMoney}" pattern="#,##0.00#"/>
+                        </td>
+                        <td style='text-align:center;'>
+                            <fmt:formatNumber value="${row.currentShouldDeductMoney}" pattern="#,##0.00#"/>
+                        </td>
+                        <td style='text-align:center;'>
+                            <fmt:formatNumber value="${row.currentPracticalPayMoney}" pattern="#,##0.00#"/>
+                        </td>
+                        <td style='text-align:center;'>
+                            <fmt:formatNumber value="${row.currentCumulativeCompletionMoney}" pattern="#,##0.00#"/>
+                        </td>
+                        <td style='text-align:center;'>
+                            <fmt:formatNumber value="${row.currentTotalPaymentMoney}" pattern="#,##0.00#"/>
+                        </td>
+                        <td style='text-align:center;'>
+                            <fmt:formatNumber value="${row.currentPayRatio}" pattern="#,##0.00#"/>
+                        </td>
+                        <td style='text-align:center;'>
+                                ${row.remarks}
+                        </td>
+                    </tr>
+                </c:forEach>
+                </tbody>
+            </table>
+        </c:if>
+    </c:forEach>
+</form>