Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/java/com/jeeplus/modules/sg/financial/expense/entity/Expense.java
xs 5 năm trước cách đây
mục cha
commit
3a8f16cd50

+ 7 - 1
src/main/java/com/jeeplus/modules/sg/financial/expense/mapper/ExpenseMapper.java

@@ -5,8 +5,10 @@ package com.jeeplus.modules.sg.financial.expense.mapper;
 
 import com.jeeplus.core.persistence.BaseMapper;
 import com.jeeplus.core.persistence.annotation.MyBatisMapper;
+import com.jeeplus.modules.sg.audit.information.entity.Information;
 import com.jeeplus.modules.sg.financial.erpcredit.entity.ErpCredit;
 import com.jeeplus.modules.sg.financial.expense.entity.Expense;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -17,5 +19,9 @@ public interface ExpenseMapper extends BaseMapper<Expense> {
 
     void insertData(Expense expense);
 
-    void
+    void updateData(Expense expense);
+
+    Expense selectByProjectId(String projectId);
+
+    void insertList(@Param("expense") List<Expense> expenseList);
 }

+ 56 - 4
src/main/java/com/jeeplus/modules/sg/financial/expense/mapper/xml/ExpenseMapper.xml

@@ -24,10 +24,15 @@
     </select>
 
     <select id="findList" resultType="Expense">
-        SELECT
-        <include refid="expenseColumns"/>
-        FROM js_expense_entry a
-        <choose>
+		SELECT
+		<include refid="expenseColumns"/>
+		FROM js_expense_entry a
+		where
+		1=1
+			<if test="projectId!=null and projectId != '' ">
+				and projectId=${projectId}
+			</if>
+		<choose>
             <when test="page !=null and page.orderBy != null and page.orderBy != ''">
                 ORDER BY ${page.orderBy}
             </when>
@@ -136,4 +141,51 @@
 		WHERE id = #{id}
 	</update>
 
+	<select id="selectByProjectId" resultType="com.jeeplus.modules.sg.financial.expense.entity.Expense">
+		select id from js_expense_entry where projectId  = #{projectId};
+	</select>
+
+	<insert id="insertList">
+		replace into js_expense_entry (
+		id,
+		create_by,
+		create_date,
+		update_by,
+		update_date,
+		del_flag,
+		remarks,
+		projectName,
+		projectId,
+		projectBatch,
+		constructionCost,
+		designCost,
+		designTypeicalCost,
+		supervisionCost,
+		supervisionTypeicalCost,
+		documentDesignCost,
+		documentSupervisionCost
+		)
+		values
+		<foreach collection="expense" item="item" index="index" separator="," >
+		(
+			#{item.id},
+			#{item.createBy.id},
+			#{item.createDate},
+			#{item.updateBy.id},
+			#{item.updateDate},
+			#{item.delFlag},
+			#{item.remarks},
+			#{item.projectName},
+			#{item.projectId},
+			#{item.projectBatch},
+			#{item.constructionCost},
+			#{item.designCost},
+			#{item.designTypeicalCost},
+			#{item.supervisionCost},
+			#{item.supervisionTypeicalCost},
+			#{item.documentDesignCost},
+			#{item.documentSupervisionCost}
+		)
+		</foreach>
+	</insert>
 </mapper>

+ 25 - 0
src/main/java/com/jeeplus/modules/sg/financial/expense/service/ExpenseService.java

@@ -23,6 +23,7 @@ import com.jeeplus.modules.sg.financial.expense.mapper.ExpenseMapper;
 import com.jeeplus.modules.sg.financial.settlement.entity.MaintainData;
 import com.jeeplus.modules.sg.financial.settlement.mapper.DataMaintenanceMapper;
 import com.jeeplus.modules.sg.financial.settlement.service.DataMaintenanceService;
+import org.apache.ibatis.annotations.Param;
 import org.apache.poi.xssf.usermodel.XSSFFont;
 import org.apache.poi.xssf.usermodel.XSSFSheet;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
@@ -77,4 +78,28 @@ public class ExpenseService extends CrudService<ExpenseMapper, Expense> {
     public void deleteData(String id){
         expenseMapper.deleteData(id);
     }
+
+    @Transactional(readOnly = false)
+    public void insertData(Expense expense) {
+        expense.preInsert();
+        expenseMapper.insertData(expense);
+
+    }
+
+    @Transactional(readOnly = false)
+    public void updateData(Expense expense) {
+        expenseMapper.updateData(expense);
+    }
+
+    public Expense selectByProjectId(String projectId) {
+        return expenseMapper.selectByProjectId(projectId);
+    }
+
+    @Transactional(readOnly = false)
+    public void insertList(@Param("expense") List<Expense> expenseList) {
+        for (Expense e : expenseList) {
+            e.preInsert();
+        }
+        expenseMapper.insertList(expenseList);
+    }
 }

+ 106 - 100
src/main/java/com/jeeplus/modules/sg/financial/expense/web/ExpenseController.java

@@ -12,10 +12,13 @@ import com.jeeplus.common.utils.excel.ImportExcel;
 import com.jeeplus.core.persistence.Page;
 import com.jeeplus.core.web.BaseController;
 import com.jeeplus.modules.sg.audit.information.entity.Information;
+import com.jeeplus.modules.sg.audit.information.entity.append;
 import com.jeeplus.modules.sg.financial.expense.entity.Expense;
 import com.jeeplus.modules.sg.financial.expense.service.ExpenseService;
+import com.jeeplus.modules.test.onetomany.dialog.entity.TestDataMain1;
 import com.jeeplus.modules.test.onetomany.form.entity.TestDataMain2;
 import com.jeeplus.modules.test.onetomany.form.service.TestDataMain2Service;
+import org.apache.poi.ss.usermodel.Row;
 import org.apache.shiro.authz.annotation.Logical;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -27,6 +30,7 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.ConstraintViolationException;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
@@ -81,6 +85,13 @@ public class ExpenseController extends BaseController {
 		return "modules/sg/financial/expense/expenseForm";
 	}
 
+	//添加数据页面
+	@RequestMapping(value = "editForm")
+	public String editForm(Expense expense, Model model) {
+		model.addAttribute("expense", expense);
+		return "modules/sg/financial/expense/expenseEditForm";
+	}
+
 	/**
 	 * 批量删除
 	 */
