From 05582688724c78bc70a7bc860193c67677f6c8cf Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期六, 28 十月 2023 10:46:37 +0800 Subject: [PATCH] Merge branch 'master' of http://192.168.5.5:10010/r/aps/crm --- api/v1/serviceContract.go | 42 ++++++++++-------------------------------- 1 files changed, 10 insertions(+), 32 deletions(-) diff --git a/api/v1/serviceContract.go b/api/v1/serviceContract.go index d6b13c1..1edad01 100644 --- a/api/v1/serviceContract.go +++ b/api/v1/serviceContract.go @@ -35,6 +35,16 @@ return } + count, err := model.NewServiceContractSearch().SetNumber(params.Number).Count() + if err != nil { + ctx.FailWithMsg(ecode.UnknownErr, "缂栫爜楠岃瘉澶辫触") + return + } + if count > 0 { + ctx.FailWithMsg(ecode.UnknownErr, "缂栫爜宸插瓨鍦�") + return + } + if params.MemberId == 0 { userInfo := utils.GetUserInfo(c) if userInfo.UserType == constvar.UserTypeSub { @@ -48,40 +58,8 @@ return } - if params.CodeRule.Method == 1 { - autoCode := model.GetAutoCode(serviceContract.Id, ¶ms.CodeRule) - m := map[string]interface{}{ - "number": autoCode, - } - _ = model.NewServiceContractSearch().SetId(serviceContract.Id).UpdateByMap(m) - } - ctx.Ok() } - -//// Delete -//// -//// @Tags ServiceContract -//// @Summary 鍒犻櫎鏈嶅姟鍚堝悓 -//// @Produce application/json -//// @Param object body request.DeleteServiceContract true "鏌ヨ鍙傛暟" -//// @Success 200 {object} contextx.Response{} -//// @Router /api/serviceContract/delete [delete] -//func (s *ServiceContractApi) Delete(c *gin.Context) { -// var params request.DeleteServiceContract -// ctx, ok := contextx.NewContext(c, ¶ms) -// if !ok { -// return -// } -// -// errCode := serviceContractService.DeleteServiceContract(params.Ids) -// if errCode != ecode.OK { -// ctx.Fail(errCode) -// return -// } -// -// ctx.Ok() -//} // BatchDelete // @Tags ServiceContract -- Gitblit v1.8.0