diff --git a/conf/app.go b/conf/app.go index 7090a92..90b5339 100644 --- a/conf/app.go +++ b/conf/app.go @@ -10,7 +10,7 @@ import ( var ExampleFile = "http://localhost:9001/public/uploadxlsx/example.xlsx" -var Baseurl = "http://localhost:9001" +var Baseurl = "http://localhost:9003" type AppConf struct { DisablePathCorrection bool diff --git a/conf/htm_log_config.yaml b/conf/htm_log_config.yaml index 2e5058d..9ccfa08 100644 --- a/conf/htm_log_config.yaml +++ b/conf/htm_log_config.yaml @@ -1,19 +1,19 @@ # module配置输出源 配置为map config: plan: - # 文件location - filename: ./log/plan - filetype: html - default: "" - # 支持文件的最大个数 - MaxAge: 30 - body: - info : "
时间:[time]错误提示:[info]
Request:[request]
Response:[response]

" - replace : - - "time" - - "info" - - "request" - - "response" + # 文件location + filename: ./log/plan + filetype: html + default: "" + # 支持文件的最大个数 + MaxAge: 30 + body: + info : "
时间:[time]错误提示:[info]
Request:[request]
Response:[response]

" + replace : + - "time" + - "info" + - "request" + - "response" salesorder: # 文件location filename: ./log/salesOrder @@ -44,15 +44,19 @@ config: - "response" planlog: filename: ./log/planlog - filetype: html-page - default: "[title][table_head]" + filetype: html + default: "[title]
[table_head]" body: - info: "[info_one]" + info: "[info_one]" info_two: "[info_two]" - bottom: "
" + bottom: "" replace: - "title" - "table_head" + - "class_one" - "info_one" - "info_two" - - "info_two_title" \ No newline at end of file + - "info_two_title" + planlogjs: + filename: ./log/planlog/js + filetype: \ No newline at end of file diff --git a/main.go b/main.go index 06f1262..2ac38cb 100644 --- a/main.go +++ b/main.go @@ -137,6 +137,6 @@ func imain() { // 开启自动创建功能 go createVersion.CreateVersionTask() //启动监听端口 - app.Run(iris.Addr(":9001"), iris.WithConfiguration(conf.C)) + app.Run(iris.Addr(":9003"), iris.WithConfiguration(conf.C)) } diff --git a/models/ap/CustDemandVerHead.model.go b/models/ap/CustDemandVerHead.model.go index 4ef14ab..6ccb561 100644 --- a/models/ap/CustDemandVerHead.model.go +++ b/models/ap/CustDemandVerHead.model.go @@ -50,6 +50,7 @@ type CustDemandVerHead struct { PublishNumber string `xorm:"nvarchar(255) 'PublishNumber'" json:"AP_CustDemandVerHead-PublishNumber"` PublishStatus int `xorm:"int 'PublishStatus'" json:"AP_CustDemandVerHead-PublishStatus"` MpsStatus int `xorm:"int 'MpsStatus'" json:"AP_CustDemandVerHead-MpsStatus"` + UserName string `xorm:"-" json:"AP_CustDemandVerHead-UserName"` } /****************************************************************************** diff --git a/services/ap/implments/Balance.service.impl.go b/services/ap/implments/Balance.service.impl.go index d3526e7..bedf36f 100644 --- a/services/ap/implments/Balance.service.impl.go +++ b/services/ap/implments/Balance.service.impl.go @@ -292,8 +292,35 @@ func (impl *BalanceServiceImplement) GetCustomerArticleDemandHtml(user *global.U messageHead := make(map[string]string) messageHead["title"] = versionId tableHead := "" - for _, _v := range CustArtStockaLL.SortKeys { - tableHead += "" + _v + "" + + for k, _v := range CustArtStockaLL.SortKeys { + + switch _v { + case "AP_ArticleDemand-ArtId": + tableHead += "物料Id" + break + case "AP_ArticleDemand-State": + tableHead += "发布状态" + break + case "AP_ArticleDemand-Descr1": + tableHead += "中文描述" + break + case "AP_ArticleDemand-FGStock": + tableHead += "成品库存" + break + case "AP_ArticleDemand-WIPStock": + tableHead += "成品在制" + break + case "AP_ArticleDemand-PUCStock": + tableHead += "采购量" + break + default: + tableHead += "" + _v + "" + break + } + if k == 5 { + tableHead += "项目名" + } } messageHead["table_head"] = tableHead //渲染表头 @@ -303,32 +330,58 @@ func (impl *BalanceServiceImplement) GetCustomerArticleDemandHtml(user *global.U messageTwo := make(map[string]string) var infoOne string var infoTwo string - i := len(CustArtStockaLL.SortKeys) + var classOne string + i := 12 + titleArr := map[int]string{ + 12: "净生产量", + 11: "预测需求", + 10: "订单需求", + 9: "外购需求", + 8: "独立需求", + 7: "在制量", + 6: "委外量", + 5: "采购量", + 4: "期初库存", + 3: "目标库存", + 2: "最低库存", + 1: "期末库存", + } for _, v := range CustArtStockaLL.ItemLst { infoOne = "" + classOne = "" infoTwo = "" - for _, _v := range CustArtStockaLL.SortKeys { - if i == len(CustArtStockaLL.SortKeys) { + for _k, _v := range CustArtStockaLL.SortKeys { + if i == 12 { + if _k == 0 && v["AP_ArticleDemand-State"] == "未发布" { + classOne = "no_public" + } infoOne += "" + v[_v] + "" } else { infoTwo += "" + v[_v] + "" } + if _v == "AP_ArticleDemand-PUCStock" { + if i == 12 { + infoOne += "" + titleArr[i] + "" + } else { + infoTwo += "" + titleArr[i] + "" + } + } } - if i == len(CustArtStockaLL.SortKeys) { + if i == 12 { + messageOne["class_one"] = classOne messageOne["info_one"] = infoOne logUtils.Write("planlog", messageOne, versionId, "info") } else { - messageTwo["info_two"] = infoOne + messageTwo["info_two"] = infoTwo messageTwo["info_two_title"] = v["AP_ArticleDemand-ArtId"] logUtils.Write("planlog", messageTwo, versionId, "info_two") } - i-- + i = i - 1 if i == 0 { - i = len(CustArtStockaLL.SortKeys) + i = 12 } } logUtils.WriteFileBottom("planlog", messageHead, versionId) - } // 显示计划列表 diff --git a/services/ap/implments/CustDemandVerHead.service.impl.go b/services/ap/implments/CustDemandVerHead.service.impl.go index c29d927..055afe3 100644 --- a/services/ap/implments/CustDemandVerHead.service.impl.go +++ b/services/ap/implments/CustDemandVerHead.service.impl.go @@ -802,23 +802,42 @@ func (impl *CustDemandVerHeadServiceImplement) SelectData(user *global.User, url if err != nil { return grmi.EmptyPagingResult, err } + userMap := make(map[string]string) + userDao := basedal.NewUserDAO(session, user.PlantNr, user.UserId) + resultInfo, ok := result.Records.([]model.CustDemandVerHead) + for k, v := range resultInfo { + if _, ok := userMap[v.LastUser]; !ok { + _user, err := userDao.SelectOne(v.LastUser) + if err != nil { + return grmi.PagingResult{}, err + } + if _user == nil { + userMap[v.LastUser] = _user.LastUser + } else { + userMap[v.LastUser] = _user.Name + } + } + resultInfo[k].UserName = userMap[v.LastUser] + } if len(list) > 0 { var versionId string for _, v := range list { versionId = v.VersionId } - resultInfo, ok := result.Records.([]model.CustDemandVerHead) + if ok { for k, v := range resultInfo { + if versionId == v.VersionId { resultInfo[k].Valid = true } } - result.Records = resultInfo + } } + result.Records = resultInfo return result, nil }