bc_zhang 4 years ago
parent
commit
fd131e425b
42 changed files with 537 additions and 176 deletions
  1. 20 4
      src/main/java/com/zglc/fm/controller/BookController.java
  2. 20 0
      src/main/java/com/zglc/fm/controller/CardController.java
  3. 39 4
      src/main/java/com/zglc/fm/controller/CommonController.java
  4. 35 3
      src/main/java/com/zglc/fm/controller/FaultController.java
  5. 10 0
      src/main/java/com/zglc/fm/controller/ManuelController.java
  6. 10 0
      src/main/java/com/zglc/fm/controller/OutlineController.java
  7. 5 0
      src/main/java/com/zglc/fm/dao/master/BookDao.java
  8. 5 0
      src/main/java/com/zglc/fm/dao/master/CardDao.java
  9. 16 3
      src/main/java/com/zglc/fm/dao/master/FaultDao.java
  10. 2 0
      src/main/java/com/zglc/fm/dao/master/ManuelDao.java
  11. 4 0
      src/main/java/com/zglc/fm/dao/master/OutlineDao.java
  12. 6 6
      src/main/java/com/zglc/fm/entity/FaultFind.java
  13. 15 0
      src/main/java/com/zglc/fm/entity/StaEntity.java
  14. 11 0
      src/main/java/com/zglc/fm/entity/aircraftStaEntity.java
  15. 17 0
      src/main/java/com/zglc/fm/service/BookService.java
  16. 14 0
      src/main/java/com/zglc/fm/service/CardService.java
  17. 47 5
      src/main/java/com/zglc/fm/service/FaultService.java
  18. 11 0
      src/main/java/com/zglc/fm/service/ManuelService.java
  19. 10 0
      src/main/java/com/zglc/fm/service/OutlineService.java
  20. 10 1
      src/main/resources/mapping/master/BookDao.xml
  21. 11 1
      src/main/resources/mapping/master/CardDao.xml
  22. 55 1
      src/main/resources/mapping/master/FaultDao.xml
  23. 7 1
      src/main/resources/mapping/master/ManuelDao.xml
  24. 7 1
      src/main/resources/mapping/master/OutlineDao.xml
  25. 17 12
      src/main/resources/static/Ordinary/department-edit.html
  26. 20 4
      src/main/resources/static/Ordinary/department.html
  27. 3 0
      src/main/resources/static/Ordinary/index-list.html
  28. 2 36
      src/main/resources/static/Ordinary/js/book-add.js
  29. 7 4
      src/main/resources/static/Ordinary/js/book.js
  30. 16 26
      src/main/resources/static/Ordinary/js/department.js
  31. 48 38
      src/main/resources/static/Ordinary/js/departmentEdit.js
  32. 0 2
      src/main/resources/static/Ordinary/js/faultSee.js
  33. 10 7
      src/main/resources/static/admin/Ubooktext.html
  34. 1 0
      src/main/resources/static/admin/UcardSee.html
  35. 1 0
      src/main/resources/static/admin/UfaultSee.html
  36. 15 8
      src/main/resources/static/admin/Umanuel-edit.html
  37. 1 0
      src/main/resources/static/admin/Uoutline-edit.html
  38. 3 1
      src/main/resources/static/admin/js/Ubook.js
  39. 1 1
      src/main/resources/static/admin/js/Ucard-edit.js
  40. 1 3
      src/main/resources/static/admin/js/second.js
  41. 1 1
      src/main/resources/static/admin/second.html
  42. 3 3
      src/main/resources/static/other/js/functions.js

+ 20 - 4
src/main/java/com/zglc/fm/controller/BookController.java

@@ -4,10 +4,7 @@ package com.zglc.fm.controller;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.zglc.fm.base.Result;
-import com.zglc.fm.entity.CatalogueEntity;
-import com.zglc.fm.entity.DeleteEntity;
-import com.zglc.fm.entity.BookEntity;
-import com.zglc.fm.entity.FaultEntity;
+import com.zglc.fm.entity.*;
 import com.zglc.fm.service.FaultService;
 import com.zglc.fm.service.BookService;
 import io.swagger.annotations.Api;
@@ -249,4 +246,23 @@ public class BookController {
         return Result.success(new PageInfo<>(bookService.findByKeyword(major,keyword,type)));
     }
 
+    @ApiOperation("教材按机型统计")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("aircraftSta")
+    public Result<List<aircraftStaEntity>> aircraftSta() {
+        return Result.success(bookService.aircraftSta());
+    }
+
+    @ApiOperation("按机型分页列出")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("listByAircraft")
+    public Result<PageInfo<BookEntity>> listByAircraft(@RequestParam String aircraftType,Integer page, Integer size) {
+        PageHelper.startPage(page, size, "id desc");
+        return Result.success(new PageInfo<>( bookService.listByAircraft(aircraftType)));
+    }
+
 }

+ 20 - 0
src/main/java/com/zglc/fm/controller/CardController.java

@@ -6,6 +6,7 @@ import com.github.pagehelper.PageInfo;
 import com.zglc.fm.base.Result;
 import com.zglc.fm.entity.DeleteEntity;
 import com.zglc.fm.entity.CardEntity;
+import com.zglc.fm.entity.aircraftStaEntity;
 import com.zglc.fm.service.CardService;
 import com.zglc.fm.utils.DocToPdf;
 import com.zglc.fm.utils.FileTool;
@@ -176,4 +177,23 @@ public class CardController {
         return Result.success(new PageInfo<>(cardService.findByKeyword(major,keyword,type)));
     }
 
+    @ApiOperation("卡片按机型统计")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("aircraftSta")
+    public Result<List<aircraftStaEntity>> aircraftSta() {
+        return Result.success(cardService.aircraftSta());
+    }
+
+    @ApiOperation("按机型分页列出")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("listByAircraft")
+    public Result<PageInfo<CardEntity>> listByAircraft(@RequestParam String aircraftType,Integer page, Integer size) {
+        PageHelper.startPage(page, size, "id desc");
+        return Result.success(new PageInfo<>( cardService.listByAircraft(aircraftType)));
+    }
+
 }

+ 39 - 4
src/main/java/com/zglc/fm/controller/CommonController.java

@@ -4,9 +4,9 @@ import com.zglc.fm.anno.PassToken;
 import com.zglc.fm.base.Result;
 import com.zglc.fm.constant.ErrorCode;
 import com.zglc.fm.entity.LoginVO;
+import com.zglc.fm.entity.StaEntity;
 import com.zglc.fm.entity.UserEntity;
-import com.zglc.fm.service.CommonService;
-import com.zglc.fm.service.UserService;
+import com.zglc.fm.service.*;
 import com.zglc.fm.utils.TokenTool;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -18,7 +18,6 @@ import org.springframework.web.bind.annotation.*;
 import javax.annotation.Resource;
 
 import org.springframework.beans.factory.annotation.Autowired;
