Ver Fonte

处理单号失真问题

zhou.xiaoning há 3 anos atrás
pai
commit
2bcf1a433a
5 ficheiros alterados com 76 adições e 32 exclusões
  1. 11 11
      controllers/guangzuan/tradeService.go
  2. 5 5
      docs/docs.go
  3. 5 5
      docs/swagger.json
  4. 5 5
      docs/swagger.yaml
  5. 50 6
      models/guangzuan.go

+ 11 - 11
controllers/guangzuan/tradeService.go

@@ -16,10 +16,10 @@ import (
 // @Security ApiKeyAuth
 // @Security LoginID
 // @Security Group
-// @Param    userid        query    int true  "用户ID"
+// @Param    userid   query    int    true  "用户ID"
 // @Param    executestatus query    int false "执行状态 - 1:未生效 2:进行中 3:已结束"
-// @Param    page          query    int false "页码"
-// @Param    pagesize      query    int false "每页条数"
+// @Param    page     query    int    false "页码"
+// @Param    pagesize query    int    false "每页条数"
 // @Success  200           {array}  models.GzcjjcorderM
 // @Failure  500     {object} app.Response
 // @Router   /Guangzuan/QueryGZCJJCOrder [get]
@@ -38,7 +38,7 @@ func QueryGZCJJCOrder(c *gin.Context) {
 // @Security LoginID
 // @Security Group
 // @Param    userid        query    int true  "用户ID"
-// @Param    orderid  query    int false "单据ID"
+// @Param    orderid  query    string false "单据ID"
 // @Param    page          query    int false "页码"
 // @Param    pagesize      query    int false "每页条数"
 // @Success  200      {array}  models.GzcjjcorderdetailM
@@ -59,8 +59,8 @@ func QueryGZCJJCOrderDetail(c *gin.Context) {
 // @Security LoginID
 // @Security Group
 // @Param    orderid  query    int true  "单据ID"
-// @Param    page     query    int false "页码"
-// @Param    pagesize query    int false "每页条数"
+// @Param    page          query    int false "页码"
+// @Param    pagesize      query    int false "每页条数"
 // @Success  200      {array}  models.GzcjbsorderfileM
 // @Failure  500     {object} app.Response
 // @Router   /Guangzuan/QueryGZCJBSOrderFile [get]
@@ -78,10 +78,10 @@ func QueryGZCJBSOrderFile(c *gin.Context) {
 // @Security ApiKeyAuth
 // @Security LoginID
 // @Security Group
-// @Param    userid   query    int true  "用户ID"
+// @Param    userid        query    int true  "用户ID"
 // @Param    executestatus query    int false "执行状态 - 1:未生效 2:进行中 3:已结束"
-// @Param    page     query    int false "页码"
-// @Param    pagesize query    int false "每页条数"
+// @Param    page     query    int    false "页码"
+// @Param    pagesize query    int    false "每页条数"
 // @Success  200           {array}  models.GzbsfworderM
 // @Failure  500           {object} app.Response
 // @Router   /Guangzuan/QueryGZBSFWOrder [get]
@@ -99,8 +99,8 @@ func QueryGZBSFWOrder(c *gin.Context) {
 // @Security ApiKeyAuth
 // @Security LoginID
 // @Security Group
-// @Param    userid   query    int true  "用户ID"
-// @Param    orderid  query    int false "单据ID"
+// @Param    userid   query    int    true  "用户ID"
+// @Param    orderid  query    string false "单据ID"
 // @Param    page     query    int false "页码"
 // @Param    pagesize query    int false "每页条数"
 // @Success  200      {array}  models.GzbsfworderdetailM

+ 5 - 5
docs/docs.go

@@ -9189,7 +9189,7 @@ const docTemplate = `{
                         "required": true
                     },
                     {
-                        "type": "integer",
+                        "type": "string",
                         "description": "单据ID",
                         "name": "orderid",
                         "in": "query"
@@ -9381,7 +9381,7 @@ const docTemplate = `{
                         "required": true
                     },
                     {
-                        "type": "integer",
+                        "type": "string",
                         "description": "单据ID",
                         "name": "orderid",
                         "in": "query"
@@ -33353,7 +33353,7 @@ const docTemplate = `{
                 },
                 "orderid": {
                     "description": "单据ID(804+Unix秒时间戳(10位)+xxxxxx)",
-                    "type": "integer"
+                    "type": "string"
                 },
                 "orderno": {
                     "description": "单据编号 - GZDEBSFW+单据流水号",
@@ -33450,11 +33450,11 @@ const docTemplate = `{
                 },
                 "orderdetailid": {
                     "description": "单据明细ID(805+Unix秒时间戳(10位)+xxxxxx)",
-                    "type": "integer"
+                    "type": "string"
                 },
                 "orderid": {
                     "description": "单据ID(804+Unix秒时间戳(10位)+xxxxxx)",
-                    "type": "integer"
+                    "type": "string"
                 },
                 "orderindex": {
                     "description": "顺序",

+ 5 - 5
docs/swagger.json

@@ -9180,7 +9180,7 @@
                         "required": true
                     },
                     {
-                        "type": "integer",
+                        "type": "string",
                         "description": "单据ID",
                         "name": "orderid",
                         "in": "query"
@@ -9372,7 +9372,7 @@
                         "required": true
                     },
                     {
-                        "type": "integer",
+                        "type": "string",
                         "description": "单据ID",
                         "name": "orderid",
                         "in": "query"
@@ -33344,7 +33344,7 @@
                 },
                 "orderid": {
                     "description": "单据ID(804+Unix秒时间戳(10位)+xxxxxx)",
-                    "type": "integer"
+                    "type": "string"
                 },
                 "orderno": {
                     "description": "单据编号 - GZDEBSFW+单据流水号",
@@ -33441,11 +33441,11 @@
                 },
                 "orderdetailid": {
                     "description": "单据明细ID(805+Unix秒时间戳(10位)+xxxxxx)",
-                    "type": "integer"
+                    "type": "string"
                 },
                 "orderid": {
                     "description": "单据ID(804+Unix秒时间戳(10位)+xxxxxx)",
-                    "type": "integer"
+                    "type": "string"
                 },
                 "orderindex": {
                     "description": "顺序",

+ 5 - 5
docs/swagger.yaml

@@ -10503,7 +10503,7 @@ definitions:
         type: string
       orderid:
         description: 单据ID(804+Unix秒时间戳(10位)+xxxxxx)
-        type: integer
+        type: string
       orderno:
         description: 单据编号 - GZDEBSFW+单据流水号
         type: string
@@ -10577,10 +10577,10 @@ definitions:
         type: string
       orderdetailid:
         description: 单据明细ID(805+Unix秒时间戳(10位)+xxxxxx)
-        type: integer
+        type: string
       orderid:
         description: 单据ID(804+Unix秒时间戳(10位)+xxxxxx)
-        type: integer
+        type: string
       orderindex:
         description: 顺序
         type: integer
@@ -31706,7 +31706,7 @@ paths:
       - description: 单据ID
         in: query
         name: orderid
-        type: integer
+        type: string
       - description: 页码
         in: query
         name: page
@@ -31822,7 +31822,7 @@ paths:
       - description: 单据ID
         in: query
         name: orderid
-        type: integer
+        type: string
       - description: 页码
         in: query
         name: page

+ 50 - 6
models/guangzuan.go

@@ -2726,7 +2726,7 @@ func (r *GzcjbsorderfileM) GetDataByPage() (interface{}, error, int, int, int) {
 
 // GzbsfworderM 保税服务单据表
 type GzbsfworderM struct {
-	ORDERID            int64     `json:"orderid" xorm:"ORDERID"`                                  // 单据ID(804+Unix秒时间戳(10位)+xxxxxx)
+	ORDERID            string    `json:"orderid" xorm:"ORDERID"`                                  // 单据ID(804+Unix秒时间戳(10位)+xxxxxx)
 	USERID             int64     `json:"userid" xorm:"USERID" form:"userid" binding:"required"`   // 用户ID
 	ACCOUNTID          int64     `json:"accountid" xorm:"ACCOUNTID"`                              // 资金账户ID
 	ORDERSN            string    `json:"ordersn" xorm:"ORDERSN"`                                  // 单据流水号 - yymm000 - yy表示年份,mm表示月份,年份、月份以两位数表示;000表示流水序号,序号不足三位以0补全
@@ -2773,7 +2773,39 @@ func (r *GzbsfworderM) calc() {
 func (r *GzbsfworderM) buildSql() string {
 	var sqlId utils.SQLVal = `
 	SELECT 
-		t.*,
+		to_char(t.ORDERID) ORDERID,
+		t.USERID,
+		t.ACCOUNTID,
+		t.ORDERSN,
+		t.ORDERNO,
+		t.ORDERDATE,
+		t.COMPANYNAMECN,
+		t.COMPANYNAMEEN,
+		t.ADDRESSCN,
+		t.ADDRESSEN,
+		t.CONTACTNAME,
+		t.CONTACTPHONENO,
+		t.CONTACTFAX,
+		t.ORIGINCOUNTRY,
+		t.TOTALNETWEIGTHCT,
+		t.TOTALNETWEIGHTGM,
+		t.TOTALGROSSWEIGHTGM,
+		t.TOTALAMOUNT,
+		t.GZBSSTATUS,
+		t.HANDLESTATUS,
+		t.EXECUTESTATUS,
+		t.TAXMARGIN,
+		t.ADVANCEAMOUNT,
+		t.SETTLEAMOUNT,
+		t.CREATETIME,
+		t.TOTALNUMBER,
+		t.GZBSDELIVERYTYPE,
+		t.OTHERLOGISTICS,
+		t.WEIGHTRANGE,
+		t.SHAPERANGE,
+		t.COLORRANGE,
+		t.CONTENTRANGE,
+		t.CLOSEDTRADEDATE,
 		CAST((t.TOTALAMOUNT / t.TOTALNETWEIGTHCT) AS DECIMAL(13,2)) PRICEPER,
 		e1.ENUMDICNAME GZBSSTATUSDISPLAY
 	FROM GZ_BSFWOrder t
@@ -2801,8 +2833,8 @@ func (r *GzbsfworderM) GetDataByPage() (interface{}, error, int, int, int) {
 
 // GzbsfworderdetailM 保税服务单据明细表
 type GzbsfworderdetailM struct {
-	ORDERDETAILID int64     `json:"orderdetailid" xorm:"ORDERDETAILID"`    // 单据明细ID(805+Unix秒时间戳(10位)+xxxxxx)
-	ORDERID       int64     `json:"orderid" xorm:"ORDERID" form:"orderid"` // 单据ID(804+Unix秒时间戳(10位)+xxxxxx)
+	ORDERDETAILID string    `json:"orderdetailid" xorm:"ORDERDETAILID"`    // 单据明细ID(805+Unix秒时间戳(10位)+xxxxxx)
+	ORDERID       string    `json:"orderid" xorm:"ORDERID" form:"orderid"` // 单据ID(804+Unix秒时间戳(10位)+xxxxxx)
 	ORDERINDEX    int32     `json:"orderindex" xorm:"ORDERINDEX"`          // 顺序
 	NETWEIGTHCT   float64   `json:"netweigthct" xorm:"NETWEIGTHCT"`        // 净重(克拉)
 	NETWEIGTHGM   float64   `json:"netweigthgm" xorm:"NETWEIGTHGM"`        // 净重(克)
@@ -2827,13 +2859,25 @@ func (r *GzbsfworderdetailM) calc() {
 func (r *GzbsfworderdetailM) buildSql() string {
 	var sqlId utils.SQLVal = `
 	SELECT 
-		t.*
+		to_char(t.ORDERDETAILID) ORDERDETAILID,
+		to_char(t.ORDERID) ORDERID,
+		t.ORDERINDEX,
+		t.NETWEIGTHCT,
+		t.NETWEIGTHGM,
+		t.GROSSWEIGHTGM,
+		t.TOTALAMOUNT,
+		t.PERPRICE,
+		t.ORDERCONTENT,
+		t.COLORINFO,
+		t.REMARK,
+		t.CREATETIME,
+		t.GZCJSHAPE
 	FROM GZ_BSFWOrderDetail t
 	LEFT JOIN GZ_BSFWOrder d ON t.orderid = d.orderid AND d.userid = %v
 	WHERE 1=1
 	`
 	sqlId.FormatParam(r.USERID)
-	sqlId.AndEx("t.orderid", r.ORDERID, r.ORDERID > 0)
+	sqlId.AndEx("t.orderid", r.ORDERID, r.ORDERID != "")
 	sqlId.OrderBy("t.ORDERINDEX")
 
 	sqlId.Page(r.Page, r.PageSize)