|
|
@ -4,11 +4,13 @@ package ods |
|
|
|
|
|
|
|
import ( |
|
|
|
model "LAPP_GAAS_GFrame_BACKEND/models/ods" |
|
|
|
"LAPP_GAAS_GFrame_BACKEND/utils" |
|
|
|
"LAPP_GAAS_GFrame_BACKEND/web/middleware/jwts" |
|
|
|
"LAPP_GAAS_GFrame_BACKEND/web/models" |
|
|
|
"LAPP_GAAS_GFrame_BACKEND/web/supports" |
|
|
|
"github.com/kataras/iris/v12" |
|
|
|
"github.com/kataras/iris/v12/core/router" |
|
|
|
"strings" |
|
|
|
) |
|
|
|
|
|
|
|
/****************************************************************************** |
|
|
@ -324,6 +326,54 @@ func RegisterMultiArtRouteOdsLst(party router.Party, httpMethod string, path str |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/****************************************************************************** |
|
|
|
* |
|
|
|
* @Function Name : RegisterSelectOneArtRouteOdsLstByArtId |
|
|
|
*----------------------------------------------------------------------------- |
|
|
|
* |
|
|
|
* @Description : 为一个查询ArtRouteStepOdsLst的方法注册路由 |
|
|
|
* |
|
|
|
* @Function Parameters : 路由分组 |
|
|
|
* |
|
|
|
* @Function Parameters : 路径 |
|
|
|
* |
|
|
|
* @Function Parameters : 实际处理请求的方法 |
|
|
|
* |
|
|
|
* @Author : 代码生成器创建 |
|
|
|
* |
|
|
|
* @Date : 2021-03-18 22:49:12 |
|
|
|
* |
|
|
|
******************************************************************************/ |
|
|
|
func RegisterSelectOneArtRouteOdsLstByArtId(party router.Party, path string, method func(*models.Usertab, string) (interface{}, error)) { |
|
|
|
|
|
|
|
party.Get(path, func(ctx iris.Context) { |
|
|
|
user, ok := jwts.ParseToken(ctx) |
|
|
|
if !ok { |
|
|
|
supports.Error(ctx, iris.StatusBadRequest, supports.ParseParamsFailur, nil) |
|
|
|
return |
|
|
|
} |
|
|
|
orderId := ctx.URLParam("artid") |
|
|
|
//截取物料id
|
|
|
|
if utils.ValueIsEmpty(orderId){ |
|
|
|
supports.Error(ctx, iris.StatusBadRequest, "序列订单流水号为空!", nil) |
|
|
|
return |
|
|
|
} |
|
|
|
orderIds := strings.Split(orderId,"GAAS") |
|
|
|
if len(orderIds) < 2{ |
|
|
|
supports.Error(ctx, iris.StatusBadRequest, "序列订单流水号错误!", nil) |
|
|
|
return |
|
|
|
} |
|
|
|
artId := orderIds[0] |
|
|
|
result, err := method(user, artId) |
|
|
|
if err != nil { |
|
|
|
supports.Error(ctx, iris.StatusBadRequest, err.Error(), nil) |
|
|
|
return |
|
|
|
} |
|
|
|
supports.Ok(ctx, supports.OptionSuccess, result) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
/****************************************************************************** |
|
|
|
* |
|
|
|
* @Function Name : RegisterInsertArtRouteOdsLst |
|
|
|