挂账需求
This commit is contained in:
@@ -0,0 +1,97 @@
|
||||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.log.annotation.OperationLog;
|
||||
import com.czg.order.dto.CreditBuyerDTO;
|
||||
import com.czg.order.param.CreditBuyerQueryParam;
|
||||
import com.czg.order.param.CreditBuyerRepaymentParam;
|
||||
import com.czg.order.service.CreditBuyerService;
|
||||
import com.czg.order.vo.CreditBuyerRepaymentVo;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.utils.AssertUtil;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
/**
|
||||
* 挂账人
|
||||
*
|
||||
* @author Tankaikai tankaikai@aliyun.com
|
||||
* @since 1.0 2025-03-04
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/admin/order/credit/buyer")
|
||||
public class CreditBuyerController {
|
||||
private final CreditBuyerService creditBuyerService;
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*/
|
||||
@GetMapping("page")
|
||||
@OperationLog("挂账人-分页")
|
||||
//@SaAdminCheckPermission("creditBuyer:page")
|
||||
public CzgResult<Page<CreditBuyerDTO>> getCreditBuyerPage(CreditBuyerQueryParam param) {
|
||||
Page<CreditBuyerDTO> data = creditBuyerService.getCreditBuyerPage(param);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
* param id 挂账人id
|
||||
*/
|
||||
@GetMapping("{id}")
|
||||
@OperationLog("挂账人-详情")
|
||||
//@SaAdminCheckPermission("creditBuyer:info")
|
||||
public CzgResult<CreditBuyerDTO> getCreditBuyerById(@PathVariable("id") String id) {
|
||||
AssertUtil.isNull(id, "{}不能为空", "id");
|
||||
CreditBuyerDTO data = creditBuyerService.getCreditBuyerById(id);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@PostMapping
|
||||
@OperationLog("挂账人-新增")
|
||||
//@SaAdminCheckPermission("creditBuyer:add")
|
||||
public CzgResult<Void> addCreditBuyer(@RequestBody CreditBuyerDTO dto) {
|
||||
creditBuyerService.addCreditBuyer(dto);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@PutMapping
|
||||
@OperationLog("挂账人-修改")
|
||||
//@SaAdminCheckPermission("creditBuyer:update")
|
||||
public CzgResult<Void> updateCreditBuyer(@RequestBody CreditBuyerDTO dto) {
|
||||
creditBuyerService.updateCreditBuyer(dto);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param id 挂账人id
|
||||
*/
|
||||
@DeleteMapping("{id}")
|
||||
@OperationLog("挂账人-删除")
|
||||
//@SaAdminCheckPermission("creditBuyer:delete")
|
||||
public CzgResult<Void> deleteCreditBuyer(@PathVariable("id") String id) {
|
||||
//效验数据
|
||||
AssertUtil.isNull(id, "{}不能为空", "id");
|
||||
creditBuyerService.deleteCreditBuyer(id);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
@PostMapping("repayment")
|
||||
@OperationLog("挂账人-还款")
|
||||
//@SaAdminCheckPermission("creditBuyer:repayment")
|
||||
public CzgResult<CreditBuyerRepaymentVo> repayment(@RequestBody CreditBuyerRepaymentParam param) {
|
||||
CreditBuyerRepaymentVo data = creditBuyerService.repayment(param);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.log.annotation.OperationLog;
|
||||
import com.czg.order.dto.CreditBuyerOrderDTO;
|
||||
import com.czg.order.entity.CreditPaymentRecord;
|
||||
import com.czg.order.param.CreditBuyerOrderQueryParam;
|
||||
import com.czg.order.service.CreditBuyerOrderService;
|
||||
import com.czg.order.vo.CreditBuyerOrderSummaryVo;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
/**
|
||||
* 挂账账单
|
||||
*
|
||||
* @author Tankaikai tankaikai@aliyun.com
|
||||
* @since 1.0 2025-03-04
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/admin/order/credit/buyerOrder")
|
||||
public class CreditBuyerOrderController {
|
||||
private final CreditBuyerOrderService creditBuyerOrderService;
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*/
|
||||
@GetMapping("page")
|
||||
@OperationLog("挂账账单-分页")
|
||||
//@SaAdminCheckPermission("creditBuyerOrder:page")
|
||||
public CzgResult<Page<CreditBuyerOrderDTO>> getCreditBuyerOrderPage(CreditBuyerOrderQueryParam param) {
|
||||
Page<CreditBuyerOrderDTO> data = creditBuyerOrderService.getCreditBuyerOrderPage(param);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 付款
|
||||
*/
|
||||
@PostMapping("pay")
|
||||
@OperationLog("挂账账单-付款")
|
||||
//@SaAdminCheckPermission("creditBuyerOrder:pay")
|
||||
public CzgResult<Void> pay(@RequestBody CreditPaymentRecord record) {
|
||||
creditBuyerOrderService.pay(record);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计
|
||||
*/
|
||||
@GetMapping("summary")
|
||||
@OperationLog("挂账账单-统计")
|
||||
//@SaAdminCheckPermission("creditBuyerOrder:summary")
|
||||
public CzgResult<CreditBuyerOrderSummaryVo> summary(CreditBuyerOrderQueryParam param) {
|
||||
CreditBuyerOrderSummaryVo data = creditBuyerOrderService.summary(param);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.log.annotation.OperationLog;
|
||||
import com.czg.order.dto.CreditPaymentRecordDTO;
|
||||
import com.czg.order.param.CreditPaymentRecordQueryParam;
|
||||
import com.czg.order.service.CreditPaymentRecordService;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
||||
/**
|
||||
* 挂账账单付款记录
|
||||
*
|
||||
* @author Tankaikai tankaikai@aliyun.com
|
||||
* @since 1.0 2025-03-04
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/admin/order/credit/paymentRecord")
|
||||
public class CreditPaymentRecordController {
|
||||
private final CreditPaymentRecordService creditPaymentRecordService;
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*/
|
||||
@GetMapping("page")
|
||||
@OperationLog("挂账账单付款记录-分页")
|
||||
//@SaAdminCheckPermission("creditPaymentRecord:page")
|
||||
public CzgResult<Page<CreditPaymentRecordDTO>> getCreditPaymentRecordPage(CreditPaymentRecordQueryParam param) {
|
||||
Page<CreditPaymentRecordDTO> data = creditPaymentRecordService.getCreditPaymentRecordPage(param);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user