|
|
@ -1,8 +1,10 @@ |
|
|
|
package calloff |
|
|
|
|
|
|
|
import ( |
|
|
|
"encoding/xml" |
|
|
|
"fmt" |
|
|
|
"github.com/go-xorm/xorm" |
|
|
|
"io" |
|
|
|
"io/ioutil" |
|
|
|
"leit.com/leit_seat_aps/common" |
|
|
|
"leit.com/leit_seat_aps/db" |
|
|
@ -11,6 +13,8 @@ import ( |
|
|
|
"leit.com/leit_seat_aps/service" |
|
|
|
"os" |
|
|
|
"regexp" |
|
|
|
"strconv" |
|
|
|
"strings" |
|
|
|
"time" |
|
|
|
) |
|
|
|
|
|
|
@ -554,6 +558,7 @@ func ParseCalloffOrder() { |
|
|
|
session.Close() |
|
|
|
etcd.G_jobLock.UnLock() |
|
|
|
time.Sleep(10 * time.Millisecond) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -703,8 +708,85 @@ func GenerateDeliveryCar() { |
|
|
|
if err != nil { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//APS向WMS传递发运包装信息
|
|
|
|
var o = PlnCalloffdataLandingXml{} |
|
|
|
o.Packorderid = pkotablst[j].Packorderid |
|
|
|
o.Packtemplateid = pkotablst[j].Packtemplateid |
|
|
|
o.Projnr = pkotablst[j].Projnr |
|
|
|
o.Status = strconv.Itoa(pkotablst[j].Status) |
|
|
|
o.Shortpack = strconv.Itoa(pkotablst[j].Shortpack) |
|
|
|
o.Orderinfo = pkotablst[j].Orderinfo |
|
|
|
o.Boxsn = pkotablst[j].Boxsn |
|
|
|
o.Packtypeid = pkotablst[j].Packtypeid |
|
|
|
o.Printerid = pkotablst[j].Printerid |
|
|
|
o.Templatefile = pkotablst[j].Templatefile |
|
|
|
o.Planqty = strconv.Itoa(pkotablst[j].Planqty) |
|
|
|
o.Actqty = strconv.Itoa(pkotablst[j].Actqty) |
|
|
|
for _, info := range pkotablst[j].Itemlst{ |
|
|
|
o.Details = append(o.Details, Pln_calloffdata_landing_Xml{ |
|
|
|
Packorderid :info.Packorderid, |
|
|
|
Pos :common.ValueToString(info.Pos,""), |
|
|
|
Poscode :info.Poscode, |
|
|
|
Oemseq : common.ValueToString(info.Oemseq, ""), |
|
|
|
Checkseq :common.ValueToString(info.Seq,""), |
|
|
|
Supplygroupid : info.Supplygroupid, |
|
|
|
Workordernr : info.Workordernr, |
|
|
|
Status : common.ValueToString(info.Status,""), |
|
|
|
Planqty :common.ValueToString(info.Planqty,""), |
|
|
|
Actqty :common.ValueToString(info.Actqty,""), |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
resXML, err := xml.MarshalIndent(o, " ", " ") |
|
|
|
if err != nil { |
|
|
|
glog.InfoExtln("Calloff包装单", "Failed to create xml due to :",err) |
|
|
|
} |
|
|
|
timeS := time.Now().Format("20060102150405.999") |
|
|
|
fileName := strings.Trim(timeS,".") |
|
|
|
f, err := os.Create("./OutData/"+fileName +".xml") |
|
|
|
if err != nil { |
|
|
|
glog.InfoExtln("Calloff包装单", "Failed to create xml due to :",err) |
|
|
|
} |
|
|
|
io.WriteString(f, xml.Header) |
|
|
|
io.WriteString(f, string(resXML)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
time.Sleep(10 * time.Second) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
type PlnCalloffdataLandingXml struct { |
|
|
|
XMLName xml.Name `xml:"Content"` |
|
|
|
Packorderid string `xml:"packorderid,attr"` |
|
|
|
Packtemplateid string `xml:"packtemplateid,attr"` |
|
|
|
Projnr string `xml:"projnr,attr"` |
|
|
|
Status string `xml:"status,attr"` |
|
|
|
Shortpack string `xml:"shortpack,attr"` |
|
|
|
Orderinfo string `xml:"orderinfo,attr"` |
|
|
|
Boxsn string `xml:"boxsn,attr"` |
|
|
|
Packtypeid string `xml:"packtypeid,attr"` |
|
|
|
Printerid string `xml:"printerid,attr"` |
|
|
|
Templatefile string `xml:"templatefile,attr"` |
|
|
|
Planqty string `xml:"planqty,attr"` |
|
|
|
Actqty string `xml:"actqty,attr"` |
|
|
|
|
|
|
|
Details []Pln_calloffdata_landing_Xml `xml:"Details"` |
|
|
|
Description string `xml:",innerxml"` |
|
|
|
} |
|
|
|
|
|
|
|
type Pln_calloffdata_landing_Xml struct { |
|
|
|
XMLName xml.Name `xml:"Details"` |
|
|
|
Packorderid string `xml:"packorderid,attr"` |
|
|
|
Pos string `xml:"pos,attr"` |
|
|
|
Poscode string `xml:"poscode,attr"` |
|
|
|
Oemseq string `xml:"oemseq,attr"` |
|
|
|
Checkseq string `xml:"checkseq,attr"` |
|
|
|
Supplygroupid string `xml:"supplygroupid,attr"` |
|
|
|
Workordernr string `xml:"workordernr,attr"` |
|
|
|
Status string `xml:"status,attr"` |
|
|
|
Planqty string `xml:"planqty,attr"` |
|
|
|
Actqty string `xml:"actqty,attr"` |
|
|
|
} |