|
@ -33,18 +33,6 @@ public class DeviceManageService extends BaseJpaService<DeviceDetail,DeviceDetai
|
|
|
@Autowired
|
|
|
private DeviceDao deviceDao;
|
|
|
|
|
|
public JSONObject findDmDeviceDictName() {
|
|
|
String deviceNameSql = "select name, id from dm_device";
|
|
|
String deviceModelSql = "select model, id from dm_device";
|
|
|
|
|
|
List<Map<String, Object>> deviceName = jdbcTemplate.queryForList(deviceNameSql);
|
|
|
List<Map<String, Object>> deviceModel = jdbcTemplate.queryForList(deviceModelSql);
|
|
|
JSONObject result = new JSONObject();
|
|
|
result.put("deviceName",deviceName);
|
|
|
result.put("deviceModel",deviceModel);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
public JSONObject saveWlyyDevice(String json)throws Exception{
|
|
|
JSONObject result = new JSONObject();
|
|
|
DeviceDetail deviceDetail = objectMapper.readValue(json, DeviceDetail.class);
|
|
@ -63,11 +51,8 @@ public class DeviceManageService extends BaseJpaService<DeviceDetail,DeviceDetai
|
|
|
String iccid = deviceDetail.getIccid();
|
|
|
String imsi = deviceDetail.getImsi();
|
|
|
DeviceDetail tmps1 = deviceDetailDao.findBySn(deviceSn);
|
|
|
if (tmps1.getId()!=deviceDetail.getId()) {
|
|
|
if (tmps1 != null) {
|
|
|
if (tmps1.getId()!=deviceDetail.getId()) {
|
|
|
|
|
|
}
|
|
|
if (tmps1 != null) {
|
|
|
if (tmps1.getId()!=deviceDetail.getId()) {
|
|
|
result.put(ResponseContant.resultFlag, ResponseContant.fail);
|
|
|
result.put(ResponseContant.resultMsg, "设备SN码重复");
|
|
|
return result;
|
|
@ -206,4 +191,21 @@ public class DeviceManageService extends BaseJpaService<DeviceDetail,DeviceDetai
|
|
|
ws.addCell(label);
|
|
|
}
|
|
|
|
|
|
public JSONObject findDmDeviceDictName(String code, String name) {
|
|
|
JSONObject result = new JSONObject();
|
|
|
String deviceSql = "select id, name, model from dm_device where 1=1 ";
|
|
|
if (StringUtils.isNotBlank(code)){
|
|
|
deviceSql+=" and category_code = "+ code;
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(name)){
|
|
|
deviceSql+=" and name = " + "'" + name + "'";
|
|
|
}
|
|
|
|
|
|
List<Map<String, Object>> deviceName = jdbcTemplate.queryForList(deviceSql);
|
|
|
result.put("deviceName",deviceName);
|
|
|
|
|
|
return result;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|