Browse Source

案例文件批量下载,登录首页更改密码无需输入旧密码调整

徐滕 1 week ago
parent
commit
fd0935ba91

+ 7 - 0
src/main/java/com/jeeplus/modules/projectAccessory/dao/ProjectTemplateDao.java

@@ -55,6 +55,13 @@ public interface ProjectTemplateDao extends CrudDao<ProjectTemplateInfo>,TreeDao
      * @param parentId
      * @return
      */
+    List<ProjectTemplateInfo> getProjectAccessoryListByParentId(ProjectAccessoryRelationInfo projectTemplateInfo);
+
+    /**
+     * 根据父id获取子信息
+     * @param parentId
+     * @return
+     */
     List<ProjectTemplateInfo> getCaseBaseAccessoryListByParentId(String parentId);
     /**
      * 根据父id获取子信息并保留当前id项

+ 225 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsCaseBaseService.java

@@ -6,6 +6,9 @@ import com.jeeplus.common.persistence.Page;
 import com.jeeplus.common.service.CrudService;
 import com.jeeplus.common.utils.Collections3;
 import com.jeeplus.common.utils.MenuStatusEnum;
+import com.jeeplus.modules.projectAccessory.dao.ProjectTemplateDao;
+import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryRelationInfo;
+import com.jeeplus.modules.projectAccessory.entity.ProjectTemplateInfo;
 import com.jeeplus.modules.projectFilingBatch.dao.ProjectFilingBatchDao;
 import com.jeeplus.modules.projectFilingBatch.dao.ProjectFilingbatchRelationDao;
 import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingBatch;
@@ -22,6 +25,10 @@ import com.jeeplus.modules.sys.entity.User;
 import com.jeeplus.modules.sys.service.OfficeService;
 import com.jeeplus.modules.sys.utils.DictUtils;
 import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.utils.SftpClientUtil;
+import com.jeeplus.modules.utils.ZipCompressUtil;
+import com.jeeplus.modules.workclientinfo.dao.WorkClientAttachmentDao;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientInfo;
 import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
 import com.jeeplus.modules.workcontractinfo.service.WorkContractInfoService;
@@ -32,6 +39,12 @@ 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.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URLEncoder;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.List;
@@ -498,4 +511,216 @@ public class RuralProjectRecordsCaseBaseService extends CrudService<RuralProject
         return recordsList;
     }
 
+    /**
+     * 获取项目附件模板类型
+     * @return
+     */
+    public static List<MainDictDetail> attachmentTemplateList(){
+        return  DictUtils.getMainDictList("attachment_template_type");
+    }
+    /**
+     * 获取项目附件模板类型
+     * @return
+     */
+    public static List<MainDictDetail> attachmentTemplateListToCloud(){
+        return  DictUtils.getMainDictListById("attachment_template_type");
+    }
+
+    /**
+     * 项目相应文件批量下载并压缩
+     * @param idList
+     */
+    public String exportAll(List<String> idList) throws Exception {
+        //设置下载的压缩包名(固定字符+时间戳)
+        long timeMillis = System.currentTimeMillis();
+        String fileLocality = "案例库甲乙供附件_"+ timeMillis;
+        //判定当前系统
+        String path = null;
+        if(System.getProperty("os.name").toLowerCase().contains("win")){
+            path = Global.getConfig("remoteServer.winDirectory");
+        }else{
+            path = Global.getConfig("remoteServer.directory");
+        }
+        path = path + "/" + fileLocality;
+        //检查该路径对应的目录是否存在. 如果不存在则创建目录
+        File dir=new File(path);
+        if (!dir.exists()) {
+            dir.mkdirs();
+        }
+
+        File resultFile = null;
+        File file = null;
+        try {
+            //遍历项目id并查询对应数据信息
+            for (String projectId: idList) {
+                //获取项目信息
+                RuralProjectRecords records = this.getQueryProjectUsers(projectId);
+                //根据项目id查询项目报告信息
+                //ProjectReportData projectReportData = projectReportDataService.getReportDataByProjectId(records.getId());
+                //projectReportData = projectReportDataService.get(projectReportData.getId());
+                ProjectAccessoryRelationInfo relateInfo = new ProjectAccessoryRelationInfo();
+
+                //添加项目类型
+                relateInfo.setAttachmentProjectType(records.getProjectType());
+                relateInfo.setAttachmentProjectSort(records.getAttachmentProjectSort());
+
+                //查看送审金额是否为500w以上金额
+                //Integer approvalMoney = projectAccessoryRelationService.decideAttachmentProjectApprovalMoney(projectReportData.getReviewFee());
+                //Integer approvalMoney = 2;
+                String money=records.getSubmitMoney();
+                Integer approvalMoney=null;
+                if(com.jeeplus.common.utils.StringUtils.isBlank(money)){
+                    approvalMoney=1;
+                }else{
+                    approvalMoney=Integer.parseInt(money);
+                }
+                switch (approvalMoney){
+                    case 0:
+                        //金额为0
+                        relateInfo.setAttachmentProjectApprovalMoney(null);
+                        break;
+                    case 1:
+                        //500w以下金额状态
+                        relateInfo.setAttachmentProjectApprovalMoney("1");
+                        break;
+                    case 2:
+                        //500w以上金额状态
+                        relateInfo.setAttachmentProjectApprovalMoney("2");
+                        break;
+                }
+                //添加报告类型
+                relateInfo.setRequiredStage(1);
+                relateInfo.setId(records.getId());
+                //查询报告文件、依据性文件、其他文件必填列表以及数据
+                List<MainDictDetail> mainDictDetails = attachmentTemplateList();
+                String downloadPath = path  +"/案例文件" + "/" + records.getProjectReportNumber() + "_" + records.getProjectName();
+                for (MainDictDetail mainDict : mainDictDetails) {
+                    relateInfo.setAttachType(mainDict.getValue());
+                    switch (mainDict.getValue()) {
+                        case "14":
+                            File dirMaterialFile=new File(downloadPath + "/甲供材料清单");
+                            File dirSupplierFile=new File(downloadPath + "/乙供材料清单");
+                            //查询没有被选择必填项的数据并查询是否已经上传附件,若有则添加到展示列中
+                            relateInfo.setAttachName("甲供材料清单");
+                            List<ProjectTemplateInfo> materialProjectTemplateList = projectTemplateDao.getProjectAccessoryListByParentId(relateInfo);
+                            List<ProjectTemplateInfo> projectTemplateListA = this.getProjectTemplateList(relateInfo, materialProjectTemplateList);
+                            this.disposeFileList(projectTemplateListA,dirMaterialFile.getPath());
+
+                            relateInfo.setAttachName("乙供材料清单");
+                            List<ProjectTemplateInfo> supplierProjectTemplateList1 = projectTemplateDao.getProjectAccessoryListByParentId(relateInfo);
+                            List<ProjectTemplateInfo> projectTemplateListB = this.getProjectTemplateList(relateInfo, supplierProjectTemplateList1);
+                            this.disposeFileList(projectTemplateListB,dirSupplierFile.getPath());
+                            break;
+                    }
+
+                }
+
+            }
+            //处理完之后进行打包压缩并删除之前的文件
+            ZipCompressUtil zipUtil = new ZipCompressUtil();
+            resultFile = new File(path);
+            file = zipUtil.zipCompress(resultFile, true);
+
+        }catch (IOException e) {
+            logger.error("Exception e:"+e);
+        }
+        finally {
+            //路径是个文件且不为空时删除文件
+            if(resultFile.isFile()&&resultFile.exists()){
+                resultFile.delete();
+            }
+        }
+
+        return file.getPath();
+    }
+
+    @Autowired
+    private WorkClientAttachmentDao workClientAttachmentDao;
+    @Autowired
+    private ProjectTemplateDao projectTemplateDao;
+
+    public List<ProjectTemplateInfo> getProjectTemplateList(ProjectAccessoryRelationInfo projectTemplateInfo, List<ProjectTemplateInfo> otherProjectTemplateList){
+        for (ProjectTemplateInfo otherInfo: otherProjectTemplateList) {
+            if("甲供材料清单".equals(otherInfo.getAttachName()) || "乙供材料清单".equals(otherInfo.getAttachName())){
+                WorkClientAttachment attchment = new WorkClientAttachment();
+                attchment.setProjectId(projectTemplateInfo.getId());
+                attchment.setAttachmentId(otherInfo.getId());
+                List<WorkClientAttachment> attachments = workClientAttachmentDao.getList(attchment);
+                if(!attachments.isEmpty()){
+                    otherInfo.setWorkAttachments(attachments);
+                }
+            }
+        }
+
+        return otherProjectTemplateList;
+    }
+    /**
+     * 处理文件信息
+     * @param projectTemplateList
+     * @param downloadPath
+     */
+    public void disposeFileList(List<ProjectTemplateInfo> projectTemplateList,String downloadPath) throws IOException {
+        SftpClientUtil sftpClientUtil = new SftpClientUtil();
+        for (ProjectTemplateInfo info: projectTemplateList) {
+            List<WorkClientAttachment> workAttachments = info.getWorkAttachments();
+            if(null != workAttachments && !workAttachments.isEmpty()){
+                for (WorkClientAttachment attachment:workAttachments) {
+                    sftpClientUtil.downloadRuralProject(attachment.getUrl().substring(0,attachment.getUrl().lastIndexOf("/")),attachment.getUrl().substring(attachment.getUrl().lastIndexOf("/") + 1, attachment.getUrl().length()),downloadPath,attachment.getAttachmentName());
+                }
+            }else{
+                File file = new File(downloadPath);
+                if (!file.exists()) {
+                    file.mkdirs();
+                }
+            }
+        }
+    }
+
+    public RuralProjectRecords getQueryProjectUsers(String id) {
+        RuralProjectRecords projectRecords = super.get(id);
+        List<User> users = workProjectUserDao.queryProjectUsers(projectRecords.getId(), "1");
+        projectRecords.setLeaderNameStr(Collections3.extractToString(users, "name", ","));
+        if (StringUtils.isNotBlank(projectRecords.getWorkContractInfo().getId())) {
+            WorkContractInfo workContractInfo = contractInfoService.get(projectRecords.getWorkContractInfo().getId());
+//			workContractInfo.setConstructionProjectTypeStr(DictUtils.getDictLabel(String.valueOf(workContractInfo.getConstructionProjectType()), "construction_project_type", ""));
+            projectRecords.setWorkContractInfo(workContractInfo);
+        }
+        return projectRecords;
+    }
+    /**
+     * 下载压缩文件
+     * @param filePath
+     * @param response
+     */
+    public void downloadZipFile(String filePath, HttpServletResponse response){
+        File file = new File(filePath);
+        // 取得文件名。
+        String fileName = file.getName();
+        InputStream in = null;
+        try {
+            fileName = URLEncoder.encode(fileName,"UTF8");
+            in = new FileInputStream(file);
+            response.reset();//重置 响应头
+            response.setCharacterEncoding("UTF-8");
+            response.setContentType("application/x-download");
+            response.setHeader("Content-disposition", "attachment; filename=" + fileName);
+
+            byte[] b = new byte[1024];
+            int len;
+            while ((len = in.read(b)) > 0){
+                response.getOutputStream().write(b, 0, len);
+            }
+            in.close();
+            response.getOutputStream().close();
+        }catch (IOException e) {
+            logger.error("Exception e:"+e);
+        }
+        finally {
+            //路径是个文件且不为空时删除文件
+            if(file.isFile()&&file.exists()){
+                file.delete();
+            }
+        }
+    }
+
 }

