Forráskód Böngészése

Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabXxpDutyController.java
#	zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/XxpDutyMapper.java
#	zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/XxpInspectionMapper.java
#	zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/IXxpDutyService.java
#	zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/IXxpInspectionService.java
#	zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/XxpClassifyDetailedServiceImpl.java
#	zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/XxpDutyServiceImpl.java
#	zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/XxpInspectionServiceImpl.java
donggaosheng 2 éve
szülő
commit
325f5b63e1
45 módosított fájl, 1184 hozzáadás és 101 törlés
  1. 6 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/RemoteLaboratoryService.java
  2. 5 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/fallback/RemoteLaboratoryFallbackFactory.java
  3. 8 0
      zd-modules/zd-base/src/main/java/com/zd/base/job/task/LabTask.java
  4. 21 8
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabControlController.java
  5. 44 2
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabXxpDutyController.java
  6. 75 1
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabXxpInspectionController.java
  7. 75 2
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/LabSubject.java
  8. 9 2
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/XxpCardInfo.java
  9. 0 3
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/XxpClassify.java
  10. 4 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/XxpClassifyDetail.java
  11. 1 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/XxpDuty.java
  12. 2 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/XxpInspection.java
  13. 43 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/vo/LabMessageGroupVO.java
  14. 44 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/vo/XxpDutyVO.java
  15. 34 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/vo/XxpInspectionVO.java
  16. 2 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/LabCheckMachineMsgMapper.java
  17. 16 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/LabControlMapper.java
  18. 8 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/LabMessageContentMapper.java
  19. 23 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/XxpDutyMapper.java
  20. 2 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/XxpInspectionMapper.java
  21. 70 2
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/onemachine/controller/OneMachineController.java
  22. 2 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/ILabCheckMachineMsgService.java
  23. 21 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/ILabControlService.java
  24. 8 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/ILabMessageContentService.java
  25. 25 2
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/IXxpDutyService.java
  26. 30 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/IXxpInspectionService.java
  27. 6 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabCheckMachineMsgServiceImpl.java
  28. 43 2
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabControlServiceImpl.java
  29. 11 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabMessageContentServiceImpl.java
  30. 1 1
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabRiskPlanServiceImpl.java
  31. 36 1
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabSubjectManagerService.java
  32. 21 7
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/XxpCardInfoServiceImpl.java
  33. 5 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/XxpClassifyDetailedServiceImpl.java
  34. 76 3
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/XxpDutyServiceImpl.java
  35. 60 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/XxpInspectionServiceImpl.java
  36. 6 0
      zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabCheckMachineMsgMapper.xml
  37. 12 0
      zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabControlMapper.xml
  38. 8 0
      zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabMessageContentMapper.xml
  39. 56 7
      zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabSubjectMapper.xml
  40. 7 9
      zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/XxpCardInfoMapper.xml
  41. 7 0
      zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/XxpClassifyDetailMapper.xml
  42. 37 2
      zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/XxpDutyMapper.xml
  43. 84 2
      zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/XxpInspectionMapper.xml
  44. 33 0
      zd-modules/zd-modules-system/src/main/java/com/zd/system/domain/SysLogoConfig.java
  45. 97 45
      zd-modules/zd-modules-system/src/main/resources/mapper/system/SysLogoConfigMapper.xml

+ 6 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/RemoteLaboratoryService.java

@@ -452,6 +452,12 @@ public interface RemoteLaboratoryService {
     public AjaxResult timedExhaustTask();
 
     /**
+     * 定时器定时每天 00:30 开始执行,定时清理90天以前的所有控制记录数据
+     */
+    @GetMapping("/control/timingClearMsg")
+    public AjaxResult timingClearMsg();
+
+    /**
      * 一体机logo修改通知
      */
     @ApiOperation(value = "一体机logo修改通知")

+ 5 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/fallback/RemoteLaboratoryFallbackFactory.java

@@ -417,6 +417,11 @@ public class RemoteLaboratoryFallbackFactory implements FallbackFactory<RemoteLa
             }
 
             @Override
+            public AjaxResult timingClearMsg() {
+                throw new RuntimeException("定时清理消息失败:" + cause.getMessage());
+            }
+
+            @Override
             public void logoNotice() {
                 throw new RuntimeException("logo通知失败" + cause.getMessage());
             }

+ 8 - 0
zd-modules/zd-base/src/main/java/com/zd/base/job/task/LabTask.java

@@ -70,4 +70,12 @@ public class LabTask {
     public void timedExhaustTask() {
         remoteLaboratoryService.timedExhaustTask();
     }
+
+
+    /**
+     * 定时器定时每天 00:30 开始执行,定时清理90天以前的所有控制记录数据
+     */
+    public void timingClearMsg() {
+        remoteLaboratoryService.timingClearMsg();
+    }
 }

+ 21 - 8
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabControlController.java

@@ -11,14 +11,7 @@ import com.zd.laboratory.domain.vo.LabBigViewGroupVO;
 import com.zd.laboratory.domain.vo.LabControlVO;
 import com.zd.laboratory.domain.vo.LabRiskPlanListVO;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 import com.zd.common.core.annotation.Log;
 import com.zd.common.core.log.BusinessType;
 import com.zd.common.core.annotation.PreAuthorize;
@@ -121,4 +114,24 @@ public class LabControlController extends BaseController {
         List<LabRiskPlanListVO> list = labControlService.getRiskPlanList(labControlVO);
         return getDataTable(list);
     }
+
+
+    /**
+     * 获取控制记录详细信息
+     */
+    @GetMapping(value = "/newMsg/{id}")
+    public ResultData getNewMsgInfo(@PathVariable("id") Long id) {
+        try {
+            Thread.sleep(1000);
+            return ResultData.success(labControlService.selectLabControlNewMegById(id));
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+       return ResultData.fail("获取控制记录信息失败!");
+    }
+
+    @RequestMapping(value = "/timingClearMsg")
+    public void timingClearMsg(){
+        labControlService.timingClearMsg();
+    }
 }

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

@@ -5,8 +5,11 @@ 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.ExcelUtil;
+import com.zd.common.core.utils.StringUtils;
 import com.zd.common.core.web.controller.BaseController;
 import com.zd.laboratory.domain.XxpDuty;
+import com.zd.laboratory.domain.XxpInspection;
+import com.zd.laboratory.domain.vo.XxpDutyVO;
 import com.zd.laboratory.service.IXxpDutyService;
 import com.zd.model.domain.ResultData;
 import com.zd.model.domain.per.PerFun;
@@ -19,6 +22,7 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -53,6 +57,24 @@ public class LabXxpDutyController extends BaseController
     }
 
     /**
+     * 查询值班列表(按实时间查询)
+     */
+    @PreAuthorize(hasPermi = PerPrefix.LABORATORY_DUTY + PerFun.LIST)
+    @GetMapping("/listYmd")
+    @ApiOperation(value = "查询值班列表")
+    public TableDataInfo<XxpDutyVO> listGroup(XxpDuty xxpDuty)
+    {
+        //startPage();
+        List<XxpDutyVO> list = xxpDutyService.selectDutyYmdById(xxpDuty);
+        for (XxpDutyVO duty:list) {
+            XxpDutyVO vo= xxpDutyService.selectSubAndUserSum(duty.getDutyTime());
+            duty.setSubSum(vo.getSubSum());
+            duty.setUserSum(vo.getSubSum());
+        }
+        return getDataTable(list);
+    }
+
+    /**
      * 导出值班列表
      */
     @ApiOperation(value = "导出值班列表")
@@ -79,15 +101,35 @@ public class LabXxpDutyController extends BaseController
 
 
     /**
+     * 根据时间获取值班详情
+     */
+    @ApiOperation(value = "根据时间获取值班详情")
+    @PreAuthorize(hasPermi = PerPrefix.LABORATORY_DUTY + PerFun.QUERY)
+    @GetMapping(value = "/getInfoByDate")
+    public TableDataInfo<XxpDutyVO> getInfoByDate(XxpDuty xxpDuty)
+    {
+        startPage();
+        List<XxpDutyVO> listVo = xxpDutyService.selectInfoByDate(xxpDuty);
+        XxpDuty newDuty = new XxpDuty();
+        for (XxpDutyVO duty:listVo) {
+            newDuty.setSubjectId(duty.getSubjectId());
+            newDuty.setDutyTime(xxpDuty.getDutyTime());
+            List<XxpDuty> list =xxpDutyService.selectXxpDutyList(newDuty);
+            duty.setDutyList(list);
+        }
+        return getDataTable(listVo);
+    }
+
+    /**
      * 新增值班
      */
     @ApiOperation(value = "新增值班")
     @PreAuthorize(hasPermi = PerPrefix.LABORATORY_DUTY + PerFun.ADD)
     @Log(title = "值班", businessType = BusinessType.INSERT)
     @PostMapping
-    public ResultData add(@RequestBody XxpDuty xxpDuty)
+    public ResultData add(@RequestBody XxpDutyVO xxpDutyVO)
     {
-        return ResultData.result(xxpDutyService.insertXxpDuty(xxpDuty));
+        return ResultData.result(xxpDutyService.insertXxpDuty(xxpDutyVO));
     }
 
 

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

@@ -8,7 +8,9 @@ import com.zd.common.core.utils.ExcelUtil;
 import com.zd.common.core.web.controller.BaseController;
 import com.zd.laboratory.domain.LabWhitelist;
 import com.zd.laboratory.domain.XxpClassify;
+import com.zd.laboratory.domain.XxpDuty;
 import com.zd.laboratory.domain.XxpInspection;
+import com.zd.laboratory.domain.vo.XxpInspectionVO;
 import com.zd.laboratory.service.IXxpClassifyService;
 import com.zd.laboratory.service.IXxpInspectionService;
 import com.zd.model.domain.ResultData;
