1 2 tuần trước cách đây
mục cha
commit
8e3a793c1e
3 tập tin đã thay đổi với 67 bổ sung0 xóa
  1. 14 0
      common/models/sb/year_main.go
  2. 4 0
      common/rod_utils.go
  3. 49 0
      common/yaar.go

+ 14 - 0
common/models/sb/year_main.go

@@ -126,6 +126,20 @@ type YearA105080 struct {
 	A9 string `json:"a9"`
 }
 
+// YearA105080Fb  A105080Fb28 29附表结构体
+type YearA105080Fb struct {
+	ID         uint      `json:"id" gorm:"primary_key"`
+	CreatedAt  time.Time `json:"createdAt"`
+	UpdatedAt  time.Time `json:"updatedAt"`
+	YearMainId uint      `json:"yearMainId"`
+	Type       string    `json:"type"`
+	Project    string    `json:"project"`
+	Other      string    `json:"other"`
+	Code       string    `json:"code"`
+	Amount     string    `json:"amount"`
+	IsCheck    int       `json:"isCheck"`
+}
+
 type YearA105000 struct {
 	ID         uint      `json:"id" gorm:"primary_key"`
 	CreatedAt  time.Time `json:"createdAt"`

+ 4 - 0
common/rod_utils.go

@@ -636,3 +636,7 @@ func InputElementX(p *rod.Page, xPath, inputVal string) {
 	}
 	MustElementX(p, xPath).MustSelectAllText().MustInput(inputVal)
 }
+
+func GetText(page *rod.Page, selector string) string {
+	return page.Timeout(ClickTimeOut).MustSearch(selector).MustText()
+}

+ 49 - 0
common/yaar.go

@@ -0,0 +1,49 @@
+package common
+
+import (
+	"git.listensoft.net/tool/jspkit/common/models"
+	"git.listensoft.net/tool/jspkit/common/variable"
+	"github.com/tidwall/gjson"
+)
+
+func GetYearSbTables(task *models.TaxTask, tables interface{}) {
+	if ok := gjson.Get(task.Data, `a000000`).Raw; ok != "" {
+		tables.(map[variable.SbKey]bool)[variable.A000000] = true
+	}
+	if ok := gjson.Get(task.Data, `a000000Gd`).Raw; ok != "" {
+		tables.(map[variable.SbKey]bool)[variable.A000000Gd] = true
+	}
+	if ok := gjson.Get(task.Data, `a100000`).Raw; ok != "" {
+		tables.(map[variable.SbKey]bool)[variable.A100000] = true
+	}
+	if ok := gjson.Get(task.Data, `a101010`).Raw; ok != "" {
+		tables.(map[variable.SbKey]bool)[variable.A101010] = true
+	}
+	if ok := gjson.Get(task.Data, `a102010`).Raw; ok != "" {
+		tables.(map[variable.SbKey]bool)[variable.A102010] = true
+	}
+	if ok := gjson.Get(task.Data, `a104000`).Raw; ok != "" {
+		tables.(map[variable.SbKey]bool)[variable.A104000] = true
+	}
+	if ok := gjson.Get(task.Data, `a105000`).Raw; ok != "" {
+		tables.(map[variable.SbKey]bool)[variable.A105000] = true
+	}
+	if ok := gjson.Get(task.Data, `a105050`).Raw; ok != "" {
+		tables.(map[variable.SbKey]bool)[variable.A105050] = true
+	}
+	if ok := gjson.Get(task.Data, `a105060`).Raw; ok != "" {
+		tables.(map[variable.SbKey]bool)[variable.A105060] = true
+	}
+	if ok := gjson.Get(task.Data, `a105080`).Raw; ok != "" {
+		tables.(map[variable.SbKey]bool)[variable.A105080] = true
+	}
+	if ok := gjson.Get(task.Data, `a106000`).Raw; ok != "" {
+		tables.(map[variable.SbKey]bool)[variable.A106000] = true
+	}
+	if ok := gjson.Get(task.Data, `a107010`).Raw; ok != "" {
+		tables.(map[variable.SbKey]bool)[variable.A107010] = true
+	}
+	if ok := gjson.Get(task.Data, `a107040`).Raw; ok != "" {
+		tables.(map[variable.SbKey]bool)[variable.A107040] = true
+	}
+}