xboot-modules/xboot-base/src/main/java/cn/exrick/xboot/base/controller/common/TestImpl.java
New file @@ -0,0 +1,57 @@ package cn.exrick.xboot.base.controller.common; import cn.exrick.xboot.base.entity.Dict; import cn.exrick.xboot.base.entity.DictData; import cn.exrick.xboot.base.service.DictDataService; import cn.exrick.xboot.base.service.DictService; import cn.hutool.http.HttpRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import java.util.List; //测试 @Component public class TestImpl { @Autowired private DictService dictService; @Autowired private DictDataService dictDataService; @Scheduled(cron="0 0/3 * * * ?") //@Scheduled(cron="0 * * * * ?") public void execute(){ Dict shouQuan = dictService.findByType("shouQuan"); if(shouQuan==null){ return; } List<DictData> byDictId = dictDataService.findByDictId(shouQuan.getId()); String token =""; String cookie=""; String url2=""; for(DictData dictData:byDictId){ if(dictData.getTitle().equals("token")){ token = dictData.getValue(); } if(dictData.getTitle().equals("cookie")){ cookie = dictData.getValue(); } if(dictData.getTitle().equals("url")){ url2 = dictData.getValue(); } } //String url = "https://111.63.178.115:1443/msa-web/multimedia/findPicturesByAlarmId.do?alarmId=1234567_01_20220119083014_01_81&alarmTime=2022-01-19T08%3A30%3A14.000%2B08%3A00"; try { HttpRequest cookie2 = HttpRequest.get(url2).header("X-CSRF-TOKEN", token).header("Cookie", cookie); String body = cookie2.execute().body(); System.out.println(body.substring(0,25)); }catch (Exception e){ System.out.println("error"); } } } xboot-modules/xboot-base/src/main/java/cn/exrick/xboot/base/controller/manage/UserController.java
@@ -521,9 +521,9 @@ if (StrUtil.isNotBlank(username) && userService.findByUsername(username) != null) { throw new XbootException("该登录账号已被注册"); } if (StrUtil.isNotBlank(email) && userService.findByEmail(email) != null) { throw new XbootException("该邮箱已被注册"); } // if (StrUtil.isNotBlank(email) && userService.findByEmail(email) != null) { // throw new XbootException("该邮箱已被注册"); // } if (StrUtil.isNotBlank(mobile) && userService.findByMobile(mobile) != null) { throw new XbootException("该手机号已被注册"); } xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/DrivingRecordController.java
@@ -51,6 +51,32 @@ } record.setDrivingDate(DateUtil.parse(format)); int flag=0; if(record.getSanZheng()!=0){ flag++; }else if(record.getSanLiang()!=0){ flag++; }else if(record.getAnQuan()!=0){ flag++; }else if(record.getHouShiJing()!=0){ flag++; }else if(record.getLaBa()!=0){ flag++; }else if(record.getLunTai()!=0){ flag++; }else if(record.getQiTa()!=0){ flag++; }else if(record.getSiDeng()!=0){ flag++; }else if(record.getYiBiao()!=0){ flag++; }else if(record.getYuShuaQi()!=0){ flag++; } if(flag>0){ record.setYinHuan(1); } iDrivingRecordService.saveOrUpdate(record); return ResultUtil.success("操作成功"); } @@ -63,6 +89,9 @@ wrapper.eq("driving_date",format); wrapper.eq("car_id",carId); DrivingRecord drivingRecord = iDrivingRecordService.getOne(wrapper); if(drivingRecord==null){ drivingRecord = new DrivingRecord(); } drivingRecord.setMileage(mileage); drivingRecord.setInTime(DateUtil.parseDate(inDate)); drivingRecord.setUserId(userId); xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/wx/IndexController.java
@@ -171,7 +171,7 @@ Map<String,Object> map = new HashMap<>(); map.put("lng",df.format(lng/360000.0)); map.put("lat",df.format(lat/360000.0)); map.put("content","还有3单,预计10:22送达"); map.put("content","还有3单,预计1小时后送达"); return ResultUtil.data(map); } xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/entity/DrivingRecord.java
@@ -104,6 +104,9 @@ @ApiModelProperty(value = "被赞数") private String likes; @ApiModelProperty(value = "是否有安全隐患 0:没有 1:有") private Integer yinHuan=0; @Transient @TableField(exist = false) private double beginMileage; xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/DrivingRecordMapper.java
@@ -20,4 +20,7 @@ @Select("select sum(likes) from t_driving_record where user_id=#{userId}") Integer sumLikeByUserId(String userId); @Select("select count(id) from t_driving_record where yin_huan=1") int count2(); } xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/StatisticPc2ScheduleImpl.java
@@ -34,7 +34,7 @@ @Autowired private IOrderTaskService iOrderTaskService; @Scheduled(cron="0 0 * * * ?")//每小时执行一次 @Scheduled(cron="0 0 20 * * ?")//每晚8点执行 public void execute(){ List<Area> list = iAreaService.list(); for(Area area:list){ xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/StatisticPcScheduleImpl.java
@@ -71,7 +71,7 @@ redisTemplate.set(HEAD+"notice",messageService.getTotalCount()+"");//通知公告条数 redisTemplate.set(HEAD+"video","0");//视频监控次数 redisTemplate.set(HEAD+"call",iRemoteCallService.count()+"");//远程呼叫次数 redisTemplate.set(HEAD+"paiCha","0");//事故隐患排查 redisTemplate.set(HEAD+"paiCha",iDrivingRecordService.count2()+"");//事故隐患排查 redisTemplate.set(HEAD+"wx",iCustomerService.sumLogin()+"");//小程序登陆次数 redisTemplate.set(HEAD+"wxRate",iCustomerService.countOpenId()+"");//小程序使用率 xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/service/IDrivingRecordService.java
@@ -16,4 +16,6 @@ Integer minByUserId(String id); int sumLikeByUserId(String id); int count2(); } xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/serviceimpl/IDrivingRecordServiceImpl.java
@@ -43,4 +43,9 @@ return i; } } @Override public int count2() { return drivingRecordMapper.count2(); } } xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/util/HaiKangPost.java
@@ -193,7 +193,7 @@ PreviewURLsVo previewURLsVo = new PreviewURLsVo(); previewURLsVo.setCameraIndexCode("27760424aa8b486e84db8d6720b2a9bf"); previewURLsVo.setProtocol("rtmp"); previewURLsVo.setProtocol("rtsp"); haiKangPost.previewURLs(previewURLsVo); }