Browse Source

Merge remote-tracking branch 'origin/master'

蔡德晨 5 years ago
parent
commit
11b3abcd8a

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

@@ -4,6 +4,8 @@
 package com.jeeplus.modules.sg.information.entity;
 
 import java.util.Date;
+import java.util.List;
+
 import com.fasterxml.jackson.annotation.JsonFormat;
 
 import com.jeeplus.common.utils.excel.annotation.ExcelField;
@@ -77,6 +79,36 @@ public class Information extends DataEntity<Information>  {
 	//归口部门
 	private String underCentralized;
 
+	String[] attrs;
+
+	List<Information> fileList;
+
+	public String getHiddenSign() {
+		return hiddenSign;
+	}
+
+	public void setHiddenSign(String hiddenSign) {
+		this.hiddenSign = hiddenSign;
+	}
+
+	private String hiddenSign;
+
+	public String[] getAttrs() {
+		return attrs;
+	}
+
+	public void setAttrs(String[] attrs) {
+		this.attrs = attrs;
+	}
+
+	public List<Information> getFileList() {
+		return fileList;
+	}
+
+	public void setFileList(List<Information> fileList) {
+		this.fileList = fileList;
+	}
+
 	public String getComplete() {
 		return complete;
 	}

+ 28 - 0
src/main/java/com/jeeplus/modules/sg/information/entity/searchDto.java

@@ -0,0 +1,28 @@
+package com.jeeplus.modules.sg.information.entity;
+
+import com.jeeplus.core.persistence.DataEntity;
+
+import java.util.List;
+
+public class searchDto extends DataEntity<searchDto> {
+    List<Information> fileList;
+
+    List<Information> boxList;
+
+
+    public List<Information> getFileList() {
+        return fileList;
+    }
+
+    public void setFileList(List<Information> fileList) {
+        this.fileList = fileList;
+    }
+
+    public List<Information> getBoxList() {
+        return boxList;
+    }
+
+    public void setBoxList(List<Information> boxList) {
+        this.boxList = boxList;
+    }
+}

+ 12 - 3
src/main/java/com/jeeplus/modules/sg/information/mapper/xml/InformationMapper.xml

@@ -238,9 +238,6 @@
 		left JOIN project_append as b on a.project_id = b.project_id
         <where>
 			1=1
-            <if test="projectId != null and projectId != ''">
-                AND a.project_id = #{projectId}
-            </if>
             <if test="projectName != null and projectName != ''">
                 AND a.project_name LIKE
                 <if test="dbName == 'oracle'">'%'||#{projectName}||'%'</if>
@@ -267,6 +264,18 @@
 					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>
         </where>
         <choose>
             <when test="page !=null and page.orderBy != null and page.orderBy != ''">

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

@@ -10,6 +10,7 @@ import java.util.List;
 import com.jeeplus.modules.sg.information.entity.Information;
 import com.jeeplus.modules.sg.information.entity.append;
 import com.jeeplus.modules.sg.information.entity.constant;
+import com.jeeplus.modules.sg.information.entity.searchDto;
 import com.jeeplus.modules.sg.information.mapper.InformationMapper;
 import com.jeeplus.modules.sg.material.entity.Material;
 import io.swagger.models.auth.In;
@@ -104,6 +105,67 @@ public class InformationService extends CrudService<InformationMapper, Informati
 		return page1;
 	}
 
