| | |
| | | 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->{ |
| | |
| | | public BasicResult selectAppInfo(String regionInspectionId, String userId) { |
| | | SysUserInfo sysUserInfo = UserInfoUtils.getInstance().getUserInfo(); |
| | | userId = sysUserInfo.getUserId(); |
| | | RegionInspectionEntity obj = regionInspectionRecordMapper.selectInfo(regionInspectionId, userId); |
| | | 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); |
| | | } |
| | | } |