|
|
@@ -3555,3 +3555,287 @@ func (r *Fworderoperate) GetDataEx() (interface{}, error) {
|
|
|
}
|
|
|
return sData, nil
|
|
|
}
|
|
|
+
|
|
|
+// GGzbscinoutorder 保税仓出入库申请表
|
|
|
+type GGzbscinoutorder struct {
|
|
|
+ ORDERID string `json:"orderid" xorm:"ORDERID"` // 申请ID(806+Unix秒时间戳(10位)+xxxxxx)
|
|
|
+ ORDERTYPE int32 `json:"ordertype" xorm:"ORDERTYPE" form:"ordertype" binding:"required"` // 单据类型 - 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 string `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"` // 进出口日期
|
|
|
+ CUSTOMSNO string `json:"customsno" xorm:"CUSTOMSNO"` // 报关单号
|
|
|
+ CHECKLISTNO string `json:"checklistno" xorm:"CHECKLISTNO"` // 核注清单号
|
|
|
+ SIGNEENAME string `json:"signeename" xorm:"SIGNEENAME"` // 收发货人
|
|
|
+ SIGNEEDATE string `json:"signeedate" xorm:"SIGNEEDATE"` // 收发货人日期
|
|
|
+ SEALNO string `json:"sealno" xorm:"SEALNO"` // 进出仓封条号
|
|
|
+ CONFIRMERNAME string `json:"confirmername" xorm:"CONFIRMERNAME"` // 进出仓确认人
|
|
|
+ CONFIRMDATE string `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"` // 单据编号
|
|
|
+
|
|
|
+ ListType int `json:"-" xorm:"-" form:"listtype"` // 列表类型 - 0.全部 1.待上传 2.进行中 3.已结束
|
|
|
+
|
|
|
+ PageEx `xorm:"extends"` // 页码信息
|
|
|
+}
|
|
|
+
|
|
|
+func (r *GGzbscinoutorder) calc() {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+func (r *GGzbscinoutorder) 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,
|
|
|
+ to_char(t.APPLICANTTIME, 'yyyy-mm-dd hh24:mi:ss') APPLICANTTIME,
|
|
|
+ t.OUTTYPE,
|
|
|
+ t.ORDERSTATUS,
|
|
|
+ to_char(t.JCKDATE, 'yyyy-mm-dd') JCKDATE,
|
|
|
+ t.CUSTOMSNO,
|
|
|
+ t.CHECKLISTNO,
|
|
|
+ t.SIGNEENAME,
|
|
|
+ to_char(t.SIGNEEDATE, 'yyyy-mm-dd') SIGNEEDATE,
|
|
|
+ t.SEALNO,
|
|
|
+ t.CONFIRMERNAME,
|
|
|
+ to_char(t.CONFIRMDATE, 'yyyy-mm-dd') CONFIRMDATE,
|
|
|
+ t.CONFIRMTRADEDATE,
|
|
|
+ t.NETWEIGHTCT,
|
|
|
+ t.NETWEIGHTGM,
|
|
|
+ t.BAGWEIGHTGM,
|
|
|
+ t.TOTALPRICE,
|
|
|
+ t.CUSTOMSTOTALVALUE,
|
|
|
+ t.GOODSNAME,
|
|
|
+ t.ORDERNUM
|
|
|
+ from GZ_BSCInOutOrder t
|
|
|
+ where t.userid = %v and t.ORDERTYPE = %v and %v
|
|
|
+ order by t.APPLICANTTIME desc
|
|
|
+ `
|
|
|
+
|
|
|
+ e := "1=1"
|
|
|
+ if r.ListType != 0 {
|
|
|
+ switch r.ListType {
|
|
|
+ case 1:
|
|
|
+ e = "t.ORDERSTATUS = 2"
|
|
|
+ case 2:
|
|
|
+ e = "t.ORDERSTATUS < 20"
|
|
|
+ case 3:
|
|
|
+ e = "t.ORDERSTATUS >= 20"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sqlId.FormatParam(r.USERID, r.ORDERTYPE, e)
|
|
|
+
|
|
|
+ sqlId.Page(r.Page, r.PageSize)
|
|
|
+ return sqlId.String()
|
|
|
+}
|
|
|
+
|
|
|
+func (r *GGzbscinoutorder) GetDataByPage() (interface{}, error, int, int, int) {
|
|
|
+ sData := make([]GGzbscinoutorder, 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
|
|
|
+}
|
|
|
+
|
|
|
+// BScinoutorderdetail 保税仓出入库申请明细表
|
|
|
+type BScinoutorderdetail struct {
|
|
|
+ DETAILID string `json:"detailid" xorm:"DETAILID"` // 明细ID(807+Unix秒时间戳(10位)+xxxxxx)
|
|
|
+ ORDERID string `json:"orderid" xorm:"ORDERID" form:"orderid" binding:"required"` // 申请ID
|
|
|
+ GOODSID int64 `json:"goodsid" xorm:"GOODSID"` // 商品ID
|
|
|
+ GOODSSPEC string `json:"goodsspec" xorm:"GOODSSPEC"` // 规格
|
|
|
+ RAWDETAIL string `json:"rawdetail" xorm:"RAWDETAIL"` // 原料明细
|
|
|
+ BACKAGENUM int32 `json:"backagenum" xorm:"BACKAGENUM"` // 件数
|
|
|
+ NETWEIGHTCT float64 `json:"netweightct" xorm:"NETWEIGHTCT"` // 净重(克拉)
|
|
|
+ NETWEIGHTGM float64 `json:"netweightgm" xorm:"NETWEIGHTGM"` // 净重(克)
|
|
|
+ BAGWEIGHTGM float64 `json:"bagweightgm" xorm:"BAGWEIGHTGM"` // 连袋重(克)
|
|
|
+ PREPRICEGM float64 `json:"prepricegm" xorm:"PREPRICEGM"` // 单价(克)
|
|
|
+ TOTALPRICE float64 `json:"totalprice" xorm:"TOTALPRICE"` // 总价
|
|
|
+ CURRENCYDES string `json:"currencydes" xorm:"CURRENCYDES"` // 币种
|
|
|
+ CUSTOMSVALUE float64 `json:"customsvalue" xorm:"CUSTOMSVALUE"` // 报关总值
|
|
|
+ ORIGINCOUNTRY string `json:"origincountry" xorm:"ORIGINCOUNTRY"` // 原产国
|
|
|
+ REMARK string `json:"remark" xorm:"REMARK"` // 备注
|
|
|
+ USERID int64 `json:"userid" xorm:"USERID" form:"userid" binding:"required"` // 用户ID
|
|
|
+ CUSTOMSNO string `json:"customsno" xorm:"CUSTOMSNO"` // 报关单号(进仓:录入时更新,出仓申请时有)
|
|
|
+
|
|
|
+ GOODSNUM string `json:"goodsnum" xorm:"GOODSNUM"` // 商品编号
|
|
|
+ GOODSNAME string `json:"goodsname" xorm:"GOODSNAME"` // 商品名称
|
|
|
+ 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 *BScinoutorderdetail) calc() {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+func (r *BScinoutorderdetail) buildSql() string {
|
|
|
+ var sqlId utils.SQLVal = `
|
|
|
+ SELECT
|
|
|
+ to_char(t.DETAILID) DETAILID,
|
|
|
+ to_char(t.ORDERID) ORDERID,
|
|
|
+ t.GOODSID,
|
|
|
+ t.GOODSSPEC,
|
|
|
+ t.RAWDETAIL,
|
|
|
+ t.BACKAGENUM,
|
|
|
+ t.NETWEIGHTCT,
|
|
|
+ t.NETWEIGHTGM,
|
|
|
+ t.BAGWEIGHTGM,
|
|
|
+ t.PREPRICEGM,
|
|
|
+ t.TOTALPRICE,
|
|
|
+ t.CURRENCYDES,
|
|
|
+ t.CUSTOMSVALUE,
|
|
|
+ t.ORIGINCOUNTRY,
|
|
|
+ t.REMARK,
|
|
|
+ t.USERID,
|
|
|
+ t.CUSTOMSNO,
|
|
|
+ a.GOODSNUM,
|
|
|
+ a.GOODSNAME,
|
|
|
+ a.COUNTRYNAME,
|
|
|
+ a.REPORTUNIT,
|
|
|
+ a.LEGALUNIT,
|
|
|
+ a.UNITPRICE,
|
|
|
+ a.CURRENCYNAME,
|
|
|
+ a.EXECUTIONFLAG,
|
|
|
+ a.STORAGEPERIOD
|
|
|
+ FROM GZ_BSCInOutOrderDetail t
|
|
|
+ LEFT JOIN GZ_BSCGoods a ON a.goodsid = t.goodsid
|
|
|
+ WHERE t.USERID = %v AND t.ORDERID = %v
|
|
|
+ ORDER BY a.GOODSNAME
|
|
|
+ `
|
|
|
+
|
|
|
+ sqlId.FormatParam(r.USERID, r.ORDERID)
|
|
|
+
|
|
|
+ sqlId.Page(r.Page, r.PageSize)
|
|
|
+ return sqlId.String()
|
|
|
+}
|
|
|
+
|
|
|
+func (r *BScinoutorderdetail) GetDataByPage() (interface{}, error, int, int, int) {
|
|
|
+ sData := make([]BScinoutorderdetail, 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
|
|
|
+}
|
|
|
+
|
|
|
+// 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
|
|
|
+
|
|
|
+ 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 *BScoutorderdetailatt) calc() {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+func (r *BScoutorderdetailatt) buildSql() string {
|
|
|
+ var sqlId utils.SQLVal = `
|
|
|
+ SELECT
|
|
|
+ to_char(t.DETAILATTID) DETAILATTID,
|
|
|
+ to_char(t.ORDERID) ORDERID,
|
|
|
+ t.GOODSID,
|
|
|
+ t.CUSTOMSNO,
|
|
|
+ to_char(t.JCKDATE, 'yyyy-mm-dd') JCKDATE,
|
|
|
+ t.NETWEIGHTCT,
|
|
|
+ t.CURNETWEIGHTCT,
|
|
|
+ t.REMAINNETWEIGHTCT,
|
|
|
+ t.NETWEIGHTGM,
|
|
|
+ t.CURNETWEIGHTGM,
|
|
|
+ t.REMAINCURNETWEIGHTGM,
|
|
|
+ t.TOTALPRICE,
|
|
|
+ t.CURTOTALPRICE,
|
|
|
+ t.REMAINTOTALPRICE,
|
|
|
+ t.CUSTOMSVALUE,
|
|
|
+ t.CURCUSTOMSVALUE,
|
|
|
+ t.REMAINCUSTOMSVALUE,
|
|
|
+ t.USERID,
|
|
|
+ a.GOODSNUM,
|
|
|
+ a.GOODSNAME,
|
|
|
+ a.COUNTRYNAME,
|
|
|
+ a.REPORTUNIT,
|
|
|
+ a.LEGALUNIT,
|
|
|
+ a.UNITPRICE,
|
|
|
+ a.CURRENCYNAME,
|
|
|
+ a.EXECUTIONFLAG,
|
|
|
+ a.STORAGEPERIOD
|
|
|
+ FROM GZ_BSCOUTORDERDETAILATT t
|
|
|
+ WHERE t.USERID = %v AND t.ORDERID = %v
|
|
|
+ ORDER BY a.GOODSNAME, t.JCKDATE
|
|
|
+ `
|
|
|
+
|
|
|
+ sqlId.FormatParam(r.USERID, r.ORDERID)
|
|
|
+
|
|
|
+ sqlId.Page(r.Page, r.PageSize)
|
|
|
+ return sqlId.String()
|
|
|
+}
|
|
|
+
|
|
|
+func (r *BScoutorderdetailatt) GetDataByPage() (interface{}, error, int, int, int) {
|
|
|
+ sData := make([]BScoutorderdetailatt, 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
|
|
|
+}
|