Browse Source

修改打包写入plc逻辑

pull/141/head
zhangxin 3 years ago
parent
commit
150db2ac1b
1 changed files with 6 additions and 6 deletions
  1. +6
    -6
      services/jit/implments/PackOrder.service.impl.go

+ 6
- 6
services/jit/implments/PackOrder.service.impl.go View File

@ -19,6 +19,7 @@ import (
model "LAPP_ACURA_MOM_BACKEND/models/jit"
meModel "LAPP_ACURA_MOM_BACKEND/models/me"
"LAPP_ACURA_MOM_BACKEND/utils"
"encoding/hex"
"github.com/go-xorm/xorm"
json "github.com/json-iterator/go"
"github.com/kataras/iris/v12"
@ -1849,7 +1850,7 @@ func (impl *PackOrderServiceImplement) WriteSeatDataToPLC(seatData string, locat
if location == model.PACK_LOCATION_ON_LINE {
DBAddress = conf.DbConfig.OfflineDBSave
}
valueType = "String"
valueType = "Bytes"
data = baseModel.PLC{
PLCType: plcType,
PLCAddress: plcAddress,
@ -1958,14 +1959,14 @@ func (impl *PackOrderServiceImplement) SeatOfflineReadSign(data baseModel.PLC) e
func (impl *PackOrderServiceImplement) SeatOfflineWriteSeatData(data baseModel.PLC) error {
log, _ := logger.NewLogger("plc", "JIT")
//data.ValueText = hex.EncodeToString([]byte(data.ValueText.(string)))
data.ValueText = hex.EncodeToString([]byte(data.ValueText.(string)))
postData, err := json.Marshal(data)
if err != nil {
log.Error("座椅下线plc写入, 序列化座椅数据请求数据失败, error:" + err.Error())
return grmi.NewBusinessError("座椅下线plc写入, 序列化座椅数据请求数据失败, error:" + err.Error())
}
log.Debug("座椅下线plc写入, 写入座椅数据请求参数:" + string(postData) + ", url:" + conf.DbConfig.PLCWriteStringBackend)
boday, err := utils.Post(conf.DbConfig.PLCWriteStringBackend, postData)
log.Debug("座椅下线plc写入, 写入座椅数据请求参数:" + string(postData) + ", url:" + conf.DbConfig.PLCWriteBackend)
boday, err := utils.Post(conf.DbConfig.PLCWriteBackend, postData)
if err != nil {
log.Error("座椅下线plc写入,写入座椅数据调用失败, error:" + err.Error())
return grmi.NewBusinessError("座椅下线plc写入, 写入座椅数据调用失败, error:" + err.Error())
@ -2212,8 +2213,7 @@ func (impl *PackOrderServiceImplement) RepairPlcErr(user *global.User, packOrder
if packOrderError.Location == model.PACK_LOCATION_ON_LINE {
DBAddress = conf.DbConfig.OfflineDBSave
}
valueType = "String"
valueType = "Bytes"
data = baseModel.PLC{
PLCType: plcType,
PLCAddress: plcAddress,


Loading…
Cancel
Save