bill-produce-excel.go 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581
  1. package api
  2. import (
  3. "box-cost/db/model"
  4. "fmt"
  5. "github.com/xuri/excelize/v2"
  6. )
  7. type ProduceBillExcel struct {
  8. Offset int
  9. Row int
  10. Title string //标题
  11. Excel *excelize.File
  12. SheetName string
  13. AlignCenterStyle int
  14. Content *model.ProduceBill
  15. Signatures []*model.Signature
  16. IsPdf string
  17. }
  18. func (b *ProduceBillExcel) drawTitle() error {
  19. b.Row++
  20. //是打印
  21. startCell := fmt.Sprintf("A%d", b.Row)
  22. marginLeft := excelize.PageMarginLeft(0.1)
  23. endCell := fmt.Sprintf("K%d", b.Row)
  24. if b.Content.IsPrint {
  25. b.Excel.SetColWidth(b.SheetName, "A", "A", 15)
  26. b.Excel.SetColWidth(b.SheetName, "B", "C", 14)
  27. b.Excel.SetColWidth(b.SheetName, "D", "E", 9)
  28. b.Excel.SetColWidth(b.SheetName, "F", "F", 8)
  29. b.Excel.SetColWidth(b.SheetName, "G", "G", 6.5)
  30. b.Excel.SetColWidth(b.SheetName, "H", "I", 9)
  31. b.Excel.SetColWidth(b.SheetName, "J", "J", 10)
  32. b.Excel.SetColWidth(b.SheetName, "K", "K", 14)
  33. } else {
  34. // 不是打印
  35. endCell = fmt.Sprintf("H%d", b.Row)
  36. marginLeft = excelize.PageMarginLeft(0.6)
  37. b.Excel.SetColWidth(b.SheetName, "A", "B", 17)
  38. b.Excel.SetColWidth(b.SheetName, "C", "C", 12)
  39. b.Excel.SetColWidth(b.SheetName, "D", "D", 6)
  40. b.Excel.SetColWidth(b.SheetName, "E", "G", 12)
  41. b.Excel.SetColWidth(b.SheetName, "H", "H", 20)
  42. // 是覆膜
  43. if b.Content.IsLam {
  44. endCell = fmt.Sprintf("I%d", b.Row)
  45. marginLeft = excelize.PageMarginLeft(0.3)
  46. b.Excel.SetColWidth(b.SheetName, "A", "A", 16)
  47. b.Excel.SetColWidth(b.SheetName, "B", "C", 14)
  48. // 覆膜规格
  49. // b.Excel.SetColWidth(b.SheetName, "C", "C", 16)
  50. b.Excel.SetColWidth(b.SheetName, "D", "D", 10)
  51. b.Excel.SetColWidth(b.SheetName, "E", "F", 12)
  52. b.Excel.SetColWidth(b.SheetName, "G", "H", 10)
  53. b.Excel.SetColWidth(b.SheetName, "I", "I", 14)
  54. }
  55. }
  56. b.Excel.SetPageMargins(b.SheetName, marginLeft)
  57. err := b.Excel.MergeCell(b.SheetName, startCell, endCell)
  58. if err != nil {
  59. return err
  60. }
  61. style, err := b.Excel.NewStyle(&excelize.Style{
  62. Alignment: &excelize.Alignment{Horizontal: "center", Vertical: "center"},
  63. Font: &excelize.Font{Bold: true, Size: 18}})
  64. if err != nil {
  65. return err
  66. }
  67. err = b.Excel.SetCellStyle(b.SheetName, startCell, startCell, style)
  68. if err != nil {
  69. return err
  70. }
  71. b.Excel.SetRowHeight(b.SheetName, b.Row, 23)
  72. b.Excel.SetCellValue(b.SheetName, startCell, b.Title)
  73. return nil
  74. }
  75. func (b *ProduceBillExcel) drawSubTitles() error {
  76. b.Row++
  77. styleLeft, err := b.Excel.NewStyle(&excelize.Style{
  78. Alignment: &excelize.Alignment{Horizontal: "left", Vertical: "center"},
  79. Font: &excelize.Font{Size: 11}})
  80. if err != nil {
  81. return err
  82. }
  83. styleRight, err := b.Excel.NewStyle(&excelize.Style{
  84. Alignment: &excelize.Alignment{Horizontal: "right", Vertical: "center"},
  85. Font: &excelize.Font{Size: 11}})
  86. if err != nil {
  87. return err
  88. }
  89. drawLeft := func(rowIndex int, value string) error {
  90. //左边1
  91. left1Cell := fmt.Sprintf("A%d", rowIndex)
  92. err = b.Excel.MergeCell(b.SheetName, left1Cell, fmt.Sprintf("H%d", rowIndex))
  93. if err != nil {
  94. return err
  95. }
  96. err = b.Excel.SetCellStyle(b.SheetName, left1Cell, left1Cell, styleLeft)
  97. if err != nil {
  98. return err
  99. }
  100. b.Excel.SetCellValue(b.SheetName, left1Cell, value)
  101. return nil
  102. }
  103. drawRight := func(rowIndex int, value string) error {
  104. right1Cell := fmt.Sprintf("I%d", rowIndex)
  105. err = b.Excel.MergeCell(b.SheetName, right1Cell, fmt.Sprintf("K%d", rowIndex))
  106. if err != nil {
  107. return err
  108. }
  109. err = b.Excel.SetCellStyle(b.SheetName, right1Cell, right1Cell, styleRight)
  110. if err != nil {
  111. return err
  112. }
  113. b.Excel.SetCellValue(b.SheetName, right1Cell, value)
  114. return nil
  115. }
  116. if !b.Content.IsPrint {
  117. drawLeft = func(rowIndex int, value string) error {
  118. //左边1
  119. left1Cell := fmt.Sprintf("A%d", rowIndex)
  120. err = b.Excel.MergeCell(b.SheetName, left1Cell, fmt.Sprintf("F%d", rowIndex))
  121. if err != nil {
  122. return err
  123. }
  124. err = b.Excel.SetCellStyle(b.SheetName, left1Cell, left1Cell, styleLeft)
  125. if err != nil {
  126. return err
  127. }
  128. b.Excel.SetCellValue(b.SheetName, left1Cell, value)
  129. return nil
  130. }
  131. drawRight = func(rowIndex int, value string) error {
  132. right1Cell := fmt.Sprintf("G%d", rowIndex)
  133. err = b.Excel.MergeCell(b.SheetName, right1Cell, fmt.Sprintf("H%d", rowIndex))
  134. if err != nil {
  135. return err
  136. }
  137. err = b.Excel.SetCellStyle(b.SheetName, right1Cell, right1Cell, styleRight)
  138. if err != nil {
  139. return err
  140. }
  141. b.Excel.SetCellValue(b.SheetName, right1Cell, value)
  142. return nil
  143. }
  144. if b.Content.IsLam {
  145. drawLeft = func(rowIndex int, value string) error {
  146. //左边1
  147. left1Cell := fmt.Sprintf("A%d", rowIndex)
  148. err = b.Excel.MergeCell(b.SheetName, left1Cell, fmt.Sprintf("F%d", rowIndex))
  149. if err != nil {
  150. return err
  151. }
  152. err = b.Excel.SetCellStyle(b.SheetName, left1Cell, left1Cell, styleLeft)
  153. if err != nil {
  154. return err
  155. }
  156. b.Excel.SetCellValue(b.SheetName, left1Cell, value)
  157. return nil
  158. }
  159. drawRight = func(rowIndex int, value string) error {
  160. right1Cell := fmt.Sprintf("G%d", rowIndex)
  161. err = b.Excel.MergeCell(b.SheetName, right1Cell, fmt.Sprintf("I%d", rowIndex))
  162. if err != nil {
  163. return err
  164. }
  165. err = b.Excel.SetCellStyle(b.SheetName, right1Cell, right1Cell, styleRight)
  166. if err != nil {
  167. return err
  168. }
  169. b.Excel.SetCellValue(b.SheetName, right1Cell, value)
  170. return nil
  171. }
  172. }
  173. }
  174. //第一行
  175. drawLeft(b.Row, "类别:"+b.Content.Type)
  176. drawRight(b.Row, "单号:"+b.Content.SerialNumber)
  177. b.Excel.SetRowHeight(b.SheetName, b.Row, 21)
  178. //第二行
  179. drawLeft(b.Row+1, "供应商名称:"+b.Content.Supplier)
  180. timeformat := b.Content.CreateTime.Local().Format("2006年01月02号 15:04:05")
  181. drawRight(b.Row+1, "下单时间:"+timeformat)
  182. b.Excel.SetRowHeight(b.SheetName, b.Row+1, 21)
  183. //第三行
  184. drawLeft(b.Row+2, "产品名称:"+b.Content.ProductName)
  185. status := ""
  186. if b.Content.Status == "complete" {
  187. status = "已完成"
  188. }
  189. if b.Content.Status == "created" {
  190. status = "进行中"
  191. }
  192. drawRight(b.Row+2, "状态:"+status)
  193. b.Excel.SetRowHeight(b.SheetName, b.Row+2, 21)
  194. return nil
  195. }
  196. func (b *ProduceBillExcel) drawTableTitle() error {
  197. b.Row += 3
  198. var drawCol = func(prefix string, value string) error {
  199. left1Cell := fmt.Sprintf("%s%d", prefix, b.Row)
  200. left2Cell := fmt.Sprintf("%s%d", prefix, b.Row+1)
  201. err := b.Excel.MergeCell(b.SheetName, left1Cell, left2Cell)
  202. if err != nil {
  203. return err
  204. }
  205. err = b.Excel.SetCellStyle(b.SheetName, left1Cell, left2Cell, b.AlignCenterStyle)
  206. if err != nil {
  207. return err
  208. }
  209. return b.Excel.SetCellValue(b.SheetName, left1Cell, value)
  210. }
  211. // var drawCol2 = func(prefix string, value1 string, value2 string) error {
  212. // left1Cell := fmt.Sprintf("%s%d", prefix, b.Row)
  213. // left2Cell := fmt.Sprintf("%s%d", prefix, b.Row+1)
  214. // err := b.Excel.SetCellStyle(b.SheetName, left1Cell, left2Cell, b.AlignCenterStyle)
  215. // if err != nil {
  216. // return err
  217. // }
  218. // b.Excel.SetCellValue(b.SheetName, left1Cell, value1)
  219. // b.Excel.SetCellValue(b.SheetName, left2Cell, value2)
  220. // return nil
  221. // }
  222. var drawCol3 = func(prefix1 string, prefix2 string, value1 string, value2 string, value3 string) error {
  223. left1Cell := fmt.Sprintf("%s%d", prefix1, b.Row)
  224. left2Cell := fmt.Sprintf("%s%d", prefix2, b.Row)
  225. err := b.Excel.MergeCell(b.SheetName, left1Cell, left2Cell)
  226. if err != nil {
  227. return err
  228. }
  229. if err != nil {
  230. fmt.Println(err)
  231. return err
  232. }
  233. err = b.Excel.SetCellStyle(b.SheetName, left1Cell, left2Cell, b.AlignCenterStyle)
  234. if err != nil {
  235. return err
  236. }
  237. b.Excel.SetCellValue(b.SheetName, left1Cell, value1)
  238. val2Cel := fmt.Sprintf("%s%d", prefix1, b.Row+1)
  239. b.Excel.SetCellStyle(b.SheetName, val2Cel, val2Cel, b.AlignCenterStyle)
  240. b.Excel.SetCellValue(b.SheetName, val2Cel, value2)
  241. val3Cel := fmt.Sprintf("%s%d", prefix2, b.Row+1)
  242. b.Excel.SetCellStyle(b.SheetName, val3Cel, val3Cel, b.AlignCenterStyle)
  243. b.Excel.SetCellValue(b.SheetName, val3Cel, value3)
  244. return nil
  245. }
  246. unit := b.Content.Produces[0].Unit
  247. if b.Content.IsPrint {
  248. drawCol("A", "加工项目")
  249. drawCol("B", "规格")
  250. drawCol("C", "纸张")
  251. drawCol("D", "来纸尺寸")
  252. drawCol("E", "印刷尺寸")
  253. drawCol("F", "下单数量")
  254. drawCol("G", "单位")
  255. drawCol("H", "单价")
  256. drawCol("I", "预算金额")
  257. drawCol("J", "交货时间")
  258. drawCol("K", "备注")
  259. } else {
  260. if b.Content.IsLam {
  261. drawCol("A", "加工项目")
  262. drawCol("B", "规格")
  263. drawCol("C", "覆膜尺寸")
  264. drawCol("D", "下单数量")
  265. unit2 := b.Content.Produces[0].Unit2
  266. drawCol3("E", "F", "单价", unit, unit2)
  267. drawCol("G", "预算金额")
  268. drawCol("H", "交货时间")
  269. drawCol("I", "备注")
  270. } else {
  271. drawCol("A", "加工项目")
  272. drawCol("B", "规格")
  273. drawCol("C", "下单数量")
  274. drawCol("D", "单位")
  275. drawCol("E", "单价")
  276. drawCol("F", "预算金额")
  277. drawCol("G", "交货时间")
  278. drawCol("H", "备注")
  279. }
  280. }
  281. return nil
  282. }
  283. func (b *ProduceBillExcel) drawTableContent() error {
  284. b.Row += 2
  285. var DrawRow = func(rowIndex int, values ...string) {
  286. charas := []string{"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K"}
  287. if !b.Content.IsPrint {
  288. charas = []string{"A", "B", "C", "D", "E", "F", "G", "H"}
  289. if b.Content.IsLam {
  290. charas = []string{"A", "B", "C", "D", "E", "F", "G", "H", "I"}
  291. }
  292. }
  293. // }
  294. for i, c := range charas {
  295. v := ""
  296. if i < len(values) {
  297. v = values[i]
  298. }
  299. b.Excel.SetCellValue(b.SheetName, fmt.Sprintf("%s%d", c, rowIndex), v)
  300. val2Cel := fmt.Sprintf("%s%d", c, rowIndex)
  301. b.Excel.SetCellStyle(b.SheetName, val2Cel, val2Cel, b.AlignCenterStyle)
  302. // var magN float64 = 1
  303. // lenv := len([]rune(v))
  304. // magN = math.Ceil(float64(lenv) / 10)
  305. // if lenv%10 > 5 {
  306. // magN = math.Ceil(float64(lenv) / 10)
  307. // } else {
  308. // n := math.Floor(float64(lenv) / 10)
  309. // if n > 0 {
  310. // magN = n
  311. // }
  312. // }
  313. // b.Excel.SetRowHeight(b.SheetName, rowIndex, 21*magN)
  314. b.Excel.SetRowHeight(b.SheetName, rowIndex, 40)
  315. }
  316. }
  317. produces := b.Content.Produces
  318. if len(produces) > 0 {
  319. for _, produce := range produces {
  320. realCount := ""
  321. price := produce.OrderPrice
  322. priceStr := fmt.Sprintf("%.3f", price)
  323. b.FormatToEmpty(&priceStr)
  324. // 预算金额
  325. budgetAmount := fmt.Sprintf("%.3f", produce.OrderPrice*float64(produce.OrderCount))
  326. b.FormatToEmpty(&budgetAmount)
  327. // 实际金额
  328. realPrice := ""
  329. // 实际完成数
  330. realCount = fmt.Sprintf("%d", produce.ConfirmCount)
  331. b.FormatToEmpty(&realCount)
  332. realPrice = fmt.Sprintf("%.3f", produce.OrderPrice*float64(produce.ConfirmCount))
  333. b.FormatToEmpty(&realPrice)
  334. deliveryTime := produce.DeliveryTime.Local().Format("2006-01-02")
  335. if b.Content.IsPrint {
  336. DrawRow(b.Row, produce.Name, produce.Norm, produce.Paper, produce.PaperSize, produce.PrintSize, fmt.Sprintf("%d", produce.OrderCount), produce.Unit, priceStr, budgetAmount, deliveryTime, produce.Remark)
  337. } else {
  338. // 覆膜
  339. if b.Content.IsLam {
  340. DrawRow(b.Row, produce.Name, produce.Norm, produce.PrintSize, fmt.Sprintf("%d", produce.OrderCount), priceStr, fmt.Sprintf("%.3f", produce.Price2), budgetAmount, deliveryTime, produce.Remark)
  341. } else {
  342. DrawRow(b.Row, produce.Name, produce.Norm, fmt.Sprintf("%d", produce.OrderCount), produce.Unit, priceStr, budgetAmount, deliveryTime, produce.Remark)
  343. }
  344. }
  345. b.Row++
  346. }
  347. }
  348. return nil
  349. }
  350. func (b *ProduceBillExcel) drawTableFooter() error {
  351. border := []excelize.Border{
  352. {Type: "top", Style: 1, Color: "000000"},
  353. {Type: "left", Style: 1, Color: "000000"},
  354. {Type: "right", Style: 1, Color: "000000"},
  355. {Type: "bottom", Style: 1, Color: "000000"},
  356. }
  357. styleLeft, _ := b.Excel.NewStyle(&excelize.Style{
  358. Alignment: &excelize.Alignment{Horizontal: "left", Vertical: "center"},
  359. Border: border,
  360. })
  361. sendToStartCell := fmt.Sprintf("A%d", b.Row)
  362. sendToEndCell := fmt.Sprintf("H%d", b.Row)
  363. supplierStartCell := fmt.Sprintf("I%d", b.Row)
  364. supplierEndCell := fmt.Sprintf("K%d", b.Row)
  365. if !b.Content.IsPrint {
  366. sendToEndCell = fmt.Sprintf("E%d", b.Row)
  367. supplierStartCell = fmt.Sprintf("F%d", b.Row)
  368. supplierEndCell = fmt.Sprintf("H%d", b.Row)
  369. if b.Content.IsLam {
  370. sendToEndCell = fmt.Sprintf("F%d", b.Row)
  371. supplierStartCell = fmt.Sprintf("G%d", b.Row)
  372. supplierEndCell = fmt.Sprintf("I%d", b.Row)
  373. }
  374. }
  375. b.Excel.MergeCell(b.SheetName, sendToStartCell, sendToEndCell)
  376. b.Excel.SetCellStyle(b.SheetName, sendToStartCell, sendToEndCell, styleLeft)
  377. b.Excel.SetCellValue(b.SheetName, sendToStartCell, "送货地址:"+b.Content.SendTo)
  378. b.Excel.MergeCell(b.SheetName, supplierStartCell, supplierEndCell)
  379. b.Excel.SetCellStyle(b.SheetName, supplierStartCell, supplierEndCell, styleLeft)
  380. b.Excel.SetCellValue(b.SheetName, supplierStartCell, "供应商签字:")
  381. b.Excel.SetRowHeight(b.SheetName, b.Row, 21)
  382. return nil
  383. }
  384. func (b *ProduceBillExcel) drawTableSignature() error {
  385. b.Row += 2
  386. style1, _ := b.Excel.NewStyle(&excelize.Style{
  387. Alignment: &excelize.Alignment{Horizontal: "center", Vertical: "center"},
  388. // Border: border,
  389. })
  390. // 制单人
  391. billUserCellS := fmt.Sprintf("A%d", b.Row+1)
  392. billUserCellE := fmt.Sprintf("B%d", b.Row+1)
  393. b.Excel.MergeCell(b.SheetName, billUserCellS, billUserCellE)
  394. b.Excel.SetCellValue(b.SheetName, billUserCellS, "制单人:"+b.Content.UserName)
  395. fontNum := "F"
  396. image1s := "G"
  397. image2s := "J"
  398. image1e := "I"
  399. image2e := "K"
  400. if !b.Content.IsPrint {
  401. fontNum = "E"
  402. image1s = "F"
  403. image2s = "H"
  404. image1e = "G"
  405. image2e = "H"
  406. if b.Content.IsLam {
  407. fontNum = "E"
  408. image1s = "F"
  409. image2s = "H"
  410. image1e = "G"
  411. image2e = "I"
  412. }
  413. }
  414. fontCell := fmt.Sprintf("%s%d", fontNum, b.Row)
  415. fontEndCell := fmt.Sprintf("%s%d", fontNum, b.Row+2)
  416. imageCell1 := fmt.Sprintf("%s%d", image1s, b.Row)
  417. imageEndCell1 := fmt.Sprintf("%s%d", image1e, b.Row+2)
  418. imageCell2 := fmt.Sprintf("%s%d", image2s, b.Row)
  419. imageEndCell2 := fmt.Sprintf("%s%d", image2e, b.Row+2)
  420. b.Excel.MergeCell(b.SheetName, fontCell, fontEndCell)
  421. b.Excel.SetCellStyle(b.SheetName, fontCell, fontCell, style1)
  422. b.Excel.SetCellValue(b.SheetName, fontCell, "审核签字:")
  423. // 签字图片1 I10-J12
  424. b.Excel.MergeCell(b.SheetName, imageCell1, imageEndCell1)
  425. b.Excel.SetCellStyle(b.SheetName, imageCell1, imageCell1, style1)
  426. b.Excel.SetCellValue(b.SheetName, imageCell1, "")
  427. // 签字图片2 K10-L12
  428. b.Excel.MergeCell(b.SheetName, imageCell2, imageEndCell2)
  429. b.Excel.SetCellStyle(b.SheetName, imageCell2, imageCell1, style1)
  430. b.Excel.SetCellValue(b.SheetName, imageCell2, "")
  431. // 状态为已审核时,签字
  432. if b.Content.Reviewed == 1 {
  433. imageCells := []string{imageCell1, imageCell2}
  434. if len(b.Signatures) > 0 {
  435. for k, sign := range b.Signatures {
  436. b.Excel.AddPicture(b.SheetName, imageCells[k], sign.Path, sign.Format)
  437. }
  438. }
  439. }
  440. b.Excel.SetRowHeight(b.SheetName, b.Row, 21)
  441. return nil
  442. }
  443. func (b *ProduceBillExcel) Draws() {
  444. b.drawTitle()
  445. b.drawSubTitles()
  446. b.drawTableTitle()
  447. b.drawTableContent()
  448. b.drawTableFooter()
  449. b.drawTableSignature()
  450. }
  451. func NewProduceBill(f *excelize.File) *ProduceBillExcel {
  452. border := []excelize.Border{
  453. {Type: "top", Style: 1, Color: "000000"},
  454. {Type: "left", Style: 1, Color: "000000"},
  455. {Type: "right", Style: 1, Color: "000000"},
  456. {Type: "bottom", Style: 1, Color: "000000"},
  457. }
  458. styleLeft, _ := f.NewStyle(&excelize.Style{
  459. Alignment: &excelize.Alignment{Horizontal: "center", Vertical: "center", WrapText: true},
  460. Border: border,
  461. })
  462. b := &ProduceBillExcel{
  463. Title: "中鱼互动加工单",
  464. SheetName: "Sheet1",
  465. Excel: f,
  466. Offset: 0,
  467. AlignCenterStyle: styleLeft,
  468. Signatures: make([]*model.Signature, 0),
  469. }
  470. f.SetPageMargins(b.SheetName, excelize.PageMarginTop(0), excelize.PageMarginLeft(0), excelize.PageMarginRight(0))
  471. return b
  472. }
  473. func (b *ProduceBillExcel) FormatToEmpty(str *string) {
  474. if *str == "0" || *str == "0.000" {
  475. *str = ""
  476. }
  477. }
  478. func (b *ProduceBillExcel) SetContent(content interface{}) {
  479. b.Content = content.(*model.ProduceBill)
  480. }
  481. func (b *ProduceBillExcel) SetTitle(title string) {
  482. b.Title = title
  483. }
  484. func (b *ProduceBillExcel) SetRow(row int) {
  485. b.Row = row
  486. }
  487. func (b *ProduceBillExcel) SetIsPdf(isPdf string) {
  488. b.IsPdf = isPdf
  489. }
  490. func (b *ProduceBillExcel) GetRow() int {
  491. return b.Row
  492. }
  493. func (b *ProduceBillExcel) SetSignatures(sign interface{}) {
  494. b.Signatures = sign.([]*model.Signature)
  495. }