| | |
| | | |
| | | @Autowired |
| | | private IRuleGeneratorPayFeeBillV1InnerServiceSMO ruleGeneratorPayFeeBillV1InnerServiceSMOImpl; |
| | | @Autowired |
| | | private IFeeConfigInnerServiceSMO feeConfigInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public void execute(Business business, List<Business> businesses) throws ParseException { |
| | |
| | | List<PayFeePo> feePos = new ArrayList<>(); |
| | | List<FeeAttrPo> feeAttrsPos = new ArrayList<>(); |
| | | |
| | | |
| | | FeeConfigDto feeConfigDto = new FeeConfigDto(); |
| | | feeConfigDto.setCommunityId(data.getString("communityId")); |
| | | feeConfigDto.setConfigId(data.getString("configId")); |
| | | List<FeeConfigDto> feeConfigDtos = feeConfigInnerServiceSMOImpl.queryFeeConfigs(feeConfigDto); |
| | | Assert.listOnlyOne(feeConfigDtos, "当前费用项ID不存在或存在多条" + data.getString("configId")); |
| | | |
| | | |
| | | int saveFlag = 0; |
| | | for (int roomIndex = 0; roomIndex < roomDtos.size(); roomIndex++) { |
| | | //todo 加入 房屋费用 |
| | | feePos.add(addRoomFee(roomDtos.get(roomIndex), data)); |
| | | feePos.add(addRoomFee(roomDtos.get(roomIndex), data, feeConfigDtos.get(0))); |
| | | if (!StringUtil.isEmpty(roomDtos.get(roomIndex).getOwnerId())) { |
| | | if (!FeeDto.FEE_FLAG_CYCLE.equals(data.getString("feeFlag"))) { |
| | | feeAttrsPos.add(addFeeAttr(data, FeeAttrDto.SPEC_CD_ONCE_FEE_DEADLINE_TIME, data.containsKey("endTime") ? data.getString("endTime") : data.getString("configEndTime"))); |
| | |
| | | |
| | | } |
| | | |
| | | private PayFeePo addRoomFee(RoomDto roomDto, JSONObject paramInJson) { |
| | | private PayFeePo addRoomFee(RoomDto roomDto, JSONObject paramInJson, FeeConfigDto feeConfigDto) { |
| | | |
| | | String time = DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A); |
| | | if (paramInJson.containsKey("feeEndDate")) { |
| | | time = paramInJson.getString("feeEndDate"); |
| | |
| | | businessUnit.put("batchId", paramInJson.getString("batchId")); |
| | | businessUnit.put("userId", paramInJson.getString("userId")); |
| | | paramInJson.put("feeId", businessUnit.getString("feeId")); |
| | | if (!FeeDto.FEE_FLAG_CYCLE.equals(feeConfigDto.getFeeFlag()) |
| | | && !StringUtil.isEmpty(paramInJson.getString("endTime"))) { |
| | | paramInJson.put("maxTime", paramInJson.getString("endTime")); |
| | | } else { |
| | | paramInJson.put("maxTime", feeConfigDto.getEndTime()); |
| | | } |
| | | return BeanConvertUtil.covertBean(businessUnit, PayFeePo.class); |
| | | } |
| | | |