|
@@ -15,6 +15,7 @@ import (
|
|
|
"hongze/hongze_mobile_admin/models/tables/company_delay_permission"
|
|
|
"hongze/hongze_mobile_admin/models/tables/company_product"
|
|
|
"hongze/hongze_mobile_admin/models/tables/company_product_log"
|
|
|
+ "hongze/hongze_mobile_admin/models/tables/company_product_update_log"
|
|
|
"hongze/hongze_mobile_admin/models/tables/contract_approval"
|
|
|
"hongze/hongze_mobile_admin/models/tables/contract_approval_record"
|
|
|
"hongze/hongze_mobile_admin/services"
|
|
@@ -773,6 +774,34 @@ func afterApproved(companyApprovalId int, opUserId int, opUserName string) (err
|
|
|
services.AddCompanyOperationRecord(recodeInfo.CompanyId, companyProduct.SellerId, opUserId, recodeInfo.ProductId, opUserId, companyProduct.CompanyName,
|
|
|
companyProduct.ProductName, opUserName, remark, operation, approveContent, opUserName, "", companyProduct.Status)
|
|
|
}
|
|
|
+
|
|
|
+ //新增客户产品状态变更日志
|
|
|
+ {
|
|
|
+ updateSource := ``
|
|
|
+ switch recodeInfo.ApplyMethod {
|
|
|
+ case 1: //试用转正式
|
|
|
+ updateSource = `turn_positive`
|
|
|
+ case 2: //冻结->试用
|
|
|
+ updateSource = "thaw"
|
|
|
+ case 3: //试用延期
|
|
|
+ updateSource = "delay"
|
|
|
+ case 4: //原销售申请领取流失客户
|
|
|
+ updateSource = "apply_receive"
|
|
|
+ case 5: //正式客户申请续约
|
|
|
+ updateSource = "service_update"
|
|
|
+ case 6: //正式客户新增补充协议
|
|
|
+ updateSource = "add_agreement"
|
|
|
+ }
|
|
|
+ companyProductUpdateLog := &company_product_update_log.CompanyProductUpdateLog{
|
|
|
+ Id: 0,
|
|
|
+ CompanyId: companyProduct.CompanyId,
|
|
|
+ ProductId: companyProduct.ProductId,
|
|
|
+ Status: companyProduct.Status,
|
|
|
+ Source: updateSource,
|
|
|
+ CreateTime: time.Now(),
|
|
|
+ }
|
|
|
+ go company_product_update_log.AddCompanyProductUpdateLog(companyProductUpdateLog)
|
|
|
+ }
|
|
|
return
|
|
|
}
|
|
|
|