update: cus-eng-con-sys
parent
473746944d
commit
faf0beacf6
@ -0,0 +1,55 @@
|
|||||||
|
package model
|
||||||
|
|
||||||
|
import (
|
||||||
|
"cu-helper/cus-eng-con-sys/cryptokit"
|
||||||
|
"reflect"
|
||||||
|
)
|
||||||
|
|
||||||
|
/*
|
||||||
|
http://10.202.2.108:8086/zjgd/frm/acceptanceComfirmController/toAcceptanceComfirm?businessKey=ig0+wuJz1ydtzu4VbmlXigelzjrHpK2M95FWj1QqFZhIXAPC/wQsSLtbQzJMombk&processInstanceId=hOVgJWbcGMSpwlAyOahXOQ==&taskDefinitionKey=TbtfJ6chgqzgSldk3ONCqQ==&taskId=RjahQdQO070+0msrB5z0rQ==&startLink=Jy0nsEWMSdJA3lqME93vgA==&endLink=Jy0nsEWMSdJA3lqME93vgA==&taskflag=facpUhYPtTztlU3uwUpNpA==&ranstr=4rUNDFPWHZwTW36OfKVg1jT7bnoF1dg4/dR2wgtzWnQ=×tamp=1RhySb/bDJGzULZTDF2g4Q==&_=1720262226902
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
用途
|
||||||
|
1、/zjgd/frm/pdmProductionController/updatePdmProduction.action时入参使用
|
||||||
|
*/
|
||||||
|
|
||||||
|
type GoPdmEntrustEdit struct {
|
||||||
|
BusinessKey string `map:"businessKey"`
|
||||||
|
ProcessInstanceId string `map:"processInstanceId"`
|
||||||
|
TaskDefinitionKey string `map:"taskDefinitionKey"`
|
||||||
|
TaskId string `map:"taskId"`
|
||||||
|
StartLink string `map:"startLink"`
|
||||||
|
EndLink string `map:"endLink"`
|
||||||
|
TaskFlag string `map:"taskflag"`
|
||||||
|
Ranstr string `map:"ranstr"`
|
||||||
|
Timestamp string `map:"timestamp"`
|
||||||
|
TimestampPro string `map:"_"` //工建原始请求key就这样
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewGoPdmEntrustEdit(businessKey, processInstId, taskId string) *GoPdmEntrustEdit {
|
||||||
|
goPdmEntrustEdit := new(GoPdmEntrustEdit)
|
||||||
|
goPdmEntrustEdit.BusinessKey = businessKey
|
||||||
|
goPdmEntrustEdit.ProcessInstanceId = processInstId
|
||||||
|
goPdmEntrustEdit.TaskDefinitionKey = "JSFAWT"
|
||||||
|
goPdmEntrustEdit.TaskId = taskId //等于id
|
||||||
|
goPdmEntrustEdit.StartLink = "false"
|
||||||
|
goPdmEntrustEdit.EndLink = "false"
|
||||||
|
goPdmEntrustEdit.TaskFlag = "db"
|
||||||
|
goPdmEntrustEdit.Ranstr = cryptokit.RandomStr(true, 10, 32)
|
||||||
|
goPdmEntrustEdit.Timestamp = cryptokit.GetTimeStamp()
|
||||||
|
goPdmEntrustEdit.encrypt()
|
||||||
|
//这个最终不加密
|
||||||
|
goPdmEntrustEdit.TimestampPro = cryptokit.GetTimeStamp()
|
||||||
|
return goPdmEntrustEdit
|
||||||
|
}
|
||||||
|
|
||||||
|
func (th *GoPdmEntrustEdit) 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()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,87 @@
|
|||||||
|
package model
|
||||||
|
|
||||||
|
import (
|
||||||
|
"cu-helper/cus-eng-con-sys/cryptokit"
|
||||||
|
"cu-helper/cus-eng-con-sys/util"
|
||||||
|
"github.com/mizuki1412/go-core-kit/service/logkit"
|
||||||
|
"reflect"
|
||||||
|
)
|
||||||
|
|
||||||
|
/*
|
||||||
|
http://10.202.2.108:8086/zjgd/frm/pdmProductionController/updatePdmProduction.action
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
用途
|
||||||
|
1、updatePdmProduction入参
|
||||||
|
*/
|
||||||
|
|
||||||
|
type UpdatePdmProduction struct {
|
||||||
|
RemandTouzi string `map:"remandTouzi"`
|
||||||
|
RemandId string `map:"remandId"`
|
||||||
|
BuildAttr string `map:"buildAttr"`
|
||||||
|
PdmServiceProviderId string `map:"pdmServiceProviderId"`
|
||||||
|
PdmProjReceiverId string `map:"pdmProjReceiverId"`
|
||||||
|
BuildModel string `map:"buildModel"`
|
||||||
|
GovEnterpId string `map:"govEnterpId"`
|
||||||
|
ResourceType string `map:"resourceType"`
|
||||||
|
IsNewNational string `map:"isNewNational"`
|
||||||
|
SupervisorProviderId string `map:"supervisorProviderId"`
|
||||||
|
SupervisorReceiverId string `map:"supervisorReceiverId"`
|
||||||
|
Ranstr string `map:"ranstr"`
|
||||||
|
Timestamp string `map:"timestamp"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewUpdatePdmProduction(remandId, html, taskTitle string) *UpdatePdmProduction {
|
||||||
|
updatePdmProduction := new(UpdatePdmProduction)
|
||||||
|
remandTouzi := util.RegexpFindFirst(html, `投资\s*(\d+(?:\.\d+)?)\s*元`)
|
||||||
|
updatePdmProduction.RemandTouzi = remandTouzi
|
||||||
|
updatePdmProduction.RemandId = remandId
|
||||||
|
updatePdmProduction.BuildAttr = "PT"
|
||||||
|
updatePdmProduction.PdmServiceProviderId = "1538321"
|
||||||
|
updatePdmProduction.PdmProjReceiverId = "3083564"
|
||||||
|
updatePdmProduction.BuildModel = "ZJ"
|
||||||
|
updatePdmProduction.GovEnterpId = ""
|
||||||
|
updatePdmProduction.ResourceType = "undefined"
|
||||||
|
updatePdmProduction.IsNewNational = "0"
|
||||||
|
updatePdmProduction.SupervisorProviderId = "309320681"
|
||||||
|
updatePdmProduction.SupervisorReceiverId = "3098707"
|
||||||
|
updatePdmProduction.Ranstr = cryptokit.RandomStr(true, 10, 32)
|
||||||
|
updatePdmProduction.Timestamp = cryptokit.GetTimeStamp()
|
||||||
|
logkit.Info(taskTitle + " 投资:" + remandTouzi + "元")
|
||||||
|
return updatePdmProduction
|
||||||
|
}
|
||||||
|
|
||||||
|
// GenReqParam 返回加密后的请求参数
|
||||||
|
func (th *UpdatePdmProduction) GenReqParam() map[string]string {
|
||||||
|
th.encrypt()
|
||||||
|
return th.structToMap()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (th *UpdatePdmProduction) 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 *UpdatePdmProduction) 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()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue