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.

259 lines
13 KiB
Go

package model
import (
"cu-helper/cus-eng-con-sys/cryptokit"
"cu-helper/cus-eng-con-sys/util"
"reflect"
"time"
)
/*
/zjgd/frm/actInfoController/updateActInfo
*/
/*
用途
完工确认(扩容需要填写完工时间,需要调用这个接口)
*/
type UpdateActInfo struct {
RemandName string `map:"remandName"`
RemandCode string `map:"remandCode"`
ProjectName string `map:"projectName"`
ProjectCode string `map:"projectCode"`
CityName string `map:"cityName"`
City string `map:"city"`
ReplyInvestment string `map:"replyInvestment"`
StaffName string `map:"staffName"`
MobilPhone string `map:"mobilPhone"`
RemandStartDate string `map:"remandStartDate"`
BuildAddress string `map:"buildAddress"`
ActualFinishDate string `map:"actualFinishDate"`
EponNum string `map:"eponNum"`
GponNum string `map:"gponNum"`
Epon10Num string `map:"epon10Num"`
Gpon10gNum string `map:"gpon10gNum"`
BuildPonNum string `map:"buildPonNum"`
OltTypess string `map:"oltTypess"`
OltPortNum string `map:"oltPortNum"`
BuildSwithNum string `map:"buildSwithNum"`
OltInvestment string `map:"oltInvestment"`
SwithInvestment string `map:"swithInvestment"`
PonPrice string `map:"ponPrice"`
CoverTypeToRemind string `map:"coverTypeToRemind"`
FenceAddressType string `map:"fenceAddressType"`
UpPonType string `map:"upPonType"`
AccessWay string `map:"accessWay"`
ODNCoverReason string `map:"ODNCoverReason"`
BroadbandPortNum string `map:"broadbandPortNum"`
TipPortNum string `map:"tipPortNum"`
CascadePort string `map:"cascadePort"`
FtthPortNum string `map:"ftthPortNum"`
PonLan10gNum string `map:"ponLan10gNum"`
FiberBoxNum string `map:"fiberBoxNum"`
BuildTotalNum string `map:"buildTotalNum"`
CoverBuildTotalNum string `map:"coverBuildTotalNum"`
CoverBuildNum string `map:"coverBuildNum"`
ResiTotalNum string `map:"resiTotalNum"`
CoverResiTotalNum string `map:"coverResiTotalNum"`
CoverAddrNum string `map:"coverAddrNum"`
EntryLineDesc string `map:"entryLineDesc"`
PermeabilityRate string `map:"permeabilityRate"`
PonIdList string `map:"ponIdList"`
UpOltPoint string `map:"upOltPoint"`
OltIps string `map:"oltIps"`
OccupyPonNum string `map:"occupyPonNum"`
OccupyPonName string `map:"occupyPonName"`
UnselectedPonReason string `map:"unselectedPonReason"`
ActCoverBussCode string `map:"actCoverBussCode"`
CablePostion string `map:"cablePostion"`
IsPerpendLine string `map:"isPerpendLine"`
AccessEquipment string `map:"accessEquipment"`
ScpectPorg string `map:"scpectPorg"`
ActStartOrgId string `map:"actStartOrgId"`
ActStartOrgName string `map:"actStartOrgName"`
ActOrgCode string `map:"actOrgCode"`
OrgName string `map:"orgName"`
Phone string `map:"phone"`
BuildLimitedType string `map:"buildLimitedType"`
ActLimitType string `map:"actLimitType"`
BuildLimitedDays string `map:"buildLimitedDays"`
ActFinishDate string `map:"actFinishDate"`
ActStartDesc string `map:"actStartDesc"`
ActFinishDesc string `map:"actFinishDesc"`
Token string `map:"token"`
ActId string `map:"actId"`
RemandId string `map:"remandId"`
SplitRemandId string `map:"splitRemandId"`
IsSplitedRemand string `map:"isSplitedRemand"`
SaveOrUpdateType string `map:"saveOrUpdateType"`
Prov string `map:"prov"`
BussCode string `map:"bussCode"`
ProcInsId string `map:"procInsId"`
BuildType1 string `map:"buildType1"`
SpecCC string `map:"specCC"`
SpecB string `map:"specB"`
BuildModel string `map:"buildModel"`
Countys string `map:"countys"`
LinkCode string `map:"linkCode"`
BusiId string `map:"busiId'"` //这是工建的bug
TaskIds string `map:"taskIds"`
SpecC string `map:"specC"`
Pass string `map:"pass"`
ActStartDate string `map:"actStartDate"`
TaskDefinitionKeys string `map:"taskDefinitionKeys"`
AttachCountyCode string `map:"attachCountyCode"`
IsCross string `map:"isCross"`
InvestmentConfigId string `map:"investmentConfigId"`
IsGrid string `map:"isGrid"`
AttactGrid string `map:"attactGrid"`
ResourceGridOrg string `map:"resourceGridOrg"`
GridId string `map:"gridId"`
IsExist string `map:"isExist"`
IsNewNational string `map:"isNewNational"`
VoicePortNum string `map:"voicePortNum"`
Ranstr string `map:"ranstr"`
Timestamp string `map:"timestamp"`
}
func NewUpdateActInfo(html string) *UpdateActInfo {
updateActInfo := new(UpdateActInfo)
updateActInfo.RemandName = util.HTMLContentFindFirst(html, "remandName")
updateActInfo.RemandCode = util.HTMLContentFindFirst(html, "remandCode")
updateActInfo.ProjectName = util.HTMLContentFindFirst(html, "projectName")
updateActInfo.ProjectCode = util.HTMLContentFindFirst(html, "projectCode")
updateActInfo.CityName = util.HTMLContentFindFirst(html, "cityName")
updateActInfo.City = util.HTMLContentFindFirst(html, "city")
updateActInfo.ReplyInvestment = util.HTMLContentFindFirst(html, "replyInvestment")
updateActInfo.StaffName = util.HTMLContentFindFirst(html, "staffName")
updateActInfo.MobilPhone = util.HTMLContentFindFirst(html, "mobilPhone")
updateActInfo.RemandStartDate = util.HTMLContentFindFirst(html, "remandStartDate")
updateActInfo.BuildAddress = util.HTMLContentFindFirst(html, "buildAddress")
updateActInfo.ActualFinishDate = util.HTMLContentFindFirst(html, "actualFinishDate")
t, _ := time.Parse("2006-01-02 15:04:05", util.HTMLContentFindFirst(html, "actStartDate"))
if t.String() == "0001-01-01 00:00:00 +0000 UTC" {
updateActInfo.ActualFinishDate = ""
} else {
newDate := t.Add(48 * time.Hour).Format("2006-01-02")
updateActInfo.ActualFinishDate = newDate
}
updateActInfo.EponNum = util.HTMLContentFindFirst(html, "eponNum")
updateActInfo.GponNum = util.HTMLContentFindFirst(html, "gponNum")
updateActInfo.Epon10Num = util.HTMLContentFindFirst(html, "epon10Num")
updateActInfo.Gpon10gNum = util.HTMLContentFindFirst(html, "gpon10gNum")
updateActInfo.BuildPonNum = util.HTMLContentFindFirst(html, "buildPonNum")
updateActInfo.OltTypess = util.HTMLContentFindFirst(html, "oltTypess")
updateActInfo.OltPortNum = util.HTMLContentFindFirst(html, "oltPortNum")
updateActInfo.BuildSwithNum = util.HTMLContentFindFirst(html, "buildSwithNum")
updateActInfo.OltInvestment = util.HTMLContentFindFirst(html, "oltInvestment")
updateActInfo.SwithInvestment = util.HTMLContentFindFirst(html, "swithInvestment")
updateActInfo.PonPrice = util.HTMLContentFindFirst(html, "ponPrice")
updateActInfo.CoverTypeToRemind = util.HTMLContentFindFirst(html, "coverTypeToRemind")
updateActInfo.FenceAddressType = util.HTMLContentFindFirst(html, "fenceAddressType")
updateActInfo.UpPonType = util.HTMLContentFindFirst(html, "upPonType")
updateActInfo.AccessWay = util.HTMLContentFindFirst(html, "accessWay")
updateActInfo.ODNCoverReason = util.HTMLContentFindFirst(html, "ODNCoverReason")
updateActInfo.BroadbandPortNum = util.HTMLContentFindFirst(html, "broadbandPortNum")
updateActInfo.TipPortNum = util.HTMLContentFindFirst(html, "tipPortNum")
updateActInfo.CascadePort = util.HTMLContentFindFirst(html, "cascadePort")
updateActInfo.FtthPortNum = util.HTMLContentFindFirst(html, "ftthPortNum")
updateActInfo.PonLan10gNum = util.HTMLContentFindFirst(html, "ponLan10gNum")
updateActInfo.FiberBoxNum = util.HTMLContentFindFirst(html, "fiberBoxNum")
updateActInfo.BuildTotalNum = util.HTMLContentFindFirst(html, "buildTotalNum")
updateActInfo.CoverBuildTotalNum = util.HTMLContentFindFirst(html, "coverBuildTotalNum")
updateActInfo.CoverBuildNum = util.HTMLContentFindFirst(html, "coverBuildNum")
updateActInfo.ResiTotalNum = util.HTMLContentFindFirst(html, "resiTotalNum")
updateActInfo.CoverResiTotalNum = util.HTMLContentFindFirst(html, "coverResiTotalNum")
updateActInfo.CoverAddrNum = util.HTMLContentFindFirst(html, "coverAddrNum")
updateActInfo.EntryLineDesc = util.HTMLContentFindFirst(html, "entryLineDesc")
updateActInfo.PermeabilityRate = util.HTMLContentFindFirst(html, "permeabilityRate")
updateActInfo.PonIdList = util.HTMLContentFindFirst(html, "ponIdList")
updateActInfo.UpOltPoint = util.HTMLContentFindFirst(html, "upOltPoint")
updateActInfo.OltIps = util.HTMLContentFindFirst(html, "oltIps")
updateActInfo.OccupyPonNum = util.HTMLContentFindFirst(html, "occupyPonNum")
updateActInfo.OccupyPonName = util.HTMLContentFindFirst(html, "occupyPonName")
updateActInfo.UnselectedPonReason = util.HTMLContentFindFirst(html, "unselectedPonReason")
updateActInfo.ActCoverBussCode = util.HTMLContentFindFirst(html, "actCoverBussCode")
updateActInfo.CablePostion = util.HTMLContentFindFirst(html, "cablePostion")
updateActInfo.IsPerpendLine = util.HTMLContentFindFirst(html, "isPerpendLine")
updateActInfo.AccessEquipment = util.HTMLContentFindFirst(html, "accessEquipment")
updateActInfo.ScpectPorg = util.HTMLContentFindFirst(html, "scpectPorg")
updateActInfo.ActStartOrgId = util.HTMLContentFindFirst(html, "actStartOrgId")
updateActInfo.ActStartOrgName = util.HTMLContentFindFirst(html, "actStartOrgName")
updateActInfo.ActOrgCode = util.HTMLContentFindFirst(html, "actOrgCode")
updateActInfo.OrgName = util.HTMLContentFindFirst(html, "orgName")
updateActInfo.Phone = util.HTMLContentFindFirst(html, "phone")
updateActInfo.BuildLimitedType = util.HTMLContentFindFirst(html, "buildLimitedType")
updateActInfo.ActLimitType = util.HTMLContentFindFirst(html, "actLimitType")
updateActInfo.BuildLimitedDays = util.HTMLContentFindFirst(html, "buildLimitedDays")
updateActInfo.ActFinishDate = util.HTMLContentFindFirst(html, "actFinishDate")
updateActInfo.ActStartDesc = util.HTMLContentFindFirst(html, "actStartDesc")
updateActInfo.ActFinishDesc = util.HTMLContentFindFirst(html, "actFinishDesc")
updateActInfo.Token = util.HTMLContentFindFirst(html, "token")
updateActInfo.ActId = util.HTMLContentFindFirst(html, "actId")
updateActInfo.RemandId = util.HTMLContentFindFirst(html, "remandId")
updateActInfo.SplitRemandId = util.HTMLContentFindFirst(html, "splitRemandId")
updateActInfo.IsSplitedRemand = util.HTMLContentFindFirst(html, "isSplitedRemand")
updateActInfo.SaveOrUpdateType = "2"
updateActInfo.Prov = util.HTMLContentFindFirst(html, "prov")
updateActInfo.BussCode = util.HTMLContentFindFirst(html, "bussCode")
updateActInfo.ProcInsId = util.HTMLContentFindFirst(html, "procInsId")
updateActInfo.BuildType1 = util.HTMLContentFindFirst(html, "buildType1")
updateActInfo.SpecCC = util.HTMLContentFindFirst(html, "specCC")
updateActInfo.SpecB = util.HTMLContentFindFirst(html, "specB")
updateActInfo.BuildModel = util.HTMLContentFindFirst(html, "buildModel")
updateActInfo.Countys = util.HTMLContentFindFirst(html, "countys")
updateActInfo.LinkCode = util.HTMLContentFindFirst(html, "linkCode")
updateActInfo.BusiId = util.HTMLContentFindFirst(html, "busiId") // 你标记的BUG
updateActInfo.TaskIds = util.HTMLContentFindFirst(html, "taskIds")
updateActInfo.SpecC = util.HTMLContentFindFirst(html, "specC")
updateActInfo.Pass = util.HTMLContentFindFirst(html, "pass")
updateActInfo.ActStartDate = util.HTMLContentFindFirst(html, "actStartDate")
updateActInfo.TaskDefinitionKeys = util.HTMLContentFindFirst(html, "taskDefinitionKeys")
updateActInfo.AttachCountyCode = util.HTMLContentFindFirst(html, "attachCountyCode")
updateActInfo.IsCross = util.HTMLContentFindFirst(html, "isCross")
updateActInfo.InvestmentConfigId = util.HTMLContentFindFirst(html, "investmentConfigId")
updateActInfo.IsGrid = util.HTMLContentFindFirst(html, "isGrid")
updateActInfo.AttactGrid = util.HTMLContentFindFirst(html, "attactGrid")
updateActInfo.ResourceGridOrg = util.HTMLContentFindFirst(html, "resourceGridOrg")
updateActInfo.GridId = util.HTMLContentFindFirst(html, "gridId")
updateActInfo.IsExist = util.HTMLContentFindFirst(html, "isExist")
updateActInfo.IsNewNational = util.HTMLContentFindFirst(html, "isNewNational")
updateActInfo.VoicePortNum = "0" //写死
return updateActInfo
}
// GenReqParam 返回加密后的请求参数
func (th *UpdateActInfo) GenReqParam() map[string]string {
th.encrypt()
return th.structToMap()
}
func (th *UpdateActInfo) 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 *UpdateActInfo) 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()))
}
}
}