select.go 35 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148
  1. package oilsupplier
  2. import (
  3. "archive/zip"
  4. "dashoo.cn/backend/api/business/oilsupplier/annualaudit"
  5. "dashoo.cn/backend/api/business/oilsupplier/infochange"
  6. "dashoo.cn/backend/api/business/oilsupplier/qualchange"
  7. "dashoo.cn/backend/api/business/oilsupplier/suppliercert"
  8. "dashoo.cn/backend/api/business/oilsupplier/suppliercertappend"
  9. "dashoo.cn/backend/api/business/oilsupplier/supplierfile"
  10. "dashoo.cn/backend/api/business/oilsupplier/tableheader"
  11. "dashoo.cn/backend/api/business/register"
  12. "encoding/json"
  13. "fmt"
  14. "io"
  15. "os"
  16. "sort"
  17. "strconv"
  18. "strings"
  19. "time"
  20. // "fmt"
  21. "dashoo.cn/backend/api/business/oilsupplier/selectbusiness"
  22. "dashoo.cn/backend/api/business/oilsupplier/supplier"
  23. . "dashoo.cn/backend/api/controllers"
  24. "dashoo.cn/utils"
  25. . "github.com/linxGnu/goseaweedfs"
  26. )
  27. type SelectController struct {
  28. BaseController
  29. }
  30. type UpSearch struct {
  31. FullName string
  32. }
  33. type UpInfoSearch struct {
  34. FullName string
  35. SupplierTypeName string
  36. HeGe int
  37. BuHeGe int
  38. ZongShu int
  39. Reason string
  40. }
  41. type Processinfo struct {
  42. Id int
  43. AccessCardNo string
  44. WorkflowId string
  45. ProcessKey string
  46. SupplierName string
  47. SupplierTypeCode string
  48. Status string
  49. Type string
  50. CreateOn time.Time
  51. AddinTime time.Time
  52. RecUnitName string
  53. ContactName string
  54. Mobile string
  55. }
  56. // @Title 获取所有
  57. // @Description
  58. // @Success 200 {object}
  59. // @router /getcompanylist [post]
  60. func (this *SelectController) GetTList() {
  61. var model supplier.OilSupplierSelect
  62. var model1 supplier.RegCapitalRange //注册资金范围
  63. //var model2 supplier.NeedFileTypeStruct //资质结构体
  64. var jsonBlob = this.Ctx.Input.RequestBody
  65. json.Unmarshal(jsonBlob, &model)
  66. json.Unmarshal(jsonBlob, &model1)
  67. //json.Unmarshal(jsonBlob, &model2)
  68. // //获取分页信息
  69. page := this.GetPageInfoForm()
  70. where := " 1=1 AND b.InFlag in (1,2,3) AND b.Status = '8' "
  71. orderby := "a.Id"
  72. asc := true
  73. Order := this.GetString("Order")
  74. Prop := this.GetString("Prop")
  75. CheckUId := this.GetString("CheckUId")
  76. FullId := this.GetString("FullId")
  77. if Order != "" && Prop != "" {
  78. orderby = Prop
  79. if Order == "desc" {
  80. asc = false
  81. }
  82. }
  83. leftjoin := ""
  84. //准入证号
  85. if model.AccessCardNo != "" {
  86. where = where + " and b.AccessCardNo like '%" + model.AccessCardNo + "%'"
  87. }
  88. //企业名称
  89. if model.SupplierName != "" {
  90. where = where + " and a.SupplierName like '%" + model.SupplierName + "%'"
  91. }
  92. if model.OldSupplierName != "" {
  93. where = where + " and OldSupplierName like '%" + model.OldSupplierName + "%'"
  94. }
  95. if FullId != "" {
  96. where = where + " and f.Id = '" + FullId + "'"
  97. }
  98. if CheckUId != "" {
  99. where = where + " and g.CheckUnitId = '" + CheckUId + "'"
  100. }
  101. //准入类别(基建,物资,技术服务)
  102. if model.SupplierTypeCode != "" {
  103. where = where + " and b.SupplierTypeCode = '" + model.SupplierTypeCode + "'"
  104. }
  105. //准入标识 1 准入 2 暂停 3取消
  106. if model.InFlag != "" {
  107. where = where + " and b.InFlag = '" + model.InFlag + "'"
  108. }
  109. //法人
  110. if model.LegalPerson != "" {
  111. where = where + " and a.LegalPerson like '%" + model.LegalPerson + "%'"
  112. }
  113. //联系人
  114. if model.ContactName != "" {
  115. where = where + " and a.ContactName like '%" + model.ContactName + "%'"
  116. }
  117. //统一社会信用代码
  118. if model.CommercialNo != "" {
  119. where = where + " and a.CommercialNo like '%" + model.CommercialNo + "%'"
  120. }
  121. //开户银行
  122. if model.DepositBank != "" {
  123. where = where + " and a.DepositBank like '%" + model.DepositBank + "%'"
  124. }
  125. //HSE审查
  126. if model.HseTraining != "" {
  127. where = where + " and a.HseTraining = '" + model.HseTraining + "'"
  128. }
  129. //公司类型
  130. if model.CompanyType != "" {
  131. where = where + " and a.CompanyType like '%" + model.CompanyType + "%'"
  132. }
  133. //成立时间
  134. SetupTime := this.GetString("SetupTime")
  135. if SetupTime != "" {
  136. where = where + " and a.SetupTime ='" + SetupTime + "'"
  137. }
  138. //注册资金范围
  139. if model1.RegCapital1 != "" {
  140. where = where + " and a.RegCapital >= '" + model1.RegCapital1 + "'"
  141. }
  142. if model1.RegCapital2 != "" {
  143. where = where + " and a.RegCapital <= '" + model1.RegCapital2 + "'"
  144. }
  145. //注册省份
  146. if model.Province != "" {
  147. where = where + " and a.Province = '" + model.Province + "'"
  148. }
  149. //注册市
  150. if model.City != "" {
  151. where = where + " and a.City = '" + model.City + "'"
  152. }
  153. //注册区
  154. if model.Street != "" {
  155. where = where + " and a.Street = '" + model.Street + "'"
  156. }
  157. //注册详细地址
  158. if model.Address != "" {
  159. where = where + " and a.Address like '%" + model.Address + "%'"
  160. }
  161. if model.LinkProvince != "" {
  162. where = where + " and a.LinkProvince = '" + model.LinkProvince + "'"
  163. }
  164. if model.LinkCity != "" {
  165. where = where + " and a.LinkCity = '" + model.LinkCity + "'"
  166. }
  167. if model.LinkStreet != "" {
  168. where = where + " and a.LinkStreet = '" + model.LinkStreet + "'"
  169. }
  170. if model.LinkAddress != "" {
  171. where = where + " and a.LinkAddress like '%" + model.LinkAddress + "%'"
  172. }
  173. //营业范围
  174. if model.BusinessScope != "" {
  175. where = where + " and a.BusinessScope like '%" + model.BusinessScope + "%'"
  176. }
  177. CreateOn := this.GetString("CreateOn")
  178. if CreateOn != "" {
  179. dates := strings.Split(CreateOn, ",")
  180. if len(dates) == 2 {
  181. minDate := dates[0]
  182. maxDate := dates[1]
  183. where = where + " and a.CreateOn>='" + minDate + "' and a.CreateOn<='" + maxDate + "'"
  184. }
  185. }
  186. a := model.InStyle
  187. fmt.Println(a)
  188. //准入方式
  189. if model.InStyle != "" {
  190. if model.InStyle == "0"{
  191. where = where + " and b.InStyle in ('2','3','4','5')"
  192. }else{
  193. where = where + " and b.InStyle ='" + model.InStyle + "'"
  194. }
  195. }
  196. //包含资质
  197. //if model2.NeedFileType != nil && len(model2.NeedFileType) > 0 {
  198. // pararm := ""
  199. // for i := 0; i < len(model2.NeedFileType); i++ {
  200. //
  201. // pararm = pararm + "'" + model2.NeedFileType[i] + "',"
  202. //
  203. // }
  204. // fmt.Println(pararm[0 : len(pararm)-1])
  205. // where = where + " and d.NeedFileType in (" + pararm[0:len(pararm)-1] + ")"
  206. //}
  207. having:=""
  208. //准入范围
  209. if model.CerSubName!="" {
  210. having = " having CerSubName like '%"+model.CerSubName+"%' "
  211. leftjoin = "left join "+ OilSupplierCertSubName + " d on d.SupplierCertId = b.Id "
  212. }
  213. //资质
  214. if model.NeedFileType!="" {
  215. having = " having NeedFileType like '%"+model.NeedFileType+"%' "
  216. }
  217. if model.CerSubName!=""&& model.NeedFileType!=""{
  218. having = " having CerSubName like '%"+model.CerSubName+"%' and NeedFileType like '%"+model.NeedFileType+"%' "
  219. leftjoin = "left join "+ OilSupplierCertSubName + " d on d.SupplierCertId = b.Id "
  220. }
  221. svc := selectbusiness.GetSelectService(utils.DBE)
  222. var list []supplier.OilSupplierSelect
  223. total := svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, OilInfoChangeName,OilCorporateInfoName,OilSupplierCertSubName,
  224. OilSupplierFileName, page.CurrentPage, page.Size, orderby, asc, &list, where,having, leftjoin)
  225. var datainfo DataInfo
  226. datainfo.Items = list
  227. datainfo.CurrentItemCount = total
  228. datainfo.PageIndex = page.CurrentPage
  229. datainfo.ItemsPerPage = page.Size
  230. this.Data["json"] = &datainfo
  231. this.ServeJSON()
  232. }
  233. // @Title 根据公司名获取公司信息和准入
  234. // @Description
  235. // @Success 200 {object}
  236. // @router /getbaseinfo [post]
  237. func (this *SelectController) GetBaseInfo() {
  238. Spesearch := this.GetString("Spesearch")
  239. spesearchs := strings.Split(Spesearch, ",")
  240. svc := selectbusiness.GetSelectService(utils.DBE)
  241. var infoIntelist []supplier.OilSupplierInte
  242. for _,item := range spesearchs {
  243. //var supplierinfo supplier.SupplierInfoInte
  244. var infoInte supplier.OilSupplierInte
  245. where := " where 1 = 1 AND a.SupplierName = '" + item + "'"
  246. svc.GetInfoByCompId(where,&infoInte.SupplierInfo)
  247. var cert1 suppliercert.OilSupplierCert
  248. where = "SupplierId=" + strconv.Itoa(infoInte.SupplierInfo.Id) + " and SupplierTypeCode= '01'"
  249. svc.GetEntityByWhere(OilSupplierCertName, where, &cert1)
  250. infoInte.SupplierInfo.WZStatus = cert1.InFlag
  251. infoInte.SupplierInfo.WZDate = cert1.ApplyTime.Format("2006-01-02")
  252. var cert2 suppliercert.OilSupplierCert
  253. where = "SupplierId=" + strconv.Itoa(infoInte.SupplierInfo.Id) + " and SupplierTypeCode= '02'"
  254. svc.GetEntityByWhere(OilSupplierCertName, where, &cert2)
  255. infoInte.SupplierInfo.JSStatus = cert2.InFlag
  256. infoInte.SupplierInfo.JSDate = cert2.ApplyTime.Format("2006-01-02")
  257. var cert3 suppliercert.OilSupplierCert
  258. where = "SupplierId=" + strconv.Itoa(infoInte.SupplierInfo.Id) + " and SupplierTypeCode= '03'"
  259. svc.GetEntityByWhere(OilSupplierCertName, where, &cert3)
  260. infoInte.SupplierInfo.JFStatus = cert3.InFlag
  261. infoInte.SupplierInfo.JFDate = cert3.ApplyTime.Format("2006-01-02")
  262. if infoInte.SupplierInfo.SupplierName != "" {
  263. //var suplliersup []supplier.OilSupplierCertSubInte
  264. where = "where SupplierId=" + strconv.Itoa(infoInte.SupplierInfo.Id) + " and SupplierTypeCode='01'"
  265. svc.Getoilsuppliercertsub(OilSupplierCertSubName, where, &infoInte.WZsub)
  266. where = "where SupplierId=" + strconv.Itoa(infoInte.SupplierInfo.Id) + " and SupplierTypeCode='02'"
  267. svc.Getoilsuppliercertsub(OilSupplierCertSubName, where, &infoInte.JSsub)
  268. where = "where SupplierId=" + strconv.Itoa(infoInte.SupplierInfo.Id) + " and SupplierTypeCode='03'"
  269. svc.Getoilsuppliercertsub(OilSupplierCertSubName, where, &infoInte.JFsub)
  270. }else if item == "" {
  271. where = "where SupplierTypeCode='01'"
  272. svc.Getoilsuppliercertsub(OilSupplierCertSubName, where, &infoInte.WZsub)
  273. where = "where and SupplierTypeCode='02'"
  274. svc.Getoilsuppliercertsub(OilSupplierCertSubName, where, &infoInte.JSsub)
  275. where = "where SupplierTypeCode='03'"
  276. svc.Getoilsuppliercertsub(OilSupplierCertSubName, where, &infoInte.JFsub)
  277. }
  278. infoIntelist = append(infoIntelist, infoInte)
  279. }
  280. var datainfo DataInfo
  281. datainfo.Items = infoIntelist
  282. this.Data["json"] = &datainfo
  283. this.ServeJSON()
  284. }
  285. // @Title 根据分页获取公司信息和准入
  286. // @Description
  287. // @Success 200 {object}
  288. // @router /getinfobypage [post]
  289. func (this *SelectController) GetInfoByPage() {
  290. page := this.GetString("page")
  291. svc := selectbusiness.GetSelectService(utils.DBE)
  292. var infoIntelist []supplier.OilSupplierInte
  293. intpage, _ := strconv.Atoi(page)
  294. for i:= (intpage-1)*50;i < (intpage*50) ;i++{
  295. //var supplierinfo supplier.SupplierInfoInte
  296. var infoInte supplier.OilSupplierInte
  297. stringi := strconv.Itoa(i)
  298. where := " where 1 = 1 limit "+ stringi + ",1"
  299. svc.GetInfoByCompId(where,&infoInte.SupplierInfo)
  300. if infoInte.SupplierInfo.SupplierName != "" {
  301. where = "where SupplierId=" + strconv.Itoa(infoInte.SupplierInfo.Id) + " and SupplierTypeCode='01'"
  302. svc.Getoilsuppliercertsub(OilSupplierCertSubName, where, &infoInte.WZsub)
  303. where = "where SupplierId=" + strconv.Itoa(infoInte.SupplierInfo.Id) + " and SupplierTypeCode='02'"
  304. svc.Getoilsuppliercertsub(OilSupplierCertSubName, where, &infoInte.JSsub)
  305. where = "where SupplierId=" + strconv.Itoa(infoInte.SupplierInfo.Id) + " and SupplierTypeCode='03'"
  306. svc.Getoilsuppliercertsub(OilSupplierCertSubName, where, &infoInte.JFsub)
  307. }
  308. if infoInte.SupplierInfo.Id != 0 {
  309. infoIntelist = append(infoIntelist, infoInte)
  310. }
  311. }
  312. var datainfo DataInfo
  313. datainfo.Items = infoIntelist
  314. this.Data["json"] = &datainfo
  315. this.ServeJSON()
  316. }
  317. // @Title 获取所有
  318. // @Description
  319. // @Success 200 {object}
  320. // @router /up [post]
  321. func (this *SelectController) Up() {
  322. var model UpSearch
  323. var jsonBlob = this.Ctx.Input.RequestBody
  324. json.Unmarshal(jsonBlob, &model)
  325. // //获取分页信息
  326. page := this.GetPageInfoForm()
  327. where := ""
  328. asc := false
  329. Order := this.GetString("Order")
  330. Prop := this.GetString("Prop")
  331. CreateOn := this.GetString("CreateOn")
  332. if Order != "" && Prop != "" {
  333. if Order == "asc" {
  334. asc = true
  335. }
  336. }
  337. if CreateOn != "" {
  338. dates := strings.Split(CreateOn, ",")
  339. if len(dates) == 2 {
  340. minDate := dates[0]
  341. maxDate := dates[1]
  342. where = where + " and CreateOn>='" + minDate + "' and CreateOn<='" + maxDate + "'"
  343. }
  344. }
  345. if model.FullName != "" {
  346. where = where + " and (select FullName from Base_Organize where Id = a.CommitComId) like '%" + model.FullName + "%'"
  347. }
  348. svc := selectbusiness.GetSelectService(utils.DBE)
  349. var list []UpInfoSearch
  350. total := svc.GetUp( OilSupplierCertName , page.CurrentPage, page.Size, Prop, asc, &list, where)
  351. var datainfo DataInfo
  352. datainfo.Items = list
  353. datainfo.CurrentItemCount = total
  354. datainfo.PageIndex = page.CurrentPage
  355. datainfo.ItemsPerPage = page.Size
  356. this.Data["json"] = &datainfo
  357. this.ServeJSON()
  358. }
  359. // @Title 获取所有资质名称
  360. // @Description
  361. // @Success 200 {object}
  362. // @router /getnftoptions [post]
  363. func (this *SelectController) GetNFTOptions() {
  364. svc := selectbusiness.GetSelectService(utils.DBE)
  365. var list []map[string]string
  366. sql := "select distinct(Name) from " + BaseTableHeader + ""
  367. list, _ = svc.DBE.QueryString(sql)
  368. var datainfo DataInfo
  369. datainfo.Items = list
  370. this.Data["json"] = &datainfo
  371. this.ServeJSON()
  372. }
  373. // @Title 流程查询准入
  374. // @Description
  375. // @Success 200 {object}
  376. // @router /getprocessauditlist [get]
  377. func (this *SelectController) GetProcessAuditList() {
  378. //获取分页信息
  379. page := this.GetPageInfoForm()
  380. where := " 1=1 "
  381. orderby := "Id"
  382. asc := false
  383. Order := this.GetString("Order")
  384. Prop := this.GetString("Prop")
  385. if Order != "" && Prop != "" {
  386. orderby = Prop
  387. if Order == "asc" {
  388. asc = true
  389. }
  390. }
  391. svc := supplier.GetOilSupplierService(utils.DBE)
  392. tabinx := this.GetString("tabinx")
  393. supplierTypeCode := this.GetString("SupplierTypeCode")
  394. supplierName := this.GetString("SupplierName")
  395. CreateOn := this.GetString("CreateOn")
  396. //企业用户必须加创建人条件
  397. var registerUser register.OilCorporateInfo
  398. sql := " UserName='" + this.User.Username + "'"
  399. svc.GetEntity(&registerUser,sql)
  400. var processinfolist []Processinfo
  401. if this.User.IsCompanyUser == 1 {
  402. where = where + " and (b.CreateUserId = '" + this.User.Id + "' or a.CommercialNo='"+registerUser.CommercialNo+"')"
  403. }
  404. if supplierTypeCode != "" {
  405. where = where + " and b.SupplierTypeCode like '%" + supplierTypeCode + "%'"
  406. }
  407. if supplierName != "" {
  408. where = where + " and a.SupplierName like '%" + supplierName + "%'"
  409. }
  410. var total int64 = 0
  411. var datainfo DataInfo
  412. if tabinx == "1" || tabinx == "0" {
  413. var list []Processinfo //[]supplier.OilSupplierView
  414. if CreateOn != "" {
  415. dates := strings.Split(CreateOn, ",")
  416. if len(dates) == 2 {
  417. minDate := dates[0]
  418. maxDate := dates[1]
  419. where = where + " and b.CreateOn>='" + minDate + "' and b.CreateOn<='" + maxDate + "'"
  420. }
  421. }
  422. total = total + svc.GetProcessInfoWithOrderBytbl(OilSupplierName, OilSupplierCertName, page.CurrentPage, page.Size, "b.Id", asc, &list, where)
  423. processinfolist = append(processinfolist, list...)
  424. //datainfo.Items = processinfolist
  425. }
  426. if tabinx == "2" || tabinx == "0" {
  427. whereapp := "1=1"
  428. //企业用户必须加创建人条件
  429. if this.User.IsCompanyUser == 1 {
  430. whereapp = whereapp + " and a.CreateUserId = '" + this.User.Id + "'"
  431. }
  432. if supplierTypeCode != "" {
  433. whereapp = whereapp + " and a.AppendType like '%" + supplierTypeCode + "%'"
  434. }
  435. if supplierName != "" {
  436. whereapp = whereapp + " and a.SupplierName like '%" + supplierName + "%'"
  437. }
  438. if CreateOn != "" {
  439. dates := strings.Split(CreateOn, ",")
  440. if len(dates) == 2 {
  441. minDate := dates[0]
  442. maxDate := dates[1]
  443. whereapp = whereapp + " a.and CreateOn>='" + minDate + "' and a.CreateOn<='" + maxDate + "'"
  444. }
  445. }
  446. var list []Processinfo//[]suppliercertappend.OilSupplierCertAppend
  447. svc := suppliercertappend.GetOilSupplierCertAppendService(utils.DBE)
  448. total = total + svc.GetProcessInfoWithOrderBytbl(OilSupplierCertAppendName, page.CurrentPage, page.Size, "a.Id", asc, &list, whereapp)
  449. processinfolist = append(processinfolist, list...)
  450. //datainfo.Items = processinfolist
  451. }
  452. if tabinx == "3" || tabinx == "0" {
  453. whereapp := "1=1"
  454. //企业用户必须加创建人条件
  455. if this.User.IsCompanyUser == 1 {
  456. whereapp = whereapp + " and a.CreateUserId = '" + this.User.Id + "'"
  457. }
  458. if supplierTypeCode != "" {
  459. whereapp = whereapp + " and a.SupplierTypeName like '%" + supplierTypeCode + "%'"
  460. }
  461. if supplierName != "" {
  462. whereapp = whereapp + " and a.SupplierName like '%" + supplierName + "%'"
  463. }
  464. if CreateOn != "" {
  465. dates := strings.Split(CreateOn, ",")
  466. if len(dates) == 2 {
  467. minDate := dates[0]
  468. maxDate := dates[1]
  469. whereapp = whereapp + " and a.CreateOn>='" + minDate + "' and a.CreateOn<='" + maxDate + "'"
  470. }
  471. }
  472. var list []Processinfo//[]annualaudit.OilAnnualAudit
  473. svc := annualaudit.GetOilAnnualAuditService(utils.DBE)
  474. total = total + svc.GetProcessInfoWithOrderBytbl(OilAnnualAuditName, page.CurrentPage, page.Size, orderby, asc, &list, whereapp)
  475. processinfolist = append(processinfolist, list...)
  476. //datainfo.Items = processinfolist
  477. }
  478. if tabinx == "4" || tabinx == "0" {
  479. whereapp := "1=1"
  480. //企业用户必须加创建人条件
  481. if this.User.IsCompanyUser == 1 {
  482. whereapp = whereapp + " and a.CreateUserId = '" + this.User.Id + "'"
  483. }
  484. if supplierName != "" {
  485. whereapp = whereapp + " and a.SupplierName like '%" + supplierName + "%'"
  486. }
  487. if CreateOn != "" {
  488. dates := strings.Split(CreateOn, ",")
  489. if len(dates) == 2 {
  490. minDate := dates[0]
  491. maxDate := dates[1]
  492. whereapp = whereapp + " and a.CreateOn>='" + minDate + "' and a.CreateOn<='" + maxDate + "'"
  493. }
  494. }
  495. var list []Processinfo//[]infochange.OilInfoChange
  496. svc := infochange.GetInfoChangeService(utils.DBE)
  497. total = total + svc.GetProcessInfoWithOrderBytbl(OilInfoChangeName, page.CurrentPage, page.Size, orderby, asc, &list, whereapp)
  498. processinfolist = append(processinfolist, list...)
  499. //datainfo.Items = processinfolist
  500. }
  501. if tabinx == "5" {
  502. whereapp := "1=1"
  503. //企业用户必须加创建人条件
  504. if this.User.IsCompanyUser == 1 {
  505. whereapp = whereapp + " and CreateUserId = '" + this.User.Id + "'"
  506. }
  507. if supplierName != "" {
  508. whereapp = whereapp + " and SupplierName like '%" + supplierName + "%'"
  509. }
  510. if CreateOn != "" {
  511. dates := strings.Split(CreateOn, ",")
  512. if len(dates) == 2 {
  513. minDate := dates[0]
  514. maxDate := dates[1]
  515. whereapp = whereapp + " and CreateOn>='" + minDate + "' and CreateOn<='" + maxDate + "'"
  516. }
  517. }
  518. svc := qualchange.GetQualChangeService(utils.DBE)
  519. var list []qualchange.OilQualChangeMain
  520. total = svc.GetPagingEntitiesWithOrderBytbl("", page.CurrentPage, page.Size, orderby, asc, &list, whereapp)
  521. datainfo.Items = list
  522. }
  523. sort.Slice(processinfolist, func(i, j int) bool {
  524. return processinfolist[i].CreateOn.Unix() > processinfolist[j].CreateOn.Unix()
  525. })
  526. datainfo.Items = processinfolist
  527. datainfo.CurrentItemCount = total
  528. datainfo.PageIndex = page.CurrentPage
  529. datainfo.ItemsPerPage = page.Size
  530. this.Data["json"] = &datainfo
  531. this.ServeJSON()
  532. }
  533. // @Title 准入范围查询
  534. // @Description
  535. // @Success 200 {object}
  536. // @router /zrfwselect [get]
  537. func (this *SelectController) ZrfwSelect() {
  538. //获取分页信息
  539. page := this.GetPageInfoForm()
  540. limitCurrent:=(page.CurrentPage-1)*page.Size
  541. svc := selectbusiness.GetSelectService(utils.DBE)
  542. supplierTypeCode := this.GetString("SupplierTypeCode")
  543. certsub := this.GetString("certsub")
  544. //企业用户必须加创建人条件
  545. var registerUser register.OilCorporateInfo
  546. var company supplier.OilSupplier
  547. sql := " UserName='" + this.User.Username + "'"
  548. svc.GetEntity(&registerUser,sql)
  549. if this.User.IsCompanyUser == 1 {
  550. sql1:= " CreateUserId = '" + this.User.Id + "' or CommercialNo='"+registerUser.CommercialNo+"'"
  551. svc.GetEntity(&company,sql1)
  552. }
  553. where := ""
  554. if certsub != "" {
  555. where = " and (Code like '%" + certsub + "%' or Name like '%" + certsub + "%')"
  556. }
  557. if company.SupplierName!=""{
  558. sql2:="select distinct(Code),Name,SupplierId,CertSubStatus from OilSupplierCertSub where SupplierId='"+strconv.Itoa(company.Id)+"' and SupplierTypeCode='"+supplierTypeCode+"' " + where + " order by CertSubStatus desc,Code asc limit "+strconv.FormatInt(limitCurrent,10)+","+strconv.FormatInt(page.Size,10)+""
  559. result,_:=svc.DBE.QueryString(sql2)
  560. sql3:="select count(distinct(Code)) total from OilSupplierCertSub where SupplierId='"+strconv.Itoa(company.Id)+"' and SupplierTypeCode='"+supplierTypeCode+"'" + where
  561. result1,_:=svc.DBE.QueryString(sql3)
  562. total,_:= strconv.ParseInt(result1[0]["total"], 10, 64)
  563. var datainfo DataInfo
  564. datainfo.Items = result
  565. datainfo.CurrentItemCount = total
  566. datainfo.PageIndex = page.CurrentPage
  567. datainfo.ItemsPerPage = page.Size
  568. this.Data["json"] = &datainfo
  569. this.ServeJSON()
  570. }else{
  571. var datainfo DataInfo
  572. datainfo.Items = ""
  573. datainfo.PageIndex = page.CurrentPage
  574. datainfo.ItemsPerPage = page.Size
  575. this.Data["json"] = &datainfo
  576. this.ServeJSON()
  577. }
  578. }
  579. // @Title 获取所有
  580. // @Description
  581. // @Success 200 {object}
  582. // @router /getallbusinesslist [post]
  583. func (this *SelectController) GetAllBusinesList() {
  584. perject := this.GetString("Perject")
  585. accessCardNo := this.GetString("AccessCardNo")
  586. supplierTypeCode := this.GetString("SupplierTypeCode")
  587. supplierName := this.GetString("SupplierName")
  588. var list []selectbusiness.SelectBusiness
  589. // 准入
  590. if perject == "1" || perject == "" {
  591. where := "1=1 "
  592. if accessCardNo != "" {
  593. where = where + " and b.AccessCardNo='" + accessCardNo + "'"
  594. }
  595. if supplierTypeCode != "" {
  596. where = where + " and b.SupplierTypeCode='" + supplierTypeCode + "'"
  597. }
  598. if supplierName != "" {
  599. where =where + " and a.SupplierName like '%" + supplierName + "%'"
  600. }
  601. var zrlist []supplier.OilSupplierView
  602. zrsvc := supplier.GetOilSupplierService(utils.DBE)
  603. if this.User.IsCompanyUser == 1 {
  604. var registerUser register.OilCorporateInfo
  605. sql := " UserName='" + this.User.Username + "'"
  606. zrsvc.GetEntity(&registerUser,sql)
  607. where = where + " and (b.CreateUserId = '" + this.User.Id + "' or a.CommercialNo='" + registerUser.CommercialNo + "')"
  608. }
  609. zrwhere := where + " and b.Status='" + suppliercert.STORE_STATUS + "'"
  610. zrsvc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, 1, 100, "b.Id", false , &zrlist, zrwhere)
  611. for _, item := range zrlist {
  612. var sele selectbusiness.SelectBusiness
  613. sele.SupplierName = item.SupplierName
  614. sele.CreateOn = item.CreateOn
  615. sele.AccessCardNo = item.AccessCardNo
  616. sele.TypeCode = item.SupplierTypeCode
  617. sele.TypeName = item.SupplierTypeName
  618. sele.Preject = "1"
  619. list = append(list, sele)
  620. }
  621. }
  622. // 增项
  623. if perject == "2" || perject == "" {
  624. where := "1=1 "
  625. if accessCardNo != "" {
  626. where = where + " and b.AccessCardNo='" + accessCardNo + "'"
  627. }
  628. if supplierTypeCode != "" {
  629. where = where + " and b.AppendType='" + supplierTypeCode + "'"
  630. }
  631. if supplierName != "" {
  632. where =where + " and a.SupplierName like '%" + supplierName + "%'"
  633. }
  634. var zxlist []suppliercertappend.OilSupplierCertAppend
  635. zxsvc := suppliercertappend.GetOilSupplierCertAppendService(utils.DBE)
  636. if this.User.IsCompanyUser == 1 {
  637. var registerUser register.OilCorporateInfo
  638. sql := " UserName='" + this.User.Username + "'"
  639. zxsvc.GetEntity(&registerUser,sql)
  640. where = where + " and (b.CreateUserId = '" + this.User.Id + "' or a.CommercialNo='" + registerUser.CommercialNo + "')"
  641. }
  642. zxwhere := where + " and b.Status='" + suppliercert.STORE_STATUS + "'"
  643. zxsvc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertAppendName, 1, 100, "b.Id", false, &zxlist, zxwhere)
  644. for _, item := range zxlist {
  645. var sele selectbusiness.SelectBusiness
  646. sele.SupplierName = item.SupplierName
  647. sele.CreateOn = item.CreateOn
  648. sele.AccessCardNo = item.AccessCardNo
  649. sele.TypeCode = item.AppendType
  650. sele.TypeName = ""
  651. sele.Preject = "2"
  652. list = append(list, sele)
  653. }
  654. }
  655. // 年审
  656. if perject == "3" || perject == "" {
  657. where := "1=1 "
  658. if accessCardNo != "" {
  659. where = where + " and b.AccessCardNo='" + accessCardNo + "'"
  660. }
  661. if supplierTypeCode != "" {
  662. where = where + " and b.SupplierTypeName='" + supplierTypeCode + "'"
  663. }
  664. if supplierName != "" {
  665. where =where + " and a.SupplierName like '%" + supplierName + "%'"
  666. }
  667. var nslist []annualaudit.OilAnnualAudit
  668. nssvc := annualaudit.GetOilAnnualAuditService(utils.DBE)
  669. if this.User.IsCompanyUser == 1 {
  670. var registerUser register.OilCorporateInfo
  671. sql := " UserName='" + this.User.Username + "'"
  672. nssvc.GetEntity(&registerUser,sql)
  673. where = where + " and (b.CreateUserId = '" + this.User.Id + "' or a.CommercialNo='" + registerUser.CommercialNo + "')"
  674. }
  675. zswhere := where + " and b.Status='" + suppliercert.DRAFT_STATUS + "'"
  676. nssvc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilAnnualAuditName,1, 100, "b.Id", false, &nslist, zswhere)
  677. for _, item := range nslist {
  678. var sele selectbusiness.SelectBusiness
  679. sele.SupplierName = item.SupplierName
  680. sele.CreateOn = item.CreateOn
  681. sele.AccessCardNo = item.AccessCardNo
  682. sele.TypeCode = item.SupplierTypeName
  683. sele.TypeName = ""
  684. sele.Preject = "3"
  685. list = append(list, sele)
  686. }
  687. }
  688. // 变更申请
  689. if perject == "4" || perject == "" {
  690. where := "1=1 "
  691. if accessCardNo != "" {
  692. where = where + " and b.AccessCardNo='" + accessCardNo + "'"
  693. }
  694. if supplierTypeCode != "" {
  695. where = where + " and b.SupplierTypeCode='" + supplierTypeCode + "'"
  696. }
  697. if supplierName != "" {
  698. where =where + " and a.SupplierName like '%" + supplierName + "%'"
  699. }
  700. var bglist []infochange.SuppModelInfo
  701. bgsvc := infochange.GetInfoChangeService(utils.DBE)
  702. if this.User.IsCompanyUser == 1 {
  703. var registerUser register.OilCorporateInfo
  704. sql := " UserName='" + this.User.Username + "'"
  705. bgsvc.GetEntity(&registerUser,sql)
  706. where = where + " and (b.CreateUserId = '" + this.User.Id + "' or a.CommercialNo='" + registerUser.CommercialNo + "')"
  707. }
  708. bgwhere := where + " and b.Status='" + suppliercert.DRAFT_STATUS + "'"
  709. bgsvc.GetSuppPagingEntitiesWithOrderBytbl(OilSupplierName, OilInfoChangeName, 1, 100, "b.Id", false, &bglist, bgwhere)
  710. for _, item := range bglist {
  711. var sele selectbusiness.SelectBusiness
  712. sele.SupplierName = item.SupplierName
  713. sele.CreateOn = item.CreateOn
  714. sele.AccessCardNo = ""
  715. sele.TypeCode = item.SupplierTypeCode
  716. sele.TypeName = item.SupplierTypeName
  717. sele.Preject = "4"
  718. list = append(list, sele)
  719. }
  720. }
  721. var datainfo DataInfo
  722. datainfo.Items = list
  723. this.Data["json"] = &datainfo
  724. this.ServeJSON()
  725. }
  726. // @Title 文件上传
  727. // @Description get user by tokenaddsubfile
  728. // @Success 200 {object} models.Userblood
  729. // @router /filelist [get]
  730. func (this *SelectController) FileList() {
  731. page := this.GetPageInfoForm()
  732. var list []supplierfile.OilSupplierFile
  733. svc := supplierfile.GetSupplierfileService(utils.DBE)
  734. where := " 1=1"
  735. orderby := "Id"
  736. asc := true
  737. Order := this.GetString("Order")
  738. Prop := this.GetString("Prop")
  739. subfilename := this.GetString("subfileName")
  740. supplierId := this.GetString("SupplierId")
  741. createOn := this.GetString("CreateOn")
  742. if Order != "" && Prop != "" {
  743. orderby = Prop
  744. if Order == "asc" {
  745. asc = true
  746. }
  747. }
  748. //企业用户必须加创建人条件
  749. var registerUser register.OilCorporateInfo
  750. var company supplier.OilSupplier
  751. sql := " UserName='" + this.User.Username + "'"
  752. svc.GetEntity(&registerUser,sql)
  753. sql1:= " CreateUserId = '" + this.User.Id + "' or CommercialNo='"+registerUser.CommercialNo+"'"
  754. svc.GetEntity(&company,sql1)
  755. if supplierId != "0" {
  756. where = where + " and SupplierId=" + supplierId
  757. } else {
  758. where = where + " and SupplierId=" + strconv.Itoa(company.Id)
  759. }
  760. if subfilename != "" {
  761. where = where + " and NeedFileType like '%" + subfilename + "%'"
  762. }
  763. if createOn != "" {
  764. dates := strings.Split(createOn, ",")
  765. if len(dates) == 2 {
  766. minDate := dates[0]
  767. maxDate := dates[1]
  768. where = where + " and EffectDate>='" + minDate + "' and EffectDate<='" + maxDate + "'"
  769. }
  770. }
  771. total := svc.GetPagingEntitiesWithoutAccCode(page.CurrentPage, page.Size, orderby, asc, &list, where)
  772. var datainfo DataInfo
  773. datainfo.Items = list
  774. datainfo.CurrentItemCount = total
  775. this.Data["json"] = &datainfo
  776. this.ServeJSON()
  777. }
  778. // @Title 获取列表
  779. // @Description
  780. // @Success 200 {object}
  781. // @router /totallist [get]
  782. func (this *SelectController) GetTotalList() {
  783. //获取分页信息
  784. page := this.GetPageInfoForm()
  785. where := "0"
  786. orderby := "Id"
  787. asc := false
  788. Order := this.GetString("Order")
  789. Prop := this.GetString("Prop")
  790. if Order != "" && Prop != "" {
  791. orderby = Prop
  792. if Order == "asc" {
  793. asc = true
  794. }
  795. }
  796. Years := this.GetString("Years")
  797. if Years != "" {
  798. where = Years
  799. }
  800. //CreateOn := this.GetString("CreateOn")
  801. //
  802. //if CreateOn != "" {
  803. // dates := strings.Split(CreateOn, ",")
  804. // if len(dates) == 2 {
  805. // minDate := dates[0]
  806. // maxDate := dates[1]
  807. // where = where + " and ValidityTo>='" + minDate + "' and ValidityTo<='" + maxDate + "'"
  808. // }
  809. //}
  810. svc := selectbusiness.GetSelectService(utils.DBE)
  811. var list []selectbusiness.TotalCount
  812. svc.GetTotalInMonth(orderby, asc, &list, where)
  813. var datainfo DataInfo
  814. datainfo.Items = list
  815. datainfo.PageIndex = page.CurrentPage
  816. datainfo.ItemsPerPage = page.Size
  817. this.Data["json"] = &datainfo
  818. this.ServeJSON()
  819. }
  820. // @Title 导出资质图片
  821. // @Description
  822. // @Success 200 {object}
  823. // @router /getallbusinesslicense [get]
  824. func (this *SelectController) GetAllBusinessLicense() {
  825. needFileType := this.GetString("NeedFileType")
  826. svc := supplier.GetOilSupplierService(utils.DBE)
  827. var supplierList []supplier.OilSupplier
  828. where := "1=1"
  829. svc.GetEntities(&supplierList, where)
  830. _dir := utils.Cfg.MustValue("file", "tmplateDir") + needFileType
  831. downFileUrl := "http://" + utils.Cfg.MustValue("server", "localIP")
  832. for _,item := range supplierList {
  833. var supplierFile supplierfile.OilSupplierFile
  834. where := "SupplierId=" + strconv.Itoa(item.Id) + " and NeedFileType='" + needFileType + "'"
  835. has := svc.GetEntity(&supplierFile, where)
  836. if has {
  837. fileArr := strings.Split(supplierFile.FileName, ".")
  838. fileUrl := strings.Split(supplierFile.FileUrl, "|")
  839. if len(fileUrl) == 2 && len(fileArr) == 2 {
  840. utils.DownloadFile( downFileUrl + fileUrl[0], item.SupplierName + "." + fileArr[1] , _dir)
  841. }
  842. }
  843. }
  844. //Zip(_dir, utils.Cfg.MustValue("file", "tmplateDir") + "license.zip")
  845. f1,_ := os.Open(_dir)
  846. var files = []*os.File{f1}
  847. destZipName := time.Now().Format("2006-01-02")
  848. destZip := utils.Cfg.MustValue("file", "tmplateDir") + destZipName + ".zip"
  849. err := Compress(files, destZip)
  850. retDocUrl := ""
  851. if err == nil {
  852. var sw *Seaweed
  853. var filer []string
  854. if _filer := os.Getenv("GOSWFS_FILER_URL"); _filer != "" {
  855. filer = []string{_filer}
  856. }
  857. sw = NewSeaweed("http", utils.Cfg.MustValue("file", "upFileHost"), filer, 2*1024*1024, 5*time.Minute)
  858. _, _, fID, _ := sw.UploadFile(destZip, "", "")
  859. retDocUrl = utils.Cfg.MustValue("file", "downFileHost") + "/" + fID
  860. }
  861. os.Remove(destZip)
  862. os.RemoveAll(_dir)
  863. var errinfo ErrorDataInfo
  864. errinfo.Code = 0
  865. errinfo.Item = retDocUrl
  866. this.Data["json"] = &errinfo
  867. this.ServeJSON()
  868. }
  869. // @Title 导出企业资质图片
  870. // @Description
  871. // @Success 200 {object}
  872. // @router /getallbusinesslicensebyid [get]
  873. func (this *SelectController) GetBusinessLicenseById() {
  874. SupplierId := this.GetString("SupplierId")
  875. SupplierName := this.GetString("SupplierName")
  876. SupplierTypeCode := this.GetString("SupTypeCode")
  877. svc := supplier.GetOilSupplierService(utils.DBE)
  878. if SupplierId == "0" && this.User.IsCompanyUser == 1 {
  879. var registerUser register.OilCorporateInfo
  880. var company supplier.OilSupplier
  881. sql := " UserName='" + this.User.Username + "'"
  882. svc.GetEntity(&registerUser,sql)
  883. sql1:= " CreateUserId = '" + this.User.Id + "' or CommercialNo='"+registerUser.CommercialNo+"'"
  884. svc.GetEntity(&company,sql1)
  885. SupplierId = strconv.Itoa(company.Id)
  886. SupplierName = company.SupplierName
  887. }
  888. _dir := utils.Cfg.MustValue("file", "tmplateDir") + SupplierName
  889. downFileUrl := "http://" + utils.Cfg.MustValue("server", "localIP")
  890. var supplierFile []supplierfile.OilSupplierFile
  891. where := "SupplierId=" + SupplierId
  892. svc.GetEntities(&supplierFile, where)
  893. var errinfo ErrorDataInfo
  894. if len(supplierFile) == 0 {
  895. errinfo.Code = -1
  896. errinfo.Message = "该公司没有可导出的资质!"
  897. this.Data["json"] = &errinfo
  898. this.ServeJSON()
  899. return
  900. }
  901. for _,item := range supplierFile {
  902. fileArr := strings.Split(item.FileName, ".")
  903. fileUrl := strings.Split(item.FileUrl, "|")
  904. if len(fileUrl) == 2 && len(fileArr) == 2 {
  905. utils.DownloadFile( downFileUrl + fileUrl[0], item.NeedFileType + "." + fileArr[1] , _dir)
  906. }
  907. }
  908. //Zip(_dir, utils.Cfg.MustValue("file", "tmplateDir") + "license.zip")
  909. f1,_ := os.Open(_dir)
  910. var files = []*os.File{f1}
  911. if SupplierTypeCode == "01" {
  912. SupplierTypeCode = "WZ"
  913. } else if SupplierTypeCode == "02" {
  914. SupplierTypeCode = "JS"
  915. } else if SupplierTypeCode == "03" {
  916. SupplierTypeCode = "JF"
  917. } else {
  918. SupplierTypeCode = ""
  919. }
  920. destZipName := SupplierName + time.Now().Format("2006-01-02") + SupplierTypeCode
  921. destZip := utils.Cfg.MustValue("file", "tmplateDir") + destZipName + ".zip"
  922. err := Compress(files, destZip)
  923. fmt.Println("err28==", err)
  924. retDocUrl := ""
  925. if err == nil {
  926. var sw *Seaweed
  927. var filer []string
  928. if _filer := os.Getenv("GOSWFS_FILER_URL"); _filer != "" {
  929. filer = []string{_filer}
  930. }
  931. sw = NewSeaweed("http", utils.Cfg.MustValue("file", "upFileHost"), filer, 2*1024*1024, 5*time.Minute)
  932. _, _, fID, _ := sw.UploadFile(destZip, "", "")
  933. retDocUrl = utils.Cfg.MustValue("file", "downFileHost") + "/" + fID
  934. }
  935. fmt.Println("==retDocWatermarkUrlZZXZ==", retDocUrl)
  936. err = os.RemoveAll(destZip)
  937. fmt.Println(err)
  938. err = os.RemoveAll(_dir)
  939. fmt.Println(err)
  940. errinfo.Code = 0
  941. errinfo.Item = retDocUrl
  942. this.Data["json"] = &errinfo
  943. this.ServeJSON()
  944. }
  945. func Compress(files []*os.File, dest string) error {
  946. d, _ := os.Create(dest)
  947. defer d.Close()
  948. w := zip.NewWriter(d)
  949. defer w.Close()
  950. for _, file := range files {
  951. err := compress(file, "", w)
  952. if err != nil {
  953. return err
  954. }
  955. }
  956. return nil
  957. }
  958. func compress(file *os.File, prefix string, zw *zip.Writer) error {
  959. info, err := file.Stat()
  960. if err != nil {
  961. return err
  962. }
  963. if info.IsDir() {
  964. prefix = prefix + "/" + info.Name()
  965. fileInfos, err := file.Readdir(-1)
  966. if err != nil {
  967. return err
  968. }
  969. for _, fi := range fileInfos {
  970. f, err := os.Open(file.Name() + "/" + fi.Name())
  971. if err != nil {
  972. return err
  973. }
  974. err = compress(f, prefix, zw)
  975. if err != nil {
  976. return err
  977. }
  978. }
  979. } else {
  980. header, err := zip.FileInfoHeader(info)
  981. header.Name = prefix + "/" + header.Name
  982. if err != nil {
  983. return err
  984. }
  985. writer, err := zw.CreateHeader(header)
  986. if err != nil {
  987. return err
  988. }
  989. _, err = io.Copy(writer, file)
  990. file.Close()
  991. if err != nil {
  992. return err
  993. }
  994. }
  995. return nil
  996. }
  997. // @Title 获取资质列表
  998. // @Description get user by tokenaddsubfile
  999. // @Success 200 {object} models.Userblood
  1000. // @router /gettableheaderlist [get]
  1001. func (this *SelectController) GetTableHeaderList() {
  1002. typeCode := this.GetString("Type")
  1003. var tableHeader []tableheader.BaseTableheader
  1004. svc := tableheader.GetTableHeaderService(utils.DBE)
  1005. where := "CategoryCode='" + typeCode + "'"
  1006. svc.GetEntitysByWhere(BaseTableHeader, where, &tableHeader)
  1007. var errinfo ErrorDataInfo
  1008. errinfo.Code = 0
  1009. errinfo.Item = tableHeader
  1010. this.Data["json"] = &errinfo
  1011. this.ServeJSON()
  1012. }