| | |
| | | package com.stylefeng.guns.modular.api; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.netflix.ribbon.proxy.annotation.Http; |
| | | import com.stylefeng.guns.modular.system.dao.SysReformistMapper; |
| | | import com.stylefeng.guns.modular.system.model.Driver; |
| | | import com.stylefeng.guns.modular.system.model.DriverService; |
| | | import com.stylefeng.guns.modular.system.model.Phone; |
| | | import com.stylefeng.guns.modular.system.model.SysReformist; |
| | | import com.stylefeng.guns.modular.system.service.IDriverService; |
| | | import com.stylefeng.guns.modular.system.service.IPhoneService; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.naming.ldap.PagedResultsControl; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private IPhoneService phoneService; |
| | | |
| | | @Autowired |
| | | private IDriverService driverService; |
| | | @Autowired |
| | | private SysReformistMapper sysReformistMapper; |
| | | |
| | | |
| | | /** |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "当前定位行政区域编号", name = "code", required = true, dataType = "string"), |
| | | }) |
| | | public ResultUtil queryCustomerPhone(String code){ |
| | | public ResultUtil queryCustomerPhone(String code,HttpServletRequest request){ |
| | | try { |
| | | Map<String, Object> map = phoneService.queryCustomerPhone(code); |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | String wechat = ""; |
| | | Driver driver = driverService.selectById(uid); |
| | | List<SysReformist> companyId = sysReformistMapper.selectList(new EntityWrapper<SysReformist>().eq("companyId", driver.getCompanyId())); |
| | | for (SysReformist sysReformist : companyId) { |
| | | wechat = sysReformist.getDriverQrCode(); |
| | | } |
| | | |
| | | Map<String, Object> map = phoneService.queryCustomerPhone(code,wechat); |
| | | return ResultUtil.success(map); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | // @ResponseBody |
| | | // @PostMapping("/queryWechatPic") |
| | | // @ApiOperation(value = "获取客服二维码", tags = {"司机端-首页"}) |
| | | // @ApiImplicitParams({ |
| | | // @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | // }) |
| | | // public ResultUtil queryCustomerWechat(HttpServletRequest request){ |
| | | // try { |
| | | // Integer uid = driverService.getUserIdFormRedis(request); |
| | | // if(null == uid){ |
| | | // return ResultUtil.tokenErr(); |
| | | // } |
| | | // Driver driver = driverService.selectById(uid); |
| | | // List<SysReformist> companyId = sysReformistMapper.selectList(new EntityWrapper<SysReformist>().eq("companyId", driver.getCompanyId())); |
| | | // for (SysReformist sysReformist : companyId) { |
| | | // return ResultUtil.success(sysReformist.getDriverQrCode()); |
| | | // } |
| | | // |
| | | // }catch (Exception e){ |
| | | // e.printStackTrace(); |
| | | // return ResultUtil.runErr(); |
| | | // } |
| | | // return ResultUtil.error("请稍后重试"); |
| | | // } |
| | | } |