@@ -22,7 +24,8 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
-import java.util.List;
+import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * 巡查Controller
@@ -55,6 +58,77 @@ public class LabXxpInspectionController extends BaseController
     }
 
     /**
+     * 查询巡查列表(根据时间段)
+     */
+    @PreAuthorize(hasPermi = PerPrefix.LABORATORY_XXP_INSPECTION + PerFun.LIST)
+    @GetMapping("/listYmd")
+    @ApiOperation(value = "查询巡查列表")
+    public List<XxpInspectionVO> listYmd(XxpInspectionVO inspectionVO)
+    {
+        Map<String,XxpInspectionVO> allMap = new LinkedHashMap<>();
+        //startPage();
+        //获取时间段内签到人员总数
+        List<XxpInspectionVO> signinList = xxpInspectionService.selectListSigninCount(inspectionVO);
+        Optional.ofNullable(signinList).orElseGet(Collections::emptyList)
+                .stream()
+                .forEach(a->{
+                    a.setNoSignedInCount(0);
+                    allMap.put(a.getDutyTime(),a);
+                });
+
+        //获取时间段内签到人员总数
+        List<XxpInspectionVO> notSigninLlist = xxpInspectionService.selectListNotSigninCount(inspectionVO);
+        Optional.ofNullable(notSigninLlist).orElseGet(Collections::emptyList)
+                .stream()
+                .forEach(a->{
+                    if(allMap.get(a.getDutyTime())!=null){
+                        XxpInspectionVO newInspectionVo = allMap.get(a.getDutyTime());
+                        newInspectionVo.setNoSignedInCount(a.getNoSignedInCount());
+                        allMap.put(a.getDutyTime(),newInspectionVo);
+                    }else{
+                        a.setSignInCount(0);
+                        allMap.put(a.getDutyTime(),a);
+                    }
+
+                });
+        return Optional.ofNullable(allMap.entrySet()).orElseGet(Collections::emptySet)
+                .stream()
+                .map(a->a.getValue())
+                .collect(Collectors.toList());
+    }
+
+    /***
+     * 签到列表-正常
+     * @param xxpInspection
+     * @return
+     */
+    // @PreAuthorize(hasPermi = PerPrefix.LABORATORY_XXP_INSPECTION + PerFun.LIST)
+    @GetMapping("/listStandard")
+    @ApiOperation(value = "查询巡查列表-正常")
+    public TableDataInfo<XxpInspection> listStandard(XxpInspection xxpInspection)
+    {
+        startPage();
+        List<XxpInspection> list = xxpInspectionService.selectListSignin(xxpInspection);
+        return getDataTable(list);
+    }
+
+
+    /***
+     * 签到列表-正常
+     * @param xxpDuty
+     * @return
+     */
+    // @PreAuthorize(hasPermi = PerPrefix.LABORATORY_XXP_INSPECTION + PerFun.LIST)
+    @GetMapping("/listAbnormal")
+    @ApiOperation(value = "查询巡查列表-异常")
+    public TableDataInfo<XxpDuty> listAbnormal(XxpDuty xxpDuty)
+    {
+        startPage();
+        List<XxpDuty> list = xxpInspectionService.selectListAbnormal(xxpDuty);
+        return getDataTable(list);
+    }
+
+    /**
      * 导出巡查列表
      */
     @ApiOperation(value = "导出巡查列表")

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

