| | |
| | | import com.java110.dto.RoomDto; |
| | | import com.java110.dto.community.CommunityDto; |
| | | import com.java110.dto.fee.*; |
| | | import com.java110.dto.logSystemError.LogSystemErrorDto; |
| | | import com.java110.dto.owner.OwnerCarDto; |
| | | import com.java110.dto.owner.OwnerRoomRelDto; |
| | | import com.java110.dto.task.TaskDto; |
| | |
| | | import com.java110.intf.user.IOwnerCarInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerRoomRelInnerServiceSMO; |
| | | import com.java110.job.quartz.TaskSystemQuartz; |
| | | import com.java110.po.logSystemError.LogSystemErrorPo; |
| | | import com.java110.service.smo.ISaveSystemErrorSMO; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.exception.TaskTemplateException; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.utils.util.ExceptionUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | @Autowired |
| | | private IComputeFeeSMO computeFeeSMOImpl; |
| | | |
| | | @Autowired |
| | | private ISaveSystemErrorSMO saveSystemErrorSMOImpl; |
| | | |
| | | |
| | | @Override |
| | | protected void process(TaskDto taskDto) throws Exception { |
| | |
| | | List<CommunityDto> communityDtos = getAllCommunity(); |
| | | |
| | | for (CommunityDto communityDto : communityDtos) { |
| | | GenerateBill(taskDto, communityDto); |
| | | try { |
| | | GenerateBill(taskDto, communityDto); |
| | | }catch (Throwable e){ |
| | | |
| | | LogSystemErrorPo logSystemErrorPo = new LogSystemErrorPo(); |
| | | logSystemErrorPo.setErrId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_errId)); |
| | | logSystemErrorPo.setErrType(LogSystemErrorDto.ERR_TYPE_JOB); |
| | | logSystemErrorPo.setMsg(ExceptionUtil.getStackTrace(e)); |
| | | saveSystemErrorSMOImpl.saveLog(logSystemErrorPo); |
| | | logger.error("费用出账失败" + communityDto.getCommunityId(), e); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | for (FeeConfigDto tmpFeeConfigDto : feeConfigDtos) { |
| | | try { |
| | | GenerateBillByFeeConfig(taskDto, tmpFeeConfigDto); |
| | | } catch (Exception e) { |
| | | } catch (Throwable e) { |
| | | LogSystemErrorPo logSystemErrorPo = new LogSystemErrorPo(); |
| | | logSystemErrorPo.setErrId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_errId)); |
| | | logSystemErrorPo.setErrType(LogSystemErrorDto.ERR_TYPE_JOB); |
| | | logSystemErrorPo.setMsg(ExceptionUtil.getStackTrace(e)); |
| | | saveSystemErrorSMOImpl.saveLog(logSystemErrorPo); |
| | | logger.error("费用出账失败" + tmpFeeConfigDto.getConfigId(), e); |
| | | } |
| | | } |
| | |
| | | BillDto billDto = new BillDto(); |
| | | billDto.setBillId(billId); |
| | | billDto.setBillName(feeConfigDto.getFeeName() + "-" + DateUtil.getFormatTimeString(new Date(), DateUtil.DATE_FORMATE_STRING_H)); |
| | | billDto.setBillTime(DateUtil.getFormatTimeString(new Date(), DateUtil.DATE_FORMATE_STRING_A)); |
| | | billDto.setBillTime(DateUtil.getFormatTimeString(new Date(), DateUtil.DATE_FORMATE_STRING_B)); |
| | | billDto.setCommunityId(feeConfigDto.getCommunityId()); |
| | | billDto.setConfigId(feeConfigDto.getConfigId()); |
| | | billDto.setCurBill("T"); |
| | |
| | | for (FeeDto tmpFeeDto : feeDtos) { |
| | | try { |
| | | generateFee(startTime, tmpFeeDto, billDto, feeConfigDto); |
| | | } catch (Exception e) { |
| | | } catch (Throwable e) { |
| | | LogSystemErrorPo logSystemErrorPo = new LogSystemErrorPo(); |
| | | logSystemErrorPo.setErrId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_errId)); |
| | | logSystemErrorPo.setErrType(LogSystemErrorDto.ERR_TYPE_JOB); |
| | | logSystemErrorPo.setMsg(ExceptionUtil.getStackTrace(e)); |
| | | saveSystemErrorSMOImpl.saveLog(logSystemErrorPo); |
| | | logger.error("生成费用失败", e); |
| | | } |
| | | } |
| | |
| | | if (oweMonth <= 0.0) { |
| | | return; |
| | | } |
| | | double tmpFeePrice = computeFeeSMOImpl.getFeePrice(feeDto); |
| | | feeDto.setFeePrice(tmpFeePrice); |
| | | Map feePriceAll = computeFeeSMOImpl.getFeePrice(feeDto); |
| | | feeDto.setFeePrice(Double.parseDouble(feePriceAll.get("feePrice").toString())); |
| | | if (feeDto.getFeePrice() <= 0) { |
| | | return;//这个没有欠费可算 |
| | | } |
| | |
| | | if (roomDtos == null || roomDtos.size() < 1) { |
| | | //房屋可能被删除了 |
| | | billOweFeeDto.setOweId("1"); |
| | | billOweFeeDto.setOwnerId("-1"); |
| | | billOweFeeDto.setOwnerName("未知"); |
| | | billOweFeeDto.setOwnerTel("19999999999"); |
| | | billOweFeeDto.setPayerObjName("未知"); |
| | |
| | | OwnerRoomRelDto ownerRoomRelDto = new OwnerRoomRelDto(); |
| | | ownerRoomRelDto.setByOwnerInfo(true); |
| | | ownerRoomRelDto.setRoomId(tmpRoomDto.getRoomId()); |
| | | ownerRoomRelDto.setCommunityId(feeDto.getCommunityId()); |
| | | List<OwnerRoomRelDto> ownerRoomRelDtos = ownerRoomRelInnerServiceSMOImpl.queryOwnerRoomRels(ownerRoomRelDto); |
| | | |
| | | if (ownerRoomRelDtos == null || ownerRoomRelDtos.size() < 1) { |
| | | //房屋可能被删除了 |
| | | billOweFeeDto.setOweId("1"); |
| | | billOweFeeDto.setOwnerId("-1"); |
| | | billOweFeeDto.setOwnerName("未知"); |
| | | billOweFeeDto.setOwnerTel("19999999999"); |
| | | return; |