|
@@ -12,6 +12,7 @@ import (
|
|
|
"hongze/hongze_mobile_admin/utils"
|
|
|
"path"
|
|
|
"strconv"
|
|
|
+ "strings"
|
|
|
)
|
|
|
|
|
|
//SealCommon
|
|
@@ -59,8 +60,11 @@ func (c *SealCommon) Add() {
|
|
|
c.FailWithMessage("合同附件不能为空", "合同附件不能为空")
|
|
|
return
|
|
|
}
|
|
|
+ if req.AffiliatedCompany == "" {
|
|
|
+ c.FailWithMessage("归属公司不能为空", "归属公司不能为空")
|
|
|
+ }
|
|
|
|
|
|
- sealInfo, err := sealService.AddSeal(c.AdminWx.AdminId, req.ContractId, req.FileNum, c.AdminWx.RealName, req.Use, req.UseCompanyName, req.CompanyName, req.CreditCode, req.ServiceType, req.SealType, req.Remark, req.FileUrls)
|
|
|
+ sealInfo, err := sealService.AddSeal(c.AdminWx.AdminId, req.ContractId, req.FileNum, c.AdminWx.RealName, req.Use, req.UseCompanyName, req.CompanyName, req.CreditCode, req.ServiceType, req.SealType, req.Remark, req.FileUrls, req.AffiliatedCompany)
|
|
|
if err != nil {
|
|
|
c.FailWithMessage("用印添加失败", err.Error())
|
|
|
return
|
|
@@ -119,8 +123,11 @@ func (c *SealCommon) Edit() {
|
|
|
c.FailWithMessage("合同附件不能为空", "合同附件不能为空")
|
|
|
return
|
|
|
}
|
|
|
+ if req.AffiliatedCompany == "" {
|
|
|
+ c.FailWithMessage("归属公司不能为空", "归属公司不能为空")
|
|
|
+ }
|
|
|
|
|
|
- sealInfo, err := sealService.Edit(req.SealId, c.AdminWx.AdminId, req.ContractId, req.FileNum, req.Use, req.CompanyName, req.UseCompanyName, req.CreditCode, req.ServiceType, req.SealType, req.Remark, req.FileUrls, c.AdminWx.RealName)
|
|
|
+ sealInfo, err := sealService.Edit(req.SealId, c.AdminWx.AdminId, req.ContractId, req.FileNum, req.Use, req.CompanyName, req.UseCompanyName, req.CreditCode, req.ServiceType, req.SealType, req.Remark, req.FileUrls, c.AdminWx.RealName, req.AffiliatedCompany)
|
|
|
if err != nil {
|
|
|
c.FailWithMessage("修改合同失败!", "修改合同失败,Err:"+err.Error())
|
|
|
return
|
|
@@ -204,6 +211,7 @@ func (c *SealCommon) List() {
|
|
|
adminIds := c.GetString("AdminId")
|
|
|
keyword := c.GetString("Keyword")
|
|
|
keywordEq := c.GetString("KeywordEq")
|
|
|
+ affiliatedCompany := c.GetString("AffiliatedCompany")
|
|
|
|
|
|
condition := ""
|
|
|
pars := make([]interface{}, 0)
|
|
@@ -247,6 +255,11 @@ func (c *SealCommon) List() {
|
|
|
condition += ` AND (c.use_company_name =? OR c.company_name =?) `
|
|
|
pars = append(pars, keywordEq, keywordEq)
|
|
|
}
|
|
|
+ // 归属公司
|
|
|
+ if affiliatedCompany != "" {
|
|
|
+ condition += ` AND affiliated_company =? `
|
|
|
+ pars = append(pars, affiliatedCompany)
|
|
|
+ }
|
|
|
|
|
|
pageSize, _ := c.GetInt("PageSize")
|
|
|
currentIndex, _ := c.GetInt("CurrentIndex")
|
|
@@ -473,5 +486,22 @@ func (c *SealCommon) CompanyNameList() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ c.OkDetailed(list, "获取成功")
|
|
|
+}
|
|
|
+
|
|
|
+// 关联公司列表
|
|
|
+// @Title 关联公司列表
|
|
|
+// @Description 关联公司列表
|
|
|
+// @Success 200 {object} response.SealApprovalListResp
|
|
|
+// @router /getAffiliatedCompany [get]
|
|
|
+func (c *SealCommon) AffiliatedCompanyList() {
|
|
|
+
|
|
|
+ crmConfig, err := company.GetConfigDetailByCode("affiliated_company")
|
|
|
+ if err != nil {
|
|
|
+ c.FailWithMessage( "获取配置失败!", "获取配置失败,Err:"+err.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ list := strings.Split(crmConfig.ConfigValue, ",")
|
|
|
+
|
|
|
c.OkDetailed(list, "获取成功")
|
|
|
}
|