This commit is contained in:
wuweihua
2026-09-16 17:14:24 +08:00
45 changed files with 3786 additions and 77 deletions
@@ -22,6 +22,7 @@ import com.ruoyi.ar.domain.ArBillLog;
import com.ruoyi.ar.domain.vo.ArBillActionRequest;
import com.ruoyi.ar.domain.vo.ArBillGenerateQuery;
import com.ruoyi.ar.domain.vo.ArBillGenerateRequest;
import com.ruoyi.ar.domain.vo.ArBillQuery;
import com.ruoyi.ar.service.IArBillService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
@@ -43,7 +44,7 @@ public class ArBillController extends BaseController
@PreAuthorize("@ss.hasPermi('ar:bill:list')")
@GetMapping("/list")
public TableDataInfo list(ArBill query)
public TableDataInfo list(ArBillQuery query)
{
startPage();
List<ArBill> list = billService.selectArBillList(query);
@@ -0,0 +1,78 @@
package com.ruoyi.web.controller.customer.customerinfo;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.customer.customerinfo.domain.BmsCustomerPriceSet;
import com.ruoyi.customer.customerinfo.domain.BmsPriceSetOption;
import com.ruoyi.customer.customerinfo.service.IBmsCustomerPriceSetService;
/**
* 客户套餐绑定Controller(客户管理-客户编辑-绑定套餐)
*
* @author ruoyi
* @date 2026-09-16
*/
@RestController
@RequestMapping("/customersupplier/customerinfo/priceset")
public class BmsCustomerPriceSetController extends BaseController
{
@Autowired
private IBmsCustomerPriceSetService customerPriceSetService;
/**
* 查询客户已绑定的套餐列表
*/
@PreAuthorize("@ss.hasPermi('customersupplier:customerinfo:list')")
@GetMapping("/bind/list")
public AjaxResult bindList(Long customerId)
{
List<BmsCustomerPriceSet> list = customerPriceSetService.selectBindList(customerId);
return success(list);
}
/**
* 查询可绑定的生效套餐选项
*/
@PreAuthorize("@ss.hasPermi('customersupplier:customerinfo:list')")
@GetMapping("/option/list")
public AjaxResult optionList(BmsPriceSetOption query)
{
return success(customerPriceSetService.selectOptionList(query));
}
/**
* 保存客户套餐绑定(已绑定则更新/更换套餐,未绑定则新增)
*/
@PreAuthorize("@ss.hasPermi('customersupplier:customerinfo:edit')")
@Log(title = "客户套餐绑定", businessType = BusinessType.INSERT)
@PostMapping("/bind")
public AjaxResult saveBind(@RequestBody BmsCustomerPriceSet bind)
{
bind.setCreateBy(getUsername());
bind.setUpdateBy(getUsername());
return toAjax(customerPriceSetService.saveBind(bind));
}
/**
* 解绑客户套餐
*/
@PreAuthorize("@ss.hasPermi('customersupplier:customerinfo:edit')")
@Log(title = "客户套餐解绑", businessType = BusinessType.DELETE)
@DeleteMapping("/bind/{customerPricesetIds}")
public AjaxResult removeBind(@PathVariable Long[] customerPricesetIds)
{
return toAjax(customerPriceSetService.deleteBindByIds(customerPricesetIds));
}
}
@@ -0,0 +1,111 @@
package com.ruoyi.web.controller.customer.customermoney;
import java.util.Collections;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.ar.domain.ArBalanceWriteoff;
import com.ruoyi.ar.service.IArBalanceWriteoffService;
import com.ruoyi.ar.service.IArBillService;
import com.ruoyi.ar.domain.vo.ArBillQuery;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
/**
* 客户余额核销应收账单 / 账单只读查询 Controller
*
* @author ruoyi
* @date 2026-09-16
*/
@RestController
@RequestMapping("/customersupplier/customerbill")
public class CustomerBillController extends BaseController
{
@Autowired
private IArBalanceWriteoffService balanceWriteoffService;
@Autowired
private IArBillService billService;
/**
* 查询客户可核销账单(已确认/部分核销,未核销额大于0)
*/
@PreAuthorize("@ss.hasPermi('customersupplier:customerinfo:list')")
@GetMapping("/unsettled/{customerId}")
public AjaxResult unsettled(@PathVariable("customerId") Long customerId)
{
return success(balanceWriteoffService.selectUnsettledBills(customerId));
}
/**
* 查询余额核销记录(分页)
*/
@PreAuthorize("@ss.hasPermi('customersupplier:customerinfo:list')")
@GetMapping("/writeoff/list")
public TableDataInfo writeoffList(ArBalanceWriteoff query)
{
if (query == null || query.getCustomerId() == null || query.getCustomerId() == 0L)
{
return getDataTable(Collections.emptyList());
}
startPage();
List<ArBalanceWriteoff> list = balanceWriteoffService.selectWriteoffList(query);
return getDataTable(list);
}
/**
* 用客户账户余额核销账单
*/
@PreAuthorize("@ss.hasPermi('customer:bill:writeoff')")
@Log(title = "余额核销账单", businessType = BusinessType.UPDATE)
@PostMapping("/writeoff")
public AjaxResult writeoff(@RequestBody ArBalanceWriteoff cmd)
{
cmd.setCreateBy(getUsername());
return success(balanceWriteoffService.writeoff(cmd));
}
/**
* 反核销(取消一笔有效余额核销)
*/
@PreAuthorize("@ss.hasPermi('customer:bill:writeoff:cancel')")
@Log(title = "余额核销反核销", businessType = BusinessType.UPDATE)
@PutMapping("/writeoff/{writeoffId}/cancel")
public AjaxResult cancelWriteoff(@PathVariable("writeoffId") Long writeoffId,
@RequestBody(required = false) ArBalanceWriteoff body)
{
balanceWriteoffService.cancelWriteoff(writeoffId, body == null ? null : body.getCancelRemark());
return success();
}
/**
* 账单查看:分页查询应收账单(只读,供客户侧账单查看页使用)
*/
@PreAuthorize("@ss.hasPermi('customer:bill:list')")
@GetMapping("/list")
public TableDataInfo billList(ArBillQuery query)
{
startPage();
return getDataTable(billService.selectArBillList(query));
}
/**
* 账单查看:账单详情(含订单明细/费用明细)
*/
@PreAuthorize("@ss.hasPermi('customer:bill:query')")
@GetMapping("/{arBillId}")
public AjaxResult billInfo(@PathVariable("arBillId") Long arBillId)
{
return success(billService.selectArBillById(arBillId));
}
}
@@ -17,6 +17,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.customer.customermoney.domain.CustomerBalanceFlow;
import com.ruoyi.customer.customermoney.domain.CustomerCreditFlow;
import com.ruoyi.customer.customermoney.domain.CustomerReceipt;
import com.ruoyi.customer.customermoney.service.ICustomerMoneyService;
@@ -118,4 +119,32 @@ public class CustomerMoneyController extends BaseController
List<CustomerBalanceFlow> list = customerMoneyService.selectFlowList(query);
return getDataTable(list);
}
/**
* 查询额度流水列表
*/
@PreAuthorize("@ss.hasPermi('customersupplier:customerinfo:list')")
@GetMapping("/credit/flow/list")
public TableDataInfo creditFlowList(CustomerCreditFlow query)
{
if (query == null || query.getCustomerId() == null || query.getCustomerId() == 0L) {
return getDataTable(Collections.emptyList());
}
startPage();
List<CustomerCreditFlow> list = customerMoneyService.selectCreditFlowList(query);
return getDataTable(list);
}
/**
* 调整客户额度(信用额度/临时额度),调整过程留额度流水
*/
@PreAuthorize("@ss.hasPermi('customer:credit:adjust')")
@Log(title = "客户额度调整", businessType = BusinessType.UPDATE)
@PostMapping("/credit/adjust")
public AjaxResult adjustCredit(@RequestBody CustomerCreditFlow flow)
{
flow.setCreateBy(getUsername());
flow.setOperatorId(getUserId());
return toAjax(customerMoneyService.adjustCredit(flow));
}
}