|
@@ -127,6 +127,8 @@ func (this *ReportSelectionController) PreserveAndPublish() {
|
|
|
if v.IndustrialManagementNames != "" {
|
|
|
item.IndustrialManagementNames = v.IndustrialManagementNames
|
|
|
}
|
|
|
+ item.ThirdId = v.ThirdId
|
|
|
+ item.ThirdName = v.ThirdName
|
|
|
item.OverviewArticleId = v.OverviewArticleId
|
|
|
item.IsNew = v.IsNew
|
|
|
item.IsShowOverviewArticle = v.IsShowOverviewArticle
|
|
@@ -422,7 +424,9 @@ func (this *ReportSelectionController) Detail() {
|
|
|
listSon[kIndustrial].IsNew = 0
|
|
|
}
|
|
|
|
|
|
- if vIndustrial.SubjectName == "" {
|
|
|
+ if vIndustrial.ThirdName != "" {
|
|
|
+ listSon[kIndustrial].ShowName = vIndustrial.ThirdName
|
|
|
+ } else if vIndustrial.SubjectName == "" {
|
|
|
listSon[kIndustrial].ShowName = vIndustrial.IndustrialManagementNames
|
|
|
} else {
|
|
|
listSon[kIndustrial].ShowName = vIndustrial.SubjectName
|
|
@@ -1100,3 +1104,66 @@ func (this *ReportSelectionController) RarryList() {
|
|
|
br.Msg = "获取成功"
|
|
|
br.Data = resp
|
|
|
}
|
|
|
+
|
|
|
+// @Title 添加三方名称
|
|
|
+// @Description 添加三方名称接口
|
|
|
+// @Param request body cygx.AddReportSelectionThirdNameReq true "type json string"
|
|
|
+// @Success Ret=200 {object} cygx.AddReportSelectionThirdNameResp
|
|
|
+// @router /reportSelection/add/third_name [post]
|
|
|
+func (this *ReportSelectionController) AddThirdName() {
|
|
|
+ br := new(models.BaseResponse).Init()
|
|
|
+ defer func() {
|
|
|
+ this.Data["json"] = br
|
|
|
+ this.ServeJSON()
|
|
|
+ }()
|
|
|
+ AdminUser := this.SysUser
|
|
|
+ if AdminUser == nil {
|
|
|
+ br.Msg = "请登录"
|
|
|
+ br.ErrMsg = "请登录,用户信息为空"
|
|
|
+ br.Ret = 408
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var req cygx.AddReportSelectionThirdNameReq
|
|
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "参数解析异常!"
|
|
|
+ br.ErrMsg = "参数解析失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ thirdName := req.ThirdName
|
|
|
+ chartPermissionId := req.ChartPermissionId
|
|
|
+ if thirdName == "" {
|
|
|
+ br.Msg = "名称不能为空"
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ // 品种信息
|
|
|
+ chartPermission, err := models.GetChartPermissionById(chartPermissionId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "品种信息有误"
|
|
|
+ br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ item := new(cygx.CygxReportSelectionThirdName)
|
|
|
+ item.ThirdName = thirdName
|
|
|
+ item.ChartPermissionId = chartPermissionId
|
|
|
+ item.ChartPermissionName = chartPermission.ChartPermissionName
|
|
|
+ item.CreateTime = time.Now()
|
|
|
+
|
|
|
+ newId, err := cygx.AddCygxReportSelectionThirdName(item)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "操作失败"
|
|
|
+ br.ErrMsg = "操作失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ resp := new(cygx.AddReportSelectionThirdNameResp)
|
|
|
+ resp.ThirdName = thirdName
|
|
|
+ resp.ThirdId = fmt.Sprint(newId)
|
|
|
+ br.Ret = 200
|
|
|
+ br.Data = resp
|
|
|
+ br.Success = true
|
|
|
+ br.Msg = "操作成功"
|
|
|
+ br.IsAddLog = true
|
|
|
+}
|