From 91d7ca06128f996844aa7d2d691d083c944bdf1d Mon Sep 17 00:00:00 2001
From: lishihai <dslsh@dscom>
Date: 星期三, 03 七月 2024 17:22:16 +0800
Subject: [PATCH] 导入物料/产品->新模版BUG修复
---
router/router.go | 153 ++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 145 insertions(+), 8 deletions(-)
diff --git a/router/router.go b/router/router.go
index 084dc11..edf34ef 100644
--- a/router/router.go
+++ b/router/router.go
@@ -20,6 +20,8 @@
r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
urlPrefix := "/api-wms/v1"
+ r.Use(middleware.JWTAuth())
+ r.Use(middleware.VerifyResetPwd())
// 缁勭粐绠$悊
departmentController := new(controllers.DepartmentController)
@@ -61,6 +63,20 @@
locationAPI.POST("updateLocation", locationController.UpdateLocation) //淇敼浣嶇疆
locationAPI.GET("getLocationDetails/:id", locationController.GetLocationDetails) //鑾峰彇浣嶇疆璇︽儏
locationAPI.DELETE("deleteLocation/:id", locationController.DeleteLocation) //鍒犻櫎浣嶇疆
+ locationAPI.GET("getLocationTreeList", locationController.GetLocationTreeList) //鑾峰彇浣嶇疆鍒楄〃鏍�
+ }
+
+ // 灞炴�т俊鎭�
+ attributeController := new(controllers.AttributeController)
+ attributeAPI := r.Group(urlPrefix + "/attribute")
+ {
+ attributeAPI.POST("attribute", attributeController.Add) // 娣诲姞灞炴��
+ attributeAPI.PUT("updateAttribute/:id", attributeController.Update) // 淇敼灞炴��
+ attributeAPI.DELETE("delete/:id", attributeController.Delete) // 鍒犻櫎灞炴��
+ attributeAPI.GET("attribute", attributeController.ListAttribute) // 鑾峰彇灞炴��
+ attributeAPI.POST("list", attributeController.ListAttribute) // 鑾峰彇灞炴��
+ attributeAPI.GET("primary/:id", attributeController.PrimaryAttribute) //鍒犻櫎
+ //attributeAPI.GET("attribute/:id", attributeController.GetAttributeDetail) // 鑾峰彇灞炴��
}
// 涓氬姟绫诲瀷
@@ -68,6 +84,7 @@
operationTypeAPI := r.Group(urlPrefix + "/operationType")
{
operationTypeAPI.GET("operationType", operationTypeController.List) // 鑾峰彇浣滀笟绫诲瀷鍒楄〃
+ operationTypeAPI.GET("listTransfer", operationTypeController.ListTransfer) // 鑾峰彇浣滀笟绫诲瀷鍒楄〃
operationTypeAPI.POST("operationType", operationTypeController.Add) // 鏂板浣滀笟绫诲瀷
operationTypeAPI.PUT("operationType/:id", operationTypeController.Update) // 淇敼浣滀笟绫诲瀷
operationTypeAPI.DELETE("operationType/:id", operationTypeController.Delete) // 鍒犻櫎浣滀笟绫诲瀷
@@ -77,28 +94,148 @@
operationController := new(controllers.OperationController)
operationAPI := r.Group(urlPrefix + "/operation")
{
- operationAPI.GET("operation", operationController.List)
+ operationAPI.POST("list", operationController.List)
+ operationAPI.GET("getOperationInfo/:id", operationController.GetOperationInfo)
operationAPI.POST("operation", operationController.Add)
- operationAPI.PUT("operation/:id", operationController.Update)
+ operationAPI.POST("update", operationController.Update)
operationAPI.DELETE("operation/:id", operationController.Delete)
- operationAPI.PUT("Finish/:id", operationController.Finish)
+ operationAPI.PUT("finish/:id", operationController.Finish)
+ operationAPI.POST("listTransfer", operationController.ListTransfer)
+ operationAPI.GET("getLogisticCompanyList", operationController.GetLogisticCompanyList)
+ operationAPI.PUT("cancel/:id", operationController.Cancel)
+ operationAPI.PUT("outputOperation/:id", operationController.OutputOperation)
+ operationAPI.GET("getSupplierList", operationController.GetSupplierList)
+ operationAPI.GET("getClientList", operationController.GetClientList)
+ operationAPI.POST("listByCondition", operationController.ListByCondition)
+ operationAPI.GET("getPersonnelList", operationController.GetPersonnelList)
+
}
//浜у搧
productController := new(controllers.ProductController)
productAPI := r.Group(urlPrefix + "/product")
{
- productAPI.POST("addProduct", productController.AddProduct) // 鏂板浜у搧
- productAPI.POST("getProductList", productController.GetProductList) // 鑾峰彇浜у搧鍒楄〃
- productAPI.GET("getProductDetails/:id", productController.GetProductDetails) // 鑾峰彇浜у搧璇︽儏
- productAPI.POST("updateProduct", productController.UpdateProduct) // 淇敼浜у搧璇︽儏
- productAPI.DELETE("deleteProduct/:id", productController.DeleteProduct) // 鍒犻櫎浜у搧
+ productAPI.POST("addProduct", productController.AddProduct) // 鏂板浜у搧
+ productAPI.POST("getProductList", productController.GetProductList) // 鑾峰彇浜у搧鍒楄〃
+ productAPI.GET("getProductDetails/:id", productController.GetProductDetails) // 閫氳繃ID鑾峰彇浜у搧璇︽儏
+ productAPI.GET("getProductDetailsByBarCode/:barCode", productController.GetProductDetailsByBarCode) // 閫氳繃鏉″舰鐮佽幏鍙栦骇鍝佽鎯�
+ productAPI.POST("updateProduct", productController.UpdateProduct) // 淇敼浜у搧璇︽儏
+ productAPI.DELETE("deleteProduct/:id", productController.DeleteProduct) // 閫氳繃ID鑾峰垹闄や骇鍝�
+ productAPI.DELETE("deleteProductByBarCode/:barCode", productController.DeleteProductByBarCode) // 閫氳繃鏉″舰鐮佸垹闄や骇鍝�
+ productAPI.GET("downloadInputFormat", productController.DownloadInputFormat) // 涓嬭浇瀵煎叆鐗╂枡妯℃澘
productAPI.POST("addProductCategory", productController.AddProductCategory) //娣诲姞浜у搧绫诲瀷
productAPI.POST("getProductCategoryList", productController.GetProductCategoryList) //鑾峰彇浜у搧绫诲瀷鍒楄〃
productAPI.GET("getProductCategoryDetails/:id", productController.GetProductCategoryDetails) //鑾峰彇浜у搧绫诲瀷璇︽儏
productAPI.POST("updateProductCategory", productController.UpdateProductCategory) //淇敼浜у搧绫诲瀷
productAPI.DELETE("deleteProductCategory/:id", productController.DeleteProductCategory) //鍒犻櫎浜у搧绫诲瀷
+
+ productAPI.POST("listOperaton", productController.ListOperation) //鏌ョ湅浜у搧鐨勫巻鍙插嚭鍏ュ簱淇℃伅
+ productAPI.POST("addDisuse", productController.AddDisuse) //娣诲姞鎶ュ簾淇℃伅
+ productAPI.POST("listDisuse", productController.ListDisuse) //鏌ョ湅浜у搧鐨勫巻鍙插嚭鍏ュ簱淇℃伅
+ productAPI.PUT("finishDisuse/:id", productController.FinishDisuse) //鎶ュ簾楠岃瘉
+ productAPI.POST("updateDisuse", productController.UpdateDisuse) //淇敼鎶ュ簾淇℃伅
+ productAPI.POST("listHistory", productController.ListHistory) //浜у搧浣嶇疆鍘嗗彶璁板綍
+ productAPI.PUT("cancelDisuse/:id", productController.CancelDisuse) //鍙栨秷鎶ュ簾
+ productAPI.GET("getUserInfo", productController.GetUserInfo) //鑾峰彇鐧诲綍鐢ㄦ埛淇℃伅
+ productAPI.GET("getUnitInfo", productController.GetUnitInfo) //鑾峰彇鍗曚綅淇℃伅
+ productAPI.POST("saveUnitDict", productController.SaveUnitDict) //鏇存柊璁¢噺鍗曚綅瀛楀吀
+ productAPI.POST("inputProduct", productController.InputProduct) //鏇存柊璁¢噺鍗曚綅瀛楀吀
+
+ }
+
+ // 涓婃灦瑙勫垯
+ locationProductController := new(controllers.LocationProductController)
+ locationProductAPI := r.Group(urlPrefix + "/locationProduct")
+ {
+ locationProductAPI.POST("list", locationProductController.List) // 鑾峰彇涓婃灦瑙勫垯鍒楄〃
+ locationProductAPI.POST("add", locationProductController.Add) // 鏂板涓婃灦瑙勫垯
+ locationProductAPI.POST("update", locationProductController.Update) // 淇敼涓婃灦瑙勫垯
+ locationProductAPI.DELETE("delete/:id", locationProductController.Delete) // 鍒犻櫎涓婃灦瑙勫垯
+ }
+
+ //搴撳瓨鐩樼偣
+ locationProductAmountController := new(controllers.LocationProductAmountController)
+ locationProductAmountAPI := r.Group(urlPrefix + "/locationProductAmount")
+ {
+ locationProductAmountAPI.POST("add", locationProductAmountController.Add) //娣诲姞搴撳瓨鐩樼偣淇℃伅
+ locationProductAmountAPI.POST("list", locationProductAmountController.List) //鏌ョ湅搴撳瓨鐩樼偣鍒楄〃
+ locationProductAmountAPI.POST("update", locationProductAmountController.Update) //淇敼搴撳瓨鐩樼偣淇℃伅
+ locationProductAmountAPI.POST("finish", locationProductAmountController.Finish) //搴旂敤銆侀獙璇佸簱瀛樼洏鐐逛俊鎭�
+ locationProductAmountAPI.POST("getRuleList", locationProductAmountController.GetRuleList) //鑾峰彇涓婃灦瑙勫垯
+ locationProductAmountAPI.POST("getLocationProductAmount", locationProductAmountController.GetLocationProductAmount) //鑾峰彇浣嶇疆浜у搧淇℃伅
+ }
+
+ //鎶ヨ〃
+ reportFormsController := new(controllers.ReportFormsController)
+ reportFormsAPI := r.Group(urlPrefix + "/forms")
+ {
+ reportFormsAPI.POST("getInventoryForms", reportFormsController.GetInventoryForms) //鑾峰彇搴撳瓨鎶ヨ〃
+ reportFormsAPI.POST("downloadInventoryForms", reportFormsController.DownloadInventoryForms) //涓嬭浇搴撳瓨鎶ヨ〃
+ reportFormsAPI.POST("getHistory", reportFormsController.GetHistory) //鑾峰彇搴撳瓨鍘嗗彶
+ reportFormsAPI.POST("downloadHistory", reportFormsController.DownloadHistory) //涓嬭浇搴撳瓨鎶ヨ〃
+ reportFormsAPI.POST("getLocationForms", reportFormsController.GetLocationForms) //鑾峰彇浣嶇疆鎶ヨ〃
+ reportFormsAPI.POST("downloadLocationForms", reportFormsController.DownloadLocationForms) //涓嬭浇浣嶇疆鎶ヨ〃
+ reportFormsAPI.POST("monthStats", reportFormsController.MonthStats) //鑾峰彇鏈堝害缁熻鎶ヨ〃
+ reportFormsAPI.POST("downloadMonthStats", reportFormsController.DownloadMonthStats) //涓嬭浇鏈堝害缁熻鎶ヨ〃
+ reportFormsAPI.POST("doMonthStats", reportFormsController.DoMonthStats) //鎵嬪姩璺戞湀搴︾粺璁″簱瀛樻姤琛�
+
+ reportFormsAPI.POST("warehouseMonthStats", reportFormsController.WarehouseMonthStats) //鎸変粨搴撹幏鍙栨湀搴︾粺璁℃姤琛�
+ reportFormsAPI.POST("doWarehouseMonthStats", reportFormsController.DoWareHouseMonthStats) //鎵嬪姩璺戞寜浠撳簱鑾峰彇鏈堝害缁熻鎶ヨ〃
+ reportFormsAPI.POST("downloadWarehouseMonthStats", reportFormsController.DownloadWarehouseMonthStats) //涓嬭浇鎸変粨搴撹幏鍙栨湀搴︾粺璁℃姤琛�
+ }
+
+ //閲嶈璐ц鍒�
+ reorderRuleController := new(controllers.ReorderRuleController)
+ reorderRuleAPI := r.Group(urlPrefix + "/reorderRule")
+ {
+ reorderRuleAPI.POST("addReorderRule", reorderRuleController.AddReorderRule) //娣诲姞閲嶈璐ц鍒�
+ reorderRuleAPI.POST("getReorderRuleList", reorderRuleController.GetReorderRuleList) //鑾峰彇閲嶈璐ц鍒欏垪琛�
+ reorderRuleAPI.POST("getAmountAndPrediction", reorderRuleController.GetAmountAndPrediction) //鑾峰彇鍦ㄥ簱涓庨娴嬫暟閲�
+ reorderRuleAPI.POST("updateReorderRule", reorderRuleController.UpdateReorderRule) //鏇存柊閲嶈璐ц鍒�
+ reorderRuleAPI.POST("orderAgain", reorderRuleController.OrderAgain) //鍐嶈涓�娆�
+ }
+
+ attachmentController := new(controllers.AttachmentController)
+ attachmentAPI := r.Group(urlPrefix + "/attachment")
+ {
+ attachmentAPI.POST("uploadFiles", attachmentController.UploadFiles) //涓婁紶鏂囦欢
+ }
+
+ codeApiController := new(controllers.CodeApi)
+ codeApi := r.Group(urlPrefix + "/code")
+ {
+ codeApi.GET("getCodeList", codeApiController.GetCodeList) //鑾峰彇缂栫爜鍒楄〃
+ codeApi.POST("getAutoCode", codeApiController.GetAutoCode) //鑾峰彇鑷姩缂栫爜
+ }
+
+ attributeValueController := new(controllers.AttributeValueController)
+ attributeValueAPI := r.Group(urlPrefix + "/attributeValue")
+ {
+ attributeValueAPI.POST("add", attributeValueController.AddAttributeValue)
+ attributeValueAPI.POST("update", attributeValueController.UpdateAttributeValue)
+ attributeValueAPI.DELETE("delete/:id", attributeValueController.DeleteAttributeValue) //鍒犻櫎
+ attributeValueAPI.POST("list", attributeValueController.ListAttributeValue)
+ attributeValueAPI.GET("primary/:id", attributeValueController.PrimaryAttributeValue) //鍒犻櫎
+ }
+
+ // 璋冩嫧銆佸嚭搴撳叆搴撳瓧鍏搁厤缃�
+ dictController := new(controllers.DictController)
+ dictApi := r.Group(urlPrefix + "/dict")
+ {
+ dictApi.POST("add", dictController.AddMiniDict) //娣诲姞瀛楀吀淇℃伅
+ dictApi.POST("edit", dictController.EditMiniDict) //淇敼瀛楀吀淇℃伅
+ dictApi.DELETE("delete/:id", dictController.DeleteMiniDict) //鍒犻櫎瀛楀吀淇℃伅
+ dictApi.POST("save", dictController.SaveMiniDict) //鎵归噺淇濆瓨绯荤粺璁剧疆
+ dictApi.POST("getDictList", dictController.GetMiniDictList) //鑾峰彇瀛楀吀淇℃伅鍒楄〃
+ }
+
+ //绯荤粺閰嶇疆
+ sysCfgCtl := new(controllers.SystemConfigController)
+ sysCfgApi := r.Group(urlPrefix + "/systemConfig")
+ {
+ sysCfgApi.POST("save", sysCfgCtl.SaveConfig) //淇濆瓨绯荤粺璁剧疆
+ sysCfgApi.GET("get", sysCfgCtl.GetSystemConfig) //鑾峰彇绯荤粺閰嶇疆
}
return r
--
Gitblit v1.8.0