You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
93 lines
1.8 KiB
93 lines
1.8 KiB
package gys
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"recook/internal/back"
|
|
"recook/internal/libs/bean"
|
|
"recook/internal/v2/logic/manage/gys"
|
|
"recook/tools"
|
|
)
|
|
|
|
type Company struct {
|
|
}
|
|
|
|
// SettledList 入驻列表.
|
|
func (o *Company) SettledList(c *gin.Context) {
|
|
req := gys.SettledCompanyListReq{}
|
|
if err := tools.Params(&req, c); err != nil {
|
|
back.Fail(c, err.Error())
|
|
return
|
|
}
|
|
|
|
result, total := gys.CLogic.SettledList(&req)
|
|
back.Suc(c, "操作成功", bean.ResultLists{
|
|
List: result,
|
|
Total: total,
|
|
})
|
|
return
|
|
}
|
|
|
|
// UnSettledList 未入驻列表.
|
|
func (o *Company) UnSettledList(c *gin.Context) {
|
|
req := gys.UnSettledCompanyListReq{}
|
|
if err := tools.Params(&req, c); err != nil {
|
|
back.Fail(c, err.Error())
|
|
return
|
|
}
|
|
|
|
result, total := gys.CLogic.UnSettledList(&req)
|
|
back.Suc(c, "操作成功", bean.ResultLists{
|
|
List: result,
|
|
Total: total,
|
|
})
|
|
return
|
|
}
|
|
|
|
// UpdateCode 修改供应商编码.
|
|
func (o *Company) UpdateCode(c *gin.Context) {
|
|
req := gys.UpdateCodeReq{}
|
|
if err := tools.Params(&req, c); err != nil {
|
|
back.Fail(c, err.Error())
|
|
return
|
|
}
|
|
|
|
if err := gys.CLogic.UpdateCode(&req); err != nil {
|
|
back.Fail(c, err.Error())
|
|
return
|
|
}
|
|
back.Suc(c, "操作成功", nil)
|
|
return
|
|
}
|
|
|
|
// ReNew 续约.
|
|
func (o *Company) ReNew(c *gin.Context) {
|
|
req := gys.UpdateRenewReq{}
|
|
if err := tools.Params(&req, c); err != nil {
|
|
back.Fail(c, err.Error())
|
|
return
|
|
}
|
|
|
|
if err := gys.CLogic.ReNew(&req); err != nil {
|
|
back.Fail(c, err.Error())
|
|
return
|
|
}
|
|
back.Suc(c, "操作成功", nil)
|
|
return
|
|
}
|
|
|
|
// ReSign 重签.
|
|
func (o *Company) ReSign(c *gin.Context) {
|
|
req := gys.UpdateReSignReq{}
|
|
if err := tools.Params(&req, c); err != nil {
|
|
back.Fail(c, err.Error())
|
|
return
|
|
}
|
|
|
|
if err := gys.CLogic.ReSign(&req); err != nil {
|
|
back.Fail(c, err.Error())
|
|
return
|
|
}
|
|
back.Suc(c, "操作成功", nil)
|
|
return
|
|
}
|