|
@@ -3902,23 +3902,29 @@ func (rg *RegisterController) CheckContractDuplicate(c *gin.Context) {
|
|
|
}
|
|
|
|
|
|
// 是否存在相同合同名称的登记
|
|
|
- //处理重复公司名日期等重复的开票到款记录
|
|
|
- dupList, e := fms.GetDuplicateContractInvoiceDetailItemListForSupplement(req.CompanyName, req.StartDate, req.EndDate, req.ContractType, req.HasPayment)
|
|
|
+ list, e := fms.CheckContractDuplicate(existCond, existPars)
|
|
|
if e != nil {
|
|
|
resp.FailMsg("操作失败", "查询重复合同失败, Err: "+e.Error(), c)
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
typeIdMap := make(map[int]int)
|
|
|
registerIds := make([]int, 0)
|
|
|
- for i := range dupList {
|
|
|
- registerIds = append(registerIds, dupList[i].ContractRegisterId)
|
|
|
- if dupList[i].ContractCode != "" {
|
|
|
- typeIdMap[dupList[i].ContractRegisterId] = 1
|
|
|
+ for i := range list {
|
|
|
+ registerIds = append(registerIds, list[i].ContractRegisterId)
|
|
|
+ if list[i].ContractCode != "" {
|
|
|
+ typeIdMap[list[i].ContractRegisterId] = 1
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ dupList, e := fms.CheckContractServiceDuplicate(registerIds)
|
|
|
+ if e != nil {
|
|
|
+ resp.FailMsg("操作失败", "查询重复合同套餐失败, Err: "+e.Error(), c)
|
|
|
+ return
|
|
|
+ }
|
|
|
serviceIdMap := make(map[int]string)
|
|
|
for _, v := range dupList {
|
|
|
- serviceIdMap[v.ContractRegisterId] = v.TemplateIds
|
|
|
+ serviceIdMap[v.ContractRegisterId] = v.Ids
|
|
|
}
|
|
|
//校验套餐
|
|
|
if len(req.Services) > 0 {
|