wang-hao-jie
2022-05-03 b8086d8c8bf084ed20488a005f957e29ee3cbc8e
最新版本
8个文件已修改
1个文件已添加
186 ■■■■ 已修改文件
xboot-admin/src/main/resources/application.yml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/face/FaceImgController.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/pc/Statistic3Controller.java 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/pc/StatisticController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/OrderTaskMapper.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/HistoryOrder.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/service/IOrderTaskService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/serviceimpl/IOrderTaskServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/util/MQTT.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xboot-admin/src/main/resources/application.yml
@@ -172,13 +172,13 @@
    # token中存储用户权限数据 设为true开启后可避免每次请求再获取用户权限,但有可能导致编辑权限菜单后无法读取到最新权限数据(需用户重新登录)
    storePerms: true
    # token过期时间 redis模式有请求自动刷新(分钟)
    tokenExpireTime: 600
    tokenExpireTime: 60000
    # 用户选择 保存登录状态/记住我 对应token过期时间(天)
    saveLoginTime: 7
    # 限制用户登陆错误次数(次)
    loginTimeLimit: 10
    # 错误超过次数后多少分钟后才能继续登录(分钟)
    loginAfterTime: 10
    loginAfterTime: 1
  # app应用 token交互配置
  appToken:
    # 是否开启同一平台单设备登陆(如安卓设备只允许登录一个相同账号,同时IOS设备可允许一个设备登陆)
@@ -299,6 +299,7 @@
    - /index.html
    - /xboot/pcStatistic/**
    - /xboot/pcStatistic2/**
    - /xboot/pcStatistic3/**
    - /xboot/area/getAll
    - /xboot/areaSection/getAll2
    - /xboot/message/**
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/face/FaceImgController.java
@@ -18,6 +18,7 @@
import cn.exrick.xboot.your.service.ICarService;
import cn.exrick.xboot.your.service.IEventLogService;
import cn.exrick.xboot.your.util.FaceSystem;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
@@ -37,6 +38,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.util.Collection;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
//人脸比对检测车厢异常开启
@@ -84,6 +86,16 @@
                return;
            }
            String format = DateUtil.format(new Date(),"yyyy-MM-dd HH:mm");
            QueryWrapper<Alarm> awrapper = new QueryWrapper<>();
            awrapper.between("create_time",format+"00",format+"59");
            awrapper.eq("car_no",one.getCarNo());
            awrapper.eq("type",5);
            List<Alarm> list = iAlarmService.list(awrapper);
            if(list.size()>0){
                return;
            }
            User user = userService.get(one.getUserId());
            User user1 = userService.get(one.getFollowUserId());
@@ -109,7 +121,7 @@
                                String avatar = user.getAvatar();
                                if(StrUtil.isNotEmpty(avatar)){
                                    int result1 = FaceSystem.getResult(avatar, avatar2);
                                    if(result1<60){
                                    if(result1<50){
                                        flag++;
                                    }else{
                                        deleteFile(f.getId());//是一个人删除图片 flag=0
@@ -123,7 +135,7 @@
                                String avatar = user1.getAvatar();
                                if(StrUtil.isNotEmpty(avatar)){
                                    int result1 = FaceSystem.getResult(avatar, avatar2);
                                    if(result1<60){
                                    if(result1<50){
                                        flag++;
                                    }else{
                                        deleteFile(f.getId());
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/pc/Statistic3Controller.java
New file
@@ -0,0 +1,95 @@
package cn.exrick.xboot.your.controller.pc;
import cn.exrick.xboot.core.common.utils.PageUtil;
import cn.exrick.xboot.core.common.utils.ResultUtil;
import cn.exrick.xboot.core.common.vo.PageVo;
import cn.exrick.xboot.core.common.vo.Result;
import cn.exrick.xboot.your.entity.*;
import cn.exrick.xboot.your.service.*;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
/**
 * @author whj
 */
