|
|
@@ -1532,18 +1532,23 @@ func (this *OilGoodsAptitudeController) ImportExcel() {
|
|
|
svc := goodsaptitude.GetOilGoodsAptitudeService(utils.DBE)
|
|
|
var list1 []supplier.OilSupplier
|
|
|
svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, 0, 0, "Id", false, &list1, " 1=1")
|
|
|
+ svc.DBE.Query("SET unique_checks=0;")
|
|
|
+ svc.DBE.Query("SET autocommit=0;")
|
|
|
for _, item := range list1 {
|
|
|
var list []supplier.OilSupplierContrast
|
|
|
where := " b.SupplierTypeCode='01' and a.Id = " + strconv.Itoa(item.Id)
|
|
|
svc.GetPagingTmpCheckedEntities(&list, where)
|
|
|
if list != nil {
|
|
|
total := svc.GetTableTotal(" SupplierId = " + strconv.Itoa(item.Id))
|
|
|
- total1 := svc.GetTableTotal(" SubClassId > 0 and SupplierId = " + strconv.Itoa(item.Id))
|
|
|
+ total1 := svc.GetTableTotal(" SubClassId = 0 and SupplierId = " + strconv.Itoa(item.Id))
|
|
|
list[0].SubCnt = int(total)
|
|
|
list[0].NoSubCnt = int(total1)
|
|
|
svc.InsertEntityBytbl("OilSupplierContrast", list[0])
|
|
|
+ svc.DBE.Query("commit;")
|
|
|
}
|
|
|
}
|
|
|
+ svc.DBE.Query("SET unique_checks=1;")
|
|
|
+ svc.DBE.Query("SET autocommit=1;")
|
|
|
elapsed1 := time.Since(t)
|
|
|
log.Println(elapsed1)
|
|
|
}
|
|
|
@@ -1715,6 +1720,8 @@ func (this *OilGoodsAptitudeController) CreateContrast() {
|
|
|
// 插入对比列表
|
|
|
var list1 []supplier.OilSupplier
|
|
|
svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, 0, 0, "Id", false, &list1, " 1=1")
|
|
|
+ svc.DBE.Query("SET unique_checks=0;")
|
|
|
+ svc.DBE.Query("SET autocommit=0;")
|
|
|
for _, item := range list1 {
|
|
|
var list []supplier.OilSupplierContrast
|
|
|
where := " b.SupplierTypeCode='01' and a.Id = " + strconv.Itoa(item.Id)
|
|
|
@@ -1725,8 +1732,11 @@ func (this *OilGoodsAptitudeController) CreateContrast() {
|
|
|
list[0].SubCnt = int(total)
|
|
|
list[0].NoSubCnt = int(total1)
|
|
|
svc.InsertEntityBytbl("OilSupplierContrast", list[0])
|
|
|
+ svc.DBE.Query("commit;")
|
|
|
}
|
|
|
}
|
|
|
+ svc.DBE.Query("SET unique_checks=1;")
|
|
|
+ svc.DBE.Query("SET autocommit=1;")
|
|
|
var errorinfo ErrorInfo
|
|
|
errorinfo.Code = 0
|
|
|
errorinfo.Message = "成功!"
|