|
|
@@ -573,6 +573,7 @@ func (this *OilContractController) ImportExcel() {
|
|
|
svc.GetEntityByWhere("Base_Organize", "FullName = '"+sheet.Rows[i].Cells[7].String()+"'", &org)
|
|
|
if org.Id > 0 {
|
|
|
con.SecondUnit = org.Id
|
|
|
+ con.SecondUnitName = org.Fullname
|
|
|
}
|
|
|
con.Number = sheet.Rows[i].Cells[9].String()
|
|
|
con.ChooseWay = sheet.Rows[i].Cells[10].String()
|
|
|
@@ -719,12 +720,14 @@ func (this *OilContractController) ImportUpdate() {
|
|
|
}
|
|
|
|
|
|
if Column == "SecondUnit" {
|
|
|
+ var org organize.Base_Organize
|
|
|
+ svc.GetEntityByWhere("Base_Organize", "Id = " + Value, &org)
|
|
|
if Id != "" {
|
|
|
where += " and Id = " + Id + " and ImportStatus = 0 and ImportSecondUnit = '" + Class + "'"
|
|
|
- sql = "update OilContract set SupplierName = '" + supp.SupplierName + "', " + Column + " = " + Value + " where " + where
|
|
|
+ sql = "update OilContract set SecondUnitName = '" + org.Fullname + "',SupplierName = '" + supp.SupplierName + "', " + Column + " = " + Value + " where " + where
|
|
|
} else {
|
|
|
where += " and ImportStatus = 0 and ImportSecondUnit = '" + Class + "' and " + Column + " = 0"
|
|
|
- sql = "update OilContract set " + Column + " = " + Value + " where " + where
|
|
|
+ sql = "update OilContract set SecondUnitName = '" + org.Fullname + "'," + Column + " = " + Value + " where " + where
|
|
|
}
|
|
|
_, err = utils.DBE.Query(sql)
|
|
|
}
|