@Slf4j
@RestController
@Api(tags = "大屏统计其他页面接口3")
@RequestMapping("/xboot/pcStatistic3")
@Transactional
public class Statistic3Controller {
    @Autowired
    private ICustomerService iCustomerService;
    @Autowired
    private IAlarmService iAlarmService;
    @Autowired
    private IOrderTaskService iOrderTaskService;
    @Autowired
    private IDrivingRecordService iDrivingRecordService;
    @RequestMapping(value = "/table1", method = RequestMethod.GET)
    @ApiOperation(value = "获取出发车辆")
    public Result<Object> table1(PageVo page) {
        String format = DateUtil.format(new Date(), "yyyy-MM-dd");
        QueryWrapper<DrivingRecord> wp = new QueryWrapper<>();
        wp.between("a.create_time",format+" 00:00:00",format+" 23:59:59");
        IPage<DrivingRecord> page1 = iDrivingRecordService.page2(PageUtil.initMpPage(page), wp);
        return new ResultUtil<Object>().setData(page1);
    }
    //0配送中,1已送达,2异常签收
    @RequestMapping(value = "/table2", method = RequestMethod.GET)
    @ApiOperation(value = "订单配送")
    public Result<Object> table2(PageVo page,String sendDate,Integer status) {
        QueryWrapper<OrderTask> wrapper = new QueryWrapper<>();
        if(StrUtil.isNotEmpty(sendDate)){
            wrapper.eq("o.send_date",sendDate);
        }
        if(status!=null){
            wrapper.eq("o.status",status);
        }
        IPage<OrderTask> data = iOrderTaskService.page3(PageUtil.initMpPage(page),wrapper);
        return new ResultUtil<Object>().setData(data);
    }
    @RequestMapping(value = "/table3", method = RequestMethod.GET)
    @ApiOperation(value = "异常签收")
    public Result<Object> table3(PageVo page,Integer type,String carNo) {
        QueryWrapper<Alarm> queryWrapper = new QueryWrapper<>();
        if(type!=null){
            queryWrapper.eq("type",type);
        }
        if(StrUtil.isNotEmpty(carNo)){
            queryWrapper.like("car_no","%"+carNo+"%");
        }
        IPage<Alarm> data = iAlarmService.page(PageUtil.initMpPage(page),queryWrapper);
        return new ResultUtil<Object>().setData(data);
    }
    @RequestMapping(value = "/table4", method = RequestMethod.GET)
    @ApiOperation(value = "今日新增商户")
    public Result<Object> table4(PageVo page) {
        QueryWrapper<Customer> wrapper = new QueryWrapper<>();
        String format = DateUtil.format(new Date(), "yyyy-MM-dd");
        wrapper.between("create_time",format+" 00:00:00",format+" 23:59:59");
        IPage<Customer> data = iCustomerService.page(PageUtil.initMpPage(page),wrapper);
        return new ResultUtil<Object>().setData(data);
    }
}
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/pc/StatisticController.java
@@ -357,10 +357,10 @@
            OrderTask2 orderTask2 = new OrderTask2();
            BeanUtil.copyProperties(orderTask,orderTask2);
            if(orderTask.getUserId()!=null){
            if(StrUtil.isNotEmpty(orderTask.getUserId())){
                orderTask2.setUserName(getUser(orderTask.getUserId()));
            }
            if(orderTask.getCustomerId()!=null){
            if(StrUtil.isNotEmpty(orderTask.getCustomerId())){
                orderTask2.setCustomerName(getCustomer(orderTask.getCustomerId()));
            }
            list2.add(orderTask2);
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/OrderTaskMapper.java
@@ -84,4 +84,7 @@
    @Select("SELECT o.*,c.name as customerName FROM t_order_task o LEFT JOIN t_customer c ON o.customer_id=c.id")
    IPage<OrderTask> page2(Page initMpPage);
    @Select("SELECT o.*,c.name as customerName FROM t_order_task o LEFT JOIN t_customer c ON o.customer_id=c.id ${ew.customSqlSegment}")
    IPage<OrderTask> page3(Page initMpPage,@Param(Constants.WRAPPER) QueryWrapper<OrderTask> wrapper);
}
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/HistoryOrder.java
@@ -4,6 +4,7 @@
import cn.exrick.xboot.your.entity.*;
import cn.exrick.xboot.your.service.*;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
@@ -31,7 +32,7 @@
    @Autowired
    private ICustomerService iCustomerService;
    @Scheduled(cron="0 30 21 * * ?")//每晚下午9点半点执行
    @Scheduled(cron="0 31 21 * * ?")//每晚下午9点半点执行
    public void execute(){
        String day = getDay(0);
        QueryWrapper<OrderTask> wrapper = new QueryWrapper<>();
@@ -51,18 +52,26 @@
    }
    private String getUser(String id){
        User user = userService.get(id);
        if(user!=null){
            return user.getNickname();
        if(StrUtil.isNotEmpty(id)){
            User user = userService.get(id);
            if(user!=null){
                return user.getNickname();
            }else{
                return null;
            }
        }else{
            return null;
        }
    }
    private String getCustomer(String id){
        Customer customer = iCustomerService.getById(id);
        if(customer!=null){
            return customer.getName();
        if(StrUtil.isNotEmpty(id)){
            Customer customer = iCustomerService.getById(id);
            if(customer!=null){
                return customer.getName();
            }else{
                return null;
            }
        }else{
            return null;
        }
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/service/IOrderTaskService.java
@@ -37,4 +37,6 @@
    List<OrderTask> list4(QueryWrapper<OrderTask> wrapper2);
    IPage<OrderTask> page2(Page initMpPage);
    IPage<OrderTask> page3(Page initMpPage, QueryWrapper<OrderTask> wrapper);
}
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/serviceimpl/IOrderTaskServiceImpl.java
@@ -86,4 +86,9 @@
    public IPage<OrderTask> page2(Page initMpPage){
        return orderTaskMapper.page2(initMpPage);
    }
    @Override
    public IPage<OrderTask> page3(Page initMpPage, QueryWrapper<OrderTask> wrapper) {
        return orderTaskMapper.page3(initMpPage,wrapper);
    }
}
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/util/MQTT.java
@@ -15,6 +15,8 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
public class MQTT {
@@ -96,17 +98,27 @@
                                    JSONObject jsonObject1 = JSONUtil.parseObj(s1);
                                    String data = jsonObject1.get("data").toString();
                                    JSONObject jsonObject2 = JSONUtil.parseObj(data);
                                    //System.out.println(jsonObject2.get("alarmId"));//报警id
                                    //System.out.println(jsonObject2.get("vehicleIndexCode"));//车辆code
                                    //System.out.println(jsonObject2.get("eventType"));//报警类型
                                    //未系安全带:132376
                                    //抽烟:132375
                                    //接打电话:132374
                                    //疲劳驾驶:132371
                                    String eventType = jsonObject2.get("eventType").toString();
                                    String vehicleIndexCode = jsonObject2.get("vehicleIndexCode").toString();
                                    String alarmId = jsonObject2.get("alarmId").toString();
                                    String alarmTime = jsonObject2.get("alarmTime").toString();
                                    QueryWrapper<Car> wrapper = new QueryWrapper<Car>();
                                    wrapper.eq("code",vehicleIndexCode);
                                    Car car = iCarService.getOne(wrapper);
                                    if(car==null){
                                        return;
                                    }
                                    String format = alarmTime.substring(0,17);
                                    QueryWrapper<Alarm> awrapper = new QueryWrapper<>();
                                    awrapper.between("create_time",format+"00",format+"59");
                                    awrapper.eq("car_no",car.getCarNo());
                                    awrapper.eq("type",1);
                                    List<Alarm> list = iAlarmService.list(awrapper);
                                    if(list.size()>0){
                                        return;
                                    }
                                    Alarm alarm = new Alarm();
                                    if(eventType.equals("132371")){
@@ -125,13 +137,6 @@
                                        alarm.setType(7);
                                        alarm.setValue("超速");
                                    }else{
                                        return;
                                    }
                                    QueryWrapper<Car> wrapper = new QueryWrapper<Car>();
                                    wrapper.eq("code",vehicleIndexCode);
                                    Car car = iCarService.getOne(wrapper);
                                    if(car==null){
                                        return;
                                    }