| | |
| | | import com.java110.dto.repair.RepairDto; |
| | | import com.java110.dto.repair.RepairUserDto; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.intf.acct.IAccountDetailInnerServiceSMO; |
| | | import com.java110.fee.smo.impl.FeeReceiptInnerServiceSMOImpl; |
| | | import com.java110.intf.acct.IAccountInnerServiceSMO; |
| | | import com.java110.intf.acct.ICouponUserDetailV1InnerServiceSMO; |
| | | import com.java110.intf.acct.ICouponUserV1InnerServiceSMO; |
| | | import com.java110.intf.community.*; |
| | | import com.java110.intf.fee.*; |
| | | import com.java110.intf.fee.IFeeAccountDetailServiceSMO; |
| | |
| | | import com.java110.po.owner.RepairUserPo; |
| | | import com.java110.po.payFee.PayFeeDetailDiscountPo; |
| | | import com.java110.utils.cache.CommonCache; |
| | | import com.java110.utils.constant.CommonConstant; |
| | | import com.java110.utils.constant.FeeFlagTypeConstant; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.exception.CmdException; |
| | |
| | | private IFeeAttrInnerServiceSMO feeAttrInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IRoomInnerServiceSMO roomInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IFeeConfigInnerServiceSMO feeConfigInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IOwnerCarInnerServiceSMO ownerCarInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IFeeReceiptDetailInnerServiceSMO feeReceiptDetailInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IRepairUserInnerServiceSMO repairUserInnerServiceSMO; |
| | |
| | | |
| | | @Autowired |
| | | private IParkingSpaceInnerServiceSMO parkingSpaceInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IAccountDetailInnerServiceSMO accountDetailInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IAccountInnerServiceSMO accountInnerServiceSMOImpl; |
| | |
| | | private IRepairUserV1InnerServiceSMO repairUserNewV1InnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private ICouponUserV1InnerServiceSMO couponUserV1InnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private ICouponUserDetailV1InnerServiceSMO couponUserDetailV1InnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IOwnerCarNewV1InnerServiceSMO ownerCarNewV1InnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | |
| | | @Autowired |
| | | private IUserV1InnerServiceSMO userV1InnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private FeeReceiptInnerServiceSMOImpl feeReceiptInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | |
| | | Assert.jsonObjectHaveKey(reqJson, "cycles", "请求报文中未包含cycles节点"); |
| | | Assert.jsonObjectHaveKey(reqJson, "receivedAmount", "请求报文中未包含receivedAmount节点"); |
| | | Assert.jsonObjectHaveKey(reqJson, "feeId", "请求报文中未包含feeId节点"); |
| | | |
| | | Assert.hasLength(reqJson.getString("communityId"), "小区ID不能为空"); |
| | | Assert.hasLength(reqJson.getString("cycles"), "周期不能为空"); |
| | | Assert.hasLength(reqJson.getString("receivedAmount"), "实收金额不能为空"); |
| | | Assert.hasLength(reqJson.getString("feeId"), "费用ID不能为空"); |
| | | |
| | | //判断是否 费用状态为缴费结束 |
| | | FeeDto feeDto = new FeeDto(); |
| | | feeDto.setFeeId(reqJson.getString("feeId")); |
| | |
| | | if (feeConfigDtos == null || feeConfigDtos.size() != 1) { |
| | | throw new IllegalArgumentException("费用项不存在"); |
| | | } |
| | | /*//一次性费用 和间接性费用 |
| | | //一次性费用 和间接性费用 |
| | | Date maxEndTime = feeDtos.get(0).getDeadlineTime(); |
| | | //周期性费用 |
| | | if (maxEndTime == null || FeeDto.FEE_FLAG_CYCLE.equals(feeConfigDtos.get(0).getFeeFlag())) { |
| | | maxEndTime = DateUtil.getDateFromStringA(feeConfigDtos.get(0).getEndTime()); |
| | | }*/ |
| | | Date maxEndTime = null; |
| | | if (!StringUtil.isEmpty(feeDto.getFeeFlag()) && feeDto.getFeeFlag().equals(FeeDto.FEE_FLAG_CYCLE)) { //周期性费用 |
| | | maxEndTime = DateUtil.getDateFromStringA(feeConfigDtos.get(0).getEndTime()); |
| | | } else { //一次性费用 和间接性费用 |
| | | maxEndTime = feeDtos.get(0).getDeadlineTime(); |
| | | } |
| | | // Date maxEndTime = null; |
| | | // if (!StringUtil.isEmpty(feeDto.getFeeFlag()) && feeDto.getFeeFlag().equals(FeeDto.FEE_FLAG_CYCLE)) { //周期性费用 |
| | | // maxEndTime = DateUtil.getDateFromStringA(feeConfigDtos.get(0).getEndTime()); |
| | | // } else { //一次性费用 和间接性费用 |
| | | // maxEndTime = feeDtos.get(0).getDeadlineTime(); |
| | | // } |
| | | |
| | | if (maxEndTime != null && endTime != null && !FeeDto.FEE_FLAG_ONCE.equals(feeConfigDtos.get(0).getFeeFlag())) { |
| | | Date newDate = DateUtil.stepMonth(endTime, reqJson.getDouble("cycles").intValue()); |
| | |
| | | String cycles = paramObj.getString("cycles"); |
| | | Date endTime = null; |
| | | |
| | | //todo 生成收据编号 |
| | | String receiptCode = feeReceiptInnerServiceSMOImpl.generatorReceiptCode(paramObj.getString("communityId")); |
| | | |
| | | PayFeePo payFeePo = null; |
| | | String requestId = DistributedLock.getLockUUID(); |
| | | String key = this.getClass().getSimpleName() + paramObj.get("feeId"); |
| | |
| | | payFeePo = BeanConvertUtil.covertBean(fee, PayFeePo.class); |
| | | PayFeeDetailPo payFeeDetailPo = BeanConvertUtil.covertBean(feeDetail, PayFeeDetailPo.class); |
| | | payFeeDetailPo.setReceivableAmount(feeDetail.getString("totalFeePrice")); |
| | | //判断是否有赠送规则 |
| | | //todo 缓存收据编号 |
| | | CommonCache.setValue(payFeeDetailPo.getDetailId() + CommonCache.RECEIPT_CODE, receiptCode, CommonCache.DEFAULT_EXPIRETIME_TWO_MIN); |
| | | |
| | | //todo 判断是否有赠送规则 |
| | | hasDiscount(paramObj, payFeePo, payFeeDetailPo); |
| | | |
| | | // todo 处理用户账户 |
| | |
| | | applyRoomDiscountInnerServiceSMOImpl.updateApplyRoomDiscount(applyRoomDiscountPo); |
| | | } |
| | | } |
| | | |
| | | |
| | | //根据明细ID 查询收据信息 |
| | | FeeReceiptDetailDto feeReceiptDetailDto = new FeeReceiptDetailDto(); |
| | |
| | | return; |
| | | } |
| | | |
| | | //todo 如果是同一天不创建 |
| | | if (DateUtil.getFormatTimeStringB(endTime).equals(reqJson.getString("customStartTime"))) { |
| | | return; |
| | | } |
| | | |
| | | FeeDto feeInfo = (FeeDto) reqJson.get("feeInfo"); |
| | | String payObjNameRemark = "房屋"; |
| | | if (FeeDto.PAYER_OBJ_TYPE_CAR.equals(feeInfo.getPayerObjType())) { |
| | |
| | | tmpFeeAttrPos.add(tmpFeeAttrPo); |
| | | } |
| | | //todo 没有结束时间时 |
| | | if(!hasDeadLineTime){ |
| | | if (!hasDeadLineTime) { |
| | | tmpFeeAttrPo = new FeeAttrPo(); |
| | | tmpFeeAttrPo.setAttrId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_attrId, true)); |
| | | tmpFeeAttrPo.setFeeId(tmpPayFeePo.getFeeId()); |