|
@@ -97,8 +97,8 @@ func getContractServiceAndDetailList(contractId int) (serviceList []*crm.Contrac
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- templateMap := make(map[string]*fms.ContractServiceTemplate)
|
|
|
- templateIdMap := make(map[int]string)
|
|
|
+ templateMap := make(map[string]*fms.ContractServiceTemplate,0)
|
|
|
+ templateIdMap := make(map[int]string,0)
|
|
|
for _, v := range serviceTempList {
|
|
|
templateIdMap[v.ServiceTemplateId] = v.Title
|
|
|
}
|
|
@@ -111,7 +111,7 @@ func getContractServiceAndDetailList(contractId int) (serviceList []*crm.Contrac
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- fmsTemplateIdMap := make(map[int]string)
|
|
|
+ fmsTemplateIdMap := make(map[int]string,0)
|
|
|
|
|
|
newLen := len(serviceList)
|
|
|
for i := 0; newLen > i; i++ {
|
|
@@ -136,9 +136,11 @@ func getContractServiceAndDetailList(contractId int) (serviceList []*crm.Contrac
|
|
|
v.FMSServiceTemplatePId =templateMap[pTitle+v.Title].Pid
|
|
|
v.FMSPTitle = templateIdMap[v.Pid]
|
|
|
}else{
|
|
|
- v.FMSServiceTemplateId = templateMap[v.Title].ServiceTemplateId
|
|
|
+ if templateMap[v.Title] != nil {
|
|
|
+ v.FMSServiceTemplateId = templateMap[v.Title].ServiceTemplateId
|
|
|
+ v.FMSServiceTemplatePId =templateMap[v.Title].Pid
|
|
|
+ }
|
|
|
v.FMSTitle = templateIdMap[v.FMSServiceTemplateId]
|
|
|
- v.FMSServiceTemplatePId =templateMap[v.Title].Pid
|
|
|
v.FMSPTitle = templateIdMap[v.Pid]
|
|
|
}
|
|
|
}
|