|
@@ -286,8 +286,24 @@ public class CleanController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
+
|
|
|
+ if(overdueDate==null||overdueDate.equals("")){
|
|
|
+ Date date = new Date();
|
|
|
+ SimpleDateFormat sformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//日期格式
|
|
|
+ overdueDate = sformat.format(date);
|
|
|
+ }else{
|
|
|
+ if(overdueDate.endsWith(".0")){
|
|
|
+ overdueDate = overdueDate.substring(0,overdueDate.length()-2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(remaining==null||remaining.equals("")){
|
|
|
+ remaining = "0";
|
|
|
+ }
|
|
|
jsonObject.put("overdueDate", overdueDate);
|
|
|
jsonObject.put("remaining", remaining);
|
|
|
+ equipment.setRemaining(remaining);
|
|
|
+ equipment.setOverdueDate(overdueDate);
|
|
|
+ equipmentService.update(equipment);
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|
|
@@ -324,18 +340,29 @@ public class CleanController extends BaseController {
|
|
|
equipment.setRemaining(String.valueOf(re));
|
|
|
equipmentService.update(equipment);
|
|
|
if(re==0){
|
|
|
- return "机器已过期";
|
|
|
+ return JsonMessage.success("机器已过期");
|
|
|
}
|
|
|
}
|
|
|
} catch (ParseException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
- return "success";
|
|
|
+ return JsonMessage.success("success");
|
|
|
}
|
|
|
private String getMessage(String content, String name, String clientId) {
|
|
|
String message = "您好,机器" + content + ",机器名:" + name + ",设备号:" + clientId;
|
|
|
return message;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取时间
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/getTime", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
|
|
|
+ @ResponseBody
|
|
|
+ public Object getTime() {
|
|
|
+ Date date = new Date();
|
|
|
+ SimpleDateFormat sformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//日期格式
|
|
|
+ return JsonMessage.success(sformat.format(date));
|
|
|
+ }
|
|
|
+
|
|
|
}
|