-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #235 from Jzow/master
Add allot shipments receipt views and api
- Loading branch information
Showing
15 changed files
with
1,861 additions
and
11 deletions.
There are no files selected for viewing
67 changes: 67 additions & 0 deletions
67
core/api/src/main/java/com/wansenai/api/warehouse/AllotShipmentsController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
390 changes: 385 additions & 5 deletions
390
.../service/src/main/java/com/wansenai/service/warehouse/impl/AllotShipmentsServiceImpl.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}` | ||
}, | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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[]; | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
}, | ||
] |
Oops, something went wrong.