Преглед изворни кода

Merge remote-tracking branch 'origin/V0.0.2' into V0.0.2

jingyuanchao пре 2 година
родитељ
комит
35c1738364
32 измењених фајлова са 367 додато и 267 уклоњено
  1. 15 1
      project_data/sql/0.0.2/soc/soc.sql
  2. 2 2
      soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/panel/vo/PanelListVo.java
  3. 4 4
      soc-common/soc-common-core/src/main/java/com/xunmei/common/core/web/page/TableDataInfo.java
  4. 1 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/service/ICoreEvaluateTaskService.java
  5. 1 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/information/service/impl/CoreMessageCenterServiceImpl.java
  6. 2 25
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/controller/ApiPlanController.java
  7. 6 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/domain/AppResumptionData.java
  8. 4 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/domain/AppRulePoint.java
  9. 6 38
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/dto/rulePoint/AppRulePointDetailDto.java
  10. 2 31
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/dto/rulePoint/AppRulePointDto.java
  11. 7 13
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/dto/rulePoint/AppRulePointInfoDto.java
  12. 81 26
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/gx/service/ResumptionServiceImpl.java
  13. 8 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/gx/vo/ResumptionNFCVo.java
  14. 10 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/gx/vo/ResumptionPlanVo.java
  15. 4 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/gx/vo/ResumptionPointVo.java
  16. 2 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/mapper/ResumptionMapper.java
  17. 9 6
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/AppPlanServiceImpl.java
  18. 1 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/AppRuleItemServiceImpl.java
  19. 9 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/appPlan/RuleItemVo.java
  20. 9 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/appRuleItem/AppRulePointSelectVo.java
  21. 3 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/resumptionRecord/AppResumptionDataInfoVo.java
  22. 3 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/resumptionRecord/NFCRecordVo.java
  23. 1 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/controller/CoreSafecheckPlanController.java
  24. 8 6
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/impl/CoreSafecheckPlanServiceImpl.java
  25. 97 96
      soc-modules/soc-modules-core/src/main/resources/mapper/resumption/AppPlanMapper.xml
  26. 6 2
      soc-modules/soc-modules-core/src/main/resources/mapper/resumption/AppRulePointMapper.xml
  27. 23 7
      soc-modules/soc-modules-core/src/main/resources/mapper/resumption/ResumptionMapper.xml
  28. 6 2
      soc-modules/soc-modules-core/src/main/resources/mapper/resumption/ResumptionRecordMapper.xml
  29. 17 3
      soc-modules/soc-modules-core/src/main/resources/mapper/retrieval/CoreMonitoringRetrievalTaskMapper.xml
  30. 1 1
      soc-modules/soc-modules-core/src/main/resources/mapper/safetycheck/CoreSafetyTaskMapper.xml
  31. 18 1
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysAreaCheckController.java
  32. 1 1
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysAreaController.java

+ 15 - 1
project_data/sql/0.0.2/soc/soc.sql

@@ -151,7 +151,6 @@ CREATE TABLE `core_evaluate_task_content` (
                                               `code` BIGINT DEFAULT NULL COMMENT '编号',
                                               `content_type` VARCHAR ( 2 ) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '评价类型',
                                               `content` VARCHAR ( 1000 ) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '内容',
-                                                  `company` VARCHAR ( 255 ) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '被评价公司名称',
                                               `score` VARCHAR ( 1000 ) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '评价评分',
                                               PRIMARY KEY ( `id` )
 ) ENGINE = INNODB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '外包评价任务绑定内容';
@@ -1130,6 +1129,21 @@ END IF;
 			CHANGE COLUMN `plan_id` `parent_plan_id` bigint NULL DEFAULT NULL COMMENT '父计划id,没有就与plan_id一致' AFTER `ymd_minute`,
 			ADD COLUMN `plan_id` bigint NULL COMMENT '生成任务的计划id' AFTER `parent_plan_id`;
     END IF;
