Commit 334812b9 authored by 王晓倩's avatar 王晓倩

新增工单接口返回工单id

parent eb4de9ef
...@@ -100,13 +100,14 @@ public class TWorkOrderController extends BaseController ...@@ -100,13 +100,14 @@ public class TWorkOrderController extends BaseController
@PostMapping @PostMapping
public AjaxResult add(@RequestBody TWorkOrder tWorkOrder) throws Exception public AjaxResult add(@RequestBody TWorkOrder tWorkOrder) throws Exception
{ {
String orderId = null;
try { try {
tWorkOrderService.insertTWorkOrder(tWorkOrder); orderId = tWorkOrderService.insertTWorkOrder(tWorkOrder);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
throw new Exception("新增工单信息失败"); throw new Exception("新增工单信息失败");
} }
return AjaxResult.success(); return AjaxResult.success(orderId);
} }
/** /**
......
...@@ -36,7 +36,7 @@ public interface ITWorkOrderService ...@@ -36,7 +36,7 @@ public interface ITWorkOrderService
* @param tWorkOrder 工单基础信息 * @param tWorkOrder 工单基础信息
* @return 结果 * @return 结果
*/ */
public int insertTWorkOrder(TWorkOrder tWorkOrder) throws Exception; public String insertTWorkOrder(TWorkOrder tWorkOrder) throws Exception;
/** /**
* 修改工单基础信息 * 修改工单基础信息
......
...@@ -224,7 +224,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService ...@@ -224,7 +224,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
* @return 结果 * @return 结果
*/ */
@Override @Override
public int insertTWorkOrder(TWorkOrder tWorkOrder) throws Exception public String insertTWorkOrder(TWorkOrder tWorkOrder) throws Exception
{ {
String orderId = tWorkOrderMapper.getWorkOrderId(); String orderId = tWorkOrderMapper.getWorkOrderId();
int resourceId = tWorkOrder.getResourceId(); int resourceId = tWorkOrder.getResourceId();
...@@ -256,7 +256,8 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService ...@@ -256,7 +256,8 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
tDeviceAlarmMapper.updateTDeviceAlarm(alarm); tDeviceAlarmMapper.updateTDeviceAlarm(alarm);
} }
return tWorkOrderMapper.insertTWorkOrder(tWorkOrder); tWorkOrderMapper.insertTWorkOrder(tWorkOrder);
return orderId;
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment