|
|
@@ -1640,6 +1640,7 @@ func (this *OilSupplierCertController) ChangeSupplierStatus() {
|
|
|
svcsupp := supplier.GetOilSupplierService(utils.DBE)
|
|
|
var fileData []supplier.ExpireFileList
|
|
|
where := " b.EffectDate <= '" + time.Now().Format("2006-01-02") + "' and b.IsDelete = 0 and b.SupType not in (2, 4) "
|
|
|
+ log.Print("资质过期查询条件:" + where)
|
|
|
svcsupp.GetExpireFileList(OilSupplierName, OilSupplierFileName, &fileData, where)
|
|
|
|
|
|
for _, item := range fileData {
|
|
|
@@ -1647,26 +1648,29 @@ func (this *OilSupplierCertController) ChangeSupplierStatus() {
|
|
|
"InFlag",
|
|
|
"Remark",
|
|
|
}
|
|
|
- where := "SupplierId=" + strconv.Itoa(item.Id)
|
|
|
+ whereSup := "SupplierId=" + strconv.Itoa(item.Id) + " and InFlag in ('1', '2')"
|
|
|
if item.SupplierTypeCode != "000" {
|
|
|
- where = where + " and SupplierTypeCode='" + item.SupplierTypeCode + "'"
|
|
|
+ whereSup = whereSup + " and SupplierTypeCode='" + item.SupplierTypeCode + "'"
|
|
|
}
|
|
|
var tmpCertList []suppliercert.OilSupplierCert
|
|
|
- svcsupp.GetEntitysByWhere(OilSupplierCertName, where, &tmpCertList)
|
|
|
+ svcsupp.GetEntitysByWhere(OilSupplierCertName, whereSup, &tmpCertList)
|
|
|
for _, tmpCertItem := range tmpCertList {
|
|
|
if tmpCertItem.InFlag == "1" {
|
|
|
log.Print("定时任务资质检查 InFlag == 1:" + item.SupplierName)
|
|
|
tmpCertItem.InFlag = "2"
|
|
|
if tmpCertItem.ApplyTime.Before(time.Now()) {
|
|
|
+ //log.Print("年审资质过期年审 公司名称:" + item.SupplierName + "文件名称:" + item.FileName + ", 过期时间:" + item.EffectDate.String() + ", 当前时间:" + time.Now().Format("2006-01-02"))
|
|
|
// 年审到期
|
|
|
tmpCertItem.Remark = strings.Trim("年审过期,资质过期,"+tmpCertItem.Remark, ",")
|
|
|
} else {
|
|
|
+ //log.Print("仅资质过期 公司名称:" + item.SupplierName + "文件名称:" + item.FileName + ", 过期时间:" + item.EffectDate.String() + ", 当前时间:" + time.Now().Format("2006-01-02"))
|
|
|
tmpCertItem.Remark = strings.Trim("资质过期,"+tmpCertItem.Remark, ",")
|
|
|
}
|
|
|
svcsupp.UpdateEntityByIdCols(tmpCertItem.Id, &tmpCertItem, cols)
|
|
|
|
|
|
} else if tmpCertItem.InFlag == "2" && !strings.Contains(tmpCertItem.Remark, "资质过期") {
|
|
|
log.Print("定时任务资质检查 InFlag == 2:" + item.SupplierName)
|
|
|
+ //log.Print("已暂停资质过期 公司名称:" + item.SupplierName + ", 文件名称:" + item.FileName + ", 过期时间:" + item.EffectDate.String() + "\n, 当前时间:" + time.Now().Format("2006-01-02"))
|
|
|
tmpCertItem.InFlag = "2"
|
|
|
tmpCertItem.Remark = strings.Trim("资质过期,"+tmpCertItem.Remark, ",")
|
|
|
svcsupp.UpdateEntityByIdCols(tmpCertItem.Id, &tmpCertItem, cols)
|