| | |
| | | package com.stylefeng.guns.modular.api; |
| | | import java.util.Date; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | |
| | | import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService; |
| | | import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; |
| | | import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService; |
| | | import com.stylefeng.guns.modular.system.dao.DriverWorkMapper; |
| | | import com.stylefeng.guns.modular.system.dao.SysReformistMapper; |
| | | import com.stylefeng.guns.modular.system.dao.TDriverFacialFailMapper; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.util.ALiSendSms; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | //import com.stylefeng.guns.modular.system.util.ICBCPayUtil; |
| | | import com.stylefeng.guns.modular.system.util.CompareFace; |
| | | import com.stylefeng.guns.modular.system.util.HuaWeiSMSUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.ActivityWarpper; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.*; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | | import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; |
| | |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.text.SimpleDateFormat; |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | @Resource |
| | | private DriverWorkMapper driverWorkMapper; |
| | | @Autowired |
| | | private IOrderService orderService; |
| | | @Autowired |
| | | private PushMinistryOfTransportUtil pushMinistryOfTransportUtil; |
| | | @Value("${pushMinistryOfTransport}") |
| | | private boolean pushMinistryOfTransport; |
| | | @Resource |
| | | private TDriverFacialFailMapper driverFacialFailMapper; |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/face") |
| | | @ApiOperation(value = "面容识别", tags = {"司机端-登录"}, notes = "") |
| | |
| | | //通过第三方进行识别 |
| | | if (CompareFace.faceCompare(url, driver.getFaceImgUrl())){ |
| | | driver.setLastFacialTime(new Date()); |
| | | driver.setFailCount(0); |
| | | driverService.updateById(driver); |
| | | return ResultUtil.success(); |
| | | } |
| | | driver.setFailCount(driver.getFailCount()==null? 0: driver.getFailCount()+1); |
| | | driverService.updateById(driver); |
| | | if (driver.getFailCount()==5){ |
| | | if (driver.getFailCount()>=5){ |
| | | DriverWork driverWork = driverWorkMapper.queryNewWork(uid, null, 1); |
| | | List<Map<String, Object>> list = orderService.queryOrderList(1, 1, 10, uid); |
| | | if(list.size() > 0){ |
| | | return ResultUtil.error("还有未完成的订单,不能进行下班操作"); |
| | | } |
| | | driverWork.setEndTime(new Date()); |
| | | driverWork.setState(2); |
| | | driverWorkMapper.updateById(driverWork); |
| | | driver.setState(1); |
| | | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传数据 |
| | | pushMinistryOfTransportUtil.operateLogout(uid); |
| | | } |
| | | } |
| | | }).start(); |
| | | |
| | | TDriverFacialFail tDriverFacialFail = new TDriverFacialFail(); |
| | | tDriverFacialFail.setDriverId(driver.getId()); |
| | | tDriverFacialFail.setCity("成都市"); |
| | | tDriverFacialFail.setCityCode("510100"); |
| | | tDriverFacialFail.setFacialPicture(url); |
| | | tDriverFacialFail.setCreateTime(new Date()); |
| | | driverFacialFailMapper.insert(tDriverFacialFail); |
| | | // tDriverFacialFail.setIsDelete(0); |
| | | |
| | | |
| | | |
| | | return new ResultUtil<>(-1,"已满五次,退回主页"); |
| | | } |
| | | //成功的话保存最后识别时间 |