Compare commits
2 Commits
3c2cb917c5
...
596ec6d7fd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
596ec6d7fd | ||
|
|
88b5994fb4 |
@ -2,10 +2,8 @@ package com.xunhong.erp.turbo.admin.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.Response;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.xunhong.erp.turbo.api.biz.api.OrderSupplierServiceI;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.OrderSupplierBatchInvoiceUploadCmd;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.OrderSupplierUpdateCmd;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.qry.OrderSupplierPageQry;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.vo.OrderSupplierVO;
|
||||
@ -62,13 +60,4 @@ public class OrderSupplierController {
|
||||
public SingleResponse<OrderSupplierVO> updateOrderSupplier(@RequestBody @Validated OrderSupplierUpdateCmd orderSupplierUpdateCmd) {
|
||||
return SingleResponse.of(orderSupplierService.update(orderSupplierUpdateCmd));
|
||||
}
|
||||
|
||||
@SaCheckLogin
|
||||
// @SaCheckPermission(value = {PermissionConstant.MDB_BUSINESS_ORDER_SUPPLIER_BATCH_INVOICE_UPLOAD})
|
||||
@PostMapping("batchUploadInvoice")
|
||||
@Operation(summary = "批量上传供应商发票", method = "POST")
|
||||
public Response batchUploadInvoice(@RequestBody @Validated OrderSupplierBatchInvoiceUploadCmd batchInvoiceUploadCmd) {
|
||||
orderSupplierService.batchUploadInvoice(batchInvoiceUploadCmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,79 @@
|
||||
package com.xunhong.erp.turbo.admin.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import com.alibaba.cola.dto.MultiResponse;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.Response;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.xunhong.erp.turbo.api.biz.api.SupplierInvoiceServiceI;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.SupplierInvoiceCreateCmd;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.SupplierInvoiceDestroyCmd;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.SupplierInvoiceUpdateCmd;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.qry.SupplierInvoiceListQry;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.qry.SupplierInvoicePageQry;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.qry.SupplierInvoiceShowQry;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.vo.SupplierInvoiceVO;
|
||||
import com.xunhong.erp.turbo.base.dto.PageDTO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @author shenyifei
|
||||
*/
|
||||
@Tag(name = "SupplierInvoice", description = "瓜农发票管理")
|
||||
@RestController("operationSupplierInvoiceController")
|
||||
@RequestMapping(value = "/operation")
|
||||
@RequiredArgsConstructor
|
||||
public class SupplierInvoiceController {
|
||||
|
||||
@DubboReference(version = "1.0.0")
|
||||
private final SupplierInvoiceServiceI supplierInvoiceService;
|
||||
|
||||
@SaCheckLogin
|
||||
@GetMapping("listSupplierInvoice")
|
||||
@Operation(summary = "瓜农发票列表", method = "GET")
|
||||
public MultiResponse<SupplierInvoiceVO> listSupplierInvoice(@ModelAttribute @Validated SupplierInvoiceListQry supplierInvoiceListQry) {
|
||||
return MultiResponse.of(supplierInvoiceService.list(supplierInvoiceListQry));
|
||||
}
|
||||
|
||||
@SaCheckLogin
|
||||
@PostMapping("createSupplierInvoice")
|
||||
@Operation(summary = "创建发票", method = "POST")
|
||||
public SingleResponse<SupplierInvoiceVO> createSupplierInvoice(@RequestBody @Validated SupplierInvoiceCreateCmd supplierInvoiceCreateCmd) {
|
||||
return SingleResponse.of(supplierInvoiceService.create(supplierInvoiceCreateCmd));
|
||||
}
|
||||
|
||||
@SaCheckLogin
|
||||
@GetMapping("showSupplierInvoice")
|
||||
@Operation(summary = "瓜农发票详情", method = "GET")
|
||||
public SingleResponse<SupplierInvoiceVO> showSupplierInvoice(@ModelAttribute @Validated SupplierInvoiceShowQry supplierInvoiceShowQry) {
|
||||
return SingleResponse.of(supplierInvoiceService.show(supplierInvoiceShowQry));
|
||||
}
|
||||
|
||||
@SaCheckLogin
|
||||
@GetMapping("pageSupplierInvoice")
|
||||
@Operation(summary = "瓜农发票列表", method = "GET")
|
||||
public PageResponse<SupplierInvoiceVO> pageSupplierInvoice(@ModelAttribute @Validated SupplierInvoicePageQry supplierInvoicePageQry) {
|
||||
PageDTO<SupplierInvoiceVO> page = supplierInvoiceService.page(supplierInvoicePageQry);
|
||||
return PageResponse.of(page.getRecords(), (int) page.getTotal(), (int) page.getSize(), (int) page.getCurrent());
|
||||
}
|
||||
|
||||
@SaCheckLogin
|
||||
@RequestMapping(value = "updateSupplierInvoice", method = {RequestMethod.PATCH, RequestMethod.PUT})
|
||||
@Operation(summary = "瓜农发票更新", method = "PATCH")
|
||||
public SingleResponse<SupplierInvoiceVO> updateSupplierInvoice(@RequestBody @Validated SupplierInvoiceUpdateCmd invoiceUpdateCmd) {
|
||||
return SingleResponse.of(supplierInvoiceService.update(invoiceUpdateCmd));
|
||||
}
|
||||
|
||||
@SaCheckLogin
|
||||
@DeleteMapping("destroySupplierInvoice")
|
||||
@Operation(summary = "瓜农发票删除", method = "DELETE")
|
||||
public Response destroySupplierInvoice(@RequestBody @Validated SupplierInvoiceDestroyCmd supplierInvoiceDestroyCmd) {
|
||||
supplierInvoiceService.destroy(supplierInvoiceDestroyCmd);
|
||||
return Response.buildSuccess();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package com.xunhong.erp.turbo.biz.app.assembler;
|
||||
|
||||
import com.xunhong.erp.turbo.api.biz.dto.vo.SupplierInvoiceVO;
|
||||
import com.xunhong.erp.turbo.biz.domain.entity.SupplierInvoice;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.NullValueCheckStrategy;
|
||||
|
||||
/**
|
||||
* @author shenyifei
|
||||
*/
|
||||
@Mapper(componentModel = "spring", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
|
||||
public interface SupplierInvoiceAssembler {
|
||||
|
||||
SupplierInvoiceVO toInvoiceVO(SupplierInvoice supplierInvoice);
|
||||
}
|
||||
@ -1,29 +0,0 @@
|
||||
package com.xunhong.erp.turbo.biz.app.executor.cmd;
|
||||
|
||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.OrderSupplierBatchInvoiceUploadCmd;
|
||||
import com.xunhong.erp.turbo.biz.domain.gateway.OrderSupplierGateway;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 订单供应商批量上传发票执行器
|
||||
*
|
||||
* @author claude
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class OrderSupplierBatchInvoiceUploadCmdExe {
|
||||
|
||||
private final OrderSupplierGateway orderSupplierGateway;
|
||||
|
||||
/**
|
||||
* 执行批量上传发票
|
||||
*
|
||||
* @param orderSupplierBatchInvoiceUploadCmd 批量上传发票命令
|
||||
*/
|
||||
public void execute(OrderSupplierBatchInvoiceUploadCmd orderSupplierBatchInvoiceUploadCmd) {
|
||||
orderSupplierGateway.batchInvoiceUpload(orderSupplierBatchInvoiceUploadCmd);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
package com.xunhong.erp.turbo.biz.app.executor.cmd;
|
||||
|
||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.SupplierInvoiceCreateCmd;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.vo.SupplierInvoiceVO;
|
||||
import com.xunhong.erp.turbo.biz.app.assembler.SupplierInvoiceAssembler;
|
||||
import com.xunhong.erp.turbo.biz.domain.entity.SupplierInvoice;
|
||||
import com.xunhong.erp.turbo.biz.domain.gateway.SupplierInvoiceGateway;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author shenyifei
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class SupplierInvoiceCreateCmdExe {
|
||||
|
||||
private final SupplierInvoiceAssembler supplierInvoiceAssembler;
|
||||
private final SupplierInvoiceGateway supplierInvoiceGateway;
|
||||
|
||||
public SupplierInvoiceVO execute(SupplierInvoiceCreateCmd supplierInvoiceCreateCmd) {
|
||||
SupplierInvoice supplierInvoice = supplierInvoiceGateway.save(supplierInvoiceCreateCmd);
|
||||
|
||||
return supplierInvoiceAssembler.toInvoiceVO(supplierInvoice);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,22 @@
|
||||
package com.xunhong.erp.turbo.biz.app.executor.cmd;
|
||||
|
||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.SupplierInvoiceDestroyCmd;
|
||||
import com.xunhong.erp.turbo.biz.domain.gateway.SupplierInvoiceGateway;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author shenyifei
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class SupplierInvoiceDestroyCmdExe {
|
||||
private final SupplierInvoiceGateway supplierInvoiceGateway;
|
||||
|
||||
public void execute(SupplierInvoiceDestroyCmd supplierInvoiceDestroyCmd) {
|
||||
supplierInvoiceGateway.destroy(supplierInvoiceDestroyCmd);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,27 @@
|
||||
package com.xunhong.erp.turbo.biz.app.executor.cmd;
|
||||
|
||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.SupplierInvoiceUpdateCmd;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.vo.SupplierInvoiceVO;
|
||||
import com.xunhong.erp.turbo.biz.app.assembler.SupplierInvoiceAssembler;
|
||||
import com.xunhong.erp.turbo.biz.domain.entity.SupplierInvoice;
|
||||
import com.xunhong.erp.turbo.biz.domain.gateway.SupplierInvoiceGateway;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author shenyifei
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class SupplierInvoiceUpdateCmdExe {
|
||||
|
||||
private final SupplierInvoiceAssembler supplierInvoiceAssembler;
|
||||
private final SupplierInvoiceGateway supplierInvoiceGateway;
|
||||
|
||||
public SupplierInvoiceVO execute(SupplierInvoiceUpdateCmd invoiceUpdateCmd) {
|
||||
SupplierInvoice supplierInvoice = supplierInvoiceGateway.update(invoiceUpdateCmd);
|
||||
return supplierInvoiceAssembler.toInvoiceVO(supplierInvoice);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package com.xunhong.erp.turbo.biz.app.executor.query;
|
||||
|
||||
import com.xunhong.erp.turbo.api.biz.dto.qry.SupplierInvoiceListQry;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.vo.SupplierInvoiceVO;
|
||||
import com.xunhong.erp.turbo.biz.app.assembler.SupplierInvoiceAssembler;
|
||||
import com.xunhong.erp.turbo.biz.domain.entity.SupplierInvoice;
|
||||
import com.xunhong.erp.turbo.biz.domain.gateway.SupplierInvoiceGateway;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author shenyifei
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class SupplierInvoiceListQryExe {
|
||||
|
||||
private final SupplierInvoiceGateway supplierInvoiceGateway;
|
||||
private final SupplierInvoiceAssembler supplierInvoiceAssembler;
|
||||
|
||||
public List<SupplierInvoiceVO> execute(SupplierInvoiceListQry supplierInvoiceListQry) {
|
||||
List<SupplierInvoice> supplierInvoiceList = supplierInvoiceGateway.list(supplierInvoiceListQry);
|
||||
return supplierInvoiceList.stream().map(supplierInvoiceAssembler::toInvoiceVO).toList();
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,29 @@
|
||||
package com.xunhong.erp.turbo.biz.app.executor.query;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.qry.SupplierInvoicePageQry;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.vo.SupplierInvoiceVO;
|
||||
import com.xunhong.erp.turbo.biz.app.assembler.SupplierInvoiceAssembler;
|
||||
import com.xunhong.erp.turbo.biz.domain.entity.SupplierInvoice;
|
||||
import com.xunhong.erp.turbo.biz.domain.gateway.SupplierInvoiceGateway;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author shenyifei
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class SupplierInvoicePageQryExe {
|
||||
|
||||
private final SupplierInvoiceGateway supplierInvoiceGateway;
|
||||
private final SupplierInvoiceAssembler supplierInvoiceAssembler;
|
||||
|
||||
public IPage<SupplierInvoiceVO> execute(SupplierInvoicePageQry supplierInvoicePageQry) {
|
||||
IPage<SupplierInvoice> page = supplierInvoiceGateway.page(supplierInvoicePageQry);
|
||||
return page.convert(supplierInvoiceAssembler::toInvoiceVO);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,29 @@
|
||||
package com.xunhong.erp.turbo.biz.app.executor.query;
|
||||
|
||||
import com.xunhong.erp.turbo.api.biz.dto.qry.SupplierInvoiceShowQry;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.vo.SupplierInvoiceVO;
|
||||
import com.xunhong.erp.turbo.biz.app.assembler.SupplierInvoiceAssembler;
|
||||
import com.xunhong.erp.turbo.biz.domain.entity.SupplierInvoice;
|
||||
import com.xunhong.erp.turbo.biz.domain.gateway.SupplierInvoiceGateway;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author shenyifei
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class SupplierInvoiceShowQryExe {
|
||||
|
||||
private final SupplierInvoiceAssembler supplierInvoiceAssembler;
|
||||
private final SupplierInvoiceGateway supplierInvoiceGateway;
|
||||
|
||||
public SupplierInvoiceVO execute(SupplierInvoiceShowQry supplierInvoiceShowQry) {
|
||||
SupplierInvoice supplierInvoice = supplierInvoiceGateway.show(supplierInvoiceShowQry);
|
||||
|
||||
return supplierInvoiceAssembler.toInvoiceVO(supplierInvoice);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,12 +1,10 @@
|
||||
package com.xunhong.erp.turbo.biz.app.service;
|
||||
|
||||
import com.xunhong.erp.turbo.api.biz.api.OrderSupplierServiceI;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.OrderSupplierBatchInvoiceUploadCmd;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.OrderSupplierUpdateCmd;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.qry.OrderSupplierPageQry;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.vo.OrderSupplierVO;
|
||||
import com.xunhong.erp.turbo.base.dto.PageDTO;
|
||||
import com.xunhong.erp.turbo.biz.app.executor.cmd.OrderSupplierBatchInvoiceUploadCmdExe;
|
||||
import com.xunhong.erp.turbo.biz.app.executor.cmd.OrderSupplierUpdateCmdExe;
|
||||
import com.xunhong.erp.turbo.biz.app.executor.query.OrderSupplierPageQryExe;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@ -24,7 +22,6 @@ import org.springframework.stereotype.Service;
|
||||
public class OrderSupplierServiceImpl implements OrderSupplierServiceI {
|
||||
|
||||
private final OrderSupplierUpdateCmdExe orderSupplierUpdateCmdExe;
|
||||
private final OrderSupplierBatchInvoiceUploadCmdExe orderSupplierBatchInvoiceUploadCmdExe;
|
||||
private final OrderSupplierPageQryExe orderSupplierPageQryExe;
|
||||
|
||||
|
||||
@ -38,10 +35,5 @@ public class OrderSupplierServiceImpl implements OrderSupplierServiceI {
|
||||
public OrderSupplierVO update(OrderSupplierUpdateCmd orderSupplierUpdateCmd) {
|
||||
return orderSupplierUpdateCmdExe.execute(orderSupplierUpdateCmd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void batchUploadInvoice(OrderSupplierBatchInvoiceUploadCmd batchInvoiceUploadCmd) {
|
||||
orderSupplierBatchInvoiceUploadCmdExe.execute(batchInvoiceUploadCmd);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,71 @@
|
||||
package com.xunhong.erp.turbo.biz.app.service;
|
||||
|
||||
import com.xunhong.erp.turbo.api.biz.api.SupplierInvoiceServiceI;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.SupplierInvoiceCreateCmd;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.SupplierInvoiceDestroyCmd;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.SupplierInvoiceUpdateCmd;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.qry.SupplierInvoiceListQry;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.qry.SupplierInvoicePageQry;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.qry.SupplierInvoiceShowQry;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.vo.SupplierInvoiceVO;
|
||||
import com.xunhong.erp.turbo.base.dto.PageDTO;
|
||||
import com.xunhong.erp.turbo.biz.app.executor.cmd.SupplierInvoiceCreateCmdExe;
|
||||
import com.xunhong.erp.turbo.biz.app.executor.cmd.SupplierInvoiceDestroyCmdExe;
|
||||
import com.xunhong.erp.turbo.biz.app.executor.cmd.SupplierInvoiceUpdateCmdExe;
|
||||
import com.xunhong.erp.turbo.biz.app.executor.query.SupplierInvoiceListQryExe;
|
||||
import com.xunhong.erp.turbo.biz.app.executor.query.SupplierInvoicePageQryExe;
|
||||
import com.xunhong.erp.turbo.biz.app.executor.query.SupplierInvoiceShowQryExe;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author shenyifei
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@DubboService(interfaceClass = SupplierInvoiceServiceI.class, version = "1.0.0")
|
||||
@RequiredArgsConstructor
|
||||
public class SupplierInvoiceServiceImpl implements SupplierInvoiceServiceI {
|
||||
|
||||
private final SupplierInvoiceCreateCmdExe supplierInvoiceCreateCmdExe;
|
||||
private final SupplierInvoiceUpdateCmdExe supplierInvoiceUpdateCmdExe;
|
||||
private final SupplierInvoicePageQryExe supplierInvoicePageQryExe;
|
||||
private final SupplierInvoiceListQryExe supplierInvoiceListQryExe;
|
||||
private final SupplierInvoiceShowQryExe supplierInvoiceShowQryExe;
|
||||
private final SupplierInvoiceDestroyCmdExe supplierInvoiceDestroyCmdExe;
|
||||
|
||||
@Override
|
||||
public SupplierInvoiceVO create(SupplierInvoiceCreateCmd supplierInvoiceCreateCmd) {
|
||||
return supplierInvoiceCreateCmdExe.execute(supplierInvoiceCreateCmd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageDTO<SupplierInvoiceVO> page(SupplierInvoicePageQry supplierInvoicePageQry) {
|
||||
return PageDTO.of(supplierInvoicePageQryExe.execute(supplierInvoicePageQry));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SupplierInvoiceVO> list(SupplierInvoiceListQry supplierInvoiceListQry) {
|
||||
return supplierInvoiceListQryExe.execute(supplierInvoiceListQry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SupplierInvoiceVO update(SupplierInvoiceUpdateCmd invoiceUpdateCmd) {
|
||||
return supplierInvoiceUpdateCmdExe.execute(invoiceUpdateCmd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SupplierInvoiceVO show(SupplierInvoiceShowQry supplierInvoiceShowQry) {
|
||||
return supplierInvoiceShowQryExe.execute(supplierInvoiceShowQry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy(SupplierInvoiceDestroyCmd supplierInvoiceDestroyCmd) {
|
||||
supplierInvoiceDestroyCmdExe.execute(supplierInvoiceDestroyCmd);
|
||||
}
|
||||
}
|
||||
|
||||
@ -156,7 +156,12 @@ public class OrderSupplier extends DTO {
|
||||
private Boolean invoiceUpload;
|
||||
|
||||
/**
|
||||
* 发票
|
||||
* 供应商发票ID
|
||||
*/
|
||||
private Long invoiceId;
|
||||
|
||||
/**
|
||||
* 发票图片(支持多张)
|
||||
*/
|
||||
private List<UploadFileItem> invoiceImg;
|
||||
|
||||
|
||||
@ -0,0 +1,73 @@
|
||||
package com.xunhong.erp.turbo.biz.domain.entity;
|
||||
|
||||
import com.alibaba.cola.domain.Entity;
|
||||
import com.alibaba.cola.dto.DTO;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.common.OrderSupplierInvoice;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.common.UploadFileItem;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.enums.SupplierInvoiceTypeEnum;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author shenyifei
|
||||
*/
|
||||
@Data
|
||||
@Entity
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SupplierInvoice extends DTO {
|
||||
|
||||
/**
|
||||
* 发票ID
|
||||
*/
|
||||
private Long supplierInvoiceId;
|
||||
|
||||
/**
|
||||
* 发票类型:1_瓜农
|
||||
*/
|
||||
private SupplierInvoiceTypeEnum type;
|
||||
|
||||
/**
|
||||
* 发票开具人
|
||||
*/
|
||||
private Long supplierId;
|
||||
|
||||
/**
|
||||
* 发票开具人名称
|
||||
*/
|
||||
private String supplierName;
|
||||
|
||||
/**
|
||||
* 代开发票人的信息
|
||||
*/
|
||||
private List<OrderSupplierInvoice> orderSupplierInvoiceList;
|
||||
|
||||
/**
|
||||
* 发票图片(支持多张)
|
||||
*/
|
||||
private List<UploadFileItem> invoiceImg;
|
||||
|
||||
/**
|
||||
* 登记时间
|
||||
*/
|
||||
private LocalDateTime registrationTime;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private Long createdBy;
|
||||
|
||||
/**
|
||||
* 创建人姓名
|
||||
*/
|
||||
private String createdByName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
}
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
package com.xunhong.erp.turbo.biz.domain.gateway;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.OrderSupplierBatchInvoiceUploadCmd;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.OrderSupplierUpdateCmd;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.qry.OrderSupplierPageQry;
|
||||
import com.xunhong.erp.turbo.biz.domain.entity.OrderSupplier;
|
||||
@ -13,7 +12,5 @@ public interface OrderSupplierGateway {
|
||||
IPage<OrderSupplier> page(OrderSupplierPageQry orderSupplierPageQry);
|
||||
|
||||
OrderSupplier update(OrderSupplierUpdateCmd orderSupplierUpdateCmd);
|
||||
|
||||
void batchInvoiceUpload(OrderSupplierBatchInvoiceUploadCmd cmd);
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,30 @@
|
||||
package com.xunhong.erp.turbo.biz.domain.gateway;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.SupplierInvoiceCreateCmd;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.SupplierInvoiceDestroyCmd;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.SupplierInvoiceUpdateCmd;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.qry.SupplierInvoiceListQry;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.qry.SupplierInvoicePageQry;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.qry.SupplierInvoiceShowQry;
|
||||
import com.xunhong.erp.turbo.biz.domain.entity.SupplierInvoice;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author shenyifei
|
||||
*/
|
||||
public interface SupplierInvoiceGateway {
|
||||
SupplierInvoice save(SupplierInvoiceCreateCmd supplierInvoiceCreateCmd);
|
||||
|
||||
IPage<SupplierInvoice> page(SupplierInvoicePageQry supplierInvoicePageQry);
|
||||
|
||||
List<SupplierInvoice> list(SupplierInvoiceListQry supplierInvoiceListQry);
|
||||
|
||||
SupplierInvoice update(SupplierInvoiceUpdateCmd invoiceUpdateCmd);
|
||||
|
||||
SupplierInvoice show(SupplierInvoiceShowQry supplierInvoiceShowQry);
|
||||
|
||||
void destroy(SupplierInvoiceDestroyCmd supplierInvoiceDestroyCmd);
|
||||
}
|
||||
|
||||
@ -0,0 +1,32 @@
|
||||
package com.xunhong.erp.turbo.biz.infrastructure.convert;
|
||||
|
||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.SupplierInvoiceCreateCmd;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.SupplierInvoiceUpdateCmd;
|
||||
import com.xunhong.erp.turbo.biz.domain.entity.SupplierInvoice;
|
||||
import com.xunhong.erp.turbo.biz.infrastructure.entity.SupplierInvoiceDO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import org.mapstruct.MappingTarget;
|
||||
import org.mapstruct.NullValueCheckStrategy;
|
||||
|
||||
/**
|
||||
* @author shenyifei
|
||||
*/
|
||||
@Mapper(componentModel = "spring", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
|
||||
public interface SupplierInvoiceConvert {
|
||||
|
||||
SupplierInvoice toInvoice(SupplierInvoiceDO supplierInvoiceDO);
|
||||
|
||||
@Mapping(target = "version", ignore = true)
|
||||
@Mapping(target = "updatedAt", ignore = true)
|
||||
@Mapping(target = "isDelete", ignore = true)
|
||||
@Mapping(target = "createdAt", ignore = true)
|
||||
SupplierInvoiceDO toInvoiceDO(SupplierInvoiceCreateCmd supplierInvoiceCreateCmd);
|
||||
|
||||
@Mapping(target = "version", ignore = true)
|
||||
@Mapping(target = "updatedAt", ignore = true)
|
||||
@Mapping(target = "isDelete", ignore = true)
|
||||
@Mapping(target = "createdAt", ignore = true)
|
||||
void toInvoiceDO(@MappingTarget SupplierInvoiceDO supplierInvoiceDO, SupplierInvoiceUpdateCmd invoiceUpdateCmd);
|
||||
}
|
||||
|
||||
@ -183,10 +183,10 @@ public class OrderSupplierDO extends BaseDO<OrderSupplierDO> {
|
||||
private Boolean invoiceUpload;
|
||||
|
||||
/**
|
||||
* 发票
|
||||
* 票证ID
|
||||
*/
|
||||
@TableField(value = "invoice_img", typeHandler = JacksonTypeHandler.class)
|
||||
private List<UploadFileItem> invoiceImg;
|
||||
@TableField(value = "invoice_id")
|
||||
private Long invoiceId;
|
||||
|
||||
/**
|
||||
* 是否上传合同
|
||||
@ -254,4 +254,6 @@ public class OrderSupplierDO extends BaseDO<OrderSupplierDO> {
|
||||
@TableField(exist = false)
|
||||
private OrderStateEnum poState;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<UploadFileItem> invoiceImg;
|
||||
}
|
||||
|
||||
@ -0,0 +1,81 @@
|
||||
package com.xunhong.erp.turbo.biz.infrastructure.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.common.OrderSupplierInvoice;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.common.UploadFileItem;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.enums.SupplierInvoiceTypeEnum;
|
||||
import com.xunhong.erp.turbo.datasource.domain.entity.BaseDO;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author shenyifei
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "supplier_invoice", autoResultMap = true)
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SupplierInvoiceDO extends BaseDO<SupplierInvoiceDO> {
|
||||
|
||||
/**
|
||||
* 发票ID
|
||||
*/
|
||||
@TableId(value = "supplier_invoice_id", type = IdType.ASSIGN_ID)
|
||||
private Long supplierInvoiceId;
|
||||
|
||||
/**
|
||||
* 发票类型:1_瓜农
|
||||
*/
|
||||
@TableField(value = "type")
|
||||
private SupplierInvoiceTypeEnum type;
|
||||
|
||||
/**
|
||||
* 发票开具人
|
||||
*/
|
||||
@TableField(value = "supplier_id")
|
||||
private Long supplierId;
|
||||
|
||||
/**
|
||||
* 发票开具人名称
|
||||
*/
|
||||
@TableField(value = "supplier_name")
|
||||
private String supplierName;
|
||||
|
||||
/**
|
||||
* 代开发票人的信息
|
||||
*/
|
||||
@TableField(value = "order_supplier_invoice", typeHandler = JacksonTypeHandler.class)
|
||||
private List<OrderSupplierInvoice> orderSupplierInvoiceList;
|
||||
|
||||
/**
|
||||
* 发票图片(支持多张)
|
||||
*/
|
||||
@TableField(value = "invoice_img", typeHandler = JacksonTypeHandler.class)
|
||||
private List<UploadFileItem> invoiceImg;
|
||||
|
||||
/**
|
||||
* 登记时间
|
||||
*/
|
||||
@TableField(value = "registration_time")
|
||||
private LocalDateTime registrationTime;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
@TableField(value = "created_by")
|
||||
private Long createdBy;
|
||||
|
||||
/**
|
||||
* 创建人姓名
|
||||
*/
|
||||
@TableField(value = "created_by_name")
|
||||
private String createdByName;
|
||||
|
||||
}
|
||||
|
||||
@ -23,10 +23,7 @@ import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -69,6 +66,7 @@ public class OrderGatewayImpl implements OrderGateway {
|
||||
private final SupplierConvert supplierConvert;
|
||||
|
||||
private final DealerMapper dealerMapper;
|
||||
private final SupplierInvoiceMapper supplierInvoiceMapper;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@ -174,8 +172,15 @@ public class OrderGatewayImpl implements OrderGateway {
|
||||
|
||||
orderDO.setOrderPackageDOList(orderPackageDOList.stream().filter(orderPackageDO -> Objects.isNull(orderPackageDO.getOrderSupplierId())).toList());
|
||||
|
||||
Set<Long> invoiceIdList = orderSupplierDOList.stream().map(OrderSupplierDO::getInvoiceId).collect(Collectors.toSet());
|
||||
List<SupplierInvoiceDO> supplierInvoiceDOList = supplierInvoiceMapper.selectByIds(invoiceIdList);
|
||||
Map<Long, SupplierInvoiceDO> supplierInvoiceDOMap = supplierInvoiceDOList.stream().collect(Collectors.toMap(SupplierInvoiceDO::getSupplierInvoiceId, Function.identity()));
|
||||
|
||||
if (CollUtil.isNotEmpty(orderSupplierIdList)) {
|
||||
orderSupplierDOList.forEach(orderSupplierDO -> {
|
||||
if (Objects.nonNull(orderSupplierDO.getInvoiceId())) {
|
||||
orderSupplierDO.setInvoiceImg(supplierInvoiceDOMap.get(orderSupplierDO.getInvoiceId()).getInvoiceImg());
|
||||
}
|
||||
orderSupplierDO.setOrderPackageDOList(orderPackageDOList.stream().filter(orderPackageDO -> orderSupplierDO.getOrderSupplierId().equals(orderPackageDO.getOrderSupplierId())).toList());
|
||||
});
|
||||
}
|
||||
@ -855,6 +860,22 @@ public class OrderGatewayImpl implements OrderGateway {
|
||||
}
|
||||
}
|
||||
|
||||
// 第四步处理发票
|
||||
if (orderStep2Cmd.getActive() == 5) {
|
||||
// 查找对应的更新数据
|
||||
OrderSupplier updatedSupplier = updatedSuppliers.stream()
|
||||
.filter(s -> (s.getOrderSupplierId() != null && s.getOrderSupplierId().equals(supplierDO.getOrderSupplierId()))
|
||||
|| (s.getOrderSupplierId() == null && supplierDO.getOrderSupplierId() != null
|
||||
&& s.getSupplierId().equals(supplierDO.getSupplierId())))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
|
||||
if (updatedSupplier != null) {
|
||||
// 处理发票信息
|
||||
handleInvoiceInfo(supplierDO, updatedSupplier, orderStep2Cmd);
|
||||
}
|
||||
}
|
||||
|
||||
if (LoadingModeEnum.FRAME_WITH_NET.equals(supplierDO.getLoadingMode())) {
|
||||
// 如果是搭架子+网垫,则删除所有包材信息
|
||||
LambdaQueryWrapper<OrderPackageDO> packageDeleteWrapper = Wrappers.lambdaQuery(OrderPackageDO.class);
|
||||
@ -864,6 +885,122 @@ public class OrderGatewayImpl implements OrderGateway {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理供应商发票信息
|
||||
* 逻辑:
|
||||
* 1. 如果前端传了invoiceId且与数据库不一致 → 删除旧发票记录
|
||||
* 2. 如果前端传了invoiceImg → 更新/新增发票记录
|
||||
* 3. 如果前端既没传invoiceId也没传invoiceImg且数据库有发票 → 删除发票记录
|
||||
*
|
||||
* @param supplierDO 数据库中的供应商信息
|
||||
* @param updatedSupplier 前端传来的供应商信息
|
||||
* @param orderStep2Cmd 订单第二步命令
|
||||
*/
|
||||
private void handleInvoiceInfo(OrderSupplierDO supplierDO, OrderSupplier updatedSupplier, OrderStep2Cmd orderStep2Cmd) {
|
||||
Long dbInvoiceId = supplierDO.getInvoiceId();
|
||||
Long frontendInvoiceId = updatedSupplier.getInvoiceId();
|
||||
List<UploadFileItem> frontendInvoiceImg = updatedSupplier.getInvoiceImg();
|
||||
|
||||
// 判断是否有发票图片传入
|
||||
boolean hasInvoiceImg = CollUtil.isNotEmpty(frontendInvoiceImg);
|
||||
|
||||
// 场景1:前端传了invoiceId,且与数据库中的invoiceId不一致
|
||||
if (frontendInvoiceId != null && !frontendInvoiceId.equals(dbInvoiceId)) {
|
||||
// 删除旧的发票记录
|
||||
if (dbInvoiceId != null) {
|
||||
supplierInvoiceMapper.deleteById(dbInvoiceId);
|
||||
}
|
||||
// 更新OrderSupplierDO的invoiceId为新的
|
||||
supplierDO.setInvoiceId(frontendInvoiceId);
|
||||
}
|
||||
// 场景2:前端传了发票图片
|
||||
else if (hasInvoiceImg) {
|
||||
// 如果没有invoiceId,需要新增SupplierInvoice记录
|
||||
if (frontendInvoiceId == null) {
|
||||
// 创建新的发票记录
|
||||
SupplierInvoiceDO newInvoice = new SupplierInvoiceDO();
|
||||
newInvoice.setType(SupplierInvoiceTypeEnum.FARMER);
|
||||
newInvoice.setSupplierId(supplierDO.getSupplierId());
|
||||
newInvoice.setSupplierName(supplierDO.getName());
|
||||
newInvoice.setInvoiceImg(frontendInvoiceImg);
|
||||
newInvoice.setCreatedBy(orderStep2Cmd.getCreatedBy());
|
||||
newInvoice.setCreatedByName(orderStep2Cmd.getCreatedByName());
|
||||
|
||||
// 构建 orderSupplierInvoice 列表
|
||||
List<OrderSupplierInvoice> orderSupplierInvoiceList = buildOrderSupplierInvoiceList(supplierDO);
|
||||
newInvoice.setOrderSupplierInvoiceList(orderSupplierInvoiceList);
|
||||
|
||||
supplierInvoiceMapper.insert(newInvoice);
|
||||
|
||||
// 更新OrderSupplierDO的invoiceId
|
||||
supplierDO.setInvoiceId(newInvoice.getSupplierInvoiceId());
|
||||
} else {
|
||||
// 如果有invoiceId,更新对应的SupplierInvoice记录
|
||||
SupplierInvoiceDO existingInvoice = supplierInvoiceMapper.selectById(frontendInvoiceId);
|
||||
if (existingInvoice != null) {
|
||||
existingInvoice.setInvoiceImg(frontendInvoiceImg);
|
||||
supplierInvoiceMapper.updateById(existingInvoice);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 场景3:前端既没传invoiceId也没传invoiceImg,且数据库有发票
|
||||
else if (frontendInvoiceId == null && !hasInvoiceImg && dbInvoiceId != null) {
|
||||
// 删除原发票记录
|
||||
supplierInvoiceMapper.deleteById(dbInvoiceId);
|
||||
// 将OrderSupplierDO的invoiceId设为null
|
||||
supplierDO.setInvoiceId(null);
|
||||
}
|
||||
|
||||
// 最后更新OrderSupplierDO
|
||||
orderSupplierMapper.updateById(supplierDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建供应商发票信息列表
|
||||
* 从 OrderSupplierDO 中提取相关信息构建 OrderSupplierInvoice
|
||||
*
|
||||
* @param supplierDO 供应商信息
|
||||
* @return OrderSupplierInvoice 列表
|
||||
*/
|
||||
private List<OrderSupplierInvoice> buildOrderSupplierInvoiceList(OrderSupplierDO supplierDO) {
|
||||
List<OrderSupplierInvoice> invoiceList = new ArrayList<>();
|
||||
|
||||
// 查询订单车辆信息获取车次号
|
||||
OrderVehicleDO orderVehicleDO = orderVehicleMapper.selectOne(
|
||||
Wrappers.lambdaQuery(OrderVehicleDO.class)
|
||||
.eq(OrderVehicleDO::getOrderId, supplierDO.getOrderId())
|
||||
);
|
||||
|
||||
// 查询订单经销商信息
|
||||
OrderDealerDO orderDealerDO = orderDealerMapper.selectOne(
|
||||
Wrappers.lambdaQuery(OrderDealerDO.class)
|
||||
.eq(OrderDealerDO::getOrderId, supplierDO.getOrderId())
|
||||
);
|
||||
|
||||
// 构建 OrderSupplierInvoice 对象
|
||||
OrderSupplierInvoice invoice = new OrderSupplierInvoice();
|
||||
invoice.setOrderSupplierId(supplierDO.getOrderSupplierId());
|
||||
invoice.setOrderId(supplierDO.getOrderId());
|
||||
invoice.setSupplierId(supplierDO.getSupplierId());
|
||||
invoice.setName(supplierDO.getName());
|
||||
invoice.setType(supplierDO.getType());
|
||||
invoice.setInvoiceAmount(supplierDO.getInvoiceAmount());
|
||||
|
||||
// 设置车辆信息
|
||||
if (orderVehicleDO != null) {
|
||||
invoice.setVehicleNo(orderVehicleDO.getVehicleNo());
|
||||
}
|
||||
|
||||
// 设置经销商信息
|
||||
if (orderDealerDO != null) {
|
||||
invoice.setDealerId(orderDealerDO.getDealerId());
|
||||
invoice.setDealerName(orderDealerDO.getShortName());
|
||||
}
|
||||
|
||||
invoiceList.add(invoice);
|
||||
return invoiceList;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void saveStep3(OrderStep3Cmd orderStep3Cmd) {
|
||||
@ -944,7 +1081,8 @@ public class OrderGatewayImpl implements OrderGateway {
|
||||
|
||||
DealerDO dealerDO = dealerMapper.selectById(lastVehicleNoQry.getDealerId());
|
||||
|
||||
if (dealerDO.getSetting().getEnableInitialTrainNo()) {
|
||||
Boolean enableInitialTrainNo = dealerDO.getSetting().getEnableInitialTrainNo();
|
||||
if (enableInitialTrainNo.equals(Boolean.TRUE)) {
|
||||
return dealerDO.getSetting().getInitialTrainNo().toString();
|
||||
} else {
|
||||
return "0";
|
||||
|
||||
@ -44,6 +44,7 @@ public class OrderRebateGatewayImpl implements OrderRebateGateway {
|
||||
public IPage<OrderRebate> page(OrderRebatePageQry orderRebatePageQry) {
|
||||
LambdaQueryWrapper<OrderRebateDO> queryWrapper = Wrappers.lambdaQuery(OrderRebateDO.class);
|
||||
queryWrapper.eq(Objects.nonNull(orderRebatePageQry.getIsPaid()), OrderRebateDO::getIsPaid, orderRebatePageQry.getIsPaid());
|
||||
queryWrapper.gt(OrderRebateDO::getAmount, 0);
|
||||
|
||||
queryWrapper.orderByDesc(OrderRebateDO::getCreatedAt);
|
||||
|
||||
|
||||
@ -1,13 +1,10 @@
|
||||
package com.xunhong.erp.turbo.biz.infrastructure.gateway;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.OrderSupplierBatchInvoiceUploadCmd;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.OrderSupplierUpdateCmd;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.qry.OrderSupplierPageQry;
|
||||
import com.xunhong.erp.turbo.biz.domain.entity.OrderSupplier;
|
||||
@ -96,17 +93,5 @@ public class OrderSupplierGatewayImpl implements OrderSupplierGateway {
|
||||
|
||||
return orderSupplierConvert.toOrderSupplier(orderSupplierDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void batchInvoiceUpload(OrderSupplierBatchInvoiceUploadCmd orderSupplierBatchInvoiceUploadCmd) {
|
||||
// 构建更新条件
|
||||
LambdaUpdateWrapper<OrderSupplierDO> updateWrapper = Wrappers.lambdaUpdate(OrderSupplierDO.class);
|
||||
updateWrapper.in(OrderSupplierDO::getOrderSupplierId, orderSupplierBatchInvoiceUploadCmd.getOrderSupplierIdList())
|
||||
.set(OrderSupplierDO::getInvoiceUpload, true)
|
||||
.set(OrderSupplierDO::getInvoiceImg, JSONObject.toJSONString(orderSupplierBatchInvoiceUploadCmd.getInvoiceImg()));
|
||||
|
||||
// 执行更新
|
||||
orderSupplierMapper.update(updateWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,110 @@
|
||||
package com.xunhong.erp.turbo.biz.infrastructure.gateway;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.SupplierInvoiceCreateCmd;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.SupplierInvoiceDestroyCmd;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.SupplierInvoiceUpdateCmd;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.common.OrderSupplierInvoice;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.qry.SupplierInvoiceListQry;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.qry.SupplierInvoicePageQry;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.qry.SupplierInvoiceShowQry;
|
||||
import com.xunhong.erp.turbo.biz.domain.entity.SupplierInvoice;
|
||||
import com.xunhong.erp.turbo.biz.domain.gateway.SupplierInvoiceGateway;
|
||||
import com.xunhong.erp.turbo.biz.infrastructure.convert.SupplierInvoiceConvert;
|
||||
import com.xunhong.erp.turbo.biz.infrastructure.entity.OrderSupplierDO;
|
||||
import com.xunhong.erp.turbo.biz.infrastructure.entity.SupplierInvoiceDO;
|
||||
import com.xunhong.erp.turbo.biz.infrastructure.mapper.OrderSupplierMapper;
|
||||
import com.xunhong.erp.turbo.biz.infrastructure.mapper.SupplierInvoiceMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author shenyifei
|
||||
*/
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
public class SupplierInvoiceGatewayImpl implements SupplierInvoiceGateway {
|
||||
private final SupplierInvoiceMapper supplierInvoiceMapper;
|
||||
private final SupplierInvoiceConvert supplierInvoiceConvert;
|
||||
|
||||
private final OrderSupplierMapper orderSupplierMapper;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public SupplierInvoice save(SupplierInvoiceCreateCmd supplierInvoiceCreateCmd) {
|
||||
SupplierInvoiceDO supplierInvoiceDO = supplierInvoiceConvert.toInvoiceDO(supplierInvoiceCreateCmd);
|
||||
supplierInvoiceMapper.insert(supplierInvoiceDO);
|
||||
|
||||
List<Long> orderSupplierIdList = supplierInvoiceCreateCmd.getOrderSupplierInvoiceList().stream().map(OrderSupplierInvoice::getOrderSupplierId).toList();
|
||||
if (CollUtil.isNotEmpty(orderSupplierIdList)) {
|
||||
LambdaUpdateWrapper<OrderSupplierDO> updateWrapper = Wrappers.lambdaUpdate(OrderSupplierDO.class);
|
||||
updateWrapper.in(OrderSupplierDO::getOrderSupplierId, orderSupplierIdList);
|
||||
updateWrapper.set(OrderSupplierDO::getInvoiceUpload, Boolean.TRUE);
|
||||
updateWrapper.set(OrderSupplierDO::getInvoiceId, supplierInvoiceDO.getSupplierInvoiceId());
|
||||
orderSupplierMapper.update(null, updateWrapper);
|
||||
}
|
||||
|
||||
return supplierInvoiceConvert.toInvoice(supplierInvoiceDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<SupplierInvoice> page(SupplierInvoicePageQry supplierInvoicePageQry) {
|
||||
LambdaQueryWrapper<SupplierInvoiceDO> queryWrapper = Wrappers.lambdaQuery(SupplierInvoiceDO.class);
|
||||
queryWrapper.orderByDesc(SupplierInvoiceDO::getCreatedAt);
|
||||
|
||||
IPage<SupplierInvoiceDO> page = new Page<>(supplierInvoicePageQry.getPageIndex(), supplierInvoicePageQry.getPageSize());
|
||||
page = supplierInvoiceMapper.selectPage(page, queryWrapper);
|
||||
|
||||
return page.convert(supplierInvoiceConvert::toInvoice);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SupplierInvoice> list(SupplierInvoiceListQry supplierInvoiceListQry) {
|
||||
LambdaQueryWrapper<SupplierInvoiceDO> queryWrapper = Wrappers.lambdaQuery(SupplierInvoiceDO.class);
|
||||
List<SupplierInvoiceDO> supplierInvoiceDOList = supplierInvoiceMapper.selectList(queryWrapper);
|
||||
return supplierInvoiceDOList.stream().map(supplierInvoiceConvert::toInvoice).toList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SupplierInvoice update(SupplierInvoiceUpdateCmd invoiceUpdateCmd) {
|
||||
LambdaQueryWrapper<SupplierInvoiceDO> queryWrapper = Wrappers.lambdaQuery(SupplierInvoiceDO.class);
|
||||
queryWrapper.eq(SupplierInvoiceDO::getSupplierInvoiceId, invoiceUpdateCmd.getSupplierInvoiceId());
|
||||
queryWrapper.last("limit 1");
|
||||
|
||||
SupplierInvoiceDO supplierInvoiceDO = supplierInvoiceMapper.selectOne(queryWrapper);
|
||||
|
||||
supplierInvoiceConvert.toInvoiceDO(supplierInvoiceDO, invoiceUpdateCmd);
|
||||
supplierInvoiceMapper.updateById(supplierInvoiceDO);
|
||||
|
||||
return supplierInvoiceConvert.toInvoice(supplierInvoiceDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SupplierInvoice show(SupplierInvoiceShowQry supplierInvoiceShowQry) {
|
||||
LambdaQueryWrapper<SupplierInvoiceDO> queryWrapper = Wrappers.lambdaQuery(SupplierInvoiceDO.class);
|
||||
queryWrapper.eq(SupplierInvoiceDO::getSupplierInvoiceId, supplierInvoiceShowQry.getSupplierInvoiceId());
|
||||
queryWrapper.last("limit 1");
|
||||
|
||||
SupplierInvoiceDO supplierInvoiceDO = supplierInvoiceMapper.selectOne(queryWrapper);
|
||||
return supplierInvoiceConvert.toInvoice(supplierInvoiceDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy(SupplierInvoiceDestroyCmd supplierInvoiceDestroyCmd) {
|
||||
LambdaQueryWrapper<SupplierInvoiceDO> queryWrapper = Wrappers.lambdaQuery(SupplierInvoiceDO.class);
|
||||
queryWrapper.eq(SupplierInvoiceDO::getSupplierInvoiceId, supplierInvoiceDestroyCmd.getSupplierInvoiceId());
|
||||
queryWrapper.last("limit 1");
|
||||
|
||||
SupplierInvoiceDO supplierInvoiceDO = supplierInvoiceMapper.selectOne(queryWrapper);
|
||||
supplierInvoiceDO.deleteById();
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,13 @@
|
||||
package com.xunhong.erp.turbo.biz.infrastructure.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xunhong.erp.turbo.biz.infrastructure.entity.SupplierInvoiceDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 发票记录表Mapper
|
||||
* @author shenyifei
|
||||
*/
|
||||
@Mapper
|
||||
public interface SupplierInvoiceMapper extends BaseMapper<SupplierInvoiceDO> {
|
||||
}
|
||||
@ -58,7 +58,7 @@
|
||||
LEFT JOIN `order` po ON oc.order_id = po.order_id AND
|
||||
po.is_delete = 0
|
||||
<where>
|
||||
oc.is_delete = 0
|
||||
oc.is_delete = 0 and oc.price > 0
|
||||
<if test="query.createdBy != null">
|
||||
AND po.created_by = #{query.createdBy}
|
||||
</if>
|
||||
|
||||
@ -28,14 +28,13 @@
|
||||
<result property="loadingMode" column="loading_mode"/>
|
||||
<result property="salePrice" column="sale_price"/>
|
||||
<result property="pricingMethod" column="pricing_method"/>
|
||||
<result property="invoiceAmount" column="invoice_amount"/>
|
||||
<result property="emptyWeightImg" column="empty_weight_img"/>
|
||||
<result property="totalWeightImg" column="total_Weight_img"/>
|
||||
<result property="invoiceImg" column="invoice_img"
|
||||
typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/>
|
||||
<result property="contractImg" column="contract_img"
|
||||
typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/>
|
||||
<result property="invoiceUpload" column="invoice_upload"/>
|
||||
<result property="invoiceId" column="invoice_id"/>
|
||||
<result property="invoiceAmount" column="invoice_amount"/>
|
||||
<result property="contractUpload" column="contract_upload"/>
|
||||
<result property="productId" column="product_id"/>
|
||||
<result property="productName" column="product_name"/>
|
||||
@ -69,6 +68,9 @@
|
||||
<if test="query.createdBy != null">
|
||||
AND po.created_by = #{query.createdBy}
|
||||
</if>
|
||||
<if test="query.type != null">
|
||||
AND os.type = #{query.type}
|
||||
</if>
|
||||
<if test="query.orderId != null">
|
||||
AND po.order_id = #{query.orderId}
|
||||
</if>
|
||||
|
||||
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.xunhong.erp.turbo.biz.infrastructure.mapper.SupplierInvoiceMapper">
|
||||
<resultMap id="BaseResultMap" type="com.xunhong.erp.turbo.biz.infrastructure.entity.SupplierInvoiceDO">
|
||||
<result property="supplierInvoiceId" column="supplier_invoice_id"/>
|
||||
<result property="type" column="type"/>
|
||||
<result property="supplierId" column="supplier_id"/>
|
||||
<result property="supplierName" column="supplier_name"/>
|
||||
<result property="orderSupplierInvoice" column="order_supplier_invoice"
|
||||
typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/>
|
||||
<result property="invoiceImg" column="invoice_img"
|
||||
typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/>
|
||||
<result property="registrationTime" column="registration_time"/>
|
||||
<result property="createdBy" column="created_by"/>
|
||||
<result property="createdByName" column="created_by_name"/>
|
||||
<result property="createdAt" column="created_at"/>
|
||||
<result property="updatedAt" column="updated_at"/>
|
||||
<result property="isDelete" column="is_delete"/>
|
||||
<result property="version" column="version"/>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package com.xunhong.erp.turbo.api.biz.api;
|
||||
|
||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.OrderSupplierBatchInvoiceUploadCmd;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.OrderSupplierUpdateCmd;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.qry.OrderSupplierPageQry;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.vo.OrderSupplierVO;
|
||||
@ -13,12 +12,5 @@ public interface OrderSupplierServiceI {
|
||||
PageDTO<OrderSupplierVO> page(OrderSupplierPageQry orderSupplierPageQry);
|
||||
|
||||
OrderSupplierVO update(OrderSupplierUpdateCmd orderSupplierUpdateCmd);
|
||||
|
||||
/**
|
||||
* 批量上传供应商发票
|
||||
*
|
||||
* @param batchInvoiceUploadCmd 批量上传发票命令
|
||||
*/
|
||||
void batchUploadInvoice(OrderSupplierBatchInvoiceUploadCmd batchInvoiceUploadCmd);
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,30 @@
|
||||
package com.xunhong.erp.turbo.api.biz.api;
|
||||
|
||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.SupplierInvoiceCreateCmd;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.SupplierInvoiceDestroyCmd;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.SupplierInvoiceUpdateCmd;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.qry.SupplierInvoiceListQry;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.qry.SupplierInvoicePageQry;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.qry.SupplierInvoiceShowQry;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.vo.SupplierInvoiceVO;
|
||||
import com.xunhong.erp.turbo.base.dto.PageDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author shenyifei
|
||||
*/
|
||||
public interface SupplierInvoiceServiceI {
|
||||
SupplierInvoiceVO create(SupplierInvoiceCreateCmd supplierInvoiceCreateCmd);
|
||||
|
||||
PageDTO<SupplierInvoiceVO> page(SupplierInvoicePageQry supplierInvoicePageQry);
|
||||
|
||||
List<SupplierInvoiceVO> list(SupplierInvoiceListQry supplierInvoiceListQry);
|
||||
|
||||
SupplierInvoiceVO update(SupplierInvoiceUpdateCmd invoiceIdUpdateCmd);
|
||||
|
||||
SupplierInvoiceVO show(SupplierInvoiceShowQry supplierInvoiceShowQry);
|
||||
|
||||
void destroy(SupplierInvoiceDestroyCmd supplierInvoiceDestroyCmd);
|
||||
}
|
||||
|
||||
@ -1,39 +0,0 @@
|
||||
package com.xunhong.erp.turbo.api.biz.dto.cmd;
|
||||
|
||||
import com.xunhong.erp.turbo.api.biz.dto.common.UploadFileItem;
|
||||
import com.xunhong.erp.turbo.base.dto.Command;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单供应商批量上传发票命令
|
||||
*
|
||||
* @author claude
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "订单供应商批量上传发票命令")
|
||||
public class OrderSupplierBatchInvoiceUploadCmd extends Command {
|
||||
|
||||
/**
|
||||
* 供应商ID列表
|
||||
*/
|
||||
@Schema(description = "供应商ID列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<Long> orderSupplierIdList;
|
||||
|
||||
/**
|
||||
* 是否上传票证
|
||||
*/
|
||||
@Schema(title = "是否上传票证")
|
||||
private Boolean invoiceUpload;
|
||||
|
||||
/**
|
||||
* 发票照片
|
||||
*/
|
||||
@Schema(title = "发票照片")
|
||||
private List<UploadFileItem> invoiceImg;
|
||||
|
||||
}
|
||||
@ -27,10 +27,16 @@ public class OrderSupplierUpdateCmd extends Command {
|
||||
@Schema(title = "是否上传票证")
|
||||
private Boolean invoiceUpload;
|
||||
|
||||
/**
|
||||
* 票证ID
|
||||
*/
|
||||
@Schema(title = "发票ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long invoiceId;
|
||||
|
||||
/**
|
||||
* 发票照片
|
||||
*/
|
||||
@Schema(title = "发票照片")
|
||||
@Schema(title = "瓜农发票照片")
|
||||
private List<UploadFileItem> invoiceImg;
|
||||
|
||||
/**
|
||||
|
||||
@ -0,0 +1,51 @@
|
||||
package com.xunhong.erp.turbo.api.biz.dto.cmd;
|
||||
|
||||
import com.xunhong.erp.turbo.api.biz.dto.common.OrderSupplierInvoice;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.common.UploadFileItem;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.enums.SupplierInvoiceTypeEnum;
|
||||
import com.xunhong.erp.turbo.base.dto.Command;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author shenyifei
|
||||
*/
|
||||
@Data
|
||||
@Schema(title = "瓜农发票创建")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SupplierInvoiceCreateCmd extends Command {
|
||||
|
||||
/**
|
||||
* 发票类型:1_瓜农
|
||||
*/
|
||||
@Schema(title = "瓜农发票类型:1_瓜农")
|
||||
private SupplierInvoiceTypeEnum type;
|
||||
|
||||
/**
|
||||
* 发票开具人
|
||||
*/
|
||||
@Schema(title = "瓜农发票开具人", type = "string", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long supplierId;
|
||||
|
||||
/**
|
||||
* 发票开具人名称
|
||||
*/
|
||||
@Schema(title = "瓜农发票开具人名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String supplierName;
|
||||
|
||||
/**
|
||||
* 代开发票人的信息
|
||||
*/
|
||||
@Schema(title = "代开发票人的信息")
|
||||
private List<OrderSupplierInvoice> orderSupplierInvoiceList;
|
||||
|
||||
/**
|
||||
* 发票图片(支持多张)
|
||||
*/
|
||||
@Schema(title = "瓜农发票图片(支持多张)")
|
||||
private List<UploadFileItem> invoiceImg;
|
||||
}
|
||||
|
||||
@ -0,0 +1,19 @@
|
||||
package com.xunhong.erp.turbo.api.biz.dto.cmd;
|
||||
|
||||
import com.xunhong.erp.turbo.base.dto.Command;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author shenyifei
|
||||
*/
|
||||
@Data
|
||||
@Schema(title = "删除发票")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SupplierInvoiceDestroyCmd extends Command {
|
||||
|
||||
@Schema(title = "瓜农发票ID", requiredMode = Schema.RequiredMode.REQUIRED, type = "string")
|
||||
private Long supplierInvoiceId;
|
||||
}
|
||||
|
||||
@ -0,0 +1,18 @@
|
||||
package com.xunhong.erp.turbo.api.biz.dto.cmd;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author shenyifei
|
||||
*/
|
||||
@Data
|
||||
@Schema(title = "瓜农发票更新")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SupplierInvoiceUpdateCmd extends SupplierInvoiceCreateCmd {
|
||||
|
||||
@Schema(title = "瓜农发票ID", requiredMode = Schema.RequiredMode.REQUIRED, type = "string")
|
||||
private Long supplierInvoiceId;
|
||||
}
|
||||
|
||||
@ -156,7 +156,7 @@ public class OrderSupplier extends Command {
|
||||
/**
|
||||
* 发票金额
|
||||
*/
|
||||
@Schema(title = "发票金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@Schema(title = "瓜农发票金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private BigDecimal invoiceAmount;
|
||||
|
||||
/**
|
||||
@ -177,10 +177,16 @@ public class OrderSupplier extends Command {
|
||||
@Schema(title = "是否上传票证", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Boolean invoiceUpload;
|
||||
|
||||
/**
|
||||
* 瓜农发票ID
|
||||
*/
|
||||
@Schema(title = "瓜农发票ID")
|
||||
private Long invoiceId;
|
||||
|
||||
/**
|
||||
* 发票
|
||||
*/
|
||||
@Schema(title = "发票")
|
||||
@Schema(title = "瓜农发票")
|
||||
private List<UploadFileItem> invoiceImg;
|
||||
|
||||
/**
|
||||
|
||||
@ -0,0 +1,72 @@
|
||||
package com.xunhong.erp.turbo.api.biz.dto.common;
|
||||
|
||||
import com.alibaba.cola.dto.DTO;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.enums.SupplierTypeEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author shenyifei
|
||||
*/
|
||||
@Data
|
||||
@Schema(title = "供应商发票信息")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class OrderSupplierInvoice extends DTO {
|
||||
|
||||
/**
|
||||
* 记录ID
|
||||
*/
|
||||
@Schema(title = "记录ID", type = "string", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long orderSupplierId;
|
||||
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
@Schema(title = "订单ID", type = "string", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 供应商ID
|
||||
*/
|
||||
@Schema(title = "供应商ID", type = "string", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long supplierId;
|
||||
|
||||
/**
|
||||
* 供应商姓名
|
||||
*/
|
||||
@Schema(title = "供应商姓名", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 供应商类型:1_瓜农;2_自家档口;3_其他家档口
|
||||
*/
|
||||
@Schema(title = "供应商类型:1_瓜农;2_自家档口;3_其他家档口", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private SupplierTypeEnum type;
|
||||
|
||||
/**
|
||||
* 发票金额
|
||||
*/
|
||||
@Schema(title = "瓜农发票金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private BigDecimal invoiceAmount;
|
||||
|
||||
/**
|
||||
* 经销商Id
|
||||
*/
|
||||
@Schema(title = "经销商Id", type = "string", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long dealerId;
|
||||
|
||||
/**
|
||||
* 经销航名称
|
||||
*/
|
||||
@Schema(title = "经销航名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String dealerName;
|
||||
|
||||
/**
|
||||
* 车次号
|
||||
*/
|
||||
@Schema(title = "车次号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String vehicleNo;
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package com.xunhong.erp.turbo.api.biz.dto.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* 发票类型枚举
|
||||
*/
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public enum SupplierInvoiceTypeEnum {
|
||||
/**
|
||||
* 发票类型:1_瓜农发票
|
||||
*/
|
||||
FARMER(1, "瓜农发票"),
|
||||
;
|
||||
|
||||
@EnumValue
|
||||
private final int type;
|
||||
|
||||
private final String message;
|
||||
}
|
||||
@ -2,6 +2,7 @@ package com.xunhong.erp.turbo.api.biz.dto.qry;
|
||||
|
||||
import com.xunhong.erp.turbo.api.biz.dto.enums.OrderStateEnum;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.enums.OrderTypeEnum;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.enums.SupplierTypeEnum;
|
||||
import com.xunhong.erp.turbo.base.dto.PageQuery;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
@ -32,7 +33,7 @@ public class OrderSupplierPageQry extends PageQuery {
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private List<LocalDateTime> deliveryTime;
|
||||
|
||||
@Schema(title = "发票上传", type = "boolean")
|
||||
@Schema(title = "瓜农发票上传", type = "boolean")
|
||||
private Boolean invoiceUpload;
|
||||
|
||||
@Schema(title = "订单状态")
|
||||
@ -43,5 +44,11 @@ public class OrderSupplierPageQry extends PageQuery {
|
||||
|
||||
@Schema(title = "是否支付", type = "boolean")
|
||||
private Boolean isPaid;
|
||||
|
||||
/**
|
||||
* 供应商类型:1_瓜农;2_自家档口;3_其他家档口
|
||||
*/
|
||||
@Schema(title = "供应商类型:1_瓜农;2_自家档口;3_其他家档口")
|
||||
private SupplierTypeEnum type;
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,19 @@
|
||||
package com.xunhong.erp.turbo.api.biz.dto.qry;
|
||||
|
||||
import com.xunhong.erp.turbo.base.dto.Query;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author shenyifei
|
||||
*/
|
||||
@Data
|
||||
@Schema(title = "瓜农发票列表查询")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SupplierInvoiceListQry extends Query {
|
||||
|
||||
@Schema(title = "瓜农发票ID", type = "string")
|
||||
private Long supplierInvoiceId;
|
||||
}
|
||||
|
||||
@ -0,0 +1,19 @@
|
||||
package com.xunhong.erp.turbo.api.biz.dto.qry;
|
||||
|
||||
import com.xunhong.erp.turbo.base.dto.PageQuery;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author shenyifei
|
||||
*/
|
||||
@Data
|
||||
@Schema(title = "瓜农发票分页查询")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SupplierInvoicePageQry extends PageQuery {
|
||||
|
||||
@Schema(title = "瓜农发票ID", type = "string")
|
||||
private Long supplierInvoiceId;
|
||||
}
|
||||
|
||||
@ -0,0 +1,19 @@
|
||||
package com.xunhong.erp.turbo.api.biz.dto.qry;
|
||||
|
||||
import com.xunhong.erp.turbo.base.dto.Query;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author shenyifei
|
||||
*/
|
||||
@Data
|
||||
@Schema(title = "瓜农发票查询")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SupplierInvoiceShowQry extends Query {
|
||||
|
||||
@Schema(title = "瓜农发票ID", type = "string")
|
||||
private Long supplierInvoiceId;
|
||||
}
|
||||
|
||||
@ -164,7 +164,7 @@ public class OrderSupplierVO extends DTO {
|
||||
/**
|
||||
* 发票金额
|
||||
*/
|
||||
@Schema(title = "发票金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@Schema(title = "瓜农发票金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private BigDecimal invoiceAmount;
|
||||
|
||||
/**
|
||||
@ -203,10 +203,16 @@ public class OrderSupplierVO extends DTO {
|
||||
@Schema(title = "是否上传票证", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Boolean invoiceUpload;
|
||||
|
||||
/**
|
||||
* 票证ID
|
||||
*/
|
||||
@Schema(title = "发票ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long invoiceId;
|
||||
|
||||
/**
|
||||
* 发票照片
|
||||
*/
|
||||
@Schema(title = "发票照片", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@Schema(title = "瓜农发票照片", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<UploadFileItem> invoiceImg;
|
||||
|
||||
/**
|
||||
|
||||
@ -0,0 +1,83 @@
|
||||
package com.xunhong.erp.turbo.api.biz.dto.vo;
|
||||
|
||||
import com.alibaba.cola.dto.DTO;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.common.OrderSupplierInvoice;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.common.UploadFileItem;
|
||||
import com.xunhong.erp.turbo.api.biz.dto.enums.SupplierInvoiceTypeEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author shenyifei
|
||||
*/
|
||||
@Data
|
||||
@Schema(title = "瓜农发票")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SupplierInvoiceVO extends DTO {
|
||||
|
||||
/**
|
||||
* 发票ID
|
||||
*/
|
||||
@Schema(title = "瓜农发票ID", type = "string", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long supplierInvoiceId;
|
||||
|
||||
/**
|
||||
* 发票类型:1_瓜农
|
||||
*/
|
||||
@Schema(title = "瓜农发票类型:1_瓜农")
|
||||
private SupplierInvoiceTypeEnum type;
|
||||
|
||||
/**
|
||||
* 发票开具人
|
||||
*/
|
||||
@Schema(title = "瓜农发票开具人", type = "string", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long supplierId;
|
||||
|
||||
/**
|
||||
* 发票开具人名称
|
||||
*/
|
||||
@Schema(title = "瓜农发票开具人名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String supplierName;
|
||||
|
||||
/**
|
||||
* 代开发票人的信息
|
||||
*/
|
||||
@Schema(title = "代开发票人的信息")
|
||||
private List<OrderSupplierInvoice> orderSupplierInvoiceList;
|
||||
|
||||
/**
|
||||
* 发票图片(支持多张)
|
||||
*/
|
||||
@Schema(title = "瓜农发票图片(支持多张)")
|
||||
private List<UploadFileItem> invoiceImg;
|
||||
|
||||
/**
|
||||
* 登记时间
|
||||
*/
|
||||
@Schema(title = "登记时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime registrationTime;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
@Schema(title = "创建人ID", type = "string")
|
||||
private Long createdBy;
|
||||
|
||||
/**
|
||||
* 创建人姓名
|
||||
*/
|
||||
@Schema(title = "创建人姓名")
|
||||
private String createdByName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(title = "创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user