Ver código fonte

党员管理-党务工作指引-党务工作资源库

lizeyu 9 meses atrás
pai
commit
4c060c228f

+ 74 - 6
src/main/java/com/ghsc/partybuild/controller/workresourcelibrary/WorkResourceLibraryController.java

@@ -4,10 +4,17 @@ import com.ghsc.partybuild.AppConfig;
 import com.ghsc.partybuild.controller.jsonmodel.RequsetData;
 import com.ghsc.partybuild.model.DjWorkresourcelibrary;
 import com.ghsc.partybuild.model.DjWorkresourcelibrarytype;
+import com.ghsc.partybuild.service.UserService;
 import com.ghsc.partybuild.service.workresourcelibrary.WorkResourceLibraryService;
+import com.ghsc.partybuild.util.DateUtils;
+import com.ghsc.partybuild.util.ExcelHelper;
 import com.ghsc.partybuild.util.Word2PdfUtil;
+import com.ghsc.partybuild.vo.DjWorkresourcelibraryVo;
 import com.ghsc.partybuild.vo.DsjTreeFiletype;
 import com.github.pagehelper.PageInfo;
+import org.apache.poi.xssf.usermodel.XSSFCellStyle;
+import org.apache.poi.xssf.usermodel.XSSFSheet;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -44,12 +51,18 @@ public class WorkResourceLibraryController {
     @Autowired
     private AppConfig appConfig;
 
+    @Autowired
+    private DateUtils dateUtils;
+
+    @Autowired
+    private UserService userService;
+
     @GetMapping("/GetFilesByType")
     @ResponseBody
-    public RequsetData<PageInfo<DjWorkresourcelibrary>> GetFilesByType(@RequestParam("filetypeid") String fileTypeId, @RequestParam(required = false) String fileName , @RequestParam("pageindex") int pageIndex, @RequestParam("pagesize") int pageSize) {
-        RequsetData<PageInfo<DjWorkresourcelibrary>> res = new RequsetData<>();
+    public RequsetData<PageInfo<DjWorkresourcelibraryVo>> GetFilesByType(@RequestParam("filetypeid") String fileTypeId, @RequestParam(required = false) String fileName , @RequestParam("pageindex") int pageIndex, @RequestParam("pagesize") int pageSize) {
+        RequsetData<PageInfo<DjWorkresourcelibraryVo>> res = new RequsetData<>();
 
-        res.setItem(workResourceLibraryService.getFilesByType(fileTypeId,fileName,pageIndex, pageSize));
+        res.setItem(workResourceLibraryService.getFilesByType(fileTypeId, fileName, pageIndex, pageSize));
 
         return res;
     }
@@ -73,7 +86,7 @@ public class WorkResourceLibraryController {
         model.setCreatedatetime(new Date());
         model.setFileurl(model.getFileid());
         model.setExtendedname(".pdf");
-        result = workResourceLibraryService.saveFile(model);
+        result = workResourceLibraryService.saveFile(model, userService.getLoginUser().getUserid());
 
         return result;
     }
@@ -94,8 +107,8 @@ public class WorkResourceLibraryController {
     }
     @GetMapping("/GetFilesByKey")
     @ResponseBody
-    public RequsetData<PageInfo<DjWorkresourcelibrary>> GetFilesByKey(@RequestParam("fileName") String fileName, @RequestParam("pageindex") int pageIndex, @RequestParam("pagesize") int pageSize) {
-        RequsetData<PageInfo<DjWorkresourcelibrary>> res = new RequsetData<>();
+    public RequsetData<PageInfo<DjWorkresourcelibraryVo>> GetFilesByKey(@RequestParam("fileName") String fileName, @RequestParam("pageindex") int pageIndex, @RequestParam("pagesize") int pageSize) {
+        RequsetData<PageInfo<DjWorkresourcelibraryVo>> res = new RequsetData<>();
 
         res.setItem(workResourceLibraryService.getFilesByKey(fileName, pageIndex, pageSize));
 
@@ -302,5 +315,60 @@ public class WorkResourceLibraryController {
     }
 
 
+    @RequestMapping(value = "/export", method = RequestMethod.GET)
+    public void export(HttpServletResponse response,
+                                 @RequestParam("filetypeid") String fileTypeId,  @RequestParam(required = false) String fileName,
+                                 @RequestParam("pageindex") int pageIndex, @RequestParam("pagesize") int pageSize) throws Exception {
+        /**查询数据**/
+        List<DjWorkresourcelibraryVo> dataList = workResourceLibraryService.getFilesByType(fileTypeId, fileName, pageIndex, pageSize).getList();
+
+        ExcelHelper excelHelper = new ExcelHelper();
+        ExcelHelper.ExcelData data = excelHelper.new ExcelData();
+
+        XSSFWorkbook wb = new XSSFWorkbook();
+        XSSFSheet sheet = wb.createSheet("党务工作资源库");
+        sheet.setColumnWidth(1, 256 * 30);
+        sheet.setColumnWidth(4, 256 * 15);
+
+        try{
+            List<String> titles = new ArrayList();
+            titles.add("序号");
+            titles.add("文件名称");
+            titles.add("所属分类");
+            titles.add("上传人");
+            titles.add("最近修改时间");
+            data.setTitles(titles);
+
+            //数据
+            List<List<Object>> rows = new ArrayList();
+            List<List<XSSFCellStyle>> cellStyles = new ArrayList();
+            XSSFCellStyle defaultStyle = excelHelper.setDefaultBorder(wb);
+
+            int i = 0;
+            for (DjWorkresourcelibraryVo item : dataList) {
+                List<Object> row = new ArrayList();
+                row.add(++i);
+                row.add(item.getFilename());
+                row.add(item.getSsfltypename());
+                row.add(item.getUsername());
+                row.add(dateUtils.dateToStrFormat(item.getUpdatedatetime(), "yyyy-MM-dd"));
+                rows.add(row);
+
+                List<XSSFCellStyle> styles= new ArrayList<>();
+                for(int j=0;j<10;j++){
+                    styles.add(defaultStyle);
+                }
+                cellStyles.add(styles);
+            }
+
+            data.setRows(rows);
+            data.setStyleList(cellStyles);
+        } catch (Exception ex) {
+            wb.close();
+        }
+
+        excelHelper.exportExcelNew(wb , response,  "党务工作资源库.xlsx", data);
+    }
+
 
 }

+ 18 - 0
src/main/java/com/ghsc/partybuild/mapper/DjWorkresourcelibraryCQuery.java

@@ -0,0 +1,18 @@
+package com.ghsc.partybuild.mapper;
+
+import com.ghsc.partybuild.vo.DjWorkresourcelibraryVo;
+import com.ghsc.partybuild.vo.DsjTreeFiletype;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+@Repository
+public interface DjWorkresourcelibraryCQuery {
+    List<DsjTreeFiletype> selectTreeFiles(@Param("pFileId") String pFileId,@Param("typename") String typename,@Param("typeIds") List<String> typeIds,@Param("passTypeIds") List<String> passTypeIds);
+
+    List<Map<String,Object>> FindDSJ_File(@Param("fileName") String fileName,@Param("typeIds") List<String> typeIds);
+
+    List<DjWorkresourcelibraryVo> getFilesByKey(@Param("fileName") String fileName, @Param("typeIds") List<String> typeIds);
+}

+ 40 - 0
src/main/java/com/ghsc/partybuild/model/DjWorkresourcelibrary.java

@@ -19,6 +19,14 @@ public class DjWorkresourcelibrary {
 
     private Integer filecode2;
 
+    private Integer ssfl;
+
+    private String createuserid;
+
+    private Date updatedatetime;
+
+    private String updateuserid;
+
     public String getFileid() {
         return fileid;
     }
@@ -82,4 +90,36 @@ public class DjWorkresourcelibrary {
     public void setFilecode2(Integer filecode2) {
         this.filecode2 = filecode2;
     }
+
+    public Integer getSsfl() {
+        return ssfl;
+    }
+
+    public void setSsfl(Integer ssfl) {
+        this.ssfl = ssfl;
+    }
+
+    public String getCreateuserid() {
+        return createuserid;
+    }
+
+    public void setCreateuserid(String createuserid) {
+        this.createuserid = createuserid == null ? null : createuserid.trim();
+    }
+
+    public Date getUpdatedatetime() {
+        return updatedatetime;
+    }
+
+    public void setUpdatedatetime(Date updatedatetime) {
+        this.updatedatetime = updatedatetime;
+    }
+
+    public String getUpdateuserid() {
+        return updateuserid;
+    }
+
+    public void setUpdateuserid(String updateuserid) {
+        this.updateuserid = updateuserid == null ? null : updateuserid.trim();
+    }
 }

+ 260 - 0
src/main/java/com/ghsc/partybuild/model/DjWorkresourcelibraryExample.java

@@ -644,6 +644,266 @@ public class DjWorkresourcelibraryExample {
             addCriterion("FILECODE2 not between", value1, value2, "filecode2");
             return (Criteria) this;
         }
+
+        public Criteria andSsflIsNull() {
+            addCriterion("ssfl is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSsflIsNotNull() {
+            addCriterion("ssfl is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSsflEqualTo(Integer value) {
+            addCriterion("ssfl =", value, "ssfl");
+            return (Criteria) this;
+        }
+
+        public Criteria andSsflNotEqualTo(Integer value) {
+            addCriterion("ssfl <>", value, "ssfl");
+            return (Criteria) this;
+        }
+
+        public Criteria andSsflGreaterThan(Integer value) {
+            addCriterion("ssfl >", value, "ssfl");
+            return (Criteria) this;
+        }
+
+        public Criteria andSsflGreaterThanOrEqualTo(Integer value) {
+            addCriterion("ssfl >=", value, "ssfl");
+            return (Criteria) this;
+        }
+
+        public Criteria andSsflLessThan(Integer value) {
+            addCriterion("ssfl <", value, "ssfl");
+            return (Criteria) this;
+        }
+
+        public Criteria andSsflLessThanOrEqualTo(Integer value) {
+            addCriterion("ssfl <=", value, "ssfl");
+            return (Criteria) this;
+        }
+
+        public Criteria andSsflIn(List<Integer> values) {
+            addCriterion("ssfl in", values, "ssfl");
+            return (Criteria) this;
+        }
+
+        public Criteria andSsflNotIn(List<Integer> values) {
+            addCriterion("ssfl not in", values, "ssfl");
+            return (Criteria) this;
+        }
+
+        public Criteria andSsflBetween(Integer value1, Integer value2) {
+            addCriterion("ssfl between", value1, value2, "ssfl");
+            return (Criteria) this;
+        }
+
+        public Criteria andSsflNotBetween(Integer value1, Integer value2) {
+            addCriterion("ssfl not between", value1, value2, "ssfl");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateuseridIsNull() {
+            addCriterion("CREATEUSERID is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateuseridIsNotNull() {
+            addCriterion("CREATEUSERID is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateuseridEqualTo(String value) {
+            addCriterion("CREATEUSERID =", value, "createuserid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateuseridNotEqualTo(String value) {
+            addCriterion("CREATEUSERID <>", value, "createuserid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateuseridGreaterThan(String value) {
+            addCriterion("CREATEUSERID >", value, "createuserid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateuseridGreaterThanOrEqualTo(String value) {
+            addCriterion("CREATEUSERID >=", value, "createuserid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateuseridLessThan(String value) {
+            addCriterion("CREATEUSERID <", value, "createuserid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateuseridLessThanOrEqualTo(String value) {
+            addCriterion("CREATEUSERID <=", value, "createuserid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateuseridLike(String value) {
+            addCriterion("CREATEUSERID like", value, "createuserid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateuseridNotLike(String value) {
+            addCriterion("CREATEUSERID not like", value, "createuserid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateuseridIn(List<String> values) {
+            addCriterion("CREATEUSERID in", values, "createuserid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateuseridNotIn(List<String> values) {
+            addCriterion("CREATEUSERID not in", values, "createuserid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateuseridBetween(String value1, String value2) {
+            addCriterion("CREATEUSERID between", value1, value2, "createuserid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateuseridNotBetween(String value1, String value2) {
+            addCriterion("CREATEUSERID not between", value1, value2, "createuserid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdatedatetimeIsNull() {
+            addCriterion("UPDATEDATETIME is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdatedatetimeIsNotNull() {
+            addCriterion("UPDATEDATETIME is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdatedatetimeEqualTo(Date value) {
+            addCriterion("UPDATEDATETIME =", value, "updatedatetime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdatedatetimeNotEqualTo(Date value) {
+            addCriterion("UPDATEDATETIME <>", value, "updatedatetime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdatedatetimeGreaterThan(Date value) {
+            addCriterion("UPDATEDATETIME >", value, "updatedatetime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdatedatetimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("UPDATEDATETIME >=", value, "updatedatetime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdatedatetimeLessThan(Date value) {
+            addCriterion("UPDATEDATETIME <", value, "updatedatetime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdatedatetimeLessThanOrEqualTo(Date value) {
+            addCriterion("UPDATEDATETIME <=", value, "updatedatetime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdatedatetimeIn(List<Date> values) {
+            addCriterion("UPDATEDATETIME in", values, "updatedatetime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdatedatetimeNotIn(List<Date> values) {
+            addCriterion("UPDATEDATETIME not in", values, "updatedatetime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdatedatetimeBetween(Date value1, Date value2) {
+            addCriterion("UPDATEDATETIME between", value1, value2, "updatedatetime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdatedatetimeNotBetween(Date value1, Date value2) {
+            addCriterion("UPDATEDATETIME not between", value1, value2, "updatedatetime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateuseridIsNull() {
+            addCriterion("UPDATEUSERID is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateuseridIsNotNull() {
+            addCriterion("UPDATEUSERID is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateuseridEqualTo(String value) {
+            addCriterion("UPDATEUSERID =", value, "updateuserid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateuseridNotEqualTo(String value) {
+            addCriterion("UPDATEUSERID <>", value, "updateuserid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateuseridGreaterThan(String value) {
+            addCriterion("UPDATEUSERID >", value, "updateuserid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateuseridGreaterThanOrEqualTo(String value) {
+            addCriterion("UPDATEUSERID >=", value, "updateuserid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateuseridLessThan(String value) {
+            addCriterion("UPDATEUSERID <", value, "updateuserid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateuseridLessThanOrEqualTo(String value) {
+            addCriterion("UPDATEUSERID <=", value, "updateuserid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateuseridLike(String value) {
+            addCriterion("UPDATEUSERID like", value, "updateuserid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateuseridNotLike(String value) {
+            addCriterion("UPDATEUSERID not like", value, "updateuserid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateuseridIn(List<String> values) {
+            addCriterion("UPDATEUSERID in", values, "updateuserid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateuseridNotIn(List<String> values) {
+            addCriterion("UPDATEUSERID not in", values, "updateuserid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateuseridBetween(String value1, String value2) {
+            addCriterion("UPDATEUSERID between", value1, value2, "updateuserid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateuseridNotBetween(String value1, String value2) {
+            addCriterion("UPDATEUSERID not between", value1, value2, "updateuserid");
+            return (Criteria) this;
+        }
     }
 
     public static class Criteria extends GeneratedCriteria {

+ 23 - 40
src/main/java/com/ghsc/partybuild/service/impl/workresourcelibrary/WorkResourceLibraryServiceImpl.java

@@ -7,16 +7,14 @@ import com.ghsc.partybuild.service.DictionaryService;
 import com.ghsc.partybuild.service.workresourcelibrary.WorkResourceLibraryService;
 import com.ghsc.partybuild.util.MapUtils;
 import com.ghsc.partybuild.util.StringUtils;
+import com.ghsc.partybuild.vo.DjWorkresourcelibraryVo;
 import com.ghsc.partybuild.vo.DsjTreeFiletype;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
+import java.util.*;
 
 /**
  *
@@ -45,49 +43,26 @@ public class WorkResourceLibraryServiceImpl implements WorkResourceLibraryServic
     private CfFileMapper cfFileMapper;
 
     @Autowired
-    private CfFileCQuery cfFileCQuery;
+    private DjWorkresourcelibraryCQuery djWorkresourcelibraryCQuery;
 
     @Override
-    public PageInfo<DjWorkresourcelibrary> getFilesByType(String fileTypeId, String fileName, int pageIndex, int pageSize) {
+    public PageInfo<DjWorkresourcelibraryVo> getFilesByType(String fileTypeId, String fileName, int pageIndex, int pageSize) {
 
-
-
-        DjWorkresourcelibraryExample exp = new DjWorkresourcelibraryExample();
-        DjWorkresourcelibraryExample.Criteria criteria = exp.createCriteria();
-
-        if (!stringUtils.IsNullOrEmpty(fileName)){
-            criteria.andFilenameLike("%" + fileName + "%");
-        }
-        if(!stringUtils.IsNullOrEmpty(fileTypeId)) {
-            List<String> typeIds = findFileTypeAndChildren(fileTypeId);
-            criteria.andFiletypeidIn(typeIds);
-        }
-
-        exp.setOrderByClause("cast((filecode) as SIGNED INTEGER ) asc");
+        List<String> fileTypeIds = findFileTypeAndChildren(fileTypeId);
 
         PageHelper.startPage(pageIndex, pageSize);
-        List<DjWorkresourcelibrary> flist = djWorkresourcelibraryMapper.selectByExample(exp);
-
-
-        PageInfo<DjWorkresourcelibrary> pList = new PageInfo(flist);
-
+        List<DjWorkresourcelibraryVo> flist = djWorkresourcelibraryCQuery.getFilesByKey(fileName, fileTypeIds);
 
+        PageInfo<DjWorkresourcelibraryVo> pList = new PageInfo(flist);
         return pList;
     }
 
     @Override
-    public PageInfo<DjWorkresourcelibrary> getFilesByKey(String fileName, int pageIndex, int pageSize) {
-
-        DjWorkresourcelibraryExample exp = new DjWorkresourcelibraryExample();
-        DjWorkresourcelibraryExample.Criteria criteria = exp.createCriteria();
-
-        criteria.andFilenameLike("%"+fileName+"%");
-
+    public PageInfo<DjWorkresourcelibraryVo> getFilesByKey(String fileName, int pageIndex, int pageSize) {
         PageHelper.startPage(pageIndex, pageSize);
-        //fileName
 
-        List<DjWorkresourcelibrary> flist = djWorkresourcelibraryMapper.selectByExample(exp);
-        PageInfo<DjWorkresourcelibrary> pList = new PageInfo(flist);
+        List<DjWorkresourcelibraryVo> flist = djWorkresourcelibraryCQuery.getFilesByKey(fileName, null);
+        PageInfo<DjWorkresourcelibraryVo> pList = new PageInfo(flist);
 
         return pList;
     }
@@ -141,12 +116,12 @@ public class WorkResourceLibraryServiceImpl implements WorkResourceLibraryServic
     @Override
     public List<DsjTreeFiletype> getFileTreeByParent(String parentId, List<String> typeIds, List<String> passTypeIds) {
 
-        return cfFileCQuery.selectTreeFiles(parentId, null, typeIds, passTypeIds);
+        return djWorkresourcelibraryCQuery.selectTreeFiles(parentId, null, typeIds, passTypeIds);
     }
     @Override
     public PageInfo<Map<String, Object>> selectFiletypeList(String typename,String parentId ,int pageIndex, int pageSize) {
         PageHelper.startPage(pageIndex, pageSize);
-        List<DsjTreeFiletype> list = cfFileCQuery.selectTreeFiles(parentId, typename, null, null);
+        List<DsjTreeFiletype> list = djWorkresourcelibraryCQuery.selectTreeFiles(parentId, typename, null, null);
         PageInfo<Map<String, Object>> pList = new PageInfo(list);
         return pList;
     }
@@ -176,7 +151,7 @@ public class WorkResourceLibraryServiceImpl implements WorkResourceLibraryServic
             item.setFiletypename(model.getFiletypename());
             item.setParenttypeid(model.getParenttypeid());
             item.setTreelevel(model.getTreelevel());
-            result =djWorkresourcelibrarytypeMapper.updateByPrimaryKeySelective(item);
+            result = djWorkresourcelibrarytypeMapper.updateByPrimaryKeySelective(item);
         }
         if (result > 0) {
             res.setSuccess(true);
@@ -196,18 +171,26 @@ public class WorkResourceLibraryServiceImpl implements WorkResourceLibraryServic
     public int deleteFile(String id) {
         return djWorkresourcelibraryMapper.deleteByPrimaryKey(id);
     }
+
     @Override
-    public RequsetData<String> saveFile(DjWorkresourcelibrary model) {
+    public RequsetData<String> saveFile(DjWorkresourcelibrary model, String userId) {
         RequsetData<String> res = new RequsetData<String>();
         int result = 0;
         DjWorkresourcelibrary item = djWorkresourcelibraryMapper.selectByPrimaryKey(model.getFileid());
         if (item==null) {
+            model.setCreatedatetime(new Date());
+            model.setCreateuserid(userId);
+            model.setUpdatedatetime(new Date());
+            model.setUpdateuserid(userId);
             result = djWorkresourcelibraryMapper.insert(model);
         } else {
             item.setFilename(model.getFilename());
             item.setFilecode(model.getFilecode());
             item.setFiletypeid(model.getFiletypeid());
             item.setFilecode2(model.getFilecode2());
+            item.setSsfl(model.getSsfl());
+            model.setUpdatedatetime(new Date());
+            model.setUpdateuserid(userId);
             result= djWorkresourcelibraryMapper.updateByPrimaryKeySelective(item);
         }
         if (result > 0) {
@@ -233,7 +216,7 @@ public class WorkResourceLibraryServiceImpl implements WorkResourceLibraryServic
 
         PageHelper.startPage(pageIndex, pageSize);
         PageHelper.orderBy("TREELEVEL asc,cast(filecode2 as unsigned int) asc");
-        List<Map<String,Object>> list=cfFileCQuery.FindDSJ_File(fileName,typeIds);
+        List<Map<String,Object>> list= djWorkresourcelibraryCQuery.FindDSJ_File(fileName,typeIds);
 
         PageInfo<Map<String, Object>> pList = new PageInfo(list);
 

+ 4 - 4
src/main/java/com/ghsc/partybuild/service/workresourcelibrary/WorkResourceLibraryService.java

@@ -2,8 +2,8 @@ package com.ghsc.partybuild.service.workresourcelibrary;
 
 import com.ghsc.partybuild.controller.jsonmodel.RequsetData;
 import com.ghsc.partybuild.model.DjWorkresourcelibrary;
-import com.ghsc.partybuild.model.DjWorkresourcelibrary;
 import com.ghsc.partybuild.model.DjWorkresourcelibrarytype;
+import com.ghsc.partybuild.vo.DjWorkresourcelibraryVo;
 import com.ghsc.partybuild.vo.DsjTreeFiletype;
 import com.github.pagehelper.PageInfo;
 
@@ -25,7 +25,7 @@ public interface WorkResourceLibraryService {
      * @param pageSize ps
      * @return list
      */
-    PageInfo<DjWorkresourcelibrary> getFilesByType(String fileTypeId, String fileName, int pageIndex, int pageSize);
+    PageInfo<DjWorkresourcelibraryVo> getFilesByType(String fileTypeId, String fileName, int pageIndex, int pageSize);
 
     /**
      * 获取文件
@@ -103,7 +103,7 @@ public interface WorkResourceLibraryService {
      * @param pageSize 10
      * @return list
      */
-    PageInfo<DjWorkresourcelibrary> getFilesByKey(String fileName, int pageIndex, int pageSize);
+    PageInfo<DjWorkresourcelibraryVo> getFilesByKey(String fileName, int pageIndex, int pageSize);
 
     /**
      * 删除方法
@@ -117,7 +117,7 @@ public interface WorkResourceLibraryService {
      * @param model 10
      * @return list
      */
-    RequsetData<String> saveFile(DjWorkresourcelibrary model);
+    RequsetData<String> saveFile(DjWorkresourcelibrary model, String userId);
 
     PageInfo<Map<String,Object>> FindFilesApp(String fileName, String fileTypeId, int pageIndex, int pageSize);
 }

+ 15 - 0
src/main/java/com/ghsc/partybuild/vo/DjWorkresourcelibraryTypeVo.java

@@ -0,0 +1,15 @@
+package com.ghsc.partybuild.vo;
+
+import com.ghsc.partybuild.model.DjWorkresourcelibrarytype;
+
+public class DjWorkresourcelibraryTypeVo extends DjWorkresourcelibrarytype {
+    private int childcount;
+
+    public int getChildcount() {
+        return childcount;
+    }
+
+    public void setChildcount(int childcount) {
+        this.childcount = childcount;
+    }
+}

+ 13 - 0
src/main/java/com/ghsc/partybuild/vo/DjWorkresourcelibraryVo.java

@@ -0,0 +1,13 @@
+package com.ghsc.partybuild.vo;
+
+import com.ghsc.partybuild.model.DjWorkresourcelibrary;
+import lombok.Data;
+
+@Data
+public class DjWorkresourcelibraryVo extends DjWorkresourcelibrary {
+    public String file;
+    public String filetypename;
+    public String parenttypeid;
+    public String username;
+    public String ssfltypename;
+}

+ 2 - 2
src/main/resources/generatorConfig.xml

@@ -270,8 +270,6 @@
         <table schema="" tableName="TEST_ONLINETEST"></table>
         <table schema="" tableName="dj_workresourcelibrary"></table>
         <table schema="" tableName="dj_workresourcelibrarytype"></table>
-
-        -->
         <table schema="" tableName="pt_checkData"></table>
         <table schema="" tableName="pt_checkNameList"></table>
         <table schema="" tableName="pt_checkParty"></table>
@@ -279,5 +277,7 @@
         <table schema="" tableName="pt_checkQuestion"></table>
         <table schema="" tableName="pt_reportData"></table>
         <table schema="" tableName="pt_reportScore"></table>
+
+        -->
     </context>
 </generatorConfiguration>

+ 82 - 0
src/main/resources/mapping/DjWorkresourcelibraryCQuery.xml

@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ghsc.partybuild.mapper.DjWorkresourcelibraryCQuery">
+    <resultMap id="BaseResultMap" type="com.ghsc.partybuild.vo.DjWorkresourcelibraryTypeVo">
+        <id column="FILETYPEID" jdbcType="VARCHAR" property="filetypeid"/>
+        <result column="PARENTTYPEID" jdbcType="VARCHAR" property="parenttypeid"/>
+        <result column="FILETYPENAME" jdbcType="VARCHAR" property="filetypename"/>
+        <result column="TREELEVEL" jdbcType="DECIMAL" property="treelevel"/>
+        <result column="CHILDCOUNT" jdbcType="DECIMAL" property="childcount"/>
+    </resultMap>
+    <select id="selectTreeFiles" resultMap="BaseResultMap">
+        select FILETYPEID, PARENTTYPEID, FILETYPENAME, TREELEVEL,
+        (select count(1) from dj_workresourcelibrarytype l where l.PARENTTYPEID=f.FILETYPEID) as CHILDCOUNT
+        from dj_workresourcelibrarytype f
+        where 1=1
+
+        <if test="pFileId !='' and pFileId!=null">
+            and f.PARENTTYPEID = #{ pFileId }
+        </if>
+        <if test="typename !='' and typename!=null">
+            and f.FILETYPENAME like '%'||#{typename}||'%'
+        </if>
+        <if test="pFileId == null or pFileId ==''">
+            and f.PARENTTYPEID is null
+        </if>
+        <if test="typeIds!=null and typeIds.size()!=0">
+            and f.FILETYPEID in
+            <foreach collection="typeIds" item="typeId"
+                     index="index" open="(" close=")" separator=",">
+                #{typeId}
+            </foreach>
+        </if>
+        <if test="passTypeIds!=null and passTypeIds.size()!=0">
+            and f.FILETYPEID not in
+            <foreach collection="passTypeIds" item="typeId"
+                     index="index" open="(" close=")" separator=",">
+                #{typeId}
+            </foreach>
+        </if>
+        order by treelevel asc
+
+    </select>
+    <select id="FindDSJ_File" resultType="java.util.Map">
+        select f.*,ft.FILETYPENAME,ft.TREELEVEL from (
+        select t.*,fn_FileTypeRoot(t.FILETYPEID) as rootTypeId from dj_workresourcelibrary t
+        where 1=1
+        <if test="fileName != null and fileName !=''">
+            and t.fileName like concat('%',#{fileName},'%')
+
+        </if>
+        <if test="typeIds!=null and typeIds.size()!=0">
+            and t.FILETYPEID in
+            <foreach collection="typeIds" item="typeId"
+                     index="index" open="(" close=")" separator=",">
+                #{typeId}
+            </foreach>
+        </if>
+        ) f
+        inner join dj_workresourcelibrarytype ft on f.rootTypeId=ft.FILETYPEID
+    </select>
+    <select id="getFilesByKey" resultType="com.ghsc.partybuild.vo.DjWorkresourcelibraryVo" >
+        select dw.fileid, dw.filename, dw.fileurl, dw.extendedname, dw.createdatetime, dw.filetypeid,
+                dw.filecode, dw.filecode2, dw.ssfl, dw.createuserid, dw.updatedatetime, dw.updateuserid,
+                dwt.filetypename, dwt.parenttypeid, cu.username, cd.dicvalue as ssfltypename
+        from dj_workresourcelibrary dw
+        inner join dj_workresourcelibrarytype dwt on dw.FILETYPEID = dwt.FILETYPEID
+        left join cf_users cu on dw.CREATEUSERID = cu.USERID
+        left join cf_dictionary cd on cd.DICTYPEKEY='ssflType' and dw.ssfl = cd.DICKEY
+        where 1=1
+        <if test="fileName!=null and fileName!=''">
+            and dw.fileName like concat('%',#{fileName},'%')
+        </if>
+        <if test="typeIds!=null and typeIds.size()!=0">
+            and dw.FILETYPEID in
+            <foreach collection="typeIds" item="typeId"
+                     index="index" open="(" close=")" separator=",">
+                #{typeId}
+            </foreach>
+        </if>
+        order by dw.createdatetime desc
+    </select>
+</mapper>

+ 70 - 5
src/main/resources/mapping/DjWorkresourcelibraryMapper.xml

@@ -10,6 +10,10 @@
     <result column="FILETYPEID" jdbcType="VARCHAR" property="filetypeid" />
     <result column="FILECODE" jdbcType="VARCHAR" property="filecode" />
     <result column="FILECODE2" jdbcType="INTEGER" property="filecode2" />
+    <result column="ssfl" jdbcType="INTEGER" property="ssfl" />
+    <result column="CREATEUSERID" jdbcType="VARCHAR" property="createuserid" />
+    <result column="UPDATEDATETIME" jdbcType="TIMESTAMP" property="updatedatetime" />
+    <result column="UPDATEUSERID" jdbcType="VARCHAR" property="updateuserid" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <where>
@@ -70,7 +74,8 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    FILEID, FILENAME, FILEURL, EXTENDEDNAME, CREATEDATETIME, FILETYPEID, FILECODE, FILECODE2
+    FILEID, FILENAME, FILEURL, EXTENDEDNAME, CREATEDATETIME, FILETYPEID, FILECODE, FILECODE2, 
+    ssfl, CREATEUSERID, UPDATEDATETIME, UPDATEUSERID
   </sql>
   <select id="selectByExample" parameterType="com.ghsc.partybuild.model.DjWorkresourcelibraryExample" resultMap="BaseResultMap">
     select
@@ -105,10 +110,14 @@
   <insert id="insert" parameterType="com.ghsc.partybuild.model.DjWorkresourcelibrary">
     insert into dj_workresourcelibrary (FILEID, FILENAME, FILEURL, 
       EXTENDEDNAME, CREATEDATETIME, FILETYPEID, 
-      FILECODE, FILECODE2)
+      FILECODE, FILECODE2, ssfl, 
+      CREATEUSERID, UPDATEDATETIME, UPDATEUSERID
+      )
     values (#{fileid,jdbcType=VARCHAR}, #{filename,jdbcType=VARCHAR}, #{fileurl,jdbcType=VARCHAR}, 
       #{extendedname,jdbcType=VARCHAR}, #{createdatetime,jdbcType=TIMESTAMP}, #{filetypeid,jdbcType=VARCHAR}, 
-      #{filecode,jdbcType=VARCHAR}, #{filecode2,jdbcType=INTEGER})
+      #{filecode,jdbcType=VARCHAR}, #{filecode2,jdbcType=INTEGER}, #{ssfl,jdbcType=INTEGER}, 
+      #{createuserid,jdbcType=VARCHAR}, #{updatedatetime,jdbcType=TIMESTAMP}, #{updateuserid,jdbcType=VARCHAR}
+      )
   </insert>
   <insert id="insertSelective" parameterType="com.ghsc.partybuild.model.DjWorkresourcelibrary">
     insert into dj_workresourcelibrary
@@ -137,6 +146,18 @@
       <if test="filecode2 != null">
         FILECODE2,
       </if>
+      <if test="ssfl != null">
+        ssfl,
+      </if>
+      <if test="createuserid != null">
+        CREATEUSERID,
+      </if>
+      <if test="updatedatetime != null">
+        UPDATEDATETIME,
+      </if>
+      <if test="updateuserid != null">
+        UPDATEUSERID,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="fileid != null">
@@ -163,6 +184,18 @@
       <if test="filecode2 != null">
         #{filecode2,jdbcType=INTEGER},
       </if>
+      <if test="ssfl != null">
+        #{ssfl,jdbcType=INTEGER},
+      </if>
+      <if test="createuserid != null">
+        #{createuserid,jdbcType=VARCHAR},
+      </if>
+      <if test="updatedatetime != null">
+        #{updatedatetime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateuserid != null">
+        #{updateuserid,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.ghsc.partybuild.model.DjWorkresourcelibraryExample" resultType="java.lang.Long">
@@ -198,6 +231,18 @@
       <if test="record.filecode2 != null">
         FILECODE2 = #{record.filecode2,jdbcType=INTEGER},
       </if>
+      <if test="record.ssfl != null">
+        ssfl = #{record.ssfl,jdbcType=INTEGER},
+      </if>
+      <if test="record.createuserid != null">
+        CREATEUSERID = #{record.createuserid,jdbcType=VARCHAR},
+      </if>
+      <if test="record.updatedatetime != null">
+        UPDATEDATETIME = #{record.updatedatetime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.updateuserid != null">
+        UPDATEUSERID = #{record.updateuserid,jdbcType=VARCHAR},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -212,7 +257,11 @@
       CREATEDATETIME = #{record.createdatetime,jdbcType=TIMESTAMP},
       FILETYPEID = #{record.filetypeid,jdbcType=VARCHAR},
       FILECODE = #{record.filecode,jdbcType=VARCHAR},
-      FILECODE2 = #{record.filecode2,jdbcType=INTEGER}
+      FILECODE2 = #{record.filecode2,jdbcType=INTEGER},
+      ssfl = #{record.ssfl,jdbcType=INTEGER},
+      CREATEUSERID = #{record.createuserid,jdbcType=VARCHAR},
+      UPDATEDATETIME = #{record.updatedatetime,jdbcType=TIMESTAMP},
+      UPDATEUSERID = #{record.updateuserid,jdbcType=VARCHAR}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -241,6 +290,18 @@
       <if test="filecode2 != null">
         FILECODE2 = #{filecode2,jdbcType=INTEGER},
       </if>
+      <if test="ssfl != null">
+        ssfl = #{ssfl,jdbcType=INTEGER},
+      </if>
+      <if test="createuserid != null">
+        CREATEUSERID = #{createuserid,jdbcType=VARCHAR},
+      </if>
+      <if test="updatedatetime != null">
+        UPDATEDATETIME = #{updatedatetime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateuserid != null">
+        UPDATEUSERID = #{updateuserid,jdbcType=VARCHAR},
+      </if>
     </set>
     where FILEID = #{fileid,jdbcType=VARCHAR}
   </update>
@@ -252,7 +313,11 @@
       CREATEDATETIME = #{createdatetime,jdbcType=TIMESTAMP},
       FILETYPEID = #{filetypeid,jdbcType=VARCHAR},
       FILECODE = #{filecode,jdbcType=VARCHAR},
-      FILECODE2 = #{filecode2,jdbcType=INTEGER}
+      FILECODE2 = #{filecode2,jdbcType=INTEGER},
+      ssfl = #{ssfl,jdbcType=INTEGER},
+      CREATEUSERID = #{createuserid,jdbcType=VARCHAR},
+      UPDATEDATETIME = #{updatedatetime,jdbcType=TIMESTAMP},
+      UPDATEUSERID = #{updateuserid,jdbcType=VARCHAR}
     where FILEID = #{fileid,jdbcType=VARCHAR}
   </update>
 </mapper>

+ 51 - 28
src/main/resources/static/app/main/partyUser/workResourceLibrary/fileEdit.html

@@ -21,23 +21,23 @@
                             </div>
                         </div>
                     </div>
-                    <div class="row clearfix">
-                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 form-control-label">
-                            <label>编号</label>
-                        </div>
-                        <div class="col-lg-8 col-md-8 col-sm-8 col-xs-8">
-                            <div class="form-group">
-                                <div class="form-line"
-                                     ng-class="{ 'focused error' : dicform.filecode.$invalid &&  dicform.$submitted}">
-                                    <input type="text" name="filecode" ng-model="content.filecode" maxlength="100"
-                                           class="form-control"
-                                           ng-required="true"/>
-                                </div>
-                                <label ng-show="dicform.filecode.$invalid &&  dicform.$submitted"
-                                       class="error">必填.</label>
-                            </div>
-                        </div>
-                    </div>
+<!--                    <div class="row clearfix">-->
+<!--                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 form-control-label">-->
+<!--                            <label>编号</label>-->
+<!--                        </div>-->
+<!--                        <div class="col-lg-8 col-md-8 col-sm-8 col-xs-8">-->
+<!--                            <div class="form-group">-->
+<!--                                <div class="form-line"-->
+<!--                                     ng-class="{ 'focused error' : dicform.filecode.$invalid &&  dicform.$submitted}">-->
+<!--                                    <input type="text" name="filecode" ng-model="content.filecode" maxlength="100"-->
+<!--                                           class="form-control"-->
+<!--                                           ng-required="true"/>-->
+<!--                                </div>-->
+<!--                                <label ng-show="dicform.filecode.$invalid &&  dicform.$submitted"-->
+<!--                                       class="error">必填.</label>-->
+<!--                            </div>-->
+<!--                        </div>-->
+<!--                    </div>-->
                     <div class="row clearfix">
                         <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 form-control-label">
                             <label>文件名称</label>
@@ -56,37 +56,61 @@
                     </div>
                     <div class="row clearfix">
                         <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 form-control-label">
-                            <label>排序</label>
+                            <label>所属分类</label>
                         </div>
                         <div class="col-lg-8 col-md-8 col-sm-8 col-xs-8">
                             <div class="form-group">
                                 <div class="form-line"
-                                     ng-class="{ 'focused error' : dicform.filecode2.$invalid &&  dicform.$submitted}">
-                                    <input type="number" name="filecode2" ng-model="content.filecode2" maxlength="100"
-                                           class="form-control"
-                                           ng-required="true"/>
+                                     ng-class="{ 'focused error' : dicform.ssfl.$invalid &&  dicform.$submitted}">
+                                    <select name="ssfl" ng-model="content.ssfl" class="form-control"
+                                            ng-options="type.dickey as type.dicvalue for type in ssflTypeList"
+                                            ng-required="true">
+                                        <option value="">--全部--</option>
+                                    </select>
                                 </div>
-                                <label ng-show="dicform.filecode2.$invalid &&  dicform.$submitted"
+                                <label ng-show="dicform.ssfl.$invalid &&  dicform.$submitted"
                                        class="error">必填.</label>
                             </div>
                         </div>
                     </div>
+
+<!--                    <div class="row clearfix">-->
+<!--                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 form-control-label">-->
+<!--                            <label>排序</label>-->
+<!--                        </div>-->
+<!--                        <div class="col-lg-8 col-md-8 col-sm-8 col-xs-8">-->
+<!--                            <div class="form-group">-->
+<!--                                <div class="form-line"-->
+<!--                                     ng-class="{ 'focused error' : dicform.filecode2.$invalid &&  dicform.$submitted}">-->
+<!--                                    <input type="number" name="filecode2" ng-model="content.filecode2" maxlength="100"-->
+<!--                                           class="form-control"-->
+<!--                                           ng-required="true"/>-->
+<!--                                </div>-->
+<!--                                <label ng-show="dicform.filecode2.$invalid &&  dicform.$submitted"-->
+<!--                                       class="error">必填.</label>-->
+<!--                            </div>-->
+<!--                        </div>-->
+<!--                    </div>-->
                     <div class="row clearfix">
                         <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 form-control-label">
                             <label>文件</label>
                         </div>
-                        <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
+                        <div class="col-lg-9 col-md-9 col-sm-9 col-xs-9">
                             <!--singlefile glyphicon  glyphicon-upload data-id="content.fileid" data-fileid="fid" data-readonly="false" data-typeparams="{types:['pdf'],errormsg:'只允许上传pdf'}"></singlefile-->
                             <input size="60" class="file" type="file" ngf-select ng-model="content.file" name="file"
                                    ngf-max-size="20MB" ng-change="valiFileType()">
                         </div>
-                        <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
-                            <a class="btn glyphicon glyphicon-upload" ng-hide="updata.updated" ng-click="upfile()"></a>
+                    </div>
+                    <div class="row clearfix">
+                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 form-control-label">
+                        </div>
+                        <div class="col-lg-9 col-md-9 col-sm-9 col-xs-9" style="display: flex;">
+<!--                            <a class="btn glyphicon glyphicon-upload" ng-hide="updata.updated" ng-click="upfile()">点击上传</a>-->
+                            <a class="btn glyphicon glyphicon-picture" ng-if="content.fileurl || updata.updated" ng-click="viewFile(content.fileid,content.filename)">点击查看</a>
                         </div>
                     </div>
                     <div class="row clearfix">
                         <div class="col-lg-7 col-md-7 col-sm-7 col-xs-7">
-
                             <div ng-show="updata.isuping" class="progress">
                                 <div class="progress-bar" role="progressbar" aria-valuenow="{{updata.progressPer}}"
                                      aria-valuemin="0" aria-valuemax="100" ng-style="{width:updata.progressPer+'%'}"
@@ -94,7 +118,6 @@
                                     {{updata.progressPer}}%
                                 </div>
                             </div>
-
                         </div>
                         <div class="col-lg-5 col-md-5 col-sm-5 col-xs-5 foot-btn">
                             <button type="button" class="btn btn-default" ng-click="$hide()">取消</button>

+ 116 - 182
src/main/resources/static/app/main/partyUser/workResourceLibrary/fileTabList.js

@@ -5,6 +5,7 @@
         $scope.selectTabId = '';
         $scope.fileList = [];
         $scope.treeList = [];
+        $scope.ssflTypeList = [];
 
         $stateParams = $bsRouterState.$params($scope);
 
@@ -16,6 +17,20 @@
             ptotal: 0
         };
 
+        $scope.loadSsflTypes=function(){
+
+            $http({
+                method: 'get',
+                url: '../../api/dictionary/getDictionaryListByDicTypeKey',
+                params: {dicTypeKey: 'ssflType'}
+            }).then(function (result) {
+                $scope.ssflTypeList = result.data;
+            }, function (resp) {
+
+            });
+        };
+        $scope.loadSsflTypes();
+
         $scope.selectData.fileName = $stateParams.fileName;
 
         $scope.GetNavData = function () {
@@ -33,7 +48,7 @@
 
                 });
                 //添加
-                if ($scope.selectData.fileName != null){
+                if ($scope.selectData.fileName){
                     $scope.FindWord();
                 }else{
                     $scope.clickTreeChild($scope.navList[0]);
@@ -86,7 +101,6 @@
             $scope.selectData.pageindex = 1;
             $scope.selectData.filetypeid=item.id;
             $scope.selectData.filetypename=item.name;
-
             $scope.selectData.fileName = '';
 
             if(!item.children){
@@ -105,7 +119,7 @@
 
         $scope.FindWord = function () {
 
-            if ($scope.selectData.fileName.length > 0) {
+            if ($scope.selectData.fileName){
                 //$window.open('http://10.160.8.64:8080/es/search.do?keyWords=' + decodeURI($scope.selectKey));
                 //$bsRouterState.go('home.fileFrame', {keyWords: $scope.selectKey});
                 $http({
@@ -121,7 +135,7 @@
                     //$loading.hide();
                 });
             } else {
-                $alert({title: '提示:', content: '请输入关键字!', placement: 'top', type: 'info', show: true, duration: 3});
+                $scope.showMsg("提示", "请输入关键字!", '');
             }
 
         }
@@ -175,7 +189,7 @@
         //监视页数变化
         $scope.$watch("selectData.pageindex", function (newVal, oldVal) {
             if ($scope.selectData.ptotal > 0) {
-                if ($scope.selectData.fileName != null && $scope.selectData.fileName != ''){
+                if ($scope.selectData.fileName){
                     $scope.FindWord();
                 }else {
                     $scope.loadData();
@@ -248,15 +262,7 @@
                     var loc = filename.lastIndexOf('.');
                     var filetype = filename.substring(loc + 1, filename.length).toLowerCase();
                     if(filetype!='pdf'){
-                        $alert({
-                            title: '消息',
-                            content: "只允许上传pdf",
-                            placement: 'top',
-                            type: 'info',
-                            show: true,
-                            duration: 3,
-                            container: '#dicmodal'
-                        });
+                        $scope.showMsg("消息", "只允许上传pdf", "#dicmodal");
 
                         $scope.content.file=null;
                     }
@@ -266,93 +272,48 @@
 
             };
 
-            $scope.upfile=function(){
+            $scope.submit = function (isflag) {
+                if(!$scope.content.file){
+                    $scope.showMsg("消息", "请选择上传文件", '');
+                    return;
+                }
+
                 $scope.updata.isuping=true;
                 Upload.upload({
                     url: '../../api/workresourcelibrary/postFile',
                     data: {file: $scope.content.file, 'fileId': $scope.content.fileid}
                 }).then(function (resp) {
                     if (resp.data.success) {
-                        $alert({
-                            title: '消息',
-                            content: resp.data.msg,
-                            placement: 'top',
-                            type: 'info',
-                            show: true,
-                            duration: 3
-                        });
-                        //fileObject.loadItems(fileObject.fileoption);
-                        //$scope.updata.progressPer=100;
                         $scope.updata.isuping=false;
                         $scope.updata.updated=true;
 
+                        if (isflag) {
+                            $loading.show();
+                            $http({
+                                method: "post",
+                                url: "../../api/workresourcelibrary/saveFile",
+                                data: $scope.content
+                            }).then(function (result) {
+                                $loading.hide();
+                                $scope.showMsg("成功", result.data.msg, '');
+                                //重新刷新列表
+                                $scope.loadData();
+                                $scope.$hide();
+
+                            }), function (resp) {
+                                $scope.showMsg("错误", "服务器错误", '');
+                            }
+                        }
                     } else {
                         $scope.updata.progressPer=0;
-                        $alert({
-                            title: '消息',
-                            content: resp.data.msg,
-                            placement: 'top',
-                            type: 'info',
-                            show: true,
-                            duration: 3
-                        });
-
+                        $scope.showMsg("消息", resp.data.msg, '');
                     }
-                    //console.log('Success ' + resp.config.data.file.name + 'uploaded. Response: ' + resp.data);
                 }, function (resp) {
                     $scope.updata.updated=false;
-                    $alert({title: '错误', content: "上传服务器错误!", placement: 'center', type: 'info', show: true, duration: 3});
-                    //$scope.updata.progressPer=0;
-
+                    $scope.showMsg("错误", "上传服务器错误", '');
                 }, function (evt) {
                     $scope.updata.progressPer = parseInt(100.0 * evt.loaded / evt.total);
-                    //console.log('progress: ' + progressPercentage + '% ' + evt.config.data.file.name);
                 });
-            };
-
-            $scope.submit = function (isflag) {
-                if (isflag) {
-                    if(!$scope.updata.updated){
-                        $alert({
-                            title: '提示:',
-                            content: '请上传文件',
-                            placement: 'top',
-                            type: 'info',
-                            show: true,
-                            duration: 3
-                        });
-                        return;
-                    }
-                    $loading.show();
-                    $http({
-                        method: "post",
-                        url: "../../api/workresourcelibrary/saveFile",
-                        data: $scope.content
-                    }).then(function (result) {
-                        $loading.hide();
-                        $alert({
-                            title: '成功:',
-                            content: result.data.msg,
-                            placement: 'top',
-                            type: 'info',
-                            show: true,
-                            duration: 3
-                        });
-                        //重新刷新列表
-                        $scope.loadData();
-                        $scope.$hide();
-
-                    }), function (resp) {
-                        $alert({
-                            title: '错误:',
-                            content: '服务器错误',
-                            placement: 'top',
-                            type: 'info',
-                            show: true,
-                            duration: 3
-                        });
-                    }
-                }
             }
         };
         savemodalCtrl.$inject = ['$scope', '$http','Upload','$alert'];
@@ -394,13 +355,14 @@
             $loading.show();
         };
 
-        $scope.importFile = function () {
-            console.log("importFile");
-        }
-
         $scope.exportFile = function () {
-            console.log("exportFile");
-        }
+            var params = "?1=1";
+            for (var p in $scope.selectData) {
+                if ($scope.selectData[p] !== '' && $scope.selectData[p] !== null)
+                    params += ("&" + p + "=" + encodeURI($scope.selectData[p]));
+            }
+            window.open('../../api/workresourcelibrary/export' + params);
+        };
 
         $scope.getFileById = function (id) {
             $http.get("../../api/workresourcelibrary/getFile", {params: {'fileId': id}}).then(function (result) {
@@ -410,7 +372,7 @@
                 workModal.params.content.filetypename=$scope.selectData.filetypename;
                 workModal.$promise.then(workModal.show);
             }, function () {
-                $alert({title: '错误:', content: '服务器错误', placement: 'top', type: 'info', show: true, duration: 3});
+                $scope.showMsg("错误", "服务器错误", '');
             });
         };
 
@@ -421,7 +383,7 @@
                     method: 'GET',
                     params: {fileId: id}
                 }).then(function (result) {
-                    $scope.showMsg("消息", result.data.msg);
+                    $scope.showMsg("消息", result.data.msg, '');
                     if (result.data.success) {
                         $scope.loadData();
                     }
@@ -430,22 +392,22 @@
         };
 
         var fileTypeModalController = function ($scope, $http) {
-
             $scope.edit = {
                 filetypeparentname: "",
-                filetypeparentid: "",
-                treecurrentfiletypeid :'',
-                treefiletypeparentname :'',
-                treefiletypeparentid :''
+                filetypeparentid: ""
             };
             $scope.title = "模板分类信息";
             $scope.fileTypeModel = angular.copy($scope.currentFileType);
             $scope.edit.filetypeparentid = $scope.fileTypeModel.parenttypeid;
-            $scope.selectfileTypeParent = function () {
+            $scope.selectFileTypeParent = function () {
                 if ($scope.selectParentShow) {
                     myselectModal.$promise.then(myselectModal.show);
                 }
+            };
 
+            $scope.clearFileTypeParent = function () {
+                $scope.edit.filetypeparentname = '模板分类';
+                $scope.edit.filetypeparentid = '';
             };
 
             //获取原父级菜单
@@ -492,61 +454,32 @@
                 });
             };
             $scope.selectTreeFileTypeItem = function (item) {
-                if ($scope.curMenuID != item.filetypeid) {
+                 if ($scope.edit.filetypeparentid != item.filetypeid) {
                     if (item.parentmoduleid != null) {
-                        $alert({
-                            title: '提示:',
-                            content: "只能选择一级模块",
-                            placement: 'top',
-                            type: 'info',
-                            show: true,
-                            duration: 3,
-                            container: "#selectParentMenu"
-                        });
-                        return;
+                        $scope.showMsg("提示", "只能选择一级模块", "#selectParentMenu");
+                        return false;
                     }
-                    $scope.edit.treefiletypeid = item.filetypeid;
-                    $scope.edit.treefiletypeparentname = item.filetypename;
-                    $scope.edit.treefiletypeparentid = item.filetypeid;
+                    $scope.edit.filetypeparentid = item.filetypeid;
+                    $scope.edit.filetypeparentname = item.filetypename;
                 }
             };
 
             //加载所有的父菜单记录
             var selecModalController = function ($scope, $http) {
-
-                //加载所有的父菜单记录
-                $scope.getMenus = function () {
-                    $.ajax({
-                        url: "../../api/workresourcelibrary/getFiletypeList",
-                        data: {
-                            pageindex: 1,
-                            pagesize: 999
-                        },
-                        type: 'get',
-                        contentType: 'application/json',
-                        success: function (res) {
-                            $scope.$apply(function () {
-                                $scope.selectMenus = res.item.list;
-                            })
-                        },
-                        error: function (res) {
-                            console.log(res);
-                        }
-                    });
-                };
                 //加载子菜单
-                $scope.loadChild = function (item) {
-
+                $scope.loadTreeChildFileType = function (item) {
+                    $scope.searchParam = "";//查询条件清空
                     if (!item.isExpand)//如果该节点未展开
                     {
                         item.isExpand = true;
-                        $scope.getMenuByPID(item);
+                        $scope.getFileTypeByParentID(item);
                     } else {
                         item.isExpand = false;
                     }
                 };
+
                 //根据当前项的menuID找到其所有的子菜单
-                $scope.getMenuByPID = function (item) {
+                $scope.getFileTypeByParentID = function (item) {
                     $http.get("../../api/workresourcelibrary/getFiletypeList", {
                         params: {
                             'parentId': item.filetypeid,
@@ -554,55 +487,48 @@
                             pagesize: 999
                         }
                     }).then(function (result) {
-                        item.childs = result.data.item.list;
+                        item.childMenus = result.data.item.list;
 
-                    }, function (result) {
+                    }, function (reason) {
                         console.log("无匹配项");
                     });
                 };
-                $scope.getMenus();
 
-                $scope.changeChoose = function (item) {
-                    if ($scope.curMenuID != item.filetypeid) {
+                $scope.selectTreeFileTypeItem = function (item) {
+                    if ($scope.edit.filetypeparentid != item.filetypeid) {
                         if (item.parentmoduleid != null) {
-                            $alert({
-                                title: '提示:',
-                                content: "只能选择一级模块",
-                                placement: 'top',
-                                type: 'info',
-                                show: true,
-                                duration: 3,
-                                container: "#selectfileTypeParentMenu"
-                            });
-                            return;
+                            $scope.showMsg("提示", "只能选择一级模块", "#selectParentMenu");
+                            return false;
                         }
-                        $scope.curMenuID = item.filetypeid;
-                        $scope.Finalfiletypeparentname = item.filetypename;
-                        $scope.Finalfiletypeparentid = item.filetypeid;
+                        $scope.edit.filetypeparentid = item.filetypeid;
+                        $scope.edit.filetypeparentname = item.filetypename;
                     }
                 };
 
-                $scope.choose = function () {
-                    if ($scope.Finalfiletypeparentid != null) {
-                        $scope.edit.filetypeparentname = $scope.Finalfiletypeparentname;
-                        $scope.edit.parenttypeid = $scope.Finalfiletypeparentid;
-                        myselectModal.$promise.then(myselectModal.hide);
-                    } else {
-                        $alert({
-                            title: '提示:',
-                            content: "未选择有效的父级模块",
-                            placement: 'top',
-                            type: 'info',
-                            show: true,
-                            duration: 3,
-                            container: "#selectfileTypeParentMenu"
-                        });
-
-                    }
-
+                $scope.loadFiletypeList = function () {
+                    $.ajax({
+                        url: "../../api/workresourcelibrary/getFiletypeList",
+                        data: {
+                            pageindex: 1,
+                            pagesize: 999
+                        },
+                        type: 'get',
+                        contentType: 'application/json',
+                        success: function (res) {
+                            $scope.$apply(function () {
+                                $scope.selectMenus = res.item.list;
+                            })
+                        },
+                        error: function (res) {
+                            console.log(res);
+                        }
+                    });
                 };
+                $scope.loadFiletypeList();
 
-
+                $scope.choose = function () {
+                    myselectModal.$promise.then(myselectModal.hide);
+                };
             };
             selecModalController.$inject = ['$scope', '$http'];
             var myselectModal = $modal({
@@ -621,7 +547,7 @@
             });
             //保存菜单项
             $scope.saveFileType = function () {
-                $scope.fileTypeModel.parenttypeid = $scope.edit.parenttypeid;
+                $scope.fileTypeModel.parenttypeid = $scope.edit.filetypeparentid;
                 $.ajax({
                     url: "../../api/workresourcelibrary/saveFiletype",
                     data: JSON.stringify($scope.fileTypeModel),
@@ -629,9 +555,9 @@
                     contentType: 'application/json',
                     success: function (res) {
                         $scope.$apply(function () {
-                            $scope.getMenuList();
+                            $scope.GetNavData();
                             fileTypeModal.$promise.then(fileTypeModal.hide);
-                            $scope.showalert(res.msg);
+                            $scope.showMsg("提示", res.msg, '');
                         })
                     },
                     error: function (res) {
@@ -675,16 +601,24 @@
             }
             $http.get("../../api/workresourcelibrary/deleteFiletype",
                 {params: {'typeid': $scope.currentFileType.filetypeid}}).then(function (result) {
-                // $scope.getMenuList();
-                $scope.showalert(result.data.msg);
+                $scope.GetNavData();
+                $scope.showMsg("提示", result.data.msg, '');
             }, function () {
                 console.log("无匹配项");
             });
         };
 
-        //提示函数
-        $scope.showalert = function (data) {
-            $alert({title: '提示:', content: data, placement: 'top', type: 'info', show: true, duration: 3});
+        $scope.showMsg = function (title, content, container) {
+            $alert({
+                title: title + ':',
+                content: content,
+                placement: 'top',
+                type: 'info',
+                show: true,
+                duration: 3,
+                container: container
+            });
+
         };
 
     }).controller('fileViewCtrl', function ($scope, $http) {

+ 10 - 9
src/main/resources/static/app/main/partyUser/workResourceLibrary/fileTreeList.html

@@ -64,9 +64,6 @@
                                             <button role-permission-code="workResourceLibraryList.btnAdd" class="btn btn-default1"
                                                     ng-click="addFile()">新增
                                             </button>
-                                            <button role-permission-code="workResourceLibraryList.btnImport" class="btn btn-default1"
-                                                    ng-click="importFile()">导入
-                                            </button>
                                             <button role-permission-code="workResourceLibraryList.btnExport" class="btn btn-default1"
                                                     ng-click="exportFile()">导出
                                             </button>
@@ -75,17 +72,21 @@
                                     <table class="table table-bordered table-striped table-hover js-basic-example dataTable table-text-clip">
                                         <thead>
                                         <tr>
-                                            <th class="col-md-1">制度编号</th>
-                                            <th class="col-md-7">文件名称</th>
-                                            <th class="col-md-2">排序</th>
-                                            <th class="col-md-2">操作</th>
+                                            <th class="th-rownum"><div>序号</div></th>
+                                            <th>文件名称</th>
+                                            <th>所属分类</th>
+                                            <th>上传人</th>
+                                            <th>最近修改时间</th>
+                                            <th>操作</th>
                                         </tr>
                                         </thead>
                                         <tbody>
                                         <tr ng-repeat="f in fileList">
-                                            <td class="text-center">{{f.filecode}}</td>
+                                            <td class="text-center" td-rownum index="$index" pageindex="selectData.pageindex" pagesize="selectData.pagesize"></td>
                                             <td class="td_long_content" title="{{ f.filename}}"><a href="javascript:void(0)" ng-click="viewFile(f.fileid,f.filename)">{{ f.filename}}</a></td>
-                                            <td class="text-center">{{f.filecode2}}</td>
+                                            <td class="text-center">{{f.ssfltypename}}</td>
+                                            <td class="text-center">{{f.username}}</td>
+                                            <td class="text-center">{{f.updatedatetime|date:'yyyy-MM-dd'}}</td>
                                             <td class="text-center">
                                                 <button class="btn td-btn bg-light-first waves-effect" title="查看"
                                                         data-placement="center" data-animation="am-fade-and-scale"

+ 5 - 1
src/main/resources/static/app/main/partyUser/workResourceLibrary/filetype/edit.html

@@ -21,9 +21,13 @@
                                         <input name="filetypeparentname" type="text" ng-model="edit.filetypeparentname"
                                                class="form-control" ng-required="true" ng-disabled="true"/>
                                     </div>
-                                    <span class="input-group-addon" ng-click="selectfileTypeParent()">
+                                    <span class="input-group-addon" ng-click="selectFileTypeParent()">
                                             <i class="material-icons">search</i>
                                     </span>
+                                    <span class="input-group-addon"
+                                          ng-click="clearFileTypeParent();">
+                                                <i class="material-icons small">clear</i>
+                                    </span>
                                 </div>
                                 <label ng-show="editFileTypeForm.filetypeparentname.$invalid &&  editFileTypeForm.$submitted"
                                        class="error">必填.</label>

+ 3 - 3
src/main/resources/static/app/main/partyUser/workResourceLibrary/filetype/selectParent.html

@@ -10,11 +10,11 @@
                     <span>
                         <a ng-if="item.childcount>0" class="glyphicon {{item.isExpand ? 'glyphicon-chevron-down' : 'glyphicon-chevron-right'}}"
                            ng-click="loadTreeChildFileType(item)"></a>
-                        <span class="ModulesSpan" ng-class="depSelected:item.filetypeid==edit.treefiletypeid?'party_active':'' "
+                        <span class="ModulesSpan" ng-class="item.filetypeid==edit.filetypeparentid?'party_active':'' "
                               style="cursor: pointer;" ng-click="selectTreeFileTypeItem(item)">{{item.filetypename}}</span>
                     </span>
                     <div ng-hide="!item.isExpand">
-                        <div class="treeitem" ng-repeat="item in item.childs" ng-include="'treeFiletypeItem.html'"
+                        <div class="treeitem" ng-repeat="item in item.childMenus" ng-include="'treeFiletypeItem.html'"
                              style="cursor: pointer; margin-top:2px"></div>
                     </div>
                 </script>
@@ -22,7 +22,7 @@
                     <div class="panel-heading">
                         <div style="display:inline-block;">
                             <label>所选择的父目录为:</label>
-                            <span>{{edit.treefiletypeparentname}}</span>
+                            <span>{{edit.filetypeparentname}}</span>
                         </div>
                     </div>
                     <div class="panel-body">