|
|
@@ -3751,24 +3751,24 @@ func (r *BScinoutorderdetail) GetDataByPage() (interface{}, error, int, int, int
|
|
|
|
|
|
// BScoutorderdetailatt 保税仓出库申请明细附表
|
|
|
type BScoutorderdetailatt struct {
|
|
|
- DETAILATTID string `json:"detailattid" xorm:"DETAILATTID"` // 明细ID(810+Unix秒时间戳(10位)+xxxxxx)
|
|
|
- ORDERID string `json:"orderid" xorm:"ORDERID" form:"orderid" binding:"required"` // 申请ID
|
|
|
- GOODSID int64 `json:"goodsid" xorm:"GOODSID"` // 商品ID
|
|
|
- CUSTOMSNO string `json:"customsno" xorm:"CUSTOMSNO"` // 报关单号
|
|
|
- JCKDATE time.Time `json:"jckdate" xorm:"JCKDATE"` // 进口日期
|
|
|
- NETWEIGHTCT float64 `json:"netweightct" xorm:"NETWEIGHTCT"` // 净重(克拉)
|
|
|
- CURNETWEIGHTCT float64 `json:"curnetweightct" xorm:"CURNETWEIGHTCT"` // 本次扣减量(克拉)
|
|
|
- REMAINNETWEIGHTCT float64 `json:"remainnetweightct" xorm:"REMAINNETWEIGHTCT"` // 结余净重(克拉)
|
|
|
- NETWEIGHTGM float64 `json:"netweightgm" xorm:"NETWEIGHTGM"` // 净重(克)
|
|
|
- CURNETWEIGHTGM float64 `json:"curnetweightgm" xorm:"CURNETWEIGHTGM"` // 本次扣减净重(克)
|
|
|
- REMAINCURNETWEIGHTGM float64 `json:"remaincurnetweightgm" xorm:"REMAINCURNETWEIGHTGM"` // 结余净重(克)
|
|
|
- TOTALPRICE float64 `json:"totalprice" xorm:"TOTALPRICE"` // 总价
|
|
|
- CURTOTALPRICE float64 `json:"curtotalprice" xorm:"CURTOTALPRICE"` // 本次扣减货值
|
|
|
- REMAINTOTALPRICE float64 `json:"remaintotalprice" xorm:"REMAINTOTALPRICE"` // 结余总价
|
|
|
- CUSTOMSVALUE float64 `json:"customsvalue" xorm:"CUSTOMSVALUE"` // 报关总值
|
|
|
- CURCUSTOMSVALUE float64 `json:"curcustomsvalue" xorm:"CURCUSTOMSVALUE"` // 本次扣减货值(报关总值)
|
|
|
- REMAINCUSTOMSVALUE float64 `json:"remaincustomsvalue" xorm:"REMAINCUSTOMSVALUE"` // 结余报关总值
|
|
|
- USERID int64 `json:"userid" xorm:"USERID" form:"userid" binding:"required"` // 用户ID
|
|
|
+ DETAILATTID string `json:"detailattid" xorm:"DETAILATTID"` // 明细ID(810+Unix秒时间戳(10位)+xxxxxx)
|
|
|
+ ORDERID string `json:"orderid" xorm:"ORDERID" form:"orderid" binding:"required"` // 申请ID
|
|
|
+ GOODSID int64 `json:"goodsid" xorm:"GOODSID"` // 商品ID
|
|
|
+ CUSTOMSNO string `json:"customsno" xorm:"CUSTOMSNO"` // 报关单号
|
|
|
+ JCKDATE string `json:"jckdate" xorm:"JCKDATE"` // 进口日期
|
|
|
+ NETWEIGHTCT float64 `json:"netweightct" xorm:"NETWEIGHTCT"` // 净重(克拉)
|
|
|
+ CURNETWEIGHTCT float64 `json:"curnetweightct" xorm:"CURNETWEIGHTCT"` // 本次扣减量(克拉)
|
|
|
+ REMAINNETWEIGHTCT float64 `json:"remainnetweightct" xorm:"REMAINNETWEIGHTCT"` // 结余净重(克拉)
|
|
|
+ NETWEIGHTGM float64 `json:"netweightgm" xorm:"NETWEIGHTGM"` // 净重(克)
|
|
|
+ CURNETWEIGHTGM float64 `json:"curnetweightgm" xorm:"CURNETWEIGHTGM"` // 本次扣减净重(克)
|
|
|
+ REMAINCURNETWEIGHTGM float64 `json:"remaincurnetweightgm" xorm:"REMAINCURNETWEIGHTGM"` // 结余净重(克)
|
|
|
+ TOTALPRICE float64 `json:"totalprice" xorm:"TOTALPRICE"` // 总价
|
|
|
+ CURTOTALPRICE float64 `json:"curtotalprice" xorm:"CURTOTALPRICE"` // 本次扣减货值
|
|
|
+ REMAINTOTALPRICE float64 `json:"remaintotalprice" xorm:"REMAINTOTALPRICE"` // 结余总价
|
|
|
+ CUSTOMSVALUE float64 `json:"customsvalue" xorm:"CUSTOMSVALUE"` // 报关总值
|
|
|
+ CURCUSTOMSVALUE float64 `json:"curcustomsvalue" xorm:"CURCUSTOMSVALUE"` // 本次扣减货值(报关总值)
|
|
|
+ REMAINCUSTOMSVALUE float64 `json:"remaincustomsvalue" xorm:"REMAINCUSTOMSVALUE"` // 结余报关总值
|
|
|
+ USERID int64 `json:"userid" xorm:"USERID" form:"userid" binding:"required"` // 用户ID
|
|
|
|
|
|
GOODSNUM string `json:"goodsnum" xorm:"GOODSNUM"` // 商品编号
|
|
|
GOODSNAME string `json:"goodsname" xorm:"GOODSNAME"` // 商品名称
|
|
|
@@ -3817,8 +3817,10 @@ func (r *BScoutorderdetailatt) buildSql() string {
|
|
|
a.UNITPRICE,
|
|
|
a.CURRENCYNAME,
|
|
|
a.EXECUTIONFLAG,
|
|
|
- a.STORAGEPERIOD
|
|
|
+ a.STORAGEPERIOD,
|
|
|
+ a.GOODSSPEC
|
|
|
FROM GZ_BSCOUTORDERDETAILATT t
|
|
|
+ LEFT JOIN GZ_BSCGoods a ON a.goodsid = t.goodsid
|
|
|
WHERE t.USERID = %v AND t.ORDERID = %v
|
|
|
ORDER BY a.GOODSNAME, t.JCKDATE
|
|
|
`
|
|
|
@@ -3839,3 +3841,309 @@ func (r *BScoutorderdetailatt) GetDataByPage() (interface{}, error, int, int, in
|
|
|
}
|
|
|
return sData, err, r.Page, r.PageSize, total
|
|
|
}
|
|
|
+
|
|
|
+// GGzbscposition 保税商品报关头寸表
|
|
|
+type GGzbscposition struct {
|
|
|
+ USERID int64 `json:"userid" xorm:"USERID" form:"userid" binding:"required"` // 用户ID
|
|
|
+ CUSTOMSNO string `json:"customsno" xorm:"CUSTOMSNO"` // 报关单号
|
|
|
+ GOODSID string `json:"goodsid" xorm:"GOODSID"` // 商品ID
|
|
|
+ JCKDATE string `json:"jckdate" xorm:"JCKDATE"` // 进口日期
|
|
|
+ ORINETWEIGHTCT float64 `json:"orinetweightct" xorm:"ORINETWEIGHTCT"` // 期初净重(克拉)
|
|
|
+ ORINETWEIGHTGM float64 `json:"orinetweightgm" xorm:"ORINETWEIGHTGM"` // 期初净重(克)
|
|
|
+ ORITOTALPRICE float64 `json:"oritotalprice" xorm:"ORITOTALPRICE"` // 期初总价
|
|
|
+ ORICUSTOMSVALUE float64 `json:"oricustomsvalue" xorm:"ORICUSTOMSVALUE"` // 期初报关总值
|
|
|
+ ORIFREEZEWEIGHT float64 `json:"orifreezeweight" xorm:"ORIFREEZEWEIGHT"` // 期初冻结净重(克拉)
|
|
|
+ NETWEIGHTCT float64 `json:"netweightct" xorm:"NETWEIGHTCT"` // 净重(克拉)
|
|
|
+ NETWEIGHTGM float64 `json:"netweightgm" xorm:"NETWEIGHTGM"` // 净重(克)
|
|
|
+ TOTALPRICE float64 `json:"totalprice" xorm:"TOTALPRICE"` // 总价
|
|
|
+ CUSTOMSVALUE float64 `json:"customsvalue" xorm:"CUSTOMSVALUE"` // 报关总值
|
|
|
+ FREEZENETWEIGHTCT float64 `json:"freezenetweightct" xorm:"FREEZENETWEIGHTCT"` // 冻结净重(克拉)
|
|
|
+
|
|
|
+ GOODSNUM string `json:"goodsnum" xorm:"GOODSNUM"` // 商品编号
|
|
|
+ GOODSNAME string `json:"goodsname" xorm:"GOODSNAME"` // 商品名称
|
|
|
+ GOODSSPEC string `json:"goodsspec" xorm:"GOODSSPEC"` // 规格型号
|
|
|
+ COUNTRYNAME string `json:"countryname" xorm:"COUNTRYNAME"` // 产销国
|
|
|
+ REPORTUNIT string `json:"reportunit" xorm:"REPORTUNIT"` // 申报计量单位
|
|
|
+ LEGALUNIT string `json:"legalunit" xorm:"LEGALUNIT"` // 法定计量单位
|
|
|
+ UNITPRICE float64 `json:"unitprice" xorm:"UNITPRICE"` // 单价
|
|
|
+ CURRENCYNAME string `json:"currencyname" xorm:"CURRENCYNAME"` // 币制
|
|
|
+ EXECUTIONFLAG string `json:"executionflag" xorm:"EXECUTIONFLAG"` // 海关执行标志
|
|
|
+ STORAGEPERIOD time.Time `json:"storageperiod" xorm:"STORAGEPERIOD"` // 存储(监管)期限
|
|
|
+
|
|
|
+ PageEx `xorm:"extends"` // 页码信息
|
|
|
+}
|
|
|
+
|
|
|
+func (r *GGzbscposition) calc() {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+func (r *GGzbscposition) buildSql() string {
|
|
|
+ var sqlId utils.SQLVal = `
|
|
|
+ SELECT
|
|
|
+ t.USERID,
|
|
|
+ t.CUSTOMSNO,
|
|
|
+ t.GOODSID,
|
|
|
+ to_char(t.JCKDATE, 'yyyy-mm-dd') JCKDATE,
|
|
|
+ t.ORINETWEIGHTCT,
|
|
|
+ t.ORINETWEIGHTGM,
|
|
|
+ t.ORITOTALPRICE,
|
|
|
+ t.ORICUSTOMSVALUE,
|
|
|
+ t.ORIFREEZEWEIGHT,
|
|
|
+ t.NETWEIGHTCT,
|
|
|
+ t.NETWEIGHTGM,
|
|
|
+ t.TOTALPRICE,
|
|
|
+ t.CUSTOMSVALUE,
|
|
|
+ t.FREEZENETWEIGHTCT,
|
|
|
+ a.GOODSNUM,
|
|
|
+ a.GOODSNAME,
|
|
|
+ a.COUNTRYNAME,
|
|
|
+ a.REPORTUNIT,
|
|
|
+ a.LEGALUNIT,
|
|
|
+ a.UNITPRICE,
|
|
|
+ a.CURRENCYNAME,
|
|
|
+ a.EXECUTIONFLAG,
|
|
|
+ a.STORAGEPERIOD,
|
|
|
+ a.GOODSSPEC
|
|
|
+ FROM GZ_BSCPosition t
|
|
|
+ LEFT JOIN GZ_BSCGoods a ON a.goodsid = t.goodsid
|
|
|
+ WHERE t.USERID = %v
|
|
|
+ ORDER BY a.GOODSNAME
|
|
|
+ `
|
|
|
+
|
|
|
+ sqlId.FormatParam(r.USERID)
|
|
|
+
|
|
|
+ sqlId.Page(r.Page, r.PageSize)
|
|
|
+ return sqlId.String()
|
|
|
+}
|
|
|
+
|
|
|
+func (r *GGzbscposition) GetDataByPage() (interface{}, error, int, int, int) {
|
|
|
+ sData := make([]GGzbscposition, 0)
|
|
|
+ err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
|
|
|
+ total := 0
|
|
|
+ for i := range sData {
|
|
|
+ sData[i].calc()
|
|
|
+ total = sData[i].Total
|
|
|
+ }
|
|
|
+ return sData, err, r.Page, r.PageSize, total
|
|
|
+}
|
|
|
+
|
|
|
+// GGzbscusermonthpay 保税仓用户月付款通知书表
|
|
|
+type GGzbscusermonthpay struct {
|
|
|
+ USERID int64 `json:"userid" xorm:"USERID" form:"userid" binding:"required"` // 用户ID
|
|
|
+ TRADEMONTH string `json:"trademonth" xorm:"TRADEMONTH"` // 月份(yyyMM)
|
|
|
+ SERVICEFEE float64 `json:"servicefee" xorm:"SERVICEFEE"` // 分拣室服务费
|
|
|
+ ACCOUNTID int64 `json:"accountid" xorm:"ACCOUNTID"` // 资金账户ID
|
|
|
+ STORAGEFEE float64 `json:"storagefee" xorm:"STORAGEFEE"` // 仓储费
|
|
|
+ PREMIUM float64 `json:"premium" xorm:"PREMIUM"` // 保险费
|
|
|
+ POWERFEE float64 `json:"powerfee" xorm:"POWERFEE"` // 分拣室电费
|
|
|
+ INFEE float64 `json:"infee" xorm:"INFEE"` // 进仓报关费
|
|
|
+ OUTFEE float64 `json:"outfee" xorm:"OUTFEE"` // 出仓报关费
|
|
|
+ TOTALFEE float64 `json:"totalfee" xorm:"TOTALFEE"` // 合计费用
|
|
|
+ INNUM float64 `json:"innum" xorm:"INNUM"` // 进仓报关单数
|
|
|
+ OUTNUM float64 `json:"outnum" xorm:"OUTNUM"` // 出仓报关单数
|
|
|
+ PAYMODE int32 `json:"paymode" xorm:"PAYMODE"` // 支付方式 - 1:线上 2:线下(枚举:GZBSCPayMode)
|
|
|
+ PAYSTATUS int32 `json:"paystatus" xorm:"PAYSTATUS" form:"paystatus"` // 支付状态 - 1:待确认 2:待支付 3:已支付(枚举:GZBSCPayStatus)
|
|
|
+ STARTDATE time.Time `json:"startdate" xorm:"STARTDATE"` // 协议起始日
|
|
|
+ RENTDAYS int32 `json:"rentdays" xorm:"RENTDAYS"` // 月租天数
|
|
|
+ CONFIRMTIME time.Time `json:"confirmtime" xorm:"CONFIRMTIME"` // 确认时间
|
|
|
+ PAYTIME string `json:"paytime" xorm:"PAYTIME"` // 支付时间
|
|
|
+ HANDLESTATUS int32 `json:"handlestatus" xorm:"HANDLESTATUS"` // 处理状态
|
|
|
+
|
|
|
+ PageEx `xorm:"extends"` // 页码信息
|
|
|
+}
|
|
|
+
|
|
|
+func (r *GGzbscusermonthpay) calc() {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+func (r *GGzbscusermonthpay) buildSql() string {
|
|
|
+ var sqlId utils.SQLVal = `
|
|
|
+ SELECT
|
|
|
+ t.USERID,
|
|
|
+ t.TRADEMONTH,
|
|
|
+ t.SERVICEFEE,
|
|
|
+ t.ACCOUNTID,
|
|
|
+ t.STORAGEFEE,
|
|
|
+ t.PREMIUM,
|
|
|
+ t.POWERFEE,
|
|
|
+ t.INFEE,
|
|
|
+ t.OUTFEE,
|
|
|
+ t.TOTALFEE,
|
|
|
+ t.INNUM,
|
|
|
+ t.OUTNUM,
|
|
|
+ t.PAYMODE,
|
|
|
+ t.PAYSTATUS,
|
|
|
+ t.STARTDATE,
|
|
|
+ t.RENTDAYS,
|
|
|
+ t.CONFIRMTIME,
|
|
|
+ to_char(t.PAYTIME, 'yyyy-mm-dd hh24:mi:ss') PAYTIME,
|
|
|
+ t.HANDLESTATUS
|
|
|
+ FROM GZ_BSCUserMonthPay t
|
|
|
+ WHERE t.userid = %v
|
|
|
+ `
|
|
|
+
|
|
|
+ sqlId.FormatParam(r.USERID)
|
|
|
+ sqlId.AndEx("t.PAYSTATUS", r.PAYSTATUS, r.PAYSTATUS != 0)
|
|
|
+ sqlId.OrderByDesc("t.TradeMonth")
|
|
|
+
|
|
|
+ sqlId.Page(r.Page, r.PageSize)
|
|
|
+ return sqlId.String()
|
|
|
+}
|
|
|
+
|
|
|
+func (r *GGzbscusermonthpay) GetDataByPage() (interface{}, error, int, int, int) {
|
|
|
+ sData := make([]GGzbscusermonthpay, 0)
|
|
|
+ err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
|
|
|
+ total := 0
|
|
|
+ for i := range sData {
|
|
|
+ sData[i].calc()
|
|
|
+ total = sData[i].Total
|
|
|
+ }
|
|
|
+ return sData, err, r.Page, r.PageSize, total
|
|
|
+}
|
|
|
+
|
|
|
+// GGzbscuserpowerfee 保税仓月电费登记表
|
|
|
+type GGzbscuserpowerfee struct {
|
|
|
+ POWERFEEID string `json:"powerfeeid" xorm:"POWERFEEID"` // 电费单ID(809+Unix秒时间戳(10位)+xxxxxx)
|
|
|
+ USERID int64 `json:"userid" xorm:"USERID" form:"userid" binding:"required"` // 用户ID
|
|
|
+ TRADEMONTH string `json:"trademonth" xorm:"TRADEMONTH" form:"trademonth" binding:"required"` // 月份(yyyMM)
|
|
|
+ INSTRUMENTNO float64 `json:"instrumentno" xorm:"INSTRUMENTNO"` // 仪表编号
|
|
|
+ USERNAME float64 `json:"username" xorm:"USERNAME"` // 使用单位
|
|
|
+ STARTPOWER float64 `json:"startpower" xorm:"STARTPOWER"` // 月初读数
|
|
|
+ ENDPOWER float64 `json:"endpower" xorm:"ENDPOWER"` // 月末初数
|
|
|
+ POWERNUM float64 `json:"powernum" xorm:"POWERNUM"` // 本月用量
|
|
|
+ POWERUNIT float64 `json:"powerunit" xorm:"POWERUNIT"` // 单位
|
|
|
+ POWERFEE float64 `json:"powerfee" xorm:"POWERFEE"` // 电费(元)
|
|
|
+ CREATETIME time.Time `json:"createtime" xorm:"CREATETIME"` // 创建时间
|
|
|
+
|
|
|
+ PageEx `xorm:"extends"` // 页码信息
|
|
|
+}
|
|
|
+
|
|
|
+func (r *GGzbscuserpowerfee) calc() {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+func (r *GGzbscuserpowerfee) buildSql() string {
|
|
|
+ var sqlId utils.SQLVal = `
|
|
|
+ SELECT
|
|
|
+ to_char(t.POWERFEEID) POWERFEEID,
|
|
|
+ t.USERID,
|
|
|
+ t.TRADEMONTH,
|
|
|
+ t.INSTRUMENTNO,
|
|
|
+ t.USERNAME,
|
|
|
+ t.STARTPOWER,
|
|
|
+ t.ENDPOWER,
|
|
|
+ t.POWERNUM,
|
|
|
+ t.POWERUNIT,
|
|
|
+ t.POWERFEE,
|
|
|
+ t.CREATETIME
|
|
|
+ FROM GZ_BSCUserPowerFee t
|
|
|
+ WHERE t.userid = %v AND t.TRADEMONTH = %v
|
|
|
+ ORDER BY t.INSTRUMENTNO DESC
|
|
|
+ `
|
|
|
+
|
|
|
+ sqlId.FormatParam(r.USERID)
|
|
|
+
|
|
|
+ sqlId.Page(r.Page, r.PageSize)
|
|
|
+ return sqlId.String()
|
|
|
+}
|
|
|
+
|
|
|
+func (r *GGzbscuserpowerfee) GetDataByPage() (interface{}, error, int, int, int) {
|
|
|
+ sData := make([]GGzbscuserpowerfee, 0)
|
|
|
+ err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
|
|
|
+ total := 0
|
|
|
+ for i := range sData {
|
|
|
+ sData[i].calc()
|
|
|
+ total = sData[i].Total
|
|
|
+ }
|
|
|
+ return sData, err, r.Page, r.PageSize, total
|
|
|
+}
|
|
|
+
|
|
|
+// Bscinoutorder 本月进口明细/本月出境明细/本月转厂明细
|
|
|
+type Bscinoutorder struct {
|
|
|
+ ORDERID string `json:"orderid" xorm:"ORDERID" form:"orderid" binding:"required"` // 申请ID(806+Unix秒时间戳(10位)+xxxxxx)
|
|
|
+ ORDERTYPE int32 `json:"ordertype" xorm:"ORDERTYPE"` // 单据类型 - 1:进仓 2:出仓(枚举:GZBSCOrderType)
|
|
|
+ USERID int64 `json:"userid" xorm:"USERID" form:"userid" binding:"required"` // 申请用户ID
|
|
|
+ USERNAME string `json:"username" xorm:"USERNAME"` // 申请方名称
|
|
|
+ USERADDRESS string `json:"useraddress" xorm:"USERADDRESS"` // 申请方地点
|
|
|
+ CONTACTNAME string `json:"contactname" xorm:"CONTACTNAME"` // 申请方联系人
|
|
|
+ CONTACTNUM string `json:"contactnum" xorm:"CONTACTNUM"` // 申请方联系电话
|
|
|
+ LOGISTICSCOMPANY string `json:"logisticscompany" xorm:"LOGISTICSCOMPANY"` // 物流公司名称
|
|
|
+ LOGISTICSNO string `json:"logisticsno" xorm:"LOGISTICSNO"` // 托运单号
|
|
|
+ APPLICANTTIME time.Time `json:"applicanttime" xorm:"APPLICANTTIME"` // 申请时间
|
|
|
+ OUTTYPE int32 `json:"outtype" xorm:"OUTTYPE"` // 出仓类型 - 1:转厂 2:出境(枚举:GZBSCOutType)
|
|
|
+ ORDERSTATUS int32 `json:"orderstatus" xorm:"ORDERSTATUS"` // 进出仓状态 - 1.待确认 2.待上传 3.报关中 4.进仓中 5.出仓中 20.已关闭 21.确认拒绝(枚举:GZBSCOrderStatus)
|
|
|
+ JCKDATE string `json:"jckdate" xorm:"JCKDATE" form:"jckdate" binding:"required"` // 进出口日期
|
|
|
+ CUSTOMSNO string `json:"customsno" xorm:"CUSTOMSNO"` // 报关单号
|
|
|
+ CHECKLISTNO string `json:"checklistno" xorm:"CHECKLISTNO"` // 核注清单号
|
|
|
+ SIGNEENAME string `json:"signeename" xorm:"SIGNEENAME"` // 收发货人
|
|
|
+ SIGNEEDATE time.Time `json:"signeedate" xorm:"SIGNEEDATE"` // 收发货人日期
|
|
|
+ SEALNO string `json:"sealno" xorm:"SEALNO"` // 进出仓封条号
|
|
|
+ CONFIRMERNAME string `json:"confirmername" xorm:"CONFIRMERNAME"` // 进出仓确认人
|
|
|
+ CONFIRMDATE time.Time `json:"confirmdate" xorm:"CONFIRMDATE"` // 进出仓确认时间
|
|
|
+ CONFIRMTRADEDATE string `json:"confirmtradedate" xorm:"CONFIRMTRADEDATE"` // 进出仓确认交易日(yyyyMMdd)
|
|
|
+ NETWEIGHTCT float64 `json:"netweightct" xorm:"NETWEIGHTCT"` // 净重(克拉)
|
|
|
+ NETWEIGHTGM float64 `json:"netweightgm" xorm:"NETWEIGHTGM"` // 净重(克)
|
|
|
+ BAGWEIGHTGM float64 `json:"bagweightgm" xorm:"BAGWEIGHTGM"` // 连袋重(克)
|
|
|
+ TOTALPRICE float64 `json:"totalprice" xorm:"TOTALPRICE"` // 总价
|
|
|
+ CUSTOMSTOTALVALUE float64 `json:"customstotalvalue" xorm:"CUSTOMSTOTALVALUE"` // 报关总值
|
|
|
+ GOODSNAME string `json:"goodsname" xorm:"GOODSNAME"` // 商品名称 - 明细的商品名称拼接("/")
|
|
|
+ ORDERNUM string `json:"ordernum" xorm:"ORDERNUM"` // 单据编号
|
|
|
+
|
|
|
+ PageEx `xorm:"extends"` // 页码信息
|
|
|
+}
|
|
|
+
|
|
|
+func (r *Bscinoutorder) calc() {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+func (r *Bscinoutorder) buildSql() string {
|
|
|
+ var sqlId utils.SQLVal = `
|
|
|
+ SELECT
|
|
|
+ to_char(t.ORDERID) ORDERID,
|
|
|
+ t.ORDERTYPE,
|
|
|
+ t.USERID,
|
|
|
+ t.USERNAME,
|
|
|
+ t.USERADDRESS,
|
|
|
+ t.CONTACTNAME,
|
|
|
+ t.CONTACTNUM,
|
|
|
+ t.LOGISTICSCOMPANY,
|
|
|
+ t.LOGISTICSNO,
|
|
|
+ t.APPLICANTTIME,
|
|
|
+ t.OUTTYPE,
|
|
|
+ t.ORDERSTATUS,
|
|
|
+ to_char(t.JCKDATE, 'yyyy-mm-dd') JCKDATE,
|
|
|
+ t.CUSTOMSNO,
|
|
|
+ t.CHECKLISTNO,
|
|
|
+ t.SIGNEENAME,
|
|
|
+ t.SIGNEEDATE,
|
|
|
+ t.SEALNO,
|
|
|
+ t.CONFIRMERNAME,
|
|
|
+ t.CONFIRMDATE,
|
|
|
+ t.CONFIRMTRADEDATE,
|
|
|
+ t.NETWEIGHTCT,
|
|
|
+ t.NETWEIGHTGM,
|
|
|
+ t.BAGWEIGHTGM,
|
|
|
+ t.TOTALPRICE,
|
|
|
+ t.CUSTOMSTOTALVALUE,
|
|
|
+ t.GOODSNAME,
|
|
|
+ t.ORDERNUM
|
|
|
+ FROM GZ_BSCINOUTORDER t
|
|
|
+ WHERE t.orderid = %v AND t.userid = %v AND to_char(t.JCKDATE, 'yyyymm') = '%v'
|
|
|
+ `
|
|
|
+
|
|
|
+ sqlId.FormatParam(r.ORDERID, r.USERID, r.JCKDATE)
|
|
|
+
|
|
|
+ sqlId.Page(r.Page, r.PageSize)
|
|
|
+ return sqlId.String()
|
|
|
+}
|
|
|
+
|
|
|
+func (r *Bscinoutorder) GetDataByPage() (interface{}, error, int, int, int) {
|
|
|
+ sData := make([]Bscinoutorder, 0)
|
|
|
+ err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
|
|
|
+ total := 0
|
|
|
+ for i := range sData {
|
|
|
+ sData[i].calc()
|
|
|
+ total = sData[i].Total
|
|
|
+ }
|
|
|
+ return sData, err, r.Page, r.PageSize, total
|
|
|
+}
|