| | |
| | | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | //å¹é
æå¡æ¶é´ |
| | | Boolean or = false; |
| | | if(planBoolean){ |
| | | //æ¥è¯¢è¯¥è®¡åçææå
´è¶£ç¹ |
| | | List<ArdAlarmpointsWell> wellList = wellMapper.wellByPlanId(planId); |
| | | //æ¥è¯¢è¯¥è®¡åçæææ§è¡äºº |
| | | List<SysUser> userList = sysUserMapper.userByPlanId(planId); |
| | | //满å¤å¤å°æ¡æå¡è®°å½ |
| | | int maxNum = wellList.size()*userList.size(); |
| | | //对æ¯åºæå¡è®°å½ç¸çåtrue |
| | | if(list.size()==maxNum){ |
| | | or = true; |
| | | for (int j = 0; j < list.size(); j++) { |
| | | //è·åæå¡æ¶é´ |
| | | String toDayRecord = list.get(j).getRecordTime(); |
| | | String dr = toDayRecord.substring(0,10); |
| | | //妿æå¼æ¥æåè¿å¤©ç¸å |
| | | if(ymd.equals(dr)){ |
| | | //æ¥è¯¢è¯¥è®¡åçææå
´è¶£ç¹ |
| | | List<ArdAlarmpointsWell> wellList = wellMapper.wellByPlanId(planId); |
| | | //æ¥è¯¢è¯¥è®¡åçæææ§è¡äºº |
| | | List<SysUser> userList = sysUserMapper.userByPlanId(planId); |
| | | //满å¤å¤å°æ¡æå¡è®°å½ |
| | | int maxNum = wellList.size()*userList.size(); |
| | | //对æ¯åºæå¡è®°å½ç¸çåtrue |
| | | if(list.size()==maxNum){ |
| | | or = true; |
| | | } |
| | | } |
| | | } |
| | | // for (int j = 0; j < list.size(); j++) { |
| | | // //æå¡æ¶é´æå |
| | |
| | | @Override |
| | | public Results executeDetailsOld(RecordDetailsParam recordDetailsParam) throws ParseException { |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | SimpleDateFormat dateFormatTime = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); |
| | | SimpleDateFormat dateFormatTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String userId = SecurityUtils.getUserId(); |
| | | //è·ååæ° |
| | | String planId = recordDetailsParam.getPlanId(); |
| | |
| | | |
| | | @Override |
| | | public Results son() { |
| | | |
| | | return null; |
| | | SimpleDateFormat dateFormatTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | //è·åç¨æ·æ§è¡äºº |
| | | String userId = SecurityUtils.getUserId(); |
| | | // åå° 10 ç§ |
| | | LocalDateTime now = LocalDateTime.now(); // è·åå½åæ¥ææ¶é´ |
| | | LocalDateTime earlier = now.minusSeconds(10); // åå°30ç§ |
| | | System.out.println("å½åæ¥ææ¶é´ï¼" + now); |
| | | System.out.println("åå°10ç§åçæ¥ææ¶é´ï¼" + earlier); |
| | | RecordSonParam recordSonParam = new RecordSonParam(); |
| | | recordSonParam.setUserId(userId); |
| | | recordSonParam.setTime(dateFormatTime.format(now)); |
| | | recordSonParam.setBeforeTime(dateFormatTime.format(earlier)); |
| | | //æ ¹æ®å§åID为æ§è¡äººè·åææå¯¹åºç计ååç§° |
| | | List<ArdAppPatrolplan> list = patrolplanMapper.planUser(recordSonParam); |
| | | JSONArray jsonArray = new JSONArray(); |
| | | JSONObject jsonObject = new JSONObject(); |
| | | if(list.size()>0){ |
| | | jsonObject.put("plan",true); |
| | | jsonObject.put("user",list.get(0).getNickName()); |
| | | jsonObject.put("name",list.get(0).getPlanName()); |
| | | // list.get(0).setSon("å·²éç¥"); |
| | | // patrolplanMapper.updateById(list.get(0)); |
| | | }else { |
| | | jsonObject.put("plan",false); |
| | | jsonObject.put("user",null); |
| | | jsonObject.put("name",null); |
| | | } |
| | | jsonArray.add(jsonObject); |
| | | return Results.succeed(jsonArray); |
| | | } |
| | | } |