english_report.go 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009
  1. package models
  2. import (
  3. "errors"
  4. "eta/eta_mobile/utils"
  5. "fmt"
  6. "github.com/beego/beego/v2/client/orm"
  7. "github.com/rdlucklib/rdluck_tools/paging"
  8. "strings"
  9. "time"
  10. )
  11. type EnglishReport struct {
  12. Id int `orm:"column(id)" description:"报告Id"`
  13. AddType int `description:"新增方式:1:新增报告,2:继承报告"`
  14. ClassifyIdFirst int `description:"一级分类id"`
  15. ClassifyNameFirst string `description:"一级分类名称"`
  16. ClassifyIdSecond int `description:"二级分类id"`
  17. ClassifyNameSecond string `description:"二级分类名称"`
  18. Title string `description:"标题"`
  19. Abstract string `description:"摘要"`
  20. Author string `description:"作者"`
  21. Frequency string `description:"频度"`
  22. CreateTime string `description:"创建时间"`
  23. ModifyTime time.Time `description:"修改时间"`
  24. State int `description:"1:未发布;2:已发布;3-待提交;4-待审批;5-已驳回;6-已通过"`
  25. PublishTime time.Time `description:"发布时间"`
  26. PrePublishTime time.Time `description:"预发布时间"`
  27. Stage int `description:"期数"`
  28. Content string `description:"内容"`
  29. VideoUrl string `description:"音频文件URL"`
  30. VideoName string `description:"音频文件名称"`
  31. VideoPlaySeconds string `description:"音频播放时长"`
  32. VideoSize string `description:"音频文件大小,单位M"`
  33. ContentSub string `description:"内容前两个章节"`
  34. ReportCode string `description:"报告唯一编码"`
  35. Pv int `description:"Pv"`
  36. PvEmail int `description:"邮箱PV"`
  37. UvEmail int `description:"邮箱UV"`
  38. EmailState int `description:"群发邮件状态: 0-未发送; 1-已发送"`
  39. Overview string `description:"英文概述部分"`
  40. KeyTakeaways string `description:"关键点"`
  41. FromReportId int `description:"继承的报告ID(英文策略报告ID)"`
  42. AdminId int `description:"创建者账号"`
  43. AdminRealName string `description:"创建者姓名"`
  44. ApproveTime time.Time `description:"审批时间"`
  45. ApproveId int `description:"审批ID"`
  46. DetailImgUrl string `description:"报告详情长图地址"`
  47. DetailPdfUrl string `description:"报告详情PDF地址"`
  48. DetailImgUrlMobile string `description:"报告详情长图地址-手机端"`
  49. DetailPdfUrlMobile string `description:"报告详情PDF地址-手机端"`
  50. EmailHasFail int `description:"是否存在邮件发送失败的记录: 0-否; 1-是"`
  51. }
  52. func GetEnglishReportStage(classifyIdFirst, classifyIdSecond int) (count int, err error) {
  53. o := orm.NewOrmUsingDB("rddp")
  54. sql := ``
  55. if classifyIdSecond > 0 {
  56. sql = "SELECT MAX(stage) AS max_stage FROM english_report WHERE classify_id_second=? "
  57. o.Raw(sql, classifyIdSecond).QueryRow(&count)
  58. } else {
  59. sql = "SELECT MAX(stage) AS max_stage FROM english_report WHERE classify_id_first=? "
  60. o.Raw(sql, classifyIdFirst).QueryRow(&count)
  61. }
  62. return
  63. }
  64. func GetEnglishReportStageEdit(classifyIdFirst, classifyIdSecond, reportId int) (count int, err error) {
  65. o := orm.NewOrmUsingDB("rddp")
  66. sql := ``
  67. if classifyIdSecond > 0 {
  68. sql = "SELECT MAX(stage) AS max_stage FROM english_report WHERE classify_id_second=? AND id<>? "
  69. o.Raw(sql, classifyIdSecond, reportId).QueryRow(&count)
  70. } else {
  71. sql = "SELECT MAX(stage) AS max_stage FROM english_report WHERE classify_id_first=? AND id<>? "
  72. o.Raw(sql, classifyIdFirst, reportId).QueryRow(&count)
  73. }
  74. return
  75. }
  76. func AddEnglishReport(item *EnglishReport) (lastId int64, err error) {
  77. o := orm.NewOrmUsingDB("rddp")
  78. lastId, err = o.Insert(item)
  79. return
  80. }
  81. func ModifyEnglishReportCode(reportId int64, reportCode string) (err error) {
  82. o := orm.NewOrmUsingDB("rddp")
  83. sql := `UPDATE english_report SET report_code=? WHERE id=? `
  84. _, err = o.Raw(sql, reportCode, reportId).Exec()
  85. return
  86. }
  87. type AddEnglishReportReq struct {
  88. AddType int `description:"新增方式:1:新增报告,2:继承报告"`
  89. ClassifyIdFirst int `description:"一级分类id"`
  90. ClassifyNameFirst string `description:"一级分类名称"`
  91. ClassifyIdSecond int `description:"二级分类id"`
  92. ClassifyNameSecond string `description:"二级分类名称"`
  93. ClassifyIdThird int `description:"三级分类id"`
  94. ClassifyNameThird string `description:"三级分类名称"`
  95. Title string `description:"标题"`
  96. Abstract string `description:"摘要"`
  97. Author string `description:"作者"`
  98. Frequency string `description:"频度"`
  99. State int `description:"状态:1:未发布,2:已发布"`
  100. Content string `description:"内容"`
  101. CreateTime string `description:"创建时间"`
  102. Overview string `description:"英文概述部分"`
  103. }
  104. type AddEnglishReportResp struct {
  105. ReportId int64 `description:"报告id"`
  106. ReportCode string `description:"报告code"`
  107. }
  108. type EditEnglishReportReq struct {
  109. ReportId int64 `description:"报告id"`
  110. ClassifyIdFirst int `description:"一级分类id"`
  111. ClassifyNameFirst string `description:"一级分类名称"`
  112. ClassifyIdSecond int `description:"二级分类id"`
  113. ClassifyNameSecond string `description:"二级分类名称"`
  114. Title string `description:"标题"`
  115. Abstract string `description:"摘要"`
  116. Author string `description:"作者"`
  117. Frequency string `description:"频度"`
  118. State int `description:"状态:1:未发布,2:已发布"`
  119. Content string `description:"内容"`
  120. CreateTime string `description:"创建时间"`
  121. Overview string `description:"英文概述部分"`
  122. }
  123. type EditEnglishReportFromPolicyReq struct {
  124. ReportId int64 `description:"报告id"`
  125. Title string `description:"标题"`
  126. Abstract string `description:"摘要"`
  127. Author string `description:"作者"`
  128. Frequency string `description:"频度"`
  129. CreateTime string `description:"创建时间"`
  130. //Overview string `description:"英文概述部分"`
  131. }
  132. type EditEnglishReportResp struct {
  133. ReportId int64 `description:"报告id"`
  134. ReportCode string `description:"报告code"`
  135. }
  136. type ElasticEnglishReportDetail struct {
  137. Id string `description:"报告id或者线上路演Id"`
  138. ReportId int `description:"报告id"`
  139. VideoId int `description:"线上路演Id"`
  140. ClassifyIdFirst int `description:"一级分类id"`
  141. ClassifyNameFirst string `description:"一级分类名称"`
  142. ClassifyIdSecond int `description:"二级分类id"`
  143. ClassifyNameSecond string `description:"二级分类名称"`
  144. StageStr string `description:"报告期数"`
  145. Title string `description:"标题"`
  146. Abstract string `description:"摘要"`
  147. Author string `description:"作者"`
  148. Frequency string `description:"频度"`
  149. PublishState int `description:"状态:1:未发布,2:已发布"`
  150. BodyContent string `description:"内容"`
  151. ContentSub string `description:"前两段内容"`
  152. CreateTime string `description:"创建时间"`
  153. PublishTime string `description:"发布时间"`
  154. ReportCode string `description:"报告唯一编码"`
  155. Overview string `description:"英文概述部分"`
  156. }
  157. func EditEnglishReport(item *EnglishReport, reportId int64) (err error) {
  158. o := orm.NewOrmUsingDB("rddp")
  159. sql := `UPDATE english_report
  160. SET
  161. classify_id_first =?,
  162. classify_name_first = ?,
  163. classify_id_second = ?,
  164. classify_name_second = ?,
  165. title = ?,
  166. abstract = ?,
  167. author = ?,
  168. frequency = ?,
  169. state = ?,
  170. content = ?,
  171. content_sub = ?,
  172. stage =?,
  173. create_time = ?,
  174. modify_time = ?,
  175. overview = ?
  176. WHERE id = ? `
  177. _, err = o.Raw(sql, item.ClassifyIdFirst, item.ClassifyNameFirst, item.ClassifyIdSecond, item.ClassifyNameSecond, item.Title,
  178. item.Abstract, item.Author, item.Frequency, item.State, item.Content, item.ContentSub, item.Stage, item.CreateTime, time.Now(), item.Overview, reportId).Exec()
  179. return
  180. }
  181. type EnglishReportDetail struct {
  182. Id int `orm:"column(id)" description:"报告Id"`
  183. AddType int `description:"新增方式:1:新增报告,2:继承报告"`
  184. ClassifyIdFirst int `description:"一级分类id"`
  185. ClassifyNameFirst string `description:"一级分类名称"`
  186. ClassifyIdSecond int `description:"二级分类id"`
  187. ClassifyNameSecond string `description:"二级分类名称"`
  188. Title string `description:"标题"`
  189. Abstract string `description:"摘要"`
  190. Author string `description:"作者"`
  191. Frequency string `description:"频度"`
  192. CreateTime string `description:"创建时间"`
  193. ModifyTime string `description:"修改时间"`
  194. State int `description:"1:未发布,2:已发布"`
  195. PublishTime string `description:"发布时间"`
  196. PrePublishTime string `description:"预发布时间"`
  197. Stage int `description:"期数"`
  198. MsgIsSend int `description:"消息是否已发送,0:否,1:是"`
  199. ReportCode string `description:"报告唯一编码"`
  200. Content string `description:"内容"`
  201. VideoUrl string `description:"音频文件URL"`
  202. VideoName string `description:"音频文件名称"`
  203. VideoPlaySeconds string `description:"音频播放时长"`
  204. ContentSub string `description:"内容前两个章节"`
  205. Pv int `description:"Pv"`
  206. Overview string `description:"英文概述部分"`
  207. FromReportId int `description:"继承的报告ID(英文策略报告ID)"`
  208. KeyTakeaways string `description:"关键点"`
  209. ClassifyIdRoot int `description:"顶级分类id"`
  210. ClassifyNameRoot string `description:"顶级分类名称"`
  211. }
  212. func GetEnglishReportById(reportId int) (item *EnglishReportDetail, err error) {
  213. o := orm.NewOrmUsingDB("rddp")
  214. sql := `SELECT * FROM english_report WHERE id=?`
  215. err = o.Raw(sql, reportId).QueryRow(&item)
  216. return
  217. }
  218. func GetEnglishReportItemById(reportId int) (item *EnglishReport, err error) {
  219. o := orm.NewOrmUsingDB("rddp")
  220. sql := `SELECT * FROM english_report WHERE id = ? LIMIT 1`
  221. err = o.Raw(sql, reportId).QueryRow(&item)
  222. return
  223. }
  224. type EnglishReportList struct {
  225. Id int `description:"报告Id"`
  226. AddType int `description:"新增方式:1:新增报告,2:继承报告"`
  227. ClassifyIdFirst int `description:"一级分类id"`
  228. ClassifyNameFirst string `description:"一级分类名称"`
  229. ClassifyIdSecond int `description:"二级分类id"`
  230. ClassifyNameSecond string `description:"二级分类名称"`
  231. Title string `description:"标题"`
  232. Abstract string `description:"摘要"`
  233. Author string `description:"作者"`
  234. Frequency string `description:"频度"`
  235. CreateTime string `description:"创建时间"`
  236. ModifyTime time.Time `description:"修改时间"`
  237. State int `description:"1:未发布;2:已发布;3-待提交;4-待审批;5-已驳回;6-已通过"`
  238. PublishTime string `description:"发布时间"`
  239. PrePublishTime string `description:"预发布时间"`
  240. Stage int `description:"期数"`
  241. Content string `description:"内容"`
  242. VideoUrl string `description:"音频文件URL"`
  243. VideoName string `description:"音频文件名称"`
  244. VideoPlaySeconds string `description:"音频播放时长"`
  245. ContentSub string `description:"内容前两个章节"`
  246. ReportCode string `description:"报告唯一编码"`
  247. Pv int `description:"Pv"`
  248. ShareUrl string `description:"分享url"`
  249. PvEmail int `description:"邮箱PV"`
  250. UvEmail int `description:"邮箱UV"`
  251. EmailState int `description:"群发邮件状态: 0-未发送; 1-已发送"`
  252. EmailAuth bool `description:"是否有权限群发邮件"`
  253. EmailHasFail bool `description:"是否存在邮件发送失败的记录"`
  254. CanEdit bool `description:"是否可编辑"`
  255. Editor string `description:"编辑人"`
  256. FromReportId int `description:"继承的报告ID(英文策略报告ID)"`
  257. AdminId int `description:"创建者账号"`
  258. AdminRealName string `description:"创建者姓名"`
  259. FullClassifyName string `description:"顶级分类名/父级分类名/当前分类名"`
  260. ClassifyIdRoot int `description:"顶级分类id"`
  261. ClassifyNameRoot string `description:"顶级分类名称"`
  262. ApproveTime string `description:"审批时间"`
  263. DetailImgUrl string `description:"报告详情长图地址"`
  264. DetailPdfUrl string `description:"报告详情PDF地址"`
  265. }
  266. type EnglishReportListResp struct {
  267. List []*EnglishReportList
  268. Paging *paging.PagingItem `description:"分页数据"`
  269. }
  270. func GetEnglishReportListCount(condition string, pars []interface{}, companyType string) (count int, err error) {
  271. //产品权限
  272. companyTypeSqlStr := ``
  273. if companyType == "ficc" {
  274. companyTypeSqlStr = " AND classify_id_first != 40 "
  275. } else if companyType == "权益" {
  276. companyTypeSqlStr = " AND classify_id_first = 40 "
  277. }
  278. oRddp := orm.NewOrmUsingDB("rddp")
  279. sql := `SELECT COUNT(1) AS count FROM english_report WHERE 1=1 ` + companyTypeSqlStr
  280. if condition != "" {
  281. sql += condition
  282. }
  283. err = oRddp.Raw(sql, pars).QueryRow(&count)
  284. return
  285. }
  286. func GetEnglishReportList(condition string, pars []interface{}, companyType string, startSize, pageSize int, fieldArr []string) (items []*EnglishReport, err error) {
  287. o := orm.NewOrmUsingDB("rddp")
  288. //产品权限
  289. companyTypeSqlStr := ``
  290. if companyType == "ficc" {
  291. companyTypeSqlStr = " AND classify_id_first != 40 "
  292. } else if companyType == "权益" {
  293. companyTypeSqlStr = " AND classify_id_first = 40 "
  294. }
  295. fields := "*"
  296. if len(fieldArr) > 0 {
  297. fields = strings.Join(fieldArr, ",")
  298. }
  299. sql := fmt.Sprintf(`SELECT %s FROM english_report WHERE 1=1 %s `, fields, companyTypeSqlStr)
  300. if condition != "" {
  301. sql += condition
  302. }
  303. // 排序:1:未发布;2:已发布;3-待提交;4-待审批;5-已驳回;6-已通过
  304. sql += ` ORDER BY FIELD(state,3,1,4,5,6,2), modify_time DESC LIMIT ?,?`
  305. _, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
  306. return
  307. }
  308. func GetEnglishReportByCondition(condition string, pars []interface{}) (items []*EnglishReport, err error) {
  309. o := orm.NewOrmUsingDB("rddp")
  310. sql := `SELECT *
  311. FROM english_report WHERE 1=1 `
  312. if condition != "" {
  313. sql += condition
  314. }
  315. _, err = o.Raw(sql, pars).QueryRows(&items)
  316. return
  317. }
  318. func GetEnglishReportCountByCondition(condition string, pars []interface{}) (count int, err error) {
  319. o := orm.NewOrmUsingDB("rddp")
  320. sql := `SELECT count(*)
  321. FROM english_report WHERE 1=1 `
  322. if condition != "" {
  323. sql += condition
  324. }
  325. err = o.Raw(sql, pars).QueryRow(&count)
  326. return
  327. }
  328. // PublishEnglishReportById 发布报告
  329. func PublishEnglishReportById(reportId int, publishTime string) (err error) {
  330. o := orm.NewOrmUsingDB("rddp")
  331. sql := `UPDATE english_report SET state=2,publish_time=?,pre_publish_time=null,modify_time=NOW() WHERE id = ? `
  332. _, err = o.Raw(sql, publishTime, reportId).Exec()
  333. return
  334. }
  335. // ResetEnglishReportById 重置报告状态
  336. func ResetEnglishReportById(reportId, state int) (err error) {
  337. o := orm.NewOrmUsingDB("rddp")
  338. sql := `UPDATE english_report SET state = ?, pre_publish_time = null, modify_time = NOW() WHERE id = ?`
  339. _, err = o.Raw(sql, state, reportId).Exec()
  340. return
  341. }
  342. // PublishCancelEnglishReport 取消发布报告
  343. func PublishCancelEnglishReport(reportIds, state int) (err error) {
  344. o := orm.NewOrmUsingDB("rddp")
  345. sql := ` UPDATE english_report SET state=?, pre_publish_time=null WHERE id =? `
  346. _, err = o.Raw(sql, state, reportIds).Exec()
  347. return
  348. }
  349. // SetPrePublishEnglishReportById 设置定时发布
  350. func SetPrePublishEnglishReportById(reportId int, prePublishTime string) (err error) {
  351. o := orm.NewOrmUsingDB("rddp")
  352. sql := `UPDATE english_report SET pre_publish_time=? WHERE id = ? and state = 1 `
  353. _, err = o.Raw(sql, prePublishTime, reportId).Exec()
  354. return
  355. }
  356. // DeleteEnglishReportAndChapter 删除报告及章节
  357. func DeleteEnglishReportAndChapter(reportInfo *EnglishReportDetail) (err error) {
  358. reportId := reportInfo.Id
  359. if reportInfo.State == 2 {
  360. err = errors.New("报告已发布,不可删除")
  361. return
  362. }
  363. err = DeleteEnglishReport(reportId)
  364. if err != nil {
  365. err = errors.New("删除失败, Err: " + err.Error())
  366. return
  367. }
  368. return
  369. }
  370. // 删除报告
  371. func DeleteEnglishReport(reportIds int) (err error) {
  372. o := orm.NewOrmUsingDB("rddp")
  373. sql := ` DELETE FROM english_report WHERE id =? `
  374. _, err = o.Raw(sql, reportIds).Exec()
  375. return
  376. }
  377. func EditEnglishReportContent(reportId int, content, contentSub string) (err error) {
  378. o := orm.NewOrmUsingDB("rddp")
  379. sql := ` UPDATE english_report SET content=?,content_sub=?,modify_time=NOW() WHERE id=? `
  380. _, err = o.Raw(sql, content, contentSub, reportId).Exec()
  381. return
  382. }
  383. func AddEnglishReportSaveLog(reportId, adminId int, content, contentSub, adminName string) (err error) {
  384. o := orm.NewOrmUsingDB("rddp")
  385. sql := ` INSERT INTO english_report_save_log(report_id, content,content_sub,admin_id,admin_name) VALUES (?,?,?,?,?) `
  386. _, err = o.Raw(sql, reportId, content, contentSub, adminId, adminName).Exec()
  387. return
  388. }
  389. type EnglishClassifyList struct {
  390. Id int `orm:"column(id);pk"`
  391. ClassifyName string `description:"分类名称"`
  392. Sort int `description:"排序"`
  393. ParentId int `description:"父级分类id"`
  394. RootId int `description:"一级分类ID"`
  395. CreateTime time.Time `description:"创建时间"`
  396. ModifyTime time.Time `description:"修改时间"`
  397. ClassifyLabel string `description:"分类标签"`
  398. ShowType int `description:"展示类型:1-列表 2-专栏"`
  399. IsShow int `description:"是否在小程序显示:1-显示 0-隐藏"`
  400. //ClassifyType int `description:"分类类型:0英文报告,1英文线上路演"`
  401. EnPermissions []int `description:"英文权限IDs"`
  402. Enabled int `description:"是否可用,1可用,0禁用"`
  403. Child []*EnglishClassifyList
  404. }
  405. type EnglishClassifyListResp struct {
  406. List []*EnglishClassifyList
  407. }
  408. // GetEnglishClassifyRootId 获取一级分类列表
  409. func GetEnglishClassifyRootId(keyword string, enabled int) (items []*EnglishClassifyList, err error) {
  410. sql := ``
  411. o := orm.NewOrmUsingDB("rddp")
  412. cond := ""
  413. if enabled == 1 {
  414. cond = " AND enabled=1 "
  415. }
  416. if keyword != "" {
  417. sql = `SELECT * FROM (
  418. SELECT * FROM english_classify
  419. WHERE parent_id=0 ` + cond + ` AND classify_name LIKE ?
  420. UNION
  421. SELECT * FROM english_classify
  422. WHERE id IN(SELECT parent_id FROM english_classify
  423. WHERE parent_id>0 ` + cond + ` AND classify_name LIKE ? )
  424. )AS t
  425. ORDER BY sort ASC,create_time ASC`
  426. _, err = o.Raw(sql, utils.GetLikeKeyword(keyword), utils.GetLikeKeyword(keyword)).QueryRows(&items)
  427. } else {
  428. sql = `SELECT * FROM english_classify WHERE parent_id=0 ` + cond + ` ORDER BY sort ASC,create_time ASC `
  429. _, err = o.Raw(sql).QueryRows(&items)
  430. }
  431. return
  432. }
  433. func GetEnglishClassifyListByRootId(rootIds []int, keyword string, enabled int) (items []*EnglishClassifyList, err error) {
  434. sql := ``
  435. pars := make([]interface{}, 0)
  436. o := orm.NewOrmUsingDB("rddp")
  437. cond := ""
  438. if enabled == 1 {
  439. cond = " AND enabled=1 "
  440. }
  441. if keyword != "" {
  442. sql = `SELECT
  443. a.*
  444. FROM
  445. english_classify a
  446. LEFT JOIN english_classify b ON a.root_id = b.id
  447. LEFT JOIN english_classify c ON a.parent_id = c.id
  448. WHERE a.parent_id>0 ` + cond + ` and a.classify_name LIKE ? and a.root_id IN (` + utils.GetOrmInReplace(len(rootIds)) + `)`
  449. pars = append(pars, utils.GetLikeKeyword(keyword))
  450. pars = append(pars, rootIds)
  451. _, err = o.Raw(sql, pars).QueryRows(&items)
  452. } else {
  453. sql = `SELECT * FROM english_classify WHERE parent_id>0 ` + cond + ` and root_id IN (` + utils.GetOrmInReplace(len(rootIds)) + `) `
  454. _, err = o.Raw(sql, rootIds).QueryRows(&items)
  455. }
  456. return
  457. }
  458. func GetEnglishClassifyChildByIds(ids []int) (items []*EnglishClassifyList, err error) {
  459. o := orm.NewOrmUsingDB("rddp")
  460. sql := `SELECT * FROM english_classify WHERE id IN (` + utils.GetOrmInReplace(len(ids)) + `) ORDER BY create_time ASC `
  461. _, err = o.Raw(sql, ids).QueryRows(&items)
  462. return
  463. }
  464. func GetEnglishReportDetailByClassifyId(classifyIdFirst, classifyIdSecond int) (item *EnglishReportDetail, err error) {
  465. o := orm.NewOrmUsingDB("rddp")
  466. sql := ` SELECT * FROM english_report WHERE 1=1 `
  467. if classifyIdSecond > 0 {
  468. sql = sql + ` AND classify_id_second=? ORDER BY stage DESC LIMIT 1`
  469. err = o.Raw(sql, classifyIdSecond).QueryRow(&item)
  470. } else {
  471. sql = sql + ` AND classify_id_first=? ORDER BY stage DESC LIMIT 1`
  472. err = o.Raw(sql, classifyIdFirst).QueryRow(&item)
  473. }
  474. return
  475. }
  476. // Update 更新
  477. func (item *EnglishReport) Update(cols []string) (err error) {
  478. o := orm.NewOrmUsingDB("rddp")
  479. _, err = o.Update(item, cols...)
  480. return
  481. }
  482. // ModifyEnglishReportAuthor 更改英文报告作者
  483. func ModifyEnglishReportAuthor(condition string, pars []interface{}, authorName string) (count int, err error) {
  484. //产品权限
  485. oRddp := orm.NewOrmUsingDB("rddp")
  486. sql := `UPDATE english_report set author = ? WHERE 1=1 `
  487. if condition != "" {
  488. sql += condition
  489. }
  490. err = oRddp.Raw(sql, authorName, pars).QueryRow(&count)
  491. return
  492. }
  493. type EnglishClassify struct {
  494. Id int `orm:"column(id);pk"`
  495. ClassifyName string `description:"分类名称"`
  496. Sort int `description:"排序"`
  497. ParentId int `description:"父级分类id"`
  498. RootId int `description:"一级分类ID"`
  499. CreateTime time.Time `description:"创建时间"`
  500. ModifyTime time.Time `description:"修改时间"`
  501. ClassifyLabel string `description:"分类标签"`
  502. ShowType int `description:"展示类型:1-列表 2-专栏"`
  503. IsShow int `description:"是否在小程序显示:1-显示 0-隐藏"`
  504. //ClassifyType int `description:"分类类型:0英文报告,1英文线上路演"`
  505. Enabled int `description:"是否可用,1可用,0禁用"`
  506. }
  507. func AddEnglishClassify(item *EnglishClassify) (lastId int64, err error) {
  508. o := orm.NewOrmUsingDB("rddp")
  509. lastId, err = o.Insert(item)
  510. return
  511. }
  512. func ModifyEnglishClassify(item *EnglishClassify) (err error) {
  513. o := orm.NewOrmUsingDB("rddp")
  514. sql := `UPDATE english_classify
  515. SET
  516. classify_name = ?,
  517. sort = ?,
  518. parent_id = ?,
  519. root_id = ?,
  520. modify_time = ?
  521. WHERE id = ? `
  522. _, err = o.Raw(sql, item.ClassifyName, item.Sort, item.ParentId, item.RootId, item.ModifyTime, item.Id).Exec()
  523. return
  524. }
  525. // UpdateEnglishClassifyRootIdByParentId 更新报告分类的顶级ID
  526. func UpdateEnglishClassifyRootIdByParentId(parentId, rootId int) (err error) {
  527. o := orm.NewOrmUsingDB("rddp")
  528. sql := " UPDATE english_classify SET root_id = ? WHERE parent_id=? "
  529. _, err = o.Raw(sql, rootId, parentId).Exec()
  530. return
  531. }
  532. // UpdateClassify 更新分类
  533. func (classifyInfo *EnglishClassify) UpdateEnglishClassify(cols []string) (err error) {
  534. o := orm.NewOrmUsingDB("rddp")
  535. _, err = o.Update(classifyInfo, cols...)
  536. return
  537. }
  538. // DeleteEnglishClassify 删除英文分类
  539. func DeleteEnglishClassify(classifyId int) (err error) {
  540. o := orm.NewOrmUsingDB("rddp")
  541. sql := ` DELETE FROM english_classify WHERE id =? `
  542. _, err = o.Raw(sql, classifyId).Exec()
  543. return
  544. }
  545. func GetEnglishClassifyChildCounts(parentId int) (count int, err error) {
  546. o := orm.NewOrmUsingDB("rddp")
  547. sql := `SELECT COUNT(1) AS count FROM english_classify WHERE parent_id=? `
  548. err = o.Raw(sql, parentId).QueryRow(&count)
  549. return
  550. }
  551. func GetEnglishReportCounts(classifyId, parentId int) (count int, err error) {
  552. o := orm.NewOrmUsingDB("rddp")
  553. sql := ``
  554. if parentId == 0 {
  555. sql = `SELECT COUNT(1) AS count FROM english_report WHERE classify_id_first=? `
  556. } else {
  557. sql = `SELECT COUNT(1) AS count FROM english_report WHERE classify_id_second=? `
  558. }
  559. err = o.Raw(sql, classifyId).QueryRow(&count)
  560. return
  561. }
  562. func GetEnglishClassifyCountsByName(name string, parentId int) (count int, err error) {
  563. o := orm.NewOrmUsingDB("rddp")
  564. sql := `SELECT COUNT(1) AS count FROM english_classify WHERE classify_name=? AND parent_id = ? `
  565. err = o.Raw(sql, name, parentId).QueryRow(&count)
  566. return
  567. }
  568. // GetEnglishFirstClassifyList 获取一级、二级分类列表
  569. func GetEnglishFirstClassifyList() (items []*EnglishClassifyList, err error) {
  570. o := orm.NewOrmUsingDB("rddp")
  571. sql := `SELECT * FROM english_classify WHERE parent_id=0 ORDER BY sort ASC,create_time`
  572. _, err = o.Raw(sql).QueryRows(&items)
  573. return
  574. }
  575. // GetEnglishSecondClassifyList 获取一级、二级分类列表
  576. func GetEnglishSecondClassifyList(rootIds []int) (items []*EnglishClassifyList, err error) {
  577. o := orm.NewOrmUsingDB("rddp")
  578. sql := `SELECT * FROM english_classify WHERE root_id IN (` + utils.GetOrmInReplace(len(rootIds)) + `) and parent_id>0 and root_id=parent_id ORDER BY sort ASC,create_time ASC`
  579. _, err = o.Raw(sql, rootIds).QueryRows(&items)
  580. return
  581. }
  582. func GetEnglishFirstClassifyListCount() (count int, err error) {
  583. o := orm.NewOrmUsingDB("rddp")
  584. sqlCount := `SELECT COUNT(1) AS count FROM english_classify WHERE parent_id=0`
  585. err = o.Raw(sqlCount).QueryRow(&count)
  586. return
  587. }
  588. func GetEnglishReportClassifyById(classifyId int) (item *EnglishClassify, err error) {
  589. sql := `SELECT * FROM english_classify WHERE id=?`
  590. o := orm.NewOrmUsingDB("rddp")
  591. err = o.Raw(sql, classifyId).QueryRow(&item)
  592. return
  593. }
  594. func GetEnglishReportClassifyByIds(classifyIds []int) (list []*EnglishClassify, err error) {
  595. o := orm.NewOrmUsingDB("rddp")
  596. sql := `SELECT * FROM english_classify WHERE id IN (` + utils.GetOrmInReplace(len(classifyIds)) + `)`
  597. _, err = o.Raw(sql, classifyIds).QueryRows(&list)
  598. return
  599. }
  600. // UpdateEnglishReportSecondClassifyNameByClassifyId 更新报告分类名称字段
  601. func UpdateEnglishReportSecondClassifyNameByClassifyId(classifyId int, classifyName string) (err error) {
  602. o := orm.NewOrmUsingDB("rddp")
  603. sql := " UPDATE english_report SET classify_name_second = ? WHERE classify_id_second = ? "
  604. _, err = o.Raw(sql, classifyName, classifyId).Exec()
  605. return
  606. }
  607. // UpdateEnglishReportFirstClassifyNameByClassifyId 更新报告分类名称字段
  608. func UpdateEnglishReportFirstClassifyNameByClassifyId(classifyId int, classifyName string) (err error) {
  609. o := orm.NewOrmUsingDB("rddp")
  610. sql := " UPDATE english_report SET classify_name_first = ? WHERE classify_id_first = ? "
  611. _, err = o.Raw(sql, classifyName, classifyId).Exec()
  612. return
  613. }
  614. // UpdateEnglishReportFirstClassifyNameByClassifyId 更新报告分类名称字段
  615. func UpdateEnglishReportByClassifyId(classifyFirstName, classifySecondName string, firstClassifyId, secondClassifyId int, ids string) (err error) {
  616. o := orm.NewOrmUsingDB("rddp")
  617. sql := " UPDATE english_report SET classify_name_first = ?,classify_name_second = ?,classify_id_first=?, classify_id_second =? WHERE id IN (" + ids + ") "
  618. _, err = o.Raw(sql, classifyFirstName, classifySecondName, firstClassifyId, secondClassifyId).Exec()
  619. return
  620. }
  621. func UpdateEnglishReportClassifyByFirstSecondClassifyId(classifyId, parentId int) (err error) {
  622. o := orm.NewOrmUsingDB("rddp")
  623. // 更新相关联的二级分类的parentId,和classify_name_second
  624. sql := `update english_report r
  625. LEFT JOIN english_classify c ON r.classify_id_second = c.id
  626. SET r.classify_id_first=c.parent_id, r.classify_name_second=c.classify_name
  627. where (r.classify_id_first != c.parent_id or r.classify_name_second != c.classify_name) and r.classify_id_second =?`
  628. _, err = o.Raw(sql, classifyId).Exec()
  629. if err != nil {
  630. return
  631. }
  632. //更新一级分类名
  633. sql = `update english_report r
  634. LEFT JOIN english_classify c ON r.classify_id_first = c.id
  635. SET r.classify_name_first=c.classify_name
  636. where r.classify_name_first != c.classify_name and r.classify_id_first=?`
  637. _, err = o.Raw(sql, parentId).Exec()
  638. if err != nil {
  639. return
  640. }
  641. //更新一级分类名
  642. sql = `update english_report r
  643. LEFT JOIN english_classify c ON r.classify_id_first = c.id
  644. SET r.classify_name_first=c.classify_name
  645. where r.classify_name_first != c.classify_name and r.classify_id_first=?`
  646. _, err = o.Raw(sql, classifyId).Exec()
  647. return
  648. }
  649. // FetchEnglishReportById 主键获取英文报告
  650. func FetchEnglishReportById(reportId int) (item *EnglishReport, err error) {
  651. o := orm.NewOrmUsingDB("rddp")
  652. sql := `SELECT * FROM english_report WHERE id=?`
  653. err = o.Raw(sql, reportId).QueryRow(&item)
  654. return
  655. }
  656. // UpdateReport 更新英文报告
  657. func (reportInfo *EnglishReport) UpdateReport(cols []string) (err error) {
  658. o := orm.NewOrmUsingDB("rddp")
  659. _, err = o.Update(reportInfo, cols...)
  660. return
  661. }
  662. // GetAllEnglishClassify 获取所有英文分类
  663. func GetAllEnglishClassify() (list []*Classify, err error) {
  664. o := orm.NewOrmUsingDB("rddp")
  665. sql := ` SELECT * FROM english_classify `
  666. _, err = o.Raw(sql).QueryRows(&list)
  667. return
  668. }
  669. // GetEnglishReportByIds 根据IDs获取英文报告列表
  670. func GetEnglishReportByIds(reportIds []int, fieldArr []string) (list []*EnglishReport, err error) {
  671. listLen := len(reportIds)
  672. if listLen == 0 {
  673. return
  674. }
  675. fields := ` * `
  676. if len(fieldArr) > 0 {
  677. fields = strings.Join(fieldArr, ",")
  678. }
  679. o := orm.NewOrmUsingDB("rddp")
  680. sql := `SELECT ` + fields + ` FROM english_report WHERE id IN (` + utils.GetOrmInReplace(listLen) + `)`
  681. _, err = o.Raw(sql, reportIds).QueryRows(&list)
  682. return
  683. }
  684. // MarkEditEnReport 标记编辑英文研报的请求数据
  685. type MarkEditEnReport struct {
  686. ReportId int `description:"研报id"`
  687. Status int `description:"标记状态,1:编辑中,2:编辑完成"`
  688. }
  689. type EnglishClassifyNameParentName struct {
  690. Id int `description:"分类ID"`
  691. ClassifyName string `description:"分类名称"`
  692. Sort int `description:"排序"`
  693. ParentId int `description:"父级分类id"`
  694. CreateTime time.Time `description:"创建时间"`
  695. ModifyTime time.Time `description:"修改时间"`
  696. ClassifyLabel string `description:"分类标签"`
  697. ShowType int `description:"展示类型:1-列表 2-专栏"`
  698. IsShow int `description:"是否在小程序显示:1-显示 0-隐藏"`
  699. ParentClassifyName string `description:"父级分类名称"`
  700. }
  701. func GetEnglishClassifyByClassifyNameAndParentName(parentClassiyName, classifyName string) (item EnglishClassifyNameParentName, err error) {
  702. o := orm.NewOrmUsingDB("rddp")
  703. sql := "SELECT c1.*, c2.classify_name as parent_classify_name FROM english_classify c1 LEFT JOIN english_classify c2 on c1.parent_id = c2.id where c1.parent_id > 0 and c2.classify_name = ? and c1.classify_name= ?"
  704. err = o.Raw(sql, parentClassiyName, classifyName).QueryRow(&item)
  705. return
  706. }
  707. type RSClassifyList []*EnglishClassifyList
  708. func (m RSClassifyList) Len() int {
  709. return len(m)
  710. }
  711. func (m RSClassifyList) Less(i, j int) bool {
  712. return m[i].Sort < m[j].Sort
  713. }
  714. func (m RSClassifyList) Swap(i, j int) {
  715. m[i], m[j] = m[j], m[i]
  716. }
  717. type RSChildClassifyList []*EnglishClassifyList
  718. func (m RSChildClassifyList) Len() int {
  719. return len(m)
  720. }
  721. func (m RSChildClassifyList) Less(i, j int) bool {
  722. return m[i].Sort < m[j].Sort
  723. }
  724. func (m RSChildClassifyList) Swap(i, j int) {
  725. m[i], m[j] = m[j], m[i]
  726. }
  727. // GetEnglishClassifyByClassifyNameParentId 获取英文分类
  728. func GetEnglishClassifyByClassifyNameParentId(classifyName string, parentId int) (item *Classify, err error) {
  729. o := orm.NewOrmUsingDB("rddp")
  730. sql := ` SELECT * FROM english_classify where classify_name = ? and parent_id = ? `
  731. err = o.Raw(sql, classifyName, parentId).QueryRow(&item)
  732. return
  733. }
  734. type EnglishClassifyFullName struct {
  735. Id int `description:"分类ID"`
  736. ParentId int `description:"父级分类id"`
  737. RootId int `description:"一级分类ID"`
  738. RootName string `description:"一级分类名"`
  739. ParentName string `description:"二级分类名"`
  740. ClassifyName string `description:"分类名称"`
  741. }
  742. // GetEnglishClassifyFullNameByIds 获取英文分类名一级/二级/三级
  743. func GetEnglishClassifyFullNameByIds(classifyIds []int) (list []*EnglishClassifyFullName, err error) {
  744. o := orm.NewOrmUsingDB("rddp")
  745. sql := ` SELECT
  746. a.id,
  747. a.parent_id,
  748. a.root_id,
  749. a.classify_name,
  750. b.classify_name AS root_name,
  751. c.classify_name AS parent_name
  752. FROM
  753. english_classify a
  754. LEFT JOIN english_classify b ON a.root_id = b.id
  755. LEFT JOIN english_classify c ON a.parent_id = c.id
  756. where a.id IN (` + utils.GetOrmInReplace(len(classifyIds)) + `)`
  757. _, err = o.Raw(sql, classifyIds).QueryRows(&list)
  758. return
  759. }
  760. func (m *EnglishReport) GetItemById(id int) (item *EnglishReport, err error) {
  761. o := orm.NewOrmUsingDB("rddp")
  762. sql := `SELECT * FROM english_report WHERE id = ? LIMIT 1`
  763. err = o.Raw(sql, id).QueryRow(&item)
  764. return
  765. }
  766. // GetEnglishClassifies 获取所有英文分类
  767. func GetEnglishClassifies() (list []*EnglishClassify, err error) {
  768. o := orm.NewOrmUsingDB("rddp")
  769. sql := ` SELECT * FROM english_classify `
  770. _, err = o.Raw(sql).QueryRows(&list)
  771. return
  772. }
  773. // GetEnglishReportStateCount 获取指定状态的报告数量
  774. func GetEnglishReportStateCount(state int) (count int, err error) {
  775. o := orm.NewOrmUsingDB("rddp")
  776. sql := `SELECT COUNT(1) AS count FROM english_report WHERE state = ?`
  777. err = o.Raw(sql, state).QueryRow(&count)
  778. return
  779. }
  780. // UpdateEnglishReportsStateByCond 批量更新报告状态
  781. func UpdateEnglishReportsStateByCond(classifyFirstId, classifySecondId, oldState, newState int) (err error) {
  782. o := orm.NewOrmUsingDB("rddp")
  783. cond := ``
  784. if classifyFirstId > 0 {
  785. cond += fmt.Sprintf(` AND classify_id_first = %d`, classifyFirstId)
  786. }
  787. if classifySecondId > 0 {
  788. cond += fmt.Sprintf(` AND classify_id_second = %d`, classifySecondId)
  789. }
  790. sql := fmt.Sprintf(`UPDATE english_report SET state = ?, pre_publish_time = NULL WHERE state = ? %s`, cond)
  791. _, err = o.Raw(sql, newState, oldState).Exec()
  792. return
  793. }
  794. // UpdateEnglishReportsStateBySecondIds 批量更新二级分类报告状态
  795. func UpdateEnglishReportsStateBySecondIds(oldState, newState int, secondIds []int) (err error) {
  796. if len(secondIds) <= 0 {
  797. return
  798. }
  799. o := orm.NewOrmUsingDB("rddp")
  800. // (有审批流的)未发布->待提交
  801. sql := fmt.Sprintf(`UPDATE english_report SET state = ?, pre_publish_time = NULL WHERE state = ? AND classify_id_second IN (%s)`, utils.GetOrmInReplace(len(secondIds)))
  802. _, err = o.Raw(sql, newState, oldState, secondIds).Exec()
  803. if err != nil {
  804. return
  805. }
  806. // (无审批流的)待提交->未发布
  807. sql = fmt.Sprintf(`UPDATE english_report SET state = ?, pre_publish_time = NULL WHERE state = ? AND classify_id_second NOT IN (%s)`, utils.GetOrmInReplace(len(secondIds)))
  808. _, err = o.Raw(sql, oldState, newState, secondIds).Exec()
  809. return
  810. }
  811. type EnglishClassifySetEnabledReq struct {
  812. ClassifyId int `description:"分类ID"`
  813. Enabled int `description:"是否可用,1可用,0禁用"`
  814. }
  815. func (classifyInfo *EnglishClassify) SetEnabled(id, enabled int) (err error) {
  816. o := orm.NewOrmUsingDB("rddp")
  817. to, err := o.Begin()
  818. if err != nil {
  819. return
  820. }
  821. defer func() {
  822. if err != nil {
  823. _ = to.Rollback()
  824. } else {
  825. _ = to.Commit()
  826. }
  827. }()
  828. sql := ` UPDATE english_classify SET enabled =? WHERE id = ?`
  829. _, err = to.Raw(sql, enabled, id).Exec()
  830. if err != nil {
  831. return
  832. }
  833. sql = ` UPDATE english_classify SET enabled =? WHERE parent_id = ? or root_id = ?`
  834. _, err = to.Raw(sql, enabled, id, id).Exec()
  835. if err != nil {
  836. return
  837. }
  838. return
  839. }
  840. func ModifyEnglishReportPdfUrl(reportId int, detailPdfUrl string) (err error) {
  841. o := orm.NewOrmUsingDB("rddp")
  842. sql := `UPDATE english_report SET detail_pdf_url=? WHERE id=? `
  843. _, err = o.Raw(sql, detailPdfUrl, reportId).Exec()
  844. return
  845. }
  846. func ModifyEnglishReportImgUrl(reportId int, detailImgUrl string) (err error) {
  847. o := orm.NewOrmUsingDB("rddp")
  848. sql := `UPDATE english_report SET detail_img_url=? WHERE id=? `
  849. _, err = o.Raw(sql, detailImgUrl, reportId).Exec()
  850. return
  851. }
  852. func ModifyEnglishReportPdfUrlMobile(reportId int, detailPdfUrlMobile string) (err error) {
  853. o := orm.NewOrmUsingDB("rddp")
  854. sql := `UPDATE english_report SET detail_pdf_url_mobile=? WHERE id=? `
  855. _, err = o.Raw(sql, detailPdfUrlMobile, reportId).Exec()
  856. return
  857. }
  858. func ModifyEnglishReportImgUrlMobile(reportId int, detailImgUrlMobile string) (err error) {
  859. o := orm.NewOrmUsingDB("rddp")
  860. sql := `UPDATE english_report SET detail_img_url_mobile=? WHERE id=? `
  861. _, err = o.Raw(sql, detailImgUrlMobile, reportId).Exec()
  862. return
  863. }
  864. // UpdatePdfUrlEnglishReportById 清空pdf相关字段
  865. func UpdatePdfUrlEnglishReportById(reportId int) (err error) {
  866. o := orm.NewOrmUsingDB("rddp")
  867. sql := `UPDATE english_report SET detail_img_url = '',detail_pdf_url='',modify_time=NOW() WHERE id = ? `
  868. _, err = o.Raw(sql, reportId).Exec()
  869. return
  870. }
  871. func FormatEnglishReport2ListItem(origin *EnglishReport) (item *EnglishReportList) {
  872. if origin == nil {
  873. return
  874. }
  875. item = new(EnglishReportList)
  876. item.Id = origin.Id
  877. item.AddType = origin.AddType
  878. item.ClassifyIdFirst = origin.ClassifyIdFirst
  879. item.ClassifyNameFirst = origin.ClassifyNameFirst
  880. item.ClassifyIdSecond = origin.ClassifyIdSecond
  881. item.ClassifyNameSecond = origin.ClassifyNameSecond
  882. item.Title = origin.Title
  883. item.Abstract = origin.Abstract
  884. item.Author = origin.Author
  885. item.Frequency = origin.Frequency
  886. item.CreateTime = origin.CreateTime
  887. item.ModifyTime = origin.ModifyTime
  888. item.State = origin.State
  889. item.PublishTime = utils.TimeTransferString(utils.FormatDateTime, origin.PublishTime)
  890. item.PrePublishTime = utils.TimeTransferString(utils.FormatDateTime, origin.PrePublishTime)
  891. item.Stage = origin.Stage
  892. //item.Content = origin.Content
  893. item.VideoUrl = origin.VideoUrl
  894. item.VideoName = origin.VideoName
  895. item.VideoPlaySeconds = origin.VideoPlaySeconds
  896. item.ContentSub = origin.ContentSub
  897. item.ReportCode = origin.ReportCode
  898. item.Pv = origin.Pv
  899. item.PvEmail = origin.PvEmail
  900. item.UvEmail = origin.UvEmail
  901. // 邮箱PV大于0的时候, 不展示最初版本的PV
  902. if item.PvEmail > 0 {
  903. item.Pv = 0
  904. }
  905. item.EmailState = origin.EmailState
  906. if origin.EmailHasFail == 1 {
  907. item.EmailHasFail = true
  908. }
  909. item.FromReportId = origin.FromReportId
  910. item.AdminId = origin.AdminId
  911. item.AdminRealName = origin.AdminRealName
  912. item.ApproveTime = utils.TimeTransferString(utils.FormatDateTime, origin.ApproveTime)
  913. item.DetailImgUrl = origin.DetailImgUrl
  914. item.DetailPdfUrl = origin.DetailPdfUrl
  915. return
  916. }