aa
This commit is contained in:
@@ -479,6 +479,7 @@ func checkJobOrders(db *dao.DaoDB, jobID int, statusCompareStr, userID string, f
|
|||||||
|
|
||||||
func checkLimitJobOrders(db *dao.DaoDB, job *model.Job, jobOrder *model.JobOrder, jobTimerType int) (timer *time.Timer) {
|
func checkLimitJobOrders(db *dao.DaoDB, job *model.Job, jobOrder *model.JobOrder, jobTimerType int) (timer *time.Timer) {
|
||||||
//插到定时任务表里,主要是重启项目后的重启定时器用
|
//插到定时任务表里,主要是重启项目后的重启定时器用
|
||||||
|
//main 里有重启的函数
|
||||||
jobTimer := &model.JobTimer{
|
jobTimer := &model.JobTimer{
|
||||||
JobID: job.ID,
|
JobID: job.ID,
|
||||||
JobOrderID: jobOrder.JobOrderID,
|
JobOrderID: jobOrder.JobOrderID,
|
||||||
@@ -737,7 +738,7 @@ func AuditJob(ctx *jxcontext.Context, jobOrderID, status int, comment, vendorWay
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//一件代发处理
|
//一件代发处理,审核相当于发货
|
||||||
jobOrder.VendorWaybillID = vendorWaybillID
|
jobOrder.VendorWaybillID = vendorWaybillID
|
||||||
jobOrder.Status = model.JobOrderStatusFinish
|
jobOrder.Status = model.JobOrderStatusFinish
|
||||||
if _, err = dao.UpdateEntity(db, jobOrder, "Status", "VendorWaybillID"); err != nil {
|
if _, err = dao.UpdateEntity(db, jobOrder, "Status", "VendorWaybillID"); err != nil {
|
||||||
@@ -1186,6 +1187,7 @@ func GetAllDeliveryDetail(ctx *jxcontext.Context, vendorWaybillID, comType strin
|
|||||||
json.Unmarshal([]byte(jobOrder.WaybillInfo), &getWaybillDetailInfoResult)
|
json.Unmarshal([]byte(jobOrder.WaybillInfo), &getWaybillDetailInfoResult)
|
||||||
return getWaybillDetailInfoResult, err
|
return getWaybillDetailInfoResult, err
|
||||||
}
|
}
|
||||||
|
//距上次查询时间要大于12小时的,才去真正查
|
||||||
if jobOrder.WaybillQueryTime != utils.ZeroTimeValue {
|
if jobOrder.WaybillQueryTime != utils.ZeroTimeValue {
|
||||||
if time.Now().Sub(jobOrder.WaybillQueryTime) <= time.Hour*12 {
|
if time.Now().Sub(jobOrder.WaybillQueryTime) <= time.Hour*12 {
|
||||||
json.Unmarshal([]byte(jobOrder.WaybillInfo), &getWaybillDetailInfoResult)
|
json.Unmarshal([]byte(jobOrder.WaybillInfo), &getWaybillDetailInfoResult)
|
||||||
@@ -1429,6 +1431,7 @@ func RefreshDropShippingJob(ctx *jxcontext.Context) (err error) {
|
|||||||
if time.Now().Weekday() != 5 && time.Now().Weekday() != 1 {
|
if time.Now().Weekday() != 5 && time.Now().Weekday() != 1 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
//找出没有完成的,顺便刷成完成
|
||||||
sql := `
|
sql := `
|
||||||
SELECT a.*
|
SELECT a.*
|
||||||
FROM job_order a
|
FROM job_order a
|
||||||
@@ -1448,6 +1451,7 @@ func RefreshDropShippingJob(ctx *jxcontext.Context) (err error) {
|
|||||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||||
jobOrder := batchItemList[0].(*model.JobOrder)
|
jobOrder := batchItemList[0].(*model.JobOrder)
|
||||||
result, err := GetAllDeliveryDetail(ctx, jobOrder.VendorWaybillID, "")
|
result, err := GetAllDeliveryDetail(ctx, jobOrder.VendorWaybillID, "")
|
||||||
|
//完成了的,现在判断是如果收货时间已经过了3天了就自动确认收货
|
||||||
if result.State == utils.Int2Str(txcloudapi.StatusFinished) && time.Now().Sub(utils.Str2Time(result.UpdateTime)) > time.Hour*72 {
|
if result.State == utils.Int2Str(txcloudapi.StatusFinished) && time.Now().Sub(utils.Str2Time(result.UpdateTime)) > time.Hour*72 {
|
||||||
err = ConfirmDropShippingJob(ctx, int(jobOrder.JobOrderID))
|
err = ConfirmDropShippingJob(ctx, int(jobOrder.JobOrderID))
|
||||||
}
|
}
|
||||||
@@ -1463,6 +1467,7 @@ func AddressDistinguish(ctx *jxcontext.Context, address string) (result *txcloud
|
|||||||
db = dao.GetDB()
|
db = dao.GetDB()
|
||||||
addressDistinguish = &model.AddressDistinguish{Address: address}
|
addressDistinguish = &model.AddressDistinguish{Address: address}
|
||||||
)
|
)
|
||||||
|
//建了个表,有查过的记录就存一下吧
|
||||||
if err = dao.GetEntity(db, addressDistinguish, "Address"); err == nil && addressDistinguish.ID != 0 {
|
if err = dao.GetEntity(db, addressDistinguish, "Address"); err == nil && addressDistinguish.ID != 0 {
|
||||||
if err = json.Unmarshal([]byte(addressDistinguish.Info), &result); err == nil {
|
if err = json.Unmarshal([]byte(addressDistinguish.Info), &result); err == nil {
|
||||||
return result, err
|
return result, err
|
||||||
|
|||||||
@@ -340,7 +340,7 @@ func (c *JobController) GetDeliveryDetail() {
|
|||||||
// @router /AddressDistinguish [post]
|
// @router /AddressDistinguish [post]
|
||||||
func (c *JobController) AddressDistinguish() {
|
func (c *JobController) AddressDistinguish() {
|
||||||
c.callAddressDistinguish(func(params *tJobAddressDistinguishParams) (retVal interface{}, errCode string, err error) {
|
c.callAddressDistinguish(func(params *tJobAddressDistinguishParams) (retVal interface{}, errCode string, err error) {
|
||||||
|
retVal, err = cms.AddressDistinguish(params.Ctx, params.Address)
|
||||||
return retVal, "", err
|
return retVal, "", err
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user