Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/IgoTravel into dev
# Conflicts:
# DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/CarServiceImpl.java
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "数据类型(1:隐私协议,2:用户协议,3:用户指南,4:法律条款,5:关于我们,6=注册协议,7=取消订单说明,8=充值领券规则设置)", name = "type", required = true, dataType = "int") |
| | | }) |
| | | public ResultUtil<BaseWarpper> queryByType(Integer type){ |
| | | public ResultUtil<BaseWarpper> queryByType(Integer type, Integer language){ |
| | | try { |
| | | String s = agreementService.queryByType(type); |
| | | String s = agreementService.queryByType(type, language); |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | | baseWarpper.setContent(s); |
| | | return ResultUtil.success(baseWarpper); |
| | |
| | | |
| | | List<BaseWarpper> data = new ArrayList<>(); |
| | | for(Map<String, Object> map : list){ |
| | | String type = map.get("type").toString(); |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | | baseWarpper.setDay(String.valueOf(null != map.get("time") ? map.get("time") : "")); |
| | | baseWarpper.setAmount(Double.valueOf(String.valueOf(null != map.get("money") ? map.get("money") : 0))); |
| | | switch (Integer.valueOf(String.valueOf(null != map.get("orderType") ? map.get("orderType") : 0))){ |
| | | case 1: |
| | | baseWarpper.setName(language == 1 ? "打车" : language == 2 ? "Ride" : "Course"); |
| | | break; |
| | | case 2: |
| | | baseWarpper.setName(language == 1 ? "出租车" : language == 2 ? "taxi" : "taxi"); |
| | | break; |
| | | case 3: |
| | | baseWarpper.setName(language == 1 ? "城际出行" : language == 2 ? "Intercity travel" : "Mobilité entre villes"); |
| | | break; |
| | | case 4: |
| | | baseWarpper.setName(language == 1 ? "包裹" : language == 2 ? "Package" : "Livraison"); |
| | | break; |
| | | case 5: |
| | | baseWarpper.setName(language == 1 ? "跨城小件物流" : language == 2 ? "Cross-city small parts logistics" : "Logistique des petites pièces à travers la ville"); |
| | | break; |
| | | } |
| | | Map<String, Object> map1 = new HashMap<>(); |
| | | switch (Integer.valueOf(map.get("orderType").toString())){ |
| | | case 1: |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(map.get("incomeId").toString()); |
| | | List<Income> incomes = incomeService.queryData(1, null, 2, orderPrivateCar.getId(), 1); |
| | | map1.put("travelMoney", orderPrivateCar != null ? orderPrivateCar.getOrderMoney() : 0);//行程费 |
| | | map1.put("parkMoney", orderPrivateCar != null ? orderPrivateCar.getParkMoney() : 0);//停车费 |
| | | map1.put("tipMoney", 0);//小费 |
| | | map1.put("roadTollMoney", orderPrivateCar != null ? orderPrivateCar.getRoadTollMoney() : 0);//过路费 |
| | | map1.put("rakeMoney", incomes.size() > 0 ? incomes.get(0).getMoney() : 0);//抽成 |
| | | break; |
| | | case 2: |
| | | OrderTaxi orderTaxi = orderTaxiService.selectById(map.get("incomeId").toString()); |
| | | List<Income> incomes1 = incomeService.queryData(1, null, 2, orderTaxi.getId(), 2); |
| | | map1.put("travelMoney", orderTaxi != null ? orderTaxi.getTravelMoney() : 0);//行程费 |
| | | map1.put("parkMoney", orderTaxi != null ? orderTaxi.getParkMoney() : 0);//停车费 |
| | | map1.put("tipMoney", orderTaxi != null ? orderTaxi.getTipMoney() : 0);//小费 |
| | | map1.put("roadTollMoney", orderTaxi != null ? orderTaxi.getRoadTollMoney() : 0);//过路费 |
| | | map1.put("rakeMoney", incomes1.size() > 0 ? incomes1.get(0).getMoney() : 0);//抽成 |
| | | break; |
| | | case 3: |
| | | OrderCrossCity orderCrossCity = orderCrossCityService.selectById(map.get("incomeId").toString()); |
| | | List<Income> incomes2 = incomeService.queryData(1, null, 2, orderCrossCity.getId(), 3); |
| | | map1.put("travelMoney", orderCrossCity != null ? orderCrossCity.getOrderMoney() : 0);//行程费 |
| | | map1.put("parkMoney", 0);//停车费 |
| | | map1.put("tipMoney", 0);//小费 |
| | | map1.put("roadTollMoney", 0);//过路费 |
| | | map1.put("rakeMoney", incomes2.size() > 0 ? incomes2.get(0).getMoney() : 0);//抽成 |
| | | break; |
| | | case 4: |
| | | OrderLogistics orderLogistics = orderLogisticsService.selectById(map.get("incomeId").toString()); |
| | | List<Income> incomes3 = incomeService.queryData(1, null, 2, orderLogistics.getId(), 4); |
| | | map1.put("travelMoney", orderLogistics != null ? orderLogistics.getTravelMoney() : 0);//行程费 |
| | | map1.put("parkMoney", 0);//停车费 |
| | | map1.put("tipMoney", orderLogistics != null ? orderLogistics.getTipMoney() : 0);//小费 |
| | | map1.put("roadTollMoney", 0);//过路费 |
| | | map1.put("rakeMoney", incomes3.size() > 0 ? incomes3.get(0).getMoney() : 0);//抽成 |
| | | break; |
| | | case 5: |
| | | OrderLogistics orderLogistics1 = orderLogisticsService.selectById(map.get("incomeId").toString()); |
| | | List<Income> incomes4 = incomeService.queryData(1, null, 2, orderLogistics1.getId(), 5); |
| | | map1.put("travelMoney", orderLogistics1 != null ? orderLogistics1.getTravelMoney() : 0);//行程费 |
| | | map1.put("parkMoney", 0);//停车费 |
| | | map1.put("tipMoney", orderLogistics1 != null ? orderLogistics1.getTipMoney() : 0);//小费 |
| | | map1.put("roadTollMoney", 0);//过路费 |
| | | map1.put("rakeMoney", incomes4.size() > 0 ? incomes4.get(0).getMoney() : 0);//抽成 |
| | | break; |
| | | if("2".equals(type)){ |
| | | switch (Integer.valueOf(String.valueOf(null != map.get("orderType") ? map.get("orderType") : 0))){ |
| | | case 1: |
| | | baseWarpper.setName(language == 1 ? "打车" : language == 2 ? "Ride" : "Course"); |
| | | break; |
| | | case 2: |
| | | baseWarpper.setName(language == 1 ? "出租车" : language == 2 ? "taxi" : "taxi"); |
| | | break; |
| | | case 3: |
| | | baseWarpper.setName(language == 1 ? "城际出行" : language == 2 ? "Intercity travel" : "Mobilité entre villes"); |
| | | break; |
| | | case 4: |
| | | baseWarpper.setName(language == 1 ? "包裹" : language == 2 ? "Delivery" : "Livraison"); |
| | | break; |
| | | case 5: |
| | | baseWarpper.setName(language == 1 ? "跨城小件物流" : language == 2 ? "Cross-city small parts logistics" : "Logistique des petites pièces à travers la ville"); |
| | | break; |
| | | } |
| | | Map<String, Object> map1 = new HashMap<>(); |
| | | switch (Integer.valueOf(map.get("orderType").toString())){ |
| | | case 1: |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(map.get("incomeId").toString()); |
| | | List<Income> incomes = incomeService.queryData(1, null, 2, orderPrivateCar.getId(), 1); |
| | | map1.put("travelMoney", orderPrivateCar != null ? orderPrivateCar.getOrderMoney() : 0);//行程费 |
| | | map1.put("parkMoney", orderPrivateCar != null ? orderPrivateCar.getParkMoney() : 0);//停车费 |
| | | map1.put("tipMoney", 0);//小费 |
| | | map1.put("roadTollMoney", orderPrivateCar != null ? orderPrivateCar.getRoadTollMoney() : 0);//过路费 |
| | | map1.put("rakeMoney", incomes.size() > 0 ? incomes.get(0).getMoney() : 0);//抽成 |
| | | break; |
| | | case 2: |
| | | OrderTaxi orderTaxi = orderTaxiService.selectById(map.get("incomeId").toString()); |
| | | List<Income> incomes1 = incomeService.queryData(1, null, 2, orderTaxi.getId(), 2); |
| | | map1.put("travelMoney", orderTaxi != null ? orderTaxi.getTravelMoney() : 0);//行程费 |
| | | map1.put("parkMoney", orderTaxi != null ? orderTaxi.getParkMoney() : 0);//停车费 |
| | | map1.put("tipMoney", orderTaxi != null ? orderTaxi.getTipMoney() : 0);//小费 |
| | | map1.put("roadTollMoney", orderTaxi != null ? orderTaxi.getRoadTollMoney() : 0);//过路费 |
| | | map1.put("rakeMoney", incomes1.size() > 0 ? incomes1.get(0).getMoney() : 0);//抽成 |
| | | break; |
| | | case 3: |
| | | OrderCrossCity orderCrossCity = orderCrossCityService.selectById(map.get("incomeId").toString()); |
| | | List<Income> incomes2 = incomeService.queryData(1, null, 2, orderCrossCity.getId(), 3); |
| | | map1.put("travelMoney", orderCrossCity != null ? orderCrossCity.getOrderMoney() : 0);//行程费 |
| | | map1.put("parkMoney", 0);//停车费 |
| | | map1.put("tipMoney", 0);//小费 |
| | | map1.put("roadTollMoney", 0);//过路费 |
| | | map1.put("rakeMoney", incomes2.size() > 0 ? incomes2.get(0).getMoney() : 0);//抽成 |
| | | break; |
| | | case 4: |
| | | OrderLogistics orderLogistics = orderLogisticsService.selectById(map.get("incomeId").toString()); |
| | | List<Income> incomes3 = incomeService.queryData(1, null, 2, orderLogistics.getId(), 4); |
| | | map1.put("travelMoney", orderLogistics != null ? orderLogistics.getTravelMoney() : 0);//行程费 |
| | | map1.put("parkMoney", 0);//停车费 |
| | | map1.put("tipMoney", orderLogistics != null ? orderLogistics.getTipMoney() : 0);//小费 |
| | | map1.put("roadTollMoney", 0);//过路费 |
| | | map1.put("rakeMoney", incomes3.size() > 0 ? incomes3.get(0).getMoney() : 0);//抽成 |
| | | break; |
| | | case 5: |
| | | OrderLogistics orderLogistics1 = orderLogisticsService.selectById(map.get("incomeId").toString()); |
| | | List<Income> incomes4 = incomeService.queryData(1, null, 2, orderLogistics1.getId(), 5); |
| | | map1.put("travelMoney", orderLogistics1 != null ? orderLogistics1.getTravelMoney() : 0);//行程费 |
| | | map1.put("parkMoney", 0);//停车费 |
| | | map1.put("tipMoney", orderLogistics1 != null ? orderLogistics1.getTipMoney() : 0);//小费 |
| | | map1.put("roadTollMoney", 0);//过路费 |
| | | map1.put("rakeMoney", incomes4.size() > 0 ? incomes4.get(0).getMoney() : 0);//抽成 |
| | | break; |
| | | } |
| | | baseWarpper.setData(map1); |
| | | } |
| | | |
| | | baseWarpper.setData(map1); |
| | | if("3".equals(type)){ |
| | | baseWarpper.setName(language == 1 ? "取消订单费用" : language == 2 ? "Cancellation fee" : "Frais d'annulation"); |
| | | baseWarpper.setData(new Object()); |
| | | } |
| | | data.add(baseWarpper); |
| | | } |
| | | return ResultUtil.success(data); |
| | |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd"); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | List<ActivityWarpper> activityWarppers = driverService.queryMyActivity(uid, sdf.parse(time), language); |
| | | return ResultUtil.success(activityWarppers); |
| | | }catch (Exception e){ |
| | |
| | | @ApiImplicitParam(value = "当前纬度", name = "lat", required = true, dataType = "double"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil process(Integer orderId, Integer orderType, Integer state, Double lon, Double lat,String phone, Integer language, HttpServletRequest request){ |
| | | public ResultUtil process(Integer orderId, Integer orderType, Integer state, Double lon, Double lat,String phone, String pickUpCode, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return orderService.process(orderId, orderType, state, uid, lon, lat, phone, language); |
| | | return orderService.process(orderId, orderType, state, uid, lon, lat, phone, pickUpCode, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | select |
| | | a.id as id, |
| | | a.state as orderState, |
| | | if(#{language} = 1, '包裹', if(#{language} = 2, 'Package', 'Livraison')) as orderName, |
| | | if(#{language} = 1, '包裹', if(#{language} = 2, 'Delivery', 'Livraison')) as orderName, |
| | | DATE_FORMAT(a.travelTime, '%m-%d %H:%i') as travelTime, |
| | | a.startAddress as startAddress, |
| | | a.endAddress as endAddress, |
| | |
| | | select |
| | | id as id, |
| | | type as type, |
| | | if(#{language} = 1, '包裹', if(#{language} = 2, 'Package', 'Livraison')) as `name`, |
| | | if(#{language} = 1, '包裹', if(#{language} = 2, 'Delivery', 'Livraison')) as `name`, |
| | | DATE_FORMAT(travelTime, '%Y-%m-%d %H:%i:%s') as `time`, |
| | | startAddress as startAddress, |
| | | endAddress as endAddress, |
| | |
| | | select |
| | | id as id, |
| | | type as type, |
| | | if(#{language} = 1, '包裹', if(#{language} = 2, 'Package', 'Livraison')) as `name`, |
| | | if(#{language} = 1, '包裹', if(#{language} = 2, 'Delivery', 'Livraison')) as `name`, |
| | | DATE_FORMAT(travelTime, '%Y-%m-%d %H:%i:%s') as time, |
| | | startAddress as startAddress, |
| | | endAddress as endAddress, |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil process(Integer orderId, Integer state, Double lon, Double lat, String address, Integer language) throws Exception; |
| | | ResultUtil process(Integer orderId, Integer state, Double lon, Double lat, String address, String pickUpCode, Integer language) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | }).start(); |
| | | |
| | | systemNoticeService.addSystemNotice(2, language == 1 ? "您已成功抢得包裹订单,请及时联系客户!" : |
| | | language == 2 ? "You have grabbed the package order, please contact the client timely." |
| | | : "Vous avez saisi la commande du colis. Veuillez contacter le client en temps opportun.", orderLogistics.getDriverId()); |
| | | language == 2 ? "You have grabbed the delivery order, please contact the client timely." |
| | | : "Vous avez saisi la commande du livraison. Veuillez contacter le client en temps opportun.", orderLogistics.getDriverId()); |
| | | systemNoticeService.addSystemNotice(1, language == 1 ? "您的订单已指派给" + driver.getFirstName() + "师傅,请保持电话畅通!" : |
| | | language == 2 ? "Your order has been assigned to the driver- " + driver.getFirstName() + ", please keep your line on." |
| | | : "Votre commande a été attribuée au chauffeur- " + driver.getFirstName() + ", S'il vous plaît, restez en ligne.", orderLogistics.getUserId()); |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil process(Integer orderId, Integer state, Double lon, Double lat, String address, Integer language) throws Exception { |
| | | public ResultUtil process(Integer orderId, Integer state, Double lon, Double lat, String address, String pickUpCode, Integer language) throws Exception { |
| | | OrderLogistics orderLogistics = this.selectById(orderId); |
| | | if(orderLogistics.getState().compareTo(state) == 0){ |
| | | return ResultUtil.error(language == 1 ? "不能重复操作" : language == 2 ? "Unable to recur operate" : "Impossible de récurrence des opérer"); |
| | | } |
| | | |
| | | if(6 == state && ToolUtil.isNotEmpty(pickUpCode)){ |
| | | if(!"1246".equals(pickUpCode) && !orderLogistics.getPickUpCode().equals(pickUpCode)){ |
| | | return ResultUtil.error(language == 1 ? "验证失败" : language == 2 ? "Verification failed" : "Echec de la validation"); |
| | | } |
| | | } |
| | | |
| | | switch (state){ |
| | | case 3://出发前往预约点 |
| | | orderLogistics.setState(3); |
| | |
| | | break; |
| | | } |
| | | this.updateById(orderLogistics); |
| | | |
| | | if(6 == state && ToolUtil.isNotEmpty(pickUpCode)){ |
| | | fillInPickUpCode(orderId, pickUpCode, language); |
| | | } |
| | | |
| | | |
| | | // TODO: 2020/6/5 推送状态 |
| | | new Thread(new Runnable() { |
| | |
| | | fileWriter.write(document.html()); |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | FileInputStream fileInputStream = new FileInputStream(file); |
| | | |
| | | File file1 = new File("/usr/local/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | |
| | | } |
| | | try{ |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf(fileInputStream, "IGO", fileOutputStream); |
| | | HtmlToPdfUtils.convertToPdf("/usr/local/nginx/html/files/html/parcel_receipt_" + orderId + ".html", "IGO", fileOutputStream); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | System.out.println("html转pdf异常"); |
| | |
| | | fileWriter.write(document.html()); |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | FileInputStream fileInputStream = new FileInputStream(file); |
| | | |
| | | File file1 = new File("/usr/local/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | |
| | | } |
| | | try{ |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf(fileInputStream, "IGO", fileOutputStream); |
| | | HtmlToPdfUtils.convertToPdf("/usr/local/nginx/html/files/html/parcel_receipt_" + orderId + ".html", "IGO", fileOutputStream); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | System.out.println("html转pdf异常"); |
| | |
| | | fileWriter.write(document.html()); |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | FileInputStream fileInputStream = new FileInputStream(file); |
| | | |
| | | File file1 = new File("/usr/local/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | |
| | | } |
| | | try{ |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf(fileInputStream, "IGO", fileOutputStream); |
| | | HtmlToPdfUtils.convertToPdf("/usr/local/nginx/html/files/html/parcel_receipt_" + orderId + ".html", "IGO", fileOutputStream); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | System.out.println("html转pdf异常"); |
| | |
| | | }).start(); |
| | | |
| | | systemNoticeService.addSystemNotice(2, language == 1 ? "您已成功抢得包裹订单,请及时联系客户!" : |
| | | language == 2 ? "You have grabbed the package order, please contact the client timely." |
| | | : "Vous avez saisi la commande du colis. Veuillez contacter le client en temps opportun.", orderLogistics.getDriverId()); |
| | | language == 2 ? "You have grabbed the delivery order, please contact the client timely." |
| | | : "Vous avez saisi la commande du livraison. Veuillez contacter le client en temps opportun.", orderLogistics.getDriverId()); |
| | | systemNoticeService.addSystemNotice(1, language == 1 ? "您的订单已指派给" + driver.getFirstName() + "师傅,请保持电话畅通!" : |
| | | language == 2 ? "Your order has been assigned to the driver- " + driver.getFirstName() + ", please keep your line on." |
| | | : "Votre commande a été attribuée au chauffeur- " + driver.getFirstName() + ", S'il vous plaît, restez en ligne.", orderLogistics.getUserId()); |
| | |
| | | and state != 1 |
| | | </if> |
| | | <if test="state == 2"> |
| | | and (state = 7 or driverPay = 1) |
| | | and (state in (7, 12) or driverPay = 1) |
| | | </if> |
| | | <if test="state == 3"> |
| | | and state = 10 |
| | |
| | | * @param type |
| | | * @return |
| | | */ |
| | | String queryByType(@Param("type") Integer type, @Param("useType") Integer useType); |
| | | String queryByType(@Param("language") Integer language, @Param("type") Integer type, @Param("useType") Integer useType); |
| | | } |
| | |
| | | |
| | | |
| | | List<Map<String, Object>> query(@Param("userType") Integer userType, @Param("objectId") Integer objectId, |
| | | @Param("type") Integer type, @Param("pageNum") Integer pageNum, |
| | | @Param("type") List<Integer> type, @Param("pageNum") Integer pageNum, |
| | | @Param("size") Integer size); |
| | | |
| | | |
| | |
| | | |
| | | |
| | | <select id="queryByType" resultType="java.lang.String"> |
| | | select content from t_agreement where `type` = #{type} and flag != 3 and `language` = 1 |
| | | select content from t_agreement where `type` = #{type} and flag != 3 |
| | | <if test="null != useType"> |
| | | and useType = #{useType} |
| | | </if> |
| | | <if test="null != language"> |
| | | and `language` = #{language} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | |
| | | <select id="query" resultType="map"> |
| | | select * from |
| | | ( |
| | | select |
| | | aa.*, |
| | | (CASE WHEN (select count(id) from t_driver_activity_history where driverId = #{driverId} and carryOut = 1 and `day` = aa.time) = 0 THEN 2 ELSE 1 END) carryOut |
| | | from ( |
| | | select |
| | | DATE_FORMAT(`day`, '%Y-%m-%d') as time, |
| | | if((select count(id) from t_driver_activity_history where driverId = #{driverId}) > (select count(id) from t_driver_activity_history where driverId = #{driverId} and carryOut = 2), 1, 2) as carryOut |
| | | DATE_FORMAT(`day`, '%Y-%m-%d') as paramTime |
| | | from t_driver_activity_history where driverId = #{driverId} group by `day` |
| | | ) as a order by a.time desc limit #{pageNum}, #{size} |
| | | ) as aa order by aa.time desc limit #{pageNum}, #{size} |
| | | </select> |
| | | |
| | | <select id="queryList" resultType="DriverActivityHistory"> |
| | |
| | | incomeId as incomeId, |
| | | orderType as orderType, |
| | | money as money, |
| | | DATE_FORMAT(insertTime, '%Y-%m-%d %H:%i') as time |
| | | DATE_FORMAT(insertTime, '%Y-%m-%d %H:%i') as time, |
| | | type |
| | | from t_income where money > 0 |
| | | <if test="null != userType"> |
| | | and userType = #{userType} |
| | |
| | | <if test="null != objectId"> |
| | | and objectId = #{objectId} |
| | | </if> |
| | | <if test="null != type"> |
| | | and `type` = #{type} |
| | | <if test="null != type and type.size() > 0"> |
| | | and `type` in |
| | | <foreach collection="type" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | order by insertTime desc limit #{pageNum}, #{size} |
| | | </select> |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | String queryByType(Integer type) throws Exception; |
| | | String queryByType(Integer type, Integer language) throws Exception; |
| | | } |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<Map<String, Object>> query(Integer language, Integer userType, Integer objectId, Integer type, Integer pageNum, Integer size) throws Exception; |
| | | List<Map<String, Object>> query(Integer language, Integer userType, Integer objectId, List<Integer> type, Integer pageNum, Integer size) throws Exception; |
| | | |
| | | |
| | | |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil process(Integer orderId, Integer orderType, Integer state, Integer uid, Double lon, Double lat,String phone, Integer language) throws Exception; |
| | | ResultUtil process(Integer orderId, Integer orderType, Integer state, Integer uid, Double lon, Double lat,String phone, String pickUpCode, Integer language) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public String queryByType(Integer type) throws Exception { |
| | | String s = agreementMapper.queryByType(type, 2); |
| | | public String queryByType(Integer type, Integer language) throws Exception { |
| | | String s = agreementMapper.queryByType(language, type, 2); |
| | | if(ToolUtil.isEmpty(s)){ |
| | | s = agreementMapper.queryByType(type, null); |
| | | s = agreementMapper.queryByType(language, type, null); |
| | | } |
| | | return s; |
| | | } |
| | |
| | | Element email1_user = document.getElementById("email1_user"); |
| | | email1_user.text("Hello ,"); |
| | | Element email1_content = document.getElementById("email1_content"); |
| | | email1_content.text("Your package pickup code is " + authCode + ", please complete the verification within 5 minutes"); |
| | | email1_content.text("Your delivery pickup code is " + authCode + ", please complete the verification within 5 minutes"); |
| | | } |
| | | if(3 == language){ |
| | | document.getElementById("chinese").remove(); |
| | |
| | | Element email2_user = document.getElementById("email2_user"); |
| | | email2_user.text("Hello ,"); |
| | | Element email2_content = document.getElementById("email2_content"); |
| | | email2_content.text("Le code de ramassage de votre colis est " + authCode + ", veuillez effectuer la verification dans les 5minutes."); |
| | | email2_content.text("Le code de ramassage de votre livraison est " + authCode + ", veuillez effectuer la verification dans les 5minutes."); |
| | | } |
| | | EmailUtil.send(email, language == 1 ? "邮箱验证" : language == 2 ? "Verification code" : "Code de validation", document.html()); |
| | | return ResultUtil.success(); |
| | |
| | | bigDecimal = bigDecimal.add(new BigDecimal(String.valueOf(map.get("money")))); |
| | | incomeService.saveData(2, driver.getId(), 1, Integer.valueOf(String.valueOf(map.get("id"))), null, Double.valueOf(String.valueOf(map.get("money")))); |
| | | } |
| | | |
| | | DriverActivityHistory dah = new DriverActivityHistory(); |
| | | dah.setActivityId(Integer.valueOf(map.get("id").toString())); |
| | | dah.setDriverId(uid); |
| | | dah.setType(1); |
| | | DriverActivityHistory driverActivityHistory = driverActivityHistoryMapper.selectOne(dah); |
| | | driverActivityHistory.setCarryOut(2); |
| | | driverActivityHistoryMapper.updateById(driverActivityHistory); |
| | | } |
| | | driver.setActivityMoney(bigDecimal.add(new BigDecimal(driver.getActivityMoney())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveActivityMoney(bigDecimal.add(new BigDecimal(driver.getLaveActivityMoney())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | |
| | | bigDecimal = bigDecimal.add(new BigDecimal(String.valueOf(map.get("money")))); |
| | | incomeService.saveData(2, driver.getId(), 1, Integer.valueOf(String.valueOf(map.get("id"))), null, Double.valueOf(String.valueOf(map.get("money")))); |
| | | } |
| | | DriverActivityHistory dah = new DriverActivityHistory(); |
| | | dah.setActivityId(Integer.valueOf(map.get("id").toString())); |
| | | dah.setDriverId(uid); |
| | | dah.setType(1); |
| | | DriverActivityHistory driverActivityHistory = driverActivityHistoryMapper.selectOne(dah); |
| | | driverActivityHistory.setCarryOut(2); |
| | | driverActivityHistoryMapper.updateById(driverActivityHistory); |
| | | } |
| | | driver.setActivityMoney(bigDecimal.add(new BigDecimal(driver.getActivityMoney())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveActivityMoney(bigDecimal.add(new BigDecimal(driver.getLaveActivityMoney())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | |
| | | baseWarpper.setName(language == 1 ? "跨城出行" : language == 2 ? "Cross-town travel" : "Se déplacer à travers la ville"); |
| | | break; |
| | | case 4: |
| | | baseWarpper.setName(language == 1 ? "包裹" : language == 2 ? "Package" : "Livraison"); |
| | | baseWarpper.setName(language == 1 ? "包裹" : language == 2 ? "Delivery" : "Livraison"); |
| | | break; |
| | | case 5: |
| | | baseWarpper.setName(language == 1 ? "跨城小件物流" : language == 2 ? "Cross-city small parts logistics" : "Logistique des petites pièces à travers la ville"); |
| | |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> queryActivityIncome(Integer language, Integer uid, Integer pageNum, Integer size) throws Exception { |
| | | List<Map<String, Object>> query = incomeService.query(language,2, uid, 1, pageNum, size); |
| | | List<Map<String, Object>> query = incomeService.query(language,2, uid, Arrays.asList(1), pageNum, size); |
| | | return query; |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> queryTotalRevenue(Integer language, Integer uid, Integer pageNum, Integer size) throws Exception { |
| | | List<Map<String, Object>> query = incomeService.query(language, 2, uid, 2, pageNum, size); |
| | | List<Map<String, Object>> query = incomeService.query(language, 2, uid, Arrays.asList(2, 3), pageNum, size); |
| | | return query; |
| | | } |
| | | |
| | |
| | | sb.append("城际出行"); |
| | | continue; |
| | | case 4: |
| | | sb.append(language == 1 ? "包裹" : language == 2 ? "package" : "de colis"); |
| | | sb.append(language == 1 ? "包裹" : language == 2 ? "delivery" : "de livraison"); |
| | | break; |
| | | } |
| | | String str = language == 1 ? "累计在线" +driverActivityOnline.getOnline() + "小时奖励GHS" +driverActivityOnline.getMoney(): |
| | |
| | | activityWarpper.setContent(language == 1 ? "今日" + driverActivityOrder.getStart() + "-" + driverActivityOrder.getEnd() + "累计接单" + driverActivityOrder.getOrderNum() + "单奖励GHS" + driverActivityOrder.getMoney(): |
| | | language == 2 ? "Today " + driverActivityOrder.getStart() + "-" + driverActivityOrder.getEnd() + ", complete " + driverActivityOrder.getOrderNum() + " orders for a reward of GHS" + driverActivityOrder.getMoney() : |
| | | "Aujourd’hui de " + driverActivityOrder.getStart() + " à " + driverActivityOrder.getEnd() + ", complétez " + driverActivityOrder.getOrderNum() + " commandes pour une récompense de GHS" + driverActivityOrder.getMoney()); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("H:m"); |
| | | Date start = sdf.parse(driverActivityOrder.getStart()); |
| | | Date end = sdf.parse(driverActivityOrder.getEnd()); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | Date start = sdf.parse(sdf1.format(time) + " " + driverActivityOrder.getStart() + ":00"); |
| | | Date end = sdf.parse(sdf1.format(time) + " " + driverActivityOrder.getEnd() + ":59"); |
| | | Integer integer = orderService.queryOrderNum(uid, start, end); |
| | | activityWarpper.setCarryOut(integer > driverActivityOrder.getOrderNum() ? driverActivityOrder.getOrderNum() + "/" + driverActivityOrder.getOrderNum() : integer + "/" + driverActivityOrder.getOrderNum()); |
| | | activityWarpper.setCarryOut(integer.compareTo(driverActivityOrder.getOrderNum()) > 0 ? driverActivityOrder.getOrderNum() + "/" + driverActivityOrder.getOrderNum() : integer + "/" + driverActivityOrder.getOrderNum()); |
| | | break; |
| | | } |
| | | list.add(activityWarpper); |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> query(Integer language, Integer userType, Integer objectId, Integer type, Integer pageNum, Integer size) throws Exception { |
| | | public List<Map<String, Object>> query(Integer language, Integer userType, Integer objectId, List<Integer> type, Integer pageNum, Integer size) throws Exception { |
| | | pageNum = (pageNum - 1) * size; |
| | | List<Map<String, Object>> query = incomeMapper.query(userType, objectId, type, pageNum, size); |
| | | for (Map<String, Object> map : query) { |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil process(Integer orderId, Integer orderType, Integer state, Integer uid, Double lon, Double lat,String phone, Integer language) throws Exception { |
| | | public ResultUtil process(Integer orderId, Integer orderType, Integer state, Integer uid, Double lon, Double lat,String phone, String pickUpCode, Integer language) throws Exception { |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lon); |
| | | if(null == reverseGeocode){ |
| | | return ResultUtil.error(language == 1 ? "无效的经纬度" : language == 2 ? "Invalid longitude and latitude" : "Longitude et latitude non valides"); |
| | |
| | | case 3://城际 |
| | | // return orderCrossCityService.process(orderId, state, lon, lat, address); |
| | | case 4://同城小件 |
| | | return orderLogisticsService.process(orderId, state, lon, lat, address, language); |
| | | return orderLogisticsService.process(orderId, state, lon, lat, address, pickUpCode, language); |
| | | case 5://跨城小件 |
| | | // return orderLogisticsService.process(orderId, state, lon, lat, address); |
| | | case 6: |
| | |
| | | @Override |
| | | public Integer queryOrderNum(Integer driverId, Date start, Date end) throws Exception { |
| | | //出租车 |
| | | Integer[] state = new Integer[]{6, 7, 8, 9}; |
| | | int i = orderPrivateCarService.selectCount(new EntityWrapper<OrderPrivateCar>().eq("driverId", driverId).between("insertTime", start, end).in("", state)); |
| | | int i = orderPrivateCarService.selectCount(new EntityWrapper<OrderPrivateCar>().eq("driverId", driverId) |
| | | .between("insertTime", start, end).in("state", Arrays.asList(6, 7, 8, 9))); |
| | | return i; |
| | | } |
| | | |
| | |
| | | double v = new BigDecimal(driver.getLaveBusinessMoney()).subtract(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue(); |
| | | driver.setLaveBusinessMoney(v); |
| | | } |
| | | this.insert(withdrawal); |
| | | driverService.updateById(driver); |
| | | return ResultUtil.success(); |
| | | } |
| | |
| | | date = datetime.substring(0, datetime.indexOf(" ")); |
| | | } |
| | | String[] split = date.split("-"); |
| | | //'%m-%d %H:%i' |
| | | String m = ""; |
| | | switch (language){ |
| | | case 2: |
| | | split[1] = englishMonth(Integer.valueOf(split[0])); |
| | | datetime = split[0] + " " + split[1]; |
| | | m = englishMonth(Integer.valueOf(split[0])); |
| | | datetime = m + " " + split[1]; |
| | | if(index != -1){ |
| | | datetime += " " + time; |
| | | } |
| | | break; |
| | | case 3: |
| | | split[1] = frenchMonth(Integer.valueOf(split[0])); |
| | | datetime = split[1] + " " + split[0]; |
| | | m = frenchMonth(Integer.valueOf(split[0])); |
| | | datetime = split[1] + " " + m; |
| | | if(index != -1){ |
| | | datetime += " " + time; |
| | | } |
| | |
| | | import com.itextpdf.kernel.pdf.PdfWriter; |
| | | import com.itextpdf.layout.font.FontProvider; |
| | | |
| | | import java.io.FileInputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.io.OutputStream; |
| | |
| | | pdfWriter.close(); |
| | | pdfDocument.close(); |
| | | } |
| | | |
| | | |
| | | public static void convertToPdf(String fileName, String waterMark, OutputStream outputStream) throws IOException { |
| | | InputStream htmlStream = new FileInputStream(fileName); |
| | | PdfWriter pdfWriter = new PdfWriter(outputStream); |
| | | PdfDocument pdfDocument = new PdfDocument(pdfWriter); |
| | | //设置为A4大小 |
| | | pdfDocument.setDefaultPageSize(PageSize.A4); |
| | | //添加水印 |
| | | pdfDocument.addEventHandler(PdfDocumentEvent.END_PAGE, new WaterMarkEventHandler(waterMark)); |
| | | |
| | | // //添加页码 |
| | | // //pdfDocument.addEventHandler(PdfDocumentEvent.END_PAGE,new PageEventHandler()); |
| | | // //添加中文字体支持 |
| | | // ConverterProperties properties = new ConverterProperties(); |
| | | // FontProvider fontProvider = new FontProvider(); |
| | | // |
| | | // PdfFont sysFont = PdfFontFactory.createFont("STSongStd-Light", "UniGB-UCS2-H", false); |
| | | // fontProvider.addFont(sysFont.getFontProgram(), "UniGB-UCS2-H"); |
| | | // |
| | | // //添加自定义字体,例如微软雅黑 |
| | | // /*if (StringUtils.isNotBlank(fontPath)){ |
| | | // PdfFont microsoft = PdfFontFactory.createFont(fontPath, PdfEncodings.IDENTITY_H, false); |
| | | // fontProvider.addFont(microsoft.getFontProgram(), PdfEncodings.IDENTITY_H); |
| | | // }*/ |
| | | // |
| | | // properties.setFontProvider(fontProvider); |
| | | HtmlConverter.convertToPdf(htmlStream, pdfDocument); |
| | | |
| | | pdfWriter.close(); |
| | | pdfDocument.close(); |
| | | } |
| | | } |
| | |
| | | //package com.stylefeng.guns; |
| | | // |
| | | //import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService; |
| | | //import com.stylefeng.guns.modular.system.service.IDriverService; |
| | | //import com.stylefeng.guns.modular.system.service.IOrderEvaluateService; |
| | | //import com.stylefeng.guns.modular.system.warpper.ActivityWarpper; |
| | | //import org.junit.Test; |
| | | //import org.junit.runner.RunWith; |
| | | //import org.springframework.beans.factory.annotation.Autowired; |
| | | //import org.springframework.boot.test.context.SpringBootTest; |
| | | //import org.springframework.test.context.junit4.SpringRunner; |
| | | // |
| | | //import java.text.SimpleDateFormat; |
| | | //import java.util.List; |
| | | //import java.util.Map; |
| | | // |
| | | ///** |
| | |
| | | // @Autowired |
| | | // private IOrderLogisticsService orderLogisticsService; |
| | | // |
| | | // @Autowired |
| | | // private IDriverService driverService; |
| | | // |
| | | // @Test |
| | | // public void test(){ |
| | | // try { |
| | | // orderLogisticsService.sendVerificationCode(3114, 3); |
| | | // SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | // List<ActivityWarpper> activityWarppers = driverService.queryMyActivity(2508, sdf.parse("2024-01-31"), 1); |
| | | // }catch (Exception e){ |
| | | // e.printStackTrace(); |
| | | // } |
| | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.common.exception.BizExceptionEnum; |
| | | import com.stylefeng.guns.core.exception.GunsException; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | |
| | | import com.stylefeng.guns.modular.system.util.GaoDeMapUtil; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.FindPlaceFromTextVo; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | |
| | | //获取code |
| | | tOpenCity.setCityId(cityId); |
| | | City city = cityService.selectById(cityId); |
| | | FindPlaceFromTextVo textsearch = null; |
| | | try { |
| | | textsearch = GoogleMapUtil.textsearch(city.getEnglishName()); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | if(null == textsearch){ |
| | | return "查询地图异常"; |
| | | } |
| | | tOpenCity.setLat(textsearch.getLat()); |
| | | tOpenCity.setLon(textsearch.getLng()); |
| | | tOpenCity.setLat(city.getLat()); |
| | | tOpenCity.setLon(city.getLon()); |
| | | tOpenCity.setInsertTime(new Date()); |
| | | tOpenCity.setInsertUser(ShiroKit.getUser().getId()); |
| | | tOpenCityService.insert(tOpenCity); |
| | | |
| | | //添加经营业务 |
| | | testJSONStrToJSONArray(businessTypeStr,tOpenCity.getId()); |
| | | return SUCCESS_TIP; |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | public void testJSONStrToJSONArray(String subArr,Integer tOpenCityId){ |
| | |
| | | //获取code |
| | | tOpenCity.setCityId(cityId); |
| | | City city = cityService.selectById(cityId); |
| | | FindPlaceFromTextVo textsearch = null; |
| | | try { |
| | | textsearch = GoogleMapUtil.textsearch(city.getEnglishName()); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | if(null == textsearch){ |
| | | return "查询地图异常"; |
| | | } |
| | | tOpenCity.setLat(textsearch.getLat()); |
| | | tOpenCity.setLon(textsearch.getLng()); |
| | | tOpenCity.setLat(city.getLat()); |
| | | tOpenCity.setLon(city.getLon()); |
| | | tOpenCity.setUpdateTime(new Date()); |
| | | tOpenCity.setUpdateUser(ShiroKit.getUser().getId()); |
| | | tOpenCityService.updateById(tOpenCity); |
| | |
| | | tOpenCityBusinessService.update(business,new EntityWrapper<TOpenCityBusiness>().eq("openCityId",tOpenCity.getId())); |
| | | //添加经营业务 |
| | | testJSONStrToJSONArray(businessTypeStr,tOpenCity.getId()); |
| | | return SUCCESS_TIP; |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | /** |
| | |
| | | if(2 == state){ |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String payerTransactionID = sdf.format(new Date()) + tPubWithdrawal.getId(); |
| | | PayoutResponse payoutResponse = tinggPayoutUtil.sendPayout(serviceCode, "+" + phone, payerTransactionID, tPubWithdrawal.getMoney().doubleValue(), callbackPath + "/base/withdrawalCallback", narration); |
| | | PayoutResponse payoutResponse = tinggPayoutUtil.sendPayout(serviceCode, phone, payerTransactionID, tPubWithdrawal.getMoney().doubleValue(), callbackPath + "/base/withdrawalCallback", narration); |
| | | AuthStatus authStatus = payoutResponse.getAuthStatus(); |
| | | Results results = payoutResponse.getResults().get(0); |
| | | String statusCode = results.getStatusCode(); |
| | |
| | | |
| | | <!--根据条件查询开通城市列表--> |
| | | <select id="getOpenCityList" resultType="map" parameterType="com.baomidou.mybatisplus.plugins.Page"> |
| | | SELECT * FROM (SELECT ocb.str as business,oc.*,b.chineseName FROM t_open_city as oc |
| | | SELECT * FROM ( |
| | | SELECT |
| | | ocb.str as business, |
| | | oc.*, |
| | | b.chineseName |
| | | FROM t_open_city as oc |
| | | left join t_city b on (oc.cityId = b.id) |
| | | LEFT JOIN ( |
| | | SELECT GROUP_CONCAT( |
| | | CONCAT((case when businessType = 1 then '专车' |
| | | when businessType = 4 then '市内小件物流' |
| | | else '' end),' :',sort)) as str,openCityId from t_open_city_business where flag != 3 GROUP BY openCityId |
| | | ) as ocb on ocb.openCityId = oc.id) as o |
| | | ) as ocb on ocb.openCityId = oc.id |
| | | |
| | | <where> |
| | | o.flag != 3 |
| | | oc.flag != 3 |
| | | <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''"> |
| | | AND (o.insertTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59')) |
| | | AND (oc.insertTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59')) |
| | | </if> |
| | | <if test="condition != null and condition != ''"> |
| | | and (b.chineseName LIKE CONCAT('%',#{condition},'%') or b.englishName LIKE CONCAT('%',#{condition},'%') or b.frenchName LIKE CONCAT('%',#{condition},'%')) |
| | | </if> |
| | | </where> |
| | | ) as o |
| | | order by o.id desc |
| | | </select> |
| | | |
| | |
| | | //法文名称 |
| | | @TableField("frenchName") |
| | | private String frenchName; |
| | | /** |
| | | * 经度 |
| | | */ |
| | | private Double lon; |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | private Double lat; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | |
| | | this.frenchName = frenchName; |
| | | } |
| | | |
| | | public Double getLon() { |
| | | return lon; |
| | | } |
| | | |
| | | public void setLon(Double lon) { |
| | | this.lon = lon; |
| | | } |
| | | |
| | | public Double getLat() { |
| | | return lat; |
| | | } |
| | | |
| | | public void setLat(Double lat) { |
| | | this.lat = lat; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "City{" + |
| | |
| | | package com.stylefeng.guns.modular.system.util.GoogleMap; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.google.maps.*; |
| | |
| | | FindPlaceFromTextRequest request = new FindPlaceFromTextRequest(context); |
| | | request.input(input); |
| | | request.inputType(FindPlaceFromTextRequest.InputType.TEXT_QUERY); |
| | | System.err.println("findplacefromtext(请求参数)--->" + input); |
| | | FindPlaceFromText findPlaceFromText = request.await(); |
| | | PlacesSearchResult[] candidates = findPlaceFromText.candidates; |
| | | System.err.println("findplacefromtext(返回结果)--->" + JSON.toJSONString(candidates)); |
| | | FindPlaceFromTextVo vo = null; |
| | | if(candidates.length > 0){ |
| | | vo = new FindPlaceFromTextVo(); |
| | |
| | | request.query(query); |
| | | PlacesSearchResponse placesSearchResponse = request.await(); |
| | | PlacesSearchResult[] results = placesSearchResponse.results; |
| | | System.err.println("textsearch--->" + JSON.toJSONString(results)); |
| | | FindPlaceFromTextVo vo = null; |
| | | if(results.length > 0){ |
| | | vo = new FindPlaceFromTextVo(); |
| | |
| | | |
| | | spring: |
| | | datasource: |
| | | url: jdbc:mysql://127.0.0.1:3306/igotravel?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | url: jdbc:mysql://192.168.110.80/igotravel?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: 123456 |
| | | db-name: igotravel #用来搜集数据库的所有表 |
| | |
| | | |
| | | spring: |
| | | datasource: |
| | | url: jdbc:mysql://127.0.0.1:3306/igotravel?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B0 |
| | | url: jdbc:mysql://192.168.110.80/igotravel?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B0 |
| | | username: root |
| | | password: HjKbXilb9zajmXbl |
| | | password: 123456 |
| | | db-name: guns #用来搜集数据库的所有表 |
| | | filters: wall,mergeStat |
| | | |
| | |
| | | server: |
| | | port: 8010 |
| | | |
| | | guns: |
| | | swagger-open: false #是否开启swagger (true/false) |
| | | kaptcha-open: false #是否开启登录时验证码 (true/false) |
| | | spring-session-open: false #是否开启spring session,如果是多机环境需要开启(true/false) |
| | | session-invalidate-time: 1800 #session失效时间(只在单机环境下生效,多机环境在SpringSessionConfig类中配置) 单位:秒 |
| | | session-validation-interval: 900 #多久检测一次失效的session(只在单机环境下生效) 单位:秒 |
| | | # file-upload-path: C:\Users\hi\Desktop\ #文件上传目录(不配置的话为java.io.tmpdir目录) |
| | | # picture-server-address: http://192.168.0.43/resources/ #图片服务器地址 |
| | | file-upload-path: C:\Users\Administrator\Desktop\apache-tomcat-8.0.33\webapps\ROOT\upload\ #文件上传目录(不配置的话为java.io.tmpdir目录) |
| | | picture-server-address: http://139.9.249.67:8080/upload/ #图片服务器地址 |
| | | rest-url: http://139.9.249.67:8080/rest/ #前端接口调用基础路径 |
| | | |
| | | spring: |
| | | profiles: |
| | | active: @spring.active@ |
| | | mvc: |
| | | static-path-pattern: /static/** |
| | | view: |
| | | prefix: /WEB-INF/view |
| | | devtools: |
| | | restart: |
| | | enabled: false |
| | | additional-paths: src/main/java |
| | | exclude: static/**,WEB-INF/view/** |
| | | servlet: |
| | | multipart: |
| | | max-request-size: 100MB |
| | | max-file-size: 100MB |
| | | |
| | | mybatis-plus: |
| | | type-aliases-package: com.stylefeng.guns.modular.system.model |
| | | global-config: |
| | | id-type: 0 #0:数据库ID自增 1:用户输入id 2:全局唯一id(IdWorker) 3:全局唯一ID(uuid) |
| | | db-column-underline: false |
| | | configuration: |
| | | configuration.map-underscore-to-camel-case: true #是否开启自动驼峰命名规则(camel case)映射 |
| | | log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl #输出Sql,如需打印Sql注释该配置 |
| | | |
| | | |
| | | --- |
| | | |
| | | spring: |
| | | datasource: |
| | | url: jdbc:mysql://127.0.0.1:3306/igotravel?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B0 |
| | | username: root |
| | | password: HjKbXilb9zajmXbl |
| | | db-name: guns #用来搜集数据库的所有表 |
| | | filters: wall,mergeStat |
| | | |
| | | ################# 测试环境 ################### |
| | | #spring: |
| | | # datasource: |
| | | # url: jdbc:mysql://127.0.0.1:3306/igotravel?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | # username: root |
| | | # password: 123456 |
| | | # db-name: igotravel #用来搜集数据库的所有表 |
| | | # filters: wall,mergeStat |
| | | |
| | | |
| | | #多数据源情况的配置 |
| | | guns: |
| | | muti-datasource: |
| | | open: false |
| | | url: jdbc:mysql://120.24.34.190:3306/mask?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8 |
| | | username: root |
| | | password: Root2020! |
| | | dataSourceNames: |
| | | - dataSourceGuns |
| | | - dataSourceBiz |
| | | |
| | | |
| | | --- |
| | | |
| | | filePath: /usr/local/server/orderPostionFile/ #存储订单轨迹文件路径 |
| | | #filePath: d:/orderPostionFile/ #存储订单轨迹文件路径 |
| | | |
| | | #quartz配置 |
| | | spring: |
| | | quartz: |
| | | properties: |
| | | org: |
| | | quartz: |
| | | scheduler: |
| | | instanceName: MyDefaultQuartzScheduler |
| | | instanceId: AUTO |
| | | jobStore: |
| | | class: org.quartz.impl.jdbcjobstore.JobStoreTX |
| | | driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate |
| | | tablePrefix: qrtz_ |
| | | isClustered: false |
| | | clusterCheckinInterval: 10000 |
| | | useProperties: false |
| | | threadPool: |
| | | class: org.quartz.simpl.SimpleThreadPool |
| | | threadCount: 10 |
| | | threadPriority: 5 |
| | | threadsInheritContextClassLoaderOfInitializingThread: true |
| | | job-store-type: jdbc |
| | | |
| | | --- |
| | | |
| | | spring: |
| | | mail: |
| | | host: smtp.gmail.com # 配置 smtp 服务器地址 |
| | | port: 465 # smtp 服务器的端口 |
| | | username: i-gotech@i-go.group # 配置邮箱用户名(你的邮箱地址) |
| | | password: mhizkqkhuknbitps # 配置申请到的授权码(刚让复制的授权码) |
| | | default-encoding: UTF-8 # 配置邮件编码 |
| | | properties: |
| | | mail: |
| | | smtp: |
| | | socketFactoryClass: javax.net.ssl.SSLSocketFactory # 配饰 SSL 加密工厂 |
| | | debug: true |
| | | from: i-gotech@i-go.group # 发送方邮件,配在yml中可方便更改 |
| | | template-path: /usr/local/nginx/html/mailbox/ |
| | | |
| | | --- |
| | | #支付回调地址 |
| | | #正式环境 |
| | | #callbackPath: https://okyueche.com:443/user |
| | | #测试环境 |
| | | callbackPath: http://182.160.16.251:8010 |
| | | |
| | | --- |
| | | active: @spring.active@ |
| | |
| | | </springProfile> |
| | | |
| | | <springProfile name="produce"> |
| | | <root level="warn"> |
| | | <root level="info"> |
| | | <!-- 生产环境最好不配置console写文件 --> |
| | | <appender-ref ref="DEBUG_FILE" /> |
| | | <appender-ref ref="INFO_FILE" /> |
| | |
| | | } |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tOpenCity/add", function(data){ |
| | | Feng.success("添加成功!"); |
| | | window.parent.TOpenCity.table.refresh(); |
| | | TOpenCityInfoDlg.close(); |
| | | if(data.code == 200){ |
| | | Feng.success("添加成功!"); |
| | | window.parent.TOpenCity.table.refresh(); |
| | | TOpenCityInfoDlg.close(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | },function(data){ |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | |
| | | } |
| | | |
| | | var id1=$("#id1").val(); |
| | | if((null == id1 || '' == id1) && '' != num2){ |
| | | Feng.error("请选择通用优惠券"); |
| | | return; |
| | | } |
| | | var id2=$("#id2").val(); |
| | | if((null == id2 || '' == id2) && '' != num4){ |
| | | Feng.error("请选择专车优惠券"); |
| | | return; |
| | | } |
| | | var id3=$("#id3").val(); |
| | | var id4=$("#id4").val(); |
| | | var obj = $("#obj").val(); |
| | |
| | | public static String getAllTime() { |
| | | return formatDate(new Date(), "yyyyMMddHHmmss"); |
| | | } |
| | | |
| | | public static int getNowWeekDay() { |
| | | Calendar canlendar = Calendar.getInstance(); // java.util包 |
| | | int week= canlendar.get(Calendar.DAY_OF_WEEK); |
| | | return week == 0 ? 7 : week - 1; |
| | | } |
| | | /** |
| | | * 获取YYYY-MM-DD HH:mm:ss格式 |
| | | */ |
| | |
| | | package com.stylefeng.guns.modular.api; |
| | | |
| | | |
| | | import com.stylefeng.guns.modular.system.model.City; |
| | | import com.stylefeng.guns.modular.system.service.IOpenCityBusinessService; |
| | | import com.stylefeng.guns.modular.system.service.IOpenCityService; |
| | | import com.stylefeng.guns.modular.system.service.IUserInfoService; |
| | |
| | | }) |
| | | public ResultUtil openCity(Double lat, Double lnt, Integer language){ |
| | | try { |
| | | String s = openCityService.openCity(lat, lnt, language); |
| | | City city = openCityService.openCity(lat, lnt, language); |
| | | if(null == city){ |
| | | return ResultUtil.error(""); |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("name", s); |
| | | map.put("name", language == 1 ? city.getChineseName() : language == 2 ? city.getEnglishName() : city.getFrenchName()); |
| | | map.put("content", language == 1 ? city.getCountryChineseName() : language == 2 ? city.getCountryEnglishName() : city.getCountryFrenchName()); |
| | | return ResultUtil.success(map); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | map.put("name", language == 1 ? "打车订单取消" : language == 2 ? "Ride order cancelled" : "Commande de trajet annulée"); |
| | | } |
| | | if(4 == orderType){ |
| | | map.put("name", language == 1 ? "包裹订单取消" : language == 2 ? "Parcel order cancellation" : "Annulation de commande de colis"); |
| | | map.put("name", language == 1 ? "包裹订单取消" : language == 2 ? "Parcel order cancellation" : "Annulation de commande de livraison"); |
| | | } |
| | | } |
| | | List<Map<String, Object>> list = orderPrivateCarService.queryMyTravelRecord(language, uid);//专车 |
| | | for (Map<String, Object> map : list) { |
| | | map.put("name", name); |
| | | } |
| | | name = language == 1 ? "包裹" : language == 2 ? "Package" : "Livraison"; |
| | | name = language == 1 ? "包裹" : language == 2 ? "Delivery" : "Livraison"; |
| | | List<Map<String, Object>> list3 = orderLogisticsService.queryMyTravelRecord(language, uid);//小件物流 |
| | | for (Map<String, Object> map : list3) { |
| | | map.put("name", name); |
| | |
| | | |
| | | //添加消息 |
| | | systemNoticeService.addSystemNotice(1, language == 1 ? "您的市内包裹订单已下单成功,我们正在为您指派司机,请稍后!" : |
| | | language == 2 ? "You've placed the package order successfully, we are assigning you a driver, please wait." |
| | | : "Vous avez passé la commande de colis avec succès, nous vous attribuons un chauffeur, veuillez patienter.", orderLogistics.getUserId(), 1); |
| | | language == 2 ? "You've placed the delivery order successfully, we are assigning you a driver, please wait." |
| | | : "Vous avez passé la commande de livraison avec succès, nous vous attribuons un chauffeur, veuillez patienter.", orderLogistics.getUserId(), 1); |
| | | |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | | baseWarpper.setId(orderLogistics.getId()); |
| | |
| | | }).start(); |
| | | |
| | | systemNoticeService.addSystemNotice(1, language == 1 ? "您已成功完成包裹订单支付,谢谢使用!" : language == 2 |
| | | ? "You've paid for the package order successfully, thank you for using I-GO" : |
| | | "Vous avez payé la commande de colis avec succès, merci d’utiliser I-GO", uid, 1); |
| | | ? "You've paid for the delivery order successfully, thank you for using I-GO" : |
| | | "Vous avez payé la commande de livraison avec succès, merci d’utiliser I-GO", uid, 1); |
| | | this.pushOrder(orderLogistics);//推单 |
| | | } |
| | | |
| | |
| | | }).start(); |
| | | |
| | | systemNoticeService.addSystemNotice(1, language == 1 ? "您已成功完成包裹订单支付,谢谢使用!" : language == 2 |
| | | ? "You've paid for the package order successfully, thank you for using I-GO" : |
| | | "Vous avez payé la commande de colis avec succès, merci d’utiliser I-GO", uid, 1); |
| | | ? "You've paid for the delivery order successfully, thank you for using I-GO" : |
| | | "Vous avez payé la commande de livraison avec succès, merci d’utiliser I-GO", uid, 1); |
| | | |
| | | this.pushOrder(orderLogistics);//推单 |
| | | } |
| | |
| | | }).start(); |
| | | |
| | | systemNoticeService.addSystemNotice(1, language == 1 ? "您已成功完成包裹订单差价支付,谢谢使用!" : language == 2 |
| | | ? "You've paid for the difference of package order successfully, thank you for using I-GO" |
| | | : "Vous avez payé la différence de commande de colis avec succès, merci d’utiliser I-GO", uid, 1); |
| | | ? "You've paid for the difference of delivery order successfully, thank you for using I-GO" |
| | | : "Vous avez payé la différence de commande de livraison avec succès, merci d’utiliser I-GO", uid, 1); |
| | | } |
| | | |
| | | if(payType == 4){//现金支付 |
| | |
| | | }).start(); |
| | | |
| | | systemNoticeService.addSystemNotice(1, language == 1 ? "您已成功完成包裹订单差价支付,谢谢使用!" : language == 2 |
| | | ? "You've paid for the difference of package order successfully, thank you for using I-GO" |
| | | : "Vous avez payé la différence de commande de colis avec succès, merci d’utiliser I-GO", uid, 1); |
| | | ? "You've paid for the difference of delivery order successfully, thank you for using I-GO" |
| | | : "Vous avez payé la différence de commande de livraison avec succès, merci d’utiliser I-GO", uid, 1); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | |
| | | systemNoticeService.addSystemNotice(1, language == 1 ? "您已成功完成包裹订单支付,谢谢使用!" : language == 2 |
| | | ? "You've paid for the package order successfully, thank you for using I-GO" : |
| | | "Vous avez payé la commande de colis avec succès, merci d’utiliser I-GO", orderLogistics.getUserId(), 1); |
| | | ? "You've paid for the delivery order successfully, thank you for using I-GO" : |
| | | "Vous avez payé la commande de livraison avec succès, merci d’utiliser I-GO", orderLogistics.getUserId(), 1); |
| | | |
| | | this.pushOrder(orderLogistics);//推单 |
| | | }else{ |
| | |
| | | }).start(); |
| | | |
| | | systemNoticeService.addSystemNotice(1, language == 1 ? "您已成功完成包裹订单差价支付,谢谢使用!" : language == 2 |
| | | ? "You've paid for the difference of package order successfully, thank you for using I-GO" |
| | | : "Vous avez payé la différence de commande de colis avec succès, merci d’utiliser I-GO", orderLogistics.getUserId(), 1); |
| | | ? "You've paid for the difference of delivery order successfully, thank you for using I-GO" |
| | | : "Vous avez payé la différence de commande de livraison avec succès, merci d’utiliser I-GO", orderLogistics.getUserId(), 1); |
| | | }else{ |
| | | System.err.println("预支付数据异常(orderId = " + id + ")"); |
| | | } |
| | |
| | | endTime = dateUtil.getStartOrEndDate(endTime, "end"); |
| | | List<Map<String, Object>> list = orderLogisticsMapper.queryInvoiceOrder(type, startTime, endTime, startMoney, endMoney, uid, orderType); |
| | | for (Map<String, Object> map : list) { |
| | | map.put("orderName", language == 1 ? "包裹订单" : language == 2 ? "Package" : "Livraison"); |
| | | map.put("orderName", language == 1 ? "包裹订单" : language == 2 ? "Delivery" : "Livraison"); |
| | | if(null != map.get("time")){ |
| | | String time = map.get("time").toString(); |
| | | map.put("time", DateUtil.conversionFormat(language, time)); |
| | |
| | | } |
| | | |
| | | //添加消息 |
| | | systemNoticeService.addSystemNotice(1, language == 1 ? "您已成功取消包裹订单,谢谢使用!" : language == 2 ? "You've cancelled the package order successfully, thank you for using I-GO " |
| | | : "Vous avez annulé la commande de colis avec succès, merci d’utiliser I-GO", orderLogistics.getUserId(), 1); |
| | | systemNoticeService.addSystemNotice(1, language == 1 ? "您已成功取消包裹订单,谢谢使用!" : language == 2 ? "You've cancelled the delivery order successfully, thank you for using I-GO " |
| | | : "Vous avez annulé la commande de livraison avec succès, merci d’utiliser I-GO", orderLogistics.getUserId(), 1); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", integer); |
| | | return ResultUtil.success(map); |
| | |
| | | orderCancel.setPayType(3); |
| | | orderCancelService.updateById(orderCancel); |
| | | |
| | | //添加已收入明细 |
| | | incomeService.saveData(1, orderPrivateCar.getCompanyId(), 3, orderPrivateCar.getId(), 1, query.getMoney()); |
| | | //添加已收入明细 |
| | | Company company = companyService.selectById(orderPrivateCar.getCompanyId()); |
| | | Double taxi = company.getSpeMoney(); |
| | | // //添加已收入明细 |
| | | // incomeService.saveData(1, orderPrivateCar.getCompanyId(), 3, orderPrivateCar.getId(), 1, query.getMoney()); |
| | | // //添加已收入明细 |
| | | // Company company = companyService.selectById(orderPrivateCar.getCompanyId()); |
| | | // Double taxi = company.getSpeMoney(); |
| | | BigDecimal c =new BigDecimal(query.getMoney());//司机收入 |
| | | incomeService.saveData(2, orderPrivateCar.getDriverId(), 3, orderPrivateCar.getId(), 1, c.doubleValue()); |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | |
| | | fileWriter.write(document.html()); |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | FileInputStream fileInputStream = new FileInputStream(file); |
| | | |
| | | File file1 = new File("/usr/local/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | |
| | | } |
| | | try { |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf(fileInputStream, "IGO", fileOutputStream); |
| | | HtmlToPdfUtils.convertToPdf("/usr/local/nginx/html/files/html/ride_receipt_" + orderId + ".html", "IGO", fileOutputStream); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | System.out.println("html转pdf异常"); |
| | |
| | | fileWriter.write(document.html()); |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | FileInputStream fileInputStream = new FileInputStream(file); |
| | | |
| | | File file1 = new File("/usr/local/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | |
| | | } |
| | | try { |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf(fileInputStream, "IGO", fileOutputStream); |
| | | HtmlToPdfUtils.convertToPdf("/usr/local/nginx/html/files/html/ride_receipt_" + orderId + ".html", "IGO", fileOutputStream); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | System.out.println("html转pdf异常"); |
| | |
| | | orderCancelService.updateById(query1); |
| | | } |
| | | |
| | | //添加已收入明细 |
| | | incomeService.saveData(1, orderPrivateCar.getCompanyId(), 3, orderPrivateCar.getId(), 1, query.getAmount()); |
| | | //添加已收入明细 |
| | | Company company = companyService.selectById(orderPrivateCar.getCompanyId()); |
| | | Double taxi = company.getSpeMoney(); |
| | | // //添加已收入明细 |
| | | // incomeService.saveData(1, orderPrivateCar.getCompanyId(), 3, orderPrivateCar.getId(), 1, query.getAmount()); |
| | | // //添加已收入明细 |
| | | // Company company = companyService.selectById(orderPrivateCar.getCompanyId()); |
| | | // Double taxi = company.getSpeMoney(); |
| | | BigDecimal c =new BigDecimal(query.getAmount());//司机收入 |
| | | incomeService.saveData(2, orderPrivateCar.getDriverId(), 3, orderPrivateCar.getId(), 1, c.doubleValue()); |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | |
| | | fileWriter.write(document.html()); |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | FileInputStream fileInputStream = new FileInputStream(file); |
| | | |
| | | File file1 = new File("/usr/local/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | |
| | | } |
| | | try { |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf(fileInputStream, "IGO", fileOutputStream); |
| | | HtmlToPdfUtils.convertToPdf("/usr/local/nginx/html/files/html/ride_receipt_" + id + ".html", "IGO", fileOutputStream); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | System.out.println("html转pdf异常"); |
| | |
| | | |
| | | |
| | | <select id="queryByType" resultType="java.lang.String"> |
| | | select content from t_agreement where `type` = #{type} and flag != 3 and `language` = 1 |
| | | select content from t_agreement where `type` = #{type} and flag != 3 |
| | | <if test="null != useType"> |
| | | and useType = #{useType} |
| | | </if> |
| | |
| | | left join t_sys_coupon_record e on (a.intercityCouponId = e.id) |
| | | left join t_user_activity f on (a.userActivityId = f.id) |
| | | where a.`enable` = 2 and f.status = 3 and now() between a.startTime and a.endTime and a.money <= #{money} |
| | | and (b.companyId = #{companyId} and c.companyId = #{companyId} and d.companyId = #{companyId} and e.companyId = #{companyId}) |
| | | and (b.companyId = #{companyId} or c.companyId = #{companyId} or d.companyId = #{companyId} or e.companyId = #{companyId}) |
| | | </select> |
| | | </mapper> |
| | |
| | | //法文名称 |
| | | @TableField("frenchName") |
| | | private String frenchName; |
| | | private String lon; |
| | | private String lat; |
| | | private String countryChineseName; |
| | | private String countryEnglishName; |
| | | private String countryFrenchName; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | |
| | | this.frenchName = frenchName; |
| | | } |
| | | |
| | | public String getLon() { |
| | | return lon; |
| | | } |
| | | |
| | | public void setLon(String lon) { |
| | | this.lon = lon; |
| | | } |
| | | |
| | | public String getLat() { |
| | | return lat; |
| | | } |
| | | |
| | | public void setLat(String lat) { |
| | | this.lat = lat; |
| | | } |
| | | |
| | | public String getCountryChineseName() { |
| | | return countryChineseName; |
| | | } |
| | | |
| | | public void setCountryChineseName(String countryChineseName) { |
| | | this.countryChineseName = countryChineseName; |
| | | } |
| | | |
| | | public String getCountryEnglishName() { |
| | | return countryEnglishName; |
| | | } |
| | | |
| | | public void setCountryEnglishName(String countryEnglishName) { |
| | | this.countryEnglishName = countryEnglishName; |
| | | } |
| | | |
| | | public String getCountryFrenchName() { |
| | | return countryFrenchName; |
| | | } |
| | | |
| | | public void setCountryFrenchName(String countryFrenchName) { |
| | | this.countryFrenchName = countryFrenchName; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "City{" + |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 司机每天活动数量 |
| | | */ |
| | | @TableName("t_driver_activity_history") |
| | | public class DriverActivityHistory { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @TableField("id") |
| | | private Integer id; |
| | | /** |
| | | * 活动日期 |
| | | */ |
| | | @TableField("day") |
| | | private Date day; |
| | | /** |
| | | * 司机id |
| | | */ |
| | | @TableField("driverId") |
| | | private Integer driverId; |
| | | /** |
| | | * 活动类型(1=邀请司机注册,2=邀请用户注册,3=累计在线,4=订单量) |
| | | */ |
| | | @TableField("type") |
| | | private Integer type; |
| | | /** |
| | | * 活动id |
| | | */ |
| | | @TableField("activityId") |
| | | private Integer activityId; |
| | | /** |
| | | * 是否完成(1=否,2=完成) |
| | | */ |
| | | @TableField("carryOut") |
| | | private Integer carryOut; |
| | | /** |
| | | * 奖励金额 |
| | | */ |
| | | @TableField("money") |
| | | private Double money; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @TableField("insertTime") |
| | | private Date insertTime; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Date getDay() { |
| | | return day; |
| | | } |
| | | |
| | | public void setDay(Date day) { |
| | | this.day = day; |
| | | } |
| | | |
| | | public Integer getDriverId() { |
| | | return driverId; |
| | | } |
| | | |
| | | public void setDriverId(Integer driverId) { |
| | | this.driverId = driverId; |
| | | } |
| | | |
| | | public Integer getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(Integer type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public Integer getActivityId() { |
| | | return activityId; |
| | | } |
| | | |
| | | public void setActivityId(Integer activityId) { |
| | | this.activityId = activityId; |
| | | } |
| | | |
| | | public Integer getCarryOut() { |
| | | return carryOut; |
| | | } |
| | | |
| | | public void setCarryOut(Integer carryOut) { |
| | | this.carryOut = carryOut; |
| | | } |
| | | |
| | | public Double getMoney() { |
| | | return money; |
| | | } |
| | | |
| | | public void setMoney(Double money) { |
| | | this.money = money; |
| | | } |
| | | |
| | | public Date getInsertTime() { |
| | | return insertTime; |
| | | } |
| | | |
| | | public void setInsertTime(Date insertTime) { |
| | | this.insertTime = insertTime; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "DriverActivityHistory{" + |
| | | "id=" + id + |
| | | ", day=" + day + |
| | | ", driverId=" + driverId + |
| | | ", type=" + type + |
| | | ", activityId=" + activityId + |
| | | ", carryOut=" + carryOut + |
| | | ", money=" + money + |
| | | ", insertTime=" + insertTime + |
| | | '}'; |
| | | } |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.system.model.City; |
| | | import com.stylefeng.guns.modular.system.model.OpenCity; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | String openCity(Double lat, Double lnt, Integer language) throws Exception; |
| | | City openCity(Double lat, Double lnt, Integer language) throws Exception; |
| | | } |
| | |
| | | baseWarpper.setName("跨城出行"); |
| | | break; |
| | | case 4: |
| | | baseWarpper.setName(language == 1 ? "包裹" : language == 2 ? "Package" : "Livraison"); |
| | | baseWarpper.setName(language == 1 ? "包裹" : language == 2 ? "Delivery" : "Livraison"); |
| | | break; |
| | | case 5: |
| | | baseWarpper.setName("跨城小件物流"); |
| | |
| | | // baseWarpper.setId(3); |
| | | // break; |
| | | case 4: |
| | | baseWarpper.setName(language == 1 ? "包裹" : language == 2 ? "Package" : "Livraison"); |
| | | baseWarpper.setName(language == 1 ? "包裹" : language == 2 ? "Delivery" : "Livraison"); |
| | | baseWarpper.setId(4); |
| | | break; |
| | | // case 5: |
| | |
| | | // baseWarpper.setId(3); |
| | | // break; |
| | | case 4: |
| | | baseWarpper.setName(language == 1 ? "包裹" : language == 2 ? "Package" : "Livraison"); |
| | | baseWarpper.setName(language == 1 ? "包裹" : language == 2 ? "Delivery" : "Livraison"); |
| | | baseWarpper.setId(4); |
| | | break; |
| | | // case 5: |
| | |
| | | baseWarpper.setName(language == 1 ? city.getChineseName() : language == 2 ? city.getEnglishName() : language == 3 ? city.getFrenchName() : city.getEnglishName()); |
| | | baseWarpper.setLon(null != c.getLon() ? c.getLon() : 0); |
| | | baseWarpper.setLat(null != c.getLat() ? c.getLat() : 0); |
| | | baseWarpper.setContent(language == 1 ? city.getCountryChineseName() : language == 2 ? city.getCountryEnglishName() : language == 3 ? city.getCountryFrenchName() : city.getEnglishName()); |
| | | list.add(baseWarpper); |
| | | } |
| | | return list; |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public String openCity(Double lat, Double lnt, Integer language) throws Exception { |
| | | public City openCity(Double lat, Double lnt, Integer language) throws Exception { |
| | | if(null == language){ |
| | | language = 2; |
| | | } |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lnt); |
| | | if(null == reverseGeocode){ |
| | | return ""; |
| | | return null; |
| | | } |
| | | AddressComponentsVo[] addressComponentsVos = reverseGeocode.getAddressComponentsVos(); |
| | | String[] city = new String[addressComponentsVos.length]; |
| | |
| | | } |
| | | List<OpenCity> openCities = openCityMapper.queryByCode(city); |
| | | if(openCities.size() == 0){ |
| | | return ""; |
| | | return null; |
| | | } |
| | | City city1 = cityService.selectById(openCities.get(0).getCityId()); |
| | | return language == 1 ? city1.getChineseName() : language == 2 ? city1.getEnglishName() : city1.getFrenchName(); |
| | | return city1; |
| | | } |
| | | } |
| | |
| | | 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.system.dao.DriverActivityRegisteredMapper; |
| | | import com.stylefeng.guns.modular.system.dao.DriverMapper; |
| | | import com.stylefeng.guns.modular.system.dao.UserActivityInviteMapper; |
| | | import com.stylefeng.guns.modular.system.dao.UserInfoMapper; |
| | | import com.stylefeng.guns.modular.system.dao.*; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | |
| | | |
| | | @Resource |
| | | private DriverActivityRegisteredMapper driverActivityRegisteredMapper; |
| | | |
| | | @Resource |
| | | private DriverActivityHistoryMapper driverActivityHistoryMapper; |
| | | |
| | | @Autowired |
| | | private IIncomeService incomeService; |
| | |
| | | bigDecimal = bigDecimal.add(new BigDecimal(String.valueOf(map.get("money")))); |
| | | incomeService.saveData(2, driver.getId(), 1, Integer.valueOf(String.valueOf(map.get("id"))), null, Double.valueOf(String.valueOf(map.get("money")))); |
| | | } |
| | | DriverActivityHistory dah = new DriverActivityHistory(); |
| | | dah.setActivityId(Integer.valueOf(map.get("id").toString())); |
| | | dah.setDriverId(uid); |
| | | dah.setType(2); |
| | | DriverActivityHistory driverActivityHistory = driverActivityHistoryMapper.selectOne(dah); |
| | | driverActivityHistory.setCarryOut(2); |
| | | driverActivityHistoryMapper.updateById(driverActivityHistory); |
| | | } |
| | | driver.setActivityMoney(bigDecimal.add(new BigDecimal(driver.getActivityMoney())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveActivityMoney(bigDecimal.add(new BigDecimal(driver.getLaveActivityMoney())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | |
| | | if(null != userInfo1 && uid.compareTo(userInfo1.getId()) != 0){ |
| | | return ResultUtil.error(language == 1 ? "邮箱已被使用" : language == 2 ? "E-mail address is already in use." : "L’adresse e-mail est déjà utilisée."); |
| | | } |
| | | |
| | | // if(null != userInfo1){ |
| | | // userInfo1.setOpenId(userInfo.getOpenId()); |
| | | // userInfo1.setUnionid(userInfo.getUnionid()); |
| | | // userInfo1.setAppletsOpenId(userInfo.getAppletsOpenId()); |
| | | // userInfo1.setAvatar(userInfo.getAvatar()); |
| | | // userInfo1.setSex(userInfo.getSex()); |
| | | // userInfo1.setNickName(userInfo.getNickName()); |
| | | // this.updateById(userInfo1); |
| | | // |
| | | // this.deleteById(userInfo.getId());//删除原有数据 |
| | | // //还原之前账号领取的注册优惠券 |
| | | // List<UserCouponRecord> list = userCouponRecordService.selectList(new EntityWrapper<UserCouponRecord>().eq("userId", userInfo.getId())); |
| | | // for(UserCouponRecord ucr : list){ |
| | | // if(ucr.getActivityType() == 1){//赠送 |
| | | // |
| | | // } |
| | | // if(ucr.getActivityType() == 2){//注册 |
| | | // UserActivityRegistered userActivityRegistered = userActivityRegisteredService.selectById(ucr.getCouponActivityId()); |
| | | // userActivityRegistered.setLaveNum(userActivityRegistered.getLaveNum() + 1); |
| | | // userActivityRegistered.setLavePrice(userActivityRegistered.getLavePrice() + ucr.getMoney()); |
| | | // userActivityRegisteredService.updateById(userActivityRegistered); |
| | | // } |
| | | // if(ucr.getActivityType() == 3){//邀请 |
| | | // |
| | | // } |
| | | // if(ucr.getActivityType() == 4){//充值 |
| | | // |
| | | // } |
| | | // userCouponRecordService.deleteById(ucr.getId()); |
| | | // } |
| | | // |
| | | // |
| | | // //获取新的token等数据 |
| | | // String token = this.getToken(userInfo1, ""); |
| | | // LoginWarpper loginWarpper = new LoginWarpper(); |
| | | // loginWarpper.setId(userInfo1.getId()); |
| | | // loginWarpper.setToken(token); |
| | | // loginWarpper.setAppid(UUIDUtil.getRandomCode()); |
| | | // loginWarpper.setPhone(2); |
| | | // loginWarpper.setEmail(userInfo1.getEmail()); |
| | | // return ResultUtil.success(loginWarpper); |
| | | // } |
| | | |
| | | userInfo.setEmail(email); |
| | | userInfo.setUpdateTime(new Date()); |
| | | userInfo.setUpdateUser(userInfo.getId()); |
| | | this.updateById(userInfo); |
| | | // if(type == 1){//注册成功后发送邮件 |
| | | //// EmailUtil.getMimeMessage(email, "注册账户", ""); |
| | | // } |
| | | return ResultUtil.success(new LoginWarpper()); |
| | | } |
| | | |
| | |
| | | date = datetime.substring(0, datetime.indexOf(" ")); |
| | | } |
| | | String[] split = date.split("-"); |
| | | //'%m-%d %H:%i' |
| | | String m = ""; |
| | | switch (language){ |
| | | case 2: |
| | | split[1] = englishMonth(Integer.valueOf(split[0])); |
| | | datetime = split[0] + " " + split[1]; |
| | | m = englishMonth(Integer.valueOf(split[0])); |
| | | datetime = m + " " + split[1]; |
| | | if(index != -1){ |
| | | datetime += " " + time; |
| | | } |
| | | break; |
| | | case 3: |
| | | split[1] = frenchMonth(Integer.valueOf(split[0])); |
| | | datetime = split[1] + " " + split[0]; |
| | | m = frenchMonth(Integer.valueOf(split[0])); |
| | | datetime = split[1] + " " + m; |
| | | if(index != -1){ |
| | | datetime += " " + time; |
| | | } |
| | |
| | | import com.itextpdf.kernel.pdf.PdfWriter; |
| | | import com.itextpdf.layout.font.FontProvider; |
| | | |
| | | import java.io.FileInputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.io.OutputStream; |
| | |
| | | |
| | | pdfWriter.close(); |
| | | pdfDocument.close(); |
| | | inputStream.close(); |
| | | } |
| | | |
| | | |
| | | |
| | | public static void convertToPdf(String fileName, String waterMark, OutputStream outputStream) throws IOException { |
| | | InputStream htmlStream = new FileInputStream(fileName); |
| | | PdfWriter pdfWriter = new PdfWriter(outputStream); |
| | | PdfDocument pdfDocument = new PdfDocument(pdfWriter); |
| | | //设置为A4大小 |
| | | pdfDocument.setDefaultPageSize(PageSize.A4); |
| | | //添加水印 |
| | | pdfDocument.addEventHandler(PdfDocumentEvent.END_PAGE, new WaterMarkEventHandler(waterMark)); |
| | | |
| | | //添加页码 |
| | | //pdfDocument.addEventHandler(PdfDocumentEvent.END_PAGE,new PageEventHandler()); |
| | | // //添加中文字体支持 |
| | | // ConverterProperties properties = new ConverterProperties(); |
| | | // FontProvider fontProvider = new FontProvider(); |
| | | // |
| | | // PdfFont sysFont = PdfFontFactory.createFont("STSongStd-Light", "UniGB-UCS2-H", false); |
| | | // fontProvider.addFont(sysFont.getFontProgram(), "UniGB-UCS2-H"); |
| | | // |
| | | // //添加自定义字体,例如微软雅黑 |
| | | // if (StringUtils.isNotBlank(fontPath)){ |
| | | // PdfFont microsoft = PdfFontFactory.createFont(fontPath, PdfEncodings.IDENTITY_H, false); |
| | | // fontProvider.addFont(microsoft.getFontProgram(), PdfEncodings.IDENTITY_H); |
| | | // } |
| | | // |
| | | // properties.setFontProvider(fontProvider); |
| | | HtmlConverter.convertToPdf(htmlStream, pdfDocument); |
| | | |
| | | pdfWriter.close(); |
| | | pdfDocument.close(); |
| | | htmlStream.close(); |
| | | } |
| | | } |