|
@@ -72,7 +72,7 @@ func (rg *RegisterController) List(c *gin.Context) {
|
|
|
for _, v := range typeSlices {
|
|
|
if v[:1] == "0" {
|
|
|
//自付
|
|
|
- if v[1:] == "1"{
|
|
|
+ if v[1:] == "1" {
|
|
|
newCond += ` (contract_type = 1 AND has_payment=0) `
|
|
|
} else if v[1:] == "2" {
|
|
|
newCond += ` (contract_type = 2 AND has_payment=0) `
|
|
@@ -81,7 +81,7 @@ func (rg *RegisterController) List(c *gin.Context) {
|
|
|
}
|
|
|
} else {
|
|
|
//代付
|
|
|
- if v[1:] == "1"{
|
|
|
+ if v[1:] == "1" {
|
|
|
newCond += ` (contract_type = 1 AND has_payment=1) `
|
|
|
} else if v[1:] == "2" {
|
|
|
newCond += ` (contract_type = 2 AND has_payment=1) `
|
|
@@ -92,7 +92,7 @@ func (rg *RegisterController) List(c *gin.Context) {
|
|
|
newCond += " OR "
|
|
|
}
|
|
|
newCond = strings.TrimRight(newCond, "OR ")
|
|
|
- cond += " AND " + "(" +newCond + ")"
|
|
|
+ cond += " AND " + "(" + newCond + ")"
|
|
|
}
|
|
|
if req.RegisterStatus != 0 {
|
|
|
cond += ` AND register_status = ?`
|
|
@@ -1309,7 +1309,7 @@ func (rg *RegisterController) Export(c *gin.Context) {
|
|
|
for _, v := range typeSlices {
|
|
|
if v[:1] == "0" {
|
|
|
//自付
|
|
|
- if v[1:] == "1"{
|
|
|
+ if v[1:] == "1" {
|
|
|
newCond += ` (contract_type = 1 AND has_payment=0) `
|
|
|
} else if v[1:] == "2" {
|
|
|
newCond += ` (contract_type = 2 AND has_payment=0) `
|
|
@@ -1318,7 +1318,7 @@ func (rg *RegisterController) Export(c *gin.Context) {
|
|
|
}
|
|
|
} else {
|
|
|
//代付
|
|
|
- if v[1:] == "1"{
|
|
|
+ if v[1:] == "1" {
|
|
|
newCond += ` (contract_type = 1 AND has_payment=1) `
|
|
|
} else if v[1:] == "2" {
|
|
|
newCond += ` (contract_type = 2 AND has_payment=1) `
|
|
@@ -1329,7 +1329,7 @@ func (rg *RegisterController) Export(c *gin.Context) {
|
|
|
newCond += " OR "
|
|
|
}
|
|
|
newCond = strings.TrimRight(newCond, "OR ")
|
|
|
- cond += " AND " + "(" +newCond + ")"
|
|
|
+ cond += " AND " + "(" + newCond + ")"
|
|
|
}
|
|
|
if req.RegisterStatus != 0 {
|
|
|
cond += ` AND register_status = ?`
|
|
@@ -1550,25 +1550,41 @@ func (rg *RegisterController) Export(c *gin.Context) {
|
|
|
titleRow.SetHeight(40)
|
|
|
// 1行1列-右合并两格, 下合并1行
|
|
|
cell1 := titleRow.AddCell()
|
|
|
- cell1.HMerge = 4
|
|
|
+ if req.ListParam == 0 {
|
|
|
+ cell1.HMerge = 8
|
|
|
+ } else {
|
|
|
+ cell1.HMerge = 7
|
|
|
+ }
|
|
|
+
|
|
|
cell1.VMerge = 1
|
|
|
- cell1.SetString("FICC客户签约表")
|
|
|
+ cell1.SetString("客户签约表")
|
|
|
cell1.SetStyle(style)
|
|
|
// 右增两列空白格用于第一列合并, 否则后续单元格合并会有问题
|
|
|
titleRow.AddCell().SetString("")
|
|
|
titleRow.AddCell().SetString("")
|
|
|
titleRow.AddCell().SetString("")
|
|
|
titleRow.AddCell().SetString("")
|
|
|
- hInt += 5
|
|
|
+ titleRow.AddCell().SetString("")
|
|
|
+ titleRow.AddCell().SetString("")
|
|
|
+ titleRow.AddCell().SetString("")
|
|
|
+ hInt += 8
|
|
|
|
|
|
+ if req.ListParam == 0 {
|
|
|
+ //如果是全部的话要多一格
|
|
|
+ titleRow.AddCell().SetString("")
|
|
|
+ hInt += 1
|
|
|
+ }
|
|
|
// 1行2列
|
|
|
- cell2 := titleRow.AddCell()
|
|
|
- cell2.VMerge = 1
|
|
|
- cell2.SetString("FICC大套餐")
|
|
|
- cell2.SetStyle(style)
|
|
|
- hInt++
|
|
|
+ if req.ListParam != 2 {
|
|
|
+ cell2 := titleRow.AddCell()
|
|
|
+ cell2.VMerge = 1
|
|
|
+ cell2.SetString("FICC大套餐")
|
|
|
+ cell2.SetStyle(style)
|
|
|
+ hInt++
|
|
|
+ }
|
|
|
+
|
|
|
// 1行3列-右合并小套餐数
|
|
|
- if permissionLen >= 1 {
|
|
|
+ if permissionLen >= 1 && req.ListParam != 2 {
|
|
|
cell3 := titleRow.AddCell()
|
|
|
hInt++
|
|
|
cell3.HMerge = permissionLen - 1
|
|
@@ -1581,36 +1597,41 @@ func (rg *RegisterController) Export(c *gin.Context) {
|
|
|
hInt++
|
|
|
}
|
|
|
}
|
|
|
- for i := range otherService {
|
|
|
- cellOther := titleRow.AddCell()
|
|
|
- cellOther.VMerge = 1
|
|
|
- hInt++
|
|
|
- cellOther.SetString(otherService[i].Title)
|
|
|
- cellOther.SetStyle(style)
|
|
|
- }
|
|
|
-
|
|
|
- //权益大套餐
|
|
|
- cell4 := titleRow.AddCell()
|
|
|
- cell4.HMerge = 1
|
|
|
- cell4.VMerge = 1
|
|
|
- cell4.SetString("权益大套餐")
|
|
|
- cell4.SetStyle(style)
|
|
|
- titleRow.AddCell().SetString("")
|
|
|
- hInt += 2
|
|
|
|
|
|
- //权益分行业套餐
|
|
|
- cell5 := titleRow.AddCell()
|
|
|
- cell5.HMerge = 8
|
|
|
- cell5.SetString("权益分行业套餐")
|
|
|
- cell5.SetStyle(style)
|
|
|
- titleRow.AddCell().SetString("")
|
|
|
- titleRow.AddCell().SetString("")
|
|
|
- titleRow.AddCell().SetString("")
|
|
|
- titleRow.AddCell().SetString("")
|
|
|
- titleRow.AddCell().SetString("")
|
|
|
- titleRow.AddCell().SetString("")
|
|
|
- titleRow.AddCell().SetString("")
|
|
|
- titleRow.AddCell().SetString("")
|
|
|
+ if req.ListParam != 2 {
|
|
|
+ for i := range otherService {
|
|
|
+ cellOther := titleRow.AddCell()
|
|
|
+ cellOther.VMerge = 1
|
|
|
+ hInt++
|
|
|
+ cellOther.SetString(otherService[i].Title)
|
|
|
+ cellOther.SetStyle(style)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if req.ListParam != 1 {
|
|
|
+ //权益大套餐
|
|
|
+ cell4 := titleRow.AddCell()
|
|
|
+ cell4.HMerge = 1
|
|
|
+ cell4.VMerge = 1
|
|
|
+ cell4.SetString("权益大套餐")
|
|
|
+ cell4.SetStyle(style)
|
|
|
+ titleRow.AddCell().SetString("")
|
|
|
+ hInt += 2
|
|
|
+
|
|
|
+ //权益分行业套餐
|
|
|
+ cell5 := titleRow.AddCell()
|
|
|
+ cell5.HMerge = 8
|
|
|
+ cell5.SetString("权益分行业套餐")
|
|
|
+ cell5.SetStyle(style)
|
|
|
+ titleRow.AddCell().SetString("")
|
|
|
+ titleRow.AddCell().SetString("")
|
|
|
+ titleRow.AddCell().SetString("")
|
|
|
+ titleRow.AddCell().SetString("")
|
|
|
+ titleRow.AddCell().SetString("")
|
|
|
+ titleRow.AddCell().SetString("")
|
|
|
+ titleRow.AddCell().SetString("")
|
|
|
+ titleRow.AddCell().SetString("")
|
|
|
+ }
|
|
|
|
|
|
//第二行,前面几个单元格用于第一行的合并
|
|
|
titleRow2 := sheet.AddRow()
|
|
@@ -1618,65 +1639,98 @@ func (rg *RegisterController) Export(c *gin.Context) {
|
|
|
for i := 0; i < hInt; i++ {
|
|
|
titleRow2.AddCell().SetString("")
|
|
|
}
|
|
|
- //权益分行业套餐
|
|
|
- row2Cell1 := titleRow2.AddCell()
|
|
|
- row2Cell1.HMerge = 1
|
|
|
- row2Cell1.SetString("医药")
|
|
|
- row2Cell1.SetStyle(style)
|
|
|
- titleRow2.AddCell().SetString("")
|
|
|
-
|
|
|
- row2Cell2 := titleRow2.AddCell()
|
|
|
- row2Cell2.HMerge = 1
|
|
|
- row2Cell2.SetString("消费")
|
|
|
- row2Cell2.SetStyle(style)
|
|
|
- titleRow2.AddCell().SetString("")
|
|
|
-
|
|
|
- row2Cell3 := titleRow2.AddCell()
|
|
|
- row2Cell3.HMerge = 1
|
|
|
- row2Cell3.SetString("科技")
|
|
|
- row2Cell3.SetStyle(style)
|
|
|
- titleRow2.AddCell().SetString("")
|
|
|
-
|
|
|
- row2Cell4 := titleRow2.AddCell()
|
|
|
- row2Cell4.HMerge = 1
|
|
|
- row2Cell4.SetString("智造")
|
|
|
- row2Cell4.SetStyle(style)
|
|
|
- titleRow2.AddCell().SetString("")
|
|
|
-
|
|
|
- row2Cell5 := titleRow2.AddCell()
|
|
|
- row2Cell5.SetString("策略")
|
|
|
- row2Cell5.SetStyle(style)
|
|
|
+
|
|
|
+ if req.ListParam != 1 {
|
|
|
+ //权益分行业套餐
|
|
|
+ row2Cell1 := titleRow2.AddCell()
|
|
|
+ row2Cell1.HMerge = 1
|
|
|
+ row2Cell1.SetString("医药")
|
|
|
+ row2Cell1.SetStyle(style)
|
|
|
+ titleRow2.AddCell().SetString("")
|
|
|
+
|
|
|
+ row2Cell2 := titleRow2.AddCell()
|
|
|
+ row2Cell2.HMerge = 1
|
|
|
+ row2Cell2.SetString("消费")
|
|
|
+ row2Cell2.SetStyle(style)
|
|
|
+ titleRow2.AddCell().SetString("")
|
|
|
+
|
|
|
+ row2Cell3 := titleRow2.AddCell()
|
|
|
+ row2Cell3.HMerge = 1
|
|
|
+ row2Cell3.SetString("科技")
|
|
|
+ row2Cell3.SetStyle(style)
|
|
|
+ titleRow2.AddCell().SetString("")
|
|
|
+
|
|
|
+ row2Cell4 := titleRow2.AddCell()
|
|
|
+ row2Cell4.HMerge = 1
|
|
|
+ row2Cell4.SetString("智造")
|
|
|
+ row2Cell4.SetStyle(style)
|
|
|
+ titleRow2.AddCell().SetString("")
|
|
|
+
|
|
|
+ row2Cell5 := titleRow2.AddCell()
|
|
|
+ row2Cell5.SetString("策略")
|
|
|
+ row2Cell5.SetStyle(style)
|
|
|
+ }
|
|
|
|
|
|
// 第三行表头
|
|
|
titleRow3 := sheet.AddRow()
|
|
|
titleRow3.SetHeight(60)
|
|
|
row3Title := make([]string, 0)
|
|
|
row3TitleParent := make([]string, 0)
|
|
|
- row3Title = append(row3Title, "客户名称", "新客户\n0-是\n1-否", "合同类型\n续约-0\n新增-1\n代付-2\n补充协议-3", "FICC销售", "权益销售", "FICC大套餐")
|
|
|
- for i := range permissionList {
|
|
|
- row3Title = append(row3Title, permissionList[i].PermissionName)
|
|
|
- }
|
|
|
-
|
|
|
- // 其他套餐
|
|
|
- for i := range otherService {
|
|
|
- row3Title = append(row3Title, otherService[i].Title)
|
|
|
- }
|
|
|
- // 定义二级套餐名称
|
|
|
- for i := range row3Title {
|
|
|
- row3TitleParent = append(row3TitleParent, row3Title[i])
|
|
|
- }
|
|
|
- // 权益三级套餐
|
|
|
- for i := range raiOtherService {
|
|
|
- row3Title = append(row3Title, raiOtherService[i].Title)
|
|
|
- if raiOtherService[i].ParentTitle != "" {
|
|
|
- row3TitleParent = append(row3TitleParent, raiOtherService[i].ParentTitle)
|
|
|
- } else {
|
|
|
- row3TitleParent = append(row3TitleParent, raiOtherService[i].Title)
|
|
|
+ row3Title = append(row3Title, "客户名称", "新客户\n0-是\n1-否", "合同类型\n0-自付合同\n1-代付合同",
|
|
|
+ "合同子类型\n续约-0\n新签-1\n补充协议-2", "代付方", "关联主合同(补充协议)", "关联合同(代付合同)")
|
|
|
+ if req.ListParam == 0 {
|
|
|
+ row3Title = append(row3Title, "FICC销售", "权益销售", "FICC大套餐")
|
|
|
+ for i := range permissionList {
|
|
|
+ row3Title = append(row3Title, permissionList[i].PermissionName)
|
|
|
+ }
|
|
|
+ // 其他套餐
|
|
|
+ for i := range otherService {
|
|
|
+ row3Title = append(row3Title, otherService[i].Title)
|
|
|
+ }
|
|
|
+ // 定义二级套餐名称
|
|
|
+ for i := range row3Title {
|
|
|
+ row3TitleParent = append(row3TitleParent, row3Title[i])
|
|
|
+ }
|
|
|
+ // 权益三级套餐
|
|
|
+ for i := range raiOtherService {
|
|
|
+ row3Title = append(row3Title, raiOtherService[i].Title)
|
|
|
+ if raiOtherService[i].ParentTitle != "" {
|
|
|
+ row3TitleParent = append(row3TitleParent, raiOtherService[i].ParentTitle)
|
|
|
+ } else {
|
|
|
+ row3TitleParent = append(row3TitleParent, raiOtherService[i].Title)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if req.ListParam == 1 {
|
|
|
+ row3Title = append(row3Title, "FICC销售", "FICC大套餐")
|
|
|
+ for i := range permissionList {
|
|
|
+ row3Title = append(row3Title, permissionList[i].PermissionName)
|
|
|
+ }
|
|
|
+ // 其他套餐
|
|
|
+ for i := range otherService {
|
|
|
+ row3Title = append(row3Title, otherService[i].Title)
|
|
|
+ }
|
|
|
+ // 定义二级套餐名称
|
|
|
+ for i := range row3Title {
|
|
|
+ row3TitleParent = append(row3TitleParent, row3Title[i])
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ row3Title = append(row3Title, "权益销售")
|
|
|
+ // 权益三级套餐
|
|
|
+ for i := range raiOtherService {
|
|
|
+ row3Title = append(row3Title, raiOtherService[i].Title)
|
|
|
+ if raiOtherService[i].ParentTitle != "" {
|
|
|
+ row3TitleParent = append(row3TitleParent, raiOtherService[i].ParentTitle)
|
|
|
+ } else {
|
|
|
+ row3TitleParent = append(row3TitleParent, raiOtherService[i].Title)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- row3Title = append(row3Title, "套餐备注", "开始时间", "到期时间", "2022年合同金额", "金额单位", "FICC套餐总金额", "权益套餐总金额", "约定付款时间", "签订日", "合同状态",
|
|
|
- "合同编号", "合规备注")
|
|
|
+ row3Title = append(row3Title, "套餐备注", "开始时间", "到期时间", "2022年合同金额", "金额单位")
|
|
|
+ if req.ListParam == 0 {
|
|
|
+ row3Title = append(row3Title, "FICC套餐总金额", "权益套餐总金额")
|
|
|
+ }
|
|
|
+ row3Title = append(row3Title, "约定付款时间", "签订日", "合同状态", "合同编号", "合规备注")
|
|
|
|
|
|
// 设置表头
|
|
|
for i := range row3Title {
|
|
@@ -1716,10 +1770,13 @@ func (rg *RegisterController) Export(c *gin.Context) {
|
|
|
|
|
|
newCompanyMap := map[int]string{0: "1", 1: "0"}
|
|
|
contractTMap := map[int]int{
|
|
|
- fms.ContractTypeNew: 1,
|
|
|
- fms.ContractTypeRenew: 0,
|
|
|
- fms.ContractTypeAgentPay: 2, // 代付合同
|
|
|
- fms.ContractTypePlus: 3, // 补充协议
|
|
|
+ fms.ContractTypeSelf: 0,
|
|
|
+ fms.ContractTypebehalf: 1,
|
|
|
+ }
|
|
|
+ contractSubTMap := map[int]int{
|
|
|
+ fms.NewContractTypeNew: 0,
|
|
|
+ fms.NewContractTypeRenew: 1,
|
|
|
+ fms.NewContractTypePlus: 2, // 代付合同
|
|
|
}
|
|
|
for _, v := range list {
|
|
|
k := -1 // 套餐匹配用
|
|
@@ -1728,7 +1785,8 @@ func (rg *RegisterController) Export(c *gin.Context) {
|
|
|
k += 4
|
|
|
dataRow.AddCell().SetString(v.CompanyName)
|
|
|
dataRow.AddCell().SetString(newCompanyMap[v.NewCompany])
|
|
|
- dataRow.AddCell().SetString(fmt.Sprint(contractTMap[v.ContractType]))
|
|
|
+ dataRow.AddCell().SetString(fmt.Sprint(contractTMap[v.HasPayment]))
|
|
|
+ dataRow.AddCell().SetString(fmt.Sprint(contractSubTMap[v.ContractType]))
|
|
|
dataRow.AddCell().SetString(v.SellerName)
|
|
|
dataRow.AddCell().SetString(v.RaiSellerName)
|
|
|
|