Просмотр исходного кода

Merge branch 'dev' of http://192.168.1.43:3000/v2/zd-parents into dev

chaiyunlong лет назад: 2
Родитель
Сommit
704e8d1fbc
43 измененных файлов с 1611 добавлено и 211 удалено
  1. 10 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/LabSubjectControllerVO.java
  2. 73 0
      zd-api/zd-system-api/src/main/java/com/zd/system/api/vo/SysLogoConfigVO.java
  3. 4 0
      zd-model/src/main/java/com/zd/model/domain/per/PerPrefix.java
  4. 15 5
      zd-modules/zd-base/src/main/java/com/zd/base/app/controller/LabBoardApi.java
  5. 9 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabHardwareController.java
  6. 6 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabSecurityApplyController.java
  7. 12 1
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabSubjectAccessRecordController.java
  8. 38 2
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabXxpCardInfoController.java
  9. 75 3
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabXxpClassifyController.java
  10. 26 5
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabXxpDutyController.java
  11. 3 3
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabXxpInspectionController.java
  12. 163 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabXxpUserAuthController.java
  13. 9 9
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/LabSubject.java
  14. 1 1
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/XxpClassifySubject.java
  15. 171 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/XxpUserAuth.java
  16. 11 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/vo/LabSubjectVO.java
  17. 10 10
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/XxpDutyMapper.java
  18. 68 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/XxpUserAuthMapper.java
  19. 7 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/IXxpClassifyService.java
  20. 2 2
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/IXxpDutyService.java
  21. 79 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/IXxpUserAuthService.java
  22. 42 10
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabSubjectServiceImpl.java
  23. 33 3
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/XxpCardInfoServiceImpl.java
  24. 12 3
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/XxpClassifyDetailedServiceImpl.java
  25. 1 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/XxpClassifyServiceImpl.java
  26. 25 17
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/XxpDutyServiceImpl.java
  27. 143 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/XxpUserAuthServiceImpl.java
  28. 1 1
      zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabSecurityApplyMapper.xml
  29. 2 1
      zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabSubjectAccessRecordMapper.xml
  30. 3 3
      zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabSubjectMapper.xml
  31. 1 1
      zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/XxpCardInfoMapper.xml
  32. 11 10
      zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/XxpClassifyMapper.xml
  33. 1 1
      zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/XxpClassifySubjectMapper.xml
  34. 12 4
      zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/XxpDutyMapper.xml
  35. 19 20
      zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/XxpInspectionMapper.xml
  36. 161 0
      zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/XxpUserAuthMapper.xml
  37. 11 0
      zd-modules/zd-modules-system/src/main/java/com/zd/system/controller/SysUserController.java
  38. 10 0
      zd-modules/zd-modules-system/src/main/java/com/zd/system/domain/vo/TreeSelect.java
  39. 7 0
      zd-modules/zd-modules-system/src/main/java/com/zd/system/mapper/SysUserMapper.java
  40. 7 0
      zd-modules/zd-modules-system/src/main/java/com/zd/system/service/ISysUserService.java
  41. 11 0
      zd-modules/zd-modules-system/src/main/java/com/zd/system/service/impl/SysUserServiceImpl.java
  42. 6 2
      zd-modules/zd-modules-system/src/main/resources/mapper/system/SysDeptMapper.xml
  43. 300 94
      zd-modules/zd-modules-system/src/main/resources/mapper/system/SysUserMapper.xml

+ 10 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/LabSubjectControllerVO.java

@@ -67,6 +67,8 @@ public class LabSubjectControllerVO extends LabSubjectEntity {
 
     private List<ClassifyVO>  classifyList;
 
+    @ApiModelProperty("实验室详情")
+    private String details;
     /**
      * 实验室类型ID
      */
@@ -429,4 +431,12 @@ public class LabSubjectControllerVO extends LabSubjectEntity {
     public void setClassifyList(List<ClassifyVO> classifyList) {
         this.classifyList = classifyList;
     }
+
+    public String getDetails() {
+        return details;
+    }
+
+    public void setDetails(String details) {
+        this.details = details;
+    }
 }

+ 73 - 0
zd-api/zd-system-api/src/main/java/com/zd/system/api/vo/SysLogoConfigVO.java

@@ -57,6 +57,79 @@ public class SysLogoConfigVO extends BaseEntity
     @Excel(name = "首页banner")
     @ApiModelProperty(value = "首页banner")
     private String homepageBanner;
+
+    /** 用户身份,11是教职工,22是学生 */
+    @Excel(name = "用户身份,11是教职工,22是学生")
+    @ApiModelProperty(value = "用户身份,11是教职工,22是学生")
+    private String userType;
+
+    @ApiModelProperty(value = "智能锁配置1是有,0是无")
+    private Integer smartLock;
+
+    @ApiModelProperty(value = "气瓶标签配置 1是有,0是无")
+    private Integer airBottle;
+
+    @ApiModelProperty(value = "返回时间")
+    private Integer returnTime;
+
+    @ApiModelProperty(value = "注销时间")
+    private Integer logoutTime;
+
+    @ApiModelProperty(value = "是否启用信息牌 0不启用 1启用")
+    private Integer isStart;
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public String getUserType() {
+        return userType;
+    }
+
+    public void setUserType(String userType) {
+        this.userType = userType;
+    }
+
+    public Integer getSmartLock() {
+        return smartLock;
+    }
+
+    public void setSmartLock(Integer smartLock) {
+        this.smartLock = smartLock;
+    }
+
+    public Integer getAirBottle() {
+        return airBottle;
+    }
+
+    public void setAirBottle(Integer airBottle) {
+        this.airBottle = airBottle;
+    }
+
+    public Integer getReturnTime() {
+        return returnTime;
+    }
+
+    public void setReturnTime(Integer returnTime) {
+        this.returnTime = returnTime;
+    }
+
+    public Integer getLogoutTime() {
+        return logoutTime;
+    }
+
+    public void setLogoutTime(Integer logoutTime) {
+        this.logoutTime = logoutTime;
+    }
+
+    public Integer getIsStart() {
+        return isStart;
+    }
+
+    public void setIsStart(Integer isStart) {
+        this.isStart = isStart;
+    }
+
     public void setId(Long id)
     {
         this.id = id;

+ 4 - 0
zd-model/src/main/java/com/zd/model/domain/per/PerPrefix.java

@@ -826,4 +826,8 @@ public class PerPrefix {
      * 电子信息牌信息
      */
     public static final String LABORATORY_CARDINFO = "laboratory:cardInfo:";
+    /**
+     * 电子信息牌人员前线
+     */
+    public static final String LABORATORY_XXPUSERAUTH= "laboratory:xxpUserAuth:";
 }

+ 15 - 5
zd-modules/zd-base/src/main/java/com/zd/base/app/controller/LabBoardApi.java

@@ -5,6 +5,7 @@ import com.zd.base.app.domain.board.DutyPersonVo;
 import com.zd.base.app.domain.board.LabXxpSubjectVo;
 import com.zd.common.core.security.TokenService;
 import com.zd.common.core.utils.DateUtils;
+import com.zd.common.core.utils.FileConfigUtils;
 import com.zd.common.core.utils.StringUtils;
 import com.zd.laboratory.api.feign.RemoteDutyService;
 import com.zd.model.constant.HttpStatus;
@@ -39,6 +40,8 @@ public class LabBoardApi {
     private RemoteXxpService remoteXxpService;
     @Autowired
     private TokenService tokenService;
+    @Autowired
+    private FileConfigUtils fileConfigUtils;
 
     /**
      * 查询电子信息牌头部信息
@@ -56,14 +59,13 @@ public class LabBoardApi {
             return ResultData.fail(500, "获取logo失败!");
         }
         map.put("schoolName", logoConfigVo.getSchoolName());
-        map.put("circularLogo", logoConfigVo.getCircularLogo());
+        map.put("circularLogo", fileConfigUtils.getFileDomainApp()+logoConfigVo.getCircularLogo());
         ResultData resultData=remoteDutyService.getSubjectName(labId);
         if (resultData == null || resultData.getCode() != 200) {
             return ResultData.fail(500, "获取实验室名称失败!");
         }
         map.put("subjectName", resultData.getData());
         map.put("currentTime", DateUtils.parseDateToStr("YYYY_MM_DD HH:MM:SS",new Date()));
-        map.put("messageList", "实验室发生火情,请注意");
         return ResultData.success(map);
     }
 
@@ -76,7 +78,7 @@ public class LabBoardApi {
         //查询实验室负责人和安全负责人
         LabXxpSubjectVo vo = new LabXxpSubjectVo();
         ResultData resultData = remoteDutyService.getXxpSubjectInfo(labId);
-        if (null != resultData || resultData.getCode() != 200) {
+        if (null == resultData || resultData.getCode() != 200) {
             return ResultData.fail("获取实验室信息失败!");
         }
         Map<String, Object> map = (Map<String, Object>) resultData.getData();
@@ -251,14 +253,22 @@ public class LabBoardApi {
     @GetMapping(value = "/getSubjectIdByNum/{num}")
     public ResultData getSubjectIdByNum(@PathVariable("num") String num) {
         ResultData<String> resultData=remoteDutyService.querySubInfoByNumber(num);
+        R<SysLogoConfigVO> sysLogo = remoteUserService.getConfigLogo();
         if(null==resultData || resultData.getCode()!=200){
             return ResultData.fail("获取实验室编号失败!");
         }
-
+        if (sysLogo == null || sysLogo.getCode() != 200) {
+            return ResultData.fail(500, "获取logo失败!");
+        }
+        Map<String,Object> map=new HashMap<String,Object>();
         if(StringUtils.isNull(resultData.getData())){
             return ResultData.fail("获取实验室编号失败!");
         }
-        return ResultData.success(resultData.getData());
+        map.put("labId",resultData.getData());
+        map.put("logoutTime",sysLogo.getData().getLogoutTime());
+        map.put("returnTime",sysLogo.getData().getReturnTime());
+        map.put("isStart",sysLogo.getData().getIsStart());
+        return ResultData.success(map);
     }
 
 

+ 9 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabHardwareController.java

@@ -15,12 +15,14 @@ import com.zd.common.core.web.controller.BaseController;
 import com.zd.laboratory.api.entity.FunctionStatus;
 import com.zd.laboratory.api.vo.HardwareCVO;
 import com.zd.laboratory.domain.LabHardware;
+import com.zd.laboratory.domain.XxpCardInfo;
 import com.zd.laboratory.domain.vo.HxpSmartTerminalByExcel;
 import com.zd.laboratory.domain.vo.LabHardwareVO;
 import com.zd.laboratory.domain.vo.LabSensorVO;
 import com.zd.laboratory.service.ILabHardwareService;
 import com.zd.laboratory.service.ILabSensorService;
 import com.zd.laboratory.service.ILabSubjectService;
+import com.zd.laboratory.service.IXxpCardInfoService;
 import com.zd.laboratory.service.impl.LabSubjectManagerService;
 import com.zd.laboratory.socket.command.Symbol;
 import com.zd.model.constant.HttpStatus;
@@ -75,6 +77,8 @@ public class LabHardwareController extends BaseController {
     RedisService redisService;
     @Resource
     private RemoteRfidService rfidService;
+    @Autowired
+    private IXxpCardInfoService xxpCardInfoService;
 
     /**
      * 查询硬件统计
@@ -281,6 +285,10 @@ public class LabHardwareController extends BaseController {
         //实验室详情
         //LabSubject labSubject =labSubjectService.selectLabSubjectById(subjectId);
 
+        XxpCardInfo xxpCardInfo = new XxpCardInfo();
+        xxpCardInfo.setSubjectId(subjectId);
+        List<XxpCardInfo>  listXxp =xxpCardInfoService.selectXxpCardInfoList(xxpCardInfo);
+
         map.put("listYtj",listYtj);//一体机
         //map.put("listDykg",listDykg);//控制设备-电源开关
         //map.put("listZntf",listZntf);//控制设备-智能通风
@@ -288,6 +296,7 @@ public class LabHardwareController extends BaseController {
         map.put("listCgq",listCgq); //传感器
         map.put("listkzsb",listkzsb); //控制设备
         map.put("listHK",listHK);
+        map.put("listXxp",listXxp);//电子信息牌
         //map.put("labSubject",labSubject); //实验室详情
         return AjaxResult.success(map);
 

+ 6 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabSecurityApplyController.java

@@ -799,6 +799,12 @@ public class LabSecurityApplyController extends BaseController
     {
         startPage(pageNumber,pageSize);
         List<Map<String,Object>> list = labSecurityApplyService.selectLabSecurityApply(subjectId);
+        for(Map<String,Object> map:list){
+            if(StringUtils.isNotNull(map.get("avatar"))){
+                String avatar=fileConfigUtils.getFileDomainApp() + map.get("avatar");
+                map.put("avatar",avatar);
+            }
+        }
         return ResultData.success(list);
     }
 }

+ 12 - 1
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabSubjectAccessRecordController.java

@@ -5,6 +5,8 @@ import java.io.IOException;
 import java.util.Map;
 import javax.servlet.http.HttpServletResponse;
 
+import com.zd.common.core.utils.FileConfigUtils;
+import com.zd.common.core.utils.StringUtils;
 import com.zd.model.domain.ResultData;
 import com.zd.model.domain.per.PerFun;
 import com.zd.model.domain.per.PerPrefix;
@@ -34,6 +36,8 @@ import com.zd.model.page.TableDataInfo;
 public class LabSubjectAccessRecordController extends BaseController {
     @Autowired
     private ILabSubjectAccessRecordService labSubjectAccessRecordService;
+    @Autowired
+    private FileConfigUtils fileConfigUtils;
 
     /**
      * 查询实验室进出记录列表
@@ -153,6 +157,13 @@ public class LabSubjectAccessRecordController extends BaseController {
     /*************************************************/
     @RequestMapping("/selectSubjectSignList")
     public ResultData selectSubjectSignList(Long subjectId) {
-        return ResultData.success(labSubjectAccessRecordService.selectSubjectSignList(subjectId));
+        List<Map<String,Object>> mapSignList=labSubjectAccessRecordService.selectSubjectSignList(subjectId);
+        for(Map<String,Object> map:mapSignList){
+            if(StringUtils.isNotNull(map.get("avatar"))){
+               String avatar=fileConfigUtils.getFileDomainApp() + map.get("avatar");
+               map.put("avatar",avatar);
+            }
+        }
+        return ResultData.success(mapSignList);
     }
 }

+ 38 - 2
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabXxpCardInfoController.java

@@ -53,6 +53,18 @@ public class LabXxpCardInfoController extends BaseController
     }
 
     /**
+     * 查询电子信息牌列表-无权限
+     */
+    @GetMapping("/getlist")
+    @ApiOperation(value = "查询电子信息牌列表-无权限")
+    public TableDataInfo<XxpCardInfo> getlist(XxpCardInfo xxpCardInfo)
+    {
+        startPage();
+        List<XxpCardInfo> list = xxpCardInfoService.selectXxpCardInfoList(xxpCardInfo);
+        return getDataTable(list);
+    }
+
+    /**
      * 导出电子信息牌列表
      */
     @ApiOperation(value = "导出电子信息牌列表")
@@ -91,9 +103,9 @@ public class LabXxpCardInfoController extends BaseController
     }
 
     /**
-     * 新增电子信息牌-物联配置使用
+     * 新增电子信息牌-无权限
      */
