Browse Source

Merge pull request '解析顺引 projectId从派生获取' (#206) from develop into master

Reviewed-on: #206
pull/209/head V1.1.3
zhangxin 2 years ago
parent
commit
27c9e5822b
1 changed files with 8 additions and 5 deletions
  1. +8
    -5
      services/pln/implments/ToyotaCalloff.service.impl.go

+ 8
- 5
services/pln/implments/ToyotaCalloff.service.impl.go View File

@ -385,10 +385,13 @@ func (impl *ToyotaCalloffServiceImplement) ParseToyotaCallOffFile() {
return
}
for _, project := range projectLi {
if project.CalloffFolder == "" {
continue
}
inboxPath := path.Join(conf.DbConfig.CallOffFolder, project.CalloffFolder)
outBoxPath := path.Join(conf.DbConfig.OutCallOffFolder, project.CalloffFolder)
errorBoxPath := path.Join(conf.DbConfig.ErrorCallOffFolder, project.CalloffFolder)
go impl.LoadFile(user, project.ProjectId, inboxPath, outBoxPath, errorBoxPath)
go impl.LoadFile(user, inboxPath, outBoxPath, errorBoxPath)
}
}(plant)
}
@ -396,7 +399,7 @@ func (impl *ToyotaCalloffServiceImplement) ParseToyotaCallOffFile() {
}
// LoadFile 读取目录下的文件
func (impl *ToyotaCalloffServiceImplement) LoadFile(user *global.User, projectId string, inBoxPath string, outBoxPath string, errBoxPath string) {
func (impl *ToyotaCalloffServiceImplement) LoadFile(user *global.User, inBoxPath string, outBoxPath string, errBoxPath string) {
log, _ := logger.NewLogger("CallOff", "PLN")
fileInfoList, err := ioutil.ReadDir(inBoxPath)
if err != nil {
@ -412,7 +415,7 @@ func (impl *ToyotaCalloffServiceImplement) LoadFile(user *global.User, projectId
continue
}
filepath := path.Join(inBoxPath, file.Name())
repeat, err := impl.ParseCsvFile(user, filepath, file.Name(), projectId)
repeat, err := impl.ParseCsvFile(user, filepath, file.Name())
if err != nil {
log.Error("解析广丰CallOff, 解析失败, 文件:" + file.Name() + ", 错误:" + err.Error())
if !repeat {
@ -444,7 +447,7 @@ func (impl *ToyotaCalloffServiceImplement) LoadFile(user *global.User, projectId
}
// ParseCsvFile 解析csv文件
func (impl *ToyotaCalloffServiceImplement) ParseCsvFile(user *global.User, filepath string, filename string, projectId string) (bool, error) {
func (impl *ToyotaCalloffServiceImplement) ParseCsvFile(user *global.User, filepath string, filename string) (bool, error) {
// 第一个返回值表示是否可以重试
engine := db.Eloquent.Master()
session := engine.NewSession()
@ -512,7 +515,7 @@ func (impl *ToyotaCalloffServiceImplement) ParseCsvFile(user *global.User, filep
callOff := model.ToyotaCalloff{
DemandId: demandId,
SupplierCode: supplyCode,
ProjectId: projectId,
ProjectId: productFamily.ProjectId,
ProductFamilyId: productFamilyId,
TotalQty: 1,
CheckSequence: seq,


Loading…
Cancel
Save