|
|
@@ -1426,9 +1426,9 @@ func (this *OilGoodsAptitudeController) InsertGoodsAptitude() {
|
|
|
// @router /updatasuppiercertsub [get]
|
|
|
func (this *OilGoodsAptitudeController) UpdataSuppierCertSub() {
|
|
|
|
|
|
- excelFileName := "F:/ssa.xlsx"
|
|
|
- xlFile, _ := xlsx.OpenFile(excelFileName)
|
|
|
- var sheet = xlFile.Sheets[0]
|
|
|
+ //excelFileName := "F:/ssa.xlsx"
|
|
|
+ //xlFile, _ := xlsx.OpenFile(excelFileName)
|
|
|
+ //var sheet = xlFile.Sheets[0]
|
|
|
|
|
|
t := time.Now()
|
|
|
|
|
|
@@ -1437,7 +1437,7 @@ func (this *OilGoodsAptitudeController) UpdataSuppierCertSub() {
|
|
|
|
|
|
supsvc := supplier.GetOilSupplierService(utils.DBE)
|
|
|
var suppliercertList []suppliercert.OilSupplierCert
|
|
|
- where := "AccessCardNo='2018WZ048'"//"SupplierTypeCode='01' AND OutsideFlog = '' AND (InFlag IN ('1','2')) "
|
|
|
+ where := "SupplierTypeCode='01' AND OutsideFlog = '' AND (InFlag IN ('1','2')) "
|
|
|
supsvc.GetEntities(&suppliercertList, where)
|
|
|
|
|
|
var goodsaptitudeClassList []goodsaptitudeclass.OilGoodsAptitudeClass
|
|
|
@@ -1446,9 +1446,9 @@ func (this *OilGoodsAptitudeController) UpdataSuppierCertSub() {
|
|
|
|
|
|
var colsname = []string{"Name"}
|
|
|
for _, suppliercert := range suppliercertList {
|
|
|
- row := sheet.AddRow()
|
|
|
- cell := row.AddCell()
|
|
|
- cell.Value = strconv.Itoa(suppliercert.SupplierId)
|
|
|
+ //row := sheet.AddRow()
|
|
|
+ //cell := row.AddCell()
|
|
|
+ //cell.Value = strconv.Itoa(suppliercert.SupplierId)
|
|
|
log.Println(suppliercert.SupplierId)
|
|
|
var supplierCertSubList []suppliercertsub.OilSupplierCertSub
|
|
|
wheresup := "SupplierId = " + strconv.Itoa(suppliercert.SupplierId) + " and SupplierTypeCode='01' AND Type IN ('1', '3')"
|
|
|
@@ -1458,9 +1458,9 @@ func (this *OilGoodsAptitudeController) UpdataSuppierCertSub() {
|
|
|
//for idx, supplierCertSub := range supplierCertSubList {
|
|
|
|
|
|
for idx :=0; idx < len(supplierCertSubList); idx++{
|
|
|
- row := sheet.AddRow()
|
|
|
- cell := row.AddCell()
|
|
|
- cell.Value = "删除"
|
|
|
+ //row := sheet.AddRow()
|
|
|
+ //cell := row.AddCell()
|
|
|
+ //cell.Value = "删除"
|
|
|
|
|
|
supplierCertSub := supplierCertSubList[idx]
|
|
|
decCode := supplierCertSub.Code
|
|
|
@@ -1475,8 +1475,8 @@ func (this *OilGoodsAptitudeController) UpdataSuppierCertSub() {
|
|
|
where := "SupplierId=" + strconv.Itoa(suppliercert.SupplierId) + " and NeedFileType='" + val + "'" + " and SupplierTypeCode IN ('000', '01')"
|
|
|
has := supsvc.GetEntityByWhere(OilSupplierFileName, where, &supplierFile)
|
|
|
if !has {
|
|
|
- cell := row.AddCell()
|
|
|
- cell.Value = supplierCertSub.Code + " " + supplierCertSub.Name
|
|
|
+ //cell := row.AddCell()
|
|
|
+ //cell.Value = supplierCertSub.Code + " " + supplierCertSub.Name
|
|
|
log.Println(supplierCertSub.Code + "====" + val)
|
|
|
//wheredel := "Id = " + strconv.Itoa(supplierCertSub.Id)
|
|
|
//supsvc.DeleteEntityBytbl(OilSupplierCertSubName, wheredel)
|
|
|
@@ -1484,9 +1484,9 @@ func (this *OilGoodsAptitudeController) UpdataSuppierCertSub() {
|
|
|
break
|
|
|
}
|
|
|
if supplierCertSub.Name != goodsaptitudeClass.Name {
|
|
|
- row := sheet.AddRow()
|
|
|
- cell := row.AddCell()
|
|
|
- cell.Value = supplierCertSub.Code + ":" + supplierCertSub.Name + "==" + goodsaptitudeClass.Name
|
|
|
+ //row := sheet.AddRow()
|
|
|
+ //cell := row.AddCell()
|
|
|
+ //cell.Value = supplierCertSub.Code + ":" + supplierCertSub.Name + "==" + goodsaptitudeClass.Name
|
|
|
var entity suppliercertsub.OilSupplierCertSub
|
|
|
entity.Name = goodsaptitudeClass.Name
|
|
|
where := "Id = " + strconv.Itoa(supplierCertSub.Id)
|
|
|
@@ -1501,14 +1501,14 @@ func (this *OilGoodsAptitudeController) UpdataSuppierCertSub() {
|
|
|
//supsvc.DeleteEntityBytbl(OilSupplierCertSubName, wheredel)
|
|
|
supsvc.InsertEntityBytbl(TmpOilSupplierCertSubName, supplierCertSub)
|
|
|
}
|
|
|
- cell1 := row.AddCell()
|
|
|
- cell1.Value = decCode
|
|
|
+ //cell1 := row.AddCell()
|
|
|
+ //cell1.Value = decCode
|
|
|
|
|
|
}
|
|
|
}
|
|
|
elapsed := time.Since(t)
|
|
|
log.Println(elapsed)
|
|
|
- xlFile.Save(excelFileName)
|
|
|
+ //xlFile.Save(excelFileName)
|
|
|
|
|
|
}
|
|
|
|