Browse Source

no message

zhangchuanxing 1 ngày trước cách đây
mục cha
commit
9cd71eb91f

+ 9 - 1
controller/census/invoice_payment.go

@@ -591,6 +591,9 @@ func (ct *InvoicePaymentController) List(c *gin.Context) {
 				v.InvoicePaymentList = summaryMap[registerList[i].SummaryId]
 				v.ContractType = registerList[i].ContractType
 				v.ActualPayCompanies = registerList[i].ActualPayCompanies
+				if registerList[i].WxUserId > 0 {
+					v.CompanyName = registerList[i].WxUserName + "(" + registerList[i].CompanyName + ")"
+				}
 				respList = append(respList, v)
 			}
 		}()
@@ -1141,6 +1144,9 @@ func (ct *InvoicePaymentController) NotInvoiceList(c *gin.Context) {
 				//} else {
 				//	v.NotInvoiceTotal = registerList[i].ContractAmount - registerList[i].PaymentAmount
 				//}
+				if registerList[i].WxUserId > 0 {
+					v.CompanyName = registerList[i].WxUserName + "(" + registerList[i].CompanyName + ")"
+				}
 
 				v.NotInvoiceList = NotInvoiceSummaryMap[registerList[i].ContractRegisterId]
 				respList = append(respList, v)
@@ -1507,6 +1513,9 @@ func (ct *InvoicePaymentController) NotPaymentList(c *gin.Context) {
 				v.UnitName = unitMap[registerList[i].CurrencyUnit]
 				v.ProductIds = registerList[i].ProductIds
 				v.NotInvoiceTotal = registerList[i].ContractAmount - registerList[i].InvoicedAmount
+				if registerList[i].WxUserId > 0 {
+					v.CompanyName = registerList[i].WxUserName + "(" + registerList[i].CompanyName + ")"
+				}
 				respList = append(respList, v)
 			}
 		}()
