|
@@ -8,6 +8,7 @@ import (
|
|
|
"hongze/hz_crm_api/models/company"
|
|
|
"hongze/hz_crm_api/models/statistic_report"
|
|
|
"hongze/hz_crm_api/models/system"
|
|
|
+ cygxService "hongze/hz_crm_api/services/cygx"
|
|
|
"hongze/hz_crm_api/utils"
|
|
|
"strconv"
|
|
|
"strings"
|
|
@@ -406,6 +407,9 @@ func (this *StatisticRaiDataSummaryController) RaiDataSummaryDetail() {
|
|
|
resp := new(statistic_report.RaiDataSummaryPopupTypeResp)
|
|
|
var listResp []*statistic_report.RaiDataSummaryDetailResp
|
|
|
var trialTotal int
|
|
|
+
|
|
|
+ var condition string
|
|
|
+ var pars []interface{}
|
|
|
switch popupType {
|
|
|
case "新增试用":
|
|
|
var parsTry []interface{}
|
|
@@ -447,6 +451,56 @@ func (this *StatisticRaiDataSummaryController) RaiDataSummaryDetail() {
|
|
|
listResp = append(listResp, item)
|
|
|
}
|
|
|
}
|
|
|
+ case "新签合同":
|
|
|
+
|
|
|
+ if sellerId > 0 {
|
|
|
+ condition += ` AND a.seller_id_init = ? `
|
|
|
+ pars = append(pars, sellerId)
|
|
|
+ }
|
|
|
+
|
|
|
+ condition += ` AND a.status = 1 AND a.start_date >= ? AND a.start_date <= ? `
|
|
|
+ pars = append(pars, startDate, endDate)
|
|
|
+ condition += ` AND a.rai_contract_type = ? `
|
|
|
+ pars = append(pars, "新签合同")
|
|
|
+
|
|
|
+ total, err := company.GetIncrementalNewCompanyProductMergeCount(condition, pars)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ trialTotal = total
|
|
|
+ //列表页数据
|
|
|
+ tmpList, err := models.GetIncrementalCompanyMergeList(condition, pars, startSize, pageSize)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if len(tmpList) > 0 {
|
|
|
+ var companyContractIds []int
|
|
|
+ for _, v := range tmpList {
|
|
|
+ companyContractIds = append(companyContractIds, v.CompanyContractId)
|
|
|
+ }
|
|
|
+
|
|
|
+ //合并合同所对应的权限
|
|
|
+ mappermissionName, err := cygxService.GetCompanyContractPermissionNameMapById(companyContractIds)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ for _, v := range tmpList {
|
|
|
+ item := new(statistic_report.RaiDataSummaryDetailResp)
|
|
|
+ item.CompanyName = v.CompanyName
|
|
|
+ item.SellerName = v.SellerNameInit
|
|
|
+ item.StartDate = v.StartDate
|
|
|
+ item.EndDate = v.EndDate
|
|
|
+ item.Money = v.Money
|
|
|
+ item.PermissionName = mappermissionName[v.CompanyContractId]
|
|
|
+ listResp = append(listResp, item)
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if len(listResp) == 0 {
|