Pārlūkot izejas kodu

2022-1-13 修改大屏统计违规数据,详情列表功能添加离开未打卡,修改一体机人员头像没有,就置空,预案风险详情。

chaiyunlong 3 gadi atpakaļ
vecāks
revīzija
eda489e457

+ 6 - 4
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/onemachine/controller/OneMachineController.java

@@ -353,10 +353,12 @@ public class OneMachineController extends BaseController {
                 url=fileConfigUtils.getRemoteUrl()+sysUser.getAvatar();
             }*/
             //通过配置动态加载域名
-            url = fileConfigUtils.getFileDomainApp() + sysUser.getAvatar();
-            url= UrlFormatUtils.getHttpsORHttpUrl(url);
-            logger.error("url:"+url);
-            sysUser.setAvatar(url);
+            if(StringUtils.isNotNull(sysUser.getAvatar())){
+                url = fileConfigUtils.getFileDomainApp() + sysUser.getAvatar();
+                url= UrlFormatUtils.getHttpsORHttpUrl(url);
+                logger.error("url:"+url);
+                sysUser.setAvatar(url);
+            }
         }
         return getDataTable(sysList);
     }

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

@@ -6,6 +6,7 @@ import com.zd.algorithm.api.alarm.entity.AlarmLog;
 import com.zd.common.core.annotation.DataScope;
 import com.zd.common.core.utils.DateUtils;
 import com.zd.common.core.utils.SecurityUtils;
+import com.zd.laboratory.api.entity.SensorFunctionStatus;
 import com.zd.laboratory.config.HardwareFunctionStatusConfig;
 import com.zd.laboratory.domain.*;
 import com.zd.laboratory.domain.vo.LabRiskPlanAbnormalLogVO;
