supplier.go 68 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312
  1. package oilsupplier
  2. import (
  3. "encoding/json"
  4. "fmt"
  5. "strconv"
  6. "strings"
  7. "time"
  8. "dashoo.cn/backend/api/business/auditsetting"
  9. "dashoo.cn/backend/api/business/organize"
  10. "dashoo.cn/business2/permission"
  11. "dashoo.cn/backend/api/business/workflow"
  12. "dashoo.cn/business2/areajson"
  13. "dashoo.cn/business2/items"
  14. "dashoo.cn/backend/api/business/baseUser"
  15. "dashoo.cn/backend/api/business/oilsupplier/supplier"
  16. "dashoo.cn/backend/api/business/oilsupplier/suppliercert"
  17. . "dashoo.cn/backend/api/controllers"
  18. "dashoo.cn/business2/userRole"
  19. "dashoo.cn/utils"
  20. "github.com/go-xorm/xorm"
  21. )
  22. type OilSupplierController struct {
  23. BaseController
  24. }
  25. // @Title 获取列表
  26. // @Description get user by token
  27. // @Success 200 {object} []supplier.OilSupplier
  28. // @router /list [get]
  29. func (this *OilSupplierController) GetEntityList() {
  30. //获取分页信息
  31. page := this.GetPageInfoForm()
  32. where := " 1=1 "
  33. orderby := "Id"
  34. asc := false
  35. Order := this.GetString("Order")
  36. Prop := this.GetString("Prop")
  37. if Order != "" && Prop != "" {
  38. orderby = Prop
  39. if Order == "asc" {
  40. asc = true
  41. }
  42. }
  43. Id := this.GetString("Id")
  44. SupplierName := this.GetString("SupplierName")
  45. OilCertificateNo := this.GetString("OilCertificateNo")
  46. Grade := this.GetString("Grade")
  47. MgrUnit := this.GetString("MgrUnit")
  48. OperType := this.GetString("OperType")
  49. Country := this.GetString("Country")
  50. MaunAgent := this.GetString("MaunAgent")
  51. ConstructTeam := this.GetString("ConstructTeam")
  52. CommercialNo := this.GetString("CommercialNo")
  53. OrganCode := this.GetString("OrganCode")
  54. CountryTaxNo := this.GetString("CountryTaxNo")
  55. LocalTaxNo := this.GetString("LocalTaxNo")
  56. Address := this.GetString("Address")
  57. Province := this.GetString("Province")
  58. City := this.GetString("City")
  59. Street := this.GetString("Street")
  60. HouseNo := this.GetString("HouseNo")
  61. ZipCode := this.GetString("ZipCode")
  62. QualitySystemCert := this.GetString("QualitySystemCert")
  63. ProductQualityCert := this.GetString("ProductQualityCert")
  64. MaunLicense := this.GetString("MaunLicense")
  65. QualifCert := this.GetString("QualifCert")
  66. QualifCertLevel := this.GetString("QualifCertLevel")
  67. SafetyLicense := this.GetString("SafetyLicense")
  68. TechServiceLic := this.GetString("TechServiceLic")
  69. TJInNotify := this.GetString("TJInNotify")
  70. SpecIndustryCert := this.GetString("SpecIndustryCert")
  71. LegalPerson := this.GetString("LegalPerson")
  72. CategoryCode := this.GetString("CategoryCode")
  73. CategoryName := this.GetString("CategoryName")
  74. RegCapital := this.GetString("RegCapital")
  75. Currency := this.GetString("Currency")
  76. ContactName := this.GetString("ContactName")
  77. CompanyType := this.GetString("CompanyType")
  78. SetupTime := this.GetString("SetupTime")
  79. DepositBank := this.GetString("DepositBank")
  80. BankAccount := this.GetString("BankAccount")
  81. EMail := this.GetString("EMail")
  82. BankCreditRating := this.GetString("BankCreditRating")
  83. Mobile := this.GetString("Mobile")
  84. Telphone := this.GetString("Telphone")
  85. Fax := this.GetString("Fax")
  86. CompanyTel := this.GetString("CompanyTel")
  87. QQ := this.GetString("QQ")
  88. CompanyUrl := this.GetString("CompanyUrl")
  89. SpecSupplier := this.GetString("SpecSupplier")
  90. SpecTypeCode := this.GetString("SpecTypeCode")
  91. SpecTypeName := this.GetString("SpecTypeName")
  92. Remark := this.GetString("Remark")
  93. IsDelete := this.GetString("IsDelete")
  94. CreateOn := this.GetString("CreateOn")
  95. CreateUserId := this.GetString("CreateUserId")
  96. CreateBy := this.GetString("CreateBy")
  97. ModifiedOn := this.GetString("ModifiedOn")
  98. ModifiedUserId := this.GetString("ModifiedUserId")
  99. ModifiedBy := this.GetString("ModifiedBy")
  100. if Id != "" {
  101. where = where + " and Id like '%" + Id + "%'"
  102. }
  103. if SupplierName != "" {
  104. where = where + " and SupplierName like '%" + SupplierName + "%'"
  105. }
  106. if OilCertificateNo != "" {
  107. where = where + " and OilCertificateNo like '%" + OilCertificateNo + "%'"
  108. }
  109. if Grade != "" {
  110. where = where + " and Grade like '%" + Grade + "%'"
  111. }
  112. if MgrUnit != "" {
  113. where = where + " and MgrUnit like '%" + MgrUnit + "%'"
  114. }
  115. if OperType != "" {
  116. where = where + " and OperType like '%" + OperType + "%'"
  117. }
  118. if Country != "" {
  119. where = where + " and Country like '%" + Country + "%'"
  120. }
  121. if MaunAgent != "" {
  122. where = where + " and MaunAgent like '%" + MaunAgent + "%'"
  123. }
  124. if ConstructTeam != "" {
  125. where = where + " and ConstructTeam like '%" + ConstructTeam + "%'"
  126. }
  127. if CommercialNo != "" {
  128. where = where + " and CommercialNo like '%" + CommercialNo + "%'"
  129. }
  130. if OrganCode != "" {
  131. where = where + " and OrganCode like '%" + OrganCode + "%'"
  132. }
  133. if CountryTaxNo != "" {
  134. where = where + " and CountryTaxNo like '%" + CountryTaxNo + "%'"
  135. }
  136. if LocalTaxNo != "" {
  137. where = where + " and LocalTaxNo like '%" + LocalTaxNo + "%'"
  138. }
  139. if Address != "" {
  140. where = where + " and Address like '%" + Address + "%'"
  141. }
  142. if Province != "" {
  143. where = where + " and Province like '%" + Province + "%'"
  144. }
  145. if City != "" {
  146. where = where + " and City like '%" + City + "%'"
  147. }
  148. if Street != "" {
  149. where = where + " and Street like '%" + Street + "%'"
  150. }
  151. if HouseNo != "" {
  152. where = where + " and HouseNo like '%" + HouseNo + "%'"
  153. }
  154. if ZipCode != "" {
  155. where = where + " and ZipCode like '%" + ZipCode + "%'"
  156. }
  157. if QualitySystemCert != "" {
  158. where = where + " and QualitySystemCert like '%" + QualitySystemCert + "%'"
  159. }
  160. if ProductQualityCert != "" {
  161. where = where + " and ProductQualityCert like '%" + ProductQualityCert + "%'"
  162. }
  163. if MaunLicense != "" {
  164. where = where + " and MaunLicense like '%" + MaunLicense + "%'"
  165. }
  166. if QualifCert != "" {
  167. where = where + " and QualifCert like '%" + QualifCert + "%'"
  168. }
  169. if QualifCertLevel != "" {
  170. where = where + " and QualifCertLevel like '%" + QualifCertLevel + "%'"
  171. }
  172. if SafetyLicense != "" {
  173. where = where + " and SafetyLicense like '%" + SafetyLicense + "%'"
  174. }
  175. if TechServiceLic != "" {
  176. where = where + " and TechServiceLic like '%" + TechServiceLic + "%'"
  177. }
  178. if TJInNotify != "" {
  179. where = where + " and TJInNotify like '%" + TJInNotify + "%'"
  180. }
  181. if SpecIndustryCert != "" {
  182. where = where + " and SpecIndustryCert like '%" + SpecIndustryCert + "%'"
  183. }
  184. if LegalPerson != "" {
  185. where = where + " and LegalPerson like '%" + LegalPerson + "%'"
  186. }
  187. if CategoryCode != "" {
  188. where = where + " and CategoryCode like '%" + CategoryCode + "%'"
  189. }
  190. if CategoryName != "" {
  191. where = where + " and CategoryName like '%" + CategoryName + "%'"
  192. }
  193. if RegCapital != "" {
  194. where = where + " and RegCapital like '%" + RegCapital + "%'"
  195. }
  196. if Currency != "" {
  197. where = where + " and Currency like '%" + Currency + "%'"
  198. }
  199. if ContactName != "" {
  200. where = where + " and ContactName like '%" + ContactName + "%'"
  201. }
  202. if CompanyType != "" {
  203. where = where + " and CompanyType like '%" + CompanyType + "%'"
  204. }
  205. if SetupTime != "" {
  206. where = where + " and SetupTime like '%" + SetupTime + "%'"
  207. }
  208. if DepositBank != "" {
  209. where = where + " and DepositBank like '%" + DepositBank + "%'"
  210. }
  211. if BankAccount != "" {
  212. where = where + " and BankAccount like '%" + BankAccount + "%'"
  213. }
  214. if EMail != "" {
  215. where = where + " and EMail like '%" + EMail + "%'"
  216. }
  217. if BankCreditRating != "" {
  218. where = where + " and BankCreditRating like '%" + BankCreditRating + "%'"
  219. }
  220. if Mobile != "" {
  221. where = where + " and Mobile like '%" + Mobile + "%'"
  222. }
  223. if Telphone != "" {
  224. where = where + " and Telphone like '%" + Telphone + "%'"
  225. }
  226. if Fax != "" {
  227. where = where + " and Fax like '%" + Fax + "%'"
  228. }
  229. if CompanyTel != "" {
  230. where = where + " and CompanyTel like '%" + CompanyTel + "%'"
  231. }
  232. if QQ != "" {
  233. where = where + " and QQ like '%" + QQ + "%'"
  234. }
  235. if CompanyUrl != "" {
  236. where = where + " and CompanyUrl like '%" + CompanyUrl + "%'"
  237. }
  238. if SpecSupplier != "" {
  239. where = where + " and SpecSupplier like '%" + SpecSupplier + "%'"
  240. }
  241. if SpecTypeCode != "" {
  242. where = where + " and SpecTypeCode like '%" + SpecTypeCode + "%'"
  243. }
  244. if SpecTypeName != "" {
  245. where = where + " and SpecTypeName like '%" + SpecTypeName + "%'"
  246. }
  247. if Remark != "" {
  248. where = where + " and Remark like '%" + Remark + "%'"
  249. }
  250. if IsDelete != "" {
  251. where = where + " and IsDelete like '%" + IsDelete + "%'"
  252. }
  253. if CreateUserId != "" {
  254. where = where + " and CreateUserId like '%" + CreateUserId + "%'"
  255. }
  256. if CreateBy != "" {
  257. where = where + " and CreateBy like '%" + CreateBy + "%'"
  258. }
  259. if ModifiedOn != "" {
  260. where = where + " and ModifiedOn like '%" + ModifiedOn + "%'"
  261. }
  262. if ModifiedUserId != "" {
  263. where = where + " and ModifiedUserId like '%" + ModifiedUserId + "%'"
  264. }
  265. if ModifiedBy != "" {
  266. where = where + " and ModifiedBy like '%" + ModifiedBy + "%'"
  267. }
  268. if CreateOn != "" {
  269. dates := strings.Split(CreateOn, ",")
  270. if len(dates) == 2 {
  271. minDate := dates[0]
  272. maxDate := dates[1]
  273. where = where + " and CreateOn>='" + minDate + "' and CreateOn<='" + maxDate + "'"
  274. }
  275. }
  276. //企业用户必须加创建人条件
  277. if this.User.IsCompanyUser == 1 {
  278. where = where + " and CreateUserId = '" + this.User.Id + "'"
  279. } else {
  280. //超级管理员和有查看所有数据权限的用户不加条件
  281. svcPerm := permission.GetPermissionService(utils.DBE)
  282. isauth := svcPerm.IsAuthorized(this.User.Id, "oil_supplier.marketAccess.AllRecord")
  283. if !svcPerm.IsAdmin(this.User.Id) && !isauth {
  284. where = where + " and CreateUserId = '" + this.User.Id + "'"
  285. }
  286. }
  287. svc := supplier.GetOilSupplierService(utils.DBE)
  288. var list []supplier.OilSupplier
  289. total := svc.GetPagingEntitiesWithOrderBytbl("", page.CurrentPage, page.Size, orderby, asc, &list, where)
  290. var datainfo DataInfo
  291. datainfo.Items = list
  292. datainfo.CurrentItemCount = total
  293. datainfo.PageIndex = page.CurrentPage
  294. datainfo.ItemsPerPage = page.Size
  295. this.Data["json"] = &datainfo
  296. this.ServeJSON()
  297. }
  298. // @Title 获取列表
  299. // @Description get user by token
  300. // @Success 200 {object} []supplier.OilSupplier
  301. // @router /certlist [get]
  302. func (this *OilSupplierController) GetJoinCertEntityList() {
  303. //获取分页信息
  304. page := this.GetPageInfoForm()
  305. where := " 1=1 "
  306. orderby := "Id"
  307. asc := false
  308. Order := this.GetString("Order")
  309. Prop := this.GetString("Prop")
  310. if Order != "" && Prop != "" {
  311. orderby = Prop
  312. if Order == "asc" {
  313. asc = true
  314. }
  315. }
  316. Id := this.GetString("Id")
  317. SupplierName := this.GetString("SupplierName")
  318. OilCertificateNo := this.GetString("OilCertificateNo")
  319. Grade := this.GetString("Grade")
  320. MgrUnit := this.GetString("MgrUnit")
  321. OperType := this.GetString("OperType")
  322. Country := this.GetString("Country")
  323. MaunAgent := this.GetString("MaunAgent")
  324. ConstructTeam := this.GetString("ConstructTeam")
  325. CommercialNo := this.GetString("CommercialNo")
  326. OrganCode := this.GetString("OrganCode")
  327. CountryTaxNo := this.GetString("CountryTaxNo")
  328. LocalTaxNo := this.GetString("LocalTaxNo")
  329. Address := this.GetString("Address")
  330. Province := this.GetString("Province")
  331. City := this.GetString("City")
  332. Street := this.GetString("Street")
  333. HouseNo := this.GetString("HouseNo")
  334. ZipCode := this.GetString("ZipCode")
  335. QualitySystemCert := this.GetString("QualitySystemCert")
  336. ProductQualityCert := this.GetString("ProductQualityCert")
  337. MaunLicense := this.GetString("MaunLicense")
  338. QualifCert := this.GetString("QualifCert")
  339. QualifCertLevel := this.GetString("QualifCertLevel")
  340. SafetyLicense := this.GetString("SafetyLicense")
  341. TechServiceLic := this.GetString("TechServiceLic")
  342. TJInNotify := this.GetString("TJInNotify")
  343. SpecIndustryCert := this.GetString("SpecIndustryCert")
  344. LegalPerson := this.GetString("LegalPerson")
  345. CategoryCode := this.GetString("CategoryCode")
  346. CategoryName := this.GetString("CategoryName")
  347. RegCapital := this.GetString("RegCapital")
  348. Currency := this.GetString("Currency")
  349. ContactName := this.GetString("ContactName")
  350. CompanyType := this.GetString("CompanyType")
  351. SetupTime := this.GetString("SetupTime")
  352. DepositBank := this.GetString("DepositBank")
  353. BankAccount := this.GetString("BankAccount")
  354. EMail := this.GetString("EMail")
  355. BankCreditRating := this.GetString("BankCreditRating")
  356. Mobile := this.GetString("Mobile")
  357. Telphone := this.GetString("Telphone")
  358. Fax := this.GetString("Fax")
  359. CompanyTel := this.GetString("CompanyTel")
  360. QQ := this.GetString("QQ")
  361. CompanyUrl := this.GetString("CompanyUrl")
  362. SpecSupplier := this.GetString("SpecSupplier")
  363. SpecTypeCode := this.GetString("SpecTypeCode")
  364. SpecTypeName := this.GetString("SpecTypeName")
  365. Remark := this.GetString("Remark")
  366. CreateOn := this.GetString("CreateOn")
  367. SupplierTypeCode := this.GetString("SupplierTypeCode")
  368. status := this.GetString("Status")
  369. if status != "" {
  370. where = where + " and b.Status='" + status + "'"
  371. }
  372. if Id != "" {
  373. where = where + " and a.Id like '%" + Id + "%'"
  374. }
  375. if SupplierName != "" {
  376. where = where + " and a.SupplierName like '%" + SupplierName + "%'"
  377. }
  378. if OilCertificateNo != "" {
  379. where = where + " and a.OilCertificateNo like '%" + OilCertificateNo + "%'"
  380. }
  381. if Grade != "" {
  382. where = where + " and a.Grade like '%" + Grade + "%'"
  383. }
  384. if MgrUnit != "" {
  385. where = where + " and a.MgrUnit like '%" + MgrUnit + "%'"
  386. }
  387. if OperType != "" {
  388. where = where + " and a.OperType like '%" + OperType + "%'"
  389. }
  390. if Country != "" {
  391. where = where + " and a.Country like '%" + Country + "%'"
  392. }
  393. if MaunAgent != "" {
  394. where = where + " and a.MaunAgent like '%" + MaunAgent + "%'"
  395. }
  396. if ConstructTeam != "" {
  397. where = where + " and a.ConstructTeam like '%" + ConstructTeam + "%'"
  398. }
  399. if CommercialNo != "" {
  400. where = where + " and a.CommercialNo like '%" + CommercialNo + "%'"
  401. }
  402. if OrganCode != "" {
  403. where = where + " and a.OrganCode like '%" + OrganCode + "%'"
  404. }
  405. if CountryTaxNo != "" {
  406. where = where + " and a.CountryTaxNo like '%" + CountryTaxNo + "%'"
  407. }
  408. if LocalTaxNo != "" {
  409. where = where + " and a.LocalTaxNo like '%" + LocalTaxNo + "%'"
  410. }
  411. if Address != "" {
  412. where = where + " and a.Address like '%" + Address + "%'"
  413. }
  414. if Province != "" {
  415. where = where + " and a.Province like '%" + Province + "%'"
  416. }
  417. if City != "" {
  418. where = where + " and a.City like '%" + City + "%'"
  419. }
  420. if Street != "" {
  421. where = where + " and a.Street like '%" + Street + "%'"
  422. }
  423. if HouseNo != "" {
  424. where = where + " and a.HouseNo like '%" + HouseNo + "%'"
  425. }
  426. if ZipCode != "" {
  427. where = where + " and a.ZipCode like '%" + ZipCode + "%'"
  428. }
  429. if QualitySystemCert != "" {
  430. where = where + " and a.QualitySystemCert like '%" + QualitySystemCert + "%'"
  431. }
  432. if ProductQualityCert != "" {
  433. where = where + " and a.ProductQualityCert like '%" + ProductQualityCert + "%'"
  434. }
  435. if MaunLicense != "" {
  436. where = where + " and a.MaunLicense like '%" + MaunLicense + "%'"
  437. }
  438. if QualifCert != "" {
  439. where = where + " and a.QualifCert like '%" + QualifCert + "%'"
  440. }
  441. if QualifCertLevel != "" {
  442. where = where + " and a.QualifCertLevel like '%" + QualifCertLevel + "%'"
  443. }
  444. if SafetyLicense != "" {
  445. where = where + " and a.SafetyLicense like '%" + SafetyLicense + "%'"
  446. }
  447. if TechServiceLic != "" {
  448. where = where + " and a.TechServiceLic like '%" + TechServiceLic + "%'"
  449. }
  450. if TJInNotify != "" {
  451. where = where + " and a.TJInNotify like '%" + TJInNotify + "%'"
  452. }
  453. if SpecIndustryCert != "" {
  454. where = where + " and a.SpecIndustryCert like '%" + SpecIndustryCert + "%'"
  455. }
  456. if LegalPerson != "" {
  457. where = where + " and a.LegalPerson like '%" + LegalPerson + "%'"
  458. }
  459. if CategoryCode != "" {
  460. where = where + " and a.CategoryCode like '%" + CategoryCode + "%'"
  461. }
  462. if CategoryName != "" {
  463. where = where + " and a.CategoryName like '%" + CategoryName + "%'"
  464. }
  465. if RegCapital != "" {
  466. where = where + " and a.RegCapital like '%" + RegCapital + "%'"
  467. }
  468. if Currency != "" {
  469. where = where + " and a.Currency like '%" + Currency + "%'"
  470. }
  471. if ContactName != "" {
  472. where = where + " and a.ContactName like '%" + ContactName + "%'"
  473. }
  474. if CompanyType != "" {
  475. where = where + " and a.CompanyType like '%" + CompanyType + "%'"
  476. }
  477. if SetupTime != "" {
  478. where = where + " and a.SetupTime like '%" + SetupTime + "%'"
  479. }
  480. if DepositBank != "" {
  481. where = where + " and a.DepositBank like '%" + DepositBank + "%'"
  482. }
  483. if BankAccount != "" {
  484. where = where + " and a.BankAccount like '%" + BankAccount + "%'"
  485. }
  486. if EMail != "" {
  487. where = where + " and a.EMail like '%" + EMail + "%'"
  488. }
  489. if BankCreditRating != "" {
  490. where = where + " and a.BankCreditRating like '%" + BankCreditRating + "%'"
  491. }
  492. if Mobile != "" {
  493. where = where + " and a.Mobile like '%" + Mobile + "%'"
  494. }
  495. if Telphone != "" {
  496. where = where + " and a.Telphone like '%" + Telphone + "%'"
  497. }
  498. if Fax != "" {
  499. where = where + " and a.Fax like '%" + Fax + "%'"
  500. }
  501. if CompanyTel != "" {
  502. where = where + " and a.CompanyTel like '%" + CompanyTel + "%'"
  503. }
  504. if QQ != "" {
  505. where = where + " and a.QQ like '%" + QQ + "%'"
  506. }
  507. if CompanyUrl != "" {
  508. where = where + " and a.CompanyUrl like '%" + CompanyUrl + "%'"
  509. }
  510. if SpecSupplier != "" {
  511. where = where + " and a.SpecSupplier like '%" + SpecSupplier + "%'"
  512. }
  513. if SpecTypeCode != "" {
  514. where = where + " and a.SpecTypeCode like '%" + SpecTypeCode + "%'"
  515. }
  516. if SpecTypeName != "" {
  517. where = where + " and a.SpecTypeName like '%" + SpecTypeName + "%'"
  518. }
  519. if Remark != "" {
  520. where = where + " and a.Remark like '%" + Remark + "%'"
  521. }
  522. if CreateOn != "" {
  523. dates := strings.Split(CreateOn, ",")
  524. if len(dates) == 2 {
  525. minDate := dates[0]
  526. maxDate := dates[1]
  527. where = where + " and a.CreateOn>='" + minDate + "' and a.CreateOn<='" + maxDate + "'"
  528. }
  529. }
  530. if SupplierTypeCode != "" {
  531. where = where + " and b.SupplierTypeCode = '" + SupplierTypeCode + "'"
  532. }
  533. //企业用户只看自己的数据记录
  534. /*parameterSvc := baseparameter.GetBaseparameterService(utils.DBE) //取出外部门ID
  535. extOrganizeId := parameterSvc.GetBaseparameterMessage("GFGL", "paramset", "ExtOrganizeId")
  536. if extOrganizeId == this.User.DepartmentId {
  537. where = where + " and a.CreateUserId = '" + this.User.Id + "'"
  538. }*/
  539. //企业用户必须加创建人条件
  540. if this.User.IsCompanyUser == 1 {
  541. where = where + " and a.CreateUserId = '" + this.User.Id + "'"
  542. } else {
  543. //超级管理员和有查看所有数据权限的用户不加条件
  544. svcPerm := permission.GetPermissionService(utils.DBE)
  545. isauth := svcPerm.IsAuthorized(this.User.Id, "oil_supplier.marketAccess.AllRecord")
  546. if !svcPerm.IsAdmin(this.User.Id) && !isauth {
  547. where = where + " and a.CreateUserId = '" + this.User.Id + "'"
  548. }
  549. }
  550. svc := supplier.GetOilSupplierService(utils.DBE)
  551. var list []supplier.OilSupplierView
  552. total := svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, page.CurrentPage, page.Size, orderby, asc, &list, where)
  553. var datainfo DataInfo
  554. datainfo.Items = list
  555. datainfo.CurrentItemCount = total
  556. datainfo.PageIndex = page.CurrentPage
  557. datainfo.ItemsPerPage = page.Size
  558. this.Data["json"] = &datainfo
  559. this.ServeJSON()
  560. }
  561. // @Title 获取集中评审列表
  562. // @Description get user by token
  563. // @Success 200 {object} []supplier.OilSupplier
  564. // @router /jzps_certlist [get]
  565. func (this *OilSupplierController) GetJZPSJoinCertEntityList() {
  566. //获取分页信息
  567. page := this.GetPageInfoForm()
  568. where := " 1=1 "
  569. orderby := "Id"
  570. asc := false
  571. Order := this.GetString("Order")
  572. Prop := this.GetString("Prop")
  573. if Order != "" && Prop != "" {
  574. orderby = Prop
  575. if Order == "asc" {
  576. asc = true
  577. }
  578. }
  579. Id := this.GetString("Id")
  580. SupplierName := this.GetString("SupplierName")
  581. OilCertificateNo := this.GetString("OilCertificateNo")
  582. Grade := this.GetString("Grade")
  583. MgrUnit := this.GetString("MgrUnit")
  584. OperType := this.GetString("OperType")
  585. Country := this.GetString("Country")
  586. MaunAgent := this.GetString("MaunAgent")
  587. ConstructTeam := this.GetString("ConstructTeam")
  588. CommercialNo := this.GetString("CommercialNo")
  589. OrganCode := this.GetString("OrganCode")
  590. CountryTaxNo := this.GetString("CountryTaxNo")
  591. LocalTaxNo := this.GetString("LocalTaxNo")
  592. Address := this.GetString("Address")
  593. Province := this.GetString("Province")
  594. City := this.GetString("City")
  595. Street := this.GetString("Street")
  596. HouseNo := this.GetString("HouseNo")
  597. ZipCode := this.GetString("ZipCode")
  598. QualitySystemCert := this.GetString("QualitySystemCert")
  599. ProductQualityCert := this.GetString("ProductQualityCert")
  600. MaunLicense := this.GetString("MaunLicense")
  601. QualifCert := this.GetString("QualifCert")
  602. QualifCertLevel := this.GetString("QualifCertLevel")
  603. SafetyLicense := this.GetString("SafetyLicense")
  604. TechServiceLic := this.GetString("TechServiceLic")
  605. TJInNotify := this.GetString("TJInNotify")
  606. SpecIndustryCert := this.GetString("SpecIndustryCert")
  607. LegalPerson := this.GetString("LegalPerson")
  608. CategoryCode := this.GetString("CategoryCode")
  609. CategoryName := this.GetString("CategoryName")
  610. RegCapital := this.GetString("RegCapital")
  611. Currency := this.GetString("Currency")
  612. ContactName := this.GetString("ContactName")
  613. CompanyType := this.GetString("CompanyType")
  614. SetupTime := this.GetString("SetupTime")
  615. DepositBank := this.GetString("DepositBank")
  616. BankAccount := this.GetString("BankAccount")
  617. EMail := this.GetString("EMail")
  618. BankCreditRating := this.GetString("BankCreditRating")
  619. Mobile := this.GetString("Mobile")
  620. Telphone := this.GetString("Telphone")
  621. Fax := this.GetString("Fax")
  622. CompanyTel := this.GetString("CompanyTel")
  623. QQ := this.GetString("QQ")
  624. CompanyUrl := this.GetString("CompanyUrl")
  625. SpecSupplier := this.GetString("SpecSupplier")
  626. SpecTypeCode := this.GetString("SpecTypeCode")
  627. SpecTypeName := this.GetString("SpecTypeName")
  628. Remark := this.GetString("Remark")
  629. CreateOn := this.GetString("CreateOn")
  630. SupplierTypeCode := this.GetString("SupplierTypeCode")
  631. status := this.GetString("Status")
  632. if status != "" {
  633. where = where + " and b.Status='" + status + "'"
  634. }
  635. if Id != "" {
  636. where = where + " and a.Id like '%" + Id + "%'"
  637. }
  638. if SupplierName != "" {
  639. where = where + " and a.SupplierName like '%" + SupplierName + "%'"
  640. }
  641. if OilCertificateNo != "" {
  642. where = where + " and a.OilCertificateNo like '%" + OilCertificateNo + "%'"
  643. }
  644. if Grade != "" {
  645. where = where + " and a.Grade like '%" + Grade + "%'"
  646. }
  647. if MgrUnit != "" {
  648. where = where + " and a.MgrUnit like '%" + MgrUnit + "%'"
  649. }
  650. if OperType != "" {
  651. where = where + " and a.OperType like '%" + OperType + "%'"
  652. }
  653. if Country != "" {
  654. where = where + " and a.Country like '%" + Country + "%'"
  655. }
  656. if MaunAgent != "" {
  657. where = where + " and a.MaunAgent like '%" + MaunAgent + "%'"
  658. }
  659. if ConstructTeam != "" {
  660. where = where + " and a.ConstructTeam like '%" + ConstructTeam + "%'"
  661. }
  662. if CommercialNo != "" {
  663. where = where + " and a.CommercialNo like '%" + CommercialNo + "%'"
  664. }
  665. if OrganCode != "" {
  666. where = where + " and a.OrganCode like '%" + OrganCode + "%'"
  667. }
  668. if CountryTaxNo != "" {
  669. where = where + " and a.CountryTaxNo like '%" + CountryTaxNo + "%'"
  670. }
  671. if LocalTaxNo != "" {
  672. where = where + " and a.LocalTaxNo like '%" + LocalTaxNo + "%'"
  673. }
  674. if Address != "" {
  675. where = where + " and a.Address like '%" + Address + "%'"
  676. }
  677. if Province != "" {
  678. where = where + " and a.Province like '%" + Province + "%'"
  679. }
  680. if City != "" {
  681. where = where + " and a.City like '%" + City + "%'"
  682. }
  683. if Street != "" {
  684. where = where + " and a.Street like '%" + Street + "%'"
  685. }
  686. if HouseNo != "" {
  687. where = where + " and a.HouseNo like '%" + HouseNo + "%'"
  688. }
  689. if ZipCode != "" {
  690. where = where + " and a.ZipCode like '%" + ZipCode + "%'"
  691. }
  692. if QualitySystemCert != "" {
  693. where = where + " and a.QualitySystemCert like '%" + QualitySystemCert + "%'"
  694. }
  695. if ProductQualityCert != "" {
  696. where = where + " and a.ProductQualityCert like '%" + ProductQualityCert + "%'"
  697. }
  698. if MaunLicense != "" {
  699. where = where + " and a.MaunLicense like '%" + MaunLicense + "%'"
  700. }
  701. if QualifCert != "" {
  702. where = where + " and a.QualifCert like '%" + QualifCert + "%'"
  703. }
  704. if QualifCertLevel != "" {
  705. where = where + " and a.QualifCertLevel like '%" + QualifCertLevel + "%'"
  706. }
  707. if SafetyLicense != "" {
  708. where = where + " and a.SafetyLicense like '%" + SafetyLicense + "%'"
  709. }
  710. if TechServiceLic != "" {
  711. where = where + " and a.TechServiceLic like '%" + TechServiceLic + "%'"
  712. }
  713. if TJInNotify != "" {
  714. where = where + " and a.TJInNotify like '%" + TJInNotify + "%'"
  715. }
  716. if SpecIndustryCert != "" {
  717. where = where + " and a.SpecIndustryCert like '%" + SpecIndustryCert + "%'"
  718. }
  719. if LegalPerson != "" {
  720. where = where + " and a.LegalPerson like '%" + LegalPerson + "%'"
  721. }
  722. if CategoryCode != "" {
  723. where = where + " and a.CategoryCode like '%" + CategoryCode + "%'"
  724. }
  725. if CategoryName != "" {
  726. where = where + " and a.CategoryName like '%" + CategoryName + "%'"
  727. }
  728. if RegCapital != "" {
  729. where = where + " and a.RegCapital like '%" + RegCapital + "%'"
  730. }
  731. if Currency != "" {
  732. where = where + " and a.Currency like '%" + Currency + "%'"
  733. }
  734. if ContactName != "" {
  735. where = where + " and a.ContactName like '%" + ContactName + "%'"
  736. }
  737. if CompanyType != "" {
  738. where = where + " and a.CompanyType like '%" + CompanyType + "%'"
  739. }
  740. if SetupTime != "" {
  741. where = where + " and a.SetupTime like '%" + SetupTime + "%'"
  742. }
  743. if DepositBank != "" {
  744. where = where + " and a.DepositBank like '%" + DepositBank + "%'"
  745. }
  746. if BankAccount != "" {
  747. where = where + " and a.BankAccount like '%" + BankAccount + "%'"
  748. }
  749. if EMail != "" {
  750. where = where + " and a.EMail like '%" + EMail + "%'"
  751. }
  752. if BankCreditRating != "" {
  753. where = where + " and a.BankCreditRating like '%" + BankCreditRating + "%'"
  754. }
  755. if Mobile != "" {
  756. where = where + " and a.Mobile like '%" + Mobile + "%'"
  757. }
  758. if Telphone != "" {
  759. where = where + " and a.Telphone like '%" + Telphone + "%'"
  760. }
  761. if Fax != "" {
  762. where = where + " and a.Fax like '%" + Fax + "%'"
  763. }
  764. if CompanyTel != "" {
  765. where = where + " and a.CompanyTel like '%" + CompanyTel + "%'"
  766. }
  767. if QQ != "" {
  768. where = where + " and a.QQ like '%" + QQ + "%'"
  769. }
  770. if CompanyUrl != "" {
  771. where = where + " and a.CompanyUrl like '%" + CompanyUrl + "%'"
  772. }
  773. if SpecSupplier != "" {
  774. where = where + " and a.SpecSupplier like '%" + SpecSupplier + "%'"
  775. }
  776. if SpecTypeCode != "" {
  777. where = where + " and a.SpecTypeCode like '%" + SpecTypeCode + "%'"
  778. }
  779. if SpecTypeName != "" {
  780. where = where + " and a.SpecTypeName like '%" + SpecTypeName + "%'"
  781. }
  782. if Remark != "" {
  783. where = where + " and a.Remark like '%" + Remark + "%'"
  784. }
  785. if CreateOn != "" {
  786. dates := strings.Split(CreateOn, ",")
  787. if len(dates) == 2 {
  788. minDate := dates[0]
  789. maxDate := dates[1]
  790. where = where + " and a.CreateOn>='" + minDate + "' and a.CreateOn<='" + maxDate + "'"
  791. }
  792. }
  793. if SupplierTypeCode != "" {
  794. where = where + " and b.SupplierTypeCode = '" + SupplierTypeCode + "'"
  795. }
  796. //企业用户必须加创建人条件
  797. if this.User.IsCompanyUser == 1 {
  798. where = where + " and a.CreateUserId = '" + this.User.Id + "'"
  799. } else {
  800. //超级管理员和有查看所有数据权限的用户不加条件
  801. svcPerm := permission.GetPermissionService(utils.DBE)
  802. isauth := svcPerm.IsAuthorized(this.User.Id, "oil_supplier.marketAccess.AllRecord")
  803. if !svcPerm.IsAdmin(this.User.Id) && !isauth {
  804. //根据工作流查找
  805. //集中评审相关人可看数据
  806. actisvc := workflow.GetActivitiService(utils.DBE)
  807. //找出待办任务===准入
  808. var certIdList string
  809. ids := actisvc.GetAllMyTasks(workflow.OIL_SUPPLIER_APPLY, this.User.Id)
  810. if len(strings.Trim(ids, ",")) > 0 {
  811. certIdList += strings.Trim(ids, ",")+ ","
  812. }
  813. ids = actisvc.GetAllMyTasks(workflow.OIL_FIRST_SUPPLIER_APPLY, this.User.Id)
  814. if len(strings.Trim(ids, ",")) > 0 {
  815. certIdList += strings.Trim(ids, ",")+ ","
  816. }
  817. ids = actisvc.GetAllMyTasks(workflow.OIL_SECOND_SUPPLIER_APPLY, this.User.Id)
  818. if len(strings.Trim(ids, ",")) > 0 {
  819. certIdList += strings.Trim(ids, ",")+ ","
  820. }
  821. ids = actisvc.GetAllMyTasks(workflow.OIL_ENUSER_SUPPLIER_APPLY, this.User.Id)
  822. if len(strings.Trim(ids, ",")) > 0 {
  823. certIdList += strings.Trim(ids, ",")+ ","
  824. }
  825. ids = actisvc.GetAllMyTasks(workflow.OIL_FIRST_ENUSER_SUPPLIER_APPLY, this.User.Id)
  826. if len(strings.Trim(ids, ",")) > 0 {
  827. certIdList += strings.Trim(ids, ",")+ ","
  828. }
  829. ids = actisvc.GetAllMyTasks(workflow.OIL_SECOND_ENUSER_SUPPLIER_APPLY, this.User.Id)
  830. if len(strings.Trim(ids, ",")) > 0 {
  831. certIdList += strings.Trim(ids, ",")+ ","
  832. }
  833. certIdList = strings.Trim(certIdList, ",")
  834. certIdarr := strings.Split(certIdList, ",")
  835. for i, item := range certIdarr {
  836. idx := strings.Index(item, "-")
  837. if idx >= 0 {
  838. certIdarr[i] = strings.Split(item, "-")[0]
  839. }
  840. }
  841. certIdList = strings.Join(certIdarr, ",")
  842. if certIdList != "" {
  843. where += " and ( b.Id in (" + certIdList + ")" + " or a.CreateUserId = '" + this.User.Id + "')"
  844. } else {
  845. where = where + " and a.CreateUserId = '" + this.User.Id + "'"
  846. }
  847. } else {
  848. where = where + " and a.CreateUserId = '" + this.User.Id + "'"
  849. }
  850. }
  851. svc := supplier.GetOilSupplierService(utils.DBE)
  852. var list []supplier.OilSupplierView
  853. total := svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, page.CurrentPage, page.Size, orderby, asc, &list, where)
  854. var datainfo DataInfo
  855. datainfo.Items = list
  856. datainfo.CurrentItemCount = total
  857. datainfo.PageIndex = page.CurrentPage
  858. datainfo.ItemsPerPage = page.Size
  859. this.Data["json"] = &datainfo
  860. this.ServeJSON()
  861. }
  862. // @Title 企业入库列表
  863. // @Description get user by token
  864. // @Success 200 {object} []supplier.OilSupplier
  865. // @router /storelist [get]
  866. func (this *OilSupplierController) GetJoinStoreEntityList() {
  867. //获取分页信息
  868. page := this.GetPageInfoForm()
  869. where := " 1=1 "
  870. orderby := "Id"
  871. asc := false
  872. Order := this.GetString("Order")
  873. Prop := this.GetString("Prop")
  874. if Order != "" && Prop != "" {
  875. orderby = Prop
  876. if Order == "asc" {
  877. asc = true
  878. }
  879. }
  880. Id := this.GetString("Id")
  881. SupplierName := this.GetString("SupplierName")
  882. OilCertificateNo := this.GetString("OilCertificateNo")
  883. Grade := this.GetString("Grade")
  884. MgrUnit := this.GetString("MgrUnit")
  885. OperType := this.GetString("OperType")
  886. Country := this.GetString("Country")
  887. MaunAgent := this.GetString("MaunAgent")
  888. ConstructTeam := this.GetString("ConstructTeam")
  889. CommercialNo := this.GetString("CommercialNo")
  890. OrganCode := this.GetString("OrganCode")
  891. CountryTaxNo := this.GetString("CountryTaxNo")
  892. LocalTaxNo := this.GetString("LocalTaxNo")
  893. Address := this.GetString("Address")
  894. Province := this.GetString("Province")
  895. City := this.GetString("City")
  896. Street := this.GetString("Street")
  897. HouseNo := this.GetString("HouseNo")
  898. ZipCode := this.GetString("ZipCode")
  899. QualitySystemCert := this.GetString("QualitySystemCert")
  900. ProductQualityCert := this.GetString("ProductQualityCert")
  901. MaunLicense := this.GetString("MaunLicense")
  902. QualifCert := this.GetString("QualifCert")
  903. QualifCertLevel := this.GetString("QualifCertLevel")
  904. SafetyLicense := this.GetString("SafetyLicense")
  905. TechServiceLic := this.GetString("TechServiceLic")
  906. TJInNotify := this.GetString("TJInNotify")
  907. SpecIndustryCert := this.GetString("SpecIndustryCert")
  908. LegalPerson := this.GetString("LegalPerson")
  909. CategoryCode := this.GetString("CategoryCode")
  910. CategoryName := this.GetString("CategoryName")
  911. RegCapital := this.GetString("RegCapital")
  912. Currency := this.GetString("Currency")
  913. ContactName := this.GetString("ContactName")
  914. CompanyType := this.GetString("CompanyType")
  915. SetupTime := this.GetString("SetupTime")
  916. DepositBank := this.GetString("DepositBank")
  917. BankAccount := this.GetString("BankAccount")
  918. EMail := this.GetString("EMail")
  919. BankCreditRating := this.GetString("BankCreditRating")
  920. Mobile := this.GetString("Mobile")
  921. Telphone := this.GetString("Telphone")
  922. Fax := this.GetString("Fax")
  923. CompanyTel := this.GetString("CompanyTel")
  924. QQ := this.GetString("QQ")
  925. CompanyUrl := this.GetString("CompanyUrl")
  926. SpecSupplier := this.GetString("SpecSupplier")
  927. SpecTypeCode := this.GetString("SpecTypeCode")
  928. SpecTypeName := this.GetString("SpecTypeName")
  929. Remark := this.GetString("Remark")
  930. CreateOn := this.GetString("CreateOn")
  931. SupplierTypeCode := this.GetString("SupplierTypeCode")
  932. status := this.GetString("Status")
  933. if status != "" {
  934. where = where + " and b.Status='" + status + "'"
  935. }
  936. if Id != "" {
  937. where = where + " and a.Id like '%" + Id + "%'"
  938. }
  939. if SupplierName != "" {
  940. where = where + " and a.SupplierName like '%" + SupplierName + "%'"
  941. }
  942. if OilCertificateNo != "" {
  943. where = where + " and a.OilCertificateNo like '%" + OilCertificateNo + "%'"
  944. }
  945. if Grade != "" {
  946. where = where + " and a.Grade like '%" + Grade + "%'"
  947. }
  948. if MgrUnit != "" {
  949. where = where + " and a.MgrUnit like '%" + MgrUnit + "%'"
  950. }
  951. if OperType != "" {
  952. where = where + " and a.OperType like '%" + OperType + "%'"
  953. }
  954. if Country != "" {
  955. where = where + " and a.Country like '%" + Country + "%'"
  956. }
  957. if MaunAgent != "" {
  958. where = where + " and a.MaunAgent like '%" + MaunAgent + "%'"
  959. }
  960. if ConstructTeam != "" {
  961. where = where + " and a.ConstructTeam like '%" + ConstructTeam + "%'"
  962. }
  963. if CommercialNo != "" {
  964. where = where + " and a.CommercialNo like '%" + CommercialNo + "%'"
  965. }
  966. if OrganCode != "" {
  967. where = where + " and a.OrganCode like '%" + OrganCode + "%'"
  968. }
  969. if CountryTaxNo != "" {
  970. where = where + " and a.CountryTaxNo like '%" + CountryTaxNo + "%'"
  971. }
  972. if LocalTaxNo != "" {
  973. where = where + " and a.LocalTaxNo like '%" + LocalTaxNo + "%'"
  974. }
  975. if Address != "" {
  976. where = where + " and a.Address like '%" + Address + "%'"
  977. }
  978. if Province != "" {
  979. where = where + " and a.Province like '%" + Province + "%'"
  980. }
  981. if City != "" {
  982. where = where + " and a.City like '%" + City + "%'"
  983. }
  984. if Street != "" {
  985. where = where + " and a.Street like '%" + Street + "%'"
  986. }
  987. if HouseNo != "" {
  988. where = where + " and a.HouseNo like '%" + HouseNo + "%'"
  989. }
  990. if ZipCode != "" {
  991. where = where + " and a.ZipCode like '%" + ZipCode + "%'"
  992. }
  993. if QualitySystemCert != "" {
  994. where = where + " and a.QualitySystemCert like '%" + QualitySystemCert + "%'"
  995. }
  996. if ProductQualityCert != "" {
  997. where = where + " and a.ProductQualityCert like '%" + ProductQualityCert + "%'"
  998. }
  999. if MaunLicense != "" {
  1000. where = where + " and a.MaunLicense like '%" + MaunLicense + "%'"
  1001. }
  1002. if QualifCert != "" {
  1003. where = where + " and a.QualifCert like '%" + QualifCert + "%'"
  1004. }
  1005. if QualifCertLevel != "" {
  1006. where = where + " and a.QualifCertLevel like '%" + QualifCertLevel + "%'"
  1007. }
  1008. if SafetyLicense != "" {
  1009. where = where + " and a.SafetyLicense like '%" + SafetyLicense + "%'"
  1010. }
  1011. if TechServiceLic != "" {
  1012. where = where + " and a.TechServiceLic like '%" + TechServiceLic + "%'"
  1013. }
  1014. if TJInNotify != "" {
  1015. where = where + " and a.TJInNotify like '%" + TJInNotify + "%'"
  1016. }
  1017. if SpecIndustryCert != "" {
  1018. where = where + " and a.SpecIndustryCert like '%" + SpecIndustryCert + "%'"
  1019. }
  1020. if LegalPerson != "" {
  1021. where = where + " and a.LegalPerson like '%" + LegalPerson + "%'"
  1022. }
  1023. if CategoryCode != "" {
  1024. where = where + " and a.CategoryCode like '%" + CategoryCode + "%'"
  1025. }
  1026. if CategoryName != "" {
  1027. where = where + " and a.CategoryName like '%" + CategoryName + "%'"
  1028. }
  1029. if RegCapital != "" {
  1030. where = where + " and a.RegCapital like '%" + RegCapital + "%'"
  1031. }
  1032. if Currency != "" {
  1033. where = where + " and a.Currency like '%" + Currency + "%'"
  1034. }
  1035. if ContactName != "" {
  1036. where = where + " and a.ContactName like '%" + ContactName + "%'"
  1037. }
  1038. if CompanyType != "" {
  1039. where = where + " and a.CompanyType like '%" + CompanyType + "%'"
  1040. }
  1041. if SetupTime != "" {
  1042. where = where + " and a.SetupTime like '%" + SetupTime + "%'"
  1043. }
  1044. if DepositBank != "" {
  1045. where = where + " and a.DepositBank like '%" + DepositBank + "%'"
  1046. }
  1047. if BankAccount != "" {
  1048. where = where + " and a.BankAccount like '%" + BankAccount + "%'"
  1049. }
  1050. if EMail != "" {
  1051. where = where + " and a.EMail like '%" + EMail + "%'"
  1052. }
  1053. if BankCreditRating != "" {
  1054. where = where + " and a.BankCreditRating like '%" + BankCreditRating + "%'"
  1055. }
  1056. if Mobile != "" {
  1057. where = where + " and a.Mobile like '%" + Mobile + "%'"
  1058. }
  1059. if Telphone != "" {
  1060. where = where + " and a.Telphone like '%" + Telphone + "%'"
  1061. }
  1062. if Fax != "" {
  1063. where = where + " and a.Fax like '%" + Fax + "%'"
  1064. }
  1065. if CompanyTel != "" {
  1066. where = where + " and a.CompanyTel like '%" + CompanyTel + "%'"
  1067. }
  1068. if QQ != "" {
  1069. where = where + " and a.QQ like '%" + QQ + "%'"
  1070. }
  1071. if CompanyUrl != "" {
  1072. where = where + " and a.CompanyUrl like '%" + CompanyUrl + "%'"
  1073. }
  1074. if SpecSupplier != "" {
  1075. where = where + " and a.SpecSupplier like '%" + SpecSupplier + "%'"
  1076. }
  1077. if SpecTypeCode != "" {
  1078. where = where + " and a.SpecTypeCode like '%" + SpecTypeCode + "%'"
  1079. }
  1080. if SpecTypeName != "" {
  1081. where = where + " and a.SpecTypeName like '%" + SpecTypeName + "%'"
  1082. }
  1083. if Remark != "" {
  1084. where = where + " and a.Remark like '%" + Remark + "%'"
  1085. }
  1086. if CreateOn != "" {
  1087. dates := strings.Split(CreateOn, ",")
  1088. if len(dates) == 2 {
  1089. minDate := dates[0]
  1090. maxDate := dates[1]
  1091. where = where + " and a.CreateOn>='" + minDate + "' and a.CreateOn<='" + maxDate + "'"
  1092. }
  1093. }
  1094. if SupplierTypeCode != "" {
  1095. where = where + " and b.SupplierTypeCode = '" + SupplierTypeCode + "'"
  1096. }
  1097. //企业用户只看自己的数据记录
  1098. /*parameterSvc := baseparameter.GetBaseparameterService(utils.DBE) //取出外部门ID
  1099. extOrganizeId := parameterSvc.GetBaseparameterMessage("GFGL", "paramset", "ExtOrganizeId")
  1100. if extOrganizeId == this.User.DepartmentId {
  1101. where = where + " and a.CreateUserId = '" + this.User.Id + "'"
  1102. }*/
  1103. //企业用户必须加创建人条件
  1104. if this.User.IsCompanyUser == 1 {
  1105. where = where + " and a.CreateUserId = '" + this.User.Id + "'"
  1106. }
  1107. svc := supplier.GetOilSupplierService(utils.DBE)
  1108. var list []supplier.OilSupplierView
  1109. total := svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, page.CurrentPage, page.Size, orderby, asc, &list, where)
  1110. var datainfo DataInfo
  1111. datainfo.Items = list
  1112. datainfo.CurrentItemCount = total
  1113. datainfo.PageIndex = page.CurrentPage
  1114. datainfo.ItemsPerPage = page.Size
  1115. this.Data["json"] = &datainfo
  1116. this.ServeJSON()
  1117. }
  1118. // @Title 获取列表
  1119. // @Description get user by token
  1120. // @Success 200 {object} []supplier.OilSupplierView
  1121. // @router /mytasks [get]
  1122. func (this *OilSupplierController) GetMyTaskEntityList() {
  1123. //获取分页信息
  1124. page := this.GetPageInfoForm()
  1125. where := " 1=1 "
  1126. orderby := "Id"
  1127. asc := false
  1128. Order := this.GetString("Order")
  1129. //Statustype := this.GetString("Statustype")
  1130. //if Statustype != "" {
  1131. // where = " 1=1 and b.Status =" + Statustype
  1132. //}
  1133. where = where + " and b.Status>0"
  1134. Prop := this.GetString("Prop")
  1135. if Order != "" && Prop != "" {
  1136. orderby = Prop
  1137. if Order == "asc" {
  1138. asc = true
  1139. }
  1140. }
  1141. Id := this.GetString("Id")
  1142. SupplierName := this.GetString("SupplierName")
  1143. OilCertificateNo := this.GetString("OilCertificateNo")
  1144. Grade := this.GetString("Grade")
  1145. MgrUnit := this.GetString("MgrUnit")
  1146. OperType := this.GetString("OperType")
  1147. Country := this.GetString("Country")
  1148. MaunAgent := this.GetString("MaunAgent")
  1149. ConstructTeam := this.GetString("ConstructTeam")
  1150. CommercialNo := this.GetString("CommercialNo")
  1151. OrganCode := this.GetString("OrganCode")
  1152. CountryTaxNo := this.GetString("CountryTaxNo")
  1153. LocalTaxNo := this.GetString("LocalTaxNo")
  1154. Address := this.GetString("Address")
  1155. Province := this.GetString("Province")
  1156. City := this.GetString("City")
  1157. Street := this.GetString("Street")
  1158. HouseNo := this.GetString("HouseNo")
  1159. ZipCode := this.GetString("ZipCode")
  1160. QualitySystemCert := this.GetString("QualitySystemCert")
  1161. ProductQualityCert := this.GetString("ProductQualityCert")
  1162. MaunLicense := this.GetString("MaunLicense")
  1163. QualifCert := this.GetString("QualifCert")
  1164. QualifCertLevel := this.GetString("QualifCertLevel")
  1165. SafetyLicense := this.GetString("SafetyLicense")
  1166. TechServiceLic := this.GetString("TechServiceLic")
  1167. TJInNotify := this.GetString("TJInNotify")
  1168. SpecIndustryCert := this.GetString("SpecIndustryCert")
  1169. LegalPerson := this.GetString("LegalPerson")
  1170. CategoryCode := this.GetString("CategoryCode")
  1171. CategoryName := this.GetString("CategoryName")
  1172. RegCapital := this.GetString("RegCapital")
  1173. Currency := this.GetString("Currency")
  1174. ContactName := this.GetString("ContactName")
  1175. CompanyType := this.GetString("CompanyType")
  1176. SetupTime := this.GetString("SetupTime")
  1177. DepositBank := this.GetString("DepositBank")
  1178. BankAccount := this.GetString("BankAccount")
  1179. EMail := this.GetString("EMail")
  1180. BankCreditRating := this.GetString("BankCreditRating")
  1181. Mobile := this.GetString("Mobile")
  1182. Telphone := this.GetString("Telphone")
  1183. Fax := this.GetString("Fax")
  1184. CompanyTel := this.GetString("CompanyTel")
  1185. QQ := this.GetString("QQ")
  1186. CompanyUrl := this.GetString("CompanyUrl")
  1187. SpecSupplier := this.GetString("SpecSupplier")
  1188. SpecTypeCode := this.GetString("SpecTypeCode")
  1189. SpecTypeName := this.GetString("SpecTypeName")
  1190. Remark := this.GetString("Remark")
  1191. CreateOn := this.GetString("CreateOn")
  1192. SupplierTypeCode := this.GetString("SupplierTypeCode")
  1193. if Id != "" {
  1194. where = where + " and a.Id like '%" + Id + "%'"
  1195. }
  1196. if SupplierName != "" {
  1197. where = where + " and a.SupplierName like '%" + SupplierName + "%'"
  1198. }
  1199. if OilCertificateNo != "" {
  1200. where = where + " and a.OilCertificateNo like '%" + OilCertificateNo + "%'"
  1201. }
  1202. if Grade != "" {
  1203. where = where + " and a.Grade like '%" + Grade + "%'"
  1204. }
  1205. if MgrUnit != "" {
  1206. where = where + " and a.MgrUnit like '%" + MgrUnit + "%'"
  1207. }
  1208. if OperType != "" {
  1209. where = where + " and a.OperType like '%" + OperType + "%'"
  1210. }
  1211. if Country != "" {
  1212. where = where + " and a.Country like '%" + Country + "%'"
  1213. }
  1214. if MaunAgent != "" {
  1215. where = where + " and a.MaunAgent like '%" + MaunAgent + "%'"
  1216. }
  1217. if ConstructTeam != "" {
  1218. where = where + " and a.ConstructTeam like '%" + ConstructTeam + "%'"
  1219. }
  1220. if CommercialNo != "" {
  1221. where = where + " and a.CommercialNo like '%" + CommercialNo + "%'"
  1222. }
  1223. if OrganCode != "" {
  1224. where = where + " and a.OrganCode like '%" + OrganCode + "%'"
  1225. }
  1226. if CountryTaxNo != "" {
  1227. where = where + " and a.CountryTaxNo like '%" + CountryTaxNo + "%'"
  1228. }
  1229. if LocalTaxNo != "" {
  1230. where = where + " and a.LocalTaxNo like '%" + LocalTaxNo + "%'"
  1231. }
  1232. if Address != "" {
  1233. where = where + " and a.Address like '%" + Address + "%'"
  1234. }
  1235. if Province != "" {
  1236. where = where + " and a.Province like '%" + Province + "%'"
  1237. }
  1238. if City != "" {
  1239. where = where + " and a.City like '%" + City + "%'"
  1240. }
  1241. if Street != "" {
  1242. where = where + " and a.Street like '%" + Street + "%'"
  1243. }
  1244. if HouseNo != "" {
  1245. where = where + " and a.HouseNo like '%" + HouseNo + "%'"
  1246. }
  1247. if ZipCode != "" {
  1248. where = where + " and a.ZipCode like '%" + ZipCode + "%'"
  1249. }
  1250. if QualitySystemCert != "" {
  1251. where = where + " and a.QualitySystemCert like '%" + QualitySystemCert + "%'"
  1252. }
  1253. if ProductQualityCert != "" {
  1254. where = where + " and a.ProductQualityCert like '%" + ProductQualityCert + "%'"
  1255. }
  1256. if MaunLicense != "" {
  1257. where = where + " and a.MaunLicense like '%" + MaunLicense + "%'"
  1258. }
  1259. if QualifCert != "" {
  1260. where = where + " and a.QualifCert like '%" + QualifCert + "%'"
  1261. }
  1262. if QualifCertLevel != "" {
  1263. where = where + " and a.QualifCertLevel like '%" + QualifCertLevel + "%'"
  1264. }
  1265. if SafetyLicense != "" {
  1266. where = where + " and a.SafetyLicense like '%" + SafetyLicense + "%'"
  1267. }
  1268. if TechServiceLic != "" {
  1269. where = where + " and a.TechServiceLic like '%" + TechServiceLic + "%'"
  1270. }
  1271. if TJInNotify != "" {
  1272. where = where + " and a.TJInNotify like '%" + TJInNotify + "%'"
  1273. }
  1274. if SpecIndustryCert != "" {
  1275. where = where + " and a.SpecIndustryCert like '%" + SpecIndustryCert + "%'"
  1276. }
  1277. if LegalPerson != "" {
  1278. where = where + " and a.LegalPerson like '%" + LegalPerson + "%'"
  1279. }
  1280. if CategoryCode != "" {
  1281. where = where + " and a.CategoryCode like '%" + CategoryCode + "%'"
  1282. }
  1283. if CategoryName != "" {
  1284. where = where + " and a.CategoryName like '%" + CategoryName + "%'"
  1285. }
  1286. if RegCapital != "" {
  1287. where = where + " and a.RegCapital like '%" + RegCapital + "%'"
  1288. }
  1289. if Currency != "" {
  1290. where = where + " and a.Currency like '%" + Currency + "%'"
  1291. }
  1292. if ContactName != "" {
  1293. where = where + " and a.ContactName like '%" + ContactName + "%'"
  1294. }
  1295. if CompanyType != "" {
  1296. where = where + " and a.CompanyType like '%" + CompanyType + "%'"
  1297. }
  1298. if SetupTime != "" {
  1299. where = where + " and a.SetupTime like '%" + SetupTime + "%'"
  1300. }
  1301. if DepositBank != "" {
  1302. where = where + " and a.DepositBank like '%" + DepositBank + "%'"
  1303. }
  1304. if BankAccount != "" {
  1305. where = where + " and a.BankAccount like '%" + BankAccount + "%'"
  1306. }
  1307. if EMail != "" {
  1308. where = where + " and a.EMail like '%" + EMail + "%'"
  1309. }
  1310. if BankCreditRating != "" {
  1311. where = where + " and a.BankCreditRating like '%" + BankCreditRating + "%'"
  1312. }
  1313. if Mobile != "" {
  1314. where = where + " and a.Mobile like '%" + Mobile + "%'"
  1315. }
  1316. if Telphone != "" {
  1317. where = where + " and a.Telphone like '%" + Telphone + "%'"
  1318. }
  1319. if Fax != "" {
  1320. where = where + " and a.Fax like '%" + Fax + "%'"
  1321. }
  1322. if CompanyTel != "" {
  1323. where = where + " and a.CompanyTel like '%" + CompanyTel + "%'"
  1324. }
  1325. if QQ != "" {
  1326. where = where + " and a.QQ like '%" + QQ + "%'"
  1327. }
  1328. if CompanyUrl != "" {
  1329. where = where + " and a.CompanyUrl like '%" + CompanyUrl + "%'"
  1330. }
  1331. if SpecSupplier != "" {
  1332. where = where + " and a.SpecSupplier like '%" + SpecSupplier + "%'"
  1333. }
  1334. if SpecTypeCode != "" {
  1335. where = where + " and a.SpecTypeCode like '%" + SpecTypeCode + "%'"
  1336. }
  1337. if SpecTypeName != "" {
  1338. where = where + " and a.SpecTypeName like '%" + SpecTypeName + "%'"
  1339. }
  1340. if Remark != "" {
  1341. where = where + " and a.Remark like '%" + Remark + "%'"
  1342. }
  1343. if CreateOn != "" {
  1344. dates := strings.Split(CreateOn, ",")
  1345. if len(dates) == 2 {
  1346. minDate := dates[0]
  1347. maxDate := dates[1]
  1348. where = where + " and a.CreateOn>='" + minDate + "' and a.CreateOn<='" + maxDate + "'"
  1349. }
  1350. }
  1351. if SupplierTypeCode != "" {
  1352. where = where + " and b.SupplierTypeCode = '" + SupplierTypeCode + "'"
  1353. }
  1354. //找出待办任务
  1355. actisvc := workflow.GetActivitiService(utils.DBE)
  1356. var certIdList string
  1357. if actisvc.GetMyTasks(workflow.OIL_SUPPLIER_APPLY, this.User.Id) != "" {
  1358. certIdList = actisvc.GetMyTasks(workflow.OIL_SUPPLIER_APPLY, this.User.Id)
  1359. certIdList = certIdList + ","
  1360. }
  1361. if actisvc.GetMyTasks(workflow.OIL_FIRST_SUPPLIER_APPLY, this.User.Id) != "" {
  1362. certIdList = fmt.Sprintf("%s %s", certIdList, actisvc.GetMyTasks(workflow.OIL_FIRST_SUPPLIER_APPLY, this.User.Id))
  1363. certIdList = certIdList + ","
  1364. }
  1365. if actisvc.GetMyTasks(workflow.OIL_SECOND_SUPPLIER_APPLY, this.User.Id) != "" {
  1366. certIdList = fmt.Sprintf("%s %s", certIdList, actisvc.GetMyTasks(workflow.OIL_SECOND_SUPPLIER_APPLY, this.User.Id))
  1367. certIdList = certIdList + ","
  1368. }
  1369. if actisvc.GetMyTasks(workflow.OIL_ENUSER_SUPPLIER_APPLY, this.User.Id) != "" {
  1370. certIdList = fmt.Sprintf("%s %s", certIdList, actisvc.GetMyTasks(workflow.OIL_ENUSER_SUPPLIER_APPLY, this.User.Id))
  1371. certIdList = certIdList + ","
  1372. }
  1373. if actisvc.GetMyTasks(workflow.OIL_FIRST_ENUSER_SUPPLIER_APPLY, this.User.Id) != "" {
  1374. certIdList = fmt.Sprintf("%s %s", certIdList, actisvc.GetMyTasks(workflow.OIL_FIRST_ENUSER_SUPPLIER_APPLY, this.User.Id))
  1375. certIdList = certIdList + ","
  1376. }
  1377. if actisvc.GetMyTasks(workflow.OIL_SECOND_ENUSER_SUPPLIER_APPLY, this.User.Id) != "" {
  1378. certIdList = fmt.Sprintf("%s %s", certIdList, actisvc.GetMyTasks(workflow.OIL_SECOND_ENUSER_SUPPLIER_APPLY, this.User.Id))
  1379. }
  1380. certIdList = strings.Trim(certIdList, ",")
  1381. certIdarr := strings.Split(certIdList, ",")
  1382. for i, item := range certIdarr {
  1383. idx := strings.Index(item, "-")
  1384. if idx >= 0 {
  1385. certIdarr[i] = strings.Split(item, "-")[0]
  1386. }
  1387. }
  1388. certIdList = strings.Join(certIdarr, ",")
  1389. var list []supplier.OilSupplierView
  1390. svc := supplier.GetOilSupplierService(utils.DBE)
  1391. var total int64 = 0
  1392. if (certIdList != "") {
  1393. where += " and b.Id in (" + certIdList + ")"
  1394. total = svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, page.CurrentPage, page.Size, orderby, asc, &list, where)
  1395. }
  1396. //根据部门查询待办任务
  1397. var datainfo DataInfo
  1398. datainfo.Items = list
  1399. datainfo.CurrentItemCount = total
  1400. datainfo.PageIndex = page.CurrentPage
  1401. datainfo.ItemsPerPage = page.Size
  1402. this.Data["json"] = &datainfo
  1403. this.ServeJSON()
  1404. }
  1405. // @Title 获取字典列表
  1406. // @Description get user by token
  1407. // @Success 200 {object} map[string]interface{}
  1408. // @router /dictlist [get]
  1409. func (this *OilSupplierController) GetDictList() {
  1410. dictList := make(map[string]interface{})
  1411. dictSvc := items.GetItemsService(utils.DBE)
  1412. userSvc := baseUser.GetBaseUserService(utils.DBE)
  1413. areaJsonSvc := areajson.GetAreaJsonService(utils.DBE)
  1414. //customerSvc := svccustomer.GetCustomerService(utils.DBE)
  1415. dictList["UnitRelation"] = dictSvc.GetKeyValueItems("UnitRelation")
  1416. dictList["CompanyType"] = dictSvc.GetKeyValueItems("CompanyType")
  1417. dictList["InOptions"] = dictSvc.GetKeyValueItems("InOptions")
  1418. var userEntity userRole.Base_User
  1419. userSvc.GetEntityById(this.User.Id, &userEntity)
  1420. dictList["Supervisers"] = userSvc.GetUserListByDepartmentId(this.User.AccCode, userEntity.Departmentid)
  1421. dictList["GaodeMapChinaAreas"] = areaJsonSvc.GetGaodeMapChinaAreas()
  1422. dictList["CountryList"] = areaJsonSvc.GetCountryList()
  1423. //获取我创建的所有公司
  1424. var list []supplier.OilSupplier
  1425. if this.User.IsCompanyUser == 1 {
  1426. svcSupplier := supplier.GetOilSupplierService(utils.DBE)
  1427. supplierWhere := " CreateUserId = '" + this.User.Id + "'"
  1428. svcSupplier.GetEntitysByWhere(OilSupplierName, supplierWhere, &list)
  1429. dictList["CompanyNames"] = list
  1430. } else { //二级单位不用获取
  1431. dictList["CompanyNames"] = list
  1432. }
  1433. // 部门
  1434. orgsvc := organize.GetOrganizeService(utils.DBE)
  1435. dictList["Organizes"] = orgsvc.GetCollectionDetailviewlist("'" + this.User.AccCode + "'")
  1436. //var dictCustomer []svccustomer.Customer
  1437. //customerSvc.GetEntitysByWhere(this.User.AccCode + CustomerName, "", &dictCustomer)
  1438. //dictList["EntrustCorp"] = &dictCustomer
  1439. //获得有审核权限的人员
  1440. var users []userRole.Base_RoleList
  1441. var auditWorkflow auditsetting.Base_OilAuditSetting
  1442. rsvc := auditsetting.GetOilAuditSettingService(utils.DBE)
  1443. rsvc.GetAuditStepRoleEntity(OilAuditSettingName, this.User.DepartmentId, workflow.SECOND_TRIAL, &auditWorkflow)
  1444. users = rsvc.GetUserByRole(strconv.Itoa(auditWorkflow.RoleId), this.User.AccCode) //
  1445. dictList["Auditer"] = users
  1446. var datainfo DataInfo
  1447. datainfo.Items = dictList
  1448. this.Data["json"] = &datainfo
  1449. this.ServeJSON()
  1450. }
  1451. // @Title 获取字典列表By Status
  1452. // @Description get user by token
  1453. // @Success 200 {object} map[string]interface{}
  1454. // @router /dictlistbystatus/ [get]
  1455. func (this *OilSupplierController) GetDictListByStatus() {
  1456. //status := this.Ctx.Input.Param(":status")
  1457. status := this.GetString("status")
  1458. majorAduit := this.GetString("majorAduit")
  1459. dictList := make(map[string]interface{})
  1460. dictSvc := items.GetItemsService(utils.DBE)
  1461. userSvc := baseUser.GetBaseUserService(utils.DBE)
  1462. areaJsonSvc := areajson.GetAreaJsonService(utils.DBE)
  1463. orgsvc := organize.GetOrganizeService(utils.DBE)
  1464. svc := supplier.GetOilSupplierService(utils.DBE)
  1465. //customerSvc := svccustomer.GetCustomerService(utils.DBE)
  1466. dictList["ManagementUnit"] = dictSvc.GetKeyValueItems("ManagementUnit")
  1467. dictList["UnitRelation"] = dictSvc.GetKeyValueItems("UnitRelation")
  1468. dictList["CompanyType"] = dictSvc.GetKeyValueItems("CompanyType")
  1469. dictList["InOptions"] = dictSvc.GetKeyValueItems("InOptions")
  1470. dictList["OperType"] = dictSvc.GetKeyValueItems("OperType")
  1471. dictList["CurrencyType"] = dictSvc.GetKeyValueItems("CurrencyType")
  1472. var userEntity userRole.Base_User
  1473. userSvc.GetEntityById(this.User.Id, &userEntity)
  1474. dictList["Supervisers"] = userSvc.GetUserListByDepartmentId(this.User.AccCode, userEntity.Departmentid)
  1475. dictList["GaodeMapChinaAreas"] = areaJsonSvc.GetGaodeMapChinaAreas()
  1476. dictList["CountryList"] = areaJsonSvc.GetCountryList()
  1477. //获取专业审批处室部门
  1478. var preorglist []organize.Base_Organizetree
  1479. ids := orgsvc.GetAllChildUnitById("0")
  1480. svc.GetProOrTreeList(ids, &preorglist)
  1481. dictList["ProOrgList"] = preorglist
  1482. //获取我创建的所有公司
  1483. var list []supplier.OilSupplier
  1484. if this.User.IsCompanyUser == 1 {
  1485. svcSupplier := supplier.GetOilSupplierService(utils.DBE)
  1486. supplierWhere := " CreateUserId = '" + this.User.Id + "'"
  1487. svcSupplier.GetEntitysByWhere(OilSupplierName, supplierWhere, &list)
  1488. dictList["CompanyNames"] = list
  1489. } else { //二级单位不用获取
  1490. dictList["CompanyNames"] = list
  1491. }
  1492. // 部门
  1493. dictList["Organizes"] = orgsvc.GetCollectionDetailviewlist("'" + this.User.AccCode + "'")
  1494. //var dictCustomer []svccustomer.Customer
  1495. //customerSvc.GetEntitysByWhere(this.User.AccCode + CustomerName, "", &dictCustomer)
  1496. //dictList["EntrustCorp"] = &dictCustomer
  1497. //获得有审核权限的人员
  1498. //var users []suppliercert.UserList
  1499. //rsvc := auditsetting.GetOilAuditSettingService(utils.DBE)
  1500. certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
  1501. var users []userRole.Base_RoleList
  1502. if status == suppliercert.FIRST_TRIAL_STATUS {
  1503. //rsvc.GetAuditStepRoleEntity(OilAuditSettingName, this.User.DepartmentId, workflow.SECOND_TRIAL, &auditWorkflow)
  1504. //users = rsvc.GetUserByRole(strconv.Itoa(auditWorkflow.RoleId), this.User.AccCode) //
  1505. //where := "OrganizeId=" + this.User.DepartmentId + " and AuditStepCode='" + workflow.SECOND_TRIAL + "'"
  1506. //rsvc.GetEntitysByWhere(OilAuditSettingName, where, &users)
  1507. certSrv.GetAuditUser(this.User.DepartmentId, workflow.SECOND_TRIAL, &users)
  1508. dictList["Auditer"] = users
  1509. } else if status == suppliercert.SECOND_TRIAL_STATUS {
  1510. //rsvc.GetAuditStepRoleEntity(OilAuditSettingName, this.User.DepartmentId, workflow.SECOND_TRIAL, &auditWorkflow)
  1511. } else if status == suppliercert.THIRD_TRIAL_STATUS {
  1512. //where := "OrganizeId=" + majorAduit + " and AuditStepCode='" + workflow.SECOND_TRIAL + "'"
  1513. //rsvc.GetEntitysByWhere(OilAuditSettingName, where, &users)
  1514. certSrv.GetAuditUser(majorAduit, workflow.SECOND_TRIAL, &users)
  1515. dictList["Auditer"] = users
  1516. } else if status == suppliercert.PROF_AUDIT_STATUS {
  1517. //where := "OrganizeId=" + this.User.DepartmentId + " and AuditStepCode='" + workflow.PROF_AUDIT + "'"
  1518. //rsvc.GetEntitysByWhere(OilAuditSettingName, where, &users)
  1519. certSrv.GetAuditUser(this.User.DepartmentId, workflow.PROF_AUDIT, &users)
  1520. dictList["Auditer"] = users
  1521. } else if status == suppliercert.CENT_AUDIT_STATUS {
  1522. }
  1523. // 获取当
  1524. var datainfo DataInfo
  1525. datainfo.Items = dictList
  1526. this.Data["json"] = &datainfo
  1527. this.ServeJSON()
  1528. }
  1529. // @Title 获取实体
  1530. // @Description 获取实体
  1531. // @Success 200 {object} supplier.OilSupplier
  1532. // @router /get/:id [get]
  1533. func (this *OilSupplierController) GetEntity() {
  1534. Id := this.Ctx.Input.Param(":id")
  1535. var model supplier.OilSupplier
  1536. svc := supplier.GetOilSupplierService(utils.DBE)
  1537. svc.GetEntityByIdBytbl(OilSupplierName, Id, &model)
  1538. this.Data["json"] = &model
  1539. this.ServeJSON()
  1540. }
  1541. // @Title 获取实体
  1542. // @Description 获取实体
  1543. // @Success 200 {object} supplier.OilSupplier
  1544. // @router /getandcert/:certId [get]
  1545. func (this *OilSupplierController) GetEntityAndCert() {
  1546. Id := this.Ctx.Input.Param(":certId")
  1547. var model supplier.OilSupplierView
  1548. //svc := supplier.GetOilSupplierService(utils.DBE)
  1549. //svc.GetEntityByIdBytbl(OilSupplierName, Id, &model)
  1550. var sql string
  1551. sql = `select a.*, b.Id as CertId, b.AccessCardNo, b.SupplierTypeCode, b.SupplierTypeName, b.Step, b.WorkerTotal, b.ContractNum, b.UniversityNum, b.TechnicalNum, b.AboveProfNum,
  1552. b.MiddleProfNum, b.NationalRegNum, b.NationalCertTotal, b.DesignerTotal, b.SkillerTotal, b.InStyle, b.WorkflowId, b.Status, b.ThirdAudit, b.BusinessKey, b.AuditIndex from ` + OilSupplierName + ` a `
  1553. sql += ` left join ` + OilSupplierCertName + " b on b.SupplierId = a.Id"
  1554. sql += ` where b.Id ='` + Id + `'`
  1555. utils.DBE.SQL(sql).Get(&model)
  1556. this.Data["json"] = &model
  1557. this.ServeJSON()
  1558. }
  1559. // @Title 获取实体
  1560. // @Description 获取实体
  1561. // @Success 200 {object} supplier.OilSupplier
  1562. // @router /getbyname/:name [get]
  1563. func (this *OilSupplierController) GetEntityByName() {
  1564. name := this.Ctx.Input.Param(":name")
  1565. var model supplier.OilSupplier
  1566. svc := supplier.GetOilSupplierService(utils.DBE)
  1567. where := "SupplierName='" + name + "'"
  1568. svc.GetEntityByWhere(OilSupplierName, where, &model)
  1569. this.Data["json"] = &model
  1570. this.ServeJSON()
  1571. }
  1572. // @Title 添加
  1573. // @Description 新增
  1574. // @Success 200 {object} controllers.Request
  1575. // @router /add [post]
  1576. func (this *OilSupplierController) AddEntity() {
  1577. var model supplier.OilSupplier
  1578. var modelCert suppliercert.OilSupplierCert
  1579. var modelCertVM suppliercert.OilSupplierVM
  1580. var jsonBlob = this.Ctx.Input.RequestBody
  1581. json.Unmarshal(jsonBlob, &model)
  1582. json.Unmarshal(jsonBlob, &modelCertVM)
  1583. serviceCert := suppliercert.GetOilSupplierCertService(utils.DBE)
  1584. canApply := serviceCert.IsCanApplyByExtOrganizeUser(modelCertVM.SupplierTypeCode, this.User.DepartmentId, this.User.Id, this.User.IsCompanyUser)
  1585. var errinfo ErrorDataInfo
  1586. if !canApply {
  1587. errinfo.Message = "添加失败!供方用户只能申请一次"
  1588. errinfo.Code = -1
  1589. this.Data["json"] = &errinfo
  1590. this.ServeJSON()
  1591. return
  1592. }
  1593. var list []supplier.OilSupplierView
  1594. service := supplier.GetOilSupplierService(utils.DBE)
  1595. if model.Id <= 0 {
  1596. service.CheckRepeatApplyInfo(OilSupplierName, OilSupplierCertName, modelCertVM.SupplierTypeCode, model.SupplierName, model.CommercialNo, model.OrganCode, model.BankAccount, model.CompanyUrl, &list)
  1597. if len(list) > 0 {
  1598. errinfo.Message = "添加失败! 已存在相关企业的信息,不能重复申请"
  1599. errinfo.Code = -1
  1600. this.Data["json"] = &errinfo
  1601. this.ServeJSON()
  1602. return
  1603. }
  1604. } else {
  1605. service.CheckUpdateRepeatApplyInfo(OilSupplierName, OilSupplierCertName, modelCertVM.SupplierTypeCode, strconv.Itoa(model.Id), model.SupplierName, model.CommercialNo, model.OrganCode, model.BankAccount, model.CompanyUrl, &list)
  1606. if len(list) > 0 {
  1607. errinfo.Message = "添加失败! 已存在相关企业的信息,或与其他企业信息重复"
  1608. errinfo.Code = -1
  1609. this.Data["json"] = &errinfo
  1610. this.ServeJSON()
  1611. return
  1612. }
  1613. }
  1614. var session *xorm.Session
  1615. session = utils.DBE.NewSession()
  1616. svc := supplier.GetOilSupplierSession(session)
  1617. svcCert := suppliercert.GetOilSupplierCertSession(session)
  1618. model.CreateOn = time.Now()
  1619. model.CreateBy = this.User.Realname
  1620. model.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
  1621. //model.OrganizeId, _ = utils.StrTo(this.User.DepartmentId).Int()
  1622. defer session.Close()
  1623. err := session.Begin()
  1624. if model.Id <= 0 {
  1625. _, err = svc.InsertEntityBytbl(OilSupplierName, &model)
  1626. } else {
  1627. //判断基本信息是否可修改
  1628. updateCols := svc.GetUpdateCols(OilSupplierCertName, modelCertVM.SupplierTypeCode, model.Id)
  1629. err = svc.UpdateEntityBytbl(OilSupplierName, model.Id, &model, updateCols)
  1630. }
  1631. if err != nil {
  1632. session.Rollback()
  1633. }
  1634. modelCert.SupplierId = model.Id
  1635. modelCert.SupplierTypeCode = modelCertVM.SupplierTypeCode
  1636. modelCert.SupplierTypeName = modelCertVM.SupplierTypeName
  1637. modelCert.InStyle = modelCertVM.InStyle
  1638. modelCert.Step = 1 //企业信息保存完成
  1639. modelCert.CreateOn = time.Now()
  1640. modelCert.CreateBy = this.User.Realname
  1641. modelCert.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
  1642. _, err = svcCert.InsertEntityBytbl(OilSupplierCertName, &modelCert)
  1643. if err != nil {
  1644. session.Rollback()
  1645. }
  1646. // add Commit() after all actions
  1647. err = session.Commit()
  1648. if err == nil {
  1649. //新增
  1650. errinfo.Message = "添加成功!"
  1651. errinfo.Code = 0
  1652. errinfo.Item = strconv.Itoa(model.Id) + "_" + strconv.Itoa(modelCert.Id)
  1653. this.Data["json"] = &errinfo
  1654. this.ServeJSON()
  1655. } else {
  1656. errinfo.Message = "添加失败!" + utils.AlertProcess(err.Error())
  1657. errinfo.Code = -1
  1658. this.Data["json"] = &errinfo
  1659. this.ServeJSON()
  1660. }
  1661. }
  1662. // @Title 修改实体
  1663. // @Description 修改实体
  1664. // @Success 200 {object} controllers.Request
  1665. // @router /update/:id/:type [post]
  1666. func (this *OilSupplierController) UpdateEntity() {
  1667. id := this.Ctx.Input.Param(":id")
  1668. typeCode := this.Ctx.Input.Param(":type")
  1669. var errinfo ErrorInfo
  1670. if id == "" {
  1671. errinfo.Message = "操作失败!请求信息不完整"
  1672. errinfo.Code = -2
  1673. this.Data["json"] = &errinfo
  1674. this.ServeJSON()
  1675. return
  1676. }
  1677. var model supplier.OilSupplier
  1678. var jsonBlob = this.Ctx.Input.RequestBody
  1679. json.Unmarshal(jsonBlob, &model)
  1680. var list []supplier.OilSupplierView
  1681. service := supplier.GetOilSupplierService(utils.DBE)
  1682. service.CheckUpdateRepeatApplyInfo(OilSupplierName, OilSupplierCertName, typeCode, strconv.Itoa(model.Id), model.SupplierName, model.CommercialNo, model.OrganCode, model.BankAccount, model.CompanyUrl, &list)
  1683. if len(list) > 0 {
  1684. errinfo.Message = "修改失败! 已存在相关企业的信息,或与其他企业信息重复"
  1685. errinfo.Code = -1
  1686. this.Data["json"] = &errinfo
  1687. this.ServeJSON()
  1688. return
  1689. }
  1690. svc := supplier.GetOilSupplierService(utils.DBE)
  1691. model.ModifiedOn = time.Now()
  1692. model.ModifiedBy = this.User.Realname
  1693. model.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
  1694. //判断基本信息是否可修改
  1695. updateCols := svc.GetUpdateCols(OilSupplierCertName, typeCode, model.Id)
  1696. err := svc.UpdateEntityBytbl(OilSupplierName, id, &model, updateCols)
  1697. if err == nil {
  1698. errinfo.Message = "修改成功!"
  1699. errinfo.Code = 0
  1700. this.Data["json"] = &errinfo
  1701. this.ServeJSON()
  1702. } else {
  1703. errinfo.Message = "修改失败!" + utils.AlertProcess(err.Error())
  1704. errinfo.Code = -1
  1705. this.Data["json"] = &errinfo
  1706. this.ServeJSON()
  1707. }
  1708. }
  1709. // @Title 修改企业人员情况实体
  1710. // @Description 修改实体
  1711. // @Success 200 {object} controllers.Request
  1712. // @router /updatenumber/:id [post]
  1713. func (this *OilSupplierController) UpdateNumberEntity() {
  1714. idGroup := this.Ctx.Input.Param(":id")
  1715. //id := strings.Split(idGroup, "_")[0]
  1716. certId := strings.Split(idGroup, "_")[1]
  1717. var errinfo ErrorInfo
  1718. if certId == "" {
  1719. errinfo.Message = "操作失败!请求信息不完整"
  1720. errinfo.Code = -2
  1721. this.Data["json"] = &errinfo
  1722. this.ServeJSON()
  1723. return
  1724. }
  1725. var modelCert suppliercert.OilSupplierCert
  1726. svcCert := suppliercert.GetOilSupplierCertService(utils.DBE)
  1727. var jsonBlob = this.Ctx.Input.RequestBody
  1728. json.Unmarshal(jsonBlob, &modelCert)
  1729. modelCert.ModifiedOn = time.Now()
  1730. modelCert.ModifiedBy = this.User.Realname
  1731. modelCert.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
  1732. colcerts := []string{
  1733. "Id",
  1734. "InStyle",
  1735. "WorkerTotal",
  1736. "ContractNum ",
  1737. "UniversityNum",
  1738. "TechnicalNum",
  1739. "AboveProfNum",
  1740. "MiddleProfNum",
  1741. "NationalRegNum",
  1742. "NationalCertTotal",
  1743. "DesignerTotal",
  1744. "SkillerTotal",
  1745. "ModifiedOn",
  1746. "ModifiedUserId",
  1747. "ModifiedBy",
  1748. }
  1749. // if modelCert.Step <= 2 {
  1750. // modelCert.Step = 2 //完成企业基本信息
  1751. // colcerts = append(colcerts, "Step")
  1752. // }
  1753. err := svcCert.UpdateEntityBytbl(OilSupplierCertName, certId, &modelCert, colcerts)
  1754. if err == nil {
  1755. errinfo.Message = "保存成功!"
  1756. errinfo.Code = 0
  1757. this.Data["json"] = &errinfo
  1758. this.ServeJSON()
  1759. } else {
  1760. errinfo.Message = "保存失败!" + utils.AlertProcess(err.Error())
  1761. errinfo.Code = -1
  1762. this.Data["json"] = &errinfo
  1763. this.ServeJSON()
  1764. }
  1765. }
  1766. // @Title 删除单条信息
  1767. // @Description
  1768. // @Success 200 {object} ErrorInfo
  1769. // @Failure 403 :id 为空
  1770. // @router /delete/:Id [delete]
  1771. func (this *OilSupplierController) DeleteEntity() {
  1772. Id := this.Ctx.Input.Param(":Id")
  1773. var errinfo ErrorInfo
  1774. if Id == "" {
  1775. errinfo.Message = "操作失败!请求信息不完整"
  1776. errinfo.Code = -2
  1777. this.Data["json"] = &errinfo
  1778. this.ServeJSON()
  1779. return
  1780. }
  1781. var model supplier.OilSupplier
  1782. var entityempty supplier.OilSupplier
  1783. svc := supplier.GetOilSupplierService(utils.DBE)
  1784. opdesc := "删除-" + Id
  1785. err := svc.DeleteOperationAndWriteLogBytbl(OilSupplierName, BaseOperationLogName, Id, &model, &entityempty, utils.ToStr(this.User.Id), this.User.Username, opdesc, this.User.AccCode, "钻井日报")
  1786. if err == nil {
  1787. errinfo.Message = "删除成功"
  1788. errinfo.Code = 0
  1789. this.Data["json"] = &errinfo
  1790. this.ServeJSON()
  1791. } else {
  1792. errinfo.Message = "删除失败!" + utils.AlertProcess(err.Error())
  1793. errinfo.Code = -1
  1794. this.Data["json"] = &errinfo
  1795. this.ServeJSON()
  1796. }
  1797. }
  1798. // @Title 判断是否可以申请准入
  1799. // @Description
  1800. // @Success 200 {string} Count
  1801. // @Failure 403 :id 为空
  1802. // @router /iscanapply/:type [get]
  1803. func (this *OilSupplierController) IsCanApply() {
  1804. Type := this.Ctx.Input.Param(":type")
  1805. var errinfo ErrorInfo
  1806. if Type == "" {
  1807. errinfo.Message = "操作失败!请求信息不完整"
  1808. errinfo.Code = -2
  1809. this.Data["json"] = &errinfo
  1810. this.ServeJSON()
  1811. return
  1812. }
  1813. svc := suppliercert.GetOilSupplierCertService(utils.DBE)
  1814. canApply := svc.IsCanApplyByExtOrganizeUser(Type, this.User.DepartmentId, this.User.Id, this.User.IsCompanyUser)
  1815. if canApply {
  1816. errinfo.Message = "无申请记录,可以申请"
  1817. errinfo.Code = 0
  1818. this.Data["json"] = &errinfo
  1819. this.ServeJSON()
  1820. } else {
  1821. errinfo.Message = "供方用户只能申请一次"
  1822. errinfo.Code = -1
  1823. this.Data["json"] = &errinfo
  1824. this.ServeJSON()
  1825. }
  1826. }
  1827. // @Title 判断是否可以修改供方企业信息
  1828. // @Description
  1829. // @Success 200 {string} Count
  1830. // @Failure 403 :id 为空
  1831. // @router /iscanupdatesupplier/:supplierid [get]
  1832. func (this *OilSupplierController) CanUpdateSupplier() {
  1833. supplierId := this.Ctx.Input.Param(":supplierid")
  1834. var errinfo ErrorInfo
  1835. if supplierId == "" {
  1836. errinfo.Message = "操作失败!请求信息不完整"
  1837. errinfo.Code = -2
  1838. this.Data["json"] = &errinfo
  1839. this.ServeJSON()
  1840. return
  1841. }
  1842. Id, _ := strconv.Atoi(supplierId)
  1843. svc := supplier.GetOilSupplierService(utils.DBE)
  1844. canUpdate := svc.CanUpdateSupplier(OilSupplierCertName, Id)
  1845. if canUpdate {
  1846. errinfo.Message = "可以修改"
  1847. errinfo.Code = 0
  1848. this.Data["json"] = &errinfo
  1849. this.ServeJSON()
  1850. } else {
  1851. errinfo.Message = "此供方已经提交准入申请,不可修改"
  1852. errinfo.Code = -1
  1853. this.Data["json"] = &errinfo
  1854. this.ServeJSON()
  1855. }
  1856. }
  1857. // @Title 获取二级审核人员
  1858. // @Description 获取二级审核人员
  1859. // @router /getauditerbydept/:deptId [get]
  1860. func (this *OilSupplierController) GetAuditerByDept() {
  1861. Id := this.Ctx.Input.Param(":deptId")
  1862. auditstepcode := this.GetString("auditstepcode")
  1863. svc := organize.GetOrganizeService(utils.DBE)
  1864. unitId := svc.GetMyUnitDepartmentId(Id)
  1865. ids := svc.GetAllChildById(unitId)
  1866. //var org organize.Base_Organize
  1867. //svc := organize.GetOrganizeService(utils.DBE)
  1868. //has := svc.GetEntityById(Id, &org)
  1869. //ids := Id
  1870. //if has && org.Category == "unit" {
  1871. // ids = svc.GetAllChildById(Id)
  1872. //}
  1873. //var auditWorkflow []auditsetting.Base_OilAuditSetting
  1874. //rsvc := auditsetting.GetOilAuditSettingService(utils.DBE)
  1875. //rsvc.GetAuditStepRoleEntity(OilAuditSettingName, Id, workflow.FIRST_TRIAL, &auditWorkflow)
  1876. //var auditset []auditsetting.Base_OilAuditSetting
  1877. //where := "OrganizeId=" + Id + " and AuditStepCode='" + auditstepcode + "'"
  1878. //rsvc.GetEntitysByWhere(OilAuditSettingName, where, &auditset)
  1879. //var users []userRole.Base_RoleList
  1880. //if auditset != nil {
  1881. // svc := auditsetting.GetOilAuditSettingService(utils.DBE)
  1882. // svc.GetAuditUserList(strconv.Itoa(auditset[0].Id), &users)
  1883. //}
  1884. certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
  1885. var users []userRole.Base_RoleList
  1886. certSrv.GetAuditUser(ids, auditstepcode, &users)
  1887. var datainfo ErrorDataInfo
  1888. datainfo.Item = users
  1889. this.Data["json"] = &datainfo
  1890. this.ServeJSON()
  1891. }
  1892. // @Title 获取二级初审人员
  1893. // @Description 获取二级初审人员
  1894. // @router /getfirauditerbydept/:deptId [get]
  1895. func (this *OilSupplierController) GetFirAuditerByDept() {
  1896. Id := this.Ctx.Input.Param(":deptId")
  1897. auditstepcode := this.GetString("auditstepcode")
  1898. svc := organize.GetOrganizeService(utils.DBE)
  1899. ids := svc.GetAllChildById(Id)
  1900. certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
  1901. var users []userRole.Base_RoleList
  1902. certSrv.GetAuditUser(ids, auditstepcode, &users)
  1903. var datainfo ErrorDataInfo
  1904. datainfo.Item = users
  1905. this.Data["json"] = &datainfo
  1906. this.ServeJSON()
  1907. }
  1908. // @Title 获取二级复审人员根据初审人员
  1909. // @Description 获取二级复审人员根据初审人员
  1910. // @router /getauditerbyfirst/:firstId [get]
  1911. func (this *OilSupplierController) GetAuditerByFist() {
  1912. Id := this.Ctx.Input.Param(":firstId")
  1913. auditstepcode := this.GetString("auditstepcode")
  1914. certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
  1915. //orgSrv := organize.GetOrganizeService(utils.DBE)
  1916. var userentity userRole.Base_User
  1917. certSrv.GetEntityById(Id, &userentity)
  1918. svc := organize.GetOrganizeService(utils.DBE)
  1919. unitId := svc.GetMyUnitDepartmentId(userentity.Departmentid)
  1920. ids := svc.GetAllChildById(unitId)
  1921. //depId := strings.Split(userentity.Superior,",")
  1922. var users []userRole.Base_RoleList
  1923. certSrv.GetAuditUser(ids, auditstepcode, &users)
  1924. var datainfo ErrorDataInfo
  1925. datainfo.Item = users
  1926. this.Data["json"] = &datainfo
  1927. this.ServeJSON()
  1928. }
  1929. // @Title 获取二级初审人员(不需要验证登录)
  1930. // @Description 获取二级初审人员(不需要验证登录)
  1931. // @router /getauditerbydeptandnologin [get]
  1932. func (this *OilSupplierController) GetAuditerByDeptAndNoLogin() {
  1933. Id := this.GetString("deptId")
  1934. auditstepcode := this.GetString("auditstepcode")
  1935. certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
  1936. var users []userRole.Base_RoleList
  1937. certSrv.GetAuditUser(Id, auditstepcode, &users)
  1938. // certSrv.GetAuditUserByNoLogin(Id, &users)
  1939. var datainfo ErrorDataInfo
  1940. datainfo.Item = users
  1941. this.Data["json"] = &datainfo
  1942. this.ServeJSON()
  1943. }