+/*	public Page<Information> findSearchPage(Page<Information> page, searchDto entity) {
+		//从数据库中查询数据
+		Page<Information> page1 = super.findPage(page, entity);
+
+		//获取本页数据对象列表
+		List<Information> list = page1.getList();
+
+
+		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 > 14) {
+								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 > 14) {
+								in.setOverdue("是");
+							} else {
+								in.setOverdue("否");
+							}
+						}
+					}
+				}
+			}
+//			}
+		}
+
+		return page1;
+	}*/
+
+
 	@Override
 	public List<Information> findListBy(List<Information> entity) {
 		return super.findListBy(entity);

+ 0 - 3
src/main/java/com/jeeplus/modules/sg/information/utils/ImportInformation.java

@@ -102,9 +102,6 @@ public  class ImportInformation {
                     material.setIsBackNo(isBackNo);
                 }
 
-
-
-
                 material.setInforId(inforId.toString());
                 material.setProjectId(projectId.toString());
                 material.setMaterialName(materialName.toString());

+ 45 - 0
src/main/java/com/jeeplus/modules/sg/information/utils/RandomUtil.java

@@ -0,0 +1,45 @@
+package com.jeeplus.modules.sg.information.utils;
+
+import java.io.File;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Random;
+
+import static com.jeeplus.common.utils.FileUtils.deleteDirectory;
+import static com.jeeplus.common.utils.FileUtils.deleteFile;
+
+public class RandomUtil {
+    /**
+     * 生成随机文件名:当前年月日时分秒+五位随机数
+     *
+     * @return
+     */
+    public static String getRandomFileName() {
+
+        SimpleDateFormat simpleDateFormat;
+
+        simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
+
+        Date date = new Date();
+
+        String str = simpleDateFormat.format(date);
+
+        Random random = new Random();
+
+        int rannum = (int) (random.nextDouble() * (99999 - 10000 + 1)) + 10000;// 获取5位随机数
+
+        return rannum + str;// 当前时间
+    }
+
+    public static void delete(String fileName) {
+        File file = new File(fileName);
+        if (!file.exists()) {
+            System.out.println("删除文件失败:" + fileName + "不存在!");
+        } else {
+            if (file.isFile())
+                 deleteFile(fileName);
+            else
+                 deleteDirectory(fileName);
+        }
+    }
+}

+ 29 - 0
src/main/java/com/jeeplus/modules/sg/information/utils/SessionListener1.java

@@ -0,0 +1,29 @@
+package com.jeeplus.modules.sg.information.utils;
+
+import org.apache.shiro.session.Session;
+import org.apache.shiro.session.SessionListener;
+
+public class SessionListener1 implements SessionListener {
+    @Override
+    public void onStart(Session session) {
+
+    }
+
+    @Override
+    public void onStop(Session session) {
+        Object path = session.getAttribute("path");
+        if (path != null && path != "") {
+            RandomUtil.delete(path.toString());
+            session.removeAttribute("path");
+        }
+    }
+
+    @Override
+    public void onExpiration(Session session) {
+        Object path = session.getAttribute("path");
+        if (path != null && path != "") {
+            RandomUtil.delete(path.toString());
+            session.removeAttribute("path");
+        }
+    }
+}

+ 103 - 31
src/main/java/com/jeeplus/modules/sg/information/web/InformationController.java

@@ -26,9 +26,12 @@ import com.jeeplus.modules.sg.information.entity.constant;
 import com.jeeplus.modules.sg.information.service.InformationService;
 import com.jeeplus.modules.sg.information.utils.FreemarkerUtil;
 import com.jeeplus.modules.sg.information.utils.ImportInformation;
+import com.jeeplus.modules.sg.information.utils.RandomUtil;
 import com.jeeplus.modules.sg.information.utils.ResponseUtil;
 import com.jeeplus.modules.sg.material.entity.Material;
 import com.jeeplus.modules.sg.material.service.MaterialService;
+import com.jeeplus.modules.sg.record.entity.Record;
+import com.jeeplus.modules.sg.record.service.RecordService;
 import freemarker.template.Configuration;
 import freemarker.template.Template;
 import io.swagger.models.auth.In;
@@ -70,6 +73,8 @@ public class InformationController extends BaseController {
 	private InformationService informationService;
 	@Autowired
 	private MaterialService materialService;
+	@Autowired
+	private RecordService recordService;
 
 	@ModelAttribute
 	public Information get(@RequestParam(required=false) String id) {
@@ -100,8 +105,41 @@ public class InformationController extends BaseController {
 	@RequiresPermissions("modules:sg:information:information:list")
 	@RequestMapping(value = "data")
 	public Map<String, Object> data(Information information, HttpServletRequest request, HttpServletResponse response, Model model) {
+		String hiddenSign = information.getHiddenSign();
 		HttpSession session = request.getSession();
-		session.removeAttribute("path");
+		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);
+						}
+						bufferedReader.close();
+					} catch (IOException e) {
+						e.printStackTrace();
+					}
+					information.setFileList(tList);
+			} else {
+				if (path != null && path != "") {
+					RandomUtil.delete(path.toString());
+					session.removeAttribute("path");
+				}
+			}
+
+
+		String str = information.getProjectId();
+		if (str.equals("")) {
+
+		} else {
+			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);
 	}
@@ -125,7 +163,6 @@ public class InformationController extends BaseController {
 	}
 
 	//变更超期时间节点