+ 4 - 2
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsService.java

@@ -2561,8 +2561,10 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 						break;
 				}
 			}*/
-			for (WorkClientAttachment attachment:workAttachments) {
-				sftpClientUtil.downloadRuralProject(attachment.getUrl().substring(0,attachment.getUrl().lastIndexOf("/")),attachment.getUrl().substring(attachment.getUrl().lastIndexOf("/") + 1, attachment.getUrl().length()),downloadPath,attachment.getAttachmentName());
+			if(null != workAttachments && !workAttachments.isEmpty()){
+				for (WorkClientAttachment attachment:workAttachments) {
+					sftpClientUtil.downloadRuralProject(attachment.getUrl().substring(0,attachment.getUrl().lastIndexOf("/")),attachment.getUrl().substring(attachment.getUrl().lastIndexOf("/") + 1, attachment.getUrl().length()),downloadPath,attachment.getAttachmentName());
+				}
 			}
 		}
 	}

+ 95 - 4
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectRecordsCaseBaseController.java

@@ -36,10 +36,10 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.io.File;
+import java.util.*;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ConcurrentHashMap;
 
 
 @Controller
@@ -289,4 +289,95 @@ public class RuralProjectRecordsCaseBaseController extends BaseController {
         return "redirect:"+ Global.getAdminPath()+"/ruralProject/RuralProjectRecordsCaseBase?repage";
     }
 
