| | |
| | | import com.java110.api.bmo.ApiBaseBMO; |
| | | import com.java110.api.bmo.parkingSpace.IParkingSpaceBMO; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.smo.fee.IFeeConfigInnerServiceSMO; |
| | | import com.java110.core.smo.fee.IFeeInnerServiceSMO; |
| | | import com.java110.core.smo.parkingSpace.IParkingSpaceInnerServiceSMO; |
| | | import com.java110.intf.community.IParkingSpaceInnerServiceSMO; |
| | | import com.java110.intf.fee.IFeeConfigInnerServiceSMO; |
| | | import com.java110.intf.fee.IFeeInnerServiceSMO; |
| | | import com.java110.dto.fee.FeeConfigDto; |
| | | import com.java110.dto.fee.FeeDto; |
| | | import com.java110.dto.owner.OwnerCarDto; |
| | |
| | | businessOwnerCar.putAll(paramInJson); |
| | | businessOwnerCar.put("carId", "-1"); |
| | | OwnerCarPo ownerCarPo = BeanConvertUtil.covertBean(businessOwnerCar, OwnerCarPo.class); |
| | | super.delete(dataFlowContext, ownerCarPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_OWNER_CAR); |
| | | ownerCarPo.setState(OwnerCarDto.STATE_NORMAL); |
| | | super.insert(dataFlowContext, ownerCarPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_OWNER_CAR); |
| | | } |
| | | |
| | | /** |
| | |
| | | JSONObject businessParkingSpace = new JSONObject(); |
| | | |
| | | businessParkingSpace.putAll(BeanConvertUtil.beanCovertMap(parkingSpaceDto)); |
| | | businessParkingSpace.put("state", this.isHireParkingSpace(paramInJson) ? "H" : "S"); |
| | | businessParkingSpace.put("state", paramInJson.getString("carNumType")); |
| | | ParkingSpacePo parkingSpacePo = BeanConvertUtil.covertBean(businessParkingSpace, ParkingSpacePo.class); |
| | | super.delete(dataFlowContext, parkingSpacePo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_PARKING_SPACE); |
| | | super.update(dataFlowContext, parkingSpacePo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_PARKING_SPACE); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | // 计算feeTypeCd |
| | | |
| | | String feeTypeCd = "1001".equals(parkingSpaceDto.getTypeCd()) |
| | | ? (this.isHireParkingSpace(paramInJson) |
| | | ? FeeTypeConstant.FEE_TYPE_HIRE_UP_PARKING_SPACE |
| | | : FeeTypeConstant.FEE_TYPE_SELL_UP_PARKING_SPACE) |
| | | : (this.isHireParkingSpace(paramInJson) |
| | | ? FeeTypeConstant.FEE_TYPE_HIRE_DOWN_PARKING_SPACE |
| | | : FeeTypeConstant.FEE_TYPE_SELL_DOWN_PARKING_SPACE); |
| | | |
| | | // String feeTypeCd = "1001".equals(parkingSpaceDto.getTypeCd()) |
| | | // ? (this.isHireParkingSpace(paramInJson) |
| | | // ? FeeTypeConstant.FEE_TYPE_HIRE_UP_PARKING_SPACE |
| | | // : FeeTypeConstant.FEE_TYPE_SELL_UP_PARKING_SPACE) |
| | | // : (this.isHireParkingSpace(paramInJson) |
| | | // ? FeeTypeConstant.FEE_TYPE_HIRE_DOWN_PARKING_SPACE |
| | | // : FeeTypeConstant.FEE_TYPE_SELL_DOWN_PARKING_SPACE); |
| | | String feeTypeCd = FeeTypeConstant.FEE_TYPE_CAR; |
| | | paramInJson.put("feeTypeCd", feeTypeCd); |
| | | |
| | | //计算 receivableAmount |
| | | |
| | | |
| | | FeeConfigDto feeConfigDto = new FeeConfigDto(); |
| | | feeConfigDto.setFeeTypeCd(feeTypeCd); |
| | | feeConfigDto.setIsDefault("T"); |
| | | feeConfigDto.setConfigId(paramInJson.getString("configId")); |
| | | feeConfigDto.setCommunityId(paramInJson.getString("communityId")); |
| | | List<FeeConfigDto> feeConfigDtos = feeConfigInnerServiceSMOImpl.queryFeeConfigs(feeConfigDto); |
| | | if (feeConfigDtos == null || feeConfigDtos.size() != 1) { |
| | |
| | | |
| | | feeConfigDto = feeConfigDtos.get(0); |
| | | |
| | | double receivableAmount = isHireParkingSpace(paramInJson) ? Double.parseDouble(feeConfigDto.getAdditionalAmount()) |
| | | * Double.parseDouble(paramInJson.getString("cycles")) : Double.parseDouble(feeConfigDto.getAdditionalAmount()); |
| | | double receivableAmount = Double.parseDouble(feeConfigDto.getAdditionalAmount()) |
| | | * Double.parseDouble(paramInJson.getString("cycles")); |
| | | |
| | | paramInJson.put("receivableAmount", receivableAmount); |
| | | paramInJson.put("configId", feeConfigDto.getConfigId()); |
| | | |
| | | //计算 amount |
| | | String amount = isHireParkingSpace(paramInJson) ? "-1.00" : String.valueOf(receivableAmount); |
| | | String amount = "-1.00"; |
| | | paramInJson.put("amount", amount); |
| | | |
| | | //计算 cycles |
| | | String cycles = isHireParkingSpace(paramInJson) ? paramInJson.getString("cycles") : "1"; |
| | | String cycles = paramInJson.getString("cycles"); |
| | | paramInJson.put("cycles", cycles); |
| | | |
| | | //计算结束时间 |
| | | String endTime = "2038-01-01 00:00:00"; |
| | | if (isHireParkingSpace(paramInJson)) { |
| | | Date et = DateUtil.getCurrentDate(); |
| | | Calendar endCalender = Calendar.getInstance(); |
| | | endCalender.setTime(et); |
| | | endCalender.add(Calendar.MONTH, Integer.parseInt(paramInJson.getString("cycles"))); |
| | | endTime = DateUtil.getFormatTimeString(endCalender.getTime(), DateUtil.DATE_FORMATE_STRING_A); |
| | | } |
| | | String endTime = ""; |
| | | |
| | | Date et = DateUtil.getCurrentDate(); |
| | | Calendar endCalender = Calendar.getInstance(); |
| | | endCalender.setTime(et); |
| | | endCalender.add(Calendar.MONTH, Integer.parseInt(paramInJson.getString("cycles"))); |
| | | endTime = DateUtil.getFormatTimeString(endCalender.getTime(), DateUtil.DATE_FORMATE_STRING_A); |
| | | |
| | | |
| | | paramInJson.put("endTime", endTime); |
| | | |