|
@@ -291,18 +291,17 @@ func GetSignInOfflineTask(projectForm int32) error {
|
|
|
var logisticInfo gorm_model.YoungeeTaskLogistics
|
|
|
db2 := GetReadDB(context.Background())
|
|
|
db2.Model(gorm_model.YoungeeTaskLogistics{}).Where("task_id = ?", taskInfo.TaskId).Find(&logisticInfo)
|
|
|
- fmt.Println("logisticID", logisticInfo.LogisticsID)
|
|
|
dd, _ := time.ParseDuration(conv.MustString(t, "") + "h")
|
|
|
if logisticInfo.AutoSignAt == nil || logisticInfo.AutoSignAt.IsZero() {
|
|
|
- var t time.Time
|
|
|
+ var t1 time.Time
|
|
|
if logisticInfo.ThingsType == 3 {
|
|
|
- t = logisticInfo.SignedTime.Add(dd)
|
|
|
+ t1 = logisticInfo.SignedTime.Add(dd)
|
|
|
} else {
|
|
|
- t = logisticInfo.DeliveryTime.Add(dd)
|
|
|
+ t1 = logisticInfo.DeliveryTime.Add(dd)
|
|
|
}
|
|
|
db5 := GetReadDB(context.Background())
|
|
|
db5.Model(gorm_model.YoungeeTaskLogistics{}).Where("logistics_id = ?", logisticInfo.LogisticsID).
|
|
|
- Updates(&gorm_model.YoungeeTaskLogistics{AutoSignAt: &t})
|
|
|
+ Updates(&gorm_model.YoungeeTaskLogistics{AutoSignAt: &t1})
|
|
|
fmt.Println("已添加自动签收时间")
|
|
|
}
|
|
|
}
|
|
@@ -320,9 +319,15 @@ func GetSignInOfflineTask(projectForm int32) error {
|
|
|
for _, logisticInfo := range logisticInfos {
|
|
|
signedTaskId = append(signedTaskId, logisticInfo.TaskID)
|
|
|
if logisticInfo.Status == 0 {
|
|
|
- db6 := GetReadDB(context.Background())
|
|
|
- db6.Model(gorm_model.YoungeeTaskLogistics{}).Where("logistics_id = ?", logisticInfo.LogisticsID).Updates(
|
|
|
- &gorm_model.YoungeeTaskLogistics{SignedTime: time.Now(), Status: 1})
|
|
|
+ if logisticInfo.ThingsType == 3 {
|
|
|
+ db6 := GetReadDB(context.Background())
|
|
|
+ db6.Model(gorm_model.YoungeeTaskLogistics{}).Where("logistics_id = ?", logisticInfo.LogisticsID).Updates(
|
|
|
+ &gorm_model.YoungeeTaskLogistics{Status: 1})
|
|
|
+ } else {
|
|
|
+ db6 := GetReadDB(context.Background())
|
|
|
+ db6.Model(gorm_model.YoungeeTaskLogistics{}).Where("logistics_id = ?", logisticInfo.LogisticsID).Updates(
|
|
|
+ &gorm_model.YoungeeTaskLogistics{SignedTime: time.Now(), Status: 1})
|
|
|
+ }
|
|
|
err = CreateTaskLog(context.Background(), logisticInfo.TaskID, "签收时间")
|
|
|
if err != nil {
|
|
|
logrus.WithContext(context.Background()).Errorf("[operate db] call CreateTaskLog error,err:%+v", err)
|