Browse Source

军工保密证书功能和人员信息调整功能提交

徐滕 2 weeks ago
parent
commit
f9f3d8b068
16 changed files with 1147 additions and 233 deletions
  1. 15 0
      src/main/java/com/jeeplus/modules/militaryIndustryConfidentiality/dao/MilitaryIndustryConfidentialityDao.java
  2. 68 4
      src/main/java/com/jeeplus/modules/militaryIndustryConfidentiality/service/MilitaryIndustryConfidentialityService.java
  3. 64 12
      src/main/java/com/jeeplus/modules/militaryIndustryConfidentiality/web/MilitaryIndustryConfidentialityController.java
  4. 7 50
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectSignatureOldMessageDisposeController.java
  5. 4 0
      src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffCertificateService.java
  6. 6 0
      src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffTitleService.java
  7. 30 0
      src/main/resources/mappings/modules/militaryIndustryConfidentiality/MilitaryIndustryConfidentialityDao.xml
  8. 107 0
      src/main/webapp/WEB-INF/tags/sys/treeselectOnMilitary.tag
  9. 55 5
      src/main/webapp/webpage/modules/militaryIndustryConfidentiality/militaryIndustryConfidentialityForm.jsp
  10. 8 1
      src/main/webapp/webpage/modules/militaryIndustryConfidentiality/militaryIndustryConfidentialityList.jsp
  11. 96 49
      src/main/webapp/webpage/modules/sys/userInfo.jsp
  12. 86 6
      src/main/webapp/webpage/modules/workstaff/workStaffBasicDetailAudit.jsp
  13. 181 13
      src/main/webapp/webpage/modules/workstaff/workStaffBasicDetailForm.jsp
  14. 198 20
      src/main/webapp/webpage/modules/workstaff/workStaffBasicDetailModify.jsp
  15. 126 22
      src/main/webapp/webpage/modules/workstaff/workStaffBasicInfoForm.jsp
  16. 96 51
      src/main/webapp/webpage/modules/workstaff/workStaffBasicInfoView.jsp

+ 15 - 0
src/main/java/com/jeeplus/modules/militaryIndustryConfidentiality/dao/MilitaryIndustryConfidentialityDao.java

@@ -3,6 +3,7 @@ package com.jeeplus.modules.militaryIndustryConfidentiality.dao;
 import com.jeeplus.common.persistence.CrudDao;
 import com.jeeplus.common.persistence.annotation.MyBatisDao;
 import com.jeeplus.modules.militaryIndustryConfidentiality.entity.MilitaryIndustryConfidentiality;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 军工保密证书 dao
@@ -17,4 +18,18 @@ public interface MilitaryIndustryConfidentialityDao extends CrudDao<MilitaryIndu
      */
     void updateStatus(MilitaryIndustryConfidentiality info);
 
+    /**
+     * 根据人员id  查询数据
+     * @param userId
+     * @return
+     */
+    MilitaryIndustryConfidentiality getUserById(@Param("id") String id, @Param("userId") String userId);
+
+    /**
+     * 根据人员id  查询数据
+     * @param userName
+     * @return
+     */
+    MilitaryIndustryConfidentiality getUserByName(@Param("id") String id, @Param("userName") String userName);
+
 }

+ 68 - 4
src/main/java/com/jeeplus/modules/militaryIndustryConfidentiality/service/MilitaryIndustryConfidentialityService.java

@@ -17,7 +17,6 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.multipart.MultipartFile;
 
-import java.io.InputStream;
 import java.text.SimpleDateFormat;
 import java.time.LocalDate;
 import java.time.ZoneId;
@@ -99,6 +98,24 @@ public class MilitaryIndustryConfidentialityService extends CrudService<Military
 
     }
 
+    /**
+     * 根据人员id查询信息
+     * @param userId
+     * @return
+     */
+    public MilitaryIndustryConfidentiality getUserById(String id, String userId) {
+       return dao.getUserById(id, userId);
+    }
+
+    /**
+     * 根据人员id查询信息
+     * @param userName
+     * @return
+     */
+    public MilitaryIndustryConfidentiality getUserByName(String id, String userName) {
+       return dao.getUserByName(id, userName);
+    }
+
 
     /**
      * 定时任务。每天3:45执行,即将过期或过期人员进行发送通知
@@ -149,9 +166,18 @@ public class MilitaryIndustryConfidentialityService extends CrudService<Military
                 int maxDayOfMonth = today.lengthOfMonth();
                 boolean isSameDay = (endDay == todayDay) || (endDay > maxDayOfMonth && todayDay == maxDayOfMonth);
 
-                if (isSameDay) {
-                    // ✅ 发通知逻辑
-                    sendNotification(info);
+                // ✅ 情况一:在到期前6个月内,每月发送提醒
+                if (!today.isBefore(notifyStartDate) && !today.isAfter(endDate)) {
+                    if (isSameDay) {
+                        sendNotification(info); // 提前提醒
+                    }
+                }
+
+                // ✅ 情况二:已经过期,继续每月提醒一次
+                if (today.isAfter(endDate)) {
+                    if (isSameDay) {
+                        sendOverdueNotification(info); // 过期提醒
+                    }
                 }
             }
         }
@@ -195,4 +221,42 @@ public class MilitaryIndustryConfidentialityService extends CrudService<Military
                             ""));
         }
     }
+
+    /**
+     * 发送通知(过期)
+     * ccpm人员 发送通知给 证书持有人、保密管理员、综合部主任
+     * 会计公司人员 发送通知给保密管理员、综合部主任
+     * @param info
+     */
+    private void sendOverdueNotification(MilitaryIndustryConfidentiality info) {
+        List<User> sendUserList = Lists.newArrayList();
+        User sendUser = UserUtils.getByUserId(info.getCreateBy().getId());
+        List<User> zhglbzrUsers = UserUtils.getByRoleActivityEnname("zhglbzr",3,sendUser.getOffice().getId(),"ffe5af5b557e46f28b000c94716e228a","8");
+        List<User> bmglyUsers = UserUtils.getByRoleActivityEnname("bmgly",3,sendUser.getOffice().getId(),"ffe5af5b557e46f28b000c94716e228a","8");
+        sendUserList.addAll(zhglbzrUsers);
+        sendUserList.addAll(bmglyUsers);
+        if("1".equals(info.getPersonnelType()) && StringUtils.isNotBlank(info.getUser().getId())) {
+            User user = UserUtils.get(info.getUser().getId());
+            sendUserList.add(user);
+        }
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
+        String formattedDate = sdf.format(info.getEndDate());
+
+        String notifyStr = info.getUserName() + " 的军工保密证书已于 " + formattedDate + " 到期,请联系综合管理部或信息部进行更新。";
+        String titleStr = info.getUserName() + " 的军工保密证书已于 " + formattedDate + " 到期,请联系综合管理部或信息部进行更新。";
+
+        for (User user: sendUserList) {
+            user = UserUtils.get(user.getId());
+            workProjectNotifyService
+                    .save(UtilNotify.saveNotify(info.getId(),
+                            user,
+                            user.getCompany().getId(),
+                            titleStr,
+                            notifyStr,
+                            "187",
+                            "0",
+                            "待通知",
+                            ""));
+        }
+    }
 }

+ 64 - 12
src/main/java/com/jeeplus/modules/militaryIndustryConfidentiality/web/MilitaryIndustryConfidentialityController.java

@@ -14,15 +14,15 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.ModelAttribute;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.util.Arrays;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 军工保密证书Controller
@@ -133,7 +133,7 @@ public class MilitaryIndustryConfidentialityController extends BaseController {
 
             service.save(militaryIndustryConfidentiality);//保存
         }
-        addMessage(redirectAttributes, "保存员工信息成功");
+        addMessage(redirectAttributes, "保存军工保密资格证信息成功");
         return "redirect:"+Global.getAdminPath()+"/militaryIndustryConfidentiality/?repage";
     }
 
