|
@@ -1011,6 +1011,7 @@ func GetLzSurveyProduct(cont context.Context) (err error) {
|
|
item.CustomType = n.CustomType
|
|
item.CustomType = n.CustomType
|
|
item.Custom = n.Custom
|
|
item.Custom = n.Custom
|
|
item.QuotaSampleId = n.QuotaSampleID
|
|
item.QuotaSampleId = n.QuotaSampleID
|
|
|
|
+ item.ModifyTime = time.Now()
|
|
if count > 0 {
|
|
if count > 0 {
|
|
fmt.Println("存在", n.QuotaName, n.QuotaSampleID)
|
|
fmt.Println("存在", n.QuotaName, n.QuotaSampleID)
|
|
//修改
|
|
//修改
|
|
@@ -1019,12 +1020,24 @@ func GetLzSurveyProduct(cont context.Context) (err error) {
|
|
msg = "修改隆众价格指标失败:err " + err.Error()
|
|
msg = "修改隆众价格指标失败:err " + err.Error()
|
|
return err
|
|
return err
|
|
}
|
|
}
|
|
|
|
+ existItem, err := models.GetLongzhongSurveyProductItem(n.QuotaSampleID)
|
|
|
|
+ if err != nil {
|
|
|
|
+ msg = "获取已存在隆众指标信息失败:err " + err.Error()
|
|
|
|
+ return err
|
|
|
|
+ }
|
|
|
|
+ if existItem != nil {
|
|
|
|
+ surveyProductId := existItem.SurveyProductId
|
|
|
|
+ lzCode := fmt.Sprintf("lz%04d", surveyProductId)
|
|
|
|
+ models.ModifLongzhongSurveyProductCode(lzCode, surveyProductId)
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
- err = models.AddLongzhongSurveyProduct(item)
|
|
|
|
|
|
+ lastId, err := models.AddLongzhongSurveyProduct(item)
|
|
if err != nil {
|
|
if err != nil {
|
|
msg = "新增隆众价格指标失败:err " + err.Error()
|
|
msg = "新增隆众价格指标失败:err " + err.Error()
|
|
return err
|
|
return err
|
|
}
|
|
}
|
|
|
|
+ lzCode := fmt.Sprintf("lz%04d", lastId)
|
|
|
|
+ models.ModifLongzhongSurveyProductCode(lzCode, int(lastId))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
totalPage := utils.PageCount(int(infoItem.Response.Total), 100)
|
|
totalPage := utils.PageCount(int(infoItem.Response.Total), 100)
|