-import java.util.Map;
 
 /**
  * 通用接口
@@ -38,13 +37,24 @@ public class CommonController {
 
     @Resource
     private final UserService userService;
+    private final FaultService faultService;
+    private final BookService bookService;
+    private final ManuelService manuelService;
+    private final OutlineService outlineService;
+    private final CardService cardService;
+
 
     @Autowired
     private CommonService commonService;
 
-    public CommonController(UserService userService){
+    public CommonController(UserService userService, FaultService faultService, BookService bookService, ManuelService manuelService, OutlineService outlineService, CardService cardService){
 
         this.userService = userService;
+        this.faultService = faultService;
+        this.bookService = bookService;
+        this.manuelService = manuelService;
+        this.outlineService = outlineService;
+        this.cardService = cardService;
     }
 
     @ApiOperation("服务器状态检测")
@@ -100,5 +110,30 @@ public class CommonController {
 //        return commonService.find(keyword, type);
 //    }
 
+    @ApiOperation("综合统计")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("comprehensiveSta")
+    public Result<StaEntity> comprehensiveSta(String aircratType)
+    {
+        StaEntity staEntity = new StaEntity();
+        if (aircratType==null || "".equals(aircratType)){
+            staEntity.setFaultNo(faultService.getCount());
+            staEntity.setBookNo(bookService.getCount());
+            staEntity.setCardNo(cardService.getCount());
+            staEntity.setManuelNo(manuelService.getCount());
+            staEntity.setOutlineNo(outlineService.getCount());
+        }else {
+            staEntity.setFaultNo(faultService.getCountByAircaft(aircratType));
+            staEntity.setOutlineNo(outlineService.getCountByAircaft(aircratType));
+            staEntity.setCardNo(cardService.getCountByAircaft(aircratType));
+            staEntity.setManuelNo(manuelService.getCountByAircaft(aircratType));
+            staEntity.setBookNo(bookService.getCountByAircaft(aircratType));
+        }
+
+        return  Result.success(staEntity);
+    }
+
 
 }

+ 35 - 3
src/main/java/com/zglc/fm/controller/FaultController.java

@@ -6,6 +6,8 @@ import com.github.pagehelper.PageInfo;
 import com.zglc.fm.base.Result;
 import com.zglc.fm.entity.DeleteEntity;
 import com.zglc.fm.entity.FaultEntity;
+import com.zglc.fm.entity.FaultFind;
+import com.zglc.fm.entity.aircraftStaEntity;
 import com.zglc.fm.service.FaultService;
 import com.zglc.fm.utils.DocToPdf;
 import com.zglc.fm.utils.FileTool;
@@ -100,6 +102,15 @@ public class FaultController {
         return Result.success(faultService.listAll());
     }
 
+    @ApiOperation("故障案例按机型统计")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("aircraftSta")
+    public Result<List<aircraftStaEntity>> aircraftSta() {
+        return Result.success(faultService.aircraftSta());
+    }
+
     @ApiOperation("ID查找")
     @ApiResponses({
             @ApiResponse(code = 0, message = "成功")
@@ -166,6 +177,16 @@ public class FaultController {
         return Result.success(new PageInfo<>( faultService.listByMajor(majorType)));
     }
 
+    @ApiOperation("按机型分页列出")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("listByAircraft")
+    public Result<PageInfo<FaultEntity>> listByAircraft(@RequestParam String aircraftType,Integer page, Integer size) {
+        PageHelper.startPage(page, size, "id desc");
+        return Result.success(new PageInfo<>( faultService.listByAircraft(aircraftType)));
+    }
+
     @ApiOperation("分页列出未标引")
     @ApiResponses({
             @ApiResponse(code = 0, message = "成功")
@@ -210,10 +231,21 @@ public class FaultController {
     @ApiResponses({
             @ApiResponse(code = 0, message = "成功")
     })
-    @GetMapping("getByKeyword")
-    public Result<PageInfo<FaultEntity>> getByKeyword(@RequestParam("major") String major,@RequestParam("keyword") String keyword,@RequestParam("type") Integer type,Integer page, Integer size){
+    @PostMapping("getByKeyword")
+    public Result<PageInfo<FaultEntity>> getByKeyword(@RequestBody FaultFind faultFind,Integer page, Integer size){
         PageHelper.startPage(page, size, "id desc");
-        return Result.success(new PageInfo<>(faultService.findByKeyword(major,keyword,type)));
+        return Result.success(new PageInfo<>(faultService.findByKeyword(faultFind)));
     }
 
+    @ApiOperation("故障案例按专业搜索案例名")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("searchByMajorKeyword")
+    public Result<PageInfo<FaultEntity>> searchByMajorKeyword(@RequestParam Integer type,@RequestParam String keyword,String major,Integer page, Integer size){
+        PageHelper.startPage(page, size, "id desc");
+        return Result.success(new PageInfo<>(faultService.searchByMajorKeyword(type,keyword,major)));
+    }
+
+
 }

+ 10 - 0
src/main/java/com/zglc/fm/controller/ManuelController.java

@@ -158,4 +158,14 @@ public class ManuelController {
         return Result.success(new PageInfo<>(manuelService.findByKeyword(major,keyword,type)));
     }
 
+    @ApiOperation("按机型分页列出")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("listByAircraft")
+    public Result<PageInfo<ManuelEntity>> listByAircraft(@RequestParam String aircraftType,Integer page, Integer size) {
+        PageHelper.startPage(page, size, "id desc");
+        return Result.success(new PageInfo<>( manuelService.listByAircraft(aircraftType)));
+    }
+
 }

+ 10 - 0
src/main/java/com/zglc/fm/controller/OutlineController.java

@@ -146,4 +146,14 @@ public class OutlineController {
         return Result.success(new PageInfo<>(outlineService.getAllOutline()));
     }
 
+    @ApiOperation("按机型分页列出")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("listByAircraft")
+    public Result<PageInfo<OutlineEntity>> listByAircraft(@RequestParam String aircraftType,Integer page, Integer size) {
+        PageHelper.startPage(page, size, "id desc");
+        return Result.success(new PageInfo<>( outlineService.listByAircraft(aircraftType)));
+    }
+
 }

+ 5 - 0
src/main/java/com/zglc/fm/dao/master/BookDao.java

@@ -1,6 +1,7 @@
 package com.zglc.fm.dao.master;
 
 import com.zglc.fm.entity.BookEntity;
+import com.zglc.fm.entity.aircraftStaEntity;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 import tk.mybatis.mapper.common.Mapper;
@@ -14,10 +15,14 @@ public interface BookDao extends Mapper<BookEntity> {
 
     Integer getCount();
 
+    Integer getCountByAircaft(@Param("aircraftType") String aircraftType);
+
     List<BookEntity> findByName(@Param("name") String name);
 
     List<BookEntity> findByMultiple(@Param("major") String major,@Param("name") String name);
     List<BookEntity> findByBookName(@Param("major") String major,@Param("name") String name);
     List<BookEntity> findByAuthor(@Param("major") String major,@Param("name") String name);
 
+    List<aircraftStaEntity> aircraftSta();
+
 }

+ 5 - 0
src/main/java/com/zglc/fm/dao/master/CardDao.java

@@ -1,6 +1,7 @@
 package com.zglc.fm.dao.master;
 
 import com.zglc.fm.entity.CardEntity;
+import com.zglc.fm.entity.aircraftStaEntity;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 import tk.mybatis.mapper.common.Mapper;
@@ -18,4 +19,8 @@ public interface CardDao extends Mapper<CardEntity> {
 
     List<CardEntity> findByCardName(@Param("major") String major,@Param("name") String name);
 
+    List<aircraftStaEntity> aircraftSta();
+
+    Integer getCountByAircaft(@Param("aircraftType") String aircraftType);
+
 }

+ 16 - 3
src/main/java/com/zglc/fm/dao/master/FaultDao.java

@@ -1,10 +1,14 @@
 package com.zglc.fm.dao.master;
 
 import com.zglc.fm.entity.FaultEntity;
+import com.zglc.fm.entity.FaultFind;
+import com.zglc.fm.entity.aircraftStaEntity;
+
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 import tk.mybatis.mapper.common.Mapper;
 
+import java.util.Date;
 import java.util.List;
 
 @Repository
@@ -14,9 +18,18 @@ public interface FaultDao extends Mapper<FaultEntity> {
 
     Integer getCount();
 
+    Integer getCountByAircaft(@Param("aircraftType") String aircraftType);
+
+    List<aircraftStaEntity> aircraftSta();
+
     List<FaultEntity> findByName(@Param("fault_name") String name);
 
-    List<FaultEntity> findByMultiple(@Param("major") String major,@Param("name") String name);
-    List<FaultEntity> findByBookName(@Param("major") String major,@Param("name") String name);
-    List<FaultEntity> findByFaultName(@Param("major") String major,@Param("name") String name);
+//    List<FaultEntity> findByMultiple(@Param("major") String major,@Param("name") String name);
+    List<FaultEntity> findByBookName(@Param("aircraftType") String aircraftType,@Param("major") String major,@Param("name") String name);
+    List<FaultEntity> findByFaultName(@Param("aircraftType") String aircraftType,@Param("major") String major,@Param("name") String name);
+    List<FaultEntity> findByAuthor(@Param("aircraftType") String aircraftType,@Param("major") String major,@Param("name") String name);
+    List<FaultEntity> findByDepartment(@Param("aircraftType") String aircraftType,@Param("major") String major,@Param("name") String name);
+    List<FaultEntity> findByDescription(@Param("aircraftType") String aircraftType,@Param("major") String major,@Param("name") String name);
+    List<FaultEntity> findByFaultTime(FaultFind faultFind);
+
 }

+ 2 - 0
src/main/java/com/zglc/fm/dao/master/ManuelDao.java

@@ -14,6 +14,8 @@ public interface ManuelDao extends Mapper<ManuelEntity> {
 
     Integer getCount();
 
+    Integer getCountByAircaft(@Param("aircraftType") String aircraftType);
+
     List<ManuelEntity> findByName(@Param("manuel_name") String name);
 
     List<ManuelEntity> findByManuelName(@Param("major") String major,@Param("name") String name);

+ 4 - 0
src/main/java/com/zglc/fm/dao/master/OutlineDao.java

@@ -1,6 +1,7 @@
 package com.zglc.fm.dao.master;
 
 import com.zglc.fm.entity.OutlineEntity;
+import com.zglc.fm.entity.aircraftStaEntity;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 import tk.mybatis.mapper.common.Mapper;
@@ -15,4 +16,7 @@ public interface OutlineDao extends Mapper<OutlineEntity> {
     Integer getCount();
 
     List<OutlineEntity> findByName(@Param("outline_name") String name);
+
+    Integer getCountByAircaft(@Param("aircraftType") String aircraftType);
+
 }

+ 6 - 6
src/main/java/com/zglc/fm/entity/FaultFind.java

@@ -9,15 +9,15 @@ import java.util.Date;
 @Setter
 public class FaultFind {
 
-    private String aircraft;
+    private String aircraftType;
 
-    private String firstDevice;
+    private String major;
 
-    private String secondDevice;
+    private String keyword;
 
-    private String faultName;
+    private Integer type;
 
-    private Date startTime;
+    private String beginTime;
 
-    private Date endTime;
+    private String finishTime;
 }

+ 15 - 0
src/main/java/com/zglc/fm/entity/StaEntity.java

@@ -0,0 +1,15 @@
+package com.zglc.fm.entity;
+
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class StaEntity {
+
+    private Integer faultNo;
+    private Integer manuelNo;
+    private Integer bookNo;
+    private Integer outlineNo;
+    private Integer cardNo;
+}

+ 11 - 0
src/main/java/com/zglc/fm/entity/aircraftStaEntity.java

@@ -0,0 +1,11 @@
+package com.zglc.fm.entity;
+
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class aircraftStaEntity {
+    private String aircraft_type;
+    private Integer num;
+}

+ 17 - 0
src/main/java/com/zglc/fm/service/BookService.java

@@ -6,6 +6,8 @@ import com.zglc.fm.dao.master.CatalogueDao;
 import com.zglc.fm.entity.BookEntity;
 //import com.zglc.fm.entity.FaultEntity;
 import com.zglc.fm.entity.CatalogueEntity;
+import com.zglc.fm.entity.FaultEntity;
+import com.zglc.fm.entity.aircraftStaEntity;
 import com.zglc.fm.utils.DocToPdf;
 import com.zglc.fm.utils.ExcelUtils;
 import com.zglc.fm.utils.FileTypeUtil;
@@ -39,6 +41,10 @@ public class BookService {
         return bookDao.getCount();
     }
 
+    public Integer getCountByAircaft(String aircraftType) {
+        return bookDao.getCountByAircaft(aircraftType);
+    }
+
     public Result<String> add(BookEntity data) {
         data.setId(null);
 //        data.setIs_catalogue(0);
@@ -229,5 +235,16 @@ public class BookService {
         return lst;
     }
 
+    public List<aircraftStaEntity> aircraftSta(){
+        return bookDao.aircraftSta();
+    }
+
+    public List<BookEntity> listByAircraft(String aircraftType) {
+        Example example = new Example(BookEntity.class);
+        Example.Criteria criteria = example.createCriteria();
+        criteria.andEqualTo("aircraft_type", aircraftType);
+        return bookDao.selectByExample(example);
+    }
+
 
 }

+ 14 - 0
src/main/java/com/zglc/fm/service/CardService.java

@@ -5,6 +5,7 @@ import com.github.pagehelper.PageInfo;
 import com.zglc.fm.base.Result;
 import com.zglc.fm.dao.master.CardDao;
 import com.zglc.fm.entity.CardEntity;
+import com.zglc.fm.entity.aircraftStaEntity;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiResponse;
 import io.swagger.annotations.ApiResponses;
@@ -36,6 +37,10 @@ public class CardService {
         return cardDao.getCount();
     }
 
+    public Integer getCountByAircaft(String aircraftType) {
+        return cardDao.getCountByAircaft(aircraftType);
+    }
+
     public Result<String> add(CardEntity data) {
         data.setId(null);
         boolean flag = true;
@@ -148,6 +153,15 @@ public class CardService {
         return lst;
     }
 
+    public List<aircraftStaEntity> aircraftSta(){
+        return cardDao.aircraftSta();
+    }
 
+    public List<CardEntity> listByAircraft(String aircraftType) {
+        Example example = new Example(CardEntity.class);
+        Example.Criteria criteria = example.createCriteria();
+        criteria.andEqualTo("aircraft_type", aircraftType);
+        return cardDao.selectByExample(example);
+    }
 
 }

+ 47 - 5
src/main/java/com/zglc/fm/service/FaultService.java

@@ -3,6 +3,8 @@ package com.zglc.fm.service;
 import com.zglc.fm.base.Result;
 import com.zglc.fm.dao.master.FaultDao;
 import com.zglc.fm.entity.FaultEntity;
+import com.zglc.fm.entity.aircraftStaEntity;
+import com.zglc.fm.entity.FaultFind;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import tk.mybatis.mapper.entity.Example;
@@ -30,6 +32,14 @@ public class FaultService {
         return faultDao.getCount();
     }
 
+    public Integer getCountByAircaft(String aircraftType) {
+        return faultDao.getCountByAircaft(aircraftType);
+    }
+
+    public List<aircraftStaEntity> aircraftSta(){
+        return faultDao.aircraftSta();
+    }
+
     public Result<String> add(FaultEntity data) {
         data.setId(null);
         boolean flag = true;
@@ -156,6 +166,13 @@ public class FaultService {
             return getAllFault();
     }
 
+    public List<FaultEntity> listByAircraft(String aircraftType) {
+        Example example = new Example(FaultEntity.class);
+        Example.Criteria criteria = example.createCriteria();
+        criteria.andEqualTo("aircraft_type", aircraftType);
+        return faultDao.selectByExample(example);
+    }
+
     public List<FaultEntity> listNotIndexed() {
         Example example = new Example(FaultEntity.class);
         Example.Criteria criteria = example.createCriteria();
@@ -219,14 +236,39 @@ public class FaultService {
         return faultDao.findByName("%" + name + "%");
     }
 
-    public List<FaultEntity> findByKeyword(String major,String name,Integer type) {
+    public List<FaultEntity> findByKeyword(FaultFind faultFind) {
         List<FaultEntity> lst =  new ArrayList<>();
-        switch (type){
-            case 0:lst = faultDao.findByMultiple( major,"%" + name + "%");break;//全部查询
-            case 1:lst = faultDao.findByBookName(major,"%" + name + "%");break;//教材名称
-            case 2:lst = faultDao.findByFaultName(major,"%" + name + "%");break;//案例名称
+        switch (faultFind.getType()){
+//            case 0:lst = faultDao.findByMultiple( faultFind.getAircraftType(),faultFind.getMajor(),"%" + faultFind.getKeyword() + "%");break;//全部查询
+            case 1:lst = faultDao.findByBookName(faultFind.getAircraftType(),faultFind.getMajor(),"%" + faultFind.getKeyword() + "%");break;//教材名称
+            case 2:lst = faultDao.findByFaultName(faultFind.getAircraftType(),faultFind.getMajor(),"%" + faultFind.getKeyword() + "%");break;//案例名称
+            case 3:lst = faultDao.findByAuthor(faultFind.getAircraftType(),faultFind.getMajor(),"%" + faultFind.getKeyword() + "%");break;//作者名称
+            case 4:lst = faultDao.findByDepartment(faultFind.getAircraftType(),faultFind.getMajor(),"%" + faultFind.getKeyword() + "%");break;//部门
+            case 5:lst = faultDao.findByDescription(faultFind.getAircraftType(),faultFind.getMajor(),"%" + faultFind.getKeyword() + "%");break;//描述
+            case 6:lst = faultDao.findByFaultTime(faultFind);break;//故障时间
+
         }
         return lst;
     }
 
+    public List<FaultEntity> searchByMajorKeyword(Integer type,String keyword,String major) {
+        Example example = new Example(FaultEntity.class);
+        Example.Criteria criteria = example.createCriteria();
+        switch (type) {
+            case 1: criteria.andLike("fault_name", "%"+keyword+"%");break;//全部查询
+            case 2:{
+                    criteria.andEqualTo("major_type", major);
+                    criteria.andLike("fault_name", "%"+keyword+"%");
+                }break; //不同专业查询
+            case 3:{
+                    criteria.andIsNull("major_type");
+                    criteria.andLike("fault_name", "%"+keyword+"%");
+            }break;//未标引查询
+
+        }
+
+        return faultDao.selectByExample(example);
+
+    }
+
 }

+ 11 - 0
src/main/java/com/zglc/fm/service/ManuelService.java

@@ -29,6 +29,10 @@ public class ManuelService {
         return manuelDao.getCount();
     }
 
+    public Integer getCountByAircaft(String aircraftType) {
+        return manuelDao.getCountByAircaft(aircraftType);
+    }
+
     public Result<String> add(ManuelEntity data) {
         data.setId(null);
         boolean flag = true;
@@ -116,4 +120,11 @@ public class ManuelService {
         return lst;
     }
 
+    public List<ManuelEntity> listByAircraft(String aircraftType) {
+        Example example = new Example(ManuelEntity.class);
+        Example.Criteria criteria = example.createCriteria();
+        criteria.andEqualTo("aircraft_type", aircraftType);
+        return manuelDao.selectByExample(example);
+    }
+
 }

+ 10 - 0
src/main/java/com/zglc/fm/service/OutlineService.java

@@ -28,6 +28,10 @@ public class OutlineService {
         return outlineDao.getCount();
     }
 
+    public Integer getCountByAircaft(String aircraftType) {
+        return outlineDao.getCountByAircaft(aircraftType);
+    }
+
     public Result<String> add(OutlineEntity data) {
         data.setId(null);
         boolean flag = true;
@@ -107,4 +111,10 @@ public class OutlineService {
         return outlineDao.selectByExample(example);
     }
 
+    public List<OutlineEntity> listByAircraft(String aircraftType) {
+        Example example = new Example(OutlineEntity.class);
+        Example.Criteria criteria = example.createCriteria();
+        criteria.andEqualTo("aircraft_type", aircraftType);
+        return outlineDao.selectByExample(example);
+    }
 }

+ 10 - 1
src/main/resources/mapping/master/BookDao.xml

@@ -30,9 +30,18 @@
     <select id="getCount" resultType="java.lang.Integer">
         select count(1)
         from t_book
-        where id > 1
     </select>
 
+    <select id="getCountByAircaft" parameterType="String" resultType="java.lang.Integer">
+        select count(1)
+        from t_book
+        where aircraft_type = #{aircraftType}
+    </select>
+
+<!--    <select id="aircraftSta" parameterType="java.util.ArrayList" resultMap="staMap">-->
+<!--        select aircraft_type,count(aircraft_type) as num from t_book group by aircraft_type-->
+<!--    </select>-->
+
 
 <!--    <insert id="batchAdd" parameterType="java.util.List">-->
 <!--        <foreach collection="list" item="equ" separator=";">-->

+ 11 - 1
src/main/resources/mapping/master/CardDao.xml

@@ -24,7 +24,7 @@
     <select id="getCount" resultType="java.lang.Integer">
         select count(1)
         from t_card
-        where id > 1
+--         where id > 1
     </select>
 
 <!--    <insert id="batchAdd" parameterType="java.util.List">-->
@@ -46,4 +46,14 @@
         and major_type = #{major}
     </select>
 
+<!--    <select id="aircraftSta" parameterType="java.util.ArrayList" resultMap="staMap">-->
+<!--        select aircraft_type,count(aircraft_type) as num from t_card group by aircraft_type-->
+<!--    </select>-->
+
+    <select id="getCountByAircaft" parameterType="String" resultType="java.lang.Integer">
+        select count(1)
+        from t_card
+        where aircraft_type = #{aircraftType}
+    </select>
+
 </mapper>

+ 55 - 1
src/main/resources/mapping/master/FaultDao.xml

@@ -21,6 +21,11 @@
         <result property="remarks" column="remarks"/>
     </resultMap>
 
+    <resultMap type="com.zglc.fm.entity.aircraftStaEntity" id="staMap">
+        <result property="aircraftType" column="aircraftType"/>
+        <result property="num" column="num"/>
+    </resultMap>
+
     <select id="listAll" resultMap="faultMap">
         select id,fault_name,fault_number,author,aircraft_type,major_type,description,file_path,input_time,fault_time,book_name,chapter,remarks
         from t_fault
@@ -30,7 +35,16 @@
     <select id="getCount" resultType="java.lang.Integer">
         select count(1)
         from t_fault
-        where id > 1
+    </select>
+
+    <select id="getCountByAircaft" parameterType="String" resultType="java.lang.Integer">
+        select count(1)
+        from t_fault
+        where aircraft_type = #{aircraftType}
+    </select>
+
+    <select id="aircraftSta" parameterType="java.util.ArrayList" resultMap="staMap">
+        select aircraft_type,count(aircraft_type) as num from t_fault group by aircraft_type
     </select>
 
 <!--    <insert id="batchAdd" parameterType="java.util.List">-->
@@ -50,12 +64,35 @@
         select * from t_fault where book_name
         like #{name}
         and major_type = #{major}
+        and aircraft_type = #{aircraftType}
     </select>
 
     <select id="findByFaultName" parameterType="String" resultMap="faultMap">
         select * from t_fault where fault_name
         like #{name}
         and major_type = #{major}
+        and aircraft_type = #{aircraftType}
+    </select>
+
+    <select id="findByAuthor" parameterType="String" resultMap="faultMap">
+        select * from t_fault where author
+        like #{name}
+        and major_type = #{major}
+        and aircraft_type = #{aircraftType}
+    </select>
+
+    <select id="findByDepartment" parameterType="String" resultMap="faultMap">
+        select * from t_fault where department
+        like #{name}
+        and major_type = #{major}
+        and aircraft_type = #{aircraftType}
+    </select>
+
+    <select id="findByDescription" parameterType="String" resultMap="faultMap">
+        select * from t_fault where description
+        like #{name}
+        and major_type = #{major}
+        and aircraft_type = #{aircraftType}
     </select>
 
     <select id="findByMultiple" parameterType="String" resultMap="faultMap">
@@ -64,4 +101,21 @@
 
     </select>
 
+    <select id="findByFaultTime" parameterType="com.zglc.fm.entity.FaultFind" resultMap="faultMap">
+        select *
+        from t_fault where 1=1
+        <if test="major !=null">
+            and major_type = #{major}
+        </if>
+        <if test="aircraftType !=null">
+            and aircraft_type = #{aircraftType}
+        </if>
+        <if test="beginTime != null">
+            and fault_time <![CDATA[>=]]> #{beginTime}
+        </if>
+        <if test="finishTime !=null">
+            and fault_time <![CDATA[<=]]> #{finishTime}
+        </if>
+    </select>
+
 </mapper>

+ 7 - 1
src/main/resources/mapping/master/ManuelDao.xml

@@ -24,7 +24,13 @@
     <select id="getCount" resultType="java.lang.Integer">
         select count(1)
         from t_manuel
-        where id > 1
+--         where id > 1
+    </select>
+
+    <select id="getCountByAircaft" parameterType="String" resultType="java.lang.Integer">
+        select count(1)
+        from t_manuel
+        where aircraft_type = #{aircraftType}
     </select>
 
     <select id="findByName" parameterType="String" resultMap="manuelMap">

+ 7 - 1
src/main/resources/mapping/master/OutlineDao.xml

@@ -25,7 +25,13 @@
     <select id="getCount" resultType="java.lang.Integer">
         select count(1)
         from t_outline
-        where id > 1
+--         where id > 1
+    </select>
+
+    <select id="getCountByAircaft" parameterType="String" resultType="java.lang.Integer">
+        select count(1)
+        from t_outline
+        where aircraft_type = #{aircraftType}
     </select>
 
 <!--    <insert id="batchAdd" parameterType="java.util.List">-->

+ 17 - 12
src/main/resources/static/Ordinary/department-edit.html

@@ -3,7 +3,7 @@
 
 <head>
     <meta charset="UTF-8">
-    <title>故障信息管理系统-单位管理-编辑</title>
+    <title>生保系统故障分析及辅助维修决策软件</title>
     <meta name="renderer" content="webkit">
     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
     <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8">
@@ -15,6 +15,11 @@
     <script src="./js/xadmin.js"></script>
     <script src="../other/js/functions.js"></script>
     <script src="./js/departmentEdit.js"></script>
+	<style>
+		.layui-form-label{
+			width: 111px;
+		}
+	</style>
 </head>
 
 <body>
@@ -24,9 +29,9 @@
             <div class="layui-container">
                 <!-- 部门名称 -->
                 <div class="layui-row">
-                    <div class="layui-col-sm6">
+                    <div class="layui-col-sm12">
                         <div class="layui-form-item">
-                            <label for="departmentName" class="layui-form-label"> 部门名称 </label>
+                            <label for="departmentName" class="layui-form-label"><span class="x-red">*</span>  部门名称 </label>
                             <div class="layui-input-inline">
                                 <input type="text" id="departmentName" name="departmentName" autocomplete="off" class="layui-input">
                             </div>
@@ -35,20 +40,20 @@
                 </div>
                 <!-- 负责人编号 -->
                 <div class="layui-row">
-                    <div class="layui-col-sm6">
+<!--                    <div class="layui-col-sm6">
                         <div class="layui-form-item">
                             <label for="masterId" class="layui-form-label"> 负责人编号 </label>
                             <div class="layui-input-inline">
                                 <input type="text" id="masterId" name="masterId" autocomplete="off" class="layui-input">
                             </div>
                         </div>
-                    </div>
+                    </div> -->
                 </div>
                 <!-- 负责人名称 -->
                 <div class="layui-row">
-                    <div class="layui-col-sm6">
+                    <div class="layui-col-sm12">
                         <div class="layui-form-item">
-                            <label for="masterName" class="layui-form-label"> 负责人名称 </label>
+                            <label for="masterName" class="layui-form-label"> <span class="x-red">*</span>  负责人名称 </label>
                             <div class="layui-input-inline">
                                 <input type="text" id="masterName" name="masterName" autocomplete="off" class="layui-input">
                             </div>
@@ -57,20 +62,20 @@
                 </div>
                 <!-- 上级部门编号 -->
                 <div class="layui-row">
-                    <div class="layui-col-sm6">
+                    <!-- <div class="layui-col-sm6">
                         <div class="layui-form-item">
                             <label for="parentId" class="layui-form-label"> 上级部门编号 </label>
                             <div class="layui-input-inline">
                                 <input type="text" id="parentId" name="parentId" autocomplete="off" class="layui-input">
                             </div>
                         </div>
-                    </div>
+                    </div> -->
                 </div>
                 <!-- 上级部门名称 -->
                 <div class="layui-row">
-                    <div class="layui-col-sm6">
+                    <div class="layui-col-sm12">
                         <div class="layui-form-item">
-                            <label for="parentName" class="layui-form-label"> 上级部门名称 </label>
+                            <label for="parentName" class="layui-form-label"> <span class="x-red">*</span>  上级部门名称 </label>
                             <div class="layui-input-inline">
                                 <input type="text" id="parentName" name="parentName" autocomplete="off" class="layui-input">
                             </div>
@@ -79,7 +84,7 @@
                 </div>
                 <!-- 备注 -->
                 <div class="layui-row">
-                    <div class="layui-col-sm6">
+                    <div class="layui-col-sm12">
                         <div class="layui-form-item">
                             <label for="remark" class="layui-form-label"> 备注 </label>
                             <div class="layui-input-inline">

+ 20 - 4
src/main/resources/static/Ordinary/department.html

@@ -3,7 +3,7 @@
 
 <head>
     <meta charset="UTF-8">
-    <title>故障信息管理系统-单位管理</title>
+    <title>生保系统故障分析及辅助维修决策软件</title>
     <meta name="renderer" content="webkit">
     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
     <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8">
@@ -24,6 +24,18 @@
         .layui-table th {
             text-align: center;
         }
+        
+        .layui-border-box {
+            height: 428px!important;
+        }
+        
+        .layui-table-body {
+            height: 380px!important;
+        }
+        
+        #pagination {
+            margin-top: 45px;
+        }
     </Style>
 </head>
 
@@ -32,15 +44,16 @@
     <div class="x-body">
         <form class="layui-form" style="height: 30px;margin-top:-20px">
             <button id="addDepartment" class="layui-btn layui-btn-sm">
-					<i class="layui-icon">&#xe61f;</i> 新建单位</button>
+					<i class="layui-icon">&#xe61f;</i> 新建部门</button>
             <button id="batchDelete" class="layui-btn layui-btn-sm layui-btn-danger" style="padding-right: 10px;">
-					<i class="layui-icon">&#xe640;</i> 删除单位</button>
+					<i class="layui-icon">&#xe640;</i> 删除部门</button>
             <a class="layui-btn layui-btn-sm" style="padding-left: 10px" href="javascript:location.replace(location.href);" title="刷新">
                 <i class="layui-icon" style="line-height:30px">&#xe669;</i>刷新
             </a>
             <div class="layui-input-inline x-so " style="padding-top: 20px;padding-left: 10px">
 
-                <input id="realName" type="text" name="name" placeholder="请输入部门名称" autocomplete="off" class="layui-input">
+                <input id="realName" type="text" name="name" placeholder="请输入部门名称" autocomplete="off" class="layui-input" style="width: 200px;
+                height: 30px;">
                 <button id="searchArticle" class="layui-btn layui-btn-sm" lay-submit="" lay-filter="search">
 						<i class="layui-icon">&#xe615;</i>
 					</button>
@@ -70,6 +83,9 @@
             <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delete">删除</a>
         </script>
     </div>
+    <script type="text/html" id="xuhao">
+        {{d.LAY_TABLE_INDEX+1}}
+    </script>
 
 </body>
 

+ 3 - 0
src/main/resources/static/Ordinary/index-list.html

@@ -60,6 +60,9 @@
                         <dd>
                             <a href="javascript:;" data-url="./role.html" data-id='111' data-text="角色管理"><span class="col-2" style="float:left" />角色管理</a>
                         </dd>
+                        <dd>
+                            <a href="javascript:;" data-url="./department.html" data-id='112' data-text="部门管理"><span class="col-2" style="float:left" />部门管理</a>
+                        </dd>
                         <dd>
                             <a href="javascript:" data-url="./rights.html" data-id='2' data-text="权限配置"><span class="col-2" style="float:left" />权限管理</a>
                         </dd>

+ 2 - 36
src/main/resources/static/Ordinary/js/book-add.js

@@ -28,6 +28,7 @@ $(function() {
                 // functype_name = decodeURI(values[10].replace("type_name=", ""));
                 funcfile_path = decodeURI(values[9].replace("file_path=", ""));
                 funcremarks = decodeURI(values[10].replace("remarks=", ""));
+                funcremarks = decodeURI(values[10].replace("remarks=", ""));
             }
         }
     }
@@ -87,42 +88,6 @@ $(function() {
                     showMsg(res.msg, 2);
             }
         });
-        // var uploadInst = upload.render({
-        //     elem: '#test1',
-        //     url: urlBase + '/api/book/importImg',
-        //     accept: 'images',
-        //     size: 50000,
-        //     before: function(obj) {
-
-        //         obj.preview(function(index, file, result) {
-
-        //             $('#demo1').attr('src', result);
-        //         });
-        //     },
-        //     done: function(res) {
-        //         //如果上传失败
-        //         if (res.code > 0) {
-        //             return layer.msg('上传失败');
-        //         }
-        //         //上传成功
-        //         var demoText = $('#demoText');
-        //         demoText.html('<span style="color: #4cae4c;">上传成功</span>');
-
-        //         var fileupload = $(".image");
-        //         fileupload.attr("value", res.data.src);
-        //         console.log(fileupload.attr("value"));
-        //     },
-        //     error: function() {
-        //         //演示失败状态,并实现重传
-        //         var demoText = $('#demoText');
-        //         demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
-        //         demoText.find('.demo-reload').on('click', function() {
-        //             uploadInst.upload();
-        //         });
-        //     }
-        // });
-
-
         //监听提交
         form.on("switch(hide)", function(data) {
             isHide = data.elem.checked ? 1 : 0;
@@ -130,6 +95,7 @@ $(function() {
         form.on("submit(save)", function(data) {
             var func = data.field;
             func.id = funcId;
+            func.is_catalogue = 0;
             let url = "";
             url = "api/book/add";
             fetchJSON(url, func, "post", function(data) {

+ 7 - 4
src/main/resources/static/Ordinary/js/book.js

@@ -36,17 +36,18 @@ $(function() {
                             align: "center"
                         },
                         {
-                            field: "author",
-                            title: "作者",
+                            field: "book_name",
+                            title: "书名",
                             templet: '#type',
                             align: "center"
                         },
                         {
-                            field: "book_name",
-                            title: "书名",
+                            field: "author",
+                            title: "作者",
                             templet: '#type',
                             align: "center"
                         },
+
                         {
                             field: "description",
                             title: "描述",
@@ -135,6 +136,8 @@ $(function() {
                             });
                         }
                         tableOption.data = data.data.list;
+
+                        console.log(data.data.list[1].is_catalogue)
                         table.render(tableOption);
                     } else {
                         showMsg(data.msg, 2, 2000);

+ 16 - 26
src/main/resources/static/Ordinary/js/department.js

@@ -40,7 +40,6 @@ $(function() {
         function loadDepartmentList(page, size, searchTitle) {
             if (page === null || page === undefined) page = defaultPage;
             if (size === null || size === undefined) size = defaultSize;
-            // console.log(name)
             var tableOption = {
                 elem: "#departmentList",
                 height: "full-81",
@@ -50,30 +49,21 @@ $(function() {
                             type: "checkbox"
                         },
                         {
-                            field: "id",
-                            title: "序号",
-                            align: "center"
+                            title: '序号',
+                            templet: '#xuhao',
+                            align: "center",
+                            width: 60
                         },
                         {
                             field: "departmentName",
                             title: "部门名称",
                             align: "center"
                         },
-                        {
-                            field: "masterId",
-                            title: "负责人编号",
-                            align: "center"
-                        },
                         {
                             field: "masterName",
                             title: "负责人名称",
                             align: "center"
                         },
-                        {
-                            field: "parentId",
-                            title: "上级部门编号",
-                            align: "center"
-                        },
                         {
                             field: "parentName",
                             title: "上级部门名称",
@@ -87,7 +77,7 @@ $(function() {
                         {
                             fixed: "right",
                             title: "操作",
-                            width: 220,
+                            width: 150,
                             toolbar: "#operationToolbar",
                             align: "center"
                         }
@@ -97,9 +87,11 @@ $(function() {
 
 
             // var url = ;
+            var departmentType = 0;
+            var parentId = 0;
             if (searchTitle === null || searchTitle === undefined || searchTitle === "") {
-                // var url = ;
-                fetchJSON("api/department/listpage?page=" + (page + 1) + "&size=" + size, {}, "get", function(data) {
+
+                fetchJSON("api/department/listpage?page=" + (page + 1) + "&size=" + size + "&departmentType=" + departmentType + "&parentId=" + parentId, {}, "get", function(data) {
                     if (data.status === 0) {
                         if (tableFirstLoad) {
                             tableFirstLoad = false;
@@ -131,7 +123,7 @@ $(function() {
                             laypage.render({
                                 curr: page + 1,
                                 elem: "pagination",
-                                count: data.data.totalElements,
+                                count: data.data.length,
                                 layout: ["count", "prev", "page", "next", "limit", "refresh", "skip"],
                                 jump: function(obj, first) {
                                     if (first) return;
@@ -177,18 +169,16 @@ $(function() {
         table.on("tool(departmentList)", function(obj) {
             var data = obj.data;
 
-            if (data.id === 1) {
-                showMsg("默认部门不可操作!", 1, 2000);
-                return;
-            }
+            // if (data.id === 1) {
+            //     showMsg("默认部门不可操作!", 1, 2000);
+            //     return;
+            // }
             if (obj.event === "edit") {
                 // 打开编辑框 进行详细编辑
-                x_admin_show("编辑单位", encodeURI("department-edit.html?id=" + data.id + "&departmentName=" + data.departmentName +
-                    "&masterId=" + data.masterId + "&masterName=" + data.masterName + "&parentId=" + data.parentId + "&parentName=" + data.parentName + "&remark=" + data.remark), 510, 500, function() {
+                x_admin_show("编辑部门", encodeURI("./department-edit.html?id=" + data.id + "&departmentName=" + data.departmentName + "&masterName=" + data.masterName + "&parentName=" + data.parentName + "&remark=" + data.remark), 500, 400, function() {
                     loadDepartmentList(currentPage, currentSize);
                 });
             } else if (obj.event === "delete") {
-                // console.log(data)
                 // 删除
                 var ids = [];
                 ids.push(data.id);
@@ -210,7 +200,7 @@ $(function() {
         $("#addDepartment").on("click", function(e) {
             e.preventDefault();
             tableFirstLoad = true;
-            x_admin_show("添加用户", "department-edit.html?id=0&departmentName=&masterId=&masterName=&parentId=&parentName=&remark=", 520, 500,
+            x_admin_show("新建部门", "./department-edit.html?id=0&departmentName=&masterName=&parentName=&remark=", 500, 400,
                 function() {
                     loadDepartmentList(currentPage, currentSize);
                 });

+ 48 - 38
src/main/resources/static/Ordinary/js/departmentEdit.js

@@ -2,7 +2,7 @@ $(function () {
     var params = window.location.href.split("?");
     if (params.length > 1) {
         values = params[1].split("&");
-        if (values.length > 1) {
+        if (values.length > 4) {
             var departmentId = values[0].replace("id=", "");
             var departmentName = "";
 			var masterId ="";
@@ -12,53 +12,53 @@ $(function () {
             var purpose = "";
             if (departmentId !== "0") {
                 departmentName = decodeURI(values[1].replace("departmentName=", ""));
-				masterId = decodeURI(values[2].replace("masterId=", ""));
-				masterName = decodeURI(values[3].replace("masterName=", ""));
-				parentName = decodeURI(values[5].replace("parentName=", ""));
-                parentId = decodeURI(values[4].replace("parentId=", ""));
-                purpose = decodeURI(values[6].replace("remark=", ""));
+				// masterId = decodeURI(values[2].replace("masterId=", ""));
+				masterName = decodeURI(values[2].replace("masterName=", ""));
+				parentName = decodeURI(values[3].replace("parentName=", ""));
+                // parentId = decodeURI(values[4].replace("parentId=", ""));
+                purpose = decodeURI(values[4].replace("remark=", ""));
             }
         }
     }
 
     $("#departmentName").val(departmentName);
-	$("#masterId").val(masterId);
+	// $("#masterId").val(masterId);
 	$("#masterName").val(masterName);
 	$("#parentName").val(parentName);
-	$("#parentId").val(parentId);
+	// $("#parentId").val(parentId);
 	$("#departmentName").val(departmentName);
     $("#remark").val(purpose);
 
-    fetchJSON("/api/department/listAll?page=1&size=1000", {}, "get", function (departmentList) {
-        if (departmentList.status === 0) {
-            $("#parentId").empty();
-            $("#parentId").append($("<option>", {value: -1, text: "请选择"}));
+    // fetchJSON("api/department/listAll?page=1&size=1000", {}, "get", function (departmentList) {
+    //     if (departmentList.status === 0) {
+    //         $("#parentId").empty();
+    //         $("#parentId").append($("<option>", {value: -1, text: "请选择"}));
 
-            for (let i = 0; i < departmentList.data.length; i++) {
-                if (departmentList.data[i].id == parentId) {
-                    $("#parentId").append(
-                        $("<option>", {
-                            value:departmentList.data[i].id,
-                            text: departmentList.data[i].departmentName ,
-                            selected: true
-                        })
-                    );
-                } else {
-                    $("#parentId").append(
-                        $("<option>", {
-                            value:departmentList.data[i].id,
-                            text: departmentList.data[i].departmentName ,
-                        })
-                    );
-                }
-            }
-            layui.use("form", function () {
-                layui.form.render();
-            });
-        } else {
-            showMsg(ret.msg, 2);
-        }
-    });
+    //         for (let i = 0; i < departmentList.data.length; i++) {
+    //             if (departmentList.data[i].id == parentId) {
+    //                 $("#parentId").append(
+    //                     $("<option>", {
+    //                         value:departmentList.data[i].id,
+    //                         text: departmentList.data[i].departmentName ,
+    //                         selected: true
+    //                     })
+    //                 );
+    //             } else {
+    //                 $("#parentId").append(
+    //                     $("<option>", {
+    //                         value:departmentList.data[i].id,
+    //                         text: departmentList.data[i].departmentName ,
+    //                     })
+    //                 );
+    //             }
+    //         }
+    //         layui.use("form", function () {
+    //             layui.form.render();
+    //         });
+    //     } else {
+    //         showMsg(ret.msg, 2);
+    //     }
+    // });
     layui.use(["form", "layer"], function () {
         $ = layui.jquery;
         var form = layui.form,
@@ -67,10 +67,20 @@ $(function () {
 
         form.on("submit(add)", function (data) {
             if ($("#departmentName").val().trim() === "") {
-                showMsg("单位名不能为空!", 2);
+                showMsg("部门名称不能为空!", 2);
                 $("#departmentName").focus();
                 return false;
             }
+			if ($("#masterName").val().trim() === "") {
+			    showMsg("负责人名称不能为空!", 2);
+			    $("#masterName").focus();
+			    return false;
+			}
+			if ($("#parentName").val().trim() === "") {
+			    showMsg("上级部门名称不能为空!", 2);
+			    $("#parentName").focus();
+			    return false;
+			}
             let department = data.field;
             if (departmentId < 0)
                 department.id = 0;

+ 0 - 2
src/main/resources/static/Ordinary/js/faultSee.js

@@ -50,8 +50,6 @@ $(function() {
     $("#remarks").val(funcremarks);
     $("#box").attr('src', urlBase + funcfile_path);
 
-    // getFaultName()
-
     layui.use("form", function() {
         layui.form.render();
     });

+ 10 - 7
src/main/resources/static/admin/Ubooktext.html

@@ -20,7 +20,7 @@
             top: 0;
             left: 0;
             width: 97%;
-            height: 700px!important;
+            height: 90%!important;
         }
     </style>
 </head>
@@ -37,11 +37,14 @@
 <script>
     $(function() {
         var url = sessionStorage.getItem("url") 
-        var newurl = url.substr(url.indexOf('1'), url.length);              
-        file_path  =  newurl.substr(newurl.indexOf('\\')  +  1, newurl.length);               
-        newurl  =  file_path.substr(0, file_path.indexOf('.'));                
+        var newurl = url.substr(url.indexOf('1'), url.length); 
+        console.log(newurl)              
+            // file_path  =  newurl.substr(newurl.indexOf('\\')  +  1, newurl.length);
+            // console.log(file_path )                 
+        newurl  = newurl.substr(0, newurl.indexOf('.')); 
+        console.log(newurl)                  
         path  =  urlBase  +  "sourcefm\\"  +  newurl  +  ".pdf"
-
+        console.log(path )   
         layui.use("form", function() {
             layui.form.render();
         });
@@ -50,8 +53,8 @@
             $ = layui.jquery;
             var form = layui.form;
             var layer = layui.layer;
-            $("#box").attr('src', "../other/pdfjs/web/viewer.html?file=" + path);
-
+            $("#box").attr('src', path);
+            console.log(path )   
         });
 
     });

+ 1 - 0
src/main/resources/static/admin/UcardSee.html

@@ -37,6 +37,7 @@
 
 <script>
     function geturl() {
+
         var url = sessionStorage.getItem("url")
         window.location.href = url
     }

+ 1 - 0
src/main/resources/static/admin/UfaultSee.html

@@ -36,6 +36,7 @@
 
 <script>
     function geturl() {
+
         var url = sessionStorage.getItem("url")
         window.location.href = url
     }

+ 15 - 8
src/main/resources/static/admin/Umanuel-edit.html

@@ -13,17 +13,15 @@
     <script src="./lib/jquery.min.js"></script>
     <script src="./lib/layui/layui.js" charset="utf-8"></script>
     <script src="./js/xadmin.js"></script>
-    <script src="./js/Umanuel-edit.js"></script>
     <script src="../other/js/functions.js"></script>
-    <script src="./js/Umanuel-edit.js"></script>
-
     <style>
         #box {
             position: absolute;
-            top: 0;
-            left: 0;
-            width: 100%;
-            height: 550px!important;
+            top: 5%;
+            left: 9%;
+            width: 80%;
+            height: 600px!important;
+            border: 1px solid #000000;
         }
     </style>
 </head>
@@ -32,10 +30,19 @@
 
     <div class="x-body layui-anim layui-anim-up">
         <form class="layui-form">
-            .<iframe id="box" src=""></iframe>
+
         </form>
     </div>
 </body>
 
+<script>
+    function geturl() {
+
+        var url = sessionStorage.getItem("url")
+        window.location.href = url
+    }
+    geturl()
+</script>
+
 
 </html>

+ 1 - 0
src/main/resources/static/admin/Uoutline-edit.html

@@ -37,6 +37,7 @@
 
 <script>
     function geturl() {
+
         var url = sessionStorage.getItem("url")
         window.location.href = url
     }

+ 3 - 1
src/main/resources/static/admin/js/Ubook.js

@@ -76,7 +76,7 @@ $(function() {
                         }
 
                         tableOption.data = data.data.list;
-
+                        console.log(data.data)
                         table.render(tableOption);
                     } else {
                         showMsg(data.msg, 2, 2000);
@@ -150,9 +150,11 @@ $(function() {
                 );
                 var file_path = data.file_path;
                 // console.log(file_path)
+
                 sessionStorage.setItem("url", file_path)
                 var book_name = obj.data.book_name
                 sessionStorage.setItem("book_name", book_name)
+
             }
 
         });

+ 1 - 1
src/main/resources/static/admin/js/Ucard-edit.js

@@ -3,7 +3,7 @@ console.log(params);
 var values = params[1].split("&");
 console.log(values);
 var card_name = values[0].replace("card_name=", "");
-var file_path = sessionStorage.getItem("url");
+var file_path = sessionStorage.getItem("url")
 
 $(function() {
     var defaultPage = 0;

+ 1 - 3
src/main/resources/static/admin/js/second.js

@@ -48,10 +48,8 @@
      $("#book_name").val(funcbook_name);
      $("#chapter").val(funcchapter);
      $("#remarks").val(funcremarks);
-     $("#box").attr('src', urlBase + funcfile_path);
-
-
 
+     $("#box").attr('src', urlBase + funcfile_path);
      layui.use("form", function() {
          layui.form.render();
      });

+ 1 - 1
src/main/resources/static/admin/second.html

@@ -194,7 +194,7 @@
                 </div>
 
                 <div>
-                    <!-- <iframe id="box" src=""></iframe>  -->
+
                     .<iframe id="box" src=" "></iframe>
                 </div>
             </div>

+ 3 - 3
src/main/resources/static/other/js/functions.js

@@ -1,7 +1,7 @@
-var urlBase = window.location.origin + "/";
+//var urlBase = window.location.origin + "/";
 
-//var urlBase = "http://180.76.52.24:11083/"; //网络版
-//var urlBase = "http://127.0.0.1:11083/"; //本地版
+// var urlBase = "http://180.76.52.24:11083/"; //网络版
+var urlBase = "http://127.0.0.1:11083/"; //本地版
 
 function loginout() {
     /*if ($("#loginMenu").text() == "登录") {