@@ -195,8 +195,41 @@ public class LabSubject extends BaseEntity implements QCInterface {
 
     private String safeUserNames;
 
-    private Integer bottleTotal;//实验室气瓶总数
-    private Integer bottleUserTotal;//实验室单人气瓶总数
+    /**
+     * 实验室气瓶总数
+     */
+    private Integer bottleTotal;
+
+    /**
+     * 实验室单人气瓶总数
+     */
+    private Integer bottleUserTotal;
+
+    /***
+     *巡查人员,穿戴检查项
+     */
+    private String inspectCheckIn;
+
+    /***
+     *巡查人员,穿戴检查可跳过(0 否,1 是)
+     */
+    private String inspectSkipped;
+
+    /***
+     *巡查人员,穿戴检查识别上限
+     */
+    private String inspectCheckCount;
+
+    /***
+     *巡查人员,签到有效时间
+     */
+    private String inspectSignTime;
+
+    /***
+     *实验室详情
+     */
+    private String details;
+
     private List<Long> deptIds;
 
     /**
@@ -528,4 +561,44 @@ public class LabSubject extends BaseEntity implements QCInterface {
     public void setRoomName(String roomName) {
         this.roomName = roomName;
     }
+
+    public String getInspectCheckIn() {
+        return inspectCheckIn;
+    }
+
+    public void setInspectCheckIn(String inspectCheckIn) {
+        this.inspectCheckIn = inspectCheckIn;
+    }
+
+    public String getInspectSkipped() {
+        return inspectSkipped;
+    }
+
+    public void setInspectSkipped(String inspectSkipped) {
+        this.inspectSkipped = inspectSkipped;
+    }
+
+    public String getInspectCheckCount() {
+        return inspectCheckCount;
+    }
+
+    public void setInspectCheckCount(String inspectCheckCount) {
+        this.inspectCheckCount = inspectCheckCount;
+    }
+
+    public String getInspectSignTime() {
+        return inspectSignTime;
+    }
+
+    public void setInspectSignTime(String inspectSignTime) {
+        this.inspectSignTime = inspectSignTime;
+    }
+
+    public String getDetails() {
+        return details;
+    }
+
+    public void setDetails(String details) {
+        this.details = details;
+    }
 }

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

@@ -8,7 +8,6 @@ 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;
 
@@ -57,7 +56,7 @@ public class XxpCardInfo extends BaseEntity {
      */
     @Excel(name = "学院Id")
     @ApiModelProperty(value = "学院Id")
-    private Long locationId;
+    private Long collegeId;
 
     /**
      * 位置
@@ -222,4 +221,12 @@ public class XxpCardInfo extends BaseEntity {
     public void setDeptName(String deptName) {
         this.deptName = deptName;
     }
+
+    public Long getSubjectId() {
+        return subjectId;
+    }
+
+    public void setSubjectId(Long subjectId) {
+        this.subjectId = subjectId;
+    }
 }

+ 0 - 3
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/XxpClassify.java

@@ -1,7 +1,6 @@
 package com.zd.laboratory.domain;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
-import com.fasterxml.jackson.annotation.JsonProperty;
 import com.zd.model.annotation.Excel;
 import com.zd.model.entity.BaseEntity;
 import io.swagger.annotations.ApiModel;
@@ -9,8 +8,6 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.ToString;
 import lombok.experimental.Accessors;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
 import org.hibernate.validator.constraints.Length;
 
 import java.util.Date;

+ 4 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/XxpClassifyDetail.java

@@ -57,6 +57,10 @@ public class XxpClassifyDetail extends  BaseEntity
     private Integer sort;
 
 
+    /** 是否共有 1非公共 2公共   */
+    @Excel(name = "是否共有")
+    @ApiModelProperty(value = "是否共有")
+    private Integer isCollective;
 
     /** 用户id */
     @Excel(name = "用户id")

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

@@ -105,6 +105,7 @@ public class XxpDuty extends BaseEntity {
      * 值班时间
      */
     @Excel(name = "值班时间")
+    @JsonFormat(pattern = "yyyy-MM-dd")
     @ApiModelProperty(value = "值班时间")
     private Date dutyTime;
 

+ 2 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/XxpInspection.java

@@ -64,6 +64,7 @@ public class XxpInspection extends BaseEntity {
      * 签到时间
      */
     @Excel(name = "签到时间 ")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "签到时间 ")
     private Date signIn;
 
@@ -71,6 +72,7 @@ public class XxpInspection extends BaseEntity {
      * 签退时间
      */
     @Excel(name = "签退时间 ")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "签退时间 ")
     private Date signOut;
 

+ 43 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/vo/LabMessageGroupVO.java

@@ -0,0 +1,43 @@
+package com.zd.laboratory.domain.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 消息VO对象
+ *
+ * @Author: cyl
+ * @Date: 2023/03/28/10:43
+ * @Description:
+ */
+@ApiModel("消息组合表")
+@Data
+public class LabMessageGroupVO {
+
+    /**
+     * 消息的id
+     */
+    @ApiModelProperty("消息id")
+    private Long id;
+
+    /**
+     * 消息的内容
+     */
+    @ApiModelProperty("消息的内容")
+    private String messContent;
+
+    /**
+     * 消息类型,1是来自消息表,2是来自整改表
+     */
+    @ApiModelProperty("消息类型,1是来自消息表,2是来自整改表")
+    private Integer messType;
+
+    /**
+     * 创建时间,用于排序
+     */
+    @ApiModelProperty("创建时间,用于排序")
+    private Date createTime;
+}

+ 44 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/vo/XxpDutyVO.java

@@ -0,0 +1,44 @@
+package com.zd.laboratory.domain.vo;
+
+import com.zd.laboratory.domain.LabSubject;
+import com.zd.laboratory.domain.XxpDuty;
+import com.zd.model.entity.SysUser;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @Author: xxf
+ * @Date: 2023/03/24/13:55
+ * @Description:
+ */
+@Data
+public class XxpDutyVO extends XxpDuty {
+
+    /**
+     * 值班日期
+     */
+    private List<String> dateList;
+
+    /**
+     * 实验室集合
+     */
+    private List<LabSubject> subjectList;
+
+    /**
+     * 人员集合
+     */
+    private List<SysUser> sysUserList;
+
+    /**
+     * 实验室总数
+     */
+    private Long subSum;
+
+    /***
+     * 人员总数
+     */
+    private Long userSum;
+
+    private List<XxpDuty> dutyList;
+}

+ 34 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/vo/XxpInspectionVO.java

@@ -0,0 +1,34 @@
+package com.zd.laboratory.domain.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.zd.laboratory.domain.XxpInspection;
+import com.zd.model.annotation.Excel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @Author: xxf
+ * @Date: 2023/03/27/15:44
+ * @Description:
+ */
+@Data
+public class XxpInspectionVO extends XxpInspection {
+
+    /**
+     * 签到总数
+     */
+    private Integer signInCount;
+
+    /**
+     * 未签到总数
+     */
+    private Integer noSignedInCount;
+    /**
+     * 值班时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private String dutyTime;
+
+}

+ 2 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/LabCheckMachineMsgMapper.java

@@ -63,4 +63,6 @@ public interface LabCheckMachineMsgMapper {
     void updateByCheckRecordId(Long checkRecordId);
 
     List<LabCheckMachineMsgVo> selectCheckMsgBySubId(LabCheckMachineMsg labCheckMachineMsg);
+
+    List<LabCheckMachineMsg> selectCheckNewMsgBySubId(Long subId);
 }

+ 16 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/LabControlMapper.java

@@ -76,4 +76,20 @@ public interface LabControlMapper {
      * @return 控制记录集合
      */
     public List<LabRiskPlanListVO> getRiskPlanList(LabControlVO labControlVO);
+
+
+    /**
+     * 查询控制记录
+     *
+     * @param id 控制记录主键
+     * @return 控制记录
+     */
+    public LabControl selectLabControlNewMegById(Long id);
+
+
+    /**
+     * 定时清理90天以前的所有控制记录数据
+     *
+     */
+    public int timingClearMsg();
 }

+ 8 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/LabMessageContentMapper.java

@@ -47,6 +47,14 @@ public interface LabMessageContentMapper {
     public List<LabMessageContentVO> selectLabClearMessageList(LabMessageContentListQuery labMessageContent);
 
     /**
+     * 查询消息发布列表VO
+     *
+     * @param subId 实验室id
+     * @return 消息发布集合
+     */
+    public List<LabMessageContentVO> selectLabNewMessageContentVOList(Long subId);
+
+    /**
      * 新增消息发布
      *
      * @param labMessageContent 消息发布

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

@@ -2,7 +2,9 @@ package com.zd.laboratory.mapper;
 
 import com.zd.laboratory.domain.XxpDuty;
 import org.apache.ibatis.annotations.Param;
+import com.zd.laboratory.domain.vo.XxpDutyVO;
 
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -79,4 +81,25 @@ public interface XxpDutyMapper
      * @return
      */
     List<Map<String, Object>> selectDutyUserList(@Param("labId") Long labId, @Param("startTime") String startTime,@Param("endTime") String endTime);
+
+    /***
+     * 根据时间段查询有数据的时间列表
+     * @param xxpDuty
+     * @return
+     */
+    public List<XxpDutyVO> selectDutyYmdById(XxpDuty xxpDuty);
+
+    /***
+     * 查询某个具体时间下的实验室和人员总数
+     * @param dutyTime
+     * @return
+     */
+    public XxpDutyVO selectSubAndUserSum(Date dutyTime);
+
+    /***
+     * 根据时间查询实验室
+     * @param xxpDuty
+     * @return
+     */
+    public List<XxpDutyVO> selectInfoByDate(XxpDuty xxpDuty);
 }

+ 2 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/XxpInspectionMapper.java

@@ -1,8 +1,10 @@
 package com.zd.laboratory.mapper;
 
 import com.zd.laboratory.domain.XxpClassify;
+import com.zd.laboratory.domain.XxpDuty;
 import com.zd.laboratory.domain.XxpInspection;
 import org.apache.ibatis.annotations.Param;
+import com.zd.laboratory.domain.vo.XxpInspectionVO;
 
 import java.util.List;
 import java.util.Map;

+ 70 - 2
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/onemachine/controller/OneMachineController.java

@@ -9,9 +9,12 @@ import com.zd.laboratory.api.entity.SensorFunctionStatus;
 import com.zd.laboratory.api.vo.HardwareCVO;
 import com.zd.laboratory.api.vo.SenseValVO;
 import com.zd.laboratory.domain.FaceVO;
+import com.zd.laboratory.domain.LabCheckMachineMsg;
 import com.zd.laboratory.domain.LabRotationChart;
 import com.zd.laboratory.domain.dto.LabHazardDTO;
 import com.zd.laboratory.domain.dto.LabHazardNewVo;
+import com.zd.laboratory.domain.vo.LabMessageContentVO;
+import com.zd.laboratory.domain.vo.LabMessageGroupVO;
 import com.zd.laboratory.domain.vo.SubLayoutVO;
 import com.zd.laboratory.domain.vo.SubSimpleVO;
 import com.zd.laboratory.mapper.LabHazardMapper;
@@ -24,6 +27,8 @@ import com.zd.model.constant.HttpStatus;
 import com.zd.model.constant.SecurityConstants;
 import com.zd.model.domain.R;
 import com.zd.model.domain.ResultData;
+import com.zd.model.domain.per.PerFun;
+import com.zd.model.domain.per.PerPrefix;
 import com.zd.model.entity.SysUser;
 import com.zd.model.enums.HardwareTypeEnum;
 import com.zd.model.enums.SignEnum;
@@ -41,8 +46,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -101,6 +105,12 @@ public class OneMachineController extends BaseController {
     @Autowired
     private SubMessageSendManager messageSendService;
 
+    @Autowired
+    private ILabMessageContentService labMessageContentService;
+
+    @Autowired
+    private ILabCheckMachineMsgService labCheckMachineMsgService;
+
 //    /**
 //     * 最低危险等级
 //     */
@@ -441,4 +451,62 @@ public class OneMachineController extends BaseController {
         return oneMachineService.lotPostSignIn(code, faceVO.getData());
     }
 
+
+    /**
+     * 查询消息发布列表
+     */
+    @GetMapping("/{subId}/newMsg")
+    public TableDataInfo newMsg(@PathVariable("subId") Long subId) {
+        startPage();
+        List<LabMessageContentVO> list = labMessageContentService.selectLabNewMessageContentVOList(subId);
+        return getDataTable(list);
+    }
+
+    /**
+     * 查询整改消息最新列表
+     */
+    @GetMapping("/{subId}/checkNewMsg")
+    public TableDataInfo checkNewMsg(@PathVariable("subId") Long subId) {
+        startPage();
+        List<LabCheckMachineMsg> list = labCheckMachineMsgService.selectCheckNewMsgBySubId(subId);
+        return getDataTable(list);
+    }
+
+
+    /**
+     * 查询组合消息滚动
+     */
+    @GetMapping("/{subId}/newMsgGroup")
+    public ResultData newMsgGroup(@PathVariable("subId") Long subId) {
+        List<LabMessageGroupVO> messageGroupVOList = new ArrayList <>();
+
+        List<LabMessageContentVO> msgList = labMessageContentService.selectLabNewMessageContentVOList(subId);
+        Optional.ofNullable(msgList).orElseGet(Collections::emptyList)
+                .stream()
+                .forEach(a->{
+                    LabMessageGroupVO labMessageGroupVO = new LabMessageGroupVO();
+                    labMessageGroupVO.setId(a.getId());
+                    labMessageGroupVO.setMessContent(a.getContent());
+                    labMessageGroupVO.setMessType(1);
+                    labMessageGroupVO.setCreateTime(a.getCreateTime());
+                    messageGroupVOList.add(labMessageGroupVO);
+                });
+        List<LabCheckMachineMsg> checkList = labCheckMachineMsgService.selectCheckNewMsgBySubId(subId);
+        Optional.ofNullable(checkList).orElseGet(Collections::emptyList)
+                .stream()
+                .forEach(b->{
+                    LabMessageGroupVO labMessageGroupVO = new LabMessageGroupVO();
+                    labMessageGroupVO.setId(b.getId());
+                    labMessageGroupVO.setMessContent(b.getCheckMsg());
+                    labMessageGroupVO.setMessType(2);
+                    labMessageGroupVO.setCreateTime(b.getCreateTime());
+                    messageGroupVOList.add(labMessageGroupVO);
+                });
+
+        return ResultData.success(Optional.ofNullable(messageGroupVOList).orElseGet(Collections::emptyList)
+                .stream()
+                .sorted(Comparator.comparing(LabMessageGroupVO::getCreateTime).reversed())
+                .collect(Collectors.toList()));
+    }
+
 }

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

@@ -75,4 +75,6 @@ public interface ILabCheckMachineMsgService {
     public int deleteLabCheckMachineMsgById(Long id);
 
     List<LabCheckMachineMsgVo> selectCheckMsg(LabCheckMachineMsg labCheckMachineMsg);
+
+    List<LabCheckMachineMsg> selectCheckNewMsgBySubId(Long subId);
 }

+ 21 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/ILabControlService.java

@@ -34,6 +34,13 @@ public interface ILabControlService {
     public List<LabControlVO> selectLabControlList(LabControlVO labControl);
 
     /**
+     * 创建一个控制记录并且报错:预案专用
+     * @param hardwareVO
+     * @return
+     */
+    public void  riskCreateLabControlAndSave(LabHardware hardwareVO, Symbol.order order , Symbol.command command);
+
+    /**
      * 创建一个控制记录并且报错:手动方式
      * @param hardwareVO
      * @return
@@ -92,4 +99,18 @@ public interface ILabControlService {
      * @return 控制记录集合
      */
     public List<LabRiskPlanListVO> getRiskPlanList(LabControlVO labControlVO);
+
+    /**
+     * 查询控制记录
+     *
+     * @param id 控制记录主键
+     * @return 控制记录
+     */
+    public LabControl selectLabControlNewMegById(Long id);
+
+    /**
+     * 定时清除三个月以前的数据
+     *
+     */
+    public void timingClearMsg();
 }

+ 8 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/ILabMessageContentService.java

@@ -39,6 +39,14 @@ public interface ILabMessageContentService {
     public List<LabMessageContentVO> selectLabMessageContentVOList(LabMessageContentListQuery labMessageContent);
 
     /**
+     * 查询消息发布列表VO
+     *
+     * @param subId 实验室id
+     * @return 消息发布集合
+     */
+    public List<LabMessageContentVO> selectLabNewMessageContentVOList(Long subId);
+
+    /**
      * 发送预警消息
      * @param subId 实验室ID
      * @param newRiskPlan 预案

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

@@ -1,7 +1,9 @@
 package com.zd.laboratory.service;
 
 import com.zd.laboratory.domain.XxpDuty;
+import com.zd.laboratory.domain.vo.XxpDutyVO;
 
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -43,10 +45,10 @@ public interface IXxpDutyService
     /**
      * 新增值班
      *
-     * @param xxpDuty 值班
+     * @param xxpDutyVO 值班
      * @return 结果
      */
-    public int insertXxpDuty(XxpDuty xxpDuty);
+    public int insertXxpDuty(XxpDutyVO xxpDutyVO);
 
 
 
@@ -74,6 +76,27 @@ public interface IXxpDutyService
      */
     public int deleteXxpDutyById(Long id);
 
+    /***
+     * 根据时间段查询有数据的时间列表
+     * @param xxpDuty
+     * @return
+     */
+    public List<XxpDutyVO> selectDutyYmdById(XxpDuty xxpDuty);
+
+    /***
+     * 查询某个具体时间下的实验室和人员总数
+     * @param dutyTime
+     * @return
+     */
+    public XxpDutyVO selectSubAndUserSum(Date dutyTime);
+
+    /***
+     * 根据时间查询实验室
+     * @param xxpDuty
+     * @return
+     */
+    public List<XxpDutyVO> selectInfoByDate(XxpDuty xxpDuty);
+
     /**
      * 查询实验室值班人员信息
      * @param labId

+ 30 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/IXxpInspectionService.java

@@ -1,6 +1,8 @@
 package com.zd.laboratory.service;
 
+import com.zd.laboratory.domain.XxpDuty;
 import com.zd.laboratory.domain.XxpInspection;
+import com.zd.laboratory.domain.vo.XxpInspectionVO;
 
 import java.util.List;
 import java.util.Map;
@@ -81,4 +83,32 @@ public interface IXxpInspectionService
      */
     public List<Map<String,Object>> selectUserXxpInspectionList(Long labId,String startTime,String endTime);
 
+
+    /***
+     * 查询某时间段内签到人数集合
+     * @param inspectionVO
+     * @return
+     */
+    public List<XxpInspectionVO> selectListSigninCount(XxpInspectionVO inspectionVO);
+
+    /***
+     * 查询某时间段内未签到人数集合
+     * @param inspectionVO
+     * @return
+     */
+    public List<XxpInspectionVO> selectListNotSigninCount(XxpInspectionVO inspectionVO);
+
+    /***
+     * 正常签到列表
+     * @param inspection
+     * @return
+     */
+    public List<XxpInspection> selectListSignin(XxpInspection inspection);
+
+    /***
+     * 异常签到列表
+     * @param xxpDuty
+     * @return
+     */
+    public List<XxpDuty> selectListAbnormal(XxpDuty xxpDuty);
 }

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

@@ -514,4 +514,10 @@ public class LabCheckMachineMsgServiceImpl implements ILabCheckMachineMsgService
 
         return list;
     }
+
+
+    @Override
+    public List<LabCheckMachineMsg> selectCheckNewMsgBySubId(Long subId) {
+        return labCheckMachineMsgMapper.selectCheckNewMsgBySubId(subId);
+    }
 }

