From 55431c9b4bcdfd7d37de778f342b3890bac24767 Mon Sep 17 00:00:00 2001 From: jameszow Date: Mon, 13 Nov 2023 17:16:43 +0800 Subject: [PATCH 01/18] update: update defineComponent name --- web/src/views/retail/refund/components/ViewRefundModal.vue | 2 +- web/src/views/retail/shipments/components/ViewShipmentModal.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/views/retail/refund/components/ViewRefundModal.vue b/web/src/views/retail/refund/components/ViewRefundModal.vue index 8c2bd87a..d88fe0c7 100644 --- a/web/src/views/retail/refund/components/ViewRefundModal.vue +++ b/web/src/views/retail/refund/components/ViewRefundModal.vue @@ -70,7 +70,7 @@ import {retailShipmentsTableColumns} from "@/views/retail/shipments/shipments.da import ViewShipmentModal from "@/views/retail/shipments/components/ViewShipmentModal.vue"; export default defineComponent({ - name: 'ReceiptViewModal', + name: 'ViewRefundModal', components: { BasicModal, BasicTable, diff --git a/web/src/views/retail/shipments/components/ViewShipmentModal.vue b/web/src/views/retail/shipments/components/ViewShipmentModal.vue index 94a29f79..1ddb7244 100644 --- a/web/src/views/retail/shipments/components/ViewShipmentModal.vue +++ b/web/src/views/retail/shipments/components/ViewShipmentModal.vue @@ -69,7 +69,7 @@ import { import {retailShipmentsTableColumns} from "@/views/retail/shipments/shipments.data"; export default defineComponent({ - name: 'ReceiptViewModal', + name: 'ViewShipmentModal', components: { BasicModal, BasicTable, From 3c391e8fb8d2efa6bc04bbe95f5c9713eb7675b4 Mon Sep 17 00:00:00 2001 From: jameszow Date: Mon, 13 Nov 2023 19:25:57 +0800 Subject: [PATCH 02/18] new: add order refund storage detail views --- .../order/components/ViewOrderModal.vue | 149 +++++++++++++++ .../refund/components/ViewRefundModal.vue | 176 ++++++++++++++++++ .../storage/components/ViewStorageModal.vue | 170 +++++++++++++++++ 3 files changed, 495 insertions(+) create mode 100644 web/src/views/purchase/order/components/ViewOrderModal.vue create mode 100644 web/src/views/purchase/refund/components/ViewRefundModal.vue create mode 100644 web/src/views/purchase/storage/components/ViewStorageModal.vue diff --git a/web/src/views/purchase/order/components/ViewOrderModal.vue b/web/src/views/purchase/order/components/ViewOrderModal.vue new file mode 100644 index 00000000..35a4b8fd --- /dev/null +++ b/web/src/views/purchase/order/components/ViewOrderModal.vue @@ -0,0 +1,149 @@ + + + diff --git a/web/src/views/purchase/refund/components/ViewRefundModal.vue b/web/src/views/purchase/refund/components/ViewRefundModal.vue new file mode 100644 index 00000000..c558f1aa --- /dev/null +++ b/web/src/views/purchase/refund/components/ViewRefundModal.vue @@ -0,0 +1,176 @@ + + + diff --git a/web/src/views/purchase/storage/components/ViewStorageModal.vue b/web/src/views/purchase/storage/components/ViewStorageModal.vue new file mode 100644 index 00000000..373fbbca --- /dev/null +++ b/web/src/views/purchase/storage/components/ViewStorageModal.vue @@ -0,0 +1,170 @@ + + + From 4851c83901caa95abb0ea09206b928ee893b85a0 Mon Sep 17 00:00:00 2001 From: jameszow Date: Mon, 13 Nov 2023 19:26:32 +0800 Subject: [PATCH 03/18] new: add storage model and add components --- web/src/api/purchase/model/storageModel.ts | 2 ++ web/src/api/purchase/storage.ts | 9 +++++++++ web/src/views/purchase/storage/index.vue | 16 +++++++++++++--- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/web/src/api/purchase/model/storageModel.ts b/web/src/api/purchase/model/storageModel.ts index c988220c..587be272 100644 --- a/web/src/api/purchase/model/storageModel.ts +++ b/web/src/api/purchase/model/storageModel.ts @@ -49,7 +49,9 @@ export interface AddOrUpdatePurchaseStorageReq { export interface PurchaseStorageDetailData { supplierId: number | string; + supplierName: string; accountId: number; + accountName: string; receiptDate: string; receiptNumber: string; multipleAccountAmounts: number[]; diff --git a/web/src/api/purchase/storage.ts b/web/src/api/purchase/storage.ts index c8cb780f..3ef22608 100644 --- a/web/src/api/purchase/storage.ts +++ b/web/src/api/purchase/storage.ts @@ -12,6 +12,7 @@ enum API { GetDetail = '/purchase/storage/detail', UpdateStatus = '/purchase/storage/updateStatus', Delete = '/purchase/storage/delete', + GetLinkStorageDetail = '/purchase/storage/getLinkStorageDetail', } export function getPurchaseStoragePageList(params: QueryPurchaseStorageReq) { @@ -54,4 +55,12 @@ export function deletePurchaseStorage(ids: number[]) { url: `${API.Delete}/${ids}`, } ); +} + +export function getLinkStorageDetail(receiptNumber: string) { + return defHttp.get>( + { + url: `${API.GetLinkStorageDetail}/${receiptNumber}`, + } + ); } \ No newline at end of file diff --git a/web/src/views/purchase/storage/index.vue b/web/src/views/purchase/storage/index.vue index e7ec7019..c0c1a118 100644 --- a/web/src/views/purchase/storage/index.vue +++ b/web/src/views/purchase/storage/index.vue @@ -41,6 +41,7 @@ +
@@ -56,13 +57,16 @@ import {useI18n} from "vue-i18n"; import {Tag} from "ant-design-vue"; import {getPurchaseStoragePageList, updatePurchaseStorageStatus, deletePurchaseStorage} from "@/api/purchase/storage"; import AddEditModal from "@/views/purchase/storage/components/AddEditModal.vue"; +import ViewStorageModal from "@/views/purchase/storage/components/ViewStorageModal.vue"; +import {useModal} from "@/components/Modal"; export default defineComponent({ name: 'PurchaseStorageModal', - components: {AddEditModal, Tag, TableAction, BasicTable}, + components: {AddEditModal, Tag, TableAction, BasicTable, ViewStorageModal}, setup() { const { t } = useI18n(); const addEditModalRef = ref(null); const { createMessage } = useMessage(); + const [viewStorageReceiptModal, {openModal: openViewStorageReceiptModal}] = useModal(); const [registerTable, { reload, getSelectRows }] = useTable({ title: '采购入库列表', rowKey: 'id', @@ -133,8 +137,13 @@ export default defineComponent({ await reload(); } - function handleView(){ - + function handleView(record: Recordable){ + openViewStorageReceiptModal( + true, + { + receiptNumber: record.receiptNumber, + }, + ) } const getTimestamp = (date) => { @@ -189,6 +198,7 @@ export default defineComponent({ handleView, handleOk, handleExport, + viewStorageReceiptModal, } } }) From d9662058d452aa817fbd85194b9c51d05c07e24c Mon Sep 17 00:00:00 2001 From: jameszow Date: Mon, 13 Nov 2023 19:26:44 +0800 Subject: [PATCH 04/18] new: add refund model and add components --- web/src/api/purchase/model/refundModel.ts | 2 ++ web/src/api/purchase/refund.ts | 9 +++++++++ web/src/views/purchase/refund/index.vue | 16 ++++++++++++---- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/web/src/api/purchase/model/refundModel.ts b/web/src/api/purchase/model/refundModel.ts index 52f796fb..ade24d2c 100644 --- a/web/src/api/purchase/model/refundModel.ts +++ b/web/src/api/purchase/model/refundModel.ts @@ -49,7 +49,9 @@ export interface AddOrUpdatePurchaseRefundReq { export interface PurchaseRefundDetailData { supplierId: number | string; + supplierName: string; accountId: number; + accountName: string; otherReceipt: string; receiptDate: string; receiptNumber: string; diff --git a/web/src/api/purchase/refund.ts b/web/src/api/purchase/refund.ts index 9b12897d..acc7af00 100644 --- a/web/src/api/purchase/refund.ts +++ b/web/src/api/purchase/refund.ts @@ -12,6 +12,7 @@ enum API { GetDetail = '/purchase/refund/detail', UpdateStatus = '/purchase/refund/updateStatus', Delete = '/purchase/refund/delete', + GetLinkRefundDetail = '/purchase/refund/getLinkRefundDetail', } export function getPurchaseRefundPageList(params: QueryPurchaseRefundReq) { @@ -54,4 +55,12 @@ export function deletePurchaseRefund(ids: number[]) { url: `${API.Delete}/${ids}`, } ); +} + +export function getLinkRefundDetail(receiptNumber: string) { + return defHttp.get>( + { + url: `${API.GetLinkRefundDetail}/${receiptNumber}`, + } + ); } \ No newline at end of file diff --git a/web/src/views/purchase/refund/index.vue b/web/src/views/purchase/refund/index.vue index 89e1b794..9a5fafb6 100644 --- a/web/src/views/purchase/refund/index.vue +++ b/web/src/views/purchase/refund/index.vue @@ -14,7 +14,7 @@ :actions="[ { icon: 'clarity:info-standard-line', - tooltip: t('sys.user.viewUserDetails'), + tooltip: '查看单据详情', onClick: handleView.bind(null, record), }, { @@ -41,6 +41,7 @@ +
@@ -56,12 +57,16 @@ import {useI18n} from "vue-i18n"; import {Tag} from "ant-design-vue"; import {getPurchaseRefundPageList, updatePurchaseRefundStatus, deletePurchaseRefund} from "@/api/purchase/refund"; import AddEditModal from "@/views/purchase/refund/components/AddEditModal.vue"; +import ViewRefundModal from "@/views/purchase/refund/components/ViewRefundModal.vue" +import {useModal} from "@/components/Modal"; export default defineComponent({ name: 'PurchaseRefundModal', - components: {AddEditModal, Tag, TableAction, BasicTable}, + components: {ViewRefundModal, AddEditModal, Tag, TableAction, BasicTable}, setup() { const { t } = useI18n(); const addEditModalRef = ref(null); + const [viewRefundReceiptModal, {openModal: openViewRefundModal}] = useModal(); + const { createMessage } = useMessage(); const [registerTable, { reload, getSelectRows }] = useTable({ title: '采购退货列表', @@ -133,8 +138,10 @@ export default defineComponent({ await reload(); } - function handleView(){ - + function handleView(record: Recordable){ + openViewRefundModal(true, { + receiptNumber: record.receiptNumber + }); } const getTimestamp = (date) => { @@ -189,6 +196,7 @@ export default defineComponent({ handleView, handleOk, handleExport, + viewRefundReceiptModal, } } }) From 3d8e336c16a400e3f10026472d9f0052b716ab55 Mon Sep 17 00:00:00 2001 From: jameszow Date: Mon, 13 Nov 2023 19:27:15 +0800 Subject: [PATCH 05/18] new: add purchase getLinkPurchaseOrderDetail and getLinkPurchaseStorageDetail api --- .../api/receipt/PurchaseController.java | 15 ++ .../receipt/ReceiptPurchaseService.java | 33 +++ .../impl/ReceiptPurchaseServiceImpl.java | 201 ++++++++++++++---- 3 files changed, 210 insertions(+), 39 deletions(-) diff --git a/core/api/src/main/java/com/wansenai/api/receipt/PurchaseController.java b/core/api/src/main/java/com/wansenai/api/receipt/PurchaseController.java index 25a637f0..7a2127af 100644 --- a/core/api/src/main/java/com/wansenai/api/receipt/PurchaseController.java +++ b/core/api/src/main/java/com/wansenai/api/receipt/PurchaseController.java @@ -54,6 +54,11 @@ public Response detail(@PathVariable("id") Long id) { return purchaseService.getPurchaseOrderDetail(id); } + @GetMapping("/order/getLinkOrderDetail/{receiptNumber}") + public Response getLinkPurchaseOrderDetail(@PathVariable("receiptNumber") String receiptNumber) { + return purchaseService.getLinkPurchaseOrderDetail(receiptNumber); + } + @PutMapping("/order/updateStatus/{ids}/{status}") public Response updateStatus(@PathVariable("ids") List ids, @PathVariable("status") Integer status) { return purchaseService.updatePurchaseOrderStatus(ids, status); @@ -79,6 +84,11 @@ public Response purchaseStorageDetail(@PathVariable("id return purchaseService.getPurchaseStorageDetail(id); } + @GetMapping("/storage/getLinkStorageDetail/{receiptNumber}") + public Response getLinkPurchaseStorageDetail(@PathVariable("receiptNumber") String receiptNumber) { + return purchaseService.getLinkPurchaseStorageDetail(receiptNumber); + } + @PutMapping("/storage/updateStatus/{ids}/{status}") public Response updatePurchaseStorageStatus(@PathVariable("ids") List ids, @PathVariable("status") Integer status) { return purchaseService.updatePurchaseStorageStatus(ids, status); @@ -104,6 +114,11 @@ public Response purchaseRefundDetail(@PathVariable("id") return purchaseService.getPurchaseRefundDetail(id); } + @GetMapping("/refund/getLinkRefundDetail/{receiptNumber}") + public Response getLinkPurchaseRefundDetail(@PathVariable("receiptNumber") String receiptNumber) { + return purchaseService.getLinkPurchaseRefundDetail(receiptNumber); + } + @PutMapping("/refund/updateStatus/{ids}/{status}") public Response updatePurchaseRefundStatus(@PathVariable("ids") List ids, @PathVariable("status") Integer status) { return purchaseService.updatePurchaseRefundStatus(ids, status); diff --git a/core/service/src/main/java/com/wansenai/service/receipt/ReceiptPurchaseService.java b/core/service/src/main/java/com/wansenai/service/receipt/ReceiptPurchaseService.java index b3de1994..47caf95c 100644 --- a/core/service/src/main/java/com/wansenai/service/receipt/ReceiptPurchaseService.java +++ b/core/service/src/main/java/com/wansenai/service/receipt/ReceiptPurchaseService.java @@ -45,6 +45,17 @@ public interface ReceiptPurchaseService extends IService { */ Response getPurchaseOrderDetail(Long id); + /** + * Query purchase order details data based on purchase order number + * 根据采购订单单号查询采购订单详情数据 + * + * @param receiptNumber Purchase order number + * 采购订单单号 + * @return Returns purchase order details data + * 返回采购订单详情数据 + */ + Response getLinkPurchaseOrderDetail(String receiptNumber); + /** * Add/Update Purchase Order Data * 添加/修改采购订单数据 @@ -102,6 +113,17 @@ public interface ReceiptPurchaseService extends IService { */ Response getPurchaseStorageDetail(Long id); + /** + * Query the detailed data of the purchase receipt order based on the purchase receipt order number + * 根据采购入库单单号查询采购入库单详情数据 + * + * @param receiptNumber Purchase receipt order number + * 采购入库单单号 + * @return Returns purchase receipt order details data + * 返回采购入库单详情数据 + */ + Response getLinkPurchaseStorageDetail(String receiptNumber); + /** * Add/Modify Purchase Receipt Data * 添加/修改采购入库数据 @@ -159,6 +181,17 @@ public interface ReceiptPurchaseService extends IService { */ Response getPurchaseRefundDetail(Long id); + /** + * Query the detailed data of the purchase return order based on the purchase return order number + * 根据采购退货单单号查询采购退货单详情数据 + * + * @param receiptNumber Purchase return order number + * 采购退货单单号 + * @return Returns purchase return order details data + * 返回采购退货单详情数据 + */ + Response getLinkPurchaseRefundDetail(String receiptNumber); + /** * Add/Modify Purchase Return Order Data * 添加/修改采购退货单数据 diff --git a/core/service/src/main/java/com/wansenai/service/receipt/impl/ReceiptPurchaseServiceImpl.java b/core/service/src/main/java/com/wansenai/service/receipt/impl/ReceiptPurchaseServiceImpl.java index 329db089..477bba06 100644 --- a/core/service/src/main/java/com/wansenai/service/receipt/impl/ReceiptPurchaseServiceImpl.java +++ b/core/service/src/main/java/com/wansenai/service/receipt/impl/ReceiptPurchaseServiceImpl.java @@ -22,7 +22,6 @@ import com.wansenai.entities.product.ProductStock; import com.wansenai.entities.receipt.ReceiptPurchaseMain; import com.wansenai.entities.receipt.ReceiptPurchaseSub; -import com.wansenai.entities.receipt.ReceiptRetailSub; import com.wansenai.entities.system.SysFile; import com.wansenai.mappers.product.ProductStockKeepUnitMapper; import com.wansenai.mappers.product.ProductStockMapper; @@ -30,6 +29,7 @@ import com.wansenai.mappers.system.SysFileMapper; import com.wansenai.service.basic.SupplierService; import com.wansenai.service.common.CommonService; +import com.wansenai.service.financial.IFinancialAccountService; import com.wansenai.service.receipt.ReceiptPurchaseService; import com.wansenai.service.receipt.ReceiptPurchaseSubService; import com.wansenai.service.user.ISysUserService; @@ -63,8 +63,9 @@ public class ReceiptPurchaseServiceImpl extends ServiceImpl> receiptSubListCache = new ConcurrentHashMap<>(); @@ -105,6 +107,10 @@ private String getUserName(Long userId) { return (userId != null) ? userService.getById(userId).getName() : null; } + private String getWarehouseName(Long warehouseId) { + return (warehouseId != null) ? commonService.getWarehouseName(warehouseId) : null; + } + private List parseAndCollectLongList(String input) { if (StringUtils.hasLength(input)) { return Arrays.stream(input.split(",")) @@ -131,9 +137,16 @@ private PurchaseDataBO createPurchaseDataFromReceiptSub(ReceiptPurchaseSub item) var data = productStockKeepUnitMapper.getProductSkuByBarCode(item.getProductBarcode(), item.getWarehouseId()); if (data != null) { purchaseData.setProductName(data.getProductName()); + purchaseData.setProductModel(data.getProductModel()); purchaseData.setProductStandard(data.getProductStandard()); + purchaseData.setProductColor(data.getProductColor()); purchaseData.setProductUnit(data.getProductUnit()); + purchaseData.setProductStandard(data.getProductStandard()); purchaseData.setStock(data.getStock()); + + if(purchaseData.getWarehouseId() != null) { + purchaseData.setWarehouseName(getWarehouseName(purchaseData.getWarehouseId())); + } } return purchaseData; } @@ -291,32 +304,43 @@ public Response> getPurchaseOrderPage(QueryPurchaseOrderDT return Response.responseData(result); } - @Override - public Response getPurchaseOrderDetail(Long id) { - if (id == null) { - return Response.responseMsg(BaseCodeEnum.PARAMETER_NULL); - } - var purchaseMain = getById(id); + private PurchaseOrderDetailVO createPurchaseOrderDetail(ReceiptPurchaseMain purchaseMain) { List fileList = commonService.getFileList(purchaseMain.getFileId()); var receiptSubList = receiptPurchaseSubService.lambdaQuery() - .eq(ReceiptPurchaseSub::getReceiptPurchaseMainId, id) + .eq(ReceiptPurchaseSub::getReceiptPurchaseMainId, purchaseMain.getId()) .list(); - var tableData = new ArrayList(receiptSubList.size() + 1); - for (ReceiptPurchaseSub item : receiptSubList) { - var purchaseData = createPurchaseDataFromReceiptSub(item); - tableData.add(purchaseData); - } + var tableData = receiptSubList.stream() + .map(this::createPurchaseDataFromReceiptSub) + .collect(Collectors.toCollection(ArrayList::new)); var multipleAccountIds = parseAndCollectLongList(purchaseMain.getMultipleAccount()); var multipleAccountAmounts = parseAndCollectLongList(purchaseMain.getMultipleAccountAmount()); - var purchaseOrderDetailVO = PurchaseOrderDetailVO.builder() + var accountName = ""; + if(!multipleAccountIds.isEmpty() && !multipleAccountAmounts.isEmpty()) { + var accountNameList = new ArrayList(); + for (int i = 0; i < multipleAccountIds.size(); i++) { + var account = accountService.getById(multipleAccountIds.get(i)); + var accountAmount = multipleAccountAmounts.get(i); + accountNameList.add(account.getAccountName() + "(" + accountAmount + "元)"); + } + accountName = StringUtils.collectionToCommaDelimitedString(accountNameList); + } else { + var account = accountService.getById(purchaseMain.getAccountId()); + if (account != null) { + accountName = account.getAccountName(); + } + } + + return PurchaseOrderDetailVO.builder() .receiptNumber(purchaseMain.getReceiptNumber()) .receiptDate(purchaseMain.getReceiptDate()) .supplierId(purchaseMain.getSupplierId()) + .supplierName(getSupplierName(purchaseMain.getSupplierId())) .accountId(purchaseMain.getAccountId()) + .accountName(accountName) .discountRate(purchaseMain.getDiscountRate()) .discountAmount(purchaseMain.getDiscountAmount()) .discountLastAmount(purchaseMain.getDiscountLastAmount()) @@ -326,8 +350,31 @@ public Response getPurchaseOrderDetail(Long id) { .remark(purchaseMain.getRemark()) .tableData(tableData) .files(fileList) + .status(purchaseMain.getStatus()) .build(); + } + @Override + public Response getPurchaseOrderDetail(Long id) { + if (id == null) { + return Response.responseMsg(BaseCodeEnum.PARAMETER_NULL); + } + var purchaseMain = getById(id); + var purchaseOrderDetailVO = createPurchaseOrderDetail(purchaseMain); + return Response.responseData(purchaseOrderDetailVO); + } + + @Override + public Response getLinkPurchaseOrderDetail(String receiptNumber) { + if (!StringUtils.hasLength(receiptNumber)) { + return Response.responseMsg(BaseCodeEnum.PARAMETER_NULL); + } + var purchaseMain = lambdaQuery() + .eq(ReceiptPurchaseMain::getReceiptNumber, receiptNumber) + .eq(ReceiptPurchaseMain::getDeleteFlag, CommonConstants.NOT_DELETED) + .one(); + + var purchaseOrderDetailVO = createPurchaseOrderDetail(purchaseMain); return Response.responseData(purchaseOrderDetailVO); } @@ -512,31 +559,36 @@ public Response> getPurchaseStoragePage(QueryPurchaseSto return Response.responseData(result); } - @Override - public Response getPurchaseStorageDetail(Long id) { - if (id == null) { - return Response.responseMsg(BaseCodeEnum.PARAMETER_NULL); + private PurchaseStorageDetailVO createPurchaseStorageDetail(ReceiptPurchaseMain purchaseMain) { + if (purchaseMain == null) { + throw new IllegalArgumentException("purchaseMain cannot be null"); } - var purchaseMain = getById(id); - List fileList = commonService.getFileList(purchaseMain.getFileId()); - var receiptSubList = receiptPurchaseSubService.lambdaQuery() - .eq(ReceiptPurchaseSub::getReceiptPurchaseMainId, id) + List fileList = commonService.getFileList(purchaseMain.getFileId()); + List receiptSubList = receiptPurchaseSubService.lambdaQuery() + .eq(ReceiptPurchaseSub::getReceiptPurchaseMainId, purchaseMain.getId()) .list(); - var tableData = new ArrayList(receiptSubList.size() + 1); - for (ReceiptPurchaseSub item : receiptSubList) { - var purchaseData = createPurchaseDataFromReceiptSub(item); - tableData.add(purchaseData); - } + var tableData = receiptSubList.stream() + .map(this::createPurchaseDataFromReceiptSub) + .collect(Collectors.toCollection(ArrayList::new)); var multipleAccountIds = parseAndCollectLongList(purchaseMain.getMultipleAccount()); var multipleAccountAmounts = parseAndCollectLongList(purchaseMain.getMultipleAccountAmount()); - var purchasesStorageDetailVO = PurchaseStorageDetailVO.builder() + var accountName = createAccountName(multipleAccountIds, multipleAccountAmounts); + if (!StringUtils.hasLength(accountName)) { + var account = accountService.getById(purchaseMain.getAccountId()); + if (account != null) { + accountName = account.getAccountName(); + } + } + + return PurchaseStorageDetailVO.builder() .receiptNumber(purchaseMain.getReceiptNumber()) .receiptDate(purchaseMain.getReceiptDate()) .supplierId(purchaseMain.getSupplierId()) + .supplierName(getSupplierName(purchaseMain.getSupplierId())) .accountId(purchaseMain.getAccountId()) .paymentRate(purchaseMain.getDiscountRate()) .paymentAmount(purchaseMain.getDiscountAmount()) @@ -547,12 +599,47 @@ public Response getPurchaseStorageDetail(Long id) { .thisArrearsAmount(purchaseMain.getArrearsAmount()) .multipleAccountIds(multipleAccountIds) .multipleAccountAmounts(multipleAccountAmounts) + .accountName(accountName) .remark(purchaseMain.getRemark()) .status(purchaseMain.getStatus()) .tableData(tableData) .files(fileList) .build(); + } + private String createAccountName(List multipleAccountIds, List multipleAccountAmounts) { + if (multipleAccountIds.isEmpty() || multipleAccountAmounts.isEmpty()) { + return ""; + } + var accountNameList = new ArrayList(); + for (int i = 0; i < multipleAccountIds.size(); i++) { + var account = accountService.getById(multipleAccountIds.get(i)); + var accountAmount = multipleAccountAmounts.get(i); + accountNameList.add(account.getAccountName() + "(" + accountAmount + "元)"); + } + return StringUtils.collectionToCommaDelimitedString(accountNameList); + } + + @Override + public Response getPurchaseStorageDetail(Long id) { + if (id == null) { + return Response.responseMsg(BaseCodeEnum.PARAMETER_NULL); + } + var purchaseMain = getById(id); + var purchasesStorageDetailVO = createPurchaseStorageDetail(purchaseMain); + return Response.responseData(purchasesStorageDetailVO); + } + + @Override + public Response getLinkPurchaseStorageDetail(String receiptNumber) { + if (!StringUtils.hasLength(receiptNumber)) { + return Response.responseMsg(BaseCodeEnum.PARAMETER_NULL); + } + var purchaseMain = lambdaQuery() + .eq(ReceiptPurchaseMain::getReceiptNumber, receiptNumber) + .eq(ReceiptPurchaseMain::getDeleteFlag, CommonConstants.NOT_DELETED) + .one(); + var purchasesStorageDetailVO = createPurchaseStorageDetail(purchaseMain); return Response.responseData(purchasesStorageDetailVO); } @@ -760,25 +847,53 @@ public Response getPurchaseRefundDetail(Long id) { return Response.responseMsg(BaseCodeEnum.PARAMETER_NULL); } var purchaseMain = getById(id); - List fileList = commonService.getFileList(purchaseMain.getFileId()); + var purchasesStorageDetailVO = getPurchaseRefundDetail(purchaseMain); + return Response.responseData(purchasesStorageDetailVO); + } - var receiptSubList = receiptPurchaseSubService.lambdaQuery() - .eq(ReceiptPurchaseSub::getReceiptPurchaseMainId, id) - .list(); + @Override + public Response getLinkPurchaseRefundDetail(String receiptNumber) { + if (!StringUtils.hasLength(receiptNumber)) { + return Response.responseMsg(BaseCodeEnum.PARAMETER_NULL); + } + var purchaseMain = lambdaQuery() + .eq(ReceiptPurchaseMain::getReceiptNumber, receiptNumber) + .eq(ReceiptPurchaseMain::getDeleteFlag, CommonConstants.NOT_DELETED) + .one(); + var PurchaseRefundDetailVO = getPurchaseRefundDetail(purchaseMain); + return Response.responseData(PurchaseRefundDetailVO); + } - var tableData = new ArrayList(receiptSubList.size() + 1); - for (ReceiptPurchaseSub item : receiptSubList) { - var purchaseData = createPurchaseDataFromReceiptSub(item); - tableData.add(purchaseData); + private PurchaseRefundDetailVO getPurchaseRefundDetail(ReceiptPurchaseMain purchaseMain) { + if (purchaseMain == null) { + throw new IllegalArgumentException("purchaseMain cannot be null"); } + List fileList = commonService.getFileList(purchaseMain.getFileId()); + List receiptSubList = receiptPurchaseSubService.lambdaQuery() + .eq(ReceiptPurchaseSub::getReceiptPurchaseMainId, purchaseMain.getId()) + .list(); + + var tableData = receiptSubList.stream() + .map(this::createPurchaseDataFromReceiptSub) + .collect(Collectors.toCollection(ArrayList::new)); + var multipleAccountIds = parseAndCollectLongList(purchaseMain.getMultipleAccount()); var multipleAccountAmounts = parseAndCollectLongList(purchaseMain.getMultipleAccountAmount()); - var purchaseRefundDetailVO = PurchaseRefundDetailVO.builder() + var accountName = createAccountName(multipleAccountIds, multipleAccountAmounts); + if (!StringUtils.hasLength(accountName)) { + var account = accountService.getById(purchaseMain.getAccountId()); + if (account != null) { + accountName = account.getAccountName(); + } + } + + return PurchaseRefundDetailVO.builder() .receiptNumber(purchaseMain.getReceiptNumber()) .receiptDate(purchaseMain.getReceiptDate()) .supplierId(purchaseMain.getSupplierId()) + .supplierName(getSupplierName(purchaseMain.getSupplierId())) .accountId(purchaseMain.getAccountId()) .refundOfferRate(purchaseMain.getDiscountRate()) .refundOfferAmount(purchaseMain.getDiscountAmount()) @@ -789,13 +904,21 @@ public Response getPurchaseRefundDetail(Long id) { .thisArrearsAmount(purchaseMain.getArrearsAmount()) .multipleAccountIds(multipleAccountIds) .multipleAccountAmounts(multipleAccountAmounts) + .accountName(accountName) .remark(purchaseMain.getRemark()) .status(purchaseMain.getStatus()) .tableData(tableData) .files(fileList) .build(); + } - return Response.responseData(purchaseRefundDetailVO); + private List createTableDataList(List receiptSubList) { + var tableData = new ArrayList(receiptSubList.size() + 1); + for (ReceiptPurchaseSub item : receiptSubList) { + var purchaseData = createPurchaseDataFromReceiptSub(item); + tableData.add(purchaseData); + } + return tableData; } @Override From 8d0db18e7971865d1533c2432365be0e7ca08d22 Mon Sep 17 00:00:00 2001 From: jameszow Date: Mon, 13 Nov 2023 19:27:52 +0800 Subject: [PATCH 06/18] update: add two filed in purchase order detail (supplierName, accountName) --- .../wansenai/vo/receipt/purchase/PurchaseOrderDetailVO.java | 6 ++++++ .../vo/receipt/purchase/PurchaseRefundDetailVO.java | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/core/domain/src/main/java/com/wansenai/vo/receipt/purchase/PurchaseOrderDetailVO.java b/core/domain/src/main/java/com/wansenai/vo/receipt/purchase/PurchaseOrderDetailVO.java index a465ca13..8299f0ca 100644 --- a/core/domain/src/main/java/com/wansenai/vo/receipt/purchase/PurchaseOrderDetailVO.java +++ b/core/domain/src/main/java/com/wansenai/vo/receipt/purchase/PurchaseOrderDetailVO.java @@ -35,6 +35,8 @@ public class PurchaseOrderDetailVO { @JsonFormat(shape = JsonFormat.Shape.STRING) private Long supplierId; + private String supplierName; + @JsonFormat(shape = JsonFormat.Shape.STRING) private Long accountId; @@ -49,6 +51,8 @@ public class PurchaseOrderDetailVO { @JsonFormat(shape = JsonFormat.Shape.STRING) private List multipleAccountIds; + private String accountName; + @JsonSerialize(using = BigDecimalSerializerBO.class) private BigDecimal discountRate; @@ -66,4 +70,6 @@ public class PurchaseOrderDetailVO { private List files; private String remark; + + private Integer status; } diff --git a/core/domain/src/main/java/com/wansenai/vo/receipt/purchase/PurchaseRefundDetailVO.java b/core/domain/src/main/java/com/wansenai/vo/receipt/purchase/PurchaseRefundDetailVO.java index ce83dc5e..3ac52c7c 100644 --- a/core/domain/src/main/java/com/wansenai/vo/receipt/purchase/PurchaseRefundDetailVO.java +++ b/core/domain/src/main/java/com/wansenai/vo/receipt/purchase/PurchaseRefundDetailVO.java @@ -35,6 +35,8 @@ public class PurchaseRefundDetailVO { @JsonFormat(shape = JsonFormat.Shape.STRING) private Long supplierId; + private String supplierName; + private String receiptNumber; @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @@ -69,6 +71,8 @@ public class PurchaseRefundDetailVO { @JsonFormat(shape = JsonFormat.Shape.STRING) private List multipleAccountIds; + private String accountName; + private List tableData; private List files; From 9c212a61dfaee64d7ddef4042a8baddbc9143cc0 Mon Sep 17 00:00:00 2001 From: jameszow Date: Mon, 13 Nov 2023 19:27:59 +0800 Subject: [PATCH 07/18] update: add two filed in purchase order detail (supplierName, accountName) --- .../src/main/java/com/wansenai/bo/PurchaseDataBO.java | 6 ++++++ .../vo/receipt/purchase/PurchaseStorageDetailVO.java | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/core/domain/src/main/java/com/wansenai/bo/PurchaseDataBO.java b/core/domain/src/main/java/com/wansenai/bo/PurchaseDataBO.java index e81e1b87..49a8961b 100644 --- a/core/domain/src/main/java/com/wansenai/bo/PurchaseDataBO.java +++ b/core/domain/src/main/java/com/wansenai/bo/PurchaseDataBO.java @@ -30,6 +30,8 @@ public class PurchaseDataBO { @JsonFormat(shape = JsonFormat.Shape.STRING) private Long warehouseId; + private String warehouseName; + @JsonFormat(shape = JsonFormat.Shape.STRING) private Long barCode; @@ -39,8 +41,12 @@ public class PurchaseDataBO { private String productUnit; + private String productModel; + private String productStandard; + private String productColor; + private Integer stock; private Integer productNumber; diff --git a/core/domain/src/main/java/com/wansenai/vo/receipt/purchase/PurchaseStorageDetailVO.java b/core/domain/src/main/java/com/wansenai/vo/receipt/purchase/PurchaseStorageDetailVO.java index bb2aeb15..2f3d2274 100644 --- a/core/domain/src/main/java/com/wansenai/vo/receipt/purchase/PurchaseStorageDetailVO.java +++ b/core/domain/src/main/java/com/wansenai/vo/receipt/purchase/PurchaseStorageDetailVO.java @@ -35,6 +35,8 @@ public class PurchaseStorageDetailVO { @JsonFormat(shape = JsonFormat.Shape.STRING) private Long supplierId; + private String supplierName; + private String receiptNumber; @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @@ -69,6 +71,8 @@ public class PurchaseStorageDetailVO { @JsonFormat(shape = JsonFormat.Shape.STRING) private List multipleAccountIds; + private String accountName; + private List tableData; private List files; From f87859de16b5d651bb5b528851e48b4b6b7b856b Mon Sep 17 00:00:00 2001 From: jameszow Date: Mon, 13 Nov 2023 19:28:19 +0800 Subject: [PATCH 08/18] update: add detail api and data schma --- web/src/api/purchase/model/orderModel.ts | 20 +++++ web/src/api/purchase/order.ts | 11 ++- .../purchase/order/purchaseOrder.data.ts | 78 +++++++++++++++++++ 3 files changed, 108 insertions(+), 1 deletion(-) diff --git a/web/src/api/purchase/model/orderModel.ts b/web/src/api/purchase/model/orderModel.ts index adba4f6d..6861deb4 100644 --- a/web/src/api/purchase/model/orderModel.ts +++ b/web/src/api/purchase/model/orderModel.ts @@ -44,6 +44,26 @@ export interface AddOrUpdateReceiptReq { files: FileData[]; } +export interface LinkReceiptDetailResp { + id: number | string | undefined; + supplierId: string; + supplierName: string; + receiptNumber: string; + receiptDate: string; + discountRate: number; + discountAmount: number; + discountLastAmount: number; + deposit: number; + accountId: number | string; + accountName: string; + multipleAccountIds: number[]; + multipleAccountAmounts: number[]; + status: number; + remark: string; + tableData: PurchaseData[]; + files: FileData[]; +} + export interface PurchaseDetailData { supplierId: number | string; accountId: number; diff --git a/web/src/api/purchase/order.ts b/web/src/api/purchase/order.ts index 0ec63042..8724e5a7 100644 --- a/web/src/api/purchase/order.ts +++ b/web/src/api/purchase/order.ts @@ -3,7 +3,7 @@ import {BaseDataResp, BaseResp} from "@/api/model/baseModel"; import { QueryPurchaseOrderReq, AddOrUpdateReceiptReq, - PurchaseDetailData + PurchaseDetailData, LinkReceiptDetailResp } from "@/api/purchase/model/orderModel" enum API { @@ -12,6 +12,7 @@ enum API { GetDetail = '/purchase/order/detail', UpdateStatus = '/purchase/order/updateStatus', Delete = '/purchase/order/delete', + GetLinkOrderDetail = '/purchase/order/getLinkOrderDetail', } export function getPurchaseOrderPageList(params: QueryPurchaseOrderReq) { @@ -40,6 +41,14 @@ export function getPurchaseOrderDetail(id: string) { ); } +export function getLinkOrderDetail(receiptNumber: string) { + return defHttp.get>( + { + url: `${API.GetLinkOrderDetail}/${receiptNumber}`, + } + ); +} + export function updatePurchaseOrderStatus(ids: number[], status: number ) { return defHttp.put( { diff --git a/web/src/views/purchase/order/purchaseOrder.data.ts b/web/src/views/purchase/order/purchaseOrder.data.ts index 4d3bbeb6..bc6a1f06 100644 --- a/web/src/views/purchase/order/purchaseOrder.data.ts +++ b/web/src/views/purchase/order/purchaseOrder.data.ts @@ -132,4 +132,82 @@ export const searchFormSchema: FormSchema[] = [ }, } +] + +export const purchaseOrderTableColumns: BasicColumn[] = [ + { + title: '仓库名称', + dataIndex: 'warehouseName', + width: 100, + }, + { + title: '条码', + dataIndex: 'barCode', + width: 100, + }, + { + title: '商品名称', + dataIndex: 'productName', + width: 120, + }, + { + title: '规格', + dataIndex: 'productStandard', + width: 120, + }, + { + title: '型号', + dataIndex: 'productModel', + width: 120, + }, + { + title: '颜色', + dataIndex: 'productColor', + width: 70, + }, + { + title: '库存', + dataIndex: 'stock', + width: 80, + }, + { + title: '单位', + dataIndex: 'productUnit', + width: 60, + }, + { + title: '数量', + dataIndex: 'productNumber', + width: 60, + }, + { + title: '单价', + dataIndex: 'unitPrice', + width: 60, + }, + { + title: '金额', + dataIndex: 'amount', + width: 60, + }, + { + title: '税率(%)', + dataIndex: 'taxRate', + width: 60, + }, + { + title: '税额', + dataIndex: 'taxAmount', + width: 60, + }, + { + title: '税额', + dataIndex: 'taxTotalPrice', + width: 60, + }, + { + title: '备注', + dataIndex: 'remark', + width: 100, + }, ] \ No newline at end of file From 0ca87a28b749ddd6eb0cc33dfe23933289cdfd61 Mon Sep 17 00:00:00 2001 From: jameszow Date: Mon, 13 Nov 2023 19:28:28 +0800 Subject: [PATCH 09/18] update: add tooltip --- web/src/views/purchase/order/index.vue | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/web/src/views/purchase/order/index.vue b/web/src/views/purchase/order/index.vue index f1b82485..946a6463 100644 --- a/web/src/views/purchase/order/index.vue +++ b/web/src/views/purchase/order/index.vue @@ -14,7 +14,7 @@ :actions="[ { icon: 'clarity:info-standard-line', - tooltip: t('sys.user.viewUserDetails'), + tooltip: '查看单据详情', onClick: handleView.bind(null, record), }, { @@ -41,6 +41,7 @@ +
@@ -56,12 +57,15 @@ import {useI18n} from "vue-i18n"; import {Tag} from "ant-design-vue"; import {getPurchaseOrderPageList, updatePurchaseOrderStatus, deletePurchaseOrder} from "@/api/purchase/order"; import AddEditModal from "@/views/purchase/order/components/AddEditModal.vue"; +import ViewOrderModal from "@/views/purchase/order/components/ViewOrderModal.vue"; +import {useModal} from "@/components/Modal"; export default defineComponent({ name: 'PurchaseOrderModal', - components: {AddEditModal, Tag, TableAction, BasicTable}, + components: {AddEditModal, Tag, TableAction, BasicTable, ViewOrderModal}, setup() { const { t } = useI18n(); const addEditModalRef = ref(null); + const [receiptViewOrderModal, {openModal: openViewOrderModal}] = useModal(); const { createMessage } = useMessage(); const [registerTable, { reload, getSelectRows }] = useTable({ title: '采购订单列表', @@ -133,8 +137,11 @@ export default defineComponent({ await reload(); } - function handleView(){ - + function handleView(record: Recordable){ + openViewOrderModal(true, { + isUpdate: false, + receiptNumber: record.receiptNumber, + }); } const getTimestamp = (date) => { @@ -189,6 +196,7 @@ export default defineComponent({ handleView, handleOk, handleExport, + receiptViewOrderModal, } } }) From 4d9d54cfd275c161ade8069fc7510bcbe0a22537 Mon Sep 17 00:00:00 2001 From: jameszow Date: Mon, 13 Nov 2023 21:21:26 +0800 Subject: [PATCH 10/18] add: add sale order refund shipments detail views --- .../sales/order/components/ViewOrderModal.vue | 142 +++++++++++++++ .../refund/components/ViewRefundModal.vue | 168 ++++++++++++++++++ .../components/ViewShipmentsModal.vue | 168 ++++++++++++++++++ 3 files changed, 478 insertions(+) create mode 100644 web/src/views/sales/order/components/ViewOrderModal.vue create mode 100644 web/src/views/sales/refund/components/ViewRefundModal.vue create mode 100644 web/src/views/sales/shipments/components/ViewShipmentsModal.vue diff --git a/web/src/views/sales/order/components/ViewOrderModal.vue b/web/src/views/sales/order/components/ViewOrderModal.vue new file mode 100644 index 00000000..6ab24236 --- /dev/null +++ b/web/src/views/sales/order/components/ViewOrderModal.vue @@ -0,0 +1,142 @@ + + + diff --git a/web/src/views/sales/refund/components/ViewRefundModal.vue b/web/src/views/sales/refund/components/ViewRefundModal.vue new file mode 100644 index 00000000..8e0eba0f --- /dev/null +++ b/web/src/views/sales/refund/components/ViewRefundModal.vue @@ -0,0 +1,168 @@ + + + diff --git a/web/src/views/sales/shipments/components/ViewShipmentsModal.vue b/web/src/views/sales/shipments/components/ViewShipmentsModal.vue new file mode 100644 index 00000000..4056c30a --- /dev/null +++ b/web/src/views/sales/shipments/components/ViewShipmentsModal.vue @@ -0,0 +1,168 @@ + + + From 858454866e7d8dd185729d456cd64e5c450b7112 Mon Sep 17 00:00:00 2001 From: jameszow Date: Mon, 13 Nov 2023 21:21:40 +0800 Subject: [PATCH 11/18] update: update views edit --- web/src/views/sales/order/index.vue | 13 ++++++++++--- web/src/views/sales/refund/index.vue | 13 ++++++++++--- web/src/views/sales/shipments/index.vue | 13 ++++++++++--- 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/web/src/views/sales/order/index.vue b/web/src/views/sales/order/index.vue index 2ffebd8b..028767e1 100644 --- a/web/src/views/sales/order/index.vue +++ b/web/src/views/sales/order/index.vue @@ -41,6 +41,7 @@ +
@@ -56,13 +57,16 @@ import {useI18n} from "vue-i18n"; import {Tag} from "ant-design-vue"; import {getSaleOrderPageList, updateSaleOrderStatus, deleteSaleOrder} from "@/api/sale/order"; import AddEditModal from "@/views/sales/order/components/AddEditModal.vue"; +import ViewOrderModal from "@/views/sales/order/components/ViewOrderModal.vue"; +import {useModal} from "@/components/Modal"; export default defineComponent({ name: 'SaleOrderModal', - components: {AddEditModal, Tag, TableAction, BasicTable}, + components: {AddEditModal, Tag, TableAction, BasicTable, ViewOrderModal}, setup() { const { t } = useI18n(); const addEditModalRef = ref(null); const { createMessage } = useMessage(); + const [viewOrderReceiptModal, {openModal: openViewOrderReceiptModal}] = useModal(); const [registerTable, { reload, getSelectRows }] = useTable({ title: '销售订单列表', rowKey: 'id', @@ -133,8 +137,10 @@ export default defineComponent({ await reload(); } - function handleView(){ - + function handleView(record: Recordable){ + openViewOrderReceiptModal(true, { + receiptNumber: record.receiptNumber + }); } const getTimestamp = (date) => { @@ -178,6 +184,7 @@ export default defineComponent({ return { t, addEditModalRef, + viewOrderReceiptModal, registerTable, handleCreate, handleDelete, diff --git a/web/src/views/sales/refund/index.vue b/web/src/views/sales/refund/index.vue index aaf4d564..22036960 100644 --- a/web/src/views/sales/refund/index.vue +++ b/web/src/views/sales/refund/index.vue @@ -41,6 +41,7 @@ +
@@ -56,13 +57,16 @@ import {useI18n} from "vue-i18n"; import {Tag} from "ant-design-vue"; import {getSaleRefundPageList, updateSaleRefundStatus, deleteSaleRefund} from "@/api/sale/refund"; import AddEditModal from "@/views/sales/refund/components/AddEditModal.vue"; +import ViewShipmentModal from "@/views/sales/shipments/components/ViewShipmentsModal.vue"; +import {useModal} from "@/components/Modal"; export default defineComponent({ name: 'SaleRefundModal', - components: {Tag, TableAction, BasicTable, AddEditModal}, + components: {ViewShipmentModal, Tag, TableAction, BasicTable, AddEditModal}, setup() { const { t } = useI18n(); const addEditModalRef = ref(null); const { createMessage } = useMessage(); + const [viewShipmentReceiptModal, {openModal: openViewShipmentReceiptModal}] = useModal() const [registerTable, { reload, getSelectRows }] = useTable({ title: '销售退货列表', rowKey: 'id', @@ -133,8 +137,10 @@ export default defineComponent({ await reload(); } - function handleView(){ - + function handleView(record: Recordable){ + openViewShipmentReceiptModal(true, { + receiptNumber: record.receiptNumber + }); } const getTimestamp = (date) => { @@ -189,6 +195,7 @@ export default defineComponent({ handleView, handleOk, handleExport, + viewShipmentReceiptModal } } }) diff --git a/web/src/views/sales/shipments/index.vue b/web/src/views/sales/shipments/index.vue index df3e45cb..dbcffe08 100644 --- a/web/src/views/sales/shipments/index.vue +++ b/web/src/views/sales/shipments/index.vue @@ -41,6 +41,7 @@ +
@@ -56,13 +57,16 @@ import {useI18n} from "vue-i18n"; import {Tag} from "ant-design-vue"; import {getSaleShipmentsPageList, updateSaleShipmentsStatus, deleteSaleShipments} from "@/api/sale/shipments"; import AddEditModal from "@/views/sales/shipments/components/AddEditModal.vue"; +import ViewShipmentModal from "@/views/sales/shipments/components/ViewShipmentsModal.vue"; +import {useModal} from "@/components/Modal"; export default defineComponent({ name: 'SaleShipmentsModal', - components: {AddEditModal, Tag, TableAction, BasicTable}, + components: {ViewShipmentModal, AddEditModal, Tag, TableAction, BasicTable}, setup() { const { t } = useI18n(); const addEditModalRef = ref(null); const { createMessage } = useMessage(); + const [viewShipmentReceiptModal, {openModal: openViewShipmentReceiptModal}] = useModal() const [registerTable, { reload, getSelectRows }] = useTable({ title: '销售出库列表', rowKey: 'id', @@ -133,8 +137,10 @@ export default defineComponent({ await reload(); } - function handleView(){ - + function handleView(record: Recordable){ + openViewShipmentReceiptModal(true, { + receiptNumber: record.receiptNumber + }); } const getTimestamp = (date) => { @@ -189,6 +195,7 @@ export default defineComponent({ handleView, handleOk, handleExport, + viewShipmentReceiptModal, } } }) From a8f2bac7a25d01e591eab4bb1e26e448cc0edd37 Mon Sep 17 00:00:00 2001 From: jameszow Date: Mon, 13 Nov 2023 21:22:03 +0800 Subject: [PATCH 12/18] fix: fix bug not add other receipt filed --- .../service/receipt/ReceiptSaleService.java | 33 ++++ .../receipt/impl/ReceiptSaleServiceImpl.java | 156 +++++++++++++++--- 2 files changed, 167 insertions(+), 22 deletions(-) diff --git a/core/service/src/main/java/com/wansenai/service/receipt/ReceiptSaleService.java b/core/service/src/main/java/com/wansenai/service/receipt/ReceiptSaleService.java index 0dbbf5a1..7a5b1b13 100644 --- a/core/service/src/main/java/com/wansenai/service/receipt/ReceiptSaleService.java +++ b/core/service/src/main/java/com/wansenai/service/receipt/ReceiptSaleService.java @@ -45,6 +45,17 @@ public interface ReceiptSaleService extends IService { */ Response getSaleOrderDetail(Long id); + /** + * Query sales order details data based on sales order number + * 根据销售订单编号查询销售订单详情数据 + * + * @param receiptNumber Sales order number + * 销售订单编号 + * @return Returns sales order details data + * 返回销售订单详情数据 + */ + Response getLinkSaleOrderDetail(String receiptNumber); + /** * Add/Update Sales Order Data * 新增/修改 销售订单数据 @@ -101,6 +112,17 @@ public interface ReceiptSaleService extends IService { */ Response getSaleShipmentsDetail(Long id); + /** + * Query sales delivery order details data based on sales delivery order number + * 根据销售出货单编号查询销售出货单详情数据 + * + * @param receiptNumber Sales delivery order number + * 销售出货单编号 + * @return Returns sales delivery order details data + * 返回销售出货单详情数据 + */ + Response getLinkSaleShipmentsDetail(String receiptNumber); + /** * Add or modify sales delivery orders * 新增或修改销售出货单 @@ -158,6 +180,17 @@ public interface ReceiptSaleService extends IService { */ Response getSaleRefundDetail(Long id); + /** + * Query sales return order details data based on sales return order number + * 根据销售退货单编号查询销售退货单详情数据 + * + * @param receiptNumber Sales return order number + * 销售退货单编号 + * @return Returns sales return order details data + * 返回销售退货单详情数据 + */ + Response getLinkSaleRefundDetail(String receiptNumber); + /** * Add or modify sales refund orders * 新增或修改销售退货单 diff --git a/core/service/src/main/java/com/wansenai/service/receipt/impl/ReceiptSaleServiceImpl.java b/core/service/src/main/java/com/wansenai/service/receipt/impl/ReceiptSaleServiceImpl.java index 8d2a73f0..b98de441 100644 --- a/core/service/src/main/java/com/wansenai/service/receipt/impl/ReceiptSaleServiceImpl.java +++ b/core/service/src/main/java/com/wansenai/service/receipt/impl/ReceiptSaleServiceImpl.java @@ -20,7 +20,6 @@ import com.wansenai.bo.SalesDataBO; import com.wansenai.dto.receipt.sale.*; import com.wansenai.entities.product.ProductStock; -import com.wansenai.entities.receipt.ReceiptRetailSub; import com.wansenai.entities.receipt.ReceiptSaleMain; import com.wansenai.entities.receipt.ReceiptSaleSub; import com.wansenai.entities.system.SysFile; @@ -30,6 +29,7 @@ import com.wansenai.mappers.system.SysFileMapper; import com.wansenai.service.basic.CustomerService; import com.wansenai.service.common.CommonService; +import com.wansenai.service.financial.IFinancialAccountService; import com.wansenai.service.receipt.ReceiptSaleService; import com.wansenai.service.receipt.ReceiptSaleSubService; import com.wansenai.service.user.ISysUserService; @@ -64,8 +64,9 @@ public class ReceiptSaleServiceImpl extends ServiceImpl> receiptSubListCache = new ConcurrentHashMap<>(); @@ -103,6 +105,10 @@ private String getCustomerName(Long customerId) { return (customerId != null) ? customerService.getById(customerId).getCustomerName() : null; } + private String getWarehouseName(Long warehouseId) { + return (warehouseId != null) ? commonService.getWarehouseName(warehouseId) : null; + } + private String getUserName(Long userId) { return (userId != null) ? userService.getById(userId).getName() : null; } @@ -131,10 +137,17 @@ private SalesDataBO createSalesDataFromReceiptSub(ReceiptSaleSub item) { var data = productStockKeepUnitMapper.getProductSkuByBarCode(item.getProductBarcode(), item.getWarehouseId()); if (data != null) { + saleData.setWarehouseId(data.getWarehouseId()); saleData.setProductName(data.getProductName()); saleData.setProductStandard(data.getProductStandard()); + saleData.setProductColor(data.getProductColor()); + saleData.setProductModel(data.getProductModel()); saleData.setProductUnit(data.getProductUnit()); saleData.setStock(data.getStock()); + + if(saleData.getWarehouseId() != null) { + saleData.setWarehouseName(getWarehouseName(saleData.getWarehouseId())); + } } return saleData; } @@ -300,34 +313,66 @@ public Response getSaleOrderDetail(Long id) { return Response.responseMsg(BaseCodeEnum.PARAMETER_NULL); } var sale = getById(id); + return buildSaleOrderDetailResponse(sale); + } + + @Override + public Response getLinkSaleOrderDetail(String receiptNumber) { + if (!StringUtils.hasLength(receiptNumber)) { + return Response.responseMsg(BaseCodeEnum.PARAMETER_NULL); + } + var sale = lambdaQuery() + .eq(ReceiptSaleMain::getReceiptNumber, receiptNumber) + .eq(ReceiptSaleMain::getDeleteFlag, CommonConstants.NOT_DELETED) + .one(); + return buildSaleOrderDetailResponse(sale); + } + private Response buildSaleOrderDetailResponse(ReceiptSaleMain sale) { List fileList = commonService.getFileList(sale.getFileId()); var receiptSubList = receiptSaleSubService.lambdaQuery() - .eq(ReceiptSaleSub::getReceiptSaleMainId, id) + .eq(ReceiptSaleSub::getReceiptSaleMainId, sale.getId()) .list(); - var tableData = new ArrayList(receiptSubList.size() + 1); - for (ReceiptSaleSub item : receiptSubList) { - var saleData = createSalesDataFromReceiptSub(item); - tableData.add(saleData); - } + var tableData = receiptSubList.stream() + .map(this::createSalesDataFromReceiptSub) + .collect(Collectors.toCollection(ArrayList::new)); var operatorIds = parseAndCollectLongList(sale.getOperatorId()); var multipleAccountIds = parseAndCollectLongList(sale.getMultipleAccount()); var multipleAccountAmounts = parseAndCollectLongList(sale.getMultipleAccountAmount()); + var accountName = ""; + if(!multipleAccountIds.isEmpty() && !multipleAccountAmounts.isEmpty()) { + var accountNameList = new ArrayList(); + for (int i = 0; i < multipleAccountIds.size(); i++) { + var account = accountService.getById(multipleAccountIds.get(i)); + var accountAmount = multipleAccountAmounts.get(i); + accountNameList.add(account.getAccountName() + "(" + accountAmount + "元)"); + } + accountName = StringUtils.collectionToCommaDelimitedString(accountNameList); + } else { + var account = accountService.getById(sale.getAccountId()); + if (account != null) { + accountName = account.getAccountName(); + } + } + var saleOrderDetailVO = SaleOrderDetailVO.builder() .receiptNumber(sale.getReceiptNumber()) .receiptDate(sale.getReceiptDate()) .customerId(sale.getCustomerId()) + .customerName(getCustomerName(sale.getCustomerId())) .accountId(sale.getAccountId()) + .accountName(accountName) .operatorIds(operatorIds) .discountRate(sale.getDiscountRate()) .discountAmount(sale.getDiscountAmount()) .discountLastAmount(sale.getDiscountLastAmount()) .multipleAccountIds(multipleAccountIds) .multipleAccountAmounts(multipleAccountAmounts) + .otherReceipt(sale.getOtherReceipt()) .deposit(sale.getDeposit()) .remark(sale.getRemark()) .tableData(tableData) @@ -520,40 +565,72 @@ public Response> getSaleShipmentsPage(QuerySaleShipmentsDT return Response.responseData(result); } - + @Override public Response getSaleShipmentsDetail(Long id) { if (id == null) { return Response.responseMsg(BaseCodeEnum.PARAMETER_NULL); } var sale = getById(id); + return buildSaleShipmentsDetailResponse(sale); + } + + @Override + public Response getLinkSaleShipmentsDetail(String receiptNumber) { + if (!StringUtils.hasLength(receiptNumber)) { + return Response.responseMsg(BaseCodeEnum.PARAMETER_NULL); + } + var sale = lambdaQuery() + .eq(ReceiptSaleMain::getReceiptNumber, receiptNumber) + .eq(ReceiptSaleMain::getDeleteFlag, CommonConstants.NOT_DELETED) + .one(); + return buildSaleShipmentsDetailResponse(sale); + } + private Response buildSaleShipmentsDetailResponse(ReceiptSaleMain sale) { List fileList = commonService.getFileList(sale.getFileId()); var receiptSaleSubs = receiptSaleSubService.lambdaQuery() - .eq(ReceiptSaleSub::getReceiptSaleMainId, id) + .eq(ReceiptSaleSub::getReceiptSaleMainId, sale.getId()) .list(); - var tableData = new ArrayList(receiptSaleSubs.size() + 1); - for (ReceiptSaleSub item : receiptSaleSubs) { - var saleData = createSalesDataFromReceiptSub(item); - tableData.add(saleData); - } + var tableData = receiptSaleSubs.stream() + .map(this::createSalesDataFromReceiptSub) + .collect(Collectors.toCollection(ArrayList::new)); var operatorIds = parseAndCollectLongList(sale.getOperatorId()); var multipleAccountIds = parseAndCollectLongList(sale.getMultipleAccount()); var multipleAccountAmounts = parseAndCollectLongList(sale.getMultipleAccountAmount()); + var accountName = ""; + if(!multipleAccountIds.isEmpty() && !multipleAccountAmounts.isEmpty()) { + var accountNameList = new ArrayList(); + for (int i = 0; i < multipleAccountIds.size(); i++) { + var account = accountService.getById(multipleAccountIds.get(i)); + var accountAmount = multipleAccountAmounts.get(i); + accountNameList.add(account.getAccountName() + "(" + accountAmount + "元)"); + } + accountName = StringUtils.collectionToCommaDelimitedString(accountNameList); + } else { + var account = accountService.getById(sale.getAccountId()); + if (account != null) { + accountName = account.getAccountName(); + } + } + var saleShipmentsDetail = SaleShipmentsDetailVO.builder() .receiptNumber(sale.getReceiptNumber()) .receiptDate(sale.getReceiptDate()) .customerId(sale.getCustomerId()) + .customerName(getCustomerName(sale.getCustomerId())) .accountId(sale.getAccountId()) + .accountName(accountName) .operatorIds(operatorIds) .collectOfferRate(sale.getDiscountRate()) .collectOfferAmount(sale.getDiscountAmount()) .collectOfferLastAmount(sale.getDiscountLastAmount()) .otherAmount(sale.getOtherAmount()) + .otherReceipt(sale.getOtherReceipt()) .thisCollectAmount(sale.getChangeAmount()) .thisArrearsAmount(sale.getArrearsAmount()) .multipleAccountIds(multipleAccountIds) @@ -597,6 +674,7 @@ public Response addOrUpdateSaleShipments(SaleShipmentsDTO shipmentsDTO) .set(shipmentsDTO.getThisCollectAmount() != null, ReceiptSaleMain::getChangeAmount, shipmentsDTO.getThisCollectAmount()) .set(shipmentsDTO.getThisArrearsAmount() != null, ReceiptSaleMain::getArrearsAmount, shipmentsDTO.getThisArrearsAmount()) .set(shipmentsDTO.getStatus() != null, ReceiptSaleMain::getStatus, shipmentsDTO.getStatus()) + .set(StringUtils.hasLength(shipmentsDTO.getOtherReceipt()), ReceiptSaleMain::getOtherReceipt, shipmentsDTO.getOtherReceipt()) .set(StringUtils.hasText(shipmentsDTO.getReceiptDate()), ReceiptSaleMain::getReceiptDate, shipmentsDTO.getReceiptDate()) .set(StringUtils.hasText(shipmentsDTO.getRemark()), ReceiptSaleMain::getRemark, shipmentsDTO.getRemark()) .set(ReceiptSaleMain::getAccountId, accountId) @@ -657,6 +735,7 @@ public Response addOrUpdateSaleShipments(SaleShipmentsDTO shipmentsDTO) .discountAmount(shipmentsDTO.getCollectOfferAmount()) .discountLastAmount(shipmentsDTO.getCollectOfferLastAmount()) .otherAmount(shipmentsDTO.getOtherAmount()) + .otherReceipt(shipmentsDTO.getOtherReceipt()) .changeAmount(shipmentsDTO.getThisCollectAmount()) .arrearsAmount(shipmentsDTO.getThisArrearsAmount()) .multipleAccount(multipleAccountIds) @@ -771,33 +850,64 @@ public Response getSaleRefundDetail(Long id) { return Response.responseMsg(BaseCodeEnum.PARAMETER_NULL); } var sale = getById(id); + return getSaleRefundDetailResponse(sale); + } - List fileList = commonService.getFileList(sale.getFileId()); + @Override + public Response getLinkSaleRefundDetail(String receiptNumber) { + if (!StringUtils.hasLength(receiptNumber)) { + return Response.responseMsg(BaseCodeEnum.PARAMETER_NULL); + } + var sale = lambdaQuery() + .eq(ReceiptSaleMain::getReceiptNumber, receiptNumber) + .eq(ReceiptSaleMain::getDeleteFlag, CommonConstants.NOT_DELETED) + .one(); + return getSaleRefundDetailResponse(sale); + } + private Response getSaleRefundDetailResponse(ReceiptSaleMain sale) { + List fileList = commonService.getFileList(sale.getFileId()); var receiptSaleSubs = receiptSaleSubService.lambdaQuery() - .eq(ReceiptSaleSub::getReceiptSaleMainId, id) + .eq(ReceiptSaleSub::getReceiptSaleMainId, sale.getId()) .list(); - var tableData = new ArrayList(receiptSaleSubs.size() + 1); - for (ReceiptSaleSub item : receiptSaleSubs) { - var saleData = createSalesDataFromReceiptSub(item); - tableData.add(saleData); - } + var tableData = receiptSaleSubs.stream() + .map(this::createSalesDataFromReceiptSub) + .collect(Collectors.toCollection(ArrayList::new)); var operatorIds = parseAndCollectLongList(sale.getOperatorId()); var multipleAccountIds = parseAndCollectLongList(sale.getMultipleAccount()); var multipleAccountAmounts = parseAndCollectLongList(sale.getMultipleAccountAmount()); + var accountName = ""; + if(!multipleAccountIds.isEmpty() && !multipleAccountAmounts.isEmpty()) { + var accountNameList = new ArrayList(); + for (int i = 0; i < multipleAccountIds.size(); i++) { + var account = accountService.getById(multipleAccountIds.get(i)); + var accountAmount = multipleAccountAmounts.get(i); + accountNameList.add(account.getAccountName() + "(" + accountAmount + "元)"); + } + accountName = StringUtils.collectionToCommaDelimitedString(accountNameList); + } else { + var account = accountService.getById(sale.getAccountId()); + if (account != null) { + accountName = account.getAccountName(); + } + } + var saleRefundDetail = SaleRefundDetailVO.builder() .receiptNumber(sale.getReceiptNumber()) .receiptDate(sale.getReceiptDate()) .customerId(sale.getCustomerId()) + .customerName(getCustomerName(sale.getCustomerId())) .accountId(sale.getAccountId()) + .accountName(accountName) .operatorIds(operatorIds) .refundOfferRate(sale.getDiscountRate()) .refundOfferAmount(sale.getDiscountAmount()) .refundLastAmount(sale.getDiscountLastAmount()) .otherAmount(sale.getOtherAmount()) + .otherReceipt(sale.getOtherReceipt()) .thisRefundAmount(sale.getChangeAmount()) .thisArrearsAmount(sale.getArrearsAmount()) .multipleAccountIds(multipleAccountIds) @@ -841,6 +951,7 @@ public Response addOrUpdateSaleRefund(SaleRefundDTO refundDTO) { .set(refundDTO.getThisRefundAmount() != null, ReceiptSaleMain::getChangeAmount, refundDTO.getThisRefundAmount()) .set(refundDTO.getThisArrearsAmount() != null, ReceiptSaleMain::getArrearsAmount, refundDTO.getThisArrearsAmount()) .set(refundDTO.getStatus() != null, ReceiptSaleMain::getStatus, refundDTO.getStatus()) + .set(StringUtils.hasLength(refundDTO.getOtherReceipt()), ReceiptSaleMain::getOtherReceipt, refundDTO.getOtherReceipt()) .set(StringUtils.hasText(refundDTO.getReceiptDate()), ReceiptSaleMain::getReceiptDate, refundDTO.getReceiptDate()) .set(StringUtils.hasText(refundDTO.getRemark()), ReceiptSaleMain::getRemark, refundDTO.getRemark()) .set(ReceiptSaleMain::getAccountId, accountId) @@ -901,6 +1012,7 @@ public Response addOrUpdateSaleRefund(SaleRefundDTO refundDTO) { .discountAmount(refundDTO.getRefundOfferAmount()) .discountLastAmount(refundDTO.getRefundLastAmount()) .otherAmount(refundDTO.getOtherAmount()) + .otherReceipt(refundDTO.getOtherReceipt()) .changeAmount(refundDTO.getThisRefundAmount()) .arrearsAmount(refundDTO.getThisArrearsAmount()) .multipleAccount(multipleAccountIds) From 23275476c58cf0a55c40550d5165f17da7d2a65e Mon Sep 17 00:00:00 2001 From: jameszow Date: Mon, 13 Nov 2023 21:22:21 +0800 Subject: [PATCH 13/18] add: add customer name and account name --- .../domain/src/main/java/com/wansenai/bo/SalesDataBO.java | 6 ++++++ .../com/wansenai/vo/receipt/sale/SaleOrderDetailVO.java | 8 ++++++++ .../com/wansenai/vo/receipt/sale/SaleRefundDetailVO.java | 4 ++++ .../wansenai/vo/receipt/sale/SaleShipmentsDetailVO.java | 6 ++++++ 4 files changed, 24 insertions(+) diff --git a/core/domain/src/main/java/com/wansenai/bo/SalesDataBO.java b/core/domain/src/main/java/com/wansenai/bo/SalesDataBO.java index f19b34ca..c02ff170 100644 --- a/core/domain/src/main/java/com/wansenai/bo/SalesDataBO.java +++ b/core/domain/src/main/java/com/wansenai/bo/SalesDataBO.java @@ -30,6 +30,8 @@ public class SalesDataBO { @JsonFormat(shape = JsonFormat.Shape.STRING) private Long warehouseId; + private String warehouseName; + @JsonFormat(shape = JsonFormat.Shape.STRING) private Long barCode; @@ -37,8 +39,12 @@ public class SalesDataBO { private String productName; + private String productModel; + private String productUnit; + private String productColor; + private String productStandard; private Integer stock; diff --git a/core/domain/src/main/java/com/wansenai/vo/receipt/sale/SaleOrderDetailVO.java b/core/domain/src/main/java/com/wansenai/vo/receipt/sale/SaleOrderDetailVO.java index 021d7868..af842ce7 100644 --- a/core/domain/src/main/java/com/wansenai/vo/receipt/sale/SaleOrderDetailVO.java +++ b/core/domain/src/main/java/com/wansenai/vo/receipt/sale/SaleOrderDetailVO.java @@ -35,9 +35,15 @@ public class SaleOrderDetailVO { @JsonFormat(shape = JsonFormat.Shape.STRING) private Long customerId; + private String customerName; + @JsonFormat(shape = JsonFormat.Shape.STRING) private Long accountId; + private String accountName; + + private String otherReceipt; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDateTime receiptDate; @@ -69,4 +75,6 @@ public class SaleOrderDetailVO { private List files; private String remark; + + private Integer status; } diff --git a/core/domain/src/main/java/com/wansenai/vo/receipt/sale/SaleRefundDetailVO.java b/core/domain/src/main/java/com/wansenai/vo/receipt/sale/SaleRefundDetailVO.java index 6308b514..3bd4ec8d 100644 --- a/core/domain/src/main/java/com/wansenai/vo/receipt/sale/SaleRefundDetailVO.java +++ b/core/domain/src/main/java/com/wansenai/vo/receipt/sale/SaleRefundDetailVO.java @@ -35,6 +35,10 @@ public class SaleRefundDetailVO { @JsonFormat(shape = JsonFormat.Shape.STRING) private Long customerId; + private String customerName; + + private String accountName; + private String receiptNumber; @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") diff --git a/core/domain/src/main/java/com/wansenai/vo/receipt/sale/SaleShipmentsDetailVO.java b/core/domain/src/main/java/com/wansenai/vo/receipt/sale/SaleShipmentsDetailVO.java index 1bb5c5b8..a934153b 100644 --- a/core/domain/src/main/java/com/wansenai/vo/receipt/sale/SaleShipmentsDetailVO.java +++ b/core/domain/src/main/java/com/wansenai/vo/receipt/sale/SaleShipmentsDetailVO.java @@ -37,6 +37,10 @@ public class SaleShipmentsDetailVO { private String receiptNumber; + private String customerName; + + private String accountName; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDateTime receiptDate; @@ -77,4 +81,6 @@ public class SaleShipmentsDetailVO { private List files; private String remark; + + private Integer status; } From 71886bd68cf22cfe10c568052a08af131b346ebe Mon Sep 17 00:00:00 2001 From: jameszow Date: Mon, 13 Nov 2023 21:22:42 +0800 Subject: [PATCH 14/18] add: add three api getLinkOrderDetail getLinkShipmentDetail getLinkRefundDetail --- .../com/wansenai/api/receipt/SalesController.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/core/api/src/main/java/com/wansenai/api/receipt/SalesController.java b/core/api/src/main/java/com/wansenai/api/receipt/SalesController.java index 71b1cde3..71cd0d3d 100644 --- a/core/api/src/main/java/com/wansenai/api/receipt/SalesController.java +++ b/core/api/src/main/java/com/wansenai/api/receipt/SalesController.java @@ -47,6 +47,11 @@ public Response detail(@PathVariable("id") Long id) { return receiptSaleService.getSaleOrderDetail(id); } + @GetMapping("/order/getLinkOrderDetail/{receiptNumber}") + public Response getLinkOrderDetail(@PathVariable("receiptNumber") String receiptNumber) { + return receiptSaleService.getLinkSaleOrderDetail(receiptNumber); + } + @PutMapping("/order/updateStatus/{ids}/{status}") public Response updateStatus(@PathVariable("ids") List ids, @PathVariable("status") Integer status) { return receiptSaleService.updateSaleOrderStatus(ids, status); @@ -72,6 +77,11 @@ public Response shipmentsDetail(@PathVariable("id") Long return receiptSaleService.getSaleShipmentsDetail(id); } + @GetMapping("/shipments/getLinkShipmentDetail/{receiptNumber}") + public Response getLinkShipmentDetail(@PathVariable("receiptNumber") String receiptNumber) { + return receiptSaleService.getLinkSaleShipmentsDetail(receiptNumber); + } + @PutMapping("/shipments/updateStatus/{ids}/{status}") public Response updateShipmentsStatus(@PathVariable("ids") List ids, @PathVariable("status") Integer status) { return receiptSaleService.updateSaleShipmentsStatus(ids, status); @@ -97,6 +107,11 @@ public Response refundDetail(@PathVariable("id") Long id) { return receiptSaleService.getSaleRefundDetail(id); } + @GetMapping("/refund/getLinkRefundDetail/{receiptNumber}") + public Response getLinkRefundDetail(@PathVariable("receiptNumber") String receiptNumber) { + return receiptSaleService.getLinkSaleRefundDetail(receiptNumber); + } + @PutMapping("/refund/updateStatus/{ids}/{status}") public Response updateRefundStatus(@PathVariable("ids") List ids, @PathVariable("status") Integer status) { return receiptSaleService.updateSaleRefundStatus(ids, status); From 3b88439096fe9c813bcc04f5e4196001d4001d4d Mon Sep 17 00:00:00 2001 From: jameszow Date: Mon, 13 Nov 2023 21:23:02 +0800 Subject: [PATCH 15/18] add: add getLinkOrderDetail api --- web/src/api/sale/model/orderModel.ts | 21 +++++++++++++++++++++ web/src/api/sale/order.ts | 12 +++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/web/src/api/sale/model/orderModel.ts b/web/src/api/sale/model/orderModel.ts index b5f68efb..e4274877 100644 --- a/web/src/api/sale/model/orderModel.ts +++ b/web/src/api/sale/model/orderModel.ts @@ -46,6 +46,27 @@ export interface AddOrUpdateReceiptReq { files: FileData[]; } +export interface LinkReceiptSaleOrderDetailResp { + id: number | string | undefined; + customerId: string; + customerName: string; + accountName: string; + receiptNumber: string; + receiptDate: string; + operatorIds: number[]; + discountRate: number; + discountAmount: number; + discountLastAmount: number; + deposit: number; + accountId: number | string; + multipleAccountIds: number[]; + multipleAccountAmounts: number[]; + status: number; + remark: string; + tableData: SalesData[]; + files: FileData[]; +} + export interface SaleDetailData { customerId: number | string; receiptDate: string; diff --git a/web/src/api/sale/order.ts b/web/src/api/sale/order.ts index c33b5061..955c5959 100644 --- a/web/src/api/sale/order.ts +++ b/web/src/api/sale/order.ts @@ -3,7 +3,8 @@ import {BaseDataResp, BaseResp} from "@/api/model/baseModel"; import { QuerySaleOrderReq, AddOrUpdateReceiptReq, - SaleDetailData + SaleDetailData, + LinkReceiptSaleOrderDetailResp } from "@/api/sale/model/orderModel" enum API { @@ -12,6 +13,7 @@ enum API { GetDetail = '/sale/order/detail', UpdateStatus = '/sale/order/updateStatus', Delete = '/sale/order/delete', + GetLinkOrderDetail = '/sale/order/getLinkOrderDetail', } export function getSaleOrderPageList(params: QuerySaleOrderReq) { @@ -54,4 +56,12 @@ export function deleteSaleOrder(ids: number[]) { url: `${API.Delete}/${ids}`, } ); +} + +export function getLinkOrderDetail(receiptNumber: string) { + return defHttp.get>( + { + url: `${API.GetLinkOrderDetail}/${receiptNumber}`, + } + ); } \ No newline at end of file From eb3f594605063b1626085ad8b8320a02170022e4 Mon Sep 17 00:00:00 2001 From: jameszow Date: Mon, 13 Nov 2023 21:23:16 +0800 Subject: [PATCH 16/18] add: add getLinkShipmentsDetail api --- web/src/api/sale/model/refundModel.ts | 24 ++++++++++++++++++++++++ web/src/api/sale/refund.ts | 12 +++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/web/src/api/sale/model/refundModel.ts b/web/src/api/sale/model/refundModel.ts index 8c5cbf3c..c9ea1f60 100644 --- a/web/src/api/sale/model/refundModel.ts +++ b/web/src/api/sale/model/refundModel.ts @@ -50,6 +50,30 @@ export interface AddOrUpdateReceiptSaleRefundReq { files: FileData[]; } +export interface LinkReceiptSaleRefundDetailResp { + id: number | string | undefined; + customerId: string; + customerName: string; + accountName: string; + receiptNumber: string; + receiptDate: string; + otherReceipt: string; + operatorIds: number[]; + refundOfferRate: number; + refundOfferAmount: number; + refundLastAmount: number; + otherAmount: number; + thisRefundAmount: number; + thisArrearsAmount: number; + accountId: number | string; + multipleAccountIds: number[]; + multipleAccountAmounts: number[]; + status: number; + remark: string; + tableData: SaleRefundTableData[]; + files: FileData[]; +} + export interface SaleRefundDetailData { customerId: number | string; receiptDate: string; diff --git a/web/src/api/sale/refund.ts b/web/src/api/sale/refund.ts index a506ac1e..eeb48d88 100644 --- a/web/src/api/sale/refund.ts +++ b/web/src/api/sale/refund.ts @@ -3,7 +3,8 @@ import {BaseDataResp, BaseResp} from "@/api/model/baseModel"; import { QuerySaleRefundReq, AddOrUpdateReceiptSaleRefundReq, - SaleRefundDetailData + SaleRefundDetailData, + LinkReceiptSaleRefundDetailResp } from "@/api/sale/model/refundModel" enum API { @@ -12,6 +13,7 @@ enum API { GetDetail = '/sale/refund/detail', UpdateStatus = '/sale/refund/updateStatus', Delete = '/sale/refund/delete', + GetLinkRefundDetail = '/sale/refund/getLinkRefundDetail', } export function getSaleRefundPageList(params: QuerySaleRefundReq) { @@ -54,4 +56,12 @@ export function deleteSaleRefund(ids: number[]) { url: `${API.Delete}/${ids}`, } ); +} + +export function getLinkRefundDetail(receiptNumber: string) { + return defHttp.get>( + { + url: `${API.GetLinkRefundDetail}/${receiptNumber}`, + } + ); } \ No newline at end of file From 5bec7de3ebc9d6ac30a7dd1e49d9c9520791da91 Mon Sep 17 00:00:00 2001 From: jameszow Date: Mon, 13 Nov 2023 21:23:30 +0800 Subject: [PATCH 17/18] add: add getLinkShipmentsDetail api --- web/src/api/sale/shipments.ts | 12 +++- web/src/views/sales/order/sales.data.ts | 78 +++++++++++++++++++++++++ 2 files changed, 89 insertions(+), 1 deletion(-) diff --git a/web/src/api/sale/shipments.ts b/web/src/api/sale/shipments.ts index 199e0f47..d7c04b82 100644 --- a/web/src/api/sale/shipments.ts +++ b/web/src/api/sale/shipments.ts @@ -3,7 +3,8 @@ import {BaseDataResp, BaseResp} from "@/api/model/baseModel"; import { QuerySaleShipmentsReq, AddOrUpdateReceiptSaleShipmentsReq, - SaleShipmentDetailData + SaleShipmentDetailData, + LinkReceiptSaleShipmentsDetailResp } from "@/api/sale/model/shipmentsModel" enum API { @@ -12,6 +13,7 @@ enum API { GetDetail = '/sale/shipments/detail', UpdateStatus = '/sale/shipments/updateStatus', Delete = '/sale/shipments/delete', + GetLinkShipmentsDetail = '/sale/shipments/getLinkShipmentDetail', } export function getSaleShipmentsPageList(params: QuerySaleShipmentsReq) { @@ -54,4 +56,12 @@ export function deleteSaleShipments(ids: number[]) { url: `${API.Delete}/${ids}`, } ); +} + +export function getLinkShipmentsDetail(receiptNumber: string) { + return defHttp.get>( + { + url: `${API.GetLinkShipmentsDetail}/${receiptNumber}`, + } + ); } \ No newline at end of file diff --git a/web/src/views/sales/order/sales.data.ts b/web/src/views/sales/order/sales.data.ts index 9947c956..d49d9282 100644 --- a/web/src/views/sales/order/sales.data.ts +++ b/web/src/views/sales/order/sales.data.ts @@ -132,4 +132,82 @@ export const searchFormSchema: FormSchema[] = [ }, } +] + +export const TableColumns: BasicColumn[] = [ + { + title: '仓库名称', + dataIndex: 'warehouseName', + width: 100, + }, + { + title: '条码', + dataIndex: 'barCode', + width: 100, + }, + { + title: '商品名称', + dataIndex: 'productName', + width: 120, + }, + { + title: '规格', + dataIndex: 'productStandard', + width: 120, + }, + { + title: '型号', + dataIndex: 'productModel', + width: 120, + }, + { + title: '颜色', + dataIndex: 'productColor', + width: 70, + }, + { + title: '库存', + dataIndex: 'stock', + width: 80, + }, + { + title: '单位', + dataIndex: 'productUnit', + width: 60, + }, + { + title: '数量', + dataIndex: 'productNumber', + width: 60, + }, + { + title: '单价', + dataIndex: 'unitPrice', + width: 60, + }, + { + title: '金额', + dataIndex: 'amount', + width: 60, + }, + { + title: '税率(%)', + dataIndex: 'taxRate', + width: 60, + }, + { + title: '税额', + dataIndex: 'taxAmount', + width: 60, + }, + { + title: '税额', + dataIndex: 'taxTotalPrice', + width: 60, + }, + { + title: '备注', + dataIndex: 'remark', + width: 100, + }, ] \ No newline at end of file From 1f8b3ca8070c55ae93ff1326c6c10e756d62c3b4 Mon Sep 17 00:00:00 2001 From: jameszow Date: Mon, 13 Nov 2023 21:23:48 +0800 Subject: [PATCH 18/18] add: add interface in ts LinkReceiptSaleShipmentsDetailResp --- web/src/api/sale/model/shipmentsModel.ts | 24 +++++++++++++++++++ .../order/components/ViewOrderModal.vue | 8 +------ 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/web/src/api/sale/model/shipmentsModel.ts b/web/src/api/sale/model/shipmentsModel.ts index 4b115507..53744f2a 100644 --- a/web/src/api/sale/model/shipmentsModel.ts +++ b/web/src/api/sale/model/shipmentsModel.ts @@ -50,6 +50,30 @@ export interface AddOrUpdateReceiptSaleShipmentsReq { files: FileData[]; } +export interface LinkReceiptSaleShipmentsDetailResp { + id: number | string | undefined; + customerId: string; + customerName: string; + accountName: string; + receiptNumber: string; + receiptDate: string; + otherReceipt: string; + operatorIds: number[]; + collectOfferRate: number; + collectOfferAmount: number; + collectOfferLastAmount: number; + otherAmount: number; + thisCollectAmount: number; + thisArrearsAmount: number; + accountId: number | string; + multipleAccountIds: number[]; + multipleAccountAmounts: number[]; + status: number; + remark: string; + tableData: tableData[]; + files: FileData[]; +} + export interface SaleShipmentDetailData { customerId: number | string; receiptDate: string; diff --git a/web/src/views/purchase/order/components/ViewOrderModal.vue b/web/src/views/purchase/order/components/ViewOrderModal.vue index 35a4b8fd..7b846666 100644 --- a/web/src/views/purchase/order/components/ViewOrderModal.vue +++ b/web/src/views/purchase/order/components/ViewOrderModal.vue @@ -118,11 +118,6 @@ export default defineComponent({ function handleSubmit() { closeModal(); } - - function viewRefundReceipt() { - closeModal(); - } - return { receiptNumber, otherReceipt, @@ -138,8 +133,7 @@ export default defineComponent({ registerTable, registerModal, getTitle, - handleSubmit, - viewRefundReceipt + handleSubmit }; }, });