| | |
| | | <dependencies> |
| | | |
| | | <dependency> |
| | | <groupId>com.ncoss</groupId> |
| | | <artifactId>ncoss-java-sdk</artifactId> |
| | | <version>1.0.5</version> |
| | | <scope>system</scope> |
| | | <systemPath>${pom.basedir}/lib/ncoss-java-sdk-1.0.5.jar</systemPath> |
| | | </dependency> |
| | | |
| | | |
| | | <dependency> |
| | | <groupId>cn.rongcloud.im</groupId> |
| | | <artifactId>server-sdk-java</artifactId> |
| | | <version>3.2.13</version> |
| | |
| | | package com.stylefeng.guns.modular.api; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.account.service.ITEnterpriseWithdrawalService; |
| | | import com.stylefeng.guns.modular.account.service.UserWithdrawalService; |
| | | import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity; |
| | | import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService; |
| | | import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; |
| | | import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService; |
| | | import com.stylefeng.guns.modular.system.service.ICompanyService; |
| | | import com.stylefeng.guns.modular.system.service.IDriverService; |
| | | import com.stylefeng.guns.modular.system.service.IReassignService; |
| | | import com.stylefeng.guns.modular.system.util.PayMoneyUtil; |
| | | import com.stylefeng.guns.modular.system.util.rongyun.RongYunUtil; |
| | | import com.stylefeng.guns.modular.system.util.rongyun.model.CloudRecordingCallback; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | | import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.BufferedReader; |
| | | import java.io.IOException; |
| | | import java.io.PrintWriter; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | |
| | | @Autowired |
| | | private PayMoneyUtil payMoneyUtil; |
| | | @Autowired |
| | | private IDriverService driverService; |
| | | @Autowired |
| | | private ICompanyService companyService; |
| | | @Autowired |
| | | private ITEnterpriseWithdrawalService enterpriseWithdrawalService; |
| | | @Autowired |
| | | private UserWithdrawalService userWithdrawalService; |
| | | |
| | | |
| | | @Autowired |
| | | private IOrderPrivateCarService orderPrivateCarService; |
| | | |
| | | @Autowired |
| | | private IOrderTaxiService orderTaxiService; |
| | | |
| | | @Autowired |
| | | private IOrderCrossCityService orderCrossCityService; |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/rongYunCallBack") |
| | | public void rongYunCallBack(HttpServletRequest request, HttpServletResponse response){ |
| | | CloudRecordingCallback cloudRecordingCallback = RongYunUtil.cloudRecordingCallback(request); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | System.err.println(sdf.format(new Date()) + "-------------------云端录制状态回调!-------------------"); |
| | | System.err.println(JSON.toJSONString(cloudRecordingCallback)); |
| | | if(null == cloudRecordingCallback){ |
| | | System.err.println("云端录制状态回调解析出错!"); |
| | | return; |
| | | } |
| | | Integer type = cloudRecordingCallback.getType(); |
| | | if(4 == type){//文件上传 |
| | | String fileUrl = cloudRecordingCallback.getOutput().getFileUrl(); |
| | | String roomId = cloudRecordingCallback.getRoomId(); |
| | | String[] split = roomId.split("_"); |
| | | String orderType = split[0]; |
| | | String orderId = split[1]; |
| | | if("1".equals(orderType)){ |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId); |
| | | orderPrivateCar.setVoice(fileUrl); |
| | | orderPrivateCarService.updateById(orderPrivateCar); |
| | | } |
| | | if("2".equals(orderType)){ |
| | | OrderTaxi orderTaxi = orderTaxiService.selectById(orderId); |
| | | orderTaxi.setVoice(fileUrl); |
| | | orderTaxiService.updateById(orderTaxi); |
| | | } |
| | | if("3".equals(orderType)){ |
| | | OrderCrossCity orderCrossCity = orderCrossCityService.selectById(orderId); |
| | | orderCrossCity.setVoice(fileUrl); |
| | | orderCrossCityService.updateById(orderCrossCity); |
| | | } |
| | | |
| | | // TODO 顺风车 |
| | | } |
| | | PrintWriter out = null; |
| | | try { |
| | | out = response.getWriter(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | out.print("OK"); |
| | | out.flush(); |
| | | out.close(); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.api; |
| | | |
| | | import cn.hutool.core.io.FileUtil; |
| | | import cn.hutool.http.HttpRequest; |
| | | import cn.hutool.http.HttpResponse; |
| | | import cn.hutool.http.HttpUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alipay.api.internal.util.file.IOUtils; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.config.properties.GunsProperties; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | |
| | | import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService; |
| | | import com.stylefeng.guns.modular.system.dao.RegionMapper; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.model.vo.CompanyVo; |
| | | import com.stylefeng.guns.modular.system.model.vo.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.ALiSendSms; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.util.WeChatUtil; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.NCOSSUtil; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.QianYunTongConfig; |
| | | 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.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.http.*; |
| | | import org.springframework.util.LinkedMultiValueMap; |
| | | import org.springframework.util.MultiValueMap; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpSession; |
| | | import java.io.ByteArrayInputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.io.OutputStream; |
| | | import java.math.BigDecimal; |
| | | import java.security.SecureRandom; |
| | | import java.text.MessageFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | |
| | | @CrossOrigin |
| | | @RestController |
| | | @RequestMapping("") |
| | | @Slf4j |
| | | public class DriverController { |
| | | |
| | | @Resource |
| | |
| | | |
| | | @Autowired |
| | | private ICompanyCityService companyCityService; |
| | | |
| | | @Autowired |
| | | private TDriverPromotionActivityService driverPromotionActivityService; |
| | | |
| | | |
| | | @Autowired |
| | | private QianYunTongConfig qianYunTongConfig; |
| | | |
| | | /** |
| | | * 获取短信验证码 |
| | |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/queryHomeDataFromDriver") |
| | | @ApiOperation(value = "获取首页统计数据(黔云通)", tags = {"司机端-首页"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<DriverIndexVo> queryHomeDataFromDriver(HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | DriverIndexVo vo = driverService.queryHomeDataFromDriver(uid); |
| | | return ResultUtil.success(vo); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/queryOrderDataFromDriver") |
| | | @ApiOperation(value = "获取订单统计数据(黔云通)", tags = {"司机端-首页"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(value = "2022-02-02 - 2033-03-03", name = "time", required = false, dataType = "String"), |
| | | @ApiImplicitParam(value = "pageNumber", name = "pageNumber", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "pageSize", name = "pageSize", required = true, dataType = "int") |
| | | }) |
| | | public ResultUtil<DriverOrderDataVo> queryOrderDataFromDriver(String time,Integer pageNumber,Integer pageSize,HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | Page<DriverOrderDataNextVo> driverOrderDataVoPage = new Page<>(pageNumber, pageSize); |
| | | DriverOrderDataVo vo = driverService.queryOrderDataFromDriver(time,driverOrderDataVoPage,uid); |
| | | return ResultUtil.success(vo); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/queryOrderMoneyFromDriver") |
| | | @ApiOperation(value = "获取订单收入统计数据(黔云通)", tags = {"司机端-首页"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(value = "2022-02-02 - 2033-03-03", name = "time", required = false, dataType = "String"), |
| | | @ApiImplicitParam(value = "pageNumber", name = "pageNumber", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "pageSize", name = "pageSize", required = true, dataType = "int") |
| | | }) |
| | | public ResultUtil<DriverOrderMoneyDataVo> queryOrderMoneyFromDriver(String time, Integer pageNumber, Integer pageSize, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | Page<DriverOrderDataNextVo> driverOrderDataVoPage = new Page<>(pageNumber, pageSize); |
| | | DriverOrderMoneyDataVo vo = driverService.queryOrderMoneyFromDriver(time,driverOrderDataVoPage,uid); |
| | | return ResultUtil.success(vo); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/queryOrderPromotionFromDriver") |
| | | @ApiOperation(value = "获取订单推广统计数据(黔云通)", tags = {"司机端-首页"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(value = "2022-02-02 - 2033-03-03", name = "time", required = false, dataType = "String"), |
| | | @ApiImplicitParam(value = "pageNumber", name = "pageNumber", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "pageSize", name = "pageSize", required = true, dataType = "int") |
| | | }) |
| | | public ResultUtil<DriverOrderPromotionDataVo> queryOrderPromotionFromDriver(String time, Integer pageNumber, Integer pageSize, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | Page<DriverOrderDataNextVo> driverOrderDataVoPage = new Page<>(pageNumber, pageSize); |
| | | DriverOrderPromotionDataVo vo = driverService.queryOrderPromotionFromDriver(time,driverOrderDataVoPage,uid); |
| | | return ResultUtil.success(vo); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/getPromotionInfo") |
| | | @ApiOperation(value = "获取推广说明(黔云通)", tags = {"司机端-首页"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | }) |
| | | public ResultUtil<String> getPromotionInfo(HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | Driver driver = driverService.selectById(uid); |
| | | String areaCode = driver.getAreaCode(); |
| | | TDriverPromotionActivity tDriverPromotionActivity = driverPromotionActivityService.selectOne(new EntityWrapper<TDriverPromotionActivity>() |
| | | .eq("districtCode", areaCode) |
| | | .eq("status", 2) |
| | | .last("LIMIT 1")); |
| | | if(tDriverPromotionActivity!=null){ |
| | | return ResultUtil.success(tDriverPromotionActivity.getActivityDesc()); |
| | | } |
| | | return ResultUtil.success(""); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "个人的小程序码(分享码)生成", tags = {"司机端-首页"}, notes = "") |
| | | @GetMapping("/api/driver/person-code") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | }) |
| | | public ResultUtil<HashMap<String, String>> createQRcode(HttpServletRequest request) { |
| | | InputStream inputStream = null; |
| | | OutputStream outputStream = null; |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if (null == uid) { |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | // 获取调用凭证accessToken |
| | | String accessToken = getAccessToken(); |
| | | RestTemplate rest = new RestTemplate(); |
| | | |
| | | String imgUrl = ""; |
| | | String url = "https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=" + accessToken; |
| | | Map<String, Object> param = new HashMap<>(); |
| | | param.put("path", "pages/home/home?driverId=" + uid); |
| | | param.put("width", 430); //二维码尺寸 |
| | | MultiValueMap<String, String> headers = new LinkedMultiValueMap<>(); |
| | | HttpEntity requestEntity = new HttpEntity(param, headers); |
| | | ResponseEntity<byte[]> entity = rest.exchange(url, HttpMethod.POST, requestEntity, byte[].class, new Object[0]); |
| | | byte[] result = entity.getBody(); |
| | | inputStream = new ByteArrayInputStream(result); |
| | | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); |
| | | // 最后上传生成的文件名 |
| | | String finalFileName = System.currentTimeMillis() + "" + new SecureRandom().nextInt(0x0400) + ".jpg"; |
| | | // oss中的文件夹名 |
| | | String objectName = sdf.format(new Date()) + "/" + finalFileName; |
| | | String key = "imgs/management/" + objectName; |
| | | String object = NCOSSUtil.putObject( qianYunTongConfig.getBucketName(), key, inputStream); |
| | | |
| | | System.out.println(object); |
| | | |
| | | String url1 ="https://api.weixin.qq.com/wxa/generate_urllink?access_token="+accessToken; |
| | | Map<String, Object> param1 = new HashMap<>(); |
| | | param1.put("path", "pages/home/home"); |
| | | param1.put("query","driverId="+uid); |
| | | |
| | | HttpRequest post = HttpUtil.createPost(url1); |
| | | // map转json |
| | | String jsonString = JSON.toJSONString(param1); |
| | | post.body(jsonString); |
| | | HttpResponse execute = post.execute(); |
| | | String body = execute.body(); |
| | | String urlLink = JSONObject.parseObject(body).get("url_link").toString(); |
| | | |
| | | |
| | | HashMap<String, String> stringStringHashMap = new HashMap<>(); |
| | | stringStringHashMap.put("url_link",urlLink); |
| | | stringStringHashMap.put("img",object); |
| | | |
| | | |
| | | // inputStream = new ByteArrayInputStream(result); |
| | | // |
| | | // SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); |
| | | // // 最后上传生成的文件名 |
| | | // String finalFileName = System.currentTimeMillis() + "" + new SecureRandom().nextInt(0x0400) + ".jpg"; |
| | | // // oss中的文件夹名 |
| | | // String objectName = sdf.format(new Date()) + "/" + finalFileName; |
| | | // // 上传oss |
| | | //// ossUtil.uploadFile2OSS(inputStream, objectName); |
| | | //// //获取文件的URl地址 |
| | | //// imgUrl = ossUtil.getImgUrl(objectName); |
| | | // log.info("imgUrl: "+imgUrl); |
| | | return ResultUtil.success(stringStringHashMap); |
| | | |
| | | } catch (Exception e) { |
| | | log.error("调用小程序生成微信永久小程序码URL接口异常", e); |
| | | }finally { |
| | | if(inputStream != null){ |
| | | try { |
| | | inputStream.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | if(outputStream != null){ |
| | | try { |
| | | outputStream.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | return ResultUtil.error("获取二维码失败"); |
| | | } |
| | | |
| | | @Value("${wx.url}") |
| | | private String ACCESS_TOKEN_URL; |
| | | |
| | | @Value("${wx.appletsAppSecret}") |
| | | private String memberAppSecret; |
| | | |
| | | @Value("${wx.appletsAppid}") |
| | | private String wxAppId; |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | |
| | | public String getAccessToken() { |
| | | String requestUrl = MessageFormat.format(ACCESS_TOKEN_URL,wxAppId,memberAppSecret); |
| | | String respBody = restTemplate.getForEntity(requestUrl, String.class).getBody(); |
| | | JSONObject jsonObject = JSONObject.parseObject(respBody); |
| | | return jsonObject.getString("access_token"); |
| | | } |
| | | |
| | | |
| | |
| | | if(companyCities.isEmpty()){ |
| | | return ResultUtil.success(companyVos); |
| | | } |
| | | List<Company> companies = companyService.selectList(new EntityWrapper<Company>().eq("type", 2).ne("flag", 3).in("id", companyCities.stream().map(CompanyCity::getCompanyId).collect(Collectors.toList()))); |
| | | List<Company> companies = companyService.selectList(new EntityWrapper<Company>().ne("type", 1).ne("flag", 3).in("id", companyCities.stream().map(CompanyCity::getCompanyId).collect(Collectors.toList()))); |
| | | for (Company company : companies) { |
| | | CompanyVo companyVo = new CompanyVo(company.getId(), company.getName()); |
| | | companyVos.add(companyVo); |
| | |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | |
| | | private String splitAllocation; |
| | | |
| | | |
| | | // 推广应的金额 |
| | | private BigDecimal promotionMoney; |
| | | |
| | | // 推广司机id |
| | | private Integer promotionDriverId; |
| | | |
| | | |
| | | private String voice; |
| | | |
| | | public String getVoice() { |
| | | return voice; |
| | | } |
| | | |
| | | public void setVoice(String voice) { |
| | | this.voice = voice; |
| | | } |
| | | |
| | | public BigDecimal getPromotionMoney() { |
| | | return promotionMoney; |
| | | } |
| | | |
| | | public void setPromotionMoney(BigDecimal promotionMoney) { |
| | | this.promotionMoney = promotionMoney; |
| | | } |
| | | |
| | | public Integer getPromotionDriverId() { |
| | | return promotionDriverId; |
| | | } |
| | | |
| | | public void setPromotionDriverId(Integer promotionDriverId) { |
| | | this.promotionDriverId = promotionDriverId; |
| | | } |
| | | |
| | | public Date getPayTime() { |
| | | return payTime; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | |
| | | private Integer totalPeopleNum; |
| | | |
| | | @TableField("voice") |
| | | private String voice; |
| | | |
| | | /** |
| | | * 预估里程(米) |
| | | */ |
| | |
| | | |
| | | private Integer driverCancle; |
| | | |
| | | |
| | | |
| | | // 推广应的金额 |
| | | private BigDecimal promotionMoney; |
| | | |
| | | // 推广司机id |
| | | private Integer promotionDriverId; |
| | | |
| | | public String getVoice() { |
| | | return voice; |
| | | } |
| | | |
| | | public void setVoice(String voice) { |
| | | this.voice = voice; |
| | | } |
| | | |
| | | public BigDecimal getPromotionMoney() { |
| | | return promotionMoney; |
| | | } |
| | | |
| | | public void setPromotionMoney(BigDecimal promotionMoney) { |
| | | this.promotionMoney = promotionMoney; |
| | | } |
| | | |
| | | public Integer getPromotionDriverId() { |
| | | return promotionDriverId; |
| | | } |
| | | |
| | | public void setPromotionDriverId(Integer promotionDriverId) { |
| | | this.promotionDriverId = promotionDriverId; |
| | | } |
| | | |
| | | public String getChargeRules() { |
| | | return chargeRules; |
| | | } |
| | |
| | | public interface DriverMapper extends BaseMapper<Driver> { |
| | | |
| | | /** |
| | | * 获取当前已上班type业务类型、设置了可以接此类型的单据且空闲的司机 |
| | | * @param type |
| | | * @return |
| | | */ |
| | | List<Driver> queryIdleDriver(@Param("type") Integer type, @Param("companyId") Integer companyId); |
| | | |
| | | /** |
| | | * 获取当前已上班type业务类型、设置了可以接此类型的单据、服务车型匹配且空闲的司机 |
| | | * @param type |
| | | * @param serverCarModelId |
| | | * @param companyId |
| | | * @return |
| | | */ |
| | | List<Driver> queryIdleDriver_(@Param("type") Integer type, @Param("serverCarModelId") Integer serverCarModelId, |
| | | @Param("companyId") Integer companyId); |
| | | /** |
| | | * 根据电话获取司机 |
| | | * @param phone |
| | | * @return |
| | |
| | | package com.stylefeng.guns.modular.system.dao; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.modular.system.model.DriverService; |
| | | import com.stylefeng.guns.modular.system.model.vo.DriverOrderDataNextVo; |
| | | import com.stylefeng.guns.modular.system.model.vo.DriverOrderDataVo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | * @throws Exception |
| | | */ |
| | | List<DriverService> queryMyBusiness(@Param("uid") Integer uid); |
| | | |
| | | List<DriverOrderDataNextVo> queryOrderDataFromDriver(@Param("sTime") String sTime, @Param("eTime") String eTime, @Param("driverOrderDataVoPage") Page<DriverOrderDataNextVo> driverOrderDataVoPage, @Param("uid") Integer uid); |
| | | |
| | | |
| | | List<DriverOrderDataNextVo> queryOrderMoneyDataFromDriver(@Param("sTime") String sTime, @Param("eTime") String eTime, @Param("driverOrderDataVoPage") Page<DriverOrderDataNextVo> driverOrderDataVoPage, @Param("uid") Integer uid); |
| | | |
| | | List<DriverOrderDataNextVo> queryOrderMoneyDataFromDriverAll(@Param("sTime") String sTime, @Param("eTime") String eTime, @Param("uid") Integer uid); |
| | | |
| | | |
| | | List<DriverOrderDataNextVo> queryOrderPromotionFromDriver(@Param("sTime") String sTime, @Param("eTime") String eTime, @Param("driverOrderDataVoPage") Page<DriverOrderDataNextVo> driverOrderDataVoPage, @Param("uid") Integer uid); |
| | | |
| | | |
| | | List<DriverOrderDataNextVo> queryOrderPromotionFromDriverAll(@Param("sTime") String sTime, @Param("eTime") String eTime, @Param("uid") Integer uid); |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.stylefeng.guns.modular.system.model.TDriverPromotionActivity; |
| | | |
| | | /** |
| | | * <p> |
| | | * 司机推广活动主表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2025-07-23 |
| | | */ |
| | | public interface TDriverPromotionActivityMapper extends BaseMapper<TDriverPromotionActivity> { |
| | | |
| | | } |
| | |
| | | <result column="updateUser" property="updateUser"/> |
| | | </resultMap> |
| | | |
| | | <select id="queryIdleDriver" resultType="com.stylefeng.guns.modular.system.model.Driver"> |
| | | select |
| | | id as id, |
| | | account as account, |
| | | jobNumber as jobNumber, |
| | | phone as phone, |
| | | password as password, |
| | | name as name, |
| | | sex as sex, |
| | | idCard as idCard, |
| | | companyId as companyId, |
| | | franchiseeId as franchiseeId, |
| | | headImgUrl as headImgUrl, |
| | | faceImgUrl as faceImgUrl, |
| | | idCardImgUrl1 as idCardImgUrl1, |
| | | idCardImgUrl2 as idCardImgUrl2, |
| | | placeOfEmployment as placeOfEmployment, |
| | | birthday as birthday, |
| | | bankCardNumber as bankCardNumber, |
| | | driverNationality as driverNationality, |
| | | driverNation as driverNation, |
| | | driverMaritalStatus as driverMaritalStatus, |
| | | driverLanguageLevel as driverLanguageLevel, |
| | | driverEducation as driverEducation, |
| | | driverCensus as driverCensus, |
| | | driverAddress as driverAddress, |
| | | driverContactAddress as driverContactAddress, |
| | | driverAge as driverAge, |
| | | driveCard as driveCard, |
| | | driveCardImgUrl as driveCardImgUrl, |
| | | driverType as driverType, |
| | | getDriverLicenseDate as getDriverLicenseDate, |
| | | driverLicenseOn as driverLicenseOn, |
| | | driverLicenseOff as driverLicenseOff, |
| | | taxiDriver as taxiDriver, |
| | | taxiAptitudeCard as taxiAptitudeCard, |
| | | networkCarlssueImg as networkCarlssueImg, |
| | | networkCarlssueOrganization as networkCarlssueOrganization, |
| | | networkCarlssueDate as networkCarlssueDate, |
| | | getNetworkCarProofDate as getNetworkCarProofDate, |
| | | networkCarProofOn as networkCarProofOn, |
| | | networkCarProofOff as networkCarProofOff, |
| | | registerDate as registerDate, |
| | | fullTimeDriver as fullTimeDriver, |
| | | inDriverBlacklist as inDriverBlacklist, |
| | | commercialType as commercialType, |
| | | contractCompany as contractCompany, |
| | | contractOn as contractOn, |
| | | contractOff as contractOff, |
| | | emergencyContact as emergencyContact, |
| | | emergencyContactPhone as emergencyContactPhone, |
| | | emergencyContactAddress as emergencyContactAddress, |
| | | remark as remark, |
| | | isPlatCar as isPlatCar, |
| | | carId as carId, |
| | | authState as authState, |
| | | state as state, |
| | | addType as addType, |
| | | balance as balance, |
| | | flag as flag, |
| | | insertTime as insertTime, |
| | | insertUser as insertUser, |
| | | updateTime as updateTime, |
| | | updateUser as updateUser |
| | | from t_driver |
| | | where flag != 3 and state = 2 and authState = 2 |
| | | <if test="null != companyId"> |
| | | <choose> |
| | | <when test="companyId != 1"> |
| | | and companyId = #{companyId} or franchiseeId = #{companyId} |
| | | </when> |
| | | <otherwise> |
| | | and companyId is null or companyId = 0 or companyId = 1 or franchiseeId is null or franchiseeId = 0 |
| | | </otherwise> |
| | | </choose> |
| | | |
| | | </if> |
| | | and id in |
| | | ( |
| | | select driverId from t_driver_work where startTime < now() and state = 1 and `type` like CONCAT('%', #{type}, '%') |
| | | ) |
| | | <if test="8>type"> |
| | | and id in (select driverId from t_driver_orders where `type` = #{type}) |
| | | </if> |
| | | <if test="type>7"> |
| | | and id in (select driverId from t_driver_orders where `type` = 1) |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="queryIdleDriver_" resultType="com.stylefeng.guns.modular.system.model.Driver"> |
| | | select |
| | | id as id, |
| | | account as account, |
| | | jobNumber as jobNumber, |
| | | phone as phone, |
| | | password as password, |
| | | name as name, |
| | | sex as sex, |
| | | idCard as idCard, |
| | | companyId as companyId, |
| | | franchiseeId as franchiseeId, |
| | | headImgUrl as headImgUrl, |
| | | faceImgUrl as faceImgUrl, |
| | | idCardImgUrl1 as idCardImgUrl1, |
| | | idCardImgUrl2 as idCardImgUrl2, |
| | | placeOfEmployment as placeOfEmployment, |
| | | birthday as birthday, |
| | | bankCardNumber as bankCardNumber, |
| | | driverNationality as driverNationality, |
| | | driverNation as driverNation, |
| | | driverMaritalStatus as driverMaritalStatus, |
| | | driverLanguageLevel as driverLanguageLevel, |
| | | driverEducation as driverEducation, |
| | | driverCensus as driverCensus, |
| | | driverAddress as driverAddress, |
| | | driverContactAddress as driverContactAddress, |
| | | driverAge as driverAge, |
| | | driveCard as driveCard, |
| | | driveCardImgUrl as driveCardImgUrl, |
| | | driverType as driverType, |
| | | getDriverLicenseDate as getDriverLicenseDate, |
| | | driverLicenseOn as driverLicenseOn, |
| | | driverLicenseOff as driverLicenseOff, |
| | | taxiDriver as taxiDriver, |
| | | taxiAptitudeCard as taxiAptitudeCard, |
| | | networkCarlssueImg as networkCarlssueImg, |
| | | networkCarlssueOrganization as networkCarlssueOrganization, |
| | | networkCarlssueDate as networkCarlssueDate, |
| | | getNetworkCarProofDate as getNetworkCarProofDate, |
| | | networkCarProofOn as networkCarProofOn, |
| | | networkCarProofOff as networkCarProofOff, |
| | | registerDate as registerDate, |
| | | fullTimeDriver as fullTimeDriver, |
| | | inDriverBlacklist as inDriverBlacklist, |
| | | commercialType as commercialType, |
| | | contractCompany as contractCompany, |
| | | contractOn as contractOn, |
| | | contractOff as contractOff, |
| | | emergencyContact as emergencyContact, |
| | | emergencyContactPhone as emergencyContactPhone, |
| | | emergencyContactAddress as emergencyContactAddress, |
| | | remark as remark, |
| | | isPlatCar as isPlatCar, |
| | | carId as carId, |
| | | authState as authState, |
| | | state as state, |
| | | addType as addType, |
| | | balance as balance, |
| | | flag as flag, |
| | | insertTime as insertTime, |
| | | insertUser as insertUser, |
| | | updateTime as updateTime, |
| | | updateUser as updateUser |
| | | from t_driver |
| | | where flag != 3 and state = 2 and authState = 2 |
| | | <if test="null != companyId"> |
| | | <choose> |
| | | <when test="companyId != 1"> |
| | | and companyId = #{companyId} or franchiseeId = #{companyId} |
| | | </when> |
| | | <otherwise> |
| | | and companyId is null or companyId = 0 or companyId = 1 or franchiseeId is null or franchiseeId = 0 |
| | | </otherwise> |
| | | </choose> |
| | | |
| | | </if> |
| | | and id in |
| | | ( |
| | | select driverId from t_driver_work where startTime < now() and state = 1 and `type` like CONCAT('%', #{type}, '%') |
| | | ) |
| | | <if test="8>type"> |
| | | and id in (select driverId from t_driver_orders where `type` = #{type}) |
| | | and carId in (select carId from t_car_service where `type` = #{type} |
| | | |
| | | <if test="null != serverCarModelId"> |
| | | and serverCarModelId = #{serverCarModelId} |
| | | </if> |
| | | ) |
| | | </if> |
| | | <if test="type>7"> |
| | | and id in (select driverId from t_driver_orders where `type` =1) |
| | | and carId in (select carId from t_car_service where `type` = 1 |
| | | |
| | | <if test="null != serverCarModelId"> |
| | | and serverCarModelId = #{serverCarModelId} |
| | | </if> |
| | | ) |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | <select id="queryByPhone" resultType="Driver"> |
| | | select id as id, |
| | |
| | | `type` as `type` |
| | | from t_driver_service where driverId = #{uid} |
| | | </select> |
| | | <select id="queryOrderDataFromDriver" resultType="com.stylefeng.guns.modular.system.model.vo.DriverOrderDataNextVo"> |
| | | select * from ( |
| | | select |
| | | orderNum, |
| | | 1 as type, |
| | | insertTime as orderTime, |
| | | id as orderId, |
| | | boardingAddress as startAddress, |
| | | getoffAddress as endAddress, |
| | | state, |
| | | orderMoney |
| | | from t_order_private_car |
| | | where driverId = #{uid} and state !=10 |
| | | <if test="sTime !=null"> |
| | | and insertTime between #{sTime} and #{eTime} |
| | | </if> |
| | | |
| | | union all |
| | | |
| | | select |
| | | orderNum, |
| | | 2 as type, |
| | | insertTime as orderTime, |
| | | id as orderId, |
| | | boardingAddress as startAddress, |
| | | getoffAddress as endAddress, |
| | | state, |
| | | orderMoney |
| | | from t_order_taxi |
| | | where driverId = #{uid} and state !=10 |
| | | <if test="sTime !=null"> |
| | | and insertTime between #{sTime} and #{eTime} |
| | | </if> |
| | | |
| | | union all |
| | | |
| | | select |
| | | orderNum, |
| | | 3 as type, |
| | | insertTime as orderTime, |
| | | id as orderId, |
| | | boardingAddress as startAddress, |
| | | getoffAddress as endAddress, |
| | | state, |
| | | orderMoney |
| | | from t_order_cross_city |
| | | where driverId = #{uid} and state !=10 |
| | | <if test="sTime !=null"> |
| | | and insertTime between #{sTime} and #{eTime} |
| | | </if> |
| | | ) t1 |
| | | order by t1.orderTime desc |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | </select> |
| | | <select id="queryOrderMoneyDataFromDriver" resultType="com.stylefeng.guns.modular.system.model.vo.DriverOrderDataNextVo"> |
| | | select * from ( |
| | | select |
| | | orderNum, |
| | | 1 as type, |
| | | insertTime as orderTime, |
| | | id as orderId, |
| | | boardingAddress as startAddress, |
| | | getoffAddress as endAddress, |
| | | state, |
| | | orderMoney |
| | | from t_order_private_car |
| | | where driverId = #{uid} and state in (8,9) |
| | | <if test="sTime !=null"> |
| | | and insertTime between #{sTime} and #{eTime} |
| | | </if> |
| | | |
| | | union all |
| | | |
| | | select |
| | | orderNum, |
| | | 2 as type, |
| | | insertTime as orderTime, |
| | | id as orderId, |
| | | boardingAddress as startAddress, |
| | | getoffAddress as endAddress, |
| | | state, |
| | | orderMoney |
| | | from t_order_taxi |
| | | where driverId = #{uid} and state in (8,9) |
| | | <if test="sTime !=null"> |
| | | and insertTime between #{sTime} and #{eTime} |
| | | </if> |
| | | |
| | | union all |
| | | |
| | | select |
| | | orderNum, |
| | | 3 as type, |
| | | insertTime as orderTime, |
| | | id as orderId, |
| | | boardingAddress as startAddress, |
| | | getoffAddress as endAddress, |
| | | state, |
| | | orderMoney |
| | | from t_order_cross_city |
| | | where driverId = #{uid} and state in (8,9) |
| | | <if test="sTime !=null"> |
| | | and insertTime between #{sTime} and #{eTime} |
| | | </if> |
| | | ) t1 |
| | | order by t1.orderTime desc |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | </select> |
| | | <select id="queryOrderMoneyDataFromDriverAll" resultType="com.stylefeng.guns.modular.system.model.vo.DriverOrderDataNextVo"> |
| | | select * from ( |
| | | select |
| | | orderNum, |
| | | 1 as type, |
| | | insertTime as orderTime, |
| | | id as orderId, |
| | | boardingAddress as startAddress, |
| | | getoffAddress as endAddress, |
| | | state, |
| | | orderMoney |
| | | from t_order_private_car |
| | | where driverId = #{uid} and state in (8,9) |
| | | <if test="sTime !=null"> |
| | | and insertTime between #{sTime} and #{eTime} |
| | | </if> |
| | | |
| | | union all |
| | | |
| | | select |
| | | orderNum, |
| | | 2 as type, |
| | | insertTime as orderTime, |
| | | id as orderId, |
| | | boardingAddress as startAddress, |
| | | getoffAddress as endAddress, |
| | | state, |
| | | orderMoney |
| | | from t_order_taxi |
| | | where driverId = #{uid} and state in (8,9) |
| | | <if test="sTime !=null"> |
| | | and insertTime between #{sTime} and #{eTime} |
| | | </if> |
| | | |
| | | union all |
| | | |
| | | select |
| | | orderNum, |
| | | 3 as type, |
| | | insertTime as orderTime, |
| | | id as orderId, |
| | | boardingAddress as startAddress, |
| | | getoffAddress as endAddress, |
| | | state, |
| | | orderMoney |
| | | from t_order_cross_city |
| | | where driverId = #{uid} and state in (8,9) |
| | | <if test="sTime !=null"> |
| | | and insertTime between #{sTime} and #{eTime} |
| | | </if> |
| | | ) t1 |
| | | order by t1.orderTime desc |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | </select> |
| | | <select id="queryOrderPromotionFromDriver" resultType="com.stylefeng.guns.modular.system.model.vo.DriverOrderDataNextVo"> |
| | | select * from ( |
| | | select |
| | | orderNum, |
| | | 1 as type, |
| | | successTime as orderTime, |
| | | id as orderId, |
| | | boardingAddress as startAddress, |
| | | getoffAddress as endAddress, |
| | | state, |
| | | promotionMoney as orderMoney |
| | | from t_order_private_car |
| | | where promotionDriverId = #{uid} and state in (8,9) |
| | | <if test="sTime !=null"> |
| | | and successTime between #{sTime} and #{eTime} |
| | | </if> |
| | | |
| | | union all |
| | | |
| | | select |
| | | orderNum, |
| | | 2 as type, |
| | | successTime as orderTime, |
| | | id as orderId, |
| | | boardingAddress as startAddress, |
| | | getoffAddress as endAddress, |
| | | state, |
| | | promotionMoney as orderMoney |
| | | from t_order_taxi |
| | | where promotionDriverId = #{uid} and state in (8,9) |
| | | <if test="sTime !=null"> |
| | | and successTime between #{sTime} and #{eTime} |
| | | </if> |
| | | |
| | | union all |
| | | |
| | | select |
| | | orderNum, |
| | | 3 as type, |
| | | successTime as orderTime, |
| | | id as orderId, |
| | | boardingAddress as startAddress, |
| | | getoffAddress as endAddress, |
| | | state, |
| | | promotionMoney as orderMoney |
| | | from t_order_cross_city |
| | | where promotionDriverId = #{uid} and state in (8,9) |
| | | <if test="sTime !=null"> |
| | | and successTime between #{sTime} and #{eTime} |
| | | </if> |
| | | ) t1 |
| | | order by t1.orderTime desc |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | </select> |
| | | |
| | | <select id="queryOrderPromotionFromDriverAll" resultType="com.stylefeng.guns.modular.system.model.vo.DriverOrderDataNextVo"> |
| | | select * from ( |
| | | select |
| | | orderNum, |
| | | 1 as type, |
| | | successTime as orderTime, |
| | | id as orderId, |
| | | boardingAddress as startAddress, |
| | | getoffAddress as endAddress, |
| | | state, |
| | | promotionMoney as orderMoney |
| | | from t_order_private_car |
| | | where promotionDriverId = #{uid} and state in (8,9) |
| | | <if test="sTime !=null"> |
| | | and successTime between #{sTime} and #{eTime} |
| | | </if> |
| | | |
| | | union all |
| | | |
| | | select |
| | | orderNum, |
| | | 2 as type, |
| | | successTime as orderTime, |
| | | id as orderId, |
| | | boardingAddress as startAddress, |
| | | getoffAddress as endAddress, |
| | | state, |
| | | promotionMoney as orderMoney |
| | | from t_order_taxi |
| | | where promotionDriverId = #{uid} and state in (8,9) |
| | | <if test="sTime !=null"> |
| | | and successTime between #{sTime} and #{eTime} |
| | | </if> |
| | | |
| | | union all |
| | | |
| | | select |
| | | orderNum, |
| | | 3 as type, |
| | | successTime as orderTime, |
| | | id as orderId, |
| | | boardingAddress as startAddress, |
| | | getoffAddress as endAddress, |
| | | state, |
| | | promotionMoney as orderMoney |
| | | from t_order_cross_city |
| | | where promotionDriverId = #{uid} and state in (8,9) |
| | | <if test="sTime !=null"> |
| | | and successTime between #{sTime} and #{eTime} |
| | | </if> |
| | | ) t1 |
| | | order by t1.orderTime desc |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | </mapper> |
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="com.stylefeng.guns.modular.system.dao.TDriverPromotionActivityMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | |
| | | </mapper> |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.activerecord.Model; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.Version; |
| | | |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 司机推广活动主表 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2025-07-23 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_driver_promotion_activity") |
| | | public class TDriverPromotionActivity extends Model<TDriverPromotionActivity> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 推广活动ID |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * 关联业务:1-专车/2-出租车/3-城际/4-顺风车/5-代驾 |
| | | */ |
| | | private String bizType; |
| | | /** |
| | | * 推广活动标题 |
| | | */ |
| | | private String activityTitle; |
| | | /** |
| | | * 活动区域-省 |
| | | */ |
| | | private String province; |
| | | /** |
| | | * 省code |
| | | */ |
| | | private String provinceCode; |
| | | /** |
| | | * 活动区域-市 |
| | | */ |
| | | private String city; |
| | | /** |
| | | * 市code |
| | | */ |
| | | private String cityCode; |
| | | /** |
| | | * 活动区域-区/县 |
| | | */ |
| | | private String district; |
| | | /** |
| | | * 区code |
| | | */ |
| | | private String districtCode; |
| | | /** |
| | | * 活动开始时间 |
| | | */ |
| | | private Date startTime; |
| | | /** |
| | | * 活动结束时间 |
| | | */ |
| | | private Date endTime; |
| | | /** |
| | | * 抽佣比例(如 10.00 代表 10%) |
| | | */ |
| | | private BigDecimal commissionRatio; |
| | | /** |
| | | * 司机乘客绑定有效期(天) |
| | | */ |
| | | private Integer bindingDays; |
| | | /** |
| | | * 推广活动说明 |
| | | */ |
| | | private String activityDesc; |
| | | /** |
| | | * 状态:1-未开始 2-进行中 3-已结束 |
| | | */ |
| | | private Integer status; |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | private String creator; |
| | | private Date createTime; |
| | | private Date updateTime; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.model.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class DriverIndexVo { |
| | | @ApiModelProperty("今日订单数") |
| | | private Integer todayOrderNum; |
| | | |
| | | @ApiModelProperty("今日订单金额") |
| | | private BigDecimal todayOrderMoney; |
| | | |
| | | @ApiModelProperty("今日推广金额") |
| | | private BigDecimal todayPromotionMoney; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.model.vo; |
| | | |
| | | import com.alipay.api.domain.DataEntry; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class DriverOrderDataNextVo { |
| | | @ApiModelProperty("订单号") |
| | | private String orderNum; |
| | | |
| | | @ApiModelProperty("订单类型 1快车 2出租车 3跨城") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("订单时间") |
| | | private Date orderTime; |
| | | |
| | | @ApiModelProperty("订单id") |
| | | private String orderId; |
| | | |
| | | @ApiModelProperty("订单开始地址") |
| | | private String startAddress; |
| | | |
| | | @ApiModelProperty("订单结束地址") |
| | | private String endAddress; |
| | | |
| | | @ApiModelProperty("订单状态 1=待接单,2=待出发,3=待到达预约地点,4=待乘客上车,5=服务中,6=完成服务,7=待支付,8=待评价,9=已完成,10=已取消,11=改派中,12=取消待支付") |
| | | private Integer state; |
| | | |
| | | @ApiModelProperty("订单金额/收入金额") |
| | | private Double orderMoney; |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.model.vo; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class DriverOrderDataVo { |
| | | @ApiModelProperty("总订单数") |
| | | private Integer allOrderNum; |
| | | |
| | | @ApiModelProperty("今日订单数") |
| | | private Integer todayOrderNum; |
| | | |
| | | @ApiModelProperty("本月订单数") |
| | | private Integer monthOrderNum; |
| | | |
| | | |
| | | @ApiModelProperty("订单列表") |
| | | private Page<DriverOrderDataNextVo> driverOrderDataNextVos; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.model.vo; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class DriverOrderMoneyDataVo { |
| | | @ApiModelProperty("总订单金额") |
| | | private BigDecimal allOrderMoney; |
| | | |
| | | @ApiModelProperty("今日订单金额") |
| | | private BigDecimal todayOrderMoney; |
| | | |
| | | @ApiModelProperty("本月订单金额") |
| | | private BigDecimal monthOrderMoney; |
| | | |
| | | |
| | | @ApiModelProperty("搜索合计金额") |
| | | private BigDecimal searchMoney; |
| | | |
| | | |
| | | @ApiModelProperty("订单列表") |
| | | private Page<DriverOrderDataNextVo> driverOrderDataNextVos; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.model.vo; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class DriverOrderPromotionDataVo { |
| | | @ApiModelProperty("总推广金额") |
| | | private BigDecimal allOrderMoney; |
| | | |
| | | @ApiModelProperty("今日推广金额") |
| | | private BigDecimal todayOrderMoney; |
| | | |
| | | @ApiModelProperty("本月推广金额") |
| | | private BigDecimal monthOrderMoney; |
| | | |
| | | |
| | | @ApiModelProperty("搜索合计金额") |
| | | private BigDecimal searchMoney; |
| | | |
| | | |
| | | @ApiModelProperty("列表") |
| | | private Page<DriverOrderDataNextVo> driverOrderDataNextVos; |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.system.model.Driver; |
| | | import com.stylefeng.guns.modular.system.model.vo.*; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.ActivityWarpper; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | |
| | | import java.util.Map; |
| | | |
| | | public interface IDriverService extends IService<Driver> { |
| | | |
| | | |
| | | /** |
| | | * 获取distance公里内空闲司机数量 |
| | | * @param type |
| | | * @param lon |
| | | * @param lat |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<Driver> queryIdleDriver(Integer type, Double lon, Double lat, Double distance, Integer companyId) throws Exception; |
| | | |
| | | /** |
| | | * 获取给定车型且空闲的司机 |
| | | * @param type |
| | | * @param serverCarModelId |
| | | * @param lon |
| | | * @param lat |
| | | * @param distance |
| | | * @param companyId |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<Driver> queryIdleDriver(Integer type, Integer serverCarModelId, Double lon, Double lat, Double distance, Integer companyId) throws Exception; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取短信验证码 |
| | |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil loginOut(Integer id) throws Exception; |
| | | |
| | | DriverIndexVo queryHomeDataFromDriver(Integer uid); |
| | | |
| | | DriverOrderDataVo queryOrderDataFromDriver(String time, Page<DriverOrderDataNextVo> driverOrderDataVoPage, Integer uid); |
| | | |
| | | DriverOrderMoneyDataVo queryOrderMoneyFromDriver(String time, Page<DriverOrderDataNextVo> driverOrderDataVoPage, Integer uid); |
| | | |
| | | |
| | | DriverOrderPromotionDataVo queryOrderPromotionFromDriver(String time, Page<DriverOrderDataNextVo> driverOrderDataVoPage, Integer uid); |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.system.model.PushOrder; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IPushOrderService extends IService<PushOrder> { |
| | | |
| | | |
| | | /** |
| | | * 获取推送配置数据 |
| | | * @param type |
| | | * @param pushType |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<PushOrder> querys(Integer type, Integer pushType, Integer companyId) throws Exception; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.system.model.TDriverPromotionActivity; |
| | | |
| | | /** |
| | | * <p> |
| | | * 司机推广活动主表 服务类 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2025-07-23 |
| | | */ |
| | | public interface TDriverPromotionActivityService extends IService<TDriverPromotionActivity> { |
| | | |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.common.constant.JwtConstants; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.shiro.ShiroUser; |
| | | import com.stylefeng.guns.core.util.JwtTokenUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.crossCity.dao.OrderCrossCityMapper; |
| | | import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity; |
| | | import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService; |
| | | import com.stylefeng.guns.modular.specialTrain.dao.OrderPrivateCarMapper; |
| | | import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; |
| | | import com.stylefeng.guns.modular.system.dao.*; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.model.vo.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.SMSUtil; |
| | |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import com.stylefeng.guns.modular.system.warpper.LoginWarpper; |
| | | import com.stylefeng.guns.modular.system.warpper.RegisteredWarpper; |
| | | import com.stylefeng.guns.modular.taxi.dao.OrderTaxiMapper; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | | import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; |
| | | import io.rong.models.response.TokenResult; |
| | | import org.apache.shiro.authc.SimpleAuthenticationInfo; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | |
| | | @Resource |
| | | private DriverMapper driverMapper; |
| | | |
| | | @Resource |
| | | private CompanyCityMapper companyCityMapper; |
| | | |
| | | @Resource |
| | | private UserActivityInviteMapper userActivityInviteMapper; |
| | |
| | | |
| | | @Resource |
| | | private RedisTemplate<String, Object> redisTemplate; |
| | | |
| | | @Autowired |
| | | private ALiSendSms aLiSendSms; |
| | | |
| | | @Autowired |
| | | private ICompanyCityService companyCityService; |
| | |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private OrderPrivateCarMapper orderPrivateCarMapper; |
| | | |
| | | @Autowired |
| | | private OrderCrossCityMapper orderCrossCityMapper; |
| | | |
| | | @Autowired |
| | | private OrderTaxiMapper orderTaxiMapper; |
| | | |
| | | @Autowired |
| | | private GeodesyUtil geodesyUtil; |
| | | |
| | | |
| | | @Override |
| | | public List<Driver> queryIdleDriver(Integer type, Double lon, Double lat, Double distance, Integer companyId) throws Exception { |
| | | List<Driver> drivers = driverMapper.queryIdleDriver(type, companyId); |
| | | List<Driver> list = new ArrayList<>(); |
| | | for(Driver driver : drivers){ |
| | | String value = (String) redisTemplate.opsForValue().get("DRIVER" + String.valueOf(driver.getId())); |
| | | if(null != value){ |
| | | Map<String, Double> distance1 = geodesyUtil.getDistance(lon + "," + lat, value); |
| | | double d = Double.valueOf(distance1.get("WGS84")).doubleValue(); |
| | | if(d < (distance * 1000)){ |
| | | list.add(driver); |
| | | } |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<Driver> queryIdleDriver(Integer type, Integer serverCarModelId, Double lon, Double lat, Double distance, Integer companyId) throws Exception { |
| | | List<Driver> drivers = driverMapper.queryIdleDriver_(type, serverCarModelId, companyId); |
| | | List<Driver> list = new ArrayList<>(); |
| | | for(Driver driver : drivers){ |
| | | String value = (String) redisTemplate.opsForValue().get("DRIVER" + String.valueOf(driver.getId())); |
| | | if(null != value){ |
| | | Map<String, Double> distance1 = geodesyUtil.getDistance(lon + "," + lat, value); |
| | | double d = Double.valueOf(distance1.get("WGS84")).doubleValue(); |
| | | if(d < (distance * 1000)){ |
| | | list.add(driver); |
| | | } |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 获取短信验证码 |
| | |
| | | } |
| | | Company company = companyMapper.selectById(driver.getCompanyId()); |
| | | //查询中台员工数据 |
| | | List<QYTUserInfo> userInfoByPhone = UserUtil.getUserInfoByPhone(driver.getPhone(), company.getEnterCode()); |
| | | if (null == userInfoByPhone || userInfoByPhone.size() == 0) { |
| | | return ResultUtil.error("账号未注册"); |
| | | } |
| | | // List<QYTUserInfo> userInfoByPhone = UserUtil.getUserInfoByPhone(driver.getPhone(), company.getEnterCode()); |
| | | // if (null == userInfoByPhone || userInfoByPhone.size() == 0) { |
| | | // return ResultUtil.error("账号未注册"); |
| | | // } |
| | | |
| | | if (ToolUtil.isNotEmpty(driver.getIdCard()) && driver.getAuthState() == 1) { |
| | | return ResultUtil.error("账号正在审核中,请耐心等待"); |
| | |
| | | redisTemplate.delete("DEVICE_" + id);//清除车载端登录的标识 |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public DriverIndexVo queryHomeDataFromDriver(Integer uid) { |
| | | DriverIndexVo driverIndexVo = new DriverIndexVo(); |
| | | // 获取快车订单 |
| | | List<OrderPrivateCar> orderPrivateCars = orderPrivateCarMapper.selectList(new EntityWrapper<OrderPrivateCar>().ne("state", 10).eq("driverId", uid).like("insertTime", LocalDateTime.now().toString())); |
| | | // 跨城订单 |
| | | List<OrderCrossCity> orderCrossCities = orderCrossCityMapper.selectList(new EntityWrapper<OrderCrossCity>().ne("state", 10).eq("driverId", uid).like("insertTime", LocalDateTime.now().toString())); |
| | | // 出租车订单 |
| | | List<OrderTaxi> orderTaxis = orderTaxiMapper.selectList(new EntityWrapper<OrderTaxi>().ne("state", 10).eq("driverId", uid).like("insertTime", LocalDateTime.now().toString())); |
| | | driverIndexVo.setTodayOrderNum(orderPrivateCars.size() + orderCrossCities.size() + orderTaxis.size()); |
| | | |
| | | |
| | | double sum = orderPrivateCars.stream().mapToDouble(OrderPrivateCar::getOrderMoney).sum(); |
| | | double sum1 = orderCrossCities.stream().mapToDouble(OrderCrossCity::getOrderMoney).sum(); |
| | | double sum2 = orderTaxis.stream().mapToDouble(OrderTaxi::getOrderMoney).sum(); |
| | | driverIndexVo.setTodayOrderMoney(new BigDecimal(sum +sum1+sum2)); |
| | | |
| | | |
| | | BigDecimal reduce = orderPrivateCarMapper.selectList(new EntityWrapper<OrderPrivateCar>().eq("promotionDriverId", uid).like("insertTime", LocalDateTime.now().toString())).stream().map(OrderPrivateCar::getPromotionMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal reduce1 = orderCrossCityMapper.selectList(new EntityWrapper<OrderCrossCity>().eq("promotionDriverId", uid).like("insertTime", LocalDateTime.now().toString())).stream().map(OrderCrossCity::getPromotionMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal reduce2 = orderTaxiMapper.selectList(new EntityWrapper<OrderTaxi>().eq("promotionDriverId", uid).like("insertTime", LocalDateTime.now().toString())).stream().map(OrderTaxi::getPromotionMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | driverIndexVo.setTodayPromotionMoney(reduce.add(reduce1).add(reduce2)); |
| | | return driverIndexVo; |
| | | }; |
| | | |
| | | |
| | | |
| | | @Override |
| | | public DriverOrderDataVo queryOrderDataFromDriver(String time, Page<DriverOrderDataNextVo> driverOrderDataVoPage, Integer uid) { |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("yyyy-MM"); |
| | | // 总的订单数 |
| | | List<OrderPrivateCar> orderPrivateCars = orderPrivateCarMapper.selectList(new EntityWrapper<OrderPrivateCar>().ne("state", 10).eq("driverId", uid)); |
| | | // 跨城订单 |
| | | List<OrderCrossCity> orderCrossCities = orderCrossCityMapper.selectList(new EntityWrapper<OrderCrossCity>().ne("state", 10).eq("driverId", uid)); |
| | | // 出租车订单 |
| | | List<OrderTaxi> orderTaxis = orderTaxiMapper.selectList(new EntityWrapper<OrderTaxi>().ne("state", 10).eq("driverId", uid)); |
| | | DriverOrderDataVo driverOrderDataVo = new DriverOrderDataVo(); |
| | | driverOrderDataVo.setAllOrderNum(orderPrivateCars.size() + orderCrossCities.size() + orderTaxis.size()); |
| | | long count = orderPrivateCars.stream().filter(e -> simpleDateFormat.format(e.getInsertTime()).equals(LocalDateTime.now().toString())).count(); |
| | | long count1 = orderCrossCities.stream().filter(e -> simpleDateFormat.format(e.getInsertTime()).equals(LocalDateTime.now().toString())).count(); |
| | | long count2 = orderTaxis.stream().filter(e -> simpleDateFormat.format(e.getInsertTime()).equals(LocalDateTime.now().toString())).count(); |
| | | driverOrderDataVo.setTodayOrderNum((int) (count+count1+count2)); |
| | | |
| | | Date date = new Date(); |
| | | String month = simpleDateFormat1.format(date); |
| | | long count3 = orderPrivateCars.stream().filter(e -> simpleDateFormat1.format(e.getInsertTime()).equals(month)).count(); |
| | | long count4 = orderCrossCities.stream().filter(e -> simpleDateFormat1.format(e.getInsertTime()).equals(month)).count(); |
| | | long count5 = orderTaxis.stream().filter(e -> simpleDateFormat1.format(e.getInsertTime()).equals(month)).count(); |
| | | driverOrderDataVo.setMonthOrderNum((int) (count3+count4+count5)); |
| | | |
| | | String sTime=null; |
| | | String eTime=null; |
| | | if(ToolUtil.isNotEmpty( time)){ |
| | | sTime=time.split(" - ")[0]+" 00:00:00"; |
| | | eTime=time.split(" - ")[1]+" 23:59:59"; |
| | | } |
| | | List<DriverOrderDataNextVo> driverOrderDataNextVoPage = driverServiceMapper.queryOrderDataFromDriver(sTime, eTime, driverOrderDataVoPage, uid); |
| | | driverOrderDataVoPage.setRecords(driverOrderDataNextVoPage); |
| | | driverOrderDataVo.setDriverOrderDataNextVos(driverOrderDataVoPage); |
| | | return driverOrderDataVo; |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public DriverOrderMoneyDataVo queryOrderMoneyFromDriver(String time, Page<DriverOrderDataNextVo> driverOrderDataVoPage, Integer uid) { |
| | | DriverOrderMoneyDataVo driverOrderDataVo = new DriverOrderMoneyDataVo(); |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("yyyy-MM"); |
| | | // 总的订单数 |
| | | List<OrderPrivateCar> orderPrivateCars = orderPrivateCarMapper.selectList(new EntityWrapper<OrderPrivateCar>().in("state",Arrays.asList(8,9)).eq("driverId", uid)); |
| | | // 跨城订单 |
| | | List<OrderCrossCity> orderCrossCities = orderCrossCityMapper.selectList(new EntityWrapper<OrderCrossCity>().in("state",Arrays.asList(8,9)).eq("driverId", uid)); |
| | | // 出租车订单 |
| | | List<OrderTaxi> orderTaxis = orderTaxiMapper.selectList(new EntityWrapper<OrderTaxi>().in("state",Arrays.asList(8,9)).eq("driverId", uid)); |
| | | |
| | | |
| | | double sum = orderPrivateCars.stream().mapToDouble(OrderPrivateCar::getOrderMoney).sum(); |
| | | double sum1 = orderCrossCities.stream().mapToDouble(OrderCrossCity::getOrderMoney).sum(); |
| | | double sum2 = orderTaxis.stream().mapToDouble(OrderTaxi::getOrderMoney).sum(); |
| | | driverOrderDataVo.setAllOrderMoney(new BigDecimal(sum +sum1+sum2)); |
| | | |
| | | |
| | | |
| | | double count = orderPrivateCars.stream().filter(e -> simpleDateFormat.format(e.getInsertTime()).equals(LocalDateTime.now().toString())).mapToDouble(OrderPrivateCar::getOrderMoney).sum(); |
| | | double count1 = orderCrossCities.stream().filter(e -> simpleDateFormat.format(e.getInsertTime()).equals(LocalDateTime.now().toString())).mapToDouble(OrderCrossCity::getOrderMoney).sum(); |
| | | double count2 = orderTaxis.stream().filter(e -> simpleDateFormat.format(e.getInsertTime()).equals(LocalDateTime.now().toString())).mapToDouble(OrderTaxi::getOrderMoney).sum(); |
| | | driverOrderDataVo.setTodayOrderMoney(new BigDecimal(count+count1+count2)); |
| | | |
| | | |
| | | Date date = new Date(); |
| | | String month = simpleDateFormat1.format(date); |
| | | double count3 = orderPrivateCars.stream().filter(e -> simpleDateFormat1.format(e.getInsertTime()).equals(month)).mapToDouble(OrderPrivateCar::getOrderMoney).sum(); |
| | | double count4 = orderCrossCities.stream().filter(e -> simpleDateFormat1.format(e.getInsertTime()).equals(month)).mapToDouble(OrderCrossCity::getOrderMoney).sum(); |
| | | double count5 = orderTaxis.stream().filter(e -> simpleDateFormat1.format(e.getInsertTime()).equals(month)).mapToDouble(OrderTaxi::getOrderMoney).sum(); |
| | | driverOrderDataVo.setMonthOrderMoney(new BigDecimal(count3+count4+count5)); |
| | | |
| | | String sTime=null; |
| | | String eTime=null; |
| | | if(ToolUtil.isNotEmpty( time)){ |
| | | sTime=time.split(" - ")[0]+" 00:00:00"; |
| | | eTime=time.split(" - ")[1]+" 23:59:59"; |
| | | } |
| | | List<DriverOrderDataNextVo> driverOrderDataNextVoPage = driverServiceMapper.queryOrderMoneyDataFromDriver(sTime, eTime, driverOrderDataVoPage, uid); |
| | | List<DriverOrderDataNextVo> driverOrderDataNextVoPage1 = driverServiceMapper.queryOrderMoneyDataFromDriverAll(sTime, eTime, uid); |
| | | double sum3 = driverOrderDataNextVoPage1.stream().mapToDouble(DriverOrderDataNextVo::getOrderMoney).sum(); |
| | | driverOrderDataVo.setSearchMoney(new BigDecimal(sum3)); |
| | | driverOrderDataVoPage.setRecords(driverOrderDataNextVoPage); |
| | | driverOrderDataVo.setDriverOrderDataNextVos(driverOrderDataVoPage); |
| | | return driverOrderDataVo; |
| | | } |
| | | @Override |
| | | public DriverOrderPromotionDataVo queryOrderPromotionFromDriver(String time, Page<DriverOrderDataNextVo> driverOrderDataVoPage, Integer uid) { |
| | | DriverOrderPromotionDataVo driverOrderDataVo = new DriverOrderPromotionDataVo(); |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("yyyy-MM"); |
| | | // 总的订单数 |
| | | List<OrderPrivateCar> orderPrivateCars = orderPrivateCarMapper.selectList(new EntityWrapper<OrderPrivateCar>().in("state",Arrays.asList(8,9)).eq("promotionDriverId", uid)); |
| | | // 跨城订单 |
| | | List<OrderCrossCity> orderCrossCities = orderCrossCityMapper.selectList(new EntityWrapper<OrderCrossCity>().in("state",Arrays.asList(8,9)).eq("promotionDriverId", uid)); |
| | | // 出租车订单 |
| | | List<OrderTaxi> orderTaxis = orderTaxiMapper.selectList(new EntityWrapper<OrderTaxi>().in("state",Arrays.asList(8,9)).eq("promotionDriverId", uid)); |
| | | |
| | | |
| | | BigDecimal sum = orderPrivateCars.stream().map(OrderPrivateCar::getPromotionMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal sum1 = orderCrossCities.stream().map(OrderCrossCity::getPromotionMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal sum2 = orderTaxis.stream().map(OrderTaxi::getPromotionMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | driverOrderDataVo.setAllOrderMoney(sum.add(sum1).add(sum2)); |
| | | |
| | | |
| | | |
| | | BigDecimal count = orderPrivateCars.stream().filter(e -> simpleDateFormat.format(e.getInsertTime()).equals(LocalDateTime.now().toString())).map(OrderPrivateCar::getPromotionMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count1 = orderCrossCities.stream().filter(e -> simpleDateFormat.format(e.getInsertTime()).equals(LocalDateTime.now().toString())).map(OrderCrossCity::getPromotionMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count2 = orderTaxis.stream().filter(e -> simpleDateFormat.format(e.getInsertTime()).equals(LocalDateTime.now().toString())).map(OrderTaxi::getPromotionMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | driverOrderDataVo.setTodayOrderMoney(count.add(count1).add(count2)); |
| | | |
| | | |
| | | Date date = new Date(); |
| | | String month = simpleDateFormat1.format(date); |
| | | BigDecimal count3 = orderPrivateCars.stream().filter(e -> simpleDateFormat1.format(e.getInsertTime()).equals(month)).map(OrderPrivateCar::getPromotionMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count4 = orderCrossCities.stream().filter(e -> simpleDateFormat1.format(e.getInsertTime()).equals(month)).map(OrderCrossCity::getPromotionMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count5 = orderTaxis.stream().filter(e -> simpleDateFormat1.format(e.getInsertTime()).equals(month)).map(OrderTaxi::getPromotionMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | driverOrderDataVo.setMonthOrderMoney(count3.add(count4).add(count5)); |
| | | |
| | | String sTime=null; |
| | | String eTime=null; |
| | | if(ToolUtil.isNotEmpty( time)){ |
| | | sTime=time.split(" - ")[0]+" 00:00:00"; |
| | | eTime=time.split(" - ")[1]+" 23:59:59"; |
| | | } |
| | | List<DriverOrderDataNextVo> driverOrderDataNextVoPage = driverServiceMapper.queryOrderPromotionFromDriver(sTime, eTime, driverOrderDataVoPage, uid); |
| | | List<DriverOrderDataNextVo> driverOrderDataNextVoPage1 =driverServiceMapper.queryOrderPromotionFromDriverAll(sTime, eTime, uid); |
| | | double sum3 = driverOrderDataNextVoPage1.stream().mapToDouble(DriverOrderDataNextVo::getOrderMoney).sum(); |
| | | driverOrderDataVo.setSearchMoney(new BigDecimal(sum3)); |
| | | |
| | | driverOrderDataVoPage.setRecords(driverOrderDataNextVoPage); |
| | | driverOrderDataVo.setDriverOrderDataNextVos(driverOrderDataVoPage); |
| | | return driverOrderDataVo; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 单点登录 |
| | | * |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.dao.PushOrderMapper; |
| | | import com.stylefeng.guns.modular.system.model.PushOrder; |
| | | import com.stylefeng.guns.modular.system.service.IPushOrderService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | |
| | | @Service |
| | | public class PushOrderServiceImpl extends ServiceImpl<PushOrderMapper, PushOrder> implements IPushOrderService { |
| | | |
| | | @Resource |
| | | private PushOrderMapper pushOrderMapper; |
| | | |
| | | |
| | | /** |
| | | * 获取推送配置 |
| | | * @param type |
| | | * @param pushType |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<PushOrder> querys(Integer type, Integer pushType, Integer companyId) throws Exception { |
| | | return pushOrderMapper.querys(type, pushType, companyId); |
| | | } |
| | | } |
| | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | | @Service |
| | |
| | | |
| | | //添加已收入明细 |
| | | incomeService.saveData(1, orderPrivateCar.getCompanyId(), 4, orderPrivateCar.getId(), 1, reassign.getMoney()); |
| | | // qyt 改派直接推送 |
| | | pushOrderPrivate(orderPrivateCar,uid); |
| | | break; |
| | | case 2: |
| | | OrderTaxi orderTaxi = orderTaxiService.selectById(reassign.getOrderId()); |
| | |
| | | |
| | | //添加已收入明细 |
| | | incomeService.saveData(1, orderTaxi.getCompanyId(), 4, orderTaxi.getId(), 2, reassign.getMoney()); |
| | | |
| | | // qyt 改派直接推送 |
| | | pushOrderTaxi(orderTaxi,uid); |
| | | break; |
| | | case 4: |
| | | OrderLogistics orderLogistics = orderLogisticsService.selectById(reassign.getOrderId()); |
| | |
| | | // jgPushUtil.push(2,"有新的改派订单需要处理,请及时处理!", "订单改派", map, "DISPATCH" + dispatch.getId()); |
| | | // } |
| | | |
| | | // qyt 改派直接推送 |
| | | pushOrder(); |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | @Autowired |
| | | private IPushOrderService pushOrderService; |
| | | |
| | | @Autowired |
| | | private PushUtil pushUtil; |
| | | |
| | | /** |
| | | * 推送订单给司机抢单 |
| | | * @param orderTaxi |
| | | * @throws Exception |
| | | */ |
| | | public void pushOrder(OrderTaxi orderTaxi, Integer type) throws Exception{ |
| | | public void pushOrderTaxi(OrderTaxi orderTaxi, Integer uid) throws Exception{ |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | |
| | | } |
| | | Company query = companyCityService.query(String.valueOf(orderTaxi.getStartLon()), String.valueOf(orderTaxi.getStartLat()));//获取起点所属分公司 |
| | | List<PushOrder> querys = pushOrderService.querys(null, 2, query.getId());//获取需要推送的次数 |
| | | for (int i = 1; i <= querys.size(); i++) { |
| | | for (int i = 1; i <=6; i++) { |
| | | PushOrder pushOrder = pushOrderService.querys(i, 2, query.getId()).get(0); |
| | | System.out.println("pushOrder:" + pushOrder); |
| | | //获取空闲司机 |
| | | List<Driver> list = driverService.queryIdleDriver(2, orderTaxi.getStartLon(), orderTaxi.getStartLat(), pushOrder.getPushDistance(), null);//所有附近空闲司机 |
| | | list = list.stream().filter(e->e.getId()!=uid).collect(Collectors.toList()); |
| | | if (list.size() > 0) { |
| | | double driverProportion = pushOrder.getDriverProportion() / 100;//推送占比计算成小数 |
| | | int lastIndex = Double.valueOf(list.size() * driverProportion).intValue();//计算占比转成整数(下标截取) |
| | |
| | | } |
| | | } |
| | | Thread.sleep(pushOrder.getPushTime() * 1000);//设置等待时间 |
| | | OrderTaxi orderTaxi1 = OrderTaxiServiceImpl.this.selectById(orderTaxi.getId()); |
| | | OrderTaxi orderTaxi1 = orderTaxiService.selectById(orderTaxi.getId()); |
| | | Integer state = orderTaxi1.getState(); |
| | | if (state != 1) { |
| | | break; |
| | | } |
| | | if (i == querys.size() && state == 1) { |
| | | pushUtil.pushEndPush(1, orderTaxi.getUserId(), orderTaxi.getId(), 2); |
| | | orderTaxi1.setState(10); |
| | | orderTaxiService.updateById(orderTaxi1); |
| | | orderIds.remove(orderTaxi.getId()); |
| | | } |
| | | } |
| | |
| | | } |
| | | }).start(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 推送抢单数据 |
| | | * @param orderPrivateCar |
| | | * @throws Exception |
| | | */ |
| | | public void pushOrderPrivate(OrderPrivateCar orderPrivateCar,Integer uid) throws Exception{ |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | try { |
| | | Integer id = orderPrivateCar.getId(); |
| | | Integer orderType = orderPrivateCar.getRideType()==1?1:orderPrivateCar.getRideType()==2?9:8; |
| | | orderIds.add(orderPrivateCar.getId());//添加记录,防止调用接口重复提醒无人接单 |
| | | String vehicle = (String) redisTemplate.opsForValue().get("VEHICLE"); |
| | | List<Integer> integers = new ArrayList<>(); |
| | | if(ToolUtil.isNotEmpty(vehicle)){ |
| | | integers = JSON.parseArray(vehicle).toJavaList(Integer.class); |
| | | } |
| | | Company query = companyCityService.query(String.valueOf(orderPrivateCar.getStartLon()), String.valueOf(orderPrivateCar.getStartLat()));//获取起点所属分公司 |
| | | List<PushOrder> querys = pushOrderService.querys(null, 1, query.getId());//获取需要推送的次数 |
| | | for(int i = 1; i <= 6; i++){ |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(id); |
| | | if (null == orderPrivateCar || orderPrivateCar.getState() > 1) { |
| | | break; |
| | | } |
| | | PushOrder pushOrder = pushOrderService.querys(i, 1, query.getId()).get(0); |
| | | System.out.println("pushOrder:"+pushOrder); |
| | | int i2 = pushOrder.getPushTime() / 10; |
| | | if(i2==0){ |
| | | i2=1; |
| | | } |
| | | for (int i1 = 0; i1 < i2 ; i1++) { |
| | | if (orderPrivateCar.getState() > 1) { |
| | | break; |
| | | } |
| | | //获取空闲司机 |
| | | List<Driver> list = driverService.queryIdleDriver(orderType, orderPrivateCar.getServerCarModelId(), orderPrivateCar.getStartLon(), orderPrivateCar.getStartLat(), pushOrder.getPushDistance(), null);//所有附近空闲司机 |
| | | list = list.stream().filter(e->e.getId()!=uid).collect(Collectors.toList()); |
| | | if (list.size() > 0) { |
| | | double driverProportion = pushOrder.getDriverProportion() / 100;//推送占比计算成小数 |
| | | int lastIndex = Double.valueOf(list.size() * driverProportion).intValue();//计算占比转成整数(下标截取) |
| | | lastIndex = lastIndex == 0 ? list.size() : lastIndex; |
| | | list = list.subList(0, lastIndex);//获取空闲司机中占比数据 |
| | | for (Driver driver : list) {//开始进行推送 |
| | | boolean bo = false; |
| | | for (Integer integer : integers) { |
| | | if (integer.compareTo(driver.getId()) == 0) { |
| | | bo = true; |
| | | break; |
| | | } |
| | | } |
| | | if (bo) { |
| | | continue; |
| | | } |
| | | pushUtil.pushOrderState(2, driver.getId(), orderPrivateCar.getId(), 1, orderPrivateCar.getState(), pushOrder.getPushTime()); |
| | | } |
| | | } |
| | | Thread.sleep(10000);//设置等待时间 |
| | | Integer state = orderPrivateCar.getState(); |
| | | if (state > 1) { |
| | | orderIds.remove(orderPrivateCar.getId()); |
| | | return; |
| | | } |
| | | if (i == querys.size() && state == 1) { |
| | | pushUtil.pushEndPush(1, orderPrivateCar.getUserId(), orderPrivateCar.getId(), 1); |
| | | orderPrivateCar.setState(10); |
| | | orderPrivateCarService.updateById(orderPrivateCar); |
| | | orderIds.remove(orderPrivateCar.getId()); |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | }).start(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.dao.TDriverPromotionActivityMapper; |
| | | import com.stylefeng.guns.modular.system.model.TDriverPromotionActivity; |
| | | import com.stylefeng.guns.modular.system.service.TDriverPromotionActivityService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 司机推广活动主表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2025-07-23 |
| | | */ |
| | | @Service |
| | | public class TDriverPromotionActivityServiceImpl extends ServiceImpl<TDriverPromotionActivityMapper, TDriverPromotionActivity> implements TDriverPromotionActivityService { |
| | | |
| | | } |
| | |
| | | private Map<String, Timer> taskMap = new HashMap<>();//存储定时推送的定时器 |
| | | |
| | | private final String socket_uri = "http://172.21.35.142:6000"; |
| | | |
| | | |
| | | |
| | | |
| | | // qyt 改派重新推单 |
| | | public void pushOrderState(Integer type, Integer uid, Integer orderId, Integer orderType, Integer state, Integer time) { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("code", 200); |
| | | jsonObject.put("msg", "SUCCESS"); |
| | | jsonObject.put("method", "ORDER_STATUS"); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("orderId", orderId); |
| | | map.put("orderType", orderType); |
| | | map.put("time", time); |
| | | if (orderType == 1 && state == 100) { |
| | | map.put("carpooling", 1); |
| | | map.put("state", 2); |
| | | } else { |
| | | map.put("state", state); |
| | | } |
| | | jsonObject.put("data", map); |
| | | |
| | | //调用推送 |
| | | HttpRequest post = HttpUtil.createPost(socket_uri + "/netty/sendMsgToClient"); |
| | | post.header("Content-Type", MediaType.APPLICATION_FORM_URLENCODED_VALUE); |
| | | //将请求头部和参数合成一个请求 |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("msg", jsonObject.toJSONString()); |
| | | params.put("id", uid); |
| | | params.put("type", type); |
| | | post.form(params); |
| | | HttpResponse execute = post.execute(); |
| | | if (200 != execute.getStatus()) { |
| | | System.err.println("推送异常"); |
| | | } else { |
| | | JSONObject jsonObject1 = JSON.parseObject(execute.body(), JSONObject.class); |
| | | if (jsonObject1.getIntValue("code") != 200) { |
| | | System.err.println(jsonObject1.getString("msg")); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 推单完成后,没有司机接单的推送提醒 qyt |
| | | * |
| | | * @param type |
| | | * @param uid |
| | | * @param orderId |
| | | * @param orderType |
| | | */ |
| | | public void pushEndPush(Integer type, Integer uid, Integer orderId, Integer orderType) { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("code", 200); |
| | | jsonObject.put("msg", "SUCCESS"); |
| | | jsonObject.put("method", "END_PUSH"); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("orderId", orderId); |
| | | map.put("orderType", orderType); |
| | | jsonObject.put("data", map); |
| | | |
| | | //调用推送 |
| | | HttpRequest post = HttpUtil.createPost(socket_uri + "/netty/sendMsgToClient"); |
| | | post.header("Content-Type", MediaType.APPLICATION_FORM_URLENCODED_VALUE); |
| | | //将请求头部和参数合成一个请求 |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("msg", jsonObject.toJSONString()); |
| | | params.put("id", uid); |
| | | params.put("type", type); |
| | | post.form(params); |
| | | HttpResponse execute = post.execute(); |
| | | if (200 != execute.getStatus()) { |
| | | System.err.println("推送异常"); |
| | | } else { |
| | | JSONObject jsonObject1 = JSON.parseObject(execute.body(), JSONObject.class); |
| | | if (jsonObject1.getIntValue("code") != 200) { |
| | | System.err.println(jsonObject1.getString("msg")); |
| | | } |
| | | } |
| | | } |
| | | /** |
| | | * 推送订单状态 |
| | | * |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.qianyuntong; |
| | | |
| | | import com.heredata.hos.HOS; |
| | | import com.heredata.hos.HOSClientBuilder; |
| | | import com.heredata.hos.model.CreateBucketRequest; |
| | | import com.heredata.hos.model.HOSObject; |
| | | import com.heredata.hos.model.PutObjectRequest; |
| | | import com.heredata.hos.model.PutObjectResult; |
| | | import com.heredata.hos.model.bucket.Bucket; |
| | | import com.heredata.model.VoidResult; |
| | | import com.stylefeng.guns.modular.system.util.SpringContextsUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.io.InputStream; |
| | | |
| | | /** |
| | | * OSS 工具类 |
| | | * @author zhibing.pu |
| | | * @Date 2025/6/23 17:50 |
| | | */ |
| | | @Slf4j |
| | | public class NCOSSUtil { |
| | | |
| | | private static QianYunTongConfig qianYunTongConfig = SpringContextsUtil.getBean(QianYunTongConfig.class).getQianYunTongConfig();; |
| | | |
| | | /** |
| | | * 创建桶 |
| | | * @param bucketName |
| | | * @return |
| | | */ |
| | | public static Boolean createBucket(String bucketName) { |
| | | /** |
| | | * endPoint:HOS的基础路径(公共前缀) |
| | | * account:账户的ID |
| | | * accessKey:向UAAS服务请求到的access_key |
| | | * secretKey:向UAAS服务请求到的secret_key |
| | | */ |
| | | HOS hos = new HOSClientBuilder().build(qianYunTongConfig.getEndPoint(), qianYunTongConfig.getAccount(), qianYunTongConfig.getAccessKey(), qianYunTongConfig.getSecretKey()); |
| | | try { |
| | | // 创建请求对象,并且设置创建桶名为"example"的桶 |
| | | CreateBucketRequest createBucketRequest = new CreateBucketRequest(bucketName); |
| | | VoidResult result = hos.createBucket(createBucketRequest); |
| | | if (result.getResponse().isSuccessful()) { |
| | | log.info("创建桶成功:" + bucketName); |
| | | return true; |
| | | } |
| | | } catch (Exception e){ |
| | | log.info("创建桶失败:" + bucketName); |
| | | e.printStackTrace(); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询桶详情 |
| | | * @param bucketName |
| | | * @return |
| | | */ |
| | | public static Bucket getBucketInfo(String bucketName) { |
| | | /** |
| | | * endPoint:HOS的基础路径(公共前缀) |
| | | * account:账户的ID |
| | | * accessKey:向UAAS服务请求到的access_key |
| | | * secretKey:向UAAS服务请求到的secret_key |
| | | */ |
| | | HOS hos = new HOSClientBuilder().build(qianYunTongConfig.getEndPoint(), qianYunTongConfig.getAccount(), qianYunTongConfig.getAccessKey(), qianYunTongConfig.getSecretKey()); |
| | | try { |
| | | // 查询桶名为"example"的详情 |
| | | Bucket bucket = hos.getBucketInfo(bucketName); |
| | | return bucket; |
| | | } catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除桶 |
| | | * @param bucketName |
| | | * @return |
| | | */ |
| | | public static Boolean deleteBucket(String bucketName) { |
| | | /** |
| | | * endPoint:HOS的基础路径(公共前缀) |
| | | * account:账户的ID |
| | | * accessKey:向UAAS服务请求到的access_key |
| | | * secretKey:向UAAS服务请求到的secret_key |
| | | */ |
| | | HOS hos = new HOSClientBuilder().build(qianYunTongConfig.getEndPoint(), qianYunTongConfig.getAccount(), qianYunTongConfig.getAccessKey(), qianYunTongConfig.getSecretKey()); |
| | | try { |
| | | VoidResult result = hos.deleteBucket(bucketName); |
| | | if (result.getResponse().isSuccessful()) { |
| | | log.info("删除桶成功:" + bucketName); |
| | | return true; |
| | | } |
| | | } catch (Exception e){ |
| | | log.info("删除桶成功:" + bucketName); |
| | | e.printStackTrace(); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 设置桶策略 |
| | | * @param bucketName 桶名 |
| | | * @param policyText 策略规则字符串 |
| | | * { |
| | | * // 策略配置的版本号,由用户定义 |
| | | * "Version": "2012-10-17", |
| | | * // 策略规则配置,可指定多条策略规则 |
| | | * "Statement": [{ |
| | | * // 策略规则ID,可用户指定,如不指定则服务自动生成一条 |
| | | * "Sid": "sid", |
| | | * // 策略规则指定的HOS API接口标识,可参照下表填写 |
| | | * "Action": [ |
| | | * "action" |
| | | * ], |
| | | * // 策略规则效果,具体表现为允许或拒绝,有效值为Allow(允许),Deny(拒绝); |
| | | * "Effect": "Allow", |
| | | * // 策略规则指定的资源参照下面resource配置 |
| | | * "Resource": "resource", |
| | | * // 策略规则指定的授权人 参照下面Principal配置 |
| | | * "Principal": { |
| | | * "HWS": [ |
| | | * "account_id:root" |
| | | * ] |
| | | * } |
| | | * } |
| | | * ] |
| | | * } |
| | | * @return |
| | | */ |
| | | public static Boolean setBucketPolicy(String bucketName, String policyText) { |
| | | /** |
| | | * endPoint:HOS的基础路径(公共前缀) |
| | | * account:账户的ID |
| | | * accessKey:向UAAS服务请求到的access_key |
| | | * secretKey:向UAAS服务请求到的secret_key |
| | | */ |
| | | HOS hos = new HOSClientBuilder().build(qianYunTongConfig.getEndPoint(), qianYunTongConfig.getAccount(), qianYunTongConfig.getAccessKey(), qianYunTongConfig.getSecretKey()); |
| | | // 桶策略字符串 |
| | | try { |
| | | VoidResult result = hos.setBucketPolicy(bucketName, policyText); |
| | | if (result.getResponse().isSuccessful()) { |
| | | log.info("设置桶策略成功:" + bucketName); |
| | | return true; |
| | | } |
| | | } catch (Exception e) { |
| | | log.info("设置桶策略失败:" + bucketName); |
| | | e.printStackTrace(); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 上传对象 |
| | | * @param bucketName 桶名称 |
| | | * @param key 存储文件名 |
| | | * @param inputStream 上传文件流 |
| | | * @return 对象唯一标识 |
| | | */ |
| | | public static String putObject(String bucketName, String key, InputStream inputStream) { |
| | | /** |
| | | * endPoint:HOS的基础路径(公共前缀) |
| | | * account:账户的ID |
| | | * accessKey:向UAAS服务请求到的access_key |
| | | * secretKey:向UAAS服务请求到的secret_key |
| | | */ |
| | | HOS hos = new HOSClientBuilder().build(qianYunTongConfig.getEndPoint(), qianYunTongConfig.getAccount(), qianYunTongConfig.getAccessKey(), qianYunTongConfig.getSecretKey()); |
| | | try { |
| | | PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, key , inputStream); |
| | | PutObjectResult example = hos.putObject(putObjectRequest); |
| | | if (example.getResponse().isSuccessful()) { |
| | | log.info("上传对象成功:" + bucketName + "--->" + key); |
| | | return example.getETag(); |
| | | } |
| | | } catch (Exception e) { |
| | | log.info("上传对象成功:" + bucketName); |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询对象 |
| | | * @param bucketName 桶名称 |
| | | * @param key 存储文件名 |
| | | * @return |
| | | */ |
| | | public static HOSObject getObject(String bucketName, String key) { |
| | | /** |
| | | * endPoint:HOS的基础路径(公共前缀) |
| | | * account:账户的ID |
| | | * accessKey:向UAAS服务请求到的access_key |
| | | * secretKey:向UAAS服务请求到的secret_key |
| | | */ |
| | | HOS hos = new HOSClientBuilder().build(qianYunTongConfig.getEndPoint(), qianYunTongConfig.getAccount(), qianYunTongConfig.getAccessKey(), qianYunTongConfig.getSecretKey()); |
| | | try { |
| | | HOSObject example = hos.getObject(bucketName, key); |
| | | if (example.getResponse().isSuccessful()) { |
| | | log.info("查询对象成功:" + bucketName + "--->" + key); |
| | | return example; |
| | | } |
| | | } catch (Exception e) { |
| | | log.info("查询对象失败:" + bucketName); |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除对象 |
| | | * @param bucketName 桶名称 |
| | | * @param key 存储文件名 |
| | | * @return |
| | | */ |
| | | public static Boolean deleteObject(String bucketName, String key) { |
| | | /** |
| | | * endPoint:HOS的基础路径(公共前缀) |
| | | * account:账户的ID |
| | | * accessKey:向UAAS服务请求到的access_key |
| | | * secretKey:向UAAS服务请求到的secret_key |
| | | */ |
| | | HOS hos = new HOSClientBuilder().build(qianYunTongConfig.getEndPoint(), qianYunTongConfig.getAccount(), qianYunTongConfig.getAccessKey(), qianYunTongConfig.getSecretKey()); |
| | | try { |
| | | VoidResult example = hos.deleteObject(bucketName, key); |
| | | if (example.getResponse().isSuccessful()) { |
| | | log.info("删除对象成功:" + bucketName + "--->" + key); |
| | | return true; |
| | | } |
| | | } catch (Exception e) { |
| | | log.info("删除对象失败:" + bucketName + "--->" + key); |
| | | e.printStackTrace(); |
| | | } |
| | | return false; |
| | | } |
| | | } |
| | |
| | | public QianYunTongConfig getQianYunTongConfig() { |
| | | if("dev".equals(activeProfile)){ |
| | | this.appkey = "10001104"; |
| | | this.privateKeyPath = "C:\\Users\\39373\\Desktop\\黔云通\\private_key_test.pem"; |
| | | this.privateKeyPath = "C:\\Users\\Admin\\Desktop\\private_key_test.pem"; |
| | | this.userName = "xiaofei"; |
| | | this.status = "1"; |
| | | this.setApiUrl("https://test-zhongtai.stqcloud.com:10070"); |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.rongyun; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.util.rongyun.model.CloudRecordingCallback; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.*; |
| | | import java.net.*; |
| | | import java.security.MessageDigest; |
| | | |
| | | /** |
| | | * 融云及时通讯工具类 |
| | | */ |
| | | @Component |
| | | public class RongYunUtil { |
| | | |
| | | @Value("${rongyun.app_key}") |
| | | private String app_key; |
| | | |
| | | @Value("${rongyun.app_secret}") |
| | | private String app_secret; |
| | | |
| | | |
| | | /** |
| | | * 注册获取token |
| | | * @param userId |
| | | * @param name |
| | | * @param headUrl |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public String getToken(String userId, String name, String headUrl) throws Exception { |
| | | String url = "http://api-cn.ronghub.com/user/getToken.json"; |
| | | String data = "userId=" + userId + "&name=" + name + "&portraitUri=" + headUrl; |
| | | String s = this.pushHttp(url, data); |
| | | return s; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 刷新用户信息 |
| | | * @param userId |
| | | * @param name |
| | | * @param headUrl |
| | | * @throws Exception |
| | | */ |
| | | public void refresh(String userId, String name, String headUrl) throws Exception { |
| | | String url = "http://api-cn.ronghub.com/user/refresh.json"; |
| | | String data = "userId=" + userId + "&name=" + name + "&portraitUri=" + headUrl; |
| | | String s = this.pushHttp(url, data); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 检查用户在线状态 |
| | | * @param userId |
| | | * @return 1:在线,0:离线 |
| | | * @throws Exception |
| | | */ |
| | | public Integer checkOnline(String userId) throws Exception { |
| | | String url = "http://api-cn.ronghub.com/user/checkOnline.json"; |
| | | String data = "userId=" + userId; |
| | | String s = this.pushHttp(url, data); |
| | | JSONObject jsonObject = JSON.parseObject(s); |
| | | if(jsonObject.getIntValue("code") == 200){ |
| | | return jsonObject.getIntValue("status"); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 发送普通消息 |
| | | * @param fromUserId |
| | | * @param toUserId |
| | | * @param objectName |
| | | * @param content |
| | | * @return |
| | | */ |
| | | public String sendSms(String fromUserId, String toUserId, String objectName, String content){ |
| | | try { |
| | | String url = "https://api-cn.ronghub.com/message/private/publish.json"; |
| | | String data = "fromUserId=" + URLEncoder.encode(fromUserId, "UTF-8") + "&toUserId=" + URLEncoder.encode(toUserId, "UTF-8") + "&objectName=" + |
| | | URLEncoder.encode(objectName, "UTF-8") + "&content=" + URLEncoder.encode(content, "UTF-8") + "&disablePush=0&isIncludeSender=1"; |
| | | String s = this.pushHttp(url, data); |
| | | return s; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 创建 IM 聊天室 |
| | | * @param id 房间id长度不超过 64 字节 |
| | | * @param name 聊天室名称 |
| | | * @return |
| | | */ |
| | | public Integer ChatRoomCreate(String id, String name){ |
| | | String url = "https://api-cn.ronghub.com/chatroom/create.json"; |
| | | String data = "chatroom[" + id + "]=" + name; |
| | | String s = this.pushHttp(url, data); |
| | | JSONObject jsonObject = JSON.parseObject(s); |
| | | if(jsonObject.getIntValue("code") == 200){ |
| | | return jsonObject.getIntValue("status"); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 销毁聊天室 |
| | | * @param chatroomId 聊天室id |
| | | * @return |
| | | */ |
| | | public Integer ChatRoomDestroy(String chatroomId){ |
| | | String url = "https://api-cn.ronghub.com/chatroom/destroy.json"; |
| | | String data = "chatroomId=" + chatroomId; |
| | | String s = this.pushHttp(url, data); |
| | | JSONObject jsonObject = JSON.parseObject(s); |
| | | if(jsonObject.getIntValue("code") == 200){ |
| | | return jsonObject.getIntValue("status"); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 聊天室发送文本消息 |
| | | * @param userId 发送用户id |
| | | * @param chatroomId 聊天室id |
| | | * @param content 消息文本内容 |
| | | * @return |
| | | */ |
| | | public Integer ChatRoomPushTxtMessage(String userId, String chatroomId, String content){ |
| | | String url = "https://api-cn.ronghub.com/chatroom/destroy.json"; |
| | | String data = "fromUserId=" + userId + "&toChatroomId=" + chatroomId + "&objectName=RC:TxtMsg&content=" + content; |
| | | String s = this.pushHttp(url, data); |
| | | JSONObject jsonObject = JSON.parseObject(s); |
| | | if(jsonObject.getIntValue("code") == 200){ |
| | | return jsonObject.getIntValue("status"); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 请求接口 |
| | | * @param path |
| | | * @param json |
| | | * @return |
| | | */ |
| | | public String pushHttp(String path, String json){ |
| | | String nonce = String.valueOf(Double.valueOf(Math.random() * 1000000.0D).intValue()); |
| | | String timeMillis = String.valueOf(System.currentTimeMillis() / 1000); |
| | | String signature = getSha1(app_secret + nonce + timeMillis); |
| | | |
| | | URL url = null; |
| | | try { |
| | | url = new URL(path); |
| | | HttpURLConnection connection = (HttpURLConnection)url.openConnection(); |
| | | connection.setRequestMethod("POST"); |
| | | connection.setConnectTimeout(1000 * 30); |
| | | connection.setRequestProperty("Host", "api-cn.ronghub.com"); |
| | | connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); |
| | | connection.setRequestProperty("App-Key", app_key); |
| | | connection.setRequestProperty("Nonce", nonce); |
| | | connection.setRequestProperty("Timestamp", timeMillis); |
| | | connection.setRequestProperty("Signature", signature); |
| | | connection.setDoOutput(true); |
| | | connection.setDoInput(true); |
| | | connection.setUseCaches(false); |
| | | connection.setInstanceFollowRedirects(true); |
| | | connection.connect(); |
| | | DataOutputStream outputStream = new DataOutputStream(connection.getOutputStream()); |
| | | outputStream.write(json.getBytes("UTF-8")); |
| | | outputStream.flush(); |
| | | outputStream.close(); |
| | | |
| | | int responseCode = connection.getResponseCode(); |
| | | InputStream inputStream = null; |
| | | if(responseCode == 403){ |
| | | inputStream = connection.getErrorStream(); |
| | | } |
| | | if(responseCode == 200){ |
| | | inputStream = connection.getInputStream(); |
| | | } |
| | | DataInputStream dataInputStream = new DataInputStream(inputStream); |
| | | ByteArrayOutputStream stream = new ByteArrayOutputStream(); |
| | | int len; |
| | | byte[] bytes = new byte[1024]; |
| | | while ((len = dataInputStream.read(bytes)) != -1){ |
| | | stream.write(bytes, 0, len); |
| | | } |
| | | return stream.toString(); |
| | | } catch (MalformedURLException e) { |
| | | e.printStackTrace(); |
| | | } catch (ProtocolException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | | public static String getSha1(String str) { |
| | | char hexDigits[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', |
| | | 'a', 'b', 'c', 'd', 'e', 'f' }; |
| | | try { |
| | | MessageDigest mdTemp = MessageDigest.getInstance("SHA1"); |
| | | mdTemp.update(str.getBytes("UTF-8")); |
| | | byte[] md = mdTemp.digest(); |
| | | int j = md.length; |
| | | char buf[] = new char[j * 2]; |
| | | int k = 0; |
| | | for (int i = 0; i < j; i++) { |
| | | byte byte0 = md[i]; |
| | | buf[k++] = hexDigits[byte0 >>> 4 & 0xf]; |
| | | buf[k++] = hexDigits[byte0 & 0xf]; |
| | | } |
| | | return new String(buf); |
| | | } catch (Exception e) { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 云端录制状态回调 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | public static CloudRecordingCallback cloudRecordingCallback(HttpServletRequest request){ |
| | | String param = null; |
| | | try { |
| | | param = getParam(request); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | if(ToolUtil.isNotEmpty(param)){ |
| | | CloudRecordingCallback cloudRecordingCallback = JSON.parseObject(param, CloudRecordingCallback.class); |
| | | return cloudRecordingCallback; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | private static String getParam(HttpServletRequest request) throws IOException { |
| | | // 读取参数 |
| | | InputStream inputStream; |
| | | StringBuilder sb = new StringBuilder(); |
| | | inputStream = request.getInputStream(); |
| | | String s; |
| | | BufferedReader in = new BufferedReader(new InputStreamReader(inputStream, "UTF-8")); |
| | | while ((s = in.readLine()) != null) { |
| | | sb.append(s); |
| | | } |
| | | in.close(); |
| | | inputStream.close(); |
| | | return sb.toString(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.rongyun.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2023/4/6 10:29 |
| | | */ |
| | | @Data |
| | | public class CloudRecordingCallback { |
| | | /** |
| | | * 时间戳,单位为毫秒。 |
| | | */ |
| | | private Long timestamp; |
| | | /** |
| | | *回调事件类型,如下: |
| | | * 1: 录制开始; |
| | | * 2: 录制切片; |
| | | * 3: 录制结束; |
| | | * 4: 文件上传 |
| | | */ |
| | | private Integer type; |
| | | /** |
| | | * 当前使用的 App Key |
| | | */ |
| | | private String appKey; |
| | | /** |
| | | * 录制 ID,每次录制任务的唯一标识。如果文件切片,可以通过此 ID 进行关联。 |
| | | */ |
| | | private String recordId; |
| | | /** |
| | | * 房间 ID |
| | | */ |
| | | private String roomId; |
| | | /** |
| | | * 会话 ID,每次通话的唯一标识。您可以通过融云服务端回调获取该 sessionId |
| | | */ |
| | | private String sessionId; |
| | | /** |
| | | * 用户 ID。如果录制模式为 Mix,此字段为空 |
| | | */ |
| | | private String userId; |
| | | /** |
| | | * 录制模式,如下: |
| | | * 0:音视频 single 模式; |
| | | * 1:纯视频 single 模式; |
| | | * 2:纯音频 single 模式; |
| | | * 3:音视频 mix 模式; |
| | | * 4:纯视频 mix 模式; |
| | | * 5:纯音频 mix 模式; |
| | | * 6:单人 mix 音视频模式。 |
| | | */ |
| | | private Integer mode; |
| | | /** |
| | | * 扩展字段,内容为手动录制时传入的 extra 字段的值 |
| | | */ |
| | | private String extra; |
| | | /** |
| | | * 状态码,200 为正常 |
| | | */ |
| | | private Integer code; |
| | | /** |
| | | * 错误信息。 |
| | | */ |
| | | private String errorMessage; |
| | | /** |
| | | * |
| | | */ |
| | | private Config config; |
| | | /** |
| | | * |
| | | */ |
| | | private Output output; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.rongyun.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2023/4/6 10:48 |
| | | */ |
| | | @Data |
| | | public class Config { |
| | | /** |
| | | * 录制启动模式: 1 自动启动录制任务 |
| | | */ |
| | | private Integer trigger; |
| | | /** |
| | | * Mix模式下布局:2 悬浮布局(默认) 3 自适应布局 |
| | | */ |
| | | private Integer mixLayout; |
| | | /** |
| | | * 文件切片时间(分钟) |
| | | */ |
| | | private Integer slicesMin; |
| | | /** |
| | | * 设置的音频文件格式 |
| | | */ |
| | | private String audioFormat; |
| | | /** |
| | | * 设置的视频文件格式 |
| | | */ |
| | | private String videoFormat; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.rongyun.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2023/4/6 10:50 |
| | | */ |
| | | @Data |
| | | public class Output { |
| | | /** |
| | | * 缓存的文件名。具体请参考「配置云端录制服务」中的切片文件命名规则。 |
| | | */ |
| | | private String fileName; |
| | | /** |
| | | * 音频采样率,如 48000。如果当前录制任务没有录制音频,该字段为空。 |
| | | */ |
| | | private Integer audioSample; |
| | | /** |
| | | * 视频分辨率,如 640x480。如果当前录制任务没有录制视频,该字段为空。 |
| | | */ |
| | | private String videoResoulation; |
| | | /** |
| | | * 切片生成的录制文件大小。 |
| | | */ |
| | | private Integer fileSize; |
| | | /** |
| | | * 已上传到的第三方存储的 URL。 |
| | | */ |
| | | private String fileUrl; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.stylefeng.guns.modular.system.model.BaseBean; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | |
| | | private String splitAllocation; |
| | | |
| | | // 推广应的金额 |
| | | private BigDecimal promotionMoney; |
| | | |
| | | // 推广司机id |
| | | private Integer promotionDriverId; |
| | | |
| | | private String voice; |
| | | |
| | | public String getVoice() { |
| | | return voice; |
| | | } |
| | | |
| | | public void setVoice(String voice) { |
| | | this.voice = voice; |
| | | } |
| | | |
| | | public BigDecimal getPromotionMoney() { |
| | | return promotionMoney; |
| | | } |
| | | |
| | | public void setPromotionMoney(BigDecimal promotionMoney) { |
| | | this.promotionMoney = promotionMoney; |
| | | } |
| | | |
| | | public Integer getPromotionDriverId() { |
| | | return promotionDriverId; |
| | | } |
| | | |
| | | public void setPromotionDriverId(Integer promotionDriverId) { |
| | | this.promotionDriverId = promotionDriverId; |
| | | } |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | |
| | | |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | <configuration> |
| | | <fork>true</fork><!-- 如果没有该项配置,肯呢个devtools不会起作用,即应用不会restart --> |
| | | |
| | | </configuration> |
| | | |
| | | </plugin> |
| | | |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-surefire-plugin</artifactId> |
| | | <configuration> |
| | | <skip>true</skip> |
| | | </configuration> |
| | | </plugin> |
| | | <!-- <plugin>--> |
| | | <!-- <groupId>org.springframework.boot</groupId>--> |
| | | <!-- <artifactId>spring-boot-maven-plugin</artifactId>--> |
| | | <!-- <configuration>--> |
| | | <!-- <fork>true</fork><!– 如果没有该项配置,肯呢个devtools不会起作用,即应用不会restart –>--> |
| | | <!-- --> |
| | | <!-- </configuration>--> |
| | | <!-- --> |
| | | <!-- </plugin>--> |
| | | <!-- --> |
| | | <!-- <plugin>--> |
| | | <!-- <groupId>org.apache.maven.plugins</groupId>--> |
| | | <!-- <artifactId>maven-surefire-plugin</artifactId>--> |
| | | <!-- <configuration>--> |
| | | <!-- <skip>true</skip>--> |
| | | <!-- </configuration>--> |
| | | <!-- </plugin>--> |
| | | </plugins> |
| | | |
| | | <!--打包war包引入本地jar的打包方式--> |
| | |
| | | String onconParam = edu.yale.its.tp.cas.client.Util.getOnconParam(session); |
| | | onconParam = new String(Base64.decodeBase64(onconParam), "UTF-8"); |
| | | LoginUser loginUser = JSON.parseObject(onconParam, LoginUser.class); |
| | | log.debug("登录账号: " + JSON.toJSONString(loginUser)); |
| | | |
| | | |
| | | //获取菜单列表 |
| | | User user = userMapper.getByAccount(loginUser.getImUser()); |
| | | if (null == user) { |
| | |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/8 11:31 |
| | | */ |
| | | @Data |
| | | @Component |
| | | public class QianYunTongConfig { |
| | | |
| | |
| | | * 向UAAS服务请求到的secret_key |
| | | */ |
| | | private String secretKey; |
| | | |
| | | |
| | | |
| | | public String getActiveProfile() { |
| | | return activeProfile; |
| | | } |
| | | |
| | | public void setActiveProfile(String activeProfile) { |
| | | this.activeProfile = activeProfile; |
| | | } |
| | | |
| | | public String getAppkey() { |
| | | return appkey; |
| | | } |
| | | |
| | | public void setAppkey(String appkey) { |
| | | this.appkey = appkey; |
| | | } |
| | | |
| | | public String getPrivateKeyPath() { |
| | | return privateKeyPath; |
| | | } |
| | | |
| | | public void setPrivateKeyPath(String privateKeyPath) { |
| | | this.privateKeyPath = privateKeyPath; |
| | | } |
| | | |
| | | public String getUserName() { |
| | | return userName; |
| | | } |
| | | |
| | | public void setUserName(String userName) { |
| | | this.userName = userName; |
| | | } |
| | | |
| | | public String getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public String getApiUrl() { |
| | | return apiUrl; |
| | | } |
| | | |
| | | public void setApiUrl(String apiUrl) { |
| | | this.apiUrl = apiUrl; |
| | | } |
| | | |
| | | public String getBucketName() { |
| | | return bucketName; |
| | | } |
| | | |
| | | public void setBucketName(String bucketName) { |
| | | this.bucketName = bucketName; |
| | | } |
| | | |
| | | public String getAppId() { |
| | | return appId; |
| | | } |
| | | |
| | | public void setAppId(String appId) { |
| | | this.appId = appId; |
| | | } |
| | | |
| | | public String getEndPoint() { |
| | | return endPoint; |
| | | } |
| | | |
| | | public void setEndPoint(String endPoint) { |
| | | this.endPoint = endPoint; |
| | | } |
| | | |
| | | public String getAccount() { |
| | | return account; |
| | | } |
| | | |
| | | public void setAccount(String account) { |
| | | this.account = account; |
| | | } |
| | | |
| | | public String getAccessKey() { |
| | | return accessKey; |
| | | } |
| | | |
| | | public void setAccessKey(String accessKey) { |
| | | this.accessKey = accessKey; |
| | | } |
| | | |
| | | public String getSecretKey() { |
| | | return secretKey; |
| | | } |
| | | |
| | | public void setSecretKey(String secretKey) { |
| | | this.secretKey = secretKey; |
| | | } |
| | | |
| | | public QianYunTongConfig getQianYunTongConfig() { |
| | | if("dev".equals(activeProfile)){ |
| | | this.appkey = "10001104"; |
| | | this.privateKeyPath = "C:\\Users\\39373\\Desktop\\黔云通\\private_key_test.pem"; |
| | | this.privateKeyPath = "C:\\Users\\Admin\\Desktop\\private_key_test.pem"; |
| | | this.userName = "xiaofei"; |
| | | this.status = "1"; |
| | | this.setApiUrl("https://test-zhongtai.stqcloud.com:10070"); |