@@ -144,8 +144,8 @@ public class MilitaryIndustryConfidentialityController extends BaseController {
     @RequestMapping(value = "delete")
     public String delete(MilitaryIndustryConfidentiality militaryIndustryConfidentiality, RedirectAttributes redirectAttributes) {
         service.delete(militaryIndustryConfidentiality);
-        addMessage(redirectAttributes, "删除员工信息成功");
-        return "redirect:"+Global.getAdminPath()+"/workstaff/workStaffBasicInfo/?repage";
+        addMessage(redirectAttributes, "删除军工保密资格证信息成功");
+        return "redirect:"+Global.getAdminPath()+"/militaryIndustryConfidentiality/?repage";
     }
 
     /**
@@ -155,7 +155,7 @@ public class MilitaryIndustryConfidentialityController extends BaseController {
     @RequestMapping(value = "export", method= RequestMethod.POST)
     public String export(MilitaryIndustryConfidentiality militaryIndustryConfidentiality, HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
         try {
-            String fileName = "员工信息"+ DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
+            String fileName = "军工保密资格证信息"+ DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
             Page<MilitaryIndustryConfidentiality> page = service.findPage(new Page<MilitaryIndustryConfidentiality>(request, response, -1), militaryIndustryConfidentiality);
             List<MilitaryIndustryConfidentiality> list = page.getList();
             for (MilitaryIndustryConfidentiality industryConfidentiality : list) {
@@ -163,12 +163,64 @@ public class MilitaryIndustryConfidentialityController extends BaseController {
                     industryConfidentiality.setUserName(industryConfidentiality.getUser().getName());
                 }
             }
-            new ExportExcel("员工信息", MilitaryIndustryConfidentiality.class).setDataList(list).write(response, fileName).dispose();
-            addMessage(redirectAttributes, "导出员工信息记录成功!");
+            new ExportExcel("军工保密资格证信息", MilitaryIndustryConfidentiality.class).setDataList(list).write(response, fileName).dispose();
+            addMessage(redirectAttributes, "导出军工保密资格证信息记录成功!");
             return null;
         } catch (Exception e) {
-            addMessage(redirectAttributes, "导出员工信息记录失败!失败信息:"+e.getMessage());
+            addMessage(redirectAttributes, "导出军工保密资格证信息记录失败!失败信息:"+e.getMessage());
+        }
+        return "redirect:"+Global.getAdminPath()+"/militaryIndustryConfidentiality/?repage";
+    }
+
+    /**
+     * 根据人员id查询信息
+     */
+    @RequestMapping(value = "getUserById")
+    @ResponseBody
+    public Object getUserById(HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
+        Map<String,Object> map = new HashMap<>();
+
+        String id = request.getParameter("id");
+        String userId = request.getParameter("userId");
+        MilitaryIndustryConfidentiality militaryIndustryConfidentiality = new MilitaryIndustryConfidentiality();
+        if(StringUtils.isNotBlank(userId)){
+            militaryIndustryConfidentiality = service.getUserById(id, userId);
+            if(null != militaryIndustryConfidentiality){
+                map.put("str","人员信息已存在");
+                map.put("success",true);
+            }else{
+                map.put("success",false);
+            }
+        }else{
+            map.put("str","请选择需要登记的人员信息");
+            map.put("success",true);
+        }
+        return map;
+    }
+
+    /**
+     * 根据人员id查询信息
+     */
+    @RequestMapping(value = "getUserByName")
+    @ResponseBody
+    public Object getUserByName(HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
+        Map<String,Object> map = new HashMap<>();
+
+        String id = request.getParameter("id");
+        String userName = request.getParameter("userName");
+        MilitaryIndustryConfidentiality militaryIndustryConfidentiality = new MilitaryIndustryConfidentiality();
+        if(StringUtils.isNotBlank(userName)){
+            militaryIndustryConfidentiality = service.getUserByName(id, userName);
+            if(null != militaryIndustryConfidentiality){
+                map.put("str","人员信息已存在");
+                map.put("success",true);
+            }else{
+                map.put("success",false);
+            }
+        }else{
+            map.put("str","请选择需要登记的人员信息");
+            map.put("success",true);
         }
-        return "redirect:"+Global.getAdminPath()+"/workstaff/workStaffBasicInfo/achivelist?repage";
+        return map;
     }
 }

+ 7 - 50
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectSignatureOldMessageDisposeController.java

@@ -8,6 +8,7 @@ import com.jeeplus.common.utils.*;
 import com.jeeplus.common.utils.excel.ExportExcel;
 import com.jeeplus.common.utils.excel.ImportExcel;
 import com.jeeplus.common.web.BaseController;
+import com.jeeplus.modules.militaryIndustryConfidentiality.service.MilitaryIndustryConfidentialityService;
 import com.jeeplus.modules.pojectMaterialsWarehouse.entity.ProjectMaterialCollectInfo;
 import com.jeeplus.modules.projectAccessory.dao.ProjectTemplateDao;
 import com.jeeplus.modules.projectAccessory.entity.ProjectTemplateInfo;
@@ -114,6 +115,8 @@ public class RuralProjectSignatureOldMessageDisposeController extends BaseContro
 
     @Autowired
     private WorkReimbursementService workReimbursementService;
+    @Autowired
+    private MilitaryIndustryConfidentialityService militaryIndustryConfidentialityService;
 
     private static final String HTTPTOP = Global.getConfig("signature_http_top");
 
