优化R的调用返回
This commit is contained in:
parent
8e46276be0
commit
7312fb765b
@ -53,7 +53,7 @@ public class ApmsController extends BaseController {
|
||||
|
||||
@PostMapping(value = "apmsPostOrder")
|
||||
@ApiOperation(value = "接收APMS推送订单信息")
|
||||
public R apmsPostOrder(@Validated @RequestBody OrderParamForApms apmsPostOrderParam) {
|
||||
public R<String> apmsPostOrder(@Validated @RequestBody OrderParamForApms apmsPostOrderParam) {
|
||||
CommunicationLog communicationLog = new CommunicationLog();
|
||||
communicationLog.setCode("APMS" + System.currentTimeMillis());
|
||||
communicationLog.setLogName("WMS接收APMS订单");
|
||||
@ -66,7 +66,7 @@ public class ApmsController extends BaseController {
|
||||
|
||||
@PostMapping(value = "apmsVoidOrder")
|
||||
@ApiOperation(value = "APMS作废订单")
|
||||
public R apmsVoidOrder(@Validated @RequestBody String idenCardNum) {
|
||||
public R<String> apmsVoidOrder(@Validated @RequestBody String idenCardNum) {
|
||||
CommunicationLog communicationLog = new CommunicationLog();
|
||||
communicationLog.setCode("APMS" + System.currentTimeMillis());
|
||||
communicationLog.setLogName("APMS作废订单");
|
||||
@ -79,7 +79,7 @@ public class ApmsController extends BaseController {
|
||||
|
||||
@PostMapping(value = "apmsCompleteOrder")
|
||||
@ApiOperation(value = "APMS完成订单,返回加工单检验结果")
|
||||
public R apmsCompleteOrder(@Validated @RequestBody ApmsCompleteOrder apmsCompleteOrder) {
|
||||
public R<String> apmsCompleteOrder(@Validated @RequestBody ApmsCompleteOrder apmsCompleteOrder) {
|
||||
CommunicationLog communicationLog = new CommunicationLog();
|
||||
communicationLog.setCode("APMS" + System.currentTimeMillis());
|
||||
communicationLog.setLogName("APMS完成订单,返回WMS加工单检验结果");
|
||||
@ -93,7 +93,7 @@ public class ApmsController extends BaseController {
|
||||
|
||||
@PostMapping(value = "createProcessSheet")
|
||||
@ApiOperation(value = "通知APMS创建生产单接口")
|
||||
public R createProcessSheet(@Validated @RequestBody ApmsCreateProcessSheet apmsCreateProcess) {
|
||||
public R<ApmsCreateProcessSheetVo> createProcessSheet(@Validated @RequestBody ApmsCreateProcessSheet apmsCreateProcess) {
|
||||
checkToken();
|
||||
String paramJson = JSONUtil.toJsonStr(apmsCreateProcess);
|
||||
HttpResponse response = HttpUtil.createPost(ApiAddress + "/platform/api/createProcessSheet")
|
||||
@ -110,7 +110,7 @@ public class ApmsController extends BaseController {
|
||||
|
||||
@PostMapping(value = "startProcess")
|
||||
@ApiOperation(value = "通知APMS生产单开始处理")
|
||||
public R startProcess(@Validated @RequestBody ApmsStartProcess apmsStartProcess) {
|
||||
public R<ApmsStartProcess> startProcess(@Validated @RequestBody ApmsStartProcess apmsStartProcess) {
|
||||
checkToken();
|
||||
String paramJson = JSONUtil.toJsonStr(apmsStartProcess);
|
||||
HttpResponse response = HttpUtil.createPost(ApiAddress + "/platform/api/startProcess")
|
||||
@ -127,7 +127,7 @@ public class ApmsController extends BaseController {
|
||||
|
||||
@PostMapping(value = "endProcess")
|
||||
@ApiOperation(value = "通知APMS生产单结束处理")
|
||||
public R endProcess(@Validated @RequestBody ApmsEndProcess apmsEndProcess) {
|
||||
public R<ApmsEndProcessVo> endProcess(@Validated @RequestBody ApmsEndProcess apmsEndProcess) {
|
||||
checkToken();
|
||||
String paramJson = JSONUtil.toJsonStr(apmsEndProcess);
|
||||
HttpResponse response = HttpUtil.createPost(ApiAddress + "/platform/api/endProcess")
|
||||
@ -144,7 +144,7 @@ public class ApmsController extends BaseController {
|
||||
|
||||
@PostMapping(value = "finishProcessSheet")
|
||||
@ApiOperation(value = "通知APMS完成生产单接口")
|
||||
public R finishProcessSheet(@Validated @RequestBody ApmsFinishProcessSheet apmsFinishProcessSheet) {
|
||||
public R<ApmsFinishProcessSheetVo> finishProcessSheet(@Validated @RequestBody ApmsFinishProcessSheet apmsFinishProcessSheet) {
|
||||
checkToken();
|
||||
String paramJson = JSONUtil.toJsonStr(apmsFinishProcessSheet);
|
||||
HttpResponse response = HttpUtil.createPost(ApiAddress + "/platform/api/finishProcessSheet")
|
||||
@ -161,7 +161,7 @@ public class ApmsController extends BaseController {
|
||||
|
||||
@PostMapping(value = "getApmsToken")
|
||||
@ApiOperation(value = "获取APMS Token")
|
||||
public R getApmsToken() {
|
||||
public R<String> getApmsToken() {
|
||||
HashMap<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("apiKey", "7ee8f59bbaeae27e");
|
||||
paramMap.put("platFormCode", "CUC");
|
||||
@ -183,7 +183,7 @@ public class ApmsController extends BaseController {
|
||||
|
||||
@PostMapping(value = "getStoveCodeByWorkShopCode")
|
||||
@ApiOperation(value = "APMS通过车间编码获取炉号信息")
|
||||
public R getStoveCodeByWorkShopCode(String workShopCode) {
|
||||
public R<ApmsStoveVo> getStoveCodeByWorkShopCode(String workShopCode) {
|
||||
checkToken();
|
||||
HashMap<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("workShopCode", workShopCode);
|
||||
|
@ -48,5 +48,5 @@ public interface CurrTaskService {
|
||||
* @param param id
|
||||
* @return 结果
|
||||
*/
|
||||
R completeTask(IdParam param);
|
||||
R<String> completeTask(IdParam param);
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ public interface OrderInfoService {
|
||||
* @param apmsPostOrderParam 订单参数
|
||||
* @return 操作结果
|
||||
*/
|
||||
R apmsPostOrder(OrderParamForApms apmsPostOrderParam);
|
||||
R<String> apmsPostOrder(OrderParamForApms apmsPostOrderParam);
|
||||
|
||||
/**
|
||||
* 查询当前订单列表
|
||||
@ -30,13 +30,15 @@ public interface OrderInfoService {
|
||||
* @return 分页结果集
|
||||
*/
|
||||
R<PageVo<OrderInfoVo>> page(OrderInfoBasePageParam orderInfoBasePageParam);
|
||||
|
||||
/**
|
||||
* 人工创建订单
|
||||
*
|
||||
* @param orderInfoPersonCreateParam 人工订单参数
|
||||
* @return 结果
|
||||
*/
|
||||
R personCreateOrder(OrderInfoPersonCreateParam orderInfoPersonCreateParam);
|
||||
R<String> personCreateOrder(OrderInfoPersonCreateParam orderInfoPersonCreateParam);
|
||||
|
||||
/**
|
||||
* 获取详细单条信息
|
||||
*
|
||||
@ -65,7 +67,7 @@ public interface OrderInfoService {
|
||||
* @param idParam id号
|
||||
* @return 结果
|
||||
*/
|
||||
R completeOrder(IdParam idParam);
|
||||
R<String> completeOrder(IdParam idParam);
|
||||
|
||||
/**
|
||||
* 作废订单
|
||||
@ -73,7 +75,7 @@ public interface OrderInfoService {
|
||||
* @param idParam id号
|
||||
* @return 结果
|
||||
*/
|
||||
R voidOrder(IdParam idParam);
|
||||
R<String> voidOrder(IdParam idParam);
|
||||
|
||||
/**
|
||||
* APMS作废订单
|
||||
@ -81,7 +83,7 @@ public interface OrderInfoService {
|
||||
* @param idenCardNum 标识卡号
|
||||
* @return 结果
|
||||
*/
|
||||
R apmsVoidOrder(String idenCardNum);
|
||||
R<String> apmsVoidOrder(String idenCardNum);
|
||||
|
||||
/**
|
||||
* APMS返回订单结果
|
||||
@ -89,6 +91,6 @@ public interface OrderInfoService {
|
||||
* @param apmsCompleteOrder 订单检验结果
|
||||
* @return 结果
|
||||
*/
|
||||
R apmsCompleteOrder(ApmsCompleteOrder apmsCompleteOrder);
|
||||
R<String> apmsCompleteOrder(ApmsCompleteOrder apmsCompleteOrder);
|
||||
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ public interface TaskDetHisService {
|
||||
* @param taskDetHis 任务详情历史
|
||||
* @return 结果
|
||||
*/
|
||||
R save(TaskDetHis taskDetHis);
|
||||
R<String> save(TaskDetHis taskDetHis);
|
||||
|
||||
/**
|
||||
* 保存任务详情历史list
|
||||
@ -30,7 +30,7 @@ public interface TaskDetHisService {
|
||||
* @param taskDetHis 任务详情历史
|
||||
* @return 结果
|
||||
*/
|
||||
R saveList(List<TaskDetHis> taskDetHis);
|
||||
R<String> saveList(List<TaskDetHis> taskDetHis);
|
||||
|
||||
/**
|
||||
* 保存任务详情历史list
|
||||
|
@ -81,7 +81,7 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
|
||||
}
|
||||
|
||||
@Override
|
||||
public R completeTask(IdParam param) {
|
||||
public R<String> completeTask(IdParam param) {
|
||||
CurrTask byId = currTaskServiceBiz.getById(param.getId());
|
||||
TaskHis taskHis = new TaskHis();
|
||||
BeanUtils.copyProperties(byId, taskHis);
|
||||
|
@ -79,7 +79,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
|
||||
ApmsController apmsControl;
|
||||
|
||||
@Override
|
||||
public R apmsPostOrder(OrderParamForApms apmsPostOrderParam) {
|
||||
public R<String> apmsPostOrder(OrderParamForApms apmsPostOrderParam) {
|
||||
OrderInfo orderInfo = new OrderInfo();
|
||||
BeanUtils.copyProperties(apmsPostOrderParam, orderInfo);
|
||||
setCommonField(orderInfo);
|
||||
@ -102,13 +102,13 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
|
||||
}
|
||||
|
||||
@Override
|
||||
public R personCreateOrder(OrderInfoPersonCreateParam orderInfoPersonCreateParam) {
|
||||
public R<String> personCreateOrder(OrderInfoPersonCreateParam orderInfoPersonCreateParam) {
|
||||
OrderInfo orderInfo = new OrderInfo();
|
||||
BeanUtils.copyProperties(orderInfoPersonCreateParam,orderInfo);
|
||||
BeanUtils.copyProperties(orderInfoPersonCreateParam, orderInfo);
|
||||
setCommonField(orderInfo);
|
||||
//设定来源信息为人工
|
||||
orderInfo.setOrderSource(OrderSourceEnum.PERSON.getValue());
|
||||
orderInfo.setInterCode("PERSONAL"+System.currentTimeMillis());
|
||||
orderInfo.setInterCode("PERSONAL" + System.currentTimeMillis());
|
||||
orderInfoService.save(orderInfo);
|
||||
return successful("人工创建订单成功。");
|
||||
}
|
||||
@ -173,7 +173,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
|
||||
}
|
||||
|
||||
@Override
|
||||
public R completeOrder(IdParam idParam) {
|
||||
public R<String> completeOrder(IdParam idParam) {
|
||||
OrderInfo byId = orderInfoService.getById(idParam.getId());
|
||||
orderInfoHisService.save(byId);
|
||||
byId.setValid(0);
|
||||
@ -183,7 +183,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
|
||||
}
|
||||
|
||||
@Override
|
||||
public R voidOrder(IdParam idParam) {
|
||||
public R<String> voidOrder(IdParam idParam) {
|
||||
OrderInfo byId = orderInfoService.getById(idParam.getId());
|
||||
byId.setValid(0);
|
||||
orderInfoService.updateById(byId);
|
||||
@ -191,7 +191,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
|
||||
}
|
||||
|
||||
@Override
|
||||
public R apmsVoidOrder(String idenCardNum) {
|
||||
public R<String> apmsVoidOrder(String idenCardNum) {
|
||||
OrderInfo byId = orderInfoService.getOne(new QueryWrapper<OrderInfo>().eq(OrderInfo.IDEN_CARD_NUM, idenCardNum));
|
||||
//确定是否有订单在生产
|
||||
List<CurrTaskDet> taskDetailsByIdenCardNum = currTaskDetService.getTaskDetailsByIdenCardNum(idenCardNum);
|
||||
@ -206,7 +206,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
|
||||
}
|
||||
|
||||
@Override
|
||||
public R apmsCompleteOrder(ApmsCompleteOrder apmsCompleteOrder) {
|
||||
public R<String> apmsCompleteOrder(ApmsCompleteOrder apmsCompleteOrder) {
|
||||
//通过标识卡号与生产单号进行更新检验结果
|
||||
ApmsCheckResult one = apmsCheckResultServiceBiz.getOne(new QueryWrapper<ApmsCheckResult>().eq(ApmsCheckResult.IDEN_CARD_NUM, apmsCompleteOrder.getIdenCardNum()).eq(ApmsCheckResult.SHEET_NO, apmsCompleteOrder.getSheetNo()));
|
||||
one.setMetallography(apmsCompleteOrder.getMetallographic());
|
||||
|
@ -33,15 +33,15 @@ public class TaskDetHisServiceImpl extends BaseService implements TaskDetHisServ
|
||||
|
||||
|
||||
@Override
|
||||
public R save(TaskDetHis taskDetHis) {
|
||||
public R<String> save(TaskDetHis taskDetHis) {
|
||||
taskDetHisServiceBiz.save(taskDetHis);
|
||||
return successful("操作成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public R saveList(List<TaskDetHis> taskDetHis) {
|
||||
public R<String> saveList(List<TaskDetHis> taskDetHis) {
|
||||
taskDetHisServiceBiz.saveBatch(taskDetHis);
|
||||
return null;
|
||||
return successful("操作成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user