标签配置
data-rule="required;remote[get:comp/tDevicetype/existDevice];"
Ajax请求(返回的字符串为提示信息)
@Log(description = "验证设备标示是否已经在系统中存在")
@RequestMapping(value="/existDevice",method=RequestMethod.GET)
@ResponseBody
public String existDevice(
@PathParam(required = true) String device) {
boolean isExist = tDevicetypeService.selectByDevice(device).size() == 0;
return isExist?"":"该设备标示已存在";
}