| | |
| | | import com.dy.pipIrrGlobal.daoSe.*; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeAudits; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeGeneral; |
| | | import com.dy.pipIrrGlobal.pojoSe.SePaymentMethod; |
| | | import com.dy.pipIrrGlobal.voSe.VoGeneral; |
| | | import com.dy.pipIrrGlobal.voSe.VoTradeDetails; |
| | | import com.dy.pipIrrGlobal.voSe.VoTransactionStatistics; |
| | |
| | | |
| | | @Autowired |
| | | private SeRefundMapper seRefundMapper; |
| | | |
| | | @Autowired |
| | | private SePaymentMethodMapper sePaymentMethodMapper; |
| | | |
| | | /** |
| | | * 获取未生成总账的交易日期列表(当天的交易记录不生成总账) |
| | |
| | | // 起始索引位置 |
| | | Integer startIndex = (pageCurr - 1) * pageSize; |
| | | |
| | | // 获取各支付方式ID |
| | | Long paymentId_cash = 0L; |
| | | Long paymentId_pos = 0L; |
| | | Long paymentId_transfer = 0L; |
| | | List<SePaymentMethod> list_payment = sePaymentMethodMapper.getPaymentMethods(); |
| | | for (int i = 0; i < list_payment.size(); i++) { |
| | | SePaymentMethod paymentMethod = list_payment.get(i); |
| | | if(paymentMethod.getName().equals("现金")) { |
| | | paymentId_cash = paymentMethod.getId(); |
| | | } |
| | | if(paymentMethod.getName().equals("POS机")) { |
| | | paymentId_pos = paymentMethod.getId(); |
| | | } |
| | | if(paymentMethod.getName().equals("银行转账")) { |
| | | paymentId_transfer = paymentMethod.getId(); |
| | | } |
| | | } |
| | | |
| | | // 接收传入参数:交易起止日期、收银员ID |
| | | JSONArray array_paymentSums = new JSONArray(); |
| | |
| | | while (calendar.getTime().before(timeStop) || calendar.getTime().equals(timeStop)) { |
| | | String tradeDate = dateFormat.format(calendar.getTime()) ; |
| | | if(cashierId != 1000000L) { |
| | | Float receivedCash = Optional.ofNullable(seGeneralMapper.getPaymentSums(tradeDate, cashierId, 1L)).orElse(0f); |
| | | Float receivedQRCode = Optional.ofNullable(seGeneralMapper.getPaymentSums(tradeDate, cashierId,2L)).orElse(0f); |
| | | Float receivedTransfer = Optional.ofNullable(seGeneralMapper.getPaymentSums(tradeDate, cashierId, 3L)).orElse(0f); |
| | | Float receivedCash = Optional.ofNullable(seGeneralMapper.getPaymentSums(tradeDate, cashierId, paymentId_cash)).orElse(0f); |
| | | Float receivedPos = Optional.ofNullable(seGeneralMapper.getPaymentSums(tradeDate, cashierId,paymentId_pos)).orElse(0f); |
| | | Float receivedTransfer = Optional.ofNullable(seGeneralMapper.getPaymentSums(tradeDate, cashierId, paymentId_transfer)).orElse(0f); |
| | | |
| | | JSONObject job = new JSONObject(); |
| | | job.put("tradeDate", tradeDate); |
| | | job.put("receivedCash", receivedCash); |
| | | job.put("receivedQRCode", receivedQRCode); |
| | | job.put("receivedPos", receivedPos); |
| | | job.put("receivedTransfer", receivedTransfer); |
| | | array_paymentSums.add(job); |
| | | |
| | | }else { |
| | | // 分级计算指定日期微信收退款合计,再计算实收金额 |
| | | // 此处应用时再优化 |
| | | Double rechargeWeChat = Optional.ofNullable(seWalletRechargeMapper.getRechargeSum(tradeDate)).orElse(0.0); |
| | | Double refundWeChat = Optional.ofNullable(seRefundMapper.getRefundSum(tradeDate)).orElse(0.0); |
| | | Double receiveWeChat = rechargeWeChat - refundWeChat; |