| | |
| | | import cn.exrick.xboot.core.common.vo.PageVo; |
| | | import cn.exrick.xboot.core.common.vo.Result; |
| | | import cn.exrick.xboot.your.entity.AddOil; |
| | | import cn.exrick.xboot.your.entity.Car; |
| | | import cn.exrick.xboot.your.service.IAddOilService; |
| | | |
| | | import cn.exrick.xboot.your.service.ICarService; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | |
| | | @Autowired |
| | | private IAddOilService iAddOilService; |
| | | @Autowired |
| | | private ICarService iCarService; |
| | | |
| | | @RequestMapping(value = "/get/{id}", method = RequestMethod.GET) |
| | | @ApiOperation(value = "通过id获取") |
| | |
| | | @ApiOperation(value = "编辑或更新数据") |
| | | public Result<AddOil> saveOrUpdate(AddOil addOil) { |
| | | |
| | | if(StrUtil.isNotEmpty(addOil.getCarId())&&StrUtil.isEmpty(addOil.getAddOilCode())){ |
| | | Car byId = iCarService.getById(addOil.getCarId()); |
| | | addOil.setAddOilCode(byId.getAddOilCode()); |
| | | } |
| | | |
| | | if (iAddOilService.saveOrUpdate(addOil)) { |
| | | return new ResultUtil<AddOil>().setData(addOil); |
| | | } |
New file |
| | |
| | | package cn.exrick.xboot.your.controller; |
| | | |
| | | 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.UpdateApp; |
| | | import cn.exrick.xboot.your.service.IUpdateAppService; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | 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.web.bind.annotation.*; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author whj |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @Api(tags = "app版本更新管理接口") |
| | | @RequestMapping("/xboot/updateApp") |
| | | @Transactional |
| | | public class UpdateAppController { |
| | | |
| | | @Autowired |
| | | private IUpdateAppService iUpdateAppService; |
| | | |
| | | @RequestMapping(value = "/get/{id}", method = RequestMethod.GET) |
| | | @ApiOperation(value = "通过id获取") |
| | | public Result<UpdateApp> get(@PathVariable String id) { |
| | | |
| | | UpdateApp updateApp = iUpdateAppService.getById(id); |
| | | return new ResultUtil<UpdateApp>().setData(updateApp); |
| | | } |
| | | |
| | | @RequestMapping(value = "/getAll", method = RequestMethod.GET) |
| | | @ApiOperation(value = "获取全部数据") |
| | | public Object getAll() { |
| | | |
| | | List<UpdateApp> list = iUpdateAppService.list(); |
| | | if(list.size()==0){ |
| | | return ResultUtil.error("请联系管理员维护数据"); |
| | | } |
| | | return ResultUtil.data(list.get(0)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/getByPage", method = RequestMethod.GET) |
| | | @ApiOperation(value = "分页获取") |
| | | public Result<IPage<UpdateApp>> getByPage(PageVo page) { |
| | | |
| | | IPage<UpdateApp> data = iUpdateAppService.page(PageUtil.initMpPage(page)); |
| | | return new ResultUtil<IPage<UpdateApp>>().setData(data); |
| | | } |
| | | |
| | | @RequestMapping(value = "/insertOrUpdate", method = RequestMethod.POST) |
| | | @ApiOperation(value = "编辑或更新数据") |
| | | public Result<UpdateApp> saveOrUpdate(UpdateApp updateApp) { |
| | | |
| | | if (iUpdateAppService.saveOrUpdate(updateApp)) { |
| | | return new ResultUtil<UpdateApp>().setData(updateApp); |
| | | } |
| | | return new ResultUtil<UpdateApp>().setErrorMsg("操作失败"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/delByIds", method = RequestMethod.POST) |
| | | @ApiOperation(value = "批量通过id删除") |
| | | public Result<Object> delAllByIds(@RequestParam String[] ids) { |
| | | |
| | | for (String id : ids) { |
| | | iUpdateAppService.removeById(id); |
| | | } |
| | | return ResultUtil.success("批量通过id删除数据成功"); |
| | | } |
| | | } |
| | |
| | | import java.util.Collection; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | |
| | | //人脸比对检测车厢异常开启 |
| | | @RestController |
| | | @RequestMapping("/hk") |
| | | public class FaceImgController { |
| | |
| | | import cn.exrick.xboot.your.entity.*; |
| | | import cn.exrick.xboot.your.service.*; |
| | | import cn.exrick.xboot.your.util.HaiKangPost; |
| | | import cn.exrick.xboot.your.vo.AlarmVo; |
| | | import cn.exrick.xboot.your.vo.PreviewURLsVo; |
| | | import cn.exrick.xboot.your.vo.TalkURLsVo; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | @Autowired |
| | | private IAreaSectionService iAreaSectionService; |
| | | |
| | | @Autowired |
| | | private IEquipmentService iEquipmentService; |
| | | |
| | | @Autowired |
| | | private IAlarmService iAlarmService; |
| | | |
| | | @RequestMapping(value = "/getIndex1", method = RequestMethod.GET) |
| | | @ApiOperation(value = "获取首页数据") |
| | | public Result<Object> getIndex1() { |
| | |
| | | @ApiOperation(value = "获取车辆定位信息") |
| | | public Result<Object> getCars() { |
| | | List<Car> list = iCarService.list(); |
| | | String codes[] = new String[list.size()]; |
| | | List<String> list2 = new ArrayList<>(); |
| | | |
| | | for(int i=0;i<list.size();i++){ |
| | | codes[i] = list.get(i).getCode(); |
| | | if(!StrUtil.isEmpty(list.get(i).getCode())){ |
| | | list2.add(list.get(i).getCode()); |
| | | } |
| | | } |
| | | |
| | | String codes[] = new String[list2.size()]; |
| | | for(int i=0;i<list2.size();i++){ |
| | | codes[i] = list2.get(i); |
| | | } |
| | | String latestGps = haiKangPost.findLatestGps(codes); |
| | | return new ResultUtil<Object>().setData(JSONUtil.parseObj(latestGps)); |
| | |
| | | return new ResultUtil<Object>().setData(map); |
| | | } |
| | | |
| | | @RequestMapping(value = "/getOrderStatus", method = RequestMethod.GET) |
| | | @ApiOperation(value = "获取某辆车的配送情况") |
| | | public Result<Object> getOrderStatus(String carNo) { |
| | | |
| | | QueryWrapper<Car> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("car_no",carNo); |
| | | Car car = iCarService.getOne(wrapper); |
| | | |
| | | if(car==null){ |
| | | return ResultUtil.error("车辆不存在,请先添加车辆信息"); |
| | | } |
| | | |
| | | QueryWrapper<OrderTask> wrapper2 = new QueryWrapper<OrderTask>(); |
| | | String format = DateUtil.format(new Date(), "yyyy-MM-dd"); |
| | | wrapper2.eq("a.send_date",format); |
| | | wrapper2.eq("a.car_id",car.getId()); |
| | | List<OrderTask> list = iOrderTaskService.list4(wrapper2); |
| | | |
| | | return new ResultUtil<Object>().setData(list); |
| | | } |
| | | |
| | | @RequestMapping(value = "/getVideoByCarId", method = RequestMethod.GET) |
| | | @ApiOperation(value = "获取视频信息 1:前置 4:车内") |
| | | public Result<Object> getVideoByCarId(String carCode,int type) { |
| | | QueryWrapper<Car> wrapper = new QueryWrapper<Car>(); |
| | | wrapper.eq("code",carCode); |
| | | Car car = iCarService.getOne(wrapper); |
| | | if(car==null){ |
| | | return ResultUtil.error("车辆编号错误"); |
| | | } |
| | | |
| | | QueryWrapper<Equipment> wrapper1 = new QueryWrapper<>(); |
| | | wrapper1.eq("car_id",car.getId()); |
| | | wrapper1.eq("type",type); |
| | | Equipment one = iEquipmentService.getOne(wrapper1); |
| | | if(one==null){ |
| | | return ResultUtil.error("设备未找到"); |
| | | } |
| | | |
| | | PreviewURLsVo previewURLsVo = new PreviewURLsVo(); |
| | | previewURLsVo.setCameraIndexCode(one.getCode()); |
| | | String s = haiKangPost.previewURLs(previewURLsVo); |
| | | return new ResultUtil<Object>().setData(JSONUtil.parseObj(s)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/getYuYinByCarId", method = RequestMethod.GET) |
| | | @ApiOperation(value = "获取对讲信息") |
| | | public Result<Object> getYuYinByCarId(String carCode,int type,int transmode) { |
| | | QueryWrapper<Car> wrapper = new QueryWrapper<Car>(); |
| | | wrapper.eq("code",carCode); |
| | | Car car = iCarService.getOne(wrapper); |
| | | if(car==null){ |
| | | return ResultUtil.error("车辆编号错误"); |
| | | } |
| | | |
| | | QueryWrapper<Equipment> wrapper1 = new QueryWrapper<>(); |
| | | wrapper1.eq("car_id",car.getId()); |
| | | wrapper1.eq("type",type); |
| | | Equipment one = iEquipmentService.getOne(wrapper1); |
| | | if(one==null){ |
| | | return ResultUtil.error("设备未找到"); |
| | | } |
| | | |
| | | TalkURLsVo talkURLsVo =new TalkURLsVo(); |
| | | talkURLsVo.setCameraIndexCode(one.getCode()); |
| | | talkURLsVo.setTransmode(transmode); |
| | | String s = haiKangPost.talkURLs(talkURLsVo); |
| | | return new ResultUtil<Object>().setData(JSONUtil.parseObj(s)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/getAlarmByCarId", method = RequestMethod.GET) |
| | | @ApiOperation(value = "获取报警图片") |
| | | public Result<Object> getAlarmByCarId(String alarmId) { |
| | | QueryWrapper<Alarm> wrapper = new QueryWrapper<Alarm>(); |
| | | wrapper.eq("alarm_id",alarmId); |
| | | Alarm alarm = iAlarmService.getOne(wrapper); |
| | | if(alarm==null){ |
| | | return ResultUtil.error("报警id错误"); |
| | | } |
| | | |
| | | AlarmVo alarmVo = new AlarmVo(); |
| | | alarmVo.setAlarmId(alarm.getAlarmId()); |
| | | String[] s1 = alarm.getAlarmTime().split(" "); |
| | | alarmVo.setAlarmTime(s1[0]+"T"+s1[1]+".000+08:00"); |
| | | String s = haiKangPost.findPicturesByAlarmId(alarmVo); |
| | | return new ResultUtil<Object>().setData(JSONUtil.parseObj(s)); |
| | | } |
| | | |
| | | public double trans2(double v2){ |
| | | return (double) Math.round(v2 * 100) / 100; |
| | | } |
| | |
| | | String openid = SessionKeyOpenId.getStr("openid"); |
| | | |
| | | if(StrUtil.isEmpty(openid)){ |
| | | return ResultUtil.error(SessionKeyOpenId.toString()); |
| | | return ResultUtil.error("error微信:"+SessionKeyOpenId.toString()); |
| | | } |
| | | |
| | | QueryWrapper<Customer> wrapper = new QueryWrapper<>(); |
| | |
| | | @RequestMapping(value = "/bindWx", method = RequestMethod.POST) |
| | | @ApiOperation(value = "微信绑定零售许可证") |
| | | public Object bindWx(String licence,String openId){ |
| | | QueryWrapper<Customer> wrapper2 = new QueryWrapper<>(); |
| | | wrapper2.eq("open_id",openId); |
| | | Customer c = iCustomerService.getOne(wrapper2); |
| | | if(c==null){ |
| | | |
| | | }else { |
| | | System.out.println(c.getOpenId()); |
| | | c.setOpenId(""); |
| | | iCustomerService.saveOrUpdate(c); |
| | | } |
| | | |
| | | QueryWrapper<Customer> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("licence",licence); |
| | | Customer one = iCustomerService.getOne(wrapper); |
| | |
| | | wrapper2.eq("customer_id",customerId); |
| | | wrapper2.eq("send_date",format); |
| | | OrderTask orderTask = iOrderTaskService.getOne(wrapper2); |
| | | if(orderTask==null){ |
| | | return ResultUtil.error("今日无订单"); |
| | | } |
| | | String carId = orderTask.getCarId(); |
| | | Car car = iCarService.getById(carId); |
| | | String[] carids = new String[1]; |
| | |
| | | @ApiOperation(value = "加油助力") |
| | | public Object likes(String customerId){ |
| | | OrderTask order = getOrder(customerId); |
| | | if(order==null){ |
| | | ResultUtil.error("今日无订单"); |
| | | } |
| | | order.setLikes(1); |
| | | iOrderTaskService.saveOrUpdate(order); |
| | | return ResultUtil.success("助力成功"); |
| | |
| | | } |
| | | return new ResultUtil<CustomerReceive>().setErrorMsg("操作失败"); |
| | | } |
| | | |
| | | //14.获取签收人列表 |
| | | @RequestMapping(value = "/getCustomerReceive", method = RequestMethod.GET) |
| | | @ApiOperation(value = "获取签收人") |
| | | public Result<List<CustomerReceive>> getCustomerReceive(String customerId) { |
| | | PageVo page = new PageVo(); |
| | | page.setPageSize(30); |
| | | page.setPageNumber(1); |
| | | page.setOrder("desc"); |
| | | page.setSort("createTime"); |
| | | QueryWrapper<CustomerReceive> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("customer_id",customerId); |
| | | IPage<CustomerReceive> data = iCustomerReceiveService.page2(PageUtil.initMpPage(page),wrapper); |
| | | return new ResultUtil<List<CustomerReceive>>().setData(data.getRecords()); |
| | | } |
| | | |
| | | //15.获取签收人 |
| | | @RequestMapping(value = "/getCustomerReceiveById", method = RequestMethod.GET) |
| | | @ApiOperation(value = "获取签收人") |
| | | public Result<CustomerReceive> getCustomerReceiveById(String customerReceiveId) { |
| | | CustomerReceive byId = iCustomerReceiveService.getById(customerReceiveId); |
| | | return new ResultUtil<CustomerReceive>().setData(byId); |
| | | } |
| | | |
| | | //16.删除接货人 |
| | | @RequestMapping(value = "/deleteReceive", method = RequestMethod.POST) |
| | | @ApiOperation(value = "删除接货人") |
| | | public Object deleteReceive(String id) { |
| | | iCustomerReceiveService.removeById(id); |
| | | return ResultUtil.success("删除成功"); |
| | | } |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "异常开启图片") |
| | | private String alarmImg; |
| | | |
| | | @ApiModelProperty(value = "报警时间") |
| | | private String alarmTime; |
| | | |
| | | } |
| | |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "区域id") |
| | | @ApiModelProperty(value = "商户id") |
| | | private String customerId; |
| | | |
| | | @ApiModelProperty(value = "名称") |
| | |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "0:车机 1:摄像机 2:抓拍机 3:pad") |
| | | @ApiModelProperty(value = "0:车机 1:前置摄像机 2:抓拍机 3:pad 4:车内摄像机") |
| | | private int type; |
| | | |
| | | @ApiModelProperty(value = "编号") |
New file |
| | |
| | | package cn.exrick.xboot.your.entity; |
| | | |
| | | import cn.exrick.xboot.core.base.XbootBaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.hibernate.annotations.DynamicInsert; |
| | | import org.hibernate.annotations.DynamicUpdate; |
| | | |
| | | import javax.persistence.Entity; |
| | | import javax.persistence.Table; |
| | | import javax.persistence.Transient; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Exrick |
| | | */ |
| | | @Data |
| | | @Entity |
| | | @DynamicInsert |
| | | @DynamicUpdate |
| | | @Table(name = "t_update_app") |
| | | @TableName("t_update_app") |
| | | @ApiModel(value = "客户端更新") |
| | | public class UpdateApp extends XbootBaseEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private String apkUrl;//apk下载地址 |
| | | private String updateTitle;//更新标题 |
| | | private String updateContent;//更新内容 |
| | | private String version;//版本号 |
| | | private String versionName;//版本 |
| | | } |
| | |
| | | @Select("SELECT count(id) FROM t_order_task where likes=1") |
| | | int countLike(); |
| | | |
| | | @Select("select b.car_no as carNo1,c.name as name1,d.name as name2,count(a.area_section_id) as num1,sum(case when a.status=0 then 1 else 0 end) as num2 from t_order_task a LEFT JOIN t_car b on a.car_id=b.id LEFT JOIN t_area c on a.area_id=c.id LEFT JOIN t_area_ection d on a.area_section_id=d.id where DATE_FORMAT(a.send_date,'%Y-%m-%d')=#{date} GROUP BY a.area_section_id,b.car_no,c.name,d.name") |
| | | @Select("select b.car_no as carNo1,c.name as name1,d.name as name2,count(a.area_section_id) as num1,sum(case when a.status=0 then 1 else 0 end) as num2 ,sum(case when a.status=1 then 1 else 0 end) as num3 from t_order_task a LEFT JOIN t_car b on a.car_id=b.id LEFT JOIN t_area c on a.area_id=c.id LEFT JOIN t_area_ection d on a.area_section_id=d.id where DATE_FORMAT(a.send_date,'%Y-%m-%d')=#{date} GROUP BY a.area_section_id,b.car_no,c.name,d.name") |
| | | @Results({@Result(column="carNo1", property="carNo", jdbcType = JdbcType.VARCHAR), |
| | | @Result(column="name1", property="areaName", jdbcType = JdbcType.VARCHAR), |
| | | @Result(column="name2", property="areaSectionName", jdbcType = JdbcType.VARCHAR), |
| | | @Result(column="num1", property="num", jdbcType = JdbcType.INTEGER), |
| | | @Result(column="num2", property="level", jdbcType = JdbcType.INTEGER)}) |
| | | @Result(column="num2", property="level", jdbcType = JdbcType.INTEGER), |
| | | @Result(column="num3", property="seq", jdbcType = JdbcType.INTEGER)}) |
| | | List<OrderTask> list3(String date); |
| | | |
| | | @Select("select sum(time) as time2,send_date from t_order_task where date_sub(curdate(), interval 1 month) <= date(send_date) and area_section_id=#{arg0} GROUP BY send_date") |
| | |
| | | @Result(column="num2", property="num", jdbcType = JdbcType.INTEGER), |
| | | @Result(column="num3", property="level", jdbcType = JdbcType.INTEGER)}) |
| | | List<OrderTask> groupByTime(String areaId, String selectId); |
| | | |
| | | @Select("SELECT a.*,b.name as temp,c.name as temp2,b.lng as temp3,b.lat as temp4 FROM t_order_task a LEFT JOIN t_customer b ON a.customer_id=b.id LEFT JOIN t_customer_receive c ON a.customer_receive_id=c.id ${ew.customSqlSegment} ") |
| | | @Results({@Result(column="temp", property="customerName", jdbcType = JdbcType.VARCHAR), |
| | | @Result(column="temp2", property="code", jdbcType = JdbcType.VARCHAR), |
| | | @Result(column="temp3", property="areaName", jdbcType = JdbcType.VARCHAR), |
| | | @Result(column="temp4", property="areaSectionName", jdbcType = JdbcType.VARCHAR)}) |
| | | List<OrderTask> list4(@Param(Constants.WRAPPER) QueryWrapper<OrderTask> wrapper2); |
| | | } |
New file |
| | |
| | | package cn.exrick.xboot.your.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import cn.exrick.xboot.your.entity.UpdateApp; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * app版本更新数据处理层 |
| | | * @author whj |
| | | */ |
| | | public interface UpdateAppMapper extends BaseMapper<UpdateApp> { |
| | | |
| | | } |
| | |
| | | @Autowired |
| | | private ICustomerReceiveService iCustomerReceiveService; |
| | | |
| | | //@Scheduled(cron="0 30 23 * * ?")//每晚凌晨1点执行 |
| | | @Scheduled(cron="0 20 10 * * ?")//每晚凌晨1点执行 |
| | | @Scheduled(cron="0 30 23 * * ?")//每晚凌晨1点执行 |
| | | //@Scheduled(cron="0 22 11 * * ?")//每晚凌晨1点执行 |
| | | public void execute(){ |
| | | System.out.println("开始处理订单"); |
| | | QueryWrapper<OrderTaskOriginal> queryWrapper = new QueryWrapper<>(); |
| | |
| | | updateCustomerRecive(orderTask.getCustomerId(),original.getLinker(),original.getCustomerPhone()); |
| | | |
| | | QueryWrapper<OrderDetailOriginal> wrapper = new QueryWrapper<>(); |
| | | wrapper.between("create_time",dateStringFormat(new Date()),dateStringFormat2(new Date())); |
| | | // wrapper.between("create_time",dateStringFormat(new Date()),dateStringFormat2(new Date())); |
| | | wrapper.eq("order_id",original.getId()); |
| | | List<OrderDetailOriginal> list1 = iOrderDetailOriginalService.list(wrapper); |
| | | for(OrderDetailOriginal o:list1){ |
| | |
| | | one.setSafeDriving(0);//安全驾驶里程 |
| | | one.setDriving(0);//驾驶里程 |
| | | }else{ |
| | | one.setSafeDriving(max-min);//安全驾驶里程 |
| | | one.setDriving(max-min);//驾驶里程 |
| | | if(max==min){ |
| | | one.setSafeDriving(max);//安全驾驶里程 |
| | | one.setDriving(max);//驾驶里程 |
| | | }else{ |
| | | one.setSafeDriving(max-min);//安全驾驶里程 |
| | | one.setDriving(max-min);//驾驶里程 |
| | | } |
| | | } |
| | | |
| | | QueryWrapper<DrivingRecord> wrapper2 = new QueryWrapper<>(); |
| | |
| | | if(type2==1){ |
| | | QueryWrapper<OrderTask> wrapper2 = new QueryWrapper<>(); |
| | | wrapper2.eq("user_id",user.getId()); |
| | | wrapper2.ne("status",0); |
| | | int count = iOrderTaskService.count(wrapper2); |
| | | one.setSends(count);//配送次数 |
| | | |
| | | wrapper2.ne("status",0); |
| | | int count2 = iOrderTaskService.count(wrapper2); |
| | | QueryWrapper<OrderTask> wrapper22 = new QueryWrapper<>(); |
| | | wrapper22.eq("user_id",user.getId()); |
| | | wrapper22.eq("status",1); |
| | | int count2 = iOrderTaskService.count(wrapper22); |
| | | one.setSends2(count2);//送达次数 |
| | | |
| | | QueryWrapper<Area> wrapper3 = new QueryWrapper<>(); |
| | |
| | | List<OrderTask> sumTime(String id); |
| | | |
| | | List<OrderTask> groupByTime(String areaId, String selectId); |
| | | |
| | | List<OrderTask> list4(QueryWrapper<OrderTask> wrapper2); |
| | | } |
New file |
| | |
| | | package cn.exrick.xboot.your.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import cn.exrick.xboot.your.entity.UpdateApp; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * app版本更新接口 |
| | | * @author whj |
| | | */ |
| | | public interface IUpdateAppService extends IService<UpdateApp> { |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<OrderTask> list4(QueryWrapper<OrderTask> wrapper2) { |
| | | return orderTaskMapper.list4(wrapper2); |
| | | } |
| | | |
| | | @Override |
| | | public Month getSendNum(int year){ |
| | | return orderTaskMapper.getSendNum(year); |
| | | } |
New file |
| | |
| | | package cn.exrick.xboot.your.serviceimpl; |
| | | |
| | | import cn.exrick.xboot.your.mapper.UpdateAppMapper; |
| | | import cn.exrick.xboot.your.entity.UpdateApp; |
| | | import cn.exrick.xboot.your.service.IUpdateAppService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * app版本更新接口实现 |
| | | * @author whj |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | @Transactional |
| | | public class IUpdateAppServiceImpl extends ServiceImpl<UpdateAppMapper, UpdateApp> implements IUpdateAppService { |
| | | |
| | | @Autowired |
| | | private UpdateAppMapper updateAppMapper; |
| | | } |
| | |
| | | @Override |
| | | public void run(ApplicationArguments args) throws Exception { |
| | | String topicInfo = haiKangPost.getTopicInfo(); |
| | | System.out.println("订阅信息:"+topicInfo); |
| | | JSONObject jsonObject = JSONUtil.parseObj(topicInfo); |
| | | if(jsonObject.get("data")!=null){ |
| | | String data = jsonObject.get("data").toString(); |
| | |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | |
| | | import cn.exrick.xboot.your.vo.FindHistoryGpsRequest; |
| | | import cn.exrick.xboot.your.vo.PlaybackURLsVo; |
| | | import cn.exrick.xboot.your.vo.PreviewURLsVo; |
| | | import cn.exrick.xboot.your.vo.TalkURLsVo; |
| | | import cn.exrick.xboot.your.vo.*; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.hikvision.artemis.sdk.Client; |
| | |
| | | * STEP2:设置OpenAPI接口的上下文 |
| | | */ |
| | | private static final String ARTEMIS_PATH = "/artemis"; |
| | | private static final String HOST = "111.63.178.115:1443"; |
| | | //private static final String HOST = "111.63.178.115:1443"; |
| | | private static final String HOST = "10.10.101.1:1443"; |
| | | private static final String APP_KEY = "28156526"; |
| | | private static final String APP_SECRET = "MNkyjHuids4XxFONSOaL"; |
| | | |
| | |
| | | }; |
| | | String body= JSONUtil.toJsonStr(previewURLsVo); |
| | | String result = doPostStringArtemis(path,body,null,null,"application/json"); |
| | | System.out.println(result); |
| | | return result; |
| | | } |
| | | |
| | |
| | | } |
| | | }; |
| | | String body= JSONUtil.toJsonStr(playbackURLsVo); |
| | | String result = doPostStringArtemis(path,body,null,null,"application/json"); |
| | | return result; |
| | | } |
| | | |
| | | //根据报警ID获取关联图片信息 |
| | | public String findPicturesByAlarmId(AlarmVo alarmVo){ |
| | | String findHistoryGpsDataApi = ARTEMIS_PATH +"/api/rtsm/v1/multimedia/findPicturesByAlarmId"; |
| | | Map<String,String> path = new HashMap<String,String>(2){ |
| | | { |
| | | put("https://",findHistoryGpsDataApi); |
| | | } |
| | | }; |
| | | String body= JSONUtil.toJsonStr(alarmVo); |
| | | String result = doPostStringArtemis(path,body,null,null,"application/json"); |
| | | return result; |
| | | } |
| | |
| | | |
| | | public static void main(String[] args) { |
| | | HaiKangPost haiKangPost = new HaiKangPost(); |
| | | haiKangPost.getTopicInfo(); |
| | | // haiKangPost.getTopicInfo(); |
| | | |
| | | // FindHistoryGpsRequest findHistoryGpsRequest = new FindHistoryGpsRequest(); |
| | | // findHistoryGpsRequest.setVehicleIndexCode("b279d865eabe497db465eb2f4d2cc87d"); |
| | |
| | | // System.out.println(haiKangPost.findHistoryGps(findHistoryGpsRequest)); |
| | | |
| | | // String code[] = {"b279d865eabe497db465eb2f4d2cc87d"}; |
| | | // System.out.println(findLatestGps(code)); |
| | | // System.out.println(haiKangPost.findLatestGps(code)); |
| | | |
| | | // PreviewURLsVo previewURLsVo = new PreviewURLsVo(); |
| | | // previewURLsVo.setCameraIndexCode("b279d865eabe497db465eb2f4d2cc87d"); |
| | | // previewURLs(previewURLsVo); |
| | | PreviewURLsVo previewURLsVo = new PreviewURLsVo(); |
| | | previewURLsVo.setCameraIndexCode("27760424aa8b486e84db8d6720b2a9bf"); |
| | | previewURLsVo.setProtocol("rtmp"); |
| | | haiKangPost.previewURLs(previewURLsVo); |
| | | |
| | | } |
| | | } |
| | |
| | | |
| | | import cn.exrick.xboot.your.entity.Alarm; |
| | | import cn.exrick.xboot.your.entity.Car; |
| | | import cn.exrick.xboot.your.entity.EventLog; |
| | | import cn.exrick.xboot.your.service.IAlarmService; |
| | | import cn.exrick.xboot.your.service.ICarService; |
| | | import cn.exrick.xboot.your.service.IEventLogService; |
| | | import cn.hutool.json.JSONArray; |
| | | import cn.hutool.json.JSONObject; |
| | | import cn.hutool.json.JSONUtil; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.awt.*; |
| | | |
| | | @Component |
| | | public class MQTT { |
| | | @Autowired |
| | | private IAlarmService iAlarmService; |
| | | @Autowired |
| | | private ICarService iCarService; |
| | | @Autowired |
| | | private HaiKangPost haiKangPost; |
| | | @Autowired |
| | | private IEventLogService iEventLogService; |
| | | |
| | | public static void main(String[] args) { |
| | | MQTT mqtt = new MQTT(); |
| | |
| | | } |
| | | |
| | | public void event(String clientid,String userName,String passWord){ |
| | | String HOST = "tcp://111.63.178.115:1883"; |
| | | String HOST = "tcp://10.10.101.1:1883"; |
| | | //String HOST = "tcp://111.63.178.115:1883"; |
| | | String TOPIC = "artemis/event_msa_alarm/5201154049/admin"; |
| | | int qos = 1; |
| | | // String clientid = "28156526"; |
| | |
| | | client.setCallback(new MqttCallback() { |
| | | public void connectionLost(Throwable cause) { |
| | | System.out.println("connectionLost"); |
| | | String topicInfo = haiKangPost.getTopicInfo(); |
| | | System.out.println("重连-订阅信息:"+topicInfo); |
| | | JSONObject jsonObject = JSONUtil.parseObj(topicInfo); |
| | | if(jsonObject.get("data")!=null){ |
| | | String data = jsonObject.get("data").toString(); |
| | | JSONObject jsonObject2 = JSONUtil.parseObj(data); |
| | | String clientId = jsonObject2.get("clientId").toString(); |
| | | String userName = jsonObject2.get("userName").toString(); |
| | | String password = jsonObject2.get("password").toString(); |
| | | event(clientId,userName,password); |
| | | } |
| | | } |
| | | |
| | | public void deliveryComplete(IMqttDeliveryToken token) { |
| | |
| | | String eventType = jsonObject2.get("eventType").toString(); |
| | | String vehicleIndexCode = jsonObject2.get("vehicleIndexCode").toString(); |
| | | String alarmId = jsonObject2.get("alarmId").toString(); |
| | | String alarmTime = jsonObject2.get("alarmTime").toString(); |
| | | |
| | | Alarm alarm = new Alarm(); |
| | | if(eventType.equals("132371")){ |
| | |
| | | alarm.setCarNo(car.getCarNo()); |
| | | alarm.setCarUserId(car.getUserId()); |
| | | alarm.setFollowUserId(car.getFollowUserId()); |
| | | |
| | | alarm.setAlarmTime(alarmTime); |
| | | iAlarmService.saveOrUpdate(alarm); |
| | | |
| | | EventLog eventLog = new EventLog(); |
| | | eventLog.setType(alarm.getType()); |
| | | eventLog.setRefId(alarmId); |
| | | eventLog.setCarNo(car.getCarNo()); |
| | | iEventLogService.saveOrUpdate(eventLog); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package cn.exrick.xboot.your.vo; |
| | | |
| | | import cn.exrick.xboot.your.entity.Car; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class AlarmVo { |
| | | |
| | | private String alarmId; |
| | | private String alarmTime; |
| | | |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="cn.exrick.xboot.your.mapper.UpdateAppMapper"> |
| | | |
| | | </mapper> |