Преглед на файлове

导出项目,导出物料,导出word根据新查询功能重写
导入项目,导入物料,页面加载刷新完善完成
查询超期日期大于,等于,小于,输入天数,完成

yue преди 5 години
родител
ревизия
f87985f5cd

+ 0 - 3
src/main/java/com/jeeplus/modules/sg/information/entity/Information.java

@@ -105,9 +105,6 @@ public class Information extends DataEntity<Information>  {
 	}
 
 
-
-
-
 	public String getHiddenSign() {
 		return hiddenSign;
 	}

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

@@ -62,4 +62,6 @@ public interface InformationMapper extends BaseMapper<Information> {
     String findOverTime(String overType);
 
     int updateConstant(constant constant);
+
+    List<Information> findListWord(Information entity);
 }

+ 106 - 28
src/main/java/com/jeeplus/modules/sg/information/mapper/xml/InformationMapper.xml

@@ -233,7 +233,8 @@
 
     <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.construction,b.outConstruction,b.settlement,b.underCentralized,
+		datediff(if(firstFinish='否' or secondFinish = '否',NOW(),if(secondFinish = '是',secondFinishDate,firstFinishDate)),approvalDate) as newdate
         FROM project_information as a
 		left JOIN project_append as b on a.project_id = b.project_id
         <where>
@@ -276,6 +277,25 @@
 						#{item.projectId}
 					</foreach>
 			</if>
+			<if test="extendedStatus !=null and extendedStatus!=''">
+				<if test="extendedTime !=null and extendedTime!=''">
+					<if test="extendedStatus == '大于等于'.toString()">
+						and  datediff(if(firstFinish='否' or secondFinish = '否',NOW(),if(secondFinish = '是',secondFinishDate,firstFinishDate)),approvalDate) &gt;= ${extendedTime}
+					</if>
+					<if test="extendedStatus == '大于'.toString()">
+						and  datediff(if(firstFinish='否' or secondFinish = '否',NOW(),if(secondFinish = '是',secondFinishDate,firstFinishDate)),approvalDate) &gt; ${extendedTime}
+					</if>
+					<if test="extendedStatus == '等于'.toString()">
+						and  datediff(if(firstFinish='否' or secondFinish = '否',NOW(),if(secondFinish = '是',secondFinishDate,firstFinishDate)),approvalDate) = ${extendedTime}
+					</if>
+					<if test="extendedStatus =='小于等于'.toString()">
+						and  datediff(if(firstFinish='否' or secondFinish = '否',NOW(),if(secondFinish = '是',secondFinishDate,firstFinishDate)),approvalDate) &lt;= ${extendedTime}
+					</if>
+					<if test="extendedStatus =='小于'.toString()">
+						and  datediff(if(firstFinish='否' or secondFinish = '否',NOW(),if(secondFinish = '是',secondFinishDate,firstFinishDate)),approvalDate) &lt; ${extendedTime}
+					</if>
+				</if>
+			</if>
         </where>
         <choose>
             <when test="page !=null and page.orderBy != null and page.orderBy != ''">