+	
+	-- 履职库内容表增加NFC点位
+    IF
+        NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = DATABASE () and TABLE_NAME = 'core_resumption_rule_point' AND COLUMN_NAME = 'check_id' ) THEN
+        ALTER TABLE `core_resumption_rule_point` 
+			MODIFY COLUMN `area_id` bigint NULL COMMENT '履职区域,区域表id' AFTER `name`,
+			ADD COLUMN `check_id` bigint NULL COMMENT 'NFC点位id' AFTER `area_id`;
+    END IF;
+	
+	-- 履职登记内容表增加NFC点位
+    IF
+        NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = DATABASE () and TABLE_NAME = 'core_resumption_data' AND COLUMN_NAME = 'check_id' ) THEN
+        ALTER TABLE `core_resumption_data` 
+			ADD COLUMN `check_id` bigint NULL COMMENT '点位id' AFTER `area_id`;
+    END IF;
 
     -- 演练任务增加演练结束时间
     IF NOT EXISTS(SELECT *

+ 2 - 2
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/panel/vo/PanelListVo.java

@@ -37,8 +37,8 @@ public class PanelListVo {
     @ApiModelProperty(value = "评优状态",notes = "仅演练使用该字段")
     private Integer recStatus;
 
-
-
+    @ApiModelProperty(value = "是否存在监控",notes = "0不存在1存在")
+    private Integer isExist;
 
 
 }

+ 4 - 4
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/web/page/TableDataInfo.java

@@ -24,7 +24,7 @@ public class TableDataInfo<T> implements Serializable {
     /**
      * 列表数据
      */
-    private List<?> rows;
+    private List<T> rows;
 
     /**
      * 消息状态码
@@ -48,7 +48,7 @@ public class TableDataInfo<T> implements Serializable {
      * @param list  列表数据
      * @param total 总记录数
      */
-    public TableDataInfo(List<?> list, int total) {
+    public TableDataInfo(List<T> list, int total) {
         this.rows = list;
         this.total = total;
     }
@@ -97,11 +97,11 @@ public class TableDataInfo<T> implements Serializable {
         this.total = total;
     }
 
-    public List<?> getRows() {
+    public List<T> getRows() {
         return rows;
     }
 
-    public void setRows(List<?> rows) {
+    public void setRows(List<T> rows) {
         this.rows = rows;
     }
 

+ 1 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/service/ICoreEvaluateTaskService.java

@@ -74,4 +74,5 @@ public interface ICoreEvaluateTaskService extends IService<CoreEvaluateTask> {
      * @return Page
      */
     TableDataInfo<CoreEvaluateTaskVO> selectPage(EvaluateTaskDTO evaluateTaskDTO);
+
 }

+ 1 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/information/service/impl/CoreMessageCenterServiceImpl.java

@@ -61,7 +61,7 @@ public class CoreMessageCenterServiceImpl extends ServiceImpl<CoreMessageCenterM
     @Override
     public TableDataInfo selectByPage(CoreMessageCenterDTO coreMessageCenterDTO) {
         Page<CoreMessageCenterVO> coreMessageCenterPage = coreMessageCenterMapper.selectByPage(coreMessageCenterDTO.getPageRequest(), coreMessageCenterDTO);
-        TableDataInfo<CoreMessageCenter> tableDataInfo = new TableDataInfo();
+        TableDataInfo<CoreMessageCenterVO> tableDataInfo = new TableDataInfo();
         tableDataInfo.setMsg("操作成功");
         tableDataInfo.setCode(200);
         tableDataInfo.setTotal(coreMessageCenterPage.getTotal());

+ 2 - 25
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/controller/ApiPlanController.java

@@ -154,31 +154,8 @@ public class ApiPlanController {
             //判断是否是编辑并且计划所属任务不存在已完成或者逾期,需要删除所有任务重新生成
             boolean isEditAll = info.getHasEdit() == null && info.getId() != null;
             //如果计划所属机构类型为行社并且勾选立即执行,新增的时候立即生成任务
-            if ((info.getId() == null &&planOfOrgType!=null&& planOfOrgType == 3 && info.getBuildTaskNow() == 1) || isEditAll) {
-//                    DateTime datetime = new DateTime();
-//                    datetime.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
-//                    //当有周期存在时保持原有接口不变(doTask),否则按照新的接口创建
-//                    Integer plancycle = info.getPlanCycle();
-//                    if (plancycle != null) {
-//                        if (plancycle == 2) {
-//                            taskBusiness.syncDay(datetime, plancycle);
-//                        }
-//                        if (plancycle == 3) {
-//                            taskBusiness.syncWeek(datetime, plancycle);
-//                        }
-//                        if (plancycle == 4) {
-//                            taskBusiness.syncMonth(datetime, plancycle);
-//                        }
-//                        if (plancycle == 5) {
-//                            taskBusiness.syncQuarter(datetime, plancycle);
-//                        }
-//                        if (plancycle == 6) {
-//                            taskBusiness.syncHalfYear(datetime, plancycle);
-//                        }
-//                        if (plancycle == 7) {
-//                            taskBusiness.syncYear(datetime, plancycle);
-//                        }
-//                    }
+            if ( isEditAll) {
+
                 //如果编辑
                 List<AppPlan> list = appPlanService.list(new LambdaQueryWrapper<AppPlan>().eq(AppPlan::getParentId, plan.getId()).eq(AppPlan::getDeleted, 0));
                 list.add(plan);

+ 6 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/domain/AppResumptionData.java

@@ -69,6 +69,12 @@ public class AppResumptionData extends Model<AppResumptionData> implements Seria
      * 区域id
      */
     private Long areaId;
+
+    /**
+     * 点位id
+     */
+    private Long checkId;
+
     private String resRemark;
     /**
      * 整改期限

+ 4 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/domain/AppRulePoint.java

@@ -45,6 +45,10 @@ public class AppRulePoint extends BaseEntity {
     @TableField("area_id")
     private Long areaId;
 
+    @ApiModelProperty(value = "检查区域,区域表id")
+    @TableField("check_id")
+    private Long checkId;
+
     @TableField("business_type")
     @ApiModelProperty(value = "该要点关联的业务类型")
     private String businessType;

+ 6 - 38
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/dto/rulePoint/AppRulePointDetailDto.java

@@ -16,12 +16,6 @@ public class AppRulePointDetailDto {
     @JsonSerialize(using = ToStringSerializer.class)
     private Long id;
 
-//    @ApiModelProperty(value = "规范id")
-//    private Long ruleId;
-
-//    @ApiModelProperty(value = "检查要点编号")
-//    private int pointNum;
-
     @ApiModelProperty(value = "检查要点名称")
     private String name;
 
@@ -32,42 +26,16 @@ public class AppRulePointDetailDto {
     @ApiModelProperty(value = "检查区域名称")
     private String areaName;
 
-//    @ApiModelProperty(value = "安防类型,字典表value")
-//    private Integer safeType;
-//
-//    @ApiModelProperty(value = "安防类型名称")
-//    private String safeTypeName;
-//
-//    @ApiModelProperty(value = "整改期限,天数")
-//    private int reformDay;
-//
-//    @ApiModelProperty(value = "检查方法,字典表value")
-//    private Integer inspection;
-//
-//    @ApiModelProperty(value = "检查方法名称")
-//    private String inspectionName;
-//
-//    @ApiModelProperty(value = "数据类型,数据类型表id")
-//    private Long dataType;
-//
-//    @ApiModelProperty(value = "数据类型,数据类型表id")
-//    private String dataTypeName;
-//
-//    @ApiModelProperty(value = "时间类型,0无,1时分")
-//    private Integer timeType;
+    @ApiModelProperty(value = "NFC点位id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long checkId;
+
+    @ApiModelProperty(value = "NFC点位名称")
+    private String checkName;
 
     @ApiModelProperty(value = "备注")
     private String remark;
 
-//    @ApiModelProperty(value = "风险等级code")
-//    private Long degreeRisk;
-//
-//    @ApiModelProperty(value = "风险等级名称")
-//    private String degreeRiskName;
-
-    /*@ApiModelProperty(value = "sys_area_check 主键id")
-    private Long nfcBindId;*/
-
     @ApiModelProperty(value = "要点关联的业务类型")
     private String businessType;
 }

+ 2 - 31
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/dto/rulePoint/AppRulePointDto.java

@@ -13,50 +13,21 @@ public class AppRulePointDto {
     @ApiModelProperty(value = "检查点id")
     private Long id;
 
-//    @ApiModelProperty(value = "规范id")
-//    private Long ruleId;
-
     @ApiModelProperty(value = "检查项id")
     private Long itemId;
 
-//    @ApiModelProperty(value = "检查要点编号")
-//    private int pointNum;
-
     @ApiModelProperty(value = "检查要点名称")
     private String name;
 
     @ApiModelProperty(value = "检查区域,区域表id")
     private Long areaId;
 
-//    @ApiModelProperty(value = "安防类型,字典表id")
-//    private Integer safeType;
-//
-//    @ApiModelProperty(value = "整改期限,天数")
-//    private int reformDay;
-//
-//    @ApiModelProperty(value = "检查方法,字典表id")
-//    private Integer inspection;
-//
-//    @ApiModelProperty(value = "数据类型,数据类型表id")
-//    private Long dataType;
-//
-//    @ApiModelProperty(value = "时间类型,0无,1时分")
-//    private Integer timeType;
+    @ApiModelProperty(value = "检查区域,区域表id")
+    private Long checkId;
 
     @ApiModelProperty(value = "备注")
     private String remark;
 
-//    @NotNull(message = "规则类型不能为空")
-//    @ApiModelProperty("规范类型id")
-//    private Long ruleTypeId;
-
-//    @ApiModelProperty("风险等级")
-//    private Long degreeRisk;
-
-    /*@ApiModelProperty(value = "nfc采集点id")
-    private Long nfcBindId;*/
-
     @ApiModelProperty(value = "要点关联的业务类型")
     private String businessType;
-
 }

+ 7 - 13
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/dto/rulePoint/AppRulePointInfoDto.java

@@ -15,9 +15,6 @@ public class AppRulePointInfoDto {
     @ApiModelProperty(value = "检查项id")
     private Long itemId;
 
-//    @ApiModelProperty(value = "检查项编号")
-//    private Integer itemNum;
-
     @ApiModelProperty(value = "检查项内容")
     private String itemName;
 
@@ -27,22 +24,19 @@ public class AppRulePointInfoDto {
     @ApiModelProperty(value = "检查点id")
     private Long id;
 
-//    @ApiModelProperty(value = "检查要点编号")
-//    private int pointNum;
-
-//    @ApiModelProperty(value = "安防类型,字典表value")
-//    private Integer safeType;
-//
-//    @ApiModelProperty(value = "安防类型名称")
-//    private String safeTypeText;
-
     @ApiModelProperty(value = "检查区域,区域表id")
-    @JsonSerialize(using = ToStringSerializer.class)
     private Long areaId;
 
     @ApiModelProperty(value = "检查区域名称")
     private String areaName;
 
+    @ApiModelProperty(value = "NFC点位id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long checkId;
+
+    @ApiModelProperty(value = "NFC点位名称")
+    private String checkName;
+
     @ApiModelProperty(value = "采集点名称")
     private String nfcName;
 

+ 81 - 26
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/gx/service/ResumptionServiceImpl.java

@@ -1,8 +1,10 @@
 package com.xunmei.core.resumption.gx.service;
 
+import cn.hutool.core.collection.ListUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.xunmei.common.core.constant.SecurityConstants;
 import com.xunmei.common.core.utils.DateHelper;
 import com.xunmei.common.security.utils.SecurityUtils;
@@ -15,11 +17,13 @@ import com.xunmei.core.resumption.mapper.*;
 import com.xunmei.core.resumption.vo.ResumptionTaskNewDto;
 import com.xunmei.system.api.RemoteOrgService;
 import com.xunmei.system.api.domain.SysOrg;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.*;
+import java.util.stream.Collectors;
 
 @Service("gxResumptionService")
 public class ResumptionServiceImpl implements ResumptionService {
@@ -91,7 +95,6 @@ public class ResumptionServiceImpl implements ResumptionService {
             Long planId = resumption.getPlanId();
             resumptionPlanVos = appPlanMapper.selectResumptionPlan(planId);
             isExist = false;
-
         } else {
             resumptionPlanVos = resumptionMapper.selectResumptionPlan(taskDetailVo.getTaskId());
             isExist = true;
@@ -148,6 +151,7 @@ public class ResumptionServiceImpl implements ResumptionService {
                 data.setDataStatus(point.getDataStatus());
                 data.setResumptionId(taskId);
                 data.setAreaId(check.getAreaId());
+                data.setCheckId(point.getCheckId());
                 data.setItemId(point.getPointId());
                 data.setRectificationDeadline(point.getRectificationDeadline());
                 data.setResRemark(point.getResRemark());
@@ -246,20 +250,57 @@ public class ResumptionServiceImpl implements ResumptionService {
             QueryWrapper<AppResumptionDataRemarkimg> qw = new QueryWrapper<>();
             qw.lambda().eq(AppResumptionDataRemarkimg::getResumptionId, resumption.getId());
             List<AppResumptionDataRemarkimg> imgs = appResumptionDataRemarkimgMapper.selectList(qw);
-            for (AppResumptionDataRemarkimg img : imgs) {
-                Long resumptionDataId = img.getResumptionDataId();
-                List<AppResumptionDataRemarkimg> paths = imgMap.get(resumptionDataId);
-                if (paths == null) {
-                    paths = new ArrayList<>();
+            imgMap = imgs.stream().collect(Collectors.groupingBy(img -> img.getResumptionDataId()));
+//            for (AppResumptionDataRemarkimg img : imgs) {
+//                Long resumptionDataId = img.getResumptionDataId();
+//                List<AppResumptionDataRemarkimg> paths = imgMap.get(resumptionDataId);
+//                if (paths == null) {
+//                    paths = new ArrayList<>();
+//                }
+//                paths.add(img);
+//                imgMap.put(resumptionDataId, paths);
+//            }
+        }
+
+        List<ResumptionNFCVo> orgNFCs = resumptionMapper.selectNFCOfOrg(resumption.getId(), resumption.getOrgId());
+        if (!isExist) {
+            //未保存过时,根据NFC-点位-区域的关系,将绑定到点位的履职内容拆解到各个区域。
+            List<ResumptionPlanVo> supplementItems = new ArrayList<>();
+
+            for (ResumptionPlanVo resumptionPlanVo : resumptionPlanVos) {
+                if (ObjectUtil.isNotNull(resumptionPlanVo.getCheckId()) && ObjectUtil.isNull(resumptionPlanVo.getAreaId())) {
+                    Map<Long, List<ResumptionNFCVo>> areaGroup = orgNFCs.stream()
+                            .filter(n -> ObjectUtil.equal(n.getCheckId(), resumptionPlanVo.getCheckId()))
+                            .collect(Collectors.groupingBy(n -> n.getAreaId()));
+                    if (CollectionUtils.isEmpty(areaGroup)) {
+                        ResumptionPlanVo newVo = new ResumptionPlanVo();
+                        BeanUtils.copyProperties(resumptionPlanVo, newVo);
+                        newVo.setAreaId(-1L);
+
+                        supplementItems.add(newVo);
+                    } else {
+                        areaGroup.forEach((area, nfcs) -> {
+                            ResumptionPlanVo newVo = new ResumptionPlanVo();
+                            BeanUtils.copyProperties(resumptionPlanVo, newVo);
+                            newVo.setAreaId(area);
+                            newVo.setAreaName(nfcs.get(0).getAreaName());
+                            supplementItems.add(newVo);
+                        });
+                    }
+                } else {
+                    //如果是绑定到区域的,直接使用
+                    supplementItems.add(resumptionPlanVo);
                 }
-                paths.add(img);
-                imgMap.put(resumptionDataId, paths);
             }
+
+            resumptionPlanVos = supplementItems;
         }
+
         Integer yesPointNum = 0;
         Integer noPointNum = 0;
-        Map<Long, ResumptionItemVo> itemMap = new HashMap<>();
+        Map<String, ResumptionItemVo> itemMap = new HashMap<>();
         Map<Long, Map<String, Integer>> itComMap = new HashMap<>();
+        Map<Long, AreaResumptionVo> map = new HashMap<>();
         for (ResumptionPlanVo vo : resumptionPlanVos) {
             if (vo.getDataStatus() == 1) {
                 noPointNum++;
@@ -274,7 +315,17 @@ public class ResumptionServiceImpl implements ResumptionService {
                     vo.getImgs().addAll(imgs);
                 }
             }
-            ResumptionItemVo resumptionItemVo = itemMap.get(vo.getItemId());
+
+            AreaResumptionVo areaVo = map.get(vo.getAreaId());
+            if (ObjectUtil.isNull(areaVo)) {
+                areaVo = new AreaResumptionVo();
+                areaVo.setAreaId(vo.getAreaId());
+                areaVo.setAreaName(ObjectUtil.isNull(vo.getAreaName())?"其它":vo.getAreaName());
+                map.put(areaVo.getAreaId(), areaVo);
+            }
+
+
+            ResumptionItemVo resumptionItemVo = itemMap.get(vo.getItemId() + "_" + vo.getAreaId());
             if (resumptionItemVo == null) {
                 resumptionItemVo = new ResumptionItemVo();
             }
@@ -286,6 +337,7 @@ public class ResumptionServiceImpl implements ResumptionService {
             ResumptionPointVo pointVo = new ResumptionPointVo();
             pointVo.setPointName(vo.getPointName());
             pointVo.setImgs(vo.getImgs());
+            pointVo.setCheckId(vo.getCheckId());
             pointVo.setPointId(vo.getPointId());
             pointVo.setResRemark(vo.getResRemark());
             if (vo.getResValue() == null) {
@@ -313,23 +365,24 @@ public class ResumptionServiceImpl implements ResumptionService {
                 }
             }
 
-            itemMap.put(vo.getItemId(), resumptionItemVo);
-        }
 
-        Map<Long, AreaResumptionVo> map = new HashMap<>();
-        List<ResumptionItemVo> items = new ArrayList<>();
-        for (Map.Entry<Long, ResumptionItemVo> entry : itemMap.entrySet()) {
-            ResumptionItemVo itemVo = entry.getValue();
-            AreaResumptionVo areaData = map.get(itemVo.getAreaId());
-            if (areaData == null) {
-                areaData = new AreaResumptionVo();
-                areaData.setAreaId(itemVo.getAreaId());
-                areaData.setAreaName(itemVo.getAreaName());
-                map.put(itemVo.getAreaId(), areaData);
-            }
-            items.add(itemVo);
+            itemMap.put(vo.getItemId() + "_" + vo.getAreaId(), resumptionItemVo);
         }
 
+
+//        List<ResumptionItemVo> items = new ArrayList<>();
+//        for (Map.Entry<Long, ResumptionItemVo> entry : itemMap.entrySet()) {
+//            ResumptionItemVo itemVo = entry.getValue();
+//            AreaResumptionVo areaData = map.get(itemVo.getAreaId());
+//            if (areaData == null) {
+//                areaData = new AreaResumptionVo();
+//                areaData.setAreaId(itemVo.getAreaId());
+//                areaData.setAreaName(itemVo.getAreaName());
+//                map.put(itemVo.getAreaId(), areaData);
+//            }
+//            items.add(itemVo);
+//        }
+
         Integer yesNFC = 0;
         Integer noNFC = 0;
 
@@ -340,7 +393,9 @@ public class ResumptionServiceImpl implements ResumptionService {
             AreaResumptionVo vo = entry.getValue();
             Long areaId = entry.getKey();
             //获取每个区域下的nfc
-            List<ResumptionNFCVo> resumptionNFCVos = resumptionMapper.selectResumptionNFC(resumption.getId(), areaId, resumption.getOrgId());
+            List<ResumptionNFCVo> resumptionNFCVos = orgNFCs.stream().filter(n -> ObjectUtil.equal(n.getAreaId(), areaId)).collect(Collectors.toList());
+            //resumptionMapper.selectResumptionNFC(resumption.getId(), areaId, resumption.getOrgId());
+
             for (ResumptionNFCVo resumptionNFCVo : resumptionNFCVos) {
                 Integer status = resumptionNFCVo.getStatus();
                 Map<String, Integer> com = itComMap.get(resumptionNFCVo.getAreaId());
@@ -372,7 +427,7 @@ public class ResumptionServiceImpl implements ResumptionService {
         taskVo.setNoPointNums(noPointNum);
         taskVo.setYesPointNums(yesPointNum);
         taskVo.setAreas(areas);
-        taskVo.setChecks(items);
+        taskVo.setChecks(ListUtil.toList(itemMap.values()));
         taskVo.setNfcs(nfcs);
         return taskVo;
     }

+ 8 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/gx/vo/ResumptionNFCVo.java

@@ -1,6 +1,7 @@
 package com.xunmei.core.resumption.gx.vo;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 
@@ -19,6 +20,13 @@ public class ResumptionNFCVo {
      */
     @JsonSerialize(using = ToStringSerializer.class)
     private Long areaId;
+
+    @JsonIgnore
+    private String areaName;
+    /**
+     * 点位id
+     */
+    private Long checkId;
     /**
      * nfcid
      */

+ 10 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/gx/vo/ResumptionPlanVo.java

@@ -65,6 +65,16 @@ public class ResumptionPlanVo {
     private String areaName;
 
     /**
+     * 点位id
+     */
+    private Long checkId;
+//
+//    /**
+//     * 点位名称
+//     */
+//    private String checkName;
+
+    /**
      * 正常异常
      */
     private Integer resValue;

+ 4 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/gx/vo/ResumptionPointVo.java

@@ -21,6 +21,10 @@ public class ResumptionPointVo {
     private Long pointId;
 
     /**
+     * 检查内容对应的点位
+     */
+    private Long checkId;
+    /**
      * 检查内容
      */
     private String pointName;

+ 2 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/mapper/ResumptionMapper.java

@@ -10,6 +10,7 @@ import com.xunmei.core.resumption.gx.vo.ResumptionPlanVo;
 import com.xunmei.core.resumption.vo.ResumptionAppVo;
 import com.xunmei.core.resumption.vo.ResumptionTaskNewDto;
 import com.xunmei.core.resumption.vo.WorkChangeResumptionVo;
+import com.xunmei.core.resumption.vo.resumptionRecord.NFCRecordVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -68,6 +69,7 @@ public interface ResumptionMapper extends BaseMapper<Resumption> {
      */
     List<ResumptionNFCVo> selectResumptionNFC(@Param("resumptionId")Long resumptionId, @Param("areaId")Long areaId, @Param("orgId")Long orgId);
 
+    List<ResumptionNFCVo> selectNFCOfOrg(@Param("resumptionId")Long resumptionId,@Param("orgId")Long orgId);
 
     void updateNameByPlanId(@Param("planName") String planName, @Param("planId") Long planId);
 

+ 9 - 6
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/AppPlanServiceImpl.java

@@ -303,14 +303,17 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
 
             plan.setBuildTaskNow(app.getBuildTaskNow());
             plan.setDistribute("0");
+            plan.setPlanStatus(0);
             //设置计划所属机构类型
             plan.setPlanOfOrgType(Long.valueOf(orgService.selectSysOrgById(app.getPlanCreateOrgId(), SecurityConstants.INNER).getType()));
-            //如果计划所属机构类型为行社并且勾选立即生效
-            if (plan.getPlanOfOrgType() == 3 && plan.getBuildTaskNow() == 1) {
-                plan.setPlanStatus(1);
-            } else {
-                plan.setPlanStatus(0);
-            }
+            //如果计划所属机构类型为行社
+//            if (plan.getPlanOfOrgType() == 3 ) {
+//                plan.setPlanStatus(1);
+//                plan.setDistribute("1");
+//            } else {
+//                plan.setPlanStatus(0);
+//            }
+
             baseMapper.insert(plan);
             Long id = plan.getId();
 

+ 1 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/AppRuleItemServiceImpl.java

@@ -261,6 +261,7 @@ public class AppRuleItemServiceImpl extends ServiceImpl<AppRuleItemMapper, AppRu
         return TableDataInfo.success(page);
     }
 
+
 //    @Override
 //    public SysDictListDto dict() {
 //        final SysDictListDto dto = new SysDictListDto();

+ 9 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/appPlan/RuleItemVo.java

@@ -49,6 +49,15 @@ public class RuleItemVo {
      */
     private Long areaId;
     /**
+     * 点位名称
+     */
+    private String checkName;
+
+    /**
+     * 点位Id
+     */
+    private Long checkId;
+    /**
      * 检查点所属机构id
      */
     private Long ofOrgId;

+ 9 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/appRuleItem/AppRulePointSelectVo.java

@@ -8,6 +8,7 @@ import lombok.Data;
 import javax.validation.constraints.NotNull;
 
 /**
+ * 计划选择履职内容时显示的内容
  * @author jingyuanchao
  * @date 2022/6/1 9:40
  */
@@ -42,4 +43,12 @@ public class AppRulePointSelectVo {
     private  Long areaId;
 
     private  String areaName;
+
+
+    @ApiModelProperty(value = "NFC点位id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long checkId;
+
+    @ApiModelProperty(value = "NFC点位名称")
+    private String checkName;
 }

+ 3 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/resumptionRecord/AppResumptionDataInfoVo.java

@@ -27,6 +27,9 @@ public class AppResumptionDataInfoVo {
     @ApiModelProperty(value = "检查区域,区域表id")
     private String areaName;
 
+    @ApiModelProperty(value = "履职点位")
+    private String checkName;
+
     @ApiModelProperty(value = "执行结果")
     private String executeResult;
 //

+ 3 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/resumptionRecord/NFCRecordVo.java

@@ -18,6 +18,9 @@ public class NFCRecordVo {
     @ApiModelProperty("采集点名称")
     private String collectionAreaName;
 
+    @ApiModelProperty("nfc标签名称")
+    private String nfcName;
+
     @ApiModelProperty("执行人")
     private String executor;
 

+ 1 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/controller/CoreSafecheckPlanController.java

@@ -123,7 +123,7 @@ public class CoreSafecheckPlanController extends BaseController {
         //判断是否是编辑并且计划所属任务不存在已完成或者逾期,需要删除所有任务重新生成
         boolean isEditAll = coreSafecheckPlan.getHasEdit() == null && coreSafecheckPlan.getId() != null;
         //如果是新增计划并且勾选立即执行并且是行社或者无周期,立即生成计划
-        if (coreSafecheckPlan.getId() == null && coreSafecheckPlan.isBuildTaskNow() && (coreSafecheckPlan.getPlanOfOrgType() == 3 || coreSafecheckPlan.getPlanCycle() == 6)) {
+        if (isEditAll) {
             CoreSafecheckPlan plan = coreSafecheckPlanService.getById(returnId);
             //获取父计划下面所有父id相等并且未删除并且已启用的计划
             List<CoreSafecheckPlan> plans = coreSafecheckPlanService.list(new LambdaQueryWrapper<CoreSafecheckPlan>().eq(CoreSafecheckPlan::getParentId, plan.getId()).eq(CoreSafecheckPlan::getIsDeleted, 0).eq(CoreSafecheckPlan::getDistribute, 1));

+ 8 - 6
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/impl/CoreSafecheckPlanServiceImpl.java

@@ -298,15 +298,17 @@ public class CoreSafecheckPlanServiceImpl extends ServiceImpl<CoreSafecheckPlanM
             coreSafecheckPlan.setCreateTime(DateUtils.getNowDate());
             coreSafecheckPlan.setModifiedBy(SecurityUtils.getUserId());
             coreSafecheckPlan.setDistribute("0");
+            coreSafecheckPlan.setPlanStatus(0L);
             //计划所属机构类型
             coreSafecheckPlan.setPlanOfOrgType(orgService.selectSysOrgById(coreSafecheckPlan.getPlanOfOrgId(), SecurityConstants.INNER).getType());
             //如果是行社并且勾选了立即下发需要修改下发状态为已下发,因为会立即触发下发动作
-            if (coreSafecheckPlan.getPlanOfOrgType() == 3&&coreSafecheckPlan.isBuildTaskNow()) {
-                coreSafecheckPlan.setPlanStatus(1L);
-                coreSafecheckPlan.setDistribute("1");
-            } else {
-                coreSafecheckPlan.setPlanStatus(0L);
-            }
+//            if (coreSafecheckPlan.getPlanOfOrgType() == 3) {
+//                coreSafecheckPlan.setPlanStatus(1L);
+//                coreSafecheckPlan.setDistribute("1");
+//            } else {
+//                coreSafecheckPlan.setPlanStatus(0L);
+//            }
+
             coreSafecheckPlanMapper.insert(coreSafecheckPlan);
             returnId = coreSafecheckPlan.getId();
         } else {

+ 97 - 96
soc-modules/soc-modules-core/src/main/resources/mapper/resumption/AppPlanMapper.xml

@@ -45,7 +45,7 @@
         o.short_name as plan_of_org_name,
         g.short_name as plan_create_org_name,
         g.type as createOrgType,
-               o.type as plan_of_org_type
+        o.type as plan_of_org_type
         FROM
         core_resumption_plan a
         left join sys_user u2 on u2.id=a.modified_by
@@ -113,77 +113,77 @@
         </where>
         order by id desc
     </select>
-<!--    <select id="selectChildren" parameterType="com.xunmei.core.resumption.dto.plan.CoreResumptionPlanPageDto"-->
-<!--            resultMap="appPlans">-->
-<!--        SELECT-->
-<!--        a.*,-->
-<!--        u2.name as update_name,-->
-<!--        d.roleNames,-->
-<!--        b.orgId,-->
-<!--        b.orgNames,-->
-<!--        o.short_name as plan_of_org_name,-->
-<!--        g.short_name as plan_create_org_name-->
-<!--        FROM-->
-<!--        core_resumption_plan a-->
-<!--        left join sys_user u2 on u2.id=a.modified_by-->
-<!--        LEFT JOIN (-->
-<!--        SELECT-->
-<!--        m.plan_id,-->
-<!--        GROUP_CONCAT( n.`short_name` ) orgNames,-->
-<!--        GROUP_CONCAT( n.id ) orgId-->
-<!--        FROM-->
-<!--        core_resumption_plan_to_exec_org m-->
-<!--        LEFT JOIN sys_org n ON m.org_id = n.id-->
+    <!--    <select id="selectChildren" parameterType="com.xunmei.core.resumption.dto.plan.CoreResumptionPlanPageDto"-->
+    <!--            resultMap="appPlans">-->
+    <!--        SELECT-->
+    <!--        a.*,-->
+    <!--        u2.name as update_name,-->
+    <!--        d.roleNames,-->
+    <!--        b.orgId,-->
+    <!--        b.orgNames,-->
+    <!--        o.short_name as plan_of_org_name,-->
+    <!--        g.short_name as plan_create_org_name-->
+    <!--        FROM-->
+    <!--        core_resumption_plan a-->
+    <!--        left join sys_user u2 on u2.id=a.modified_by-->
+    <!--        LEFT JOIN (-->
+    <!--        SELECT-->
+    <!--        m.plan_id,-->
+    <!--        GROUP_CONCAT( n.`short_name` ) orgNames,-->
+    <!--        GROUP_CONCAT( n.id ) orgId-->
+    <!--        FROM-->
+    <!--        core_resumption_plan_to_exec_org m-->
+    <!--        LEFT JOIN sys_org n ON m.org_id = n.id-->
 
-<!--        GROUP BY-->
-<!--        m.plan_id-->
-<!--        ) b ON a.id = b.plan_id-->
-<!--        LEFT JOIN (-->
-<!--        SELECT-->
-<!--        r.plan_id,-->
-<!--        group_concat( t.`role_name` ) roleNames-->
-<!--        FROM-->
-<!--        core_resumption_plan_to_role r-->
-<!--        LEFT JOIN sys_role t ON r.role_id = t.id-->
-<!--        GROUP BY-->
-<!--        r.plan_id-->
-<!--        ) d ON a.id = d.plan_id-->
-<!--        LEFT JOIN sys_org o ON a.plan_of_org_id = o.id-->
-<!--        LEFT JOIN sys_org g ON a.plan_create_org_id = g.id-->
-<!--        <where>-->
-<!--            a.deleted=0-->
-<!--            <if test="info.planName != '' and info.planName != null">-->
-<!--                and a.plan_name LIKE CONCAT('%', #{info.planName}, '%' )-->
-<!--            </if>-->
-<!--            <if test="info.planStatus != null">-->
-<!--                and a.plan_status = #{info.planStatus}-->
-<!--            </if>-->
-<!--            <if test="info.planCycle != null">-->
-<!--                and a.plan_cycle = #{info.planCycle}-->
-<!--            </if>-->
-<!--            <if test="info.planExec != null">-->
-<!--                and a.plan_exec = #{info.planExec}-->
-<!--            </if>-->
-<!--            <if test="info.orgType != null">-->
-<!--                and a.exec_org_type = #{info.orgType}-->
-<!--            </if>-->
-<!--            &lt;!&ndash;            <if test="info.checkSub==true">&ndash;&gt;-->
-<!--            &lt;!&ndash;                and a.plan_of_org_id in (select id from sys_org where path like concat( (select path from sys_org where&ndash;&gt;-->
-<!--            &lt;!&ndash;                id =#{info.orgId}),'%'))&ndash;&gt;-->
-<!--            &lt;!&ndash;            </if>&ndash;&gt;-->
-<!--            <if test="info.roleList != null and info.roleList.size > 0">-->
-<!--                and a.id in (select plan_id from core_resumption_plan_to_role where role_id in-->
-<!--                <foreach collection="info.roleList" item="roleId" index="index" open="(" separator="," close=")">-->
-<!--                    #{roleId}-->
-<!--                </foreach>-->
-<!--                )-->
-<!--            </if>-->
-<!--            and a.parent_id in-->
-<!--            <foreach collection="info.parentId" item="id" open="(" close=")" separator=",">-->
-<!--                #{id}-->
-<!--            </foreach>-->
-<!--        </where>-->
-<!--    </select>-->
+    <!--        GROUP BY-->
+    <!--        m.plan_id-->
+    <!--        ) b ON a.id = b.plan_id-->
+    <!--        LEFT JOIN (-->
+    <!--        SELECT-->
+    <!--        r.plan_id,-->
+    <!--        group_concat( t.`role_name` ) roleNames-->
+    <!--        FROM-->
+    <!--        core_resumption_plan_to_role r-->
+    <!--        LEFT JOIN sys_role t ON r.role_id = t.id-->
+    <!--        GROUP BY-->
+    <!--        r.plan_id-->
+    <!--        ) d ON a.id = d.plan_id-->
+    <!--        LEFT JOIN sys_org o ON a.plan_of_org_id = o.id-->
+    <!--        LEFT JOIN sys_org g ON a.plan_create_org_id = g.id-->
+    <!--        <where>-->
+    <!--            a.deleted=0-->
+    <!--            <if test="info.planName != '' and info.planName != null">-->
+    <!--                and a.plan_name LIKE CONCAT('%', #{info.planName}, '%' )-->
+    <!--            </if>-->
+    <!--            <if test="info.planStatus != null">-->
+    <!--                and a.plan_status = #{info.planStatus}-->
+    <!--            </if>-->
+    <!--            <if test="info.planCycle != null">-->
+    <!--                and a.plan_cycle = #{info.planCycle}-->
+    <!--            </if>-->
+    <!--            <if test="info.planExec != null">-->
+    <!--                and a.plan_exec = #{info.planExec}-->
+    <!--            </if>-->
+    <!--            <if test="info.orgType != null">-->
+    <!--                and a.exec_org_type = #{info.orgType}-->
+    <!--            </if>-->
+    <!--            &lt;!&ndash;            <if test="info.checkSub==true">&ndash;&gt;-->
+    <!--            &lt;!&ndash;                and a.plan_of_org_id in (select id from sys_org where path like concat( (select path from sys_org where&ndash;&gt;-->
+    <!--            &lt;!&ndash;                id =#{info.orgId}),'%'))&ndash;&gt;-->
+    <!--            &lt;!&ndash;            </if>&ndash;&gt;-->
+    <!--            <if test="info.roleList != null and info.roleList.size > 0">-->
+    <!--                and a.id in (select plan_id from core_resumption_plan_to_role where role_id in-->
+    <!--                <foreach collection="info.roleList" item="roleId" index="index" open="(" separator="," close=")">-->
+    <!--                    #{roleId}-->
+    <!--                </foreach>-->
+    <!--                )-->
+    <!--            </if>-->
+    <!--            and a.parent_id in-->
+    <!--            <foreach collection="info.parentId" item="id" open="(" close=")" separator=",">-->
+    <!--                #{id}-->
+    <!--            </foreach>-->
+    <!--        </where>-->
+    <!--    </select>-->
     <select id="selectItemPage" parameterType="com.xunmei.core.resumption.vo.appPlan.RuleItemVo"
             resultType="com.xunmei.core.resumption.vo.appPlan.RuleItemVo">
         select
@@ -225,17 +225,21 @@
                b.DESC          AS item_desc,--                b.item_num,
 --                a.safe_type,
                c.`name`           area_name,
+               ch.check_name         as check_name,
                a.NAME          AS point_name,--                a.point_num,
                h.point_scan,
                h.required,
                d.NAME          AS ruleName,
                a.business_type AS businessType
-        FROM (SELECT point_id, point_scan, required,of_org_id FROM core_resumption_plan_to_point WHERE plan_id = #{planId}) h
+        FROM (SELECT point_id, point_scan, required, of_org_id
+              FROM core_resumption_plan_to_point
+              WHERE plan_id = #{planId}) h
                  LEFT JOIN core_resumption_rule_point a ON h.point_id = a.id
                  LEFT JOIN core_resumption_rule_item b ON a.item_id = b.id
                  LEFT JOIN sys_area c ON a.area_id = c.id
+                 LEFT JOIN sys_area_check ch on ch.id = a.check_id
                  LEFT JOIN core_resumption_rule d on b.rule_id = d.id
-order by h.of_org_id desc
+        order by h.of_org_id desc
 --         order by b.item_num, a.point_num
     </select>
 
@@ -394,28 +398,25 @@ order by h.of_org_id desc
         </where>
     </select>
     <select id="selectResumptionPlan" resultType="com.xunmei.core.resumption.gx.vo.ResumptionPlanVo">
-        select
-            q.item_id,
-            q.item_name,
-            q.point_id,
-            q.point_name,
-            q.area_id,
-            w.`name` as area_name,
-            q.plan_id
-        from
-            (
-                select
-                    c.id as item_id,
-                    c.`name` as item_name,
-                    b.id as point_id,
-                    b.name as point_name,
-                    b.area_id,
-                    a.plan_id
-                from core_resumption_plan_to_point a
-                         LEFT JOIN core_resumption_rule_point b on a.point_id = b.id
-                         LEFT JOIN core_resumption_rule_item c on b.item_id = c.id
-                where a.plan_id = #{planId}
-            ) q
-                LEFT JOIN sys_area w on q.area_id = w.id
+        select q.item_id,
+               q.item_name,
+               q.point_id,
+               q.point_name,
+               q.area_id,
+               w.`name` as area_name,
+               q.check_id,
+               q.plan_id
+        from (select c.id     as item_id,
+                     c.`name` as item_name,
+                     b.id     as point_id,
+                     b.name   as point_name,
+                     b.area_id,
+                     b.check_id,
+                     a.plan_id
+              from core_resumption_plan_to_point a
+                       LEFT JOIN core_resumption_rule_point b on a.point_id = b.id
+                       LEFT JOIN core_resumption_rule_item c on b.item_id = c.id
+              where a.plan_id = #{planId}) q
+                 LEFT JOIN sys_area w on q.area_id = w.id
     </select>
 </mapper>

+ 6 - 2
soc-modules/soc-modules-core/src/main/resources/mapper/resumption/AppRulePointMapper.xml

@@ -2,15 +2,17 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.xunmei.core.resumption.mapper.AppRulePointMapper">
     <select id="selectDataListByItemId" resultType="com.xunmei.core.resumption.dto.rulePoint.AppRulePointDetailDto">
-        select p.*,a.name as areaName
+        select p.*,a.name as areaName,c.check_name as checkName
         from core_resumption_rule_point p
         left join sys_area a on p.area_id = a.id
+        left join sys_area_check c on p.check_id=c.id
         where item_id = #{itemId}
           and p.deleted = 0
         <if test="pointName!=null and pointName!=''">
             and p.name like concat('%',#{pointName},'%')
         </if>
     </select>
+
 <!--    <select id="selectDataListByIdList" resultType="com.xunmei.core.resumption.dto.rulePoint.AppRulePointInfoDto"-->
 <!--            parameterType="java.util.List">-->
 <!--        select-->
@@ -247,12 +249,14 @@
         i.`name` AS itemName,
         p.`name` AS pointName,
         a.id as areaId,
-        a.`name` AS areaName
+        a.`name` AS areaName,
+        c.check_name as checkName
         FROM
         core_resumption_rule_point p
         INNER JOIN core_resumption_rule_item i ON p.item_id = i.id
         INNER JOIN core_resumption_rule r ON p.rule_id = r.id
         LEFT JOIN sys_area a ON p.area_id = a.id
+        left join sys_area_check c on p.check_id=c.id
         WHERE
         p.deleted = 0
         AND p.rule_id =#{query.ruleId}

+ 23 - 7
soc-modules/soc-modules-core/src/main/resources/mapper/resumption/ResumptionMapper.xml

@@ -128,10 +128,9 @@ update   core_resumption set name=#{planName} where plan_id =#{planId} and statu
         inner join core_resumption_plan p on r.plan_id = p.id and p.deleted=0
         where r.org_id=#{res.orgId}
         <if test="res.roleId!=null and res.roleId.size>0">
-            and r.role_id in
-            <foreach collection="res.roleId" separator="," open="(" close=")" item="roleId">
-                #{roleId}
-            </foreach>
+            and r.parent_plan_id in
+            (select distinct plan_id from core_resumption_plan_to_role pr
+            inner join core_resumption_plan p on pr.plan_id=p.id and p.parent_id =-1 and p.deleted=0)
         </if>
         <if test="res.dateTime != null ">
             and r.ymd_date = #{res.dateTime}
@@ -171,6 +170,7 @@ update   core_resumption set name=#{planName} where plan_id =#{planId} and statu
             a.data_id,
             a.area_id,
             d.`name` as area_name,
+            a.check_id,
             c.id as item_id,
             c.`name` as item_name,
             b.id as point_id,
@@ -180,7 +180,7 @@ update   core_resumption set name=#{planName} where plan_id =#{planId} and statu
             a.rectification_deadline,
             a.data_status
         from
-            (select id as data_id,area_id,item_id,res_value,res_remark,rectification_deadline,data_status
+            (select id as data_id,area_id,check_id,item_id,res_value,res_remark,rectification_deadline,data_status
              from core_resumption_data where resumption_id = #{resumptionId}) a
                 LEFT JOIN core_resumption_rule_point b on a.item_id = b.id
                 LEFT JOIN core_resumption_rule_item c on b.item_id = c.id
@@ -189,6 +189,7 @@ update   core_resumption set name=#{planName} where plan_id =#{planId} and statu
     <select id="selectResumptionNFC" resultType="com.xunmei.core.resumption.gx.vo.ResumptionNFCVo">
          SELECT
             a.area_id,
+            a.check_id,
             a.id as nfc_id,
             a.collection_area_name as nfc_name,
             a.`code` as nfc_code,
@@ -196,11 +197,26 @@ update   core_resumption set name=#{planName} where plan_id =#{planId} and statu
             b.scan_method,
             b.img
         FROM
-            ( SELECT area_id, collection_area_name, CODE, id FROM sys_nfc_bind WHERE area_id =#{areaId} AND org_id = #{orgId} and del_flag='0' ) a
+            ( SELECT area_id,check_id, collection_area_name, CODE, id FROM sys_nfc_bind WHERE (area_id =#{areaId} AND org_id = #{orgId} and del_flag='0' ) a
             LEFT JOIN ( SELECT nfc_id, point_id, img, STATUS, scan_method FROM core_resumption_data_nfc WHERE resumption_id = #{resumptionId} ) b ON a.id = b.nfc_id
 
     </select>
-
+    <select id="selectNFCOfOrg" resultType="com.xunmei.core.resumption.gx.vo.ResumptionNFCVo">
+        SELECT
+            a.area_id,
+            ar.name as area_name,
+            a.check_id,
+            a.id as nfc_id,
+            a.label_name as nfc_name,
+            a.`code` as nfc_code,
+            b.`status`,
+            b.scan_method,
+            b.img
+        FROM
+            ( SELECT area_id,check_id, collection_area_name, CODE, id,label_name FROM sys_nfc_bind WHERE org_id = #{orgId} and del_flag='0' ) a
+            LEFT JOIN ( SELECT nfc_id, point_id, img, STATUS, scan_method FROM core_resumption_data_nfc WHERE resumption_id = #{resumptionId} ) b ON a.id = b.nfc_id
+            left join sys_area ar on ar.id=a.area_id and ar.del_flag='0'
+    </select>
     <select id="selectCurUserTaskList" resultType="com.xunmei.common.core.domain.panel.vo.PanelListVo">
 
         select distinct t.id as id, name as taskName,t.plan_start_time as startTime,t.plan_end_time as endTime,t.status

+ 6 - 2
soc-modules/soc-modules-core/src/main/resources/mapper/resumption/ResumptionRecordMapper.xml

@@ -273,6 +273,7 @@
     <select id="selectNFCRecord" resultType="com.xunmei.core.resumption.vo.resumptionRecord.NFCRecordVo">
         select distinct a.name as areaName,
         b.collection_area_name as collectionAreaName,
+        b.label_name as nfcName,
         n.submit_time as executeTime,
         d.submit_name as executor,
         n.scan_method as scanMethod,
@@ -316,7 +317,8 @@
 
     <select id="selectDataInfo" resultType="com.xunmei.core.resumption.vo.resumptionRecord.AppResumptionDataInfoVo">
         SELECT p.name  AS pointName,
-               a.`name`      AS areaName,
+               case a.`name` when null then '其它' else a.`name` end      AS areaName,
+               ch.check_name as check_name,
                d.res_value   AS executeResult,
                d.submit_time AS executeTime,
                d.res_remark  AS resRemark,
@@ -324,9 +326,11 @@
                d.id          AS dataId
         FROM core_resumption_data d
                  INNER JOIN core_resumption_rule_point p ON d.item_id = p.id
-                 INNER JOIN sys_area a ON a.id = p.area_id
+                 LEFT JOIN sys_area a ON a.id = d.area_id
+                 LEFT JOIN sys_area_check ch on ch.id=d.check_id
         WHERE d.resumption_id = #{resumptionId}
           and p.item_id = #{ruleItemId}
+            order by d.item_id
     </select>
 
     <select id="selectRuleItemIdList" resultType="java.lang.Long">

+ 17 - 3
soc-modules/soc-modules-core/src/main/resources/mapper/retrieval/CoreMonitoringRetrievalTaskMapper.xml

@@ -490,8 +490,22 @@
     </update>
 
     <select id="selectCurUserTaskList" resultType="com.xunmei.common.core.domain.panel.vo.PanelListVo">
-     select distinct t.id as id, task_name as taskName,t.plan_start_time as startTime,t.plan_end_time as endTime,t.status
-        from core_monitoring_retrieval_task t where t.org_id =#{request.orgId} and  t.role_id in
+     select distinct t.id as id, task_name as taskName,t.plan_start_time as startTime,t.plan_end_time as endTime,t.status,
+        IF
+        (
+        IF
+        ( COUNT( b.id ) > 0, 1, 0 )+
+        IF
+        ( COUNT( c.id ) > 0, 1, 0 )= 2,
+        1,
+        0
+        ) AS isExist
+        from core_monitoring_retrieval_task t 	LEFT JOIN sys_device b ON t.org_id = b.org_id
+        AND b.del_flag = '0'
+        AND b.device_type = '0'
+        LEFT JOIN sys_device c ON c.org_id = t.org_id
+        AND c.del_flag = '0'
+        AND c.device_type = '2'  where t.org_id =#{request.orgId} and  t.role_id in
          <foreach collection="request.roleIdList" item="roleId" open="(" separator="," close=")">
             #{roleId}
          </foreach>
@@ -507,7 +521,7 @@
                 or (
                 #{request.startTime} >= t.plan_start_time
                 and #{request.endTime}  <![CDATA[<=]]>  t.plan_end_time
-             ))
+             ))GROUP BY t.id
     </select>
     <select id="selectTaskByTime" resultType="java.lang.Long">
         SELECT * FROM core_monitoring_retrieval_task WHERE `status`=1 AND start_time LIKE  concat(#{dateTime}, '%')

+ 1 - 1
soc-modules/soc-modules-core/src/main/resources/mapper/safetycheck/CoreSafetyTaskMapper.xml

@@ -225,7 +225,7 @@
             and t.title like concat('%', #{task.title}, '%')
         </if>
         <if test="task.planStartTime != null ">
-            and t.plan_start_time =#{task.planStartTime}
+            and DATE_FORMAT(t.plan_start_time, '%Y-%m-%d') = DATE_FORMAT(#{task.planStartTime}, '%Y-%m-%d')
         </if>
         <if test="task.status != null  and task.status != ''">
             and t.status =#{task.status}

+ 18 - 1
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysAreaCheckController.java

@@ -1,7 +1,9 @@
 package com.xunmei.system.controller;
 
 import java.util.List;
+import java.util.stream.Collectors;
 
+import com.xunmei.common.core.vo.IdNameVo;
 import com.xunmei.system.api.domain.SysArea;
 import com.xunmei.system.api.domain.SysOrg;
 import com.xunmei.system.domain.vo.SysAreaCheckVO;
@@ -45,6 +47,7 @@ public class SysAreaCheckController extends BaseController {
     private ISysAreaService sysAreaService;
     @Autowired
     private SysOrgMapper sysOrgMapper;
+
     /**
      * 查询区域采集点列表
      */
@@ -123,11 +126,25 @@ public class SysAreaCheckController extends BaseController {
     public AjaxResult getAreaCheckInfoByOrg(@PathVariable(value = "orgId", required = false) Long orgId) {
         AjaxResult ajax = AjaxResult.success();
         SysOrg sysOrg = sysOrgMapper.selectSysOrgById(orgId);
-        if (null==sysOrg.getType()){
+        if (null == sysOrg.getType()) {
             return error("该机构没有机构类型,请维护!");
         }
         List<SysAreaCheck> sysAreaChecks = sysAreaCheckService.selectByOrgId(orgId);
         ajax.put(AjaxResult.DATA_TAG, sysAreaChecks);
         return ajax;
     }
+
+    /**
+     * 按机构类型获取所有点位
+     */
+    @ApiOperation(value = "按机构类型获取所有点位")
+    @GetMapping("/orgtype/{orgType}")
+    public AjaxResult listByOrgType(@PathVariable Integer orgType) {
+        SysAreaCheckDTO condition = new SysAreaCheckDTO();
+        condition.setOrgType(orgType.toString());
+        condition.setPageNum(1);
+        condition.setPageSize(9999);
+        TableDataInfo<SysAreaCheck> table = sysAreaCheckService.selectPage(condition);
+        return success(table.getRows().stream().map(r -> new IdNameVo(r.getId(), r.getCheckName(), null)).collect(Collectors.toList()));
+    }
 }

+ 1 - 1
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysAreaController.java

@@ -106,7 +106,7 @@ public class SysAreaController extends BaseController {
     }
 
     /**
-     * 删除【请填写功能名称】
+     *按机构类型获取所有区域
      */
     @ApiOperation(value = "按机构类型获取所有区域")
 //    @RequiresPermissions("system:area:list