-	@RequiresPermissions(value={"modules:sg:information:information:add","modules:sg:information:information:edit"},logical=Logical.OR)
 	@RequestMapping(value = "updateConstant")
 	@ResponseBody
 	public String updateConstant(constant constant) {
@@ -139,36 +176,31 @@ public class InformationController extends BaseController {
 
 
 
-	/**
-	 * 导入甲供物资Excel数据
-	 */
-	@RequiresPermissions("modules:sg:information:information:import")
-	@ResponseBody
-    @RequestMapping(value = "import")
-   	public AjaxJson importFile(@RequestParam("file")MultipartFile file, HttpServletResponse response, HttpServletRequest request) {
-		AjaxJson j = new AjaxJson();
-		try {
-			StringBuilder failureMsg = new StringBuilder();
-			ImportExcel ei = new ImportExcel(file, 1, 0);
-//			List<Information> list = ei.getDataList(Information.class);
+
+    /**
+     * 导入甲供物资和项目信息
+     */
+//    @RequiresPermissions("modules:sg:information:information:import")
+    @ResponseBody
+    @RequestMapping(value = "importTwo")
+    public String importFile(MultipartFile btnCom,MultipartFile btnInformation, HttpServletResponse response, HttpServletRequest request) {
+        try {
+            ImportExcel importExcel = new ImportExcel(btnInformation, 1, 0);
+            int excelLastDataRowNum = importExcel.getLastDataRowNum();
+            Map<String, Integer> importCom = ImportInformation.importCom(importExcel, excelLastDataRowNum);
+			ImportExcel ei = new ImportExcel(btnCom, 1, 0);
 			int lastDataRowNum = ei.getLastDataRowNum();
 			Map<String, Object> information = ImportInformation.importmation(ei, lastDataRowNum);
-			//获取失败条数
-			int failureNum = Integer.parseInt(information.get("failureNum").toString());
-			//获取成功条数
-			int successNum = Integer.parseInt(information.get("successNum").toString());
-
-			if (failureNum>0){
-				failureMsg.insert(0, ",失败 "+failureNum+" 项目管理记录。");
-			}
-			j.setMsg( "已成功导入 "+successNum+" 项目管理记录;"+failureMsg);
-		} catch (Exception e) {
-			j.setSuccess(false);
-			j.setMsg("导入项目管理信息失败!失败信息:"+e.getMessage());
-		}
-		return j;
+			Record record = new Record();
+            recordService.save(record);
+			return "插入成功";
+        } catch (Exception e) {
+            e.getMessage();
+			return "插入失败";
+        }
     }
 
+
 	/**
 	 *	导入综合信息Excel数据
 	 * */
@@ -197,6 +229,37 @@ public class InformationController extends BaseController {
 
 
 
+    /**
+	 * 导入甲供物资Excel数据
+	 */
+	@RequiresPermissions("modules:sg:information:information:import")
+	@ResponseBody
+    @RequestMapping(value = "import")
+   	public AjaxJson importFile(@RequestParam("file")MultipartFile file, HttpServletResponse response, HttpServletRequest request) {
+		AjaxJson j = new AjaxJson();
+		try {
+			StringBuilder failureMsg = new StringBuilder();
+			ImportExcel ei = new ImportExcel(file, 1, 0);
+//			List<Information> list = ei.getDataList(Information.class);
+			int lastDataRowNum = ei.getLastDataRowNum();
+			Map<String, Object> information = ImportInformation.importmation(ei, lastDataRowNum);
+			//获取失败条数
+			int failureNum = Integer.parseInt(information.get("failureNum").toString());
+			//获取成功条数
+			int successNum = Integer.parseInt(information.get("successNum").toString());
+
+			if (failureNum>0){
+				failureMsg.insert(0, ",失败 "+failureNum+" 项目管理记录。");
+			}
+			j.setMsg( "已成功导入 "+successNum+" 项目管理记录;"+failureMsg);
+		} catch (Exception e) {
+			j.setSuccess(false);
+			j.setMsg("导入项目管理信息失败!失败信息:"+e.getMessage());
+		}
+		return j;
+    }
+
+
 	@RequiresPermissions("modules:sg:information:information:import")
 	@ResponseBody
 	@RequestMapping(value = "importInTrial")
@@ -220,6 +283,7 @@ public class InformationController extends BaseController {
 		return j;
 	}
 
+	//批量查询
 	@RequiresPermissions("modules:sg:information:information:import")
 	@ResponseBody
 	@RequestMapping(value = "btnSearch")
@@ -247,8 +311,15 @@ public class InformationController extends BaseController {
 			}
 			List<Information> listBy = informationService.findListBy(infor);
 		try {
+			HttpSession session = request.getSession();
+			Object oldPath = session.getAttribute("path");
+			if (oldPath != null && oldPath != "") {
+				RandomUtil.delete(oldPath.toString());
+				session.removeAttribute("path");
+			}
 			File path = new File(this.getClass().getResource("/").getPath()+"/freemarker");
-			File temp =new File(path+"\\information");
+			String fileName = RandomUtil.getRandomFileName();
+			File temp =new File(path+"\\"+fileName);
 			/**
 			 * 在临时文件中写入内容
 			 */
@@ -383,10 +454,11 @@ public class InformationController extends BaseController {
 		} catch (UnsupportedEncodingException e) {
 			e.printStackTrace();
 		}
-		HttpSession session = request.getSession();
-		Object path = session.getAttribute("path");
+
 		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;

+ 0 - 5
src/main/java/com/jeeplus/modules/sg/material/web/MaterialController.java

@@ -55,7 +55,6 @@ public class MaterialController extends BaseController {
 	/**
 	 * 物料详情列表页
 	 */
-	@RequiresPermissions("modules:sg:material:material:list")
 	@RequestMapping(value = {"list", ""})
 	public String list(Material material, Model model) {
 		model.addAttribute("materialList", material);
@@ -67,14 +66,12 @@ public class MaterialController extends BaseController {
 	 * 物料详情列表数据
 	 */
 	@ResponseBody
-	@RequiresPermissions("modules:sg:material:material:list")
 	@RequestMapping(value = "data")
 	public Map<String, Object> data(Material material, HttpServletRequest request, HttpServletResponse response, Model model) {
 		Page<Material> page = materialService.findPage(new Page<Material>(request, response), material);
 		return getBootstrapData(page);
 	}
 
-	@RequiresPermissions(value={"modules:sg:material:material:view","modules:sg:material:material:add","modules:sg:material:material:edit"},logical= Logical.OR)
 	@RequestMapping(value = "form")
 	public String form(Material material, Model model) {
 		model.addAttribute("Material", material);
@@ -85,7 +82,6 @@ public class MaterialController extends BaseController {
 	/**
 	 * 修改未完成领退料物料原因
 	 * */
-	@RequiresPermissions(value={"modules:sg:material:material:add","modules:sg:material:material:edit"},logical=Logical.OR)
 	@RequestMapping(value = "update")
 	@ResponseBody
 	public String updateInfo(Material material) {
@@ -118,7 +114,6 @@ public class MaterialController extends BaseController {
 	 */
 
 	@ResponseBody
-	@RequiresPermissions("modules:sg:material:material:export")
     @RequestMapping(value = "export")
     public AjaxJson exportFile(Material material, HttpServletRequest request, HttpServletResponse response) {
 		AjaxJson j = new AjaxJson();

+ 26 - 0
src/main/java/com/jeeplus/modules/sg/record/mapper/xml/RecordMapper.xml

@@ -67,4 +67,30 @@
 			</otherwise>
 		</choose>
 	</select>
+
+	<insert id="insert">
+		insert into project_record (
+			id,
+			information,
+			material,
+			importUser,
+			importDate,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			del_flag
+		)values(
+			#{id},
+			'完成',
+			'完成',
+			#{createBy.name},
+			#{createDate},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{delFlag}
+		)
+	</insert>
 </mapper>

+ 6 - 0
src/main/java/com/jeeplus/modules/sg/record/service/RecordService.java

@@ -46,4 +46,10 @@ public class RecordService extends CrudService<RecordMapper, Record> {
 		return super.findListBy(entity);
 	}
 
+	@Transactional(readOnly = false)
+	public void save(Record entity) {
+		entity.preInsert();
+		recordMapper.insert(entity);
+	}
+
 }

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

@@ -11,7 +11,7 @@
 
 j2cache.broadcast = redis
 
-#组播的通道名称
+#\u7EC4\u64AD\u7684\u901A\u9053\u540D\u79F0
 jgroups.channel.name = j2cache
 jgroups.configXml = /j2cache/network.xml
 
@@ -66,8 +66,8 @@ caffeine.region.default = 1000, 1h
 #
 # single -> single redis server
 # sentinel -> master-slaves servers
-# cluster -> cluster servers (数据库配置无效,使用 database = 0)
-# sharded -> sharded servers  (密码、数据库必须在 hosts 中指定,且连接池配置无效 ; redis://user:password@127.0.0.1:6379/0)
+# cluster -> cluster servers (\u6570\u636E\u5E93\u914D\u7F6E\u65E0\u6548\uFF0C\u4F7F\u7528 database = 0\uFF09
+# sharded -> sharded servers  (\u5BC6\u7801\u3001\u6570\u636E\u5E93\u5FC5\u987B\u5728 hosts \u4E2D\u6307\u5B9A\uFF0C\u4E14\u8FDE\u63A5\u6C60\u914D\u7F6E\u65E0\u6548 ; redis://user:password@127.0.0.1:6379/0\uFF09
 #
 #########################################
 
@@ -88,7 +88,7 @@ redis.cluster_name = j2cache
 redis.namespace = 
 
 ## connection
-redis.hosts = 127.0.0.1:6379
+redis.hosts = 192.168.2.4:6379
 redis.timeout = 2000
 redis.password =
 redis.database = 0

+ 4 - 1
src/main/resources/spring/spring-context-shiro.xml

@@ -82,8 +82,11 @@
  		
 		<property name="sessionIdCookie" ref="sessionIdCookie"/>
 		<property name="sessionIdCookieEnabled" value="true"/>
+		<property name="sessionListeners" ref="sessionListener1"/>
 	</bean>
-	
+
+	<bean id="sessionListener1" class="com.jeeplus.modules.sg.information.utils.SessionListener1"></bean>
+
 	<!-- 指定本系统SESSIONID, 默认为: JSESSIONID 问题: 与SERVLET容器名冲突, 如JETTY, TOMCAT 等默认JSESSIONID,
 		当跳出SHIRO SERVLET时如ERROR-PAGE容器会为JSESSIONID重新分配值导致登录会话丢失! -->
 	<bean id="sessionIdCookie" class="org.apache.shiro.web.servlet.SimpleCookie">

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

@@ -263,11 +263,11 @@ $(document).ready(function() {
 	function getTdValue() {
 		var tableId = document.getElementById("informationTable");
 		for(var i = 1;i < tableId.rows.length;i++) {
-			if(tableId.rows[i].cells[18].innerHTML.indexOf("是") != -1 || tableId.rows[i].cells[18].innerHTML.indexOf("否") != -1  ){
+			if(tableId.rows[i].cells[12].innerHTML.indexOf("是") != -1 || tableId.rows[i].cells[12].innerHTML.indexOf("否") != -1){
 				tableId.rows[i].setAttribute("style","color: red;");
-
 			}
 		}
+		$("#hiddenSign").val("不是第一次加载")
 	}
 
 
@@ -374,8 +374,8 @@ $(document).ready(function() {
             btn2: function(index, layero){
                 var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
                 iframeWin.contentWindow.importExcel('${ctx}/sg/information/btnSearch', function (data) {
-						top.layer.msg('成功', {icon:1})
-					console.log(data);
+                	top.layer.msg('成功', {icon:1})
+					$('#informationTable').bootstrapTable({pagination:false});
 					$('#informationTable').bootstrapTable('load',data);
 					jp.close(index);
                 });//调用保存事件
@@ -471,6 +471,8 @@ $(document).ready(function() {
 		  $("#searchForm  select").val("");
 		  $('#informationTable').bootstrapTable('refresh');
 		});
+
+
 	});
 
   function getIdSelections() {
@@ -481,7 +483,6 @@ $(document).ready(function() {
 
 
 
-
     //刷新列表
   function refresh() {
       $('#informationTable').bootstrapTable('refresh');

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

@@ -63,6 +63,8 @@
 						</form:select>
 					</div>
 				</div>
+				<form:hidden path="hiddenSign"/>
+<%--				<form:input type="hidden" id="hiddenSign"/>--%>
 		 <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>
@@ -75,8 +77,7 @@
 	
 	<!-- 工具栏 -->
 	<div id="toolbar">
-		<input id="excelFile" type="file" value="导入综合信息表" class="btn btn-info">
-		<shiro:hasPermission name="modules:sg:information:information:import">
+<%--		<shiro:hasPermission name="modules:sg:information:information:import">
 			<button id="btnCom" class="btn btn-info">
 				<i class="fa fa-folder-open-o"></i> 导入综合信息表
 			</button>
@@ -85,7 +86,7 @@
 			<button id="btnInformation" class="btn btn-info">
 				<i class="fa fa-folder-open-o"></i> 导入甲供材
 			</button>
-		</shiro:hasPermission>
+		</shiro:hasPermission>--%>
 		<shiro:hasPermission name="modules:sg:information:information:import">
 			<button id="btnInReason" class="btn btn-info">
 				<i class="fa fa-folder-open-o"></i> 导入原因类型
@@ -121,7 +122,6 @@
 				<i class="fa fa-file-excel-o"></i> 配置超期时间
 			</button>
 		</shiro:hasPermission>
-
 		    </div>
 		
 	<!-- 表格 -->

+ 0 - 2
src/main/webapp/webpage/modules/sg/material/materialList.jsp

@@ -37,11 +37,9 @@
 	
 	<!-- 工具栏 -->
 			<div id="toolbar">
-				<shiro:hasPermission name="test:onetomany:dialog:materialList:export">
 					<button id="export" class="btn btn-warning">
 						<i class="fa fa-file-excel-o"></i> 导出
 					</button>
-				</shiro:hasPermission>
 		    </div>
 		
 	<!-- 表格 -->

+ 38 - 23
src/main/webapp/webpage/modules/sg/record/recordList.js

@@ -103,43 +103,58 @@ $(document).ready(function() {
 		});
 
 	document.getElementById("btnCom").addEventListener("change",function () {
-		console.log("change");
-		var val = $("#btnCom").val();
-		console.log(val);
-		if (val != '') {
-			$("table:eq(0) tr:eq(1) td:eq(0)").html('完成');
-
-			$("table:eq(0) tr:eq(1) td:eq(1)").text();
-		} else {
-			$("table:eq(0) tr:eq(1) td:eq(0)").html('-');
-		}
 		change()
 	});
 
 	document.getElementById("btnInformation").addEventListener("change",function () {
-		console.log("change");
-		var val = $("#btnInformation").val();
-		console.log(val);
-		if (val != '') {
-			$("table:eq(0) tr:eq(1) td:eq(1)").html('完成');
-		} else {
-			$("table:eq(0) tr:eq(1) td:eq(1)").html('-');
-		}
 		change()
 	});
 
 	function change() {
-		var btnCom = $("table:eq(0) tr:eq(1) td:eq(0)").text();
-		var btnInformation = $("table:eq(0) tr:eq(1) td:eq(1)").text();
-		console.log(btnCom);
+		var btnInformation = document.getElementById("btnInformation").value;
+		var btnCom = document.getElementById("btnCom").value;
 		console.log(btnInformation);
-		if (btnCom == '完成' && btnInformation == '完成') {
+		console.log(btnCom);
+		if (btnInformation !="" && btnCom !="") {
 			$('#exportMaterial').css({'display':'block','text-align':'center','margin':'0 auto'});
 		} else {
-			$('#exportMaterial').css('display','none');
+
 		}
 	}
 
+
+		$("#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("网络请求失败,请重试!");
+				}
+			})
+		});
+
 	});
 
     //刷新列表

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

@@ -43,28 +43,27 @@
 	</div>
 	
 	<!-- 工具栏 -->
-	<div id="toolbar" style="float: left;display: flex">
-		<shiro:hasPermission name="test:onetomany:dialog:materialList:export">
+
+<%--		<shiro:hasPermission name="test:onetomany:dialog:materialList:export">
 			<button id="export" class="btn btn-warning">
 				<i class="fa fa-file-excel-o"></i> 导出
 			</button>
-		</shiro:hasPermission>
-		<form action="/$">
-		<input type="file" id="btnCom" class="btn btn-info" value="导入综合信息表"/>
-		</form>
-		<form action="/$">
-		<input style="margin-left: 10px" type="file" id="btnInformation" class="btn btn-info" value="导入甲供材"/>
-		</form>
-	</div>
+		</shiro:hasPermission>--%>
+
+<form  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>
-			<td>甲供材表是否完成</td>
+			<td>选择综合信息表</td>
+			<td>选择甲供材表</td>
 			<td>操作</td>
 		</tr>
 		<tr>
-			<td>-</td>
-			<td>-</td>
+			<td align="center">
+					<input id="btnInformation" name="btnInformation"   type="file"  class="btn btn-info" style="margin: 0 auto" />
+			</td>
+			<td align="center">
+					<input id="btnCom" name="btnCom" type="file"  class="btn btn-info"  style="margin: 0 auto"/>
+			</td>
 			<td width="100px">
 				<button id="exportMaterial" class="btn btn-warning" style="display: none">
 					<i class="fa fa-file-excel-o"></i> 同步
@@ -72,6 +71,7 @@
 			</td>
 		</tr>
 	</table>
+</form>
 	<!-- 表格 -->
 	<table id="informationTable"   data-toolbar="#toolbar"></table>
     <!-- context menu -->