|
@@ -513,7 +513,7 @@ func (rg *PreRegisterController) Edit(c *gin.Context) {
|
|
|
}
|
|
|
updateCols := []string{
|
|
|
"ProductIds", "CompanyName", "SellerId", "SellerName", "StartDate", "EndDate",
|
|
|
- "RaiSellerId", "RaiSellerName", "ModifyTime", "CurrencyUnit","ContractType","HasPayment",
|
|
|
+ "RaiSellerId", "RaiSellerName", "ModifyTime", "CurrencyUnit", "ContractType", "HasPayment",
|
|
|
}
|
|
|
|
|
|
invoiceList := make([]*fms.ContractInvoice, 0)
|
|
@@ -569,8 +569,8 @@ func (rg *PreRegisterController) Edit(c *gin.Context) {
|
|
|
resp.Fail("销售信息异常", c)
|
|
|
return
|
|
|
}
|
|
|
- fmt.Println("SellerId",sellerItem.SellerId)
|
|
|
- fmt.Println("SellerName",sellerItem.SellerName)
|
|
|
+ fmt.Println("SellerId", sellerItem.SellerId)
|
|
|
+ fmt.Println("SellerName", sellerItem.SellerName)
|
|
|
v.SellerId = sellerItem.SellerId
|
|
|
v.SellerName = sellerItem.SellerName
|
|
|
v.SellerGroupId = sellerItem.GroupId
|
|
@@ -627,7 +627,7 @@ func (rg *PreRegisterController) Edit(c *gin.Context) {
|
|
|
pp.PaymentSellerTeamName = sellerItem.TeamName
|
|
|
ppUpdateCols = append(ppUpdateCols, "InvoiceDate", "Amount", "OriginAmount", "SellerId",
|
|
|
"SellerName", "SellerGroupId", "SellerGroupName", "SellerTeamId", "SellerTeamName", "InvoiceId",
|
|
|
- "PaymentSellerId", "PaymentSellerName", "PaymentSellerGroupId", "PaymentSellerGroupName", "PaymentSellerTeamId", "PaymentSellerTeamName","ContractType","HasPayment")
|
|
|
+ "PaymentSellerId", "PaymentSellerName", "PaymentSellerGroupId", "PaymentSellerGroupName", "PaymentSellerTeamId", "PaymentSellerTeamName", "ContractType", "HasPayment")
|
|
|
} else {
|
|
|
//到款
|
|
|
pp.ArriveRemark = r.Remark
|
|
@@ -650,7 +650,7 @@ func (rg *PreRegisterController) Edit(c *gin.Context) {
|
|
|
pp.PaymentSellerTeamId = sellerItem.TeamId
|
|
|
pp.PaymentSellerTeamName = sellerItem.TeamName
|
|
|
ppUpdateCols = append(ppUpdateCols, "CurrencyUnit", "ArriveDate", "ArriveAmount", "ArriveOriginAmount", "ArriveId",
|
|
|
- "PaymentSellerId", "PaymentSellerName", "PaymentSellerGroupId", "PaymentSellerGroupName", "PaymentSellerTeamId", "PaymentSellerTeamName","ContractType","HasPayment")
|
|
|
+ "PaymentSellerId", "PaymentSellerName", "PaymentSellerGroupId", "PaymentSellerGroupName", "PaymentSellerTeamId", "PaymentSellerTeamName", "ContractType", "HasPayment")
|
|
|
}
|
|
|
|
|
|
if pp.PreRegisterId == 0 {
|
|
@@ -772,7 +772,7 @@ func (rg *PreRegisterController) Del(c *gin.Context) {
|
|
|
resp.FailMsg("删除统计记录失败", "Err:"+e.Error(), c)
|
|
|
return
|
|
|
}
|
|
|
- if count == 0{
|
|
|
+ if count == 0 {
|
|
|
ob := new(fms.ContractRegister)
|
|
|
item, e := ob.Fetch(req.ContractRegisterId)
|
|
|
if e != nil {
|
|
@@ -907,57 +907,44 @@ func (rg *PreRegisterController) Detail(c *gin.Context) {
|
|
|
}
|
|
|
|
|
|
//获取ficc小套餐品种
|
|
|
- sysConf := new(system.SysConfig)
|
|
|
- confCond := `config_code = ?`
|
|
|
- confPars := make([]interface{}, 0)
|
|
|
- confPars = append(confPars, system.ConfigKeyCrmPermissionFiccClassify)
|
|
|
- confItem, e := sysConf.FetchByCondition(confCond, confPars)
|
|
|
- if e != nil {
|
|
|
- resp.FailData("获取失败", "Err:"+e.Error(), c)
|
|
|
- return
|
|
|
- }
|
|
|
- if confItem.ConfigValue == "" {
|
|
|
- resp.FailData("获取失败", "FICC品种分类配置为空", c)
|
|
|
- return
|
|
|
- }
|
|
|
- classifyArr := strings.Split(confItem.ConfigValue, ",")
|
|
|
- if len(classifyArr) == 0 {
|
|
|
- resp.FailData("获取失败", "FICC品种分类配置为空", c)
|
|
|
- return
|
|
|
- }
|
|
|
// 获取FICC权限
|
|
|
- ficcCond := `enabled = 1 AND permission_type = 0 AND product_id = ? AND classify_name IN ?`
|
|
|
+ ficcCond := `enabled = 1 AND permission_type = 0 AND product_id = ? AND classify_name <> "市场策略"`
|
|
|
ficcPars := make([]interface{}, 0)
|
|
|
- ficcPars = append(ficcPars, 1, classifyArr)
|
|
|
+ ficcPars = append(ficcPars, 1)
|
|
|
items, e := crm.GetPermissionSetItemsByCondition(ficcCond, ficcPars)
|
|
|
if e != nil {
|
|
|
resp.FailData("获取失败", "获取FICC权限信息失败, Err: "+e.Error(), c)
|
|
|
return
|
|
|
}
|
|
|
- ficcItemMap := make(map[string][]*crm.PermissionSetItem, 0)
|
|
|
+ ficcItemMap := make(map[int][]*crm.PermissionSetItem, 0)
|
|
|
for i := range items {
|
|
|
- if ficcItemMap[items[i].ClassifyName] == nil {
|
|
|
- ficcItemMap[items[i].ClassifyName] = make([]*crm.PermissionSetItem, 0)
|
|
|
+ if items[i].ParentId > 0 {
|
|
|
+ if ficcItemMap[items[i].ParentId] == nil {
|
|
|
+ ficcItemMap[items[i].ParentId] = make([]*crm.PermissionSetItem, 0)
|
|
|
+ }
|
|
|
+ ficcItemMap[items[i].ParentId] = append(ficcItemMap[items[i].ParentId], items[i])
|
|
|
}
|
|
|
- ficcItemMap[items[i].ClassifyName] = append(ficcItemMap[items[i].ClassifyName], items[i])
|
|
|
}
|
|
|
|
|
|
sTempIdMap := make(map[string]int, 0)
|
|
|
|
|
|
- for i := range classifyArr {
|
|
|
- if classifyArr[i] == "市场策略" {
|
|
|
+ for i := range items {
|
|
|
+ if items[i].ParentId > 0 {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ if items[i].PermissionName == "市场策略" {
|
|
|
continue
|
|
|
}
|
|
|
checkList := make([]int, 0)
|
|
|
- if classifyArr[i] == "宏观经济" {
|
|
|
- checkList = append(checkList, 1)
|
|
|
+ if items[i].IsPublic == 1 {
|
|
|
+ checkList = append(checkList, items[i].ChartPermissionId)
|
|
|
}
|
|
|
|
|
|
pItem := fms.ContractServiceTemplateItem{
|
|
|
ServiceTemplateId: 90000 + i*100,
|
|
|
}
|
|
|
|
|
|
- ficcItems := ficcItemMap[classifyArr[i]]
|
|
|
+ ficcItems := ficcItemMap[items[i].ChartPermissionId]
|
|
|
for _, ficcItem := range ficcItems {
|
|
|
sTempIdMap[strconv.Itoa(ficcItem.ChartPermissionId)] = pItem.ServiceTemplateId + ficcItem.ChartPermissionId
|
|
|
}
|