|
|
@ -83,7 +83,7 @@ public class YDeviceService extends ServiceImpl<YDeviceMapper, Device> { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public Map<String, String> getStatusCount(String deviceType, String statusType) { |
|
|
|
public Map<String, String> getStatusCount(String deviceType, String statusType, String ckId) { |
|
|
|
Map<String, String> map = new HashMap<>(); |
|
|
|
QueryWrapper<Device> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
|
|
@ -91,6 +91,7 @@ public class YDeviceService extends ServiceImpl<YDeviceMapper, Device> { |
|
|
|
queryWrapper.eq("type", deviceType); |
|
|
|
} |
|
|
|
queryWrapper.eq("isDelete", 0); |
|
|
|
queryWrapper.eq("ckId", ckId); |
|
|
|
queryWrapper.isNotNull("status"); |
|
|
|
queryWrapper.notIn("type", "4,5".split(",")); |
|
|
|
queryWrapper.select("status", "count(status) as total"); |
|
|
@ -118,12 +119,30 @@ public class YDeviceService extends ServiceImpl<YDeviceMapper, Device> { |
|
|
|
public List<WareHouse> getWareHouseList() { |
|
|
|
|
|
|
|
List<WareHouse> athleteBOIPage = null; |
|
|
|
String url = "http://jianguan.yyundong.com/api/portal/v1/flow/storeHouseListPage"; |
|
|
|
String result = ""; |
|
|
|
|
|
|
|
try { |
|
|
|
athleteBOIPage = yDeviceMapper.getWareHouseList(); |
|
|
|
Map<String, Object> paramMap = new HashMap<>(); |
|
|
|
paramMap.put("current", "1"); |
|
|
|
paramMap.put("size", "1000"); |
|
|
|
paramMap.put("params", new Object()); |
|
|
|
String jsonParam = JSONObject.toJSONString(paramMap); |
|
|
|
result = HttpUtils.sendPostJson(url, jsonParam, ""); |
|
|
|
JSONObject jsonObject = JSONObject.parseObject(result); |
|
|
|
JSONObject jsonData = (JSONObject) jsonObject.get("data"); |
|
|
|
String jsonRecords = jsonData.getString("records"); |
|
|
|
athleteBOIPage = JSONArray.parseArray(jsonRecords, WareHouse.class); |
|
|
|
} catch (Exception e) { |
|
|
|
System.out.println(e); |
|
|
|
athleteBOIPage = null; |
|
|
|
} |
|
|
|
// try {
|
|
|
|
// athleteBOIPage = yDeviceMapper.getWareHouseList();
|
|
|
|
// } catch (Exception e) {
|
|
|
|
// System.out.println(e);
|
|
|
|
// athleteBOIPage = null;
|
|
|
|
// }
|
|
|
|
return athleteBOIPage; |
|
|
|
} |
|
|
|
|
|
|
@ -160,9 +179,13 @@ public class YDeviceService extends ServiceImpl<YDeviceMapper, Device> { |
|
|
|
} |
|
|
|
JSONObject jsonObject = JSONObject.parseObject(result); |
|
|
|
JSONObject dataJson = (JSONObject) jsonObject.get("data"); |
|
|
|
IPage<Device> iPage = new Page<>(); |
|
|
|
if (dataJson == null) { |
|
|
|
return iPage; |
|
|
|
} |
|
|
|
JSONArray jsonArray = (JSONArray) dataJson.get("rows"); |
|
|
|
String deviceSerial = ""; |
|
|
|
IPage<Device> iPage = new Page<>(); |
|
|
|
|
|
|
|
List<Device> list = new ArrayList<>(); |
|
|
|
String notIds = ""; |
|
|
|
for (Object obj : jsonArray) { |
|
|
|