...
|
...
|
@@ -331,6 +331,7 @@ func (srv *PullDataK3CloudService) PullPrdMo(timeFilter time.Time) error { |
|
|
"FRowId", "FBillNo", "FWorkShopID", "FWorkShopID.FName", "FMaterialId", "FMaterialId.FName",
|
|
|
"FMaterialId.FNumber", "FMaterialId.FSpecification", "FPlanStartDate", "FPlanFinishDate", "FDate", "FQty",
|
|
|
"FCreateDate", "FModifyDate", "FPrdOrgId", "FPrdOrgId.FName", "FUnitId", "FUnitId.FName", "FDescription",
|
|
|
"FStatus",
|
|
|
}
|
|
|
var (
|
|
|
startRow int
|
...
|
...
|
@@ -366,7 +367,7 @@ func (srv *PullDataK3CloudService) PullPrdMo(timeFilter time.Time) error { |
|
|
prdMoModels []models.PrdMoK3cloud
|
|
|
prdMoTemp models.PrdMoK3cloud
|
|
|
)
|
|
|
nowTime := time.Now()
|
|
|
version := time.Now().Unix()
|
|
|
for _, item := range allResult {
|
|
|
workShopID, _ := strconv.Atoi(item["FWorkShopID"])
|
|
|
materialId, _ := strconv.Atoi(item["FMaterialId"])
|
...
|
...
|
@@ -378,6 +379,7 @@ func (srv *PullDataK3CloudService) PullPrdMo(timeFilter time.Time) error { |
|
|
fCreateDate, _ := time.Parse("2006-01-02T15:04:05.999", item["FCreateDate"])
|
|
|
fModifyDate, _ := time.Parse("2006-01-02T15:04:05.999", item["FModifyDate"])
|
|
|
fUnitId, _ := strconv.Atoi(item["FUnitId"])
|
|
|
status, _ := strconv.Atoi(item["FStatus"])
|
|
|
prdMoTemp = models.PrdMoK3cloud{
|
|
|
RowId: item["FRowId"],
|
|
|
WorkShopID: workShopID,
|
...
|
...
|
@@ -392,13 +394,14 @@ func (srv *PullDataK3CloudService) PullPrdMo(timeFilter time.Time) error { |
|
|
WorkShopName: item["FWorkShopID.FName"],
|
|
|
MaterialName: item["FMaterialId.FName"],
|
|
|
MaterialNumber: item["FMaterialId.FNumber"],
|
|
|
DataVersion: nowTime.Unix(),
|
|
|
DataVersion: version,
|
|
|
PrdOrgId: fPrdOrgId,
|
|
|
PrdOrgName: item["FPrdOrgId.FName"],
|
|
|
Specification: item["FMaterialId.FSpecification"],
|
|
|
UnitName: item["FUnitId.FName"],
|
|
|
UnitId: fUnitId,
|
|
|
Description: item["FDescription"],
|
|
|
Status: status,
|
|
|
}
|
|
|
prdMoModels = append(prdMoModels, prdMoTemp)
|
|
|
}
|
...
|
...
|
@@ -424,7 +427,11 @@ func (srv *PullDataK3CloudService) PullPrdMo(timeFilter time.Time) error { |
|
|
if err != nil {
|
|
|
return application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
//同步ProductPlan 表数据
|
|
|
err = prdMoDao.SyncDataProductPlan(version)
|
|
|
if err != nil {
|
|
|
return application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
if err = transactionContext.CommitTransaction(); err != nil {
|
|
|
return application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
...
|
...
|
|