|
@@ -12,10 +12,8 @@ import java.text.SimpleDateFormat;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
-import com.shawn.model.Bean.Child;
|
|
|
|
-import com.shawn.model.Bean.Childlast;
|
|
|
|
-import com.shawn.model.Bean.Children2;
|
|
|
|
-import com.shawn.model.Bean.Children3;
|
|
|
|
|
|
+import com.gexin.fastjson.JSON;
|
|
|
|
+import com.shawn.model.Bean.*;
|
|
import com.shawn.model.dto.TAdminDTO;
|
|
import com.shawn.model.dto.TAdminDTO;
|
|
import com.shawn.model.dto.TEquipmentDTO;
|
|
import com.shawn.model.dto.TEquipmentDTO;
|
|
import com.shawn.model.entity.*;
|
|
import com.shawn.model.entity.*;
|
|
@@ -27,6 +25,7 @@ import com.shawn.repository.TOrderMapper;
|
|
import com.shawn.service.interfac.*;
|
|
import com.shawn.service.interfac.*;
|
|
import com.shawn.util.BeanUtils;
|
|
import com.shawn.util.BeanUtils;
|
|
import com.shawn.util.PushUtils;
|
|
import com.shawn.util.PushUtils;
|
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.http.HttpStatus;
|
|
import org.springframework.http.HttpStatus;
|
|
import org.springframework.http.ResponseEntity;
|
|
import org.springframework.http.ResponseEntity;
|
|
@@ -733,5 +732,74 @@ public class TEquipmentController extends BaseController<TEquipment, TEquipmentE
|
|
map.put("sundayDate", weekEnd);
|
|
map.put("sundayDate", weekEnd);
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
|
|
+ /**
|
|
|
|
+ * 推送设备共同以及/设备参数
|
|
|
|
+ *
|
|
|
|
+ * @param
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/updateParameters")
|
|
|
|
+ public ResponseEntity<?> updateCommonParam(@RequestBody CommonParamVo commonParamVo) {
|
|
|
|
+ String equipmentId = commonParamVo.getId();
|
|
|
|
+ TEquipment equipment = tEquipmentService.selectEntityById(Long.valueOf(equipmentId));
|
|
|
|
+ PushUtils.push(equipment.getGtClientId(), "", "", PushUtils.buildJson("Param", commonParamVo.getName() + ":" + commonParamVo.getVal()).toString());
|
|
|
|
|
|
|
|
+ return ResponseEntity
|
|
|
|
+ .status(HttpStatus.OK)
|
|
|
|
+ .body(new ResultMessage()
|
|
|
|
+ .setCode(true)
|
|
|
|
+ .setData("SUCCESS")
|
|
|
|
+ .setMessage("SUCCESS"));
|
|
|
|
+ }
|
|
|
|
+ /**
|
|
|
|
+ * 获取设备参数
|
|
|
|
+ *
|
|
|
|
+ * @param
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/getParameters")
|
|
|
|
+ public ResponseEntity<?> getParameters(@RequestBody CommonParamVo commonParamVo) {
|
|
|
|
+ String equipmentId = commonParamVo.getId();
|
|
|
|
+ String code = commonParamVo.getCode();
|
|
|
|
+ String name = commonParamVo.getName();
|
|
|
|
+ TEquipment equipment = tEquipmentService.selectEntityById(Long.valueOf(equipmentId));
|
|
|
|
+ List<CommonParamVo> commonParamVos = null;
|
|
|
|
+ String commonParameters = equipment.getCommonParameters();
|
|
|
|
+ String advancedParameters = equipment.getAdvancedParameters();
|
|
|
|
+// if (StringUtils.isEmpty(commonParameters) || StringUtils.isEmpty(advancedParameters)) {
|
|
|
|
+ if (StringUtils.isEmpty(advancedParameters)) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ if (code.equals("0")) {
|
|
|
|
+ commonParamVos = JSON.parseArray(commonParameters, CommonParamVo.class);
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+
|
|
|
|
+ commonParamVos = JSON.parseArray(advancedParameters, CommonParamVo.class);
|
|
|
|
+ }
|
|
|
|
+// for (CommonParamVo commonParam : commonParamVos) {
|
|
|
|
+// if (commonParam.getName().equals(name)) {
|
|
|
|
+// commonParam.getVal();
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+ return ResponseEntity
|
|
|
|
+ .status(HttpStatus.OK)
|
|
|
|
+ .body(new ResultMessage()
|
|
|
|
+ .setCode(true)
|
|
|
|
+ .setData(commonParamVos)
|
|
|
|
+ .setMessage("SUCCESS"));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //获取厕所使用情况
|
|
|
|
+ @PostMapping("/getBoxs")
|
|
|
|
+ public ResponseEntity<?> getBoxs(@RequestBody StatisticsParam param) {
|
|
|
|
+ String equipmentId = param.getEquipmentId();
|
|
|
|
+ List<TBox> boxs = tEquipmentService.getBoxs(equipmentId);
|
|
|
|
+ return ResponseEntity
|
|
|
|
+ .status(HttpStatus.OK)
|
|
|
|
+ .body(new ResultMessage()
|
|
|
|
+ .setCode(true)
|
|
|
|
+ .setData(boxs)
|
|
|
|
+ .setMessage("SUCCESS"));
|
|
|
|
+ }
|
|
}
|
|
}
|