| | |
| | | import com.java110.po.fee.PayFeePo; |
| | | import com.java110.po.owner.RepairPoolPo; |
| | | import com.java110.po.owner.RepairUserPo; |
| | | import com.java110.utils.cache.CommonCache; |
| | | import com.java110.utils.constant.FeeConfigConstant; |
| | | import com.java110.utils.constant.FeeFlagTypeConstant; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | |
| | | @Autowired |
| | | private IRepairInnerServiceSMO repairInnerServiceSMO; |
| | | |
| | | @Autowired |
| | | private IFeeReceiptInnerServiceSMO feeReceiptInnerServiceSMOImpl; |
| | | |
| | | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException { |
| | |
| | | List<UserDto> userDtos = userV1InnerServiceSMOImpl.queryUsers(userDto); |
| | | Assert.listOnlyOne(userDtos, "用户未登录"); |
| | | |
| | | |
| | | //todo 生成收据编号 |
| | | String receiptCode = feeReceiptInnerServiceSMOImpl.generatorReceiptCode(reqJson.getString("communityId")); |
| | | |
| | | List<PayFeeDetailMonthDto> payFeeDetailMonthDtos = (List<PayFeeDetailMonthDto>) reqJson.get("payFeeDetailMonthDtos"); |
| | | |
| | | Calendar createTimeCal = Calendar.getInstance(); |
| | |
| | | } |
| | | createTimeCal.add(Calendar.SECOND, 1); |
| | | try { |
| | | doMonthFee(payFeeDetailMonthDto, context, userDtos.get(0), reqJson, createTimeCal.getTime(), feeDtoMap); |
| | | doMonthFee(payFeeDetailMonthDto, context, userDtos.get(0), reqJson, createTimeCal.getTime(), feeDtoMap,receiptCode); |
| | | } catch (Exception e) { |
| | | logger.error("处理异常", e); |
| | | throw new CmdException(e.getMessage()); |
| | |
| | | * @param userDto |
| | | * @param reqJson |
| | | */ |
| | | private void doMonthFee(PayFeeDetailMonthDto payFeeDetailMonthDto, ICmdDataFlowContext context, UserDto userDto, JSONObject reqJson, Date createTime, Map<String, FeeDto> feeDtoMap) { |
| | | private void doMonthFee(PayFeeDetailMonthDto payFeeDetailMonthDto, ICmdDataFlowContext context, UserDto userDto, JSONObject reqJson, Date createTime, Map<String, FeeDto> feeDtoMap,String receiptCode) { |
| | | //todo 计算结束时间 |
| | | Date startTime = DateUtil.getDateFromStringB(payFeeDetailMonthDto.getCurMonthTime()); |
| | | Calendar calendar = Calendar.getInstance(); |
| | |
| | | payFeeDetailPo.setEndTime(endTime); |
| | | // todo 按月交费时 主要按时间顺序排序时 能够整齐 |
| | | payFeeDetailPo.setCreateTime(DateUtil.getFormatTimeStringA(createTime)); |
| | | |
| | | //todo 缓存收据编号 |
| | | CommonCache.setValue(payFeeDetailPo.getDetailId()+CommonCache.RECEIPT_CODE,receiptCode,CommonCache.DEFAULT_EXPIRETIME_TWO_MIN); |
| | | int flag = payFeeDetailNewV1InnerServiceSMOImpl.savePayFeeDetailNew(payFeeDetailPo); |
| | | if (flag < 1) { |
| | | throw new CmdException("缴费失败"); |