|
@@ -423,7 +423,7 @@ func (rg *RegisterController) Add(c *gin.Context) {
|
|
|
// sellerMap[sellerList[i].SellerId] = sellerList[i]
|
|
|
//}
|
|
|
//处理重复公司名日期等重复的开票到款记录
|
|
|
- dupList, e := fms.GetDuplicateContractInvoiceDetailItemList(ob.CompanyName, req.StartDate, req.EndDate)
|
|
|
+ dupList, e := fms.GetDuplicateContractInvoiceDetailItemList(ob.CompanyName, req.StartDate, req.EndDate, req.ContractType, req.HasPayment)
|
|
|
if e != nil {
|
|
|
err = fmt.Errorf("获取开票到款列表失败, Err: %s", e.Error())
|
|
|
return
|
|
@@ -693,7 +693,7 @@ func (rg *RegisterController) Add(c *gin.Context) {
|
|
|
return
|
|
|
}
|
|
|
//处理重复公司名日期等重复的开票到款记录
|
|
|
- dupList, e := fms.GetDuplicateContractInvoiceDetailItemList(ob.CompanyName, req.StartDate, req.EndDate)
|
|
|
+ dupList, e := fms.GetDuplicateContractInvoiceDetailItemList(ob.CompanyName, req.StartDate, req.EndDate, req.ContractType, req.HasPayment)
|
|
|
if e != nil {
|
|
|
err = fmt.Errorf("获取开票到款列表失败, Err: %s", e.Error())
|
|
|
return
|
|
@@ -2979,13 +2979,15 @@ func (rg *RegisterController) Import(c *gin.Context) {
|
|
|
resp.Fail(fmt.Sprintf("第FICC销售名称和权益销售名称不可都为空, 请按模板导入", i+1), c)
|
|
|
return
|
|
|
}
|
|
|
- sellerItem := sellerMap[v]
|
|
|
- if sellerItem == nil {
|
|
|
- resp.Fail(fmt.Sprintf("第%d行权益销售名称与系统销售不匹配, 请核对名称后导入", i+1), c)
|
|
|
- return
|
|
|
+ if v != ""{
|
|
|
+ sellerItem := sellerMap[v]
|
|
|
+ if sellerItem == nil {
|
|
|
+ resp.Fail(fmt.Sprintf("第%d行权益销售名称与系统销售不匹配, 请核对名称后导入", i+1), c)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ rowRegister.RaiSellerId = sellerItem.SellerId
|
|
|
+ rowRegister.RaiSellerName = sellerItem.SellerName
|
|
|
}
|
|
|
- rowRegister.RaiSellerId = sellerItem.SellerId
|
|
|
- rowRegister.RaiSellerName = sellerItem.SellerName
|
|
|
continue
|
|
|
}
|
|
|
// FICC大套餐
|
|
@@ -3577,7 +3579,7 @@ func (rg *RegisterController) Import(c *gin.Context) {
|
|
|
|
|
|
//处理重复公司名日期等重复的开票到款记录
|
|
|
sellerItemMap := make(map[int]*crm.SellerAdminWithGroupTeam)
|
|
|
- dupList, e := fms.GetDuplicateContractInvoiceDetailItemList(rowRegister.CompanyName, rowRegister.StartDate.Format(utils.FormatDate), rowRegister.EndDate.Format(utils.FormatDate))
|
|
|
+ dupList, e := fms.GetDuplicateContractInvoiceDetailItemList(rowRegister.CompanyName, rowRegister.StartDate.Format(utils.FormatDate), rowRegister.EndDate.Format(utils.FormatDate), rowRegister.ContractType, rowRegister.HasPayment)
|
|
|
if e != nil {
|
|
|
err = fmt.Errorf("获取开票到款列表失败, Err: %s", e.Error())
|
|
|
return
|
|
@@ -3862,7 +3864,7 @@ func (rg *RegisterController) CheckContractDuplicate(c *gin.Context) {
|
|
|
existPars := make([]interface{}, 0)
|
|
|
if req.CompanyName != "" {
|
|
|
// 是否存在相同的合同名称的登记
|
|
|
- existCond = ` company_name = ?`
|
|
|
+ existCond = ` a.company_name = ?`
|
|
|
existPars = append(existPars, req.CompanyName)
|
|
|
}
|
|
|
|
|
@@ -3879,9 +3881,9 @@ func (rg *RegisterController) CheckContractDuplicate(c *gin.Context) {
|
|
|
return
|
|
|
}
|
|
|
if existCond != "" {
|
|
|
- existCond += ` AND (start_date =? and end_date=?)`
|
|
|
+ existCond += ` AND (a.start_date =? and a.end_date=?)`
|
|
|
} else {
|
|
|
- existCond = ` start_date = ? and end_date=?`
|
|
|
+ existCond = ` a.start_date = ? and a.end_date=?`
|
|
|
}
|
|
|
|
|
|
existPars = append(existPars, startDate, endDate)
|
|
@@ -3891,6 +3893,10 @@ func (rg *RegisterController) CheckContractDuplicate(c *gin.Context) {
|
|
|
resp.Fail("请输入合同名称或者合同有效期", c)
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+ existCond += ` AND a.is_deleted = 0 AND a.contract_type = ? AND a.has_payment = ?`
|
|
|
+ existPars = append(existPars, req.ContractType, req.HasPayment)
|
|
|
+
|
|
|
data := fms.CheckContractDuplicateResp{
|
|
|
Exist: 0,
|
|
|
}
|
|
@@ -3940,10 +3946,10 @@ func (rg *RegisterController) CheckContractDuplicate(c *gin.Context) {
|
|
|
templateIdStr := strings.Join(ids, ",")
|
|
|
|
|
|
for _, v := range dupList {
|
|
|
- if serviceIds, ok := serviceIdMap[v.ContractRegisterId]; ok{
|
|
|
- if serviceIds == templateIdStr{
|
|
|
+ if serviceIds, ok := serviceIdMap[v.ContractRegisterId]; ok {
|
|
|
+ if serviceIds == templateIdStr {
|
|
|
data.Exist = 1
|
|
|
- if _, ok2 := typeIdMap[v.ContractRegisterId]; ok2{
|
|
|
+ if _, ok2 := typeIdMap[v.ContractRegisterId]; ok2 {
|
|
|
data.Type = 1
|
|
|
}
|
|
|
}
|