@@ -209,59 +212,13 @@ public class RuralProjectSignatureOldMessageDisposeController extends BaseContro
     @Transactional(readOnly = false)
     public Map<String,Object> reportView(){
         Map<String,Object> map = new HashMap<>();
-        final Calendar c = Calendar.getInstance();
-        Integer year = 2024;
-        System.out.println(c.get(Calendar.DATE));
-        System.out.println(c.getActualMaximum(Calendar.DATE));
-        //if (c.get(Calendar.DATE) == c.getActualMaximum(Calendar.DATE)){
-        long l1 = System.currentTimeMillis();
-        Integer month = 11; //第一个月从0开始,所以得到月份+1
-        //当月最后一天
-        //projectRecordsService.getBatchArchiveNotify();
-        logger.info("-----------公司级—月度报表(开始)------------------");
-        //statementCompanyComprehensiveService.disposeStatementCompany(year,2,month);
-        logger.info("------------公司级—月度报表(结束)------------------");
-        logger.info("-----------部门级—月度报表(开始)------------------");
-        statementCompanyComprehensiveService.disposeStatementOffice(year,2,month);
-        logger.info("------------部门级—月度报表(结束)------------------");
-        logger.info("------------公司级—年度报表(月报中年度信息)(开始)------------------");
-        //statementCompanyComprehensiveService.disposeStatementCompanyByYear(year,0,month);
-        logger.info("------------公司级—年度报表(月报中年度信息)(结束)------------------");
-        logger.info("-----------部门级—年度报表(月报中年度信息)(开始)------------------");
-        //statementCompanyComprehensiveService.disposeStatementOfficeByYear(year,0,month);
-        logger.info("------------部门级—年度报表(月报中年度信息)(结束)------------------");
-        logger.info("-----------张静—月度报表(开始)------------------");
-        // statementCompanyComprehensiveService.disposeReportDataStatementCompany(year,2,month);
-        logger.info("------------张静—月度报表(结束)------------------");
 
-        logger.info("-----------批量归档报表(开始)------------------");
-        //statementCompanyComprehensiveService.disposeFilingStatementCompany(year,2,month);
-        logger.info("------------批量归档报表(结束)------------------");
+        logger.info("-----------军工证书到期时间开始提醒------------------");
+        militaryIndustryConfidentialityService.timedTask();
 
-        //}
-
-        map.put("msgMonth","月度报表处理完成");
-
-        /*logger.info("-----------公司级—季度报表(开始)------------------");
-        statementCompanyComprehensiveService.disposeStatementCompany(2022,1,1);
-        logger.info("------------公司级—季度报表(结束)------------------");*/
-        logger.info("-----------部门级—季度报表(开始)------------------");
-        statementCompanyComprehensiveService.disposeStatementOffice(2024,1,4);
-        logger.info("------------部门级—季度报表(结束)------------------");
-
-        map.put("msgQuarter","季度报表处理完成");
-
-        /*logger.info("-----------公司级—年度报表(开始)------------------");
-        statementCompanyComprehensiveService.disposeStatementCompany(2022,0,0);
-        logger.info("------------公司级—年度报表(结束)------------------");
-        logger.info("-----------部门级—年度报表(开始)------------------");
-        statementCompanyComprehensiveService.disposeStatementOffice(2022,0,0);
-        logger.info("------------部门级—年度报表(结束)------------------");
-
-        map.put("msgYear","年度报表处理完成");
-        */
+        logger.info("------------军工证书到期时间结束提醒------------------");
         long l2 = System.currentTimeMillis();
-        map.put("msgdate",(l2-l1));
+        map.put("msgdate",(l2));
         return map;
     }
     /**

+ 4 - 0
src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffCertificateService.java

@@ -493,6 +493,10 @@ public class WorkStaffCertificateService extends CrudService<WorkStaffCertificat
         List<WorkStaffCertificate> certificateList =workStaffBasicInfo.getCertificateList();
         if(certificateList!=null&&certificateList.size()>0){
             for(WorkStaffCertificate newCertificate:certificateList){
+                if(null != newCertificate.getFile() && StringUtils.isNotBlank(newCertificate.getFile().getOriginalFilename())){
+                    String fileName = newCertificate.getFile().getOriginalFilename();
+                    newCertificate.setFileName(fileName);
+                }
                 Class<? extends WorkStaffCertificate> newClass = newCertificate.getClass();
                 Field[] declaredFields = newClass.getDeclaredFields();
                 if(newCertificate.getId()!=null&&!"1".equals(newCertificate.getDelFlag())&&!"".equals(newCertificate.getId())){

+ 6 - 0
src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffTitleService.java

@@ -336,6 +336,12 @@ public class WorkStaffTitleService extends CrudService<WorkStaffTitleDao, WorkSt
         List<WorkStaffTitle> titleList =workStaffBasicInfo.getTitleList();
         if(titleList!=null&&titleList.size()>0){
             for(WorkStaffTitle newTitle:titleList){
+
+                if(null != newTitle.getFile() && StringUtils.isNotBlank(newTitle.getFile().getOriginalFilename())){
+                    String fileName = newTitle.getFile().getOriginalFilename();
+                    newTitle.setFileName(fileName);
+                }
+
                 Class<? extends WorkStaffTitle> newClass = newTitle.getClass();
                 Field[] declaredFields = newClass.getDeclaredFields();
                 if(newTitle.getId()!=null&&!"1".equals(newTitle.getDelFlag())&&!"".equals(newTitle.getId())){

+ 30 - 0
src/main/resources/mappings/modules/militaryIndustryConfidentiality/MilitaryIndustryConfidentialityDao.xml

@@ -40,6 +40,36 @@
 		<include refid="moduleChooseJoins"/>
 		WHERE a.id = #{id}
 	</select>
+
+	<select id="getUserById" resultType="MilitaryIndustryConfidentiality" >
+		SELECT
+			<include refid="moduleChooseColumns"/>
+		FROM military_industry_confidentiality a
+		<include refid="moduleChooseJoins"/>
+		<where>
+			a.user_id = #{userId} and a.del_flag = 0
+			<if test="id != null and id != ''">
+				and a.id != #{id}
+			</if>
+		</where>
+		order by a.update_date desc
+		limit 1
+	</select>
+
+	<select id="getUserByName" resultType="MilitaryIndustryConfidentiality" >
+		SELECT
+			<include refid="moduleChooseColumns"/>
+		FROM military_industry_confidentiality a
+		<include refid="moduleChooseJoins"/>
+		<where>
+			a.user_name = #{userName} and a.del_flag = 0
+			<if test="id != null and id != ''">
+				and a.id != #{id}
+			</if>
+		</where>
+		order by a.update_date desc
+		limit 1
+	</select>
 	
 	<select id="findList" resultType="MilitaryIndustryConfidentiality" >
 		SELECT

+ 107 - 0
src/main/webapp/WEB-INF/tags/sys/treeselectOnMilitary.tag

@@ -0,0 +1,107 @@
+<%@ tag language="java" pageEncoding="UTF-8"%>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<%@ attribute name="id" type="java.lang.String" required="true" description="编号"%>
+<%@ attribute name="name" type="java.lang.String" required="true" description="隐藏域名称(ID)"%>
+<%@ attribute name="value" type="java.lang.String" required="true" description="隐藏域值(ID)"%>
+<%@ attribute name="labelName" type="java.lang.String" required="true" description="输入框名称(Name)"%>
+<%@ attribute name="labelValue" type="java.lang.String" required="true" description="输入框值(Name)"%>
+<%@ attribute name="title" type="java.lang.String" required="true" description="选择框标题"%>
+<%@ attribute name="url" type="java.lang.String" required="true" description="树结构数据地址"%>
+<%@ attribute name="checked" type="java.lang.Boolean" required="false" description="是否显示复选框,如果不需要返回父节点,请设置notAllowSelectParent为true"%>
+<%@ attribute name="extId" type="java.lang.String" required="false" description="排除掉的编号(不能选择的编号)"%>
+<%@ attribute name="isAll" type="java.lang.Boolean" required="false" description="是否列出全部数据,设置true则不进行数据权限过滤(目前仅对Office有效)"%>
+<%@ attribute name="notAllowSelectRoot" type="java.lang.Boolean" required="false" description="不允许选择根节点"%>
+<%@ attribute name="notAllowSelectParent" type="java.lang.Boolean" required="false" description="不允许选择父节点"%>
+<%@ attribute name="module" type="java.lang.String" required="false" description="过滤栏目模型(只显示指定模型,仅针对CMS的Category树)"%>
+<%@ attribute name="selectScopeModule" type="java.lang.Boolean" required="false" description="选择范围内的模型(控制不能选择公共模型,不能选择本栏目外的模型)(仅针对CMS的Category树)"%>
+<%@ attribute name="allowClear" type="java.lang.Boolean" required="false" description="是否允许清除"%>
+<%@ attribute name="allowInput" type="java.lang.Boolean" required="false" description="文本框可填写"%>
+<%@ attribute name="cssClass" type="java.lang.String" required="false" description="css样式"%>
+<%@ attribute name="cssStyle" type="java.lang.String" required="false" description="css样式"%>
+<%@ attribute name="smallBtn" type="java.lang.Boolean" required="false" description="缩小按钮显示"%>
+<%@ attribute name="hideBtn" type="java.lang.Boolean" required="false" description="是否显示按钮"%>
+<%@ attribute name="disabled" type="java.lang.String" required="false" description="是否限制选择,如果限制,设置为disabled"%>
+<%@ attribute name="dataMsgRequired" type="java.lang.String" required="false" description=""%>
+<%@ attribute name="rule" type="java.lang.String" required="false" description="考勤规则模块用"%>
+	<input id="${id}Id" name="${name}" class="${cssClass}" type="hidden" value="${value}" />
+	<div class="input-group">
+		<input id="${id}Name" placeholder="请选择${title}" name="${labelName}" ${allowInput?'':'readonly="readonly"'}  type="text" value="${labelValue}" data-msg-required="${dataMsgRequired}"
+		class="${cssClass}" style="${cssStyle}"/>
+       		 <span class="input-group-btn">
+	       		 <button type="button"  id="${id}Button" class="btn <c:if test="${fn:contains(cssClass, 'input-sm')}"> btn-sm </c:if><c:if test="${fn:contains(cssClass, 'input-lg')}"> btn-lg </c:if>  btn-primary ${disabled} ${hideBtn ? 'hide' : ''}"><i class="fa fa-search"></i>
+	             </button>
+       		 </span>
+
+    </div>
+	 <label id="${id}Name-error" class="error" for="${id}Name" style="display:none"></label>
+<script type="text/javascript">
+	$("#${id}Button").click(function(){
+		// 是否限制选择,如果限制,设置为disabled
+		if ($("#${id}Button").hasClass("disabled")){
+			return true;
+		}
+		// 正常打开
+		top.layer.open({
+		    type: 2,
+		    area: ['300px', '420px'],
+		    title:"选择${title}",
+		    ajaxData:{selectIds: $("#${id}Id").val()},
+		    content: "${ctx}/tag/treeselect?url="+encodeURIComponent("${url}")+"&module=${module}&checked=${checked}&extId=${extId}&isAll=${isAll}&unit=${unit}" ,
+		    btn: ['确定', '关闭']
+    	       ,yes: function(index, layero){ //或者使用btn1
+						var tree = layero.find("iframe")[0].contentWindow.tree;//h.find("iframe").contents();
+						var ids = [], names = [], nodes = [];
+						if ("${checked}" == "true"){
+							nodes = tree.getCheckedNodes(true);
+						}else{
+							nodes = tree.getSelectedNodes();
+						}
+						for(var i=0; i<nodes.length; i++) {//<c:if test="${checked && notAllowSelectParent}">
+							if (nodes[i].isParent){
+								continue; // 如果为复选框选择,则过滤掉父节点
+							}//</c:if><c:if test="${notAllowSelectRoot}">
+							if (nodes[i].level == 0){
+								//top.$.jBox.tip("不能选择根节点("+nodes[i].name+")请重新选择。");
+								// top.layer.msg("不能选择根节点("+nodes[i].name+")请重新选择。", {icon: 0});
+								// return false;
+							}//</c:if><c:if test="${notAllowSelectParent}">
+							if (nodes[i].isParent){
+								//top.$.jBox.tip("不能选择父节点("+nodes[i].name+")请重新选择。");
+								//layer.msg('有表情地提示');
+								// top.layer.msg("不能选择父节点("+nodes[i].name+")请重新选择。", {icon: 0});
+								// return false;
+							}//</c:if><c:if test="${not empty module && selectScopeModule}">
+							if (nodes[i].module == ""){
+								//top.$.jBox.tip("不能选择公共模型("+nodes[i].name+")请重新选择。");
+								// top.layer.msg("不能选择公共模型("+nodes[i].name+")请重新选择。", {icon: 0});
+								// return false;
+							}else if (nodes[i].module != "${module}"){
+								//top.$.jBox.tip("不能选择当前栏目以外的栏目模型,请重新选择。");
+								// top.layer.msg("不能选择当前栏目以外的栏目模型,请重新选择。", {icon: 0});
+								// return false;
+							}//</c:if>
+							ids.push(nodes[i].id);
+							names.push(nodes[i].name);//<c:if test="${!checked}">
+							break; // 如果为非复选框选择,则返回第一个选择  </c:if>
+						}
+						$("#${id}Id").val(ids.join(",").replace(/u_/ig,"")).change();
+						$("#${id}Name").val(names.join(",")).change();
+						$("#${id}Name").focus();
+						var rule="${rule}";
+						var id="${id}";
+						if(rule=='rule'){
+                            var _placeName =  id.split("_")[0]+"_placeName";
+                            var _itude =  id.split("_")[0]+"_itude";
+                            $("#"+_placeName).val("");
+                            $("#"+_itude).val("");
+						}
+						repetitionDeterminationByUserId(ids.join(",").replace(/u_/ig,""));
+						top.layer.close(index);
+				    	       },
+    	cancel: function(index){ //或者使用btn2
+    	           //按钮【按钮二】的回调
+    	       }
+		});
+
+	});
+</script>

+ 55 - 5
src/main/webapp/webpage/modules/militaryIndustryConfidentiality/militaryIndustryConfidentialityForm.jsp

@@ -18,9 +18,6 @@
             left:0;
             top:82px;
         }
-        .layui-layer-dialog{
-            background: red;
-        }
         td input{
             margin-left:-10px !important;
             height: 42px !important;
@@ -50,6 +47,15 @@
         var clientCount = 0;
         function doSubmit(i){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
             if(validateForm.form()){
+                filePath
+
+                var file = $("#file").val()
+                var filePath = $("#filePath").val()
+                if(!file && !filePath){
+                    layer.msg("请上传军工保密证书",{icon:2})
+                    return false;
+                }
+
                 $("#inputForm").submit();
                 return true;
             }else{
@@ -322,6 +328,50 @@
             document.getElementById("endDate").value = formattedEndDate;
         }
 
+        function repetitionDeterminationByUserId(userId){
+            var id = $("#id").val()
+            $.ajax({
+                type:'post',
+                url:'${ctx}/militaryIndustryConfidentiality/getUserById',
+                data:{
+                    "userId":userId,
+                    "id":id
+                },
+                success:function(data){
+                    console.log(data)
+                    if(data.success){
+                        $("#ccpmUserId").val("")
+                        $("#ccpmUserName").val("")
+                        layer.msg(data.str,{icon:2})
+                    }
+                }
+            })
+        }
+
+        function repetitionDeterminationByUserName(obj) {
+            var userName = obj.value.trim(); // 去除前后空格
+            if (!userName) {
+                return; // 如果为空,直接返回不请求
+            }
+
+            var id = $("#id").val();
+            $.ajax({
+                type: 'post',
+                url: '${ctx}/militaryIndustryConfidentiality/getUserByName',
+                data: {
+                    "userName": userName,
+                    "id": id
+                },
+                success: function(data) {
+                    console.log(data);
+                    if (data.success) {
+                        $("#userName").val("");
+                        layer.msg(data.str, { icon: 2 });
+                    }
+                }
+            });
+        }
+
     </script>
 </head>
 <body>
@@ -347,7 +397,7 @@
                 <div class="layui-item layui-col-sm6 lw7" id="show1">
                     <label class="layui-form-label"><span class="require-item">*</span>证书归属人:</label>
                     <div class="layui-input-block  with-icon">
-                        <sys:treeselect id="ccpmUser" name="user.id" value="${militaryIndustryConfidentiality.user.id}" labelName="user.name" labelValue="${militaryIndustryConfidentiality.user.name}"
+                        <sys:treeselectOnMilitary id="ccpmUser" name="user.id" value="${militaryIndustryConfidentiality.user.id}" labelName="user.name" labelValue="${militaryIndustryConfidentiality.user.name}"
                                         cssStyle="background-color: #fff" title="用户" url="/sys/office/treeDataAll?type=3" cssClass="form-control required layui-input" allowClear="true" notAllowSelectParent="true"/>
                     </div>
                 </div>
@@ -355,7 +405,7 @@
                 <div class="layui-item layui-col-sm6 lw7" id="show2">
                     <label class="layui-form-label"><span class="require-item">*</span>证书归属人:</label>
                     <div class="layui-input-block">
-                        <form:input path="userName" placeholder="请输入证书归属人" htmlEscape="false"  class="form-control layui-input "/>
+                        <form:input path="userName" placeholder="请输入证书归属人" htmlEscape="false" onchange="repetitionDeterminationByUserName(this)" class="form-control layui-input "/>
                     </div>
                 </div>
 

+ 8 - 1
src/main/webapp/webpage/modules/militaryIndustryConfidentiality/militaryIndustryConfidentialityList.jsp

@@ -264,7 +264,14 @@
                     , "endDate": "<fmt:formatDate value="${militaryIndustryConfidentiality.endDate}" pattern="yyyy-MM-dd"/>"
                     , "status":"${fns:getMainDictLabels(militaryIndustryConfidentiality.status,',','militaryIndustryConfidentiality_status', '')}"
                     , "personnelType":"${fns:getMainDictLabels(militaryIndustryConfidentiality.personnelType,',','militaryIndustryConfidentiality_personnel_type', '')}"
-                    , "officeName": "${militaryIndustryConfidentiality.officeName}"
+                    <c:choose>
+                        <c:when test="${not empty militaryIndustryConfidentiality.officeName}">
+                            , "officeName": "${militaryIndustryConfidentiality.officeName}"
+                        </c:when>
+                        <c:otherwise>
+                            , "officeName": "会计公司"
+                        </c:otherwise>
+                    </c:choose>
                     , "wsbiId": "${militaryIndustryConfidentiality.wsbiId}"
 
 

+ 96 - 49
src/main/webapp/webpage/modules/sys/userInfo.jsp

@@ -1070,47 +1070,70 @@
                                                     <td>
                                                             ${certificate.issType}
                                                     </td>
-                                                    <td >
+                                                    <td class="text-left op-td">
                                                         <c:if test="${not empty certificate.filePathStr}">
-                                                            <%-- 安全处理URL中的 & --%>
+                                                            <%-- 1. 安全处理URL中的 & --%>
                                                             <c:set var="safeFilePath" value="${fn:replace(certificate.filePathStr, '&', '&amp;')}" />
 
-                                                            <%-- 先从 certificate.fileName 里提取扩展名 --%>
-                                                            <c:set var="fileNameArr" value="${fn:split(certificate.fileName, '.')}" />
-                                                            <c:set var="fileExt" value="${fn:toLowerCase(fileNameArr[fn:length(fileNameArr) - 1])}" />
-
-                                                            <%-- 如果没有后缀,尝试从 filePathStr 里提取 --%>
+                                                            <%-- 2. 提取文件名 --%>
                                                             <c:choose>
-                                                                <c:when test="${fn:contains(certificate.fileName, '.')}">
-                                                                    <%-- 已经有后缀 --%>
-                                                                    <c:set var="downloadFileName" value="${certificate.fileName}" />
+                                                                <c:when test="${not empty certificate.fileName}">
+                                                                    <c:set var="fileName" value="${certificate.fileName}" />
                                                                 </c:when>
                                                                 <c:otherwise>
-                                                                    <%-- 从路径最后部分提取后缀 --%>
-                                                                    <c:set var="pathParts" value="${fn:split(certificate.filePathStr, '/')}"/>
-                                                                    <c:set var="lastPart" value="${pathParts[fn:length(pathParts) - 1]}" />
-                                                                    <c:set var="lastPartArr" value="${fn:split(lastPart, '.')}" />
-                                                                    <c:set var="pathExt" value="${fn:toLowerCase(lastPartArr[fn:length(lastPartArr) - 1])}" />
-                                                                    <c:set var="downloadFileName" value="${certificate.fileName}.${pathExt}" />
+                                                                    <c:set var="fileNameArr" value="${fn:split(certificate.filePathStr, '/')}" />
+                                                                    <c:set var="fileName" value="${fileNameArr[fn:length(fileNameArr) - 1]}" />
                                                                 </c:otherwise>
                                                             </c:choose>
 
-                                                            <%-- 显示图片缩略图 --%>
-                                                            <img src="${safeFilePath}" width="24" height="24"
-                                                                 style="cursor:pointer; vertical-align:middle;"
-                                                                 onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${safeFilePath}','90%','90%')"
-                                                                 alt="文件预览" title="点击预览" />
+                                                            <%-- 3. 提取文件扩展名(后缀)--%>
+                                                            <c:set var="extArr" value="${fn:split(fileName, '.')}" />
+                                                            <c:set var="ext" value="${fn:toLowerCase(extArr[fn:length(extArr) - 1])}" />
 
-                                                            <%-- 下载按钮 --%>
+                                                            <%-- 4. 判断并显示文件内容(图片预览 / 链接预览) --%>
+                                                            <c:choose>
+                                                                <%-- ✅ 图片预览格式 --%>
+                                                                <c:when test="${ext == 'jpg' || ext == 'jpeg' || ext == 'png' || ext == 'gif' || ext == 'bmp' || ext == 'webp'}">
+                                                                    <img src="${safeFilePath}" width="24" height="24"
+                                                                         style="cursor:pointer; vertical-align:middle;"
+                                                                         onclick="preview('预览','${safeFilePath}','90%','90%','1')"
+                                                                         alt="图片预览" title="点击预览图片" />
+                                                                </c:when>
+
+                                                                <%-- ✅ 非图片文件,按类型显示文件名并支持预览 --%>
+                                                                <c:otherwise>
+                                                                    <c:choose>
+                                                                        <%-- PDF 特殊处理(可用 iframe 预览) --%>
+                                                                        <c:when test="${ext == 'pdf'}">
+                                                                            <a class="attention-info" href="javascript:void(0)"
+                                                                               style="color: #007bff;"
+                                                                               onclick="preview('预览','${safeFilePath}','90%','90%','1')">
+                                                                                    ${fileName}
+                                                                            </a>
+                                                                        </c:when>
+
+                                                                        <%-- 其他文件格式 --%>
+                                                                        <c:otherwise>
+                                                                            <a class="attention-info" href="javascript:void(0)"
+                                                                               style="color: #007bff;"
+                                                                               onclick="preview('预览','${safeFilePath}','90%','90%')">
+                                                                                    ${fileName}
+                                                                            </a>
+                                                                        </c:otherwise>
+                                                                    </c:choose>
+                                                                </c:otherwise>
+                                                            </c:choose>
+
+                                                            <%-- 5. 下载按钮 --%>
                                                             <a href="javascript:void(0);"
-                                                               title="下载文件"
+                                                               title="下载 ${fileName}"
                                                                style="color: #28a745; margin-left: 5px; text-decoration: none;"
-                                                               onclick="downloadFile('${ctx}', '${certificate.filePath}', '${downloadFileName}')">
+                                                               onclick="downloadFile('${ctx}', '${certificate.filePath}', '${fileName}')">
                                                                 <i class="fa fa-download"></i>
                                                             </a>
                                                         </c:if>
-
                                                     </td>
+
                                                 </tr>
                                             </c:forEach>
                                             </tbody>
@@ -1149,42 +1172,66 @@
                                                     <td>
                                                             ${title.approvalAuthority}
                                                     </td>
-                                                    <td>
+
+                                                    <td class="text-left op-td">
                                                         <c:if test="${not empty title.filePathStr}">
-                                                            <%-- 安全处理URL中的 & --%>
+                                                            <%-- 1. 安全处理URL中的 & --%>
                                                             <c:set var="safeFilePath" value="${fn:replace(title.filePathStr, '&', '&amp;')}" />
 
-                                                            <%-- 先从 title.fileName 里提取扩展名 --%>
-                                                            <c:set var="fileNameArr" value="${fn:split(title.fileName, '.')}" />
-                                                            <c:set var="fileExt" value="${fn:toLowerCase(fileNameArr[fn:length(fileNameArr) - 1])}" />
-
-                                                            <%-- 如果没有后缀,尝试从 filePathStr 里提取 --%>
+                                                            <%-- 2. 提取文件名 --%>
                                                             <c:choose>
-                                                                <c:when test="${fn:contains(title.fileName, '.')}">
-                                                                    <%-- 已经有后缀 --%>
-                                                                    <c:set var="downloadFileName" value="${title.fileName}" />
+                                                                <c:when test="${not empty title.fileName}">
+                                                                    <c:set var="fileName" value="${title.fileName}" />
                                                                 </c:when>
                                                                 <c:otherwise>
-                                                                    <%-- 从路径最后部分提取后缀 --%>
-                                                                    <c:set var="pathParts" value="${fn:split(title.filePathStr, '/')}"/>
-                                                                    <c:set var="lastPart" value="${pathParts[fn:length(pathParts) - 1]}" />
-                                                                    <c:set var="lastPartArr" value="${fn:split(lastPart, '.')}" />
-                                                                    <c:set var="pathExt" value="${fn:toLowerCase(lastPartArr[fn:length(lastPartArr) - 1])}" />
-                                                                    <c:set var="downloadFileName" value="${title.fileName}.${pathExt}" />
+                                                                    <c:set var="fileNameArr" value="${fn:split(title.filePathStr, '/')}" />
+                                                                    <c:set var="fileName" value="${fileNameArr[fn:length(fileNameArr) - 1]}" />
                                                                 </c:otherwise>
                                                             </c:choose>
 
-                                                            <%-- 显示图片缩略图 --%>
-                                                            <img src="${safeFilePath}" width="24" height="24"
-                                                                 style="cursor:pointer; vertical-align:middle;"
-                                                                 onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${safeFilePath}','90%','90%')"
-                                                                 alt="文件预览" title="点击预览" />
+                                                            <%-- 3. 提取文件扩展名(后缀)--%>
+                                                            <c:set var="extArr" value="${fn:split(fileName, '.')}" />
+                                                            <c:set var="ext" value="${fn:toLowerCase(extArr[fn:length(extArr) - 1])}" />
 
-                                                            <%-- 下载按钮 --%>
+                                                            <%-- 4. 判断并显示文件内容(图片预览 / 链接预览) --%>
+                                                            <c:choose>
+                                                                <%-- ✅ 图片预览格式 --%>
+                                                                <c:when test="${ext == 'jpg' || ext == 'jpeg' || ext == 'png' || ext == 'gif' || ext == 'bmp' || ext == 'webp'}">
+                                                                    <img src="${safeFilePath}" width="24" height="24"
+                                                                         style="cursor:pointer; vertical-align:middle;"
+                                                                         onclick="preview('预览','${safeFilePath}','90%','90%','1')"
+                                                                         alt="图片预览" title="点击预览图片" />
+                                                                </c:when>
+
+                                                                <%-- ✅ 非图片文件,按类型显示文件名并支持预览 --%>
+                                                                <c:otherwise>
+                                                                    <c:choose>
+                                                                        <%-- PDF 特殊处理(可用 iframe 预览) --%>
+                                                                        <c:when test="${ext == 'pdf'}">
+                                                                            <a class="attention-info" href="javascript:void(0)"
+                                                                               style="color: #007bff;"
+                                                                               onclick="preview('预览','${safeFilePath}','90%','90%','1')">
+                                                                                    ${fileName}
+                                                                            </a>
+                                                                        </c:when>
+
+                                                                        <%-- 其他文件格式 --%>
+                                                                        <c:otherwise>
+                                                                            <a class="attention-info" href="javascript:void(0)"
+                                                                               style="color: #007bff;"
+                                                                               onclick="preview('预览','${safeFilePath}','90%','90%')">
+                                                                                    ${fileName}
+                                                                            </a>
+                                                                        </c:otherwise>
+                                                                    </c:choose>
+                                                                </c:otherwise>
+                                                            </c:choose>
+
+                                                            <%-- 5. 下载按钮 --%>
                                                             <a href="javascript:void(0);"
-                                                               title="下载文件"
+                                                               title="下载 ${fileName}"
                                                                style="color: #28a745; margin-left: 5px; text-decoration: none;"
-                                                               onclick="downloadFile('${ctx}', '${title.filePath}', '${downloadFileName}')">
+                                                               onclick="downloadFile('${ctx}', '${title.filePath}', '${fileName}')">
                                                                 <i class="fa fa-download"></i>
                                                             </a>
                                                         </c:if>

+ 86 - 6
src/main/webapp/webpage/modules/workstaff/workStaffBasicDetailAudit.jsp

@@ -864,7 +864,7 @@
                                 <th width="7%">专业</th>
                                 <th width="6%">等级</th>
                                 <th width="6%">取得方式</th>
-                                <th width="10%">文件<span style="color: #FF8C69; font-size: 10px; font-weight: normal; margin-left: 5px;">(图片)</span></th>
+                                <th width="10%">文件</th>
                             </tr>
                             </thead>
                             <tbody id="certificateList">
@@ -911,8 +911,48 @@
                                         <input id="certificateList${varStatus.index}_issType" name="certificateList[${varStatus.index}].issType" readonly="true" class="form-control" value="${certificate.issType}"/>
                                     </td>
                                     <td class="text-left op-td">
-                                        <span id="certificateList${varStatus.index}_fileName1"><c:if test="${not empty certificate.filePathStr}"><img src="${certificate.filePathStr}" width="24" height="24" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${certificate.filePathStr}','90%','90%')" alt=""></c:if></span>
-                                        <input id="certificateList${varStatus.index}_file" name="certificateList[${varStatus.index}].file" style="display:none" type="file" onchange="changeFileName(this,1)"/>
+                                        <!-- 文件或图片展示区域 -->
+                                        <span id="laborContractList${varStatus.index}_fileName1">
+                                                            <c:if test="${not empty certificate.filePathStr}">
+                                                                <!-- 提取文件名 -->
+                                                                <c:set var="fileNameArr" value="${fn:split(certificate.filePath, '/')}" />
+                                                                <c:set var="fileName" value="${fileNameArr[fn:length(fileNameArr) - 1]}" />
+
+                                                                <!-- 提取文件扩展名 -->
+                                                                <c:set var="extArr" value="${fn:split(fileName, '.')}" />
+                                                                <c:set var="ext" value="${fn:toLowerCase(extArr[fn:length(extArr) - 1])}" />
+
+                                                                <!-- 判断是否是图片类型 -->
+                                                                <c:choose>
+                                                                    <c:when test="${ext == 'jpg' || ext == 'jpeg' || ext == 'png' || ext == 'gif' || ext == 'bmp' || ext == 'webp'}">
+                                                                        <!-- 图片预览 -->
+                                                                        <img src="${certificate.filePathStr}" width="24" height="24"
+                                                                             style="cursor:pointer; vertical-align:middle;"
+                                                                             onclick="preview('预览','${certificate.filePathStr}','90%','90%','1')"
+                                                                             alt="图片预览" title="点击预览图片" />
+                                                                    </c:when>
+                                                                    <c:otherwise>
+                                                                        <c:choose>
+                                                                            <c:when test="${fn:containsIgnoreCase(certificate.fileName,'pdf')}">
+                                                                                <a class="attention-info" href="javascript:void(0)" style="color: #007bff;" onclick="preview('预览','${certificate.filePathStr}','90%','90%','1')">${certificate.fileName}</a>
+                                                                            </c:when>
+                                                                            <c:otherwise>
+                                                                                <a class="attention-info" href="javascript:void(0)" style="color: #007bff;" onclick="preview('预览','${certificate.filePathStr}','90%','90%')">${certificate.fileName}</a>
+                                                                            </c:otherwise>
+                                                                        </c:choose>
+                                                                    </c:otherwise>
+                                                                </c:choose>
+                                                            </c:if>
+                                                        </span>
+
+                                        <!-- 下载按钮 -->
+                                        <a href="javascript:void(0);"
+                                           title="下载 ${certificate.fileName}"
+                                           style="color: #28a745; margin-left: 5px; text-decoration: none;"
+                                           onclick="downloadFile('${ctx}', '${certificate.filePath}', '${certificate.fileName}')">
+                                            <i class="fa fa-download"></i>
+                                        </a>
+
                                     </td>
                                 </tr>
                             </c:forEach>
@@ -932,7 +972,7 @@
                                 <th width="15%"><span class="require-item">*</span>取得日期</th>
                                 <th width="15%"><span class="require-item">*</span>取得途径</th>
                                 <th width="15%"><span class="require-item">*</span>审批单位</th>
-                                <th width="15%">文件<span style="color: #FF8C69; font-size: 10px; font-weight: normal; margin-left: 5px;">(图片)</span></th>
+                                <th width="15%">文件</th>
                             </tr>
                             </thead>
                             <tbody id="titleList">
@@ -961,8 +1001,48 @@
                                         <input id="titleList${varStatus.index}_approvalAuthority" name="titleList[${varStatus.index}].approvalAuthority" readonly="true" class="form-control required" value="${title.approvalAuthority}"/>
                                     </td>
                                     <td class="text-left op-td">
-                                        <span id="titleList${varStatus.index}_fileName1"><c:if test="${not empty title.filePathStr}"><img src="${title.filePathStr}" width="24" height="24" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${title.filePathStr}','90%','90%')" alt=""></c:if></span>
-                                        <input id="titleList${varStatus.index}_file" name="titleList[${varStatus.index}].file" style="display:none" type="file" onchange="changeFileName(this,1)"/>
+                                        <!-- 文件或图片展示区域 -->
+                                        <span id="laborContractList${varStatus.index}_fileName1">
+                                                            <c:if test="${not empty title.filePathStr}">
+                                                                <!-- 提取文件名 -->
+                                                                <c:set var="fileNameArr" value="${fn:split(title.filePath, '/')}" />
+                                                                <c:set var="fileName" value="${fileNameArr[fn:length(fileNameArr) - 1]}" />
+
+                                                                <!-- 提取文件扩展名 -->
+                                                                <c:set var="extArr" value="${fn:split(fileName, '.')}" />
+                                                                <c:set var="ext" value="${fn:toLowerCase(extArr[fn:length(extArr) - 1])}" />
+
+                                                                <!-- 判断是否是图片类型 -->
+                                                                <c:choose>
+                                                                    <c:when test="${ext == 'jpg' || ext == 'jpeg' || ext == 'png' || ext == 'gif' || ext == 'bmp' || ext == 'webp'}">
+                                                                        <!-- 图片预览 -->
+                                                                        <img src="${title.filePathStr}" width="24" height="24"
+                                                                             style="cursor:pointer; vertical-align:middle;"
+                                                                             onclick="preview('预览','${title.filePathStr}','90%','90%','1')"
+                                                                             alt="图片预览" title="点击预览图片" />
+                                                                    </c:when>
+                                                                    <c:otherwise>
+                                                                        <c:choose>
+                                                                            <c:when test="${fn:containsIgnoreCase(title.fileName,'pdf')}">
+                                                                                <a class="attention-info" href="javascript:void(0)" style="color: #007bff;" onclick="preview('预览','${title.filePathStr}','90%','90%','1')">${title.fileName}</a>
+                                                                            </c:when>
+                                                                            <c:otherwise>
+                                                                                <a class="attention-info" href="javascript:void(0)" style="color: #007bff;" onclick="preview('预览','${title.filePathStr}','90%','90%')">${title.fileName}</a>
+                                                                            </c:otherwise>
+                                                                        </c:choose>
+                                                                    </c:otherwise>
+                                                                </c:choose>
+                                                            </c:if>
+                                                        </span>
+
+                                        <!-- 下载按钮 -->
+                                        <a href="javascript:void(0);"
+                                           title="下载 ${title.fileName}"
+                                           style="color: #28a745; margin-left: 5px; text-decoration: none;"
+                                           onclick="downloadFile('${ctx}', '${title.filePath}', '${title.fileName}')">
+                                            <i class="fa fa-download"></i>
+                                        </a>
+
                                     </td>
                                 </tr>
                             </c:forEach>

File diff suppressed because it is too large
+ 181 - 13
src/main/webapp/webpage/modules/workstaff/workStaffBasicDetailForm.jsp


File diff suppressed because it is too large
+ 198 - 20
src/main/webapp/webpage/modules/workstaff/workStaffBasicDetailModify.jsp


File diff suppressed because it is too large
+ 126 - 22
src/main/webapp/webpage/modules/workstaff/workStaffBasicInfoForm.jsp


+ 96 - 51
src/main/webapp/webpage/modules/workstaff/workStaffBasicInfoView.jsp

@@ -670,7 +670,7 @@
                                 <th width="11%">注册日期</th>
                                 <th width="11%"><span class="require-item">*</span>发证日期</th>
                                 <th width="10%">发证机关</th>
-                                <th width="10%">文件<span style="color: #FF8C69; font-size: 10px; font-weight: normal; margin-left: 5px;">(图片)</span></th>
+                                <th width="10%">文件</th>
                             </tr>
                             </thead>
                             <tbody id="certificateList">
@@ -691,46 +691,68 @@
                                     <td>
                                         ${certificate.issuingAuthority}
                                     </td>
-                                    <td >
+                                    <td class="text-left op-td">
                                         <c:if test="${not empty certificate.filePathStr}">
-                                            <%-- 安全处理URL中的 & --%>
+                                            <%-- 1. 安全处理URL中的 & --%>
                                             <c:set var="safeFilePath" value="${fn:replace(certificate.filePathStr, '&', '&amp;')}" />
 
-                                            <%-- 先从 certificate.fileName 里提取扩展名 --%>
-                                            <c:set var="fileNameArr" value="${fn:split(certificate.fileName, '.')}" />
-                                            <c:set var="fileExt" value="${fn:toLowerCase(fileNameArr[fn:length(fileNameArr) - 1])}" />
-
-                                            <%-- 如果没有后缀,尝试从 filePathStr 里提取 --%>
+                                            <%-- 2. 提取文件名 --%>
                                             <c:choose>
-                                                <c:when test="${fn:contains(certificate.fileName, '.')}">
-                                                    <%-- 已经有后缀 --%>
-                                                    <c:set var="downloadFileName" value="${certificate.fileName}" />
+                                                <c:when test="${not empty certificate.fileName}">
+                                                    <c:set var="fileName" value="${certificate.fileName}" />
                                                 </c:when>
                                                 <c:otherwise>
-                                                    <%-- 从路径最后部分提取后缀 --%>
-                                                    <c:set var="pathParts" value="${fn:split(certificate.filePathStr, '/')}"/>
-                                                    <c:set var="lastPart" value="${pathParts[fn:length(pathParts) - 1]}" />
-                                                    <c:set var="lastPartArr" value="${fn:split(lastPart, '.')}" />
-                                                    <c:set var="pathExt" value="${fn:toLowerCase(lastPartArr[fn:length(lastPartArr) - 1])}" />
-                                                    <c:set var="downloadFileName" value="${certificate.fileName}.${pathExt}" />
+                                                    <c:set var="fileNameArr" value="${fn:split(certificate.filePathStr, '/')}" />
+                                                    <c:set var="fileName" value="${fileNameArr[fn:length(fileNameArr) - 1]}" />
                                                 </c:otherwise>
                                             </c:choose>
 
-                                            <%-- 显示图片缩略图 --%>
-                                            <img src="${safeFilePath}" width="24" height="24"
-                                                 style="cursor:pointer; vertical-align:middle;"
-                                                 onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${safeFilePath}','90%','90%')"
-                                                 alt="文件预览" title="点击预览" />
+                                            <%-- 3. 提取文件扩展名(后缀)--%>
+                                            <c:set var="extArr" value="${fn:split(fileName, '.')}" />
+                                            <c:set var="ext" value="${fn:toLowerCase(extArr[fn:length(extArr) - 1])}" />
 
-                                            <%-- 下载按钮 --%>
+                                            <%-- 4. 判断并显示文件内容(图片预览 / 链接预览) --%>
+                                            <c:choose>
+                                                <%-- ✅ 图片预览格式 --%>
+                                                <c:when test="${ext == 'jpg' || ext == 'jpeg' || ext == 'png' || ext == 'gif' || ext == 'bmp' || ext == 'webp'}">
+                                                    <img src="${safeFilePath}" width="24" height="24"
+                                                         style="cursor:pointer; vertical-align:middle;"
+                                                         onclick="preview('预览','${safeFilePath}','90%','90%','1')"
+                                                         alt="图片预览" title="点击预览图片" />
+                                                </c:when>
+
+                                                <%-- ✅ 非图片文件,按类型显示文件名并支持预览 --%>
+                                                <c:otherwise>
+                                                    <c:choose>
+                                                        <%-- PDF 特殊处理(可用 iframe 预览) --%>
+                                                        <c:when test="${ext == 'pdf'}">
+                                                            <a class="attention-info" href="javascript:void(0)"
+                                                               style="color: #007bff;"
+                                                               onclick="preview('预览','${safeFilePath}','90%','90%','1')">
+                                                                    ${fileName}
+                                                            </a>
+                                                        </c:when>
+
+                                                        <%-- 其他文件格式 --%>
+                                                        <c:otherwise>
+                                                            <a class="attention-info" href="javascript:void(0)"
+                                                               style="color: #007bff;"
+                                                               onclick="preview('预览','${safeFilePath}','90%','90%')">
+                                                                    ${fileName}
+                                                            </a>
+                                                        </c:otherwise>
+                                                    </c:choose>
+                                                </c:otherwise>
+                                            </c:choose>
+
+                                            <%-- 5. 下载按钮 --%>
                                             <a href="javascript:void(0);"
-                                               title="下载文件"
+                                               title="下载 ${fileName}"
                                                style="color: #28a745; margin-left: 5px; text-decoration: none;"
-                                               onclick="downloadFile('${ctx}', '${certificate.filePath}', '${downloadFileName}')">
+                                               onclick="downloadFile('${ctx}', '${certificate.filePath}', '${fileName}')">
                                                 <i class="fa fa-download"></i>
                                             </a>
                                         </c:if>
-
                                     </td>
                                 </tr>
                             </c:forEach>
@@ -749,7 +771,7 @@
                                 <th width="15%"><span class="require-item">*</span>取得日期</th>
                                 <th width="15%"><span class="require-item">*</span>取得途径</th>
                                 <th width="20%"><span class="require-item">*</span>审批单位</th>
-                                <th width="15%">文件<span style="color: #FF8C69; font-size: 10px; font-weight: normal; margin-left: 5px;">(图片)</span></th>
+                                <th width="15%">文件</th>
                             </tr>
                             </thead>
                             <tbody id="titleList">
@@ -770,42 +792,65 @@
                                     <td>
                                         ${title.approvalAuthority}
                                     </td>
-                                    <td>
+                                    <td class="text-left op-td">
                                         <c:if test="${not empty title.filePathStr}">
-                                            <%-- 安全处理URL中的 & --%>
+                                            <%-- 1. 安全处理URL中的 & --%>
                                             <c:set var="safeFilePath" value="${fn:replace(title.filePathStr, '&', '&amp;')}" />
 
-                                            <%-- 先从 title.fileName 里提取扩展名 --%>
-                                            <c:set var="fileNameArr" value="${fn:split(title.fileName, '.')}" />
-                                            <c:set var="fileExt" value="${fn:toLowerCase(fileNameArr[fn:length(fileNameArr) - 1])}" />
-
-                                            <%-- 如果没有后缀,尝试从 filePathStr 里提取 --%>
+                                            <%-- 2. 提取文件名 --%>
                                             <c:choose>
-                                                <c:when test="${fn:contains(title.fileName, '.')}">
-                                                    <%-- 已经有后缀 --%>
-                                                    <c:set var="downloadFileName" value="${title.fileName}" />
+                                                <c:when test="${not empty title.fileName}">
+                                                    <c:set var="fileName" value="${title.fileName}" />
                                                 </c:when>
                                                 <c:otherwise>
-                                                    <%-- 从路径最后部分提取后缀 --%>
-                                                    <c:set var="pathParts" value="${fn:split(title.filePathStr, '/')}"/>
-                                                    <c:set var="lastPart" value="${pathParts[fn:length(pathParts) - 1]}" />
-                                                    <c:set var="lastPartArr" value="${fn:split(lastPart, '.')}" />
-                                                    <c:set var="pathExt" value="${fn:toLowerCase(lastPartArr[fn:length(lastPartArr) - 1])}" />
-                                                    <c:set var="downloadFileName" value="${title.fileName}.${pathExt}" />
+                                                    <c:set var="fileNameArr" value="${fn:split(title.filePathStr, '/')}" />
+                                                    <c:set var="fileName" value="${fileNameArr[fn:length(fileNameArr) - 1]}" />
                                                 </c:otherwise>
                                             </c:choose>
 
-                                            <%-- 显示图片缩略图 --%>
-                                            <img src="${safeFilePath}" width="24" height="24"
-                                                 style="cursor:pointer; vertical-align:middle;"
-                                                 onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${safeFilePath}','90%','90%')"
-                                                 alt="文件预览" title="点击预览" />
+                                            <%-- 3. 提取文件扩展名(后缀)--%>
+                                            <c:set var="extArr" value="${fn:split(fileName, '.')}" />
+                                            <c:set var="ext" value="${fn:toLowerCase(extArr[fn:length(extArr) - 1])}" />
 
-                                            <%-- 下载按钮 --%>
+                                            <%-- 4. 判断并显示文件内容(图片预览 / 链接预览) --%>
+                                            <c:choose>
+                                                <%-- ✅ 图片预览格式 --%>
+                                                <c:when test="${ext == 'jpg' || ext == 'jpeg' || ext == 'png' || ext == 'gif' || ext == 'bmp' || ext == 'webp'}">
+                                                    <img src="${safeFilePath}" width="24" height="24"
+                                                         style="cursor:pointer; vertical-align:middle;"
+                                                         onclick="preview('预览','${safeFilePath}','90%','90%','1')"
+                                                         alt="图片预览" title="点击预览图片" />
+                                                </c:when>
+
+                                                <%-- ✅ 非图片文件,按类型显示文件名并支持预览 --%>
+                                                <c:otherwise>
+                                                    <c:choose>
+                                                        <%-- PDF 特殊处理(可用 iframe 预览) --%>
+                                                        <c:when test="${ext == 'pdf'}">
+                                                            <a class="attention-info" href="javascript:void(0)"
+                                                               style="color: #007bff;"
+                                                               onclick="preview('预览','${safeFilePath}','90%','90%','1')">
+                                                                    ${fileName}
+                                                            </a>
+                                                        </c:when>
+
+                                                        <%-- 其他文件格式 --%>
+                                                        <c:otherwise>
+                                                            <a class="attention-info" href="javascript:void(0)"
+                                                               style="color: #007bff;"
+                                                               onclick="preview('预览','${safeFilePath}','90%','90%')">
+                                                                    ${fileName}
+                                                            </a>
+                                                        </c:otherwise>
+                                                    </c:choose>
+                                                </c:otherwise>
+                                            </c:choose>
+
+                                            <%-- 5. 下载按钮 --%>
                                             <a href="javascript:void(0);"
-                                               title="下载文件"
+                                               title="下载 ${fileName}"
                                                style="color: #28a745; margin-left: 5px; text-decoration: none;"
-                                               onclick="downloadFile('${ctx}', '${title.filePath}', '${downloadFileName}')">
+                                               onclick="downloadFile('${ctx}', '${title.filePath}', '${fileName}')">
                                                 <i class="fa fa-download"></i>
                                             </a>
                                         </c:if>