邱宇豪
2023-11-30 7806f1910522ac9ab1eaebd26ab973afec54850c
hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionInspection/service/impl/RegionInspectionRecordServiceImpl.java
@@ -50,11 +50,11 @@
         regionInspectionEntity.setInspectionTime(new Date());
         regionInspectionEntity.setUpdateTime(new Date());
      }
      regionInspectionRecordMapper.deleteIMG(regionInspectionEntity.getId());
      synchronized (this){
         //修改打卡记录
         regionInspectionEntity.setCreateUser(userId);
         regionInspectionRecordMapper.insert(regionInspectionEntity);
         //添加记录相对应的图片
         if (!regionInspectionEntity.getImgList().isEmpty()){
            regionInspectionEntity.getImgList().forEach(obj->{
@@ -158,23 +158,35 @@
   @Override
   public BasicResult selectAppInfo(String regionInspectionId, String userId) {
      RegionInspectionEntity obj = regionInspectionRecordMapper.selectInfo(regionInspectionId, userId);
      SysUserInfo sysUserInfo = UserInfoUtils.getInstance().getUserInfo();
      userId = sysUserInfo.getUserId();
      String platUserId = regionInspectionRecordMapper.selectPlatUserId(userId);
      RegionInspectionEntity obj = regionInspectionRecordMapper.selectInfo(regionInspectionId, platUserId);
      List<RegionInspectionHazardInformEntity> regionList = new ArrayList<>();
      if (obj.getRegionIds()!=null){
      if (obj!=null && obj.getRegionIds()!=null){
         String[] regionIds = obj.getRegionIds().intern().split(",");
         String[] regions = obj.getRegions().intern().split(",");
         //区域对象数组
         for (int i = 0; i < regionIds.length; i++) {
            RegionInspectionRecordEntity recordEntity = regionInspectionRecordMapper.regionInfo(
                  regionInspectionId,
                  userId,
                  platUserId,
                  regionIds[i]);
            List<RegionInspectionRecordImgEntity> imgEntityList=null;
            if (recordEntity!=null){
               imgEntityList = regionInspectionRecordMapper.selectImgByRecordId(recordEntity.getId());
               recordEntity.setImgList(imgEntityList);
            }
            RegionInspectionHazardInformEntity regionEntity = RegionInspectionHazardInformEntity
                  .builder()
                  .regionInspectionId(obj.getId())
                  .regionHazardInformId(regionIds[i])
                  .region(regions[i])
                  .recordEntity(recordEntity).build();
                  .recordEntity(recordEntity)
                  .imgList(imgEntityList)
                  .result(recordEntity.getResult())
                  .status(recordEntity.getStatus())
                  .build();
            regionList.add(regionEntity);
         }
      }
@@ -196,7 +208,8 @@
      SysUserInfo sysUserInfo = UserInfoUtils.getInstance().getUserInfo();
      String companyId = sysUserInfo.getCompanyId();
      String userId = sysUserInfo.getUserId();
      map.put("userId",userId);
      String platUserId = regionInspectionRecordMapper.selectPlatUserId(userId);
      map.put("userId",platUserId);
      map.put("companyId",companyId);
      int pageNum = (int) map.get("pageNum");
      int pageSize = (int) map.get("pageSize");