+ 43 - 2
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabControlServiceImpl.java

@@ -68,11 +68,11 @@ public class LabControlServiceImpl implements ILabControlService {
     }
 
     /**
-     * 创建一个控制记录并且报错:手动方式
+     * 创建一个控制记录并且报错:预案专用
      * @param hardwareVO
      * @return
      */
-    public void  manualCreateLabControlAndSave(LabHardware hardwareVO,Symbol.order order , Symbol.command command)
+    public void  riskCreateLabControlAndSave(LabHardware hardwareVO,Symbol.order order , Symbol.command command)
     {
         LabControl lab = createLab(hardwareVO, order, command);
         lab.setTriggerModes(1);
@@ -86,6 +86,26 @@ public class LabControlServiceImpl implements ILabControlService {
 
         insertLabControl(lab);
     }
+
+    /**
+     * 创建一个控制记录并且报错:手动方式
+     * @param hardwareVO
+     * @return
+     */
+    public void  manualCreateLabControlAndSave(LabHardware hardwareVO,Symbol.order order , Symbol.command command)
+    {
+        LabControl lab = createLab(hardwareVO, order, command);
+        lab.setTriggerModes(2);
+        String userName=SecurityUtils.getUsername();
+        if(StringUtils.isNotEmpty(userName)){
+            SaveUtil.setCommonAttr(lab);
+            lab.setUserName(userName);
+        }else{
+            lab.setUserName("人工操作");
+        }
+
+        insertLabControl(lab);
+    }
     /**
      * 创建一个控制记录并且报错:自动
      * @param hardwareVO
@@ -203,4 +223,25 @@ public class LabControlServiceImpl implements ILabControlService {
         });
         return planList;
     }
+
+
+    /**
+     * 查询控制记录
+     *
+     * @param id 控制记录主键
+     * @return 控制记录
+     */
+    @Override
+    public LabControl selectLabControlNewMegById(Long id) {
+        return labControlMapper.selectLabControlNewMegById(id);
+    }
+
+    /**
+     * 定时清理90天以前的所有控制记录数据
+     *
+     */
+    @Override
+    public void timingClearMsg() {
+        labControlMapper.timingClearMsg();
+    }
 }

+ 11 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabMessageContentServiceImpl.java

@@ -141,6 +141,17 @@ public class LabMessageContentServiceImpl implements ILabMessageContentService {
         return labMessageContentMapper.selectLabMessageContentVOList(labMessageContent);
     }
 
+    /**
+     * 查询消息发布列表
+     *
+     * @param subId 实验室id
+     * @return 消息发布
+     */
+    @Override
+    public List<LabMessageContentVO> selectLabNewMessageContentVOList(Long subId) {
+        return labMessageContentMapper.selectLabNewMessageContentVOList(subId);
+    }
+
 
     /**
      * 新的发送消息

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

@@ -1511,7 +1511,7 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
         List<LabHardware> hardwareList = labHardwareMapper.selectLabHardwareListBySubject(labHardware);
         //循环执行实验室下的硬件功能
         Optional.ofNullable(hardwareList).filter(a -> a.size() > 0).orElseGet(Collections::emptyList).stream().forEach(a -> {
-            subjectManagerService.control(a.getId(), Symbol.command.close);
+            subjectManagerService.riskControl(a.getId(), Symbol.command.close);
         });
         return 200;
     }

+ 36 - 1
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabSubjectManagerService.java

@@ -180,7 +180,7 @@ public class LabSubjectManagerService {
         }
 
         logger.info("预案调用硬件,硬件id={},硬件名称={},硬件指令={}",labHardware.getId(), JSON.toJSONString(labHardware.getName()),JSON.toJSONString(command));
-        return ResultData.success(control(labHardware.getId(), command));
+        return ResultData.success(riskControl(labHardware.getId(), command));
 
         //老继电器调用方法
 //        return controlService.execution(labHardware, functionStatus);
@@ -192,6 +192,41 @@ public class LabSubjectManagerService {
     }
 
     /**
+     * 控制电源开关设备 预案专用
+     *
+     * @param id
+     */
+    public Boolean riskControl(Long id, Symbol.command command) {
+        //通过设备编号获取设备详细信息
+        LabHardwareVO labHardwareVO = hardwareMapper.selectLabHardwareById(id);
+        if (labHardwareVO == null || labHardwareVO.getRelayCode() == null) {
+            logger.error("硬件不存在或未关联继电器!id:{}", id);
+            return false;
+        }
+        if (labHardwareVO.getBit() == null) {
+            logger.error("未关联继电器位!id:{},名称:{}", id, labHardwareVO.getName());
+            return false;
+        }
+        if (labHardwareVO.getHardwareType() == 2) {
+            ResultData ResultData = socketService.sendMqttCommand(labHardwareVO.getId(), labHardwareVO.getRelayCode(), command, labHardwareVO.getBit(),labHardwareVO.getSubjectId());
+            boolean equals = ResultData.getCode().equals(HttpStatus.SUCCESS);
+            if (equals) {
+                //添加记录
+                labControlService.riskCreateLabControlAndSave(labHardwareVO, Symbol.order.control, command);
+            }
+        } else {
+            ResultData ResultData = socketService.sendCommand(Symbol.order.control, labHardwareVO.getRelayCode(), command, labHardwareVO.getBit());
+            boolean equals = ResultData.getCode().equals(HttpStatus.SUCCESS);
+            if (equals) {
+                //添加记录
+                labControlService.riskCreateLabControlAndSave(labHardwareVO, Symbol.order.control, command);
+            }
+            return equals;
+        }
+        return true;
+    }
+
+    /**
      * 控制电源开关设备
      *
      * @param id

+ 21 - 7
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/XxpCardInfoServiceImpl.java

@@ -3,12 +3,15 @@ package com.zd.laboratory.service.impl;
 import com.zd.common.core.security.TokenService;
 import com.zd.laboratory.domain.XxpCardInfo;
 import com.zd.laboratory.domain.XxpInspection;
+import com.zd.laboratory.mapper.XxpCardInfoMapper;
 import com.zd.laboratory.mapper.XxpInspectionMapper;
 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;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -21,7 +24,7 @@ import java.util.List;
 public class XxpCardInfoServiceImpl implements IXxpCardInfoService
 {
     @Autowired
-    private IXxpCardInfoService xxpCardInfoService;
+    private XxpCardInfoMapper xxpCardInfoMapper;
 
     @Autowired
     private TokenService tokenService;
@@ -35,7 +38,7 @@ public class XxpCardInfoServiceImpl implements IXxpCardInfoService
      */
     @Override
     public XxpCardInfo selectXxpCardInfoById(Long id) {
-        return xxpCardInfoService.selectXxpCardInfoById(id);
+        return xxpCardInfoMapper.selectXxpCardInfoById(id);
     }
 
     /**
@@ -46,7 +49,7 @@ public class XxpCardInfoServiceImpl implements IXxpCardInfoService
      */
     @Override
     public List<XxpCardInfo> selectXxpCardInfoList(XxpCardInfo xxpCardInfo) {
-        return xxpCardInfoService.selectXxpCardInfoList(xxpCardInfo);
+        return xxpCardInfoMapper.selectXxpCardInfoList(xxpCardInfo);
     }
 
     /**
@@ -57,7 +60,13 @@ public class XxpCardInfoServiceImpl implements IXxpCardInfoService
      */
     @Override
     public int insertXxpCardInfo(XxpCardInfo xxpCardInfo) {
-        return xxpCardInfoService.insertXxpCardInfo(xxpCardInfo);
+        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());
+        return xxpCardInfoMapper.insertXxpCardInfo(xxpCardInfo);
     }
 
     /**
@@ -68,7 +77,10 @@ public class XxpCardInfoServiceImpl implements IXxpCardInfoService
      */
     @Override
     public int updateXxpCardInfo(XxpCardInfo xxpCardInfo) {
-        return xxpCardInfoService.updateXxpCardInfo(xxpCardInfo);
+        SysUser sysUser = tokenService.getLoginUser().getSysUser();
+        xxpCardInfo.setUpdateBy(sysUser.getNickName());
+        xxpCardInfo.setUpdateTime(new Date());
+        return xxpCardInfoMapper.updateXxpCardInfo(xxpCardInfo);
     }
 
     /**
@@ -79,7 +91,8 @@ public class XxpCardInfoServiceImpl implements IXxpCardInfoService
      */
     @Override
     public int deleteXxpCardInfoByIds(Long[] ids) {
-        return xxpCardInfoService.deleteXxpCardInfoByIds(ids);
+
+        return xxpCardInfoMapper.deleteXxpCardInfoByIds(ids);
     }
 
     /**
@@ -90,6 +103,7 @@ public class XxpCardInfoServiceImpl implements IXxpCardInfoService
      */
     @Override
     public int deleteXxpCardInfoById(Long id) {
-        return xxpCardInfoService.deleteXxpCardInfoById(id);
+
+        return xxpCardInfoMapper.deleteXxpCardInfoById(id);
     }
 }

