From e641a70d7ee00046a2591a00c4d1772cb93cb511 Mon Sep 17 00:00:00 2001 From: yehongyang Date: Tue, 25 Jan 2022 15:11:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0(=E5=BD=93=E5=89=8D=E6=AD=A3?= =?UTF-8?q?=E5=BC=8F=E7=8E=AF=E5=A2=83)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conf/app.go | 4 +-- main.go | 2 +- .../CustDemandVerHead.service.impl.go | 4 +-- services/erp/erp.go | 5 +-- task/k3cloud.go | 1 + utils/k3cloud.go | 32 +++++++++---------- .../common/CommonUploadPic.rest.go | 8 +++++ web/controllers/common/common.go | 4 +++ 8 files changed, 37 insertions(+), 23 deletions(-) diff --git a/conf/app.go b/conf/app.go index db43bd4..7090a92 100644 --- a/conf/app.go +++ b/conf/app.go @@ -8,9 +8,9 @@ import ( "leit.com/LAPP_CHEERSSON_BACKEND/web/supports" ) -var ExampleFile = "http://localhost:9003/public/uploadxlsx/example.xlsx" +var ExampleFile = "http://localhost:9001/public/uploadxlsx/example.xlsx" -var Baseurl = "http://localhost:9003" +var Baseurl = "http://localhost:9001" type AppConf struct { DisablePathCorrection bool diff --git a/main.go b/main.go index 2ac38cb..06f1262 100644 --- a/main.go +++ b/main.go @@ -137,6 +137,6 @@ func imain() { // 开启自动创建功能 go createVersion.CreateVersionTask() //启动监听端口 - app.Run(iris.Addr(":9003"), iris.WithConfiguration(conf.C)) + app.Run(iris.Addr(":9001"), iris.WithConfiguration(conf.C)) } diff --git a/services/ap/implments/CustDemandVerHead.service.impl.go b/services/ap/implments/CustDemandVerHead.service.impl.go index 575507c..c29d927 100644 --- a/services/ap/implments/CustDemandVerHead.service.impl.go +++ b/services/ap/implments/CustDemandVerHead.service.impl.go @@ -3514,7 +3514,7 @@ func (impl *CustDemandVerHeadServiceImplement) IssueGlobalAllVersion(user *globa //查询零件销售订单 当周销售数量 orderList, _ := sealesOrderDao.SelectSumPlanQty(v.ArtId, utils.ValueToString(v.DemandYear, "")+"."+utils.ValueToString(v.DemandWeek, ""), v.CustomerId) _qty := v.DemandQty - if orderList != nil && len(orderList) > 1 { + if orderList != nil && len(orderList) > 0 { qty := utils.ValueToFloat(string(orderList[0][baseMeta.SalesOrder_PlanQty.Name]), 0) if qty > _qty { _qty = qty @@ -3539,7 +3539,7 @@ func (impl *CustDemandVerHeadServiceImplement) IssueGlobalAllVersion(user *globa FBaseUnitID: _struct.FNumber{ FNumber: _article.UomId, }, - FBaseQty: v.DemandQty, + FBaseQty: _qty, FAVERATYPE: "W", FAveraCycle: 1, FStockOrgID: _struct.FNumber{ diff --git a/services/erp/erp.go b/services/erp/erp.go index 90d4e4b..bb23a70 100644 --- a/services/erp/erp.go +++ b/services/erp/erp.go @@ -285,8 +285,9 @@ func GetWeiWaiQty(PlantNr int, UserId string, alldata_Article *[]model.Article) //var ArticleStockList []model_base.ArticleStock dao_ArticleStock := dal_base.NewArticleStockDAO(session, PlantNr, UserId) - - dataList := utilService.PRD_MO_Init_Weiwai().Search("", "") + FilerString := "" + FilerString += "FDocumentStatus = 'C' and FCancelStatus='A'" + dataList := utilService.SUB_SUBREQORDERInit().Search(FilerString, "") articlestockMap := make(map[string]float64) for _, info := range dataList { diff --git a/task/k3cloud.go b/task/k3cloud.go index ac74581..0606592 100644 --- a/task/k3cloud.go +++ b/task/k3cloud.go @@ -130,6 +130,7 @@ func ImportWeiWai() { impl := implments.NewBalanceServiceImplement() alldata_Article := impl.GetGlobalArticleData() erp.GetWeiWaiWeekQty(model.PlantNr, "system", &alldata_Article) + erp.GetWeiWaiQty(model.PlantNr, "system", &alldata_Article) } func ImportZhaizhi() { diff --git a/utils/k3cloud.go b/utils/k3cloud.go index 65b3f40..8076623 100644 --- a/utils/k3cloud.go +++ b/utils/k3cloud.go @@ -45,14 +45,14 @@ func K3configTestInit() { } //UAT新 -const k3url = "http://10.11.12.24/K3Cloud/" -const accID = "61cff33d2cf273" -const username = "aps001" -const password = "aps202101" -const OrgId1 = "100729" -const OrgId2 = "100726" -const NoId1 = "9999" -const NoId2 = "9897" +//const k3url = "http://10.11.12.24/K3Cloud/" +//const accID = "61cff33d2cf273" +//const username = "aps001" +//const password = "aps202101" +//const OrgId1 = "100729" +//const OrgId2 = "100726" +//const NoId1 = "9999" +//const NoId2 = "9897" //瑞玛测试服UAT //const k3url = "http://10.11.12.24/K3Cloud/" @@ -92,14 +92,14 @@ func K3configInit() { } //瑞玛正式 -//const k3url = "http://10.11.12.24/K3Cloud/" -//const accID = "6178dbe238ea56" -//const username = "aps001" -//const password = "aps202101" -//const OrgId1 = "100729" -//const OrgId2 = "100726" -//const NoId1 = "9999" -//const NoId2 = "9897" +const k3url = "http://10.11.12.24/K3Cloud/" +const accID = "6178dbe238ea56" +const username = "aps001" +const password = "aps202101" +const OrgId1 = "100729" +const OrgId2 = "100726" +const NoId1 = "9999" +const NoId2 = "9897" /** K3cloud 登录 diff --git a/web/controllers/common/CommonUploadPic.rest.go b/web/controllers/common/CommonUploadPic.rest.go index 56ef84b..d29f9b5 100644 --- a/web/controllers/common/CommonUploadPic.rest.go +++ b/web/controllers/common/CommonUploadPic.rest.go @@ -49,6 +49,14 @@ func RegisterReadLog(party router.Party, path string) { }) } +//同步采购 +func RegisterCaiGou(party router.Party, path string) { + party.Get(path, func(ctx iris.Context) { + task.ImportChaigou() + supports.Ok(ctx, supports.OptionSuccess, nil) + }) +} + /****************************************************************************** * * @Function Name : RegisterUploadMustPic diff --git a/web/controllers/common/common.go b/web/controllers/common/common.go index 4b618d8..8f5555d 100644 --- a/web/controllers/common/common.go +++ b/web/controllers/common/common.go @@ -34,6 +34,10 @@ func RegisterRoutes() { RegisterEmpinfo(empinfo, "/list") log := party.Party("/log") RegisterReadLog(log, "/read") + + //同步库存 + task := party.Party("/task") + RegisterCaiGou(task, "/caigou") }) }