-    @ApiOperation(value = "新增电子信息牌")
+    @ApiOperation(value = "新增电子信息牌-无权限")
     @Log(title = "电子信息牌", businessType = BusinessType.INSERT)
     @PostMapping("/addInfo")
     public ResultData addInfo(@RequestBody XxpCardInfo xxpCardInfo)
@@ -114,6 +126,17 @@ public class LabXxpCardInfoController extends BaseController
     }
 
     /**
+     * 修改电子信息牌-无权限
+     */
+    @ApiOperation(value = "修改电子信息牌-无权限")
+    @Log(title = "电子信息牌", businessType = BusinessType.UPDATE)
+    @PostMapping("/edit")
+    public ResultData editCard(@RequestBody XxpCardInfo xxpCardInfo)
+    {
+        return  ResultData.result(xxpCardInfoService.updateXxpCardInfo(xxpCardInfo));
+    }
+
+    /**
      * 删除电子信息牌
      */
     @ApiOperation(value = "删除电子信息牌")
@@ -139,4 +162,17 @@ public class LabXxpCardInfoController extends BaseController
         return ResultData.result(xxpCardInfoService.deleteXxpCardInfoById(id));
     }
 
+    /**
+     * 根据id删除-无权限
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "根据id删除-无权限")
+    @Log(title = "电子信息牌", businessType = BusinessType.DELETE)
+    @PostMapping("/del/{id}")
+    public ResultData del(@PathVariable Long id)
+    {
+        return ResultData.result(xxpCardInfoService.deleteXxpCardInfoById(id));
+    }
+
 }

+ 75 - 3
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabXxpClassifyController.java

@@ -8,6 +8,8 @@ import com.zd.common.core.security.TokenService;
 import com.zd.common.core.utils.ExcelUtil;
 import com.zd.common.core.utils.StringUtils;
 import com.zd.common.core.web.controller.BaseController;
+import com.zd.laboratory.api.vo.ClassifyDetailVO;
+import com.zd.laboratory.api.vo.ClassifyVO;
 import com.zd.laboratory.domain.LabWhiteJoinSublist;
 import com.zd.laboratory.domain.LabWhitelist;
 import com.zd.laboratory.domain.XxpClassify;
@@ -34,6 +36,7 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
@@ -65,9 +68,7 @@ public class LabXxpClassifyController extends BaseController
     @ApiOperation(value = "查询信息牌类目列表")
     public TableDataInfo<XxpClassify> list(XxpClassify xxpClassify)
     {
-        // 排序规则获取
-        String sort=  "s".equals(xxpClassify.getRemark())?"sort":"create_time";
-        startPage(sort,"descending");
+        startPage();
         List<XxpClassify> list = xxpClassifyService.selectXxpClassifyList(xxpClassify);
         return getDataTable(list);
     }
@@ -185,4 +186,75 @@ public class LabXxpClassifyController extends BaseController
         return ResultData.result(xxpClassifyService.deleteXxpClassifyById(id));
     }
 
+    @ApiOperation(value = "是否有子类")
+    @GetMapping(value = "/delCheck")
+    public TableDataInfo<XxpClassifyDetailVO> delCheck(Long id)
+    {
+        return getDataTable(xxpClassifyService.delCheck(id));
+    }
+
+    /***
+     * 根据实验室id查询实验室安全类目
+     * @param subJectId
+     * @return
+     */
+    @ApiOperation(value = "根据实验室id查询实验室安全类目")
+    @GetMapping(value = "/getClassifyBySubId")
+    public List<ClassifyVO> getSubClassify(Long subJectId){
+        List<ClassifyVO> classifyVOList = new ArrayList<>();
+        try {
+            //查询所有有效类目配置
+            XxpClassify classify = new XxpClassify();
+            classify.setIsShow(1);
+            classify.setIsSpecial(1);
+            classify.setRemark("sort");
+            List<XxpClassify> classifyList = xxpClassifyService.selectXxpClassifyList(classify);
+            for (XxpClassify xcf:classifyList) {
+                ClassifyVO classifyVO = new ClassifyVO();
+                classifyVO.setId(xcf.getId());
+                classifyVO.setClassifyName(xcf.getClassifyName());
+                classifyVO.setClassifyType(xcf.getClassifyType());
+                classifyVOList.add(classifyVO);
+
+                //查询公共配置
+                XxpClassifyDetailVO detailVO = new XxpClassifyDetailVO();
+                detailVO.setInfoClassifyId(xcf.getId());
+                detailVO.setIsCollective(1);
+                //类目下公共所有子项类目
+                List<XxpClassifyDetailVO> allDetailList= xxpClassifyDetailedService.selectXxpClassifyDetailedList(detailVO);
+                List<ClassifyDetailVO> showPublickList= new ArrayList<>();
+                for (XxpClassifyDetailVO vo:allDetailList ) {
+                    ClassifyDetailVO detailVO1 = new ClassifyDetailVO();
+                    detailVO1.setId(vo.getId());
+                    detailVO1.setInfoClassifyId(vo.getInfoClassifyId());
+                    detailVO1.setInfoName(vo.getInfoName());
+                    detailVO1.setInfoType(vo.getInfoType());
+                    detailVO1.setInfoContent(vo.getInfoContent());
+                    showPublickList.add(detailVO1);
+                }
+
+                if(StringUtils.isNotNull(subJectId)){
+                    detailVO.setSubjectId(subJectId);
+                    //实验室私有配置类目
+                    List<XxpClassifyDetailVO> detailVOList= xxpClassifyDetailedService.selectXxpClassifyDetailedByPara(detailVO);
+                    List<ClassifyDetailVO> showprivateList = new ArrayList<>();
+                    for (XxpClassifyDetailVO vo:detailVOList) {
+                        ClassifyDetailVO classifyDetailVO = new ClassifyDetailVO();
+                        classifyDetailVO.setId(vo.getId());
+                        classifyDetailVO.setInfoClassifyId(vo.getInfoClassifyId());
+                        classifyDetailVO.setInfoName(vo.getInfoName());
+                        classifyDetailVO.setInfoType(vo.getInfoType());
+                        classifyDetailVO.setInfoContent(vo.getInfoContent());
+                        showprivateList.add(classifyDetailVO);
+                    }
+                    classifyVO.setPrivateList(showprivateList);
+                }
+                classifyVO.setPublicList(showPublickList);
+            }
+        }catch (Exception e){
+            logger.info("查询实验室下的安全类目信息异常:"+e);
+        }
+        return classifyVOList;
+    }
+
 }

+ 26 - 5
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabXxpDutyController.java

@@ -4,6 +4,7 @@ import com.zd.common.core.annotation.Log;
 import com.zd.common.core.annotation.PreAuthorize;
 import com.zd.common.core.log.BusinessType;
 import com.zd.common.core.security.TokenService;
+import com.zd.common.core.utils.DateUtils;
 import com.zd.common.core.utils.ExcelUtil;
 import com.zd.common.core.utils.FileConfigUtils;
 import com.zd.common.core.utils.StringUtils;
@@ -68,10 +69,13 @@ public class LabXxpDutyController extends BaseController
     {
         //startPage();
         List<XxpDutyVO> list = xxpDutyService.selectDutyYmdById(xxpDuty);
+        XxpDuty du  = new XxpDuty();
         for (XxpDutyVO duty:list) {
-            XxpDutyVO vo= xxpDutyService.selectSubAndUserSum(duty.getDutyTime());
+            du.setDeptId(xxpDuty.getDeptId());
+            du.setDutyTime(duty.getDutyTime());
+            XxpDutyVO vo= xxpDutyService.selectSubAndUserSum(du);
             duty.setSubSum(vo.getSubSum());
-            duty.setUserSum(vo.getSubSum());
+            duty.setUserSum(vo.getUserSum());
         }
         return getDataTable(list);
     }
@@ -116,6 +120,7 @@ public class LabXxpDutyController extends BaseController
         for (XxpDutyVO duty:listVo) {
             newDuty.setSubjectId(duty.getSubjectId());
             newDuty.setDutyTime(xxpDuty.getDutyTime());
+            newDuty.setDeptId(xxpDuty.getDeptId());
             List<XxpDuty> list =xxpDutyService.selectXxpDutyList(newDuty);
             duty.setDutyList(list);
         }
@@ -181,6 +186,12 @@ public class LabXxpDutyController extends BaseController
     public ResultData<List<Map<String,Object>>> list(Long labId,String dateTime)
     {
         List<Map<String,Object>> list = xxpDutyService.selectDutyUser(labId,dateTime);
+        for(Map<String,Object> map:list){
+            if(StringUtils.isNotNull(map.get("avatar"))){
+                String avatar=fileConfigUtils.getFileDomainApp() + map.get("avatar");
+                map.put("avatar",avatar);
+            }
+        }
         return ResultData.success(list);
     }
 
@@ -193,11 +204,21 @@ public class LabXxpDutyController extends BaseController
         Optional.ofNullable(list).orElseGet(Collections::emptyList)
                 .stream()
                 .forEach(a->{
-                    if(StringUtils.isNotNull(a.get("userImg"))){
-                        String url = fileConfigUtils.getFileDomainApp() + a.get("userImg");
-                        a.put("userImg",url);
+                    if(StringUtils.isNotNull(a.get("avatar"))){
+                        String url = fileConfigUtils.getFileDomainApp() + a.get("avatar");
+                        a.put("avatar",url);
                     }
                 });
         return ResultData.success(list);
     }
+
+    /***
+     *
+     * 获取当前时间
+     */
+    @GetMapping(value = "/getDate")
+    public ResultData getDate()
+    {
+        return ResultData.success(DateUtils.getDate());
+    }
 }

+ 3 - 3
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabXxpInspectionController.java

@@ -227,9 +227,9 @@ public class LabXxpInspectionController extends BaseController
         Optional.ofNullable(list).orElseGet(Collections::emptyList)
                 .stream()
                 .forEach(a->{
-                    if(StringUtils.isNotNull(a.get("userImg"))){
-                        String url = fileConfigUtils.getFileDomainApp() + a.get("userImg");
-                        a.put("userImg",url);
+                    if(StringUtils.isNotNull(a.get("avatar"))){
+                        String url = fileConfigUtils.getFileDomainApp() + a.get("avatar");
+                        a.put("avatar",url);
                     }
                 });
         return ResultData.success(list);

+ 163 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabXxpUserAuthController.java

@@ -0,0 +1,163 @@
+package com.zd.laboratory.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.zd.common.core.annotation.Log;
+import com.zd.common.core.annotation.PreAuthorize;
+import com.zd.common.core.log.BusinessType;
+import com.zd.common.core.redis.RedisService;
+import com.zd.common.core.security.TokenService;
+import com.zd.common.core.utils.DictUtils;
+import com.zd.common.core.utils.ExcelUtil;
+import com.zd.common.core.web.controller.BaseController;
+import com.zd.laboratory.domain.XxpUserAuth;
+import com.zd.laboratory.service.IXxpUserAuthService;
+import com.zd.model.domain.ResultData;
+import com.zd.model.domain.per.PerFun;
+import com.zd.model.domain.per.PerPrefix;
+import com.zd.model.page.TableDataInfo;
+import com.zd.system.api.entity.SysDictData;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.*;
+
+/**
+ * 信息牌人员权限 Controller
+ *
+ * @author xxf
+ * @date 2023-03-22
+ */
+@RestController
+@Api(tags = "【信息牌人员权限】")
+@RequestMapping("/XxpUserAuth")
+public class LabXxpUserAuthController extends BaseController
+{
+    @Autowired
+    private IXxpUserAuthService xxpUserAuthService;
+
+    @Autowired
+    private TokenService tokenService;
+
+    @Autowired
+    RedisService redisService;
+
+    /**
+     * 查询列表
+     */
+    @PreAuthorize(hasPermi = PerPrefix.LABORATORY_XXPUSERAUTH + PerFun.LIST)
+    @GetMapping("/list")
+    @ApiOperation(value = "查询列表")
+    public TableDataInfo<XxpUserAuth> list(XxpUserAuth xxpUserAuth)
+    {
+        startPage();
+        List<XxpUserAuth> list = xxpUserAuthService.selectXxpUserAuthList(xxpUserAuth);
+        return getDataTable(list);
+    }
+
+    /**
+     * 查询授权类型列表
+     */
+    @GetMapping("/authTypelist")
+    @ApiOperation(value = "查询授权类型列表")
+    public TableDataInfo<SysDictData> authTypelist()
+    {
+        List<SysDictData> dictDataList = DictUtils.getDictCache("xxp_auth_type");
+        return getDataTable(dictDataList);
+    }
+
+    /**
+     * 导出列表
+     */
+    @ApiOperation(value = "导出列表")
+    @PreAuthorize(hasPermi = PerPrefix.LABORATORY_XXPUSERAUTH + PerFun.EXPORT)
+    @Log(title = "信息牌人员权限", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, XxpUserAuth xxpUserAuth) throws IOException
+    {
+        List<XxpUserAuth> list = xxpUserAuthService.selectXxpUserAuthList(xxpUserAuth);
+        ExcelUtil<XxpUserAuth> util = new ExcelUtil<XxpUserAuth>(XxpUserAuth.class);
+        util.exportExcel(response, list, "巡查数据");
+    }
+
+    /**
+     * 获取详细
+     */
+    @ApiOperation(value = "获取详细")
+    @PreAuthorize(hasPermi = PerPrefix.LABORATORY_XXPUSERAUTH + PerFun.QUERY)
+    @GetMapping(value = "/{id}")
+    public ResultData<XxpUserAuth> getInfo(@PathVariable("id") Long id)
+    {
+        return ResultData.success(xxpUserAuthService.selectXxpUserAuthById(id));
+    }
+
+
+    /**
+     * 新增
+     */
+    @ApiOperation(value = "新增")
+    @PreAuthorize(hasPermi = PerPrefix.LABORATORY_XXPUSERAUTH + PerFun.ADD)
+    @Log(title = "信息牌人员权限", businessType = BusinessType.INSERT)
+    @PostMapping
+    public ResultData add(@RequestBody XxpUserAuth xxpUserAuth)
+    {
+        return ResultData.result(xxpUserAuthService.insertXxpUserAuth(xxpUserAuth));
+    }
+
+    /****
+     * 批量新增
+     * @param xxpUserAuth
+     * @return
+     */
+    @ApiOperation(value = "新增")
+    @PreAuthorize(hasPermi = PerPrefix.LABORATORY_XXPUSERAUTH + PerFun.ADD)
+    @Log(title = "信息牌人员权限", businessType = BusinessType.INSERT)
+    @PostMapping("/addAuth")
+    public ResultData addAuth(@RequestBody XxpUserAuth xxpUserAuth)
+    {
+        return ResultData.result(xxpUserAuthService.insertXxpUserAuthBatch(xxpUserAuth));
+    }
+
+    /**
+     * 修改巡查
+     */
+    @ApiOperation(value = "修改巡查")
+    @PreAuthorize(hasPermi = PerPrefix.LABORATORY_XXPUSERAUTH + PerFun.EDIT)
+    @Log(title = "信息牌人员权限", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public ResultData edit(@RequestBody XxpUserAuth xxpUserAuth)
+    {
+        return  ResultData.result(xxpUserAuthService.updateXxpUserAuth(xxpUserAuth));
+    }
+
+    /**
+     * 删除
+     */
+    @ApiOperation(value = "删除")
+    @PreAuthorize(hasPermi = PerPrefix.LABORATORY_XXPUSERAUTH + PerFun.REMOVE)
+    @Log(title = "信息牌人员权限", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public ResultData remove(@PathVariable Long[] ids)
+    {
+        return ResultData.result(xxpUserAuthService.deleteXxpUserAuthByIds(ids));
+    }
+
+    /**
+     * 根据id删除
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "根据id删除巡查")
+    @PreAuthorize(hasPermi = PerPrefix.LABORATORY_XXPUSERAUTH + PerFun.REMOVE)
+    @Log(title = "信息牌人员权限", businessType = BusinessType.DELETE)
+    @PostMapping("/{id}")
+    public ResultData remove(@PathVariable Long id)
+    {
+        return ResultData.result(xxpUserAuthService.deleteXxpUserAuthById(id));
+    }
+
+}

+ 9 - 9
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/LabSubject.java

@@ -223,17 +223,17 @@ public class LabSubject extends BaseEntity implements QCInterface {
     /***
      *巡查人员,穿戴检查可跳过(0 否,1 是)
      */
-    private String inspectSkipped;
+    private Integer inspectSkipped;
 
     /***
      *巡查人员,穿戴检查识别上限
      */
-    private String inspectCheckCount;
+    private Integer inspectCheckCount;
 
     /***
      *巡查人员,签到有效时间
      */
-    private String inspectSignTime;
+    private Integer inspectSignTime;
 
     /***
      *实验室详情
@@ -580,27 +580,27 @@ public class LabSubject extends BaseEntity implements QCInterface {
         this.inspectCheckIn = inspectCheckIn;
     }
 
-    public String getInspectSkipped() {
+    public Integer getInspectSkipped() {
         return inspectSkipped;
     }
 
-    public void setInspectSkipped(String inspectSkipped) {
+    public void setInspectSkipped(Integer inspectSkipped) {
         this.inspectSkipped = inspectSkipped;
     }
 
-    public String getInspectCheckCount() {
+    public Integer getInspectCheckCount() {
         return inspectCheckCount;
     }
 
-    public void setInspectCheckCount(String inspectCheckCount) {
+    public void setInspectCheckCount(Integer inspectCheckCount) {
         this.inspectCheckCount = inspectCheckCount;
     }
 
-    public String getInspectSignTime() {
+    public Integer getInspectSignTime() {
         return inspectSignTime;
     }
 
-    public void setInspectSignTime(String inspectSignTime) {
+    public void setInspectSignTime(Integer inspectSignTime) {
         this.inspectSignTime = inspectSignTime;
     }
 

+ 1 - 1
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/XxpClassifySubject.java

@@ -46,7 +46,7 @@ public class XxpClassifySubject extends BaseEntity {
      */
     @Excel(name = "详情id")
     @ApiModelProperty(value = "详情id")
-    private String classifyDetailId;
+    private Long classifyDetailId;
 
     /***
      * 开始时间

+ 171 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/XxpUserAuth.java

@@ -0,0 +1,171 @@
+package com.zd.laboratory.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.zd.model.annotation.Excel;
+import com.zd.model.entity.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+import org.hibernate.validator.constraints.Length;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 信息牌人员权限表 对象 xxp_user_auth
+ *
+ * @author xxf
+ * @date 2023-03-22
+ */
+@ApiModel("信息牌人员权限")
+@Data
+@Accessors(chain = true)
+@ToString(callSuper = true)
+public class XxpUserAuth extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 人员id
+     */
+    @Excel(name = "人员id")
+    @Length(message = "人员id长度不能超过20")
+    @ApiModelProperty(value = "人员id")
+    private Long userId;
+
+    /**
+     * 人员姓名
+     */
+    @Excel(name = "人员姓名")
+    @ApiModelProperty(value = "人员姓名")
+    private String userName;
+
+
+    /**
+     * 实验室id
+     */
+    @Excel(name = "实验室id")
+    @ApiModelProperty(value = "实验室id")
+    private Integer subjectId;
+
+    /**
+     * 实验室名称
+     */
+    @Excel(name = "实验室名称")
+    @ApiModelProperty(value = "实验室名称")
+    private String subjectName;
+
+    /**
+     * 授权方式
+     */
+    @Excel(name = "授权方式")
+    @ApiModelProperty(value = "授权方式")
+    private String  authType;
+
+    /**
+     * 人员类型
+     */
+    @Excel(name = "人员类型")
+    @ApiModelProperty(value = "人员类型")
+    private String userType;
+
+    /**
+     * 部门id
+     */
+    @Excel(name = "部门id ")
+    @ApiModelProperty(value = "部门id ")
+    private Long deptId;
+
+    /**
+     * 部门名称
+     */
+    @Excel(name = "部门名称 ")
+    @ApiModelProperty(value = "部门名称 ")
+    private String deptName;
+
+    /**
+     * 指纹
+     */
+    @Excel(name = "指纹 ")
+    @ApiModelProperty(value = "指纹 ")
+    private String finger;
+
+    /**
+     * 密码
+     */
+    @Excel(name = "密码")
+    @ApiModelProperty(value = "密码")
+    private String userPassword;
+
+    /**
+     * 硬件id
+     */
+    @Excel(name = "硬件id")
+    @ApiModelProperty(value = "硬件id")
+    private Long hardwareId;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+
+    /***
+     * 开始时间
+     */
+    private String beginTime;
+
+    /***
+     * 结束时间
+     */
+    private String endTime;
+
+    List<XxpUserAuth> userAuthList;
+
+    @Override
+    public Long getUserId() {
+        return userId;
+    }
+
+    @Override
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    @Override
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    @Override
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    @Override
+    public Long getDeptId() {
+        return deptId;
+    }
+
+    @Override
+    public void setDeptId(Long deptId) {
+        this.deptId = deptId;
+    }
+
+    @Override
+    public String getDeptName() {
+        return deptName;
+    }
+
+    @Override
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+}

+ 11 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/vo/LabSubjectVO.java

@@ -118,6 +118,9 @@ public class LabSubjectVO extends LabSubject {
     @ApiModelProperty(name = "位置")
     private String posi;
 
+    @ApiModelProperty(name = "电子信息牌Id")
+    private Integer xxpCardInfoId;
+
     public String getSenseState() {
         return senseState;
     }
@@ -399,4 +402,12 @@ public class LabSubjectVO extends LabSubject {
     public void setPosi(String posi) {
         this.posi = posi;
     }
+
+    public Integer getXxpCardInfoId() {
+        return xxpCardInfoId;
+    }
+
+    public void setXxpCardInfoId(Integer xxpCardInfoId) {
+        this.xxpCardInfoId = xxpCardInfoId;
+    }
 }

+ 10 - 10
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/XxpDutyMapper.java

@@ -17,14 +17,6 @@ import java.util.Map;
 public interface XxpDutyMapper
 {
     /**
-     * 查询
-     *
-     * @param id 主键
-     * @return 值班信息
-     */
-    public XxpDuty selectXxpDutyById(Long id);
-
-    /**
      * 查询列表
      *
      * @param xxpDuty 值班信息
@@ -32,6 +24,14 @@ public interface XxpDutyMapper
      */
     public List<XxpDuty> selectXxpDutyList(XxpDuty xxpDuty);
 
+    /**
+     * 查询
+     *
+     * @param id 主键
+     * @return 值班信息
+     */
+    public XxpDuty selectXxpDutyById(Long id);
+
 
     /**
      * 新增值班信息
@@ -91,10 +91,10 @@ public interface XxpDutyMapper
 
     /***
      * 查询某个具体时间下的实验室和人员总数
-     * @param dutyTime
+     * @param xxpDuty
      * @return
      */
-    public XxpDutyVO selectSubAndUserSum(Date dutyTime);
+    public XxpDutyVO selectSubAndUserSum(XxpDuty xxpDuty);
 
     /***
      * 根据时间查询实验室

+ 68 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/XxpUserAuthMapper.java

@@ -0,0 +1,68 @@
+package com.zd.laboratory.mapper;
+
+import com.zd.laboratory.domain.XxpUserAuth;
+import com.zd.laboratory.domain.vo.XxpDutyVO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 信息牌人员权限 Mapper接口
+ *
+ * @author xxf
+ * @date 2023-03-22
+ */
+public interface XxpUserAuthMapper
+{
+    /**
+     * 查询
+     *
+     * @param id 主键
+     * @return 信息牌人员权限
+     */
+    public XxpUserAuth selectXxpUserAuthById(Long id);
+
+    /**
+     * 查询列表
+     *
+     * @param XxpUserAuth 信息牌人员权限
+     * @return 白名单集合
+     */
+    public List<XxpUserAuth> selectXxpUserAuthList(XxpUserAuth XxpUserAuth);
+
+
+    /**
+     * 新增
+     *
+     * @param XxpUserAuth 信息牌人员权限
+     * @return 结果
+     */
+    public int insertXxpUserAuth(XxpUserAuth XxpUserAuth);
+
+    /**
+     * 修改
+     *
+     * @param XxpUserAuth 信息牌人员权限
+     * @return 结果
+     */
+    public int updateXxpUserAuth(XxpUserAuth XxpUserAuth);
+
+    /**
+     * 删除
+     *
+     * @param id 主键
+     * @return 结果
+     */
+    public int deleteXxpUserAuthById(Long id);
+
+    /**
+     * 批量删除
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteXxpUserAuthByIds(Long[] ids);
+
+}

+ 7 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/IXxpClassifyService.java

@@ -4,6 +4,7 @@ import com.zd.laboratory.domain.LabWhitelist;
 import com.zd.laboratory.domain.XxpClassify;
 import com.zd.laboratory.domain.XxpClassifyDetail;
 import com.zd.laboratory.domain.vo.LabWhitelistVO;
+import com.zd.laboratory.domain.vo.XxpClassifyDetailVO;
 
 import java.util.List;
 
@@ -73,4 +74,10 @@ public interface IXxpClassifyService
      * @return
      */
     List<XxpClassify> selectXxpClassifySubjectById(Long id);
+    /***
+     * 查看该类目下是否有子类
+     * @param classifyId
+     * @return
+     */
+    public List<XxpClassifyDetailVO> delCheck(Long classifyId);
 }

+ 2 - 2
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/IXxpDutyService.java

@@ -85,10 +85,10 @@ public interface IXxpDutyService
 
     /***
      * 查询某个具体时间下的实验室和人员总数
-     * @param dutyTime
+     * @param xxpDuty
      * @return
      */
-    public XxpDutyVO selectSubAndUserSum(Date dutyTime);
+    public XxpDutyVO selectSubAndUserSum(XxpDuty xxpDuty);
 
     /***
      * 根据时间查询实验室

+ 79 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/IXxpUserAuthService.java

@@ -0,0 +1,79 @@
+package com.zd.laboratory.service;
+
+import com.zd.laboratory.domain.XxpDuty;
+import com.zd.laboratory.domain.XxpInspection;
+import com.zd.laboratory.domain.XxpUserAuth;
+import com.zd.laboratory.domain.vo.XxpInspectionVO;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 信息牌人员权限 Service接口
+ *
+ * @author zd
+ * @date 2023-03-26
+ */
+public interface IXxpUserAuthService
+{
+    /**
+     * 查询
+     *
+     * @param id 主键
+     * @return
+     */
+    public XxpUserAuth selectXxpUserAuthById(Long id);
+
+    /**
+     * 查询列表
+     *
+     * @param xxpUserAuth
+     * @return 集合
+     */
+    public List<XxpUserAuth> selectXxpUserAuthList(XxpUserAuth xxpUserAuth);
+
+
+
+    /**
+     * 新增
+     *
+     * @param xxpUserAuth
+     * @return 结果
+     */
+    public int insertXxpUserAuth(XxpUserAuth xxpUserAuth);
+
+
+    /**
+     * 新增
+     *
+     * @param xxpUserAuth
+     * @return 结果
+     */
+    public int insertXxpUserAuthBatch(XxpUserAuth xxpUserAuth);
+
+
+    /**
+     * 修改
+     *
+     * @param xxpUserAuth
+     * @return 结果
+     */
+    public int updateXxpUserAuth(XxpUserAuth xxpUserAuth);
+
+    /**
+     * 批量删除
+     *
+     * @param ids 需要删除的主键集合
+     * @return 结果
+     */
+    public int deleteXxpUserAuthByIds(Long[] ids);
+
+    /**
+     * 删除信息
+     *
+     * @param id 主键
+     * @return 结果
+     */
+    public int deleteXxpUserAuthById(Long id);
+
+}

+ 42 - 10
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabSubjectServiceImpl.java

@@ -6,13 +6,11 @@ import com.zd.common.core.utils.Assert;
 import com.zd.common.core.utils.DateUtils;
 import com.zd.common.core.utils.SecurityUtils;
 import com.zd.laboratory.api.vo.LabSubClassVO;
-import com.zd.laboratory.domain.LabHazardSubjectRelation;
-import com.zd.laboratory.domain.LabQpSubjectRelation;
-import com.zd.laboratory.domain.LabSubject;
-import com.zd.laboratory.domain.XxpClassifySubject;
+import com.zd.laboratory.domain.*;
 import com.zd.laboratory.domain.vo.LabClassifiedVo;
 import com.zd.laboratory.domain.vo.LabClasstypeVo;
 import com.zd.laboratory.domain.vo.LabSubjectVO;
+import com.zd.laboratory.domain.vo.XxpClassifyDetailVO;
 import com.zd.laboratory.mapper.LabHazardSubjectRelationMapper;
 import com.zd.laboratory.mapper.LabQpSubjectRelationMapper;
 import com.zd.laboratory.mapper.LabSubjectMapper;
@@ -183,7 +181,22 @@ public class LabSubjectServiceImpl implements ILabSubjectService {
     @Override
     public int insertLabSubject(LabSubject labSubject) {
         labSubject.setCreateTime(DateUtils.getNowDate());
-        return labSubjectMapper.insertLabSubject(labSubject);
+        int flg = labSubjectMapper.insertLabSubject(labSubject);
+
+        //实验室类目信息处理
+        List<XxpClassify> classifyList = labSubject.getClassifyList();
+        if(classifyList!=null && classifyList.size()>0){
+            for (XxpClassify cfl:classifyList ) {
+                for (XxpClassifyDetailVO detailVo:cfl.getPrivateDetailList()) {
+                    XxpClassifySubject subject = new XxpClassifySubject();
+                    subject.setClassifyId(cfl.getId());
+                    subject.setClassifyDetailId(detailVo.getId());
+                    subject.setSubjectId(labSubject.getId());
+                    classifySubjectService.insertClassifySubject(subject);
+                }
+            }
+        }
+        return flg;
     }
 
     /**
@@ -215,14 +228,33 @@ public class LabSubjectServiceImpl implements ILabSubjectService {
 //            labHazardSubjectRelationMapper.deleteBySubId(labSubject.getId());
 //        }
 
-        List<XxpClassifySubject> classifySubjectList = labSubject.getClassifySubjectList();
+        //安全类目信息修改
+       /* List<XxpClassifySubject> classifySubjectList = labSubject.getClassifySubjectList();
         if(classifySubjectList!=null && classifySubjectList.size()>0){
             //删除关系
             classifySubjectService.deleteBySubjectId(labSubject.getId());
-        }
-        //安全类目关系入库
-        for (XxpClassifySubject cs:classifySubjectList) {
-            classifySubjectService.insertClassifySubject(cs);
+            //安全类目关系入库
+            for (XxpClassifySubject cs:classifySubjectList) {
+                //XxpClassifySubject classifySubject = classifySubjectService.selectClassifySubjectById(cs.getId());
+                    classifySubjectService.insertClassifySubject(cs);
+
+            }
+        }*/
+
+        //实验室类目信息处理
+        List<XxpClassify> classifyList = labSubject.getClassifyList();
+        if(classifyList!=null && classifyList.size()>0){
+            //删除关系
+            classifySubjectService.deleteBySubjectId(labSubject.getId());
+            for (XxpClassify cfl:classifyList ) {
+                for (XxpClassifyDetailVO detailVo:cfl.getPrivateDetailList()) {
+                    XxpClassifySubject subject = new XxpClassifySubject();
+                    subject.setClassifyId(cfl.getId());
+                    subject.setClassifyDetailId(detailVo.getId());
+                    subject.setSubjectId(labSubject.getId());
+                    classifySubjectService.insertClassifySubject(subject);
+                }
+            }
         }
         return labSubjectMapper.updateLabSubject(labSubject);
     }

+ 33 - 3
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/XxpCardInfoServiceImpl.java

@@ -1,12 +1,14 @@
 package com.zd.laboratory.service.impl;
 
+import com.zd.common.core.exception.ServiceException;
 import com.zd.common.core.security.TokenService;
+import com.zd.common.core.utils.StringUtils;
 import com.zd.laboratory.domain.XxpCardInfo;
 import com.zd.laboratory.domain.XxpInspection;
+import com.zd.laboratory.domain.XxpUserAuth;
 import com.zd.laboratory.mapper.XxpCardInfoMapper;
-import com.zd.laboratory.mapper.XxpInspectionMapper;
+import com.zd.laboratory.mapper.XxpUserAuthMapper;
 import com.zd.laboratory.service.IXxpCardInfoService;
-import com.zd.laboratory.service.IXxpInspectionService;
 import com.zd.model.entity.SysUser;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -29,6 +31,8 @@ public class XxpCardInfoServiceImpl implements IXxpCardInfoService
     @Autowired
     private TokenService tokenService;
 
+    @Autowired
+    private XxpUserAuthMapper xxpUserAuthMapper;
 
     /**
      * 查询电子信息牌
@@ -60,12 +64,24 @@ public class XxpCardInfoServiceImpl implements IXxpCardInfoService
      */
     @Override
     public int insertXxpCardInfo(XxpCardInfo xxpCardInfo) {
+        //一实验室只能存在一个电子信息牌
+        XxpCardInfo info = new XxpCardInfo();
+        info.setSubjectId(xxpCardInfo.getSubjectId());
+        List<XxpCardInfo> list = xxpCardInfoMapper.selectXxpCardInfoList(info);
+        if(list.size()>0){
+            throw  new ServiceException("该实验室已配置信息牌!");
+        }
         SysUser sysUser = tokenService.getLoginUser().getSysUser();
         xxpCardInfo.setCreateBy(sysUser.getNickName());
         xxpCardInfo.setCreateTime(new Date());
         xxpCardInfo.setUserId(sysUser.getUserId());
         xxpCardInfo.setDeptId(sysUser.getDept().getDeptId());
         xxpCardInfo.setDeptName(sysUser.getDept().getDeptName());
+        if(StringUtils.isNull(xxpCardInfo.getLocation()) ){
+            xxpCardInfo.setCardName("电子信息牌");
+        }else{
+            xxpCardInfo.setCardName(xxpCardInfo.getLocation()+"电子信息牌");
+        }
         return xxpCardInfoMapper.insertXxpCardInfo(xxpCardInfo);
     }
 
@@ -91,6 +107,15 @@ public class XxpCardInfoServiceImpl implements IXxpCardInfoService
      */
     @Override
     public int deleteXxpCardInfoByIds(Long[] ids) {
+        for (Long id:ids) {
+            XxpUserAuth auth = new XxpUserAuth();
+            auth.setHardwareId(id);
+            List<XxpUserAuth> list = xxpUserAuthMapper.selectXxpUserAuthList(auth);
+            if(list.size()>0){
+                XxpCardInfo info= xxpCardInfoMapper.selectXxpCardInfoById(id);
+                throw new ServiceException("信息牌编号:"+info.getCardName()+",下存在授权人员!");
+            }
+        }
 
         return xxpCardInfoMapper.deleteXxpCardInfoByIds(ids);
     }
@@ -103,7 +128,12 @@ public class XxpCardInfoServiceImpl implements IXxpCardInfoService
      */
     @Override
     public int deleteXxpCardInfoById(Long id) {
-
+        XxpUserAuth auth = new XxpUserAuth();
+        auth.setHardwareId(id);
+        List<XxpUserAuth> list = xxpUserAuthMapper.selectXxpUserAuthList(auth);
+        if(list.size()>0){
+            throw new ServiceException("信息牌下存在授权人员!");
+        }
         return xxpCardInfoMapper.deleteXxpCardInfoById(id);
     }
 }

+ 12 - 3
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/XxpClassifyDetailedServiceImpl.java

@@ -2,6 +2,7 @@ package com.zd.laboratory.service.impl;
 
 import com.zd.common.core.exception.ServiceException;
 import com.zd.common.core.security.TokenService;
+import com.zd.common.core.utils.FileConfigUtils;
 import com.zd.laboratory.api.vo.LabXxpClassifyVo;
 import com.zd.laboratory.domain.XxpClassify;
 import com.zd.common.core.utils.StringUtils;
@@ -36,6 +37,9 @@ public class XxpClassifyDetailedServiceImpl implements IXxpClassifyDetailedServi
     @Autowired
     private TokenService tokenService;
 
+    @Autowired
+    private FileConfigUtils fileConfigUtils;
+
 
     /**
      * 查询安全信息类目详情
@@ -130,19 +134,24 @@ public class XxpClassifyDetailedServiceImpl implements IXxpClassifyDetailedServi
         List<XxpClassifyDetail> classifyDetailList=classifyDetailedMapper.selectXxpClassifyBySubjectId(id);
         for(XxpClassify xxpClassify:xxpClassifyList){
             LabXxpClassifyVo labXxpClassifyVo=new LabXxpClassifyVo();
+            labXxpClassifyVo.setClassifyType(xxpClassify.getClassifyType());
             labXxpClassifyVo.setShowColour(xxpClassify.getShowColour());
             labXxpClassifyVo.setIsShow(xxpClassify.getIsShow());
             labXxpClassifyVo.setClassifyName(xxpClassify.getClassifyName());
             labXxpClassifyVo.setIsSpecial(xxpClassify.getIsSpecial());
             labXxpClassifyVo.setSort(xxpClassify.getSort());
             labXxpClassifyVo.setIsSpecial(xxpClassify.getIsSpecial());
-            List<String> StrList=new ArrayList<>();
+            List<String> strList=new ArrayList<>();
             for(XxpClassifyDetail classifyDetail:classifyDetailList){
                 if(xxpClassify.getId().intValue()==classifyDetail.getInfoClassifyId().intValue()){
-                    StrList.add(classifyDetail.getInfoContent());
+                    if(xxpClassify.getClassifyType()==2){
+                        strList.add(fileConfigUtils.getFileDomainApp()+classifyDetail.getInfoContent());
+                    }else{
+                        strList.add(classifyDetail.getInfoContent());
+                    }
                 }
             }
-            labXxpClassifyVo.setClassifyList(StrList);
+            labXxpClassifyVo.setClassifyList(strList);
             xxpClassifyVoList.add(labXxpClassifyVo);
         }
         return xxpClassifyVoList;

+ 1 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/XxpClassifyServiceImpl.java

@@ -131,6 +131,7 @@ public class XxpClassifyServiceImpl implements IXxpClassifyService
      * @param classifyId
      * @return
      */
+    @Override
     public List<XxpClassifyDetailVO> delCheck(Long classifyId){
         XxpClassifyDetailVO detail = new XxpClassifyDetailVO();
         detail.setInfoClassifyId(classifyId);

+ 25 - 17
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/XxpDutyServiceImpl.java

@@ -81,24 +81,32 @@ public class XxpDutyServiceImpl implements IXxpDutyService
             throw new ServiceException("值班人员为空");
         }
 
+        XxpDuty duty = new XxpDuty();
         SysUser sysUser = tokenService.getLoginUser().getSysUser();
         for (int i=0;i<xxpDutyVO.getDateList().size();i++){
             for (int o=0;o<xxpDutyVO.getSubjectList().size();o++){
                 for (int p=0;p<xxpDutyVO.getSysUserList().size();p++){
-                    //数据封装
-                    xxpDutyVO.setUserName(xxpDutyVO.getSysUserList().get(p).getNickName())
-                            .setUserPhone(xxpDutyVO.getSysUserList().get(p).getPhonenumber())
-                            .setUserImg(xxpDutyVO.getSysUserList().get(p).getAvatar())
-                            .setUserType(xxpDutyVO.getSysUserList().get(p).getUserType())
-                            .setSubjectId(xxpDutyVO.getSubjectList().get(o).getId())
-                            .setSubjectName(xxpDutyVO.getSubjectList().get(o).getName())
-                            .setDutyTime(DateUtils.dateTime(DateUtils.YYYY_MM_DD,xxpDutyVO.getDateList().get(i)))
-                            .setCreateById(sysUser.getUserId()).setCreateBy(sysUser.getNickName());
-                    xxpDutyVO.setUserId(xxpDutyVO.getSysUserList().get(p).getUserId());
-                    xxpDutyVO.setCreateTime(new Date());
-                    xxpDutyVO.setDeptId(xxpDutyVO.getSysUserList().get(p).getDept().getDeptId());
-                    xxpDutyVO.setDeptName(xxpDutyVO.getSysUserList().get(p).getDept().getDeptName());
-                    xxpDutyMapper.insertXxpDuty(xxpDutyVO);
+                    //检测值班人员是否已经存在
+                    duty.setSubjectId(xxpDutyVO.getSubjectList().get(o).getId());
+                    duty.setDutyTime(DateUtils.dateTime(DateUtils.YYYY_MM_DD,xxpDutyVO.getDateList().get(i)));
+                    duty.setUserId(xxpDutyVO.getSysUserList().get(p).getUserId());
+                    List<XxpDuty> list = xxpDutyMapper.selectXxpDutyList(duty);
+                    if(list.size()==0){
+                        //数据封装
+                        xxpDutyVO.setUserName(xxpDutyVO.getSysUserList().get(p).getNickName())
+                                .setUserPhone(xxpDutyVO.getSysUserList().get(p).getPhonenumber())
+                                .setUserImg(xxpDutyVO.getSysUserList().get(p).getAvatar())
+                                .setUserType(xxpDutyVO.getSysUserList().get(p).getUserType())
+                                .setSubjectId(xxpDutyVO.getSubjectList().get(o).getId())
+                                .setSubjectName(xxpDutyVO.getSubjectList().get(o).getName())
+                                .setDutyTime(DateUtils.dateTime(DateUtils.YYYY_MM_DD,xxpDutyVO.getDateList().get(i)))
+                                .setCreateById(sysUser.getUserId()).setCreateBy(sysUser.getNickName());
+                        xxpDutyVO.setUserId(xxpDutyVO.getSysUserList().get(p).getUserId());
+                        xxpDutyVO.setCreateTime(new Date());
+                        xxpDutyVO.setDeptId(xxpDutyVO.getSubjectList().get(o).getDeptId());
+                        xxpDutyVO.setDeptName(xxpDutyVO.getSubjectList().get(o).getDeptName());
+                        xxpDutyMapper.insertXxpDuty(xxpDutyVO);
+                    }
                 }
             }
         }
@@ -158,12 +166,12 @@ public class XxpDutyServiceImpl implements IXxpDutyService
 
     /***
      * 查询某个具体时间下的实验室和人员总数
-     * @param dutyTime
+     * @param xxpDuty
      * @return
      */
     @Override
-    public XxpDutyVO selectSubAndUserSum(Date dutyTime) {
-        return xxpDutyMapper.selectSubAndUserSum(dutyTime);
+    public XxpDutyVO selectSubAndUserSum(XxpDuty xxpDuty) {
+        return xxpDutyMapper.selectSubAndUserSum(xxpDuty);
     }
 
     /***

+ 143 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/XxpUserAuthServiceImpl.java

@@ -0,0 +1,143 @@
+package com.zd.laboratory.service.impl;
+
+import com.zd.common.core.exception.ServiceException;
+import com.zd.common.core.security.TokenService;
+import com.zd.common.core.utils.DateUtils;
+import com.zd.common.core.utils.StringUtils;
+import com.zd.laboratory.domain.XxpDuty;
+import com.zd.laboratory.domain.XxpUserAuth;
+import com.zd.laboratory.domain.vo.XxpDutyVO;
+import com.zd.laboratory.mapper.XxpDutyMapper;
+import com.zd.laboratory.mapper.XxpUserAuthMapper;
+import com.zd.laboratory.service.IXxpDutyService;
+import com.zd.laboratory.service.IXxpUserAuthService;
+import com.zd.model.entity.SysUser;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 值班Service业务层处理
+ *
+ * @author zd
+ * @date 2022-01-26
+ */
+@Service
+public class XxpUserAuthServiceImpl implements IXxpUserAuthService
+{
+    @Autowired
+    private XxpUserAuthMapper xxpUserAuthMapper;
+
+    @Autowired
+    private TokenService tokenService;
+
+
+    /**
+     * 查询巡查
+     *
+     * @param id 巡查主键
+     * @return 巡查
+     */
+    @Override
+    public XxpUserAuth selectXxpUserAuthById(Long id) {
+        return xxpUserAuthMapper.selectXxpUserAuthById(id);
+    }
+
+    /**
+     * 查询巡查列表
+     *
+     * @param xxpUserAuth 巡查
+     * @return 巡查集合
+     */
+    @Override
+    public List<XxpUserAuth> selectXxpUserAuthList(XxpUserAuth xxpUserAuth) {
+        return xxpUserAuthMapper.selectXxpUserAuthList(xxpUserAuth);
+    }
+
+    /**
+     * 新增巡查
+     *
+     * @param xxpUserAuth 巡查
+     * @return 结果
+     */
+    @Override
+    public int insertXxpUserAuth(XxpUserAuth xxpUserAuth) {
+        SysUser sysUser = tokenService.getLoginUser().getSysUser();
+        xxpUserAuth.setCreateTime(new Date());
+        xxpUserAuth.setCreateBy(sysUser.getNickName());
+        return xxpUserAuthMapper.insertXxpUserAuth(xxpUserAuth);
+    }
+
+    /**
+     * 新增
+     *
+     * @param xxpUserAuth
+     * @return 结果
+     */
+    @Override
+    public int insertXxpUserAuthBatch(XxpUserAuth xxpUserAuth) {
+        if(xxpUserAuth.getUserAuthList()==null){
+            throw  new ServiceException("新增集合不能为空!");
+        }
+
+        XxpUserAuth uauth = new XxpUserAuth();
+        SysUser sysUser = tokenService.getLoginUser().getSysUser();
+        for (XxpUserAuth auth:xxpUserAuth.getUserAuthList()) {
+            uauth.setUserId(auth.getUserId());
+            uauth.setSubjectId(auth.getSubjectId());
+            List<XxpUserAuth> list = xxpUserAuthMapper.selectXxpUserAuthList(uauth);
+            if(list.size()>0){
+                auth.setId(list.get(0).getId());
+                auth.setUpdateTime(new Date());
+                auth.setUpdateBy(sysUser.getNickName());
+                xxpUserAuthMapper.updateXxpUserAuth(auth);
+            }else{
+                auth.setCreateTime(new Date());
+                auth.setCreateBy(sysUser.getNickName());
+                xxpUserAuthMapper.insertXxpUserAuth(auth);
+            }
+
+        }
+        return 1;
+    }
+
+    /**
+     * 修改巡查
+     *
+     * @param xxpUserAuth 巡查
+     * @return 结果
+     */
+    @Override
+    public int updateXxpUserAuth(XxpUserAuth xxpUserAuth) {
+        SysUser sysUser = tokenService.getLoginUser().getSysUser();
+        xxpUserAuth.setUpdateTime(new Date());
+        xxpUserAuth.setUpdateBy(sysUser.getNickName());
+        return xxpUserAuthMapper.updateXxpUserAuth(xxpUserAuth);
+    }
+
+    /**
+     * 批量删除巡查
+     *
+     * @param ids 需要删除的巡查主键集合
+     * @return 结果
+     */
+    @Override
+    public int deleteXxpUserAuthByIds(Long[] ids) {
+        return xxpUserAuthMapper.deleteXxpUserAuthByIds(ids);
+    }
+
+    /**
+     * 删除巡查信息
+     *
+     * @param id 巡查主键
+     * @return 结果
+     */
+    @Override
+    public int deleteXxpUserAuthById(Long id) {
+        return xxpUserAuthMapper.deleteXxpUserAuthById(id);
+    }
+}

+ 1 - 1
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabSecurityApplyMapper.xml

@@ -573,7 +573,7 @@
 
     <!--获取实验室准入人员信息-->
     <select id="selectLabSecurityApply" resultType="java.util.Map">
-          SELECT  id id,user_name userName,date_format(valid_end_time,'%Y-%m-%d') validEndTime,
+          SELECT  id id,user_name userName,date_format(valid_begin_time,'%Y-%m-%d') validBeginTime,date_format(valid_end_time,'%Y-%m-%d') validEndTime,
           (SELECT avatar FROM sys_user WHERE user_id=lab.user_id) AS avatar,
           (SELECT user_name FROM sys_user WHERE user_id=lab.user_id) AS jobNumber
                 FROM  lab_security_apply AS lab WHERE audit_status=2 AND subject_id=#{subjectId} and valid_end_time &gt;= now()

+ 2 - 1
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabSubjectAccessRecordMapper.xml

@@ -498,7 +498,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
          WHERE ar.`out_time` IS NULL AND TIMESTAMPDIFF(HOUR,ar.in_time,NOW())>=st.sign_time AND ar.access_status=1 and ar.init_flag = 0
     </select>
     <select id="selectSubjectSignList" resultType="java.util.Map">
-        select lsar.in_time as signTime,
+        select
+               DATE_FORMAT(lsar.in_time,'%Y-%m-%d %H:%i:%s') AS signTime,
                su.user_name as jobNumber,
                su.nick_name as userName,
                su.avatar as avatar

+ 3 - 3
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabSubjectMapper.xml

@@ -256,6 +256,7 @@
                t.inspect_check_count,
                t.inspect_sign_time,
                t.details,
+               (select i.id from xxp_card_info i where i.subJect_id=t.id LIMIT 1)         xxpCardInfoId,
                CONCAT(su.nick_name, '@', su.phonenumber)                      AS          adminNameAndPhone,
 
                (select d.dept_name from sys_dept d where t.build_id = d.dept_id)          buildName,
@@ -423,7 +424,7 @@
         select t.id,
         t.name,
         t.floor_id,
-        lb.room,
+        t.room,
         t.dept_id,
         IFNULL(su.user_id,-1) admin_id,
         t.is_del,
@@ -465,7 +466,6 @@
         from lab_subject t
         left join sys_user su on su.user_id = t.admin_id AND su.`del_flag`=0
         left join sys_dept sd on sd.dept_id = t.dept_id
-        left join lab_subject_layout lb on lb.id = t.layout_id
         left join lab_safe_classified cf on cf.id = t.level
         <where>
             <if test="name != null  and name != ''">and t.name like concat('%', #{name}, '%')</if>
@@ -543,7 +543,7 @@
         where id = #{id}
     </select>
 
-    <insert id="insertLabSubject" parameterType="com.zd.laboratory.domain.LabSubject">
+    <insert id="insertLabSubject" parameterType="com.zd.laboratory.domain.LabSubject" useGeneratedKeys="true" keyProperty="id">
         insert into lab_subject
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="id != null">id,</if>

+ 1 - 1
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/XxpCardInfoMapper.xml

@@ -116,7 +116,7 @@
     <update id="updateXxpCardInfo" parameterType="com.zd.laboratory.domain.XxpCardInfo">
         update xxp_card_info
         <trim prefix="SET" suffixOverrides=",">
-            <if test="cardNum != null">card_name = #{cardNum},</if>
+            <if test="cardName != null">card_name = #{cardName},</if>
             <if test="cardNum != null">card_num = #{cardNum},</if>
             <if test="college != null">college = #{college},</if>
             <if test="collegeId != null">college_id = #{collegeId},</if>

+ 11 - 10
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/XxpClassifyMapper.xml

@@ -47,22 +47,23 @@
             <if test="userId != null ">and t.user_id = #{userId}</if>
             <if test="createBy != null ">and t.create_by = #{createBy}</if>
             <if test="searchValue != null and searchValue != ''">
-                and
-                (t.classify_name like concat('%', #{classifyName}, '%') )
+                and (
+                 t.classify_name like concat('%', #{searchValue}, '%')
+                 )
             </if>
             <if test="beginTime != null ">
-                and t.create_time &gt;= str_to_date(#{beginTime}, '%Y-%m-%d')
+                and date_format(t.create_time, '%Y-%m-%d') &gt;= date_format(#{beginTime}, '%Y-%m-%d')
             </if>
             <if test="endTime != null ">
-                and t.create_time &lt;= str_to_date(#{endTime}, '%Y-%m-%d')
-            </if>
-            <if test="remark == 'time' ">
-                order by t.create_time desc
-            </if>
-            <if test="remark == 'sort' ">
-                order by t.sort
+                and date_format(t.create_time, '%Y-%m-%d') &lt;= date_format(#{endTime}, '%Y-%m-%d')
             </if>
         </where>
+        <if test="remark == 'time' ">
+            order by t.create_time desc
+        </if>
+        <if test="remark == 'sort' ">
+            order by t.sort desc
+        </if>
     </select>
 
     <select id="selectXxpClassifyById" resultMap="XxpClassifyResult">

+ 1 - 1
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/XxpClassifySubjectMapper.xml

@@ -75,7 +75,7 @@
     <delete id="deleteBySubjectId">
         delete
         from xxp_classify_subject
-        where subject_id = #{SubjectId}
+        where subject_id = #{subjectId}
     </delete>
 
 </mapper>

+ 12 - 4
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/XxpDutyMapper.xml

@@ -76,7 +76,7 @@
     </select>
 
     <select id="selectDutyUser" resultType="java.util.Map">
-        select user_name userName,user_phone userPhone,user_img userImg from  xxp_duty xxp
+        select user_name userName,user_phone userPhone,user_img avatar from  xxp_duty xxp
         <where>
             xxp.subject_id=#{labId}
             <if test="dateTime!=null">
@@ -87,7 +87,7 @@
 
 
     <select id="selectDutyUserList" resultType="java.util.Map">
-        select user_name userName,user_phone userPhone,user_img userImg,duty_time dutyTime from  xxp_duty xxp
+        select user_name userName,user_phone userPhone,user_img avatar,duty_time dutyTime from  xxp_duty xxp
         <where>
             xxp.subject_id=#{labId}
             <if test="startTime!=null">
@@ -189,12 +189,20 @@
         from (
                  select count(1) subSum, 0 userSum
                  from (
-                          select count(1) from xxp_duty d where d.duty_time = #{dutyTime} GROUP BY d.subject_id
+                          select count(1) from xxp_duty d where d.duty_time = #{dutyTime}
+                            <if test="deptId != null ">and ( d.dept_id in (SELECT dt.dept_id FROM sys_dept dt WHERE find_in_set(#{deptId}
+                                ,ancestors )) or d.dept_id = #{deptId} )
+                            </if>
+                          GROUP BY d.subject_id
                       ) s
                  UNION ALL
                  select 0 subSum, count(1) userSum
                  from (
-                          select count(1) from xxp_duty d where d.duty_time = #{dutyTime} GROUP BY d.user_id
+                          select count(1) from xxp_duty d where d.duty_time = #{dutyTime}
+                            <if test="deptId != null ">and ( d.dept_id in (SELECT dt.dept_id FROM sys_dept dt WHERE find_in_set(#{deptId}
+                                ,ancestors )) or d.dept_id = #{deptId} )
+                            </if>
+                          GROUP BY d.user_id
                       ) u
              ) t
     </select>

+ 19 - 20
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/XxpInspectionMapper.xml

@@ -66,26 +66,24 @@
     </select>
 
     <select id="selectUserXxpInspectionList" resultType="java.util.Map">
-
-    SELECT i.user_id userId,
-                i.user_name userName,
-                i.user_img userImg,
-                DATE_FORMAT(i.sign_in,'%Y-%m-%d %H:%i:%s') AS signTime,
-                date_format(MAX(i.sign_out),'%Y-%m-%d %H:%i:%s') AS signOut,
-                COUNT(1) AS signNumber,
-                d.duty_time dutyTime
-                FROM  `xxp_inspection` i left join xxp_duty d on DATE_FORMAT(i.sign_in,'%Y-%m-%d') = DATE_FORMAT(d.duty_time,'%Y-%m-%d')
-                and i.user_id = d.user_id and i.subject_id = d.subject_id
-                WHERE i.subject_id=#{labId} GROUP BY i.sign_in,i.user_id
-
-     <!--SELECT user_id userId,
-            user_name userName,
-            user_img userImg,
-            DATE_FORMAT(sign_in,'%Y-%m-%d %H:%i:%s') AS signTime,
-            date_format(MAX(sign_out),'%Y-%m-%d %H:%i:%s') AS signOut,
-            COUNT(*) AS signNumber
-            FROM  `xxp_inspection` WHERE subject_id=#{labId} GROUP BY signTime,user_id
-            -->
+        SELECT i.user_id userId,
+               i.user_name userName,
+               i.user_img avatar,
+               (SELECT phonenumber  FROM  sys_user su WHERE su.user_id=i.user_id ) AS userPhone,
+               DATE_FORMAT(i.sign_in,'%Y-%m-%d %H:%i:%s') AS signTime,
+               DATE_FORMAT(i.sign_in,'%Y-%m-%d') AS dutyTime,
+               DATE_FORMAT(MAX(i.sign_out),'%Y-%m-%d %H:%i:%s') AS signOut,
+               COUNT(1) AS signNumber
+        FROM  `xxp_inspection` i
+        WHERE i.subject_id=#{labId} GROUP BY dutyTime,i.user_id
+        <!--SELECT user_id userId,
+               user_name userName,
+               user_img userImg,
+               DATE_FORMAT(sign_in,'%Y-%m-%d %H:%i:%s') AS signTime,
+               date_format(MAX(sign_out),'%Y-%m-%d %H:%i:%s') AS signOut,
+               COUNT(*) AS signNumber
+               FROM  `xxp_inspection` WHERE subject_id=#{labId} GROUP BY signTime,user_id
+               -->
     </select>
 
     <insert id="insertXxpInspection" parameterType="com.zd.laboratory.domain.XxpInspection">
@@ -167,6 +165,7 @@
         where sign_in is not null
         and sign_in &gt;= #{beginTime}
         and sign_in &lt;= #{endTime}
+        and date_format(sign_in, '%Y-%m-%d') != date_format(NOW(), '%Y-%m-%d')
         <if test="deptId != null ">and ( i.dept_id in (SELECT dt.dept_id FROM sys_dept dt WHERE find_in_set(#{deptId}
             ,ancestors )) or i.dept_id = #{deptId} )
         </if>

+ 161 - 0
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/XxpUserAuthMapper.xml

@@ -0,0 +1,161 @@
+<?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.zd.laboratory.mapper.XxpUserAuthMapper">
+
+    <resultMap type="com.zd.laboratory.domain.XxpUserAuth" id="XxpUserAuthResult">
+        <result property="id" column="id"/>
+        <result property="userId" column="user_id"/>
+        <result property="userName" column="user_name"/>
+        <result property="authType" column="auth_type"/>
+        <result property="userType" column="user_type"/>
+        <result property="subjectId" column="subject_id"/>
+        <result property="subjectName" column="subject_name"/>
+        <result property="hardwareId" column="hardware_id"/>
+        <result property="deptId" column="dept_id"/>
+        <result property="deptName" column="dept_name"/>
+        <result property="finger" column="finger"/>
+        <result property="userPassword" column="user_password"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+    </resultMap>
+
+    <sql id="selectXxpUserAuth">
+        select id,
+               user_id,
+               user_name,
+               auth_type,
+               user_type,
+               subject_id,
+               subject_name,
+               hardware_id,
+               dept_id,
+               dept_name,
+               finger,
+               user_password,
+               create_by,
+               create_time,
+               update_by,
+               update_time
+        from xxp_user_auth t
+    </sql>
+
+    <select id="selectXxpUserAuthList" parameterType="com.zd.laboratory.domain.XxpUserAuth"
+            resultMap="XxpUserAuthResult">
+        <include refid="selectXxpUserAuth"/>
+        <where>
+            <if test="userId != null ">and t.user_id = #{userId}</if>
+            <if test="userName != null and userName != ''">and t.user_name = #{userName}</if>
+            <if test="authType != null ">and t.auth_type = #{authType}</if>
+            <if test="userType != null ">and t.user_type = #{userType}</if>
+            <if test="subjectId != null ">and t.subject_id = #{subjectId}</if>
+            <if test="subjectName != null and subjectName != '' ">and t.subject_name = #{subjectName}</if>
+            <if test="hardwareId != null ">and t.hardware_id = #{hardwareId}</if>
+            <if test="deptId != null ">and ( t.dept_id in (SELECT dt.dept_id FROM sys_dept dt WHERE
+                find_in_set(#{deptId} ,ancestors )) or t.dept_id = #{deptId} )
+            </if>
+            <if test="deptName != null ">and t.dept_name = #{deptName}</if>
+            <if test="finger != null ">and t.finger = #{finger}</if>
+            <if test="userPassword != null ">and t.user_password = #{userPassword}</if>
+            <if test="createBy != null  ">and t.create_by =#{createBy}</if>
+            <if test="createTime != null  ">and t.create_time =#{createTime}</if>
+            <if test="updateBy != null  ">and t.update_by =#{updateBy}</if>
+            <if test="updateTime != null  ">and t.update_time =#{updateTime}</if>
+            <if test="beginTime != null ">
+                and date_format(t.create_time, '%Y-%m-%d')  &gt;= date_format(#{beginTime}, '%Y-%m-%d')
+            </if>
+            <if test="endTime != null ">
+                and date_format(t.create_time, '%Y-%m-%d') &lt;= date_format(#{endTime}, '%Y-%m-%d')
+            </if>
+            <if test="searchValue != null and searchValue!=''">
+                and (
+                t.user_name like concat('%',#{searchValue}, '%')
+                )
+            </if>
+        </where>
+        order by t.create_time desc
+    </select>
+
+    <select id="selectXxpUserAuthById" resultMap="XxpUserAuthResult">
+        <include refid="selectXxpUserAuth"/>
+        where t.id = #{id}
+    </select>
+
+
+
+
+
+
+    <insert id="insertXxpUserAuth" parameterType="com.zd.laboratory.domain.XxpUserAuth">
+        insert into xxp_user_auth
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="userId != null">user_id,</if>
+            <if test="userName != null">user_name,</if>
+            <if test="authType != null">auth_type,</if>
+            <if test="userType != null">user_type,</if>
+            <if test="subjectId != null">subject_id,</if>
+            <if test="subjectName != null">subject_name,</if>
+            <if test="hardwareId != null">hardware_id,</if>
+            <if test="deptId != null">dept_id,</if>
+            <if test="deptName != null">dept_name,</if>
+            <if test="finger != null">finger,</if>
+            <if test="userPassword != null">user_password,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="userId != null">#{userId},</if>
+            <if test="userName != null">#{userName},</if>
+            <if test="authType != null">#{authType},</if>
+            <if test="userType != null">#{userType},</if>
+            <if test="subjectId != null">#{subjectId},</if>
+            <if test="subjectName != null">#{subjectName},</if>
+            <if test="hardwareId != null">#{hardwareId},</if>
+            <if test="deptId != null">#{deptId},</if>
+            <if test="deptName != null">#{deptName},</if>
+            <if test="finger != null">#{finger},</if>
+            <if test="userPassword != null">#{userPassword},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+        </trim>
+    </insert>
+
+    <update id="updateXxpUserAuth" parameterType="com.zd.laboratory.domain.XxpUserAuth">
+        update xxp_user_auth
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="userName != null">user_name = #{userName},</if>
+            <if test="authType != null">auth_type = #{authType},</if>
+            <if test="userType != null">user_type = #{userType},</if>
+            <if test="subjectId != null">subject_id = #{subjectId},</if>
+            <if test="subjectName != null">subject_name = #{subjectName},</if>
+            <if test="hardwareId != null">hardware_id = #{hardwareId},</if>
+            <if test="deptId != null">dept_id = #{deptId},</if>
+            <if test="deptName != null">dept_name = #{deptName},</if>
+            <if test="finger != null">finger = #{finger},</if>
+            <if test="userPassword != null">user_password = #{userPassword},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteXxpUserAuthById">
+        delete
+        from xxp_user_auth
+        where id = #{id}
+    </delete>
+
+    <delete id="deleteXxpUserAuthByIds">
+        delete from xxp_user_auth where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+</mapper>

+ 11 - 0
zd-modules/zd-modules-system/src/main/java/com/zd/system/controller/SysUserController.java

@@ -120,6 +120,17 @@ public class SysUserController extends BaseController {
     }
 
     /**
+     * 值班人员列表
+     */
+    @ApiOperation("值班人员列表")
+    @GetMapping("/getUserDutyList")
+    public TableDataInfo getUserDutyList(SysUser user) {
+        startPage();
+        List<SysUser> list = userService.selectUserDutyList(user);
+        return getDataTable(list);
+    }
+
+    /**
      * 根据电话号码查询用户信息
      */
     @ApiOperation("根据电话号码查询用户信息")

+ 10 - 0
zd-modules/zd-modules-system/src/main/java/com/zd/system/domain/vo/TreeSelect.java

@@ -31,6 +31,11 @@ public class TreeSelect implements Serializable {
     private Long parentId;
 
     /**
+     * 父部门名称
+     */
+    private String parentName;
+
+    /**
      * 祖级列表
      */
     private String ancestors;
@@ -65,6 +70,7 @@ public class TreeSelect implements Serializable {
         this.deptNum = dept.getDeptNum();
         this.subOrDept = dept.getSubOrDept();
         this.subOrDeptId = dept.getSubOrDeptId();
+        this.parentName = dept.getParentName();
         this.children = dept.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
     }
 
@@ -137,4 +143,8 @@ public class TreeSelect implements Serializable {
     public void setSubOrDeptId(Integer subOrDeptId) {
         this.subOrDeptId = subOrDeptId;
     }
+
+    public String getParentName() {        return parentName;    }
+
+    public void setParentName(String parentName) {        this.parentName = parentName;    }
 }

+ 7 - 0
zd-modules/zd-modules-system/src/main/java/com/zd/system/mapper/SysUserMapper.java

@@ -288,4 +288,11 @@ public interface SysUserMapper {
      * @return 用户信息集合信息
      */
     public List<SysUser> oldCheckNewCard();
+
+    /****
+     * 值班人员列表
+     * @param sysUser
+     * @return
+     */
+    public List<SysUser> selectUserDutyList(SysUser sysUser);
 }

+ 7 - 0
zd-modules/zd-modules-system/src/main/java/com/zd/system/service/ISysUserService.java

@@ -357,4 +357,11 @@ public interface ISysUserService {
      * @return 用户信息集合信息
      */
     public void oldCheckNewCard();
+
+    /****
+     * 值班人员列表
+     * @param sysUser
+     * @return
+     */
+    public List<SysUser> selectUserDutyList(SysUser sysUser);
 }

+ 11 - 0
zd-modules/zd-modules-system/src/main/java/com/zd/system/service/impl/SysUserServiceImpl.java

@@ -1186,4 +1186,15 @@ public class SysUserServiceImpl implements ISysUserService {
         }
 
     }
+
+    /****
+     * 值班人员列表
+     * @param sysUser
+     * @return
+     */
+    @Override
+    @DataScope(deptAlias = "d", userAlias = "u")
+    public List<SysUser> selectUserDutyList(SysUser sysUser) {
+        return userMapper.selectUserDutyList(sysUser);
+    }
 }

+ 6 - 2
zd-modules/zd-modules-system/src/main/resources/mapper/system/SysDeptMapper.xml

@@ -215,12 +215,16 @@
     </select>
     <select id="treeDeptSubSel" resultType="com.zd.model.entity.SysDept">
         select d.* from (
-            select d.dept_id,d.parent_id,d.ancestors,d.dept_name,d.del_flag,1 subOrDept,d.dept_id subOrDeptId
+            select d.dept_id,d.parent_id,
+                  ( select sd.dept_name from sys_dept sd where sd.dept_id=d.parent_id) parent_name,
+                   d.ancestors,d.dept_name,d.del_flag,1 subOrDept,d.dept_id subOrDeptId
             from sys_dept d
 
             union all
 
-            select concat(10000,s.id) dept_id,s.build_id parent_id,(select dt.ancestors
+            select concat(10000,s.id) dept_id,s.build_id parent_id,
+                   (select dept_name from sys_dept sd where sd.dept_id=s.build_id) parent_name,
+                   (select dt.ancestors
             from sys_dept dt where dt.dept_id = s.build_id) ancestors,s.name dept_name,s.is_del del_flag,2 subOrDept,s.id subOrDeptId
             from lab_subject s
         )d

+ 300 - 94
zd-modules/zd-modules-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -73,26 +73,105 @@
 
     <!--2.6弃用-->
     <sql id="selectUserVo">
-        select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,u.user_type,
-        d.dept_id, d.parent_id, d.dept_name, d.order_num, d.leader, d.status as dept_status,
-        r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,
-        u.major,u.major_id, u.grade, u.category, u.tutor_user_id, u.position, u.nature, u.signature,
-       u.card_num,u.wechat_id,u.education,u.nationality,u.addr,u.work_status,u.date_birth,
-        ut.nick_name tutorUserName,u.is_check
+        select u.user_id,
+               u.dept_id,
+               u.user_name,
+               u.nick_name,
+               u.email,
+               u.avatar,
+               u.phonenumber,
+               u.password,
+               u.sex,
+               u.status,
+               u.del_flag,
+               u.login_ip,
+               u.login_date,
+               u.create_by,
+               u.create_time,
+               u.remark,
+               u.user_type,
+               d.dept_id,
+               d.parent_id,
+               d.dept_name,
+               d.order_num,
+               d.leader,
+               d.status as  dept_status,
+               r.role_id,
+               r.role_name,
+               r.role_key,
+               r.role_sort,
+               r.data_scope,
+               r.status as  role_status,
+               u.major,
+               u.major_id,
+               u.grade,
+               u.category,
+               u.tutor_user_id,
+               u.position,
+               u.nature,
+               u.signature,
+               u.card_num,
+               u.wechat_id,
+               u.education,
+               u.nationality,
+               u.addr,
+               u.work_status,
+               u.date_birth,
+               ut.nick_name tutorUserName,
+               u.is_check
         from sys_user u
-		    left join sys_dept d on u.dept_id = d.dept_id
-		    left join sys_user_role ur on u.user_id = ur.user_id
-		    left join sys_role r on r.role_id = ur.role_id
-            left join sys_user ut on ut.user_id = u.tutor_user_id
+                 left join sys_dept d on u.dept_id = d.dept_id
+                 left join sys_user_role ur on u.user_id = ur.user_id
+                 left join sys_role r on r.role_id = ur.role_id
+                 left join sys_user ut on ut.user_id = u.tutor_user_id
     </sql>
 
     <sql id="selectUserNewVo">
-        select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,u.user_type,
-               d.dept_id, d.parent_id, d.dept_name, d.order_num, d.leader, d.status as dept_status,
-               sm.`major_name` major, u.grade, u.category, u.tutor_user_id, u.position, u.nature, u.signature,
-               u.card_num,u.card_num_simple,u.wechat_id,u.education,u.nationality,u.addr,u.work_status,u.date_birth,
-               ut.nick_name tutorUserName,u.is_check,
-               uf.face_img,sc.class_name,u.major_id,u.signature,pt.`post_name` positionName
+        select u.user_id,
+               u.dept_id,
+               u.user_name,
+               u.nick_name,
+               u.email,
+               u.avatar,
+               u.phonenumber,
+               u.password,
+               u.sex,
+               u.status,
+               u.del_flag,
+               u.login_ip,
+               u.login_date,
+               u.create_by,
+               u.create_time,
+               u.remark,
+               u.user_type,
+               d.dept_id,
+               d.parent_id,
+               d.dept_name,
+               d.order_num,
+               d.leader,
+               d.status as     dept_status,
+               sm.`major_name` major,
+               u.grade,
+               u.category,
+               u.tutor_user_id,
+               u.position,
+               u.nature,
+               u.signature,
+               u.card_num,
+               u.card_num_simple,
+               u.wechat_id,
+               u.education,
+               u.nationality,
+               u.addr,
+               u.work_status,
+               u.date_birth,
+               ut.nick_name    tutorUserName,
+               u.is_check,
+               uf.face_img,
+               sc.class_name,
+               u.major_id,
+               u.signature,
+               pt.`post_name`  positionName
         from sys_user u
                  left join sys_dept d on u.dept_id = d.dept_id
                  left join sys_user ut on ut.user_id = u.tutor_user_id
@@ -178,7 +257,7 @@
             AND u.major like concat('%', #{major}, '%')
         </if>
         <if test="majorId != null and majorId != ''">
-            AND u.major_id  = #{majorId}
+            AND u.major_id = #{majorId}
         </if>
         <if test="searchValue != null and searchValue != ''">
             AND
@@ -201,16 +280,16 @@
             AND u.category like concat('%', #{category}, '%')
         </if>
         <if test="tutorUserId != null">
-            AND u.tutor_user_id  = #{tutorUserId}
+            AND u.tutor_user_id = #{tutorUserId}
         </if>
         <if test="nature != null and nature != ''">
-            AND u.nature  = #{nature}
+            AND u.nature = #{nature}
         </if>
         <if test="position != null and position != ''">
-            AND u.position  = #{position}
+            AND u.position = #{position}
         </if>
         <if test="isCheck != null">
-            AND u.is_check  = #{isCheck}
+            AND u.is_check = #{isCheck}
         </if>
         <!-- 数据范围过滤 -->
         ${params.dataScope}
@@ -221,22 +300,23 @@
         u.create_time DESC
     </select>
 
-    <select id="selectUserListByDeptIds"  resultMap="SysUserResult">
+    <select id="selectUserListByDeptIds" resultMap="SysUserResult">
         select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.password, u.sex,
         u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
         u.card_num,u.wechat_id,u.education,u.nationality,u.addr,u.work_status,u.date_birth
         from
         sys_user u
         where u.del_flag = '0'
-            and u.status = '0'
-            and  u.dept_id in
-            <foreach collection="array" item="deptId" open="(" separator="," close=")">
-                #{deptId}
-            </foreach>
+        and u.status = '0'
+        and u.dept_id in
+        <foreach collection="array" item="deptId" open="(" separator="," close=")">
+            #{deptId}
+        </foreach>
     </select>
 
     <select id="selectAllocatedList" parameterType="com.zd.model.entity.SysUser" resultMap="SysUserResult">
-        select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.user_type, u.email, u.phonenumber, u.status, u.create_time, d.`dept_name`,
+        select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.user_type, u.email, u.phonenumber, u.status,
+        u.create_time, d.`dept_name`,
         u.card_num,u.wechat_id,u.education,u.nationality,u.addr,u.work_status,u.date_birth
         from sys_user u
         left join sys_dept d on u.dept_id = d.dept_id
@@ -299,19 +379,54 @@
     </select>
 
     <select id="selectUserCenterByUserName" parameterType="String" resultMap="SysUserResult">
-        SELECT u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex,
-	           u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,u.user_type,
-               d.dept_id, d.parent_id,
-               CASE WHEN u.user_type='22' THEN d.dept_name ELSE concat(if((SELECT dt.dept_name FROM sys_dept dt WHERE dt.dept_id = d.parent_id) is null ,'',
-               (SELECT concat(dt.dept_name,'-') FROM sys_dept dt WHERE dt.dept_id = d.parent_id)),d.dept_name) end dept_name,
-               d.order_num, d.leader, d.status AS dept_status,
-               CASE WHEN u.user_type='22' THEN sm.`major_name` else pt.`post_name` end major,
-               u.grade,dd.`dict_label` category, u.tutor_user_id, u.position, u.nature, u.signature,
-               u.card_num,u.wechat_id,
-               case when u.user_type='22' then ed.`dict_label` else dd.`dict_label` end education,
-               u.nationality,u.addr,u.work_status,u.date_birth,
-               ut.nick_name tutorUserName,u.is_check,
-               uf.face_img,sc.class_name,u.major_id,u.signature,pt.`post_name` positionName
+        SELECT u.user_id,
+               u.dept_id,
+               u.user_name,
+               u.nick_name,
+               u.email,
+               u.avatar,
+               u.phonenumber,
+               u.password,
+               u.sex,
+               u.status,
+               u.del_flag,
+               u.login_ip,
+               u.login_date,
+               u.create_by,
+               u.create_time,
+               u.remark,
+               u.user_type,
+               d.dept_id,
+               d.parent_id,
+               CASE
+                   WHEN u.user_type = '22' THEN d.dept_name
+                   ELSE concat(if((SELECT dt.dept_name FROM sys_dept dt WHERE dt.dept_id = d.parent_id) is null, '',
+                                  (SELECT concat(dt.dept_name, '-') FROM sys_dept dt WHERE dt.dept_id = d.parent_id)),
+                               d.dept_name) end                                           dept_name,
+               d.order_num,
+               d.leader,
+               d.status AS                                                                dept_status,
+               CASE WHEN u.user_type = '22' THEN sm.`major_name` else pt.`post_name` end  major,
+               u.grade,
+               dd.`dict_label`                                                            category,
+               u.tutor_user_id,
+               u.position,
+               u.nature,
+               u.signature,
+               u.card_num,
+               u.wechat_id,
+               case when u.user_type = '22' then ed.`dict_label` else dd.`dict_label` end education,
+               u.nationality,
+               u.addr,
+               u.work_status,
+               u.date_birth,
+               ut.nick_name                                                               tutorUserName,
+               u.is_check,
+               uf.face_img,
+               sc.class_name,
+               u.major_id,
+               u.signature,
+               pt.`post_name`                                                             positionName
         FROM sys_user u
                  LEFT JOIN sys_dept d ON u.dept_id = d.dept_id
                  LEFT JOIN sys_user ut ON ut.user_id = u.tutor_user_id
@@ -319,9 +434,10 @@
                  LEFT JOIN sys_class sc ON sc.id = u.grade
                  LEFT JOIN sys_major sm ON sm.id = u.major_id
                  LEFT JOIN sys_post pt ON pt.`post_id` = u.`position`
-                 LEFT JOIN sys_dict_data dd ON dd.`dict_value` = u.category  AND dd.`dict_type`='professional'
-                 LEFT JOIN sys_dict_data ed ON ed.`dict_value` = u.education AND ed.`dict_type`='education'
-        where u.user_name = #{userName} and u.del_flag = 0
+                 LEFT JOIN sys_dict_data dd ON dd.`dict_value` = u.category AND dd.`dict_type` = 'professional'
+                 LEFT JOIN sys_dict_data ed ON ed.`dict_value` = u.education AND ed.`dict_type` = 'education'
+        where u.user_name = #{userName}
+          and u.del_flag = 0
     </select>
 
     <select id="selectUserByNickName" parameterType="String" resultMap="SysUserResult">
@@ -340,32 +456,54 @@
     </select>
 
     <select id="checkUserNameUnique" parameterType="String" resultType="int">
-		select count(1) from sys_user where user_name = #{userName} and del_flag=0 limit 1
-	</select>
+        select count(1)
+        from sys_user
+        where user_name = #{userName}
+          and del_flag = 0 limit 1
+    </select>
 
     <select id="checkUserNameUniqueNotOwn" parameterType="com.zd.model.entity.SysUser" resultType="int">
-		select count(1) from sys_user where user_name = #{userName} and del_flag=0 and user_id != #{userId} limit 1
-	</select>
+        select count(1)
+        from sys_user
+        where user_name = #{userName}
+          and del_flag = 0
+          and user_id != #{userId} limit 1
+    </select>
 
     <select id="checkCardUnique" parameterType="com.zd.model.entity.SysUser" resultType="int">
-		select count(1) from sys_user where card_num = #{cardNum} and del_flag=0 limit 1
-	</select>
+        select count(1)
+        from sys_user
+        where card_num = #{cardNum}
+          and del_flag = 0 limit 1
+    </select>
 
     <select id="checkCardSimpleUnique" parameterType="com.zd.model.entity.SysUser" resultType="int">
-		select count(1) from sys_user where card_num_simple = #{cardNumSimple} and del_flag=0 and user_id != #{userId} limit 1
-	</select>
+        select count(1)
+        from sys_user
+        where card_num_simple = #{cardNumSimple}
+          and del_flag = 0
+          and user_id != #{userId} limit 1
+    </select>
 
     <select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
-		select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} and del_flag=0  limit 1
-	</select>
+        select user_id, phonenumber
+        from sys_user
+        where phonenumber = #{phonenumber}
+          and del_flag = 0 limit 1
+    </select>
 
     <select id="checkPhoneUniqueNotOwn" parameterType="com.zd.model.entity.SysUser" resultMap="SysUserResult">
-		select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} and user_name != #{userName} limit 1
-	</select>
+        select user_id, phonenumber
+        from sys_user
+        where phonenumber = #{phonenumber}
+          and user_name != #{userName} limit 1
+    </select>
 
     <select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
-		select user_id, email from sys_user where email = #{email} limit 1
-	</select>
+        select user_id, email
+        from sys_user
+        where email = #{email} limit 1
+    </select>
 
     <select id="selectOption" resultType="java.util.Map">
         select user_id userId, nick_name nickName,user_name userName from sys_user
@@ -438,14 +576,14 @@
             AND u.category like concat('%', #{category}, '%')
         </if>
         <if test="tutorUserId != null">
-            AND u.tutor_user_id  = #{tutorUserId}
+            AND u.tutor_user_id = #{tutorUserId}
         </if>
         <if test="nature != null and nature != ''">
-            AND u.nature  = #{nature}
+            AND u.nature = #{nature}
         </if>
 
         <if test="isCheck != null">
-            AND u.is_check  = #{isCheck}
+            AND u.is_check = #{isCheck}
         </if>
         <!-- 数据范围过滤 -->
         ${params.dataScope}
@@ -643,16 +781,22 @@
     </update>
 
     <update id="updateUserAvatar" parameterType="com.zd.model.entity.SysUser">
- 		update sys_user set avatar = #{avatar} where user_name = #{userName}
-	</update>
+        update sys_user
+        set avatar = #{avatar}
+        where user_name = #{userName}
+    </update>
 
     <update id="resetUserPwd" parameterType="com.zd.model.entity.SysUser">
- 		update sys_user set password = #{password} where user_name = #{userName}
-	</update>
+        update sys_user
+        set password = #{password}
+        where user_name = #{userName}
+    </update>
 
     <delete id="deleteUserById" parameterType="Long">
-		update sys_user set del_flag = '2' where user_id = #{userId}
- 	</delete>
+        update sys_user
+        set del_flag = '2'
+        where user_id = #{userId}
+    </delete>
 
     <delete id="deleteUserByIds" parameterType="Long">
         update sys_user set del_flag = '2' where user_id in
@@ -661,7 +805,7 @@
         </foreach>
     </delete>
     <select id="queryPhoneByIds" resultType="string">
-        select  phonenumber from sys_user
+        select phonenumber from sys_user
         where user_id in
         <foreach collection="array" item="id" open="(" separator="," close=")">
             #{id}
@@ -670,7 +814,7 @@
     </select>
 
     <select id="queryCardNumByIds" resultType="com.zd.model.entity.SysUser">
-        select  * from sys_user
+        select * from sys_user
         where card_num_simple in
         <foreach collection="array" item="cardNums" open="(" separator="," close=")">
             #{cardNums}
@@ -738,16 +882,16 @@
             AND u.category like concat('%', #{category}, '%')
         </if>
         <if test="tutorUserId != null">
-            AND u.tutor_user_id  = #{tutorUserId}
+            AND u.tutor_user_id = #{tutorUserId}
         </if>
         <if test="nature != null and nature != ''">
-            AND u.nature  = #{nature}
+            AND u.nature = #{nature}
         </if>
         <if test="position != null and position != ''">
-            AND u.position  = #{position}
+            AND u.position = #{position}
         </if>
         <if test="isCheck != null">
-            AND u.is_check  = #{isCheck}
+            AND u.is_check = #{isCheck}
         </if>
 
     </select>
@@ -793,7 +937,7 @@
             AND u.user_id IN
             <foreach item="item" collection="ids" separator="," open="(" close=")" index="">'${item}'</foreach>
         </if>
-        <if test="deptIds !=null and  deptIds.size >0" >
+        <if test="deptIds !=null and  deptIds.size >0">
             AND u.dept_id IN
             <foreach item="item" collection="deptIds" separator="," open="(" close=")" index="">'${item}'</foreach>
         </if>
@@ -807,22 +951,25 @@
             AND u.category like concat('%', #{category}, '%')
         </if>
         <if test="tutorUserId != null">
-            AND u.tutor_user_id  = #{tutorUserId}
+            AND u.tutor_user_id = #{tutorUserId}
         </if>
         <if test="nature != null and nature != ''">
-            AND u.nature  = #{nature}
+            AND u.nature = #{nature}
         </if>
         <if test="position != null and position != ''">
-            AND u.position  = #{position}
+            AND u.position = #{position}
         </if>
         <if test="isCheck != null">
-            AND u.is_check  = #{isCheck}
+            AND u.is_check = #{isCheck}
         </if>
 
     </select>
 
     <select id="selectUserInfoByCardNum" resultType="com.zd.model.entity.SysUser">
-        SELECT user_id,nick_name,card_num,card_num_simple FROM sys_user u WHERE u.card_num_simple = #{cardNumSimple} and u.user_id != #{userId}
+        SELECT user_id, nick_name, card_num, card_num_simple
+        FROM sys_user u
+        WHERE u.card_num_simple = #{cardNumSimple}
+          and u.user_id != #{userId}
     </select>
 
     <select id="getSafeUserList" parameterType="com.zd.model.entity.SysUser" resultMap="SysUserResult">
@@ -837,21 +984,80 @@
 
 
     <select id="oldCheckNewCard" resultMap="SysUserResult">
-        select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.password, u.sex,
-        u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
-        u.major_id, u.grade, u.tutor_user_id, u.position, p.post_name as positionName,
-        u.nature,(select sc.class_name from sys_class sc where sc.id = u.grade) gradeName,
-        u.card_num,u.wechat_id,u.nationality,u.addr,u.work_status,
-        u.date_birth,d.dept_name, d.leader,u.department,
-        u.education, u.user_type,sm.`major_name` major,
-        ut.nick_name tutorUserName,u.is_check,date_format(u.create_time, '%Y-%m-%d') createTimeStr
-        from
-        sys_user u
-        left join sys_dept d on u.dept_id = d.dept_id
-        left join sys_user ut on ut.user_id = u.tutor_user_id
-        left join sys_post p on u.position = p.post_id
-        LEFT JOIN sys_major sm ON sm.id = u.major_id
+        select u.user_id,
+               u.dept_id,
+               u.nick_name,
+               u.user_name,
+               u.email,
+               u.avatar,
+               u.phonenumber,
+               u.password,
+               u.sex,
+               u.status,
+               u.del_flag,
+               u.login_ip,
+               u.login_date,
+               u.create_by,
+               u.create_time,
+               u.remark,
+               u.major_id,
+               u.grade,
+               u.tutor_user_id,
+               u.position,
+               p.post_name as                                                 positionName,
+               u.nature,
+               (select sc.class_name from sys_class sc where sc.id = u.grade) gradeName,
+               u.card_num,
+               u.wechat_id,
+               u.nationality,
+               u.addr,
+               u.work_status,
+               u.date_birth,
+               d.dept_name,
+               d.leader,
+               u.department,
+               u.education,
+               u.user_type,
+               sm.`major_name`                                                major,
+               ut.nick_name                                                   tutorUserName,
+               u.is_check,
+               date_format(u.create_time, '%Y-%m-%d')                         createTimeStr
+        from sys_user u
+                 left join sys_dept d on u.dept_id = d.dept_id
+                 left join sys_user ut on ut.user_id = u.tutor_user_id
+                 left join sys_post p on u.position = p.post_id
+                 LEFT JOIN sys_major sm ON sm.id = u.major_id
         where u.del_flag = '0'
-        AND u.card_num IS NOT NULL AND u.`card_num_simple` IS NULL
+          AND u.card_num IS NOT NULL
+          AND u.`card_num_simple` IS NULL
     </select>
+
+    <!--值班人员列表-->
+    <select id="selectUserDutyList" parameterType="com.zd.model.entity.SysUser" resultMap="SysUserResult">
+        select u.user_id, u.dept_id,d.dept_name, u.user_name, u.nick_name,  u.avatar, u.phonenumber,  u.sex,
+        u.status, u.del_flag,u.user_type
+        from
+        (
+        select w.user_id from lab_whitelist w
+        union all
+        select a.user_id from lab_security_apply a where a.valid_end_time> NOW() and audit_status=2
+        ) t
+        LEFT JOIN sys_user u on t.user_id=u.user_id
+        LEFT JOIN sys_dept d on d.dept_id = u.dept_id
+        <where>
+        <if test="deptId != null and deptId != 0">
+            AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId},
+            ancestors) ))
+        </if>
+       <if test="nickName != null and nickName != ''">
+            AND u.nick_name = #{nickName}
+        </if>
+        <if test="userType != null and userType != ''">
+            AND u.user_type = #{userType}
+        </if>
+        </where>
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+    </select>
+
 </mapper>