|
@@ -2,6 +2,7 @@ package controllers
|
|
|
|
|
|
import (
|
|
|
"encoding/json"
|
|
|
+ "fmt"
|
|
|
"github.com/rdlucklib/rdluck_tools/paging"
|
|
|
"hongze/hongze_cygx/models"
|
|
|
"hongze/hongze_cygx/services"
|
|
@@ -165,8 +166,25 @@ func (this *ReportSelectionController) Detail() {
|
|
|
if v2.Label != "" {
|
|
|
v2.CompanyLabel = strings.Split(v2.Label, "{|}")
|
|
|
}
|
|
|
+ if v2.SubjectName == "" {
|
|
|
+ v2.ShowName = v2.IndustrialManagementNames
|
|
|
+ } else {
|
|
|
+ v2.ShowName = v2.SubjectName
|
|
|
+ }
|
|
|
+ }
|
|
|
+ subjectItem := new(models.ReportSelectionChartLogSubjectName)
|
|
|
+ subjectItem.SubjectName = v2.SubjectName
|
|
|
+ subjectItem.IsNew = v2.IsNew
|
|
|
+ subjectItem.IndustrialSubjectId = v2.IndustrialSubjectId
|
|
|
+ subjectItem.IndustrialManagementId, _ = strconv.Atoi(v2.IndustrialManagementId)
|
|
|
+ subjectItem.IndustrialManagementName = v2.IndustrialManagementNames
|
|
|
+ if subjectItem.SubjectName == "" {
|
|
|
+ subjectItem.SubjectName = subjectItem.IndustrialManagementName
|
|
|
}
|
|
|
- itemSubject.ListSubject = append(itemSubject.ListSubject, &models.ReportSelectionChartLogSubjectName{SubjectName: v2.SubjectName, IsNew: v2.IsNew, IndustrialSubjectId: v2.IndustrialSubjectId})
|
|
|
+ subjectItem.Md5String = utils.MD5(fmt.Sprint("IN_ID", v2.IndustrialManagementId, "S_ID", v2.IndustrialSubjectId))
|
|
|
+ v2.Md5String = subjectItem.Md5String
|
|
|
+ itemSubject.ListSubject = append(itemSubject.ListSubject, subjectItem)
|
|
|
+ //itemSubject.ListSubject = append(itemSubject.ListSubject, &models.ReportSelectionChartLogSubjectName{SubjectName: v2.SubjectName, IsNew: v2.IsNew, IndustrialSubjectId: v2.IndustrialSubjectId})
|
|
|
}
|
|
|
item.BodyChartSummary = mapChartLog[v.PermissionName]
|
|
|
item.List = listSonLog
|
|
@@ -237,21 +255,23 @@ func (this *ReportSelectionController) ClickHistory() {
|
|
|
br.ErrMsg = "文章不存在,文章ID错误"
|
|
|
return
|
|
|
}
|
|
|
- if req.IndustrialSubjectId <= 0 {
|
|
|
+ if req.IndustrialSubjectId+req.IndustrialManagementId <= 0 {
|
|
|
br.Msg = "标的ID不存在"
|
|
|
- br.ErrMsg = "标的ID不存在,标的ID错误"
|
|
|
+ br.ErrMsg = "产业或标的ID不存在"
|
|
|
return
|
|
|
}
|
|
|
item := models.CygxReportSelectionSubjectHistory{
|
|
|
- UserId: user.UserId,
|
|
|
- ArticleId: req.ArticleId,
|
|
|
- CreateTime: time.Now(),
|
|
|
- ModifyTime: time.Now(),
|
|
|
- Mobile: user.Mobile,
|
|
|
- Email: user.Email,
|
|
|
- CompanyId: user.CompanyId,
|
|
|
- CompanyName: user.CompanyName,
|
|
|
- IndustrialSubjectId: req.IndustrialSubjectId,
|
|
|
+ UserId: user.UserId,
|
|
|
+ ArticleId: req.ArticleId,
|
|
|
+ CreateTime: time.Now(),
|
|
|
+ ModifyTime: time.Now(),
|
|
|
+ Mobile: user.Mobile,
|
|
|
+ Email: user.Email,
|
|
|
+ CompanyId: user.CompanyId,
|
|
|
+ CompanyName: user.CompanyName,
|
|
|
+ IndustrialSubjectId: req.IndustrialSubjectId,
|
|
|
+ IndustrialManagementId: req.IndustrialManagementId,
|
|
|
+ RegisterPlatform: utils.REGISTER_PLATFORM,
|
|
|
}
|
|
|
err = models.AddCygxReportSelectionSubjectHistory(&item)
|
|
|
if err != nil {
|