@@ -114,138 +125,133 @@ public class ExpenseController extends BaseController {
 	@RequestMapping(value = "save")
 	public AjaxJson save(Expense expense, Model model) throws Exception{
 		AjaxJson j = new AjaxJson();
-		expenseService.save(expense);//保存
-		j.setSuccess(true);
-		j.setMsg("保存票务代理成功");
+		Expense expense1 = expenseService.selectByProjectId(expense.getProjectId());
+		if (expense1 == null) {
+			expenseService.insertData(expense);//保存
+			j.setSuccess(true);
+			j.setMsg("保存票务代理成功");
+		} else {
+			j.setSuccess(false);
+			j.setMsg("项目定义号已存在不可重复");
+		}
 		return j;
 	}
 
 	/**
-	 * 保存票务代理
+	 * 修改
 	 */
 	@ResponseBody
 	@RequestMapping(value = "update")
 	public AjaxJson update(Expense expense, Model model) throws Exception{
 		AjaxJson j = new AjaxJson();
-		expenseService.(expense);//保存
+		expenseService.updateData(expense);//保存
 		j.setSuccess(true);
 		j.setMsg("保存票务代理成功");
 		return j;
 	}
-	
+
 	/**
-	 * 删除票务代理
-	 *//*
-	@ResponseBody
-	@RequiresPermissions("test:onetomany:form:testDataMain2:del")
-	@RequestMapping(value = "delete")
-	public AjaxJson delete(TestDataMain2 testDataMain2) {
-		AjaxJson j = new AjaxJson();
-		testDataMain2Service.delete(testDataMain2);
-		j.setMsg("删除票务代理成功");
-		return j;
-	}
-	
-	*//**
-	 * 批量删除票务代理
-	 *//*
-	@ResponseBody
-	@RequiresPermissions("test:onetomany:form:testDataMain2:del")
-	@RequestMapping(value = "deleteAll")
-	public AjaxJson deleteAll(String ids) {
-		AjaxJson j = new AjaxJson();
-		String idArray[] =ids.split(",");
-		for(String id : idArray){
-			testDataMain2Service.delete(testDataMain2Service.get(id));
-		}
-		j.setMsg("删除票务代理成功");
-		return j;
-	}
-	
-	*//**
-	 * 导出excel文件
-	 *//*
+	 * 导出模板文件
+	 */
 	@ResponseBody
-	@RequiresPermissions("test:onetomany:form:testDataMain2:export")
-    @RequestMapping(value = "export")
-    public AjaxJson exportFile(TestDataMain2 testDataMain2, HttpServletRequest request, HttpServletResponse response) {
+	@RequestMapping(value = "templates")
+	public AjaxJson templates(HttpServletResponse response) {
 		AjaxJson j = new AjaxJson();
 		try {
-            String fileName = "票务代理"+DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
-            Page<TestDataMain2> page = testDataMain2Service.findPage(new Page<TestDataMain2>(request, response, -1), testDataMain2);
-    		new ExportExcel("票务代理", TestDataMain2.class).setDataList(page.getList()).write(response, fileName).dispose();
-    		j.setSuccess(true);
-    		j.setMsg("导出成功!");
-    		return j;
+			String fileName = "费用入账模板文件.xlsx";
+			List<append> list = Lists.newArrayList();
+			new ExportExcel("", Expense.class, 1).setDataList(list).write(response, fileName).dispose();
+			return null;
 		} catch (Exception e) {
 			j.setSuccess(false);
-			j.setMsg("导出票务代理记录失败!失败信息:"+e.getMessage());
+			j.setMsg("费用入账模板文件!失败信息:" + e.getMessage());
 		}
-			return j;
-    }
-    
-    @ResponseBody
-    @RequestMapping(value = "detail")
-	public TestDataMain2 detail(String id) {
-		return testDataMain2Service.get(id);
+		return j;
 	}
-	
 
-	*//**
-	 * 导入Excel数据
-
-	 *//*
-	@ResponseBody
-	@RequiresPermissions("test:onetomany:form:testDataMain2:import")
-    @RequestMapping(value = "import")
-   	public AjaxJson importFile(@RequestParam("file")MultipartFile file, HttpServletResponse response, HttpServletRequest request) {
-		AjaxJson j = new AjaxJson();
+	/**
+	 * 导入费用入账数据
+	 */
+    @ResponseBody
+    @RequestMapping(value = "importExpense")
+    public AjaxJson importExpense(@RequestParam("file") MultipartFile file, Expense expense, HttpServletRequest request, HttpServletResponse response, Model model) {
+        AjaxJson j = new AjaxJson();
+		List<Expense> expenseList = new ArrayList<>();
 		try {
 			int successNum = 0;
-			int failureNum = 0;
 			StringBuilder failureMsg = new StringBuilder();
 			ImportExcel ei = new ImportExcel(file, 1, 0);
-			List<TestDataMain2> list = ei.getDataList(TestDataMain2.class);
-			for (TestDataMain2 testDataMain2 : list){
-				try{
-					testDataMain2Service.save(testDataMain2);
-					successNum++;
-				}catch(ConstraintViolationException ex){
-					failureNum++;
-				}catch (Exception ex) {
-					failureNum++;
+			int lastDataRowNum = ei.getLastDataRowNum();
+			String reg = "\\d+(\\.\\d+)?";
+			for (int i = 1; i < lastDataRowNum; i++) {
+				Expense insertExpense = new Expense();
+				Row row = ei.getRow(i);
+				String projectId = ei.getCellValue(row, 0).toString();
+				String projectName = ei.getCellValue(row, 1).toString();
+				String projectBatch = ei.getCellValue(row, 2).toString();
+				String constructionCost = ei.getCellValue(row, 3).toString();
+				String designCost = ei.getCellValue(row, 4).toString();
+				String designTypeicalCost = ei.getCellValue(row, 5).toString();
+				String supervisionCost = ei.getCellValue(row, 6).toString();
+				String supervisionTypeicalCost = ei.getCellValue(row, 7).toString();
+				String documentDesignCost = ei.getCellValue(row, 8).toString();
+				String documentSupervisionCost = ei.getCellValue(row, 9).toString();
+				if ("".equals(projectId)) {
+					failureMsg.append("有数据填写有误");
+					continue;
+				} else if ("".equals(projectName)) {
+					failureMsg.append("有数据填写有误");
+					continue;
+				}else if ("".equals(projectBatch)) {
+					failureMsg.append("有数据填写有误");
+					continue;
+				}else if ("".equals(constructionCost)||!constructionCost.matches(reg)) {
+					failureMsg.append(projectId+"有数据填写有误</br>");
+					continue;
+				}else if ("".equals(designCost)||!designCost.matches(reg)) {
+					failureMsg.append(projectId+"有数据填写有误</br>");
+					continue;
+				}else if ("".equals(designTypeicalCost)||!designTypeicalCost.matches(reg)) {
+					failureMsg.append(projectId+"有数据填写有误</br>");
+					continue;
+				}else if ("".equals(supervisionCost)||!supervisionCost.matches(reg)) {
+					failureMsg.append(projectId+"有数据填写有误</br>");
+					continue;
+				}else if ("".equals(supervisionTypeicalCost)||!supervisionTypeicalCost.matches(reg)) {
+					failureMsg.append(projectId+"有数据填写有误</br>");
+					continue;
+				}else if ("".equals(documentDesignCost)||!documentDesignCost.matches(reg)) {
+					failureMsg.append(projectId+"有数据填写有误</br>");
+					continue;
+				} else if ("".equals(documentSupervisionCost)||!documentSupervisionCost.matches(reg)) {
+					failureMsg.append(projectId+"有数据填写有误</br>");
+					continue;
+				} else {
+					insertExpense.setProjectId(projectId);
+					insertExpense.setProjectName(projectName);
+					insertExpense.setProjectBatch(projectBatch);
+					insertExpense.setConstructionCost(Double.valueOf(constructionCost));
+					insertExpense.setDesignCost(Double.valueOf(designCost));
+					insertExpense.setDesignTypeicalCost(Double.valueOf(designTypeicalCost));
+					insertExpense.setSupervisionCost(Double.valueOf(supervisionCost));
+					insertExpense.setSupervisionTypeicalCost(Double.valueOf(supervisionTypeicalCost));
+					insertExpense.setDocumentDesignCost(Double.valueOf(documentDesignCost));
+					insertExpense.setDocumentSupervisionCost(Double.valueOf(documentSupervisionCost));
 				}
+				expenseList.add(insertExpense);
 			}
-			if (failureNum>0){
-				failureMsg.insert(0, ",失败 "+failureNum+" 条票务代理记录。");
+			if (expenseList.size() > 0) {
+				expenseService.insertList(expenseList);
+				j.setSuccess(true);
+				j.setMsg("已成功导入 " + expenseList.size() + " 条费用入账记录" + failureMsg);
+			} else {
+				j.setSuccess(true);
+				j.setMsg( "没有符合规定的数据");
 			}
-			j.setMsg( "已成功导入 "+successNum+" 条票务代理记录"+failureMsg);
 		} catch (Exception e) {
 			j.setSuccess(false);
 			j.setMsg("导入票务代理失败!失败信息:"+e.getMessage());
 		}
-		return j;
+        return j;
     }
-	
-	*//**
-	 * 下载导入票务代理数据模板
-	 *//*
-	@ResponseBody
-	@RequiresPermissions("test:onetomany:form:testDataMain2:import")
-    @RequestMapping(value = "import/template")
-     public AjaxJson importFileTemplate(HttpServletResponse response) {
-		AjaxJson j = new AjaxJson();
-		try {
-            String fileName = "票务代理数据导入模板.xlsx";
-    		List<TestDataMain2> list = Lists.newArrayList(); 
-    		new ExportExcel("票务代理数据", TestDataMain2.class, 1).setDataList(list).write(response, fileName).dispose();
-    		return null;
-		} catch (Exception e) {
-			j.setSuccess(false);
-			j.setMsg( "导入模板下载失败!失败信息:"+e.getMessage());
-		}
-		return j;
-    }*/
-	
-
 }

+ 3 - 3
src/main/java/com/jeeplus/modules/sg/picking/activiti/web/PickIngController.java

@@ -353,7 +353,7 @@ public class PickIngController extends BaseController {
                 showList.setsVersion(value);
             }
             //新增或编辑表单保存
-//            showListService.save(showList);//保存
+            showListService.save(showList);//保存
             //查询项目的领料状态是否不为0
             String acqStatus = showListService.findAcqStatus(showList);
             if ("0".equals(acqStatus)) {
@@ -361,11 +361,11 @@ public class PickIngController extends BaseController {
             }
             //修改项目的状态
             // 启动流程
-/*            Map<String, Object> vars = Maps.newHashMap();
+            Map<String, Object> vars = Maps.newHashMap();
             vars.put("manager", UserUtils.getUser().getLoginName());
             ProcessDefinition p = actProcessService.getProcessDefinition(showList.getAct().getProcDefId());
             String title = showList.getCurrentUser().getName() + "在" + DateUtils.getDateTime() + "发起" + p.getName();
-            actTaskService.startProcess(p.getKey(), "md_acquisition_process", showList.getId(), title, vars);*/
+            actTaskService.startProcess(p.getKey(), "md_acquisition_process", showList.getId(), title, vars);
             j.setMsg("发起领料流程成功!");
             j.getBody().put("targetUrl", "/act/task/process/");
 

+ 99 - 0
src/main/webapp/webpage/modules/sg/financial/expense/expenseEditForm.jsp

@@ -0,0 +1,99 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>修改数据</title>
+	<meta name="decorator" content="ani"/>
+	<script type="text/javascript">
+
+		$(document).ready(function() {
+			$('#startDate').datetimepicker({
+				format: "YYYY-MM-DD"
+			});
+			$('#endDate').datetimepicker({
+				format: "YYYY-MM-DD"
+			});
+		});
+		function save() {
+            var isValidate = jp.validateForm('#inputForm');//校验表单
+            if(!isValidate){
+                return false;
+			}else{
+                jp.loading();
+                jp.post("${ctx}/sg/financial/expense/update",$('#inputForm').serialize(),function(data){
+                    if(data.success){
+                        jp.getParent().refresh();
+                        var dialogIndex = parent.layer.getFrameIndex(window.name); // 获取窗口索引
+                        parent.layer.close(dialogIndex);
+                        jp.success(data.msg)
+
+                    }else{
+                        jp.error(data.msg);
+                    }
+                })
+			}
+
+        }
+	</script>
+</head>
+
+<body class="bg-white">
+		<form:form id="inputForm" modelAttribute="expense" class="form-horizontal">
+		<form:hidden path="id"/>
+		<table class="table table-bordered">
+		   <tbody>
+				<tr>
+					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>项目定义号:</label></td>
+					<td class="width-35">
+						<form:input readonly="true" path="projectId" htmlEscape="false"    class="form-control required"/>
+					</td>
+					<td class="width-15 active"><label class="pull-right">项目名称:</label></td>
+					<td class="width-35">
+						<form:input path="projectName" htmlEscape="false"    class="form-control"/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="pull-right">项目批次:</label></td>
+					<td class="width-35">
+						<form:input path="projectBatch" htmlEscape="false"    class="form-control "/>
+					</td>
+					<td class="width-15 active"><label class="pull-right">施工费合同折扣:</label></td>
+					<td class="width-35">
+						<form:input path="constructionCost" htmlEscape="false"    class="form-control"/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="pull-right">设计费合同折扣:</label></td>
+					<td class="width-35">
+						<form:input path="designCost" htmlEscape="false"    class="form-control"/>
+					</td>
+					<td class="width-15 active"><label class="pull-right">设计费典型设计折扣:</label></td>
+					<td class="width-35">
+						<form:input path="designTypeicalCost" htmlEscape="false"    class="form-control number"/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="pull-right">监理费合同折扣:</label></td>
+					<td class="width-35">
+						<form:input path="supervisionCost" htmlEscape="false"    class="form-control number"/>
+					</td>
+					<td class="width-15 active"><label class="pull-right">监理费典型折扣:</label></td>
+					<td class="width-35">
+						<form:input path="supervisionTypeicalCost" htmlEscape="false"    class="form-control number"/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="pull-right">发文中设计费金额(不含税):</label></td>
+					<td class="width-35">
+						<form:input path="documentDesignCost" htmlEscape="false"    class="form-control"/>
+					</td>
+					<td class="width-15 active"><label class="pull-right">发文中监理费金额(不含税):</label></td>
+					<td class="width-35">
+						<form:input path="documentSupervisionCost" htmlEscape="false"    class="form-control number"/>
+					</td>
+				</tr>
+		 	</tbody>
+		</table>
+	</form:form>
+</body>
+</html>

+ 18 - 18
src/main/webapp/webpage/modules/sg/financial/expense/expenseForm.jsp

@@ -47,49 +47,49 @@
 					<td class="width-35">
 						<form:input path="projectId" htmlEscape="false"    class="form-control required"/>
 					</td>
-					<td class="width-15 active"><label class="pull-right">项目名称:</label></td>
+					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>项目名称:</label></td>
 					<td class="width-35">
-						<form:input path="projectName" htmlEscape="false"    class="form-control"/>
+						<form:input path="projectName" htmlEscape="false"    class="form-control required"/>
 					</td>
 				</tr>
 				<tr>
-					<td class="width-15 active"><label class="pull-right">项目批次:</label></td>
+					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>项目批次:</label></td>
 					<td class="width-35">
-						<form:input path="projectBatch" htmlEscape="false"    class="form-control "/>
+						<form:input path="projectBatch" htmlEscape="false"  class="form-control required"/>
 					</td>
-					<td class="width-15 active"><label class="pull-right">施工费合同折扣:</label></td>
+					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>施工费合同折扣:</label></td>
 					<td class="width-35">
-						<form:input path="constructionCost" htmlEscape="false"    class="form-control"/>
+						<form:input path="constructionCost" htmlEscape="false" class="form-control required number"/>
 					</td>
 				</tr>
 				<tr>
-					<td class="width-15 active"><label class="pull-right">设计费合同折扣:</label></td>
+					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>设计费合同折扣:</label></td>
 					<td class="width-35">
-						<form:input path="designCost" htmlEscape="false"    class="form-control"/>
+						<form:input path="designCost" htmlEscape="false"  class="form-control required number"/>
 					</td>
-					<td class="width-15 active"><label class="pull-right">设计费典型设计折扣:</label></td>
+					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>设计费典型设计折扣:</label></td>
 					<td class="width-35">
-						<form:input path="designTypeicalCost" htmlEscape="false"    class="form-control number"/>
+						<form:input path="designTypeicalCost" htmlEscape="false"    class="form-control required number"/>
 					</td>
 				</tr>
 				<tr>
-					<td class="width-15 active"><label class="pull-right">监理费合同折扣:</label></td>
+					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>监理费合同折扣:</label></td>
 					<td class="width-35">
-						<form:input path="supervisionCost" htmlEscape="false"    class="form-control number"/>
+						<form:input path="supervisionCost" htmlEscape="false"    class="form-control required number"/>
 					</td>
-					<td class="width-15 active"><label class="pull-right">监理费典型折扣:</label></td>
+					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>监理费典型折扣:</label></td>
 					<td class="width-35">
-						<form:input path="supervisionTypeicalCost" htmlEscape="false"    class="form-control number"/>
+						<form:input path="supervisionTypeicalCost" htmlEscape="false"    class="form-control required number"/>
 					</td>
 				</tr>
 				<tr>
-					<td class="width-15 active"><label class="pull-right">发文中设计费金额(不含税):</label></td>
+					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>发文中设计费金额(不含税):</label></td>
 					<td class="width-35">
-						<form:input path="documentDesignCost" htmlEscape="false"    class="form-control"/>
+						<form:input path="documentDesignCost" htmlEscape="false"    class="form-control required number"/>
 					</td>
-					<td class="width-15 active"><label class="pull-right">发文中监理费金额(不含税):</label></td>
+					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>发文中监理费金额(不含税):</label></td>
 					<td class="width-35">
-						<form:input path="documentSupervisionCost" htmlEscape="false"    class="form-control number"/>
+						<form:input path="documentSupervisionCost" htmlEscape="false"    class="form-control required number"/>
 					</td>
 				</tr>
 		 	</tbody>

+ 37 - 10
src/main/webapp/webpage/modules/sg/financial/expense/expenseList.js

@@ -63,18 +63,20 @@ $(document).ready(function() {
 		},
                columns: [{
 		        checkbox: true
-		    }
+		    },{
+                   field: 'projectId',
+                   width:230,
+                   title: '项目定义号'
+               }
 			,{
 		        field: 'projectName',
                 width:120,
 		        title: '项目名称'
-		    }
-		    ,{
-               field: 'projectId',
-               width:230,
-               title: '项目定义'
-
-           }
+		    },{
+                   field: 'projectBatch',
+                   width:120,
+                   title: '项目批次'
+               }
 		    ,{
                field: 'constructionCost',
                width:160,
@@ -143,6 +145,31 @@ $(document).ready(function() {
 		  $('#dataTable').bootstrapTable('refresh');
 		});
 
+    $("#import").click(function () {
+        jp.open({
+            type: 2,
+            area: [500, 200],
+            auto: true,
+            title:"导入数据",
+            content: "${ctx}/tag/importExcel" ,
+            btn: ['下载模板','确定', '关闭'],
+            btn1: function(index, layero){
+                jp.downloadFile('${ctx}/sg/financial/expense/templates');
+            },
+            btn2: function(index, layero){
+                var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                iframeWin.contentWindow.importExcel('${ctx}/sg/financial/expense/importExpense', function (data) {
+                    top.layer.msg(data.msg, {icon:1})
+                    refresh()
+                    jp.close(index);
+                });//调用保存事件
+                return false;
+            },
+            btn3: function(index){
+                jp.close(index);
+            }
+        })
+    })
 
 
 		
@@ -150,7 +177,7 @@ $(document).ready(function() {
 		
   function getIdSelections() {
         return $.map($("#dataTable").bootstrapTable('getSelections'), function (row) {
-            return row.projectId
+            return row.id
         });
     }
   
@@ -185,7 +212,7 @@ $(document).ready(function() {
        if(id == undefined){
 	      id = getIdSelections();
 	}
-	jp.openSaveDialog('编辑', "${ctx}/sg/financial/expense/addForm?id=" + id, '800px', '500px');
+	jp.openSaveDialog('编辑', "${ctx}/sg/financial/expense/editForm?id=" + id, '800px', '500px');
   }
 
     function deleteAll(){

+ 3 - 0
src/main/webapp/webpage/modules/sg/financial/expense/expenseList.jsp

@@ -60,6 +60,9 @@
 		<button id="remove" class="btn btn-danger" disabled onclick="deleteAll()">
 			<i class="glyphicon glyphicon-remove"></i> 删除
 		</button>
+		<button id="import" class="btn btn-info">
+			<i class="fa fa-folder-open-o"></i> 导入费用入账基础信息
+		</button>
 	</div>
 	<!-- 表格 -->
 	<table id="dataTable" style="table-layout:fixed"  data-toolbar="#toolbar"></table>