|
@@ -331,6 +331,7 @@ func (srv *PullDataK3CloudService) PullPrdMo(timeFilter time.Time) error { |
|
@@ -331,6 +331,7 @@ func (srv *PullDataK3CloudService) PullPrdMo(timeFilter time.Time) error { |
331
|
"FRowId", "FBillNo", "FWorkShopID", "FWorkShopID.FName", "FMaterialId", "FMaterialId.FName",
|
331
|
"FRowId", "FBillNo", "FWorkShopID", "FWorkShopID.FName", "FMaterialId", "FMaterialId.FName",
|
332
|
"FMaterialId.FNumber", "FMaterialId.FSpecification", "FPlanStartDate", "FPlanFinishDate", "FDate", "FQty",
|
332
|
"FMaterialId.FNumber", "FMaterialId.FSpecification", "FPlanStartDate", "FPlanFinishDate", "FDate", "FQty",
|
333
|
"FCreateDate", "FModifyDate", "FPrdOrgId", "FPrdOrgId.FName", "FUnitId", "FUnitId.FName", "FDescription",
|
333
|
"FCreateDate", "FModifyDate", "FPrdOrgId", "FPrdOrgId.FName", "FUnitId", "FUnitId.FName", "FDescription",
|
|
|
334
|
+ "FStatus",
|
334
|
}
|
335
|
}
|
335
|
var (
|
336
|
var (
|
336
|
startRow int
|
337
|
startRow int
|
|
@@ -366,7 +367,7 @@ func (srv *PullDataK3CloudService) PullPrdMo(timeFilter time.Time) error { |
|
@@ -366,7 +367,7 @@ func (srv *PullDataK3CloudService) PullPrdMo(timeFilter time.Time) error { |
366
|
prdMoModels []models.PrdMoK3cloud
|
367
|
prdMoModels []models.PrdMoK3cloud
|
367
|
prdMoTemp models.PrdMoK3cloud
|
368
|
prdMoTemp models.PrdMoK3cloud
|
368
|
)
|
369
|
)
|
369
|
- nowTime := time.Now()
|
370
|
+ version := time.Now().Unix()
|
370
|
for _, item := range allResult {
|
371
|
for _, item := range allResult {
|
371
|
workShopID, _ := strconv.Atoi(item["FWorkShopID"])
|
372
|
workShopID, _ := strconv.Atoi(item["FWorkShopID"])
|
372
|
materialId, _ := strconv.Atoi(item["FMaterialId"])
|
373
|
materialId, _ := strconv.Atoi(item["FMaterialId"])
|
|
@@ -378,6 +379,7 @@ func (srv *PullDataK3CloudService) PullPrdMo(timeFilter time.Time) error { |
|
@@ -378,6 +379,7 @@ func (srv *PullDataK3CloudService) PullPrdMo(timeFilter time.Time) error { |
378
|
fCreateDate, _ := time.Parse("2006-01-02T15:04:05.999", item["FCreateDate"])
|
379
|
fCreateDate, _ := time.Parse("2006-01-02T15:04:05.999", item["FCreateDate"])
|
379
|
fModifyDate, _ := time.Parse("2006-01-02T15:04:05.999", item["FModifyDate"])
|
380
|
fModifyDate, _ := time.Parse("2006-01-02T15:04:05.999", item["FModifyDate"])
|
380
|
fUnitId, _ := strconv.Atoi(item["FUnitId"])
|
381
|
fUnitId, _ := strconv.Atoi(item["FUnitId"])
|
|
|
382
|
+ status, _ := strconv.Atoi(item["FStatus"])
|
381
|
prdMoTemp = models.PrdMoK3cloud{
|
383
|
prdMoTemp = models.PrdMoK3cloud{
|
382
|
RowId: item["FRowId"],
|
384
|
RowId: item["FRowId"],
|
383
|
WorkShopID: workShopID,
|
385
|
WorkShopID: workShopID,
|
|
@@ -392,13 +394,14 @@ func (srv *PullDataK3CloudService) PullPrdMo(timeFilter time.Time) error { |
|
@@ -392,13 +394,14 @@ func (srv *PullDataK3CloudService) PullPrdMo(timeFilter time.Time) error { |
392
|
WorkShopName: item["FWorkShopID.FName"],
|
394
|
WorkShopName: item["FWorkShopID.FName"],
|
393
|
MaterialName: item["FMaterialId.FName"],
|
395
|
MaterialName: item["FMaterialId.FName"],
|
394
|
MaterialNumber: item["FMaterialId.FNumber"],
|
396
|
MaterialNumber: item["FMaterialId.FNumber"],
|
395
|
- DataVersion: nowTime.Unix(),
|
397
|
+ DataVersion: version,
|
396
|
PrdOrgId: fPrdOrgId,
|
398
|
PrdOrgId: fPrdOrgId,
|
397
|
PrdOrgName: item["FPrdOrgId.FName"],
|
399
|
PrdOrgName: item["FPrdOrgId.FName"],
|
398
|
Specification: item["FMaterialId.FSpecification"],
|
400
|
Specification: item["FMaterialId.FSpecification"],
|
399
|
UnitName: item["FUnitId.FName"],
|
401
|
UnitName: item["FUnitId.FName"],
|
400
|
UnitId: fUnitId,
|
402
|
UnitId: fUnitId,
|
401
|
Description: item["FDescription"],
|
403
|
Description: item["FDescription"],
|
|
|
404
|
+ Status: status,
|
402
|
}
|
405
|
}
|
403
|
prdMoModels = append(prdMoModels, prdMoTemp)
|
406
|
prdMoModels = append(prdMoModels, prdMoTemp)
|
404
|
}
|
407
|
}
|
|
@@ -424,7 +427,11 @@ func (srv *PullDataK3CloudService) PullPrdMo(timeFilter time.Time) error { |
|
@@ -424,7 +427,11 @@ func (srv *PullDataK3CloudService) PullPrdMo(timeFilter time.Time) error { |
424
|
if err != nil {
|
427
|
if err != nil {
|
425
|
return application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
428
|
return application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
426
|
}
|
429
|
}
|
427
|
-
|
430
|
+ //同步ProductPlan 表数据
|
|
|
431
|
+ err = prdMoDao.SyncDataProductPlan(version)
|
|
|
432
|
+ if err != nil {
|
|
|
433
|
+ return application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
434
|
+ }
|
428
|
if err = transactionContext.CommitTransaction(); err != nil {
|
435
|
if err = transactionContext.CommitTransaction(); err != nil {
|
429
|
return application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
436
|
return application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
430
|
}
|
437
|
}
|