xuxiaofei лет назад: 2
Родитель
Сommit
116708d081
25 измененных файлов с 992 добавлено и 51 удалено
  1. 10 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/LabSubjectControllerVO.java
  2. 4 0
      zd-model/src/main/java/com/zd/model/domain/per/PerPrefix.java
  3. 9 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabHardwareController.java
  4. 38 2
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabXxpCardInfoController.java
  5. 74 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabXxpClassifyController.java
  6. 6 2
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabXxpDutyController.java
  7. 165 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabXxpUserAuthController.java
  8. 1 1
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/XxpClassifySubject.java
  9. 157 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/XxpUserAuth.java
  10. 10 10
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/XxpDutyMapper.java
  11. 68 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/XxpUserAuthMapper.java
  12. 7 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/IXxpClassifyService.java
  13. 2 2
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/IXxpDutyService.java
  14. 79 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/IXxpUserAuthService.java
  15. 27 11
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabSubjectServiceImpl.java
  16. 6 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/XxpCardInfoServiceImpl.java
  17. 1 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/XxpClassifyServiceImpl.java
  18. 25 17
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/XxpDutyServiceImpl.java
  19. 131 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/XxpUserAuthServiceImpl.java
  20. 1 1
      zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabSubjectMapper.xml
  21. 1 1
      zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/XxpCardInfoMapper.xml
  22. 10 2
      zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/XxpDutyMapper.xml
  23. 144 0
      zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/XxpUserAuthMapper.xml
  24. 10 0
      zd-modules/zd-modules-system/src/main/java/com/zd/system/domain/vo/TreeSelect.java
  25. 6 2
      zd-modules/zd-modules-system/src/main/resources/mapper/system/SysDeptMapper.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;
+    }
 }

+ 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:";
 }

+ 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);
 

+ 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));
+    }
+
 }

+ 74 - 0
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;
 
@@ -185,4 +188,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;
+    }
+
 }

+ 6 - 2
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabXxpDutyController.java

@@ -68,10 +68,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 +119,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);
         }

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

@@ -0,0 +1,165 @@
+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)
+    {
+        List<SysDictData> dictDataList = DictUtils.getDictCache("xxp_auth_type");
+        System.out.println(dictDataList.size());
+        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));
+    }
+
+}

+ 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;
 
     /***
      * 开始时间

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

@@ -0,0 +1,157 @@
+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;
+
+    /**
+     * 硬件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;
+    }
+}

+ 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);
+
+}

+ 27 - 11
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,15 +228,18 @@ public class LabSubjectServiceImpl implements ILabSubjectService {
 //            labHazardSubjectRelationMapper.deleteBySubId(labSubject.getId());
 //        }
 
+        //安全类目信息修改
         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());
+                if(classifySubject==null){
+                    classifySubjectService.insertClassifySubject(cs);
+                }
+            }
         }
+
         return labSubjectMapper.updateLabSubject(labSubject);
     }
 

+ 6 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/XxpCardInfoServiceImpl.java

@@ -1,6 +1,7 @@
 package com.zd.laboratory.service.impl;
 
 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.mapper.XxpCardInfoMapper;
@@ -66,6 +67,11 @@ public class XxpCardInfoServiceImpl implements IXxpCardInfoService
         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);
     }
 

+ 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);
     }
 
     /***

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

@@ -0,0 +1,131 @@
+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("新增集合不能为空!");
+        }
+
+        SysUser sysUser = tokenService.getLoginUser().getSysUser();
+        for (XxpUserAuth auth:xxpUserAuth.getUserAuthList()) {
+            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/LabSubjectMapper.xml

@@ -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>

+ 10 - 2
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/XxpDutyMapper.xml

@@ -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>

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

@@ -0,0 +1,144 @@
+<?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="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,
+               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="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 t.create_time &gt;= str_to_date(#{beginTime}, '%Y-%m-%d')
+            </if>
+            <if test="endTime != null ">
+                and t.create_time &lt;= str_to_date(#{endTime}, '%Y-%m-%d')
+            </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="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="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="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>

+ 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;    }
 }

+ 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