| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- package com.sckw.freight.controller;
- import com.sckw.freight.model.dto.PayIndex;
- import com.sckw.freight.model.vo.request.RequestLedgerLogisticsPageInfo;
- import com.sckw.freight.model.vo.request.RequestSaveLedgerLogisticsInfo;
- import com.sckw.freight.model.vo.response.ResponseKllOrderTask;
- import com.sckw.freight.model.vo.response.ResponseLedgerLogistics;
- import com.sckw.freight.model.vo.response.ResponseLedgerLogisticsStatistics;
- import com.sckw.freight.model.vo.response.ResponsePageData;
- import com.sckw.freight.service.freight.IKwpLedgerLogisticsService;
- import com.sckw.freight.util.R;
- import io.swagger.v3.oas.annotations.Operation;
- import io.swagger.v3.oas.annotations.Parameter;
- import io.swagger.v3.oas.annotations.Parameters;
- import io.swagger.v3.oas.annotations.tags.Tag;
- import lombok.extern.slf4j.Slf4j;
- import org.apache.commons.lang3.StringUtils;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- import java.util.List;
- /**
- * @BelongsProject: Freight-Settlement-Backend
- * @BelongsPackage: com.sckw.freight.controller
- * @Author: xj
- * @CreateTime: 2025-01-10 10:18
- * @Description: 对账结算
- * @Version: 1.0
- */
- @RestController
- @RequestMapping("/ledger")
- @CrossOrigin(origins = "*") // 允许所有来源的请求跨域
- @Slf4j
- @Tag(name = "对账结算")
- public class LedgerController {
- @Autowired
- IKwpLedgerLogisticsService iKwpLedgerLogisticsService;
- /**
- * 保存对账结算
- *
- * @return
- */
- @PostMapping("/add")
- @Operation(summary = "新建物流对账单")
- public R<String> add(@RequestBody RequestSaveLedgerLogisticsInfo requestSaveLedgerSettlementInfo) {
- return iKwpLedgerLogisticsService.saveLedgerLogistics(requestSaveLedgerSettlementInfo);
- }
- /**
- * 分页查询对账单
- *
- * @return
- */
- @PostMapping("/list")
- @Operation(summary = "分页查询对账单")
- public R<ResponsePageData<ResponseLedgerLogistics>> list(@RequestBody RequestLedgerLogisticsPageInfo requestPageInfo) {
- return iKwpLedgerLogisticsService.queryLedgerLogistics(requestPageInfo);
- }
- /**
- * 根据对账单id查询运单列表信息
- *
- * @return
- */
- @GetMapping("/queryOrderTaskListByLedgerLogisticsId")
- @Operation(summary = "根据对账单id查询运单列表信息")
- @Parameters(value = {
- @Parameter(name = "ledgerLogisticsId", description = "对账单id"),
- @Parameter(name = "entId", description = "企业id")
- })
- public R<List<ResponseKllOrderTask>> queryOrderTaskListByLedgerLogisticsId(
- @RequestParam(value = "ledgerLogisticsId", required = true) Long ledgerLogisticsId,
- @RequestParam(value = "entId", required = true) Long entId) {
- return iKwpLedgerLogisticsService.queryOrderTaskListByLedgerLogisticsId(ledgerLogisticsId, entId);
- }
- @GetMapping("/queryLedgerLogisticsStatistics")
- @Operation(summary = "物流对账单-统计信息")
- @Parameters(value = {
- @Parameter(name = "entId", description = "企业id")
- })
- public R<ResponseLedgerLogisticsStatistics> queryLedgerLogisticsStatistics(@RequestParam(value = "entId") String entId) {
- //非数字则置空
- if(!StringUtils.isNumeric(entId)){
- entId=null;
- }
- return iKwpLedgerLogisticsService.queryLedgerLogisticsStatistics(entId );
- }
- /**
- * @description: 申请收款
- * @author: xj
- * @date: 2025/1/14 星期二 10:47
- * @param:
- * @return: null
- **/
- @GetMapping("/applyPayment")
- @Operation(summary = "物流对账单-申请收款")
- @Parameters(value = {
- @Parameter(name = "ledgerLogisticsId", description = "对账单id"),
- @Parameter(name = "entId", description = "企业id")
- })
- public R<PayIndex> applyPayment(
- @RequestParam(value = "ledgerLogisticsId", required = true) Long ledgerLogisticsId,
- @RequestParam(value = "entId", required = true) String entId) {
- if (StringUtils.isBlank(entId)|| !StringUtils.isNumeric(entId)) return R.failed("企业id不能为空");
- Long dEntId = Long.valueOf(entId);
- return iKwpLedgerLogisticsService.applyPayment(ledgerLogisticsId, dEntId);
- }
- }
|