| | |
| | | "nsq_server": "121.31.232.83:4150", |
| | | "nsq_webapi": "http://121.31.232.83:9080/api/nsq/pub?topic=your_topic", |
| | | "order_topic": "aps.wangpengfei.erp.seorder", |
| | | "bom_topic": "aps.wangpengfei.erp.icbom", |
| | | "bom_query_topic": "aps.wangpengfei.erp.querybom", |
| | | "bom_child_topic": "aps.wangpengfei.erp.bomchild", |
| | | "bom_topic": "aps.wangpengfei.erp.icBom", |
| | | "bom_query_topic": "aps.wangpengfei.erp.icBomQuery", |
| | | "bom_child_topic": "aps.wangpengfei.erp.icBomChild", |
| | | "inventory_topic": "aps.wangpengfei.erp.inventory", |
| | | "query_topic": "aps.wangpengfei.erp.k3resource", |
| | | "reply_topic": "aps.wangpengfei.erp.k3reply", |
| | | "cst_webapi": "", |
| | | "cst_query_topic": "", |
| | | "cst_reply_topic": "", |
| | | "cst_webapi": "http://localhost/cst/local_post.ashx", |
| | | "cst_query_topic": "aps.wangpengfei.erp.cstApply", |
| | | "cst_reply_topic": "aps.wangpengfei.erp.cstReply", |
| | | "interval": 60 |
| | | } |
| | |
| | | Options.InventoryTopic = "aps.factory.erp.inventory" |
| | | Options.SqlQueryTopic = "aps.factory.erp.k3resource" |
| | | Options.SqlReplyTopic = "aps.factory.erp.k3reply" |
| | | Options.CSTWebApi = "http://localhost/cst/local_post.ashx" |
| | | Options.CSTQueryTopic = "aps.factory.erp.cstApply" |
| | | Options.CSTReplyTopic = "aps.factory.erp.cstReply" |
| | | Options.SyncInterval = 60 |
| | |
| | | package kingdee |
| | | |
| | | type ICBom struct { |
| | | FInterID int // 内码 |
| | | FBOMNumber string // BOM单编号 |
| | | FUseStatus int // 使用状态码 |
| | | FUseStatusName string // 使用状态 |
| | | FItemIDNumber string // 物料代码 |
| | | FItemIDName string // 物料名称 |
| | | FModel string // 规格型号 |
| | | FErpClsID string // 物料属性 |
| | | FQty float64 // 数量 |
| | | FUnitName string // 单位 |
| | | FYield float64 // 成品率 |
| | | FRoutingIDNumber string // 工艺路线代码 |
| | | FRoutingIDName string // 工艺路线名称 |
| | | FNote string // 备注 |
| | | FBomType int // BOM类型 |
| | | FAudDate string // 更新时间 |
| | | FPDMImportDate string // 导入时间 |
| | | FStatus int // 状态 |
| | | FInterID int `gorm:"column:FInterID" json:"FInterID"` // 内码 |
| | | FBOMNumber string `gorm:"column:FBOMNumber" json:"FBOMNumber"` // BOM单编号 |
| | | FUseStatus int `gorm:"column:FUseStatus" json:"FUseStatus"` // 使用状态码 |
| | | FUseStatusName string `gorm:"column:FUseStatusName" json:"FUseStatusName"` // 使用状态 |
| | | FItemIDNumber string `gorm:"column:FItemIDNumber" json:"FItemIDNumber"` // 物料代码 |
| | | FItemIDName string `gorm:"column:FItemIDName" json:"FItemIDName"` // 物料名称 |
| | | FModel string `gorm:"column:FModel" json:"FModel"` // 规格型号 |
| | | FErpClsID string `gorm:"column:FErpClsID" json:"FErpClsID"` // 物料属性 |
| | | FQty float64 `gorm:"column:FQty" json:"FQty"` // 数量 |
| | | FUnitName string `gorm:"column:FUnitName" json:"FUnitName"` // 单位 |
| | | FYield float64 `gorm:"column:FYield" json:"FYield"` // 成品率 |
| | | FRoutingIDNumber string `gorm:"column:FRoutingIDNumber" json:"FRoutingIDNumber"` // 工艺路线代码 |
| | | FRoutingIDName string `gorm:"column:FRoutingIDName" json:"FRoutingIDName"` // 工艺路线名称 |
| | | FNote string `gorm:"column:FNote" json:"FNote"` // 备注 |
| | | FBomType int `gorm:"column:FBomType" json:"FBomType"` // BOM类型 |
| | | FAudDate string `gorm:"column:FAudDate" json:"FAudDate"` // 更新时间 |
| | | FPDMImportDate string `gorm:"column:FPDMImportDate" json:"FPDMImportDate"` // 导入时间 |
| | | FStatus int `gorm:"column:FStatus" json:"FStatus"` // 状态 |
| | | } |
| | | |
| | | func BomList(fData bool) []ICBom { |
| | |
| | | |
| | | import ( |
| | | "encoding/json" |
| | | "io/ioutil" |
| | | "time" |
| | | |
| | | "kingdee-dbapi/cache" |
| | |
| | | bomList := kingdee.BomList(fData) |
| | | logger.Debug("查询到%d条Bom数据", len(bomList)) |
| | | |
| | | b, _ := json.Marshal(bomList) |
| | | |
| | | ioutil.WriteFile("bomList.tmp", b, 0644) |
| | | |
| | | // 过滤数据, 判断是否已经上报过, 请求全量数据不过滤, 直接上报 |
| | | if fData { |
| | | for i := 0; i < len(bomList); { |