123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- package http
- import (
- "kpt.xdmy/apiserver/model"
- "kpt.xdmy/pkg/util"
- )
- type ChargeOffReq struct {
- Dest `json:"DEST"`
- Data ChargeOff `json:"DATA"`
- }
- type ChargeOffDetail struct {
- RowNumber int `json:"ZEILE"`
- }
- type ChargeOff struct {
- ProofCode string `json:"MBLNR"` // 物料凭证号
- ProofYear string `json:"MJAHR"` // 物料凭证年度
- ChargeDate string `json:"BUDAT"` // 凭证中的过帐日期 YYYYMMDD
- OrderNumber string `json:"FRBNR"` // 设备管理平台单号
- RowsNumber []ChargeOffDetail `json:"TMSEG"` // 设备管理平台行号
- HasTicket string `json:"ZTHFLG"` // 是否已开票退货单 "是: X ,※仅采购业务需要
- }
- func (c *ChargeOffReq) NewDest() {
- c.Dest = Dest{
- DestID: "EQMAN",
- BussTp: "MM015",
- Url: "https://app.modernfarming.cn:7443/sap/Common/MM015/CancelMblnr",
- }
- }
- func (c *ChargeOffReq) NewReq(p *model.ProofReq) {
- c.NewDest()
- h := ChargeOff{
- ProofCode: p.ProofCode,
- ProofYear: p.ProofYear,
- ChargeDate: p.ChargeDate,
- OrderNumber: p.OrderNumber,
- HasTicket: util.ZeroStr(p.HasTicket == 1, "X"),
- }
- s := make([]ChargeOffDetail, len(p.RowsNumber))
- for v := range p.RowsNumber {
- s = append(s, ChargeOffDetail{RowNumber: v})
- }
- h.RowsNumber = s
- c.Data = h
- }
|