select.go 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613
  1. package oilsupplier
  2. import (
  3. "dashoo.cn/backend/api/business/oilsupplier/annualaudit"
  4. "dashoo.cn/backend/api/business/oilsupplier/infochange"
  5. "dashoo.cn/backend/api/business/oilsupplier/qualchange"
  6. "dashoo.cn/backend/api/business/oilsupplier/suppliercert"
  7. "dashoo.cn/backend/api/business/oilsupplier/suppliercertappend"
  8. "dashoo.cn/backend/api/business/register"
  9. "encoding/json"
  10. "fmt"
  11. "strconv"
  12. // "fmt"
  13. "dashoo.cn/backend/api/business/oilsupplier/selectbusiness"
  14. "dashoo.cn/backend/api/business/oilsupplier/supplier"
  15. . "dashoo.cn/backend/api/controllers"
  16. "dashoo.cn/utils"
  17. )
  18. type SelectController struct {
  19. BaseController
  20. }
  21. type UpSearch struct {
  22. FullName string
  23. }
  24. type UpInfoSearch struct {
  25. FullName string
  26. SupplierTypeName string
  27. HeGe int
  28. BuHeGe int
  29. ZongShu int
  30. Reason string
  31. }
  32. // @Title 获取所有
  33. // @Description
  34. // @Success 200 {object}
  35. // @router /getcompanylist [post]
  36. func (this *SelectController) GetTList() {
  37. var model supplier.OilSupplierSelect
  38. var model1 supplier.RegCapitalRange //注册资金范围
  39. //var model2 supplier.NeedFileTypeStruct //资质结构体
  40. var jsonBlob = this.Ctx.Input.RequestBody
  41. json.Unmarshal(jsonBlob, &model)
  42. json.Unmarshal(jsonBlob, &model1)
  43. //json.Unmarshal(jsonBlob, &model2)
  44. // //获取分页信息
  45. page := this.GetPageInfoForm()
  46. where := " 1=1 "
  47. orderby := "a.Id"
  48. asc := true
  49. Order := this.GetString("Order")
  50. Prop := this.GetString("Prop")
  51. if Order != "" && Prop != "" {
  52. orderby = Prop
  53. if Order == "desc" {
  54. asc = false
  55. }
  56. }
  57. //准入证号
  58. if model.AccessCardNo != "" {
  59. where = where + " and b.AccessCardNo like '%" + model.AccessCardNo + "%'"
  60. }
  61. //企业名称
  62. if model.SupplierName != "" {
  63. where = where + " and a.SupplierName like '%" + model.SupplierName + "%'"
  64. }
  65. if model.OldSupplierName != "" {
  66. where = where + " and OldSupplierName like '%" + model.OldSupplierName + "%'"
  67. }
  68. //准入类别(基建,物资,技术服务)
  69. if model.SupplierTypeCode != "" {
  70. where = where + " and b.SupplierTypeCode = '" + model.SupplierTypeCode + "'"
  71. }
  72. //准入标识 1 准入 2 暂停 3取消
  73. if model.InFlag != "" {
  74. where = where + " and b.InFlag = '" + model.InFlag + "'"
  75. }
  76. //法人
  77. if model.LegalPerson != "" {
  78. where = where + " and a.LegalPerson like '%" + model.LegalPerson + "%'"
  79. }
  80. //联系人
  81. if model.ContactName != "" {
  82. where = where + " and a.ContactName like '%" + model.ContactName + "%'"
  83. }
  84. //统一社会信用代码
  85. if model.CommercialNo != "" {
  86. where = where + " and a.CommercialNo like '%" + model.CommercialNo + "%'"
  87. }
  88. //开户银行
  89. if model.DepositBank != "" {
  90. where = where + " and a.DepositBank like '%" + model.DepositBank + "%'"
  91. }
  92. //HSE审查
  93. if model.HseTraining != "" {
  94. where = where + " and a.HseTraining = '" + model.HseTraining + "'"
  95. }
  96. //公司类型
  97. if model.CompanyType != "" {
  98. where = where + " and a.CompanyType like '%" + model.CompanyType + "%'"
  99. }
  100. //成立时间
  101. SetupTime := this.GetString("SetupTime")
  102. if SetupTime != "" {
  103. where = where + " and a.SetupTime ='" + SetupTime + "'"
  104. }
  105. //注册资金范围
  106. if model1.RegCapital1 != "" {
  107. where = where + " and a.RegCapital >= '" + model1.RegCapital1 + "'"
  108. }
  109. if model1.RegCapital2 != "" {
  110. where = where + " and a.RegCapital <= '" + model1.RegCapital2 + "'"
  111. }
  112. //注册省份
  113. if model.Province != "" {
  114. where = where + " and a.Province = '" + model.Province + "'"
  115. }
  116. //注册市
  117. if model.City != "" {
  118. where = where + " and a.City = '" + model.City + "'"
  119. }
  120. //注册区
  121. if model.Street != "" {
  122. where = where + " and a.Street = '" + model.Street + "'"
  123. }
  124. //注册详细地址
  125. if model.Address != "" {
  126. where = where + " and a.Address like '%" + model.Address + "%'"
  127. }
  128. if model.LinkProvince != "" {
  129. where = where + " and a.LinkProvince = '" + model.LinkProvince + "'"
  130. }
  131. if model.LinkCity != "" {
  132. where = where + " and a.LinkCity = '" + model.LinkCity + "'"
  133. }
  134. if model.LinkStreet != "" {
  135. where = where + " and a.LinkStreet = '" + model.LinkStreet + "'"
  136. }
  137. if model.LinkAddress != "" {
  138. where = where + " and a.LinkAddress like '%" + model.LinkAddress + "%'"
  139. }
  140. //营业范围
  141. if model.BusinessScope != "" {
  142. where = where + " and a.BusinessScope like '%" + model.BusinessScope + "%'"
  143. }
  144. a := model.InStyle
  145. fmt.Println(a)
  146. //准入方式
  147. if model.InStyle != "" {
  148. if model.InStyle == "0"{
  149. where = where + " and b.InStyle in ('2','3','4','5')"
  150. }else{
  151. where = where + " and b.InStyle ='" + model.InStyle + "'"
  152. }
  153. }
  154. //包含资质
  155. //if model2.NeedFileType != nil && len(model2.NeedFileType) > 0 {
  156. // pararm := ""
  157. // for i := 0; i < len(model2.NeedFileType); i++ {
  158. //
  159. // pararm = pararm + "'" + model2.NeedFileType[i] + "',"
  160. //
  161. // }
  162. // fmt.Println(pararm[0 : len(pararm)-1])
  163. // where = where + " and d.NeedFileType in (" + pararm[0:len(pararm)-1] + ")"
  164. //}
  165. having:=""
  166. //准入范围
  167. if model.CerSubName!="" {
  168. having = " having CerSubName like '%"+model.CerSubName+"%' "
  169. }
  170. //资质
  171. if model.NeedFileType!="" {
  172. having = " having NeedFileType like '%"+model.NeedFileType+"%' "
  173. }
  174. if model.CerSubName!=""&& model.NeedFileType!=""{
  175. having = " having CerSubName like '%"+model.CerSubName+"%' and NeedFileType like '%"+model.NeedFileType+"%' "
  176. }
  177. svc := selectbusiness.GetSelectService(utils.DBE)
  178. var list []supplier.OilSupplierSelect
  179. total := svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, OilInfoChangeName,OilSupplierCert2FileName , page.CurrentPage, page.Size, orderby, asc, &list, where,having)
  180. var datainfo DataInfo
  181. datainfo.Items = list
  182. datainfo.CurrentItemCount = total
  183. datainfo.PageIndex = page.CurrentPage
  184. datainfo.ItemsPerPage = page.Size
  185. this.Data["json"] = &datainfo
  186. this.ServeJSON()
  187. }
  188. // @Title 获取所有
  189. // @Description
  190. // @Success 200 {object}
  191. // @router /up [post]
  192. func (this *SelectController) Up() {
  193. var model UpSearch
  194. var jsonBlob = this.Ctx.Input.RequestBody
  195. json.Unmarshal(jsonBlob, &model)
  196. // //获取分页信息
  197. page := this.GetPageInfoForm()
  198. where := ""
  199. asc := false
  200. Order := this.GetString("Order")
  201. Prop := this.GetString("Prop")
  202. if Order != "" && Prop != "" {
  203. if Order == "asc" {
  204. asc = true
  205. }
  206. }
  207. if model.FullName != "" {
  208. where = where + " and (select FullName from Base_Organize where Id = a.CommitComId) like '%" + model.FullName + "%'"
  209. }
  210. svc := selectbusiness.GetSelectService(utils.DBE)
  211. var list []UpInfoSearch
  212. total := svc.GetUp( OilSupplierCertName , page.CurrentPage, page.Size, Prop, asc, &list, where)
  213. var datainfo DataInfo
  214. datainfo.Items = list
  215. datainfo.CurrentItemCount = total
  216. datainfo.PageIndex = page.CurrentPage
  217. datainfo.ItemsPerPage = page.Size
  218. this.Data["json"] = &datainfo
  219. this.ServeJSON()
  220. }
  221. // @Title 获取所有资质名称
  222. // @Description
  223. // @Success 200 {object}
  224. // @router /getnftoptions [post]
  225. func (this *SelectController) GetNFTOptions() {
  226. svc := selectbusiness.GetSelectService(utils.DBE)
  227. var list []map[string]string
  228. sql := "select distinct(Name) from " + BaseTableHeader + ""
  229. list, _ = svc.DBE.QueryString(sql)
  230. var datainfo DataInfo
  231. datainfo.Items = list
  232. this.Data["json"] = &datainfo
  233. this.ServeJSON()
  234. }
  235. // @Title 流程查询准入
  236. // @Description
  237. // @Success 200 {object}
  238. // @router /getprocessauditlist [get]
  239. func (this *SelectController) GetProcessAuditList() {
  240. //获取分页信息
  241. page := this.GetPageInfoForm()
  242. where := " 1=1 "
  243. orderby := "Id"
  244. asc := false
  245. Order := this.GetString("Order")
  246. Prop := this.GetString("Prop")
  247. if Order != "" && Prop != "" {
  248. orderby = Prop
  249. if Order == "asc" {
  250. asc = true
  251. }
  252. }
  253. svc := supplier.GetOilSupplierService(utils.DBE)
  254. tabinx := this.GetString("tabinx")
  255. supplierTypeCode := this.GetString("SupplierTypeCode")
  256. supplierName := this.GetString("SupplierName")
  257. //企业用户必须加创建人条件
  258. var registerUser register.OilCorporateInfo
  259. sql := " UserName='" + this.User.Username + "'"
  260. svc.GetEntity(&registerUser,sql)
  261. if this.User.IsCompanyUser == 1 {
  262. where = where + " and (b.CreateUserId = '" + this.User.Id + "' or a.CommercialNo='"+registerUser.CommercialNo+"')"
  263. }
  264. if supplierTypeCode != "" {
  265. where = where + " and b.SupplierTypeCode like '%" + supplierTypeCode + "%'"
  266. }
  267. if supplierName != "" {
  268. where = where + " and a.SupplierName like '%" + supplierName + "%'"
  269. }
  270. var total int64 = 0
  271. var datainfo DataInfo
  272. if tabinx == "0" {
  273. var list []supplier.OilSupplierView
  274. total = svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, page.CurrentPage, page.Size, orderby, asc, &list, where)
  275. datainfo.Items = list
  276. } else if tabinx == "1" {
  277. whereapp := "1=1"
  278. //企业用户必须加创建人条件
  279. if this.User.IsCompanyUser == 1 {
  280. whereapp = whereapp + " and CreateUserId = '" + this.User.Id + "'"
  281. }
  282. if supplierTypeCode != "" {
  283. whereapp = whereapp + " and AppendType like '%" + supplierTypeCode + "%'"
  284. }
  285. if supplierName != "" {
  286. whereapp = whereapp + " and SupplierName like '%" + supplierName + "%'"
  287. }
  288. var list []suppliercertappend.OilSupplierCertAppend
  289. svc := suppliercertappend.GetOilSupplierCertAppendService(utils.DBE)
  290. total = svc.GetPagingEntitiesWithOrderBytbl("", page.CurrentPage, page.Size, orderby, asc, &list, whereapp)
  291. datainfo.Items = list
  292. } else if tabinx == "2" {
  293. whereapp := "1=1"
  294. //企业用户必须加创建人条件
  295. if this.User.IsCompanyUser == 1 {
  296. whereapp = whereapp + " and CreateUserId = '" + this.User.Id + "'"
  297. }
  298. if supplierTypeCode != "" {
  299. whereapp = whereapp + " and SupplierTypeName like '%" + supplierTypeCode + "%'"
  300. }
  301. if supplierName != "" {
  302. whereapp = whereapp + " and SupplierName like '%" + supplierName + "%'"
  303. }
  304. var list []annualaudit.OilAnnualAudit
  305. svc := annualaudit.GetOilAnnualAuditService(utils.DBE)
  306. total = svc.GetPagingEntitiesWithOrderBytbl("", page.CurrentPage, page.Size, orderby, asc, &list, whereapp)
  307. datainfo.Items = list
  308. } else if tabinx == "3" {
  309. whereapp := "1=1"
  310. //企业用户必须加创建人条件
  311. if this.User.IsCompanyUser == 1 {
  312. whereapp = whereapp + " and CreateUserId = '" + this.User.Id + "'"
  313. }
  314. if supplierName != "" {
  315. whereapp = whereapp + " and SupplierName like '%" + supplierName + "%'"
  316. }
  317. var list []infochange.OilInfoChange
  318. svc := infochange.GetInfoChangeService(utils.DBE)
  319. total = svc.GetPagingEntitiesWithOrderBytbl("", page.CurrentPage, page.Size, orderby, asc, &list, whereapp)
  320. datainfo.Items = list
  321. } else if tabinx == "4" {
  322. whereapp := "1=1"
  323. //企业用户必须加创建人条件
  324. if this.User.IsCompanyUser == 1 {
  325. whereapp = whereapp + " and CreateUserId = '" + this.User.Id + "'"
  326. }
  327. if supplierName != "" {
  328. whereapp = whereapp + " and SupplierName like '%" + supplierName + "%'"
  329. }
  330. svc := qualchange.GetQualChangeService(utils.DBE)
  331. var list []qualchange.OilQualChangeMain
  332. total = svc.GetPagingEntitiesWithOrderBytbl("", page.CurrentPage, page.Size, orderby, asc, &list, whereapp)
  333. datainfo.Items = list
  334. }
  335. datainfo.CurrentItemCount = total
  336. datainfo.PageIndex = page.CurrentPage
  337. datainfo.ItemsPerPage = page.Size
  338. this.Data["json"] = &datainfo
  339. this.ServeJSON()
  340. }
  341. // @Title 准入范围查询
  342. // @Description
  343. // @Success 200 {object}
  344. // @router /zrfwselect [get]
  345. func (this *SelectController) ZrfwSelect() {
  346. //获取分页信息
  347. page := this.GetPageInfoForm()
  348. limitCurrent:=(page.CurrentPage-1)*page.Size
  349. svc := selectbusiness.GetSelectService(utils.DBE)
  350. supplierTypeCode := this.GetString("SupplierTypeCode")
  351. //企业用户必须加创建人条件
  352. var registerUser register.OilCorporateInfo
  353. var company supplier.OilSupplier
  354. sql := " UserName='" + this.User.Username + "'"
  355. svc.GetEntity(&registerUser,sql)
  356. if this.User.IsCompanyUser == 1 {
  357. sql1:= " CreateUserId = '" + this.User.Id + "' or CommercialNo='"+registerUser.CommercialNo+"'"
  358. svc.GetEntity(&company,sql1)
  359. }
  360. if company.SupplierName!=""{
  361. sql2:="select distinct(Code),Name,SupplierId from OilSupplierCert2File where SupplierId='"+strconv.Itoa(company.Id)+"' and SupplierTypeCode='"+supplierTypeCode+"' order by Code limit "+strconv.FormatInt(limitCurrent,10)+","+strconv.FormatInt(page.Size,10)+""
  362. result,_:=svc.DBE.QueryString(sql2)
  363. sql3:="select count(distinct(Code)) total from OilSupplierCert2File where SupplierId='"+strconv.Itoa(company.Id)+"' and SupplierTypeCode='"+supplierTypeCode+"'"
  364. result1,_:=svc.DBE.QueryString(sql3)
  365. total,_:= strconv.ParseInt(result1[0]["total"], 10, 64)
  366. var datainfo DataInfo
  367. datainfo.Items = result
  368. datainfo.CurrentItemCount = total
  369. datainfo.PageIndex = page.CurrentPage
  370. datainfo.ItemsPerPage = page.Size
  371. this.Data["json"] = &datainfo
  372. this.ServeJSON()
  373. }else{
  374. var datainfo DataInfo
  375. datainfo.Items = ""
  376. datainfo.PageIndex = page.CurrentPage
  377. datainfo.ItemsPerPage = page.Size
  378. this.Data["json"] = &datainfo
  379. this.ServeJSON()
  380. }
  381. }
  382. // @Title 获取所有
  383. // @Description
  384. // @Success 200 {object}
  385. // @router /getallbusinesslist [post]
  386. func (this *SelectController) GetAllBusinesList() {
  387. perject := this.GetString("Perject")
  388. accessCardNo := this.GetString("AccessCardNo")
  389. supplierTypeCode := this.GetString("SupplierTypeCode")
  390. supplierName := this.GetString("SupplierName")
  391. var list []selectbusiness.SelectBusiness
  392. // 准入
  393. if perject == "1" || perject == "" {
  394. where := "1=1 "
  395. if accessCardNo != "" {
  396. where = where + " and b.AccessCardNo='" + accessCardNo + "'"
  397. }
  398. if supplierTypeCode != "" {
  399. where = where + " and b.SupplierTypeCode='" + supplierTypeCode + "'"
  400. }
  401. if supplierName != "" {
  402. where =where + " and a.SupplierName like '%" + supplierName + "%'"
  403. }
  404. var zrlist []supplier.OilSupplierView
  405. zrsvc := supplier.GetOilSupplierService(utils.DBE)
  406. if this.User.IsCompanyUser == 1 {
  407. var registerUser register.OilCorporateInfo
  408. sql := " UserName='" + this.User.Username + "'"
  409. zrsvc.GetEntity(&registerUser,sql)
  410. where = where + " and (b.CreateUserId = '" + this.User.Id + "' or a.CommercialNo='" + registerUser.CommercialNo + "')"
  411. }
  412. zrwhere := where + " and b.Status='" + suppliercert.STORE_STATUS + "'"
  413. zrsvc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, 1, 100, "b.Id", false , &zrlist, zrwhere)
  414. for _, item := range zrlist {
  415. var sele selectbusiness.SelectBusiness
  416. sele.SupplierName = item.SupplierName
  417. sele.CreateOn = item.CreateOn
  418. sele.AccessCardNo = item.AccessCardNo
  419. sele.TypeCode = item.SupplierTypeCode
  420. sele.TypeName = item.SupplierTypeName
  421. sele.Preject = "1"
  422. list = append(list, sele)
  423. }
  424. }
  425. // 增项
  426. if perject == "2" || perject == "" {
  427. where := "1=1 "
  428. if accessCardNo != "" {
  429. where = where + " and b.AccessCardNo='" + accessCardNo + "'"
  430. }
  431. if supplierTypeCode != "" {
  432. where = where + " and b.AppendType='" + supplierTypeCode + "'"
  433. }
  434. if supplierName != "" {
  435. where =where + " and a.SupplierName like '%" + supplierName + "%'"
  436. }
  437. var zxlist []suppliercertappend.OilSupplierCertAppend
  438. zxsvc := suppliercertappend.GetOilSupplierCertAppendService(utils.DBE)
  439. if this.User.IsCompanyUser == 1 {
  440. var registerUser register.OilCorporateInfo
  441. sql := " UserName='" + this.User.Username + "'"
  442. zxsvc.GetEntity(&registerUser,sql)
  443. where = where + " and (b.CreateUserId = '" + this.User.Id + "' or a.CommercialNo='" + registerUser.CommercialNo + "')"
  444. }
  445. zxwhere := where + " and b.Status='" + suppliercert.STORE_STATUS + "'"
  446. zxsvc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertAppendName, 1, 100, "b.Id", false, &zxlist, zxwhere)
  447. for _, item := range zxlist {
  448. var sele selectbusiness.SelectBusiness
  449. sele.SupplierName = item.SupplierName
  450. sele.CreateOn = item.CreateOn
  451. sele.AccessCardNo = item.AccessCardNo
  452. sele.TypeCode = item.AppendType
  453. sele.TypeName = ""
  454. sele.Preject = "2"
  455. list = append(list, sele)
  456. }
  457. }
  458. // 年审
  459. if perject == "3" || perject == "" {
  460. where := "1=1 "
  461. if accessCardNo != "" {
  462. where = where + " and b.AccessCardNo='" + accessCardNo + "'"
  463. }
  464. if supplierTypeCode != "" {
  465. where = where + " and b.SupplierTypeName='" + supplierTypeCode + "'"
  466. }
  467. if supplierName != "" {
  468. where =where + " and a.SupplierName like '%" + supplierName + "%'"
  469. }
  470. var nslist []annualaudit.OilAnnualAudit
  471. nssvc := annualaudit.GetOilAnnualAuditService(utils.DBE)
  472. if this.User.IsCompanyUser == 1 {
  473. var registerUser register.OilCorporateInfo
  474. sql := " UserName='" + this.User.Username + "'"
  475. nssvc.GetEntity(&registerUser,sql)
  476. where = where + " and (b.CreateUserId = '" + this.User.Id + "' or a.CommercialNo='" + registerUser.CommercialNo + "')"
  477. }
  478. zswhere := where + " and b.Status='" + suppliercert.DRAFT_STATUS + "'"
  479. nssvc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilAnnualAuditName,1, 100, "b.Id", false, &nslist, zswhere)
  480. for _, item := range nslist {
  481. var sele selectbusiness.SelectBusiness
  482. sele.SupplierName = item.SupplierName
  483. sele.CreateOn = item.CreateOn
  484. sele.AccessCardNo = item.AccessCardNo
  485. sele.TypeCode = item.SupplierTypeName
  486. sele.TypeName = ""
  487. sele.Preject = "3"
  488. list = append(list, sele)
  489. }
  490. }
  491. // 变更申请
  492. if perject == "4" || perject == "" {
  493. where := "1=1 "
  494. if accessCardNo != "" {
  495. where = where + " and b.AccessCardNo='" + accessCardNo + "'"
  496. }
  497. if supplierTypeCode != "" {
  498. where = where + " and b.SupplierTypeCode='" + supplierTypeCode + "'"
  499. }
  500. if supplierName != "" {
  501. where =where + " and a.SupplierName like '%" + supplierName + "%'"
  502. }
  503. var bglist []infochange.SuppModelInfo
  504. bgsvc := infochange.GetInfoChangeService(utils.DBE)
  505. if this.User.IsCompanyUser == 1 {
  506. var registerUser register.OilCorporateInfo
  507. sql := " UserName='" + this.User.Username + "'"
  508. bgsvc.GetEntity(&registerUser,sql)
  509. where = where + " and (b.CreateUserId = '" + this.User.Id + "' or a.CommercialNo='" + registerUser.CommercialNo + "')"
  510. }
  511. bgwhere := where + " and b.Status='" + suppliercert.DRAFT_STATUS + "'"
  512. bgsvc.GetSuppPagingEntitiesWithOrderBytbl(OilSupplierName, OilInfoChangeName, 1, 100, "b.Id", false, &bglist, bgwhere)
  513. for _, item := range bglist {
  514. var sele selectbusiness.SelectBusiness
  515. sele.SupplierName = item.SupplierName
  516. sele.CreateOn = item.CreateOn
  517. sele.AccessCardNo = ""
  518. sele.TypeCode = item.SupplierTypeCode
  519. sele.TypeName = item.SupplierTypeName
  520. sele.Preject = "4"
  521. list = append(list, sele)
  522. }
  523. }
  524. var datainfo DataInfo
  525. datainfo.Items = list
  526. this.Data["json"] = &datainfo
  527. this.ServeJSON()
  528. }