+
+    // 用Map存储任务状态:key=taskId,value=状态信息Map
+    private final ConcurrentHashMap<String, Map<String, Object>> taskMap = new ConcurrentHashMap<>();
+
+    /**
+     * 1. 创建下载任务(异步处理)
+     */
+    @RequestMapping(value = "createDownloadTask")
+    @ResponseBody
+    public Map<String, Object> createDownloadTask(HttpServletRequest request) {
+        Map<String, Object> result = new HashMap<>();
+        try {
+            String listIds = request.getParameter("listId");
+            List<String> idList = Arrays.asList(listIds.split(","));
+
+            // 生成任务ID
+            String taskId = UUID.randomUUID().toString().replace("-", "");
+
+            // 初始化任务状态
+            Map<String, Object> taskInfo = new HashMap<>();
+            taskInfo.put("status", "processing"); // processing/completed/failed
+            taskInfo.put("filePath", "");
+            taskInfo.put("errorMsg", "");
+            taskMap.put(taskId, taskInfo);
+
+            // 异步处理文件压缩
+            CompletableFuture.runAsync(() -> {
+                try {
+                    String filePath = service.exportAll(idList);
+                    // 更新任务状态为完成
+                    Map<String, Object> completedTask = taskMap.get(taskId);
+                    completedTask.put("status", "completed");
+                    completedTask.put("filePath", filePath);
+                    taskMap.put(taskId, completedTask);
+                } catch (Exception e) {
+                    // 更新任务状态为失败
+                    Map<String, Object> failedTask = taskMap.get(taskId);
+                    failedTask.put("status", "failed");
+                    failedTask.put("errorMsg", "处理失败:" + e.getMessage());
+                    taskMap.put(taskId, failedTask);
+                    logger.error("文件处理异常", e);
+                }
+            });
+
+            result.put("success", true);
+            result.put("taskId", taskId);
+            return result;
+        } catch (Exception e) {
+            result.put("success", false);
+            result.put("msg", "创建任务失败");
+            return result;
+        }
+    }
+
+    /**
+     * 2. 查询任务状态
+     */
+    @RequestMapping(value = "queryTaskStatus")
+    @ResponseBody
+    public Map<String, Object> queryTaskStatus(String taskId) {
+        Map<String, Object> result = new HashMap<>();
+        if (StringUtils.isBlank(taskId) || !taskMap.containsKey(taskId)) {
+            result.put("success", false);
+            result.put("msg", "任务ID不存在");
+            return result;
+        }
+        result.put("success", true);
+        result.put("data", taskMap.get(taskId)); // 直接返回任务信息Map
+        return result;
+    }
+
+    /**
+     * 3. 下载文件
+     */
+    @RequestMapping(value = "downloadFile")
+    public void downloadFile(String filePath, HttpServletResponse response) {
+        try {
+            service.downloadZipFile(filePath, response);
+        } catch (Exception e) {
+            logger.error("文件下载失败", e);
+        } finally {
+            // 清理临时文件和任务记录
+            File file = new File(filePath);
+            if (file.isFile() && file.exists()) {
+                file.delete();
+            }
+            // 移除已完成的任务
+            taskMap.entrySet().removeIf(entry -> filePath.equals(entry.getValue().get("filePath")));
+        }
+    }
+
 }