@@ -427,34 +447,9 @@
 		select *
 		from material_information
 		where project_Id in(
-		SELECT
-		project_Id
-		FROM project_information as a
-		<where>
-			1=1
-		<foreach collection="list" item="items" index="index">
-			<if test="items.projectId != null and items.projectId != ''">
-				AND a.project_Id = #{items.projectId}
-			</if>
-			<if test="items.projectName != null and items.projectName != ''">
-				AND a.project_Name LIKE
-				concat('%',#{items.projectName},'%')
-			</if>
-			<if test="items.department != null and items.department != ''">
-				AND a.department = #{items.department}
-			</if>
-			<if test="items.secondUnits != null and items.secondUnits != '' ">
-				AND a.second_Units=#{items.secondUnits}
-			</if>
-			<if test="items.firstUnits != null and items.firstUnits != '' ">
-				AND a.first_Units=#{items.firstUnits}
-			</if>
-			<if test="items.projectType !=null and items.projectType != ''">
-				and a.project_type = #{items.projectType}
-			</if>
+		<foreach collection="list" item="items" index="index"  separator=",">
+			#{items.projectId}
 		</foreach>
-		</where>
-
 		)
 	</select>
 
@@ -537,4 +532,87 @@
 	<update id="updateConstant" parameterType="com.jeeplus.modules.sg.information.entity.constant">
 		update project_constant set overTime = #{overTime} where overType = 'overTime';
 	</update>
+
+
+	<select id="findListWord" resultType="com.jeeplus.modules.sg.information.entity.Information">
+		SELECT
+		<include refid="newInformationColumns"/>,b.trial,b.construction,b.outConstruction,b.settlement,b.underCentralized,
+		datediff(if(firstFinish='否' or secondFinish = '否',NOW(),if(secondFinish = '是',secondFinishDate,firstFinishDate)),approvalDate) as newdate
+		FROM project_information as a
+		left JOIN project_append as b on a.project_id = b.project_id
+		<where>
+			1=1
+			and a.project_Id in (
+				select project_Id
+				from material_information
+				where (status is not null
+				or status != '') group by project_id
+			)
+			<if test="projectName != null and projectName != ''">
+				AND a.project_name LIKE
+				<if test="dbName == 'oracle'">'%'||#{projectName}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{projectName}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{projectName},'%')</if>
+			</if>
+			<if test="department != null and department != ''">
+				AND a.department = #{department}
+			</if>
+			<if test="secondUnits != null and secondUnits != '' ">
+				AND a.second_units=#{secondUnits}
+			</if>
+			<if test="firstUnits != null and firstUnits != '' ">
+				AND a.first_units=#{firstUnits}
+			</if>
+			<if test="projectType !=null and projectType != ''">
+				and a.project_type = #{projectType}
+			</if>
+			<if test="firstFinish!=null and firstFinish!=''">
+				<if test="firstFinish == '是'.toString()">
+					and a.firstFinish='是' and (a.secondFinish != '否' or a.secondFinish is null)
+				</if>
+				<if test="firstFinish == '否'.toString()">
+					and (a.firstFinish='否' or a.secondFinish = '否')
+				</if>
+			</if>
+			<if test="attrs != null and  attrs !='' ">
+				and a.project_id in
+				<foreach collection="attrs" item="item" index="index" open="(" separator="," close=")">
+					#{item}
+				</foreach>
+			</if>
+			<if test="fileList != null and  fileList !='' ">
+				and a.project_id in
+				<foreach collection="fileList" item="item" index="index" open="(" separator="," close=")">
+					#{item.projectId}
+				</foreach>
+			</if>
+			<if test="extendedStatus !=null and extendedStatus!=''">
+				<if test="extendedTime !=null and extendedTime!=''">
+					<if test="extendedStatus == '大于等于'.toString()">
+						and  datediff(if(firstFinish='否' or secondFinish = '否',NOW(),if(secondFinish = '是',secondFinishDate,firstFinishDate)),approvalDate) &gt;= ${extendedTime}
+					</if>
+					<if test="extendedStatus == '大于'.toString()">
+						and  datediff(if(firstFinish='否' or secondFinish = '否',NOW(),if(secondFinish = '是',secondFinishDate,firstFinishDate)),approvalDate) &gt; ${extendedTime}
+					</if>
+					<if test="extendedStatus == '等于'.toString()">
+						and  datediff(if(firstFinish='否' or secondFinish = '否',NOW(),if(secondFinish = '是',secondFinishDate,firstFinishDate)),approvalDate) = ${extendedTime}
+					</if>
+					<if test="extendedStatus =='小于等于'.toString()">
+						and  datediff(if(firstFinish='否' or secondFinish = '否',NOW(),if(secondFinish = '是',secondFinishDate,firstFinishDate)),approvalDate) &lt;= ${extendedTime}
+					</if>
+					<if test="extendedStatus =='小于'.toString()">
+						and  datediff(if(firstFinish='否' or secondFinish = '否',NOW(),if(secondFinish = '是',secondFinishDate,firstFinishDate)),approvalDate) &lt; ${extendedTime}
+					</if>
+				</if>
+			</if>
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY update_date DESC
+			</otherwise>
+		</choose>
+	</select>
 </mapper>

+ 53 - 5
src/main/java/com/jeeplus/modules/sg/information/service/InformationService.java

@@ -3,6 +3,7 @@
  */
 package com.jeeplus.modules.sg.information.service;
 
+import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
@@ -48,14 +49,12 @@ public class InformationService extends CrudService<InformationMapper, Informati
 	}
 
 	public Page<Information> findPage(Page<Information> page, Information entity) {
-
 		Page<Information> page1 = super.findPage(page, entity);
 		List<Information> list = page1.getList();
 		String find = informationMapper.findOverTime("overTime");
 		int overTime = Integer.parseInt(find);
 		Calendar cal = Calendar.getInstance();
-		String extendedStatus = entity.getExtendedStatus();
-		String extendedTime = entity.getExtendedTime();
+
 		long between_days = 0;
 		for (Information in : list) {
 			//判断审定日期是否为空
@@ -103,7 +102,6 @@ public class InformationService extends CrudService<InformationMapper, Informati
 				}
 //			}
 		}