+ 5 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/XxpClassifyDetailedServiceImpl.java

@@ -1,8 +1,10 @@
 package com.zd.laboratory.service.impl;
 
+import com.zd.common.core.exception.ServiceException;
 import com.zd.common.core.security.TokenService;
 import com.zd.laboratory.api.vo.LabXxpClassifyVo;
 import com.zd.laboratory.domain.XxpClassify;
+import com.zd.common.core.utils.StringUtils;
 import com.zd.laboratory.domain.XxpClassifyDetail;
 import com.zd.laboratory.mapper.XxpClassifyDetailedMapper;
 import com.zd.laboratory.mapper.XxpClassifyMapper;
@@ -79,6 +81,9 @@ public class XxpClassifyDetailedServiceImpl implements IXxpClassifyDetailedServi
      */
     @Override
     public int updateXxpClassifyDetailed(XxpClassifyDetail classifyDetailed) {
+        if(StringUtils.isNull(classifyDetailed.getId()) ){
+            throw new ServiceException("ID不能为空!");
+        }
         SysUser sysUser = tokenService.getLoginUser().getSysUser();
         classifyDetailed.setUpdateBy(sysUser.getNickName());
         classifyDetailed.setUpdateTime(new Date());

+ 76 - 3
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/XxpDutyServiceImpl.java

@@ -1,16 +1,23 @@
 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.XxpInspection;
+import com.zd.laboratory.domain.vo.XxpDutyVO;
 import com.zd.laboratory.mapper.XxpDutyMapper;
 import com.zd.laboratory.mapper.XxpInspectionMapper;
 import com.zd.laboratory.service.IXxpDutyService;
 import com.zd.laboratory.service.IXxpInspectionService;
 import org.apache.ibatis.annotations.Param;
+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;
 
@@ -60,12 +67,42 @@ public class XxpDutyServiceImpl implements IXxpDutyService
     /**
      * 新增值班
      *
-     * @param xxpDuty 值班
+     * @param xxpDutyVO 值班
      * @return 结果
      */
     @Override
-    public int insertXxpDuty(XxpDuty xxpDuty) {
-        return xxpDutyMapper.insertXxpDuty(xxpDuty);
+    @Transactional(rollbackFor = Exception.class)
+    public int insertXxpDuty(XxpDutyVO xxpDutyVO) {
+        if(StringUtils.isNull(xxpDutyVO.getDateList()) ){
+            throw new ServiceException("值班时间为空");
+        }else if(StringUtils.isNull(xxpDutyVO.getSubjectList())){
+            throw new ServiceException("值班实验室为空");
+        }else if(StringUtils.isNull(xxpDutyVO.getSysUserList())){
+            throw new ServiceException("值班人员为空");
+        }
+
+        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);
+                }
+            }
+        }
+        return 1;
     }
 
     /**
@@ -105,4 +142,40 @@ public class XxpDutyServiceImpl implements IXxpDutyService
     public List<Map<String, Object>> selectDutyUserList(Long labId, String startTime, String endTime) {
         return xxpDutyMapper.selectDutyUserList(labId,startTime,endTime);
     }
+
+    /***
+     * 根据时间段查询有数据的时间列表
+     * @param xxpDuty
+     * @return
+     */
+    @Override
+    public List<XxpDutyVO> selectDutyYmdById(XxpDuty xxpDuty) {
+        if(StringUtils.isNull(xxpDuty.getBeginTime()) || StringUtils.isNull(xxpDuty.getEndTime())){
+            throw new ServiceException("必须指定开始时间和结束时间");
+        }
+        return xxpDutyMapper.selectDutyYmdById(xxpDuty);
+    }
+
+    /***
+     * 查询某个具体时间下的实验室和人员总数
+     * @param dutyTime
+     * @return
+     */
+    @Override
+    public XxpDutyVO selectSubAndUserSum(Date dutyTime) {
+        return xxpDutyMapper.selectSubAndUserSum(dutyTime);
+    }
+
+    /***
+     * 根据时间查询实验室
+     * @param xxpDuty
+     * @return
+     */
+    @Override
+    public List<XxpDutyVO> selectInfoByDate(XxpDuty xxpDuty) {
+        if(StringUtils.isNull(xxpDuty.getDutyTime())){
+            throw new ServiceException("查询时间不能为空!");
+        }
+        return xxpDutyMapper.selectInfoByDate(xxpDuty);
+    }
 }

+ 60 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/XxpInspectionServiceImpl.java

@@ -1,8 +1,12 @@
 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.XxpClassify;
+import com.zd.laboratory.domain.XxpDuty;
 import com.zd.laboratory.domain.XxpInspection;
+import com.zd.laboratory.domain.vo.XxpInspectionVO;
 import com.zd.laboratory.mapper.XxpClassifyMapper;
 import com.zd.laboratory.mapper.XxpInspectionMapper;
 import com.zd.laboratory.service.IXxpClassifyService;
@@ -112,4 +116,60 @@ public class XxpInspectionServiceImpl implements IXxpInspectionService
     public List<Map<String, Object>> selectUserXxpInspectionList(Long labId, String startTime, String endTime) {
         return xxpInspectionMapper.selectUserXxpInspectionList(labId,startTime,endTime);
     }
+
+    /***
+     * 查询某时间段内签到人数集合
+     * @param inspectionVO
+     * @return
+     */
+    @Override
+    public List<XxpInspectionVO> selectListSigninCount(XxpInspectionVO inspectionVO) {
+        return xxpInspectionMapper.selectListSigninCount(inspectionVO);
+    }
+
+    /***
+     * 查询某时间段内未签到人数集合
+     * @param inspectionVO
+     * @return
+     */
+    @Override
+    public List<XxpInspectionVO> selectListNotSigninCount(XxpInspectionVO inspectionVO) {
+        return xxpInspectionMapper.selectListNotSigninCount(inspectionVO);
+    }
+
+    /***
+     * 正常签到列表
+     * @param inspection
+     * @return
+     */
+    @Override
+    public List<XxpInspection> selectListSignin(XxpInspection inspection) {
+        List<XxpInspection> list = xxpInspectionMapper.selectListSignin(inspection);
+        String timeStr=null;
+        for (XxpInspection ins:list) {
+            if(StringUtils.isNotEmpty(ins.getResidenceTime())){
+                String[] time =  ins.getResidenceTime().split(":");
+                for (int i=0; i<time.length;i++){
+                    timeStr=time[0]+"时";
+                    timeStr+=time[1]+"分";
+                    timeStr+=time[2]+"秒";
+                    ins.setResidenceTime(timeStr);
+                }
+            }
+        }
+        return list;
+    }
+
+    /***
+     * 异常签到列表
+     * @param xxpDuty
+     * @return
+     */
+    @Override
+    public List<XxpDuty> selectListAbnormal(XxpDuty xxpDuty) {
+        if(StringUtils.isNull(xxpDuty.getDutyTime()) ){
+            throw new ServiceException("时间不能为空!");
+        }
+        return xxpInspectionMapper.selectListAbnormal(xxpDuty);
+    }
 }

+ 6 - 0
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabCheckMachineMsgMapper.xml

@@ -83,6 +83,12 @@
         ORDER BY cr.create_time DESC
     </select>
 
+    <select id="selectCheckNewMsgBySubId" resultMap="LabCheckMachineMsgResult">
+        select cmm.* from lab_check_record cr inner join lab_check_machine_msg cmm on cr.id = cmm.check_record_id
+        where cr.laboratory_id = #{subId}
+        order by cmm.create_time desc
+    </select>
+
     <insert id="insertLabCheckMachineMsg" parameterType="com.zd.laboratory.domain.LabCheckMachineMsg"
             useGeneratedKeys="true" keyProperty="id">
         insert into lab_check_machine_msg