+ 9 - 2
src/main/java/com/jeeplus/modules/sys/web/UserController.java

@@ -896,7 +896,7 @@ public class UserController extends BaseController {
         if (StringUtils.isNotBlank(oldPassword) && StringUtils.isNotBlank(newPassword)) {
             if (Global.isDemoMode()) {
                 redirectAttributes.addFlashAttribute("message", "演示模式,不允许操作!");
-                return "redirect:/sys/userInfo"; // 使用重定向传递消息
+                return "redirect:" + adminPath + "/sys/user/info?repage";
             }
 
             oldPassword = SystemService.encrypeString(oldPassword);
@@ -914,7 +914,14 @@ public class UserController extends BaseController {
                 return "redirect:/a/home"; // 重定向到首页
             }
 
-            return "redirect:/sys/userInfo"; // 如果没有跳转到首页,则返回用户信息页面
+            return "redirect:" + adminPath + "/sys/user/info?repage";
+        }else{
+            if ("home".equals(request.getParameter("home")) && StringUtils.isNotBlank(newPassword)) {
+                newPassword = SystemService.encrypeString(newPassword);
+                systemService.updatePasswordById(user.getId(), user.getLoginName(), newPassword);
+                redirectAttributes.addFlashAttribute("message", "修改密码成功,请重新登录");
+                return "redirect:/a/home"; // 重定向到首页
+            }
         }
 
         // 如果没有提交密码,返回修改密码页面

+ 25 - 0
src/main/resources/mappings/modules/projectAccessory/ProjectTemplateDao.xml

@@ -124,6 +124,31 @@
 
 	</select>
 
+	<select id="getProjectAccessoryListByParentId" resultType="com.jeeplus.modules.projectAccessory.entity.ProjectTemplateInfo" >
+		SELECT
+			<include refid="workReviewStandardColumns"/>
+		FROM project_template_structure_info a
+		<where>
+			<choose>
+				<when test="attachType != null and attachType!=''">
+					and a.parent_id =#{attachType}
+				</when>
+				<otherwise>
+					<if test="attachTypeList != null and attachTypeList.size>0">
+						and a.parent_id in
+						<foreach collection="attachTypeList" item="attachType" separator="," open="(" close=")">
+							#{attachType}
+						</foreach>
+					</if>
+				</otherwise>
+			</choose>
+			<if test="attachName != null and attachName!=''">
+				and a.attach_name = #{attachName}
+			</if>
+		</where>
+
+	</select>
+
 	<select id="getCaseBaseAccessoryListByParentId" resultType="com.jeeplus.modules.projectAccessory.entity.ProjectTemplateInfo" >
 		SELECT
 			<include refid="workReviewStandardColumns"/>

+ 6 - 6
src/main/resources/mappings/modules/sys/UserDao.xml

@@ -431,7 +431,7 @@
 	<!-- 根据OfficeId获取用户(树查询用户时用) -->
 	<select id="findUserByOfficeId" resultType="User" useCache="true">
 		SELECT
-		a.id, a.name, a.login_name,a.photo
+		DISTINCT a.id, a.name, a.login_name,a.photo
 		,so.name as "office.name"
 		FROM sys_user a
 		left join sys_office so on so.id = a.office_id
@@ -455,7 +455,7 @@
 	<!-- 根据OfficeId获取用户(树查询用户时用) -->
 	<select id="findUserByOfficeIdAndName" resultType="User" useCache="true">
 		SELECT
-		a.id, a.name, a.login_name,a.photo
+		DISTINCT a.id, a.name, a.login_name,a.photo
 		,so.name as "office.name",a.office_id as "office.id"
 		FROM sys_user a
 		left join sys_office so on so.id = a.office_id
@@ -482,7 +482,7 @@
 	<!-- 根据OfficeId获取用户(树查询用户时用) -->
 	<select id="findUserByOfficeIdAndNameAndOfficeIdList" resultType="User" useCache="true">
 		SELECT
-		a.id, a.name, a.login_name,a.photo
+		DISTINCT a.id, a.name, a.login_name,a.photo
 		,so.name as "office.name",a.office_id as "office.id"
 		FROM sys_user a
 		left join sys_office so on so.id = a.office_id
@@ -516,7 +516,7 @@
 	<!-- 根据OfficeId获取用户(树查询用户时用) -->
 	<select id="findUserByOfficeIdAndNameOnReported" resultType="User" useCache="true">
 		SELECT
-		a.id, a.name, a.login_name,a.photo
+		DISTINCT a.id, a.name, a.login_name,a.photo
 		,so.name as "office.name"
 		FROM sys_user a
 		left join sys_office so on so.id = a.office_id
@@ -543,7 +543,7 @@
 	<!-- 根据OfficeId获取用户(树查询用户时用) -->
 	<select id="findUserByOfficeIdAndNameOnReportedZXY" resultType="User" useCache="true">
 		SELECT
-		a.id, a.name, a.login_name,a.photo
+		DISTINCT a.id, a.name, a.login_name,a.photo
 		,so.name as "office.name"
 		FROM sys_user a
 		left join sys_office so on so.id = a.office_id
@@ -571,7 +571,7 @@
 	<!-- 根据OfficeId获取用户(树查询用户时用) -->
 	<select id="findUserByOffices" resultType="User" useCache="true">
 		SELECT
-		a.id, a.name, a.login_name,a.photo
+		DISTINCT a.id, a.name, a.login_name,a.photo
 		FROM sys_user a
 		LEFT JOIN work_staff_achives uo ON uo.user_id = a.id
 		LEFT JOIN sys_office o ON o.id = uo.office_id

+ 83 - 2
src/main/webapp/webpage/modules/ruralprojectrecords/cost/ruralProjectRecordsCaseBaseList.jsp

@@ -843,6 +843,11 @@
 						<shiro:hasPermission name="ruralProject:RuralProjectRecordsCaseBase:export">
 							<table:exportExcel url="${ctx}/ruralProject/RuralProjectRecordsCaseBase/exportCaseBase"></table:exportExcel><!-- 导出按钮 -->
 						</shiro:hasPermission>
+
+						<shiro:hasPermission name="ruralProject:RuralProjectRecordsCaseBase:exportAll">
+							<button type="button" data-toggle="tooltip" data-placement="top" class="layui-btn layui-btn-sm layui-bg-blue" id="exportAll"> 批量下载</button>
+						</shiro:hasPermission>
+
 						<button class="layui-btn layui-btn-sm" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"> 刷新</button>
 					</div>
 					<div style="clear: both;"></div>
@@ -879,7 +884,9 @@
             ,elem: '#contentTable1'
             ,page: false
             ,cols: [[
-                // {checkbox: true, fixed: true},
+				<shiro:hasPermission name="ruralProject:RuralProjectRecordsCaseBase:exportAll">
+                	{checkbox: true, fixed: true},
+				</shiro:hasPermission>
                 {field:'index',align:'center',  title: '序号',width:40}
 				,{field: 'projId',align:'center', title: '项目编号/项目定义号',width:160}
 				,{field:'projName',align:'center', title: '项目名称', minWidth:215,templet:function(d){
@@ -1266,7 +1273,81 @@
             // ,even: true
             // ,height: 315
         });
-    })
+
+		$("#exportAll").bind("click", function () {
+			var checkList = layui.table.checkStatus('contentTable1').data;
+			var listId = [];
+			$.each(checkList, function (i, data) {
+				listId.push(data.id);
+			});
+
+			if (listId.length <= 0) {
+				layer.msg("请选择需要下载的案例项目信息", {icon: 2});
+				return;
+			}
+
+			layer.confirm(
+					"确定要下载选中的 " + listId.length + " 条案例项目信息吗?",
+					{icon: 3, title: "确认下载"},
+					function(confirmIndex){
+						layer.close(confirmIndex);
+
+						// 显示"请稍后"提示(不自动关闭)
+						var loadingIndex = layer.msg('请稍后...', {
+							icon: 16,
+							shade: 0.1,
+							time: 0
+						});
+
+						// 创建下载任务
+						$.get("${ctx}/ruralProject/RuralProjectRecordsCaseBase/createDownloadTask",
+								{listId: listId.join(",")},
+								function (res) {
+									if (res.success) {
+										var taskId = res.taskId;
+										// 轮询任务状态
+										var interval = setInterval(function () {
+											$.get("${ctx}/ruralProject/RuralProjectRecordsCaseBase/queryTaskStatus",
+													{taskId: taskId},
+													function (statusRes) {
+														if (statusRes.success) {
+															var task = statusRes.data;
+
+															if (task.status === "completed") {
+																clearInterval(interval);
+																// 关闭"请稍后"提示
+																layer.close(loadingIndex);
+
+																// 立即显示下载成功提示(在加载提示关闭后)
+																layer.msg("下载成功!", {icon: 1});
+
+																// 触发文件下载
+																window.location.href = "${ctx}/ruralProject/RuralProjectRecordsCaseBase/downloadFile?filePath=" + encodeURIComponent(task.filePath);
+															}
+
+															if (task.status === "failed") {
+																clearInterval(interval);
+																layer.close(loadingIndex);
+																layer.msg("下载失败:" + task.errorMsg, {icon: 2});
+															}
+														} else {
+															clearInterval(interval);
+															layer.close(loadingIndex);
+															layer.msg("查询失败:" + statusRes.msg, {icon: 2});
+														}
+													}
+											);
+										}, 500);
+									} else {
+										layer.close(loadingIndex);
+										layer.msg("创建任务失败:" + res.msg, {icon: 2});
+									}
+								}
+						);
+					});
+		});
+
+	})
 
     resizeListTable();
     $("a").on("click",addLinkVisied);

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

@@ -104,13 +104,15 @@
 			</c:if>
 
 			<div class="form-top">
-                <div class="layui-item layui-col-sm12">
-                    <label class="layui-form-label"><span class="require-item">*</span>旧密码:</label>
-                    <div class="layui-input-block">
-                        <input id="oldPassword" placeholder="请输入旧密码" name="oldPassword" type="password" value="" maxlength="50" minlength="3"  class="form-control layui-input required"/>
-                        <span id="span" class="help-inline"></span>
-                    </div>
-                </div>
+				<c:if test="${ empty home}">
+					<div class="layui-item layui-col-sm12">
+						<label class="layui-form-label"><span class="require-item">*</span>旧密码:</label>
+						<div class="layui-input-block">
+							<input id="oldPassword" placeholder="请输入旧密码" name="oldPassword" type="password" value="" maxlength="50" minlength="3"  class="form-control layui-input required"/>
+							<span id="span" class="help-inline"></span>
+						</div>
+					</div>
+				</c:if>
 				<div class="layui-item layui-col-sm12">
 					<label class="layui-form-label"><span class="require-item">*</span>新密码:</label>
 					<div class="layui-input-block">