| | |
| | | import com.java110.intf.community.IRoomInnerServiceSMO; |
| | | import com.java110.intf.fee.IFeeConfigInnerServiceSMO; |
| | | import com.java110.intf.fee.IFeeInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerCarInnerServiceSMO; |
| | | import com.java110.po.car.CarInoutPo; |
| | | import com.java110.po.fee.FeeAttrPo; |
| | | import com.java110.po.fee.PayFeeConfigPo; |
| | | import com.java110.po.fee.PayFeeDetailPo; |
| | | import com.java110.po.fee.PayFeePo; |
| | |
| | | feeReceiptDetailPo.setFeeName(StringUtil.isEmpty(feeDto.getImportFeeName()) ? feeDto.getFeeName() : feeDto.getImportFeeName()); |
| | | feeReceiptDetailPo.setStartTime(businessFeeDetail.getString("startTime")); |
| | | feeReceiptDetailPo.setReceiptId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_receiptId)); |
| | | |
| | | computeFeeSMOImpl.freshFeeReceiptDetail(feeDto, feeReceiptDetailPo); |
| | | feeReceiptDetailPos.add(feeReceiptDetailPo); |
| | | feeReceiptPo.setAmount(feeReceiptDetailPo.getAmount()); |
| | |
| | | } else { |
| | | endCalender.add(Calendar.MONTH, Integer.parseInt(paramInJson.getString("cycles"))); |
| | | if (FeeDto.FEE_FLAG_ONCE.equals(feeDto.getFeeFlag())) { |
| | | if (!StringUtil.isEmpty(feeDto.getCurDegrees())) { |
| | | if(feeDto.getDeadlineTime() != null){ |
| | | endCalender.setTime(feeDto.getDeadlineTime()); |
| | | }else if (!StringUtil.isEmpty(feeDto.getCurDegrees())) { |
| | | endCalender.setTime(feeDto.getCurReadingTime()); |
| | | } else if (feeDto.getImportFeeEndTime() == null) { |
| | | endCalender.setTime(feeDto.getConfigEndTime()); |
| | |
| | | } |
| | | businessFeeDetail.put("endTime", DateUtil.getFormatTimeString(endCalender.getTime(), DateUtil.DATE_FORMATE_STRING_A)); |
| | | |
| | | BigDecimal feePrice = new BigDecimal("0.00"); |
| | | double feePrice = 0.0; |
| | | |
| | | if ("3333".equals(feeDto.getPayerObjType())) { //房屋相关 |
| | | String computingFormula = feeDto.getComputingFormula(); |
| | | if ("1001".equals(computingFormula)) { //面积*单价+附加费 |
| | | RoomDto roomDto = new RoomDto(); |
| | | roomDto.setRoomId(feeDto.getPayerObjId()); |
| | | roomDto.setCommunityId(feeDto.getCommunityId()); |
| | | List<RoomDto> roomDtos = roomInnerServiceSMOImpl.queryRooms(roomDto); |
| | | if (roomDtos == null || roomDtos.size() != 1) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_ERROR, "未查到房屋信息,查询多条数据"); |
| | | } |
| | | roomDto = roomDtos.get(0); |
| | | //feePrice = Double.parseDouble(feeDto.getSquarePrice()) * Double.parseDouble(roomDtos.get(0).getBuiltUpArea()) + Double.parseDouble(feeDto.getAdditionalAmount()); |
| | | BigDecimal squarePrice = new BigDecimal(Double.parseDouble(feeDto.getSquarePrice())); |
| | | BigDecimal builtUpArea = new BigDecimal(Double.parseDouble(roomDtos.get(0).getBuiltUpArea())); |
| | | BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount())); |
| | | feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } else if ("2002".equals(computingFormula)) { // 固定费用 |
| | | //feePrice = Double.parseDouble(feeDto.getAdditionalAmount()); |
| | | BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount())); |
| | | feePrice = additionalAmount.setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } else if ("4004".equals(computingFormula)) { |
| | | feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount())); |
| | | } else if ("5005".equals(computingFormula)) { |
| | | if (StringUtil.isEmpty(feeDto.getCurDegrees())) { |
| | | //throw new IllegalArgumentException("抄表数据异常"); |
| | | } else { |
| | | BigDecimal curDegree = new BigDecimal(Double.parseDouble(feeDto.getCurDegrees())); |
| | | BigDecimal preDegree = new BigDecimal(Double.parseDouble(feeDto.getPreDegrees())); |
| | | BigDecimal squarePrice = new BigDecimal(Double.parseDouble(feeDto.getSquarePrice())); |
| | | BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount())); |
| | | BigDecimal sub = curDegree.subtract(preDegree); |
| | | feePrice = sub.multiply(squarePrice) |
| | | .add(additionalAmount) |
| | | .setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } |
| | | } else if ("6006".equals(computingFormula)) { |
| | | feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount())); |
| | | } else { |
| | | throw new IllegalArgumentException("暂不支持该类公式"); |
| | | } |
| | | } else if ("6666".equals(feeDto.getPayerObjType())) {//车位相关 |
| | | String computingFormula = feeDto.getComputingFormula(); |
| | | if ("1001".equals(computingFormula)) { //面积*单价+附加费 |
| | | ParkingSpaceDto parkingSpaceDto = new ParkingSpaceDto(); |
| | | parkingSpaceDto.setCommunityId(feeDto.getCommunityId()); |
| | | parkingSpaceDto.setPsId(feeDto.getPayerObjId()); |
| | | List<ParkingSpaceDto> parkingSpaceDtos = parkingSpaceInnerServiceSMOImpl.queryParkingSpaces(parkingSpaceDto); |
| | | feePrice = computeFeeSMOImpl.getFeePrice(feeDto); |
| | | |
| | | if (parkingSpaceDtos == null || parkingSpaceDtos.size() < 1) { //数据有问题 |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_ERROR, "未查到停车位信息,查询多条数据"); |
| | | } |
| | | //feePrice = Double.parseDouble(feeDto.getSquarePrice()) * Double.parseDouble(parkingSpaceDtos.get(0).getArea()) + Double.parseDouble(feeDto.getAdditionalAmount()); |
| | | BigDecimal squarePrice = new BigDecimal(Double.parseDouble(feeDto.getSquarePrice())); |
| | | BigDecimal builtUpArea = new BigDecimal(Double.parseDouble(parkingSpaceDtos.get(0).getArea())); |
| | | BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount())); |
| | | feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } else if ("2002".equals(computingFormula)) { // 固定费用 |
| | | //feePrice = Double.parseDouble(feeDto.getAdditionalAmount()); |
| | | BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount())); |
| | | feePrice = additionalAmount.setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } else if ("5005".equals(computingFormula)) { |
| | | if (StringUtil.isEmpty(feeDto.getCurDegrees())) { |
| | | throw new IllegalArgumentException("抄表数据异常"); |
| | | } else { |
| | | BigDecimal curDegree = new BigDecimal(Double.parseDouble(feeDto.getCurDegrees())); |
| | | BigDecimal preDegree = new BigDecimal(Double.parseDouble(feeDto.getPreDegrees())); |
| | | BigDecimal squarePrice = new BigDecimal(Double.parseDouble(feeDto.getSquarePrice())); |
| | | BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount())); |
| | | BigDecimal sub = curDegree.subtract(preDegree); |
| | | feePrice = sub.multiply(squarePrice) |
| | | .add(additionalAmount) |
| | | .setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } |
| | | } else if ("6006".equals(computingFormula)) { |
| | | feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount())); |
| | | } else if ("4004".equals(computingFormula)) { |
| | | feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount())); |
| | | } else { |
| | | throw new IllegalArgumentException("暂不支持该类公式"); |
| | | } |
| | | } |
| | | BigDecimal receivableAmount = feePrice; |
| | | BigDecimal receivableAmount = new BigDecimal(feePrice); |
| | | BigDecimal cycles = new BigDecimal(Double.parseDouble(paramInJson.getString("cycles"))); |
| | | double tmpReceivableAmount = cycles.multiply(receivableAmount).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue(); |
| | | double discountPrice = paramInJson.getDouble("discountPrice"); |
| | |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ + 1); |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | JSONObject businessUnit = new JSONObject(); |
| | | businessUnit.put("feeId", "-1"); |
| | | businessUnit.put("feeId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_feeId)); |
| | | businessUnit.put("configId", paramInJson.getString("configId")); |
| | | businessUnit.put("feeTypeCd", paramInJson.getString("feeTypeCd")); |
| | | businessUnit.put("incomeObjId", paramInJson.getString("storeId")); |
| | |
| | | businessUnit.put("state", "2008001"); |
| | | businessUnit.put("userId", dataFlowContext.getRequestCurrentHeaders().get(CommonConstant.HTTP_USER_ID)); |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put(PayFeePo.class.getSimpleName(), businessUnit); |
| | | paramInJson.put("feeId", businessUnit.getString("feeId")); |
| | | return business; |
| | | } |
| | | |
| | | @Override |
| | | public JSONObject addFeeAttr(JSONObject paramInJson, DataFlowContext dataFlowContext, String specCd, String value) { |
| | | |
| | | JSONObject business = JSONObject.parseObject("{\"datas\":{}}"); |
| | | business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_FEE_INFO); |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ + 1); |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | FeeAttrPo feeAttrPo = new FeeAttrPo(); |
| | | feeAttrPo.setCommunityId(paramInJson.getString("communityId")); |
| | | feeAttrPo.setSpecCd(specCd); |
| | | feeAttrPo.setValue(value); |
| | | feeAttrPo.setFeeId(paramInJson.getString("feeId")); |
| | | feeAttrPo.setAttrId("-1"); |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put(FeeAttrPo.class.getSimpleName(), JSONObject.parseObject(JSONObject.toJSONString(feeAttrPo))); |
| | | return business; |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ + 1); |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | JSONObject businessUnit = new JSONObject(); |
| | | businessUnit.put("feeId", "-1"); |
| | | businessUnit.put("feeId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_feeId)); |
| | | businessUnit.put("configId", paramInJson.getString("configId")); |
| | | businessUnit.put("feeTypeCd", paramInJson.getString("feeTypeCd")); |
| | | businessUnit.put("incomeObjId", paramInJson.getString("storeId")); |
| | |
| | | businessUnit.put("state", "2008001"); |
| | | businessUnit.put("userId", dataFlowContext.getRequestCurrentHeaders().get(CommonConstant.HTTP_USER_ID)); |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put(PayFeePo.class.getSimpleName(), businessUnit); |
| | | paramInJson.put("feeId", businessUnit.getString("feeId")); |
| | | return business; |
| | | } |
| | | |