...
|
...
|
@@ -218,10 +218,18 @@ public class TkDeviceScriptController extends BaseController { |
218
|
218
|
throw new TkDataValidationException(String.format(ErrorMessage.NEED_MAIN_PARAMETER.getMessage(),"设备地址码"));
|
219
|
219
|
}
|
220
|
220
|
if(StringUtils.isEmpty(inputParams.getMethod()) || null == inputParams.getCrc() ||
|
221
|
|
- null ==inputParams.getRegisterNumber() || null ==inputParams.getRegisterAddress() ||
|
222
|
|
- null ==inputParams.getRegisterValues() || inputParams.getRegisterValues().isEmpty()){
|
|
221
|
+ null ==inputParams.getRegisterAddress()){
|
223
|
222
|
throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage());
|
224
|
223
|
}
|
|
224
|
+ if(null !=inputParams.getRegisterNumber() && null !=inputParams.getRegisterValues() &&
|
|
225
|
+ !inputParams.getRegisterValues().isEmpty()){
|
|
226
|
+ List<Integer> registerValues = inputParams.getRegisterValues();
|
|
227
|
+ for (Integer value : registerValues){
|
|
228
|
+ if(null == value){
|
|
229
|
+ throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage());
|
|
230
|
+ }
|
|
231
|
+ }
|
|
232
|
+ }
|
225
|
233
|
return ResponseEntity.ok(scriptService.modbus(inputParams));
|
226
|
234
|
}
|
227
|
235
|
|
...
|
...
|
|