返回数据

This commit is contained in:
chc0125 2025-02-26 11:12:15 +08:00
parent c15d821f32
commit f10c6a2361
3 changed files with 21 additions and 4 deletions

View File

@ -69,7 +69,7 @@ public class AppPmsController extends BaseController {
// 判断入库单号是否重复 // 判断入库单号是否重复
AppPmsOrderIn existAppPmsOrderIn = appPmsOrderInService.selectAppPmsOrderInByListId(orderInRequest.getListId()); AppPmsOrderIn existAppPmsOrderIn = appPmsOrderInService.selectAppPmsOrderInByListId(orderInRequest.getListId());
if (existAppPmsOrderIn != null) { if (existAppPmsOrderIn != null) {
return error("入库单号重复。"); return AjaxResult.error(201,"入库单已存在");
} }
AppPmsOrderIn appPmsOrderIn = new AppPmsOrderIn(); AppPmsOrderIn appPmsOrderIn = new AppPmsOrderIn();
BeanUtils.copyProperties(orderInRequest, appPmsOrderIn); BeanUtils.copyProperties(orderInRequest, appPmsOrderIn);
@ -88,7 +88,11 @@ public class AppPmsController extends BaseController {
if (i == 0) { if (i == 0) {
return error("存入入库码盘信息失败"); return error("存入入库码盘信息失败");
} }
return toAjax(appPmsOrderInService.insertAppPmsOrderIn(appPmsOrderIn)); int i1 = appPmsOrderInService.insertAppPmsOrderIn(appPmsOrderIn);
if (i1 == 0) {
return error("入库单保存失败");
}
return AjaxResult.success("success");
} }
/** /**

View File

@ -298,7 +298,7 @@ public class AppTaskController extends BaseController
wcsDate.setUser("WMS"); wcsDate.setUser("WMS");
wcsDate.setVehicleNo(wcsStackerTask.getVehicleNo()); wcsDate.setVehicleNo(wcsStackerTask.getVehicleNo());
wcsDate.setDestination(location); wcsDate.setDestination(location);
return success(wcsDate); return AjaxResult.success(0,"请求成功",wcsDate);
} }
@ApiOperation("任务反馈") @ApiOperation("任务反馈")
@ -465,7 +465,7 @@ public class AppTaskController extends BaseController
} }
} }
return success(); return AjaxResult.success(0,"成功");
} }
@PostMapping("/kk") @PostMapping("/kk")
@Anonymous @Anonymous

View File

@ -23,6 +23,7 @@ public class AjaxResult extends HashMap<String, Object>
/** 数据对象 */ /** 数据对象 */
public static final String DATA_TAG = "data"; public static final String DATA_TAG = "data";
/** /**
* 初始化一个新创建的 AjaxResult 对象使其表示一个空消息 * 初始化一个新创建的 AjaxResult 对象使其表示一个空消息
*/ */
@ -59,6 +60,8 @@ public class AjaxResult extends HashMap<String, Object>
} }
} }
/** /**
* 返回成功消息 * 返回成功消息
* *
@ -102,6 +105,16 @@ public class AjaxResult extends HashMap<String, Object>
return new AjaxResult(HttpStatus.SUCCESS, msg, data); return new AjaxResult(HttpStatus.SUCCESS, msg, data);
} }
public static AjaxResult success(int code,String msg, Object returnDate)
{
return new AjaxResult(code, msg, returnDate);
}
public static AjaxResult success(int code,String msg)
{
return new AjaxResult(code, msg);
}
/** /**
* 返回警告消息 * 返回警告消息
* *