You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

147 lines
7.4 KiB
Go

package model
import (
"cu-helper/cus-eng-con-sys/cryptokit"
"cu-helper/cus-eng-con-sys/util"
"reflect"
)
/*
/zjgd/frm/designSchemeController/modifyDesignSchemeLogInfo?stepCode=x4VBE4FymufyJwjbSSE3yA==&processDefinitionKey=36N3BIABJT+GrtB98lHgMw==
*/
/*
用途
方案确认(目前只适用于政企零星,也只有政企零星需要在最后方案确认提交前调用这个接口,因为政企零星方案确认之后直接就工程开工了)
*/
type ModifyDesignSchemeLogInfo struct {
RemandName string `map:"remandName"`
RemandCode string `map:"remandCode"`
CreatedName string `map:"createdName"`
CreateDate string `map:"createDate"`
DelegateDate string `map:"delegateDate"`
BuildAttr string `map:"buildAttr"`
RemandTouzi string `map:"remandTouzi"`
BuildAddress string `map:"buildAddress"`
BuildScale string `map:"buildScale"`
BuildScheme string `map:"buildScheme"`
EponNum string `map:"eponNum"`
GponNum string `map:"gponNum"`
Epon10Num string `map:"epon10Num"`
Gpon10gNum string `map:"gpon10gNum"`
BuildPonNum string `map:"buildPonNum"`
OltTypes string `map:"oltTypes"`
OltPortNum string `map:"oltPortNum"`
BuildSwithNum string `map:"buildSwithNum"`
OltInvestment string `map:"oltInvestment"`
SwithInvestment string `map:"swithInvestment"`
PonPrice string `map:"ponPrice"`
ScpectPort string `map:"scpectPort"`
EquipCost string `map:"equipCost"`
EnginCost string `map:"enginCost"`
SafetyProdCost string `map:"safetyProdCost"`
SurveyCost string `map:"surveyCost"`
SupervisionCost string `map:"supervisionCost"`
OtherCost string `map:"otherCost"`
ReplyInvestment string `map:"replyInvestment"`
ContractFirInvestment string `map:"contractFirInvestment"`
ContractSecInvestment string `map:"contractSecInvestment"`
ContractThrInvestment string `map:"contractThrInvestment"`
ContractFouInvestment string `map:"contractFouInvestment"`
ContractFivInvestment string `map:"contractFivInvestment"`
PdmContent string `map:"pdmContent"`
SpecC string `map:"specC"`
RemandId string `map:"remandId"`
SkipFlag string `map:"skipFlag"`
CustTypeXr string `map:"custTypeXr"`
StoreState string `map:"storeState"`
IsGKOrder string `map:"isGKOrder"`
Token string `map:"token"`
Ranstr string `map:"ranstr"`
Timestamp string `map:"timestamp"`
}
func NewModifyDesignSchemeLogInfo(token, html1 string) *ModifyDesignSchemeLogInfo {
modifyDesignSchemeLogInfo := new(ModifyDesignSchemeLogInfo)
modifyDesignSchemeLogInfo.RemandName = util.HTMLContentFindFirst(html1, "remandName")
modifyDesignSchemeLogInfo.RemandCode = util.HTMLContentFindFirst(html1, "remandCode")
modifyDesignSchemeLogInfo.CreatedName = util.HTMLContentFindFirst(html1, "createdName")
modifyDesignSchemeLogInfo.CreateDate = util.HTMLContentFindFirst(html1, "createDate")
modifyDesignSchemeLogInfo.DelegateDate = util.HTMLContentFindFirst(html1, "delegateDate")
modifyDesignSchemeLogInfo.BuildAttr = util.HTMLContentFindFirst(html1, "buildAttr")
modifyDesignSchemeLogInfo.RemandTouzi = util.HTMLContentFindFirst(html1, "remandTouzi")
modifyDesignSchemeLogInfo.BuildAddress = util.HTMLContentFindFirst(html1, "buildAddress")
modifyDesignSchemeLogInfo.BuildScale = util.HTMLContentFindFirst(html1, "buildScale")
modifyDesignSchemeLogInfo.BuildScheme = util.HTMLContentFindFirst(html1, "buildScheme")
modifyDesignSchemeLogInfo.EponNum = util.HTMLContentFindFirst(html1, "eponNum")
modifyDesignSchemeLogInfo.GponNum = util.HTMLContentFindFirst(html1, "gponNum")
modifyDesignSchemeLogInfo.Epon10Num = util.HTMLContentFindFirst(html1, "epon10Num")
modifyDesignSchemeLogInfo.Gpon10gNum = util.HTMLContentFindFirst(html1, "gpon10gNum")
modifyDesignSchemeLogInfo.BuildPonNum = util.HTMLContentFindFirst(html1, "buildPonNum")
modifyDesignSchemeLogInfo.OltTypes = util.HTMLContentFindFirst(html1, "oltTypes")
modifyDesignSchemeLogInfo.OltPortNum = util.HTMLContentFindFirst(html1, "oltPortNum")
modifyDesignSchemeLogInfo.BuildSwithNum = util.HTMLContentFindFirst(html1, "buildSwithNum")
modifyDesignSchemeLogInfo.OltInvestment = util.HTMLContentFindFirst(html1, "oltInvestment")
modifyDesignSchemeLogInfo.SwithInvestment = util.HTMLContentFindFirst(html1, "swithInvestment")
modifyDesignSchemeLogInfo.PonPrice = util.HTMLContentFindFirst(html1, "ponPrice")
modifyDesignSchemeLogInfo.ScpectPort = util.HTMLContentFindFirst(html1, "scpectPort")
modifyDesignSchemeLogInfo.EquipCost = util.HTMLContentFindFirst(html1, "equipCost")
modifyDesignSchemeLogInfo.EnginCost = util.HTMLContentFindFirst(html1, "enginCost")
modifyDesignSchemeLogInfo.SafetyProdCost = util.HTMLContentFindFirst(html1, "safetyProdCost")
modifyDesignSchemeLogInfo.SurveyCost = util.HTMLContentFindFirst(html1, "surveyCost")
modifyDesignSchemeLogInfo.SupervisionCost = util.HTMLContentFindFirst(html1, "supervisionCost")
modifyDesignSchemeLogInfo.OtherCost = util.HTMLContentFindFirst(html1, "otherCost")
modifyDesignSchemeLogInfo.ReplyInvestment = util.HTMLContentFindFirst(html1, "replyInvestment")
modifyDesignSchemeLogInfo.ContractFirInvestment = util.HTMLContentFindFirst(html1, "contractFirInvestment")
modifyDesignSchemeLogInfo.ContractSecInvestment = util.HTMLContentFindFirst(html1, "contractSecInvestment")
modifyDesignSchemeLogInfo.ContractThrInvestment = util.HTMLContentFindFirst(html1, "contractThrInvestment")
modifyDesignSchemeLogInfo.ContractFouInvestment = util.HTMLContentFindFirst(html1, "contractFouInvestment")
modifyDesignSchemeLogInfo.ContractFivInvestment = util.HTMLContentFindFirst(html1, "contractFivInvestment")
modifyDesignSchemeLogInfo.PdmContent = util.HTMLContentFindFirst(html1, "pdmContent")
modifyDesignSchemeLogInfo.SpecC = util.HTMLContentFindFirst(html1, "specC")
modifyDesignSchemeLogInfo.RemandId = util.HTMLContentFindFirst(html1, "remandId")
modifyDesignSchemeLogInfo.SkipFlag = util.HTMLContentFindFirst(html1, "skipFlag")
modifyDesignSchemeLogInfo.CustTypeXr = util.HTMLContentFindFirst(html1, "custTypeXr")
modifyDesignSchemeLogInfo.StoreState = util.HTMLContentFindFirst(html1, "storeState")
modifyDesignSchemeLogInfo.IsGKOrder = util.HTMLContentFindFirst(html1, "isGKOrder")
modifyDesignSchemeLogInfo.Token = token
modifyDesignSchemeLogInfo.Ranstr = cryptokit.RandomStr(true, 10, 32)
modifyDesignSchemeLogInfo.Timestamp = cryptokit.GetTimeStamp()
return modifyDesignSchemeLogInfo
}
// GenReqParam 返回加密后的请求参数
func (th *ModifyDesignSchemeLogInfo) GenReqParam() map[string]string {
th.encrypt()
return th.structToMap()
}
func (th *ModifyDesignSchemeLogInfo) structToMap() map[string]string {
result := make(map[string]string)
t := reflect.TypeOf(*th)
v := reflect.ValueOf(*th)
for i := 0; i < t.NumField(); i++ {
field := t.Field(i)
value := v.Field(i)
// Use the tag value as the key in the map, if it exists; otherwise, use the field name.
tag := field.Tag.Get("map")
if tag == "" {
tag = field.Name
}
result[tag] = value.String()
}
return result
}
func (th *ModifyDesignSchemeLogInfo) encrypt() {
v := reflect.ValueOf(th).Elem()
for i := 0; i < v.NumField(); i++ {
field := v.Field(i)
if field.CanSet() {
field.SetString(cryptokit.Encrypt(field.String()))
}
}
}