-
 		return page1;
 	}
 
@@ -170,7 +168,53 @@ public class InformationService extends CrudService<InformationMapper, Informati
 
 	@Override
 	public List<Information> findListBy(List<Information> entity) {
-		return super.findListBy(entity);
+		List<Information> information = super.findListBy(entity);
+		String find = informationMapper.findOverTime("overTime");
+		int overTime = Integer.parseInt(find);
+		Calendar cal = Calendar.getInstance();
+		long between_days = 0;
+		for (Information in : information) {
+		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 information;
 	}
 
 	@Transactional(readOnly = false)
@@ -342,4 +386,8 @@ public class InformationService extends CrudService<InformationMapper, Informati
 	public int updateConstant(constant constant) {
 		return informationMapper.updateConstant(constant);
 	}
+
+	public List<Information> findListWord(Information entity) {
+		return informationMapper.findListWord(entity);
+	}
 }

+ 1 - 6
src/main/java/com/jeeplus/modules/sg/information/utils/ImportInformation.java

@@ -53,7 +53,6 @@ public  class ImportInformation {
                 Object materialMid = ei.getCellValue(row, 14);
                 Object materialBig = ei.getCellValue(row, 15);
                 String isBack = "";
-
                 if (outboundAmount.equals("")) {
                     outboundAmount = "0.0";
                 }
@@ -169,13 +168,9 @@ public  class ImportInformation {
                         if (needInfor.getFirstFinish() == "" || needInfor.getFirstFinish() == null || ("否").equals(needInfor.getFirstFinish())) {
                             upInfor.setFirstFinish("是");
                             upInfor.setFirstFinishDate(new Date());
-                        } else if (("否").equals(needInfor.getSecondFinish())) {
+                        }  else if (("否").equals(needInfor.getSecondFinish())) {
                             upInfor.setSecondFinish("是");
                             upInfor.setSecondFinishDate(new Date());
-                        } else if (("是").equals(needInfor.getSecondFinish())) {
-                            upInfor.setFirstFinish("是");
-                            upInfor.setSecondFinish(" ");
-                            upInfor.setFirstFinishDate(new Date());
                         }
                     } else {
                         if (needInfor.getFirstFinish() == "" || needInfor.getFirstFinish() == null || ("否").equals(needInfor.getFirstFinish())) {

+ 188 - 151
src/main/java/com/jeeplus/modules/sg/information/web/InformationController.java

@@ -109,21 +109,23 @@ public class InformationController extends BaseController {
 		HttpSession session = request.getSession();
 		Object path = session.getAttribute("path");
 			if (hiddenSign.equals("不是第一次加载")) {
-				List<Information> tList = new ArrayList<>();
-					try {
-						BufferedReader bufferedReader = null;
-						bufferedReader = new BufferedReader(new FileReader(path.toString()));
-						String string;
-						while ((string=bufferedReader.readLine()) != null){
-							Information information1 = new Information();
-							information1.setProjectId(string);
-							tList.add(information1);
+				if (path !=null && !path.equals("")) {
+					List<Information> tList = new ArrayList<>();
+						try {
+							BufferedReader bufferedReader = null;
+							bufferedReader = new BufferedReader(new FileReader(path.toString()));
+							String string;
+							while ((string=bufferedReader.readLine()) != null){
+								Information information1 = new Information();
+								information1.setProjectId(string);
+								tList.add(information1);
+							}
+							bufferedReader.close();
+						} catch (IOException e) {
+							e.printStackTrace();
 						}
-						bufferedReader.close();
-					} catch (IOException e) {
-						e.printStackTrace();
-					}
-					information.setFileList(tList);
+						information.setFileList(tList);
+				}
 			} else {
 				if (path != null && path != "") {
 					RandomUtil.delete(path.toString());
@@ -131,7 +133,6 @@ public class InformationController extends BaseController {
 				}
 			}
 
-
 		String str = information.getProjectId();
 		if (str.equals("")) {
 
@@ -139,7 +140,6 @@ public class InformationController extends BaseController {
 			String[] strArr = str.split("\\s+");
 			information.setAttrs(strArr);
 		}
-//		Page<Information> page = informationService.findSearchPage(new Page<Information>(request, response), information,String[] strArr);
 		Page<Information> page = informationService.findPage(new Page<Information>(request, response), information);
 		return getBootstrapData(page);
 	}
@@ -183,8 +183,9 @@ public class InformationController extends BaseController {
 //    @RequiresPermissions("modules:sg:information:information:import")
     @ResponseBody
     @RequestMapping(value = "importTwo")
-    public String importFile(MultipartFile btnCom,MultipartFile btnInformation, HttpServletResponse response, HttpServletRequest request) {
-        try {
+    public AjaxJson importFile(MultipartFile btnCom,MultipartFile btnInformation, HttpServletResponse response, HttpServletRequest request) {
+		AjaxJson j = new AjaxJson();
+    	try {
             ImportExcel importExcel = new ImportExcel(btnInformation, 1, 0);
             int excelLastDataRowNum = importExcel.getLastDataRowNum();
             Map<String, Integer> importCom = ImportInformation.importCom(importExcel, excelLastDataRowNum);
@@ -193,11 +194,12 @@ public class InformationController extends BaseController {
 			Map<String, Object> information = ImportInformation.importmation(ei, lastDataRowNum);
 			Record record = new Record();
             recordService.save(record);
-			return "插入成功";
+			j.setMsg("成功");
         } catch (Exception e) {
-            e.getMessage();
-			return "插入失败";
+    		j.setSuccess(false);
+			j.setMsg("失败");
         }
+		return j;
     }
 
 
@@ -260,7 +262,7 @@ public class InformationController extends BaseController {
     }
 
 
-	@RequiresPermissions("modules:sg:information:information:import")
+	@RequiresPermissions("modules:sg:information:information:importTrial")
 	@ResponseBody
 	@RequestMapping(value = "importInTrial")
 	public AjaxJson importInTrial(@RequestParam("file")MultipartFile file, HttpServletResponse response, HttpServletRequest request) {
@@ -344,7 +346,7 @@ public class InformationController extends BaseController {
 		}
 
 	//导入原因类型
-	@RequiresPermissions("modules:sg:information:information:import")
+	@RequiresPermissions("modules:sg:information:information:importReason")
 	@ResponseBody
 	@RequestMapping(value = "btnInReason")
 	public AjaxJson btnInReason(@RequestParam("file")MultipartFile file, Information information, HttpServletRequest request, HttpServletResponse response, Model model) {
@@ -437,66 +439,80 @@ public class InformationController extends BaseController {
 		String projectYear = "";
 		String firstUnits = "";
 		String secondUnits = "";
-
+		String firstFinish = "";
+		String extendedStatus = "";
+		String extendedTime = "";
+		String hiddenSign = "";
 		try {
-		projectId = request.getParameter("projectId");
-		projectName = request.getParameter("projectName");
+			projectId = request.getParameter("projectId");
+			projectId = new String(projectId.getBytes("iso8859-1"),"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");
-		projectType = request.getParameter("projectType");
+			information.setProjectName(projectName);
+			projectType = request.getParameter("projectType");
 			projectType = new String(projectType.getBytes("iso8859-1"),"utf-8");
-		projectYear = request.getParameter("projectYear");
+			information.setProjectType(projectType);
+			projectYear = request.getParameter("projectYear");
 			projectYear = new String(projectYear.getBytes("iso8859-1"),"utf-8");
-		firstUnits= request.getParameter("firstUnits");
+			information.setProjectType(projectYear);
+			firstUnits= request.getParameter("firstUnits");
 			firstUnits = new String(firstUnits.getBytes("iso8859-1"),"utf-8");
-		secondUnits= request.getParameter("secondUnits");
+			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();
 		}
-
-		List<Information> tList = new ArrayList<>();
 		AjaxJson j = new AjaxJson();
 		HttpSession session = request.getSession();
 		Object path = session.getAttribute("path");
-		if (path != null && path != "") {
-//			 * 读取临时文件中的内容
-			BufferedReader bufferedReader = null;
-			try {
-				bufferedReader = new BufferedReader(new FileReader(path.toString()));
-				String string;
-				while ((string=bufferedReader.readLine()) != null){
-					Information information1 = new Information();
-					information1.setProjectId(string);
-					tList.add(information1);
-				}
-				bufferedReader.close();
+		if (hiddenSign.equals("不是第一次加载")) {
+			if (path !=null && !path.equals("")) {
+				List<Information> tList = new ArrayList<>();
 				try {
-					String fileName = "导出物料清单"+ DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
-					List<Material> materialList = informationService.allNoBack(tList);
-					new ExportExcel("导出物料清单", Material.class).setDataList(materialList).write(response, fileName).dispose();
-					j.setSuccess(true);
-					j.setMsg("导出成功!");
-					return j;
-				} catch (Exception e) {
-					j.setSuccess(false);
-					j.setMsg("导出物料清单!失败信息:"+e.getMessage());
+					BufferedReader bufferedReader = null;
+					bufferedReader = new BufferedReader(new FileReader(path.toString()));
+					String string;
+					while ((string=bufferedReader.readLine()) != null){
+						Information information1 = new Information();
+						information1.setProjectId(string);
+						tList.add(information1);
+					}
+					bufferedReader.close();
+				} catch (IOException e) {
+					e.printStackTrace();
 				}
-			} catch (IOException e) {
-				e.printStackTrace();
+				information.setFileList(tList);
 			}
 		} else {
-			Information information1 = new Information();
-			information1.setProjectId(projectId);
-			information1.setProjectName(projectName);
-			information1.setProjectType(projectType);
-			information1.setProjectYear(projectYear);
-			information1.setFirstUnits(firstUnits);
-			information1.setSecondUnits(secondUnits);
-			tList.add(information1);
-			try {
+			if (path != null && path != "") {
+				RandomUtil.delete(path.toString());
+				session.removeAttribute("path");
+			}
+		}
+		List<Information> list = informationService.findList(information);
+		try {
 				String fileName = "导出物料清单"+ DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
-				List<Material> materialList = informationService.allNo(tList);
+				List<Material> materialList = informationService.allNo(list);
 				new ExportExcel("导出物料清单", Material.class).setDataList(materialList).write(response, fileName).dispose();
 				j.setSuccess(true);
 				j.setMsg("导出成功!");
@@ -505,7 +521,6 @@ public class InformationController extends BaseController {
 				j.setSuccess(false);
 				j.setMsg("导出物料清单!失败信息:"+e.getMessage());
 			}
-		}
 		return j;
 	}
 
@@ -520,63 +535,80 @@ public class InformationController extends BaseController {
 		String projectYear = "";
 		String firstUnits = "";
 		String secondUnits = "";
+		String firstFinish = "";
+		String extendedStatus = "";
+		String extendedTime = "";
+		String hiddenSign = "";
 		try {
 			projectId = request.getParameter("projectId");
+			projectId = new String(projectId.getBytes("iso8859-1"),"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");
+			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();
 		}
+		AjaxJson j = new AjaxJson();
 		HttpSession session = request.getSession();
 		Object path = session.getAttribute("path");
-		List<Information> tList = new ArrayList<>();
-		AjaxJson j = new AjaxJson();
-		if (path != null && path != "") {
-//			 * 读取临时文件中的内容
-			BufferedReader bufferedReader = null;
-			try {
-				bufferedReader = new BufferedReader(new FileReader(path.toString()));
-				String string;
-				while ((string=bufferedReader.readLine()) != null){
-					Information information1 = new Information();
-					information1.setProjectId(string);
-					tList.add(information1);
-				}
-				bufferedReader.close();
+		if (hiddenSign.equals("不是第一次加载")) {
+			if (path !=null && !path.equals("")) {
+				List<Information> tList = new ArrayList<>();
 				try {
-					String fileName = "导出项目清单"+ DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
-					List<Information> informationList = informationService.exportInfor(tList);
-					new ExportExcel("导出项目清单", Information.class).setDataList(informationList).write(response, fileName).dispose();
-					j.setSuccess(true);
-					j.setMsg("导出成功!");
-					return j;
-				} catch (Exception e) {
-					j.setSuccess(false);
-					j.setMsg("导出项目清单!失败信息:"+e.getMessage());
+					BufferedReader bufferedReader = null;
+					bufferedReader = new BufferedReader(new FileReader(path.toString()));
+					String string;
+					while ((string=bufferedReader.readLine()) != null){
+						Information information1 = new Information();
+						information1.setProjectId(string);
+						tList.add(information1);
+					}
+					bufferedReader.close();
+				} catch (IOException e) {
+					e.printStackTrace();
 				}
-			} catch (IOException e) {
-				e.printStackTrace();
+				information.setFileList(tList);
 			}
 		} else {
-			Information information1 = new Information();
-			information1.setProjectId(projectId);
-			information1.setProjectName(projectName);
-			information1.setProjectType(projectType);
-			information1.setProjectYear(projectYear);
-			information1.setFirstUnits(firstUnits);
-			information1.setSecondUnits(secondUnits);
-			tList.add(information1);
+			if (path != null && path != "") {
+				RandomUtil.delete(path.toString());
+				session.removeAttribute("path");
+			}
+		}
+
 			try {
 				String fileName = "导出项目清单"+ DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
-				List<Information> informationList = informationService.export(tList);
+				List<Information> informationList = informationService.findList(information);
 				new ExportExcel("导出项目清单", Information.class).setDataList(informationList).write(response, fileName).dispose();
 				j.setSuccess(true);
 				j.setMsg("导出成功!");
@@ -585,7 +617,6 @@ public class InformationController extends BaseController {
 				j.setSuccess(false);
 				j.setMsg("导出项目清单!失败信息:"+e.getMessage());
 			}
-		}
 		return j;
 	}
 
@@ -602,26 +633,76 @@ public class InformationController extends BaseController {
 		String projectYear = "";
 		String firstUnits = "";
 		String secondUnits = "";
+		String firstFinish = "";
+		String extendedStatus = "";
+		String extendedTime = "";
+		String hiddenSign = "";
 		try {
 			projectId = request.getParameter("projectId");
+			projectId = new String(projectId.getBytes("iso8859-1"),"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");
+			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();
 		}
-		HttpSession session = request.getSession();
-		Object pathSession = session.getAttribute("path");
 		AjaxJson j = new AjaxJson();
-
+		HttpSession session = request.getSession();
+		Object outPath = session.getAttribute("path");
+		if (hiddenSign.equals("不是第一次加载")) {
+			if (outPath !=null && !outPath.equals("")) {
+				List<Information> tList = new ArrayList<>();
+				try {
+					BufferedReader bufferedReader = null;
+					bufferedReader = new BufferedReader(new FileReader(outPath.toString()));
+					String string;
+					while ((string=bufferedReader.readLine()) != null){
+						Information information1 = new Information();
+						information1.setProjectId(string);
+						tList.add(information1);
+					}
+					bufferedReader.close();
+				} catch (IOException e) {
+					e.printStackTrace();
+				}
+				information.setFileList(tList);
+			}
+		} else {
+			if (outPath != null && outPath != "") {
+				RandomUtil.delete(outPath.toString());
+				session.removeAttribute("path");
+			}
+		}
 		StringBuilder stringBuilder = new StringBuilder();
 		Template template=null;
 		File path = new File(this.getClass().getResource("/").getPath()+"/freemarker");
@@ -636,24 +717,7 @@ public class InformationController extends BaseController {
 			e.printStackTrace();
 		}
 		Map<String,Object> data  = new HashMap<>();
-		List<Information> tList = new ArrayList<>();
-		if (pathSession != null && pathSession != "") {
-			BufferedReader bufferedReader = null;
-			try {
-				bufferedReader = new BufferedReader(new FileReader(pathSession.toString()));
-				String string;
-				while ((string = bufferedReader.readLine()) != null) {
-					Information information1 = new Information();
-					information1.setProjectId(string);
-					tList.add(information1);
-				}
-				bufferedReader.close();
-			} catch (IOException e) {
-				e.printStackTrace();
-			}
-			List<Material> proId = materialService.findProId(tList);
-			if (proId.size()!=0) {
-				List<Information> informationList = materialService.proIdName(proId);
+			List<Information> informationList = informationService.findListWord(information);
 				for (int i = 0; i < informationList.size(); i++) {
 					stringBuilder.append(i + 1 + "." + informationList.get(i).getProjectName() + "(" + informationList.get(i).getProjectId() + ")");
 					Information information1 = informationList.get(i);
@@ -665,33 +729,6 @@ public class InformationController extends BaseController {
 					stringBuilder.append("<w:p></w:p>");
 					stringBuilder.append("<w:p></w:p>");
 				}
-			}
-		} else {
-			Information infor = new Information();
-			infor.setProjectId(projectId);
-			infor.setProjectName(projectName);
-			infor.setProjectType(projectType);
-			infor.setProjectYear(projectYear);
-			infor.setFirstUnits(firstUnits);
-			infor.setSecondUnits(secondUnits);
-			tList.add(infor);
-			List<Information> idByList = informationService.findIdByList(tList);
-			List<Material> proId = materialService.findProId(idByList);
-			if (proId.size()!=0) {
-				List<Information> informationList = materialService.proIdName(proId);
-				for (int i = 0; i < informationList.size(); i++) {
-					stringBuilder.append(i + 1 + "." + informationList.get(i).getProjectName() + "(" + informationList.get(i).getProjectId() + ")");
-					Information information1 = informationList.get(i);
-					List<Material> mateial = materialService.findMateial(information1);
-					for (int k = 0; k < mateial.size(); k++) {
-						stringBuilder.append("<w:p></w:p>");
-						stringBuilder.append(k + 1 + "." + mateial.get(k).getMaterialName() + "(" + mateial.get(k).getInforId() + "),出库数量为" + mateial.get(k).getOutboundNumber() + ",审定数量为" + mateial.get(k).getAuthorizedNumber() + ",由于原因" + mateial.get(k).getStatus() + ":" + mateial.get(k).getInfo() + ",已完成甲供物资领退料。");
-					}
-					stringBuilder.append("<w:p></w:p>");
-					stringBuilder.append("<w:p></w:p>");
-				}
-			}
-		}
 		data.put("mb",stringBuilder);
 		File docFile = new File(path+"\\甲供物资超欠供说明.doc");
 		FreemarkerUtil.generateFile(data,template,docFile);

+ 41 - 5
src/main/webapp/webpage/modules/sg/information/informationList.js

@@ -375,9 +375,9 @@ $(document).ready(function() {
                 var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
                 iframeWin.contentWindow.importExcel('${ctx}/sg/information/btnSearch', function (data) {
                 	top.layer.msg('成功', {icon:1})
-					$('#informationTable').bootstrapTable({pagination:false});
 					$('#informationTable').bootstrapTable('load',data);
 					jp.close(index);
+					getTdValue();
                 });//调用保存事件
                 return false;
             },
@@ -423,13 +423,21 @@ $(document).ready(function() {
 		var projectYear = $("#projectYear").val();
 		var firstUnits = $("#firstUnits").val();
 		var secondUnits = $("#secondUnits").val();
-		console.log(projectId);
+		var firstFinish = $("#firstFinish").val();
+		var extendedStatus = $("#extendedStatus").val();
+		var extendedTime = $("#extendedTime").val();
+		var hiddenSign = $("#hiddenSign").val();
+		console.log(projectId );
 		console.log(projectName);
 		console.log(projectType);
 		console.log(projectYear);
 		console.log(firstUnits);
 		console.log(secondUnits);
-		jp.downloadFile('${ctx}/sg/information/exportMaterial?projectId='+projectId+'&projectName='+projectName+'&projectType='+projectType+'&projectYear='+projectYear+'&firstUnits='+firstUnits+'&secondUnits='+secondUnits);
+		console.log(firstFinish);
+		console.log(extendedStatus);
+		console.log(extendedTime);
+		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);
 	});
 
 //导出项目清单
@@ -440,7 +448,21 @@ $(document).ready(function() {
 		var projectYear = $("#projectYear").val();
 		var firstUnits = $("#firstUnits").val();
 		var secondUnits = $("#secondUnits").val();
-		jp.downloadFile('${ctx}/sg/information/export?projectId='+projectId+'&projectName='+projectName+'&projectType='+projectType+'&projectYear='+projectYear+'&firstUnits='+firstUnits+'&secondUnits='+secondUnits);
+		var firstFinish = $("#firstFinish").val();
+		var extendedStatus = $("#extendedStatus").val();
+		var extendedTime = $("#extendedTime").val();
+		var hiddenSign = $("#hiddenSign").val();
+		console.log(projectId );
+		console.log(projectName);
+		console.log(projectType);
+		console.log(projectYear);
+		console.log(firstUnits);
+		console.log(secondUnits);
+		console.log(firstFinish);
+		console.log(extendedStatus);
+		console.log(extendedTime);
+		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);
 
 	});
 
@@ -452,7 +474,21 @@ $(document).ready(function() {
 		var projectYear = $("#projectYear").val();
 		var firstUnits = $("#firstUnits").val();
 		var secondUnits = $("#secondUnits").val();
-		jp.downloadFile('${ctx}/sg/information/exportInformation?projectId='+projectId+'&projectName='+projectName+'&projectType='+projectType+'&projectYear='+projectYear+'&firstUnits='+firstUnits+'&secondUnits='+secondUnits);
+		var firstFinish = $("#firstFinish").val();
+		var extendedStatus = $("#extendedStatus").val();
+		var extendedTime = $("#extendedTime").val();
+		var hiddenSign = $("#hiddenSign").val();
+		console.log(projectId );
+		console.log(projectName);
+		console.log(projectType);
+		console.log(projectYear);
+		console.log(firstUnits);
+		console.log(secondUnits);
+		console.log(firstFinish);
+		console.log(extendedStatus);
+		console.log(extendedTime);
+		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);
 	});
 
 	$("#editOverTime").click(function () {

+ 5 - 5
src/main/webapp/webpage/modules/sg/information/informationList.jsp

@@ -71,7 +71,7 @@
 							<form:option value="大于等于"> 大于等于</form:option>
 							<form:option value="大于"> 大于</form:option>
 							<form:option value="等于"> 等于</form:option>
-							<form:option value="小于等于"> <= </form:option>
+							<form:option value="小于等于"> 小于等于 </form:option>
 							<form:option value="小于"> 小于</form:option>
 						</form:select>
 					</div>
@@ -107,12 +107,12 @@
 				<i class="fa fa-folder-open-o"></i> 导入甲供材
 			</button>
 		</shiro:hasPermission>--%>
-		<shiro:hasPermission name="modules:sg:information:information:import">
+		<shiro:hasPermission name="modules:sg:information:information:importReason">
 			<button id="btnInReason" class="btn btn-info">
 				<i class="fa fa-folder-open-o"></i> 导入原因类型
 			</button>
 		</shiro:hasPermission>
-		<shiro:hasPermission name="modules:sg:information:information:import">
+		<shiro:hasPermission name="modules:sg:information:information:importTrial">
 			<button id="btnInTrial" class="btn btn-info">
 				<i class="fa fa-folder-open-o"></i> 导入送审
 			</button>
@@ -137,11 +137,11 @@
 				<i class="fa fa-file-excel-o"></i> 导出欠供说明
 			</button>
 		</shiro:hasPermission>
-		<shiro:hasPermission name="modules:sg:information:information:edit">
+<%--		<shiro:hasPermission name="modules:sg:information:information:edit">
 			<button id="editOverTime" class="btn btn-danger">
 				<i class="fa fa-file-excel-o"></i> 配置超期时间
 			</button>
-		</shiro:hasPermission>
+		</shiro:hasPermission>--%>
 		    </div>
 		
 	<!-- 表格 -->

+ 32 - 30
src/main/webapp/webpage/modules/sg/record/recordList.js

@@ -123,40 +123,42 @@ $(document).ready(function() {
 	}
 
 
-		$("#exportMaterial").bind("click",function(){
-
-			var btnCom = document.getElementById("btnCom").files[0]
-			var btnInformation = document.getElementById("btnInformation").files[0]
-			var formDate = new FormData();
-			formDate.append("btnCom",btnCom)
-			formDate.append("btnInformation",btnInformation)
-			var defer = $.Deferred();
-			$.ajax({
-				url: "${ctx}/sg/information/importTwo",
-				type: 'post',
-				data: formDate,
-				cache: false,
-/*				beforeSend:jp.loading('  正在导入,请稍等...'),*/
-				contentType: false,
-				processData: false,
-				success: function (index,data) {
-					//判断数据是不是成功修改
-					if (data == success) {
-						jp.success("插入成功");
-						refresh();
-					} else {
-						jp.error("插入失败")
-					}
-					jp.close(index);
-				},
-				error: function (data) {
-					alert("网络请求失败,请重试!");
+	$("#exportMaterial").click(function(){
+		var btnCom = document.getElementById("btnCom").files[0]
+		var btnInformation = document.getElementById("btnInformation").files[0]
+		console.log(btnCom);
+		console.log(btnInformation);
+		var formDate = new FormData();
+		formDate.append("btnCom", btnCom);
+		formDate.append("btnInformation", btnInformation);
+		jp.loading('正在导入,请稍等...');
+		// var defer = $.Deferred();
+		$.ajax({
+			url: "${ctx}/sg/information/importTwo",
+			type: 'post',
+			data: formDate,
+			cache: false,
+			contentType: false,
+			processData: false,
+			dataType:"json",
+			success:function (data) {
+				console.log(data);
+				console.log(data.success);
+				if (data.success) {
+					jp.success("成功");
+					window.location.reload();
+				} else {
+					jp.error("失败");
+					window.location.reload();
 				}
-			})
-		});
+			}
+		})
+	});
 
 	});
 
+
+
     //刷新列表
   function refresh() {
       $('#informationTable').bootstrapTable('refresh');

+ 2 - 2
src/main/webapp/webpage/modules/sg/record/recordList.jsp

@@ -50,7 +50,7 @@
 			</button>
 		</shiro:hasPermission>--%>
 
-<form  id="recordForm" action="${ctx}/sg/information/importTwo" enctype="multipart/form-data" method="post">
+<div  id="recordForm" action="${ctx}/sg/information/importTwo" enctype="multipart/form-data" method="post">
 	<table id="record" width="100%" STYLE="border: 1px solid #dedede;">
 		<tr>
 			<td>选择综合信息表</td>
@@ -71,7 +71,7 @@
 			</td>
 		</tr>
 	</table>
-</form>
+</div>
 	<!-- 表格 -->
 	<table id="informationTable"   data-toolbar="#toolbar"></table>
     <!-- context menu -->