Skip to content

Commit

Permalink
Merge pull request #235 from Jzow/master
Browse files Browse the repository at this point in the history
Add allot shipments receipt views and api
  • Loading branch information
Jzow authored Nov 25, 2023
2 parents eff470f + df404f2 commit 3997b58
Show file tree
Hide file tree
Showing 15 changed files with 1,861 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
* with the License. A copy of the License is located at
*
* http://opensource.wansenai.com/apache2.0/
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
* OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.wansenai.api.warehouse;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wansenai.dto.warehouse.AllotReceiptDTO;
import com.wansenai.dto.warehouse.QueryAllotReceiptDTO;
import com.wansenai.service.warehouse.AllotShipmentsService;
import com.wansenai.utils.response.Response;
import com.wansenai.vo.warehouse.AllotReceiptDetailVO;
import com.wansenai.vo.warehouse.AllotReceiptVO;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

@RestController
@RequestMapping("warehouse/allotShipments")
public class AllotShipmentsController {

private final AllotShipmentsService allotShipmentsService;

public AllotShipmentsController(AllotShipmentsService allotShipmentsService) {
this.allotShipmentsService = allotShipmentsService;
}

@PostMapping("addOrUpdate")
public Response<String> addOrUpdateAllotShipments(@RequestBody AllotReceiptDTO allotReceiptDTO) {
return allotShipmentsService.addOrUpdateAllotReceipt(allotReceiptDTO);
}

@PostMapping("pageList")
public Response<Page<AllotReceiptVO>> getAllotShipmentsPageList(@RequestBody QueryAllotReceiptDTO queryAllotReceiptDTO) {
return allotShipmentsService.getAllotReceiptPageList(queryAllotReceiptDTO);
}

@GetMapping("getDetailById/{id}")
public Response<AllotReceiptDetailVO> getAllotShipmentsDetailById(@PathVariable("id") Long id) {
return allotShipmentsService.getAllotReceiptDetail(id);
}

@PutMapping("deleteByIds")
public Response<String> deleteAllotShipmentsByIds(@RequestParam("ids") List<Long> ids) {
return allotShipmentsService.deleteBatchAllotReceipt(ids);
}

@PutMapping("updateStatusByIds")
public Response<String> updateAllotShipmentsStatusByIds(@RequestParam("ids") List<Long> ids, @RequestParam("status") Integer status) {
return allotShipmentsService.updateAllotReceiptStatus(ids, status);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ public class QueryAllotReceiptDTO {

private String productInfo;

private Long warehouseId;

private Long operatorId;

private Integer status;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ public class QueryOtherShipmentDTO {

private Long customerId;

private Long warehouseId;

private Long operatorId;

private String otherReceipt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ public class WarehouseReceiptSub {
*/
private Long warehouseId;

/**
* 调拨对方仓库ID (这是调入方的仓库ID)
*/
private Long otherWarehouseId;

/**
* 商品条码
*/
Expand Down

Large diffs are not rendered by default.

63 changes: 63 additions & 0 deletions web/src/api/warehouse/allotShipments.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import {defHttp} from '/@/utils/http/axios';
import { ErrorMessageMode } from '/#/axios';
import {BaseDataResp, BaseResp} from "@/api/model/baseModel";
import {
AddOrUpdateAllotShipmentsReq,
QueryAllotShipmentsReq,
AllotShipmentsResp,
AllotShipmentsDetailResp,
} from "@/api/warehouse/model/allotShipmentsModel";

enum API {
PageList = '/warehouse/allotShipments/pageList',
AddOrUpdateAccount = '/warehouse/allotShipments/addOrUpdate',
DeleteBatch = '/warehouse/allotShipments/deleteByIds',
UpdateStatus = '/warehouse/allotShipments/updateStatusByIds',
GetDetail = '/warehouse/allotShipments/getDetailById',
}

export function getAllotShipmentsPageList(params: QueryAllotShipmentsReq, mode: ErrorMessageMode = 'notice') {
return defHttp.post<BaseDataResp<AllotShipmentsResp>>(
{
url: API.PageList,
params,
},
{
errorMessageMode: mode,
successMessageMode: mode,
},
);
}

export function addOrUpdateAllotShipments(params: AddOrUpdateAllotShipmentsReq) {
return defHttp.post<BaseResp>(
{
url: API.AddOrUpdateAccount,
params,
},
);
}

export function updateAllotShipmentsStatus(ids: number[], status: number) {
return defHttp.put<BaseResp>(
{
url: `${API.UpdateStatus}?ids=${ids}&status=${status}`
},
);
}

export function deleteBatchAllotShipments(ids: number[]) {
return defHttp.put<BaseResp>(
{
url: `${API.DeleteBatch}?ids=${ids}`
},
);
}

export function getAllotShipmentsDetailById(id: number) {
return defHttp.get<BaseDataResp<AllotShipmentsDetailResp>>(
{
url: `${API.GetDetail}/${id}`
},
);
}
60 changes: 60 additions & 0 deletions web/src/api/warehouse/model/allotShipmentsModel.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import {FileData} from "@/api/financial/model/advanceModel";

export interface AllotShipmentsData {
id: number | string;
warehouseId: number | string;
warehouseName: string;
otherWarehouseId: number | string;
otherWarehouseName: string;
barCode: string;
productId: number | string;
productName: string;
productModel: string;
productUnit: string;
productStandard: string;
stock: number;
productNumber: number;
unitPrice: number;
amount: number;
remark: string;
}

export interface AddOrUpdateAllotShipmentsReq {
id: number | undefined;
receiptNumber: string;
receiptDate: string;
remark: string;
status: number;
files: FileData[];
tableData: AllotShipmentsData[];
}

export interface QueryAllotShipmentsReq {
receiptNumber: string;
productInfo: string;
operatorId: number;
otherReceipt: string;
status: number;
remark: string;
}

export interface AllotShipmentsResp {
id: string | undefined;
receiptNumber: string;
productInfo: string;
receiptDate: string;
operator: string;
productNumber: number;
totalAmount: number;
status: number;
}

export interface AllotShipmentsDetailResp {
id: string | undefined;
receiptNumber: string;
receiptDate: string;
remark: string;
status: number;
files: FileData[];
tableData: AllotShipmentsData[];
}
173 changes: 173 additions & 0 deletions web/src/views/warehouse/allot/allotShipments.data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
import {FormSchema} from "@/components/Form";
import {BasicColumn} from "@/components/Table";
import {getUserOperatorList} from "@/api/sys/user";

export const columns: BasicColumn[] = [
{
title: '单据编号',
dataIndex: 'receiptNumber',
width: 130,
},
{
title: '商品信息',
dataIndex: 'productInfo',
width: 150,
},
{
title: '单据日期',
dataIndex: 'receiptDate',
width: 130,
},
{
title: '数量',
dataIndex: 'productNumber',
width: 100,
},
{
title: '金额合计',
dataIndex: 'totalAmount',
width: 70,
},
{
title: '操作员',
dataIndex: 'operator',
width: 70,
},
{
title: '状态',
dataIndex: 'status',
width: 70,
},
]

export const searchFormSchema: FormSchema[] = [
{
label: '单据编号',
field: 'receiptNumber',
component: 'Input',
colProps: {
xl: 8,
xxl: 8,
},
},
{
field: '[startDate, endDate]',
label: '单据日期',
component: 'RangePicker',
componentProps: {
format: 'YYYY/MM/DD',
placeholder: ['开始日期', '结束日期'],
},
colProps: {
xl: 8,
xxl: 8,
},
},
{
label: '操作员',
field: 'operatorId',
component: 'ApiSelect',
componentProps: {
api: getUserOperatorList,
resultField: 'data',
labelField: 'name',
valueField: 'id',
},
colProps: {
xl: 8,
xxl: 8,
},
},
{
label: '单据状态',
field: 'status',
component: 'Select',
colProps: {
xl: 8,
xxl: 8,
},
componentProps: {
options: [
{ label: '未审核', value: 0, key: 0 },
{ label: '已审核', value: 1, key: 1 },
],
},
},
{
label: '单据备注',
field: 'remark',
component: 'Input',
colProps: {
xl: 8,
xxl: 8,
},
}
]

export const allotShipmentTableColumns: BasicColumn[] = [
{
title: '调出方仓库',
dataIndex: 'warehouseName',
width: 100,
},
{
title: '调入方仓库',
dataIndex: 'otherWarehouseName',
width: 100,
},
{
title: '条码',
dataIndex: 'barCode',
width: 120,
},
{
title: '商品名称',
dataIndex: 'productName',
width: 150,
},
{
title: '单位',
dataIndex: 'productUnit',
width: 70,
},
{
title: '商品规格',
dataIndex: 'productStandard',
width: 130,
},
{
title: '商品型号',
dataIndex: 'productModel',
width: 130,
},
{
title: '扩展信息',
dataIndex: 'productExtendInfo',
width: 150,
},
{
title: '库存',
dataIndex: 'stock',
width: 70,
},
{
title: '数量',
dataIndex: 'productNumber',
width: 70,
},
{
title: '单价',
dataIndex: 'unitPrice',
width: 70,
},
{
title: '金额',
dataIndex: 'amount',
width: 70,
},
{
title: '备注',
dataIndex: 'remark',
width: 130,
},
]
Loading

0 comments on commit 3997b58

Please sign in to comment.