| | |
| | | doImportData(assetImportLogDetailDto); |
| | | |
| | | updateImportLogDetailState(assetImportLogDetailDto.getDetailId()); |
| | | try { |
| | | Thread.sleep(200); |
| | | } catch (InterruptedException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | if (e.getMessage().contains("### Error updating database")){ |
| | | updateImportLogDetailState(assetImportLogDetailDto.getDetailId(), "未知错误,请联系管理员"); |
| | | updateImportLogDetailState(assetImportLogDetailDto.getDetailId(), "未知错误,请联系管理员" + e.getMessage()); |
| | | } |
| | | else { |
| | | updateImportLogDetailState(assetImportLogDetailDto.getDetailId(), e); |
| | |
| | | |
| | | int a = 6; |
| | | JSONArray objects = JSONObject.parseArray(assetImportLogDetailDto.getContent()); |
| | | |
| | | if (Vtil.defaultValue(objects.get(16)).equals("")){ |
| | | throw new IllegalArgumentException("房屋面积不能为空"); |
| | | } |
| | | |
| | | if (Vtil.defaultValue(objects.get(54)).length() > 1){ |
| | | throw new IllegalArgumentException("性别内容有误!"); |
| | | } |
| | | |
| | | |
| | | ImportOwnerRoomDto importOwnerRoomDto = new ImportOwnerRoomDto();//房屋 |
| | | importOwnerRoomDto.setRoomId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_roomId)); |
| | |
| | | CommunityDto communityDto = new CommunityDto(); |
| | | communityDto.setCommunityCode(Vtil.defaultValue(objects.get(3))); |
| | | communityDto.setName(Vtil.defaultValue(objects.get(4))); |
| | | if (communityDto.getCommunityCode().equals("") && communityDto.getName().equals("")) { |
| | | throw new IllegalArgumentException("导入失败:小区编码和小区名称都为空"); |
| | | } |
| | | List<CommunityDto> communityDtos = communityInnerServiceSMOImpl.queryCommunitys(communityDto); |
| | | if (communityDtos.isEmpty()) { |
| | | throw new IllegalArgumentException("导入失败:小区中不存在小区编码为‘" + Vtil.defaultValue(objects.get(1)) + "’的小区"); |
| | | throw new IllegalArgumentException("导入失败:小区中不存在小区‘" + Vtil.defaultValue(objects.get(3))+Vtil.defaultValue(objects.get(4)) + "’"); |
| | | } else if (communityDtos.size() > 1) { |
| | | String communityNames = communityDtos.stream() |
| | | .map(CommunityDto::getName) // 提取每个小区的名称 |
| | |
| | | roomDto.setFloorNum(importOwnerRoomDto.getFloorNum()); |
| | | roomDto.setUnitNum(importOwnerRoomDto.getUnitNum()); |
| | | roomDto.setRoomNum(importOwnerRoomDto.getRoomNum()); |
| | | if (roomDto.getRoomNum() ==null || roomDto.getRoomNum().equals("")){ |
| | | roomDto.setPropertyType("商铺"); |
| | | } |
| | | roomDto.setDoorRoomNum(importOwnerRoomDto.getDoorRoomNum()); |
| | | roomDto.setPropertyAddress(importOwnerRoomDto.getPropertyAddress()); |
| | | // if (roomDto.getRoomNum() ==null || roomDto.getRoomNum().equals("")){ |
| | | // roomDto.setPropertyType("商铺"); |
| | | // } |
| | | |
| | | List<Object> objects1 = sqlSessionTemplate.selectList("roomServiceDaoImpl.getRoomInfo", BeanConvertUtil.beanCovertMap(roomDto)); |
| | | if (!objects1.isEmpty()) { |
| | | throw new IllegalArgumentException("重复的房屋"); |
| | | throw new IllegalArgumentException("重复的房屋:"); |
| | | } |
| | | List<FeeConfigDto> feeDtos = null; |
| | | if (!importOwnerRoomDto.getCommunityId().isEmpty()){ |
| | |
| | | try { |
| | | applyRoomDiscountServiceDaoImpl.saveApplyRoomDiscountInfo(BeanConvertUtil.beanCovertMap(applyRoomDiscountPo)); |
| | | }catch (Exception e){ |
| | | throw new IllegalArgumentException("导入失败:打折信息导入存在错误"); |
| | | throw new IllegalArgumentException("导入失败:打折信息导入存在错误" + e.getMessage()); |
| | | } |
| | | } |
| | | //-----业主信息 |
| | |
| | | |
| | | |
| | | |
| | | if (Vtil.defaultValue(objects.get(61),null) != null) { |
| | | if (Vtil.defaultValue(objects.get(61),null) != null || Vtil.defaultValue(objects.get(141)).isEmpty() || Vtil.defaultValue(objects.get(147+a)).isEmpty() || Vtil.defaultValue(objects.get(149+a)).isEmpty()) { |
| | | OweFeeCallablePo oweFeeCallablePo = new OweFeeCallablePo(); |
| | | oweFeeCallablePo.setOfcId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_attrId)); |
| | | oweFeeCallablePo.setAmountdOwed("0"); |
| | |
| | | oweFeeCallablePo.setStaffId("302025062612580518"); |
| | | oweFeeCallablePo.setStaffName("刘志勇"); |
| | | oweFeeCallablePo.setState(OweFeeCallableDto.STATE_COMPLETE); |
| | | oweFeeCallablePo.setReceivableAmount(Vtil.defaultValue(objects.get(155+a))); |
| | | oweFeeCallablePo.setReceivedAmount(Vtil.defaultValue(objects.get(156+a))); |
| | | // oweFeeCallablePo.setDifferenceReason(Vtil.defaultValue(objects.get(157+a))); |
| | | // oweFeeCallablePo.setReceiptTime(Vtil.defaultValue(objects.get(158+a))); |
| | | oweFeeCallablePo.setPayee(Vtil.defaultValue(objects.get(159+a))); |
| | | if (!Vtil.defaultValue(objects.get(160+a), "").equals("")) { |
| | | oweFeeCallablePo.setRemark(oweFeeCallablePo.getRemark() + "。备注信息:" + Vtil.defaultValue(objects.get(160+a))); |
| | | } |
| | | // oweFeeCallablePo.setStartTime(Vtil.defaultValueToDate(objects.get(61)));//TODO 时间段需要拆分 |
| | | // oweFeeCallablePo.setEndTime(Vtil.defaultValueToDate(objects.get(61))); |
| | | oweFeeCallablePo.setCreateTime(Vtil.defaultValueToDate(objects.get(53+a))); |
| | |
| | | |
| | | for (int i = 0; i < 5 ; i++) { |
| | | int index = i*4 + 65; |
| | | if(objects.get(index) == null){ |
| | | if(objects.get(index) == null || objects.get(index).equals("")) { |
| | | break; |
| | | } |
| | | HouseMailRecord houseMailRecord = new HouseMailRecord(); |
| | |
| | | houseMailRecord.setOwnerId(importOwnerRoomDto.getOwnerId()); |
| | | houseMailRecord.setHouseId(importOwnerRoomDto.getRoomId()); |
| | | houseMailRecord.setCallableId(oweFeeCallablePo.getOfcId()); |
| | | houseMailRecord.setCreateTime(Vtil.defaultValueToDate(objects.get(index))); |
| | | houseMailRecord.setSendDate(Vtil.defaultValueToDate(objects.get(index))); |
| | | houseMailRecord.setMailNo(Vtil.defaultValue(objects.get(index+1))); |
| | | houseMailRecord.setServiceFee(Vtil.defaultValue(objects.get(index+2))); |
| | | houseMailRecord.setMailResult(Vtil.defaultValue(objects.get(index+3))); |
| | |
| | | //----- |
| | | |
| | | //法院执行程序 |
| | | if (!Vtil.defaultValue(objects.get(147+a)).isEmpty()) { |
| | | if (!Vtil.defaultValue(objects.get(147+a)).isEmpty() || !Vtil.defaultValue(objects.get(149+a)).isEmpty()) { |
| | | CourtExecutionProcedure courtExecutionProcedure = new CourtExecutionProcedure(); |
| | | courtExecutionProcedure.setCallableId(oweFeeCallablePo.getOfcId()); |
| | | courtExecutionProcedure.setOwnerId(importOwnerRoomDto.getOwnerId()); |