Explorar el Código

Merge branch 'master' of http://192.168.2.4:3000/chengqiang/sg_audit

chengqiang hace 5 años
padre
commit
34cda95efd
Se han modificado 100 ficheros con 12413 adiciones y 375 borrados
  1. 26 1
      src/main/java/com/jeeplus/common/utils/excel/ImportExcel.java
  2. 110 0
      src/main/java/com/jeeplus/modules/act/service/ActTaskService.java
  3. 30 0
      src/main/java/com/jeeplus/modules/act/web/ActTaskController.java
  4. 11 2
      src/main/java/com/jeeplus/modules/sg/audit/information/entity/Information.java
  5. 16 15
      src/main/java/com/jeeplus/modules/sg/audit/information/entity/OutInformation.java
  6. 18 19
      src/main/java/com/jeeplus/modules/sg/audit/information/entity/append.java
  7. 3 0
      src/main/java/com/jeeplus/modules/sg/audit/information/mapper/InformationMapper.java
  8. 32 16
      src/main/java/com/jeeplus/modules/sg/audit/information/mapper/xml/InformationMapper.xml
  9. 4 0
      src/main/java/com/jeeplus/modules/sg/audit/information/service/InformationService.java
  10. 11 35
      src/main/java/com/jeeplus/modules/sg/audit/information/utils/ImportInformation.java
  11. 61 60
      src/main/java/com/jeeplus/modules/sg/audit/information/web/InformationController.java
  12. 82 44
      src/main/java/com/jeeplus/modules/sg/audit/material/entity/Material.java
  13. 9 0
      src/main/java/com/jeeplus/modules/sg/audit/report/entity/SgReport.java
  14. 4 0
      src/main/java/com/jeeplus/modules/sg/audit/report/mapper/ReportMapper.java
  15. 111 14
      src/main/java/com/jeeplus/modules/sg/audit/report/mapper/xml/ReportMapper.xml
  16. 73 0
      src/main/java/com/jeeplus/modules/sg/audit/report/service/ReportService.java
  17. 123 0
      src/main/java/com/jeeplus/modules/sg/audit/report/web/ReportController.java
  18. 186 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ErpAccount.java
  19. 262 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ErpCredit.java
  20. 95 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ErpCreditChild1.java
  21. 83 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ErpCreditChild2.java
  22. 160 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/GeneralSituation.java
  23. 79 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/MaterialEquipment.java
  24. 153 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/Schedule.java
  25. 223 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ScheduleOther.java
  26. 58 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/TheAssetsTotal.java
  27. 124 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/TransferOfPower1.java
  28. 115 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/TransferOfPower2.java
  29. 15 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/ErpCreditChild1Mapper.java
  30. 19 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/ErpCreditChild2Mapper.java
  31. 17 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/ErpCreditMapper.java
  32. 164 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/xml/ErpCreditChild1Mapper.xml
  33. 154 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/xml/ErpCreditChild2Mapper.xml
  34. 211 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/xml/ErpCreditMapper.xml
  35. 218 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/service/ErpCreditService.java
  36. 612 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ErpInfo.java
  37. 173 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ExportTemplate.java
  38. 462 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ExportUtil.java
  39. 582 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ExportUtil1.java
  40. 400 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ExportUtil2.java
  41. 391 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ImportUtil.java
  42. 159 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/Test.java
  43. 210 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/web/ErpCreditController.java
  44. 73 0
      src/main/java/com/jeeplus/modules/sg/financial/settlement/entity/MaintainData.java
  45. 2 0
      src/main/java/com/jeeplus/modules/sg/financial/settlement/mapper/DataMaintenanceMapper.java
  46. 56 12
      src/main/java/com/jeeplus/modules/sg/financial/settlement/mapper/xml/DataMaintenanceMapper.xml
  47. 5 0
      src/main/java/com/jeeplus/modules/sg/financial/settlement/service/DataMaintenanceService.java
  48. 129 37
      src/main/java/com/jeeplus/modules/sg/financial/settlement/util/ExcelWriter.java
  49. 43 36
      src/main/java/com/jeeplus/modules/sg/financial/settlement/web/DataMaintenanceController.java
  50. 80 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/activiti/entity/Construction.java
  51. 20 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/activiti/mapper/ConstructionMapper.java
  52. 141 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/activiti/mapper/xml/ConstructionMapper.xml
  53. 52 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/activiti/service/ConstructionService.java
  54. 121 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/activiti/web/ConstructionController.java
  55. 112 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/activiti/web/DivideController.java
  56. 117 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/entity/MaterialInfo.java
  57. 157 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/entity/MaterialStandard.java
  58. 15 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/entity/MaterialVersion.java
  59. 24 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/mapper/MaterialInfoMapper.java
  60. 24 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/mapper/MaterialVersionMapper.java
  61. 235 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/mapper/xml/MaterialInfoMapper.xml
  62. 137 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/mapper/xml/MaterialVersionMapper.xml
  63. 272 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/service/MaterialInfoService.java
  64. 97 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/service/MaterialVersionService.java
  65. 68 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/util/MaterialReplaceUtil.java
  66. 269 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/web/MaterialInfoController.java
  67. 210 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/web/MaterialVersionController.java
  68. 87 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialproject/entity/MaterialProject.java
  69. 19 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialproject/mapper/MaterialProjectMapper.java
  70. 181 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialproject/mapper/xml/MaterialProjectMapper.xml
  71. 57 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialproject/service/MaterialProjectService.java
  72. 198 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialproject/web/MaterialProjectController.java
  73. BIN
      src/main/resources/freemarker/excelmodel/竣工决算模板.xlsx
  74. 1 1
      src/main/resources/j2cache/j2cache.properties
  75. 1 1
      src/main/resources/properties/jeeplus.properties
  76. 44 51
      src/main/webapp/webpage/modules/sg/audit/information/informationList.js
  77. 19 2
      src/main/webapp/webpage/modules/sg/audit/report/reportList.jsp
  78. 20 2
      src/main/webapp/webpage/modules/sg/audit/report/reportList1.jsp
  79. 147 0
      src/main/webapp/webpage/modules/sg/audit/report/reportList2.jsp
  80. 265 0
      src/main/webapp/webpage/modules/sg/financial/erp/erpCreditForm.jsp
  81. 486 0
      src/main/webapp/webpage/modules/sg/financial/erp/erpCreditList.js
  82. 90 0
      src/main/webapp/webpage/modules/sg/financial/erp/erpCreditList.jsp
  83. 42 16
      src/main/webapp/webpage/modules/sg/settlement/dataMaintenanceForm.jsp
  84. 30 11
      src/main/webapp/webpage/modules/sg/settlement/dataMaintenanceList.js
  85. 0 0
      src/main/webapp/webpage/modules/sg/financial/settlement/dataMaintenanceList.jsp
  86. 206 0
      src/main/webapp/webpage/modules/sg/managementcenter/activiti/constructionAudit.jsp
  87. 157 0
      src/main/webapp/webpage/modules/sg/managementcenter/activiti/constructionForm.jsp
  88. 176 0
      src/main/webapp/webpage/modules/sg/managementcenter/activiti/divideAudit.jsp
  89. 120 0
      src/main/webapp/webpage/modules/sg/managementcenter/materialinfo/importexcel.jsp
  90. 273 0
      src/main/webapp/webpage/modules/sg/managementcenter/materialinfo/importmore.jsp
  91. 288 0
      src/main/webapp/webpage/modules/sg/managementcenter/materialinfo/materialInfoList.js
  92. 118 0
      src/main/webapp/webpage/modules/sg/managementcenter/materialinfo/materialInfoList.jsp
  93. 94 0
      src/main/webapp/webpage/modules/sg/managementcenter/materialproject/materialProjectForm.jsp
  94. 228 0
      src/main/webapp/webpage/modules/sg/managementcenter/materialproject/materialProjectList.js
  95. 120 0
      src/main/webapp/webpage/modules/sg/managementcenter/materialproject/materialProjectList.jsp
  96. 108 0
      src/main/webapp/webpage/modules/sg/managementcenter/materialversion/importexcel.jsp
  97. 218 0
      src/main/webapp/webpage/modules/sg/managementcenter/materialversion/materialVersionList.js
  98. 83 0
      src/main/webapp/webpage/modules/sg/managementcenter/materialversion/materialVersionList.jsp
  99. 29 0
      target/classes/act/build.xml
  100. 0 0
      target/classes/act/deployments/oa/test_audit/test_audit.bar

+ 26 - 1
src/main/java/com/jeeplus/common/utils/excel/ImportExcel.java

@@ -126,6 +126,11 @@ public class ImportExcel {
 		this(multipartFile.getOriginalFilename(), multipartFile.getInputStream(), headerNum, sheetIndex);
 	}
 
+	public ImportExcel(MultipartFile multipartFile, int headerNum, String sheetName)
+			throws InvalidFormatException, IOException {
+		this(multipartFile.getOriginalFilename(), multipartFile.getInputStream(), headerNum, sheetName);
+	}
+
 	/**
 	 * 构造函数
 	 * @param path 导入文件对象
@@ -152,6 +157,25 @@ public class ImportExcel {
 		this.headerNum = headerNum;
 		log.debug("Initialize success.");
 	}
+
+	public ImportExcel(String fileName, InputStream is, int headerNum, String sheetName)
+			throws InvalidFormatException, IOException {
+		if (StringUtils.isBlank(fileName)){
+			throw new RuntimeException("导入文档为空!");
+		}else if(fileName.toLowerCase().endsWith("xls")){
+			this.wb = new HSSFWorkbook(is);
+		}else if(fileName.toLowerCase().endsWith("xlsx")){
+			this.wb = new XSSFWorkbook(is);
+		}else{
+			throw new RuntimeException("文档格式不正确!");
+		}
+		if (this.wb.getSheet(sheetName) == null) {
+			throw new RuntimeException("缺少" + sheetName);
+		}
+		this.sheet = this.wb.getSheet(sheetName);
+		this.headerNum = headerNum;
+		log.debug("Initialize success.");
+	}
 	
 	/**
 	 * 获取行对象
@@ -214,7 +238,8 @@ public class ImportExcel {
 				} else if (cell.getCellType() == Cell.CELL_TYPE_STRING) {
 					val = cell.getStringCellValue();
 				} else if (cell.getCellType() == Cell.CELL_TYPE_FORMULA) {
-					val = cell.getCellFormula();
+//					val = cell.getCellFormula();
+					val = cell.getNumericCellValue();
 				} else if (cell.getCellType() == Cell.CELL_TYPE_BOOLEAN) {
 					val = cell.getBooleanCellValue();
 				} else if (cell.getCellType() == Cell.CELL_TYPE_ERROR) {

+ 110 - 0
src/main/java/com/jeeplus/modules/act/service/ActTaskService.java

@@ -6,6 +6,7 @@ package com.jeeplus.modules.act.service;
 import java.io.InputStream;
 import java.util.*;
 
+import com.jeeplus.modules.sg.managementcenter.activiti.entity.Construction;
 import org.activiti.bpmn.model.BpmnModel;
 import org.activiti.engine.FormService;
 import org.activiti.engine.HistoryService;
@@ -586,6 +587,58 @@ public class ActTaskService extends BaseService {
 		return act.getProcInsId();
 	}
 
+
+	/**
+	 * 新启动流程
+	 * @param procDefKey 流程定义KEY
+	 * @param businessTable 业务表表名
+	 * @param businessId	业务表编号
+	 * @param title			流程标题,显示在待办任务标题
+	 * @param vars			流程变量
+	 * @return 流程实例ID
+	 */
+	@SuppressWarnings("unused")
+	@Transactional(readOnly = false)
+	public String startProcessNew(String procDefKey, String businessTable, String businessId, String title, Map<String, Object> vars) {
+		//String userId = UserUtils.getUser().getLoginName();//ObjectUtils.toString(UserUtils.getUser().getId())
+		// 设置流程变量
+		if (vars == null){
+			vars = Maps.newHashMap();
+		}
+
+		String userId = (String) vars.get("applyUserId");
+		if(userId == null ){
+			userId = UserUtils.getUser().getLoginName();
+		}
+		String userName = UserUtils.getByLoginName(userId).getName();
+		vars.put("userName", userName);
+
+		String processer = (String) vars.get("processer");
+		if (processer != null) {
+			vars.put("processer", processer);
+		}
+
+		// 用来设置启动流程的人员ID,引擎会自动把用户ID保存到activiti:initiator中
+		identityService.setAuthenticatedUserId(userId);
+
+		// 设置流程标题
+		if (StringUtils.isNotBlank(title)){
+			vars.put("title", title);
+		}
+
+		// 启动流程
+		ProcessInstance procIns = runtimeService.startProcessInstanceByKey(procDefKey, businessTable+":"+businessId, vars);
+
+		// 更新业务表流程实例ID
+		Act act = new Act();
+		act.setBusinessTable(businessTable);// 业务表名
+		act.setBusinessId(businessId);	// 业务表ID
+		act.setProcInsId(procIns.getId());
+		act.setVars(vars);
+		actMapper.updateProcInsIdByBusinessId(act);
+		return act.getProcInsId();
+	}
+
 	/**
 	 * 获取任务
 	 * @param taskId 任务ID
@@ -1030,12 +1083,69 @@ public class ActTaskService extends BaseService {
 		// 提交流程任务
 		Map<String, Object> vars = Maps.newHashMap();
 		vars.put("pass", "yes".equals(act.getFlag())? true : false);
+		complete(act.getTaskId(), act.getProcInsId(), act.getComment(), vars);
+	}
 
+
+	/**
+	 * 经理保存审核意见
+	 * @param act
+	 */
+	@Transactional(readOnly = false)
+	public void auditSave2(Act act) {
+		// 设置意见
+		act.setComment(("yes".equals(act.getFlag())?"[没有问题] ":"[存在问题] ")+act.getComment());
+		act.preUpdate();
+		// 对不同环节的业务逻辑进行操作
+		String taskDefKey = act.getTaskDefKey();
+		// 提交流程任务
+		Map<String, Object> vars = Maps.newHashMap();
+		vars.put("pass", "yes".equals(act.getFlag())? true : false);
 		complete(act.getTaskId(), act.getProcInsId(), act.getComment(), vars);
+	}
+
+	/**
+	 * 保存审核意见
+	 *
+	 * @param act
+	 */
+	@Transactional(readOnly = false)
+	public void newAuditSave(Act act, Construction construction) {
 
+		// 设置意见
+		if ("manager".equals(act.getFlag())) {
+			act.setComment("[项目经理]");
+		} else if ("company".equals(act.getFlag())) {
+			act.setComment("[施工单位]");
+		} else {
+			act.setComment("[驳回]");
+		}
+		/*		act.setComment(("yes".equals(act.getFlag())?"[同意] ":"[驳回] ")+act.getComment());*/
+		act.preUpdate();
+		// 对不同环节的业务逻辑进行操作
+		String taskDefKey = act.getTaskDefKey();
+		// 提交流程任务
+		Map<String, Object> vars = Maps.newHashMap();
+		if ("manager".equals(act.getFlag())) {
+			vars.put("manager", true);
+			vars.put("company", false);
+			vars.put("reject", false);
+		} else if ("company".equals(act.getFlag())) {
+			vars.put("manager", false);
+			vars.put("company", true);
+			vars.put("reject", false);
+		} else {
+			vars.put("manager", false);
+			vars.put("company", false);
+			vars.put("reject", true);
+		}
+		vars.put("processer", UserUtils.get(construction.getTuser().getId()).getLoginName());
+		/*vars.put("pass", "yes".equals(act.getFlag())? true : false);*/
+		complete(act.getTaskId(), act.getProcInsId(), act.getComment(), vars);
 	}
 
 
+
 	/**
 	 * 判断下一个节点是互斥网关还是用户任务节点
 	 * @param  processInstanceId     任务Id信息

+ 30 - 0
src/main/java/com/jeeplus/modules/act/web/ActTaskController.java

@@ -13,6 +13,7 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import com.jeeplus.common.json.AjaxJson;
+import com.jeeplus.modules.sg.managementcenter.activiti.entity.Construction;
 import org.activiti.engine.HistoryService;
 import org.activiti.engine.RepositoryService;
 import org.activiti.engine.RuntimeService;
@@ -366,6 +367,35 @@ public class ActTaskController extends BaseController {
 		return j;
 	}
 
+
+	/**
+	 * 审批
+	 * @param act
+	 */
+	@ResponseBody
+	@RequestMapping(value = "audit2")
+	public AjaxJson auditTask2(Act act) {
+		AjaxJson j = new AjaxJson();
+		actTaskService.auditSave2(act);
+		j.setMsg("审批成功");
+		return j;
+	}
+
+
+	/**
+	 * 施工交底审批
+	 * @param act*/
+
+
+	@ResponseBody
+	@RequestMapping(value = "newAudit")
+	public AjaxJson newAuditTask(Act act, Construction construction) {
+		AjaxJson j = new AjaxJson();
+		actTaskService.newAuditSave(act,construction);
+		j.setMsg("审批成功");
+		return j;
+	}
+
 	/**
 	 * 取回流程
 	 * @param taskId

+ 11 - 2
src/main/java/com/jeeplus/modules/sg/audit/information/entity/Information.java

@@ -38,7 +38,7 @@ public class Information extends DataEntity<Information>  {
 	private Date projectStop;
 //	施工单位
 	private String department;
-//	事务所名称
+//	结算审计单位名称
 	private String projectFirm;
 //	提交送审日期
 	private Date subDate;
@@ -88,7 +88,16 @@ public class Information extends DataEntity<Information>  {
 	private String extendedStatus;
 	//记录查询超期时间
 	private String extendedTime;
+	//工作状态
+	private String appendStatus;
 
+	public String getAppendStatus() {
+		return appendStatus;
+	}
+
+	public void setAppendStatus(String appendStatus) {
+		this.appendStatus = appendStatus;
+	}
 
 	public String getExtendedStatus() {
 		return extendedStatus;
@@ -275,7 +284,7 @@ public class Information extends DataEntity<Information>  {
 		this.projectStop = projectStop;
 	}
 
-	@ExcelField(title="事务所名称", align=2, sort=10)
+	@ExcelField(title="结算审计单位名称", align=2, sort=10)
 	public String getProjectFirm() {
 		return projectFirm;
 	}

+ 16 - 15
src/main/java/com/jeeplus/modules/sg/audit/information/entity/OutInformation.java

@@ -14,8 +14,6 @@ public class OutInformation {
     private String projectName;
     //	项目类型
     private String projectType;
-    //工作状态(是否关闭)
-    private String outConstruction;
     //	审定日期
     private Date approvalDate;
     //是否完成甲供物资领退料
@@ -53,8 +51,8 @@ public class OutInformation {
     //	实际竣工日期
     private Date projectStop;
     //施工单位
-    private String construction;
-    //	事务所名称
+    private String department;
+    //	结算审计单位名称
     private String projectFirm;
     //	提交送审日期
     private Date subDate;
@@ -66,6 +64,9 @@ public class OutInformation {
     private Date resultDate;
     //结算单位
     private String settlement;
+    //工作状态
+    private String appendStatus;
+
 
     @ExcelField(title="项目定义号", align=2, sort=1)
     public String getProjectId() {
@@ -95,12 +96,12 @@ public class OutInformation {
     }
 
     @ExcelField(title="工作状态", align=2, sort=4)
-    public String getOutConstruction() {
-        return outConstruction;
+    public String getAppendStatus() {
+        return appendStatus;
     }
 
-    public void setOutConstruction(String outConstruction) {
-        this.outConstruction = outConstruction;
+    public void setAppendStatus(String appendStatus) {
+        this.appendStatus = appendStatus;
     }
 
     @ExcelField(title="审定日期", align=2, sort=5)
@@ -266,15 +267,15 @@ public class OutInformation {
     }
 
     @ExcelField(title="施工单位", align=2, sort=23)
-    public String getConstruction() {
-        return construction;
+    public String getDepartment() {
+        return department;
     }
 
-    public void setConstruction(String construction) {
-        this.construction = construction;
+    public void setDepartment(String department) {
+        this.department = department;
     }
 
-    @ExcelField(title="事务所名称", align=2, sort=24)
+    @ExcelField(title="结算审计单位名称", align=2, sort=24)
     public String getProjectFirm() {
         return projectFirm;
     }
@@ -319,12 +320,12 @@ public class OutInformation {
         this.resultDate = resultDate;
     }
 
-    @ExcelField(title="结算单位", align=2, sort=29)
+/*    @ExcelField(title="结算单位", align=2, sort=29)
     public String getSettlement() {
         return settlement;
     }
 
     public void setSettlement(String settlement) {
         this.settlement = settlement;
-    }
+    }*/
 }

+ 18 - 19
src/main/java/com/jeeplus/modules/sg/audit/information/entity/append.java

@@ -9,14 +9,14 @@ public class append {
     private String projectId;
     //是否决算送审
     private String trial;
-    //施工单位
-    private String construction;
+/*    //施工单位
+    private String construction;*/
     //工作状态(是否关闭)
-    private String outConstruction;
-    //结算单位
-    private String settlement;
-    //归口部门
-    private String underCentralized;
+    private String appendStatus;
+/*    //结算单位
+    private String settlement;*/
+/*    //归口部门
+    private String underCentralized;*/
 
 
     @ExcelField(title = "项目定义号", align = 2, sort = 1)
@@ -37,39 +37,38 @@ public class append {
         this.trial = trial;
     }
 
-    @ExcelField(title = "施工单位", align = 2, sort = 3)
+/*    @ExcelField(title = "施工单位", align = 2, sort = 3)
     public String getConstruction() {
         return construction;
     }
 
     public void setConstruction(String construction) {
         this.construction = construction;
-    }
+    }*/
 
-    @ExcelField(title = "工作状态(是否关闭)", align = 2, sort = 4)
-    public String getOutConstruction() {
-        return outConstruction;
+    @ExcelField(title = "工作状态(是否关闭)", align = 2, sort = 3)
+    public String getAppendStatus() {
+        return appendStatus;
     }
 
-    public void setOutConstruction(String outConstruction) {
-        this.outConstruction = outConstruction;
+    public void setAppendStatus(String appendStatus) {
+        this.appendStatus = appendStatus;
     }
-
-    @ExcelField(title = "结算单位", align = 2, sort = 5)
+/*    @ExcelField(title = "结算单位", align = 2, sort = 5)
     public String getSettlement() {
         return settlement;
     }
 
     public void setSettlement(String settlement) {
         this.settlement = settlement;
-    }
+    }*/
 
-    @ExcelField(title = "归口部门", align = 2, sort = 6)
+/*    @ExcelField(title = "归口部门", align = 2, sort = 4)
     public String getUnderCentralized() {
         return underCentralized;
     }
 
     public void setUnderCentralized(String underCentralized) {
         this.underCentralized = underCentralized;
-    }
+    }*/
 }

+ 3 - 0
src/main/java/com/jeeplus/modules/sg/audit/information/mapper/InformationMapper.java

@@ -65,4 +65,7 @@ public interface InformationMapper extends BaseMapper<Information> {
     int updateConstant(constant constant);
 
     List<Information> findListWord(Information entity);
+
+    //通过查询条件,查询所有未完成领退料的信息
+    List<Information> findNoFinishList(List<Information> list);
 }

+ 32 - 16
src/main/java/com/jeeplus/modules/sg/audit/information/mapper/xml/InformationMapper.xml

@@ -26,7 +26,8 @@
 		secondFinish,
 		secondFinishDate,
 		finishDate,
-		overdue
+		overdue,
+		underCentralized
 	</sql>
 
 	<sql id="newInformationColumns">
@@ -53,7 +54,8 @@
 		a.secondFinish,
 		a.secondFinishDate,
 		a.finishDate,
-		a.overdue
+		a.overdue,
+		a.underCentralized
 	</sql>
     <select id="findAllInformationList" resultType="com.jeeplus.modules.sg.audit.information.entity.Information">
 		select project_id,project_name from sj_project_information
@@ -233,7 +235,7 @@
 
     <select id="findList" resultType="Information">
         SELECT
-		<include refid="newInformationColumns"/>,b.trial,b.construction,b.outConstruction,b.settlement,b.underCentralized,
+		<include refid="newInformationColumns"/>,b.trial,b.appendStatus,
 		datediff(if(firstFinish='否' or secondFinish = '否',NOW(),if(secondFinish = '是',secondFinishDate,firstFinishDate)),approvalDate) as newdate
         FROM sj_project_information as a
 		left JOIN sj_project_append as b on a.project_id = b.project_id
@@ -254,6 +256,9 @@
             <if test="firstUnits != null and firstUnits != '' ">
                 AND a.first_units=#{firstUnits}
             </if>
+			<if test="projectYear !=null and projectYear != ''">
+				and a.project_year = #{projectYear}
+			</if>
         	<if test="projectType !=null and projectType != ''">
 				and a.project_type = #{projectType}
 			</if>
@@ -352,7 +357,8 @@
 		del_flag,
 		firstFinishDate,
 		secondFinish,
-		secondFinishDate
+		secondFinishDate,
+		underCentralized
 		) VALUES
 		<foreach collection="information" item="item" index="index" separator="," >
 		(
@@ -382,7 +388,8 @@
 			#{item.delFlag},
 			#{item.firstFinishDate},
 			#{item.secondFinish},
-			#{item.secondFinishDate}
+			#{item.secondFinishDate},
+			#{item.underCentralized}
             )
 		</foreach>
 	</insert>
@@ -418,20 +425,14 @@
 		replace into sj_project_append(
 			project_id,
 			trial,
-			construction,
-			outConstruction,
-			settlement,
-			underCentralized
+			appendStatus
 		)
 		VALUES
 		<foreach collection="list" item="item" separator="," >
 			(
 			#{item.projectId},
 			#{item.trial},
-			#{item.construction},
-			#{item.outConstruction},
-			#{item.settlement},
-			#{item.underCentralized}
+			#{item.appendStatus}
 			)
 		</foreach>
 	</insert>
@@ -447,9 +448,15 @@
 	</select>
 
 	<select id="allNo" resultType="com.jeeplus.modules.sg.audit.material.entity.Material">
-		select *
-		from sj_material_information
-		where project_Id in(
+		SELECT
+		a.*, b.project_Name,
+		b.project_Type,
+		c.appendStatus
+		FROM
+		sj_material_information AS a
+		LEFT JOIN sj_project_information AS b ON a.project_id = b.project_id
+		LEFT JOIN sj_project_append AS c ON a.project_id = c.project_id
+		where a.project_Id in(
 		<foreach collection="list" item="items" index="index"  separator=",">
 			#{items.projectId}
 		</foreach>
@@ -618,4 +625,13 @@
 			</otherwise>
 		</choose>
 	</select>
+
+	<select id="findNoFinishList" resultType="com.jeeplus.modules.sg.audit.information.entity.Information">
+		select * from sj_project_information where(firstFinish ='否' or secondFinish = '否')
+		and project_Id in(
+		<foreach collection="list" item="items" index="index"  separator=",">
+			#{items.projectId}
+		</foreach>
+		)
+	</select>
 </mapper>

+ 4 - 0
src/main/java/com/jeeplus/modules/sg/audit/information/service/InformationService.java

@@ -98,6 +98,10 @@ public class InformationService extends CrudService<InformationMapper, Informati
 		return super.findAllList(entity);
 	}
 
+	public List<Information> findNoFinishList(List<Information> list) {
+		return informationMapper.findNoFinishList(list);
+	}
+
 	public Page<Information> findPage(Page<Information> page, Information entity) {
 		Page<Information> page1 = super.findPage(page, entity);
 		List<Information> list = page1.getList();

+ 11 - 35
src/main/java/com/jeeplus/modules/sg/audit/information/utils/ImportInformation.java

@@ -337,6 +337,7 @@ public  class ImportInformation {
                     Object endDate = ei.getCellValue(row, 43);
                     Object resultDate = ei.getCellValue(row, 44);
                     Object approvalDate = ei.getCellValue(row, 45);
+                    Object underCentralized = ei.getCellValue(row, 53);
                     Object secondUnits = ei.getCellValue(row, 54);
                     Object firstUnits = ei.getCellValue(row, 55);
                     if (projectTotal.equals("")) {
@@ -348,6 +349,7 @@ public  class ImportInformation {
                     information.setProjectGrade(projectGrade.toString());
                     information.setProjectYear(projectYear.toString());
                     information.setProjectTotal(projectTotal.toString());
+                    information.setUnderCentralized(secondUnits.toString()+underCentralized.toString());
                         if (!projectStart.equals("")&&projectStart!=null) {
                             information.setProjectStart(simpleDateFormat.parse(projectStart.toString()));
                         }
@@ -415,17 +417,17 @@ public  class ImportInformation {
                 Material material = new Material();
                 Row row = ei.getRow(i);
                 //项目定义号
-                Object projectId = ei.getCellValue(row, 0);
+                Object projectId = ei.getCellValue(row, 1);
                 //审定数量
-                Object authorizedNumber = ei.getCellValue(row, 7);
+                Object authorizedNumber = ei.getCellValue(row, 10);
                 //出库数量
-                Object outboundNumber = ei.getCellValue(row, 6);
+                Object outboundNumber = ei.getCellValue(row, 9);
                 //物料编号
-                Object inforId = ei.getCellValue(row, 1);
+                Object inforId = ei.getCellValue(row, 2);
                 //原因类型
-                Object status = ei.getCellValue(row, 14);
+                Object status = ei.getCellValue(row, 17);
                 //备注说明
-                Object info = ei.getCellValue(row, 15);
+                Object info = ei.getCellValue(row, 18);
                 //根据项目定义号,物料定义号查询出该条的物料信息
                 Material myProIn = materialService.findByProIn(projectId.toString(), inforId.toString());
                 //如果出库数量与记录的出库数量不一致,不与插入
@@ -541,23 +543,6 @@ public  class ImportInformation {
             }
             if (noChange.size() != 0) {
                 materialService.updateStatus(noChange);
-                List<Material> isBack = materialService.findIsBack(materialList);
-                for (Material maInfor:isBack) {
-                    Information upInfor = new Information();
-                    Information needInfor = materialService.findNeedInfor(maInfor);
-                    if (needInfor.getFirstFinish() == "" || needInfor.getFirstFinish() == null || ("否").equals(needInfor.getFirstFinish())) {
-                        upInfor.setProjectId(needInfor.getProjectId());
-                        upInfor.setFirstFinish("是");
-                        upInfor.setFirstFinishDate(new Date());
-                    } else if (("否").equals(needInfor.getSecondFinish())) {
-                        upInfor.setProjectId(needInfor.getProjectId());
-                        upInfor.setSecondFinish("是");
-                        upInfor.setSecondFinishDate(new Date());
-                    } else {
-                        continue;
-                    }
-                    materialService.updateNeed(upInfor);
-                }
                 noChange.clear();
             }
         } catch (Exception e) {
@@ -584,22 +569,13 @@ public  class ImportInformation {
                 Row row = ei.getRow(i);
                 //项目定义号
                 Object projectId = ei.getCellValue(row, 0);
-                //是否决算颂声
+                //是否决算送审
                 Object trial = ei.getCellValue(row, 1);
-                //施工单位
-                Object construction = ei.getCellValue(row, 2);
                 //工作状态
-                Object outConstruction = ei.getCellValue(row, 3);
-                //结算单位
-                Object settlement = ei.getCellValue(row, 4);
-                //归口部门
-                Object underCentralized = ei.getCellValue(row, 5);
+                Object appendStatus = ei.getCellValue(row, 2);
                 append.setProjectId(projectId.toString());
                 append.setTrial(trial.toString());
-                append.setConstruction(construction.toString());
-                append.setOutConstruction(outConstruction.toString());
-                append.setSettlement(settlement.toString());
-                append.setUnderCentralized(underCentralized.toString());
+                append.setAppendStatus(appendStatus.toString());
                 appendList.add(append);
                 if (appendList.size() == 1000) {
                     informationService.updateAppend(appendList);

+ 61 - 60
src/main/java/com/jeeplus/modules/sg/audit/information/web/InformationController.java

@@ -4,6 +4,7 @@
 package com.jeeplus.modules.sg.audit.information.web;
 
 import java.io.*;
+import java.net.URLDecoder;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -446,40 +447,40 @@ public class InformationController extends BaseController {
         String extendedTime = "";
         String hiddenSign = "";
         try {
-            projectId = request.getParameter("projectId");
-            projectId = new String(projectId.getBytes("iso8859-1"), "utf-8");
+            projectId = (String)request.getParameter("projectId");
+            projectId = URLDecoder.decode(projectId,"UTF-8");
             if (projectId.equals("")) {
 
             } else {
                 String[] strArr = projectId.split("\\s+");
                 information.setAttrs(strArr);
             }
-            projectName = request.getParameter("projectName");
-            projectName = new String(projectName.getBytes("iso8859-1"), "utf-8");
+            projectName = (String)request.getParameter("projectName");
+            projectName = URLDecoder.decode(projectName,"UTF-8");
+            projectType = (String)request.getParameter("projectType");
+            projectType = URLDecoder.decode(projectType,"UTF-8");
+            projectYear = (String)request.getParameter("projectYear");
+            projectYear = URLDecoder.decode(projectYear,"UTF-8");
+            firstUnits = (String)request.getParameter("firstUnits");
+            firstUnits = URLDecoder.decode(firstUnits,"UTF-8");
+            secondUnits = (String)request.getParameter("secondUnits");
+            secondUnits = URLDecoder.decode(secondUnits,"UTF-8");
+            firstFinish = (String)request.getParameter("firstFinish");
+            firstFinish = URLDecoder.decode(firstFinish,"UTF-8");
+            extendedStatus = (String)request.getParameter("extendedStatus");
+            extendedStatus = URLDecoder.decode(extendedStatus,"UTF-8");
+            extendedTime = (String)request.getParameter("extendedTime");
+            extendedTime = URLDecoder.decode(extendedTime,"UTF-8");
+            hiddenSign = (String)request.getParameter("hiddenSign");
+            hiddenSign = URLDecoder.decode(hiddenSign,"UTF-8");
             information.setProjectName(projectName);
-            projectType = request.getParameter("projectType");
-            projectType = new String(projectType.getBytes("iso8859-1"), "utf-8");
             information.setProjectType(projectType);
-            projectYear = request.getParameter("projectYear");
-            projectYear = new String(projectYear.getBytes("iso8859-1"), "utf-8");
             information.setProjectType(projectYear);
-            firstUnits = request.getParameter("firstUnits");
-            firstUnits = new String(firstUnits.getBytes("iso8859-1"), "utf-8");
             information.setFirstUnits(firstUnits);
-            secondUnits = request.getParameter("secondUnits");
-            secondUnits = new String(secondUnits.getBytes("iso8859-1"), "utf-8");
             information.setSecondUnits(secondUnits);
-            firstFinish = request.getParameter("firstFinish");
-            firstFinish = new String(firstFinish.getBytes("iso8859-1"), "utf-8");
             information.setFirstFinish(firstFinish);
-            extendedStatus = request.getParameter("extendedStatus");
-            extendedStatus = new String(extendedStatus.getBytes("iso8859-1"), "utf-8");
             information.setExtendedStatus(extendedStatus);
-            extendedTime = request.getParameter("extendedTime");
-            extendedTime = new String(extendedTime.getBytes("iso8859-1"), "utf-8");
             information.setExtendedTime(extendedTime);
-            hiddenSign = request.getParameter("hiddenSign");
-            hiddenSign = new String(hiddenSign.getBytes("iso8859-1"), "utf-8");
             information.setHiddenSign(hiddenSign);
         } catch (UnsupportedEncodingException e) {
             e.printStackTrace();
@@ -544,40 +545,40 @@ public class InformationController extends BaseController {
         String extendedTime = "";
         String hiddenSign = "";
         try {
-            projectId = request.getParameter("projectId");
-            projectId = new String(projectId.getBytes("iso8859-1"), "utf-8");
+            projectId = (String)request.getParameter("projectId");
+            projectId = URLDecoder.decode(projectId,"UTF-8");
             if (projectId.equals("")) {
 
             } else {
                 String[] strArr = projectId.split("\\s+");
                 information.setAttrs(strArr);
             }
-            projectName = request.getParameter("projectName");
-            projectName = new String(projectName.getBytes("iso8859-1"), "utf-8");
+            projectName = (String)request.getParameter("projectName");
+            projectName = URLDecoder.decode(projectName,"UTF-8");
+            projectType = (String)request.getParameter("projectType");
+            projectType = URLDecoder.decode(projectType,"UTF-8");
+            projectYear = (String)request.getParameter("projectYear");
+            projectYear = URLDecoder.decode(projectYear,"UTF-8");
+            firstUnits = (String)request.getParameter("firstUnits");
+            firstUnits = URLDecoder.decode(firstUnits,"UTF-8");
+            secondUnits = (String)request.getParameter("secondUnits");
+            secondUnits = URLDecoder.decode(secondUnits,"UTF-8");
+            firstFinish = (String)request.getParameter("firstFinish");
+            firstFinish = URLDecoder.decode(firstFinish,"UTF-8");
+            extendedStatus = (String)request.getParameter("extendedStatus");
+            extendedStatus = URLDecoder.decode(extendedStatus,"UTF-8");
+            extendedTime = (String)request.getParameter("extendedTime");
+            extendedTime = URLDecoder.decode(extendedTime,"UTF-8");
+            hiddenSign = (String)request.getParameter("hiddenSign");
+            hiddenSign = URLDecoder.decode(hiddenSign,"UTF-8");
             information.setProjectName(projectName);
-            projectType = request.getParameter("projectType");
-            projectType = new String(projectType.getBytes("iso8859-1"), "utf-8");
             information.setProjectType(projectType);
-            projectYear = request.getParameter("projectYear");
-            projectYear = new String(projectYear.getBytes("iso8859-1"), "utf-8");
             information.setProjectType(projectYear);
-            firstUnits = request.getParameter("firstUnits");
-            firstUnits = new String(firstUnits.getBytes("iso8859-1"), "utf-8");
             information.setFirstUnits(firstUnits);
-            secondUnits = request.getParameter("secondUnits");
-            secondUnits = new String(secondUnits.getBytes("iso8859-1"), "utf-8");
             information.setSecondUnits(secondUnits);
-            firstFinish = request.getParameter("firstFinish");
-            firstFinish = new String(firstFinish.getBytes("iso8859-1"), "utf-8");
             information.setFirstFinish(firstFinish);
-            extendedStatus = request.getParameter("extendedStatus");
-            extendedStatus = new String(extendedStatus.getBytes("iso8859-1"), "utf-8");
             information.setExtendedStatus(extendedStatus);
-            extendedTime = request.getParameter("extendedTime");
-            extendedTime = new String(extendedTime.getBytes("iso8859-1"), "utf-8");
             information.setExtendedTime(extendedTime);
-            hiddenSign = request.getParameter("hiddenSign");
-            hiddenSign = new String(hiddenSign.getBytes("iso8859-1"), "utf-8");
             information.setHiddenSign(hiddenSign);
         } catch (UnsupportedEncodingException e) {
             e.printStackTrace();
@@ -641,40 +642,40 @@ public class InformationController extends BaseController {
         String extendedTime = "";
         String hiddenSign = "";
         try {
-            projectId = request.getParameter("projectId");
-            projectId = new String(projectId.getBytes("iso8859-1"), "utf-8");
+            projectId = (String)request.getParameter("projectId");
+            projectId = URLDecoder.decode(projectId,"UTF-8");
             if (projectId.equals("")) {
 
             } else {
                 String[] strArr = projectId.split("\\s+");
                 information.setAttrs(strArr);
             }
-            projectName = request.getParameter("projectName");
-            projectName = new String(projectName.getBytes("iso8859-1"), "utf-8");
+            projectName = (String)request.getParameter("projectName");
+            projectName = URLDecoder.decode(projectName,"UTF-8");
+            projectType = (String)request.getParameter("projectType");
+            projectType = URLDecoder.decode(projectType,"UTF-8");
+            projectYear = (String)request.getParameter("projectYear");
+            projectYear = URLDecoder.decode(projectYear,"UTF-8");
+            firstUnits = (String)request.getParameter("firstUnits");
+            firstUnits = URLDecoder.decode(firstUnits,"UTF-8");
+            secondUnits = (String)request.getParameter("secondUnits");
+            secondUnits = URLDecoder.decode(secondUnits,"UTF-8");
+            firstFinish = (String)request.getParameter("firstFinish");
+            firstFinish = URLDecoder.decode(firstFinish,"UTF-8");
+            extendedStatus = (String)request.getParameter("extendedStatus");
+            extendedStatus = URLDecoder.decode(extendedStatus,"UTF-8");
+            extendedTime = (String)request.getParameter("extendedTime");
+            extendedTime = URLDecoder.decode(extendedTime,"UTF-8");
+            hiddenSign = (String)request.getParameter("hiddenSign");
+            hiddenSign = URLDecoder.decode(hiddenSign,"UTF-8");
             information.setProjectName(projectName);
-            projectType = request.getParameter("projectType");
-            projectType = new String(projectType.getBytes("iso8859-1"), "utf-8");
             information.setProjectType(projectType);
-            projectYear = request.getParameter("projectYear");
-            projectYear = new String(projectYear.getBytes("iso8859-1"), "utf-8");
             information.setProjectType(projectYear);
-            firstUnits = request.getParameter("firstUnits");
-            firstUnits = new String(firstUnits.getBytes("iso8859-1"), "utf-8");
             information.setFirstUnits(firstUnits);
-            secondUnits = request.getParameter("secondUnits");
-            secondUnits = new String(secondUnits.getBytes("iso8859-1"), "utf-8");
             information.setSecondUnits(secondUnits);
-            firstFinish = request.getParameter("firstFinish");
-            firstFinish = new String(firstFinish.getBytes("iso8859-1"), "utf-8");
             information.setFirstFinish(firstFinish);
-            extendedStatus = request.getParameter("extendedStatus");
-            extendedStatus = new String(extendedStatus.getBytes("iso8859-1"), "utf-8");
             information.setExtendedStatus(extendedStatus);
-            extendedTime = request.getParameter("extendedTime");
-            extendedTime = new String(extendedTime.getBytes("iso8859-1"), "utf-8");
             information.setExtendedTime(extendedTime);
-            hiddenSign = request.getParameter("hiddenSign");
-            hiddenSign = new String(hiddenSign.getBytes("iso8859-1"), "utf-8");
             information.setHiddenSign(hiddenSign);
         } catch (UnsupportedEncodingException e) {
             e.printStackTrace();

+ 82 - 44
src/main/java/com/jeeplus/modules/sg/audit/material/entity/Material.java

@@ -7,7 +7,7 @@ import com.jeeplus.common.utils.excel.annotation.ExcelField;
 import com.jeeplus.core.persistence.DataEntity;
 
 /**
- * 项目信息Entity
+ * 物料信息Entity
  * @author qiuyue
  * @version 2019-09-04
  */
@@ -51,40 +51,23 @@ public class Material extends DataEntity<Material>  {
     private Double afterNumber;
     //用于记录修改原因后的审定数量,便于下次比对
     private Double afterAuthor;
+    //项目名称
+    private String projectName;
+    //项目类型
+    private String projectType;
+    //工作状态
+    private String appendStatus;
 
-    public Double getAfterAuthor() {
-        return afterAuthor;
-    }
-
-    public void setAfterAuthor(Double afterAuthor) {
-        this.afterAuthor = afterAuthor;
-    }
-
-    public Double getAfterNumber() {
-        return afterNumber;
-    }
-
-    public void setAfterNumber(Double afterNumber) {
-        this.afterNumber = afterNumber;
-    }
-
-    public int getIsBackNo() {
-        return isBackNo;
+    @ExcelField(title="项目名称", align=2, sort=1)
+    public String getProjectName() {
+        return projectName;
     }
 
-    public void setIsBackNo(int isBackNo) {
-        this.isBackNo = isBackNo;
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
     }
 
-    @ExcelField(title="是否完成领退料", align=2, sort=14)
-    public String getIsBack() {
-        return isBack;
-    }
-
-    public void setIsBack(String isBack) {
-        this.isBack = isBack;
-    }
-    @ExcelField(title="项目定义号", align=2, sort=1)
+    @ExcelField(title="项目定义号", align=2, sort=2)
     public String getProjectId() {
         return projectId;
     }
@@ -93,7 +76,7 @@ public class Material extends DataEntity<Material>  {
         this.projectId = projectId;
     }
 
-    @ExcelField(title="物料编号", align=2, sort=2)
+    @ExcelField(title="物料编号", align=2, sort=3)
     public String getInforId() {
         return inforId;
     }
@@ -102,7 +85,25 @@ public class Material extends DataEntity<Material>  {
         this.inforId = inforId;
     }
 
-    @ExcelField(title="物料描述", align=2, sort=3)
+    @ExcelField(title="项目类型", align=2, sort=4)
+    public String getProjectType() {
+        return projectType;
+    }
+
+    public void setProjectType(String projectType) {
+        this.projectType = projectType;
+    }
+
+    @ExcelField(title="工作状态", align=2, sort=5)
+    public String getAppendStatus() {
+        return appendStatus;
+    }
+
+    public void setAppendStatus(String appendStatus) {
+        this.appendStatus = appendStatus;
+    }
+
+    @ExcelField(title="物料描述", align=2, sort=6)
     public String getMaterialName() {
         return materialName;
     }
@@ -111,7 +112,7 @@ public class Material extends DataEntity<Material>  {
         this.materialName = materialName;
     }
 
-    @ExcelField(title="出库金额", align=2, sort=4)
+    @ExcelField(title="出库金额", align=2, sort=7)
     public Double getOutboundAmount() {
         return outboundAmount;
     }
@@ -120,7 +121,7 @@ public class Material extends DataEntity<Material>  {
         this.outboundAmount = outboundAmount;
     }
 
-    @ExcelField(title="审定金额", align=2, sort=5)
+    @ExcelField(title="审定金额", align=2, sort=8)
     public Double getAuthorizedAmount() {
         return authorizedAmount;
     }
@@ -129,7 +130,7 @@ public class Material extends DataEntity<Material>  {
         this.authorizedAmount = authorizedAmount;
     }
 
-    @ExcelField(title="差额", align=2, sort=6)
+    @ExcelField(title="差额", align=2, sort=9)
     public Double getDifference() {
         return difference;
     }
@@ -138,7 +139,7 @@ public class Material extends DataEntity<Material>  {
         this.difference = difference;
     }
 
-    @ExcelField(title="出库数量", align=2, sort=7)
+    @ExcelField(title="出库数量", align=2, sort=10)
     public Double getOutboundNumber() {
         return outboundNumber;
     }
@@ -147,7 +148,7 @@ public class Material extends DataEntity<Material>  {
         this.outboundNumber = outboundNumber;
     }
 
-    @ExcelField(title="审定数量", align=2, sort=8)
+    @ExcelField(title="审定数量", align=2, sort=11)
     public Double getAuthorizedNumber() {
         return authorizedNumber;
     }
@@ -156,7 +157,7 @@ public class Material extends DataEntity<Material>  {
         this.authorizedNumber = authorizedNumber;
     }
 
-    @ExcelField(title="平均价单价", align=2, sort=9)
+    @ExcelField(title="平均价单价", align=2, sort=12)
     public Double getPrice() {
         return price;
     }
@@ -165,7 +166,7 @@ public class Material extends DataEntity<Material>  {
         this.price = price;
     }
 
-    @ExcelField(title="单位", align=2, sort=10)
+    @ExcelField(title="单位", align=2, sort=13)
     public String getUnit() {
         return unit;
     }
@@ -174,7 +175,7 @@ public class Material extends DataEntity<Material>  {
         this.unit = unit;
     }
 
-    @ExcelField(title="物料小类", align=2, sort=11)
+    @ExcelField(title="物料小类", align=2, sort=14)
     public String getMaterialSmall() {
         return materialSmall;
     }
@@ -183,7 +184,7 @@ public class Material extends DataEntity<Material>  {
         this.materialSmall = materialSmall;
     }
 
-    @ExcelField(title="物料中类", align=2, sort=12)
+    @ExcelField(title="物料中类", align=2, sort=15)
     public String getMaterialMid() {
         return materialMid;
     }
@@ -192,7 +193,7 @@ public class Material extends DataEntity<Material>  {
         this.materialMid = materialMid;
     }
 
-    @ExcelField(title="物料大类", align=2, sort=13)
+    @ExcelField(title="物料大类", align=2, sort=16)
     public String getMaterialBig() {
         return materialBig;
     }
@@ -201,7 +202,16 @@ public class Material extends DataEntity<Material>  {
         this.materialBig = materialBig;
     }
 
-    @ExcelField(title="原因类型", align=2, sort=15)
+    @ExcelField(title="是否完成领退料", align=2, sort=17)
+    public String getIsBack() {
+        return isBack;
+    }
+
+    public void setIsBack(String isBack) {
+        this.isBack = isBack;
+    }
+
+    @ExcelField(title="原因类型", align=2, sort=18)
     public String getStatus() {
         return status;
     }
@@ -210,7 +220,7 @@ public class Material extends DataEntity<Material>  {
         this.status = status;
     }
 
-    @ExcelField(title="备注说明", align=2, sort=16)
+    @ExcelField(title="备注说明", align=2, sort=19)
     public String getInfo() {
         return info;
     }
@@ -218,4 +228,32 @@ public class Material extends DataEntity<Material>  {
     public void setInfo(String info) {
         this.info = info;
     }
+
+
+    public Double getAfterAuthor() {
+        return afterAuthor;
+    }
+
+    public void setAfterAuthor(Double afterAuthor) {
+        this.afterAuthor = afterAuthor;
+    }
+
+    public Double getAfterNumber() {
+        return afterNumber;
+    }
+
+    public void setAfterNumber(Double afterNumber) {
+        this.afterNumber = afterNumber;
+    }
+
+
+    public void setIsBackNo(int isBackNo) {
+        this.isBackNo = isBackNo;
+    }
+
+    public int getIsBackNo() {
+        return isBackNo;
+    }
+
+
 }

+ 9 - 0
src/main/java/com/jeeplus/modules/sg/audit/report/entity/SgReport.java

@@ -14,6 +14,15 @@ public class SgReport extends DataEntity<SgReport> {
     private String endDate;
     private Integer finishCount;
     private Integer unfinishCount;
+    private String condition;
+
+    public String getCondition() {
+        return condition;
+    }
+
+    public void setCondition(String condition) {
+        this.condition = condition;
+    }
 
     public String getName() {
         return name;

+ 4 - 0
src/main/java/com/jeeplus/modules/sg/audit/report/mapper/ReportMapper.java

@@ -5,6 +5,7 @@ package com.jeeplus.modules.sg.audit.report.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.audit.report.entity.SgReport;
 
 import java.util.List;
@@ -16,4 +17,7 @@ public interface ReportMapper extends BaseMapper<SgReport> {
    List<SgReport> findList(SgReport sgReport);
    List<SgReport> findUnitData(SgReport sgReport);
    List<SgReport> findUnitList(SgReport sgReport);
+   List<SgReport> findSecondData(SgReport sgReport);
+   List<SgReport> findSecondList(SgReport sgReport);
+   List<Information> findInformationList(SgReport sgReport);
 }

+ 111 - 14
src/main/java/com/jeeplus/modules/sg/audit/report/mapper/xml/ReportMapper.xml

@@ -1,7 +1,33 @@
 <?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.sg.audit.report.mapper.ReportMapper">
-
+	<sql id="newInformationColumns">
+		a.id,
+		a.project_id,
+		a.project_name,
+		a.project_type,
+		a.project_grade,
+		a.project_year,
+		a.project_total,
+		a.project_start,
+		a.project_stop,
+		a.department,
+		a.project_firm,
+		a.subDate,
+		a.releaseDate,
+		a.endDate,
+		a.resultDate,
+		a.approvalDate,
+		a.second_units,
+		a.first_units,
+		a.firstFinish,
+		a.firstFinishDate,
+		a.secondFinish,
+		a.secondFinishDate,
+		a.finishDate,
+		a.overdue,
+		a.underCentralized
+	</sql>
 	<select id="findData" resultType="SgReport" parameterType="SgReport">
 		SELECT a.department as name ,
 		sum(a.st1) as finishCount,
@@ -62,10 +88,10 @@
 		sum(a.st1) as finishCount,
 		SUM(a.st2) as unfinishCount
 		 from
-	    (SELECT if(t2.underCentralized is null,'未知部门',t2.underCentralized) as underCentralized,
+	    (SELECT if(t1.underCentralized is null,'未知部门',t1.underCentralized) as underCentralized,
 	            if(t1.firstFinish='否' or t1.secondFinish = '否',0,1) as st1,
 	            if(t1.firstFinish='否' or t1.secondFinish = '否',1,0) as st2
-	            from sj_project_information t1 left join sj_project_append t2 on t1.project_id = t2.project_id
+	            from sj_project_information t1
 		<where>
 			1=1
 			<if test="dataScope != null and dataScope != ''">
@@ -90,10 +116,10 @@
 		a.status as status
 		from
 		(SELECT id,
-		if(t2.underCentralized is null,'未知部门',t2.underCentralized) as underCentralized,
+		if(t1.underCentralized is null,'未知部门',t1.underCentralized) as underCentralized,
 		if(t1.firstFinish='否' or t1.secondFinish = '否',NOW(),if(t1.secondFinish = '是',t1.secondFinishDate,t1.firstFinishDate) )as da ,
 		t1.approvalDate ,if(t1.firstFinish='否' or t1.secondFinish = '否','0','1') as status
-		from sj_project_information t1 left join sj_project_append t2 on t1.project_id = t2.project_id
+		from sj_project_information t1
 		<where>
 			1=1
 			<if test="dataScope != null and dataScope != ''">
@@ -111,17 +137,88 @@
 
 	</select>
 
+	<select id="findSecondData" resultType="SgReport" parameterType="SgReport">
+		SELECT a.second_units as name,
+		sum(a.st1) as finishCount,
+		SUM(a.st2) as unfinishCount
+		from
+		(SELECT if(t1.second_units is null,'未知部门',t1.second_units) as second_units,
+		if(t1.firstFinish='否' or t1.secondFinish = '否',0,1) as st1,
+		if(t1.firstFinish='否' or t1.secondFinish = '否',1,0) as st2
+		from sj_project_information t1
+		<where>
+			1=1
+			<if test="dataScope != null and dataScope != ''">
+				${dataScope}
+			</if>
+		</where>
+		) a
+		GROUP BY a.second_units
+	</select>
 
+	<select id="findSecondList" parameterType="SgReport" resultType="SgReport">
+		SELECT b.second_units as name,
+		sum(b.level1) as level1,
+		sum(b.level2) as level2,
+		sum(b.level3) as level3,
+		sum(b.level4) as level4 from
+		(SELECT a.id, a.second_units,
+		if(DATEDIFF(a.da, a.approvalDate)&lt;=7,1,0) as level1,
+		if(DATEDIFF(a.da, a.approvalDate)&lt;= 14 and DATEDIFF(a.da, a.approvalDate)&gt;7,1,0) as level2,
+		if(DATEDIFF(a.da, a.approvalDate)&lt;= 21 and DATEDIFF(a.da, a.approvalDate)&gt;14,1,0) as level3,
+		if(DATEDIFF(a.da, a.approvalDate)&gt;21 or a.approvalDate is null,1,0) as level4,
+		a.status as status
+		from
+		(SELECT id,
+		if(t1.second_units is null,'未知部门',t1.second_units) as second_units,
+		if(t1.firstFinish='否' or t1.secondFinish = '否',NOW(),if(t1.secondFinish = '是',t1.secondFinishDate,t1.firstFinishDate) )as da ,
+		t1.approvalDate ,if(t1.firstFinish='否' or t1.secondFinish = '否','0','1') as status
+		from sj_project_information t1
+		<where>
+			1=1
+			<if test="dataScope != null and dataScope != ''">
+				${dataScope}
+			</if>
+		</where>
+		) a
+		<where>
+			<if test="status != null and status != ''">
+				a.status = #{status} and
+			</if>
+			1=1
+		</where>
+		) b   GROUP BY b.second_units
 
+	</select>
 
 
-
-
-
-
-
-	
-
-
-
+	<select id="findInformationList" resultType="Information">
+		SELECT
+		<include refid="newInformationColumns"/>,b.trial,b.appendStatus,
+		datediff(if(firstFinish='否' or secondFinish = '否',NOW(),if(secondFinish = '是',secondFinishDate,firstFinishDate)),approvalDate) as newdate
+		FROM sj_project_information as a
+		left JOIN sj_project_append as b on a.project_id = b.project_id
+		<where>
+			1=1
+			<if test="type!=null and type!=''">
+				<if test="type==0">
+					and a.department like concat('%',#{condition},'%')
+				</if>
+				<if test="type==1">
+					and a.underCentralized like concat('%',#{condition},'%')
+				</if>
+				<if test="type==2">
+					and a.second_units like concat('%',#{condition},'%')
+				</if>
+			</if>
+			<if test="status!=null and status !=''">
+				<if test="status==0">
+					and a.firstFinish='是' and (a.secondFinish != '否' or a.secondFinish is null)
+				</if>
+				<if test="status==1">
+					and (a.firstFinish='否' or a.secondFinish = '否')
+				</if>
+			</if>
+		</where>
+	</select>
 </mapper>

+ 73 - 0
src/main/java/com/jeeplus/modules/sg/audit/report/service/ReportService.java

@@ -1,11 +1,15 @@
 package com.jeeplus.modules.sg.audit.report.service;
 
 import com.jeeplus.core.service.CrudService;
+import com.jeeplus.modules.sg.audit.information.entity.Information;
+import com.jeeplus.modules.sg.audit.information.mapper.InformationMapper;
 import com.jeeplus.modules.sg.audit.report.entity.SgReport;
 import com.jeeplus.modules.sg.audit.report.mapper.ReportMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Calendar;
+import java.util.Date;
 import java.util.List;
 
 @Service
@@ -13,6 +17,9 @@ public class ReportService extends CrudService<ReportMapper, SgReport> {
     @Autowired
     private ReportMapper reportMapper;
 
+    @Autowired
+    private InformationMapper informationMapper;
+
 
     public List<SgReport> findData(SgReport sgReport){
         dataRuleFilter(sgReport);
@@ -33,4 +40,70 @@ public class ReportService extends CrudService<ReportMapper, SgReport> {
         dataRuleFilter(sgReport);
         return reportMapper.findUnitList(sgReport);
     }
+    public List<SgReport> findSecondList(SgReport sgReport){
+        dataRuleFilter(sgReport);
+        return reportMapper.findSecondList(sgReport);
+    }
+
+    public List<SgReport> findSecondData(SgReport sgReport){
+        dataRuleFilter(sgReport);
+        return reportMapper.findSecondData(sgReport);
+    }
+
+    public List<Information> findInformationList(SgReport sgReport) {
+        dataRuleFilter(sgReport);
+        List<Information> list = reportMapper.findInformationList(sgReport);
+        String find = informationMapper.findOverTime("overTime");
+        int overTime = Integer.parseInt(find);
+        Calendar cal = Calendar.getInstance();
+        long between_days = 0;
+        for (Information in : list) {
+            //判断审定日期是否为空
+//			if (in.getApprovalDate() != null) {
+            //格式化审定日期
+            if ("否".equals(in.getFirstFinish()) || "否".equals(in.getSecondFinish())) {
+                in.setComplete("否");
+                if (in.getApprovalDate() != null) {
+                    cal.setTime(in.getApprovalDate());
+                    long appDay = cal.getTimeInMillis();
+                    cal.setTime(new Date());
+                    long nowDate = cal.getTimeInMillis();
+                    between_days = (nowDate - appDay) / (1000 * 3600 * 24);
+                    in.setNoFinishDate(String.valueOf(between_days) + "天");
+                }
+            } else {
+                in.setComplete("是");
+                if (in.getApprovalDate() != null) {
+                    cal.setTime(in.getApprovalDate());
+                    long appDay = cal.getTimeInMillis();
+                    if (in.getFirstFinishDate() != null || in.getSecondFinishDate() != null) {
+                        if (in.getSecondFinishDate() != null) {
+                            cal.setTime(in.getSecondFinishDate());
+                            long secondDate = cal.getTimeInMillis();
+                            between_days = (secondDate - appDay) / (1000 * 3600 * 24);
+                            in.setFinishDate(String.valueOf(between_days) + "天");
+                            if (between_days > overTime) {
+                                in.setOverdue("是");
+                            } else {
+                                in.setOverdue("否");
+                            }
+                        } else {
+                            cal.setTime(in.getFirstFinishDate());
+                            long firstDate = cal.getTimeInMillis();
+                            between_days = (firstDate - appDay) / (1000 * 3600 * 24);
+                            in.setFinishDate(String.valueOf(between_days) + "天");
+                            if (between_days > overTime) {
+                                in.setOverdue("是");
+                            } else {
+                                in.setOverdue("否");
+                            }
+                        }
+                    }
+                }
+            }
+//			}
+        }
+        return list;
+    }
+
 }

+ 123 - 0
src/main/java/com/jeeplus/modules/sg/audit/report/web/ReportController.java

@@ -7,7 +7,13 @@ import com.github.abel533.echarts.code.Trigger;
 import com.github.abel533.echarts.feature.MagicType;
 import com.github.abel533.echarts.json.GsonOption;
 import com.github.abel533.echarts.series.Bar;
+import com.jeeplus.common.json.AjaxJson;
+import com.jeeplus.common.utils.DateUtils;
 import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.utils.excel.ExportExcel;
+import com.jeeplus.modules.sg.audit.information.entity.Information;
+import com.jeeplus.modules.sg.audit.information.entity.OutInformation;
+import com.jeeplus.modules.sg.audit.material.entity.Material;
 import com.jeeplus.modules.sg.audit.report.entity.SgReport;
 import com.jeeplus.modules.sg.audit.report.service.ReportService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -18,6 +24,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.net.URLDecoder;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -68,6 +75,25 @@ public class ReportController {
     }
 
 
+    /**
+     * 二级单位项目报表
+     */
+    @RequestMapping("/secondlist")
+    public String list2(SgReport sgReport, Model model) {
+        String status = sgReport.getStatus();
+        model.addAttribute("sgReport", sgReport);
+        List<SgReport> list = reportService.findSecondData(sgReport);
+//        List<SgReport> list1 = reportService.findList(sgReport);
+        model.addAttribute("list",list);
+//        model.addAttribute("list1",list1);
+        if(StringUtils.isNotBlank(status)) {
+            model.addAttribute("dataURL", "/sg/report/secondoption?status=" + status);
+        }else {
+            model.addAttribute("dataURL", "/sg/report/secondoption");
+        }
+        return "modules/sg/audit/report/reportList2";
+    }
+
 
 
     /**
@@ -212,4 +238,101 @@ public class ReportController {
         return option;
     }
 
+
+    @ResponseBody
+    @RequestMapping("secondoption")
+    public GsonOption getOption2(HttpServletRequest request){
+        String status = request.getParameter("status");
+        SgReport sgReport = new SgReport();
+        sgReport.setStatus(status);
+        List<SgReport> list = reportService.findSecondList(sgReport);
+        String[] str = new String[list.size()];
+        int[] level1 = new int[list.size()];
+        int[] level2 = new int[list.size()];
+        int[] level3 = new int[list.size()];
+        int[] level4 = new int[list.size()];
+        for(int i=0;i<list.size();i++){
+            str[i] = list.get(i).getName();
+            level1[i] = list.get(i).getLevel1();
+            level2[i] = list.get(i).getLevel2();
+            level3[i] = list.get(i).getLevel3();
+            level4[i] = list.get(i).getLevel4();
+        }
+        GsonOption option = new GsonOption();
+//        option.title("ECharts2 vs ECharts1", "Chrome下测试数据");
+        option.tooltip(Trigger.axis);
+        option.legend(
+                "1-7天", "8-14天", "15-21天",
+                "21天以上");
+        option.toolbox().show(true)
+                .feature(
+                        Tool.mark, Tool.dataView,
+                        new MagicType(Magic.line, Magic.bar),
+                        Tool.restore, Tool.saveAsImage);
+        option.calculable(true);
+        option.grid().y(70).y2(30).x2(60).bottom(120);
+        CategoryAxis categoryAxis = new CategoryAxis();
+        for(int j=0;j<str.length;j++){
+            categoryAxis.data(str[j]);
+        }
+        option.xAxis(
+                categoryAxis.axisLabel(new AxisLabel().rotate(40).interval(0))
+//                new CategoryAxis()
+//                        .axisLine(new AxisLine().show(false))
+//                        .axisTick(new AxisTick().show(false))
+//                        .axisLabel(new AxisLabel().show(false))
+//                        .splitArea(new SplitArea().show(false))
+//                        .axisLine(new AxisLine().show(false))
+//                        .data("Line", "Bar")
+        );
+        option.yAxis(new ValueAxis().axisLabel(new AxisLabel().formatter("{value} 个")));
+        Bar b1 = new Bar("1-7天");
+        b1.itemStyle().normal().color("rgba(193,35,43,0.5)").label().show(true);
+        Bar b2 = new Bar("8-14天");
+        b2.itemStyle().normal().color("rgba(181,195,52,1)").label().show(true).textStyle().color("#27727B");
+        Bar b3 = new Bar("15-21天");
+        b3.itemStyle().normal().color("rgba(252,206,16,1)").label().show(true).textStyle().color("#E87C25");
+        Bar b4 = new Bar("21天以上");
+        b4.itemStyle().normal().color("rgba(193,35,43,1)").label().show(true);
+        for (int k=0;k<list.size();k++){
+            b1.data(level1[k] );
+            b2.data(level2[k] );
+            b3.data(level3[k] );
+            b4.data(level4[k] );
+        }
+        option.series(b1, b2, b3, b4);
+        return option;
+    }
+
+    /**
+     * 导出项目清单
+     * */
+    @ResponseBody
+    @RequestMapping(value = "exportInformation")
+    public AjaxJson exportInformation(SgReport sgReport,HttpServletRequest request, HttpServletResponse response) {
+        AjaxJson j = new AjaxJson();
+        try {
+/*
+            String condition =  request.getParameter("condition");
+            condition = new String(condition.getBytes("iso8859-1"), "utf-8");
+*/
+            String condition = (String)request.getParameter("condition");
+            condition = URLDecoder.decode(condition,"UTF-8");
+            String status =  request.getParameter("status");
+            String type =  request.getParameter("type");
+            sgReport.setStatus(status);
+            sgReport.setType(type);
+            sgReport.setCondition(condition);
+            String fileName = "导出项目信息" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx";
+            List<Information> informationList = reportService.findInformationList(sgReport);
+            new ExportExcel("导出项目信息", OutInformation.class).setDataList(informationList).write(response, fileName).dispose();
+            j.setSuccess(true);
+            j.setMsg("导出成功!");
+            return j;
+        } catch (Exception e) {
+            j.setSuccess(false);
+            j.setMsg("导出物料清单!失败信息:" + e.getMessage());
+        }
+        return j;
+    }
 }

+ 186 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ErpAccount.java

@@ -0,0 +1,186 @@
+package com.jeeplus.modules.sg.financial.erpcredit.entity;
+
+import com.jeeplus.common.utils.excel.annotation.ExcelField;
+
+
+import java.io.Serializable;
+
+public class ErpAccount implements Serializable {
+    private static final long serialVersionUID = 1L;
+//    private String companyCode;//公司代码
+//    private String aProfitCenter;//利润中心
+//    private String accountData;//过账日期
+//    private String voucherCode;//凭证代码
+//    private String archivingVoucher;//归档凭证类型
+//    private String numberOfArchiving;//归档凭证编码
+//    private String titleText;//凭证抬头文本
+//    private String hookWbsCode;//挂接WBS编码
+//    private String WbsCode;//WBS编码
+
+    private String WbsDetails;//WBS描述
+    private String ProjectDefinitionCode;//项目定义编码
+    private String ProjectDefinitionDetails;//项目定义描述
+//    private String subjectCode;//科目代码
+    private String subjectName;//科目名称
+//    private String borrowingDirection;//借贷方向
+    private String lineItemAmount;//行项目金额
+    private String theNumber;//数量
+//    private String batch;//批次
+//    private String materialCode;//物料编码
+    private String materialDetails;//物料描述
+    private String unit;//单位
+    private String theInputTax;//进项税额
+//    private String taxPurposes;//转出进行税额
+//    private String taxNumbers;//转出凭证号码
+//    private String taxZcDate;//转出凭证过账日期
+//    private String supplier;//供应商)
+    private String supplierName;//供应商名称
+
+////    @ExcelField(title="公司代码")
+//    public String getCompanyCode() {
+//        return companyCode;
+//    }
+////    @ExcelField(title="利润中心")
+//    public String getaProfitCenter() {
+//        return aProfitCenter;
+//    }
+////    @ExcelField(title="凭证编码")
+//    public String getVoucherCode() {
+//        return voucherCode;
+//    }
+////    @ExcelField(title="归档凭证类型")
+//    public String getArchivingVoucher() {
+//        return archivingVoucher;
+//    }
+////    @ExcelField(title="归档凭证编码")
+//    public String getNumberOfArchiving() {
+//        return numberOfArchiving;
+//    }
+////    @ExcelField(title="凭证抬头文本")
+//    public String getTitleText() {
+//        return titleText;
+//    }
+////    @ExcelField(title="挂接WBS编码")
+//    public String getHookWbsCode() {
+//        return hookWbsCode;
+//    }
+////    @ExcelField(title="WBS编码")
+//    public String getWbsCode() {
+//        return WbsCode;
+//    }
+//    @ExcelField(title="WBS描述")
+    public String getWbsDetails() {
+        return WbsDetails;
+    }
+//    @ExcelField(title="项目定义编码")
+    public String getProjectDefinitionCode() {
+        return ProjectDefinitionCode;
+    }
+//    @ExcelField(title="项目定义描述")
+    public String getProjectDefinitionDetails() {
+        return ProjectDefinitionDetails;
+    }
+//    @ExcelField(title="科目代码")
+//    public String getSubjectCode() {
+//        return subjectCode;
+//    }
+//    @ExcelField(title="科目名称")
+    public String getSubjectName() {
+        return subjectName;
+    }
+//    @ExcelField(title="借贷方向")
+//    public String getBorrowingDirection() {
+//        return borrowingDirection;
+//    }
+//    @ExcelField(title="行项目金额")
+    public String getLineItemAmount() {
+        return lineItemAmount;
+    }
+//    @ExcelField(title="数量")
+    public String getTheNumber() {
+        return theNumber;
+    }
+//    @ExcelField(title="批次")
+//    public String getBatch() {
+//        return batch;
+//    }
+//    @ExcelField(title="物料编码")
+//    public String getMaterialCode() {
+//        return materialCode;
+//    }
+//    @ExcelField(title="物料描述")
+    public String getMaterialDetails() {
+        return materialDetails;
+    }
+//    @ExcelField(title="单位")
+    public String getUnit() {
+        return unit;
+    }
+//    @ExcelField(title="进项税额")
+//    public String getTheInputTax() {
+//        return theInputTax;
+//    }
+////    @ExcelField(title="转出进行税额")
+//    public String getTaxPurposes() {
+//        return taxPurposes;
+//    }
+////    @ExcelField(title="转出凭证号码")
+//    public String getTaxNumbers() {
+//        return taxNumbers;
+//    }
+////    @ExcelField(title="供应商")
+//    public String getSupplier() {
+//        return supplier;
+//    }
+////    @ExcelField(title="供应商名称")
+//    public String getSupplierNumber() {
+//        return supplierNumber;
+//    }
+
+    public void setWbsDetails(String wbsDetails) {
+        WbsDetails = wbsDetails;
+    }
+    public void setProjectDefinitionCode(String projectDefinitionCode) {
+        ProjectDefinitionCode = projectDefinitionCode;
+    }
+    public void setProjectDefinitionDetails(String projectDefinitionDetails) {
+        ProjectDefinitionDetails = projectDefinitionDetails;
+    }
+    public void setSubjectName(String subjectName) {
+        this.subjectName = subjectName;
+    }
+    public void setLineItemAmount(String lineItemAmount) {
+        this.lineItemAmount = lineItemAmount;
+    }
+    public void setTheNumber(String theNumber) {
+        this.theNumber = theNumber;
+    }
+
+    public void setMaterialDetails(String materialDetails) {
+        this.materialDetails = materialDetails;
+    }
+    public void setUnit(String unit) {
+        this.unit = unit;
+    }
+
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public String getTheInputTax() {
+        return theInputTax;
+    }
+
+    public void setTheInputTax(String theInputTax) {
+        this.theInputTax = theInputTax;
+    }
+
+    public String getSupplierName() {
+        return supplierName;
+    }
+
+    public void setSupplierName(String supplierName) {
+        this.supplierName = supplierName;
+    }
+}

+ 262 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ErpCredit.java

@@ -0,0 +1,262 @@
+package com.jeeplus.modules.sg.financial.erpcredit.entity;
+
+import com.jeeplus.common.utils.excel.annotation.ExcelField;
+import com.jeeplus.core.persistence.DataEntity;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ErpCredit extends DataEntity<ErpCredit>{
+    private static final long serialVersionUID = 1L;
+
+    private String itemId;//项目定义编码
+    private String itemName;//项目名称
+    private Double actualInvestment;//实际投资
+    private Double transferAssets;//移交生产的资产总值
+    private Double consBuildingFee;//施工:建筑费
+    private Double consInstallFee;//施工:安装费
+    private Double consTotalFee;//施工:总计
+    private Double otherSupervisorFee;//其他:监理费
+    private Double otherDesignFee;//其他设计费
+    private Double otherBeWorkFee;//项目前期工作费
+    private Double otherBuildLoan;//建设期贷款利息
+    private Double otherLineDamages;//线路施工赔偿费
+    private Double otherLegalManage;//法人管理费
+    private Double otherTotalFee;//其他费用合计
+    private Double theInputTax;//进项税额
+    private String tenKvModel;//架空导线型号
+    private String tenKvUnit;//10kv线路信息单位
+    private Double tenKvLength;//10kv线路信息长度
+    private Double tenKvLineLength;//10kv线路长度
+    private Double tenKvItsLine;//10kv线路
+    private Double tenKvItesFhvFollow;//400v以下
+    private String supplierName;//供应商名称
+    private List<ErpCreditChild1> erpCreditChild1s = new ArrayList<ErpCreditChild1>();
+    private List<ErpCreditChild2> erpCreditChild2s = new ArrayList<ErpCreditChild2>();
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+    @ExcelField(title="项目定义编号", align=2, sort=1)
+    public String getItemId() {
+        return itemId;
+    }
+
+    public void setItemId(String itemId) {
+        this.itemId = itemId;
+    }
+    @ExcelField(title="项目名称", align=2, sort=2)
+    public String getItemName() {
+        return itemName;
+    }
+
+    public void setItemName(String itemName) {
+        this.itemName = itemName;
+    }
+    @ExcelField(title="实际投资", align=2, sort=3)
+    public Double getActualInvestment() {
+        return actualInvestment;
+    }
+
+    public void setActualInvestment(Double actualInvestment) {
+        this.actualInvestment = actualInvestment;
+    }
+
+    public Double getTransferAssets() {
+        return transferAssets;
+    }
+
+    public void setTransferAssets(Double transferAssets) {
+        this.transferAssets = transferAssets;
+    }
+
+    public Double getConsBuildingFee() {
+        return consBuildingFee;
+    }
+
+    public void setConsBuildingFee(Double consBuildingFee) {
+        this.consBuildingFee = consBuildingFee;
+    }
+
+    public Double getConsInstallFee() {
+        return consInstallFee;
+    }
+
+    public void setConsInstallFee(Double consInstallFee) {
+        this.consInstallFee = consInstallFee;
+    }
+
+    public Double getConsTotalFee() {
+        return consTotalFee;
+    }
+
+    public void setConsTotalFee(Double consTotalFee) {
+        this.consTotalFee = consTotalFee;
+    }
+
+    public Double getOtherSupervisorFee() {
+        return otherSupervisorFee;
+    }
+
+    public void setOtherSupervisorFee(Double otherSupervisorFee) {
+        this.otherSupervisorFee = otherSupervisorFee;
+    }
+
+    public Double getOtherDesignFee() {
+        return otherDesignFee;
+    }
+
+    public void setOtherDesignFee(Double otherDesignFee) {
+        this.otherDesignFee = otherDesignFee;
+    }
+
+    public Double getOtherBeWorkFee() {
+        return otherBeWorkFee;
+    }
+
+    public void setOtherBeWorkFee(Double otherBeWorkFee) {
+        this.otherBeWorkFee = otherBeWorkFee;
+    }
+
+    public Double getOtherBuildLoan() {
+        return otherBuildLoan;
+    }
+
+    public void setOtherBuildLoan(Double otherBuildLoan) {
+        this.otherBuildLoan = otherBuildLoan;
+    }
+
+    public Double getOtherLineDamages() {
+        return otherLineDamages;
+    }
+
+    public void setOtherLineDamages(Double otherLineDamages) {
+        this.otherLineDamages = otherLineDamages;
+    }
+
+    public Double getOtherLegalManage() {
+        return otherLegalManage;
+    }
+
+    public void setOtherLegalManage(Double otherLegalManage) {
+        this.otherLegalManage = otherLegalManage;
+    }
+
+    public Double getOtherTotalFee() {
+        return otherTotalFee;
+    }
+
+    public void setOtherTotalFee(Double otherTotalFee) {
+        this.otherTotalFee = otherTotalFee;
+    }
+
+    public Double getTheInputTax() {
+        return theInputTax;
+    }
+
+    public void setTheInputTax(Double theInputTax) {
+        this.theInputTax = theInputTax;
+    }
+
+    public String getTenKvModel() {
+        return tenKvModel;
+    }
+
+    public void setTenKvModel(String tenKvModel) {
+        this.tenKvModel = tenKvModel;
+    }
+
+    public String getTenKvUnit() {
+        return tenKvUnit;
+    }
+
+    public void setTenKvUnit(String tenKvUnit) {
+        this.tenKvUnit = tenKvUnit;
+    }
+
+    public Double getTenKvLength() {
+        return tenKvLength;
+    }
+
+    public void setTenKvLength(Double tenKvLength) {
+        this.tenKvLength = tenKvLength;
+    }
+
+    public Double getTenKvLineLength() {
+        return tenKvLineLength;
+    }
+
+    public void setTenKvLineLength(Double tenKvLineLength) {
+        this.tenKvLineLength = tenKvLineLength;
+    }
+
+    public Double getTenKvItsLine() {
+        return tenKvItsLine;
+    }
+
+    public void setTenKvItsLine(Double tenKvItsLine) {
+        this.tenKvItsLine = tenKvItsLine;
+    }
+
+    public Double getTenKvItesFhvFollow() {
+        return tenKvItesFhvFollow;
+    }
+
+    public void setTenKvItesFhvFollow(Double tenKvItesFhvFollow) {
+        this.tenKvItesFhvFollow = tenKvItesFhvFollow;
+    }
+
+    public String getSupplierName() {
+        return supplierName;
+    }
+
+    public void setSupplierName(String supplierName) {
+        this.supplierName = supplierName;
+    }
+
+    public List<ErpCreditChild1> getErpCreditChild1s() {
+        return erpCreditChild1s;
+    }
+
+    public void setErpCreditChild1s(List<ErpCreditChild1> erpCreditChild1s) {
+        this.erpCreditChild1s = erpCreditChild1s;
+    }
+
+    public List<ErpCreditChild2> getErpCreditChild2s() {
+        return erpCreditChild2s;
+    }
+
+    public void setErpCreditChild2s(List<ErpCreditChild2> erpCreditChild2s) {
+        this.erpCreditChild2s = erpCreditChild2s;
+    }
+
+    @Override
+    public String toString() {
+        return "ErpCredit{" +
+                "itemId='" + itemId + '\'' +
+                ", itemName='" + itemName + '\'' +
+                ", actualInvestment=" + actualInvestment +
+                ", transferAssets=" + transferAssets +
+                ", consBuildingFee=" + consBuildingFee +
+                ", consInstallFee=" + consInstallFee +
+                ", consTotalFee=" + consTotalFee +
+                ", otherSupervisorFee=" + otherSupervisorFee +
+                ", otherDesignFee=" + otherDesignFee +
+                ", otherBeWorkFee=" + otherBeWorkFee +
+                ", otherBuildLoan=" + otherBuildLoan +
+                ", otherLineDamages=" + otherLineDamages +
+                ", otherLegalManage=" + otherLegalManage +
+                ", otherTotalFee=" + otherTotalFee +
+                ", theInputTax=" + theInputTax +
+                ", tenKvModel='" + tenKvModel + '\'' +
+                ", tenKvUnit='" + tenKvUnit + '\'' +
+                ", tenKvLength=" + tenKvLength +
+                ", tenKvLineLength=" + tenKvLineLength +
+                ", tenKvItsLine=" + tenKvItsLine +
+                ", tenKvItesFhvFollow=" + tenKvItesFhvFollow +
+                ", supplierName='" + supplierName + '\'' +
+                ", erpCreditChild1s=" + erpCreditChild1s +
+                ", erpCreditChild2s=" + erpCreditChild2s +
+                '}';
+    }
+}

+ 95 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ErpCreditChild1.java

@@ -0,0 +1,95 @@
+package com.jeeplus.modules.sg.financial.erpcredit.entity;
+
+import com.jeeplus.core.persistence.DataEntity;
+
+public class ErpCreditChild1 extends DataEntity<ErpCreditChild1> {//设备费实体类
+    private static final long serialVersionUID = 1L;
+
+    private String eqmMaterialDetails1;//设备物料描述
+    private String eqmUnit;//设备单位
+    private Double eqmNumbers;//设备台数
+    private String eqmTotalCapacity;//设备总容量
+    private Double eqmBookedFee1;//设备入账金额
+    private String eqmSupplierName;//供应商
+    private ErpCredit erpCredit;//父类
+
+    public ErpCreditChild1(){
+
+    }
+    public ErpCreditChild1(ErpCredit erpCredit) {
+        this.erpCredit = erpCredit;
+    }
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public String getEqmMaterialDetails1() {
+        return eqmMaterialDetails1;
+    }
+
+    public void setEqmMaterialDetails1(String eqmMaterialDetails1) {
+        this.eqmMaterialDetails1 = eqmMaterialDetails1;
+    }
+
+    public String getEqmUnit() {
+        return eqmUnit;
+    }
+
+    public void setEqmUnit(String eqmUnit) {
+        this.eqmUnit = eqmUnit;
+    }
+
+    public Double getEqmNumbers() {
+        return eqmNumbers;
+    }
+
+    public void setEqmNumbers(Double eqmNumbers) {
+        this.eqmNumbers = eqmNumbers;
+    }
+
+    public String getEqmTotalCapacity() {
+        return eqmTotalCapacity;
+    }
+
+    public void setEqmTotalCapacity(String eqmTotalCapacity) {
+        this.eqmTotalCapacity = eqmTotalCapacity;
+    }
+
+    public Double getEqmBookedFee1() {
+        return eqmBookedFee1;
+    }
+
+    public void setEqmBookedFee1(Double eqmBookedFee1) {
+        this.eqmBookedFee1 = eqmBookedFee1;
+    }
+
+    public String getEqmSupplierName() {
+        return eqmSupplierName;
+    }
+
+    public void setEqmSupplierName(String eqmSupplierName) {
+        this.eqmSupplierName = eqmSupplierName;
+    }
+
+    public ErpCredit getErpCredit() {
+        return erpCredit;
+    }
+
+    public void setErpCredit(ErpCredit erpCredit) {
+        this.erpCredit = erpCredit;
+    }
+
+    @Override
+    public String toString() {
+        return "ErpCreditChild1{" +
+                "eqmMaterialDetails1='" + eqmMaterialDetails1 + '\'' +
+                ", eqmUnit='" + eqmUnit + '\'' +
+                ", eqmNumbers=" + eqmNumbers +
+                ", eqmTotalCapacity='" + eqmTotalCapacity + '\'' +
+                ", eqmBookedFee1=" + eqmBookedFee1 +
+                ", eqmSupplierName='" + eqmSupplierName + '\'' +
+                ", erpCredit=" + erpCredit +
+                '}';
+    }
+}

+ 83 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ErpCreditChild2.java

@@ -0,0 +1,83 @@
+package com.jeeplus.modules.sg.financial.erpcredit.entity;
+
+import com.jeeplus.core.persistence.DataEntity;
+
+public class ErpCreditChild2 extends DataEntity<ErpCreditChild2> {//材料费实体类
+    private static final long serialVersionUID = 1L;
+    private Double mtlBookedFee2;//材料 入账金额
+    private String eqmMaterialDetails2;//设备物料描述
+    private String mtlUnit;//设备单位
+    private Double mtlNumbers;//设备台数
+    private String mtlSupplierName;//供应商
+    private ErpCredit erpCredit;//父类
+
+    public ErpCreditChild2(ErpCredit erpCredit) {
+        this.erpCredit = erpCredit;
+    }
+    public ErpCreditChild2(){
+
+    }
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public Double getMtlBookedFee2() {
+        return mtlBookedFee2;
+    }
+
+    public void setMtlBookedFee2(Double mtlBookedFee2) {
+        this.mtlBookedFee2 = mtlBookedFee2;
+    }
+
+    public String getEqmMaterialDetails2() {
+        return eqmMaterialDetails2;
+    }
+
+    public void setEqmMaterialDetails2(String eqmMaterialDetails2) {
+        this.eqmMaterialDetails2 = eqmMaterialDetails2;
+    }
+
+    public String getMtlUnit() {
+        return mtlUnit;
+    }
+
+    public void setMtlUnit(String mtlUnit) {
+        this.mtlUnit = mtlUnit;
+    }
+
+    public Double getMtlNumbers() {
+        return mtlNumbers;
+    }
+
+    public void setMtlNumbers(Double mtlNumbers) {
+        this.mtlNumbers = mtlNumbers;
+    }
+
+    public String getMtlSupplierName() {
+        return mtlSupplierName;
+    }
+
+    public void setMtlSupplierName(String mtlSupplierName) {
+        this.mtlSupplierName = mtlSupplierName;
+    }
+
+    public ErpCredit getErpCredit() {
+        return erpCredit;
+    }
+
+    public void setErpCredit(ErpCredit erpCredit) {
+        this.erpCredit = erpCredit;
+    }
+
+    @Override
+    public String toString() {
+        return "ErpCreditChild2{" +
+                "mtlBookedFee2=" + mtlBookedFee2 +
+                ", eqmMaterialDetails2='" + eqmMaterialDetails2 + '\'' +
+                ", mtlUnit='" + mtlUnit + '\'' +
+                ", mtlNumbers=" + mtlNumbers +
+                ", mtlSupplierName='" + mtlSupplierName + '\'' +
+                ", erpCredit=" + erpCredit +
+                '}';
+    }
+}

+ 160 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/GeneralSituation.java

@@ -0,0 +1,160 @@
+package com.jeeplus.modules.sg.financial.erpcredit.entity;
+
+/**
+ * 概况表
+ */
+public class GeneralSituation {
+    private String projectName;//工程名称
+    private String consAddress;//建设地址
+    private String consNature;//建设性质
+    private String lineArea;//线路起止地点
+    private String lineLength;//线路长度
+    private String tenKvLength;//其中:10kv线路
+    private String fourKvLength;//400v及以下
+    private String circuitNumber;//电压及回路数
+    private String designUnit;//设计单位
+    private String buildUnit;//施工单位
+    private String organDataNumber;//预算批准机关、日期、文号
+    private String commencementDate;//开工日期
+    private String completionDate;//竣工日期
+    private String investmentBudget;//预算投资
+    private String actualInvestment;//实际投资
+    private String transferAssets;//移交生产总值
+    private String hasItsOwn;//企业自由
+
+    public String getTransferAssets() {
+        return transferAssets;
+    }
+
+    public void setTransferAssets(String transferAssets) {
+        this.transferAssets = transferAssets;
+    }
+
+    public String getProjectName() {
+        return projectName;
+    }
+
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
+    public String getConsAddress() {
+        return consAddress;
+    }
+
+    public void setConsAddress(String consAddress) {
+        this.consAddress = consAddress;
+    }
+
+    public String getConsNature() {
+        return consNature;
+    }
+
+    public void setConsNature(String consNature) {
+        this.consNature = consNature;
+    }
+
+    public String getLineArea() {
+        return lineArea;
+    }
+
+    public void setLineArea(String lineArea) {
+        this.lineArea = lineArea;
+    }
+
+    public String getLineLength() {
+        return lineLength;
+    }
+
+    public void setLineLength(String lineLength) {
+        this.lineLength = lineLength;
+    }
+
+    public String getTenKvLength() {
+        return tenKvLength;
+    }
+
+    public void setTenKvLength(String tenKvLength) {
+        this.tenKvLength = tenKvLength;
+    }
+
+    public String getFourKvLength() {
+        return fourKvLength;
+    }
+
+    public void setFourKvLength(String fourKvLength) {
+        this.fourKvLength = fourKvLength;
+    }
+
+    public String getCircuitNumber() {
+        return circuitNumber;
+    }
+
+    public void setCircuitNumber(String circuitNumber) {
+        this.circuitNumber = circuitNumber;
+    }
+
+    public String getDesignUnit() {
+        return designUnit;
+    }
+
+    public void setDesignUnit(String designUnit) {
+        this.designUnit = designUnit;
+    }
+
+    public String getBuildUnit() {
+        return buildUnit;
+    }
+
+    public void setBuildUnit(String buildUnit) {
+        this.buildUnit = buildUnit;
+    }
+
+    public String getOrganDataNumber() {
+        return organDataNumber;
+    }
+
+    public void setOrganDataNumber(String organDataNumber) {
+        this.organDataNumber = organDataNumber;
+    }
+
+    public String getCommencementDate() {
+        return commencementDate;
+    }
+
+    public void setCommencementDate(String commencementDate) {
+        this.commencementDate = commencementDate;
+    }
+
+    public String getCompletionDate() {
+        return completionDate;
+    }
+
+    public void setCompletionDate(String completionDate) {
+        this.completionDate = completionDate;
+    }
+
+    public String getInvestmentBudget() {
+        return investmentBudget;
+    }
+
+    public void setInvestmentBudget(String investmentBudget) {
+        this.investmentBudget = investmentBudget;
+    }
+
+    public String getActualInvestment() {
+        return actualInvestment;
+    }
+
+    public void setActualInvestment(String actualInvestment) {
+        this.actualInvestment = actualInvestment;
+    }
+
+    public String getHasItsOwn() {
+        return hasItsOwn;
+    }
+
+    public void setHasItsOwn(String hasItsOwn) {
+        this.hasItsOwn = hasItsOwn;
+    }
+}

+ 79 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/MaterialEquipment.java

@@ -0,0 +1,79 @@
+package com.jeeplus.modules.sg.financial.erpcredit.entity;
+
+/**
+ * 设备材料清册
+ */
+public class MaterialEquipment {
+    private String id;//序号
+    private String meName;//设备材料名称
+    private String meSpecifications;//规格型号
+    private String meSupplierName;//供应单位制造
+    private String meUnit;//计量单位
+    private String meNumber;//数量
+    private String meUnitPrice;//单价
+    private String meAllPrice;//合计
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getMeName() {
+        return meName;
+    }
+
+    public void setMeName(String meName) {
+        this.meName = meName;
+    }
+
+    public String getMeSpecifications() {
+        return meSpecifications;
+    }
+
+    public void setMeSpecifications(String meSpecifications) {
+        this.meSpecifications = meSpecifications;
+    }
+
+    public String getMeSupplierName() {
+        return meSupplierName;
+    }
+
+    public void setMeSupplierName(String meSupplierName) {
+        this.meSupplierName = meSupplierName;
+    }
+
+    public String getMeUnit() {
+        return meUnit;
+    }
+
+    public void setMeUnit(String meUnit) {
+        this.meUnit = meUnit;
+    }
+
+    public String getMeNumber() {
+        return meNumber;
+    }
+
+    public void setMeNumber(String meNumber) {
+        this.meNumber = meNumber;
+    }
+
+    public String getMeUnitPrice() {
+        return meUnitPrice;
+    }
+
+    public void setMeUnitPrice(String meUnitPrice) {
+        this.meUnitPrice = meUnitPrice;
+    }
+
+    public String getMeAllPrice() {
+        return meAllPrice;
+    }
+
+    public void setMeAllPrice(String meAllPrice) {
+        this.meAllPrice = meAllPrice;
+    }
+}

+ 153 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/Schedule.java

@@ -0,0 +1,153 @@
+package com.jeeplus.modules.sg.financial.erpcredit.entity;
+
+/**
+ * 一览表
+ */
+public class Schedule {
+    private String itemId;//项目定义编码
+    private String itemName;//工程名称
+    private String budgetBuildProject;//预算建筑工程
+    private String budgetInstallProject;//预算安装工程
+    private String budgetEquipmentValue;//预算设备价值
+    private String budgetOtherFee;//预算其他费用
+    private String budgetTotalFee;//预算合计金额
+    private String actualBuildProject;//实际金额建筑工程
+    private String actualIntallProject;//实际安装工程
+    private String actualEquipmentValue;//实际设备价值
+    private String actualOtherFee;//实际其他费用
+    private String actualTotalFee;//实际合计
+    private String addSubtractionLines;//增加额
+    private String addSubtractionRate;//增加率
+
+    @Override
+    public String toString() {
+        return "Schedule{" +
+                "itemId='" + itemId + '\'' +
+                ", itemName='" + itemName + '\'' +
+                ", budgetBuildProject='" + budgetBuildProject + '\'' +
+                ", budgetInstallProject='" + budgetInstallProject + '\'' +
+                ", budgetEquipmentValue='" + budgetEquipmentValue + '\'' +
+                ", budgetOtherFee='" + budgetOtherFee + '\'' +
+                ", budgetTotalFee='" + budgetTotalFee + '\'' +
+                ", actualBuildProject='" + actualBuildProject + '\'' +
+                ", actualIntallProject='" + actualIntallProject + '\'' +
+                ", actualEquipmentValue='" + actualEquipmentValue + '\'' +
+                ", actualOtherFee='" + actualOtherFee + '\'' +
+                ", actualTotalFee='" + actualTotalFee + '\'' +
+                ", addSubtractionLines='" + addSubtractionLines + '\'' +
+                ", addSubtractionRate='" + addSubtractionRate + '\'' +
+                '}';
+    }
+
+    public String getItemId() {
+        return itemId;
+    }
+
+    public void setItemId(String itemId) {
+        this.itemId = itemId;
+    }
+
+    public String getItemName() {
+        return itemName;
+    }
+
+    public void setItemName(String itemName) {
+        this.itemName = itemName;
+    }
+
+    public String getBudgetBuildProject() {
+        return budgetBuildProject;
+    }
+
+    public void setBudgetBuildProject(String budgetBuildProject) {
+        this.budgetBuildProject = budgetBuildProject;
+    }
+
+    public String getBudgetInstallProject() {
+        return budgetInstallProject;
+    }
+
+    public void setBudgetInstallProject(String budgetInstallProject) {
+        this.budgetInstallProject = budgetInstallProject;
+    }
+
+    public String getBudgetEquipmentValue() {
+        return budgetEquipmentValue;
+    }
+
+    public void setBudgetEquipmentValue(String budgetEquipmentValue) {
+        this.budgetEquipmentValue = budgetEquipmentValue;
+    }
+
+    public String getBudgetOtherFee() {
+        return budgetOtherFee;
+    }
+
+    public void setBudgetOtherFee(String budgetOtherFee) {
+        this.budgetOtherFee = budgetOtherFee;
+    }
+
+    public String getBudgetTotalFee() {
+        return budgetTotalFee;
+    }
+
+    public void setBudgetTotalFee(String budgetTotalFee) {
+        this.budgetTotalFee = budgetTotalFee;
+    }
+
+    public String getActualBuildProject() {
+        return actualBuildProject;
+    }
+
+    public void setActualBuildProject(String actualBuildProject) {
+        this.actualBuildProject = actualBuildProject;
+    }
+
+    public String getActualIntallProject() {
+        return actualIntallProject;
+    }
+
+    public void setActualIntallProject(String actualIntallProject) {
+        this.actualIntallProject = actualIntallProject;
+    }
+
+    public String getActualEquipmentValue() {
+        return actualEquipmentValue;
+    }
+
+    public void setActualEquipmentValue(String actualEquipmentValue) {
+        this.actualEquipmentValue = actualEquipmentValue;
+    }
+
+    public String getActualOtherFee() {
+        return actualOtherFee;
+    }
+
+    public void setActualOtherFee(String actualOtherFee) {
+        this.actualOtherFee = actualOtherFee;
+    }
+
+    public String getActualTotalFee() {
+        return actualTotalFee;
+    }
+
+    public void setActualTotalFee(String actualTotalFee) {
+        this.actualTotalFee = actualTotalFee;
+    }
+
+    public String getAddSubtractionLines() {
+        return addSubtractionLines;
+    }
+
+    public void setAddSubtractionLines(String addSubtractionLines) {
+        this.addSubtractionLines = addSubtractionLines;
+    }
+
+    public String getAddSubtractionRate() {
+        return addSubtractionRate;
+    }
+
+    public void setAddSubtractionRate(String addSubtractionRate) {
+        this.addSubtractionRate = addSubtractionRate;
+    }
+}

+ 223 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ScheduleOther.java

@@ -0,0 +1,223 @@
+package com.jeeplus.modules.sg.financial.erpcredit.entity;
+
+/**
+ * 其他费用明细表
+ */
+public class ScheduleOther {
+    private String requisitionSite;//建设场地征用及清理费
+    private String compensationAcquisition;//土地征用补偿费
+    private String cleaningFees;//余物清理费
+    private String storageFee;//集中配送物资保管费
+    private String compensateFee;//土地征用补偿费(赔青费)
+    private String managementFee;//项目建设管理费
+    private String preWorkingFee;//项目前期工作费
+    private String itemManageFee;//项目管理经费
+    private String theTenderFee;//招标费
+    private String supervisionFee;//工程监理费
+    private String  technicalFee;//项目建设技术服务费
+    private String surveyFee;//工程勘察费
+    private String designFee;//工程设计费
+    private String drawingBudgetFee;//施工图预算编制费
+    private String evaluationFee;//项目后评价费
+    private String economicFee;//技术经济标准变值管理费
+    private String inspectionFee;//工程建设监督检测费
+    private String preparationFee;//生产准备费
+    private String basicFee;//基本预备费
+    private String reserveFee;//资本化利息
+    private String totalFee;//合计
+
+    @Override
+    public String toString() {
+        return "ScheduleOther{" +
+                "requisitionSite='" + requisitionSite + '\'' +
+                ", compensationAcquisition='" + compensationAcquisition + '\'' +
+                ", cleaningFees='" + cleaningFees + '\'' +
+                ", storageFee='" + storageFee + '\'' +
+                ", compensateFee='" + compensateFee + '\'' +
+                ", managementFee='" + managementFee + '\'' +
+                ", preWorkingFee='" + preWorkingFee + '\'' +
+                ", itemManageFee='" + itemManageFee + '\'' +
+                ", theTenderFee='" + theTenderFee + '\'' +
+                ", supervisionFee='" + supervisionFee + '\'' +
+                ", technicalFee='" + technicalFee + '\'' +
+                ", surveyFee='" + surveyFee + '\'' +
+                ", designFee='" + designFee + '\'' +
+                ", drawingBudgetFee='" + drawingBudgetFee + '\'' +
+                ", evaluationFee='" + evaluationFee + '\'' +
+                ", economicFee='" + economicFee + '\'' +
+                ", inspectionFee='" + inspectionFee + '\'' +
+                ", preparationFee='" + preparationFee + '\'' +
+                ", basicFee='" + basicFee + '\'' +
+                ", reserveFee='" + reserveFee + '\'' +
+                ", totalFee='" + totalFee + '\'' +
+                '}';
+    }
+
+    public String getRequisitionSite() {
+        return requisitionSite;
+    }
+
+    public void setRequisitionSite(String requisitionSite) {
+        this.requisitionSite = requisitionSite;
+    }
+
+    public String getCompensationAcquisition() {
+        return compensationAcquisition;
+    }
+
+    public void setCompensationAcquisition(String compensationAcquisition) {
+        this.compensationAcquisition = compensationAcquisition;
+    }
+
+    public String getCleaningFees() {
+        return cleaningFees;
+    }
+
+    public void setCleaningFees(String cleaningFees) {
+        this.cleaningFees = cleaningFees;
+    }
+
+    public String getStorageFee() {
+        return storageFee;
+    }
+
+    public void setStorageFee(String storageFee) {
+        this.storageFee = storageFee;
+    }
+
+    public String getCompensateFee() {
+        return compensateFee;
+    }
+
+    public void setCompensateFee(String compensateFee) {
+        this.compensateFee = compensateFee;
+    }
+
+    public String getManagementFee() {
+        return managementFee;
+    }
+
+    public void setManagementFee(String managementFee) {
+        this.managementFee = managementFee;
+    }
+
+    public String getPreWorkingFee() {
+        return preWorkingFee;
+    }
+
+    public void setPreWorkingFee(String preWorkingFee) {
+        this.preWorkingFee = preWorkingFee;
+    }
+
+    public String getItemManageFee() {
+        return itemManageFee;
+    }
+
+    public void setItemManageFee(String itemManageFee) {
+        this.itemManageFee = itemManageFee;
+    }
+
+    public String getTheTenderFee() {
+        return theTenderFee;
+    }
+
+    public void setTheTenderFee(String theTenderFee) {
+        this.theTenderFee = theTenderFee;
+    }
+
+    public String getSupervisionFee() {
+        return supervisionFee;
+    }
+
+    public void setSupervisionFee(String supervisionFee) {
+        this.supervisionFee = supervisionFee;
+    }
+
+    public String getTechnicalFee() {
+        return technicalFee;
+    }
+
+    public void setTechnicalFee(String technicalFee) {
+        this.technicalFee = technicalFee;
+    }
+
+    public String getSurveyFee() {
+        return surveyFee;
+    }
+
+    public void setSurveyFee(String surveyFee) {
+        this.surveyFee = surveyFee;
+    }
+
+    public String getDesignFee() {
+        return designFee;
+    }
+
+    public void setDesignFee(String designFee) {
+        this.designFee = designFee;
+    }
+
+    public String getDrawingBudgetFee() {
+        return drawingBudgetFee;
+    }
+
+    public void setDrawingBudgetFee(String drawingBudgetFee) {
+        this.drawingBudgetFee = drawingBudgetFee;
+    }
+
+    public String getEvaluationFee() {
+        return evaluationFee;
+    }
+
+    public void setEvaluationFee(String evaluationFee) {
+        this.evaluationFee = evaluationFee;
+    }
+
+    public String getEconomicFee() {
+        return economicFee;
+    }
+
+    public void setEconomicFee(String economicFee) {
+        this.economicFee = economicFee;
+    }
+
+    public String getInspectionFee() {
+        return inspectionFee;
+    }
+
+    public void setInspectionFee(String inspectionFee) {
+        this.inspectionFee = inspectionFee;
+    }
+
+    public String getPreparationFee() {
+        return preparationFee;
+    }
+
+    public void setPreparationFee(String preparationFee) {
+        this.preparationFee = preparationFee;
+    }
+
+    public String getBasicFee() {
+        return basicFee;
+    }
+
+    public void setBasicFee(String basicFee) {
+        this.basicFee = basicFee;
+    }
+
+    public String getReserveFee() {
+        return reserveFee;
+    }
+
+    public void setReserveFee(String reserveFee) {
+        this.reserveFee = reserveFee;
+    }
+
+    public String getTotalFee() {
+        return totalFee;
+    }
+
+    public void setTotalFee(String totalFee) {
+        this.totalFee = totalFee;
+    }
+}

+ 58 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/TheAssetsTotal.java

@@ -0,0 +1,58 @@
+package com.jeeplus.modules.sg.financial.erpcredit.entity;
+
+public class TheAssetsTotal {
+    private String propertyName;//财产名称
+    private String buildProject;//建筑工程
+    private String intallProject;//安装工程费
+    private String equipmentValue;//设备价值
+    private String costSharing;//分摊费用
+    private String deliveryCostValue;//交付使用资产价值
+
+    public String getPropertyName() {
+        return propertyName;
+    }
+
+    public void setPropertyName(String propertyName) {
+        this.propertyName = propertyName;
+    }
+
+    public String getBuildProject() {
+        return buildProject;
+    }
+
+    public void setBuildProject(String buildProject) {
+        this.buildProject = buildProject;
+    }
+
+    public String getIntallProject() {
+        return intallProject;
+    }
+
+    public void setIntallProject(String intallProject) {
+        this.intallProject = intallProject;
+    }
+
+    public String getEquipmentValue() {
+        return equipmentValue;
+    }
+
+    public void setEquipmentValue(String equipmentValue) {
+        this.equipmentValue = equipmentValue;
+    }
+
+    public String getCostSharing() {
+        return costSharing;
+    }
+
+    public void setCostSharing(String costSharing) {
+        this.costSharing = costSharing;
+    }
+
+    public String getDeliveryCostValue() {
+        return deliveryCostValue;
+    }
+
+    public void setDeliveryCostValue(String deliveryCostValue) {
+        this.deliveryCostValue = deliveryCostValue;
+    }
+}

+ 124 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/TransferOfPower1.java

@@ -0,0 +1,124 @@
+package com.jeeplus.modules.sg.financial.erpcredit.entity;
+
+/**
+ * 移交资产-配电网资产-一览表
+ */
+public class TransferOfPower1 {
+    private String powerId;//配电网项目编号
+    private String powerName;//配电网资产名称
+    private String powerNumberBars;//线路条数
+    private String powerAssetClass;//资产类别
+    private String powerArea;//线路起止地点或配电所在地
+    private String powerDepartment;//保管部门
+    private String powerTenKvLineLength;//10kv线路长度
+    private String powerTenKvCableType;//10kv电缆架空导线型号
+    private String powerBuildFee;//建筑费用
+    private String powerInstallFee;//安装费用
+    private String powerStandInFee;//摊入费用
+    private String powerDeliveredAssets;//交付使用资产价值
+    private String poweRequipmentFee;//其中:附属设备价值
+
+    public String getPowerNumberBars() {
+        return powerNumberBars;
+    }
+
+    public void setPowerNumberBars(String powerNumberBars) {
+        this.powerNumberBars = powerNumberBars;
+    }
+
+    public String getPowerAssetClass() {
+        return powerAssetClass;
+    }
+
+    public void setPowerAssetClass(String powerAssetClass) {
+        this.powerAssetClass = powerAssetClass;
+    }
+
+    public String getPowerId() {
+        return powerId;
+    }
+
+    public void setPowerId(String powerId) {
+        this.powerId = powerId;
+    }
+
+    public String getPowerName() {
+        return powerName;
+    }
+
+    public void setPowerName(String powerName) {
+        this.powerName = powerName;
+    }
+
+    public String getPowerArea() {
+        return powerArea;
+    }
+
+    public void setPowerArea(String powerArea) {
+        this.powerArea = powerArea;
+    }
+
+    public String getPowerDepartment() {
+        return powerDepartment;
+    }
+
+    public void setPowerDepartment(String powerDepartment) {
+        this.powerDepartment = powerDepartment;
+    }
+
+    public String getPowerTenKvLineLength() {
+        return powerTenKvLineLength;
+    }
+
+    public void setPowerTenKvLineLength(String powerTenKvLineLength) {
+        this.powerTenKvLineLength = powerTenKvLineLength;
+    }
+
+    public String getPowerTenKvCableType() {
+        return powerTenKvCableType;
+    }
+
+    public void setPowerTenKvCableType(String powerTenKvCableType) {
+        this.powerTenKvCableType = powerTenKvCableType;
+    }
+
+    public String getPowerBuildFee() {
+        return powerBuildFee;
+    }
+
+    public void setPowerBuildFee(String powerBuildFee) {
+        this.powerBuildFee = powerBuildFee;
+    }
+
+    public String getPowerInstallFee() {
+        return powerInstallFee;
+    }
+
+    public void setPowerInstallFee(String powerInstallFee) {
+        this.powerInstallFee = powerInstallFee;
+    }
+
+    public String getPowerStandInFee() {
+        return powerStandInFee;
+    }
+
+    public void setPowerStandInFee(String powerStandInFee) {
+        this.powerStandInFee = powerStandInFee;
+    }
+
+    public String getPowerDeliveredAssets() {
+        return powerDeliveredAssets;
+    }
+
+    public void setPowerDeliveredAssets(String powerDeliveredAssets) {
+        this.powerDeliveredAssets = powerDeliveredAssets;
+    }
+
+    public String getPoweRequipmentFee() {
+        return poweRequipmentFee;
+    }
+
+    public void setPoweRequipmentFee(String poweRequipmentFee) {
+        this.poweRequipmentFee = poweRequipmentFee;
+    }
+}

+ 115 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/TransferOfPower2.java

@@ -0,0 +1,115 @@
+package com.jeeplus.modules.sg.financial.erpcredit.entity;
+
+/**
+ * 移交资产-配电网资产-一览表2(设备)
+ */
+public class TransferOfPower2 {
+    private String powerId;//配电网项目编号
+    private String powerName;//配电网资产名称
+    private String powerAssetClass;//资产类别
+    private String powerArea;//线路起止地点或配变所在滴
+    private String powerDepartment;//保管部门
+    private String powerNumber;//配变数量
+    private String powerUnit;//计量单位
+    private String powerCapacity;//配变容量
+    private String powerValue;//设备价值
+    private String powerStandInFee;//摊入费用
+    private String powerDeliveredAssets;//交付使用资产价值
+    private String poweRequipmentFee;//其中:附属设备价值
+
+    public String getPowerAssetClass() {
+        return powerAssetClass;
+    }
+
+    public void setPowerAssetClass(String powerAssetClass) {
+        this.powerAssetClass = powerAssetClass;
+    }
+
+    public String getPowerId() {
+        return powerId;
+    }
+
+    public void setPowerId(String powerId) {
+        this.powerId = powerId;
+    }
+
+    public String getPowerName() {
+        return powerName;
+    }
+
+    public void setPowerName(String powerName) {
+        this.powerName = powerName;
+    }
+
+    public String getPowerArea() {
+        return powerArea;
+    }
+
+    public void setPowerArea(String powerArea) {
+        this.powerArea = powerArea;
+    }
+
+    public String getPowerDepartment() {
+        return powerDepartment;
+    }
+
+    public void setPowerDepartment(String powerDepartment) {
+        this.powerDepartment = powerDepartment;
+    }
+
+    public String getPowerNumber() {
+        return powerNumber;
+    }
+
+    public void setPowerNumber(String powerNumber) {
+        this.powerNumber = powerNumber;
+    }
+
+    public String getPowerUnit() {
+        return powerUnit;
+    }
+
+    public void setPowerUnit(String powerUnit) {
+        this.powerUnit = powerUnit;
+    }
+
+    public String getPowerCapacity() {
+        return powerCapacity;
+    }
+
+    public void setPowerCapacity(String powerCapacity) {
+        this.powerCapacity = powerCapacity;
+    }
+
+    public String getPowerValue() {
+        return powerValue;
+    }
+
+    public void setPowerValue(String powerValue) {
+        this.powerValue = powerValue;
+    }
+
+    public String getPowerStandInFee() {
+        return powerStandInFee;
+    }
+
+    public void setPowerStandInFee(String powerStandInFee) {
+        this.powerStandInFee = powerStandInFee;
+    }
+
+    public String getPowerDeliveredAssets() {
+        return powerDeliveredAssets;
+    }
+
+    public void setPowerDeliveredAssets(String powerDeliveredAssets) {
+        this.powerDeliveredAssets = powerDeliveredAssets;
+    }
+
+    public String getPoweRequipmentFee() {
+        return poweRequipmentFee;
+    }
+
+    public void setPoweRequipmentFee(String poweRequipmentFee) {
+        this.poweRequipmentFee = poweRequipmentFee;
+    }
+}

+ 15 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/ErpCreditChild1Mapper.java

@@ -0,0 +1,15 @@
+package com.jeeplus.modules.sg.financial.erpcredit.mapper;
+
+import com.jeeplus.core.persistence.BaseEntity;
+import com.jeeplus.core.persistence.BaseMapper;
+import com.jeeplus.core.persistence.annotation.MyBatisMapper;
+import com.jeeplus.modules.sg.financial.erpcredit.entity.ErpCredit;
+import com.jeeplus.modules.sg.financial.erpcredit.entity.ErpCreditChild1;
+
+import java.util.List;
+
+@MyBatisMapper
+public interface ErpCreditChild1Mapper extends BaseMapper<ErpCreditChild1> {
+
+    public List<ErpCreditChild1> findErpCreditChild1List(String[] ids);
+}

+ 19 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/ErpCreditChild2Mapper.java

@@ -0,0 +1,19 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.financial.erpcredit.mapper;
+
+import com.jeeplus.core.persistence.BaseMapper;
+import com.jeeplus.core.persistence.annotation.MyBatisMapper;
+import com.jeeplus.modules.sg.financial.erpcredit.entity.ErpCredit;
+import com.jeeplus.modules.sg.financial.erpcredit.entity.ErpCreditChild1;
+import com.jeeplus.modules.sg.financial.erpcredit.entity.ErpCreditChild2;
+
+import java.util.List;
+
+
+@MyBatisMapper
+public interface ErpCreditChild2Mapper extends BaseMapper<ErpCreditChild2> {
+
+    public List<ErpCreditChild2> findErpCreditChild2List(String[] ids);
+}

+ 17 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/ErpCreditMapper.java

@@ -0,0 +1,17 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.financial.erpcredit.mapper;
+
+import com.jeeplus.core.persistence.BaseMapper;
+import com.jeeplus.core.persistence.annotation.MyBatisMapper;
+import com.jeeplus.modules.sg.financial.erpcredit.entity.ErpCredit;
+
+import java.util.List;
+
+
+@MyBatisMapper
+public interface ErpCreditMapper extends BaseMapper<ErpCredit> {
+    //查询
+    public List<ErpCredit> findErpCreditList(String[] ids);
+}

+ 164 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/xml/ErpCreditChild1Mapper.xml

@@ -0,0 +1,164 @@
+<?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.sg.financial.erpcredit.mapper.ErpCreditChild1Mapper">
+    
+	<sql id="erpChild1Columns">
+		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.erp_credit_id As "erpCredit.id",
+		a.eqm_material_details As "eqmMaterialDetails1",
+		a.eqm_unit As "eqmUnit",
+		a.eqm_numbers As "eqmNumbers",
+		a.eqm_total_capacity As "eqmTotalCapacity",
+		a.eqm_booked_fee As "eqmBookedFee1",
+		a.eqm_supplier_name As "eqmSupplierName"
+	</sql>
+
+	<select id="get" resultType="ErpCreditChild1" >
+		SELECT 
+			<include refid="erpChild1Columns"/>
+		FROM js_erp_credit_child1 a
+		WHERE a.erp_credit_id = #{erpCredit.id}
+	</select>
+	
+	<select id="findList" resultType="ErpCreditChild1" >
+		SELECT 
+			<include refid="erpChild1Columns"/>
+		FROM js_erp_credit_child1 a
+		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+			${dataScope}
+			<if test="erpCredit != null and erpCredit.itemId != null and erpCredit.itemId != ''">
+				AND a.erp_credit_id = #{erpCredit.id}
+			</if>
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY a.create_date ASC
+			</otherwise>
+		</choose>
+	</select>
+	
+	<select id="findAllList" resultType="ErpCreditChild1" >
+		SELECT 
+			<include refid="erpChild1Columns"/>
+		FROM js_erp_credit_child1 a
+		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+			${dataScope}
+		</where>		
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY a.create_date ASC
+			</otherwise>
+		</choose>
+	</select>
+	
+	<insert id="insert">
+		INSERT INTO js_erp_credit_child1(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag,
+			erp_credit_id,
+			eqm_material_details,
+			eqm_unit,
+			eqm_numbers,
+			eqm_total_capacity,
+			eqm_booked_fee,
+			eqm_supplier_name
+		) VALUES (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag},
+			#{erpCredit.id},
+			#{eqmMaterialDetails1},
+    		#{eqmUnit},
+    		#{eqmNumbers},
+    		#{eqmTotalCapacity},
+    		#{eqmBookedFee1},
+    		#{eqmSupplierName}
+		)
+	</insert>
+	
+	<update id="update">
+		UPDATE js_erp_credit_child1 SET
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			remarks = #{remarks},
+			del_flag = #{delFlag},
+			eqm_material_details = #{eqmMaterialDetails1},
+			eqm_unit = #{eqmUnit},
+			eqm_numbers = #{eqmNumbers},
+			eqm_total_capacity = #{eqmTotalCapacity},
+			eqm_booked_fee = #{eqmBookedFee1},
+			eqm_supplier_name = #{eqmSupplierName}
+		WHERE id = #{id}
+	</update>
+	
+	
+	<!--物理删除-->
+	<update id="delete">
+		DELETE FROM js_erp_credit_child1
+		<choose>
+			<when test="id !=null and id != ''">
+				WHERE id = #{id}
+			</when>
+			<otherwise>
+				WHERE erp_credit_id = #{erpCredit.id}
+			</otherwise>
+		</choose>
+	</update>
+	
+	<!--逻辑删除-->
+	<update id="deleteByLogic">
+		UPDATE js_erp_credit_child1 SET
+			del_flag = #{DEL_FLAG_DELETE}
+		<choose>
+			<when test="id !=null and id != ''">
+				WHERE id = #{id}
+			</when>
+			<otherwise>
+				WHERE erp_credit_id = #{erpCredit.id}
+			</otherwise>
+		</choose>
+	</update>
+	
+	
+	<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
+	<select id="findUniqueByProperty" resultType="TestDataChild11" statementType="STATEMENT">
+		select * FROM js_erp_credit_child1  where ${propertyName} = '${value}'
+	</select>
+	<!--查找多个条件-->
+	<select id="findErpCreditChild1List" parameterType="java.util.List" resultType="erpCreditChild1">
+		select
+		<include refid="erpChild1Columns"/>
+		FROM js_erp_credit_child1 a
+		WHERE a.del_flag = '0'
+		and a.erp_credit_id in
+		<if test="array !=null and array.length > 0">
+			<foreach collection="array" index="index" item="item" open="("
+					 separator="," close=")">
+				#{item}
+			</foreach>
+		</if>
+	</select>
+</mapper>

+ 154 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/xml/ErpCreditChild2Mapper.xml

@@ -0,0 +1,154 @@
+<?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.sg.financial.erpcredit.mapper.ErpCreditChild2Mapper">
+    
+	<sql id="erpChild2Columns">
+		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.erp_credit_id As "erpCredit.id",
+		a.eqm_material_details As "eqmMaterialDetails2",
+		a.mtl_booked_fee As "mtlBookedFee2",
+		a.mtl_unit As "mtlUnit",
+		a.mtl_numbers As "mtlNumbers",
+		a.mtl_supplier_name As "mtlSupplierName"
+	</sql>
+
+	<select id="get" resultType="ErpCreditChild2" >
+		SELECT 
+			<include refid="erpChild2Columns"/>
+		FROM js_erp_credit_child2 a
+		WHERE a.erp_credit_id = #{erpCredit.id}
+	</select>
+	
+	<select id="findList" resultType="ErpCreditChild2" >
+		SELECT 
+			<include refid="erpChild2Columns"/>
+		FROM js_erp_credit_child2 a
+		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+			${dataScope}
+			<if test="erpCredit != null and erpCredit.itemId != null and erpCredit.itemId != ''">
+				AND a.erp_credit_id = #{erpCredit.id}
+			</if>
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY a.create_date ASC
+			</otherwise>
+		</choose>
+	</select>
+	
+	<select id="findAllList" resultType="ErpCreditChild2" >
+		SELECT 
+			<include refid="erpChild2Columns"/>
+		FROM js_erp_credit_child2 a
+		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+			${dataScope}
+		</where>		
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY a.create_date ASC
+			</otherwise>
+		</choose>
+	</select>
+	
+	<insert id="insert">
+		INSERT INTO js_erp_credit_child2(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag,
+			erp_credit_id,
+			eqm_material_details,
+			mtl_booked_fee,
+			mtl_supplier_name
+		) VALUES (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag},
+			#{erpCredit.id},
+			#{eqmMaterialDetails2},
+			#{mtlBookedFee2},
+			#{mtlSupplierName}
+		)
+	</insert>
+	
+	<update id="update">
+		UPDATE js_erp_credit_child2 SET
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			remarks = #{remarks},
+			del_flag = #{delFlag},
+			eqm_material_details = #{eqmMaterialDetails2},
+			mtl_booked_fee = #{mtlBookedFee2},
+			mtl_supplier_name=#{mtlSupplierName}
+		WHERE id = #{id}
+	</update>
+	
+	
+	<!--物理删除-->
+	<update id="delete">
+		DELETE FROM js_erp_credit_child2
+		<choose>
+			<when test="id !=null and id != ''">
+				WHERE id = #{id}
+			</when>
+			<otherwise>
+				WHERE erp_credit_id = #{erpCredit.id}
+			</otherwise>
+		</choose>
+	</update>
+	
+	<!--逻辑删除-->
+	<update id="deleteByLogic">
+		UPDATE js_erp_credit_child2 SET
+			del_flag = #{DEL_FLAG_DELETE}
+		<choose>
+			<when test="id !=null and id != ''">
+				WHERE id = #{id}
+			</when>
+			<otherwise>
+				WHERE erp_credit_id = #{erpCredit.id}
+			</otherwise>
+		</choose>
+	</update>
+	
+	
+	<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
+	<select id="findUniqueByProperty" resultType="ErpCreditChild2" statementType="STATEMENT">
+		select * FROM js_erp_credit_child2  where ${propertyName} = '${value}'
+	</select>
+	<!--查找多个条件-->
+	<select id="findErpCreditChild2List" parameterType="java.util.List" resultType="erpCreditChild2">
+		select
+		<include refid="erpChild2Columns"/>
+		FROM js_erp_credit_child2 a
+		WHERE a.del_flag = '0'
+		and a.erp_credit_id in
+		<if test="array !=null and array.length > 0">
+			<foreach collection="array" index="index" item="item" open="("
+					 separator="," close=")">
+				#{item}
+			</foreach>
+		</if>
+	</select>
+</mapper>

+ 211 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/xml/ErpCreditMapper.xml

@@ -0,0 +1,211 @@
+<?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.sg.financial.erpcredit.mapper.ErpCreditMapper">
+
+	<sql id="erpColumns">
+		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.item_id As "itemId",
+		a.item_name As "itemName",
+		a.actual_investment As "actualInvestment",
+		a.transfer_assets As "transferAssets",
+		a.cons_building_fee As "consBuildingFee",
+		a.cons_install_fee As "consInstallFee",
+		a.cons_total_fee As "consTotalFee",
+		a.other_supervisor_fee As "otherSupervisorFee",
+		a.other_design_fee As "otherDesignFee",
+		a.other_bework_fee As "otherBeWorkFee",
+		a.other_build_loan As "otherBuildLoan",
+		a.other_line_damages As "otherLineDamages",
+		a.other_legal_manage As "otherLegalManage",
+		a.other_total_fee As "otherTotalFee",
+		a.tenkv_model As "tenKvModel",
+		a.tenkv_unit As "tenKvUnit",
+		a.tenkv_length As "tenKvLength",
+		a.tenkv_line_length As "tenKvLineLength",
+		a.tenkv_its_line As "tenKvItsLine",
+		a.tenkv_ites_fhv_follow As "tenKvItesFhvFollow",
+		a.the_input_tax As "theInputTax",
+		a.ten_supplier_name As "supplierName"
+	</sql>
+
+	<select id="get" resultType="ErpCredit" >
+		SELECT
+		<include refid="erpColumns"/>
+		FROM js_erp_credit a
+		WHERE a.id = #{id}
+	</select>
+
+	<select id="findList" resultType="ErpCredit" >
+		SELECT
+		<include refid="erpColumns"/>
+		FROM js_erp_credit a
+		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+			${dataScope}
+			<if test="itemId != null and itemId != ''">
+				AND a.item_id = #{itemId}
+			</if>
+		</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="ErpCredit" >
+		SELECT
+		<include refid="erpColumns"/>
+		FROM js_erp_credit a
+		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+			${dataScope}
+		</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 js_erp_credit(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag,
+			item_id,
+			item_name,
+			actual_investment,
+			transfer_assets,
+			cons_building_fee,
+			cons_install_fee,
+			cons_total_fee,
+			other_supervisor_fee,
+			other_design_fee,
+			other_bework_fee,
+			other_build_loan,
+			other_line_damages,
+			other_legal_manage,
+			other_total_fee,
+			tenkv_model,
+			tenkv_unit,
+			tenkv_length,
+			tenkv_line_length,
+			tenkv_its_line,
+			tenkv_ites_fhv_follow,
+			the_input_tax,
+			ten_supplier_name
+		) VALUES (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag},
+			#{itemId},
+			#{itemName},
+			#{actualInvestment},
+			#{transferAssets},
+    		#{consBuildingFee},
+    		#{consInstallFee},
+    		#{consTotalFee},
+    		#{otherSupervisorFee},
+    		#{otherDesignFee},
+    		#{otherBeWorkFee},
+    		#{otherBuildLoan},
+    		#{otherLineDamages},
+    		#{otherLegalManage},
+    		#{otherTotalFee},
+    		#{tenKvModel},
+    		#{tenKvUnit},
+    		#{tenKvLength},
+    		#{tenKvLineLength},
+    		#{tenKvItsLine},
+    		#{tenKvItesFhvFollow},
+    		#{theInputTax},
+    		#{supplierName}
+		)
+	</insert>
+
+	<update id="update">
+		UPDATE js_erp_credit SET
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			remarks = #{remarks},
+			del_flag = #{delFlag},
+			item_id = #{itemId},
+			item_name = #{itemName},
+			actual_investment = #{actualInvestment},
+			transfer_assets = #{transferAssets},
+			cons_building_fee = #{consBuildingFee},
+			cons_install_fee = #{consInstallFee},
+			cons_total_fee = #{consInstallFee},
+			other_supervisor_fee = #{otherSupervisorFee},
+			other_design_fee = #{otherDesignFee},
+			other_bework_fee = #{otherBeWorkFee},
+			other_build_loan = #{otherBuildLoan},
+			other_line_damages = #{otherLineDamages},
+			other_legal_manage =#{otherLegalManage},
+			other_total_fee = #{otherTotalFee},
+			tenkv_model = #{tenKvModel},
+			tenkv_unit = #{tenKvUnit},
+			tenkv_length = #{tenKvLength},
+			tenkv_line_length = #{tenKvLineLength},
+			tenkv_its_line = #{tenKvItsLine},
+			tenkv_ites_fhv_follow = #{tenKvItesFhvFollow},
+			the_input_tax = #{theInputTax},
+			ten_supplier_name=#{supplierName}
+		WHERE id = #{id}
+	</update>
+
+
+	<!--物理删除-->
+	<update id="delete">
+		DELETE FROM js_erp_credit
+		WHERE id = #{id}
+	</update>
+
+	<!--逻辑删除-->
+	<update id="deleteByLogic">
+		UPDATE js_erp_credit SET
+			del_flag = #{DEL_FLAG_DELETE}
+		WHERE id = #{id}
+	</update>
+
+
+	<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
+	<select id="findUniqueByProperty" resultType="ErpCredit" statementType="STATEMENT">
+		select * FROM js_erp_credit where ${propertyName} = '${value}'
+	</select>
+
+	<select id="findErpCreditList" parameterType="java.util.List" resultType="erpCredit">
+		select
+		<include refid="erpColumns"/>
+		FROM js_erp_credit a
+		WHERE a.del_flag = '0'
+		and a.id in
+		<if test="array !=null and array.length > 0">
+			<foreach collection="array" index="index" item="item" open="("
+					 separator="," close=")">
+				#{item}
+			</foreach>
+		</if>
+	</select>
+</mapper>

+ 218 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/service/ErpCreditService.java

@@ -0,0 +1,218 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.financial.erpcredit.service;
+
+import com.jeeplus.common.json.AjaxJson;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.core.persistence.Page;
+import com.jeeplus.core.service.CrudService;
+import com.jeeplus.modules.sg.financial.erpcredit.entity.*;
+import com.jeeplus.modules.sg.financial.erpcredit.mapper.ErpCreditChild1Mapper;
+import com.jeeplus.modules.sg.financial.erpcredit.mapper.ErpCreditChild2Mapper;
+import com.jeeplus.modules.sg.financial.erpcredit.mapper.ErpCreditMapper;
+import com.jeeplus.modules.sg.financial.erpcredit.util.ExportTemplate;
+import com.jeeplus.modules.sg.financial.erpcredit.util.ExportUtil2;
+import com.jeeplus.modules.sg.financial.settlement.entity.MaintainData;
+import com.jeeplus.modules.sg.financial.settlement.mapper.DataMaintenanceMapper;
+import org.apache.poi.xssf.usermodel.XSSFSheet;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.*;
+import java.net.URLEncoder;
+import java.util.List;
+
+
+@Service
+@Transactional(readOnly = true)
+public class ErpCreditService extends CrudService<ErpCreditMapper,ErpCredit> {
+    @Autowired
+    private ErpCreditChild1Mapper erpCreditChild1Mapper;
+    @Autowired
+    private ErpCreditChild2Mapper erpCreditChild2Mapper;
+    @Autowired
+    private ErpCreditMapper erpCreditMapper;
+    @Autowired
+    private DataMaintenanceMapper dataMaintenanceMapper;
+
+    public List<ErpCredit> getListErpCredit(String[] ids){
+        List<ErpCredit> erpCreditList = erpCreditMapper.findErpCreditList(ids);
+        List<ErpCreditChild1> erpCreditChild1List = erpCreditChild1Mapper.findErpCreditChild1List(ids);
+        List<ErpCreditChild2> erpCreditChild2List = erpCreditChild2Mapper.findErpCreditChild2List(ids);
+        if (null!=erpCreditList&&erpCreditList.size()>0){
+            for (ErpCredit erpCredit:erpCreditList){
+                if (null!=erpCreditChild1List&&erpCreditChild1List.size()>0){
+                    for (ErpCreditChild1 erpCreditChild1:erpCreditChild1List){
+                        if (erpCredit.getId().equals(erpCreditChild1.getErpCredit().getId())){
+                            erpCredit.getErpCreditChild1s().add(erpCreditChild1);
+                        }
+                    }
+                }
+                if (null!=erpCreditChild2List&&erpCreditChild2List.size()>0){
+                    for (ErpCreditChild2 erpCreditChild2:erpCreditChild2List){
+                        if (erpCredit.getId().equals(erpCreditChild2.getErpCredit().getId())){
+                            erpCredit.getErpCreditChild2s().add(erpCreditChild2);
+                        }
+                    }
+                }
+            }
+        }
+        return erpCreditList;
+    }
+    public ErpCredit get(String id) {
+        ErpCredit erpCredit = super.get(id);
+        erpCredit.setErpCreditChild1s(erpCreditChild1Mapper.findList(new ErpCreditChild1(erpCredit)));
+        erpCredit.setErpCreditChild2s(erpCreditChild2Mapper.findList(new ErpCreditChild2(erpCredit)));
+//        erpCredit.setErpCreditChild3s(erpCreditChild3Mapper.findList(new ErpCreditChild3(erpCredit)));
+        return erpCredit;
+    }
+
+    public List<ErpCredit> findList(ErpCredit erpCredit) {
+        return super.findList(erpCredit);
+    }
+
+    public Page<ErpCredit> findPage(Page<ErpCredit> page, ErpCredit erpCredit) {
+        return super.findPage(page, erpCredit);
+    }
+
+    @Transactional(readOnly = false)
+    public void save(ErpCredit erpCredit) {
+        super.save(erpCredit);
+        for (ErpCreditChild1 erpCreditChild1 : erpCredit.getErpCreditChild1s()){
+            if (ErpCreditChild1.DEL_FLAG_NORMAL.equals(erpCredit.getDelFlag())){
+                if (StringUtils.isBlank(erpCreditChild1.getId())) {
+                    erpCreditChild1.setErpCredit(erpCredit);
+                    erpCreditChild1.preInsert();
+                    erpCreditChild1Mapper.insert(erpCreditChild1);
+                }else {
+                    erpCreditChild1.preUpdate();
+                    erpCreditChild1Mapper.update(erpCreditChild1);
+                }
+            }else {
+                erpCreditChild1Mapper.delete(erpCreditChild1);
+            }
+        }
+        for (ErpCreditChild2 erpCreditChild2 : erpCredit.getErpCreditChild2s()){
+            if (ErpCreditChild2.DEL_FLAG_NORMAL.equals(erpCreditChild2.getDelFlag())){
+                if (StringUtils.isBlank(erpCreditChild2.getId())){
+                    erpCreditChild2.setErpCredit(erpCredit);
+                    erpCreditChild2.preInsert();
+                    erpCreditChild2Mapper.insert(erpCreditChild2);
+                }else {
+                    erpCreditChild2.preUpdate();
+                    erpCreditChild2Mapper.update(erpCreditChild2);
+                }
+            }else {
+                erpCreditChild2Mapper.delete(erpCreditChild2);
+            }
+        }
+//        for (ErpCreditChild3 erpCreditChild3 : erpCredit.getErpCreditChild3s()){
+//            if (ErpCreditChild3.DEL_FLAG_NORMAL.equals(erpCreditChild3.getDelFlag())){
+//                if (StringUtils.isBlank(erpCreditChild3.getId())){
+//                    erpCreditChild3.setErpCredit(erpCredit);
+//                    erpCreditChild3.preInsert();
+//                    erpCreditChild3Mapper.insert(erpCreditChild3);
+//                }else {
+//                    erpCreditChild3.preUpdate();
+//                    erpCreditChild3Mapper.update(erpCreditChild3);
+//                }
+//            }else {
+//                erpCreditChild3Mapper.delete(erpCreditChild3);
+//            }
+//        }
+    }
+
+    @Transactional(readOnly = false)
+    public void delete(ErpCredit erpCredit) {
+        super.delete(erpCredit);
+        erpCreditChild1Mapper.delete(new ErpCreditChild1(erpCredit));
+        erpCreditChild2Mapper.delete(new ErpCreditChild2(erpCredit));
+//        erpCreditChild3Mapper.delete(new ErpCreditChild3(erpCredit));
+    }
+
+    //维护表
+    public List<MaintainData> getFindListMain(String[] ids){
+        return dataMaintenanceMapper.getFindListMain(ids);
+    }
+
+    //导出
+    public void getExport(String[] ids, HttpServletResponse response){
+        List<ErpCredit> erpCreditList = getListErpCredit(ids);
+        List<MaintainData> maintainDatas = getFindListMain(ids);
+        ExportTemplate exportTemplate = new ExportTemplate();
+        File newFile = exportTemplate.createNewFile();
+        // 新文件写入数据,并下载
+        InputStream inputStream = null;
+        XSSFWorkbook workbook = null;
+        XSSFSheet sheet1 = null;
+        XSSFSheet sheet2 = null;
+        XSSFSheet sheet3 = null;
+        XSSFSheet sheet5 = null;
+        XSSFSheet sheet4 = null;
+        XSSFSheet sheet6=null;
+        XSSFSheet sheet7=null;
+        XSSFSheet sheet10=null;
+        XSSFSheet sheet11=null;
+        try {
+            inputStream = new FileInputStream(newFile);// 将excel文件转为输入流
+            workbook = new XSSFWorkbook(inputStream);// 创建个workbook,
+            sheet1 =workbook.getSheetAt(1);
+            sheet2 = workbook.getSheetAt(2);
+            sheet3 = workbook.getSheetAt(3);
+            sheet4 = workbook.getSheetAt(4);
+            sheet5=workbook.getSheetAt(5);
+            sheet6=workbook.getSheetAt(6);
+            sheet7=workbook.getSheetAt(7);
+            sheet10=workbook.getSheetAt(10);
+            sheet11=workbook.getSheetAt(11);
+        } catch (Exception e1) {
+            e1.printStackTrace();
+        }
+        try {
+            // 写数据
+            FileOutputStream fos = new FileOutputStream(newFile);
+            ExportUtil2.getSheet1(sheet1,erpCreditList,maintainDatas);
+            ExportUtil2.getSheet2(sheet2,erpCreditList,maintainDatas);
+            ExportUtil2.getSheet3(sheet3,erpCreditList,maintainDatas);
+            ExportUtil2.getSheet5(sheet5,erpCreditList);
+            ExportUtil2.getSheet6(sheet6,erpCreditList);
+            ExportUtil2.getSheet7(sheet7,erpCreditList);
+            ExportUtil2.getSheet10(sheet10,erpCreditList);
+            ExportUtil2.getSheet11(sheet11,erpCreditList);
+            ExportUtil2.getSheet4(sheet4,erpCreditList);
+            workbook.write(fos);
+            fos.flush();
+            fos.close();
+            InputStream fis = new BufferedInputStream(new FileInputStream(
+                    newFile));
+            byte[] buffer = new byte[fis.available()];
+            fis.read(buffer);
+            fis.close();
+            response.reset();
+            response.setContentType("text/html;charset=UTF-8");
+            OutputStream toClient = new BufferedOutputStream(response.getOutputStream());
+            response.setContentType("application/x-msdownload");
+            String newName = URLEncoder.encode("竣工结算表" + System.currentTimeMillis() + ".xlsx","UTF-8");
+            response.addHeader("Content-Disposition","attachment;filename=\"" + newName + "\"");
+            response.addHeader("Content-Length", "" + newFile.length());
+            toClient.write(buffer);
+            toClient.flush();
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                if (null != inputStream) {
+                    inputStream.close();
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        // 删除创建的新文件
+        // this.deleteFile(newFile);
+    }
+}

+ 612 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ErpInfo.java

@@ -0,0 +1,612 @@
+package com.jeeplus.modules.sg.financial.erpcredit.util;
+
+import com.jeeplus.modules.sg.financial.erpcredit.entity.*;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.ss.usermodel.Row;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public  class ErpInfo {
+    public final static String CON_PROJECT = "工程成本";
+
+    public final static String CON_IPE = "安装工程支出";
+
+    public final static String CON_PES= "待摊支出";
+
+    public final static String CON_PLPM = "项目法人管理费";
+
+    public final static String CON_PMF= "项目管理经费";
+
+    public final static String CON_OTR ="其他";
+
+    public final static String CON_METF= "会议费";
+
+    public final static String CON_PSF="工程监理费";
+
+    public final static String CON_EDF="工程设计费";
+
+    public final static String CON_OBL="建设期贷款利息";
+
+    public final static String CON_OLD="线路施工赔偿费";
+
+    public final static String CON_TSF="变压器";
+
+    public final static String CON_RNB="环网柜";
+
+    public final static String CON_BST="箱式变电站";
+
+    public final static String CON_HVS="高压开关柜";
+
+    public final static String CON_OIC="架空绝缘导线";
+
+    public final static String CON_OICAC10="架空绝缘导线,AC10kV";
+    public final static String CON_OICAC20="架空绝缘导线,AC20kV";
+
+    public final static String CON_PRC="电缆电力";
+
+    public final static String CON_PRCAC10="电力电缆,AC10kV";
+    public final static String CON_PRCAC20="电力电缆,AC20kV";
+
+    public final static String CON_OICAC1="架空绝缘导线,AC1kV";
+    public final static String CON_PRCAC1="电力电缆,AC1kV";
+
+    public final static String CON_OICAC="架空绝缘导线";
+    public final static String CON_PRCAC="电力电缆";
+
+    public final static String  CON_lINE = "-";
+
+    public final static String CON_PlPlQ=CON_PROJECT+CON_lINE+CON_PES+CON_lINE+CON_OTR;//工程成本-待摊支出-其他
+
+    public final static String CON_PLPLPLQ=CON_PlPlQ+CON_lINE+CON_PES+CON_lINE+CON_PLPM+CON_lINE+CON_OTR;//工程成本-待摊支出-项目法人管理费-其他
+
+    public final static String CON_PLM=CON_PMF+CON_lINE+CON_METF;//项目管理经费 - 会议费
+
+    public static Boolean getContains(Object object,Object object1){
+        return true;
+    }
+
+    /**
+     * 获取表格数据
+     * @param importUtil
+     * @return List<ErpAccount> 导入表格数据
+     */
+    public static List<ErpAccount> getErpAccount(ImportUtil importUtil)  {
+        int lastRow = importUtil.getLastDataRowNum();
+        List<ErpAccount> list = new ArrayList<ErpAccount>();
+        ErpAccount erpAccount = null;
+        for(int i=1; i<lastRow;i++){
+            erpAccount = new ErpAccount();
+            Row row = importUtil.getRow(i);
+            String erpCode = (String) importUtil.getCellValue(row,10);
+            if(StringUtils.isNotBlank(erpCode)) {
+                erpAccount.setProjectDefinitionCode(erpCode);
+                erpAccount.setProjectDefinitionDetails((String)importUtil.getCellValue(row,11));
+                erpAccount.setSubjectName((String)importUtil.getCellValue(row,13));
+                erpAccount.setLineItemAmount((String)importUtil.getCellValue(row,15));
+                erpAccount.setTheNumber((String)importUtil.getCellValue(row,16));
+                erpAccount.setMaterialDetails((String)importUtil.getCellValue(row,19));
+                erpAccount.setUnit((String)importUtil.getCellValue(row,20));
+                erpAccount.setWbsDetails((String)importUtil.getCellValue(row,9));
+                erpAccount.setTheInputTax((String)importUtil.getCellValue(row,21));
+                erpAccount.setSupplierName((String)importUtil.getCellValue(row,26));
+                list.add(erpAccount);
+            }
+        }
+        return list;
+    }
+
+    /**
+     * 传入表的数据集合,获取设备费/材料费/10kV线路信息 集合
+     * 分别获取List<ErpCreditChild1>(设备费)<ErpCreditChild2>(材料费)
+     * 与List<ErpCredit>项目定义编号对应的对象
+     * 添加到List<ErpCredit>集合中的erpCreditChild1s,erpCreditChild2s,erpCreditChild3s.
+     * @param list 表格对象
+     * @return 返回List<ErpCredit>
+     */
+    public static List<ErpCredit> getAllErpCreditList(List<ErpAccount> list){
+        double tenKvLineLength=0.0;
+        boolean flag; //设备费开关:施工费中 建筑费 安装判断 true-建筑费 false-安装费
+        //获取erpCredit对象 list集合
+        List<ErpCredit> erpCredits = getListErpCredit(list);
+        //获取ErpCreditChild1对象 list集合 (设备费)
+        List<ErpCreditChild1> erpCreditChild1s = getListErpCreditChild1(list);
+        //获取ErpCreditChild2对象 list集合  (材料费)
+        List<ErpCreditChild2> erpCreditChild2s = getListErpCreditChild2(list);
+        //循环erpCredit对象 list集合
+        for (ErpCredit erpCredit:erpCredits){
+            tenKvLineLength=0.0;
+            flag = false;//赋初始值
+            //赋值线路长度
+            if (null!=erpCredit.getTenKvItesFhvFollow()&&null!=erpCredit.getTenKvItsLine()){
+                tenKvLineLength=erpCredit.getTenKvItesFhvFollow()+erpCredit.getTenKvItsLine();
+                erpCredit.setTenKvLineLength(tenKvLineLength);
+            }
+            //判断线路信息是否为空
+            if (null!=erpCredit.getTenKvModel()&&erpCredit.getTenKvModel().length()!=0){
+                flag=true;
+            }
+            //设备费 集合 循环
+            for (ErpCreditChild1 erpCreditChild1:erpCreditChild1s){
+                //判断 erpCredit对象项目定义编号  与  ErpCreditChild1对象项目定义编号
+                if (erpCredit.getItemId().equals(erpCreditChild1.getErpCredit().getItemId())){
+                    //把erpCreditChild1对象 添加到 List<ErpCredit>的List<ErpCreditChild1>中
+                    erpCredit.getErpCreditChild1s().add(erpCreditChild1);
+                    flag =true;
+                }
+            }
+            //材料费 集合 循环
+            for (ErpCreditChild2 erpCreditChild2:erpCreditChild2s){
+                //判断 erpCredit对象项目定义编号  与  ErpCreditChild2对象项目定义编号
+                if (erpCreditChild2.getErpCredit().getItemId().equals(erpCredit.getItemId())){
+                    //把erpCreditChild1对象 添加到 List<ErpCredit>的List<ErpCreditChild2>中
+                    erpCredit.getErpCreditChild2s().add(erpCreditChild2);
+                }
+            }
+            if (flag){//如果为true
+                //施工费合计 赋值为安装费(有 设备费入账金额 或者 材料费入账金额)
+                erpCredit.setConsInstallFee(erpCredit.getConsTotalFee());
+            }else {
+                //施工费合计 赋值为 建筑费(无 设备费入账金额 以及 材料费入账金额)
+                erpCredit.setConsBuildingFee(erpCredit.getConsTotalFee());
+            }
+        }
+        return erpCredits;
+    }
+
+    /**
+     * 获取单独 唯一 的 数据集合(项目定义编号——其他费用合计)
+     * @param list 读取表格获得的列表
+     * @return List<ErpCredit> 主类 集合(单独唯一的数据集合)
+     */
+    public static List<ErpCredit> getListErpCredit(List<ErpAccount> list){
+        List<ErpCredit> erpCredits = new ArrayList<ErpCredit>();//定义集合
+        ErpCredit erpCredit=null;//要获取集合对象
+        ErpAccount erpAccount=null;//导入表格对象
+        boolean flag;//判断 项目定义编号是否相同 true-不相同 false-相同
+        //循环导入表格对象
+        for (int i = 0; i < list.size(); i++) {
+            flag = true;//默认值为true (默认项目定义编号不相同)
+            erpAccount=list.get(i);//获取erpAccount对象
+            //判断当前 集合有数据
+            if (null!=erpCredits&&erpCredits.size()>0){
+                //循环 当前得到的ErpCredits对象
+                for (int j = 0; j < erpCredits.size(); j++) {
+                    erpCredit = erpCredits.get(j);//获取 erpCredit对象
+                    //判断项目定义号相同
+                    if (erpAccount.getProjectDefinitionCode().equals(erpCredit.getItemId())){
+                        flag = false;
+                        erpCredit = getActualAndConstruction(erpCredit,erpAccount,flag);
+                        erpCredit=getOtherFee(erpCredit,erpAccount,flag);
+                        erpCredit=getTenKvLineInformation(erpCredit,erpAccount,flag);
+                        break;
+                    }
+                }
+            }
+            //第一次,或者项目定义编码不同 进行如下方法计算
+            if (flag){
+                erpCredit = new ErpCredit();//获取ErpCredit对象
+                erpCredit.setItemId(erpAccount.getProjectDefinitionCode());//添加项目定义编号
+                erpCredit.setItemName(erpAccount.getProjectDefinitionDetails());//项目名称
+                erpCredit = getActualAndConstruction(erpCredit,erpAccount,flag);
+                erpCredit = getOtherFee(erpCredit,erpAccount,flag);
+                erpCredit = getTenKvLineInformation(erpCredit,erpAccount,flag);
+                erpCredits.add(erpCredit);
+            }
+        }
+        return erpCredits;
+    }
+
+    /**
+     * 400
+     * @param erpCredit
+     * @param erpAccount
+     * @param flag
+     * @return
+     */
+    public static ErpCredit getFourHundredInformation(ErpCredit erpCredit,ErpAccount erpAccount,boolean flag){
+        double fourHundredKvLength=0.0;//10kv线路信息长度
+        //400
+        if (!erpAccount.getTheNumber().isEmpty()){
+            fourHundredKvLength = Double.parseDouble(erpAccount.getTheNumber());
+        }
+        if (flag){
+            //架空绝缘导线AC1V 电力电缆AC1V
+            if (erpAccount.getMaterialDetails().contains(ErpInfo.CON_OICAC1)||
+                    erpAccount.getMaterialDetails().contains(ErpInfo.CON_PRCAC1)){
+                erpCredit.setTenKvItesFhvFollow(fourHundredKvLength);
+            }
+            return erpCredit;
+        }
+        //得到400
+        if (erpAccount.getMaterialDetails().contains(ErpInfo.CON_OICAC1)||
+                erpAccount.getMaterialDetails().contains(ErpInfo.CON_PRCAC1)){
+            if (null!=erpCredit.getTenKvItesFhvFollow()){//如果值不存在则赋值为0.0
+                fourHundredKvLength = erpCredit.getTenKvItesFhvFollow()+fourHundredKvLength;
+            }
+            erpCredit.setTenKvItesFhvFollow(fourHundredKvLength);
+        }
+        return erpCredit;
+    }
+    /**
+     * 10kv线路信息
+     * @param erpCredit
+     * @param erpAccount
+     * @param flag
+     * @return
+     */
+    public static ErpCredit getTenKvLineInformation(ErpCredit erpCredit,ErpAccount erpAccount,boolean flag){
+        String materialDetails = erpAccount.getMaterialDetails();//物料描述
+        double tenKvLength=0.0;//长度
+        double tenKvItsLine=0.0;//10kv线路
+        String[] split;
+        String[] split1;
+        if (!erpAccount.getTheNumber().isEmpty()){
+            tenKvLength = Double.parseDouble(erpAccount.getTheNumber());
+            tenKvItsLine= Double.parseDouble(erpAccount.getTheNumber());
+        }
+        if (flag){
+            if (materialDetails.contains(ErpInfo.CON_OICAC10)||
+                    materialDetails.contains(ErpInfo.CON_OICAC20)||
+                    materialDetails.contains(ErpInfo.CON_PRCAC10)||
+                    materialDetails.contains(ErpInfo.CON_PRCAC20)){
+                erpCredit.setTenKvModel(materialDetails);//架空导线型号
+                erpCredit.setTenKvUnit(erpAccount.getUnit());//单位
+                erpCredit.setTenKvLength(tenKvLength);//长度
+                erpCredit.setTenKvItsLine(tenKvItsLine);//10kv线路
+                erpCredit.setSupplierName(erpAccount.getSupplierName());
+            }
+            return erpCredit;
+        }
+        //得到10
+        if (materialDetails.contains(ErpInfo.CON_OICAC10)||
+                materialDetails.contains(ErpInfo.CON_OICAC20)||
+                materialDetails.contains(ErpInfo.CON_PRCAC10)||
+                materialDetails.contains(ErpInfo.CON_PRCAC20)){
+            //判断型号 显示
+//            if (null!=erpCredit.getTenKvModel()&& erpCredit.getTenKvModel().length() != 0){
+//                split = materialDetails.split(",");
+//                split1 = erpCredit.getTenKvModel().split(",");
+//                if (materialDetails.contains(ErpInfo.CON_OICAC)){
+//                    if (Double.parseDouble(split[split.length-1]) >= Double.parseDouble(split1[split1.length-1])){
+//                        erpCredit.setTenKvModel(materialDetails);
+//                        erpCredit.setTenKvUnit(erpAccount.getUnit());//单位
+//                        erpCredit.setSupplierName(erpAccount.getSupplierName());//公司
+//                    }else {
+//                        if (!erpCredit.getTenKvModel().contains(ErpInfo.CON_OICAC)){
+//                            erpCredit.setTenKvModel(materialDetails);
+//                            erpCredit.setTenKvUnit(erpAccount.getUnit());//单位
+//                            erpCredit.setSupplierName(erpAccount.getSupplierName());//公司
+//                        }
+//                    }
+//                }else {
+//                    if (!erpCredit.getTenKvModel().contains(ErpInfo.CON_OICAC)){
+//                        if (Double.parseDouble(split[split.length-1]) >= Double.parseDouble(split1[split1.length-1])){
+//                            erpCredit.setTenKvModel(materialDetails);
+//                            erpCredit.setTenKvUnit(erpAccount.getUnit());//单位
+//                            erpCredit.setSupplierName(erpAccount.getSupplierName());//公司
+//                        }
+//                    }
+//                }
+//            }else {
+//                erpCredit.setTenKvModel(materialDetails);
+//                erpCredit.setTenKvUnit(erpAccount.getUnit());//单位
+//                erpCredit.setSupplierName(erpAccount.getSupplierName());//公司
+//            }
+            erpCredit.setTenKvModel(materialDetails);
+            erpCredit.setTenKvUnit(erpAccount.getUnit());//单位
+            erpCredit.setSupplierName(erpAccount.getSupplierName());//公司
+            if (null!=erpCredit.getTenKvLength()){
+                tenKvLength=erpCredit.getTenKvLength()+tenKvLength;
+            }
+            if (null!=erpCredit.getTenKvItsLine()){
+                tenKvItsLine=erpCredit.getTenKvItsLine()+tenKvItsLine;
+            }
+            //添加长度
+            erpCredit.setTenKvLength(tenKvLength);
+            //添加10kv线路
+            erpCredit.setTenKvItsLine(tenKvItsLine);
+        }
+        return erpCredit;
+    }
+    /**
+     * 获取实际金额,进项税额,施工费合计
+     * @param erpCredit
+     * @param erpAccount
+     * @param flag
+     * @return
+     */
+    public static ErpCredit getActualAndConstruction(ErpCredit erpCredit,ErpAccount erpAccount,boolean flag){
+        double actualInvestment = 0.0;//实际投资
+        double consTotalFee=0.0;//施工费:合计
+        double theInputNumer=0.0;//进项税额
+        //判断 导入表格 对象 的行项目金额是否为空
+        if(!erpAccount.getLineItemAmount().isEmpty()){
+            actualInvestment = Double.parseDouble(erpAccount.getLineItemAmount());
+            consTotalFee = Double.parseDouble(erpAccount.getLineItemAmount());
+        }
+        //判断进项税额是否为空值
+        if (!erpAccount.getTheInputTax().isEmpty()){
+            theInputNumer=Double.parseDouble(erpAccount.getTheInputTax());
+        }
+        if (flag){
+            erpCredit.setTheInputTax(theInputNumer);//添加进项税额
+            //筛选(科目名称)中包含(工程成本-)的所有内容,统计行项目金额合计
+            if (erpAccount.getSubjectName().contains(ErpInfo.CON_PROJECT)){
+                //添加行项目金额 到 ErpCredit对象中的实际投资金额
+                erpCredit.setActualInvestment(actualInvestment);
+            }
+            //施工费:合计:入账金额 判断物料描述是否为空
+            if (erpAccount.getMaterialDetails().isEmpty()) {
+                //筛选物料描述为空的(科目名称)中包含(工程成本-安装工程支出)的所有内容,统计行项目金额合计
+                if (erpAccount.getSubjectName().contains(ErpInfo.CON_PROJECT + ErpInfo.CON_lINE + ErpInfo.CON_IPE)) {
+                    //得到施工费
+                    erpCredit.setConsTotalFee(consTotalFee);
+                }
+            }
+            return erpCredit;
+        }
+        //添加进项税额
+        if (null!=erpCredit.getTheInputTax()){
+            theInputNumer=erpCredit.getTheInputTax()+theInputNumer;
+        }
+        erpCredit.setTheInputTax(theInputNumer);
+        //筛选(科目名称)中包含(工程成本-)的所有内容,统计行项目金额合计
+        if (erpAccount.getSubjectName().contains(ErpInfo.CON_PROJECT)){
+            //当前实际投资+获取到的行项目金额
+            if (null!=erpCredit.getActualInvestment()){
+                actualInvestment=erpCredit.getActualInvestment()+actualInvestment;
+            }
+            //替换 实际投资金额
+            erpCredit.setActualInvestment(actualInvestment);
+        }
+        //施工费:合计:入账金额 判断物料描述是否为空
+        if (erpAccount.getMaterialDetails().isEmpty()) {
+            //筛选物料描述为空的(科目名称)中包含(工程成本-安装工程支出)的所有内容,统计行项目金额合计
+            if (erpAccount.getSubjectName().contains(ErpInfo.CON_PROJECT + ErpInfo.CON_lINE + ErpInfo.CON_IPE)) {
+                //当前施工费:合计+获取到的行项目金额
+                if (null!=erpCredit.getConsTotalFee()){
+                    consTotalFee = erpCredit.getConsTotalFee()+ consTotalFee;
+                }
+                //替换 施工费:合计金额
+                erpCredit.setConsTotalFee(consTotalFee);
+            }
+        }
+        return erpCredit;
+    }
+    /**
+     * 其他费用
+     * @param erpCredit
+     * @param erpAccount
+     * @param flag
+     * @return
+     */
+    public static ErpCredit getOtherFee(ErpCredit erpCredit,ErpAccount erpAccount,boolean flag){
+        double otherSupervisorFee=0.0;//其他费用:监理费:入账金额
+        double otherDesignFee = 0.0;//其他费用:设计费:入账金额
+        double otherBuildLoan=0.0;//其他费用:建设期贷款利息
+        double otherLineDamages=0.0;//线路施工赔偿费
+        double otherLegalManage=0.0;//法人管理费
+        double otherTotalFee=0.0;//其他费用合计
+        double lineItemAmount=0.0;//行项目金额合计
+        //判断 导入表格 对象 的行项目金额是否为空
+        if(!erpAccount.getLineItemAmount().isEmpty()){
+            lineItemAmount = Double.parseDouble(erpAccount.getLineItemAmount());
+        }
+        if (flag){
+            erpCredit.setOtherSupervisorFee(0.0);//添加其他:监理费
+            erpCredit.setOtherDesignFee(0.0);//添加 其他设计费
+            erpCredit.setOtherBuildLoan(0.0);//添加 建设期贷款利息
+            erpCredit.setOtherLineDamages(0.0);//添加 线路施工赔偿费
+            erpCredit.setOtherLegalManage(0.0);//添加 法人管理费
+            //其他费用:合计
+            erpCredit.setOtherTotalFee(0.0);
+            //判断物料描述是否为空
+            if (erpAccount.getMaterialDetails().isEmpty()) {
+                //筛选物料描述为空的先筛选(科目名称)中包含(工程成本-待摊支出-其他/工程成本-待摊支出-项目法人管理费-其他/项目管理经费 - 会议费)
+                if (erpAccount.getSubjectName().contains(ErpInfo.CON_PlPlQ)||
+                        erpAccount.getSubjectName().contains(ErpInfo.CON_PLPLPLQ)||
+                        erpAccount.getSubjectName().contains(ErpInfo.CON_PLM)){
+                    //判断WBS描述为工程监理费
+                    if (erpAccount.getWbsDetails().equals(ErpInfo.CON_PSF)){
+                        erpCredit.setOtherSupervisorFee(lineItemAmount);
+                    }
+                    //判断WBS描述为工程设计费
+                    if (erpAccount.getWbsDetails().equals(ErpInfo.CON_EDF)){
+                        erpCredit.setOtherDesignFee(lineItemAmount);
+                    }
+                    //判断WBS描述为建设期贷款利息
+                    if (erpAccount.getWbsDetails().equals(ErpInfo.CON_OBL)){
+                        erpCredit.setOtherBuildLoan(lineItemAmount);
+                    }
+                    //判断WBS描述为线路施工赔偿费
+                    if (erpAccount.getWbsDetails().equals(ErpInfo.CON_OLD)){
+                        erpCredit.setOtherLineDamages(lineItemAmount);
+                    }
+                    //其他费用:法人管理费
+                    erpCredit.setOtherLegalManage(lineItemAmount);
+                    //其他费用:合计
+                    erpCredit.setOtherTotalFee(lineItemAmount);
+                }
+            }
+        }else {
+            if (erpAccount.getMaterialDetails().isEmpty()) {
+                //筛选物料描述为空的先筛选(科目名称)中包含(工程成本-待摊支出-其他/工程成本-待摊支出-项目法人管理费-其他/项目管理经费 - 会议费)
+                if (erpAccount.getSubjectName().contains(ErpInfo.CON_PlPlQ)||
+                        erpAccount.getSubjectName().contains(ErpInfo.CON_PLPLPLQ)||
+                        erpAccount.getSubjectName().contains(ErpInfo.CON_PLM)){
+                    //筛选(WBS描述)为工程监理费的行项目金额合计
+                    if (erpAccount.getWbsDetails().equals(ErpInfo.CON_PSF)){
+                        otherSupervisorFee = erpCredit.getOtherSupervisorFee()+lineItemAmount;//监理费
+                        erpCredit.setOtherSupervisorFee(otherSupervisorFee);
+                    }
+                    //判断WBS描述为工程设计费
+                    if (erpAccount.getWbsDetails().equals(ErpInfo.CON_EDF)){
+                        otherDesignFee = erpCredit.getOtherDesignFee() + lineItemAmount;//设计费
+                        erpCredit.setOtherDesignFee(otherDesignFee);
+                    }
+                    //判断WBS描述为建设期贷款利息
+                    if (erpAccount.getWbsDetails().equals(ErpInfo.CON_OBL)){
+                        otherBuildLoan =erpCredit.getOtherBuildLoan()+lineItemAmount;//建设期贷款利息
+                        erpCredit.setOtherBuildLoan(otherBuildLoan);
+                    }
+                    //判断WBS描述为线路施工赔偿费
+                    if (erpAccount.getWbsDetails().equals(ErpInfo.CON_OLD)){
+                        otherLineDamages = erpCredit.getOtherLineDamages()+lineItemAmount;//建设期贷款利息
+                        erpCredit.setOtherLineDamages(otherLineDamages);
+                    }
+                    //其他费用:法人管理费
+                    otherLegalManage=erpCredit.getOtherLegalManage()+lineItemAmount;
+                    erpCredit.setOtherLegalManage(otherLegalManage);
+                    //其他费用:合计
+                    otherTotalFee = erpCredit.getOtherTotalFee()+ lineItemAmount;
+                    erpCredit.setOtherTotalFee(otherTotalFee);
+                }
+            }
+        }
+        return erpCredit;
+    }
+    /**
+     * 获取设备的list集合
+     * @param list 导入的表格 bean对象
+     * @return 设备的list集合
+     */
+    public static List<ErpCreditChild1> getListErpCreditChild1(List<ErpAccount> list){
+        Double eqmNumbers=0.0;//设备台数
+        Double eqmBookedFee=0.0;//设备入账金额
+        String materialDetails="";//筛选kva
+        boolean flag = true;//开关:判断集合是否重复 true-物料描述不同 false-项目定义编号相同且物料描述相同
+        ErpCreditChild1 erpCreditChild1;//设备对象
+        ErpCredit erpCredit;//设备父类
+        ErpAccount erpAccount;//数据集合
+        List<ErpCreditChild1> creditListChild1 = new ArrayList<ErpCreditChild1>();
+        for (int i = 0; i < list.size(); i++) {
+            flag=true;
+            erpAccount=list.get(i);
+            //判断设备台数是否为空
+            if (!erpAccount.getTheNumber().isEmpty()){//设备台数
+                eqmNumbers = Double.parseDouble(erpAccount.getTheNumber()); //否则 获取设备台数 信息
+            }
+            //判断如行项目金额是否为空
+            if (!erpAccount.getLineItemAmount().isEmpty()){
+                eqmBookedFee = Double.parseDouble(erpAccount.getLineItemAmount());//行项目金额赋值费入账金额
+            }
+            //判断当前 设备费 集合是否存在
+            if (null!=creditListChild1&&creditListChild1.size()>0){
+                for (int j = 0; j < creditListChild1.size(); j++) {
+                    erpCreditChild1 = creditListChild1.get(j);//获取设备对象
+                    //判断项目定义号是否相同
+                    if (erpCreditChild1.getErpCredit().getItemId().equals(erpAccount.getProjectDefinitionCode())) {
+                        //判断物料描述是否相同
+                        if (erpAccount.getMaterialDetails().equals(erpCreditChild1.getEqmMaterialDetails1())) {
+                            eqmBookedFee = erpCreditChild1.getEqmBookedFee1()+eqmBookedFee;//累加 入账金额
+                            erpCreditChild1.setEqmBookedFee1(eqmBookedFee);//替换
+                            eqmNumbers = erpCreditChild1.getEqmNumbers()+eqmNumbers;//累计 数量
+                            erpCreditChild1.setEqmNumbers(eqmNumbers);//替换
+                            flag = false;// 项目定义编号相同且物料描述相同(当前ErpAccount对象在ErpCreditChild1对象中存在且相同 跳过下面方法)
+                            break;
+                        }
+                    }
+                }
+            }
+            if (flag){
+                //筛选物料描述包含(变压器、环网柜(无“”有“无”字样)、箱式变电站、高压开关柜),分别显示筛选出的物料描述
+                if (erpAccount.getMaterialDetails().contains(ErpInfo.CON_TSF)||
+                        erpAccount.getMaterialDetails().contains(ErpInfo.CON_RNB)||
+                        erpAccount.getMaterialDetails().contains(ErpInfo.CON_BST)||
+                        erpAccount.getMaterialDetails().contains(ErpInfo.CON_HVS)){
+                    erpCreditChild1 = new ErpCreditChild1();//获取设备对象
+                    erpCredit=new ErpCredit();//获取设备 父类 主类
+                    materialDetails = erpAccount.getMaterialDetails();//获取物料描述
+                    //截取总容量kVA前数字
+                    if (materialDetails.contains("kVA")){
+                        String str[] =  materialDetails.split(",");
+                        for (int k = 0; k < str.length; k++) {
+                            if (str[k].toLowerCase().contains("kva")){
+                                materialDetails = str[k].substring(0,str[k].toLowerCase().indexOf("kva"));
+                                break;
+                            }
+                        }
+                        erpCreditChild1.setEqmTotalCapacity(materialDetails);//添加总容量
+                    }
+                    erpCredit.setItemId(erpAccount.getProjectDefinitionCode());//添加项目定义编码
+                    erpCreditChild1.setEqmMaterialDetails1(erpAccount.getMaterialDetails());//添加物料描述
+                    erpCreditChild1.setEqmUnit(erpAccount.getUnit());//添加的单位
+                    erpCreditChild1.setEqmNumbers(eqmNumbers);//添加数量
+                    erpCreditChild1.setEqmBookedFee1(eqmBookedFee);//添加入账金额
+                    erpCreditChild1.setEqmSupplierName(erpAccount.getSupplierName());//添加供应商
+                    erpCreditChild1.setErpCredit(erpCredit);
+                    creditListChild1.add(erpCreditChild1);
+                }
+            }
+        }
+        return creditListChild1;
+    }
+
+    /**
+     * 获取材料的list集合
+     * @param erpAccounts 导入的表格 bean对象
+     * @return 材料 list金额
+     */
+    public static List<ErpCreditChild2> getListErpCreditChild2(List<ErpAccount> erpAccounts){
+        List<ErpCreditChild2> creditListChild2 = new ArrayList<ErpCreditChild2>();
+        boolean flag = true;//判断 材料费 true-物料描述不同或者项目定义编号不同 false-仙姑定义编号物料描述相同
+        double eqmBookedFee2=0.0;//材料入账金额
+        double eqmNumber2=0.0;//设备台数
+        ErpCreditChild2 erpCreditChild2=null;
+        ErpCredit erpCredit = null;
+        ErpAccount erpAccount=null;
+        for (int i = 0; i < erpAccounts.size(); i++) {
+            flag=true;//默认初始值 项目定义编号不同
+            erpAccount = erpAccounts.get(i);
+            //判断行项目金额是否为空
+            if (!erpAccount.getLineItemAmount().isEmpty()){
+                //赋值材料入账金额为行项目金额
+                eqmBookedFee2 = Double.parseDouble(erpAccount.getLineItemAmount());
+            }
+            if (!erpAccount.getTheNumber().isEmpty()){//判断设备材料
+                eqmNumber2=Double.parseDouble(erpAccount.getTheNumber());
+            }
+            //判断creditListChild2对象集合 是否存在
+            if (null!=creditListChild2&&creditListChild2.size()>0){
+                for (int j = 0; j < creditListChild2.size(); j++) {
+                    erpCreditChild2 = creditListChild2.get(j);
+                    //判断项目定义号是否相同
+                    if (erpCreditChild2.getErpCredit().getItemId().equals(erpAccount.getProjectDefinitionCode())) {
+                        //判断物料描述是否相同
+                        if (erpAccount.getMaterialDetails().equals(erpCreditChild2.getEqmMaterialDetails2())) {
+                            eqmBookedFee2 += erpCreditChild2.getMtlBookedFee2();//入账金额累加
+                            erpCreditChild2.setMtlBookedFee2(eqmBookedFee2);
+                            eqmNumber2 = erpCreditChild2.getMtlNumbers()+eqmNumber2;//台数累加
+                            erpCreditChild2.setMtlNumbers(eqmNumber2);//添加设备台数
+                            flag=false;
+                            break;
+                        }
+                    }
+                }
+            }
+            if (flag){
+                //排除 物料描述为空的内容
+                if (!erpAccount.getMaterialDetails().isEmpty()) {
+                    //筛选物料描述不包含(变压器、环网柜(无“”有“无”字样)、箱式变电站、高压开关柜)的行项目金额合计
+                    if (!erpAccount.getMaterialDetails().contains(ErpInfo.CON_TSF) &&
+                            !erpAccount.getMaterialDetails().contains(ErpInfo.CON_RNB) &&
+                            !erpAccount.getMaterialDetails().contains(ErpInfo.CON_BST) &&
+                            !erpAccount.getMaterialDetails().contains(ErpInfo.CON_HVS)) {
+                        erpCreditChild2 = new ErpCreditChild2();//获取材料费对象
+                        erpCredit = new ErpCredit();//获取材料 父类 对象
+                        erpCredit.setItemId(erpAccount.getProjectDefinitionCode());//添加项目id
+                        erpCreditChild2.setEqmMaterialDetails2(erpAccount.getMaterialDetails());//添加物料描述
+                        erpCreditChild2.setMtlBookedFee2(eqmBookedFee2);//添加项目材料费
+                        erpCreditChild2.setMtlNumbers(eqmNumber2);//添加设备台数
+                        erpCreditChild2.setMtlUnit(erpAccount.getUnit());//添加设备单位
+                        erpCreditChild2.setMtlSupplierName(erpAccount.getSupplierName());//添加供应商
+                        erpCreditChild2.setErpCredit(erpCredit);
+                        creditListChild2.add(erpCreditChild2);
+                    }
+                }
+            }
+        }
+        return creditListChild2;
+    }
+}

+ 173 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ExportTemplate.java

@@ -0,0 +1,173 @@
+package com.jeeplus.modules.sg.financial.erpcredit.util;
+
+import com.jeeplus.modules.sg.financial.erpcredit.entity.ErpCredit;
+import com.jeeplus.modules.sg.financial.erpcredit.entity.ScheduleOther;
+import org.apache.poi.xssf.usermodel.XSSFCell;
+import org.apache.poi.xssf.usermodel.XSSFRow;
+import org.apache.poi.xssf.usermodel.XSSFSheet;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.*;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 根据模板导出excel表格
+ */
+public class ExportTemplate {
+//    public void exportExcel(List<ErpCredit> erpCredits) {
+//        File newFile = createNewFile();
+//        // 新文件写入数据,并下载
+//        InputStream inputStream = null;
+//        XSSFWorkbook workbook = null;
+//        XSSFSheet sheet1 = null;//概况表
+//        XSSFSheet sheet2=null;//一览表
+//        XSSFSheet sheet3=null;//其他费用明细表
+//        XSSFSheet sheet4=null;//移交生产的资产总表
+//        XSSFSheet sheet5=null;//移交资产—配电网资产一览表(线路)
+//        XSSFSheet sheet6=null;//移交资产—配电网资产一览表(设备)
+//        XSSFSheet sheet7=null;//设备材料清册
+//        XSSFSheet sheet8=null;//竣工工程财务决算表
+//        XSSFSheet sheet9=null;//移交资产—配电网资产一览表(线路)1
+//        XSSFSheet sheet10=null;//移交资产—配电网资产一览表(设备)2
+//        try {
+//            inputStream = new FileInputStream(newFile);// 将excel文件转为输入流
+//            workbook = new XSSFWorkbook(inputStream);// 创建个workbook,
+//            //获取概况表
+//            sheet1 =workbook.getSheetAt(1);
+//            //获取一览表
+//            sheet2 = workbook.getSheetAt(2);
+//            // 获取其他费用明细表
+//            sheet3 = workbook.getSheetAt(3);
+//            //获取移交生产的总表
+//            sheet4=workbook.getSheetAt(4);
+//            //获取移交资产—配电网资产一览表(线路)
+//            sheet5=workbook.getSheetAt(5);
+//            //获取移交资产—配电网资产一览表(设备)
+//            sheet6=workbook.getSheetAt(6);
+//            //获取设备材料清册
+//            sheet7=workbook.getSheetAt(7);
+//            //获取竣工工程财务决算表
+//            sheet8=workbook.getSheetAt(8);
+//            //获取移交资产—配电网资产一览表(线路)1
+//            sheet9=workbook.getSheetAt(10);
+//            //获取移交资产—配电网资产一览表(设备)2
+//            sheet10 = workbook.getSheetAt(11);
+//        } catch (Exception e1) {
+//            e1.printStackTrace();
+//        }
+//
+//        if (sheet3!= null) {
+//            try {
+//                // 写数据
+//                FileOutputStream fos = new FileOutputStream(newFile);
+//                XSSFRow row = sheet3.getRow(6);
+//                XSSFCell cell = row.getCell(3);
+//                ScheduleOther scheduleOther = ExportUtil1.getScheduleOfOtherExpenses(erpCredits);
+//                for (int i = 0; i < 20; i++) {
+//                    row =sheet3.getRow((int)i+6);
+//                    cell=row.getCell(3);
+//                    cell.setCellValue(i);
+//                }
+//                workbook.write(fos);
+//                fos.flush();
+//                fos.close();
+//            } catch (Exception e) {
+//                e.printStackTrace();
+//            } finally {
+//                try {
+//                    if (null != inputStream) {
+//                        inputStream.close();
+//                    }
+//                } catch (Exception e) {
+//                    e.printStackTrace();
+//                }
+//            }
+//        }
+//        // 删除创建的新文件
+//        // this.deleteFile(newFile);
+//    }
+
+    /**
+     * 复制文件
+     * @param file
+     *            源文件
+     * @param fileNew
+     *            复制到的新文件
+     */
+    public static void fileChannelCopy(File file, File fileNew) {
+        try {
+            InputStream in = null;
+            OutputStream out = null;
+            try {
+                in = new BufferedInputStream(new FileInputStream(file), 1024);
+                out = new BufferedOutputStream(new FileOutputStream(fileNew), 1024);
+                byte[] buffer = new byte[1024];
+                int len;
+                while ((len = in.read(buffer)) != -1) {
+                    out.write(buffer, 0, len);
+                }
+            } finally {
+                if (null != in) {
+                    in.close();
+                }
+                if (null != out) {
+                    out.close();
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public String getSispPath() {
+        String sispPath = this.getClass().getResource("/").getPath()+ "freemarker/";
+        return sispPath;
+    }
+    /**
+     * 读取excel模板,并复制到新文件中供写入和下载
+     * @return
+     */
+    public File createNewFile() {
+        // 读取模板,并赋值到新文件
+        // 文件模板路径
+        String path = (getSispPath() + "excelmodel/竣工决算模板.xlsx");
+        File file = new File(path);
+        // 保存文件的路径
+        String realPath = (getSispPath() + "newexcelmodel");
+        // 新的文件名
+        String newFileName = "竣工决算" + System.currentTimeMillis() + ".xlsx";
+        // 判断路径是否存在
+        File filePath = new File(realPath);
+        if (!filePath.exists()) {
+            filePath.mkdirs();
+        }
+        // 写入到新的excel
+        File newFile = new File(realPath, newFileName);
+        try {
+            newFile.createNewFile();
+            // 复制模板到新文件
+            fileChannelCopy(file, newFile);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return newFile;
+    }
+    /**
+     * 下载成功后删除
+     *
+     * @param files
+     */
+    private void deleteFile(File... files) {
+        for (File file : files) {
+            if (file.exists()) {
+                file.delete();
+            }
+        }
+    }
+
+}

+ 462 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ExportUtil.java

@@ -0,0 +1,462 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.financial.erpcredit.util;
+
+import com.google.common.collect.Lists;
+import com.jeeplus.common.utils.Encodes;
+import com.jeeplus.common.utils.Reflections;
+import com.jeeplus.common.utils.excel.annotation.ExcelField;
+import com.jeeplus.modules.sys.utils.DictUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.ss.util.CellRangeAddress;
+import org.apache.poi.xssf.streaming.SXSSFWorkbook;
+import org.apache.poi.xssf.usermodel.XSSFClientAnchor;
+import org.apache.poi.xssf.usermodel.XSSFRichTextString;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.*;
+
+/**
+ * 导出Excel文件(导出“XLSX”格式,支持大数据量导出   @see org.apache.poi.ss.SpreadsheetVersion)
+ * @author jeeplus
+ * @version 2016-04-21
+ */
+public class ExportUtil {
+
+	private static Logger log = LoggerFactory.getLogger(ExportUtil.class);
+
+	/**
+	 * 工作薄对象
+	 */
+	private SXSSFWorkbook wb;
+
+	/**
+	 * 工作表对象
+	 */
+	private Sheet sheet;
+
+	/**
+	 * 样式列表
+	 */
+	private Map<String, CellStyle> styles;
+
+	/**
+	 * 当前行号
+	 */
+	private int rownum;
+
+	/**
+	 * 注解列表(Object[]{ ExcelField, Field/Method })
+	 */
+	List<Object[]> annotationList = Lists.newArrayList();
+
+	/**
+	 * 构造函数
+	 * @param title 表格标题,传“空值”,表示无标题
+	 * @param cls 实体对象,通过annotation.ExportField获取标题
+	 */
+	public ExportUtil(String title, Class<?> cls){
+		this(title, cls, 1);
+	}
+
+	/**
+	 * 构造函数
+	 * @param title 表格标题,传“空值”,表示无标题
+	 * @param cls 实体对象,通过annotation.ExportField获取标题
+	 * @param type 导出类型(1:导出数据;2:导出模板)
+	 * @param groups 导入分组
+	 */
+	public ExportUtil(String title, Class<?> cls, int type, int... groups){
+		// Get annotation field
+		Field[] fs = cls.getDeclaredFields();
+		for (Field f : fs){
+			ExcelField ef = f.getAnnotation(ExcelField.class);
+			if (ef != null && (ef.type()==0 || ef.type()==type)){
+				if (groups!=null && groups.length>0){
+					boolean inGroup = false;
+					for (int g : groups){
+						if (inGroup){
+							break;
+						}
+						for (int efg : ef.groups()){
+							if (g == efg){
+								inGroup = true;
+								annotationList.add(new Object[]{ef, f});
+								break;
+							}
+						}
+					}
+				}else{
+					annotationList.add(new Object[]{ef, f});
+				}
+			}
+		}
+		// Get annotation method
+		Method[] ms = cls.getDeclaredMethods();
+		for (Method m : ms){
+			ExcelField ef = m.getAnnotation(ExcelField.class);
+			if (ef != null && (ef.type()==0 || ef.type()==type)){
+				if (groups!=null && groups.length>0){
+					boolean inGroup = false;
+					for (int g : groups){
+						if (inGroup){
+							break;
+						}
+						for (int efg : ef.groups()){
+							if (g == efg){
+								inGroup = true;
+								annotationList.add(new Object[]{ef, m});
+								break;
+							}
+						}
+					}
+				}else{
+					annotationList.add(new Object[]{ef, m});
+				}
+			}
+		}
+		// Field sorting
+		Collections.sort(annotationList, new Comparator<Object[]>() {
+			public int compare(Object[] o1, Object[] o2) {
+				return new Integer(((ExcelField)o1[0]).sort()).compareTo(
+						new Integer(((ExcelField)o2[0]).sort()));
+			};
+		});
+		// Initialize
+		List<String> headerList = Lists.newArrayList();
+		for (Object[] os : annotationList){
+			String t = ((ExcelField)os[0]).title();
+			// 如果是导出,则去掉注释
+			if (type==1){
+				String[] ss = StringUtils.split(t, "**", 2);
+				if (ss.length==2){
+					t = ss[0];
+				}
+			}
+			headerList.add(t);
+		}
+		initialize(title, headerList);
+	}
+
+	/**
+	 * 构造函数
+	 * @param title 表格标题,传“空值”,表示无标题
+	 * @param headers 表头数组
+	 */
+	public ExportUtil(String title, String[] headers) {
+		initialize(title, Lists.newArrayList(headers));
+	}
+
+	/**
+	 * 构造函数
+	 * @param title 表格标题,传“空值”,表示无标题
+	 * @param headerList 表头列表
+	 */
+	public ExportUtil(String title, List<String> headerList) {
+		initialize(title, headerList);
+	}
+	
+	/**
+	 * 初始化函数
+	 * @param title 表格标题,传“空值”,表示无标题
+	 * @param headerList 表头列表
+	 */
+	private void initialize(String title, List<String> headerList) {
+		this.wb = new SXSSFWorkbook(500);
+		this.sheet = wb.createSheet("Export");
+		this.styles = createStyles(wb);
+		// Create title
+		if (StringUtils.isNotBlank(title)){
+			Row titleRow = sheet.createRow(rownum++);
+			titleRow.setHeightInPoints(30);
+			Cell titleCell = titleRow.createCell(0);
+			titleCell.setCellStyle(styles.get("title"));
+			titleCell.setCellValue(title);
+			sheet.addMergedRegion(new CellRangeAddress(titleRow.getRowNum(),
+					titleRow.getRowNum(), titleRow.getRowNum(), headerList.size()-1));
+		}
+		// Create header
+		if (headerList == null){
+			throw new RuntimeException("headerList not null!");
+		}
+		Row headerRow = sheet.createRow(rownum++);
+		headerRow.setHeightInPoints(16);
+		for (int i = 0; i < headerList.size(); i++) {
+			Cell cell = headerRow.createCell(i);
+			cell.setCellStyle(styles.get("header"));
+			String[] ss = StringUtils.split(headerList.get(i), "**", 2);
+			if (ss.length==2){
+				cell.setCellValue(ss[0]);
+				Comment comment = this.sheet.createDrawingPatriarch().createCellComment(
+						new XSSFClientAnchor(0, 0, 0, 0, (short) 3, 3, (short) 5, 6));
+				comment.setString(new XSSFRichTextString(ss[1]));
+				cell.setCellComment(comment);
+			}else{
+				cell.setCellValue(headerList.get(i));
+			}
+			sheet.autoSizeColumn(i);
+		}
+		for (int i = 0; i < headerList.size(); i++) {  
+			int colWidth = sheet.getColumnWidth(i)*2;
+	        sheet.setColumnWidth(i, colWidth < 3000 ? 3000 : colWidth);  
+		}
+		log.debug("Initialize success.");
+	}
+	
+	/**
+	 * 创建表格样式
+	 * @param wb 工作薄对象
+	 * @return 样式列表
+	 */
+	private Map<String, CellStyle> createStyles(Workbook wb) {
+		Map<String, CellStyle> styles = new HashMap<String, CellStyle>();
+		
+		CellStyle style = wb.createCellStyle();
+		style.setAlignment(CellStyle.ALIGN_CENTER);
+		style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
+		Font titleFont = wb.createFont();
+		titleFont.setFontName("Arial");
+		titleFont.setFontHeightInPoints((short) 16);
+		titleFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
+		style.setFont(titleFont);
+		styles.put("title", style);
+
+		style = wb.createCellStyle();
+		style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
+		style.setBorderRight(CellStyle.BORDER_THIN);
+		style.setRightBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
+		style.setBorderLeft(CellStyle.BORDER_THIN);
+		style.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
+		style.setBorderTop(CellStyle.BORDER_THIN);
+		style.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
+		style.setBorderBottom(CellStyle.BORDER_THIN);
+		style.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
+		Font dataFont = wb.createFont();
+		dataFont.setFontName("Arial");
+		dataFont.setFontHeightInPoints((short) 10);
+		style.setFont(dataFont);
+		styles.put("data", style);
+		
+		style = wb.createCellStyle();
+		style.cloneStyleFrom(styles.get("data"));
+		style.setAlignment(CellStyle.ALIGN_LEFT);
+		styles.put("data1", style);
+
+		style = wb.createCellStyle();
+		style.cloneStyleFrom(styles.get("data"));
+		style.setAlignment(CellStyle.ALIGN_CENTER);
+		styles.put("data2", style);
+
+		style = wb.createCellStyle();
+		style.cloneStyleFrom(styles.get("data"));
+		style.setAlignment(CellStyle.ALIGN_RIGHT);
+		styles.put("data3", style);
+		
+		style = wb.createCellStyle();
+		style.cloneStyleFrom(styles.get("data"));
+//		style.setWrapText(true);
+		style.setAlignment(CellStyle.ALIGN_CENTER);
+		style.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex());
+		style.setFillPattern(CellStyle.SOLID_FOREGROUND);
+		Font headerFont = wb.createFont();
+		headerFont.setFontName("Arial");
+		headerFont.setFontHeightInPoints((short) 10);
+		headerFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
+		headerFont.setColor(IndexedColors.WHITE.getIndex());
+		style.setFont(headerFont);
+		styles.put("header", style);
+		
+		return styles;
+	}
+
+	/**
+	 * 添加一行
+	 * @return 行对象
+	 */
+	public Row addRow(){
+		return sheet.createRow(rownum++);
+	}
+	
+
+	/**
+	 * 添加一个单元格
+	 * @param row 添加的行
+	 * @param column 添加列号
+	 * @param val 添加值
+	 * @return 单元格对象
+	 */
+	public Cell addCell(Row row, int column, Object val){
+		return this.addCell(row, column, val, 0, Class.class);
+	}
+	
+	/**
+	 * 添加一个单元格
+	 * @param row 添加的行
+	 * @param column 添加列号
+	 * @param val 添加值
+	 * @param align 对齐方式(1:靠左;2:居中;3:靠右)
+	 * @return 单元格对象
+	 */
+	public Cell addCell(Row row, int column, Object val, int align, Class<?> fieldType){
+		Cell cell = row.createCell(column);
+		CellStyle style = styles.get("data"+(align>=1&&align<=3?align:""));
+		try {
+			if (val == null){
+				cell.setCellValue("");
+			} else if (val instanceof String) {
+				cell.setCellValue((String) val);
+			} else if (val instanceof Integer) {
+				cell.setCellValue((Integer) val);
+			} else if (val instanceof Long) {
+				cell.setCellValue((Long) val);
+			} else if (val instanceof Double) {
+				cell.setCellValue((Double) val);
+			} else if (val instanceof Float) {
+				cell.setCellValue((Float) val);
+			} else if (val instanceof Date) {
+				DataFormat format = wb.createDataFormat();
+	            style.setDataFormat(format.getFormat("yyyy-MM-dd"));
+				cell.setCellValue((Date) val);
+			} else {
+				if (fieldType != Class.class){
+					cell.setCellValue((String)fieldType.getMethod("setValue", Object.class).invoke(null, val));
+				}else{
+					cell.setCellValue((String)Class.forName(this.getClass().getName().replaceAll(this.getClass().getSimpleName(), 
+						"fieldtype."+val.getClass().getSimpleName()+"Type")).getMethod("setValue", Object.class).invoke(null, val));
+				}
+			}
+		} catch (Exception ex) {
+			log.info("Set cell value ["+row.getRowNum()+","+column+"] error: " + ex.toString());
+			cell.setCellValue(val.toString());
+		}
+		cell.setCellStyle(style);
+		return cell;
+	}
+
+	/**
+	 * 添加数据(通过annotation.ExportField添加数据)
+	 * @return list 数据列表
+	 */
+	public <E> ExportUtil setDataList(List<E> list){
+		for (E e : list){
+			int colunm = 0;
+			Row row = this.addRow();
+			StringBuilder sb = new StringBuilder();
+			for (Object[] os : annotationList){
+				ExcelField ef = (ExcelField)os[0];
+				Object val = null;
+				// Get entity value
+				try{
+					if (StringUtils.isNotBlank(ef.value())){
+						val = Reflections.invokeGetter(e, ef.value());
+					}else{
+						if (os[1] instanceof Field){
+							val = Reflections.invokeGetter(e, ((Field)os[1]).getName());
+						}else if (os[1] instanceof Method){
+							val = Reflections.invokeMethod(e, ((Method)os[1]).getName(), new Class[] {}, new Object[] {});
+						}
+					}
+					// If is dict, get dict label
+					if (StringUtils.isNotBlank(ef.dictType())){
+						val = DictUtils.getDictLabel(val==null?"":val.toString(), ef.dictType(), "");
+					}
+				}catch(Exception ex) {
+					// Failure to ignore
+					log.info(ex.toString());
+					val = "";
+				}
+				this.addCell(row, colunm++, val, ef.align(), ef.fieldType());
+				sb.append(val + ", ");
+			}
+			log.debug("Write success: ["+row.getRowNum()+"] "+sb.toString());
+		}
+		return this;
+	}
+	
+	/**
+	 * 输出数据流
+	 * @param os 输出数据流
+	 */
+	public ExportUtil write(OutputStream os) throws IOException{
+		wb.write(os);
+		return this;
+	}
+	
+	/**
+	 * 输出到客户端
+	 * @param fileName 输出文件名
+	 */
+	public ExportUtil write(HttpServletResponse response, String fileName) throws IOException{
+		response.reset();
+        response.setContentType("application/octet-stream; charset=utf-8");
+        response.setHeader("Content-Disposition", "attachment; filename="+Encodes.urlEncode(fileName));
+		write(response.getOutputStream());
+		return this;
+	}
+	
+	/**
+	 * 输出到文件
+	 * @param name 输出文件名
+	 */
+	public ExportUtil writeFile(String name) throws FileNotFoundException, IOException{
+		FileOutputStream os = new FileOutputStream(name);
+		this.write(os);
+		return this;
+	}
+	
+	/**
+	 * 清理临时文件
+	 */
+	public ExportUtil dispose(){
+		wb.dispose();
+		return this;
+	}
+	
+//	/**
+//	 * 导出测试
+//	 */
+//	public static void main(String[] args) throws Throwable {
+//		
+//		List<String> headerList = Lists.newArrayList();
+//		for (int i = 1; i <= 10; i++) {
+//			headerList.add("表头"+i);
+//		}
+//		
+//		List<String> dataRowList = Lists.newArrayList();
+//		for (int i = 1; i <= headerList.size(); i++) {
+//			dataRowList.add("数据"+i);
+//		}
+//		
+//		List<List<String>> dataList = Lists.newArrayList();
+//		for (int i = 1; i <=1000000; i++) {
+//			dataList.add(dataRowList);
+//		}
+//
+//		ExportExcel ee = new ExportExcel("表格标题", headerList);
+//		
+//		for (int i = 0; i < dataList.size(); i++) {
+//			Row row = ee.addRow();
+//			for (int j = 0; j < dataList.get(i).size(); j++) {
+//				ee.addCell(row, j, dataList.get(i).get(j));
+//			}
+//		}
+//		
+//		ee.writeFile("target/export.xlsx");
+//
+//		ee.dispose();
+//		
+//		log.debug("Export success.");
+//		
+//	}
+
+}

+ 582 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ExportUtil1.java

@@ -0,0 +1,582 @@
+package com.jeeplus.modules.sg.financial.erpcredit.util;
+
+import com.jeeplus.modules.sg.financial.erpcredit.entity.*;
+import com.jeeplus.modules.sg.financial.settlement.entity.MaintainData;
+
+import javax.xml.crypto.Data;
+import java.text.DecimalFormat;
+import java.util.*;
+
+public class ExportUtil1 {
+    public static String POWER_DEPARTMENT="配电检修工区";
+    public static String POWER_BDZ="变电站";
+    public static String POWER_BOXBDZ="箱式变电站";
+    public static String POWER_HGW="环网柜";
+    public static String POWER_KGG="高压开关柜";
+    public static String POWER_ZYXL="中压线路";
+    public static String POWER_BDZCOUNT="160200001";
+    public static String POWER_BOXCOUNT="160200002";
+    public static String POWER_HGWCOUNT="160200003";
+    public static String POWER_KGGCOUNT="160200010";
+
+    public static List<Schedule> getScheduleList(List<ErpCredit> erpCreditList,List<MaintainData> maintainDataList){
+        List<Schedule> schedules = new ArrayList<Schedule>();
+        Schedule schedule = null;
+        if (null!=erpCreditList&&erpCreditList.size()>0){
+            for (ErpCredit erpCredit:erpCreditList){
+                schedule = new Schedule();
+                schedule = getActualRelative(schedule,erpCredit,maintainDataList);//得到一览表实际金额
+                schedules.add(schedule);
+            }
+        }
+        return schedules;
+    }
+    //一览表 实际较预算增减
+    public static Schedule getActualRelative(Schedule schedule,ErpCredit erpCredit,List<MaintainData> maintainDataList){
+        DecimalFormat decimalFormat   = new DecimalFormat("#0.00");
+        schedule = getScheduleBudget(schedule,erpCredit,maintainDataList);
+        schedule = getScheduleActual(schedule,erpCredit);
+        double addSubtractionLines = 0.0;
+        double addSubtractionRate1=0.0;
+        String addSubtractionRate2="";
+        if (null==schedule.getActualTotalFee()) {
+            schedule.setActualTotalFee("0");
+        }
+        if (null==schedule.getBudgetTotalFee()){
+            schedule.setBudgetTotalFee("0");
+        }
+        addSubtractionLines=Double.parseDouble(schedule.getActualTotalFee())-Double.parseDouble(schedule.getBudgetTotalFee());
+        schedule.setAddSubtractionLines(String.valueOf(addSubtractionLines));
+        if (null==schedule.getBudgetTotalFee()) {
+            schedule.setAddSubtractionLines("1");
+        }
+        addSubtractionRate1 = addSubtractionLines/Double.parseDouble(schedule.getBudgetTotalFee());
+        addSubtractionRate2 = decimalFormat.format(addSubtractionRate1);
+        schedule.setAddSubtractionRate(addSubtractionRate2);
+        return schedule;
+    }
+    //获取:一览表 预算价值
+    public static Schedule getScheduleBudget(Schedule schedule,ErpCredit erpCredit,List<MaintainData> maintainDataList){
+        if (null!=maintainDataList&&maintainDataList.size()>0){
+            for (MaintainData maintainData:maintainDataList){
+                //判断id是否一样
+                if (maintainData.getProjectId().equals(erpCredit.getItemId())){
+                    schedule.setBudgetBuildProject(String.valueOf(maintainData.getBuildingFee()));//建筑费
+                    schedule.setBudgetInstallProject(String.valueOf(maintainData.getInstallFee()+maintainData.getMaterialFee()));
+                    schedule.setBudgetEquipmentValue(String.valueOf(maintainData.getEquipmentFee()));//设备购置费
+                    schedule.setBudgetTotalFee(String.valueOf(maintainData.getEquipmentFee()+maintainData.getInstallFee()+maintainData.getMaterialFee()+maintainData.getEquipmentFee()));
+                }
+            }
+        }
+        return schedule;
+    }
+    //获取:一览表 实际价值
+    public static Schedule getScheduleActual(Schedule schedule,ErpCredit erpCredit){
+        boolean flag = false;
+        List<ErpCreditChild2> erpCreditChild2s = null;//得到材料费金额
+        List<ErpCreditChild1> erpCreditChild1s = null;//得到设备费金额
+        double netAmount=0.0;//入账金额:设备费,材料费
+        double actualTotalFee=0.0;//合计金额
+        //循环erpCredit集合
+        schedule.setItemId(erpCredit.getItemId());//得到项目定义编号
+        schedule.setItemName(erpCredit.getItemName());//得到项目名称
+        if (null!=erpCredit.getConsBuildingFee()){//如果建筑费不为空
+            //得到建筑费
+            schedule.setActualBuildProject(String.valueOf(erpCredit.getConsBuildingFee()));
+            actualTotalFee+=erpCredit.getConsBuildingFee();
+        }
+        erpCreditChild2s = erpCredit.getErpCreditChild2s();//得到材料费
+        //判断材料费
+        if (erpCreditChild2s!=null&&erpCreditChild2s.size()>0){
+            for (ErpCreditChild2 erpCreditChild2:erpCreditChild2s){
+                if (null!=erpCreditChild2.getMtlBookedFee2()){
+                    netAmount+=erpCreditChild2.getMtlBookedFee2();//得到材料费入账金额
+                    flag = true;
+                }
+            }
+            if (flag){
+                schedule.setActualIntallProject(String.valueOf(netAmount));
+                actualTotalFee+=netAmount;
+            }
+            flag = false;
+            netAmount = 0.0;
+        }
+        erpCreditChild1s = erpCredit.getErpCreditChild1s();//得到设备费
+        //判断设备费
+        if (null!=erpCreditChild1s&&erpCreditChild1s.size()>0){
+            for (ErpCreditChild1 erpCreditChild1:erpCreditChild1s){
+                if (null!=erpCreditChild1.getEqmBookedFee1()){
+                    netAmount+=erpCreditChild1.getEqmBookedFee1();//得到
+                    flag=true;
+                }
+            }
+            if (flag){
+                schedule.setActualEquipmentValue(String.valueOf(netAmount));
+                actualTotalFee+=netAmount;
+            }
+            flag=false;
+            netAmount=0.0;
+        }
+        //得到其他费用合计
+        if (null!=erpCredit.getOtherTotalFee()){
+            schedule.setActualOtherFee(String.valueOf(erpCredit.getOtherTotalFee()));
+            actualTotalFee+=erpCredit.getOtherTotalFee();
+        }
+        //添加合计金额
+        schedule.setActualTotalFee(String.valueOf(actualTotalFee));
+        return schedule;
+    }
+
+    /**
+     * 其他费用明细表
+     * @param erpCreditList
+     * @return
+     */
+    public static ScheduleOther getScheduleOfOtherExpenses(List<ErpCredit> erpCreditList,List<MaintainData> maintainDataList){
+        ScheduleOther scheduleOther = new ScheduleOther();
+        Double requisitionSite=0.0;//建设场地征用及清理费
+        Double  compensationAcquisition=0.0;//土地征用补偿费
+        Double  cleaningFees=0.0;//余物清理费
+        Double  storageFee=0.0;//集中配送物资保管费
+        Double compensateFee=0.0;//土地征用补偿费(赔青费)
+        Double  managementFee=0.0;//项目建设管理费
+        Double  preWorkingFee=0.0;//项目前期工作费
+        Double  itemManageFee=0.0;//项目管理经费
+        Double  theTenderFee=0.0;//招标费
+        Double  supervisionFee=0.0;//工程监理费
+        Double   technicalFee=0.0;//项目建设技术服务费
+        Double  surveyFee=0.0;//工程勘察费
+        Double  designFee=0.0;//工程设计费
+        Double drawingBudgetFee=0.0;//施工图预算编制费
+        Double  evaluationFee=0.0;//项目后评价费
+        Double  economicFee=0.0;//技术经济标准变值管理费
+        Double  inspectionFee=0.0;//工程建设监督检测费
+        Double  preparationFee=0.0;//生产准备费
+        Double  basicFee=0.0;//基本预备费
+        Double  reserveFee=0.0;//资本化利息
+        Double  totalFee=0.0;//合计
+        if (null!=maintainDataList&&maintainDataList.size()>0){
+            for (MaintainData maintainData:maintainDataList){
+                cleaningFees+=maintainData.getDamages();//清理费
+                preWorkingFee+=maintainData.getPreliminaryWorkFee();//项目前期工作费
+            }
+            scheduleOther.setCleaningFees(String.valueOf(cleaningFees));
+            scheduleOther.setPreWorkingFee(String.valueOf(preparationFee));
+        }
+        if (null!=erpCreditList&&erpCreditList.size()>0){
+            for (ErpCredit erpCredit:erpCreditList){
+                //如果线路施工赔偿费不等于空,土地征用补偿费累加
+                if (null!=erpCredit.getOtherLineDamages()){
+                    compensateFee+=erpCredit.getOtherLineDamages();
+                }
+                //如果法人管理费不为空,则赋值项目管理经费
+                if (null!=erpCredit.getOtherLegalManage()){
+                    itemManageFee=+erpCredit.getOtherLegalManage();
+                }
+                //如果监理费不为空,则赋值为工程监理费
+                if (null!=erpCredit.getOtherSupervisorFee()){
+                    supervisionFee+=erpCredit.getOtherSupervisorFee();
+                }
+                //如果设计费不为空,则赋值为工程设计费
+                if (null!=erpCredit.getOtherDesignFee()){
+                    designFee+=erpCredit.getOtherDesignFee();
+                }
+                //如果=ERP账生成数据中建设期贷款利息不为空,则累计赋值到资本化利息
+                if (null!= erpCredit.getOtherBuildLoan()){
+                    reserveFee+=erpCredit.getOtherBuildLoan();
+                }
+            }
+        }
+        //项目建设技术服务费(暂无)
+        technicalFee=surveyFee+economicFee;
+        //项目建设管理费
+        managementFee=itemManageFee+supervisionFee;
+        //建设场地征用费
+        requisitionSite=compensationAcquisition+compensateFee;
+        //合计
+        totalFee=requisitionSite+managementFee+technicalFee+inspectionFee+preparationFee+basicFee+reserveFee;
+        scheduleOther.setCompensateFee(String.valueOf(compensateFee));//土地征用补偿费
+        scheduleOther.setItemManageFee(String.valueOf(itemManageFee));//项目管理经费
+        scheduleOther.setSupervisionFee(String.valueOf(supervisionFee));//工程监理费
+        scheduleOther.setDesignFee(String.valueOf(designFee));//工程设计费
+        scheduleOther.setReserveFee(String.valueOf(reserveFee));//资本化利息
+        scheduleOther.setTechnicalFee(String.valueOf(technicalFee));//项目设计技术服务费
+        scheduleOther.setManagementFee(String.valueOf(managementFee));//项目建设管理费
+        scheduleOther.setRequisitionSite(String.valueOf(requisitionSite));//建设场地征用费
+        scheduleOther.setTotalFee(String.valueOf(totalFee));//合计
+        return scheduleOther;
+    }
+
+    /**
+     * 设备材料清册
+     * @param erpCredits
+     * @return
+     */
+    public static List<MaterialEquipment> getMaterialEquipment(List<ErpCredit> erpCredits){
+        DecimalFormat decimalFormat   = new DecimalFormat("#0.00");
+        DecimalFormat decimalFormat1 = new DecimalFormat("#0");
+        Double count = 0.0;
+        List<MaterialEquipment> materialEquipments = new ArrayList<MaterialEquipment>();
+        MaterialEquipment materialEquipment = null;
+        List<ErpCreditChild1> erpCreditChild1s = null;
+        List<ErpCreditChild2> erpCreditChild2s = null;
+        for (ErpCredit erpCredit:erpCredits){
+            erpCreditChild1s=erpCredit.getErpCreditChild1s();
+            erpCreditChild2s=erpCredit.getErpCreditChild2s();
+            //设备详情
+            if (null!=erpCreditChild1s&&erpCreditChild1s.size()>0){
+                for (ErpCreditChild1 erpCreditChild1:erpCreditChild1s){
+                    count=0.0;
+                    materialEquipment=new MaterialEquipment();
+                    materialEquipment.setId(erpCredit.getItemId());
+                    //物料描述赋值给名称
+                    materialEquipment.setMeName(erpCreditChild1.getEqmMaterialDetails1());
+                    //如果供应商不为空,赋值供应商
+                    if (null!=erpCreditChild1.getEqmSupplierName()){
+                        materialEquipment.setMeSupplierName(erpCreditChild1.getEqmSupplierName());
+                    }
+                    //得到单位
+                    if (null!=erpCreditChild1.getEqmUnit()){
+                        materialEquipment.setMeUnit(erpCreditChild1.getEqmUnit());
+                    }
+                    //得到数量
+                    if (null!=erpCreditChild1.getEqmNumbers()){
+                        materialEquipment.setMeNumber(decimalFormat1.format(erpCreditChild1.getEqmNumbers()));
+                    }
+                    //得到合计金额
+                    if (null!=erpCreditChild1.getEqmBookedFee1()){
+                        materialEquipment.setMeAllPrice(String.valueOf(erpCreditChild1.getEqmBookedFee1()));
+                        if (null!=materialEquipment.getMeNumber()){
+                            count=erpCreditChild1.getEqmBookedFee1()/Double.parseDouble(materialEquipment.getMeNumber());
+                            materialEquipment.setMeUnitPrice(decimalFormat.format(count));
+                        }else {
+                            materialEquipment.setMeUnitPrice(decimalFormat.format(erpCreditChild1.getEqmBookedFee1()));
+                        }
+                    }else {
+                        materialEquipment.setMeAllPrice("0");
+                    }
+                    materialEquipments.add(materialEquipment);
+                }
+            }
+            //材料详情
+            if (null!=erpCreditChild2s&&erpCreditChild2s.size()>0){
+                for (ErpCreditChild2 erpCreditChild2:erpCreditChild2s){
+                    count=0.0;
+                    //得到材料费项目定义好
+                    materialEquipment.setId(erpCredit.getItemId());
+                    //得到材料费名称
+                    materialEquipment.setMeName(erpCreditChild2.getEqmMaterialDetails2());
+                    //得到供应商
+                    if (null!=erpCreditChild2.getMtlSupplierName()){
+                        materialEquipment.setMeSupplierName(erpCreditChild2.getMtlSupplierName());
+                    }
+                    //得到单位
+                    if (null!=erpCreditChild2.getMtlUnit()){
+                        materialEquipment.setMeUnit(erpCreditChild2.getMtlUnit());
+                    }
+                    //得到数量
+                    if (null!=erpCreditChild2.getMtlNumbers()){
+                        materialEquipment.setMeNumber(decimalFormat1.format(erpCreditChild2.getMtlNumbers()));
+                    }
+                    //得到合计金额
+                    if (null!=erpCreditChild2.getMtlBookedFee2()){
+                        materialEquipment.setMeAllPrice(String.valueOf(erpCreditChild2.getMtlBookedFee2()));
+                        if (null!=materialEquipment.getMeNumber()){
+                            count=erpCreditChild2.getMtlBookedFee2()/Double.parseDouble(materialEquipment.getMeNumber());
+                            materialEquipment.setMeUnitPrice(decimalFormat.format(count));
+                        }else {
+                            materialEquipment.setMeUnitPrice(decimalFormat.format(erpCreditChild2.getMtlBookedFee2()));
+                        }
+                    }else {
+                        materialEquipment.setMeUnit("0");
+                    }
+                    materialEquipments.add(materialEquipment);
+                }
+            }
+        }
+        return materialEquipments;
+    }
+
+    /**
+     * 移交资产—配电网资产一览表(线路)
+     * @return
+     */
+    public static List<TransferOfPower1> getTransFerPower1(List<ErpCredit> erpCredits){
+        DecimalFormat decimalFormat   = new DecimalFormat("#0.00");
+        List<TransferOfPower1> transferOfPower1s = new ArrayList<TransferOfPower1>();
+        TransferOfPower1 transferOfPower1 = null;
+        List<ErpCreditChild1> erpCreditChild1s = null;
+        Double eqmNumbers = 0.0;//获取总数量
+        Double eqmValue = 0.0;//相同项目定义号合计
+        Double standInFee=0.0;//摊入费用
+        Double powerDeliveredAssets=0.0;//交付知产使用价值
+        for (ErpCredit erpCredit:erpCredits){
+            erpCreditChild1s = erpCredit.getErpCreditChild1s();//获取集合
+            if (null!=erpCreditChild1s&&erpCreditChild1s.size()>=0){
+                eqmNumbers = 0.0;
+                for (ErpCreditChild1 erpCreditChild11:erpCreditChild1s){
+                    if (null!=erpCreditChild11.getEqmNumbers()){//当前项目定义号所有的台数合计
+                        eqmNumbers+=erpCreditChild11.getEqmNumbers();
+                    }
+                }
+                if (null!=erpCredit.getConsInstallFee()){//得到分摊后安装费
+                    eqmNumbers=erpCredit.getConsTotalFee()/eqmNumbers;
+                }
+                for (ErpCreditChild1 erpCreditChild1:erpCreditChild1s){
+                    if (null!=erpCredit.getTenKvModel()){//若10KV电缆、架空导线型号为空:得到设备价值
+                        eqmValue = erpCreditChild1.getEqmBookedFee1()+eqmNumbers+eqmValue;//设备H6的和
+                    }
+                }
+            }
+            //添加固定数据:线路
+            transferOfPower1  = new TransferOfPower1();
+            transferOfPower1.setPowerId(erpCredit.getItemId());//添加项目定义号
+            transferOfPower1.setPowerName(erpCredit.getItemName());//添加项目名称
+            transferOfPower1.setPowerDepartment(ExportUtil1.POWER_DEPARTMENT);//添加保管
+            if (null!=erpCredit.getTenKvItsLine()) {//其中 10kv线路 10kv线路长度
+                transferOfPower1.setPowerTenKvLineLength(String.valueOf(erpCredit.getTenKvItsLine()));
+            }
+            if (null!=erpCredit.getTenKvModel()){//10kv电缆架空导线型号
+                transferOfPower1.setPowerTenKvCableType(erpCredit.getTenKvModel());
+                transferOfPower1.setPowerNumberBars("1");
+                transferOfPower1.setPowerAssetClass(POWER_ZYXL);
+            }
+            if (null!=erpCredit.getConsBuildingFee()){//建筑费
+                transferOfPower1.setPowerBuildFee(String.valueOf(erpCredit.getConsBuildingFee()));
+                powerDeliveredAssets+=erpCredit.getConsBuildingFee();
+            }
+            if (null!=erpCredit.getConsInstallFee()){//安装费
+                transferOfPower1.setPowerInstallFee(String.valueOf(erpCredit.getConsInstallFee()));
+                powerDeliveredAssets+=erpCredit.getConsInstallFee();
+            }else {
+                transferOfPower1.setPowerInstallFee("0");
+            }
+            if (transferOfPower1.getPowerInstallFee().equals("0")){//摊入费用
+                transferOfPower1.setPowerInstallFee("0");
+            }else {
+                standInFee = Double.valueOf(transferOfPower1.getPowerInstallFee())/(Double.valueOf(transferOfPower1.getPowerInstallFee())+eqmNumbers);
+                transferOfPower1.setPowerStandInFee(decimalFormat.format(standInFee));
+                powerDeliveredAssets+=standInFee;
+            }
+            //添加交付使用资产价值
+            transferOfPower1.setPowerDeliveredAssets(decimalFormat.format(powerDeliveredAssets));
+            transferOfPower1s.add(transferOfPower1);//添加到集合中
+        }
+        return transferOfPower1s;
+    }
+
+    /**
+     * 移交资产—配电网资产一览表(设备)
+     * @param erpCredits
+     * @return
+     */
+    public static List<TransferOfPower2> getTransferOfPower2(List<ErpCredit> erpCredits){
+        DecimalFormat decimalFormat   = new DecimalFormat("#0.00");
+        DecimalFormat decimalFormat1   = new DecimalFormat("#0");
+        List<TransferOfPower2> transferOfPower2s =  new ArrayList<TransferOfPower2>();
+        List<ErpCreditChild1> erpCreditChild1s = null;
+        TransferOfPower2 transferOfPower2 = null;
+        Double powerValue = 0.0;
+        Double eqmNumbers = 0.0;//获取总数量
+        Double powerInstallFee = 0.0;//安装费用(线路)
+        Double powerStandInFee = 0.0;//摊入费用
+        Double powerDeliveredAssets=0.0;//交付使用资产价值
+        for (ErpCredit erpCredit:erpCredits){
+            erpCreditChild1s = erpCredit.getErpCreditChild1s();//得到集合
+            //得到安装费用
+            if (null!=erpCredit.getConsInstallFee()){//安装费
+                powerInstallFee = erpCredit.getConsInstallFee();
+            }
+            if (null!=erpCreditChild1s && erpCreditChild1s.size()>=0){
+                eqmNumbers = 0.0;
+                for (ErpCreditChild1 erpCreditChild11:erpCreditChild1s){
+                    if (null!=erpCreditChild11.getEqmNumbers()){//当前项目定义号所有的台数合计
+                        eqmNumbers+=erpCreditChild11.getEqmNumbers();
+                    }
+                }
+                if (null!=erpCredit.getConsInstallFee()){//得到分摊后安装费
+                    eqmNumbers=eqmNumbers/erpCredit.getConsTotalFee();
+                }
+                for (ErpCreditChild1 erpCreditChild1:erpCreditChild1s){
+                    powerDeliveredAssets=0.0;
+                    transferOfPower2 = new TransferOfPower2();
+                    transferOfPower2.setPowerId(erpCredit.getItemId());
+                    transferOfPower2.setPowerName(erpCredit.getItemName());//添加名称
+                    transferOfPower2.setPowerDepartment(ExportUtil1.POWER_DEPARTMENT);//添加保管
+                    if (null!=erpCreditChild1.getEqmNumbers()){//得到配变数量
+                        transferOfPower2.setPowerNumber(decimalFormat1.format(erpCreditChild1.getEqmNumbers()));
+                    }
+                    if (null!=erpCreditChild1.getEqmUnit()){//计量单位
+                        transferOfPower2.setPowerUnit(erpCreditChild1.getEqmUnit());
+                    }
+                    //配电容量
+                    transferOfPower2.setPowerCapacity(erpCreditChild1.getEqmMaterialDetails1());
+                    //设备价值
+                    if (null!=erpCreditChild1.getEqmBookedFee1()){
+                        powerValue=erpCreditChild1.getEqmBookedFee1()+eqmNumbers;
+                        transferOfPower2.setPowerValue(decimalFormat.format(powerValue));
+                        powerDeliveredAssets +=powerValue;
+                    }else {
+                        powerValue=erpCreditChild1.getEqmBookedFee1();
+                        transferOfPower2.setPowerValue(decimalFormat.format(powerValue));
+                        powerDeliveredAssets+=powerValue;
+                    }
+                    //计算摊入费用
+                    if (erpCredit.getConsBuildingFee()!=null&&erpCredit.getConsBuildingFee()!=0){
+                        powerStandInFee=Double.parseDouble(transferOfPower2.getPowerValue())/(Double.parseDouble(transferOfPower2.getPowerValue())+powerInstallFee)*erpCredit.getConsBuildingFee();
+                        transferOfPower2.setPowerStandInFee(decimalFormat.format(powerStandInFee));
+                        powerDeliveredAssets+=powerStandInFee;
+                    }else {
+                        transferOfPower2.setPowerStandInFee("0");
+                    }
+                    //添加资产类别
+                    if (erpCreditChild1.getEqmMaterialDetails1().contains(POWER_BDZ)){
+                        transferOfPower2.setPowerAssetClass(POWER_BDZCOUNT);
+                    }
+                    if (erpCreditChild1.getEqmMaterialDetails1().contains(POWER_BOXBDZ)){
+                        transferOfPower2.setPowerAssetClass(POWER_BOXCOUNT);
+                    }
+                    if (erpCreditChild1.getEqmMaterialDetails1().contains(POWER_HGW)){
+                        transferOfPower2.setPowerAssetClass(POWER_HGWCOUNT);
+                    }
+                    if (erpCreditChild1.getEqmMaterialDetails1().contains(POWER_KGG)){
+                        transferOfPower2.setPowerAssetClass(POWER_KGGCOUNT);
+                    }
+                    transferOfPower2.setPowerDeliveredAssets(decimalFormat.format(powerDeliveredAssets));//交付使用资产价值
+                    transferOfPower2s.add(transferOfPower2);
+                }
+            }
+        }
+        return transferOfPower2s;
+    }
+    //概况表
+    public static GeneralSituation getFeneraSituation(List<ErpCredit> erpCredits, List<MaintainData> maintainDataList){
+        GeneralSituation generalSituation = new GeneralSituation();
+        Double lineLength=0.0;//线路长度
+        Double tenKvLength=0.0;//其中:10kv线路
+        Double fourKvLength=0.0;//400v及以下
+        List<String> organDataList = new ArrayList<String>();//预算批准机关、日期、文号
+        List<Date> commencementDateList =new ArrayList<Date>();//开工日期
+        List<Date> completionDateList = new ArrayList<Date>();//竣工日期
+        String organData = "";//文号
+        Double investmentBudget=0.0;//预算投资
+        Double actualInvestment=0.0;//实际投资
+        if (null!=erpCredits&&erpCredits.size()>0){
+            for (ErpCredit erpCredit:erpCredits){
+                //如果线路长度不为空
+                if (null!=erpCredit.getTenKvLineLength()){
+                    lineLength+=erpCredit.getTenKvLineLength();//得到线路长度(线路)
+                }
+                //其中:10kv线路
+                if (null!=erpCredit.getTenKvItsLine()){
+                    tenKvLength+=erpCredit.getTenKvItsLine();
+                }
+                //400kv
+                if (null!=erpCredit.getTenKvItesFhvFollow()){
+                    fourKvLength+=erpCredit.getTenKvItesFhvFollow();
+                }
+                //实际投资
+                if (null!=erpCredit.getActualInvestment()){
+                    actualInvestment+=erpCredit.getActualInvestment();
+                }
+            }
+            generalSituation.setLineLength(String.valueOf(lineLength));
+            generalSituation.setTenKvLength(String.valueOf(tenKvLength));
+            generalSituation.setFourKvLength(String.valueOf(fourKvLength));
+            generalSituation.setActualInvestment(String.valueOf(actualInvestment));
+            generalSituation.setTransferAssets(String.valueOf(actualInvestment));
+            generalSituation.setHasItsOwn(String.valueOf(actualInvestment));
+        }
+        if (null!=maintainDataList&&maintainDataList.size()>0){
+            for (MaintainData maintainData:maintainDataList){
+                if (null!=maintainData.getApprovalNumber()){//如果审批文号不为空
+                    organDataList.add(maintainData.getApprovalNumber());
+                }
+                if (maintainData.getStartDate().toString()!=null&&maintainData.getStartDate().toString().length()>0){
+                    commencementDateList.add(maintainData.getStartDate());
+                }
+                if (null!=maintainData.getEndDate()&&maintainData.getEndDate().toString().length()>0){
+                    completionDateList.add(maintainData.getEndDate());
+                }
+                investmentBudget+=maintainData.getTotalFee();
+            }
+            if (null!=organDataList&&organDataList.size()>0){
+                //去重
+                for (int i = 0; i < organDataList.size(); i++) {
+                    for (int j = 0; j < organDataList.size(); j++) {
+                        if(i!=j&&organDataList.get(i)==organDataList.get(j)) {
+                            organDataList.remove(organDataList.get(j));
+                        }
+                    }
+                }
+                for(String str:organDataList){
+                    organData+=str+",";
+                }
+                generalSituation.setOrganDataNumber(organData);
+            }
+            if (null!=commencementDateList&&commencementDateList.size()>0){
+                generalSituation.setCommencementDate(Collections.min(commencementDateList).toString());
+            }
+            if (null!=completionDateList&&completionDateList.size()>0){
+                generalSituation.setCompletionDate(Collections.max(completionDateList).toString());
+            }
+            generalSituation.setInvestmentBudget(String.valueOf(investmentBudget));
+        }
+        return generalSituation;
+    }
+    //资产总表
+    public static List<TheAssetsTotal> getTheAssetsTotal(List<ErpCredit> erpCredits){
+        DecimalFormat decimalFormat   = new DecimalFormat("#0.00");
+        List<TheAssetsTotal> theAssetsTotals = new ArrayList<TheAssetsTotal>();
+        TheAssetsTotal theAssetsTotal1 = new TheAssetsTotal();
+        TheAssetsTotal theAssetsTotal2 = new TheAssetsTotal();
+        TheAssetsTotal theAssetsTotal3 = new TheAssetsTotal();
+        Double buildProject=0.0;//建筑工程
+        Double intallProject=0.0;//安装工程费
+        Double equipmentValue=0.0;//设备价值
+        Double costSharing=0.0;//分摊费用
+        Double deliveryCostValue=0.0;//交付使用资产价值
+        Double equipmentValue1=0.0;//设备价值
+        Double costSharing1=0.0;//分摊费用
+        Double deliveryCostValue1=0.0;//交付使用资产价值
+        List<TransferOfPower1> transferOfPower1s = getTransFerPower1(erpCredits);
+        List<TransferOfPower2> transferOfPower2s = getTransferOfPower2(erpCredits);
+        for (TransferOfPower1 transferOfPower1:transferOfPower1s){
+            if (null!=transferOfPower1.getPowerBuildFee()){//建筑
+                buildProject+=Double.parseDouble(transferOfPower1.getPowerBuildFee());
+            }
+            if (null!=transferOfPower1.getPowerInstallFee()){
+                intallProject+=Double.parseDouble(transferOfPower1.getPowerInstallFee());
+            }
+            if (null!=transferOfPower1.getPowerStandInFee()){//分摊费用
+                costSharing+=Double.parseDouble(transferOfPower1.getPowerStandInFee());
+            }
+            deliveryCostValue=buildProject+intallProject+costSharing;
+        }
+        theAssetsTotal1.setBuildProject(decimalFormat.format(buildProject));
+        theAssetsTotal1.setIntallProject(decimalFormat.format(intallProject));
+        theAssetsTotal1.setCostSharing(decimalFormat.format(costSharing));
+        theAssetsTotal1.setDeliveryCostValue(decimalFormat.format(deliveryCostValue));
+        for (TransferOfPower2 transferOfPower2:transferOfPower2s){
+            if (null!=transferOfPower2.getPowerValue()){//设备价值
+                equipmentValue1+=Double.parseDouble(transferOfPower2.getPowerValue());
+            }
+            if (null!=transferOfPower2.getPowerStandInFee()){
+                costSharing1+=Double.parseDouble(transferOfPower2.getPowerStandInFee());
+            }
+            deliveryCostValue1=equipmentValue1+costSharing1;
+            theAssetsTotal2.setEquipmentValue(decimalFormat.format(equipmentValue1));
+            theAssetsTotal2.setCostSharing(decimalFormat.format(costSharing1));
+            theAssetsTotal2.setDeliveryCostValue(decimalFormat.format(deliveryCostValue1));
+        }
+        theAssetsTotal3.setBuildProject(decimalFormat.format(buildProject));
+        theAssetsTotal3.setIntallProject(decimalFormat.format(intallProject));
+        theAssetsTotal3.setEquipmentValue(decimalFormat.format(equipmentValue1));
+        theAssetsTotal3.setCostSharing(decimalFormat.format(costSharing+costSharing1));
+        theAssetsTotal3.setDeliveryCostValue(decimalFormat.format(deliveryCostValue+deliveryCostValue1));
+        theAssetsTotals.add(theAssetsTotal3);
+        theAssetsTotals.add(theAssetsTotal1);
+        theAssetsTotals.add(theAssetsTotal2);
+        return theAssetsTotals;
+    }
+}

+ 400 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ExportUtil2.java

@@ -0,0 +1,400 @@
+package com.jeeplus.modules.sg.financial.erpcredit.util;
+
+import com.jeeplus.modules.sg.financial.erpcredit.entity.*;
+import com.jeeplus.modules.sg.financial.settlement.entity.MaintainData;
+import org.apache.poi.hssf.util.HSSFColor;
+import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.xssf.usermodel.XSSFCell;
+import org.apache.poi.xssf.usermodel.XSSFRow;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class ExportUtil2 {
+
+    //一览表
+    public static void getSheet2(Sheet sheet,List<ErpCredit> erpCredits,List<MaintainData> maintainDataList){
+        if (sheet!=null){
+            Schedule schedule = null;
+            XSSFRow row = (XSSFRow) sheet.getRow(0);
+            XSSFCell cell = row.getCell(3);
+            List<Schedule> scheduleList = ExportUtil1.getScheduleList(erpCredits, maintainDataList);
+            for (int i = 1; i <=scheduleList.size(); i++) {
+                schedule = scheduleList.get(i);
+                row=(XSSFRow)sheet.getRow(i+5);
+                cell=row.getCell(0);
+                cell.setCellValue(i);
+                cell=row.getCell(1);
+                cell.setCellValue(schedule.getItemId());
+                cell=row.getCell(2);
+                cell.setCellValue(schedule.getItemName());
+                cell=row.getCell(3);
+                cell.setCellValue(schedule.getBudgetBuildProject());
+                cell=row.getCell(4);
+                cell.setCellValue(schedule.getBudgetInstallProject());
+                cell=row.getCell(5);
+                cell.setCellValue(schedule.getBudgetEquipmentValue());
+                cell=row.getCell(6);
+                cell.setCellValue(schedule.getBudgetOtherFee());
+                cell=row.getCell(7);
+                cell.setCellValue(schedule.getBudgetTotalFee());
+                cell=row.getCell(8);
+                cell.setCellValue(schedule.getActualBuildProject());
+                cell=row.getCell(9);
+                cell.setCellValue(schedule.getActualIntallProject());
+                cell=row.getCell(10);
+                cell.setCellValue(schedule.getActualEquipmentValue());
+                cell=row.getCell(11);
+                cell.setCellValue(schedule.getActualOtherFee());
+                cell=row.getCell(12);
+                cell.setCellValue(schedule.getActualTotalFee());
+                cell=row.getCell(13);
+                cell.setCellValue(schedule.getAddSubtractionLines());
+                cell=row.getCell(14);
+                cell.setCellValue(schedule.getAddSubtractionRate());
+            }
+        }
+
+    }
+    //读取得到其他费用表
+   public static void getSheet3(Sheet sheet,List<ErpCredit> erpCredits,List<MaintainData> maintainDataList){
+       if (null!=sheet){
+           XSSFRow row = (XSSFRow) sheet.getRow(0);
+           XSSFCell cell = row.getCell(3);
+           ScheduleOther scheduleOther = ExportUtil1.getScheduleOfOtherExpenses(erpCredits,maintainDataList);
+           List list = new ArrayList();
+           list.add(scheduleOther.getRequisitionSite());
+           list.add(scheduleOther.getCompensationAcquisition());
+           list.add(scheduleOther.getCleaningFees());
+           list.add(scheduleOther.getStorageFee());
+           list.add(scheduleOther.getCompensateFee());
+           list.add(scheduleOther.getManagementFee());
+           list.add(scheduleOther.getPreparationFee());
+           list.add(scheduleOther.getItemManageFee());
+           list.add(scheduleOther.getTheTenderFee());
+           list.add(scheduleOther.getSupervisionFee());
+           list.add(scheduleOther.getTechnicalFee());
+           list.add(scheduleOther.getSurveyFee());
+           list.add(scheduleOther.getDesignFee());
+           list.add(scheduleOther.getDrawingBudgetFee());
+           list.add(scheduleOther.getEvaluationFee());
+           list.add(scheduleOther.getEconomicFee());
+           list.add(scheduleOther.getInspectionFee());
+           list.add(scheduleOther.getPreparationFee());
+           list.add(scheduleOther.getBasicFee());
+           list.add(scheduleOther.getReserveFee());
+           list.add(scheduleOther.getTotalFee());
+           for (int i = 0; i < list.size(); i++) {
+               row = (XSSFRow) sheet.getRow((int)i+6);
+               cell=row.getCell(3);
+               cell.setCellValue((String)list.get(i));
+           }
+       }
+   }
+   //移交资产—配电网资产一览表(线路)
+   public static void getSheet5(Sheet sheet,List<ErpCredit> erpCredits){
+       if (null!=sheet){
+           XSSFRow row = (XSSFRow) sheet.getRow(0);
+           XSSFCell cell = row.getCell(0);
+           TransferOfPower1 transferOfPower1 = null;
+           List<TransferOfPower1> transferOfPower1s = ExportUtil1.getTransFerPower1(erpCredits);
+           for (int i = 0; i < transferOfPower1s.size(); i++) {
+               transferOfPower1=transferOfPower1s.get(i);
+               row = (XSSFRow) sheet.getRow((int)i+5);
+               cell=row.getCell(0);
+               cell.setCellValue(transferOfPower1.getPowerId());
+               cell=row.getCell(1);
+               cell.setCellValue(transferOfPower1.getPowerName());
+               cell=row.getCell(2);
+               cell.setCellValue(transferOfPower1.getPowerArea());
+               cell=row.getCell(3);
+               cell.setCellValue(transferOfPower1.getPowerDepartment());
+               cell=row.getCell(4);
+               cell.setCellValue(transferOfPower1.getPowerTenKvLineLength());
+               cell=row.getCell(5);
+               cell.setCellValue(transferOfPower1.getPowerTenKvCableType());
+               cell=row.getCell(6);
+               cell.setCellValue(transferOfPower1.getPowerBuildFee());
+               cell=row.getCell(7);
+               cell.setCellValue(transferOfPower1.getPowerInstallFee());
+               cell=row.getCell(8);
+               cell.setCellValue(transferOfPower1.getPowerStandInFee());
+               cell=row.getCell(9);
+               cell.setCellValue(transferOfPower1.getPowerDeliveredAssets());
+               cell=row.getCell(10);
+               cell.setCellValue(transferOfPower1.getPoweRequipmentFee());
+           }
+       }
+   }
+   //移交资产—配电网资产一览表(设备)
+   public static void getSheet6(Sheet sheet,List<ErpCredit> erpCredits){
+      if (sheet!=null){
+          XSSFRow row = (XSSFRow) sheet.getRow(0);
+          XSSFCell cell = row.getCell(0);
+          TransferOfPower2 transferOfPower2 = null;
+          List<TransferOfPower2> transferOfPower2s = ExportUtil1.getTransferOfPower2(erpCredits);
+          for (int i = 0; i < transferOfPower2s.size(); i++) {
+              transferOfPower2=transferOfPower2s.get(i);
+              row = (XSSFRow) sheet.getRow((int)i+5);
+              cell=row.getCell(0);
+              cell.setCellValue(transferOfPower2.getPowerId());//项目定义编号
+              cell=row.getCell(1);
+              cell.setCellValue(transferOfPower2.getPowerName());//配电网资产名称
+              cell=row.getCell(2);
+              cell.setCellValue(transferOfPower2.getPowerArea());////线路起止地点或配变所在滴
+              cell=row.getCell(3);
+              cell.setCellValue(transferOfPower2.getPowerDepartment());//保管部门
+              cell=row.getCell(4);
+              cell.setCellValue(transferOfPower2.getPowerNumber());//配变数量
+              cell=row.getCell(5);
+              cell.setCellValue(transferOfPower2.getPowerUnit());//计量单位
+              cell=row.getCell(6);
+              cell.setCellValue(transferOfPower2.getPowerCapacity());//配变容量
+              cell=row.getCell(7);
+              cell.setCellValue(transferOfPower2.getPowerValue());//设备价值
+              cell=row.getCell(8);
+              cell.setCellValue(transferOfPower2.getPowerStandInFee());//摊入费用
+              cell=row.getCell(9);
+              cell.setCellValue(transferOfPower2.getPowerDeliveredAssets());//交付使用资产价值
+              cell=row.getCell(10);
+              cell.setCellValue(transferOfPower2.getPoweRequipmentFee());//其中:附属设备价值
+          }
+      }
+   }
+   //设备材料清册
+    public static void getSheet7(Sheet sheet,List<ErpCredit> erpCredits){
+        XSSFRow row = (XSSFRow) sheet.getRow(0);
+        XSSFCell cell = row.getCell(0);
+        MaterialEquipment materialEquipment = null;
+        if (null!=sheet){
+            List<MaterialEquipment> materialEquipments = ExportUtil1.getMaterialEquipment(erpCredits);
+            for (int i = 0; i < materialEquipments.size(); i++) {
+                materialEquipment = materialEquipments.get(i);
+                row = (XSSFRow) sheet.getRow((int)i+5);
+                cell=row.getCell(0);
+                cell.setCellValue(materialEquipment.getId());//项目定义编号
+                cell=row.getCell(1);
+                cell.setCellValue(materialEquipment.getMeName());
+                cell=row.getCell(2);
+                cell.setCellValue(materialEquipment.getMeSpecifications());
+                cell=row.getCell(3);
+                cell.setCellValue(materialEquipment.getMeSupplierName());//供应单位制造
+                cell=row.getCell(4);
+                cell.setCellValue(materialEquipment.getMeUnit());////计量单位
+                cell=row.getCell(5);
+                cell.setCellValue(materialEquipment.getMeNumber());////数量
+                cell=row.getCell(6);
+                cell.setCellValue(materialEquipment.getMeUnitPrice());////单价
+                cell=row.getCell(7);
+                cell.setCellValue(materialEquipment.getMeAllPrice());////合计
+            }
+        }
+    }
+
+    //移交资产—配电网资产一览表(线路)1
+    public static void getSheet10(Sheet sheet,List<ErpCredit> erpCredits){
+        if (null!=sheet){
+            XSSFRow row = (XSSFRow) sheet.getRow(0);
+            XSSFCell cell = row.getCell(0);
+            TransferOfPower1 transferOfPower1 = null;
+            List<TransferOfPower1> transferOfPower1s = ExportUtil1.getTransFerPower1(erpCredits);
+            for (int i = 0; i < transferOfPower1s.size(); i++) {
+                transferOfPower1=transferOfPower1s.get(i);
+                row = (XSSFRow) sheet.getRow((int)i+5);
+                cell=row.getCell(0);
+                cell.setCellValue(transferOfPower1.getPowerId());
+                cell=row.getCell(1);
+                cell.setCellValue(transferOfPower1.getPowerName());
+                cell=row.getCell(2);
+                cell.setCellValue(transferOfPower1.getPowerNumberBars());
+                cell=row.getCell(3);
+                cell.setCellValue(transferOfPower1.getPowerAssetClass());
+                cell=row.getCell(4);
+                cell.setCellValue(transferOfPower1.getPowerArea());
+                cell=row.getCell(5);
+                cell.setCellValue(transferOfPower1.getPowerDepartment());
+                cell=row.getCell(6);
+                cell.setCellValue(transferOfPower1.getPowerTenKvLineLength());
+                cell=row.getCell(7);
+                cell.setCellValue(transferOfPower1.getPowerTenKvCableType());
+                cell=row.getCell(8);
+                cell.setCellValue(transferOfPower1.getPowerBuildFee());
+                cell=row.getCell(9);
+                cell.setCellValue(transferOfPower1.getPowerInstallFee());
+                cell=row.getCell(10);
+                cell.setCellValue(transferOfPower1.getPowerStandInFee());
+                cell=row.getCell(11);
+                cell.setCellValue(transferOfPower1.getPowerDeliveredAssets());
+                cell=row.getCell(12);
+                cell.setCellValue(transferOfPower1.getPoweRequipmentFee());
+            }
+        }
+    }
+    //移交资产—配电网资产一览表(设备)2
+    public static void getSheet11(Sheet sheet,List<ErpCredit> erpCredits){
+        if (sheet!=null){
+            XSSFRow row = (XSSFRow) sheet.getRow(0);
+            XSSFCell cell = row.getCell(0);
+            TransferOfPower2 transferOfPower2 = null;
+            List<TransferOfPower2> transferOfPower2s = ExportUtil1.getTransferOfPower2(erpCredits);
+            for (TransferOfPower2 transferOfPower21:transferOfPower2s){
+                System.out.println(transferOfPower21);
+            }
+            for (int i = 0; i < transferOfPower2s.size(); i++) {
+                transferOfPower2=transferOfPower2s.get(i);
+                row = (XSSFRow) sheet.getRow((int)i+5);
+                cell=row.getCell(0);
+                cell.setCellValue(transferOfPower2.getPowerId());//项目定义编号
+                cell=row.getCell(1);
+                cell.setCellValue(transferOfPower2.getPowerName());//配电网资产名称
+                cell=row.getCell(2);
+                cell.setCellValue(transferOfPower2.getPowerAssetClass());
+                cell=row.getCell(3);
+                cell.setCellValue(transferOfPower2.getPowerArea());////线路起止地点或配变所在滴
+                cell=row.getCell(4);
+                cell.setCellValue(transferOfPower2.getPowerDepartment());//保管部门
+                cell=row.getCell(5);
+                cell.setCellValue(transferOfPower2.getPowerNumber());//配变数量
+                cell=row.getCell(6);
+                cell.setCellValue(transferOfPower2.getPowerUnit());//计量单位
+                cell=row.getCell(7);
+                cell.setCellValue(transferOfPower2.getPowerCapacity());//配变容量
+                cell=row.getCell(8);
+                cell.setCellValue(transferOfPower2.getPowerValue());//设备价值
+                cell=row.getCell(9);
+                cell.setCellValue(transferOfPower2.getPowerStandInFee());//摊入费用
+                cell=row.getCell(10);
+                cell.setCellValue(transferOfPower2.getPowerDeliveredAssets());//交付使用资产价值
+                cell=row.getCell(11);
+                cell.setCellValue(transferOfPower2.getPoweRequipmentFee());//其中:附属设备价值
+            }
+        }
+    }
+
+    //概述表
+    public static void getSheet1(Sheet sheet, List<ErpCredit> erpCredits, List<MaintainData> maintainDataList){
+       if (sheet!=null){
+           GeneralSituation generalSituation = ExportUtil1.getFeneraSituation(erpCredits,maintainDataList);
+           XSSFRow row = (XSSFRow) sheet.getRow(6);
+           XSSFCell cell = row.getCell(6);
+           cell.setCellValue(generalSituation.getOrganDataNumber());//日期,批文号
+
+           row = (XSSFRow)sheet.getRow(9);
+           cell = row.getCell(2);
+           cell.setCellValue(generalSituation.getLineLength());
+           cell = row.getCell(7);
+           cell.setCellValue(generalSituation.getCommencementDate());
+
+           row = (XSSFRow)sheet.getRow(10);
+           cell = row.getCell(2);
+           cell.setCellValue(generalSituation.getTenKvLength());
+           cell = row.getCell(7);
+           cell.setCellValue(generalSituation.getCompletionDate());
+
+           row = (XSSFRow)sheet.getRow(11);
+           cell=row.getCell(2);
+           cell.setCellValue(generalSituation.getFourKvLength());
+
+           row = (XSSFRow)sheet.getRow(12);
+           cell=row.getCell(7);
+           cell.setCellValue(generalSituation.getInvestmentBudget());
+
+           row = (XSSFRow)sheet.getRow(13);
+           cell=row.getCell(7);
+           cell.setCellValue(generalSituation.getActualInvestment());//实际投资
+
+           row = (XSSFRow)sheet.getRow(14);
+           cell=row.getCell(7);
+           cell.setCellValue(generalSituation.getTransferAssets());
+
+           row = (XSSFRow)sheet.getRow(16);
+           cell=row.getCell(7);
+           cell.setCellValue(generalSituation.getHasItsOwn());
+       }
+    }
+    //资产总表
+    public static void getSheet4(Sheet sheet,List<ErpCredit> erpCredits){
+       if (sheet!=null){
+           XSSFRow row = (XSSFRow) sheet.getRow(0);
+           XSSFCell cell = row.getCell(0);
+           TheAssetsTotal theAssetsTotal = null;
+           List<TheAssetsTotal> theAssetsTotals = ExportUtil1.getTheAssetsTotal(erpCredits);
+           for (int i = 0; i < theAssetsTotals.size(); i++) {
+               theAssetsTotal = theAssetsTotals.get(i);
+               row = (XSSFRow) sheet.getRow((int)i+6);
+               cell = row.getCell(2);
+               cell.setCellValue(theAssetsTotal.getBuildProject());
+               cell=row.getCell(3);
+               cell.setCellValue(theAssetsTotal.getIntallProject());
+               cell=row.getCell(4);
+               cell.setCellValue(theAssetsTotal.getEquipmentValue());
+               cell=row.getCell(5);
+               cell.setCellValue(theAssetsTotal.getCostSharing());
+               cell=row.getCell(6);
+               cell.setCellValue(theAssetsTotal.getDeliveryCostValue());
+           }
+       }
+    }
+    private static Map<String, CellStyle> createStyles(Workbook wb) {
+        Map<String, CellStyle> styles = new HashMap<String, CellStyle>();
+
+        CellStyle style = wb.createCellStyle();
+        style.setAlignment(CellStyle.ALIGN_CENTER);
+        style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
+        Font titleFont = wb.createFont();
+        titleFont.setFontName("Arial");
+        titleFont.setFontHeightInPoints((short) 16);
+        titleFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
+        style.setFont(titleFont);
+        styles.put("title", style);
+
+        style = wb.createCellStyle();
+        style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
+        style.setBorderRight(CellStyle.BORDER_THIN);
+        style.setRightBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
+        style.setBorderLeft(CellStyle.BORDER_THIN);
+        style.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
+        style.setBorderTop(CellStyle.BORDER_THIN);
+        style.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
+        style.setBorderBottom(CellStyle.BORDER_THIN);
+        style.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
+        Font dataFont = wb.createFont();
+        dataFont.setFontName("Arial");
+        dataFont.setFontHeightInPoints((short) 10);
+        style.setFont(dataFont);
+        styles.put("data", style);
+
+        style = wb.createCellStyle();
+        style.cloneStyleFrom(styles.get("data"));
+        style.setAlignment(CellStyle.ALIGN_LEFT);
+        styles.put("data1", style);
+
+        style = wb.createCellStyle();
+        style.cloneStyleFrom(styles.get("data"));
+        style.setAlignment(CellStyle.ALIGN_CENTER);
+        styles.put("data2", style);
+
+        style = wb.createCellStyle();
+        style.cloneStyleFrom(styles.get("data"));
+        style.setAlignment(CellStyle.ALIGN_RIGHT);
+        styles.put("data3", style);
+
+        style = wb.createCellStyle();
+        style.cloneStyleFrom(styles.get("data"));
+//		style.setWrapText(true);
+        style.setAlignment(CellStyle.ALIGN_CENTER);
+        style.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex());
+        style.setFillPattern(CellStyle.SOLID_FOREGROUND);
+        Font headerFont = wb.createFont();
+        headerFont.setFontName("Arial");
+        headerFont.setFontHeightInPoints((short) 10);
+        headerFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
+        headerFont.setColor(IndexedColors.BLACK.getIndex());
+        style.setFont(headerFont);
+        style.setFillForegroundColor(HSSFColor.WHITE.index);
+        styles.put("header", style);
+
+        return styles;
+    }
+}

+ 391 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ImportUtil.java

@@ -0,0 +1,391 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.financial.erpcredit.util;
+
+import com.google.common.collect.Lists;
+import com.jeeplus.common.utils.Reflections;
+import com.jeeplus.common.utils.excel.annotation.ExcelField;
+import com.jeeplus.modules.sys.entity.Area;
+import com.jeeplus.modules.sys.entity.Office;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.utils.DictUtils;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.hssf.usermodel.HSSFDateUtil;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.text.NumberFormat;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * 导入Excel文件(支持“XLS”和“XLSX”格式)
+ * @author jeeplus
+ * @version 2016-03-10
+ */
+public class ImportUtil {
+
+	private static Logger log = LoggerFactory.getLogger(ImportUtil.class);
+
+	/**
+	 * 工作薄对象
+	 */
+	private Workbook wb;
+
+	/**
+	 * 工作表对象
+	 */
+	private Sheet sheet;
+
+	/**
+	 * 标题行号
+	 */
+	private int headerNum;
+
+	/**
+	 * 构造函数
+	 * @param path 导入文件,读取第一个工作表
+	 * @param headerNum 标题行号,数据行号=标题行号+1
+	 * @throws InvalidFormatException
+	 * @throws IOException
+	 */
+	public ImportUtil(String fileName, int headerNum)
+			throws InvalidFormatException, IOException {
+		this(new File(fileName), headerNum);
+	}
+
+	/**
+	 * 构造函数
+	 * @param path 导入文件对象,读取第一个工作表
+	 * @param headerNum 标题行号,数据行号=标题行号+1
+	 * @throws InvalidFormatException
+	 * @throws IOException
+	 */
+	public ImportUtil(File file, int headerNum)
+			throws InvalidFormatException, IOException {
+		this(file, headerNum, 0);
+	}
+
+	/**
+	 * 构造函数
+	 * @param path 导入文件
+	 * @param headerNum 标题行号,数据行号=标题行号+1
+	 * @param sheetIndex 工作表编号
+	 * @throws InvalidFormatException
+	 * @throws IOException
+	 */
+	public ImportUtil(String fileName, int headerNum, int sheetIndex)
+			throws InvalidFormatException, IOException {
+		this(new File(fileName), headerNum, sheetIndex);
+	}
+
+	/**
+	 * 构造函数
+	 * @param path 导入文件对象
+	 * @param headerNum 标题行号,数据行号=标题行号+1
+	 * @param sheetIndex 工作表编号
+	 * @throws InvalidFormatException
+	 * @throws IOException
+	 */
+	public ImportUtil(File file, int headerNum, int sheetIndex)
+			throws InvalidFormatException, IOException {
+		this(file.getName(), new FileInputStream(file), headerNum, sheetIndex);
+	}
+
+	/**
+	 * 构造函数
+	 * @param file 导入文件对象
+	 * @param headerNum 标题行号,数据行号=标题行号+1
+	 * @param sheetIndex 工作表编号
+	 * @throws InvalidFormatException
+	 * @throws IOException
+	 */
+	public ImportUtil(MultipartFile multipartFile, int headerNum, int sheetIndex)
+			throws InvalidFormatException, IOException {
+		this(multipartFile.getOriginalFilename(), multipartFile.getInputStream(), headerNum, sheetIndex);
+	}
+
+	/**
+	 * 构造函数
+	 * @param path 导入文件对象
+	 * @param headerNum 标题行号,数据行号=标题行号+1
+	 * @param sheetIndex 工作表编号
+	 * @throws InvalidFormatException
+	 * @throws IOException
+	 */
+	public ImportUtil(String fileName, InputStream is, int headerNum, int sheetIndex)
+			throws InvalidFormatException, IOException {
+		if (StringUtils.isBlank(fileName)){
+			throw new RuntimeException("导入文档为空!");
+		}else if(fileName.toLowerCase().endsWith("xls")){    
+			this.wb = new HSSFWorkbook(is);    
+        }else if(fileName.toLowerCase().endsWith("xlsx")){  
+        	this.wb = new XSSFWorkbook(is);
+        }else{  
+        	throw new RuntimeException("文档格式不正确!");
+        }  
+		if (this.wb.getNumberOfSheets()<sheetIndex){
+			throw new RuntimeException("文档中没有工作表!");
+		}
+		this.sheet = this.wb.getSheetAt(sheetIndex);
+		this.headerNum = headerNum;
+		log.debug("Initialize success.");
+	}
+	
+	/**
+	 * 获取行对象
+	 * @param rownum
+	 * @return
+	 */
+	public Row getRow(int rownum){
+		return this.sheet.getRow(rownum);
+	}
+
+	/**
+	 * 获取数据行号
+	 * @return
+	 */
+	public int getDataRowNum(){
+		return headerNum+1;
+	}
+	
+	/**
+	 * 获取最后一个数据行号
+	 * @return
+	 */
+	public int getLastDataRowNum(){
+		return this.sheet.getLastRowNum()+headerNum;
+	}
+	
+	/**
+	 * 获取最后一个列号
+	 * @return
+	 */
+	public int getLastCellNum(){
+		return this.getRow(headerNum).getLastCellNum();
+	}
+	
+	/**
+	 * 获取单元格值
+	 * @param row 获取的行
+	 * @param column 获取单元格列号
+	 * @return 单元格值
+	 */
+	public Object getCellValue(Row row, int column) {
+		Object val = "";
+		try {
+			Cell cell = row.getCell(column);
+			if (cell != null) {
+				if (cell.getCellType() == Cell.CELL_TYPE_NUMERIC) {
+					// val = cell.getNumericCellValue();
+					// 当excel 中的数据为数值或日期是需要特殊处理
+					if (HSSFDateUtil.isCellDateFormatted(cell)) {
+						double d = cell.getNumericCellValue();
+						Date date = HSSFDateUtil.getJavaDate(d);
+						SimpleDateFormat dformat = new SimpleDateFormat(
+								"yyyy-MM-dd");
+						val = dformat.format(date);
+					} else {
+						NumberFormat nf = NumberFormat.getInstance();
+						nf.setGroupingUsed(false);// true时的格式:1,234,567,890
+						val = nf.format(cell.getNumericCellValue());// 数值类型的数据为double,所以需要转换一下
+					}
+				} else if (cell.getCellType() == Cell.CELL_TYPE_STRING) {
+					val = cell.getStringCellValue();
+				} else if (cell.getCellType() == Cell.CELL_TYPE_FORMULA) {
+					val = cell.getCellFormula();
+				} else if (cell.getCellType() == Cell.CELL_TYPE_BOOLEAN) {
+					val = cell.getBooleanCellValue();
+				} else if (cell.getCellType() == Cell.CELL_TYPE_ERROR) {
+					val = cell.getErrorCellValue();
+				}
+			}
+		} catch (Exception e) {
+			return val;
+		}
+		return val;
+	}
+	
+	/**
+	 * 获取导入数据列表
+	 * @param cls 导入对象类型
+	 * @param groups 导入分组
+	 */
+	public <E> List<E> getDataList(Class<E> cls, int... groups) throws InstantiationException, IllegalAccessException{
+		List<Object[]> annotationList = Lists.newArrayList();
+		// Get annotation field 
+		Field[] fs = cls.getDeclaredFields();
+		for (Field f : fs){
+			ExcelField ef = f.getAnnotation(ExcelField.class);
+			if (ef != null && (ef.type()==0 || ef.type()==2)){
+				if (groups!=null && groups.length>0){
+					boolean inGroup = false;
+					for (int g : groups){
+						if (inGroup){
+							break;
+						}
+						for (int efg : ef.groups()){
+							if (g == efg){
+								inGroup = true;
+								annotationList.add(new Object[]{ef, f});
+								break;
+							}
+						}
+					}
+				}else{
+					annotationList.add(new Object[]{ef, f});
+				}
+			}
+		}
+		// Get annotation method
+		Method[] ms = cls.getDeclaredMethods();
+		for (Method m : ms){
+			ExcelField ef = m.getAnnotation(ExcelField.class);
+			if (ef != null && (ef.type()==0 || ef.type()==2)){
+				if (groups!=null && groups.length>0){
+					boolean inGroup = false;
+					for (int g : groups){
+						if (inGroup){
+							break;
+						}
+						for (int efg : ef.groups()){
+							if (g == efg){
+								inGroup = true;
+								annotationList.add(new Object[]{ef, m});
+								break;
+							}
+						}
+					}
+				}else{
+					annotationList.add(new Object[]{ef, m});
+				}
+			}
+		}
+		// Field sorting
+		Collections.sort(annotationList, new Comparator<Object[]>() {
+			public int compare(Object[] o1, Object[] o2) {
+				return new Integer(((ExcelField)o1[0]).sort()).compareTo(
+						new Integer(((ExcelField)o2[0]).sort()));
+			};
+		});
+		//log.debug("Import column count:"+annotationList.size());
+		// Get excel data
+		List<E> dataList = Lists.newArrayList();
+		for (int i = this.getDataRowNum(); i < this.getLastDataRowNum(); i++) {
+			E e = (E)cls.newInstance();
+			int column = 0;
+			Row row = this.getRow(i);
+			StringBuilder sb = new StringBuilder();
+			for (Object[] os : annotationList){
+				Object val = this.getCellValue(row, column++);
+				if (val != null){
+					ExcelField ef = (ExcelField)os[0];
+					// If is dict type, get dict value
+					if (StringUtils.isNotBlank(ef.dictType())){
+						val = DictUtils.getDictValue(val.toString(), ef.dictType(), "");
+						//log.debug("Dictionary type value: ["+i+","+colunm+"] " + val);
+					}
+					// Get param type and type cast
+					Class<?> valType = Class.class;
+					if (os[1] instanceof Field){
+						valType = ((Field)os[1]).getType();
+					}else if (os[1] instanceof Method){
+						Method method = ((Method)os[1]);
+						if ("get".equals(method.getName().substring(0, 3))){
+							valType = method.getReturnType();
+						}else if("set".equals(method.getName().substring(0, 3))){
+							valType = ((Method)os[1]).getParameterTypes()[0];
+						}
+					}
+					//log.debug("Import value type: ["+i+","+column+"] " + valType);
+					try {
+						//如果导入的java对象,需要在这里自己进行变换。
+						if (valType == String.class){
+							String s = String.valueOf(val.toString());
+							if(StringUtils.endsWith(s, ".0")){
+								val = StringUtils.substringBefore(s, ".0");
+							}else{
+								val = String.valueOf(val.toString());
+							}
+						}else if (valType == Integer.class){
+							val = Double.valueOf(val.toString()).intValue();
+						}else if (valType == Long.class){
+							val = Double.valueOf(val.toString()).longValue();
+						}else if (valType == Double.class){
+							val = Double.valueOf(val.toString());
+						}else if (valType == Float.class){
+							val = Float.valueOf(val.toString());
+						}else if (valType == Date.class){
+							SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
+							val=sdf.parse(val.toString()); 
+						}else if (valType == User.class){
+							val = UserUtils.getByUserName(val.toString());
+						}else if (valType == Office.class){
+							val = UserUtils.getByOfficeName(val.toString());
+						}else if (valType == Area.class){
+							val = UserUtils.getByAreaName(val.toString());
+						}else{
+							if (ef.fieldType() != Class.class){
+								val = ef.fieldType().getMethod("getValue", String.class).invoke(null, val.toString());
+							}else{
+								val = Class.forName(this.getClass().getName().replaceAll(this.getClass().getSimpleName(), 
+										"fieldtype."+valType.getSimpleName()+"Type")).getMethod("getValue", String.class).invoke(null, val.toString());
+							}
+						}
+					} catch (Exception ex) {
+						log.info("Get cell value ["+i+","+column+"] error: " + ex.toString());
+						val = null;
+					}
+					// set entity value
+					if (os[1] instanceof Field){
+						Reflections.invokeSetter(e, ((Field)os[1]).getName(), val);
+					}else if (os[1] instanceof Method){
+						String mthodName = ((Method)os[1]).getName();
+						if ("get".equals(mthodName.substring(0, 3))){
+							mthodName = "set"+StringUtils.substringAfter(mthodName, "get");
+						}
+						Reflections.invokeMethod(e, mthodName, new Class[] {valType}, new Object[] {val});
+					}
+				}
+				sb.append(val+", ");
+			}
+			dataList.add(e);
+			log.debug("Read success: ["+i+"] "+sb.toString());
+		}
+		return dataList;
+	}
+
+//	/**
+//	 * 导入测试
+//	 */
+//	public static void main(String[] args) throws Throwable {
+//		
+//		ImportExcel ei = new ImportExcel("target/export.xlsx", 1);
+//		
+//		for (int i = ei.getDataRowNum(); i < ei.getLastDataRowNum(); i++) {
+//			Row row = ei.getRow(i);
+//			for (int j = 0; j < ei.getLastCellNum(); j++) {
+//				Object val = ei.getCellValue(row, j);
+//				System.out.print(val+", ");
+//			}
+//			System.out.print("\n");
+//		}
+//		
+//	}
+}

+ 159 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/Test.java

@@ -0,0 +1,159 @@
+package com.jeeplus.modules.sg.financial.erpcredit.util;
+
+import com.jeeplus.modules.sg.financial.erpcredit.entity.ErpCredit;
+import com.jeeplus.modules.sg.financial.erpcredit.entity.ScheduleOther;
+import org.apache.poi.xssf.usermodel.XSSFCell;
+import org.apache.poi.xssf.usermodel.XSSFRow;
+import org.apache.poi.xssf.usermodel.XSSFSheet;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.*;
+import java.net.URLEncoder;
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class Test {
+    public void getTest() {
+        String content = "10kV箱式变电站,400kva,美式,硅钢片,普通,无环网柜,600kVA";
+        String str[] = content.split(",");
+        for (int i = 0; i < str.length; i++) {
+//                System.out.println(str[i]);
+            if (str[i].toLowerCase().contains("kva")) {
+                System.out.println(str[i].substring(0, str[i].toLowerCase().indexOf("kva")));
+                break;
+            }
+        }
+    }
+
+    public void getTest1() {
+        String str = "架空绝缘导线,AC10kV,JKLYJ,150";
+        String[] split = str.split(",");
+        System.out.println(split[split.length - 1]);
+    }
+
+    @org.junit.Test
+    public void getExcel(){
+            // 读取模板,并赋值到新文件
+            // 文件模板路径
+        ExportTemplate exportTemplate = new ExportTemplate();
+        String path = (exportTemplate.getSispPath() + "excelmodel/");
+        File file = new File(path);
+        // 保存文件的路径
+        String realPath = (exportTemplate.getSispPath() + "newexcelmodel");
+        // 新的文件名
+        String newFileName = "竣工决算" + System.currentTimeMillis() + ".xlsx";
+        System.out.println(newFileName);
+        // 判断路径是否存在
+        File createNewFile = new File(realPath);
+        if (!createNewFile.exists()) {
+            createNewFile.mkdirs();
+            System.out.println("创建了");
+        }
+        // 写入到新的excel
+        File newFile = new File(realPath, newFileName);
+        try {
+            newFile.createNewFile();
+            System.out.println();
+            // 复制模板到新文件
+            exportTemplate.fileChannelCopy(file, newFile);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+    }
+    @org.junit.Test
+    public void getPath(){
+        String sispPath = this.getClass().getResource("/").getPath()+ "freemarker/excelmodel/daochu.xlsx";
+        System.out.println(sispPath);
+    }
+    @org.junit.Test
+    public void exportExcel() {
+        ExportTemplate exportTemplate = new ExportTemplate();
+        File newFile = exportTemplate.createNewFile();
+        // 新文件写入数据,并下载
+        InputStream inputStream = null;
+        XSSFWorkbook workbook = null;
+        XSSFSheet sheet = null;
+        try {
+            inputStream = new FileInputStream(newFile);// 将excel文件转为输入流
+            workbook = new XSSFWorkbook(inputStream);// 创建个workbook,
+            // 获取第一个sheet
+            sheet = workbook.getSheetAt(3);
+        } catch (Exception e1) {
+            e1.printStackTrace();
+        }
+
+        if (sheet != null) {
+            try {
+                // 写数据
+                FileOutputStream fos = new FileOutputStream(newFile);
+                XSSFRow row = sheet.getRow(0);
+                XSSFCell cell = row.getCell(3);
+                for (int i = 0; i < 10; i++) {
+                    row =sheet.getRow((int)i+6);
+                    cell=row.getCell(3);
+                    cell.setCellValue(i);
+                }
+                workbook.write(fos);
+                fos.flush();
+                fos.close();
+                // 定义一个list集合假数据
+//                List<Map<String, Object>> lst = new ArrayList();
+//                Map<String, Object> map1 = new HashMap<String, Object>();
+//                for (int i = 0; i < 42; i++) {
+//                    map1.put("id" + i, i);
+//                    lst.add(map1);
+//                }
+//                for (int m = 0; m < lst.size(); m++) {
+//                    Map<String, Object> map = lst.get(m);
+//                    row = sheet.createRow((int) m + 3);
+//                    for (int i = 0; i < 42; i++) {
+//                        String value = map.get("id" + m) + "";
+//                        if (value.equals("null")) {
+//                            value = "0";
+//                        }
+//                        cell = row.createCell(i);
+//                        cell.setCellValue(value);
+//                    }
+//                }
+//                // 下载
+//                InputStream fis = new BufferedInputStream(new FileInputStream(
+//                        newFile));
+////                HttpServletResponse response = ServletActionContext.getResponse();
+//                HttpServletResponse response = null;
+//                byte[] buffer = new byte[fis.available()];
+//                fis.read(buffer);
+//                fis.close();
+//                response.reset();
+//                response.setContentType("text/html;charset=UTF-8");
+//                OutputStream toClient = new BufferedOutputStream(
+//                        response.getOutputStream());
+//                response.setContentType("application/x-msdownload");
+//                String newName = URLEncoder.encode(
+//                        "违法案件报表" + System.currentTimeMillis() + ".xlsx",
+//                        "UTF-8");
+//                response.addHeader("Content-Disposition",
+//                        "attachment;filename=\"" + newName + "\"");
+//                response.addHeader("Content-Length", "" + newFile.length());
+//                toClient.write(buffer);
+//                toClient.flush();
+            } catch (Exception e) {
+                e.printStackTrace();
+            } finally {
+                try {
+                    if (null != inputStream) {
+                        inputStream.close();
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        // 删除创建的新文件
+        // this.deleteFile(newFile);
+    }
+}

+ 210 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/web/ErpCreditController.java

@@ -0,0 +1,210 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.financial.erpcredit.web;
+
+import com.jeeplus.common.json.AjaxJson;
+import com.jeeplus.common.utils.DateUtils;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.utils.excel.ExportExcel;
+import com.jeeplus.core.persistence.Page;
+import com.jeeplus.core.web.BaseController;
+import com.jeeplus.modules.sg.financial.erpcredit.entity.*;
+import com.jeeplus.modules.sg.financial.erpcredit.service.ErpCreditService;
+import com.jeeplus.modules.sg.financial.erpcredit.util.ErpInfo;
+import com.jeeplus.modules.sg.financial.erpcredit.util.ExportTemplate;
+import com.jeeplus.modules.sg.financial.erpcredit.util.ExportUtil2;
+import com.jeeplus.modules.sg.financial.erpcredit.util.ImportUtil;
+import com.jeeplus.modules.sg.financial.settlement.entity.MaintainData;
+import com.jeeplus.modules.sg.financial.settlement.service.DataMaintenanceService;
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
+import org.apache.poi.xssf.usermodel.XSSFCell;
+import org.apache.poi.xssf.usermodel.XSSFRow;
+import org.apache.poi.xssf.usermodel.XSSFSheet;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.ConstraintViolationException;
+import java.io.*;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 数据维护
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/sg/financial/erpCredit")
+public class ErpCreditController extends BaseController {
+
+	@Autowired
+	private ErpCreditService erpCreditService;
+
+
+	@ModelAttribute
+	public ErpCredit get(@RequestParam(required=false) String id) {
+		ErpCredit entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = erpCreditService.get(id);
+		}
+		if (entity == null){
+			entity = new ErpCredit();
+		}
+		return entity;
+	}
+	/**
+	 * 表单列表页面
+	 */
+//	@RequiresPermissions("sg:financial:erpCredit:list")
+	@RequestMapping(value = {"list", ""})
+	public String list(ErpCredit erpCredit, Model model) {
+//		model.addAttribute("leave1", erpCredit);
+		model.addAttribute("erpCredit", erpCredit);
+		return "modules/sg/financial/erp/erpCreditList";
+	}
+
+	/**
+	 * 表单列表数据
+	 */
+	@ResponseBody
+//	@RequiresPermissions("sg:financial:erpCredit:list")
+	@RequestMapping(value = "data")
+	public Map<String, Object> data(ErpCredit erpCredit, HttpServletRequest request, HttpServletResponse response, Model model) {
+		Page<ErpCredit> page = erpCreditService.findPage(new Page<ErpCredit>(request, response), erpCredit);
+		return getBootstrapData(page);
+	}
+
+	/**
+	 * 查看,增加,编辑表单表单页面
+	 */
+//	@RequiresPermissions(value={"sg:financial:erpCredit:view","sg:financial:erpCredit:add","sg:financial:erpCredit:edit"},logical=Logical.OR)
+	@RequestMapping(value = "form")
+	public String form(ErpCredit erpCredit, Model model) {
+		model.addAttribute("erpCredit", erpCredit);
+		return "modules/sg/financial/erp/erpCreditForm";
+	}
+
+	/**
+	 * 保存表单
+	 */
+	@ResponseBody
+//	@RequiresPermissions(value={"sg:financial:erpCredit:add","sg:financial:erpcredit:edit"},logical=Logical.OR)
+	@RequestMapping(value = "save")
+	public AjaxJson save(ErpCredit erpCredit, Model model) throws Exception{
+		AjaxJson j = new AjaxJson();
+		/**
+		 * 后台hibernate-validation插件校验
+		 */
+		String errMsg = beanValidator(erpCredit);
+		if (StringUtils.isNotBlank(errMsg)){
+			j.setSuccess(false);
+			j.setMsg(errMsg);
+			return j;
+		}
+		//新增或编辑表单保存
+		erpCreditService.save(erpCredit);//保存
+		j.setSuccess(true);
+		j.setMsg("保存表单成功");
+		return j;
+	}
+
+	/**
+	 * 删除表单
+	 */
+	@ResponseBody
+//	@RequiresPermissions("sg:financial:erpCredit:del")
+	@RequestMapping(value = "delete")
+	public AjaxJson delete(ErpCredit erpCredit) {
+		AjaxJson j = new AjaxJson();
+		erpCreditService.delete(erpCredit);
+		j.setMsg("删除表单成功");
+		return j;
+	}
+
+	/**
+	 * 批量表单
+	 */
+	@ResponseBody
+//	@RequiresPermissions("sg:financial:erpCredit:del")
+	@RequestMapping(value = "deleteAll")
+	public AjaxJson deleteAll(String ids) {
+		AjaxJson j = new AjaxJson();
+		String idArray[] =ids.split(",");
+		for(String id : idArray){
+			erpCreditService.delete(erpCreditService.get(id));
+		}
+		j.setMsg("删除表单成功");
+		return j;
+	}
+
+	/**
+	 * 导出excel文件
+	 */
+	@ResponseBody
+//	@RequiresPermissions("sg:financial:erpCredit:export")
+	@RequestMapping(value = "export")
+	public AjaxJson exportFile(String ids, HttpServletRequest request, HttpServletResponse response){
+		AjaxJson j = new AjaxJson();
+		String idArray[] =ids.split(",");
+		try {
+			erpCreditService.getExport(idArray,response);
+			j.setSuccess(true);
+			j.setMsg("导出成功!");
+		}catch (Exception e){
+			j.setSuccess(false);
+			j.setMsg("导出失败!失败信息:"+e.getMessage());
+		}
+		return j;
+	}
+	@ResponseBody
+	@RequestMapping(value = "detail")
+	public ErpCredit detail(String id) {
+		return erpCreditService.get(id);
+	}
+	/**
+	 * 导入Excel数据
+	 */
+	@ResponseBody
+//	@RequiresPermissions("sg:financial:erpCredit:import")
+	@RequestMapping(value = "import")
+	public AjaxJson importFile(@RequestParam("file")MultipartFile file, HttpServletResponse response, HttpServletRequest request){
+		AjaxJson j = new AjaxJson();
+		try {
+			int successNum = 0;
+			int failureNum = 0;
+			StringBuilder failureMsg = new StringBuilder();
+			ImportUtil importUtil = new ImportUtil(file, 0, 0);
+			List<ErpAccount> erpAccounts = ErpInfo.getErpAccount(importUtil);//获取表格数据
+			List<ErpCredit> erpCredits = ErpInfo.getAllErpCreditList(erpAccounts);//获取单条数据
+			for (ErpCredit erpCredit : erpCredits){
+				System.out.println(erpCredit);
+				try{
+					erpCreditService.save(erpCredit);
+					successNum++;
+				}catch(ConstraintViolationException ex){
+					failureNum++;
+				}catch (Exception ex) {
+					failureNum++;
+				}
+			}
+			if (failureNum>0){
+				failureMsg.insert(0, ",失败 "+failureNum+" 条ERP账户记录。");
+			}
+			j.setMsg( "已成功导入 "+successNum+" 条ERP账户记录"+failureMsg);
+		} catch (Exception e) {
+			j.setSuccess(false);
+			j.setMsg("导入ERP失败!失败信息:"+e.getMessage());
+		}
+		return j;
+	}
+}

+ 73 - 0
src/main/java/com/jeeplus/modules/sg/financial/settlement/entity/MaintainData.java

@@ -4,10 +4,16 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import com.jeeplus.common.utils.excel.annotation.ExcelField;
 import com.jeeplus.core.persistence.DataEntity;
 
+import java.util.Arrays;
 import java.util.Date;
 
 public class MaintainData extends DataEntity<MaintainData> {
     private String projectId;     //项目定义号
+    private String designUnits;    //设计单位
+    private String constructionUnits;    //施工单位
+    private String address;    //建筑地址
+    private String property;    //建筑属性
+    private String investment;    //发文总投资
     private Date startDate;      //开工时间
     private Date endDate;        //竣工时间
     private String approvalNumber;     //审批文号
@@ -51,6 +57,46 @@ public class MaintainData extends DataEntity<MaintainData> {
         this.projectId = projectId;
     }
 
+    public String getDesignUnits() {
+        return designUnits;
+    }
+
+    public void setDesignUnits(String designUnits) {
+        this.designUnits = designUnits;
+    }
+
+    public String getConstructionUnits() {
+        return constructionUnits;
+    }
+
+    public void setConstructionUnits(String constructionUnits) {
+        this.constructionUnits = constructionUnits;
+    }
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public String getProperty() {
+        return property;
+    }
+
+    public void setProperty(String property) {
+        this.property = property;
+    }
+
+    public String getInvestment() {
+        return investment;
+    }
+
+    public void setInvestment(String investment) {
+        this.investment = investment;
+    }
+
     @ExcelField(title="开工时间", align=2, sort=2)
     @JsonFormat(pattern = "yyyy-MM-dd")
     public Date getStartDate() {
@@ -171,4 +217,31 @@ public class MaintainData extends DataEntity<MaintainData> {
     public void setTotalFee(Double totalFee) {
         this.totalFee = totalFee;
     }
+
+    @Override
+    public String toString() {
+        return "MaintainData{" +
+                "projectId='" + projectId + '\'' +
+                ", designUnits='" + designUnits + '\'' +
+                ", constructionUnits='" + constructionUnits + '\'' +
+                ", address='" + address + '\'' +
+                ", property='" + property + '\'' +
+                ", investment='" + investment + '\'' +
+                ", startDate=" + startDate +
+                ", endDate=" + endDate +
+                ", approvalNumber='" + approvalNumber + '\'' +
+                ", buildingFee=" + buildingFee +
+                ", installFee=" + installFee +
+                ", equipmentFee=" + equipmentFee +
+                ", materialFee=" + materialFee +
+                ", designFee=" + designFee +
+                ", supervisionFee=" + supervisionFee +
+                ", preliminaryWorkFee=" + preliminaryWorkFee +
+                ", damages=" + damages +
+                ", managementFee=" + managementFee +
+                ", totalFee=" + totalFee +
+                ", state='" + state + '\'' +
+                ", projectIds=" + Arrays.toString(projectIds) +
+                '}';
+    }
 }

+ 2 - 0
src/main/java/com/jeeplus/modules/sg/financial/settlement/mapper/DataMaintenanceMapper.java

@@ -14,4 +14,6 @@ import java.util.List;
 @MyBatisMapper
 public interface DataMaintenanceMapper extends BaseMapper<MaintainData> {
 	int insertList(@Param("list") List<MaintainData> list);
+	void deleteData(String projectId);
+	List<MaintainData> getFindListMain(String[] ids);
 }

+ 56 - 12
src/main/java/com/jeeplus/modules/sg/financial/settlement/mapper/xml/DataMaintenanceMapper.xml

@@ -3,7 +3,6 @@
 <mapper namespace="com.jeeplus.modules.sg.financial.settlement.mapper.DataMaintenanceMapper">
     
 	<sql id="infoColumns">
-		a.id AS "id",
 		a.create_by AS "createBy.id",
 		a.create_date AS "createDate",
 		a.update_by AS "updateBy.id",
@@ -11,6 +10,11 @@
 		a.remarks AS "remarks",
 		a.del_flag AS "delFlag",
 		a.project_id AS "projectId",
+		a.design_units AS "designUnits",
+		a.construction_units AS "constructionUnits",
+		a.address,
+		a.property,
+		a.investment,
 		a.start_date AS "startDate",
 		a.end_date AS "endDate",
 		a.approval_number AS "approvalNumber",
@@ -31,7 +35,7 @@
 		SELECT 
 			<include refid="infoColumns"/>
 		FROM js_maintain_data a
-		WHERE a.id = #{id}
+		WHERE a.project_id = #{id}
 	</select>
 	
 	<select id="findList" resultType="MaintainData" >
@@ -78,7 +82,7 @@
 	
 	<insert id="insert">
 		INSERT INTO js_maintain_data(
-			id,
+
 			create_by,
 			create_date,
 			update_by,
@@ -86,6 +90,11 @@
 			remarks,
 			del_flag,
 			project_id,
+			design_units,
+		    construction_units,
+		    address,
+		    property,
+		    investment,
 			start_date,
 			end_date,
 			approval_number,
@@ -100,7 +109,7 @@
 			management_fee,
 			total_fee
 		) VALUES (
-			#{id},
+
 			#{createBy.id},
 			#{createDate},
 			#{updateBy.id},
@@ -108,6 +117,11 @@
 			#{remarks},
 			#{delFlag},
 			#{projectId},
+			#{designUnits},
+			#{constructionUnits},
+			#{address},
+			#{property},
+			#{investment},
 			#{startDate},
 			#{endDate},
 			#{approvalNumber},
@@ -126,7 +140,6 @@
 
     <insert id="insertList">
         replace INTO js_maintain_data(
-			id,
 			create_by,
 			create_date,
 			update_by,
@@ -134,6 +147,11 @@
 			remarks,
 			del_flag,
 			project_id,
+		    design_units,
+		    construction_units,
+		    address,
+		    property,
+		    investment,
 			start_date,
 			end_date,
 			approval_number,
@@ -150,7 +168,7 @@
 		) VALUES
         <foreach collection="list" item="item" index="index" separator="," >
 		(
-			#{item.id},
+
 			#{item.createBy.id},
 			#{item.createDate},
 			#{item.updateBy.id},
@@ -158,6 +176,11 @@
 			#{item.remarks},
 			#{item.delFlag},
 			#{item.projectId},
+			#{item.designUnits},
+			#{item.constructionUnits},
+			#{item.address},
+			#{item.property},
+			#{item.investment},
 			#{item.startDate},
 			#{item.endDate},
 			#{item.approvalNumber},
@@ -179,9 +202,12 @@
 		UPDATE js_maintain_data SET
 			update_by = #{updateBy.id},
 			update_date = #{updateDate},
-			remarks = #{remarks},
+			design_units = #{designUnits},
+			construction_units = #{constructionUnits},
+			address = #{address},
+			property = #{property},
+			investment = #{investment},
 			start_date = #{startDate},
-			project_id = #{projectId},
 			end_date = #{endDate},
 			approval_number = #{approvalNumber},
 			building_fee = #{buildingFee},
@@ -194,21 +220,26 @@
 			damages = #{damages},
 			management_fee = #{managementFee},
 			total_fee = #{totalFee}
-		WHERE id = #{id}
+		WHERE project_id = #{id}
 	</update>
 	
 	
 	<!--物理删除-->
 	<update id="delete">
 		DELETE FROM js_maintain_data
-		WHERE id = #{id}
+		WHERE project_id = #{id}
+	</update>
+
+	<update id="deleteData">
+		DELETE FROM js_maintain_data
+		WHERE project_id = #{projectId}
 	</update>
 	
 	<!--逻辑删除-->
 	<update id="deleteByLogic">
 		UPDATE js_maintain_data SET
 			del_flag = #{DEL_FLAG_DELETE}
-		WHERE id = #{id}
+		WHERE project_id = #{id}
 	</update>
 	
 	
@@ -216,5 +247,18 @@
 	<select id="findUniqueByProperty" resultType="TestNote" statementType="STATEMENT">
 		select * FROM js_maintain_data  where ${propertyName} = '${value}'
 	</select>
-	
+
+	<select id="getFindListMain" parameterType="java.util.List" resultType="maintainData">
+		select
+		<include refid="infoColumns"/>
+		FROM js_maintain_data a
+		WHERE a.del_flag = '0'
+		and a.project_id in
+		<if test="array !=null and array.length > 0">
+			<foreach collection="array" index="index" item="item" open="("
+					 separator="," close=")">
+				#{item}
+			</foreach>
+		</if>
+	</select>
 </mapper>

+ 5 - 0
src/main/java/com/jeeplus/modules/sg/financial/settlement/service/DataMaintenanceService.java

@@ -56,6 +56,11 @@ public class DataMaintenanceService extends CrudService<DataMaintenanceMapper, M
 		super.delete(maintainData);
 	}
 
+	@Transactional(readOnly = false)
+    public void deleteData(String projectId){
+        dataMaintenanceMapper.deleteData(projectId);
+    }
+
 
 	public void export(MaintainData maintainData , HttpServletResponse response){
 		Workbook workbook = null;

+ 129 - 37
src/main/java/com/jeeplus/modules/sg/financial/settlement/util/ExcelWriter.java

@@ -1,6 +1,7 @@
 package com.jeeplus.modules.sg.financial.settlement.util;
 
 
+import com.jeeplus.common.utils.DateUtils;
 import com.jeeplus.modules.sg.financial.settlement.entity.MaintainData;
 import org.apache.poi.hssf.util.HSSFColor;
 import org.apache.poi.ss.usermodel.*;
@@ -60,12 +61,17 @@ public class ExcelWriter {
         sheet.addMergedRegion(new CellRangeAddress(2, 0, 1, 1));
         sheet.addMergedRegion(new CellRangeAddress(2, 0, 2, 2));
         sheet.addMergedRegion(new CellRangeAddress(2, 0, 3, 3));
-        sheet.addMergedRegion(new CellRangeAddress(0, 0, 4, 13));
-        sheet.addMergedRegion(new CellRangeAddress(2, 1, 4, 4));
-        sheet.addMergedRegion(new CellRangeAddress(2, 1, 5, 5));
-        sheet.addMergedRegion(new CellRangeAddress(2, 1, 6, 6));
-        sheet.addMergedRegion(new CellRangeAddress(2, 1, 7, 7));
-        sheet.addMergedRegion(new CellRangeAddress(1, 1, 8, 13));
+        sheet.addMergedRegion(new CellRangeAddress(2, 0, 4, 4));
+        sheet.addMergedRegion(new CellRangeAddress(2, 0, 5, 5));
+        sheet.addMergedRegion(new CellRangeAddress(2, 0, 6, 6));
+        sheet.addMergedRegion(new CellRangeAddress(2, 0, 7, 7));
+        sheet.addMergedRegion(new CellRangeAddress(2, 0, 8, 8));
+        sheet.addMergedRegion(new CellRangeAddress(0, 0, 9, 18));
+        sheet.addMergedRegion(new CellRangeAddress(2, 1, 9, 9));
+        sheet.addMergedRegion(new CellRangeAddress(2, 1, 10, 10));
+        sheet.addMergedRegion(new CellRangeAddress(2, 1, 11, 11));
+        sheet.addMergedRegion(new CellRangeAddress(2, 1, 12, 12));
+        sheet.addMergedRegion(new CellRangeAddress(1, 1, 13, 18));
         // 构建头单元格样式
         styles = createStyles(sheet.getWorkbook());
         CellStyle cellStyle = buildHeadCellStyle(sheet.getWorkbook());
@@ -79,13 +85,28 @@ public class ExcelWriter {
         Cell cell1 = row1.createCell(0);
         cell1.setCellValue("项目定义编码");
         cell1.setCellStyle(styles.get("header"));
-        Cell cell2 = row1.createCell(1);
+        Cell cella1 = row1.createCell(1);
+        cella1.setCellValue("设计单位");
+        cella1.setCellStyle(styles.get("header"));
+        Cell cellb1 = row1.createCell(2);
+        cellb1.setCellValue("施工单位");
+        cellb1.setCellStyle(styles.get("header"));
+        Cell cellc1 = row1.createCell(3);
+        cellc1.setCellValue("建筑地址");
+        cellc1.setCellStyle(styles.get("header"));
+        Cell celld1 = row1.createCell(4);
+        celld1.setCellValue("建筑属性");
+        celld1.setCellStyle(styles.get("header"));
+        Cell celle1 = row1.createCell(5);
+        celle1.setCellValue("发文总投资");
+        celle1.setCellStyle(styles.get("header"));
+        Cell cell2 = row1.createCell(6);
         cell2.setCellValue("开工时间");
         cell2.setCellStyle(styles.get("header"));
-        Cell cell3 = row1.createCell(2);
+        Cell cell3 = row1.createCell(7);
         cell3.setCellValue("竣工时间");
         cell3.setCellStyle(styles.get("header"));
-        Cell cell4 = row1.createCell(3);
+        Cell cell4 = row1.createCell(8);
         cell4.setCellValue("批准文号");
         cell4.setCellStyle(styles.get("header"));
 
@@ -93,90 +114,120 @@ public class ExcelWriter {
         Cell cella = row2.createCell(0);
         cella.setCellValue("");
         cella.setCellStyle(styles.get("header"));
-        Cell cellb = row2.createCell(1);
+        Cell cella2 = row2.createCell(1);
+        cella2.setCellValue("");
+        cella2.setCellStyle(styles.get("header"));
+        Cell cella3 = row2.createCell(2);
+        cella3.setCellValue("");
+        cella3.setCellStyle(styles.get("header"));
+        Cell cella4 = row2.createCell(3);
+        cella4.setCellValue("");
+        cella4.setCellStyle(styles.get("header"));
+        Cell cella5 = row2.createCell(4);
+        cella5.setCellValue("");
+        cella5.setCellStyle(styles.get("header"));
+        Cell cella6 = row2.createCell(5);
+        cella6.setCellValue("");
+        cella6.setCellStyle(styles.get("header"));
+        Cell cellb = row2.createCell(6);
         cellb.setCellValue("");
         cellb.setCellStyle(styles.get("header"));
-        Cell cellc = row2.createCell(2);
+        Cell cellc = row2.createCell(7);
         cellc.setCellValue("");
         cellc.setCellStyle(styles.get("header"));
-        Cell celld = row2.createCell(3);
+        Cell celld = row2.createCell(8);
         celld.setCellValue("");
         celld.setCellStyle(styles.get("header"));
 
-        Cell cellm = row2.createCell(9);
+        Cell cellm = row2.createCell(14);
         cellm.setCellValue("");
         cellm.setCellStyle(styles.get("header"));
-        Cell celln = row2.createCell(10);
+        Cell celln = row2.createCell(15);
         celln.setCellValue("");
         celln.setCellStyle(styles.get("header"));
-        Cell cello = row2.createCell(11);
+        Cell cello = row2.createCell(16);
         cello.setCellValue("");
         cello.setCellStyle(styles.get("header"));
-        Cell cellp = row2.createCell(12);
+        Cell cellp = row2.createCell(17);
         cellp.setCellValue("");
         cellp.setCellStyle(styles.get("header"));
-        Cell cellq = row2.createCell(13);
+        Cell cellq = row2.createCell(18);
         cellq.setCellValue("");
         cellq.setCellStyle(styles.get("header"));
 
         Cell celle = row3.createCell(0);
         celle.setCellValue("");
         celle.setCellStyle(styles.get("header"));
-        Cell cellf = row3.createCell(1);
+        Cell celle6 = row3.createCell(1);
+        celle6.setCellValue("");
+        celle6.setCellStyle(styles.get("header"));
+        Cell celle2 = row3.createCell(2);
+        celle2.setCellValue("");
+        celle2.setCellStyle(styles.get("header"));
+        Cell celle3 = row3.createCell(3);
+        celle3.setCellValue("");
+        celle3.setCellStyle(styles.get("header"));
+        Cell celle4 = row3.createCell(4);
+        celle4.setCellValue("");
+        celle4.setCellStyle(styles.get("header"));
+        Cell celle5 = row3.createCell(5);
+        celle5.setCellValue("");
+        celle5.setCellStyle(styles.get("header"));
+        Cell cellf = row3.createCell(6);
         cellf.setCellValue("");
         cellf.setCellStyle(styles.get("header"));
-        Cell cellg = row3.createCell(2);
+        Cell cellg = row3.createCell(7);
         cellg.setCellValue("");
         cellg.setCellStyle(styles.get("header"));
-        Cell cellh = row3.createCell(3);
+        Cell cellh = row3.createCell(8);
         cellh.setCellValue("");
         cellh.setCellStyle(styles.get("header"));
 
-        Cell cell5 = row1.createCell(4);
+        Cell cell5 = row1.createCell(9);
         cell5.setCellValue("概算数");
         cell5.setCellStyle(styles.get("header"));
-        Cell cell6 = row2.createCell(4);
+        Cell cell6 = row2.createCell(9);
         cell6.setCellValue("建筑费");
         cell6.setCellStyle(styles.get("header"));
-        Cell cell7 = row2.createCell(5);
+        Cell cell7 = row2.createCell(10);
         cell7.setCellValue("安装费");
         cell7.setCellStyle(styles.get("header"));
-        Cell cell8 = row2.createCell(6);
+        Cell cell8 = row2.createCell(11);
         cell8.setCellValue("设备购置费");
         cell8.setCellStyle(styles.get("header"));
 
-        Cell cellj = row3.createCell(4);
+        Cell cellj = row3.createCell(9);
         cellj.setCellValue("");
         cellj.setCellStyle(styles.get("header"));
-        Cell cellk = row3.createCell(5);
+        Cell cellk = row3.createCell(10);
         cellk.setCellValue("");
         cellk.setCellStyle(styles.get("header"));
-        Cell celll = row3.createCell(6);
+        Cell celll = row3.createCell(11);
         celll.setCellValue("");
         celll.setCellStyle(styles.get("header"));
 
-        Cell cell9 = row2.createCell(7);
+        Cell cell9 = row2.createCell(12);
         cell9.setCellValue("主材费");
         cell9.setCellStyle(styles.get("header"));
-        Cell cell10 = row2.createCell(8);
+        Cell cell10 = row2.createCell(13);
         cell10.setCellValue("其他费用");
         cell10.setCellStyle(styles.get("header"));
-        Cell cell11 = row3.createCell(8);
+        Cell cell11 = row3.createCell(13);
         cell11.setCellValue("设计费");
         cell11.setCellStyle(styles.get("header"));
-        Cell cell12 = row3.createCell(9);
+        Cell cell12 = row3.createCell(14);
         cell12.setCellValue("监理费");
         cell12.setCellStyle(styles.get("header"));
-        Cell cell13 = row3.createCell(10);
+        Cell cell13 = row3.createCell(15);
         cell13.setCellValue("项目前期工作费");
         cell13.setCellStyle(styles.get("header"));
-        Cell cell14 = row3.createCell(11);
+        Cell cell14 = row3.createCell(16);
         cell14.setCellValue("线路施工赔偿费");
         cell14.setCellStyle(styles.get("header"));
-        Cell cell15 = row3.createCell(12);
+        Cell cell15 = row3.createCell(17);
         cell15.setCellValue("法人管理费(余物清理费)");
         cell15.setCellStyle(styles.get("header"));
-        Cell cell16 = row3.createCell(13);
+        Cell cell16 = row3.createCell(18);
         cell16.setCellValue("合计");
         cell16.setCellStyle(styles.get("header"));
         return sheet;
@@ -206,6 +257,11 @@ public class ExcelWriter {
         return style;
     }
 
+    /**
+     * 设置导出表格样式
+     * @param wb
+     * @return
+     */
     private static Map<String, CellStyle> createStyles(Workbook wb) {
         Map<String, CellStyle> styles = new HashMap<String, CellStyle>();
 
@@ -285,15 +341,51 @@ public class ExcelWriter {
         }
         cell = row.createCell(cellNum++);
         cell.setCellStyle(styles.get("data"));
+        if (null != maintainData.getDesignUnits()) {
+            cell.setCellValue(maintainData.getDesignUnits());
+        } else {
+            cell.setCellValue("");
+        }
+        cell = row.createCell(cellNum++);
+        cell.setCellStyle(styles.get("data"));
+        if (null != maintainData.getConstructionUnits()) {
+            cell.setCellValue(maintainData.getConstructionUnits());
+        } else {
+            cell.setCellValue("");
+        }
+        cell = row.createCell(cellNum++);
+        cell.setCellStyle(styles.get("data"));
+        if (null != maintainData.getAddress()) {
+            cell.setCellValue(maintainData.getAddress());
+        } else {
+            cell.setCellValue("");
+        }
+        cell = row.createCell(cellNum++);
+        cell.setCellStyle(styles.get("data"));
+        if (null != maintainData.getProperty()) {
+            cell.setCellValue(maintainData.getProperty());
+        } else {
+            cell.setCellValue("");
+        }
+        cell = row.createCell(cellNum++);
+        cell.setCellStyle(styles.get("data"));
+        if (null != maintainData.getInvestment()) {
+            cell.setCellValue(maintainData.getInvestment());
+        } else {
+            cell.setCellValue("");
+        }
+        cell = row.createCell(cellNum++);
+        cell.setCellStyle(styles.get("data"));
         if (null != maintainData.getStartDate()) {
-            cell.setCellValue(maintainData.getStartDate());
+            cell.setCellValue(DateUtils.formatDate(maintainData.getStartDate()));
+
         } else {
             cell.setCellValue("");
         }
         cell = row.createCell(cellNum++);
         cell.setCellStyle(styles.get("data"));
         if (null != maintainData.getEndDate()) {
-            cell.setCellValue(maintainData.getEndDate());
+            cell.setCellValue(DateUtils.formatDate(maintainData.getEndDate()));
         } else {
             cell.setCellValue("");
         }

+ 43 - 36
src/main/java/com/jeeplus/modules/sg/financial/settlement/web/DataMaintenanceController.java

@@ -64,9 +64,10 @@ public class DataMaintenanceController extends BaseController {
 	@RequestMapping(value = {"list", ""})
 	public String list(MaintainData maintainData, Model model) {
 		model.addAttribute("maintainData", maintainData);
-		return "modules/sg/settlement/dataMaintenanceList";
+		return "modules/sg/financial/settlement/dataMaintenanceList";
 	}
-	
+
+
 		/**
 	 * 列表数据
 	 */
@@ -76,22 +77,18 @@ public class DataMaintenanceController extends BaseController {
 	public Map<String, Object> data(MaintainData maintainData, HttpServletRequest request, HttpServletResponse response, Model model,HttpSession session) {
 		String id = UserUtils.getUser().getId();
 		String state = maintainData.getState();
-		StringBuilder stringBuilder = new StringBuilder();
+		String st = "";
 		if(state.equals("0")) {
-			String st = (String) session.getAttribute(id);
-			if (StringUtils.isNotBlank(st)) {
-				stringBuilder.append(st);
-			}
+			st = (String) session.getAttribute(id);
 		}else {
 			session.removeAttribute(id);
 		}
 		String projectId = maintainData.getProjectId();
 		if(StringUtils.isNotBlank(projectId)){
-			stringBuilder.append(projectId);
+			st = projectId;
 		}
-		String newstr = stringBuilder.toString();
-		if(StringUtils.isNotBlank(newstr)){
-			String[] sts = newstr.split("\\s+");
+		if(StringUtils.isNotBlank(st)){
+			String[] sts = st.split("\\s+");
 			maintainData.setProjectIds(sts);
 		}
 		Page<MaintainData> page = dataMaintenanceService.findPage(new Page<MaintainData>(request, response), maintainData);
@@ -103,8 +100,8 @@ public class DataMaintenanceController extends BaseController {
 	@ResponseBody
 	@RequiresPermissions("sg:settlement:import")
 	@RequestMapping(value = "importsel")
-	public Map<String, Object> importSelect(@RequestParam("file")MultipartFile file, MaintainData maintainData, HttpServletResponse response, HttpServletRequest request, HttpSession session) throws IOException, InvalidFormatException {
-//		try {
+	public Map<String, Object> importSelect(@RequestParam("file")MultipartFile file, MaintainData maintainData, HttpServletResponse response, HttpServletRequest request, HttpSession session){
+		try {
 			ImportExcel importExcel = new ImportExcel(file, 1, 0);
 			int lastRow = importExcel.getLastDataRowNum();
 			StringBuilder stringBuilder = new StringBuilder();
@@ -117,16 +114,16 @@ public class DataMaintenanceController extends BaseController {
 			}
 			String st = stringBuilder.toString();
 			String sts = st.substring(0,st.length()-1);
+			//把id作为key,把查询条件存入session
 			String id = UserUtils.getUser().getId();
 			session.setAttribute(id,st);
 			String[] strs = st.split(" ");
 			maintainData.setProjectIds(strs);
 			Page<MaintainData> page = dataMaintenanceService.findPage(new Page<MaintainData>(request, response), maintainData);
 			return getBootstrapData(page);
-//			return "redirect:/a/sg/settlement/data";
-//		}catch (Exception e){
-//			return  null;
-//		}
+		}catch (Exception e){
+			return  null;
+		}
 	}
 	/**
 	 * 查看,增加,编辑表单页面
@@ -135,7 +132,7 @@ public class DataMaintenanceController extends BaseController {
 	@RequestMapping(value = "form")
 	public String form(MaintainData maintainData, Model model) {
 		model.addAttribute("maintainData", maintainData);
-		return "modules/sg/settlement/dataMaintenanceForm";
+		return "modules/sg/financial/settlement/dataMaintenanceForm";
 	}
 
 	/**
@@ -174,7 +171,6 @@ public class DataMaintenanceController extends BaseController {
 		j.setMsg("删除成功");
 		return j;
 	}
-	
 	/**
 	 * 批量删除
 	 */
@@ -185,12 +181,11 @@ public class DataMaintenanceController extends BaseController {
 		AjaxJson j = new AjaxJson();
 		String idArray[] =ids.split(",");
 		for(String id : idArray){
-			dataMaintenanceService.delete(dataMaintenanceService.get(id));
+			dataMaintenanceService.deleteData(id);
 		}
 		j.setMsg("删除成功");
 		return j;
 	}
-	
 	/**
 	 * 导出excel文件
 	 */
@@ -257,7 +252,9 @@ public class DataMaintenanceController extends BaseController {
 		return j;
     }
 
-
+	/**
+	 *excel文件数据读取
+	 */
 	private List<MaintainData> getData(ImportExcel importExcel) throws ParseException {
 		int lastRow = importExcel.getLastDataRowNum();
 		List<MaintainData> list = new ArrayList<>();
@@ -268,25 +265,33 @@ public class DataMaintenanceController extends BaseController {
 			String projectId = (String) importExcel.getCellValue(row,0);
 			if(StringUtils.isNotBlank(projectId)) {
 				maintainData.setProjectId(projectId);
-			    maintainData.setStartDate(getDate(importExcel,row,1));
-			    maintainData.setEndDate(getDate(importExcel,row,2));
-				maintainData.setApprovalNumber((String) importExcel.getCellValue(row, 3));
-				maintainData.setBuildingFee(getDouble(importExcel,row,4));
-				maintainData.setInstallFee(getDouble(importExcel,row,5));
-				maintainData.setEquipmentFee(getDouble(importExcel,row,6));
-				maintainData.setMaterialFee(getDouble(importExcel,row,7));
-				maintainData.setDesignFee(getDouble(importExcel,row,8));
-				maintainData.setSupervisionFee(getDouble(importExcel,row,9));
-				maintainData.setPreliminaryWorkFee(getDouble(importExcel,row,10));
-				maintainData.setDamages(getDouble(importExcel,row,11));
-				maintainData.setManagementFee(getDouble(importExcel,row,12));
-				maintainData.setTotalFee(getDouble(importExcel,row,13));
+				maintainData.setDesignUnits((String) importExcel.getCellValue(row, 1));
+				maintainData.setConstructionUnits((String) importExcel.getCellValue(row, 2));
+				maintainData.setAddress((String) importExcel.getCellValue(row, 3));
+				maintainData.setProperty((String) importExcel.getCellValue(row, 4));
+				maintainData.setInvestment((String) importExcel.getCellValue(row, 5));
+			    maintainData.setStartDate(getDate(importExcel,row,6));
+			    maintainData.setEndDate(getDate(importExcel,row,7));
+				maintainData.setApprovalNumber((String) importExcel.getCellValue(row, 8));
+				maintainData.setBuildingFee(getDouble(importExcel,row,9));
+				maintainData.setInstallFee(getDouble(importExcel,row,10));
+				maintainData.setEquipmentFee(getDouble(importExcel,row,11));
+				maintainData.setMaterialFee(getDouble(importExcel,row,12));
+				maintainData.setDesignFee(getDouble(importExcel,row,13));
+				maintainData.setSupervisionFee(getDouble(importExcel,row,14));
+				maintainData.setPreliminaryWorkFee(getDouble(importExcel,row,15));
+				maintainData.setDamages(getDouble(importExcel,row,16));
+				maintainData.setManagementFee(getDouble(importExcel,row,17));
+				maintainData.setTotalFee(getDouble(importExcel,row,18));
 				list.add(maintainData);
 			}
 		}
 		return list;
 	}
 
+	/**
+	 *获取excel double类型的值
+	 */
 	private double getDouble(ImportExcel importExcel,Row row,int col){
 		double d = 0.00;
         Object o = importExcel.getCellValue(row,col);
@@ -296,7 +301,9 @@ public class DataMaintenanceController extends BaseController {
       return d;
 	}
 
-
+	/**
+	 *获取excel date类型的值
+	 */
 	private Date getDate(ImportExcel importExcel,Row row,int col) throws ParseException {
 		Date d = null;
 		Object o = importExcel.getCellValue(row,col);

+ 80 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/activiti/entity/Construction.java

@@ -0,0 +1,80 @@
+package com.jeeplus.modules.sg.managementcenter.activiti.entity;
+
+import com.jeeplus.core.persistence.ActEntity;
+import com.jeeplus.modules.sys.entity.User;
+
+import java.util.Date;
+
+/**
+ * 施工交底Entity
+ * @author
+ * @version 2019-11-08
+ */
+public class Construction extends ActEntity<Construction> {
+    private static final long serialVersionUID = 1L;
+    private User tuser;		// 归属用户
+    private String procInsId;		// 流程实例编号
+    private String userName;		// 申请人
+    private String projectId;		// 项目号
+    private String projectName;		// 项目名称
+    private Date acceptDate;		// 接收图纸时间
+    private String examineDate;		// 查看时间
+
+    public User getTuser() {
+        return tuser;
+    }
+
+    public void setTuser(User tuser) {
+        this.tuser = tuser;
+    }
+
+    @Override
+    public String getProcInsId() {
+        return procInsId;
+    }
+
+    @Override
+    public void setProcInsId(String procInsId) {
+        this.procInsId = procInsId;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getProjectId() {
+        return projectId;
+    }
+
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
+    }
+
+    public String getProjectName() {
+        return projectName;
+    }
+
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
+    public Date getAcceptDate() {
+        return acceptDate;
+    }
+
+    public void setAcceptDate(Date acceptDate) {
+        this.acceptDate = acceptDate;
+    }
+
+    public String getExamineDate() {
+        return examineDate;
+    }
+
+    public void setExamineDate(String examineDate) {
+        this.examineDate = examineDate;
+    }
+}

+ 20 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/activiti/mapper/ConstructionMapper.java

@@ -0,0 +1,20 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.managementcenter.activiti.mapper;
+
+import com.jeeplus.core.persistence.BaseMapper;
+import com.jeeplus.core.persistence.annotation.MyBatisMapper;
+import com.jeeplus.modules.sg.managementcenter.activiti.entity.Construction;
+import com.jeeplus.modules.test.activiti.entity.OALeave;
+
+/**
+ * 施工交底MAPPER接口
+ * @author
+ * @version 2019-11-08
+ */
+
+@MyBatisMapper
+public interface ConstructionMapper extends BaseMapper<Construction> {
+	
+}

+ 141 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/activiti/mapper/xml/ConstructionMapper.xml

@@ -0,0 +1,141 @@
+<?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.sg.managementcenter.activiti.mapper.ConstructionMapper">
+    
+	<sql id="constructionColumns">
+		a.id AS "id",
+		a.proc_ins_id AS "procInsId",
+		a.user_name AS "userName",
+		a.project_id AS "projectId",
+		a.project_name AS "projectName",
+		a.accept_date AS "acceptDate",
+		a.examine_date AS "examineDate",
+		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"
+	</sql>
+	
+	<sql id="constructionJoins">
+		LEFT JOIN sys_user updateBy ON updateBy.id = a.update_by
+	</sql>
+	
+    <resultMap type="Construction" id="ConstructionResult" autoMapping="true">
+    	<result column="reason" property="reason"   typeHandler="com.jeeplus.core.mapper.ConvertBlobTypeHandler"/>
+    </resultMap>
+
+	<select id="get" resultMap="ConstructionResult" >
+		SELECT 
+			<include refid="constructionColumns"/>
+		FROM xm_construction_clarificaiton a
+		<include refid="constructionJoins"/>
+		WHERE a.id = #{id}
+	</select>
+	
+	<select id="findList" resultMap="ConstructionResult" >
+		SELECT 
+			<include refid="constructionColumns"/>
+		FROM xm_construction_clarificaiton a
+		<include refid="constructionJoins"/>
+		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+			${dataScope}
+		</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" resultMap="ConstructionResult" >
+		SELECT 
+			<include refid="constructionColumns"/>
+		FROM xm_construction_clarificaiton a
+		<include refid="constructionJoins"/>
+		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+			${dataScope}
+		</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 xm_construction_clarificaiton(
+			id,
+			proc_ins_id,
+			user_name,
+			project_id,
+			project_name,
+			accept_date,
+			examine_date,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag
+		) VALUES (
+			#{id},
+			#{procInsId},
+			#{userName},
+			#{projectId},
+			#{projectName},
+			#{acceptDate},
+			#{examineDate},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag}
+		)
+	</insert>
+	
+	<update id="update">
+		UPDATE xm_construction_clarificaiton SET
+			proc_ins_id = #{procInsId},
+			user_name = #{userName},
+			project_id = #{projectId},
+			project_name = #{projectName},
+			accept_date = #{acceptDate},
+			examine_date = #{examineDate},
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			remarks = #{remarks}
+		WHERE id = #{id}
+	</update>
+	
+	
+	<!--物理删除-->
+	<update id="delete">
+		DELETE FROM xm_construction_clarificaiton
+		WHERE id = #{id}
+	</update>
+	
+	<!--逻辑删除-->
+	<update id="deleteByLogic">
+		UPDATE xm_construction_clarificaiton SET
+			del_flag = #{DEL_FLAG_DELETE}
+		WHERE id = #{id}
+	</update>
+	
+	
+	<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
+	<select id="findUniqueByProperty" resultType="OALeave" statementType="STATEMENT">
+		select * FROM xm_construction_clarificaiton  where ${propertyName} = '${value}'
+	</select>
+	
+</mapper>

+ 52 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/activiti/service/ConstructionService.java

@@ -0,0 +1,52 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.managementcenter.activiti.service;
+
+import com.jeeplus.core.persistence.Page;
+import com.jeeplus.core.service.CrudService;
+import com.jeeplus.modules.sg.managementcenter.activiti.entity.Construction;
+import com.jeeplus.modules.sg.managementcenter.activiti.mapper.ConstructionMapper;
+import com.jeeplus.modules.test.activiti.entity.OALeave;
+import com.jeeplus.modules.test.activiti.mapper.OALeaveMapper;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * 施工交底Service
+ * @author
+ * @version 2019-11-08
+ */
+@Service
+@Transactional(readOnly = true)
+public class ConstructionService extends CrudService<ConstructionMapper, Construction> {
+
+
+
+	public Construction get(String id) {
+		return super.get(id);
+	}
+	
+	public List<Construction> findList(Construction construction) {
+		return super.findList(construction);
+	}
+	
+	public Page<Construction> findPage(Page<Construction> page, Construction construction) {
+		return super.findPage(page, construction);
+	}
+	
+	@Transactional(readOnly = false)
+	public void save(Construction construction) {
+		super.save(construction);
+	}
+	
+	@Transactional(readOnly = false)
+	public void delete(Construction construction) {
+		super.delete(construction);
+	}
+
+
+
+}

+ 121 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/activiti/web/ConstructionController.java

@@ -0,0 +1,121 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.managementcenter.activiti.web;
+
+import com.google.common.collect.Maps;
+import com.jeeplus.common.json.AjaxJson;
+import com.jeeplus.common.utils.DateUtils;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.core.web.BaseController;
+import com.jeeplus.modules.act.service.ActProcessService;
+import com.jeeplus.modules.act.service.ActTaskService;
+import com.jeeplus.modules.sg.managementcenter.activiti.entity.Construction;
+import com.jeeplus.modules.sg.managementcenter.activiti.service.ConstructionService;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.test.activiti.entity.OALeave;
+import com.jeeplus.modules.test.activiti.service.OALeaveService;
+import org.activiti.engine.repository.ProcessDefinition;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Map;
+
+/**
+ * 施工交底Controller
+ * @author
+ * @version 2019-11-08
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/managementcenter/activiti")
+
+public class ConstructionController extends BaseController {
+
+	@Autowired
+	private ConstructionService constructionService;
+	@Autowired
+	private ActProcessService actProcessService;
+	@Autowired
+	private ActTaskService actTaskService;
+	
+	@ModelAttribute
+	public Construction get(@RequestParam(required=false) String id) {
+		Construction entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = constructionService.get(id);
+		}
+		if (entity == null){
+			entity = new Construction();
+		}
+		return entity;
+	}
+
+
+	
+
+	/**
+	 * 查看,增加,编辑请假申请表单页面
+	 */
+	@RequestMapping(value = "form/{mode}")
+	public String form(@PathVariable String mode, Construction construction, Model model) {
+		model.addAttribute("construction", construction);
+		if("add".equals(mode) || "edit".equals(mode)){
+			return "modules/sg/managementcenter/activiti/constructionForm";
+		}else{//audit
+			return "modules/sg/managementcenter/activiti/constructionAudit";
+		}
+	}
+
+	/**
+	 * 保存请假申请
+	 */
+	@ResponseBody
+	@RequestMapping(value = "save")
+	public AjaxJson save(Construction construction, Model model) throws Exception{
+		AjaxJson j = new AjaxJson();
+		/**
+		 * 后台hibernate-validation插件校验
+		 */
+		String errMsg = beanValidator(construction);
+		if (StringUtils.isNotBlank(errMsg)){
+			j.setSuccess(false);
+			j.setMsg(errMsg);
+			return j;
+		}
+
+
+		/**
+		 * 流程审批
+		 */
+		if (StringUtils.isBlank(construction.getId())){
+			//新增或编辑表单保存
+			constructionService.save(construction);//保存
+			// 启动流程
+			ProcessDefinition p = actProcessService.getProcessDefinition(construction.getAct().getProcDefId());
+			Map<String, Object> vars = Maps.newHashMap();
+			vars.put("processer", UserUtils.get(construction.getTuser().getId()).getLoginName());
+			String title = construction.getCurrentUser().getName()+"在"+ DateUtils.getDateTime()+"发起"+p.getName();
+			actTaskService.startProcessNew(p.getKey(),  "xm_construction_clarificaiton", construction.getId(), title,vars);
+			j.setMsg("发起流程审批成功!");
+			j.getBody().put("targetUrl",  "/act/task/process/");
+		}else{
+			//新增或编辑表单保存
+			constructionService.save(construction);//保存
+			construction.getAct().setComment(("yes".equals(construction.getAct().getFlag())?"[重新申请] ":"[销毁申请] "));
+			// 完成流程任务
+			Map<String, Object> vars = Maps.newHashMap();
+			vars.put("reapply", "yes".equals(construction.getAct().getFlag())? true : false);
+			vars.put("processer", UserUtils.get(construction.getTuser().getId()).getLoginName());
+			actTaskService.complete(construction.getAct().getTaskId(), construction.getAct().getProcInsId(), construction.getAct().getComment(), construction.getContent(), vars);
+			j.setMsg("提交成功!");
+			j.getBody().put("targetUrl",  "/act/task/todo/");
+		}
+
+		return j;
+	}
+	
+
+
+}

+ 112 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/activiti/web/DivideController.java

@@ -0,0 +1,112 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.managementcenter.activiti.web;
+
+import com.google.common.collect.Maps;
+import com.jeeplus.common.json.AjaxJson;
+import com.jeeplus.common.utils.DateUtils;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.core.web.BaseController;
+import com.jeeplus.modules.act.service.ActProcessService;
+import com.jeeplus.modules.act.service.ActTaskService;
+import com.jeeplus.modules.sg.managementcenter.activiti.entity.Construction;
+import com.jeeplus.modules.sg.managementcenter.activiti.service.ConstructionService;
+import org.activiti.engine.repository.ProcessDefinition;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Map;
+
+/**
+ * 施工交底Controller
+ * @author
+ * @version 2019-11-08
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/managementcenter/divide")
+
+public class DivideController extends BaseController {
+
+	@Autowired
+	private ConstructionService constructionService;
+	@Autowired
+	private ActProcessService actProcessService;
+	@Autowired
+	private ActTaskService actTaskService;
+	
+	@ModelAttribute
+	public Construction get(@RequestParam(required=false) String id) {
+		Construction entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = constructionService.get(id);
+		}
+		if (entity == null){
+			entity = new Construction();
+		}
+		return entity;
+	}
+
+
+	
+
+	/**
+	 * 查看,增加,编辑请假申请表单页面
+	 */
+	@RequestMapping(value = "form/{mode}")
+	public String form(@PathVariable String mode, Construction construction, Model model) {
+		model.addAttribute("construction", construction);
+		return "modules/sg/managementcenter/activiti/divideAudit";
+//		return "modules/sg/managementcenter/activiti/constructionForm";
+	}
+
+	/**
+	 * 保存请假申请
+	 */
+	@ResponseBody
+	@RequestMapping(value = "save")
+	public AjaxJson save(Construction construction, Model model) throws Exception{
+		AjaxJson j = new AjaxJson();
+		/**
+		 * 后台hibernate-validation插件校验
+		 */
+		String errMsg = beanValidator(construction);
+		if (StringUtils.isNotBlank(errMsg)){
+			j.setSuccess(false);
+			j.setMsg(errMsg);
+			return j;
+		}
+
+
+		/**
+		 * 流程审批
+		 */
+		if (StringUtils.isBlank(construction.getId())){
+			//新增或编辑表单保存
+			constructionService.save(construction);//保存
+			// 启动流程
+			ProcessDefinition p = actProcessService.getProcessDefinition(construction.getAct().getProcDefId());
+			String title = construction.getCurrentUser().getName()+"在"+ DateUtils.getDateTime()+"发起"+p.getName();
+			actTaskService.startProcess(p.getKey(),  "xm_construction_clarificaiton", construction.getId(), title);
+			j.setMsg("发起流程审批成功!");
+			j.getBody().put("targetUrl",  "/act/task/process/");
+		}else{
+			//新增或编辑表单保存
+			constructionService.save(construction);//保存
+			construction.getAct().setComment(("yes".equals(construction.getAct().getFlag())?"[重新申请] ":"[销毁申请] "));
+			// 完成流程任务
+			Map<String, Object> vars = Maps.newHashMap();
+			vars.put("reapply", "yes".equals(construction.getAct().getFlag())? true : false);
+			actTaskService.complete(construction.getAct().getTaskId(), construction.getAct().getProcInsId(), construction.getAct().getComment(), construction.getContent(), vars);
+			j.setMsg("提交成功!");
+			j.getBody().put("targetUrl",  "/act/task/todo/");
+		}
+
+		return j;
+	}
+	
+
+
+}

+ 117 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/entity/MaterialInfo.java

@@ -0,0 +1,117 @@
+package com.jeeplus.modules.sg.managementcenter.materialinfo.entity;
+
+import com.jeeplus.common.utils.excel.annotation.ExcelField;
+import com.jeeplus.core.persistence.DataEntity;
+
+public class MaterialInfo extends DataEntity<MaterialInfo> {
+    private String projectName;            //项目名称
+    private String materialCode;           //物料编码
+    private String materialName;         //物料名称
+    private String extendDescription;    //扩展描述
+    private String unit;              //单位
+    private Double totalCount;      //总量
+    private Double weightKg;        //单重/kg
+    private Double weightTon;      //总重/吨
+    private String supplyType;   //甲乙供
+    private String note;      //备注
+    private String state;     //状态,与标准比对,1:相同 0:不相同
+
+
+    public String getState() {
+        return state;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
+//    @ExcelField(title="储备项目名称", align=2, sort=1)
+    public String getProjectName() {
+        return projectName;
+    }
+
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
+    @ExcelField(title="物料编码", align=2, sort=2)
+    public String getMaterialCode() {
+        return materialCode;
+    }
+
+    public void setMaterialCode(String materialCode) {
+        this.materialCode = materialCode;
+    }
+
+    @ExcelField(title="物料名称", align=2, sort=3)
+    public String getMaterialName() {
+        return materialName;
+    }
+
+    public void setMaterialName(String materialName) {
+        this.materialName = materialName;
+    }
+
+    @ExcelField(title="扩展描述", align=2, sort=4)
+    public String getExtendDescription() {
+        return extendDescription;
+    }
+
+    public void setExtendDescription(String extendDescription) {
+        this.extendDescription = extendDescription;
+    }
+
+    @ExcelField(title="单位", align=2, sort=5)
+    public String getUnit() {
+        return unit;
+    }
+
+    public void setUnit(String unit) {
+        this.unit = unit;
+    }
+
+    @ExcelField(title="总量", align=2, sort=6)
+    public Double getTotalCount() {
+        return totalCount;
+    }
+
+    public void setTotalCount(Double totalCount) {
+        this.totalCount = totalCount;
+    }
+
+    @ExcelField(title="单重/kg", align=2, sort=7)
+    public Double getWeightKg() {
+        return weightKg;
+    }
+
+    public void setWeightKg(Double weightKg) {
+        this.weightKg = weightKg;
+    }
+
+    @ExcelField(title="总重/吨", align=2, sort=8)
+    public Double getWeightTon() {
+        return weightTon;
+    }
+
+    public void setWeightTon(Double weightTon) {
+        this.weightTon = weightTon;
+    }
+
+    @ExcelField(title="甲乙供", align=2, sort=9)
+    public String getSupplyType() {
+        return supplyType;
+    }
+
+    public void setSupplyType(String supplyType) {
+        this.supplyType = supplyType;
+    }
+
+    @ExcelField(title="备注", align=2, sort=10)
+    public String getNote() {
+        return note;
+    }
+
+    public void setNote(String note) {
+        this.note = note;
+    }
+}

+ 157 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/entity/MaterialStandard.java

@@ -0,0 +1,157 @@
+package com.jeeplus.modules.sg.managementcenter.materialinfo.entity;
+
+import com.jeeplus.common.utils.excel.annotation.ExcelField;
+import com.jeeplus.core.persistence.DataEntity;
+
+public class MaterialStandard extends DataEntity<MaterialStandard> {
+    private String batch;            //批次
+    private String bigClassification;           //大分类
+    private String midClassification;         //中分类
+    private String smallClassification;    //小分类
+    private String materialCode;              //物料编码
+    private String materialDescription;      //物料描述
+    private String extendCode;        //扩展编码
+    private String combinationCode;      //物料编码&扩展编码
+    private String extendDescription;   //扩展描述
+    private String unit;      //单位
+    private String price;      //价格
+    private String batchType;      //批次类型
+    private String specificationId;      //电子商务平台技术规范书ID
+    private String section;      //标段
+    private String note;      //备注
+
+    @ExcelField(title="批次", align=2, sort=1)
+    public String getBatch() {
+        return batch;
+    }
+
+    public void setBatch(String batch) {
+        this.batch = batch;
+    }
+
+    @ExcelField(title="大分类", align=2, sort=2)
+    public String getBigClassification() {
+        return bigClassification;
+    }
+
+    public void setBigClassification(String bigClassification) {
+        this.bigClassification = bigClassification;
+    }
+
+    @ExcelField(title="中分类", align=2, sort=3)
+    public String getMidClassification() {
+        return midClassification;
+    }
+
+    public void setMidClassification(String midClassification) {
+        this.midClassification = midClassification;
+    }
+
+    @ExcelField(title="小分类", align=2, sort=4)
+    public String getSmallClassification() {
+        return smallClassification;
+    }
+
+    public void setSmallClassification(String smallClassification) {
+        this.smallClassification = smallClassification;
+    }
+
+    @ExcelField(title="物料编码", align=2, sort=5)
+    public String getMaterialCode() {
+        return materialCode;
+    }
+
+    public void setMaterialCode(String materialCode) {
+        this.materialCode = materialCode;
+    }
+
+    @ExcelField(title="物料描述", align=2, sort=6)
+    public String getMaterialDescription() {
+        return materialDescription;
+    }
+
+    public void setMaterialDescription(String materialDescription) {
+        this.materialDescription = materialDescription;
+    }
+
+    @ExcelField(title="扩展编码", align=2, sort=7)
+    public String getExtendCode() {
+        return extendCode;
+    }
+
+    public void setExtendCode(String extendCode) {
+        this.extendCode = extendCode;
+    }
+
+    @ExcelField(title="物料编码&扩展编码", align=2, sort=8)
+    public String getCombinationCode() {
+        return combinationCode;
+    }
+
+    public void setCombinationCode(String combinationCode) {
+        this.combinationCode = combinationCode;
+    }
+
+    @ExcelField(title="扩展描述", align=2, sort=9)
+    public String getExtendDescription() {
+        return extendDescription;
+    }
+
+    public void setExtendDescription(String extendDescription) {
+        this.extendDescription = extendDescription;
+    }
+
+    @ExcelField(title="单位", align=2, sort=10)
+    public String getUnit() {
+        return unit;
+    }
+
+    public void setUnit(String unit) {
+        this.unit = unit;
+    }
+
+    @ExcelField(title="价格", align=2, sort=11)
+    public String getPrice() {
+        return price;
+    }
+
+    public void setPrice(String price) {
+        this.price = price;
+    }
+
+    @ExcelField(title="批次类型", align=2, sort=12)
+    public String getBatchType() {
+        return batchType;
+    }
+
+    public void setBatchType(String batchType) {
+        this.batchType = batchType;
+    }
+
+    @ExcelField(title="电子商务平台技术规范书ID", align=2, sort=13)
+    public String getSpecificationId() {
+        return specificationId;
+    }
+
+    public void setSpecificationId(String specificationId) {
+        this.specificationId = specificationId;
+    }
+
+    @ExcelField(title="标段", align=2, sort=14)
+    public String getSection() {
+        return section;
+    }
+
+    public void setSection(String section) {
+        this.section = section;
+    }
+
+    @ExcelField(title="备注", align=2, sort=15)
+    public String getNote() {
+        return note;
+    }
+
+    public void setNote(String note) {
+        this.note = note;
+    }
+}

+ 15 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/entity/MaterialVersion.java

@@ -0,0 +1,15 @@
+package com.jeeplus.modules.sg.managementcenter.materialinfo.entity;
+
+import com.jeeplus.core.persistence.DataEntity;
+
+public class MaterialVersion extends DataEntity<MaterialVersion> {
+    private String batch;   //批次
+
+    public String getBatch() {
+        return batch;
+    }
+
+    public void setBatch(String batch) {
+        this.batch = batch;
+    }
+}

+ 24 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/mapper/MaterialInfoMapper.java

@@ -0,0 +1,24 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.managementcenter.materialinfo.mapper;
+
+import com.jeeplus.core.persistence.BaseMapper;
+import com.jeeplus.core.persistence.annotation.MyBatisMapper;
+import com.jeeplus.modules.sg.financial.settlement.entity.MaintainData;
+import com.jeeplus.modules.sg.managementcenter.materialinfo.entity.MaterialInfo;
+import com.jeeplus.modules.sg.managementcenter.materialproject.entity.MaterialProject;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+
+@MyBatisMapper
+public interface MaterialInfoMapper extends BaseMapper<MaterialInfo> {
+	int insertList(@Param("list") List<MaterialInfo> list);
+	List<MaterialInfo> findSat(String batch);
+	List<MaterialInfo> findProjectName();
+	List<MaterialInfo> findByList(@Param("list") List<MaterialProject> list);
+	void deleteByPro(String projectName);
+
+}

+ 24 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/mapper/MaterialVersionMapper.java

@@ -0,0 +1,24 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.managementcenter.materialinfo.mapper;
+
+import com.jeeplus.core.persistence.BaseMapper;
+import com.jeeplus.core.persistence.annotation.MyBatisMapper;
+import com.jeeplus.modules.sg.managementcenter.materialinfo.entity.MaterialInfo;
+import com.jeeplus.modules.sg.managementcenter.materialinfo.entity.MaterialStandard;
+import com.jeeplus.modules.sg.managementcenter.materialinfo.entity.MaterialVersion;
+import com.jeeplus.modules.sg.managementcenter.materialproject.entity.MaterialProject;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+
+@MyBatisMapper
+public interface MaterialVersionMapper extends BaseMapper<MaterialVersion> {
+	int insertList(@Param("list") List<MaterialStandard> list);
+	List<MaterialVersion> findSat(String batch);
+	void deleteByBatch(String batch);
+	void deleteData(String batch);
+
+}

+ 235 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/mapper/xml/MaterialInfoMapper.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.sg.managementcenter.materialinfo.mapper.MaterialInfoMapper">
+    
+	<sql id="infoColumns">
+		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_name AS "projectName",
+		a.material_code AS "materialCode",
+		a.material_name AS "materialName",
+		a.extend_description AS "extendDescription",
+		a.unit AS "unit",
+		a.total_count AS "totalCount",
+		a.weight_kg AS "weightKg",
+		a.weight_ton AS "weightTon",
+		a.supply_type AS "supplyType",
+		a.note AS "note",
+		a.state AS "state"
+	</sql>
+
+    
+	<select id="get" resultType="MaterialInfo" >
+		SELECT 
+			<include refid="infoColumns"/>
+		FROM xm_material_data a
+		WHERE a.id = #{id}
+	</select>
+	
+	<select id="findList" resultType="MaterialInfo" >
+		SELECT 
+			<include refid="infoColumns"/>
+		FROM xm_material_data a
+		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+			${dataScope}
+			<if test="projectName != null and projectName != '' ">
+				AND project_name = #{projectName}
+			</if>
+		</where>
+		ORDER BY a.material_code DESC
+		<!--<choose>-->
+			<!--<when test="page !=null and page.orderBy != null and page.orderBy != ''">-->
+				<!--ORDER BY a.update_date DESC-->
+			<!--</when>-->
+			<!--<otherwise>-->
+				<!--ORDER BY a.update_date DESC-->
+			<!--</otherwise>-->
+		<!--</choose>-->
+	</select>
+	
+	<select id="findAllList" resultType="MaterialInfo" >
+		SELECT 
+			<include refid="infoColumns"/>
+		FROM xm_material_data a
+		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+			${dataScope}
+		</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 xm_material_data(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag,
+			project_name,
+		    material_code,
+		    material_name,
+		    extend_description ,
+		    unit ,
+		    total_count,
+		     weight_kg,
+		    weight_ton,
+		    supply_type,
+		    note
+		) VALUES (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag},
+			#{projectName},
+			#{materialCode},
+			#{materialName},
+			#{extendDescription},
+			#{unit},
+			#{totalCount},
+			#{weightKg},
+			#{weightTon},
+			#{supplyType},
+			#{note}
+		)
+	</insert>
+
+    <insert id="insertList">
+        replace INTO xm_material_data(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag,
+		    project_name,
+		    material_code,
+		    material_name,
+		    extend_description ,
+		    unit ,
+		    total_count,
+		    weight_kg,
+		    weight_ton,
+		    supply_type,
+		    note,
+		    state
+		) VALUES
+        <foreach collection="list" item="item" index="index" separator="," >
+		(
+			#{item.id},
+			#{item.createBy.id},
+			#{item.createDate},
+			#{item.updateBy.id},
+			#{item.updateDate},
+			#{item.remarks},
+			#{item.delFlag},
+			#{item.projectName},
+			#{item.materialCode},
+			#{item.materialName},
+			#{item.extendDescription},
+			#{item.unit},
+			#{item.totalCount},
+			#{item.weightKg},
+			#{item.weightTon},
+			#{item.supplyType},
+			#{item.note},
+			#{item.state}
+		)
+        </foreach>
+	</insert>
+	
+	<update id="update">
+		UPDATE xm_material_data SET
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			remarks = #{remarks},
+			start_date = #{startDate},
+			project_id = #{projectId},
+			end_date = #{endDate},
+			approval_number = #{approvalNumber},
+			building_fee = #{buildingFee},
+			install_fee = #{installFee},
+			equipment_fee = #{equipmentFee},
+			material_fee = #{materialFee},
+			design_fee = #{designFee},
+			supervision_fee = #{supervisionFee},
+			preliminaryWork_fee = #{preliminaryWorkFee},
+			damages = #{damages},
+			management_fee = #{managementFee},
+			total_fee = #{totalFee}
+		WHERE id = #{id}
+	</update>
+	
+	
+	<!--物理删除-->
+	<update id="delete">
+		DELETE FROM xm_material_data
+		WHERE id = #{id}
+	</update>
+
+	<delete id="deleteByPro">
+		DELETE FROM xm_material_data
+		WHERE project_name = #{projectName}
+	</delete>
+	
+	<!--逻辑删除-->
+	<update id="deleteByLogic">
+		UPDATE xm_material_data SET
+			del_flag = #{DEL_FLAG_DELETE}
+		WHERE id = #{id}
+	</update>
+	
+	
+	<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
+	<select id="findUniqueByProperty" resultType="TestNote" statementType="STATEMENT">
+		select * FROM xm_material_data  where ${propertyName} = '${value}'
+	</select>
+
+
+	<select id="findSat" resultType="MaterialInfo" parameterType="String">
+		select a.material_code as materialCode,
+		a.material_description as materialName,
+		a.extend_description as extendDescription
+		from xm_material_standard a
+		<where>
+			a.batch = #{batch}
+		</where>
+	</select>
+
+	<select id="findProjectName" resultType="MaterialInfo" parameterType="String">
+		SELECT DISTINCT(project_name) AS projectName
+		<where>
+			project_name = #{projectName}
+		</where>
+	</select>
+
+	<select id="findByList" resultType="MaterialInfo">
+		SELECT
+		   <include refid="infoColumns"/>
+		FROM xm_material_data a
+		<where>
+		 a.project_name in
+		<foreach collection="list" item="item" open="(" close=")" separator=",">
+			#{item.reserveProjectName}
+		</foreach>
+		</where>
+	</select>
+</mapper>

+ 137 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/mapper/xml/MaterialVersionMapper.xml

@@ -0,0 +1,137 @@
+<?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.sg.managementcenter.materialinfo.mapper.MaterialVersionMapper">
+    
+	<sql id="infoColumns">
+		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.batch AS "batch"
+	</sql>
+
+    
+	<select id="get" resultType="MaterialVersion" >
+		SELECT 
+			<include refid="infoColumns"/>
+		FROM xm_material_version a
+		WHERE a.id = #{id}
+	</select>
+	
+	<select id="findList" resultType="MaterialVersion" >
+		SELECT 
+			<include refid="infoColumns"/>
+		FROM xm_material_version a
+		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+			${dataScope}
+			<if test="batch != null and batch != '' ">
+				AND batch = #{batch}
+			</if>
+		</where>
+		ORDER BY a.update_date DESC
+	</select>
+	
+
+	
+	<insert id="insert">
+		INSERT INTO xm_material_version(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag,
+			batch
+		) VALUES (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag},
+			#{batch}
+		)
+	</insert>
+
+    <insert id="insertList">
+        INSERT INTO xm_material_standard(
+		batch,
+		big_classification,
+		mid_classification,
+		small_classification,
+		material_code,
+		material_description,
+		extend_code,
+		combination_code,
+		extend_description,
+		unit,
+		price,
+		batch_type,
+		specification_id,
+		section,
+		note
+		) VALUES
+        <foreach collection="list" item="item" index="index" separator="," >
+		(
+			#{item.batch},
+			#{item.bigClassification},
+			#{item.midClassification},
+			#{item.smallClassification},
+			#{item.materialCode},
+			#{item.materialDescription},
+			#{item.extendCode},
+			#{item.combinationCode},
+			#{item.extendDescription},
+			#{item.unit},
+			#{item.price},
+			#{item.batchType},
+			#{item.specificationId},
+			#{item.section},
+			#{item.note}
+		)
+        </foreach>
+	</insert>
+	
+
+	
+	
+	<!--物理删除-->
+	<update id="delete">
+		DELETE FROM xm_material_version
+		WHERE id = #{id}
+	</update>
+
+	<update id="deleteData">
+		DELETE FROM xm_material_version
+		WHERE batch = #{batch}
+	</update>
+
+	<delete id="deleteByBatch">
+		DELETE FROM xm_material_standard
+		WHERE batch = #{batch}
+	</delete>
+	
+	<!--逻辑删除-->
+	<update id="deleteByLogic">
+		UPDATE xm_material_version SET
+			del_flag = #{DEL_FLAG_DELETE}
+		WHERE id = #{id}
+	</update>
+	
+	
+	<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
+	<select id="findUniqueByProperty" resultType="TestNote" statementType="STATEMENT">
+		select * FROM xm_material_version  where ${propertyName} = '${value}'
+	</select>
+
+
+
+
+
+</mapper>

+ 272 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/service/MaterialInfoService.java

@@ -0,0 +1,272 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.managementcenter.materialinfo.service;
+
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.utils.excel.ImportExcel;
+import com.jeeplus.core.persistence.Page;
+import com.jeeplus.core.service.CrudService;
+import com.jeeplus.modules.sg.financial.settlement.util.ExcelWriter;
+import com.jeeplus.modules.sg.managementcenter.materialinfo.entity.MaterialInfo;
+import com.jeeplus.modules.sg.managementcenter.materialinfo.mapper.MaterialInfoMapper;
+import com.jeeplus.modules.sg.managementcenter.materialinfo.util.MaterialReplaceUtil;
+import com.jeeplus.modules.sg.managementcenter.materialproject.entity.MaterialProject;
+import com.jeeplus.modules.sg.managementcenter.materialproject.service.MaterialProjectService;
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+
+@Service
+@Transactional(readOnly = true)
+public class MaterialInfoService extends CrudService<MaterialInfoMapper, MaterialInfo> {
+
+	@Autowired
+	private MaterialInfoMapper materialInfoMapper;
+	@Autowired
+	private MaterialProjectService materialProjectService;
+
+	public MaterialInfo get(String id) {
+		return super.get(id);
+	}
+	
+	public List<MaterialInfo> findList(MaterialInfo materialInfo) {
+		return super.findList(materialInfo);
+	}
+
+	public List<MaterialInfo> findProjectName(){
+		return materialInfoMapper.findProjectName();
+	}
+	
+	public Page<MaterialInfo> findPage(Page<MaterialInfo> page, MaterialInfo materialInfo) {
+		return super.findPage(page, materialInfo);
+	}
+	
+	@Transactional(readOnly = false)
+	public void save(MaterialInfo materialInfo) {
+		super.save(materialInfo);
+	}
+
+	@Transactional(readOnly = false)
+	public void saveList(List<MaterialInfo> list) {
+		for(MaterialInfo maintainData : list){
+			maintainData.preInsert();
+		}
+		materialInfoMapper.insertList(list);
+	}
+	
+	@Transactional(readOnly = false)
+	public void delete(MaterialInfo materialInfo) {
+		super.delete(materialInfo);
+	}
+
+	/**
+	 *根据项目名称删除物料信息
+	 */
+	@Transactional(readOnly = false)
+	public void deleteByPro(String projectName) {
+		materialInfoMapper.deleteByPro(projectName);
+	}
+
+	/**
+	 *物料信息合并保存
+	 */
+    @Transactional(readOnly = false)
+	public void export(MultipartFile file,String batch,String itemBatch) throws IOException, InvalidFormatException {
+		ImportExcel mo = new ImportExcel(file,1,"模块表");
+		ImportExcel importExcel = new ImportExcel(file,1,"领料清单");
+		Row row = mo.getRow(0);
+		String projectNam1 = (String) mo.getCellValue(row, 1);
+		String projectName = projectNam1.trim();
+		MaterialProject materialProject1 = new MaterialProject();
+		materialProject1.setReserveProjectName(projectName);
+		List<MaterialProject> materialProjects = materialProjectService.findList(materialProject1);
+		if(materialProjects != null && materialProjects.size() > 0){
+			materialProjectService.delete(materialProjects.get(0));
+			materialInfoMapper.deleteByPro(projectName);
+		}
+		List<MaterialInfo> materialInfos = getData(importExcel,projectName);   //sheet页数据
+//		List<MaterialInfo> list = replaceDate(materialInfos);          //对比替换数据
+		List<MaterialInfo> list = getNewData(materialInfos);      //合并后数据
+		List<MaterialInfo> standardList = materialInfoMapper.findSat(batch);     //标准库数据
+		List<MaterialInfo> newList = compareData(list,standardList);    //比对之后的数据
+		saveList(newList);
+		MaterialProject materialProject = new MaterialProject();
+		materialProject.setReserveProjectName(projectName);
+		materialProject.setSuppliesBatch(batch);
+		materialProject.setProjectBatch(itemBatch);
+        materialProjectService.save(materialProject);
+	}
+
+	/**
+	 *根据项目名称获取物料信息
+	 */
+	public List<MaterialInfo> findByBatch(List<MaterialProject> list){
+		List<MaterialInfo> list1 = materialInfoMapper.findByList(list);
+		 List<MaterialInfo> list2 = getNewData(list1); //合并数据
+		Collections.sort(list2, new Comparator<MaterialInfo>() {
+			@Override
+			public int compare(MaterialInfo o1, MaterialInfo o2) {
+				return o1.getMaterialCode().compareTo(o2.getMaterialCode());
+			}
+		});
+		 return list2;
+	}
+
+
+
+
+	/**
+	 * 获取sheet中数据
+	 * @param importExcel
+	 * @param projectName
+	 * @return
+	 */
+	private List<MaterialInfo> getData(ImportExcel importExcel,String projectName)  {
+		int lastRow = importExcel.getLastDataRowNum();
+		List<MaterialInfo> list = new ArrayList<>();
+		MaterialInfo maintainData = null;
+		for(int i=2; i<lastRow;i++){
+			maintainData = new MaterialInfo();
+			Row row = importExcel.getRow(i);
+			String materialCode = (String) importExcel.getCellValue(row,1);
+			if(StringUtils.isNotBlank(materialCode)) {
+				maintainData.setProjectName(projectName);
+				maintainData.setMaterialCode(materialCode);
+			    maintainData.setMaterialName((String) importExcel.getCellValue(row,2));
+			    maintainData.setExtendDescription((String) importExcel.getCellValue(row,3));
+			    maintainData.setUnit((String) importExcel.getCellValue(row,4));
+			    maintainData.setTotalCount(getDouble(importExcel,row,5));
+			    maintainData.setWeightKg(getDouble(importExcel,row,6));
+			    maintainData.setWeightTon(getDouble(importExcel,row,7));
+				maintainData.setSupplyType((String) importExcel.getCellValue(row,8));
+				maintainData.setNote((String) importExcel.getCellValue(row,9));
+				list.add(maintainData);
+			}
+		}
+		return list;
+	}
+
+	/**
+	 * 合并数据
+	 * @param materialInfos
+	 * @return
+	 */
+	private List<MaterialInfo> getNewData(List<MaterialInfo> materialInfos) {
+		double totalCount = 0.00;
+		double weightTon = 0.00;
+		List<MaterialInfo> list = new ArrayList<>();
+		for(int i=0;i<materialInfos.size();i++){
+			MaterialInfo materialInfo = materialInfos.get(i);
+            String projectName = materialInfo.getProjectName();
+            String code = materialInfo.getMaterialCode();
+            String name = materialInfo.getMaterialName();
+            String des = materialInfo.getExtendDescription();
+            totalCount = materialInfo.getTotalCount();
+            weightTon = materialInfo.getWeightTon();
+            String note = materialInfo.getNote();
+            if(projectName != null){
+            	for(int j=i+1;j<materialInfos.size();j++){
+					MaterialInfo materialInfo1 = materialInfos.get(j);
+					String code1 = materialInfo1.getMaterialCode();
+					String name1 = materialInfo1.getMaterialName();
+					String des1 = materialInfo1.getExtendDescription();
+					String note1 = materialInfo1.getNote();
+					double totalCount1 = materialInfo1.getTotalCount();
+					double weightTon1 = materialInfo1.getWeightTon();
+					if(code.equals(code1) && des.equals(des1) && name.equals(name1) && note.equals(note1)){
+                          totalCount = totalCount + totalCount1;
+                          weightTon = weightTon + weightTon1;
+						  materialInfo1.setProjectName(null);
+					}
+				}
+				materialInfo.setTotalCount(totalCount);
+				materialInfo.setWeightTon(weightTon);
+				list.add(materialInfo);
+			}
+
+		}
+		return list;
+	}
+
+	/**
+	 * 对比替换数据
+	 * @param list
+	 * @return
+	 */
+	private List<MaterialInfo> replaceDate(List<MaterialInfo> list) {
+		for(MaterialInfo materialInfo : list){
+			String code = materialInfo.getMaterialCode();
+			String name = materialInfo.getMaterialName();
+			String des = materialInfo.getExtendDescription();
+			for(int i=0;i< MaterialReplaceUtil.exportCode.length;i++){
+				if(code.equals(MaterialReplaceUtil.exportCode[i]) && name.equals(MaterialReplaceUtil.exportName[i])
+						&& des.equals(MaterialReplaceUtil.exportDes[i])){
+					materialInfo.setMaterialCode(MaterialReplaceUtil.replaceCode[i]);
+					materialInfo.setMaterialName(MaterialReplaceUtil.replaceName[i]);
+					materialInfo.setExtendDescription(MaterialReplaceUtil.replaceDes[i]);
+					break;
+				}
+			}
+		}
+		return list;
+	}
+
+	/**
+	 * 数据和标准库比对
+	 * @param list
+	 * @param standardList
+	 * @return
+	 */
+	private List<MaterialInfo> compareData(List<MaterialInfo> list, List<MaterialInfo> standardList) {
+		for(MaterialInfo materialInfo : list){
+			String code = materialInfo.getMaterialCode();
+			String name = materialInfo.getMaterialName();
+			String des = materialInfo.getExtendDescription();
+			materialInfo.setState("0");
+			for(MaterialInfo materialInfo1 : standardList){
+				String code1 = materialInfo1.getMaterialCode();
+				String name1 = materialInfo1.getMaterialName();
+				String des1 = materialInfo1.getExtendDescription();
+				if(code.equals(code1) && name.equals(name1) && des.equals(des1)){
+					materialInfo.setState("1");
+					break;
+				}
+			}
+		}
+		return list;
+	}
+
+
+	private double getDouble(ImportExcel importExcel,Row row,int col){
+		double d = 0.00;
+		Object o = importExcel.getCellValue(row,col);
+		if(!o.equals("")){
+			d = Double.parseDouble(o.toString());
+		}
+		return d;
+	}
+
+
+
+
+
+
+
+
+
+	
+}

+ 97 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/service/MaterialVersionService.java

@@ -0,0 +1,97 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.managementcenter.materialinfo.service;
+
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.utils.excel.ImportExcel;
+import com.jeeplus.core.persistence.Page;
+import com.jeeplus.core.service.CrudService;
+import com.jeeplus.modules.sg.managementcenter.materialinfo.entity.MaterialStandard;
+import com.jeeplus.modules.sg.managementcenter.materialinfo.entity.MaterialVersion;
+import com.jeeplus.modules.sg.managementcenter.materialinfo.mapper.MaterialVersionMapper;
+import com.jeeplus.modules.sg.managementcenter.materialproject.entity.MaterialProject;
+import com.jeeplus.modules.sg.managementcenter.materialproject.service.MaterialProjectService;
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
+import org.apache.poi.ss.usermodel.Row;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+
+@Service
+@Transactional(readOnly = true)
+public class MaterialVersionService extends CrudService<MaterialVersionMapper, MaterialVersion> {
+
+	@Autowired
+	private MaterialVersionMapper materialVersionMapper;
+
+	public MaterialVersion get(String id) {
+		return super.get(id);
+	}
+	
+	public List<MaterialVersion> findList(MaterialVersion materialVersion) {
+		return super.findList(materialVersion);
+	}
+	
+	
+	public Page<MaterialVersion> findPage(Page<MaterialVersion> page, MaterialVersion materialVersion) {
+		return super.findPage(page, materialVersion);
+	}
+	
+	@Transactional(readOnly = false)
+	public void save(MaterialVersion materialVersion) {
+		super.save(materialVersion);
+	}
+
+	/**
+	 *物料保存
+	 */
+	@Transactional(readOnly = false)
+	public void saveList(List<MaterialStandard> list,String batch) {
+		MaterialVersion materialVersion = new MaterialVersion();
+		materialVersion.setBatch(batch);
+        List<MaterialVersion> list1 = materialVersionMapper.findList(materialVersion);
+        if(list1 != null && list1.size()>0){
+        	materialVersionMapper.deleteByBatch(batch);
+        	materialVersionMapper.deleteData(batch);
+		}
+        save(materialVersion);
+		materialVersionMapper.insertList(list);
+	}
+
+	/**
+	 *删除物料信息
+	 */
+	@Transactional(readOnly = false)
+	public void delete(MaterialVersion materialVersion) {
+		super.delete(materialVersion);
+		deleteByPro(materialVersion.getBatch());
+	}
+
+	/**
+	 * 更加批次号删除物料信息
+	 */
+	@Transactional(readOnly = false)
+	public void deleteByPro(String batch) {
+		materialVersionMapper.deleteByBatch(batch);
+	}
+
+
+
+
+
+
+
+
+
+
+	
+}

+ 68 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/util/MaterialReplaceUtil.java

@@ -0,0 +1,68 @@
+package com.jeeplus.modules.sg.managementcenter.materialinfo.util;
+
+public class MaterialReplaceUtil {
+    public static String[] exportCode = {
+            "500107562", "500017402", "500017402", "500017402", "500017402", "500017402",
+            "500017402", "500017402", "500017396", "500050121", "500050121", "500050121",
+            "500134504", "500134497", "500132919", "500021647"
+    };
+    public static String[] replaceCode = {
+            "500107562", "500118948", "500118948", "500118948", "500118948", "500118948",
+            "500118948", "500118948", "500118948", "500118948", "500118948", "500118948",
+            "500134504", "500134497", "500132919", "500107555"
+
+    };
+    public static String[] exportName = {
+            "电缆分支箱,AC400V,塑壳断路器,七路,630A", "线路角铁横担,∠75×8,1500mm,不计孔距,双侧",
+            "线路角铁横担,∠75×8,1500mm,不计孔距,双侧", "线路角铁横担,∠75×8,1500mm,不计孔距,双侧",
+            "线路角铁横担,∠75×8,1500mm,不计孔距,双侧", "线路角铁横担,∠75×8,1500mm,不计孔距,双侧",
+            "线路角铁横担,∠75×8,1500mm,不计孔距,双侧", "线路角铁横担,∠75×8,1500mm,不计孔距,双侧",
+            "线路角铁横担,∠75×8,1500mm,不计孔距,单侧", "普通螺栓,M18,300mm,铁,热浸锌,配螺母",
+            "普通螺栓,M18,300mm,铁,热浸锌,配螺母", "普通螺栓,M18,300mm,铁,热浸锌,配螺母",
+            "10kV柱上变压器台成套设备,ZA-1-CX,400kVA,15m", "10kV柱上变压器台成套设备,ZA-1-ZX,400kVA,15m",
+            "配电箱,户外,4回路400kVA-使用环境:户外,回路数:4回路400kVA", "电缆分支箱,AC400V,塑壳断路器,四路,400A"
+    };
+    public static String[] replaceName = {
+            "电缆分支箱,AC400V,塑壳断路器,七路,630A", "铁构件", "铁构件", "铁构件", "铁构件", "铁构件",
+            "铁构件", "铁构件", "铁构件", "铁构件", "铁构件", "铁构件", "10kV柱上变压器台成套设备,ZA-1-CX,400kVA,15m",
+            "10kV柱上变压器台成套设备,ZA-1-ZX,400kVA,15m", "配电箱,户外,4回路400kVA", "电缆分支箱,AC400V,塑壳断路器,四路,400A"
+    };
+    public static String[] exportDes = {
+            "电缆分支箱,AC400V,塑壳断路器,七路,630A。进线隔离开关400A,出线塑壳断路器,6×160A,304不锈钢,落地式,户外",
+            "配农网用,成套杆头,Z-S-190/12(15)",
+            "配农网用,成套杆头,ZJ-S-190/12(15)",
+            "配农网用,成套杆头,NJ1-S-350/15",
+            "配农网用,成套杆头,NJ1-S-190/12(15)",
+            "配农网用,成套杆头,2Z-V-190/15",
+            "配农网用,成套杆头,2ZJ-V-350/15",
+            "配农网用,成套杆头,2NJ1-V-190/15",
+            "线路角铁横担,∠75×8,1500mm,不计孔距,单侧。垫铁-50×5×272,适用杆径直径(mm)240-265",
+            "普通螺栓,M18,300mm,铁,热浸锌,配螺母。双头螺栓,ST-410,M18,210mm,螺母4个,平垫2个,弹垫2个",
+            "普通螺栓,M18,300mm,铁,热浸锌,配螺母。双头螺栓,ST-430,M18,230mm,螺母4个,平垫2个,弹垫2个",
+            "普通螺栓,M18,300mm,铁,热浸锌,配螺母。双头螺栓,ST-450,M18,250mm,螺母4个,平垫2个,弹垫2个",
+            "10kV柱上变压器台成套设备,ZA-1-CX,400kVA,15m。S13油浸变压器侧装,避雷器,配电箱进线刀熔开关,出线3回塑壳断路器带漏电保护,配智能电容,绝缘导线引线",
+            "10kV柱上变压器台成套设备,ZA-1-ZX,400kVA,15m。S13油浸变压器正装,避雷器,配电箱进线刀熔开关,出线3回塑壳断路器带漏电保护,配智能电容,绝缘导线引线",
+            "配电箱,户外,4回路400kVA。低压综合配电箱,AC380V,400kVA,四路,无补偿,进线熔断器式隔离开关,出线塑壳断路器,带剩余电流保护,电子式,带通信功能",
+            "电缆分支箱,AC400V,塑壳断路器,四路,400A。进线隔离开关400A,出线塑壳断路器,3×250A,SMC,落地式,户外"
+
+   };
+    public static String[] replaceDes = {
+            "电缆分支箱,AC400V,塑壳断路器,七路,630A。进线隔离开关630A,出线塑壳断路器,2×250A+4×160A,304不锈钢,落地式,户外",
+            "成套件,线路角铁横担,10kV单回路三角排列直线(单层、单横担)杆头,Z-S-190/12(15)",
+            "成套件,线路角铁横担,10kV单回路三角排列直线转角(单层、双横担)杆头,ZJ-S-190/12(15)",
+            "成套件,线路角铁横担,10kV单回路三角排列耐张转角(单层、双横担)杆头,NJ1-S-350/15",
+            "成套件,线路角铁横担,10kV单回路三角排列耐张转角(单层、双横担)杆头,NJ1-S-190/12(15)",
+            "成套件,线路角铁横担,10kV双回路垂直排列直线(单层、单横担)杆头,2Z-V-190/15",
+            "成套件,线路角铁横担,10kV双回路垂直排列直线转角(单层、双横担)杆头,2ZJ-V-350/15",
+            "成套件,线路角铁横担,10kV双回路垂直排列耐张转角(单层、双横担)杆头,2NJ1-V-190/15",
+            "成套件,线路角铁横担,∠75×8,1500mm,不计孔距,单侧。垫铁-50×5×272,适用杆径直径(mm)240-265",
+            "双头螺栓,ST-410,M18,210mm,螺母4个,平垫2个,弹垫2个",
+            "双头螺栓,ST-430,M18,230mm,螺母4个,平垫2个,弹垫2个",
+            "双头螺栓,ST-450,M18,250mm,螺母4个,平垫2个,弹垫2个",
+            "S13油浸叠铁芯变压器侧装,避雷器,配电箱进线刀熔开关,出线3回塑壳断路器带漏电保护,配智能电容,绝缘导线引线",
+            "S13油浸叠铁芯变压器正装,避雷器,配电箱进线刀熔开关,出线3回塑壳断路器带漏电保护,配智能电容,绝缘导线引线",
+            "配电箱,户外,4回路400kVA。低压综合配电箱,AC380V,400kVA,四路,无补偿,进线熔断器式隔离开关,出线塑壳断路器,带剩余电流保护,电子式,带通信功能",
+            "电缆分支箱,AC400V,塑壳断路器,四路,400A。进线隔离开关400A,出线塑壳断路器,3×250A,SMC,落地式,户外"
+};
+
+}

+ 269 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/web/MaterialInfoController.java

@@ -0,0 +1,269 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.managementcenter.materialinfo.web;
+
+import com.google.common.collect.Lists;
+import com.jeeplus.common.json.AjaxJson;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.utils.excel.ExportExcel;
+import com.jeeplus.common.utils.excel.ImportExcel;
+import com.jeeplus.core.persistence.Page;
+import com.jeeplus.core.web.BaseController;
+import com.jeeplus.modules.sg.managementcenter.materialinfo.entity.MaterialInfo;
+import com.jeeplus.modules.sg.managementcenter.materialinfo.service.MaterialInfoService;
+import com.jeeplus.modules.sg.managementcenter.materialproject.entity.MaterialProject;
+import com.jeeplus.modules.sg.managementcenter.materialproject.service.MaterialProjectService;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
+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;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import java.io.IOException;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 数据维护
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/managementcenter/materialinfo")
+public class MaterialInfoController extends BaseController {
+
+	@Autowired
+	private MaterialInfoService materialInfoService;
+	@Autowired
+	private MaterialProjectService materialProjectService;
+	
+	@ModelAttribute
+	public MaterialInfo get(@RequestParam(required=false) String id) {
+		MaterialInfo entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = materialInfoService.get(id);
+		}
+		if (entity == null){
+			entity = new MaterialInfo();
+		}
+		return entity;
+	}
+	
+	/**
+	 * 列表页面
+	 */
+	@RequiresPermissions("managementcenter:materialinfo:list")
+	@RequestMapping(value = {"list", ""})
+	public String list(MaterialInfo materialInfo, Model model) {
+		model.addAttribute("materialInfo", materialInfo);
+		return "modules/sg/managementcenter/materialinfo/materialInfoList";
+	}
+	
+		/**
+	 * 列表数据
+	 */
+		@ResponseBody
+		@RequiresPermissions("managementcenter:materialinfo:list")
+		@RequestMapping(value = "data")
+		public Map<String, Object> data(MaterialInfo materialInfo, HttpServletRequest request, HttpServletResponse response, Model model) {
+			Page<MaterialInfo> page = materialInfoService.findPage(new Page<MaterialInfo>(request, response), materialInfo);
+			return getBootstrapData(page);
+		}
+
+
+
+
+	
+	/**
+	 * 删除
+	 */
+	@ResponseBody
+	@RequiresPermissions("managementcenter:materialinfo:del")
+	@RequestMapping(value = "delete")
+	public AjaxJson delete(MaterialInfo materialInfo) {
+		AjaxJson j = new AjaxJson();
+		materialInfoService.delete(materialInfo);
+		j.setMsg("删除成功");
+		return j;
+	}
+	
+	/**
+	 * 批量删除
+	 */
+	@ResponseBody
+	@RequiresPermissions("managementcenter:materialinfo:del")
+	@RequestMapping(value = "deleteAll")
+	public AjaxJson deleteAll(String ids) {
+		AjaxJson j = new AjaxJson();
+		String idArray[] =ids.split(",");
+		for(String id : idArray){
+			materialInfoService.delete(materialInfoService.get(id));
+		}
+		j.setMsg("删除成功");
+		return j;
+	}
+
+
+	/**
+	 * 导入Excel数据
+	 */
+	@ResponseBody
+	@RequiresPermissions("managementcenter:materialinfo:import")
+    @RequestMapping(value = "import")
+   	public AjaxJson importFile(@RequestParam("file")MultipartFile file, HttpServletResponse response, HttpServletRequest request) {
+		String batch = request.getParameter("batch");   //物料批次
+		String itemBatch = request.getParameter("itemBatch");  //项目批次
+		AjaxJson j = new AjaxJson();
+		try {
+			materialInfoService.export(file,batch,itemBatch);
+			j.setMsg("导入成功");
+		} catch (Exception e) {
+			j.setSuccess(false);
+			j.setMsg("导入失败!失败信息:"+e.getMessage());
+		}
+		return j;
+    }
+
+
+    /**
+     * 多文件导入
+     */
+    @ResponseBody
+    @RequiresPermissions("managementcenter:materialinfo:import")
+    @RequestMapping(value = "imports")
+    public AjaxJson importFile(@RequestParam("file")MultipartFile[] file, HttpServletResponse response, HttpServletRequest request) {
+        String batch = request.getParameter("batch");   //物料批次
+        String itemBatch = request.getParameter("itemBatch");   //项目批次
+        AjaxJson j = new AjaxJson();
+        try {
+            for(int i=0;i<file.length;i++) {
+                materialInfoService.export(file[i], batch,itemBatch);
+            }
+            j.setMsg("导入成功");
+        } catch (Exception e) {
+            j.setSuccess(false);
+            j.setMsg("导入失败!失败信息:"+e.getMessage());
+        }
+        return j;
+    }
+
+
+    /**
+	 * 导入文件页面
+	 * @return
+	 */
+	@RequestMapping(value = "importExcel")
+	public String importExcel(Model model) {
+		List<MaterialProject> list = materialProjectService.findBatch();
+		model.addAttribute("batch",list);
+		return "modules/sg/managementcenter/materialinfo/importexcel";
+	}
+
+
+	/**
+	 * 多文件导出页面
+	 */
+	@RequestMapping(value = "/importMore/Form")
+	public String importMoreForm(Model model){
+		List<MaterialProject> list = materialProjectService.findBatch();
+		model.addAttribute("batch",list);
+		return "modules/sg/managementcenter/materialinfo/importmore";
+	}
+
+
+
+
+
+	/**
+	 * 项目验证
+	 */
+
+	@ResponseBody
+	@RequestMapping(value = "importValidation")
+	public AjaxJson importValidation(@RequestParam("file")MultipartFile file,String batch,String itemBatch){
+		AjaxJson j = new AjaxJson();
+		try {
+		ImportExcel mo = new ImportExcel(file,1,"模块表");
+		Row row = mo.getRow(0);
+		String projectName1 = (String) mo.getCellValue(row, 1);
+		String projectName = projectName1.trim();
+		MaterialProject materialProject = new MaterialProject();
+		materialProject.setReserveProjectName(projectName);
+		List<MaterialProject> list = materialProjectService.findList(materialProject);
+		if(list != null && list.size()>0){
+			j.setSuccess(true);
+		}else {
+			materialInfoService.export(file,batch,itemBatch);
+			j.setSuccess(true);
+			j.setErrorCode("0");
+			j.setMsg("导入成功");
+		}
+		} catch (Exception e) {
+			j.setSuccess(false);
+			j.setMsg("导入失败!失败信息:"+e.getMessage());
+		}
+		return j;
+	}
+
+
+    /**
+     * 多文件验证
+     */
+    @ResponseBody
+    @RequestMapping(value = "importValidations")
+    public AjaxJson importValidations(@RequestParam("file")MultipartFile[] file,String batch,String itemBatch){
+        AjaxJson j = new AjaxJson();
+        List<MaterialProject> materialProjects = new ArrayList<>();
+        try {
+            for(int i = 0;i<file.length;i++) {
+                ImportExcel mo = new ImportExcel(file[i], 1, "模块表");
+                Row row = mo.getRow(0);
+                String projectName1 = (String) mo.getCellValue(row, 1);
+                String projectName = projectName1.trim();
+                MaterialProject materialProject = new MaterialProject();
+                materialProject.setReserveProjectName(projectName);
+                materialProjects.add(materialProject);
+            }
+            List<MaterialProject> list = materialProjectService.findByList(materialProjects);
+            if(list != null && list.size()>0){
+            	StringBuilder stringBuilder = new StringBuilder();
+            	for(MaterialProject materialProject : list){
+            		stringBuilder.append(materialProject.getReserveProjectName()+",");
+				}
+            	j.setMsg(stringBuilder.toString());
+                j.setSuccess(true);
+            }else {
+                for(int k=0;k<file.length;k++) {
+                    materialInfoService.export(file[k], batch,itemBatch);
+                }
+                j.setSuccess(true);
+                j.setErrorCode("0");
+                j.setMsg("导入成功");
+            }
+        } catch (Exception e) {
+            j.setSuccess(false);
+            j.setMsg("导入失败!失败信息:"+e.getMessage());
+        }
+        return j;
+    }
+
+
+
+
+
+
+}

+ 210 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/web/MaterialVersionController.java

@@ -0,0 +1,210 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.managementcenter.materialinfo.web;
+
+import com.jeeplus.common.json.AjaxJson;
+import com.jeeplus.common.utils.DateUtils;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.utils.excel.ExportExcel;
+import com.jeeplus.common.utils.excel.ImportExcel;
+import com.jeeplus.core.persistence.Page;
+import com.jeeplus.core.web.BaseController;
+import com.jeeplus.modules.sg.managementcenter.materialinfo.entity.MaterialStandard;
+import com.jeeplus.modules.sg.managementcenter.materialinfo.entity.MaterialVersion;
+import com.jeeplus.modules.sg.managementcenter.materialinfo.service.MaterialVersionService;
+import com.jeeplus.modules.sg.managementcenter.materialproject.entity.MaterialProject;
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
+import org.apache.shiro.authz.annotation.Logical;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
+
+@Controller
+@RequestMapping(value = "${adminPath}/managementcenter/materialversion")
+public class MaterialVersionController extends BaseController {
+
+	@Autowired
+	private MaterialVersionService materialVersionService;
+	
+	
+	@ModelAttribute
+	public MaterialVersion get(@RequestParam(required=false) String id) {
+		MaterialVersion entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = materialVersionService.get(id);
+		}
+		if (entity == null){
+			entity = new MaterialVersion();
+		}
+		return entity;
+	}
+	
+	/**
+	 * 项目列表页面
+	 */
+	@RequiresPermissions("managementcenter:materialversion:list")
+	@RequestMapping(value = {"list", ""})
+	public String list(MaterialVersion materialVersion, Model model) {
+		model.addAttribute("materialVersion", materialVersion);
+		return "modules/sg/managementcenter/materialversion/materialVersionList";
+	}
+	
+		/**
+	 * 列表数据
+	 */
+	@ResponseBody
+	@RequiresPermissions("managementcenter:materialversion:list")
+	@RequestMapping(value = "data")
+	public Map<String, Object> data(MaterialVersion materialVersion, HttpServletRequest request, HttpServletResponse response, Model model) {
+		Page<MaterialVersion> page = materialVersionService.findPage(new Page<MaterialVersion>(request, response), materialVersion);
+		return getBootstrapData(page);
+	}
+
+	/**
+	 * 查看,增加,编辑表单页面
+	 */
+	@RequiresPermissions(value={"managementcenter:materialversion:view","managementcenter:materialversion:add","managementcenter:materialversion:edit"},logical=Logical.OR)
+	@RequestMapping(value = "form")
+	public String form(MaterialVersion materialVersion, Model model) {
+		model.addAttribute("materialVersion", materialVersion);
+		return "modules/sg/managementcenter/materialversion/materialVersionForm";
+	}
+
+	/**
+	 * 保存
+	 */
+	@ResponseBody
+	@RequiresPermissions(value={"managementcenter:materialversion:add","managementcenter:materialversion:edit"},logical=Logical.OR)
+	@RequestMapping(value = "save")
+	public AjaxJson save(MaterialVersion materialVersion, Model model) throws Exception{
+		AjaxJson j = new AjaxJson();
+		/**
+		 * 后台hibernate-validation插件校验
+		 */
+		String errMsg = beanValidator(materialVersion);
+		if (StringUtils.isNotBlank(errMsg)){
+			j.setSuccess(false);
+			j.setMsg(errMsg);
+			return j;
+		}
+		//新增或编辑表单保存
+		materialVersionService.save(materialVersion);//保存
+		j.setSuccess(true);
+		j.setMsg("保存项目成功");
+		return j;
+	}
+
+	/**
+	 * 导入页面跳转
+	 * @param model
+	 * @return
+	 */
+	@RequestMapping(value = "importExcel")
+	public String importExcel(Model model) {
+		return "modules/sg/managementcenter/materialversion/importexcel";
+	}
+
+	/**
+	 *导入
+	 */
+	@ResponseBody
+	@RequiresPermissions("managementcenter:materialversion:import")
+	@RequestMapping(value = "import")
+	public AjaxJson importFile(@RequestParam("file") MultipartFile file, HttpServletResponse response, HttpServletRequest request){
+		String batch = request.getParameter("batch");
+		AjaxJson j = new AjaxJson();
+		try {
+			ImportExcel ei = new ImportExcel(file, 1, 0);
+			List<MaterialStandard> list = ei.getDataList(MaterialStandard.class);
+			for(MaterialStandard materialStandard : list){
+				materialStandard.setBatch(batch);
+			}
+			materialVersionService.saveList(list,batch);
+			j.setMsg( "导入成功");
+		} catch (Exception e) {
+			j.setSuccess(false);
+			j.setMsg("导入失败!失败信息:"+e.getMessage());
+		}
+		return j;
+	}
+
+	/**
+	 * 导入验证,如果批次号存在,则返回,不存在,则直接读入
+	 */
+	@ResponseBody
+	@RequestMapping(value = "importValidation")
+	public AjaxJson importValidation(@RequestParam("file")MultipartFile file,String batch) {
+		AjaxJson j = new AjaxJson();
+		try {
+			MaterialVersion materialVersion = new MaterialVersion();
+			materialVersion.setBatch(batch);
+			List<MaterialVersion> list = materialVersionService.findList(materialVersion);
+			if(list != null && list.size()>0){
+				j.setSuccess(true);
+			}else {
+				ImportExcel ei = new ImportExcel(file, 1, 0);
+				List<MaterialStandard> list1 = ei.getDataList(MaterialStandard.class);
+				for(MaterialStandard materialStandard1 : list1){
+					materialStandard1.setBatch(batch);
+				}
+				materialVersionService.saveList(list1,batch);
+				j.setSuccess(true);
+				j.setErrorCode("0");
+				j.setMsg("导入成功");
+			}
+		} catch (Exception e) {
+			j.setSuccess(false);
+			j.setMsg("导入失败!失败信息:"+e.getMessage());
+		}
+		return j;
+	}
+	
+	/**
+	 * 删除项目
+	 */
+	@ResponseBody
+	@RequiresPermissions("managementcenter:materialversion:del")
+	@RequestMapping(value = "delete")
+	public AjaxJson delete(MaterialVersion materialVersion) {
+		AjaxJson j = new AjaxJson();
+		materialVersionService.delete(materialVersion);
+		j.setMsg("删除项目成功");
+		return j;
+	}
+	
+	/**
+	 * 批量删除
+	 */
+	@ResponseBody
+	@RequiresPermissions("managementcenter:materialversion:del")
+	@RequestMapping(value = "deleteAll")
+	public AjaxJson deleteAll(String ids) {
+		AjaxJson j = new AjaxJson();
+		String idArray[] =ids.split(",");
+		for(String id : idArray){
+			materialVersionService.delete(materialVersionService.get(id));
+		}
+		j.setMsg("删除项目成功");
+		return j;
+	}
+
+
+
+	
+
+
+}

+ 87 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/materialproject/entity/MaterialProject.java

@@ -0,0 +1,87 @@
+package com.jeeplus.modules.sg.managementcenter.materialproject.entity;
+
+import com.jeeplus.common.utils.excel.annotation.ExcelField;
+import com.jeeplus.core.persistence.DataEntity;
+
+public class MaterialProject extends DataEntity<MaterialProject> {
+    private String reserveProjectName;   //储备项目名称
+    private String projectName;       //项目名称
+    private String reserveCode;        //储备编码
+    private String projectCode;       //项目编码
+    private String projectDefine;     //项目定义
+    private String projectAttribute;   //项目属性
+    private String projectBatch;       //项目批次
+    private String suppliesBatch;       //物料批次
+
+
+    @ExcelField(title="储备项目名称", align=2, sort=1)
+    public String getReserveProjectName() {
+        return reserveProjectName;
+    }
+
+    public void setReserveProjectName(String reserveProjectName) {
+        this.reserveProjectName = reserveProjectName;
+    }
+
+    @ExcelField(title="项目名称", align=2, sort=2)
+    public String getProjectName() {
+        return projectName;
+    }
+
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
+    @ExcelField(title="储备编码", align=2, sort=3)
+    public String getReserveCode() {
+        return reserveCode;
+    }
+
+    public void setReserveCode(String reserveCode) {
+        this.reserveCode = reserveCode;
+    }
+
+    @ExcelField(title="项目编码", align=2, sort=4)
+    public String getProjectCode() {
+        return projectCode;
+    }
+
+    public void setProjectCode(String projectCode) {
+        this.projectCode = projectCode;
+    }
+
+    @ExcelField(title="项目定义", align=2, sort=5)
+    public String getProjectDefine() {
+        return projectDefine;
+    }
+
+    public void setProjectDefine(String projectDefine) {
+        this.projectDefine = projectDefine;
+    }
+
+    @ExcelField(title="项目属性", align=2, sort=6)
+    public String getProjectAttribute() {
+        return projectAttribute;
+    }
+
+    public void setProjectAttribute(String projectAttribute) {
+        this.projectAttribute = projectAttribute;
+    }
+
+    @ExcelField(title="项目批次", align=2, sort=7)
+    public String getProjectBatch() {
+        return projectBatch;
+    }
+
+    public void setProjectBatch(String projectBatch) {
+        this.projectBatch = projectBatch;
+    }
+
+    public String getSuppliesBatch() {
+        return suppliesBatch;
+    }
+
+    public void setSuppliesBatch(String suppliesBatch) {
+        this.suppliesBatch = suppliesBatch;
+    }
+}

+ 19 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/materialproject/mapper/MaterialProjectMapper.java

@@ -0,0 +1,19 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.managementcenter.materialproject.mapper;
+
+import com.jeeplus.core.persistence.BaseMapper;
+import com.jeeplus.core.persistence.annotation.MyBatisMapper;
+import com.jeeplus.modules.sg.managementcenter.materialproject.entity.MaterialProject;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+
+@MyBatisMapper
+public interface MaterialProjectMapper extends BaseMapper<MaterialProject> {
+    List<MaterialProject> findBatch();
+    List<MaterialProject> findByList(@Param("list") List<MaterialProject> list);
+
+}

+ 181 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/materialproject/mapper/xml/MaterialProjectMapper.xml

@@ -0,0 +1,181 @@
+<?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.sg.managementcenter.materialproject.mapper.MaterialProjectMapper">
+    
+	<sql id="infoColumns">
+		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.reserve_project_name AS "reserveProjectName",
+		a.project_name AS "projectName",
+		a.reserve_code AS "reserveCode",
+		a.project_code AS "projectCode",
+		a.project_define AS "projectDefine",
+		a.project_attribute AS "projectAttribute",
+		a.project_batch AS "projectBatch",
+		a.supplies_batch AS "suppliesBatch"
+	</sql>
+
+    
+	<select id="get" resultType="MaterialProject" >
+		SELECT 
+			<include refid="infoColumns"/>
+		FROM xm_material_project a
+		WHERE a.id = #{id}
+	</select>
+	
+	<select id="findList" resultType="MaterialProject" >
+		SELECT 
+			<include refid="infoColumns"/>
+		FROM xm_material_project a
+		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+			${dataScope}
+			<if test="reserveProjectName != null and reserveProjectName != ''">
+				AND a.reserve_project_name = #{reserveProjectName}
+			</if>
+			<if test="projectName != null and projectName != ''">
+				AND a.project_name = #{projectName}
+			</if>
+			<if test="reserveCode != null and reserveCode != ''">
+				AND a.reserve_code = #{reserveCode}
+			</if>
+			<if test="projectCode != null and projectCode != ''">
+				AND a.project_code = #{projectCode}
+			</if>
+			<if test="projectDefine != null and projectDefine !=''">
+				AND a.project_define = #{projectDefine}
+			</if>
+			<if test="projectAttribute != null and projectAttribute != ''">
+				AND a.project_attribute = #{projectAttribute}
+			</if>
+			<if test="projectBatch != null and projectBatch != ''">
+				AND a.project_batch = #{projectBatch}
+			</if>
+			<if test="suppliesBatch != null and suppliesBatch !=''">
+				AND a.supplies_batch = #{suppliesBatch}
+			</if>
+
+		</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="findByList" resultType="MaterialProject">
+		SELECT
+		<include refid="infoColumns"/>
+		FROM xm_material_project a
+		<where>
+			a.reserve_project_name in
+			<foreach collection="list" item="item" open="(" close=")" separator=",">
+				#{item.reserveProjectName}
+			</foreach>
+		</where>
+	</select>
+	
+	<select id="findAllList" resultType="MaterialProject" >
+		SELECT 
+			<include refid="infoColumns"/>
+		FROM xm_material_project a
+		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+			${dataScope}
+		</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="findBatch" resultType="MaterialProject">
+		SELECT DISTINCT(batch) AS suppliesBatch
+		from  xm_material_standard
+	</select>
+	
+	<insert id="insert">
+		INSERT INTO xm_material_project(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag,
+			reserve_project_name ,
+		    project_name ,
+		    reserve_code ,
+		    project_code ,
+		    project_define ,
+		    project_attribute ,
+		    project_batch ,
+		    supplies_batch
+		) VALUES (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag},
+			#{reserveProjectName},
+			#{projectName},
+			#{reserveCode},
+			#{projectCode},
+			#{projectDefine},
+			#{projectAttribute},
+			#{projectBatch},
+			#{suppliesBatch}
+		)
+	</insert>
+	
+	<update id="update">
+		UPDATE xm_material_project SET
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			remarks = #{remarks},
+			reserve_project_name = #{reserveProjectName},
+			project_name = #{projectName},
+			reserve_code = #{reserveCode},
+			project_code = #{projectCode},
+			project_define = #{projectDefine},
+			project_attribute = #{projectAttribute},
+			project_batch = #{projectBatch},
+			supplies_batch = #{suppliesBatch}
+		WHERE id = #{id}
+	</update>
+	
+	
+	<!--物理删除-->
+	<update id="delete">
+		DELETE FROM xm_material_project
+		WHERE id = #{id}
+	</update>
+	
+	<!--逻辑删除-->
+	<update id="deleteByLogic">
+		UPDATE xm_material_project SET
+			del_flag = #{DEL_FLAG_DELETE}
+		WHERE id = #{id}
+	</update>
+	
+	
+	<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
+	<select id="findUniqueByProperty" resultType="TestNote" statementType="STATEMENT">
+		select * FROM xm_material_project  where ${propertyName} = '${value}'
+	</select>
+	
+</mapper>

+ 57 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/materialproject/service/MaterialProjectService.java

@@ -0,0 +1,57 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.managementcenter.materialproject.service;
+
+import com.jeeplus.core.persistence.Page;
+import com.jeeplus.core.service.CrudService;
+import com.jeeplus.modules.sg.managementcenter.materialinfo.service.MaterialInfoService;
+import com.jeeplus.modules.sg.managementcenter.materialproject.entity.MaterialProject;
+import com.jeeplus.modules.sg.managementcenter.materialproject.mapper.MaterialProjectMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+
+@Service
+@Transactional(readOnly = true)
+public class MaterialProjectService extends CrudService<MaterialProjectMapper, MaterialProject> {
+	@Autowired
+	private MaterialProjectMapper materialProjectMapper;
+	@Autowired
+	private MaterialInfoService materialInfoService;
+
+	public MaterialProject get(String id) {
+		return super.get(id);
+	}
+	
+	public List<MaterialProject> findList(MaterialProject materialProject) {
+		return super.findList(materialProject);
+	}
+
+	public List<MaterialProject> findBatch(){
+		return materialProjectMapper.findBatch();
+	}
+
+	public List<MaterialProject> findByList(List<MaterialProject> list){
+		return materialProjectMapper.findByList(list);
+	}
+	
+	public Page<MaterialProject> findPage(Page<MaterialProject> page, MaterialProject materialProject) {
+		return super.findPage(page, materialProject);
+	}
+	
+	@Transactional(readOnly = false)
+	public void save(MaterialProject materialProject) {
+		super.save(materialProject);
+	}
+	
+	@Transactional(readOnly = false)
+	public void delete(MaterialProject materialProject) {
+		super.delete(materialProject);
+		materialInfoService.deleteByPro(materialProject.getReserveProjectName());
+	}
+	
+}

+ 198 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/materialproject/web/MaterialProjectController.java

@@ -0,0 +1,198 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.managementcenter.materialproject.web;
+
+import com.google.common.collect.Lists;
+import com.jeeplus.common.json.AjaxJson;
+import com.jeeplus.common.utils.DateUtils;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.utils.excel.ExportExcel;
+import com.jeeplus.common.utils.excel.ImportExcel;
+import com.jeeplus.core.persistence.Page;
+import com.jeeplus.core.web.BaseController;
+import com.jeeplus.modules.sg.managementcenter.materialinfo.entity.MaterialInfo;
+import com.jeeplus.modules.sg.managementcenter.materialinfo.service.MaterialInfoService;
+import com.jeeplus.modules.sg.managementcenter.materialproject.entity.MaterialProject;
+import com.jeeplus.modules.sg.managementcenter.materialproject.service.MaterialProjectService;
+import org.apache.shiro.authz.annotation.Logical;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.ConstraintViolationException;
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
+
+@Controller
+@RequestMapping(value = "${adminPath}/managementcenter/materialproject")
+public class MaterialProjectController extends BaseController {
+
+	@Autowired
+	private MaterialProjectService materialProjectService;
+	@Autowired
+	private MaterialInfoService materialInfoService;
+	
+	@ModelAttribute
+	public MaterialProject get(@RequestParam(required=false) String id) {
+		MaterialProject entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = materialProjectService.get(id);
+		}
+		if (entity == null){
+			entity = new MaterialProject();
+		}
+		return entity;
+	}
+	
+	/**
+	 * 项目列表页面
+	 */
+	@RequiresPermissions("managementcenter:materialproject:list")
+	@RequestMapping(value = {"list", ""})
+	public String list(MaterialProject materialProject, Model model) {
+		model.addAttribute("materialProject", materialProject);
+		return "modules/sg/managementcenter/materialproject/materialProjectList";
+	}
+	
+		/**
+	 * 列表数据
+	 */
+	@ResponseBody
+	@RequiresPermissions("managementcenter:materialproject:list")
+	@RequestMapping(value = "data")
+	public Map<String, Object> data(MaterialProject materialProject, HttpServletRequest request, HttpServletResponse response, Model model) {
+		Page<MaterialProject> page = materialProjectService.findPage(new Page<MaterialProject>(request, response), materialProject);
+		return getBootstrapData(page);
+	}
+
+	/**
+	 * 查看,增加,编辑表单页面
+	 */
+	@RequiresPermissions(value={"managementcenter:materialproject:view","managementcenter:materialproject:add","managementcenter:materialproject:edit"},logical=Logical.OR)
+	@RequestMapping(value = "form")
+	public String form(MaterialProject materialProject, Model model) {
+		List<MaterialProject> list = materialProjectService.findBatch();
+		model.addAttribute("batch",list);
+		model.addAttribute("materialProject", materialProject);
+		return "modules/sg/managementcenter/materialproject/materialProjectForm";
+	}
+
+	/**
+	 * 保存
+	 */
+	@ResponseBody
+	@RequiresPermissions(value={"managementcenter:materialproject:add","managementcenter:materialproject:edit"},logical=Logical.OR)
+	@RequestMapping(value = "save")
+	public AjaxJson save(MaterialProject materialProject, Model model) throws Exception{
+		AjaxJson j = new AjaxJson();
+		/**
+		 * 后台hibernate-validation插件校验
+		 */
+		String errMsg = beanValidator(materialProject);
+		if (StringUtils.isNotBlank(errMsg)){
+			j.setSuccess(false);
+			j.setMsg(errMsg);
+			return j;
+		}
+		//新增或编辑表单保存
+		materialProjectService.save(materialProject);//保存
+		j.setSuccess(true);
+		j.setMsg("保存项目成功");
+		return j;
+	}
+	
+	/**
+	 * 删除项目
+	 */
+	@ResponseBody
+	@RequiresPermissions("managementcenter:materialproject:del")
+	@RequestMapping(value = "delete")
+	public AjaxJson delete(MaterialProject materialProject) {
+		AjaxJson j = new AjaxJson();
+		materialProjectService.delete(materialProject);
+		j.setMsg("删除项目成功");
+		return j;
+	}
+	
+	/**
+	 * 批量删除
+	 */
+	@ResponseBody
+	@RequiresPermissions("managementcenter:materialproject:del")
+	@RequestMapping(value = "deleteAll")
+	public AjaxJson deleteAll(String ids) {
+		AjaxJson j = new AjaxJson();
+		String idArray[] =ids.split(",");
+		for(String id : idArray){
+			materialProjectService.delete(materialProjectService.get(id));
+		}
+		j.setMsg("删除项目成功");
+		return j;
+	}
+	
+	/**
+	 * 物料列表导出
+	 */
+	@ResponseBody
+	@RequiresPermissions("managementcenter:materialproject:export")
+    @RequestMapping(value = "export")
+    public AjaxJson exportFile(MaterialProject materialProject, HttpServletRequest request, HttpServletResponse response) throws IOException {
+		AjaxJson j = new AjaxJson();
+		try {
+            String fileName = "物料"+DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
+            List<MaterialProject> list = materialProjectService.findList(materialProject);
+            List<MaterialInfo> materialInfos = materialInfoService.findByBatch(list);
+    		new ExportExcel(null, MaterialInfo.class).setDataList(materialInfos).write(response, fileName).dispose();
+    		j.setSuccess(true);
+    		j.setMsg("导出成功!");
+    		return j;
+		} catch (Exception e) {
+			j.setSuccess(false);
+			j.setMsg("导出失败!失败信息:"+e.getMessage());
+		}
+			return j;
+    }
+
+	/**
+	 * 项目列表导出
+	 * @param materialProject
+	 * @param request
+	 * @param response
+	 * @return
+	 */
+	@ResponseBody
+	@RequiresPermissions("managementcenter:materialproject:export")
+	@RequestMapping(value = "exportpro")
+	public AjaxJson exportPro(MaterialProject materialProject, HttpServletRequest request, HttpServletResponse response) {
+		AjaxJson j = new AjaxJson();
+		try {
+			String fileName = "项目列表"+DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
+//			Page<MaterialProject> page = materialProjectService.findPage(new Page<MaterialProject>(request, response, -1), materialProject);
+			List<MaterialProject> list = materialProjectService.findList(materialProject);
+			new ExportExcel(null, MaterialProject.class).setDataList(list).write(response, fileName).dispose();
+			j.setSuccess(true);
+			j.setMsg("导出成功!");
+			return j;
+		} catch (Exception e) {
+			j.setSuccess(false);
+			j.setMsg("导出失败!失败信息:"+e.getMessage());
+		}
+		return j;
+	}
+
+
+	
+
+
+}

BIN
src/main/resources/freemarker/excelmodel/竣工决算模板.xlsx


+ 1 - 1
src/main/resources/j2cache/j2cache.properties

@@ -89,7 +89,7 @@ redis.namespace =
 
 ## connection
 #redis.hosts = 127.0.0.1:6379
-redis.hosts = 192.168.2.4:6379
+redis.hosts = 192.168.2.4:6380
 redis.timeout = 2000
 redis.password =
 redis.database = 0

+ 1 - 1
src/main/resources/properties/jeeplus.properties

@@ -14,7 +14,7 @@
 #mysql database setting
 jdbc.type=mysql
 jdbc.driver=com.mysql.jdbc.Driver
-jdbc.url=jdbc:mysql://192.168.2.4:3306/sg_audit?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
+jdbc.url=jdbc:mysql://192.168.2.4:3306/sg_audit?useUnicode=true&amp;characterEncoding=utf-8&allowMultiQueries=true
 #jdbc.url=jdbc:mysql://localhost:3306/sg_audit?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
 jdbc.username=root
 jdbc.password=root

+ 44 - 51
src/main/webapp/webpage/modules/sg/audit/information/informationList.js

@@ -92,10 +92,10 @@ $(document).ready(function() {
 		        sortName: 'project_type'
 		    }
 		   ,{
-			   field: 'outConstruction',
+			   field: 'appendStatus',
 			   title: '工作</br>状态',
 			   width:'60px',
-			   sortName: 'outConstruction'
+			   sortName: 'appendStatus'
 		   }
 		   ,{
 			   field: 'approvalDate',
@@ -168,8 +168,8 @@ $(document).ready(function() {
 		   }
 		   ,{
 			   field: 'underCentralized',
-			   title: '归口</br>部门',
-			   width:'60px',
+			   title: '归口部门',
+			   width:'120px',
 			   sortName: 'underCentralized'
 		   }
 			,{
@@ -203,15 +203,15 @@ $(document).ready(function() {
 			   sortName: 'project_stop'
 		   }
 		   ,{
-			   field: 'construction',
+			   field: 'department',
 			   title: '施工</br>单位',
 			   width:'60px',
-			   sortName: 'construction'
+			   sortName: 'department'
 		   }
 		   ,{
 			   field: 'projectFirm',
-			   title: '事务所</br>名称',
-			   width:'60px',
+			   title: '结算审计</br>单位名称',
+			   width:'100px',
 			   sortName: 'project_firm'
 		   }
 		   ,{
@@ -238,13 +238,6 @@ $(document).ready(function() {
 			   width:'100px',
 			   sortName: 'resultDate'
 		   }
-
-		   ,{
-			   field: 'settlement',
-			   title: '结算单位',
-			   width:'100px',
-			   sortName: 'settlement'
-		   }
 			,{
 			   field: 'operate',
 			   title: '操作',
@@ -423,17 +416,17 @@ $(document).ready(function() {
 
 //导出物料清单
 	$("#export").click(function(){
-		var projectId = $("#projectId").val();
-		var projectName = $("#projectName").val();
-		var projectType = $("#projectType").val();
-		var projectYear = $("#projectYear").val();
-		var firstUnits = $("#firstUnits").val();
-		var secondUnits = $("#secondUnits").val();
-		var firstFinish = $("#firstFinish").val();
-		var extendedStatus = $("#extendedStatus").val();
-		var extendedTime = $("#extendedTime").val();
-		var hiddenSign = $("#hiddenSign").val();
-		console.log(projectId );
+		var projectId = encodeURI(encodeURI($("#projectId").val()));
+		var projectName = encodeURI(encodeURI($("#projectName").val()));
+		var projectType = encodeURI(encodeURI($("#projectType").val()));
+		var projectYear = encodeURI(encodeURI($("#projectYear").val()));
+		var firstUnits = encodeURI(encodeURI($("#firstUnits").val()));
+		var secondUnits = encodeURI(encodeURI($("#secondUnits").val()));
+		var firstFinish = encodeURI(encodeURI($("#firstFinish").val()));
+		var extendedStatus = encodeURI(encodeURI($("#extendedStatus").val()));
+		var extendedTime = encodeURI(encodeURI($("#extendedTime").val()));
+		var hiddenSign = encodeURI(encodeURI($("#hiddenSign").val()));
+/*		console.log(projectId );
 		console.log(projectName);
 		console.log(projectType);
 		console.log(projectYear);
@@ -442,23 +435,23 @@ $(document).ready(function() {
 		console.log(firstFinish);
 		console.log(extendedStatus);
 		console.log(extendedTime);
-		console.log(hiddenSign);
+		console.log(hiddenSign);*/
 		jp.downloadFile('${ctx}/sg/information/exportMaterial?projectId='+projectId+'&projectName='+projectName+'&projectType='+projectType+'&projectYear='+projectYear+'&firstUnits='+firstUnits+'&secondUnits='+secondUnits+'&firstFinish='+firstFinish+'&extendedStatus='+extendedStatus+'&extendedTime='+extendedTime+'&hiddenSign='+hiddenSign);
 	});
 
 //导出项目清单
 	$("#exportMaterial").click(function(){
-		var projectId = $("#projectId").val();
-		var projectName = $("#projectName").val();
-		var projectType = $("#projectType").val();
-		var projectYear = $("#projectYear").val();
-		var firstUnits = $("#firstUnits").val();
-		var secondUnits = $("#secondUnits").val();
-		var firstFinish = $("#firstFinish").val();
-		var extendedStatus = $("#extendedStatus").val();
-		var extendedTime = $("#extendedTime").val();
-		var hiddenSign = $("#hiddenSign").val();
-		console.log(projectId );
+		var projectId = encodeURI(encodeURI($("#projectId").val()));
+		var projectName = encodeURI(encodeURI($("#projectName").val()));
+		var projectType = encodeURI(encodeURI($("#projectType").val()));
+		var projectYear = encodeURI(encodeURI($("#projectYear").val()));
+		var firstUnits = encodeURI(encodeURI($("#firstUnits").val()));
+		var secondUnits = encodeURI(encodeURI($("#secondUnits").val()));
+		var firstFinish = encodeURI(encodeURI($("#firstFinish").val()));
+		var extendedStatus = encodeURI(encodeURI($("#extendedStatus").val()));
+		var extendedTime = encodeURI(encodeURI($("#extendedTime").val()));
+		var hiddenSign = encodeURI(encodeURI($("#hiddenSign").val()));
+/*		console.log(projectId );
 		console.log(projectName);
 		console.log(projectType);
 		console.log(projectYear);
@@ -467,24 +460,24 @@ $(document).ready(function() {
 		console.log(firstFinish);
 		console.log(extendedStatus);
 		console.log(extendedTime);
-		console.log(hiddenSign);
+		console.log(hiddenSign);*/
 		jp.downloadFile('${ctx}/sg/information/export?projectId='+projectId+'&projectName='+projectName+'&projectType='+projectType+'&projectYear='+projectYear+'&firstUnits='+firstUnits+'&secondUnits='+secondUnits+'&firstFinish='+firstFinish+'&extendedStatus='+extendedStatus+'&extendedTime='+extendedTime+'&hiddenSign='+hiddenSign);
 
 	});
 
 //导出说明word
 	$("#exportInformation").click(function(){
-		var projectId = $("#projectId").val();
-		var projectName = $("#projectName").val();
-		var projectType = $("#projectType").val();
-		var projectYear = $("#projectYear").val();
-		var firstUnits = $("#firstUnits").val();
-		var secondUnits = $("#secondUnits").val();
-		var firstFinish = $("#firstFinish").val();
-		var extendedStatus = $("#extendedStatus").val();
-		var extendedTime = $("#extendedTime").val();
-		var hiddenSign = $("#hiddenSign").val();
-		console.log(projectId );
+		var projectId = encodeURI(encodeURI($("#projectId").val()));
+		var projectName = encodeURI(encodeURI($("#projectName").val()));
+		var projectType = encodeURI(encodeURI($("#projectType").val()));
+		var projectYear = encodeURI(encodeURI($("#projectYear").val()));
+		var firstUnits = encodeURI(encodeURI($("#firstUnits").val()));
+		var secondUnits = encodeURI(encodeURI($("#secondUnits").val()));
+		var firstFinish = encodeURI(encodeURI($("#firstFinish").val()));
+		var extendedStatus = encodeURI(encodeURI($("#extendedStatus").val()));
+		var extendedTime = encodeURI(encodeURI($("#extendedTime").val()));
+		var hiddenSign = encodeURI(encodeURI($("#hiddenSign").val()));
+/*		console.log(projectId );
 		console.log(projectName);
 		console.log(projectType);
 		console.log(projectYear);
@@ -493,7 +486,7 @@ $(document).ready(function() {
 		console.log(firstFinish);
 		console.log(extendedStatus);
 		console.log(extendedTime);
-		console.log(hiddenSign);
+		console.log(hiddenSign);*/
 		jp.downloadFile('${ctx}/sg/information/exportInformation?projectId='+projectId+'&projectName='+projectName+'&projectType='+projectType+'&projectYear='+projectYear+'&firstUnits='+firstUnits+'&secondUnits='+secondUnits+'&firstFinish='+firstFinish+'&extendedStatus='+extendedStatus+'&extendedTime='+extendedTime+'&hiddenSign='+hiddenSign);
 	});
 

+ 19 - 2
src/main/webapp/webpage/modules/sg/audit/report/reportList.jsp

@@ -25,6 +25,7 @@
 		<ul class="nav nav-tabs">
 			<li role="presentation" class="active"><a href="">按施工单位</a></li>
 			<li role="presentation"><a href="${ctx}/sg/report/unitlist">按归口部门</a></li>
+			<li role="presentation"><a href="${ctx}/sg/report/secondlist">按二级单位</a> </li>
 		</ul>
 		</div>
 		
@@ -45,13 +46,13 @@
 			<tr>
 				<th>完成</th>
 				<c:forEach items="${list}" var="data" varStatus="index">
-				<th>${data.finishCount}</th>
+					<th><a class="finish"><input class="finishOne" type="hidden" value="${data.name}"/>${data.finishCount}</a></th>
 				</c:forEach>
 			</tr>
 			<tr>
 				<th>未完成</th>
 				<c:forEach items="${list}" var="data" varStatus="index">
-				<th>${data.unfinishCount}</th>
+					<th><a class="noFinish"><input class="finishOne" type="hidden" value="${data.name}"/>${data.unfinishCount}</a></th>
 				</c:forEach>
 			</tr>
 			</thead>
@@ -120,6 +121,22 @@
 					// 使用刚指定的配置项和数据显示图表。
 					myChart.setOption(option);
 				})
+				//点击完成的数量导出对应项目文件
+				$(".finish").on("click", function () {
+					var conditionBe = $(this).find("input").val();
+					var condition = encodeURI(encodeURI(conditionBe));
+					console.log(conditionBe);
+					console.log(condition);
+					jp.downloadFile('${ctx}/sg/report/exportInformation?condition=' + condition + '&status=0&type=0')
+				});
+				//点击为完成的数量导出对应项目文件
+				$(".noFinish").click(function () {
+					var conditionBe = $(this).find("input").val();
+					var condition = encodeURI(encodeURI(conditionBe));
+					console.log(conditionBe);
+					console.log(condition);
+					jp.downloadFile('${ctx}/sg/report/exportInformation?condition=' + condition + '&status=1&type=0');
+				})
 			})
 		</script>
 	</div>

+ 20 - 2
src/main/webapp/webpage/modules/sg/audit/report/reportList1.jsp

@@ -25,6 +25,7 @@
 		<ul class="nav nav-tabs">
 			<li role="presentation"><a href="${ctx}/sg/report/">按施工单位</a></li>
 			<li role="presentation" class="active"><a href="#">按归口部门</a></li>
+			<li role="presentation"><a href="${ctx}/sg/report/secondlist">按二级单位</a> </li>
 		</ul>
 		</div>
 		
@@ -45,13 +46,13 @@
 			<tr>
 				<th>完成</th>
 				<c:forEach items="${list}" var="data" varStatus="index">
-				<th>${data.finishCount}</th>
+					<th><a class="finish"><input class="finishOne" type="hidden" value="${data.name}"/>${data.finishCount}</a></th>
 				</c:forEach>
 			</tr>
 			<tr>
 				<th>未完成</th>
 				<c:forEach items="${list}" var="data" varStatus="index">
-				<th>${data.unfinishCount}</th>
+					<th><a class="noFinish"><input class="finishOne" type="hidden" value="${data.name}"/>${data.unfinishCount}</a></th>
 				</c:forEach>
 			</tr>
 			</thead>
@@ -120,6 +121,23 @@
 					// 使用刚指定的配置项和数据显示图表。
 					myChart.setOption(option);
 				})
+
+				//点击完成的数量导出对应项目文件
+				$(".finish").click(function () {
+					var conditionBe = $(this).find("input").val();
+					var condition = encodeURI(encodeURI(conditionBe));
+					console.log(conditionBe);
+					console.log(condition);
+					jp.downloadFile('${ctx}/sg/report/exportInformation?condition='+condition+'&status=0&type=1')
+				})
+				//点击为完成的数量导出对应项目文件
+				$(".noFinish").click(function () {
+					var conditionBe = $(this).find("input").val();
+					var condition = encodeURI(encodeURI(conditionBe));
+					console.log(conditionBe);
+					console.log(condition);
+					jp.downloadFile('${ctx}/sg/report/exportInformation?condition='+condition+'&status=1&type=1')
+				})
 			})
 		</script>
 	</div>

+ 147 - 0
src/main/webapp/webpage/modules/sg/audit/report/reportList2.jsp

@@ -0,0 +1,147 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>项目报表</title>
+	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
+	<meta name="decorator" content="ani"/>
+	<%@ include file="/webpage/include/bootstraptable.jsp"%>
+	<%@ include file="/webpage/include/echarts.jsp"%>
+	<%--<%@include file="reportList.js" %>--%>
+	<style type="text/css">
+		#div1{
+			margin-top: 10px;
+		}
+	</style>
+</head>
+<body>
+	<div class="wrapper wrapper-content">
+	<div class="panel panel-primary">
+	<div class="panel-heading">
+		<h3 class="panel-title">项目报表</h3>
+	</div>
+	<div class="panel-body">
+		<div>
+		<ul class="nav nav-tabs">
+			<li role="presentation"><a href="${ctx}/sg/report/">按施工单位</a></li>
+			<li role="presentation"><a href="${ctx}/sg/report/unitlist">按归口部门</a></li>
+			<li role="presentation" class="active"><a href="#">按二级单位</a> </li>
+		</ul>
+		</div>
+		
+	<!-- 表格 -->
+	<%--<table id="reportTable"   data-toolbar="#toolbar"></table>--%>
+
+    <!-- context menu -->
+		<div id="div1">
+		<table class="table table-bordered">
+
+            <thead>
+			<tr>
+				<th> </th>
+				<c:forEach items="${list}" var="data" varStatus="index">
+				<th>${data.name}</th>
+				</c:forEach>
+			</tr>
+			<tr>
+				<th>完成</th>
+				<c:forEach items="${list}" var="data" varStatus="index">
+					<th><a class="finish"><input class="finishOne" type="hidden" value="${data.name}"/>${data.finishCount}</a></th>
+				</c:forEach>
+			</tr>
+			<tr>
+				<th>未完成</th>
+				<c:forEach items="${list}" var="data" varStatus="index">
+					<th><a class="noFinish"><input class="finishOne" type="hidden" value="${data.name}"/>${data.unfinishCount}</a></th>
+				</c:forEach>
+			</tr>
+			</thead>
+		</table>
+		</div>
+
+		<%--<table class="table table-bordered">--%>
+
+			<%--<thead>--%>
+			<%--<tr>--%>
+				<%--<th> </th>--%>
+				<%--<c:forEach items="${list1}" var="data" varStatus="index">--%>
+					<%--<th>${data.name}</th>--%>
+				<%--</c:forEach>--%>
+			<%--</tr>--%>
+			<%--<tr>--%>
+				<%--<th>1-7天</th>--%>
+				<%--<c:forEach items="${list1}" var="data" varStatus="index">--%>
+					<%--<th>${data.level1}</th>--%>
+				<%--</c:forEach>--%>
+			<%--</tr>--%>
+			<%--<tr>--%>
+				<%--<th>8-14天</th>--%>
+				<%--<c:forEach items="${list1}" var="data" varStatus="index">--%>
+					<%--<th>${data.level2}</th>--%>
+				<%--</c:forEach>--%>
+			<%--</tr>--%>
+			<%--<tr>--%>
+				<%--<th>15-21天</th>--%>
+				<%--<c:forEach items="${list1}" var="data" varStatus="index">--%>
+					<%--<th>${data.level3}</th>--%>
+				<%--</c:forEach>--%>
+			<%--</tr>--%>
+			<%--<tr>--%>
+				<%--<th>21天以上</th>--%>
+				<%--<c:forEach items="${list1}" var="data" varStatus="index">--%>
+					<%--<th>${data.level4}</th>--%>
+				<%--</c:forEach>--%>
+			<%--</tr>--%>
+
+			<%--</thead>--%>
+
+
+		<%--</table>--%>
+		<div class="btn-group" role="group" aria-label="...">
+			<div class="btn-group" role="group">
+				<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+					项目状态
+					<span class="caret"></span>
+				</button>
+				<ul class="dropdown-menu">
+					<li><a href="${ctx}/sg/report/secondlist?status=1">完成</a></li>
+					<li><a href="${ctx}/sg/report/secondlist?status=0">未完成</a></li>
+				</ul>
+			</div>
+		</div>
+		<div id="main" style="width: 100%;height: 400px"></div>
+		<script type="text/javascript">
+			// 基于准备好的dom,初始化echarts实例4
+			var myChart = echarts.init(document.getElementById('main'));
+			window.onresize = myChart.resize;
+
+			$(function () {
+				jp.get("${ctx}${dataURL}", function (option) {
+					// 指定图表的配置项和数据
+					// 使用刚指定的配置项和数据显示图表。
+					myChart.setOption(option);
+				})
+
+				//点击完成的数量导出对应项目文件
+				$(".finish").click(function () {
+					var conditionBe = $(this).find("input").val();
+					var condition = encodeURI(encodeURI(conditionBe));
+					console.log(conditionBe);
+					console.log(condition);
+					jp.downloadFile('${ctx}/sg/report/exportInformation?condition='+condition+'&status=0&type=2')
+				})
+				//点击为完成的数量导出对应项目文件
+				$(".noFinish").click(function () {
+					var conditionBe = $(this).find("input").val();
+					var condition = encodeURI(encodeURI(conditionBe));
+					console.log(conditionBe);
+					console.log(condition);
+					jp.downloadFile('${ctx}/sg/report/exportInformation?condition='+condition+'&status=1&type=2')
+				})
+			})
+		</script>
+	</div>
+	</div>
+	</div>
+</body>
+</html>

+ 265 - 0
src/main/webapp/webpage/modules/sg/financial/erp/erpCreditForm.jsp

@@ -0,0 +1,265 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>新增ERP账户</title>
+	<meta name="decorator" content="ani"/>
+	<script type="text/javascript">
+
+		$(document).ready(function() {
+	        $('#inDate').datetimepicker({
+				 format: "YYYY-MM-DD HH:mm:ss"
+		    });
+		});
+
+		function save() {
+            var isValidate = jp.validateForm('#inputForm');//校验表单
+            if(!isValidate){
+                return false;
+			}else{
+                jp.loading();
+                jp.post("${ctx}/sg/financial/erpCredit/save",$('#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);
+                    }
+                })
+			}
+
+        }
+		function addRow(list, idx, tpl, row){
+			$(list).append(Mustache.render(tpl, {
+				idx: idx, delBtn: true, row: row
+			}));
+			$(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");
+					}
+				}
+			});
+			$(list+idx).find(".form_datetime").each(function(){
+				 $(this).datetimepicker({
+					 format: "YYYY-MM-DD HH:mm:ss"
+			    });
+			});
+		}
+		function delRow(obj, prefix){
+			var id = $(prefix+"_id");
+			var delFlag = $(prefix+"_delFlag");
+			if (id.val() == ""){
+				$(obj).parent().parent().remove();
+			}else if(delFlag.val() == "0"){
+				delFlag.val("1");
+				$(obj).html("&divide;").attr("title", "撤销删除");
+				$(obj).parent().parent().addClass("error");
+			}else if(delFlag.val() == "1"){
+				delFlag.val("0");
+				$(obj).html("&times;").attr("title", "删除");
+				$(obj).parent().parent().removeClass("error");
+			}
+		}
+	</script>
+</head>
+<body class="bg-white">
+		<form:form id="inputForm" modelAttribute="erpCredit" action="${ctx}/sg/financial/erpCredit/save" method="post" 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 path="itemId" htmlEscape="false" class="form-control required"/>
+					</td>
+					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>项目名称:</label></td>
+					<td class="width-35">
+						<form:input path="itemName" htmlEscape="false"    class="form-control required"/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="">实际投资:</label></td>
+					<td class="width-35">
+						<form:input path="actualInvestment" htmlEscape="false"    class="form-control"/>
+					</td>
+					<td class="width-15 active"><label class="">移交生产的资产总值:</label></td>
+					<td class="width-35">
+						<form:input path="transferAssets" htmlEscape="false"    class="form-control"/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="">建筑费:</label></td>
+					<td class="width-35">
+						<form:input path="consBuildingFee" htmlEscape="false"    class="form-control"/>
+					</td>
+					<td class="width-15 active"><label class="">安装费:</label></td>
+					<td class="width-35">
+						<form:input path="consInstallFee" htmlEscape="false"    class="form-control"/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="">施工费:合计:</label></td>
+					<td class="width-35">
+						<form:input path="consTotalFee" htmlEscape="false"    class="form-control"/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="">监理费:</label></td>
+					<td class="width-35">
+						<form:input path="otherSupervisorFee" htmlEscape="false"    class="form-control"/>
+					</td>
+					<td class="width-15 active"><label class="">设计费:</label></td>
+					<td class="width-35">
+						<form:input path="otherDesignFee" htmlEscape="false"    class="form-control"/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="">项目前期工作费:</label></td>
+					<td class="width-35">
+						<form:input path="otherBeWorkFee" htmlEscape="false"    class="form-control"/>
+					</td>
+					<td class="width-15 active"><label class="">建设期贷款利息:</label></td>
+					<td class="width-35">
+						<form:input path="otherBuildLoan" htmlEscape="false"    class="form-control"/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="">线路施工赔偿费:</label></td>
+					<td class="width-35">
+						<form:input path="otherLineDamages" htmlEscape="false"    class="form-control"/>
+					</td>
+					<td class="width-15 active"><label class="">法人管理费:</label></td>
+					<td class="width-35">
+						<form:input path="otherLegalManage" htmlEscape="false"    class="form-control"/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="">其他费用:合计:</label></td>
+					<td class="width-35">
+						<form:input path="otherTotalFee" htmlEscape="false"    class="form-control"/>
+					</td>
+				</tr>
+		 	</tbody>
+		</table>
+		<div class="tabs-container">
+            <ul class="nav nav-tabs">
+				<li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true">设备费</a>
+                </li>
+				<li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">材料费</a>
+                </li>
+            </ul>
+            <div class="tab-content">
+				<div id="tab-1" class="tab-pane fade in  active">
+			<a class="btn btn-white btn-sm" onclick="addRow('#testDataChild11List', testDataChild11RowIdx, testDataChild11Tpl);testDataChild11RowIdx = testDataChild11RowIdx + 1;" title="新增"><i class="fa fa-plus"></i> 新增</a>
+			<table class="table table-striped table-bordered table-condensed">
+				<thead>
+					<tr>
+						<th class="hide"></th>
+						<th><font color="red">*</font>物料描述</th>
+						<th>单位</th>
+						<th>台数</th>
+						<th>总容量(千伏安)</th>
+						<th>入账金额(不含税价)</th>
+						<th width="10">&nbsp;</th>
+					</tr>
+				</thead>
+				<tbody id="testDataChild11List">
+				</tbody>
+			</table>
+			<script type="text/template" id="testDataChild11Tpl">
+				<tr id="testDataChild11List{{idx}}">
+					<td class="hide">
+						<input id="testDataChild11List{{idx}}_id" name="erpCreditChild1s[{{idx}}].id" type="hidden" value="{{row.id}}"/>
+						<input id="testDataChild11List{{idx}}_delFlag" name="erpCreditChild1s[{{idx}}].delFlag" type="hidden" value="0"/>
+					</td>
+					<td  class="max-width-250">
+						<input  name="erpCreditChild1s[{{idx}}].eqmMaterialDetails1" class="form-control required" type="text" value="{{row.eqmMaterialDetails1}}"/>
+					</td>
+					<td  class="max-width-250">
+						<input  name="erpCreditChild1s[{{idx}}].eqmUnit" class="form-control" type="text" value="{{row.eqmUnit}}"/>
+					</td>
+					<td>
+						<input  name="erpCreditChild1s[{{idx}}].eqmNumbers" class="form-control" type="text" value="{{row.eqmNumbers}}"/>
+					</td>
+					<td>
+						<input  name="erpCreditChild1s[{{idx}}].eqmTotalCapacity" class="form-control" type="text" value="{{row.eqmTotalCapacity}}"/>
+					</td>
+					<td>
+						<input  name="erpCreditChild1s[{{idx}}].eqmBookedFee1" class="form-control" type="text" value="{{row.eqmBookedFee1}}"/>
+					</td>
+
+					<td class="text-center" width="10">
+						{{#delBtn}}<span class="close" onclick="delRow(this, '#testDataChild11List{{idx}}')" title="删除">&times;</span>{{/delBtn}}
+					</td>
+				</tr>
+			</script>
+			<script type="text/javascript">
+				var testDataChild11RowIdx = 0, testDataChild11Tpl = $("#testDataChild11Tpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+				$(document).ready(function() {
+					var data = ${fns:toJson(erpCredit.erpCreditChild1s)};
+					for (var i=0; i<data.length; i++){
+						addRow('#testDataChild11List', testDataChild11RowIdx, testDataChild11Tpl, data[i]);
+						testDataChild11RowIdx = testDataChild11RowIdx + 1;
+					}
+				});
+			</script>
+			</div>
+				<div id="tab-2" class="tab-pane fade">
+			<a class="btn btn-white btn-sm" onclick="addRow('#testDataChild12List', testDataChild12RowIdx, testDataChild12Tpl);testDataChild12RowIdx = testDataChild12RowIdx + 1;" title="新增"><i class="fa fa-plus"></i> 新增</a>
+			<table class="table table-striped table-bordered table-condensed">
+				<thead>
+					<tr>
+						<th class="hide"></th>
+						<th><font color="red">*</font>物料描述</th>
+						<th>入账金额(不含税价)</th>
+						<th width="10">&nbsp;</th>
+					</tr>
+				</thead>
+				<tbody id="testDataChild12List">
+				</tbody>
+			</table>
+			<script type="text/template" id="testDataChild12Tpl">
+				<tr id="testDataChild12List{{idx}}">
+					<td class="hide">
+						<input id="testDataChild12List{{idx}}_id" name="erpCreditChild2s[{{idx}}].id" type="hidden" value="{{row.id}}"/>
+						<input id="testDataChild12List{{idx}}_delFlag" name="erpCreditChild2s[{{idx}}].delFlag" type="hidden" value="0"/>
+					</td>
+					
+					<td  class="max-width-250">
+						<input  name="erpCreditChild2s[{{idx}}].eqmMaterialDetails2" class="form-control required" type="text" value="{{row.eqmMaterialDetails2}}"/>
+					</td>
+					
+					
+					<td  class="max-width-250">
+						<input  name="erpCreditChild2s[{{idx}}].mtlBookedFee2" class="form-control" type="text" value="{{row.mtlBookedFee2}}"/>
+					</td>
+					
+					<td class="text-center" width="10">
+						{{#delBtn}}<span class="close" onclick="delRow(this, '#testDataChild12List{{idx}}')" title="删除">&times;</span>{{/delBtn}}
+					</td>
+				</tr>
+			</script>
+			<script type="text/javascript">
+				var testDataChild12RowIdx = 0, testDataChild12Tpl = $("#testDataChild12Tpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+				$(document).ready(function() {
+					var data = ${fns:toJson(erpCredit.erpCreditChild2s)};
+					for (var i=0; i<data.length; i++){
+						addRow('#testDataChild12List', testDataChild12RowIdx, testDataChild12Tpl, data[i]);
+						testDataChild12RowIdx = testDataChild12RowIdx + 1;
+					}
+				});
+			</script>
+			</div>
+		</div>
+		</div>
+		</form:form>
+</body>
+</html>

+ 486 - 0
src/main/webapp/webpage/modules/sg/financial/erp/erpCreditList.js

@@ -0,0 +1,486 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<script>
+$(document).ready(function() {
+	$('#erpTable').bootstrapTable({
+		 
+		  //请求方法
+               method: 'post',
+               //类型json
+               dataType: "json",
+               contentType: "application/x-www-form-urlencoded",
+               //显示检索按钮
+	       		showSearch: true,
+               //显示刷新按钮
+               showRefresh: true,
+               //显示切换手机试图按钮
+               showToggle: true,
+               //显示 内容列下拉框
+    	       showColumns: true,
+    	       //显示到处按钮
+    	       showExport: true,
+    	       //显示切换分页按钮
+    	       showPaginationSwitch: true,
+    	       //显示详情按钮
+    	       detailView: true,
+    	       	//显示详细内容函数
+	           detailFormatter: "detailFormatter",
+    	       //最低显示2行
+    	       minimumCountColumns: 2,
+               //是否显示行间隔色
+               striped: true,
+               //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)     
+               cache: false,    
+               //是否显示分页(*)  
+               pagination: true,   
+                //排序方式 
+               sortOrder: "asc",  
+               //初始化加载第一页,默认第一页
+               pageNumber:1,   
+               //每页的记录行数(*)   
+               pageSize: 5,
+               //可供选择的每页的行数(*)    
+               pageList: [5,10, 25, 50, 100],
+               //这个接口需要处理bootstrap table传递的固定参数,并返回特定格式的json数据  
+               url: "${ctx}/sg/financial/erpCredit/data",
+               //默认值为 'limit',传给服务端的参数为:limit, offset, search, sort, order Else
+               //queryParamsType:'',   
+               ////查询参数,每次调用是会带上这个参数,可自定义                         
+               queryParams : function(params) {
+               	var searchParam = $("#searchForm").serializeJSON();
+               	searchParam.pageNo = params.limit === undefined? "1" :params.offset/params.limit+1;
+               	searchParam.pageSize = params.limit === undefined? -1 : params.limit;
+               	searchParam.orderBy = params.sort === undefined? "" : params.sort+ " "+  params.order;
+                   return searchParam;
+               },
+               //分页方式:client客户端分页,server服务端分页(*)
+               sidePagination: "server",
+               contextMenuTrigger:"right",//pc端 按右键弹出菜单
+               contextMenuTriggerMobile:"press",//手机端 弹出菜单,click:单击, press:长按。
+               contextMenu: '#context-menu',
+               onContextMenuItem: function(row, $el){
+                   if($el.data("item") == "edit"){
+                   		edit(row.id);
+                   }else if($el.data("item") == "view"){
+                       view(row.id);
+                   } else if($el.data("item") == "delete"){
+                        jp.confirm('确认要删除记录吗?', function(){
+                       	jp.loading();
+                       	jp.get("${ctx}/sg/financial/erpCredit/delete?id="+row.id, function(data){
+                   	  		if(data.success){
+                   	  			$('#erpTable').bootstrapTable('refresh');
+                   	  			jp.success(data.msg);
+                   	  		}else{
+                   	  			jp.error(data.msg);
+                   	  		}
+                   	  	})
+                   	   
+                   	});
+                      
+                   } 
+               },
+              
+               onClickRow: function(row, $el){
+               },
+               	onShowSearch: function () {
+			$("#search-collapse").slideToggle();
+		},
+               columns: [{
+		        checkbox: true
+		       
+		    }
+			,{
+		        field: 'itemId',
+		        title: '项目定义编码',
+		        sortable: true,
+		        sortName: 'itemId'
+		        ,formatter:function(value, row , index){
+
+			   if(value == null || value ==""){
+				   value = "-";
+			   }
+			   <c:choose>
+				   <c:when test="${fns:hasPermission('sg:financial:erpCredit:edit')}">
+				      return "<a href='javascript:edit(\""+row.id+"\")'>"+value+"</a>";
+			      </c:when>
+				  <c:when test="${fns:hasPermission('sg:financial:erpCredit:view')}">
+				      return "<a href='javascript:view(\""+row.id+"\")'>"+value+"</a>";
+			      </c:when>
+				  <c:otherwise>
+				      return value;
+			      </c:otherwise>
+			   </c:choose>
+
+		        }
+		       
+		    }
+			,{
+		        field: 'itemName',
+		        title: '项目名称',
+		        sortable: true,
+		        sortName: 'itemName'
+		       
+		    }
+			,{
+		        field: 'actualInvestment',
+		        title: '实际投资',
+		        sortable: true,
+		        sortName: 'actualInvestment'
+		       
+		    }
+			,{
+		        field: 'transferAssets',
+		        title: '移交生产的资产总值',
+		        sortable: true,
+		        sortName: 'transferAssets'
+		       
+		    }
+                   ,{
+                       field: 'consBuildingFee',
+                       title: '建筑费',
+                       sortable: true,
+                       sortName: 'consBuildingFee'
+
+                   }
+                   ,{
+                       field: 'consInstallFee',
+                       title: '安装费',
+                       sortable: true,
+                       sortName: 'consInstallFee'
+
+                   }
+                   ,{
+                       field: 'consTotalFee',
+                       title: '施工费:合计',
+                       sortable: true,
+                       sortName: 'consTotalFee'
+
+                   }
+                   ,{
+                       field: 'otherSupervisorFee',
+                       title: '监理费',
+                       sortable: true,
+                       sortName: 'otherSupervisorFee'
+
+                   }
+                   ,{
+                       field: 'otherDesignFee',
+                       title: '设计费',
+                       sortable: true,
+                       sortName: 'otherDesignFee'
+
+                   }
+                   ,{
+                       field: 'otherBeWorkFee',
+                       title: '项目前期工作费',
+                       sortable: true,
+                       sortName: 'otherBeWorkFee'
+
+                   }
+                   ,{
+                       field: 'otherBuildLoan',
+                       title: '建设期贷款利息',
+                       sortable: true,
+                       sortName: 'otherBuildLoan'
+
+                   }
+                   ,{
+                       field: 'otherLineDamages',
+                       title: '线路施工赔偿费',
+                       sortable: true,
+                       sortName: 'otherLineDamages'
+
+                   }
+                   ,{
+                       field: 'otherLegalManage',
+                       title: '法人管理费',
+                       sortable: true,
+                       sortName: 'otherLegalManage'
+
+                   }
+                   ,{
+                       field: 'otherTotalFee',
+                       title: '其他费用:合计',
+                       sortable: true,
+                       sortName: 'otherTotalFee'
+
+                   }
+                   ,{
+                       field: 'tenKvModel',
+                       title: '10KV电缆、架空导线型号',
+                       sortable: true,
+                       sortName: 'tenKvModel'
+
+                   }
+                   ,{
+                       field: 'tenKvUnit',
+                       title: '单位',
+                       sortable: true,
+                       sortName: 'tenKvUnit'
+
+                   }
+                   ,{
+                       field: 'tenKvLength',
+                       title: '长度',
+                       sortable: true,
+                       sortName: 'tenKvLength'
+
+                   }
+                   ,{
+                       field: 'tenKvLineLength',
+                       title: '10KV线路长度(KM)',
+                       sortable: true,
+                       sortName: 'tenKvLineLength'
+
+                   }
+                   ,{
+                       field: 'tenKvItsLine',
+                       title: '其中:10KV线路',
+                       sortable: true,
+                       sortName: 'tenKvItsLine'
+
+                   }
+                   ,{
+                       field: 'tenKvItesFhvFollow',
+                       title: '其中:400V及以下',
+                       sortable: true,
+                       sortName: 'tenKvItesFhvFollow'
+
+                   }
+                   ,{
+                       field: 'theInputTax',
+                       title: '进项税额',
+                       sortable: true,
+                       sortName: 'theInputTax'
+
+                   }
+                   ,{
+                       field: 'supplierName',
+                       title: '供应商名称',
+                       sortable: true,
+                       sortName: 'supplierName'
+
+                   }
+		     ]
+		
+		});
+		
+		  
+	  if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端
+
+		 
+		  $('#erpTable').bootstrapTable("toggleView");
+		}
+	  
+	  $('#erpTable').on('check.bs.table uncheck.bs.table load-success.bs.table ' +
+                'check-all.bs.table uncheck-all.bs.table', function () {
+            $('#remove').prop('disabled', ! $('#erpTable').bootstrapTable('getSelections').length);
+            $('#view,#edit').prop('disabled', $('#erpTable').bootstrapTable('getSelections').length!=1);
+        });
+		  
+		$("#btnImport").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/erpCredit/import/template');
+				//   },
+			    btn1: function(index, layero){
+						var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+						iframeWin.contentWindow.importExcel('${ctx}/sg/financial/erpCredit/import', function (data) {
+							if(data.success){
+								jp.success(data.msg);
+								refresh();
+							}else{
+								jp.error(data.msg);
+							}
+                            jp.close(index);
+                        });//调用保存事件
+                    return false;
+				  },
+				 
+				  btn2: function(index){
+					  jp.close(index);
+	    	       }
+			}); 
+		});
+	  $("#export").click(function(){//导出Excel文件
+			jp.downloadFile('${ctx}/sg/financial/erpCredit/export?ids='+ getIdSelections());
+	  });
+	  $("#search").click("click", function() {// 绑定查询按扭
+		  $('#erpTable').bootstrapTable('refresh');
+		});
+	 
+	 $("#reset").click("click", function() {// 绑定查询按扭
+		  $("#searchForm  input").val("");
+		  $("#searchForm  select").val("");
+		   $("#searchForm  .select-item").html("");
+		  $('#erpTable').bootstrapTable('refresh');
+		});
+		
+				$('#beginInDate').datetimepicker({
+					 format: "YYYY-MM-DD HH:mm:ss"
+				});
+				$('#endInDate').datetimepicker({
+					 format: "YYYY-MM-DD HH:mm:ss"
+				});
+		
+	});
+		
+  function getIdSelections() {
+        return $.map($("#erpTable").bootstrapTable('getSelections'), function (row) {
+            return row.id
+        });
+    }
+  
+  function deleteAll(){
+
+		jp.confirm('确认要删除该记录吗?', function(){
+			jp.loading();  	
+			jp.get("${ctx}/sg/financial/erpCredit/deleteAll?ids=" + getIdSelections(), function(data){
+         	  		if(data.success){
+         	  			$('#erpTable').bootstrapTable('refresh');
+         	  			jp.success(data.msg);
+         	  		}else{
+         	  			jp.error(data.msg);
+         	  		}
+         	  	})
+          	   
+		})
+  }
+  
+    //刷新列表
+  function refresh() {
+      $('#erpTable').bootstrapTable('refresh');
+  }
+  function add(){
+	  jp.openSaveDialog('新增记录', "${ctx}/sg/financial/erpCredit/form",'800px', '500px');
+  }
+  
+   function edit(id){//没有权限时,不显示确定按钮
+       if(id == undefined){
+	      id = getIdSelections();
+	}
+	jp.openSaveDialog('编辑记录', "${ctx}/sg/financial/erpCredit/form?id=" + id, '800px', '500px');
+  }
+
+  
+ function view(id){//没有权限时,不显示确定按钮
+      if(id == undefined){
+             id = getIdSelections();
+      }
+        jp.openViewDialog('查看表单', "${ctx}/sg/financial/erpCredit/form?id=" + id, '800px', '500px');
+ }
+  
+  
+  
+  
+		   
+  function detailFormatter(index, row) {
+	  var htmltpl =  $("#testDataMain1ChildrenTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+	  var html = Mustache.render(htmltpl, {
+			idx:row.id
+		});
+	  $.get("${ctx}/sg/financial/erpCredit/detail?id="+row.id, function(erpCredit){
+    	var testDataMain1Child1RowIdx = 0, testDataMain1Child1Tpl = $("#testDataMain1Child1Tpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+		var data1 =  erpCredit.erpCreditChild1s;
+		if(data1!=null){
+			for (var i=0; i<data1.length; i++){
+				// data1[i].dict = {};
+				// data1[i].dict.isHave = jp.getDictLabel(${fns:toJson(fns:getDictList('yes_no'))}, data1[i].isHave, "-");
+				addRow('#testDataMain1Child-'+row.id+'-1-List', testDataMain1Child1RowIdx, testDataMain1Child1Tpl, data1[i]);
+				testDataMain1Child1RowIdx = testDataMain1Child1RowIdx + 1;
+			}
+		}
+				
+    	var testDataMain1Child2RowIdx = 0, testDataMain1Child2Tpl = $("#testDataMain1Child2Tpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+		var data2 =  erpCredit.erpCreditChild2s;
+    	if(data2!=null){
+			for (var i=0; i<data2.length; i++){
+				// data2[i].dict = {};
+				// data2[i].dict.isHave = jp.getDictLabel(${fns:toJson(fns:getDictList('yes_no'))}, data2[i].isHave, "-");
+				addRow('#testDataMain1Child-'+row.id+'-2-List', testDataMain1Child2RowIdx, testDataMain1Child2Tpl, data2[i]);
+				testDataMain1Child2RowIdx = testDataMain1Child2RowIdx + 1;
+			}
+		}
+      })
+     
+        return html;
+    }
+  
+	function addRow(list, idx, tpl, row){
+		$(list).append(Mustache.render(tpl, {
+			idx: idx, delBtn: true, row: row
+		}));
+	}
+			
+</script>
+<script type="text/template" id="testDataMain1ChildrenTpl">//<!--
+	<div class="tabs-container">
+		<ul class="nav nav-tabs">
+				<li class="active"><a data-toggle="tab" href="#tab-{{idx}}-1" aria-expanded="true">设备费</a></li>
+				<li><a data-toggle="tab" href="#tab-{{idx}}-2" aria-expanded="true">材料费</a></li>
+		</ul>
+		<div class="tab-content">
+				 <div id="tab-{{idx}}-1" class="tab-pane fade in active">
+						<table class="ani table">
+						<thead>
+							<tr>
+								<th width="14%">物料描述</th>
+								<th width="4%">单位</th>
+								<th width="4%">台数</th>
+								<th width="6%">总容量(千伏安)</th>
+								<th width="72%">入账金额(不含税价)</th>
+							</tr>
+						</thead>
+						<tbody id="testDataMain1Child-{{idx}}-1-List">
+						</tbody>
+					</table>
+				</div>
+				<div id="tab-{{idx}}-2" class="tab-pane fade">
+					<table class="ani table">
+						<thead>
+							<tr>
+                                <th width="15%">物料描述</th>
+                                <th width="85%">入账金额(不含税价)</th>
+							</tr>
+						</thead>
+						<tbody id="testDataMain1Child-{{idx}}-2-List">
+						</tbody>
+					</table>
+				</div>
+		</div>//-->
+	</script>
+	<script type="text/template" id="testDataMain1Child1Tpl">//<!--
+				<tr>
+					<td>
+						{{row.eqmMaterialDetails1}}
+					</td>
+					<td>
+						{{row.eqmUnit}}
+					</td>
+					<td>
+						{{row.eqmNumbers}}
+					</td>
+					<td>
+						{{row.eqmTotalCapacity}}
+					</td>
+					<td>
+						{{row.eqmBookedFee1}}
+					</td>
+				</tr>//-->
+	</script>
+	<script type="text/template" id="testDataMain1Child2Tpl">//<!--
+				<tr>
+					<td>
+						{{row.eqmMaterialDetails2}}
+					</td>
+					<td>
+						{{row.mtlBookedFee2}}
+					</td>
+				</tr>//-->
+	</script>
+

+ 90 - 0
src/main/webapp/webpage/modules/sg/financial/erp/erpCreditList.jsp

@@ -0,0 +1,90 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>Erp项目管理</title>
+	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
+	<meta name="decorator" content="ani"/>
+	<%@ include file="/webpage/include/bootstraptable.jsp"%>
+	<%@include file="/webpage/include/treeview.jsp" %>
+	<%@include file="erpCreditList.js" %>
+</head>
+<body>
+	<div class="wrapper wrapper-content">
+	<div class="panel panel-primary">
+	<div class="panel-heading">
+		<h3 class="panel-title">Erp管理列表</h3>
+	</div>
+	<div class="panel-body">
+
+		<!-- 搜索 -->
+		<div id="search-collapse" class="collapse">
+			<div class="accordion-inner">
+				<form:form id="searchForm" modelAttribute="erpCredit" class="form form-horizontal well clearfix">
+					<div class="col-xs-12 col-sm-6 col-md-4">
+						<label class="label-item single-overflow pull-left" title="项目定义编码:">项目定义编码:</label>
+						<form:input path="itemId" htmlEscape="false" maxlength="100"  class=" form-control"/>
+					</div>
+					<div class="col-xs-12 col-sm-6 col-md-4">
+						<div style="margin-top:26px">
+							<a  id="search" class="btn btn-primary btn-rounded  btn-bordered btn-sm"><i class="fa fa-search"></i> 查询</a>
+							<a  id="reset" class="btn btn-primary btn-rounded  btn-bordered btn-sm" ><i class="fa fa-refresh"></i> 重置</a>
+						</div>
+					</div>
+				</form:form>
+			</div>
+		</div>
+	
+	<!-- 工具栏 -->
+	<div id="toolbar">
+			<%--<shiro:hasPermission name="test:onetomany:dialog:testDataMain1:add">--%>
+				<button id="add" class="btn btn-primary" onclick="add()">
+					<i class="glyphicon glyphicon-plus"></i> 新建
+				</button>
+			<%--</shiro:hasPermission>--%>
+			<%--<shiro:hasPermission name="test:onetomany:dialog:testDataMain1:edit">--%>
+			    <button id="edit" class="btn btn-success" disabled onclick="edit()">
+	            	<i class="glyphicon glyphicon-edit"></i> 修改
+	        	</button>
+			<%--</shiro:hasPermission>--%>
+			<%--<shiro:hasPermission name="test:onetomany:dialog:testDataMain1:del">--%>
+				<button id="remove" class="btn btn-danger" disabled onclick="deleteAll()">
+	            	<i class="glyphicon glyphicon-remove"></i> 删除
+	        	</button>
+			<%--</shiro:hasPermission>--%>
+			<%--<shiro:hasPermission name="test:onetomany:dialog:testDataMain1:import">--%>
+				<button id="btnImport" class="btn btn-info"><i class="fa fa-folder-open-o"></i> 导入</button>
+			<%--</shiro:hasPermission>--%>
+			<%--<shiro:hasPermission name="test:onetomany:dialog:testDataMain1:export">--%>
+	        		<button id="export" class="btn btn-warning">
+					<i class="fa fa-file-excel-o"></i> 导出
+				</button>
+			 <%--</shiro:hasPermission>--%>
+			<%--<shiro:hasPermission name="test:onetomany:dialog:testDataMain1:view">--%>
+				<button id="view" class="btn btn-default" onclick="view()">
+					<i class="fa fa-search-plus"></i> 查看
+				</button>
+			<%--</shiro:hasPermission>--%>
+		    </div>
+		
+	<!-- 表格 -->
+	<table id="erpTable"   data-toolbar="#toolbar"></table>
+
+    <!-- context menu -->
+    <ul id="context-menu" class="dropdown-menu">
+    	<%--<shiro:hasPermission name="test:onetomany:dialog:testDataMain1:view">--%>
+        <li data-item="view"><a>查看</a></li>
+        <%--</shiro:hasPermission>--%>
+    	<%--<shiro:hasPermission name="test:onetomany:dialog:testDataMain1:edit">--%>
+        <li data-item="edit"><a>编辑</a></li>
+        <%--</shiro:hasPermission>--%>
+        <%--<shiro:hasPermission name="test:onetomany:dialog:testDataMain1:del">--%>
+        <li data-item="delete"><a>删除</a></li>
+        <%--</shiro:hasPermission>--%>
+        <li data-item="action1"><a>取消</a></li>
+    </ul>  
+	</div>
+	</div>
+	</div>
+</body>
+</html>

+ 42 - 16
src/main/webapp/webpage/modules/sg/settlement/dataMaintenanceForm.jsp

@@ -46,17 +46,41 @@
 					<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-35">
+						<form:input path="designUnits" 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="constructionUnits" htmlEscape="false"    class="form-control "/>
+					</td>
+					<td class="width-15 active"><label class="pull-right">建筑地址:</label></td>
+					<td class="width-35">
+						<form:input path="address" 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="property" htmlEscape="false"    class="form-control "/>
+					</td>
+					<td class="width-15 active"><label class="pull-right">发文总投资:</label></td>
+					<td class="width-35">
+						<form:input path="investment" htmlEscape="false"    class="form-control "/>
+					</td>
+				</tr>
+				<tr>
 					<td class="width-15 active"><label class="pull-right">开工时间:</label></td>
 					<td class="width-35">
-					<div class='input-group form_datetime' id='startDate'>
-						<input type='text'  name="startDate" class="form-control required"  value="<fmt:formatDate value="${maintainData.startDate}" pattern="yyyy-MM-dd"/>"/>
-						<span class="input-group-addon">
+						<div class='input-group form_datetime' id='startDate'>
+							<input type='text'  name="startDate" class="form-control required"  value="<fmt:formatDate value="${maintainData.startDate}" pattern="yyyy-MM-dd"/>"/>
+							<span class="input-group-addon">
 			                        <span class="glyphicon glyphicon-calendar"></span>
 			                    </span>
-					</div>
+						</div>
 					</td>
-				</tr>
-				<tr>
 					<td class="width-15 active"><label class="pull-right">竣工时间:</label></td>
 					<td class="width-35">
 						<div class='input-group form_datetime' id='endDate'>
@@ -66,56 +90,58 @@
 			                    </span>
 						</div>
 					</td>
+				</tr>
+				<tr>
 					<td class="width-15 active"><label class="pull-right">批准文号:</label></td>
 					<td class="width-35">
 						<form:input path="approvalNumber" htmlEscape="false"    class="form-control required"/>
 					</td>
-				</tr>
-				<tr>
 					<td class="width-15 active"><label class="pull-right">建筑费:</label></td>
 					<td class="width-35">
 						<form:input path="buildingFee" htmlEscape="false"    class="form-control required"/>
 					</td>
+				</tr>
+				<tr>
 					<td class="width-15 active"><label class="pull-right">安装费:</label></td>
 					<td class="width-35">
 						<form:input path="installFee" htmlEscape="false"    class="form-control required"/>
 					</td>
-				</tr>
-				<tr>
 					<td class="width-15 active"><label class="pull-right">设备购置费:</label></td>
 					<td class="width-35">
 						<form:input path="equipmentFee" htmlEscape="false"    class="form-control required"/>
 					</td>
+				</tr>
+				<tr>
 					<td class="width-15 active"><label class="pull-right">主材费:</label></td>
 					<td class="width-35">
 						<form:input path="materialFee" htmlEscape="false"    class="form-control required"/>
 					</td>
-				</tr>
-				<tr>
 					<td class="width-15 active"><label class="pull-right">设计费:</label></td>
 					<td class="width-35">
 						<form:input path="designFee" htmlEscape="false"    class="form-control required"/>
 					</td>
+				</tr>
+				<tr>
 					<td class="width-15 active"><label class="pull-right">监理费:</label></td>
 					<td class="width-35">
 						<form:input path="supervisionFee" htmlEscape="false"    class="form-control required"/>
 					</td>
-				</tr>
-				<tr>
 					<td class="width-15 active"><label class="pull-right">前期工作费:</label></td>
 					<td class="width-35">
 						<form:input path="preliminaryWorkFee" htmlEscape="false"    class="form-control required"/>
 					</td>
+				</tr>
+				<tr>
 					<td class="width-15 active"><label class="pull-right">线路施工赔偿费:</label></td>
 					<td class="width-35">
 						<form:input path="damages" htmlEscape="false"    class="form-control required"/>
 					</td>
-				</tr>
-				<tr>
 					<td class="width-15 active"><label class="pull-right">法人管理费:</label></td>
 					<td class="width-35">
 						<form:input path="managementFee" htmlEscape="false"    class="form-control required"/>
 					</td>
+				</tr>
+				<tr>
 					<td class="width-15 active"><label class="pull-right">合计:</label></td>
 					<td class="width-35">
 						<form:input path="totalFee" htmlEscape="false"    class="form-control required"/>

+ 30 - 11
src/main/webapp/webpage/modules/sg/settlement/dataMaintenanceList.js

@@ -61,7 +61,7 @@ $(document).ready(function() {
                    } else if($el.data("item") == "delete"){
                         jp.confirm('确认要删除该数据记录吗?', function(){
                        	jp.loading();
-                       	jp.get("${ctx}/sg/settlement/delete?id="+row.id, function(data){
+                       	jp.get("${ctx}/sg/settlement/delete?id="+row.projectId, function(data){
                    	  		if(data.success){
                    	  			$('#dataTable').bootstrapTable('refresh');
                    	  			jp.success(data.msg);
@@ -91,10 +91,10 @@ $(document).ready(function() {
 		        	value = jp.unescapeHTML(value);
 				   <c:choose>
 					   <c:when test="${fns:hasPermission('sg:settlement:edit')}">
-					      return "<a href='javascript:edit(\""+row.id+"\")'>"+value+"</a>";
+					      return "<a href='javascript:edit(\""+row.projectId+"\")'>"+value+"</a>";
 				      </c:when>
 					  <c:when test="${fns:hasPermission('sg:settlement:view')}">
-					      return "<a href='javascript:view(\""+row.id+"\")'>"+value+"</a>";
+					      return "<a href='javascript:view(\""+row.projectId+"\")'>"+value+"</a>";
 				      </c:when>
 					  <c:otherwise>
 					      return value;
@@ -103,6 +103,26 @@ $(document).ready(function() {
 		         }
 		       
 		    }
+		    ,{
+                       field: 'designUnits',
+                       title: '设计单位'
+                   }
+		    ,{
+                       field: 'constructionUnits',
+                       title: '施工单位'
+                   }
+		    ,{
+                       field: 'address',
+                       title: '建筑地址'
+                   }
+		    ,{
+                       field: 'property',
+                       title: '建筑属性'
+                   }
+		    ,{
+                       field: 'investment',
+                       title: '发文总投资'
+                   }
 			,{
 		              field: 'startDate',
 		              title: '开工时间',
@@ -183,11 +203,11 @@ $(document).ready(function() {
                 auto: true,
 			    title:"导入数据",
 			    content: "${ctx}/tag/importExcel" ,
-			    btn: ['下载模板','确定', '关闭'],
-				    btn1: function(index, layero){
-					  jp.downloadFile('${ctx}/sg/settlement/import/template');
-				  },
-			    btn2: function(index, layero){
+			    btn: ['确定', '关闭'],
+				  //   btn1: function(index, layero){
+					//   jp.downloadFile('${ctx}/sg/settlement/import/template');
+				  // },
+			    btn1: function(index, layero){
 				        var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
 						iframeWin.contentWindow.importExcel('${ctx}/sg/settlement/import', function (data) {
 							if(data.success){
@@ -201,7 +221,7 @@ $(document).ready(function() {
                     return false;
 				  },
 				 
-				  btn3: function(index){ 
+				  btn2: function(index){
 					  jp.close(index);
 	    	       }
 			}); 
@@ -222,7 +242,6 @@ $(document).ready(function() {
                       top.layer.msg('成功', {icon:1})
                        $('#dataTable').bootstrapTable('load',data);
                      jp.close(index);
-                     getTdValue();
                       });//调用保存事件
                        return false;
                     },
@@ -254,7 +273,7 @@ $(document).ready(function() {
 		
   function getIdSelections() {
         return $.map($("#dataTable").bootstrapTable('getSelections'), function (row) {
-            return row.id
+            return row.projectId
         });
     }
   

src/main/webapp/webpage/modules/sg/settlement/dataMaintenanceList.jsp → src/main/webapp/webpage/modules/sg/financial/settlement/dataMaintenanceList.jsp


+ 206 - 0
src/main/webapp/webpage/modules/sg/managementcenter/activiti/constructionAudit.jsp

@@ -0,0 +1,206 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>施工交底管理</title>
+	<meta name="decorator" content="ani"/>
+	<!-- SUMMERNOTE -->
+	<%@include file="/webpage/include/summernote.jsp" %>
+	<script type="text/javascript">
+
+		$(document).ready(function() {
+			jp.ajaxForm("#inputForm",function(data){
+				if(data.success){
+					jp.success(data.msg);
+					jp.go("${ctx}/managementcenter/activiti");
+				}else{
+					jp.error(data.msg);
+					$("#inputForm").find("button:submit").button("reset");
+				}
+			});
+
+
+			$("#agree").click(function () {
+				jp.prompt("同意, 审批意见", function (message) {
+					jp.post("${ctx}/act/task/newAudit",
+							{
+								"taskId":"${construction.act.taskId}",
+								"taskName":"${construction.act.taskName}",
+								"taskDefKey":"${construction.act.taskDefKey}",
+								"procInsId":"${construction.act.procInsId}",
+								"procDefId":"${construction.act.procDefId}",
+								"flag":"manager",
+								"comment":message
+
+							},
+							function (data) {
+								if(data.success){
+									jp.success(data.msg);
+									jp.go("${ctx}/act/task/todo")
+								}
+							})
+				})
+			})
+
+			$("#agree2").click(function () {
+				jp.prompt("同意, 审批意见", function (message) {
+					jp.post("${ctx}/act/task/newAudit",
+							{
+								"taskId":"${construction.act.taskId}",
+								"taskName":"${construction.act.taskName}",
+								"taskDefKey":"${construction.act.taskDefKey}",
+								"procInsId":"${construction.act.procInsId}",
+								"procDefId":"${construction.act.procDefId}",
+								"flag":"company",
+								"comment":message
+
+							},
+							function (data) {
+								if(data.success){
+									jp.success(data.msg);
+									jp.go("${ctx}/act/task/todo")
+								}
+							})
+				})
+			})
+
+			$("#reject").click(function () {
+				jp.prompt("驳回, 审批意见", function (message) {
+					jp.post("${ctx}/act/task/newAudit",
+							{
+								"taskId":"${construction.act.taskId}",
+								"taskName":"${construction.act.taskName}",
+								"taskDefKey":"${construction.act.taskDefKey}",
+								"procInsId":"${construction.act.procInsId}",
+								"procDefId":"${construction.act.procDefId}",
+								"flag":"reject",
+								"comment":message
+							},
+							function (data) {
+								if(data.success){
+									jp.success(data.msg);
+									jp.go("${ctx}/act/task/todo")
+								}
+							})
+				})
+			})
+
+
+			$('#startTime').datetimepicker({
+				format: "YYYY-MM-DD HH:mm:ss"
+			});
+			$('#endTime').datetimepicker({
+				format: "YYYY-MM-DD HH:mm:ss"
+			});
+			//富文本初始化
+			$('#reason').summernote({
+				height: 300,
+				lang: 'zh-CN',
+				readonly: true,
+				callbacks: {
+					onChange: function(contents, $editable) {
+						$("input[name='reason']").val($('#reason').summernote('code'));//取富文本的值
+					}
+				}
+			});
+		});
+	</script>
+</head>
+<body>
+<div class="wrapper wrapper-content">
+	<div class="row">
+		<div class="col-md-12">
+			<div class="panel panel-primary">
+				<div class="panel-heading">
+					<h3 class="panel-title">
+						<a class="panelButton"  href="#"  onclick="history.go(-1)"><i class="ti-angle-left"></i> 返回</a>
+					</h3>
+				</div>
+				<div class="panel-body">
+					<div class="form-group text-center">
+						<%--<h3>${oALeave.act.taskName}</h3>--%>
+					</div>
+					<form:form id="inputForm" modelAttribute="construction" action="${ctx}/managementcenter/activiti/save" method="post" class="form-horizontal">
+						<form:hidden path="id"/>
+						<div class="form-group">
+							<label class="col-sm-2 control-label"><font color="red">*</font>申请人:</label>
+							<div class="col-sm-10">
+									${fns:unescapeHtml(construction.userName)}
+							</div>
+						</div>
+						<hr>
+						<div class="form-group">
+							<label class="col-sm-2 control-label"><font color="red">*</font>归属用户:</label>
+							<div class="col-sm-10">
+								<sys:userselect id="tuser" name="tuser.id" value="${construction.tuser.id}" labelName="tuser.name" labelValue="${construction.tuser.name}"
+												cssClass="form-control required"/>
+							</div>
+						</div>
+						<hr>
+						<div class="form-group">
+							<label class="col-sm-2 control-label"><font color="red">*</font>项目号:</label>
+							<div class="col-sm-10">
+									${fns:unescapeHtml(construction.projectId)}
+							</div>
+						</div>
+						<hr>
+						<div class="form-group">
+							<label class="col-sm-2 control-label"><font color="red">*</font>项目名称:</label>
+							<div class="col-sm-10">
+									${fns:unescapeHtml(construction.projectName)}
+							</div>
+						</div>
+						<hr>
+						<div class="form-group">
+							<label class="col-sm-2 control-label"><font color="red">*</font>接收图纸时间:</label>
+							<div class="col-sm-10">
+								<fmt:formatDate value="${construction.acceptDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
+							</div>
+						</div>
+						<hr>
+						<div class="form-group">
+							<label class="col-sm-2 control-label"><font color="red">*</font>备注说明:</label>
+							<div class="col-sm-10">
+									${fns:unescapeHtml(construction.examineDate)}
+<%--								<fmt:formatDate value="${construction.examineDate}" pattern="yyyy-MM-dd HH:mm:ss"/>--%>
+							</div>
+						</div>
+						<hr>
+					</form:form>
+
+
+					<c:if test="${construction.act.taskDefKey != '' && !construction.act.finishTask && construction.act.isNextGatewaty}">
+						<div class="row">
+							<div class="col-sm-3"></div>
+							<div class="col-sm-6">
+								<div class="form-group text-center">
+									<input id="agree" class="btn  btn-primary btn-lg btn-parsley" type="submit" value="施工单位" />&nbsp;
+									<input id="agree2" class="btn  btn-primary btn-lg btn-parsley" type="submit" value="项目经理" />
+									<input id="reject" class="btn  btn-danger btn-lg btn-parsley" type="submit" value="驳 回" />&nbsp;
+								</div>
+							</div>
+						</div>
+					</c:if>
+					<c:if test="${construction.act.taskDefKey != '' && !construction.act.finishTask && !construction.act.isNextGatewaty}">
+						<div class="row">
+							<div class="col-sm-3"></div>
+							<div class="col-sm-6">
+								<div class="form-group text-center">
+									<input id="agree" class="btn  btn-primary btn-lg btn-parsley" type="submit" value="办 理" />&nbsp;
+								</div>
+							</div>
+						</div>
+					</c:if>
+
+					<c:if test="${not empty construction.id}">
+						<act:flowChart procInsId="${construction.act.procInsId}"/>
+						<act:histoicFlow procInsId="${construction.act.procInsId}" />
+					</c:if>
+
+				</div>
+			</div>
+		</div>
+	</div>
+</div>
+</body>
+</html>

+ 157 - 0
src/main/webapp/webpage/modules/sg/managementcenter/activiti/constructionForm.jsp

@@ -0,0 +1,157 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>施工交底管理</title>
+	<meta name="decorator" content="ani"/>
+	<!-- SUMMERNOTE -->
+	<%@include file="/webpage/include/summernote.jsp" %>
+	<script type="text/javascript">
+
+		$(document).ready(function() {
+			jp.ajaxForm("#inputForm",function(data){
+				if(data.success){
+					jp.success(data.msg);
+					jp.go("${ctx}"+ data.body.targetUrl);
+				}else{
+					jp.error(data.msg);
+					$("#inputForm").find("button:submit").button("reset");
+				}
+			});
+
+			$('#acceptDate').datetimepicker({
+				format: "YYYY-MM-DD HH:mm:ss"
+			});
+			$('#examineDate').datetimepicker({
+				format: "YYYY-MM-DD HH:mm:ss"
+			});
+			//富文本初始化
+			$('#reason').summernote({
+				height: 300,
+				lang: 'zh-CN',
+				callbacks: {
+					onChange: function(contents, $editable) {
+						$("input[name='reason']").val($('#reason').summernote('code'));//取富文本的值
+					}
+				}
+			});
+		});
+	</script>
+</head>
+<body>
+<div class="wrapper wrapper-content">
+	<div class="row">
+		<div class="col-md-12">
+			<div class="panel panel-primary">
+				<div class="panel-heading">
+					<h3 class="panel-title">
+						<a class="panelButton"  href="#"  onclick="history.go(-1)"><i class="ti-angle-left"></i> 返回</a>
+					</h3>
+				</div>
+				<div class="panel-body">
+					<form:form id="inputForm" modelAttribute="construction" action="${ctx}/managementcenter/activiti/save" method="post" class="form-horizontal">
+						<form:hidden path="id"/>
+						<form:hidden path="act.taskId"/>
+						<form:hidden path="act.taskName"/>
+						<form:hidden path="act.taskDefKey"/>
+						<form:hidden path="act.procInsId"/>
+						<form:hidden path="act.procDefId"/>
+						<form:hidden id="flag" path="act.flag" />
+						<div class="form-group text-center">
+							<h3> 施工交底申请</h3>
+						</div>
+						<div class="form-group">
+							<label class="col-sm-2 control-label"><font color="red">*</font>申请人:</label>
+							<div class="col-sm-10">
+								<div id='userName'>
+									<input type='text'  name="userName" class="form-control required"  value="${construction.userName}"/>
+								</div>
+							</div>
+						</div>
+						<hr>
+						<div class="form-group">
+							<label class="col-sm-2 control-label"><font color="red">*</font>归属用户:</label>
+							<div class="col-sm-10">
+								<sys:userselect id="tuser" name="tuser.id" value="${construction.tuser.id}" labelName="tuser.name" labelValue="${construction.tuser.name}"
+												cssClass="form-control required"/>
+							</div>
+						</div>
+						<hr>
+						<div class="form-group">
+							<label class="col-sm-2 control-label"><font color="red">*</font>项目号:</label>
+							<div class="col-sm-10">
+								<div id='projectId'>
+									<input type='text'  name="projectId" class="form-control required"  value="${construction.projectId}"/>
+								</div>
+							</div>
+						</div>
+						<hr>
+						<div class="form-group">
+							<label class="col-sm-2 control-label"><font color="red">*</font>项目名称:</label>
+							<div class="col-sm-10">
+								<div  id='projectName'>
+									<input type='text'  name="projectName" class="form-control required"  value="${construction.projectName}"/>
+								</div>
+							</div>
+						</div>
+						<hr>
+						<div class="form-group">
+							<label class="col-sm-2 control-label"><font color="red">*</font>接收图纸时间:</label>
+							<div class="col-sm-10">
+									<div class='input-group form_datetime' id='acceptDate'>
+									<input type='text'  name="acceptDate" class="form-control required"  value="<fmt:formatDate value="${construction.acceptDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
+									<span class="input-group-addon">
+								<span class="glyphicon glyphicon-calendar"></span>
+							</span>
+								</div>
+							</div>
+						</div>
+						<hr>
+						<div class="form-group">
+							<label class="col-sm-2 control-label"><font color="red">*</font>备注说明:</label>
+							<div class="col-sm-10">
+<%--								<div class='input-group form_datetime' id='examineDate'>
+									<input type='text'  name="examineDate" class="form-control required"  value="<fmt:formatDate value="${construction.examineDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
+									<span class="input-group-addon">
+										<span class="glyphicon glyphicon-calendar"></span>
+									</span>
+
+								</div>--%>
+								<div  id='examineDate'>
+									<textarea  name="examineDate" style="height: 100px" class="form-control required">${construction.examineDate}</textarea>
+								</div>
+							</div>
+						</div>
+						<hr>
+						<div class="form-group">
+							<div class="col-lg-3"></div>
+							<c:if test="${construction.act.taskDefKey ne '' && !construction.act.finishTask && construction.act.isNextGatewaty}">
+								<div class="col-sm-6">
+									<div class="form-group text-center">
+										<input id="agree" class="btn  btn-primary btn-lg btn-parsley" type="submit" value="重新提交" onclick="$('#flag').val('yes')"/>&nbsp;
+										<input id="reject" class="btn  btn-danger btn-lg btn-parsley" type="submit" value="销毁申请" onclick="$('#flag').val('no')"/>&nbsp;
+									</div>
+								</div>
+							</c:if>
+							<c:if test="${construction.act.startTask}">
+								<div class="col-lg-6">
+									<div class="form-group text-center">
+										<div>
+											<button class="btn btn-primary btn-block btn-lg btn-parsley" data-loading-text="正在提交...">提 交</button>
+										</div>
+									</div>
+								</div>
+							</c:if>
+						</div>
+					</form:form>
+					<c:if test="${not empty construction.id}">
+						<act:flowChart procInsId="${construction.act.procInsId}"/>
+						<act:histoicFlow procInsId="${construction.act.procInsId}" />
+					</c:if>
+				</div>
+			</div>
+		</div>
+	</div>
+</div>
+</body>
+</html>

+ 176 - 0
src/main/webapp/webpage/modules/sg/managementcenter/activiti/divideAudit.jsp

@@ -0,0 +1,176 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>请假申请管理</title>
+	<meta name="decorator" content="ani"/>
+	<!-- SUMMERNOTE -->
+	<%@include file="/webpage/include/summernote.jsp" %>
+	<script type="text/javascript">
+
+		$(document).ready(function() {
+			jp.ajaxForm("#inputForm",function(data){
+				if(data.success){
+					jp.success(data.msg);
+					jp.go("${ctx}/managementcenter/divide");
+				}else{
+					jp.error(data.msg);
+					$("#inputForm").find("button:submit").button("reset");
+				}
+			});
+
+
+			$("#agree").click(function () {
+				jp.prompt("没有问题, 审批意见", function (message) {
+					jp.post("${ctx}/act/task/audit2",
+							{
+								"taskId":"${construction.act.taskId}",
+								"taskName":"${construction.act.taskName}",
+								"taskDefKey":"${construction.act.taskDefKey}",
+								"procInsId":"${construction.act.procInsId}",
+								"procDefId":"${construction.act.procDefId}",
+								"flag":"yes",
+								"comment":message
+
+							},
+							function (data) {
+								if(data.success){
+									jp.success(data.msg);
+									jp.go("${ctx}/act/task/todo")
+								}
+							})
+				})
+			})
+
+
+			$("#reject").click(function () {
+				jp.prompt("存在问题, 审批意见", function (message) {
+					jp.post("${ctx}/act/task/audit2",
+							{
+								"taskId":"${construction.act.taskId}",
+								"taskName":"${construction.act.taskName}",
+								"taskDefKey":"${construction.act.taskDefKey}",
+								"procInsId":"${construction.act.procInsId}",
+								"procDefId":"${construction.act.procDefId}",
+								"flag":"no",
+								"comment":message
+							},
+							function (data) {
+								if(data.success){
+									jp.success(data.msg);
+									jp.go("${ctx}/act/task/todo")
+								}
+							})
+				})
+			})
+
+
+			$('#startTime').datetimepicker({
+				format: "YYYY-MM-DD HH:mm:ss"
+			});
+			$('#endTime').datetimepicker({
+				format: "YYYY-MM-DD HH:mm:ss"
+			});
+			//富文本初始化
+			$('#reason').summernote({
+				height: 300,
+				lang: 'zh-CN',
+				readonly: true,
+				callbacks: {
+					onChange: function(contents, $editable) {
+						$("input[name='reason']").val($('#reason').summernote('code'));//取富文本的值
+					}
+				}
+			});
+		});
+	</script>
+</head>
+<body>
+<div class="wrapper wrapper-content">
+	<div class="row">
+		<div class="col-md-12">
+			<div class="panel panel-primary">
+				<div class="panel-heading">
+					<h3 class="panel-title">
+						<a class="panelButton"  href="#"  onclick="history.go(-1)"><i class="ti-angle-left"></i> 返回</a>
+					</h3>
+				</div>
+				<div class="panel-body">
+					<div class="form-group text-center">
+						<%--<h3>${oALeave.act.taskName}</h3>--%>
+					</div>
+					<form:form id="inputForm" modelAttribute="construction" action="${ctx}/managementcenter/divide/save" method="post" class="form-horizontal">
+						<form:hidden path="id"/>
+						<div class="form-group">
+							<label class="col-sm-2 control-label"><font color="red">*</font>申请人:</label>
+							<div class="col-sm-10">
+									${fns:unescapeHtml(construction.userName)}
+							</div>
+						</div>
+						<hr>
+						<div class="form-group">
+							<label class="col-sm-2 control-label"><font color="red">*</font>项目号:</label>
+							<div class="col-sm-10">
+									${fns:unescapeHtml(construction.projectId)}
+							</div>
+						</div>
+						<hr>
+						<div class="form-group">
+							<label class="col-sm-2 control-label"><font color="red">*</font>项目名称:</label>
+							<div class="col-sm-10">
+									${fns:unescapeHtml(construction.projectName)}
+							</div>
+						</div>
+						<hr>
+						<div class="form-group">
+							<label class="col-sm-2 control-label"><font color="red">*</font>接收图纸时间:</label>
+							<div class="col-sm-10">
+								<fmt:formatDate value="${construction.acceptDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
+							</div>
+						</div>
+						<hr>
+						<div class="form-group">
+							<label class="col-sm-2 control-label"><font color="red">*</font>备注说明:</label>
+							<div class="col-sm-10">
+									${fns:unescapeHtml(construction.examineDate)}
+<%--								<fmt:formatDate value="${construction.examineDate}" pattern="yyyy-MM-dd HH:mm:ss"/>--%>
+							</div>
+						</div>
+						<hr>
+					</form:form>
+
+
+					<c:if test="${construction.act.taskDefKey != '' && !construction.act.finishTask && construction.act.isNextGatewaty}">
+						<div class="row">
+							<div class="col-sm-3"></div>
+							<div class="col-sm-6">
+								<div class="form-group text-center">
+									<input id="agree" class="btn  btn-primary btn-lg btn-parsley" type="submit" value="没有问题" />&nbsp;
+									<input id="reject" class="btn  btn-primary btn-lg btn-parsley" type="submit" value="存在问题" />
+								</div>
+							</div>
+						</div>
+					</c:if>
+					<c:if test="${construction.act.taskDefKey != '' && !construction.act.finishTask && !construction.act.isNextGatewaty}">
+						<div class="row">
+							<div class="col-sm-3"></div>
+							<div class="col-sm-6">
+								<div class="form-group text-center">
+									<input id="agree" class="btn  btn-primary btn-lg btn-parsley" type="submit" value="办 理" />&nbsp;
+								</div>
+							</div>
+						</div>
+					</c:if>
+
+					<c:if test="${not empty construction.id}">
+						<act:flowChart procInsId="${construction.act.procInsId}"/>
+						<act:histoicFlow procInsId="${construction.act.procInsId}" />
+					</c:if>
+
+				</div>
+			</div>
+		</div>
+	</div>
+</div>
+</body>
+</html>

+ 120 - 0
src/main/webapp/webpage/modules/sg/managementcenter/materialinfo/importexcel.jsp

@@ -0,0 +1,120 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+    <title>导入Excel</title>
+    <meta name="decorator" content="ani"/>
+    <script>
+        function importExcel(url, fn) {
+            var importForm =$("#importForm")[0];
+            var file = $("#uploadFile").val();
+            var itemBatch = $("#itemBatch").val();
+            var suppliesBatch = $("#suppliesBatch").val();
+            if(file.length === 0){
+                layer.msg("请选择文件",{icon: 3,offset:['40%','40%']});
+                return false;
+            }
+            if(itemBatch == null || itemBatch === ''){
+                layer.msg("请输入项目批次",{icon: 3,offset:['40%','40%']});
+                return false;
+            }
+            if(suppliesBatch == null || suppliesBatch === ''){
+                layer.msg("请选择物料批次",{icon: 3,offset:['40%','40%']});
+                return false;
+            }
+            jp.loading('  正在导入,请稍等...');
+            // jp.uploadFile(importForm, url,function (data) {
+            //    fn(data);
+            // })
+                var data = new FormData(importForm);
+                // data.append("CustomField", "This is some extra data, testing");//如果要添加参数
+                $.ajax({
+                    type: "POST",
+                    enctype: 'multipart/form-data',
+                    url: url,
+                    data: data,
+                    processData: false, //prevent jQuery from automatically transforming the data into a query string
+                    contentType: false,
+                    cache: false,
+                    timeout: 600000,
+                    success: function (result) {
+                        if(result.success && result.errorCode === '-1'){
+                            jp.confirm('该项目已存在,确定覆盖嘛?', function(){
+                                jp.loading('  正在导入,请稍等...');
+                                $.ajax({
+                                    type: "POST",
+                                    enctype: 'multipart/form-data',
+                                    url: '${ctx}/managementcenter/materialinfo/import',
+                                    data: data,
+                                    processData: false, //prevent jQuery from automatically transforming the data into a query string
+                                    contentType: false,
+                                    cache: false,
+                                    timeout: 600000,
+                                    success: function (result) {
+                                        fn(result);
+                                    }
+                                })
+                            });
+                        }else if((result.success && result.errorCode === '0')){
+                                   fn(result)
+                        }
+                        // fn(result);
+                    },
+                    error:function(xhr, textStatus){
+                        if(xhr.status == 0){
+                            jp.info("连接失败,请检查网络!")
+                        }else if(xhr.status == 404){
+                            var errDetail ="<font color='red'>404,请求地址不存在!</font>";
+                            top.layer.alert(errDetail , {
+                                icon: 2,
+                                area:['auto','auto'],
+                                title:"请求出错"
+                            })
+                        }else if(xhr.status && xhr.responseText){
+                            var errDetail ="<font color='red'>"+ xhr.responseText.replace(/[\r\n]/g,"<br>").replace(/[\r]/g,"<br>").replace(/[\n]/g,"<br>")+"</font>";
+                            top.layer.alert(errDetail , {
+                                icon: 2,
+                                area:['80%','70%'],
+                                title:xhr.status+"错误"
+                            })
+                        }else{
+                            var errDetail =xhr.responseText=="<font color='red'>未知错误!</font>";
+                            top.layer.alert(errDetail , {
+                                icon: 2,
+                                area:['auto','auto'],
+                                title:"真悲剧,后台抛出异常了"
+                            })
+                        }
+
+                    }
+                })
+        }
+    </script>
+</head>
+<body class="bg-white">
+    <div class="wrapper wrapper-content">
+        <div id="importBox" >
+            <form id="importForm" action="${url}" method="post" enctype="multipart/form-data"
+                  style="padding-left:20px;text-align:center;" onsubmit="loading('正在导入,请稍等...');">
+                <div>
+                    <label class="label-item single-overflow pull-left" title="选择文件:">选择文件:</label>
+                <input id="uploadFile" name="file" type="file" class="form-control" style="width:300px"/>
+                </div>
+                <div style="margin-top: 4px;">
+                    <label class="label-item single-overflow pull-left" title="项目批次:">项目批次:</label>
+                    <input id="itemBatch" name="itemBatch" type="text" class="form-control" style="width:300px"/>
+                </div>
+                <div style="margin-top: 4px;">
+                    <label class="label-item single-overflow pull-left" title="物料批次:">物料批次:</label>
+                <select name="batch"  class="form-control   simple-select" id="suppliesBatch" style="width:300px"/>
+                    <c:forEach var="item" items="${batch}">
+                        <option value="${item.suppliesBatch}" label="${item.suppliesBatch}"></option>
+                    </c:forEach>
+                </select>
+                </div> 
+
+            </form>
+        </div>
+    </div>
+</body>
+</html>

+ 273 - 0
src/main/webapp/webpage/modules/sg/managementcenter/materialinfo/importmore.jsp

@@ -0,0 +1,273 @@
+<%@ page contentType="text/html;charset=UTF-8"%>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<link rel="stylesheet" href="${ctxStatic}/plugin/layui/dist/css/layui.css">
+<script src="${pageContext.request.contextPath}/act/rest/js/common/jquery-1.8.3.js"></script>
+<script src="${ctxStatic}/plugin/layui/dist/layui.js"></script>
+<script src="${ctxStatic}/common/js/jeeplus.js"></script>
+
+<html>
+<head>
+    <title>添加</title>
+    <meta http-equiv=Content-Type content=“text/html;charset=utf-8″>
+    <meta http-equiv=X-UA-Compatible content=IE=EmulateIE7>
+    <meta name="renderer" content="webkit">
+    <style>
+        .layui-input{ height: 28px;margin-top: 6px;line-height: 28px}
+        .layui-table-view .layui-table {width:100%}
+        .myselect{border: none;padding: 5px 7px;min-height: 20px;color: #666666;line-height: 20px}
+        .mydiv{padding: 5px 7px;min-height: 20px;border: whitesmoke;line-height: 20px}
+        .mydiv:empty:before{content: attr(placeholder);color:#999999;}
+        .mydiv:focus:before{content:none}
+        .layui-table-tips-main{display:none}
+        .layui-table-tips-c{display:none}
+    </style>
+</head>
+<body style="height: 100%;line-height: 100%">
+<div style="padding: 10px;">
+    <div class="layui-main-bgc">
+        <div class="layui-row layui-col-space15">
+            <div class="layui-col-md12">
+                <div class="layui-card">
+                        <div class="layui-card-body" style="margin-top: 2px;">
+                            <form class="layui-form">
+                            <div class="layui-form-item">
+                                <div class="layui-inline">
+                                    <label class="layui-form-label">*项目批次</label>
+                                    <div class="layui-input-inline">
+                                        <input type="text" id="myinput" autocomplete="off" placeholder=""  class="layui-input">
+                                    </div>
+                                </div>
+                                <div class="layui-inline">
+                                    <label class="layui-form-label">*物料批次</label>
+                                    <div class="layui-input-inline">
+                                        <select name="suppliesBatch"  id="suppliesBatch">
+                                            <option value="">请选择</option>
+                                            <c:forEach var="item" items="${batch}">
+                                                <option value="${item.suppliesBatch}">${item.suppliesBatch}</option>
+                                            </c:forEach>
+                                        </select>
+                                    </div>
+                                </div>
+                            </div>
+                            </form>
+                            <div class="layui-upload">
+                                <button type="button" class="layui-btn layui-btn-normal" id="add_List">添加文件</button>
+                                <div class="layui-upload-list">
+                                        <table class="layui-table" id="mytable">
+                                        <thead>
+                                        <tr>
+                                            <th width="45%">*文件名称</th>
+                                            <%--<th width="17%">*项目类型</th>--%>
+                                            <%--<th width="25%">*结算书编号</th>--%>
+                                            <%--<th width="33%">*供应商</th>--%>
+                                            <th width="22%" style="text-align: center">操作</th>
+                                        </tr></thead>
+                                        <tbody id="tbody_List">
+
+                                        </tbody>
+                                    </table>
+                                </div>
+                             <%--<div style="margin-top: 20px">--%>
+                                <%--<button id="mybtn" type="button" class="layui-btn" style="width: 70px;" onclick="okSubmit()">确定</button>--%>
+                            <%--</div>--%>
+                        </div>
+                    </div>
+                </div>
+             </div>
+        </div>
+    </div>
+</div>
+</body>
+<script type="text/javascript">
+    /*//定义存放文件数组*/
+    var arrayFile=[];
+    /*加载layui文件上传*/
+    layui.use('upload', function(){
+        var $ = layui.jquery
+            ,upload = layui.upload;
+        //多文件列表示例
+        var tbodyListView = $('#tbody_List')
+            ,uploadListIns = upload.render({
+            elem: '#add_List'
+            ,accept: 'file'
+            ,exts:'xls|xlsx'
+            ,multiple: true
+            ,auto: false
+            ,choose: function(obj){
+                // var files = this.files = obj.pushFile(); //将每次选择的文件追加到文件队列
+                //读取本地文件
+                obj.preview(function(index, file, result){
+                    //添加 id 到数组
+                    arrayFile.push(index);
+                    //添加文件到数组
+                    arrayFile.push(file);
+                    //拼接生成表格
+                    var tr = $(['<tr id='+index+'>'
+                        ,'<td hidden><div class="td_id">'+index+'</div></td>'
+                        ,'<td><div contenteditable="true" class="mydiv1 mydiv" placeholder="请输入项目名称">'+file.name.split(".")[0]+'</div></td>'
+                        // ,'<td>'
+                        // ,' <select name="type" class="myselect"><option value="">请选择项目类型</option><option value="1">架空线路工程</option><option value="2">电缆工程</option><option value="3">变电站工程</option></select>'
+                        // ,'<td><div contenteditable="true" class="mydiv2 mydiv" placeholder="请输入项目编号"></div></td>'
+                        // ,'<td><div contenteditable="true" class="mydiv3 mydiv" placeholder="请输入供应商"></div></td>'
+                        ,'<td style="text-align: center">'
+                        ,'<button class="layui-btn layui-btn-xs layui-btn-danger demo-delete">删除</button>'
+                        ,'</td>'
+                        ,'</tr>'].join(''));
+                    //删除
+                    tr.find('.demo-delete').on('click', function(){
+                        // delete files[index]; //删除对应的文件
+                        tr.remove();//删除tr
+                        //清空input file当中已经存在文件
+                        uploadListIns.config.elem.next()[0].value = '';
+                    });
+
+                    tbodyListView.append(tr);
+                    //清空input file当中已经存在文件
+                    uploadListIns.config.elem.next()[0].value = '';
+                });
+            }
+        });
+    });
+
+    function importExcel(url, fn) {
+        var formdata = new FormData();
+
+        // 获取表格id的值
+        var itemBatch = $("#myinput").val();
+        var suppliesBatch = $("#suppliesBatch").val();
+        var file = $(":file").val;
+
+
+        //获取输入的项目名称
+        var div1 =  $(".mydiv1");
+
+        //判断列表中项目名称是否为空
+        if (div1.length<=0){
+            layer.msg("请选择文件",{icon: 3,offset:['40%','40%']});
+            return false;
+        }
+        //存储列表中 输入项目名称的值
+        var divvalue=[];
+        //存储列表中 输入项目名称的值
+        var div_val=[];
+        //循环获取当前项目列表的项目名称
+
+        for (var i = 0; i < div1.length; i++) {
+            //存放到集合当中
+            divvalue[i]=div1[i].innerHTML;
+            div_val[i]=div1[i].innerHTML;
+        }
+        //判断项目名称是否重复
+        for (var i = 0; i < divvalue.length; i++) {
+            if (divvalue[i] === ""||divvalue[i]==null){
+                layer.msg("请选择文件",{icon: 3,offset:['40%','40%']});
+                throw SyntaxError;
+            }
+            if(div_val[i] === divvalue[i+1]){
+                layer.msg("选择文件重复",{icon: 5,offset:['40%','40%']});
+                throw SyntaxError;
+            }
+        }
+        // if(file.length === 0){
+        //     layer.msg("请选择文件",{icon: 3,offset:['40%','40%']});
+        //     return false;
+        // }
+        if(itemBatch == null || itemBatch === ''){
+            layer.msg("请输入项目批次",{icon: 3,offset:['40%','40%']});
+            return false;
+        }
+        if(suppliesBatch == null || suppliesBatch === ''){
+            layer.msg("请选择物料批次",{icon: 3,offset:['40%','40%']});
+            return false;
+        }
+        var td_id=document.getElementsByClassName("td_id");
+        //存放id的数组
+        var array_id = [];
+        //循环遍历id
+        for (var i = 0; i < td_id.length; i++) {
+            array_id[i]=td_id[i].innerHTML;
+        }
+        //根据id获取对象文件传入后台
+        for (var i = 0; i < array_id.length; i++) {
+            for (var j = 0; j < arrayFile.length; j++) {
+                if (array_id[i]==arrayFile[j]){
+                    //追加文件到表单当中
+                    formdata.append("file",arrayFile[j+1]);
+                }
+            }
+        }
+        formdata.append("itemBatch",itemBatch);
+        formdata.append("batch",suppliesBatch);
+
+        jp.loading('  正在导入,请稍等...');
+        $.ajax({
+            type: "POST",
+            enctype: 'multipart/form-data',
+            url: url,
+            data: formdata,
+            processData: false, //prevent jQuery from automatically transforming the data into a query string
+            contentType: false,
+            cache: false,
+            timeout: 600000,
+            success: function (result) {
+                if(result.success && result.errorCode === '-1'){
+                    jp.confirm('项目'+result.msg+'已存在,确定覆盖嘛?', function(){
+                        jp.loading('  正在导入,请稍等...');
+                        $.ajax({
+                            type: "POST",
+                            enctype: 'multipart/form-data',
+                            url: '${ctx}/managementcenter/materialinfo/imports',
+                            data: formdata,
+                            processData: false, //prevent jQuery from automatically transforming the data into a query string
+                            contentType: false,
+                            cache: false,
+                            timeout: 600000,
+                            success: function (result) {
+                                fn(result);
+                            }
+                        })
+                    });
+                }else if((result.success && result.errorCode === '0')){
+                    fn(result)
+                }
+                // fn(result);
+            },
+            error:function(xhr, textStatus){
+                if(xhr.status == 0){
+                    jp.info("连接失败,请检查网络!")
+                }else if(xhr.status == 404){
+                    var errDetail ="<font color='red'>404,请求地址不存在!</font>";
+                    top.layer.alert(errDetail , {
+                        icon: 2,
+                        area:['auto','auto'],
+                        title:"请求出错"
+                    })
+                }else if(xhr.status && xhr.responseText){
+                    var errDetail ="<font color='red'>"+ xhr.responseText.replace(/[\r\n]/g,"<br>").replace(/[\r]/g,"<br>").replace(/[\n]/g,"<br>")+"</font>";
+                    top.layer.alert(errDetail , {
+                        icon: 2,
+                        area:['80%','70%'],
+                        title:xhr.status+"错误"
+                    })
+                }else{
+                    var errDetail =xhr.responseText=="<font color='red'>未知错误!</font>";
+                    top.layer.alert(errDetail , {
+                        icon: 2,
+                        area:['auto','auto'],
+                        title:"真悲剧,后台抛出异常了"
+                    })
+                }
+
+            }
+        })
+
+    }
+
+</script>
+<script>
+    layui.use('form',function () {
+        var  form = layui.form;
+        form.render();
+    })
+</script>
+</html>

+ 288 - 0
src/main/webapp/webpage/modules/sg/managementcenter/materialinfo/materialInfoList.js

@@ -0,0 +1,288 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<script>
+$(document).ready(function() {
+	$('#dataTable').bootstrapTable({
+		 
+		  //请求方法
+               method: 'post',
+               //类型json
+               dataType: "json",
+               contentType: "application/x-www-form-urlencoded",
+               //显示检索按钮
+	           showSearch: true,
+               //显示刷新按钮
+               showRefresh: true,
+               //显示切换手机试图按钮
+               showToggle: true,
+               //显示 内容列下拉框
+    	       showColumns: true,
+    	       //显示到处按钮
+    	       showExport: true,
+    	       //显示切换分页按钮
+    	       showPaginationSwitch: true,
+    	       //最低显示2行
+    	       minimumCountColumns: 2,
+               //是否显示行间隔色
+               striped: true,
+               //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)     
+               cache: false,    
+               //是否显示分页(*)  
+               pagination: true,   
+                //排序方式 
+               sortOrder: "asc",  
+               //初始化加载第一页,默认第一页
+               pageNumber:1,   
+               //每页的记录行数(*)   
+               pageSize: 10,  
+               //可供选择的每页的行数(*)    
+               pageList: [10, 25, 50, 100],
+               //这个接口需要处理bootstrap table传递的固定参数,并返回特定格式的json数据  
+               url: "${ctx}/managementcenter/materialinfo/data",
+               //默认值为 'limit',传给服务端的参数为:limit, offset, search, sort, order Else
+               //queryParamsType:'',   
+               ////查询参数,每次调用是会带上这个参数,可自定义                         
+               queryParams : function(params) {
+               	var searchParam = $("#searchForm").serializeJSON();
+               	searchParam.pageNo = params.limit === undefined? "1" :params.offset/params.limit+1;
+               	searchParam.pageSize = params.limit === undefined? -1 : params.limit;
+               	searchParam.orderBy = params.sort === undefined? "" : params.sort+ " "+  params.order;
+                   return searchParam;
+               },
+               //分页方式:client客户端分页,server服务端分页(*)
+               sidePagination: "server",
+               contextMenuTrigger:"right",//pc端 按右键弹出菜单
+               contextMenuTriggerMobile:"press",//手机端 弹出菜单,click:单击, press:长按。
+               contextMenu: '#context-menu',
+               onContextMenuItem: function(row, $el){
+                   if($el.data("item") == "edit"){
+                   		edit(row.id);
+                   }else if($el.data("item") == "view"){
+                       view(row.id);
+                   } else if($el.data("item") == "delete"){
+                        jp.confirm('确认要删除该数据记录吗?', function(){
+                       	jp.loading();
+                       	jp.get("${ctx}/managementcenter/materialinfo/delete?id="+row.id, function(data){
+                   	  		if(data.success){
+                   	  			$('#dataTable').bootstrapTable('refresh');
+                   	  			jp.success(data.msg);
+                   	  		}else{
+                   	  			jp.error(data.msg);
+                   	  		}
+                   	  	})
+                   	   
+                   	});
+                      
+                   } 
+               },
+               onClickRow: function(row, $el){
+               },
+               onLoadSuccess: function () {  //加载成功时执行
+                   getTdValue();
+               },
+               	onShowSearch: function () {
+			$("#search-collapse").slideToggle();
+		},
+               columns: [
+			{
+		              field: 'projectName',
+		              title: '项目名称'
+		    }
+			,{
+		              field: 'materialCode',
+		              title: '物料编码'
+		    }
+		    ,{
+					   field: 'materialName',
+					   title: '物料名称'
+               }
+             ,{
+					   field: 'extendDescription',
+					   title: '扩展描述'
+               }
+             ,{
+					   field: 'unit',
+					   title: '单位'
+               }
+             ,{
+					   field: 'totalCount',
+					   title: '总量'
+               }
+              ,{
+                       field: 'weightKg',
+                       title: '单重/kg'
+                   }
+               ,{
+                       field: 'weightTon',
+                       title: '总重/吨'
+                   }
+             ,{
+                       field: 'supplyType',
+                       title: '甲乙供'
+                   }
+              ,{
+                       field: 'note',
+                       title: '备注'
+                   }
+               ,{
+                       field: 'state',
+                       title : '状态'
+                   }
+
+		     ]
+		
+		});
+		
+		  
+	  if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端
+
+		 
+		  $('#dataTable').bootstrapTable("toggleView");
+		}
+	  
+	  $('#dataTable').on('check.bs.table uncheck.bs.table load-success.bs.table ' +
+                'check-all.bs.table uncheck-all.bs.table', function () {
+            $('#remove').prop('disabled', ! $('#dataTable').bootstrapTable('getSelections').length);
+            $('#view,#edit').prop('disabled', $('#dataTable').bootstrapTable('getSelections').length!=1);
+        });
+
+    $("#btnImport").click(function(){
+             jp.open({
+                       type: 2,
+                       area: [500, 300],
+                       auto: true,
+                       title:"导入数据",
+                       // content: "${ctx}/managementcenter/materialinfo/importExcel" ,
+                       content: "${ctx}/managementcenter/materialinfo/importExcel" ,
+                       btn: ['确定', '关闭'],
+                       btn1: function(index, layero){
+                             var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                             iframeWin.contentWindow.importExcel('${ctx}/managementcenter/materialinfo/importValidation', function (data) {
+                             if(data.success){
+                                jp.success(data.msg);
+                                 refresh();
+                             }else{
+                                jp.error(data.msg);
+                             }
+                            jp.close(index);
+                      });//调用保存事件
+                       return false;
+                     },
+
+              btn2: function(index){
+                        jp.close(index);
+                      }
+                   });
+             });
+
+
+    $("#moreImport").click(function(){
+         jp.open({
+                      type: 2,
+                      area: [800, 400],
+                      auto: true,
+                      title:"导入数据",
+                       content: "${ctx}/managementcenter/materialinfo/importMore/Form" ,
+                       btn: ['确定', '关闭'],
+                      btn1: function(index, layero){
+                      var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                      iframeWin.contentWindow.importExcel('${ctx}/managementcenter/materialinfo/importValidations', function (data) {
+                      if(data.success){
+                           jp.success(data.msg);
+                            refresh();
+                      }else{
+                           jp.error(data.msg);
+                      }
+                      jp.close(index);
+                   });//调用保存事件
+                return false;
+          },
+
+                     btn2: function(index){
+                         jp.close(index);
+                      }
+                  });
+               });
+		
+		
+	 $("#export").click(function(){//导出Excel文件
+			jp.downloadFile('${ctx}/managementcenter/materialinfo/export');
+	  });
+
+		    
+	  $("#search").click("click", function() {// 绑定查询按扭
+		  $('#dataTable').bootstrapTable('refresh');
+		});
+
+
+	 
+	 $("#reset").click("click", function() {// 绑定查询按扭
+		  $("#searchForm  input").val("");
+		  $("#searchForm  select").val("");
+		  $("#searchForm  .select-item").html("");
+		  $('#dataTable').bootstrapTable('refresh');
+		});
+		
+		
+	});
+		
+  function getIdSelections() {
+        return $.map($("#dataTable").bootstrapTable('getSelections'), function (row) {
+            return row.id
+        });
+    }
+
+
+    function getTdValue(){
+            var tableId = document.getElementById("dataTable");
+             for(var i = 1;i < tableId.rows.length;i++) {
+                 if(tableId.rows[i].cells[10].innerHTML.indexOf("0") != -1 ){
+                   tableId.rows[i].setAttribute("style","color: red;");
+                   }
+             }
+    }
+
+  
+  function deleteAll(){
+
+		jp.confirm('确认要删除该数据记录吗?', function(){
+			jp.loading();  	
+			jp.get("${ctx}/managementcenter/materialinfo/deleteAll?ids=" + getIdSelections(), function(data){
+         	  		if(data.success){
+         	  			$('#dataTable').bootstrapTable('refresh');
+         	  			jp.success(data.msg);
+         	  		}else{
+         	  			jp.error(data.msg);
+         	  		}
+         	  	})
+          	   
+		})
+  }
+
+    //刷新列表
+  function refresh(){
+  	$('#dataTable').bootstrapTable('refresh');
+  }
+  
+   function add(){
+	  jp.openSaveDialog('新增', "${ctx}/managementcenter/materialinfo/form",'800px', '500px');
+  }
+
+
+  
+   function edit(id){//没有权限时,不显示确定按钮
+       if(id == undefined){
+	      id = getIdSelections();
+	}
+	jp.openSaveDialog('编辑', "${ctx}/managementcenter/materialinfo/form?id=" + id, '800px', '500px');
+  }
+  
+ function view(id){//没有权限时,不显示确定按钮
+      if(id == undefined){
+             id = getIdSelections();
+      }
+        jp.openViewDialog('查看', "${ctx}/managementcenter/materialinfo/form?id=" + id, '800px', '500px');
+ }
+
+
+
+</script>

+ 118 - 0
src/main/webapp/webpage/modules/sg/managementcenter/materialinfo/materialInfoList.jsp

@@ -0,0 +1,118 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>物料列表</title>
+	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
+	<meta name="decorator" content="ani"/>
+	<%@ include file="/webpage/include/bootstraptable.jsp"%>
+	<%@include file="/webpage/include/treeview.jsp" %>
+	<%@include file="materialInfoList.js" %>
+</head>
+<body>
+	<div class="wrapper wrapper-content">
+	<div class="panel panel-primary">
+	<div class="panel-heading">
+		<h3 class="panel-title">物料列表</h3>
+	</div>
+	<div class="panel-body">
+	
+	<!-- 搜索 -->
+	<div id="search-collapse" class="collapse">
+		<div class="accordion-inner">
+			<form:form id="searchForm" modelAttribute="materialInfo" class="form form-horizontal well clearfix">
+			    <%--<div class="col-xs-12 col-sm-6 col-md-4">--%>
+				   <%--<label class="label-item single-overflow pull-left" title="储备项目暂定名称:">储备项目暂定名称:</label>--%>
+				   <%--<form:input path="reserveProjectName" htmlEscape="false" maxlength="64"  class=" form-control"/>--%>
+			    <%--</div>--%>
+				<div class="col-xs-12 col-sm-6 col-md-4">
+					<label class="label-item single-overflow pull-left" title="项目名称:">项目名称:</label>
+					<form:input path="projectName" htmlEscape="false" maxlength="64"  class=" form-control"/>
+				</div>
+				<%--<div class="col-xs-12 col-sm-6 col-md-4">--%>
+					<%--<label class="label-item single-overflow pull-left" title="储备编码:">储备编码:</label>--%>
+					<%--<form:input path="reserveCode" htmlEscape="false" maxlength="64"  class=" form-control"/>--%>
+				<%--</div>--%>
+				<%--<div class="col-xs-12 col-sm-6 col-md-4">--%>
+					<%--<label class="label-item single-overflow pull-left" title="项目编码:">项目编码:</label>--%>
+					<%--<form:input path="projectCode" htmlEscape="false" maxlength="64"  class=" form-control"/>--%>
+				<%--</div>--%>
+				<%--<div class="col-xs-12 col-sm-6 col-md-4">--%>
+					<%--<label class="label-item single-overflow pull-left" title="项目定义:">项目定义:</label>--%>
+					<%--<form:input path="projectDefine" htmlEscape="false" maxlength="64"  class=" form-control"/>--%>
+				<%--</div>--%>
+				<%--<div class="col-xs-12 col-sm-6 col-md-4">--%>
+					<%--<label class="label-item single-overflow pull-left" title="项目属性:">项目属性:</label>--%>
+					<%--<form:input path="projectAttribute" htmlEscape="false" maxlength="64"  class=" form-control"/>--%>
+				<%--</div>--%>
+				<%--<div class="col-xs-12 col-sm-6 col-md-4">--%>
+					<%--<label class="label-item single-overflow pull-left" title="项目批次:">项目批次:</label>--%>
+					<%--<form:input path="projectBatch" htmlEscape="false" maxlength="64"  class=" form-control"/>--%>
+				<%--</div>--%>
+				<%--<div class="col-xs-12 col-sm-6 col-md-4">--%>
+					<%--<label class="label-item single-overflow pull-left" title="项目批次:">物料批次:</label>--%>
+					<%--<form:input path="suppliesBatch" htmlEscape="false" maxlength="64"  class=" form-control"/>--%>
+				<%--</div>--%>
+		 <div class="col-xs-12 col-sm-6 col-md-4">
+			<div style="margin-top:26px">
+			  <a  id="search" class="btn btn-primary btn-rounded  btn-bordered btn-sm"><i class="fa fa-search"></i> 查询</a>
+			  <a  id="reset" class="btn btn-primary btn-rounded  btn-bordered btn-sm" ><i class="fa fa-refresh"></i> 重置</a>
+			 </div>
+	    </div>	
+	</form:form>
+	</div>
+	</div>
+	
+	<!-- 工具栏 -->
+	<div id="toolbar">
+			<%--<shiro:hasPermission name="managementcenter:materialinfo:add">--%>
+				<%--<button id="add" class="btn btn-primary" onclick="add()">--%>
+					<%--<i class="glyphicon glyphicon-plus"></i> 新建--%>
+				<%--</button>--%>
+			<%--</shiro:hasPermission>--%>
+			<%--<shiro:hasPermission name="managementcenter:materialinfo:edit">--%>
+			    <%--<button id="edit" class="btn btn-success" disabled onclick="edit()">--%>
+	            	<%--<i class="glyphicon glyphicon-edit"></i> 修改--%>
+	        	<%--</button>--%>
+			<%--</shiro:hasPermission>--%>
+			<%--<shiro:hasPermission name="managementcenter:materialinfo:del">--%>
+				<%--<button id="remove" class="btn btn-danger" disabled onclick="deleteAll()">--%>
+	            	<%--<i class="glyphicon glyphicon-remove"></i> 删除--%>
+	        	<%--</button>--%>
+			<%--</shiro:hasPermission>--%>
+		<shiro:hasPermission name="managementcenter:materialinfo:import">
+			<button id="btnImport" class="btn btn-info"><i class="fa fa-folder-open-o"></i> 导入</button>
+		</shiro:hasPermission>
+			<shiro:hasPermission name="managementcenter:materialinfo:import">
+	        		<button id="moreImport" class="btn btn-warning">
+					<i class="fa fa-file-excel-o"></i> 多文件导入
+				</button>
+			 </shiro:hasPermission>
+	                 <%--<shiro:hasPermission name="managementcenter:materialinfo:view">--%>
+				<%--<button id="view" class="btn btn-default" disabled onclick="view()">--%>
+					<%--<i class="fa fa-search-plus"></i> 查看--%>
+				<%--</button>--%>
+			<%--</shiro:hasPermission>--%>
+		    </div>
+		
+	<!-- 表格 -->
+	<table id="dataTable"   data-toolbar="#toolbar"></table>
+
+    <!-- context menu -->
+    <ul id="context-menu" class="dropdown-menu">
+    	<shiro:hasPermission name="managementcenter:materialinfo:add">
+        <li data-item="view"><a>查看</a></li>
+        </shiro:hasPermission>
+    	<shiro:hasPermission name="managementcenter:materialinfo:edit">
+        <li data-item="edit"><a>编辑</a></li>
+        </shiro:hasPermission>
+        <shiro:hasPermission name="managementcenter:materialinfo:del">
+        <li data-item="delete"><a>删除</a></li>
+        </shiro:hasPermission>
+        <li data-item="action1"><a>取消</a></li>
+    </ul>  
+	</div>
+	</div>
+	</div>
+</body>
+</html>

+ 94 - 0
src/main/webapp/webpage/modules/sg/managementcenter/materialproject/materialProjectForm.jsp

@@ -0,0 +1,94 @@
+<%@ 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}/managementcenter/materialproject/save",$('#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="materialProject" class="form-horizontal">
+		<form:hidden path="id"/>	
+		<table class="table table-bordered">
+		   <tbody>
+				<tr>
+					<td class="width-15 active"><label class="pull-right">储备项目暂定名称:</label></td>
+					<td class="width-35">
+						<form:input path="reserveProjectName" htmlEscape="false"    class="form-control required" readonly="true"/>
+					</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="reserveCode" htmlEscape="false"    class="form-control "/>
+					</td>
+					<td class="width-15 active"><label class="pull-right">项目编码:</label></td>
+					<td class="width-35">
+						<form:input path="projectCode" 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="projectDefine" htmlEscape="false"    class="form-control "/>
+					</td>
+					<td class="width-15 active"><label class="pull-right">项目属性:</label></td>
+					<td class="width-35">
+						<form:input path="projectAttribute" 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 required"/>
+					</td>
+					<td class="width-15 active"><label class="pull-right">物料批次:</label></td>
+					<td class="width-35">
+						<%--<form:input path="suppliesBatch" htmlEscape="false"    class="form-control required"/>--%>
+						<form:select path="suppliesBatch"  class="form-control   simple-select">
+							<form:option value="" label=""/>
+							<c:forEach var="item" items="${batch}">
+								<form:option value="${item.suppliesBatch}" label="${item.suppliesBatch}"/>
+							</c:forEach>
+						</form:select>
+					</td>
+				</tr>
+		 	</tbody>
+		</table>
+	</form:form>
+</body>
+</html>

+ 228 - 0
src/main/webapp/webpage/modules/sg/managementcenter/materialproject/materialProjectList.js

@@ -0,0 +1,228 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<script>
+$(document).ready(function() {
+	$('#dataTable').bootstrapTable({
+		 
+		  //请求方法
+               method: 'post',
+               //类型json
+               dataType: "json",
+               contentType: "application/x-www-form-urlencoded",
+               //显示检索按钮
+	           showSearch: true,
+               //显示刷新按钮
+               showRefresh: true,
+               //显示切换手机试图按钮
+               showToggle: true,
+               //显示 内容列下拉框
+    	       showColumns: true,
+    	       //显示到处按钮
+    	       showExport: true,
+    	       //显示切换分页按钮
+    	       showPaginationSwitch: true,
+    	       //最低显示2行
+    	       minimumCountColumns: 2,
+               //是否显示行间隔色
+               striped: true,
+               //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)     
+               cache: false,    
+               //是否显示分页(*)  
+               pagination: true,   
+                //排序方式 
+               sortOrder: "asc",  
+               //初始化加载第一页,默认第一页
+               pageNumber:1,   
+               //每页的记录行数(*)   
+               pageSize: 10,  
+               //可供选择的每页的行数(*)    
+               pageList: [10, 25, 50, 100],
+               //这个接口需要处理bootstrap table传递的固定参数,并返回特定格式的json数据  
+               url: "${ctx}/managementcenter/materialproject/data",
+               //默认值为 'limit',传给服务端的参数为:limit, offset, search, sort, order Else
+               //queryParamsType:'',   
+               ////查询参数,每次调用是会带上这个参数,可自定义                         
+               queryParams : function(params) {
+               	var searchParam = $("#searchForm").serializeJSON();
+               	searchParam.pageNo = params.limit === undefined? "1" :params.offset/params.limit+1;
+               	searchParam.pageSize = params.limit === undefined? -1 : params.limit;
+               	searchParam.orderBy = params.sort === undefined? "" : params.sort+ " "+  params.order;
+                   return searchParam;
+               },
+               //分页方式:client客户端分页,server服务端分页(*)
+               sidePagination: "server",
+               contextMenuTrigger:"right",//pc端 按右键弹出菜单
+               contextMenuTriggerMobile:"press",//手机端 弹出菜单,click:单击, press:长按。
+               contextMenu: '#context-menu',
+               onContextMenuItem: function(row, $el){
+                   if($el.data("item") == "edit"){
+                   		edit(row.id);
+                   }else if($el.data("item") == "view"){
+                       view(row.id);
+                   } else if($el.data("item") == "delete"){
+                        jp.confirm('确认要删除该数据记录吗?', function(){
+                       	jp.loading();
+                       	jp.get("${ctx}/managementcenter/materialproject/delete?id="+row.id, function(data){
+                   	  		if(data.success){
+                   	  			$('#dataTable').bootstrapTable('refresh');
+                   	  			jp.success(data.msg);
+                   	  		}else{
+                   	  			jp.error(data.msg);
+                   	  		}
+                   	  	})
+                   	   
+                   	});
+                      
+                   } 
+               },
+              
+               onClickRow: function(row, $el){
+               },
+               	onShowSearch: function () {
+			$("#search-collapse").slideToggle();
+		},
+               columns: [{
+		        checkbox: true
+
+		    }
+			,{
+		        field: 'reserveProjectName',
+		        title: '储备项目暂定名称'
+		        ,formatter:function(value, row , index){
+		        	value = jp.unescapeHTML(value);
+				   <c:choose>
+					   <c:when test="${fns:hasPermission('managementcenter:materialproject:edit')}">
+					      return "<a href='javascript:edit(\""+row.id+"\")'>"+value+"</a>";
+				      </c:when>
+					  <c:when test="${fns:hasPermission('managementcenter:materialproject:view')}">
+					      return "<a href='javascript:view(\""+row.id+"\")'>"+value+"</a>";
+				      </c:when>
+					  <c:otherwise>
+					      return value;
+				      </c:otherwise>
+				   </c:choose>
+		         }
+		       
+		    }
+			,{
+		              field: 'projectName',
+		              title: '项目名称'
+		    }
+			,{
+		              field: 'reserveCode',
+		              title: '储备编码'
+		    }
+		    ,{
+					   field: 'projectCode',
+					   title: '项目编码'
+               }
+             ,{
+					   field: 'projectDefine',
+					   title: '项目定义'
+               }
+             ,{
+					   field: 'projectAttribute',
+					   title: '项目属性'
+               }
+             ,{
+					   field: 'projectBatch',
+					   title: '项目批次'
+               }
+              ,{
+                       field: 'suppliesBatch',
+                       title: '物资批次'
+                   }
+		     ]
+		
+		});
+		
+		  
+	  if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端
+
+		 
+		  $('#dataTable').bootstrapTable("toggleView");
+		}
+	  
+	  $('#dataTable').on('check.bs.table uncheck.bs.table load-success.bs.table ' +
+                'check-all.bs.table uncheck-all.bs.table', function () {
+            $('#remove').prop('disabled', ! $('#dataTable').bootstrapTable('getSelections').length);
+            $('#view,#edit').prop('disabled', $('#dataTable').bootstrapTable('getSelections').length!=1);
+        });
+		  
+
+		
+		
+	 $("#export").click(function(){//导出Excel文件
+            var batch = $("#bat").val();
+			jp.downloadFile('${ctx}/managementcenter/materialproject/export?projectBatch='+batch);
+	  });
+
+    $("#exportpro").click(function(){//导出Excel文件
+         var batch = $("#bat").val();
+         jp.downloadFile('${ctx}/managementcenter/materialproject/exportpro?projectBatch='+batch);
+    });
+
+		    
+	  $("#search").click("click", function() {// 绑定查询按扭
+		  $('#dataTable').bootstrapTable('refresh');
+		});
+	 
+	 $("#reset").click("click", function() {// 绑定查询按扭
+		  $("#searchForm  input").val("");
+		  $("#searchForm  select").val("");
+		  $("#searchForm  .select-item").html("");
+		  $('#dataTable').bootstrapTable('refresh');
+		});
+		
+		
+	});
+		
+  function getIdSelections() {
+        return $.map($("#dataTable").bootstrapTable('getSelections'), function (row) {
+            return row.id
+        });
+    }
+  
+  function deleteAll(){
+
+		jp.confirm('确认要删除该数据记录吗?', function(){
+			jp.loading();  	
+			jp.get("${ctx}/managementcenter/materialproject/deleteAll?ids=" + getIdSelections(), function(data){
+         	  		if(data.success){
+         	  			$('#dataTable').bootstrapTable('refresh');
+         	  			jp.success(data.msg);
+         	  		}else{
+         	  			jp.error(data.msg);
+         	  		}
+         	  	})
+          	   
+		})
+  }
+
+    //刷新列表
+  function refresh(){
+  	$('#dataTable').bootstrapTable('refresh');
+  }
+  
+   function add(){
+	  jp.openSaveDialog('新增', "${ctx}/managementcenter/materialproject/form",'800px', '500px');
+  }
+
+
+  
+   function edit(id){//没有权限时,不显示确定按钮
+       if(id == undefined){
+	      id = getIdSelections();
+	}
+	jp.openSaveDialog('编辑', "${ctx}/managementcenter/materialproject/form?id=" + id, '800px', '500px');
+  }
+  
+ function view(id){//没有权限时,不显示确定按钮
+      if(id == undefined){
+             id = getIdSelections();
+      }
+        jp.openViewDialog('查看', "${ctx}/managementcenter/materialproject/form?id=" + id, '800px', '500px');
+ }
+
+
+
+</script>

+ 120 - 0
src/main/webapp/webpage/modules/sg/managementcenter/materialproject/materialProjectList.jsp

@@ -0,0 +1,120 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>数据维护</title>
+	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
+	<meta name="decorator" content="ani"/>
+	<%@ include file="/webpage/include/bootstraptable.jsp"%>
+	<%@include file="/webpage/include/treeview.jsp" %>
+	<%@include file="materialProjectList.js" %>
+</head>
+<body>
+	<div class="wrapper wrapper-content">
+	<div class="panel panel-primary">
+	<div class="panel-heading">
+		<h3 class="panel-title">物料项目</h3>
+	</div>
+	<div class="panel-body">
+	
+	<!-- 搜索 -->
+	<div id="search-collapse" class="collapse">
+		<div class="accordion-inner">
+			<form:form id="searchForm" modelAttribute="materialProject" class="form form-horizontal well clearfix">
+			    <div class="col-xs-12 col-sm-6 col-md-4">
+				   <label class="label-item single-overflow pull-left" title="储备项目暂定名称:">储备项目暂定名称:</label>
+				   <form:input path="reserveProjectName" htmlEscape="false" maxlength="64"  class=" form-control"/>
+			    </div>
+				<div class="col-xs-12 col-sm-6 col-md-4">
+					<label class="label-item single-overflow pull-left" title="项目名称:">项目名称:</label>
+					<form:input path="projectName" htmlEscape="false" maxlength="64"  class=" form-control"/>
+				</div>
+				<div class="col-xs-12 col-sm-6 col-md-4">
+					<label class="label-item single-overflow pull-left" title="储备编码:">储备编码:</label>
+					<form:input path="reserveCode" htmlEscape="false" maxlength="64"  class=" form-control"/>
+				</div>
+				<div class="col-xs-12 col-sm-6 col-md-4">
+					<label class="label-item single-overflow pull-left" title="项目编码:">项目编码:</label>
+					<form:input path="projectCode" htmlEscape="false" maxlength="64"  class=" form-control"/>
+				</div>
+				<div class="col-xs-12 col-sm-6 col-md-4">
+					<label class="label-item single-overflow pull-left" title="项目定义:">项目定义:</label>
+					<form:input path="projectDefine" htmlEscape="false" maxlength="64"  class=" form-control"/>
+				</div>
+				<div class="col-xs-12 col-sm-6 col-md-4">
+					<label class="label-item single-overflow pull-left" title="项目属性:">项目属性:</label>
+					<form:input path="projectAttribute" htmlEscape="false" maxlength="64"  class=" form-control"/>
+				</div>
+				<div class="col-xs-12 col-sm-6 col-md-4">
+					<label class="label-item single-overflow pull-left" title="项目批次:">项目批次:</label>
+					<form:input path="projectBatch" htmlEscape="false" maxlength="64"  class=" form-control" id="bat"/>
+				</div>
+				<div class="col-xs-12 col-sm-6 col-md-4">
+					<label class="label-item single-overflow pull-left" title="物料批次:">物料批次:</label>
+					<form:input path="suppliesBatch" htmlEscape="false" maxlength="64"  class=" form-control"/>
+				</div>
+		 <div class="col-xs-12 col-sm-6 col-md-4">
+			<div style="margin-top:26px">
+			  <a  id="search" class="btn btn-primary btn-rounded  btn-bordered btn-sm"><i class="fa fa-search"></i> 查询</a>
+			  <a  id="reset" class="btn btn-primary btn-rounded  btn-bordered btn-sm" ><i class="fa fa-refresh"></i> 重置</a>
+			 </div>
+	    </div>	
+	</form:form>
+	</div>
+	</div>
+	
+	<!-- 工具栏 -->
+	<div id="toolbar">
+			<%--<shiro:hasPermission name="managementcenter:materialproject:add">--%>
+				<%--<button id="add" class="btn btn-primary" onclick="add()">--%>
+					<%--<i class="glyphicon glyphicon-plus"></i> 新建--%>
+				<%--</button>--%>
+			<%--</shiro:hasPermission>--%>
+			<shiro:hasPermission name="managementcenter:materialproject:edit">
+			    <button id="edit" class="btn btn-success" disabled onclick="edit()">
+	            	<i class="glyphicon glyphicon-edit"></i> 修改
+	        	</button>
+			</shiro:hasPermission>
+			<shiro:hasPermission name="managementcenter:materialproject:del">
+				<button id="remove" class="btn btn-danger" disabled onclick="deleteAll()">
+	            	<i class="glyphicon glyphicon-remove"></i> 删除
+	        	</button>
+			</shiro:hasPermission>
+			<shiro:hasPermission name="managementcenter:materialproject:export">
+	        		<button id="export" class="btn btn-warning">
+					<i class="fa fa-file-excel-o"></i> 导出物料
+				</button>
+			 </shiro:hasPermission>
+	                 <shiro:hasPermission name="managementcenter:materialproject:view">
+				<button id="view" class="btn btn-default" disabled onclick="view()">
+					<i class="fa fa-search-plus"></i> 查看
+				</button>
+			</shiro:hasPermission>
+				<shiro:hasPermission name="managementcenter:materialproject:export">
+					<button id="exportpro" class="btn btn-warning">
+						<i class="fa fa-file-excel-o"></i> 导出项目
+					</button>
+				</shiro:hasPermission>
+		    </div>
+		
+	<!-- 表格 -->
+	<table id="dataTable"   data-toolbar="#toolbar"></table>
+
+    <!-- context menu -->
+    <ul id="context-menu" class="dropdown-menu">
+    	<shiro:hasPermission name="managementcenter:materialproject:add">
+        <li data-item="view"><a>查看</a></li>
+        </shiro:hasPermission>
+    	<shiro:hasPermission name="managementcenter:materialproject:edit">
+        <li data-item="edit"><a>编辑</a></li>
+        </shiro:hasPermission>
+        <shiro:hasPermission name="managementcenter:materialproject:del">
+        <li data-item="delete"><a>删除</a></li>
+        </shiro:hasPermission>
+        <li data-item="action1"><a>取消</a></li>
+    </ul>  
+	</div>
+	</div>
+	</div>
+</body>
+</html>

+ 108 - 0
src/main/webapp/webpage/modules/sg/managementcenter/materialversion/importexcel.jsp

@@ -0,0 +1,108 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+    <title>导入Excel</title>
+    <meta name="decorator" content="ani"/>
+    <script>
+        function importExcel(url, fn) {
+            var importForm =$("#importForm")[0];
+            var file = $("#uploadFile").val();
+            var itemBatch = $("#itemBatch").val();
+            if(file.length === 0){
+                layer.msg("请选择文件",{icon: 3,offset:['40%','40%']});
+                return false;
+            }
+            if(itemBatch == null || itemBatch === ''){
+                layer.msg("请输入物料批次",{icon: 3,offset:['40%','40%']});
+                return false;
+            }
+            jp.loading('  正在导入,请稍等...');
+            // jp.uploadFile(importForm, url,function (data) {
+            //    fn(data);
+            // })
+                var data = new FormData(importForm);
+                // data.append("CustomField", "This is some extra data, testing");//如果要添加参数
+                $.ajax({
+                    type: "POST",
+                    enctype: 'multipart/form-data',
+                    url: url,
+                    data: data,
+                    processData: false, //prevent jQuery from automatically transforming the data into a query string
+                    contentType: false,
+                    cache: false,
+                    timeout: 600000,
+                    success: function (result) {
+                        if(result.success && result.errorCode === '-1'){
+                            jp.confirm('该项目已存在,确定覆盖嘛?', function(){
+                                jp.loading('  正在导入,请稍等...');
+                                $.ajax({
+                                    type: "POST",
+                                    enctype: 'multipart/form-data',
+                                    url: '${ctx}/managementcenter/materialversion/import',
+                                    data: data,
+                                    processData: false, //prevent jQuery from automatically transforming the data into a query string
+                                    contentType: false,
+                                    cache: false,
+                                    timeout: 600000,
+                                    success: function (result) {
+                                        fn(result);
+                                    }
+                                })
+                            });
+                        }else if((result.success && result.errorCode === '0')){
+                                   fn(result)
+                        }
+                        // fn(result);
+                    },
+                    error:function(xhr, textStatus){
+                        if(xhr.status == 0){
+                            jp.info("连接失败,请检查网络!")
+                        }else if(xhr.status == 404){
+                            var errDetail ="<font color='red'>404,请求地址不存在!</font>";
+                            top.layer.alert(errDetail , {
+                                icon: 2,
+                                area:['auto','auto'],
+                                title:"请求出错"
+                            })
+                        }else if(xhr.status && xhr.responseText){
+                            var errDetail ="<font color='red'>"+ xhr.responseText.replace(/[\r\n]/g,"<br>").replace(/[\r]/g,"<br>").replace(/[\n]/g,"<br>")+"</font>";
+                            top.layer.alert(errDetail , {
+                                icon: 2,
+                                area:['80%','70%'],
+                                title:xhr.status+"错误"
+                            })
+                        }else{
+                            var errDetail =xhr.responseText=="<font color='red'>未知错误!</font>";
+                            top.layer.alert(errDetail , {
+                                icon: 2,
+                                area:['auto','auto'],
+                                title:"真悲剧,后台抛出异常了"
+                            })
+                        }
+
+                    }
+                })
+        }
+    </script>
+</head>
+<body class="bg-white">
+    <div class="wrapper wrapper-content">
+        <div id="importBox" >
+            <form id="importForm" action="${url}" method="post" enctype="multipart/form-data"
+                  style="padding-left:20px;text-align:center;" onsubmit="loading('正在导入,请稍等...');">
+                <div>
+                    <label class="label-item single-overflow pull-left" title="选择文件:">选择文件:</label>
+                <input id="uploadFile" name="file" type="file" class="form-control" style="width:300px"/>
+                </div>
+                <div style="margin-top: 4px;">
+                    <label class="label-item single-overflow pull-left" title="物料批次:">物料批次:</label>
+                    <input id="itemBatch" name="batch" type="text" class="form-control" style="width:300px"/>
+                </div>
+                 
+
+            </form>
+        </div>
+    </div>
+</body>
+</html>

+ 218 - 0
src/main/webapp/webpage/modules/sg/managementcenter/materialversion/materialVersionList.js

@@ -0,0 +1,218 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<script>
+$(document).ready(function() {
+	$('#dataTable').bootstrapTable({
+		 
+		  //请求方法
+               method: 'post',
+               //类型json
+               dataType: "json",
+               contentType: "application/x-www-form-urlencoded",
+               //显示检索按钮
+	           showSearch: true,
+               //显示刷新按钮
+               showRefresh: true,
+               //显示切换手机试图按钮
+               showToggle: true,
+               //显示 内容列下拉框
+    	       showColumns: true,
+    	       //显示到处按钮
+    	       showExport: true,
+    	       //显示切换分页按钮
+    	       showPaginationSwitch: true,
+    	       //最低显示2行
+    	       minimumCountColumns: 2,
+               //是否显示行间隔色
+               striped: true,
+               //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)     
+               cache: false,    
+               //是否显示分页(*)  
+               pagination: true,   
+                //排序方式 
+               sortOrder: "asc",  
+               //初始化加载第一页,默认第一页
+               pageNumber:1,   
+               //每页的记录行数(*)   
+               pageSize: 10,  
+               //可供选择的每页的行数(*)    
+               pageList: [10, 25, 50, 100],
+               //这个接口需要处理bootstrap table传递的固定参数,并返回特定格式的json数据  
+               url: "${ctx}/managementcenter/materialversion/data",
+               //默认值为 'limit',传给服务端的参数为:limit, offset, search, sort, order Else
+               //queryParamsType:'',   
+               ////查询参数,每次调用是会带上这个参数,可自定义                         
+               queryParams : function(params) {
+               	var searchParam = $("#searchForm").serializeJSON();
+               	searchParam.pageNo = params.limit === undefined? "1" :params.offset/params.limit+1;
+               	searchParam.pageSize = params.limit === undefined? -1 : params.limit;
+               	searchParam.orderBy = params.sort === undefined? "" : params.sort+ " "+  params.order;
+                   return searchParam;
+               },
+               //分页方式:client客户端分页,server服务端分页(*)
+               sidePagination: "server",
+               contextMenuTrigger:"right",//pc端 按右键弹出菜单
+               contextMenuTriggerMobile:"press",//手机端 弹出菜单,click:单击, press:长按。
+               contextMenu: '#context-menu',
+               onContextMenuItem: function(row, $el){
+                   if($el.data("item") == "edit"){
+                   		edit(row.id);
+                   }else if($el.data("item") == "view"){
+                       view(row.id);
+                   } else if($el.data("item") == "delete"){
+                        jp.confirm('确认要删除该数据记录吗?', function(){
+                       	jp.loading();
+                       	jp.get("${ctx}/managementcenter/materialversion/delete?id="+row.id, function(data){
+                   	  		if(data.success){
+                   	  			$('#dataTable').bootstrapTable('refresh');
+                   	  			jp.success(data.msg);
+                   	  		}else{
+                   	  			jp.error(data.msg);
+                   	  		}
+                   	  	})
+                   	   
+                   	});
+                      
+                   } 
+               },
+              
+               onClickRow: function(row, $el){
+               },
+               	onShowSearch: function () {
+			$("#search-collapse").slideToggle();
+		},
+               columns: [{
+		        checkbox: true
+
+		    }
+
+			,{
+		              field: 'batch',
+		              title: '批次'
+		    }
+			,{
+		              field: 'createDate',
+		              title: '导入时间'
+		    }
+		     ]
+		
+		});
+		
+		  
+	  if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端
+
+		 
+		  $('#dataTable').bootstrapTable("toggleView");
+		}
+	  
+	  $('#dataTable').on('check.bs.table uncheck.bs.table load-success.bs.table ' +
+                'check-all.bs.table uncheck-all.bs.table', function () {
+            $('#remove').prop('disabled', ! $('#dataTable').bootstrapTable('getSelections').length);
+            $('#view,#edit').prop('disabled', $('#dataTable').bootstrapTable('getSelections').length!=1);
+        });
+		  
+
+		
+		
+	//  $("#export").click(function(){//导出Excel文件
+    //         var batch = $("#bat").val();
+	// 		jp.downloadFile('${ctx}/managementcenter/materialproject/export?projectBatch='+batch);
+	//   });
+    //
+    // $("#exportpro").click(function(){//导出Excel文件
+    //      var batch = $("#bat").val();
+    //      jp.downloadFile('${ctx}/managementcenter/materialproject/exportpro?projectBatch='+batch);
+    // });
+  $("#btnImport").click(function(){
+                jp.open({
+                        type: 2,
+                        area: [500, 300],
+                        auto: true,
+                        title:"导入数据",
+  // content: "${ctx}/managementcenter/materialinfo/importExcel" ,
+                        content: "${ctx}/managementcenter/materialversion/importExcel" ,
+                         btn: ['确定', '关闭'],
+                          btn1: function(index, layero){
+                             var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                              iframeWin.contentWindow.importExcel('${ctx}/managementcenter/materialversion/importValidation', function (data) {
+                             if(data.success){
+                                   jp.success(data.msg);
+                                    refresh();
+                                 }else{
+                                   jp.error(data.msg);
+                                 }
+                                 jp.close(index);
+                             });//调用保存事件
+                             return false;
+                           },
+
+                        btn2: function(index){
+                           jp.close(index);
+                         }
+                        });
+                         });
+
+		    
+	  $("#search").click("click", function() {// 绑定查询按扭
+		  $('#dataTable').bootstrapTable('refresh');
+		});
+	 
+	 $("#reset").click("click", function() {// 绑定查询按扭
+		  $("#searchForm  input").val("");
+		  $("#searchForm  select").val("");
+		  $("#searchForm  .select-item").html("");
+		  $('#dataTable').bootstrapTable('refresh');
+		});
+		
+		
+	});
+		
+  function getIdSelections() {
+        return $.map($("#dataTable").bootstrapTable('getSelections'), function (row) {
+            return row.id
+        });
+    }
+  
+  function deleteAll(){
+
+		jp.confirm('确认要删除该数据记录吗?', function(){
+			jp.loading();  	
+			jp.get("${ctx}/managementcenter/materialversion/deleteAll?ids=" + getIdSelections(), function(data){
+         	  		if(data.success){
+         	  			$('#dataTable').bootstrapTable('refresh');
+         	  			jp.success(data.msg);
+         	  		}else{
+         	  			jp.error(data.msg);
+         	  		}
+         	  	})
+          	   
+		})
+  }
+
+    //刷新列表
+  function refresh(){
+  	$('#dataTable').bootstrapTable('refresh');
+  }
+  
+   {/*function add(){*/}
+	  {/*jp.openSaveDialog('新增', "${ctx}/managementcenter/materialproject/form",'800px', '500px');*/}
+  {/*}*/}
+
+
+  
+   {/*function edit(id){//没有权限时,不显示确定按钮*/}
+       {/*if(id == undefined){*/}
+	      {/*id = getIdSelections();*/}
+	{/*}*/}
+	{/*jp.openSaveDialog('编辑', "${ctx}/managementcenter/materialproject/form?id=" + id, '800px', '500px');*/}
+  {/*}*/}
+  
+ {/*function view(id){//没有权限时,不显示确定按钮*/}
+      {/*if(id == undefined){*/}
+             {/*id = getIdSelections();*/}
+      {/*}*/}
+        {/*jp.openViewDialog('查看', "${ctx}/managementcenter/materialproject/form?id=" + id, '800px', '500px');*/}
+ {/*}*/}
+
+
+
+</script>

+ 83 - 0
src/main/webapp/webpage/modules/sg/managementcenter/materialversion/materialVersionList.jsp

@@ -0,0 +1,83 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>数据维护</title>
+	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
+	<meta name="decorator" content="ani"/>
+	<%@ include file="/webpage/include/bootstraptable.jsp"%>
+	<%@include file="/webpage/include/treeview.jsp" %>
+	<%@include file="materialVersionList.js" %>
+</head>
+<body>
+	<div class="wrapper wrapper-content">
+	<div class="panel panel-primary">
+	<div class="panel-heading">
+		<h3 class="panel-title">物料项目</h3>
+	</div>
+	<div class="panel-body">
+	
+	<!-- 搜索 -->
+	<div id="search-collapse" class="collapse">
+		<div class="accordion-inner">
+			<form:form id="searchForm" modelAttribute="materialVersion" class="form form-horizontal well clearfix">
+				<div class="col-xs-12 col-sm-6 col-md-4">
+					<label class="label-item single-overflow pull-left" title="物料批次:">物料批次:</label>
+					<form:input path="batch" htmlEscape="false" maxlength="64"  class=" form-control"/>
+				</div>
+		 <div class="col-xs-12 col-sm-6 col-md-4">
+			<div style="margin-top:26px">
+			  <a  id="search" class="btn btn-primary btn-rounded  btn-bordered btn-sm"><i class="fa fa-search"></i> 查询</a>
+			  <a  id="reset" class="btn btn-primary btn-rounded  btn-bordered btn-sm" ><i class="fa fa-refresh"></i> 重置</a>
+			 </div>
+	    </div>	
+	</form:form>
+	</div>
+	</div>
+	
+	<!-- 工具栏 -->
+	<div id="toolbar">
+			<%--<shiro:hasPermission name="managementcenter:materialproject:add">--%>
+				<%--<button id="add" class="btn btn-primary" onclick="add()">--%>
+					<%--<i class="glyphicon glyphicon-plus"></i> 新建--%>
+				<%--</button>--%>
+			<%--</shiro:hasPermission>--%>
+			<%--<shiro:hasPermission name="managementcenter:materialproject:edit">--%>
+			    <%--<button id="edit" class="btn btn-success" disabled onclick="edit()">--%>
+	            	<%--<i class="glyphicon glyphicon-edit"></i> 修改--%>
+	        	<%--</button>--%>
+			<%--</shiro:hasPermission>--%>
+			<shiro:hasPermission name="managementcenter:materialversion:del">
+				<button id="remove" class="btn btn-danger" disabled onclick="deleteAll()">
+	            	<i class="glyphicon glyphicon-remove"></i> 删除
+	        	</button>
+			</shiro:hasPermission>
+			<shiro:hasPermission name="managementcenter:materialversion:import">
+	        		<button id="btnImport" class="btn btn-warning">
+					<i class="fa fa-file-excel-o"></i> 导入物料
+				</button>
+			 </shiro:hasPermission>
+
+		    </div>
+		
+	<!-- 表格 -->
+	<table id="dataTable"   data-toolbar="#toolbar"></table>
+
+    <!-- context menu -->
+    <ul id="context-menu" class="dropdown-menu">
+    	<shiro:hasPermission name="managementcenter:materialproject:add">
+        <li data-item="view"><a>查看</a></li>
+        </shiro:hasPermission>
+    	<shiro:hasPermission name="managementcenter:materialproject:edit">
+        <li data-item="edit"><a>编辑</a></li>
+        </shiro:hasPermission>
+        <shiro:hasPermission name="managementcenter:materialproject:del">
+        <li data-item="delete"><a>删除</a></li>
+        </shiro:hasPermission>
+        <li data-item="action1"><a>取消</a></li>
+    </ul>  
+	</div>
+	</div>
+	</div>
+</body>
+</html>

+ 29 - 0
target/classes/act/build.xml

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="act" default="welcome">
+
+	<!-- properties from key value -->
+	<property name="designs" value="designs" />
+	<property name="deployments" value="deployments" />
+
+	<!-- 显示欢迎信息以及操作提示 -->
+	<target name="welcome">
+		<echo>Activiti打包程序,请输入命令后操作!</echo>
+	</target>
+
+	<!-- 请假流程定义打包 -->
+	<target name="oa.leave">
+		<echo>打包流程定义:请假流程</echo>
+		<copy file="${designs}/oa/leave/leave.bpmn" tofile="${designs}/oa/leave/leave.bpmn20.xml" />
+		<zip destfile="${deployments}/oa/leave/leave.bar" basedir="${designs}/oa/leave" update="true" includes="*.xml,*.png" />
+		<delete file="${designs}/oa/leave/leave.bpmn20.xml" />
+	</target>
+	
+	<!-- 请假流程定义打包-自定义表单 -->
+	<target name="oa.test_audit">
+		<echo>打包流程定义:测试审核流程</echo>
+		<copy file="${designs}/oa/test_audit/test_audit.bpmn" tofile="${designs}/oa/test_audit/test_audit.bpmn20.xml" />
+		<zip destfile="${deployments}/oa/test_audit/test_audit.bar" basedir="${designs}/oa/test_audit" update="true" includes="*.xml,*.png" />
+		<delete file="${designs}/oa/test_audit/test_audit.bpmn20.xml" />
+	</target>
+
+</project>

+ 0 - 0
target/classes/act/deployments/oa/test_audit/test_audit.bar


Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio