| | |
| | | import com.java110.dto.menu.MenuDto; |
| | | import com.java110.dto.oweFeeCallable.OweFeeCallableDto; |
| | | import com.java110.dto.owner.OwnerDto; |
| | | import com.java110.dto.room.RoomDto; |
| | | import com.java110.fee.api.ApplyRoomDiscountApi; |
| | | import com.java110.fee.dao.IApplyRoomDiscountServiceDao; |
| | | import com.java110.intf.community.ICommunityInnerServiceSMO; |
| | |
| | | ImportOwnerRoomDto importOwnerRoomDto = new ImportOwnerRoomDto();//房屋 |
| | | importOwnerRoomDto.setRoomId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_roomId)); |
| | | importOwnerRoomDto.setOwnerId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_ownerId)); |
| | | importOwnerRoomDto.setUserId(objects.getString(167)); |
| | | importOwnerRoomDto.setUserId(objects.getString(169)); |
| | | importOwnerRoomDto.setLayerCount("0"); |
| | | importOwnerRoomDto.setLayer("0"); |
| | | importOwnerRoomDto.setLift("未知"); |
| | |
| | | importOwnerRoomDto.setPropertyAddress(defaultValue(objects.get(10)));//业主地址 |
| | | importOwnerRoomDto.setRoomBuyer(defaultValue(objects.get(11)));//购房人 |
| | | |
| | | RoomDto roomDto = new RoomDto(); |
| | | roomDto.setCommunityId(importOwnerRoomDto.getCommunityId()); |
| | | roomDto.setRoadName(importOwnerRoomDto.getRoadName()); |
| | | roomDto.setFloorNum(importOwnerRoomDto.getFloorNum()); |
| | | roomDto.setUnitNum(importOwnerRoomDto.getUnitNum()); |
| | | roomDto.setRoomNum(importOwnerRoomDto.getRoomNum()); |
| | | |
| | | |
| | | List<Object> objects1 = sqlSessionTemplate.selectList("roomServiceDaoImpl.getRoomInfo", BeanConvertUtil.beanCovertMap(roomDto)); |
| | | if (!objects1.isEmpty()) { |
| | | throw new IllegalArgumentException("重复的房屋"); |
| | | } |
| | | //---------家庭成员、租客 |
| | | OwnerPo ownerPoTo3 = new OwnerPo();// |
| | | if (!defaultValue(objects.get(13)).isEmpty()) { |
| | |
| | | ownerPoTo3.setOwnerTypeCd(OwnerDto.OWNER_TYPE_CD_MEMBER); |
| | | ownerPoTo3.setName(defaultValue(objects.get(12))); |
| | | ownerPoTo3.setLink(link); |
| | | ownerPoTo3.setSex(""); |
| | | ownerPoTo3.setSex("2"); |
| | | ownerPoTo3.setPersonRole(OwnerDto.PERSON_ROLE_MEMBER); |
| | | } |
| | | |
| | |
| | | ownerPoTo2.setOwnerTypeCd(OwnerDto.OWNER_TYPE_CD_MEMBER); |
| | | ownerPoTo2.setName(defaultValue(objects.get(21))); |
| | | ownerPoTo2.setLink(link); |
| | | ownerPoTo2.setSex(""); |
| | | ownerPoTo2.setSex("2"); |
| | | ownerPoTo2.setPersonRole(OwnerDto.PERSON_ROLE_MEMBER); |
| | | } |
| | | //--------- |
| | |
| | | //----- |
| | | |
| | | //-----打折信息 TODO 未添加重复校验 |
| | | if (!defaultValue(objects.get(46)).isEmpty()) { |
| | | if (!defaultValue(objects.get(38)).isEmpty()) { |
| | | ApplyRoomDiscountPo applyRoomDiscountPo = new ApplyRoomDiscountPo();//打折 |
| | | applyRoomDiscountPo.setArdId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_ardId)); |
| | | applyRoomDiscountPo.setCommunityId(importOwnerRoomDto.getCommunityId()); |
| | |
| | | |
| | | try { |
| | | SimpleDateFormat outputSdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | applyRoomDiscountPo.setStartTime(outputSdf.format(sdf.parse(defaultValue(objects.get(38))))); |
| | | applyRoomDiscountPo.setEndTime(outputSdf.format(sdf.parse(defaultValue(objects.get(39))))); |
| | | applyRoomDiscountPo.setStartTime(defaultValueToDate(objects.get(38))); |
| | | applyRoomDiscountPo.setEndTime(defaultValueToDate(objects.get(39))); |
| | | }catch (Exception e){ |
| | | throw new IllegalArgumentException("导入失败:处理折扣日期区间时出错"); |
| | | } |
| | | applyRoomDiscountPo.setDiscountArchiveDate(defaultValue(objects.get(40))); |
| | | applyRoomDiscountPo.setDiscountArchiveDate(defaultValueToDate(objects.get(40))); |
| | | applyRoomDiscountPo.setCreateRemark(defaultValue(objects.get(41))); |
| | | applyRoomDiscountPo.setCheckRemark("审批人:" + defaultValue(objects.get(42))); |
| | | applyRoomDiscountPo.setReviewRemark("审批人:" + defaultValue(objects.get(43))); |
| | | applyRoomDiscountPo.setCreateUserTel("无"); |
| | | applyRoomDiscountPo.setCreateUserName("由系统导入"); |
| | | applyRoomDiscountPo.setState("4"); |
| | | applyRoomDiscountPo.setStatusCd("0"); |
| | |
| | | try { |
| | | applyRoomDiscountServiceDaoImpl.saveApplyRoomDiscountInfo(BeanConvertUtil.beanCovertMap(applyRoomDiscountPo)); |
| | | }catch (Exception e){ |
| | | throw new IllegalArgumentException("导入失败"); |
| | | throw new IllegalArgumentException("导入失败:打折信息导入存在错误"); |
| | | } |
| | | } |
| | | //----- |
| | |
| | | importOwnerRoomDto.setTel(defaultValue(objects.get(45)));//手机号 |
| | | importOwnerRoomDto.setIdCard(defaultValue(objects.get(46)));//身份证 |
| | | importOwnerRoomDto.setAddress(defaultValue(objects.get(47)));//TODO 导入逻辑未添加该字段 联络地址 |
| | | importOwnerRoomDto.setSex(defaultValue(objects.get(48))); |
| | | importOwnerRoomDto.setOwnerName(defaultValue(objects.get(49))); |
| | | importOwnerRoomDto.setSex(defaultValue(objects.get(48)).equals("") ?"2" : defaultValue(objects.get(48))); |
| | | importOwnerRoomDto.setOwnerName(defaultValue(objects.get(11))); |
| | | importOwnerRoomDto.setHouseholdPoliceStation(defaultValue(objects.get(50))); |
| | | importOwnerRoomDto.setPropertyCertificateNo(defaultValue(objects.get(51))); |
| | | importOwnerRoomDto.setIsEvChargerInstalled(defaultValue(objects.get(52))); |
| | |
| | | break; |
| | | } |
| | | MailCallRecord mailCallRecord = new MailCallRecord(); |
| | | mailCallRecord.setMailId(importOwnerRoomDto.getOwnerId()); |
| | | mailCallRecord.setCallDate(defaultValueToDate(objects.get(index))); |
| | | mailCallRecord.setCallResult(defaultValue(objects.get(index+1))); |
| | | mailCallRecord.setCallContact(defaultValue(objects.get(index+2))); |
| | |
| | | |
| | | if (mailCallRecords.size() > 0) { |
| | | Map<String, Object> param = new HashMap<>(); |
| | | param.put("payeeReceiveList", BeanConvertUtil.beanCovertMap(mailCallRecords)); |
| | | param.put("mailCallRecordList", BeanConvertUtil.beanCovertMap(mailCallRecords)); |
| | | |
| | | sqlSessionTemplate.insert("payeeReceiveInfoServiceDaoImpl.batchSavePayeeReceiveInfo", param); |
| | | sqlSessionTemplate.insert("mailCallRecordServiceDaoImpl.batchSaveMailCallRecord", param); |
| | | } |
| | | //---- |
| | | |
| | |
| | | //诉讼 |
| | | if (!defaultValue(objects.get(124)).isEmpty()) { |
| | | LitigationInfoPo litigationInfoPo = new LitigationInfoPo(); |
| | | litigationInfoPo.setLitigationDate(objects.getDate(124)); |
| | | litigationInfoPo.setLitigationDate(defaultValue(objects.get(124))); |
| | | litigationInfoPo.setArrearsPeriod(defaultValue(objects.get(125))); |
| | | litigationInfoPo.setArrearsAmount(objects.getBigDecimal(126)); |
| | | litigationInfoPo.setLateFee(objects.getBigDecimal(127)); |
| | | litigationInfoPo.setAcceptanceFee(objects.getBigDecimal(128)); |
| | | litigationInfoPo.setOtherFee(objects.getBigDecimal(129)); |
| | | litigationInfoPo.setTotalAmount(objects.getBigDecimal(130)); |
| | | litigationInfoPo.setArrearsAmount(defaultValue(objects.get(126))); |
| | | litigationInfoPo.setLateFee(defaultValue(objects.get(127))); |
| | | litigationInfoPo.setAcceptanceFee(defaultValue(objects.get(128))); |
| | | litigationInfoPo.setOtherFee(defaultValue(objects.get(129))); |
| | | litigationInfoPo.setTotalAmount(defaultValue(objects.get(130))); |
| | | litigationInfoPo.setSubmitter(defaultValue(objects.get(131))); |
| | | |
| | | litigationInfoPo.setOwnerId(importOwnerRoomDto.getOwnerId()); |
| | | sqlSessionTemplate.insert("litigationInfoServiceDaoImpl.saveLitigationInfo", |
| | | BeanConvertUtil.beanCovertMap(litigationInfoPo)); |
| | | } |
| | |
| | | if (ownerDtos.size() == 1) { |
| | | ownerPoTo2.setUserId(ownerDtos.get(0).getUserId()); |
| | | ownerPoTo3.setUserId(ownerDtos.get(0).getUserId()); |
| | | ownerV1InnerServiceSMOImpl.saveOwner(ownerPoTo2); |
| | | ownerV1InnerServiceSMOImpl.saveOwner(ownerPoTo3); |
| | | if (ownerPoTo2.getLink() != null) { |
| | | ownerV1InnerServiceSMOImpl.saveOwner(ownerPoTo2); |
| | | } |
| | | if (ownerPoTo2.getLink() != null) { |
| | | ownerV1InnerServiceSMOImpl.saveOwner(ownerPoTo3); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private String defaultValueToDate(Object o) { |
| | | return o == null ? null : o.toString(); |
| | | // 空值直接返回null(原有逻辑) |
| | | if (o == null) { |
| | | return null; |
| | | } |
| | | |
| | | try { |
| | | // 尝试将对象转换为数字(兼容Excel日期序列号,如44747) |
| | | double excelDateNum = Double.parseDouble(o.toString()); |
| | | |
| | | // Excel 1900日期系统基准(修正闰日bug,实际基准是1899-12-30) |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.set(1899, 11, 30, 0, 0, 0); // 月份从0开始,11代表12月 |
| | | calendar.set(Calendar.MILLISECOND, 0); |
| | | |
| | | // 计算对应的实际日期 |
| | | calendar.add(Calendar.DAY_OF_MONTH, (int) excelDateNum); |
| | | |
| | | // 格式化为yyyy-MM-dd的日期字符串 |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | return sdf.format(calendar.getTime()); |
| | | } catch (NumberFormatException e) { |
| | | // 非数字类型,执行原有逻辑返回toString() |
| | | return o.toString(); |
| | | } |
| | | } |
| | | |
| | | public String defaultValue(Object o) { |