+ 12 - 0
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabControlMapper.xml

@@ -262,4 +262,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         ORDER BY gp.create_time DESC
     </select>
+
+
+    <select id="selectLabControlNewMegById"  resultMap="LabControlResult">
+        <include refid="selectLabControlVo"/>
+        where hardware_id = #{id}
+        order by create_time desc limit 1
+    </select>
+
+
+    <delete id="timingClearMsg">
+        delete from lab_control where create_time &lt;= DATE_SUB(CURDATE(),INTERVAL 90 day)
+    </delete>
 </mapper>

+ 8 - 0
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabMessageContentMapper.xml

@@ -139,6 +139,14 @@
         <include refid="selectDetail"/>
     </select>
 
+    <select id="selectLabNewMessageContentVOList" resultType="com.zd.laboratory.domain.vo.LabMessageContentVO">
+        <include refid="selectlistVO"/>
+        where
+            t.mess_class = 3
+            AND FIND_IN_SET(#{subId}, t.`sub_ids`)
+        order by t.create_time desc
+    </select>
+
     <insert id="insertLabMessageContent" parameterType="com.zd.laboratory.api.entity.LabMessageContent" useGeneratedKeys="true" keyProperty="id">
         insert into lab_message_content
         <trim prefix="(" suffix=")" suffixOverrides=",">

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

@@ -26,6 +26,12 @@
         <result property="safeUserId" column="safe_user_id"/>
         <result property="moldId" column="mold_id"/>
         <result property="moldName" column="moldName"/>
+
+        <result property="inspectCheckIn" column="inspect_check_in"/>
+        <result property="inspectSkipped" column="inspect_skipped"/>
+        <result property="inspectCheckCount" column="inspect_check_count"/>
+        <result property="inspectSignTime" column="inspect_sign_time"/>
+        <result property="details" column="details"/>
     </resultMap>
 
     <resultMap type="com.zd.laboratory.domain.vo.LabSubjectVO" id="LabSubjectResultVO">
@@ -70,6 +76,11 @@
         <result property="moldName" column="moldName"/>
         <result property="adminNameAndPhone" column="adminNameAndPhone"/>
         <result property="safeUserNameAdminPhone" column="safeUserNameAdminPhone"/>
+        <result property="inspectCheckIn" column="inspect_check_in"/>
+        <result property="inspectSkipped" column="inspect_skipped"/>
+        <result property="inspectCheckCount" column="inspect_check_count"/>
+        <result property="inspectSignTime" column="inspect_sign_time"/>
+        <result property="details" column="details"/>
     </resultMap>
 
     <resultMap type="com.zd.laboratory.domain.vo.LabSubjectDetailVO" id="subjectAndInfoResult">
@@ -107,6 +118,11 @@
         <result property="skipped" column="skipped"/>
         <result property="checkCount" column="check_count"/>
         <result property="signTime" column="sign_time"/>
+        <result property="inspectCheckIn" column="inspect_check_in"/>
+        <result property="inspectSkipped" column="inspect_skipped"/>
+        <result property="inspectCheckCount" column="inspect_check_count"/>
+        <result property="inspectSignTime" column="inspect_sign_time"/>
+        <result property="details" column="details"/>
 
         <collection property="hazardSubjectRelations" column="id"
                     ofType="com.zd.laboratory.domain.LabHazardSubjectRelation"
@@ -150,6 +166,11 @@
                skipped,
                check_count,
                sign_time,
+               inspect_check_in,
+               inspect_skipped,
+               inspect_check_count,
+               inspect_sign_time,
+               details,
                (SELECT GROUP_CONCAT(ur.nick_name)
                 FROM sys_user ur
                 WHERE ur.`user_id`
@@ -230,6 +251,11 @@
                t.skipped,
                t.check_count,
                t.sign_time,
+               t.inspect_check_in,
+               t.inspect_skipped,
+               t.inspect_check_count,
+               t.inspect_sign_time,
+               t.details,
                CONCAT(su.nick_name, '@', su.phonenumber)                      AS          adminNameAndPhone,
 
                (select d.dept_name from sys_dept d where t.build_id = d.dept_id)          buildName,
@@ -280,7 +306,12 @@
                t.qr_code,
                su.nick_name   as                                                                admin_name,
                su.phonenumber as                                                                adminPhone,
-               sd.dept_name   as                                                                dept_name
+               sd.dept_name   as                                                                dept_name,
+               t.inspect_check_in,
+               t.inspect_skipped,
+               t.inspect_check_count,
+               t.inspect_sign_time,
+               t.details
         from lab_subject t
                  left join sys_user su on su.user_id = t.admin_id
                  left join sys_dept sd on sd.dept_id = t.dept_id
@@ -425,8 +456,12 @@
 
         (select d.dept_name from sys_dept d where t.build_id = d.dept_id) buildName,
         (select b.name from lab_building b where b.id = t.floor_id) floorName,
-        (SELECT l.room FROM lab_subject_layout l WHERE l.id = t.layout_id ) roomName
-
+        (SELECT l.room FROM lab_subject_layout l WHERE l.id = t.layout_id ) roomName,
+        t.inspect_check_in,
+        t.inspect_skipped,
+        t.inspect_check_count,
+        t.inspect_sign_time,
+        t.details
         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
@@ -544,6 +579,12 @@
             <if test="skipped != null">`skipped`,</if>
             <if test="checkCount != null">`check_count`,</if>
             <if test="moldId != null">`mold_id`,</if>
+
+            <if test="inspectCheckIn != null">inspect_check_in,</if>
+            <if test="inspectSkipped != null">inspect_skipped,</if>
+            <if test="inspectCheckCount != null">inspect_check_count,</if>
+            <if test="inspectSignTime != null">inspect_sign_time,</if>
+            <if test="details != null">details,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -578,6 +619,12 @@
             <if test="skipped != null">#{skipped},</if>
             <if test="checkCount != null">#{checkCount},</if>
             <if test="moldId != null">#{moldId},</if>
+
+            <if test="inspectCheckIn != null">#{inspectCheckIn},</if>
+            <if test="inspectSkipped != null">#{inspectSkipped},</if>
+            <if test="inspectCheckCount != null">#{inspectCheckCount},</if>
+            <if test="inspectSignTime != null">#{inspectSignTime},</if>
+            <if test="details != null">#{details},</if>
         </trim>
     </insert>
 
@@ -616,6 +663,12 @@
             <if test="checkCount != null">`check_count` = #{checkCount},</if>
             <if test="signTime != null">`sign_time` = #{signTime},</if>
             <if test="moldId != null">`mold_id` = #{moldId},</if>
+
+            <if test="inspectCheckIn != null">inspect_check_in = #{inspectCheckIn},</if>
+            <if test="inspectSkipped != null">inspect_skipped = #{inspectSkipped},</if>
+            <if test="inspectCheckCount != null">inspect_check_count = #{inspectCheckCount},</if>
+            <if test="inspectSignTime != null">inspect_sign_time = #{inspectSignTime},</if>
+            <if test="details != null">details = #{details},</if>
         </trim>
         where id = #{id}
     </update>
@@ -1040,11 +1093,7 @@
         </where>
 
     </select>
-    <select id="selectLabSubjectListPage" resultType="com.zd.laboratory.domain.vo.LabSubjectVO">
-        select *
-        from lab_subject
 
-    </select>
     <select id="selectLabSubjectListByLayout" parameterType="com.zd.laboratory.domain.LabSubject"
             resultMap="LabSubjectResult">
         select

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

@@ -9,15 +9,14 @@
         <result property="cardName" column="card_name"/>
         <result property="cardNum" column="card_num"/>
         <result property="college" column="college"/>
+        <result property="collegeId" column="college_id"/>
         <result property="location" column="location"/>
-        <result property="locationId" column="location_id"/>
         <result property="operate" column="operate"/>
         <result property="subjectId" column="subject_id"/>
         <result property="subjectName" column="subject_name"/>
         <result property="deptId" column="dept_id"/>
         <result property="deptName" column="dept_name"/>
         <result property="isStart" column="is_start"/>
-
         <result property="userId" column="user_id"/>
         <result property="createBy" column="create_by"/>
         <result property="createTime" column="create_time"/>
@@ -30,8 +29,8 @@
                card_name,
                card_num,
                college,
+               college_id
                location,
-               location_id,
                operate,
                subject_id,
                subject_name,
@@ -53,10 +52,10 @@
             <if test="cardName != null and cardName != null">and t.card_name = #{cardName}</if>
             <if test="cardNum != null and cardNum != ''">and t.card_num = #{cardNum}</if>
             <if test="college != null and college != null">and t.college = #{college}</if>
+            <if test="collegeId != null">and t.college_id = #{collegeId}</if>
             <if test="location != null and location != '' ">and t.location = #{location}</if>
-            <if test="locationId != null ">and t.location_id = #{locationId}</if>
             <if test="operate != null ">and t.operate = #{operate}</if>
-            <if test="subject_id != null ">and t.subject_id = #{subjectId}</if>
+            <if test="subjectId != null ">and t.subject_id = #{subjectId}</if>
             <if test="subjectName != null ">and t.subject_name = #{subjectName}</if>
             <if test="deptId != null ">and t.dept_id = #{deptId}</if>
             <if test="deptName != null ">and t.dept_name = #{deptName}</if>
@@ -80,8 +79,8 @@
             <if test="cardName != null">card_name,</if>
             <if test="cardNum != null">card_num,</if>
             <if test="college != null">college,</if>
+            <if test="collegeId != null">college_id,</if>
             <if test="location != null">location,</if>
-            <if test="locationId != null">location_id,</if>
             <if test="operate != null">operate,</if>
             <if test="subjectId != null">subject_id,</if>
             <if test="subjectName != null">subject_name,</if>
@@ -98,8 +97,8 @@
             <if test="cardName != null">#{cardName},</if>
             <if test="cardNum != null">#{cardNum},</if>
             <if test="college != null">#{college},</if>
+            <if test="collegeId != null">#{collegeId},</if>
             <if test="location != null">#{location},</if>
-            <if test="locationId != null">#{locationId},</if>
             <if test="operate != null">#{operate},</if>
             <if test="subjectId != null">#{subjectId},</if>
             <if test="subjectName != null">#{subjectName},</if>
@@ -120,8 +119,8 @@
             <if test="cardNum != null">card_name = #{cardNum},</if>
             <if test="cardNum != null">card_num = #{cardNum},</if>
             <if test="college != null">college = #{college},</if>
+            <if test="collegeId != null">college_id = #{collegeId},</if>
             <if test="location != null">location = #{location},</if>
-            <if test="locationId != null">location = #{locationId},</if>
             <if test="operate != null">operate = #{operate},</if>
             <if test="subjectId != null">subject_id = #{subjectId},</if>
             <if test="subjectName != null">subject_name = #{subjectName},</if>
@@ -129,7 +128,6 @@
             <if test="deptName != null">dept_name = #{deptName},</if>
             <if test="isStart != null">is_start = #{isStart},</if>
             <if test="userId != null">user_id = #{userId},</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>

+ 7 - 0
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/XxpClassifyDetailMapper.xml

@@ -11,6 +11,7 @@
         <result property="infoType" column="info_type"/>
         <result property="infoContent" column="info_content"/>
         <result property="sort" column="sort"/>
+        <result property="isCollective" column="is_collective"/>
         <result property="userId" column="user_id"/>
         <result property="createBy" column="create_by"/>
         <result property="createTime" column="create_time"/>
@@ -25,6 +26,7 @@
                info_type,
                info_content,
                sort,
+               is_collective,
                user_id,
                create_by,
                create_time,
@@ -42,6 +44,7 @@
             <if test="infoType != null ">and t.info_type = #{infoType}</if>
             <if test="infoContent != null ">and t.info_content = #{infoContent}</if>
             <if test="sort != null ">and t.sort = #{sort}</if>
+            <if test="isCollective != null ">and t.is_collective = #{isCollective}</if>
             <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 != ''">
@@ -81,6 +84,8 @@
 
             <if test="sort != null">sort,</if>
 
+            <if test="isCollective != null">is_collective,</if>
+
             <if test="userId != null">user_id,</if>
 
             <if test="createBy != null">create_by,</if>
@@ -97,6 +102,7 @@
             <if test="infoType != null">#{infoType},</if>
             <if test="infoContent != null">#{infoContent},</if>
             <if test="sort != null">#{sort},</if>
+            <if test="isCollective != null">#{isCollective},</if>
             <if test="userId != null">#{userId},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createTime != null">#{createTime},</if>
@@ -113,6 +119,7 @@
             <if test="infoType != null">info_type = #{infoType},</if>
             <if test="infoContent != null">info_content = #{infoContent},</if>
             <if test="sort != null">sort = #{sort},</if>
+            <if test="isCollective != null">is_collective = #{isCollective},</if>
             <if test="userId != null">user_id = #{userId},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="createTime != null">create_time = #{createTime},</if>

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

@@ -52,7 +52,7 @@
             <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="deptId != null ">and t.dept_id = #{deptId}</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="college != null ">and t.college = #{college}</if>
             <if test="dutyTime != null  ">and t.duty_time =#{dutyTime}</if>
@@ -65,6 +65,7 @@
                 and t.duty_time &lt;= str_to_date(#{endTime}, '%Y-%m-%d')
             </if>
         </where>
+        order by create_time desc
     </select>
 
     <select id="selectXxpDutyById" resultMap="XxpDutyResult">
@@ -125,7 +126,7 @@
             <if test="deptId != null">#{deptId},</if>
             <if test="deptName != null">#{deptName},</if>
             <if test="college != null">#{college},</if>
-            <if test="dutyTime != null">#{duty_time},</if>
+            <if test="dutyTime != null">#{dutyTime},</if>
             <if test="createById != null">#{createById},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createTime != null">#{createTime},</if>
@@ -165,4 +166,38 @@
             #{id}
         </foreach>
     </delete>
+
+    <select id="selectDutyYmdById" parameterType="com.zd.laboratory.domain.XxpDuty" resultType="com.zd.laboratory.domain.vo.XxpDutyVO">
+        select t1.duty_time
+        from (
+                 select t.duty_time
+                 from xxp_duty t
+                 where t.duty_time &gt;= str_to_date(#{beginTime}, '%Y-%m-%d')
+                   and t.duty_time &lt;= str_to_date(#{endTime}, '%Y-%m-%d')
+                 GROUP BY t.duty_time
+             ) t1
+    </select>
+
+    <select id="selectSubAndUserSum" resultType="com.zd.laboratory.domain.vo.XxpDutyVO" parameterType="java.util.Date">
+        select sum(subSum) subSum, sum(userSum) userSum
+        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
+                      ) 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
+                      ) u
+             ) t
+    </select>
+
+    <select id="selectInfoByDate" parameterType="com.zd.laboratory.domain.XxpDuty" resultType="com.zd.laboratory.domain.vo.XxpDutyVO">
+        select subject_id,subject_name from xxp_duty t
+        where t.duty_time=#{dutyTime}
+        <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>
+        GROUP BY t.subject_id, t.subject_name
+    </select>
+
 </mapper>

+ 84 - 2
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/XxpInspectionMapper.xml

@@ -28,7 +28,7 @@
                sign_out,
                dept_id,
                dept_name,
-               residence_time,
+               timediff(sign_out, sign_in) residence_time,
                create_time
         from xxp_inspection t
     </sql>
@@ -41,7 +41,7 @@
             <if test="userName != null and userName != ''">and t.user_name = #{userName}</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="signIn != null ">and t.sign_in = #{signIn}</if>
+            <if test="signIn != null ">and date_format(t.sign_in, '%Y-%m-%d') =date_format(#{signIn}, '%Y-%m-%d')</if>
             <if test="signOut != null ">and t.sign_out = #{signOut}</if>
             <if test="deptId != null ">and t.dept_id = #{deptId}</if>
             <if test="deptName != null ">and t.dept_name = #{deptName}</if>
@@ -143,4 +143,86 @@
             #{id}
         </foreach>
     </delete>
+
+    <!-- 签到总数-->
+    <select id="selectListSigninCount" parameterType="com.zd.laboratory.domain.XxpInspection"
+            resultType="com.zd.laboratory.domain.vo.XxpInspectionVO">
+        select dutyTime, count(1) signInCount
+        from (
+        select date_format(sign_in, '%Y-%m-%d') dutyTime, user_id
+        from xxp_inspection i
+        where sign_in is not null
+        and sign_in &gt;= #{beginTime}
+        and sign_in &lt;= #{endTime}
+        <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>
+        GROUP BY date_format(sign_in, '%Y-%m-%d'), user_id
+        ) t
+        GROUP BY dutyTime
+        ORDER by dutyTime
+    </select>
+
+    <!-- 未签到总数-->
+    <select id="selectListNotSigninCount" parameterType="com.zd.laboratory.domain.XxpInspection"
+            resultType="com.zd.laboratory.domain.vo.XxpInspectionVO">
+        select dutyTime, count(1) noSignedInCount
+        from (
+        select du.duty_time dutyTime,
+        du.user_id,
+        du.subject_id,
+        (select count(1)
+        from xxp_inspection i
+        where i.user_id = du.user_id
+        and date_format(i.sign_in, '%Y-%m-%d') =
+        date_format(du.duty_time, '%Y-%m-%d')
+        and i.subject_id = du.subject_id ) noSignedInCount
+        from xxp_duty du
+        where du.duty_time &gt;= #{beginTime}
+        and du.duty_time &lt;= #{endTime}
+        <if test="deptId != null ">and ( du.dept_id in (SELECT dt.dept_id FROM sys_dept dt WHERE find_in_set(#{deptId}
+            ,ancestors )) or du.dept_id = #{deptId} )
+        </if>
+        ) t
+        where noSignedInCount = 0
+        GROUP BY dutyTime
+        ORDER BY dutyTime
+    </select>
+
+    <!-- 正常签到列表-->
+    <select id="selectListSignin" parameterType="com.zd.laboratory.domain.XxpInspection"
+            resultMap="XxpInspectionResult">
+        <include refid="selectXxpInspection"/>
+        where sign_in is not null and sign_out is not null
+        <if test="signIn != null">and date_format(t.sign_in, '%Y-%m-%d') =date_format(#{signIn}, '%Y-%m-%d')</if>
+    </select>
+
+    <!-- 异常签到列表-->
+    <select id="selectListAbnormal" parameterType="com.zd.laboratory.domain.XxpDuty"
+            resultType="com.zd.laboratory.domain.XxpDuty">
+        select d.user_name, d.user_phone, d.subject_name, '巡查后未签退' remark
+        from xxp_inspection i
+                 LEFT JOIN xxp_duty d
+                           on i.user_id = d.user_id and i.subject_id = d.subject_id and
+                              date_format(i.sign_in, '%Y-%m-%d') = d.duty_time
+        where sign_out is null
+          and date_format(i.sign_in, '%Y-%m-%d') = date_format(#{dutyTime}, '%Y-%m-%d')
+
+        UNION all
+
+        select user_name, user_phone, subject_name, '未巡查' remark
+        from (
+                 select du.user_name,
+                        du.user_phone,
+                        du.subject_name,
+                        (select count(1)
+                         from xxp_inspection i
+                         where i.user_id = du.user_id
+                           and date_format(i.sign_in, '%Y-%m-%d') = date_format(du.duty_time, '%Y-%m-%d')
+                           and i.subject_id = du.subject_id) noSignedInCount
+                 from xxp_duty du
+                 where du.duty_time = date_format(#{dutyTime}, '%Y-%m-%d')
+             ) t
+        where noSignedInCount = 0
+    </select>
 </mapper>

+ 33 - 0
zd-modules/zd-modules-system/src/main/java/com/zd/system/domain/SysLogoConfig.java

@@ -69,6 +69,15 @@ public class SysLogoConfig extends BaseEntity
     @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 void setId(Long id)
     {
         this.id = id;
@@ -183,6 +192,30 @@ public class SysLogoConfig extends BaseEntity
         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;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 97 - 45
zd-modules/zd-modules-system/src/main/resources/mapper/system/SysLogoConfigMapper.xml

@@ -1,7 +1,7 @@
 <?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">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.zd.system.mapper.SysLogoConfigMapper">
 
     <resultMap type="com.zd.system.domain.SysLogoConfig" id="SysLogoConfigResult">
@@ -18,78 +18,124 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="userType" column="user_type"/>
         <result property="smartLock" column="smart_lock"/>
         <result property="airBottle" column="air_bottle"/>
+        <result property="returnTime" column="return_time"/>
+        <result property="logoutTime" column="logout_time"/>
+        <result property="isStart" column="is_start"/>
 
     </resultMap>
 
     <sql id="selectSysLogoConfigVo">
-        select id, school_name, circular_logo, rectangle_logo, lot_control, sign_map, video_cover, operation_guide, login_banner, homepage_banner,user_type,smart_lock,
-            air_bottle
+        select id,
+               school_name,
+               circular_logo,
+               rectangle_logo,
+               lot_control,
+               sign_map,
+               video_cover,
+               operation_guide,
+               login_banner,
+               homepage_banner,
+               user_type,
+               smart_lock,
+               air_bottle,
+               return_time,
+               logout_time,
+               is_start
         from sys_logo_config
     </sql>
     <sql id="selectSysLogoConfigListVo">
-        select t.id, t.school_name, t.circular_logo, t.rectangle_logo, t.lot_control, t.sign_map, t.video_cover, t.operation_guide, t.login_banner, t.homepage_banner,t.user_type from sys_logo_config as t
+        select t.id,
+               t.school_name,
+               t.circular_logo,
+               t.rectangle_logo,
+               t.lot_control,
+               t.sign_map,
+               t.video_cover,
+               t.operation_guide,
+               t.login_banner,
+               t.homepage_banner,
+               t.user_type,
+               t.return_time,
+               t.logout_time,
+               t.is_start
+        from sys_logo_config as t
     </sql>
-    <select id="selectSysLogoConfigList" parameterType="com.zd.system.domain.SysLogoConfig" resultMap="SysLogoConfigResult">
+    <select id="selectSysLogoConfigList" parameterType="com.zd.system.domain.SysLogoConfig"
+            resultMap="SysLogoConfigResult">
         <include refid="selectSysLogoConfigVo"/>
         <where>
-            <if test="schoolName != null  and schoolName != ''"> and school_name like concat('%', #{schoolName}, '%')</if>
-            <if test="circularLogo != null  and circularLogo != ''"> and circular_logo = #{circularLogo}</if>
-            <if test="rectangleLogo != null  and rectangleLogo != ''"> and rectangle_logo = #{rectangleLogo}</if>
-            <if test="lotControl != null  and lotControl != ''"> and lot_control = #{lotControl}</if>
-            <if test="signMap != null  and signMap != ''"> and sign_map = #{signMap}</if>
-            <if test="videoCover != null  and videoCover != ''"> and video_cover = #{videoCover}</if>
-            <if test="operationGuide != null  and operationGuide != ''"> and operation_guide = #{operationGuide}</if>
-            <if test="loginBanner != null  and loginBanner != ''"> and login_banner = #{loginBanner}</if>
-            <if test="homepageBanner != null  and homepageBanner != ''"> and homepage_banner = #{homepageBanner}</if>
+            <if test="schoolName != null  and schoolName != ''">and school_name like concat('%', #{schoolName}, '%')
+            </if>
+            <if test="circularLogo != null  and circularLogo != ''">and circular_logo = #{circularLogo}</if>
+            <if test="rectangleLogo != null  and rectangleLogo != ''">and rectangle_logo = #{rectangleLogo}</if>
+            <if test="lotControl != null  and lotControl != ''">and lot_control = #{lotControl}</if>
+            <if test="signMap != null  and signMap != ''">and sign_map = #{signMap}</if>
+            <if test="videoCover != null  and videoCover != ''">and video_cover = #{videoCover}</if>
+            <if test="operationGuide != null  and operationGuide != ''">and operation_guide = #{operationGuide}</if>
+            <if test="loginBanner != null  and loginBanner != ''">and login_banner = #{loginBanner}</if>
+            <if test="homepageBanner != null  and homepageBanner != ''">and homepage_banner = #{homepageBanner}</if>
+            <if test="returnTime != null">and return_time = #{returnTime}</if>
+            <if test="logoutTime != null">and logout_time = #{logoutTime}</if>
+            <if test="isStart != null">and is_start = #{isStart}</if>
         </where>
     </select>
 
-    <select id="selectSysLogoConfigById"  resultMap="SysLogoConfigResult">
+    <select id="selectSysLogoConfigById" resultMap="SysLogoConfigResult">
         <include refid="selectSysLogoConfigVo"/>
         where id = #{id}
     </select>
 
-    <insert id="insertSysLogoConfig" parameterType="com.zd.system.domain.SysLogoConfig" useGeneratedKeys="true" keyProperty="id">
+    <insert id="insertSysLogoConfig" parameterType="com.zd.system.domain.SysLogoConfig" useGeneratedKeys="true"
+            keyProperty="id">
         insert into sys_logo_config
         <trim prefix="(" suffix=")" suffixOverrides=",">
-    <if test="schoolName != null">school_name,</if>
+            <if test="schoolName != null">school_name,</if>
 
-    <if test="circularLogo != null">circular_logo,</if>
+            <if test="circularLogo != null">circular_logo,</if>
 
-    <if test="rectangleLogo != null">rectangle_logo,</if>
+            <if test="rectangleLogo != null">rectangle_logo,</if>
 
-    <if test="lotControl != null">lot_control,</if>
+            <if test="lotControl != null">lot_control,</if>
 
-    <if test="signMap != null">sign_map,</if>
+            <if test="signMap != null">sign_map,</if>
 
-    <if test="videoCover != null">video_cover,</if>
+            <if test="videoCover != null">video_cover,</if>
 
-    <if test="operationGuide != null">operation_guide,</if>
+            <if test="operationGuide != null">operation_guide,</if>
 
-    <if test="loginBanner != null">login_banner,</if>
+            <if test="loginBanner != null">login_banner,</if>
 
-    <if test="homepageBanner != null">homepage_banner,</if>
+            <if test="homepageBanner != null">homepage_banner,</if>
 
-    <if test="userType != null">user_type,</if>
+            <if test="userType != null">user_type,</if>
 
-    <if test="smartLock != null">smart_lock,</if>
+            <if test="smartLock != null">smart_lock,</if>
 
-    <if test="airBottle != null">air_bottle,</if>
-         </trim>
+            <if test="airBottle != null">air_bottle,</if>
+
+            <if test="returnTime != null">return_time,</if>
+
+            <if test="logoutTime != null">logout_time,</if>
+
+            <if test="isStart != null">is_start,</if>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-    <if test="schoolName != null">#{schoolName},</if>
-    <if test="circularLogo != null">#{circularLogo},</if>
-    <if test="rectangleLogo != null">#{rectangleLogo},</if>
-    <if test="lotControl != null">#{lotControl},</if>
-    <if test="signMap != null">#{signMap},</if>
-    <if test="videoCover != null">#{videoCover},</if>
-    <if test="operationGuide != null">#{operationGuide},</if>
-    <if test="loginBanner != null">#{loginBanner},</if>
-    <if test="homepageBanner != null">#{homepageBanner},</if>
-    <if test="userType != null">#{userType},</if>
-    <if test="smartLock != null">#{smartLock},</if>
-    <if test="airBottle != null">#{airBottle},</if>
-         </trim>
+            <if test="schoolName != null">#{schoolName},</if>
+            <if test="circularLogo != null">#{circularLogo},</if>
+            <if test="rectangleLogo != null">#{rectangleLogo},</if>
+            <if test="lotControl != null">#{lotControl},</if>
+            <if test="signMap != null">#{signMap},</if>
+            <if test="videoCover != null">#{videoCover},</if>
+            <if test="operationGuide != null">#{operationGuide},</if>
+            <if test="loginBanner != null">#{loginBanner},</if>
+            <if test="homepageBanner != null">#{homepageBanner},</if>
+            <if test="userType != null">#{userType},</if>
+            <if test="smartLock != null">#{smartLock},</if>
+            <if test="airBottle != null">#{airBottle},</if>
+            <if test="returnTime != null">#{returnTime},</if>
+            <if test="logoutTime != null">#{logoutTime},</if>
+            <if test="isStart != null">#{isStart},</if>
+        </trim>
     </insert>
 
     <update id="updateSysLogoConfig" parameterType="com.zd.system.domain.SysLogoConfig">
@@ -107,12 +153,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="userType != null">user_type = #{userType},</if>
             <if test="smartLock != null">smart_lock = #{smartLock},</if>
             <if test="airBottle != null">air_bottle = #{airBottle},</if>
+
+            <if test="returnTime != null">return_time = #{returnTime},</if>
+            <if test="logoutTime != null">logout_time = #{logoutTime},</if>
+            <if test="isStart != null">is_start = #{isStart},</if>
         </trim>
         where id = #{id}
     </update>
 
-    <delete id="deleteSysLogoConfigById" >
-        delete from sys_logo_config where id = #{id}
+    <delete id="deleteSysLogoConfigById">
+        delete
+        from sys_logo_config
+        where id = #{id}
     </delete>
 
     <delete id="deleteSysLogoConfigByIds">