@@ -74,7 +75,18 @@ public class LabRiskPlanAbnormalLogServiceImpl implements ILabRiskPlanAbnormalLo
     @Override
     @DataScope(deptAlias = "s", permi = PerPrefix.LABORATORY_PLANLOG)
     public List<LabRiskPlanAbnormalLog> selectLabRiskPlanAbnormalLogList(LabRiskPlanAbnormalLog labRiskPlanAbnormalLog) {
-        return labRiskPlanAbnormalLogMapper.selectLabRiskPlanAbnormalLogList(labRiskPlanAbnormalLog);
+        List<LabRiskPlanAbnormalLog> riskLogList = labRiskPlanAbnormalLogMapper.selectLabRiskPlanAbnormalLogList(labRiskPlanAbnormalLog);
+        for(LabRiskPlanAbnormalLog riskLog:riskLogList){
+            JSONArray json = JSONArray.parseArray(riskLog.getSensorJson());
+            if (json != null) {
+                for (int i = 0; i < json.size(); i++) {
+                    String describe = json.getJSONObject(i).get("describe")+"传感器:检测数值"+json.getJSONObject(i).get("value");
+                    riskLog.setRemark(describe);
+                }
+            }
+        }
+
+        return riskLogList;
     }
 
     /**

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

@@ -314,7 +314,7 @@ public class LabViolationServiceImpl implements ILabViolationService {
             Optional.ofNullable(value).orElseGet(Collections::emptyList).stream()
                     .forEach(a -> Optional.ofNullable(allList).orElseGet(Collections::emptyList).stream()
                             .filter(b -> b.getType().equals(a.getType())).forEach(b -> {
-                                b.setNum(a.getNum());
+                                b.setNum(a.getNum()+b.getNum());
                                 b.setCurrencyid(a.getCurrencyid());
                                 b.setCurrencyName(a.getCurrencyName());
                             }));

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

@@ -64,7 +64,8 @@
         pl.create_by, pl.update_time, pl.update_by,
         dt.dept_id,
         dt.dept_name,
-        s.name as subjectName
+        s.name as subjectName,
+        pl.sensor_json
         from lab_risk_plan_abnormal_log pl left join lab_subject s on pl.subject_id = s.id
         LEFT JOIN sys_dept dt ON s.`dept_id` = dt.`dept_id`
         <where>

+ 14 - 4
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabViolationMapper.xml

@@ -332,7 +332,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         SELECT '-99' id,'其他' violation_name FROM DUAL
         ) dd LEFT JOIN
         (
-        SELECT v.id,v.`violation_type`,s.build_id dept_id,t.parent_id,t.`ancestors`,
+        SELECT DISTINCT v.id,v.`violation_type`,s.build_id dept_id,t.parent_id,t.`ancestors`,
         (SELECT dt.`dept_id`
         FROM  sys_dept d JOIN sys_dept dt ON d.dept_id = dt.parent_id
         WHERE d.parent_id = 0 AND FIND_IN_SET(dt.dept_id,t.`ancestors`)) deptGroup
@@ -340,6 +340,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             SELECT v.reason violation_type, vs.`id`,v.`laboratory_id` subject_id,v.`create_time`
             FROM lab_negativelist_history v INNER JOIN lab_violation_score_site vs ON v.`reason` = vs.`violation_name`
             UNION ALL
+            SELECT v.violation_content violation_type, v.`id`,v.`subject_id`,v.`create_time` FROM lab_violation v
+            UNION ALL
             SELECT '其他' violation_type , '-99' id,v.`laboratory_id` subject_id,v.`create_time`
             FROM lab_negativelist_history v
             WHERE v.reason NOT IN(
@@ -375,6 +377,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             SELECT v.reason violation_type, vs.`id`,v.`laboratory_id` subject_id,v.`create_time`
             FROM lab_negativelist_history v INNER JOIN lab_violation_score_site vs ON v.`reason` = vs.`violation_name`
             UNION ALL
+            SELECT v.violation_content violation_type, v.`id`,v.`subject_id`,v.`create_time` FROM lab_violation v
+            UNION ALL
             SELECT '其他' violation_type , '-99' id,v.`laboratory_id` subject_id,v.`create_time`
             FROM lab_negativelist_history v
             WHERE v.reason NOT IN(
@@ -382,7 +386,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             FROM lab_violation_score_site vs
             )
             ) v ON s.`id` = v.`subject_id`
-            )x2 GROUP BY x2.subjectId ORDER BY num DESC LIMIT 10
+            )x2 GROUP BY x2.subjectId ORDER BY num DESC
         )xs1 LEFT JOIN (
         SELECT xx2.type,xx2.content,xx2.num,xx2.subjectId currencyId,xx2.subjectName currencyName FROM (SELECT x2.subjectId,IFNULL(COUNT(1),0) num FROM (
         SELECT v.id,v.`violation_type`,s.id subjectId,s.`name` subjectName
@@ -390,6 +394,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         SELECT v.reason violation_type, vs.`id`,v.`laboratory_id` subject_id,v.`create_time`
         FROM lab_negativelist_history v INNER JOIN lab_violation_score_site vs ON v.`reason` = vs.`violation_name`
         UNION ALL
+        SELECT v.violation_content violation_type, v.`id`,v.`subject_id`,v.`create_time` FROM lab_violation v
+        UNION ALL
         SELECT '其他' violation_type , '-99' id,v.`laboratory_id` subject_id,v.`create_time`
         FROM lab_negativelist_history v
         WHERE v.reason NOT IN(
@@ -402,7 +408,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <!-- 数据范围过滤 -->
             ${params.dataScope}
         </where>
-        )x2 GROUP BY x2.subjectId ORDER BY num DESC LIMIT 10)xx1
+        )x2 GROUP BY x2.subjectId ORDER BY num DESC)xx1
         INNER JOIN (
         SELECT dd.id AS TYPE, dd.violation_name AS content,IFNULL(COUNT(x1.id),0) num,x1.subjectId subjectId,x1.`subjectName` subjectName
         FROM (
@@ -417,6 +423,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         SELECT v.reason violation_type, vs.`id`,v.`laboratory_id` subject_id,v.`create_time`
         FROM lab_negativelist_history v INNER JOIN lab_violation_score_site vs ON v.`reason` = vs.`violation_name`
         UNION ALL
+        SELECT v.violation_content violation_type, v.`id`,v.`subject_id`,v.`create_time` FROM lab_violation v
+        UNION ALL
         SELECT '其他' violation_type , '-99' id,v.`laboratory_id` subject_id,v.`create_time`
         FROM lab_negativelist_history v
         WHERE v.reason NOT IN(
@@ -440,7 +448,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         )x1 ON dd.violation_name = x1.violation_type
         GROUP BY x1.subjectId,x1.violation_type
         )xx2 ON xx1.subjectId = xx2.subjectId
-        )xs2 ON xs1.currencyId = xs2.currencyId ORDER BY num DESC,xs1.currencyId DESC
+        )xs2 ON xs1.currencyId = xs2.currencyId ORDER BY num DESC,xs1.currencyId DESC LIMIT 10
     </select>
 
 
@@ -460,6 +468,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             SELECT v.reason violation_type, vs.`id` id,v.`laboratory_id` subject_id,v.`create_time`
             FROM lab_negativelist_history v INNER JOIN lab_violation_score_site vs ON v.`reason` = vs.`violation_name`
             UNION ALL
+            SELECT v.violation_content violation_type, v.`id`,v.`subject_id`,v.`create_time` FROM lab_violation v
+            UNION ALL
             SELECT '其他' violation_type , '-99' id,v.`laboratory_id` subject_id,v.`create_time`
             FROM lab_negativelist_history v
             WHERE v.reason NOT IN(