| | |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.mapper.AccountExpenseMapper; |
| | | import com.ruoyi.account.pojo.AccountExpense; |
| | | import com.ruoyi.account.service.AccountExpenseService; |
| | | import com.ruoyi.basic.mapper.SupplierManageMapper; |
| | | import com.ruoyi.basic.pojo.SupplierManage; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | |
| | | |
| | | private ProductRecordMapper productRecordMapper; |
| | | |
| | | private AccountExpenseService accountExpenseService; |
| | | |
| | | /** |
| | | * 查询付款登记 |
| | | * |
| | |
| | | */ |
| | | @Override |
| | | public int insertPaymentRegistration(List<PaymentRegistration> paymentRegistrationList) { |
| | | Long userId = SecurityUtils.getLoginUser().getUser().getUserId(); |
| | | LoginUser userId = SecurityUtils.getLoginUser(); |
| | | for (PaymentRegistration paymentRegistration : paymentRegistrationList) { |
| | | PaymentRegistration byId = paymentRegistration; |
| | | if (!ObjectUtils.isEmpty(paymentRegistration.getId())){ |
| | |
| | | } |
| | | paymentRegistration.setCreateTime(DateUtils.getNowDate()); |
| | | paymentRegistration.setUpdateTime(DateUtils.getNowDate()); |
| | | paymentRegistration.setRegistrantId(userId); |
| | | paymentRegistration.setRegistrantId(userId.getUserId()); |
| | | salesLedgerProduct.setTicketsTotal(salesLedgerProduct.getTicketsTotal().add(paymentRegistration.getCurrentPaymentAmount())); |
| | | salesLedgerProduct.setPendingTicketsTotal(salesLedgerProduct.getTaxInclusiveTotalPrice().subtract(salesLedgerProduct.getTicketsTotal())); |
| | | paymentRegistrationMapper.insert(paymentRegistration); |
| | | salesLedgerProductMapper.updateById(salesLedgerProduct); |
| | | // 2. 处理账户收入 |
| | | AccountExpense accountExpense = new AccountExpense(); |
| | | accountExpense.setExpenseDate(purchaseLedger.getEntryDate()); |
| | | accountExpense.setExpenseType("0"); |
| | | accountExpense.setSupplierName(purchaseLedger.getSupplierName()); |
| | | accountExpense.setExpenseMoney(paymentRegistration.getCurrentPaymentAmount()); |
| | | accountExpense.setExpenseDescribed("付款支出"); |
| | | accountExpense.setExpenseMethod("0"); |
| | | accountExpense.setBusinessId(paymentRegistration.getId()); |
| | | accountExpense.setBusinessType(1); |
| | | accountExpense.setInputTime(new Date()); |
| | | accountExpense.setInputUser(userId.getNickName()); |
| | | accountExpenseService.save(accountExpense); |
| | | } |
| | | return 1; |
| | | |