|
|
@@ -1496,7 +1496,7 @@ func (this *OilGoodsAptitudeController) ImportExcel() {
|
|
|
this.ServeJSON()
|
|
|
}
|
|
|
// 外网不用 go func()
|
|
|
- go func() {
|
|
|
+ //go func() {
|
|
|
_dir := utils.Cfg.MustValue("file", "tmplateDir") + "xlsx"
|
|
|
filename := strconv.Itoa(int(time.Now().Unix())) + ".xlsx"
|
|
|
utils.DownloadFile(url, filename, _dir)
|
|
|
@@ -1527,8 +1527,9 @@ func (this *OilGoodsAptitudeController) ImportExcel() {
|
|
|
} else {
|
|
|
elapsed := time.Since(t)
|
|
|
log.Println(elapsed)
|
|
|
+ this.CreateContrast()
|
|
|
}
|
|
|
- }()
|
|
|
+ //}()
|
|
|
errorinfo.Code = 0
|
|
|
errorinfo.Message = "导入中,请等待!"
|
|
|
this.Data["json"] = &errorinfo
|
|
|
@@ -1704,22 +1705,22 @@ func (this *OilGoodsAptitudeController) CreateContrast() {
|
|
|
svc.GetPagingTmpCheckedEntities(&list, where)
|
|
|
if list != nil {
|
|
|
var supplierCertSubList []suppliercertsub.OilSupplierCertSub
|
|
|
- total := svc.GetTableTotal(" SupplierTypeCode='01' AND SupplierId = " + strconv.Itoa(item.Id), &supplierCertSubList)
|
|
|
+ total := svc.GetTableTotal(" SupplierTypeCode = '01' AND SupplierId = " + strconv.Itoa(item.Id), &supplierCertSubList)
|
|
|
total1 := svc.GetNoSubCntTotal("a.SupplierTypeCode = '01' and b.`Name` is null and a.SupplierId = " + strconv.Itoa(item.Id))
|
|
|
list[0].SubCnt = int(total)
|
|
|
- list[0].MinClassId = "0"
|
|
|
+ //list[0].MinClassId = "0"
|
|
|
list[0].NoSubCnt = int(total1)
|
|
|
- for _, sub := range supplierCertSubList {
|
|
|
- var goodsList goodsaptitudeclass.OilGoodsAptitudeClass
|
|
|
- where2 := "Code = '"+ sub.Code + "'"
|
|
|
- svc.GetEntityByWhere(OilGoodsAptitudeClassName, where2, &goodsList)
|
|
|
- if goodsList.Id > 0{
|
|
|
- list[0].MinClassId = strconv.Itoa(goodsList.Id)
|
|
|
- } else {
|
|
|
- list[0].MinClassId = "0"
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
+ //for _, sub := range supplierCertSubList {
|
|
|
+ // var goodsList goodsaptitudeclass.OilGoodsAptitudeClass
|
|
|
+ // where2 := "Code = '"+ sub.Code + "'"
|
|
|
+ // svc.GetEntityByWhere(Tmp_OilGoodsAptitudeClassName, where2, &goodsList)
|
|
|
+ // if goodsList.Id > 0{
|
|
|
+ // list[0].MinClassId = strconv.Itoa(goodsList.Id)
|
|
|
+ // } else {
|
|
|
+ // list[0].MinClassId = "0"
|
|
|
+ // break
|
|
|
+ // }
|
|
|
+ //}
|
|
|
list[0].SetupTime = time.Now()
|
|
|
var oneTwo supplier.OilSupplierContrast
|
|
|
svc.GetEntityByCode("SupplierTypeCode = '01' and SupplierId = "+ strconv.Itoa(list[0].Id), &oneTwo)
|
|
|
@@ -3076,10 +3077,12 @@ func (this *OilGoodsAptitudeController) DeleteSuspend() {
|
|
|
//subDelete.DueTime = "2021-06-06 00:00:00"
|
|
|
paramSvc := baseparameter.GetBaseparameterService(utils.DBE)
|
|
|
DueTimeStr := paramSvc.GetBaseparameterMessage("GFZT", "paramset", "Suspend")
|
|
|
- fmt.Println("返回的时间", DueTimeStr)
|
|
|
- local, _ := time.LoadLocation("Local")
|
|
|
- theTime, _ := time.ParseInLocation("2006-01-02", DueTimeStr, local)
|
|
|
- subDelete.DueTime = theTime
|
|
|
+ //fmt.Println("返回的时间", DueTimeStr)
|
|
|
+ //local, _ := time.LoadLocation("Local")
|
|
|
+ //theTime, _ := time.ParseInLocation("2006-01-02", DueTimeStr, local)
|
|
|
+ currentTime := time.Now()
|
|
|
+ days,_ := strconv.Atoi(DueTimeStr)
|
|
|
+ subDelete.DueTime = currentTime.AddDate(0, 0, days)
|
|
|
i := 1
|
|
|
//暂停
|
|
|
for _, value := range code {
|