@@ -1968,4 +1977,3 @@ func ExportNotPaymentCensusList(c *gin.Context, results *fms.NotInvoicePaymentCe
 	c.Writer.Header().Add("Content-Type", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
 	http.ServeContent(c.Writer, c.Request, fileName, time.Now(), content)
 }
-

+ 10 - 1
controller/contract/register.go

@@ -190,6 +190,10 @@ func (rg *RegisterController) List(c *gin.Context) {
 		v.ServicesName = serviceMap[list[i].ContractRegisterId]
 		v.InvoiceList = invoiceMap[list[i].ContractRegisterId]
 		v.PaymentList = paymentMap[list[i].ContractRegisterId]
+
+		if list[i].WxUserId > 0 {
+			v.CompanyName = v.WxUserName + "(" + v.CompanyName + ")"
+		}
 		respList = append(respList, v)
 	}
 
@@ -347,12 +351,14 @@ func (rg *RegisterController) Add(c *gin.Context) {
 	ob.HasPayment = req.HasPayment
 	ob.HasInvoice = req.HasInvoice
 	ob.ActualPayCompanies = req.ActualPayCompanies
+	ob.WxUserId = req.WxUserId
+	ob.WxUserName = req.WxUserName
 	ob.Set()
 	updateCols := []string{
 		"ContractCode", "RelateContractCode", "RelateContractMainCode", "CrmContractId", "ContractSource",
 		"ProductIds", "CompanyName", "SellerId", "SellerName", "StartDate", "EndDate",
 		"RaiSellerId", "RaiSellerName", "ModifyTime", "ContractType", "ContractAmount", "CurrencyUnit", "RMBRate",
-		"SignDate", "AgreedPayTime", "ContractStatus", "RegisterStatus", "Remark", "HasPayment", "HasInvoice", "ActualPayCompanies",
+		"SignDate", "AgreedPayTime", "ContractStatus", "RegisterStatus", "Remark", "HasPayment", "HasInvoice", "ActualPayCompanies", "WxUserId", "WxUserName",
 	}
 	// 不需要开票到款的代付直接完成登记, 且不允许进行开票/到款登记
 	if req.HasInvoice == 0 || req.ContractStatus == fms.ContractStatusEnd {
@@ -2497,6 +2503,9 @@ func (rg *RegisterController) InvoiceList(c *gin.Context) {
 	for i := range list {
 		list[i].UnitName = unitMap[list[i].CurrencyUnit]
 		contractRegisterIds = append(contractRegisterIds, list[i].ContractRegisterId)
+		if list[i].WxUserId > 0 {
+			list[i].CompanyName = list[i].WxUserName + "(" + list[i].CompanyName + ")"
+		}
 	}
 	if len(contractRegisterIds) > 0 {
 		contractRegisters, err := fms.GetContractInfoByRegisterIds(contractRegisterIds)

+ 10 - 1
controller/crm/contract.go

@@ -332,6 +332,14 @@ func (rg *ContractController) SealList(c *gin.Context) {
 		} else {
 			contractTypeInt = 3
 		}
+
+		if list[i].Use == "代付合同" {
+			list[i].CompanyName = list[i].UseCompanyName
+		}
+
+		//if list[i].WxUserId > 0 {
+		//	list[i].WxUserName += "(" + "单账号签约" + ")"
+		//}
 		respItem := &crm.ContractSearchListResp{
 			ContractId:              list[i].SealId,
 			ContractCode:            list[i].Code,
@@ -345,6 +353,8 @@ func (rg *ContractController) SealList(c *gin.Context) {
 			ContractBusinessTypeInt: 1, // 业务合同
 			StartDate:               utils.TimeTransferString(utils.FormatDate, list[i].StartDate),
 			EndDate:                 utils.TimeTransferString(utils.FormatDate, list[i].EndDate),
+			WxUserId:                list[i].WxUserId,
+			WxUserName:              list[i].WxUserName,
 		}
 		respItem.ContractBusinessTypeInt = 1
 		respList = append(respList, respItem)
@@ -373,7 +383,6 @@ func (rg *ContractController) SealDetail(c *gin.Context) {
 		resp.FailData("参数解析失败", err.Translate(global.Trans), c)
 		return
 	}
-
 	contractDetail, e := crmService.GetSealDetail(req.ContractId)
 	if e != nil {
 		global.LOG.Error(e.Error())

+ 2 - 0
models/crm/contract.go

@@ -93,6 +93,8 @@ type ContractSearchListResp struct {
 	ContractTypeInt         int     `json:"contract_type_int" description:"CRM合同类型: 1新签合同; 2续约合同; 3补充协议;"`
 	ContractBusinessTypeInt int     `json:"contract_business_type_int" description:"合同业务类型,1'业务合同', 2'代付合同;"`
 	HasPayment              int     `json:"has_payment" description:"是否有代付: 0-无; 1-有"`
+	WxUserId                int     `json:"wx_user_id" description:"用户id,针对某份合同仅对单个用户使用的时候的场景"`
+	WxUserName              string  `json:"wx_user_name" description:"用户姓名,针对某份合同仅对单个用户使用的时候的场景"`
 }
 
 // PayCompanyRelation 代付合同

+ 2 - 0
models/crm/seal.go

@@ -37,6 +37,8 @@ type Seal struct {
 	StartDate         time.Time `description:"开始日期"`
 	EndDate           time.Time `description:"结束日期"`
 	Money             float64   `description:"合同金额"`
+	WxUserId          int       `description:"用户id,针对某份合同仅对单个用户使用的时候的场景"`
+	WxUserName        string    `description:"用户姓名,针对某份合同仅对单个用户使用的时候的场景"`
 }
 
 // ContractDetail 合同详情信息(包含服务信息等)

+ 8 - 1
models/fms/contract_invoice.go

@@ -63,6 +63,8 @@ type ContractInvoiceItem struct {
 	EndDate            string  `gorm:"column:end_date" json:"end_date" description:"约定结束时间"`
 	CreateTime         string  `gorm:"column:create_time" json:"create_time" description:"创建时间"`
 	CompanyName        string  `gorm:"column:company_name" json:"company_name" description:"客户名称"`
+	WxUserId           int     `json:"wx_user_id" description:"用户id,针对某份合同仅对单个用户使用的时候的场景"`
+	WxUserName         string  `json:"wx_user_name"  description:"用户姓名,针对某份合同仅对单个用户使用的时候的场景"`
 }
 
 func (c *ContractInvoice) Create() (err error) {
@@ -236,7 +238,7 @@ type ContractInvoiceListReq struct {
 func GetContractInvoiceItemPageList(page base.IPage, condition string, pars []interface{}) (count int64, results []*ContractInvoiceItem, err error) {
 	list := make([]*ContractInvoiceRespItem, 0)
 	query := global.DEFAULT_MYSQL.Table("contract_invoice AS a").
-		Select("a.*, b.company_name").
+		Select("a.*, b.company_name,b.wx_user_id,b.wx_user_name").
 		Joins("JOIN contract_register b ON a.contract_register_id = b.contract_register_id").
 		Where("a.is_deleted = 0").
 		Where(condition, pars...)
@@ -273,6 +275,9 @@ func formatContractInvoice2Item(item *ContractInvoiceRespItem) (formatItem *Cont
 	formatItem.ServiceProductId = item.ServiceProductId
 	formatItem.CreateTime = utils.TimeTransferString(utils.FormatDateTime, item.CreateTime)
 	formatItem.CompanyName = item.CompanyName
+	formatItem.WxUserId = item.WxUserId
+	formatItem.WxUserName = item.WxUserName
+	formatItem.CompanyName = item.CompanyName
 	return
 }
 
@@ -613,6 +618,8 @@ func formatContractInvoice2DetailItemList(list []*InvoiceDetailItem) (itemList [
 type ContractInvoiceRespItem struct {
 	ContractInvoice
 	CompanyName string `gorm:"column:company_name" json:"company_name" description:"客户名称"`
+	WxUserId    int    `json:"wx_user_id" description:"用户id,针对某份合同仅对单个用户使用的时候的场景"`
+	WxUserName  string `json:"wx_user_name"  description:"用户姓名,针对某份合同仅对单个用户使用的时候的场景"`
 }
 
 func (c *ContractInvoice) FetchByRegisterId(registerId int) (items []*ContractInvoice, err error) {

+ 8 - 0
models/fms/contract_register.go

@@ -43,6 +43,8 @@ type ContractRegister struct {
 	NewCompany             int       `gorm:"column:new_company" json:"new_company" description:"是否为新客户: 0-否; 1-是"`
 	ActualPayCompanies     string    `gorm:"column:actual_pay_companies" json:"actual_pay_companies" description:"合同关联的所有代付方名称, 英文逗号拼接"`
 	IsDeleted              int       `gorm:"column:is_deleted" json:"is_deleted" description:"是否已删除: 0-正常; 1-已删除"`
+	WxUserId               int       `gorm:"column:wx_user_id" json:"wx_user_id" description:"用户id,针对某份合同仅对单个用户使用的时候的场景"`
+	WxUserName             string    `gorm:"column:wx_user_name" json:"wx_user_name"  description:"用户姓名,针对某份合同仅对单个用户使用的时候的场景"`
 	base.TimeBase
 }
 
@@ -148,6 +150,8 @@ type ContractRegisterItem struct {
 	ActualPayCompanies     string  `json:"actual_pay_companies" description:"合同关联的所有代付方名称, 英文逗号拼接"`
 	CreateTime             string  `json:"create_time" description:"登记时间"`
 	SellerIds              string  `json:"seller_ids"`
+	WxUserId               int     `json:"wx_user_id" description:"用户id,针对某份合同仅对单个用户使用的时候的场景"`
+	WxUserName             string  `json:"wx_user_name"  description:"用户姓名,针对某份合同仅对单个用户使用的时候的场景"`
 }
 
 // ContractRegisterList 合同登记列表
@@ -197,6 +201,8 @@ type ContractRegisterAddReq struct {
 	Services               []ContractServiceAddReq       `json:"services" description:"服务套餐内容"`
 	ServiceAmount          []ContractServiceAmountAddReq `json:"service_amount" description:"服务套餐金额"`
 	ActualPayCompanies     string                        `json:"actual_pay_companies" description:"合同关联的所有代付方名称, 英文逗号拼接"`
+	WxUserId               int                           `json:"wx_user_id" description:"用户id,针对某份合同仅对单个用户使用的时候的场景"`
+	WxUserName             string                        `json:"wx_user_name"  description:"用户姓名,针对某份合同仅对单个用户使用的时候的场景"`
 }
 
 // ContractRegisterEditReq 编辑合同登记请求体
@@ -434,6 +440,8 @@ func formatContractRegister2Item(item *ContractRegister) (formatItem *ContractRe
 	formatItem.HasInvoice = item.HasInvoice
 	formatItem.NewCompany = item.NewCompany
 	formatItem.ActualPayCompanies = item.ActualPayCompanies
+	formatItem.WxUserId = item.WxUserId
+	formatItem.WxUserName = item.WxUserName
 	formatItem.CreateTime = utils.TimeTransferString(utils.FormatDateTime, item.CreateTime)
 	return
 }