|
@@ -204,6 +204,20 @@ func ContractBreach(ctx context.Context, req *http_model.ContractBreachRequest)
|
|
|
return err
|
|
|
}
|
|
|
|
|
|
+ db = GetReadDB(ctx)
|
|
|
+ db = db.Model(gorm_model.RecruitStrategy{}).Where("project_id = ? and strategy_id = ?", taskInfo.ProjectId, taskInfo.StrategyId)
|
|
|
+ err = db.Updates(map[string]interface{}{
|
|
|
+ "total_offer": gorm.Expr("total_offer + ?", taskInfo.RealPayment)}).Error
|
|
|
+ if err != nil {
|
|
|
+ logrus.WithContext(ctx).Errorf("[ContractBreach] error update RecruitStrategy, err:%+v", err)
|
|
|
+ return err
|
|
|
+ }
|
|
|
+
|
|
|
+ err = CreateTaskLog(context.Background(), taskInfo.TaskId, "解约时间")
|
|
|
+ if err != nil {
|
|
|
+ logrus.WithContext(context.Background()).Errorf("[ContractBreach] call CreateTaskLog error,err:%+v", err)
|
|
|
+ }
|
|
|
+
|
|
|
db4 := GetReadDB(ctx)
|
|
|
if breakType == 1 {
|
|
|
err = db4.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", taskId).Updates(
|
|
@@ -244,7 +258,7 @@ func ContractBreach(ctx context.Context, req *http_model.ContractBreachRequest)
|
|
|
}
|
|
|
db5 := GetReadDB(ctx)
|
|
|
err = db5.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", taskId).Updates(
|
|
|
- map[string]interface{}{"settle_amount": settleAmount}).Error
|
|
|
+ map[string]interface{}{"settle_amount": settleAmount, "withdraw_status": 2, "complete_status": 4, "complete_date": time.Now()}).Error
|
|
|
if err != nil {
|
|
|
logrus.WithContext(ctx).Errorf("[ContractBreach] error update YoungeeTaskInfo, err:%+v", err)
|
|
|
return err
|