Browse Source

no message

master
xia 2 years ago
parent
commit
dfb993fd7f
  1. 27
      storeroom/src/main/java/com/storeroom/modules/device/controller/DeviceController.java

27
storeroom/src/main/java/com/storeroom/modules/device/controller/DeviceController.java

@ -1,6 +1,7 @@
package com.storeroom.modules.device.controller;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.storeroom.annotaion.rest.AnonymousDeleteMapping;
import com.storeroom.annotaion.rest.AnonymousGetMapping;
@ -14,11 +15,14 @@ import com.storeroom.modules.device.service.OperatingStateService;
import com.storeroom.modules.storeroom3d.service.AlarmInfoService;
import com.storeroom.modules.storeroom3d.service.ThirdApiService;
import com.storeroom.utils.ApiResponse;
import com.storeroom.utils.HttpUtils;
import com.storeroom.utils.StringUtils;
import com.storeroom.utils.enums.ResponseStatus;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.apache.http.HttpResponse;
import org.apache.http.util.EntityUtils;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestBody;
@ -114,13 +118,26 @@ public class DeviceController {
if (StringUtils.isEmpty(storeroomCode)) {
storeroomCode = "12345678";
}
Object obj = thirdApiService.getCabinetState(url1, storeroomCode, QuNo);
if (ObjectUtils.isEmpty(obj)) {
count = 0;
} else {
JSONObject json = new JSONObject();
json.put("StoreCode", storeroomCode);
json.put("QuNo",QuNo);
try {
HashMap<String, String> llmap = new HashMap<>();
llmap.put("Content-type", "application/json");
HttpResponse response = HttpUtils.doPost(url1, "/IntelligentCabinetAPIServer/ReportStatus",
"POST", llmap, null, json.toJSONString());
String retust = EntityUtils.toString(response.getEntity());
count = deviceService.getDeviceTypeNum("DD656054BE3D1DF1E2F1FC");
}catch (Exception e){
count = 0;
}
// Object obj = thirdApiService.getCabinetState(url1, storeroomCode, QuNo);
// if (ObjectUtils.isEmpty(obj)) {
// count = 0;
// } else {
// count = deviceService.getDeviceTypeNum("DD656054BE3D1DF1E2F1FC");
// }
count += deviceService.getDeviceTypeNum("65D1886B0F864291766421");
count += deviceService.getDeviceTypeNum("7305DE3D273B0CAC079538");

Loading…
Cancel
Save