src/main/java/com/mzl/flower/mapper/wallet/WalletBillRecordMapper.java
@@ -1,14 +1,11 @@ package com.mzl.flower.mapper.wallet; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.mzl.flower.dto.request.wallet.QueryWalletBillDTO; import com.mzl.flower.dto.response.wallet.WalletBillRecordVO; import com.mzl.flower.dto.response.wallet.WalletWithdrawRecordVO; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.mzl.flower.dto.request.wallet.QueryWalletBillRecordDTO; import com.mzl.flower.dto.response.wallet.WalletBillRecordVO; import com.mzl.flower.entity.wallet.WalletBillRecordDO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; src/main/java/com/mzl/flower/service/impl/wallet/WalletBillRecordServiceImpl.java
@@ -176,7 +176,7 @@ int a = 0; objs[a++] = sn; // 序号 objs[a++] = o.getSupplierName()+":"+o.getSupplierId(); // 供应商信息 objs[a++] = o.getTypeStr(); // 变动类型 objs[a++] = o.getTypeName(); // 变动类型 objs[a++] = o.getOriginalAmount(); // 原金额 objs[a++] = o.getChangeAmount(); // 变动金额 objs[a++] = o.getBalance(); //现余额 src/main/java/com/mzl/flower/service/impl/wallet/WalletServiceImpl.java
@@ -96,7 +96,7 @@ walletDO.setSettlingAmount(BigDecimal.ZERO); walletDO.setTotalDeduction(BigDecimal.ZERO); walletDO.setTotalTransactionAmount(BigDecimal.ZERO); walletDO.setSettlingAmount(BigDecimal.ZERO); walletDO.setSettledAmount(BigDecimal.ZERO); walletDO.create(SecurityUtils.getUserId()); baseMapper.insert(walletDO); // 将再次查询的结果返回 src/main/java/com/mzl/flower/service/payment/OrderSettlementService.java
@@ -732,7 +732,7 @@ serviceFee = serviceFee.add(ois.getServiceFee()); serviceFeeRate = ois.getServiceFeeRate(); settlementAmount = settlementAmount.add(ois.getIncomeSupplier()); WalletDO walletDO = walletService.getBySupplierId(supplierId); WalletDO walletDO = walletService.getOrCreateBySupplierId(supplierId); RLock lock = redissonClient.getLock(String.format(LockConstants.WALLET_ID_KEY, walletDO.getId())); try { if (lock.tryLock(10, 30, TimeUnit.SECONDS)) { @@ -766,6 +766,7 @@ //已结算金额 walletDOInfo.setSettledAmount(walletDOInfo.getSettledAmount().add(ois.getIncomeSupplier())); walletMapper.updateById(walletDOInfo); walletBillRecord.create(); walletBillRecordMapper.insert(walletBillRecord); } finally { lock.unlock(); src/main/java/com/mzl/flower/web/v2/wallet/WalletBillRecordController.java
@@ -5,24 +5,12 @@ import com.mzl.flower.base.BaseController; import com.mzl.flower.base.R; import com.mzl.flower.base.ReturnDataDTO; import com.mzl.flower.dto.request.report.QueryPartnerOrderDTO; import com.mzl.flower.dto.request.wallet.QueryWalletBillRecordDTO; import com.mzl.flower.dto.request.wallet.QueryWalletWithdrawDTO; import com.mzl.flower.dto.response.wallet.WalletBillRecordVO; import com.mzl.flower.dto.response.wallet.WalletWithdrawRecordVO; import com.mzl.flower.config.exception.ValidationException; import com.mzl.flower.dto.request.wallet.CreateWalletBillRecordDTO; import com.mzl.flower.dto.request.wallet.QueryWalletBillDTO; import com.mzl.flower.dto.request.wallet.QueryWalletBillRecordDTO; import com.mzl.flower.dto.response.wallet.WalletBillRecordVO; import com.mzl.flower.entity.supplier.Supplier; import com.mzl.flower.entity.wallet.WalletDO; import com.mzl.flower.mapper.supplier.SupplierMapper; import com.mzl.flower.service.supplier.SupplierService; import com.mzl.flower.service.wallet.WalletBillRecordService; import io.swagger.annotations.ApiOperation; import com.mzl.flower.service.wallet.WalletReduceService; import com.mzl.flower.service.wallet.WalletService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -45,31 +33,10 @@ @Autowired private SupplierService supplierService; @PostMapping("") public ResponseEntity<ReturnDataDTO> create(@Validated @RequestBody CreateWalletBillRecordDTO dto) { return returnData(R.SUCCESS.getCode(), null); } @PutMapping("/{id}") public ResponseEntity<ReturnDataDTO> update(@PathVariable @Positive(message = "{id.positive}") Integer id) { return returnData(R.SUCCESS.getCode(), null); } @DeleteMapping("/{id}") public ResponseEntity<ReturnDataDTO> delete(@PathVariable @Positive(message = "{id.positive}") Integer id) { return returnData(R.SUCCESS.getCode(), null); @GetMapping("/list") @ApiOperation(value = "供应商财务-分页", httpMethod = "GET") public ResponseEntity<ReturnDataDTO<Page<WalletBillRecordVO>>> getMemberList(Page page, QueryWalletBillRecordDTO dto) { return returnData(R.SUCCESS.getCode(), walletBillRecordService.queryPage(dto, page)); } @GetMapping("/{id}") public WalletBillRecordDO get(@PathVariable(value = "id") @Positive(message = "{id.positive}") Integer id) { return null; } @GetMapping("/page") @@ -77,12 +44,13 @@ ) { // 根据当前用户获取供应商 dto.setSupplierId(supplierService.getCurrentSupplier().getId()); return returnData(R.SUCCESS.getCode(), walletBillRecordService.getPage(page,dto)); return returnData(R.SUCCESS.getCode(), walletBillRecordService.getPage(page, dto)); } @GetMapping({"/export"}) @ApiOperation(value = "供应商财务导出") public void partnerExportSales(HttpServletResponse response, @Validated QueryWalletBillRecordDTO dto){ public void partnerExportSales(HttpServletResponse response, @Validated QueryWalletBillRecordDTO dto) { walletBillRecordService.exportSupplierFinanceList(response, dto); } } src/main/resources/mapper/wallet/WalletBillRecordMapper.xml
@@ -40,7 +40,6 @@ <select id="queryPage" resultType="com.mzl.flower.dto.response.wallet.WalletBillRecordVO"> select t.* ,s.name supplierName from t_wallet_bill_record t left join t_supplier_info s on t.supplier_id = s.id left join t_order o on t.order_id = o.id left join t_wallet_withdraw_record w on t.withdraw_record_id = w.id where t.deleted= 0 <if test="dto.supplierName != null and dto.supplierName != ''"> @@ -53,10 +52,10 @@ and t.type = #{type} </if> <if test="dto.orderNo != null and dto.orderNo != ''"> and o.order_no = like concat('%', #{orderNo}, '%') and torder_no = like concat('%', #{orderNo}, '%') </if> <if test="dto.createStartDate!=null "> <![CDATA[ <![CDATA[. AND w.create_time >= #{dto.createStartDate} ]]> </if> @@ -82,7 +81,6 @@ <select id="queryWalletBillRecordList" resultType="com.mzl.flower.dto.response.wallet.WalletBillRecordVO"> select t.* ,s.name supplierName from t_wallet_bill_record t left join t_supplier_info s on t.supplier_id = s.id left join t_order o on t.order_id = o.id left join t_wallet_withdraw_record w on t.withdraw_record_id = w.id where t.deleted= 0 <if test="dto.supplierName != null and dto.supplierName != ''"> @@ -95,7 +93,7 @@ and t.type = #{type} </if> <if test="dto.orderNo != null and dto.orderNo != ''"> and o.order_no = like concat('%', #{orderNo}, '%') and t.order_no = like concat('%', #{orderNo}, '%') </if> <if test="dto.createStartDate!=null "> <![CDATA[