|
|
@ -609,4 +609,43 @@ func RegisterSplitPackOrderBySerialOrderId(party router.Party, path string, meth |
|
|
|
} |
|
|
|
supports.Ok(ctx, supports.OptionSuccess, nil) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
/****************************************************************************** |
|
|
|
* |
|
|
|
* @Function Name : RegisterScanBarcodeOutLine |
|
|
|
*----------------------------------------------------------------------------- |
|
|
|
* |
|
|
|
* @Description : 线外打包扫描工单条码进包 |
|
|
|
* |
|
|
|
* @Function Parameters : 路由分组 |
|
|
|
* |
|
|
|
* @Function Parameters : 路径 |
|
|
|
* |
|
|
|
* @Function Parameters : 实际处理请求的方法 |
|
|
|
* |
|
|
|
* @Author : zhangxin |
|
|
|
* |
|
|
|
* @Date : 2021-10-22 |
|
|
|
* |
|
|
|
******************************************************************************/ |
|
|
|
func RegisterScanBarcodeOutLine(party router.Party, path string, method func(user *global.User, barcode string) (*model.PackOrderInfo, error)) { |
|
|
|
|
|
|
|
party.Get(path, func(ctx iris.Context) { |
|
|
|
user, ok := jwts.ParseToken(ctx) |
|
|
|
if !ok { |
|
|
|
return |
|
|
|
} |
|
|
|
barcode := ctx.URLParam("barcode") |
|
|
|
if barcode == "" { |
|
|
|
supports.Error(ctx, iris.StatusBadRequest, "未获取到工单条码", nil) |
|
|
|
return |
|
|
|
} |
|
|
|
result, err := method(user, barcode) |
|
|
|
if err != nil { |
|
|
|
supports.Error(ctx, iris.StatusBadRequest, err.Error(), nil) |
|
|
|
return |
|
|
|
} |
|
|
|
supports.Ok(ctx, supports.OptionSuccess, result) |
|
|
|
}) |
|
|
|
} |