|
@@ -86,11 +86,15 @@ public class TdDeviceController extends BaseController {
|
86
|
86
|
return ResponseBean.error("未绑定农机");
|
87
|
87
|
}
|
88
|
88
|
|
89
|
|
- TdDevice origin = iTdDeviceService.getExistBy("machinery_id", tdDevice.getMachineryId(), false, true);
|
|
89
|
+ if (StringUtils.isEmpty(tdDevice.getDeviceNo()) || StringUtils.isEmpty(tdDevice.getDeviceType())) {
|
|
90
|
+ return ResponseBean.error("未选择设备");
|
|
91
|
+ }
|
|
92
|
+
|
|
93
|
+ TdDevice origin = iTdDeviceService.getExistByDevice(tdDevice.getDeviceType(), tdDevice.getDeviceNo());
|
90
|
94
|
if (isNew) {
|
91
|
95
|
// 如果是新增操作
|
92
|
96
|
if (null != origin) {
|
93
|
|
- return ResponseBean.error("该农机已绑定设备");
|
|
97
|
+ return ResponseBean.error("该农机已绑定设备, 请先解绑");
|
94
|
98
|
}
|
95
|
99
|
} else {
|
96
|
100
|
if (null != origin) {
|