| | |
| | | package com.stylefeng.guns.modular.smallLogistics.server.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | |
| | | }).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()); |
| | |
| | | return map; |
| | | } |
| | | |
| | | @Autowired |
| | | private ISettlementDetailService settlementDetailService; |
| | | @Autowired |
| | | private ISettlementAllocationService settlementAllocationService; |
| | | |
| | | @Autowired |
| | | private ISettlementRecordService settlementRecordService; |
| | | |
| | | @Autowired |
| | | private OrderLogisticsSpreadService spreadService; |
| | | /** |
| | | * 走订单流程 |
| | | * @param orderId |
| | |
| | | * @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"); |
| | | } |
| | | } |
| | | |
| | | List<OrderLogisticsSpread> orderLogisticsId = spreadService.selectList(new EntityWrapper<OrderLogisticsSpread>().eq("orderLogisticsId", orderLogistics.getId()).eq("payType",4)); |
| | | |
| | | |
| | | switch (state){ |
| | | case 3://出发前往预约点 |
| | | orderLogistics.setState(3); |
| | |
| | | driverService.updateById(driver); |
| | | } |
| | | |
| | | if (orderLogistics.getPayType()==4||!orderLogisticsId.isEmpty()){ |
| | | |
| | | System.err.println("1111111111111111111111111"); |
| | | |
| | | double sum = 0; |
| | | if (orderLogistics.getPayType()==4){ |
| | | sum= orderLogistics.getOrderMoney(); |
| | | } |
| | | |
| | | if (!orderLogisticsId.isEmpty()){ |
| | | for (OrderLogisticsSpread orderLogisticsSpread : orderLogisticsId) { |
| | | sum = sum +orderLogisticsSpread.getPrice(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | Company company = companyService.selectById(orderLogistics.getCompanyId()); |
| | | Double speMoney = company.getSameLogisticsMoney(); |
| | | BigDecimal d = null;//企业收入 |
| | | BigDecimal c = null;//司机收入 |
| | | if(company.getIsSameLogisticsFixedOrProportional() == 2){//固定 |
| | | d = new BigDecimal(speMoney); |
| | | c = new BigDecimal(orderLogistics.getOrderMoney()).subtract(d);//只有出行金额参与抽成,其余归属司机 |
| | | } |
| | | if(company.getIsSameLogisticsFixedOrProportional() == 1){//比例 |
| | | Double price = orderLogistics.getOrderMoney(); |
| | | d = new BigDecimal(price).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100), new MathContext(2, RoundingMode.HALF_EVEN))); |
| | | c = new BigDecimal(orderLogistics.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } |
| | | //记录司机待结算金额 |
| | | if(d.compareTo(new BigDecimal(0)) > 0){ |
| | | System.err.println("2222222222222222222222"); |
| | | SettlementDetail settlementDetail = new SettlementDetail(); |
| | | settlementDetail.setOrderId(orderId); |
| | | settlementDetail.setOrderType(1); |
| | | settlementDetail.setDriverId(orderLogistics.getDriverId()); |
| | | settlementDetail.setOrderMoney(sum); |
| | | settlementDetail.setPrice(d.doubleValue()); |
| | | settlementDetail.setCreateTime(new Date()); |
| | | settlementDetailService.insert(settlementDetail); |
| | | |
| | | SettlementAllocation settlementAllocation = settlementAllocationService.selectOne(null); |
| | | if(null != settlementAllocation){ |
| | | JSONObject jsonObject = JSON.parseObject(settlementAllocation.getContent()); |
| | | Double maxPrice = jsonObject.getDouble("maxPrice"); |
| | | List<SettlementDetail> settlementDetailList = settlementDetailService.selectList(new EntityWrapper<SettlementDetail>().eq("driverId", orderLogistics.getDriverId()).isNull("settlementRecordId").last(" and DATE_FORMAT(now(), '%Y-%m-%d') = DATE_FORMAT(createTime, '%Y-%m-%d')")); |
| | | BigDecimal total = new BigDecimal(0); |
| | | for (SettlementDetail detail : settlementDetailList) { |
| | | total = total.add(new BigDecimal(detail.getPrice())); |
| | | } |
| | | if(maxPrice.compareTo(total.doubleValue()) <= 0){ |
| | | SettlementRecord settlementRecord = new SettlementRecord(); |
| | | settlementRecord.setDay(new Date()); |
| | | settlementRecord.setDriverId(orderLogistics.getDriverId()); |
| | | settlementRecord.setType(1); |
| | | settlementRecord.setPaymentStatus(1); |
| | | settlementRecord.setPayMoney(sum); |
| | | settlementRecord.setInsertTime(new Date()); |
| | | settlementRecordService.insert(settlementRecord); |
| | | |
| | | for (SettlementDetail detail : settlementDetailList) { |
| | | detail.setSettlementRecordId(settlementRecord.getId()); |
| | | settlementDetailService.updateById(detail); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | break; |
| | | } |
| | | this.updateById(orderLogistics); |
| | | |
| | | if(6 == state && ToolUtil.isNotEmpty(pickUpCode)){ |
| | | fillInPickUpCode(orderId, pickUpCode, language); |
| | | } |
| | | |
| | | |
| | | // TODO: 2020/6/5 推送状态 |
| | | new Thread(new Runnable() { |
| | |
| | | title_chinese.text(DateUtil.conversionFormat(language, sdf.format(orderLogistics.getTravelTime())) + ",您在I-GO1个订单消费GHS " + orderLogistics.getPayMoney()); |
| | | Element xcf_chinese = document.getElementById("xcf_chinese"); |
| | | xcf_chinese.text("GHS " + orderLogistics.getOrderMoney()); |
| | | if(null != orderLogistics.getCouponMoney() && orderLogistics.getCouponMoney() > 0){ |
| | | Element yhq_chinese = document.getElementById("yhq_chinese"); |
| | | yhq_chinese.text("GHS -" + orderLogistics.getCouponMoney()); |
| | | }else{ |
| | | Element yhq_chinese_div = document.getElementById("yhq_chinese_div"); |
| | | yhq_chinese_div.remove(); |
| | | } |
| | | if(null != orderLogistics.getDiscountMoney() && orderLogistics.getDiscountMoney() > 0){ |
| | | Element zk_chinese = document.getElementById("zk_chinese"); |
| | | zk_chinese.text("GHS -" + orderLogistics.getDiscountMoney()); |
| | | }else{ |
| | | Element zk_chinese_div = document.getElementById("zk_chinese_div"); |
| | | zk_chinese_div.remove(); |
| | | } |
| | | if(null != orderLogistics.getRedPacketMoney() && orderLogistics.getRedPacketMoney() > 0){ |
| | | Element hb_chinese = document.getElementById("hb_chinese"); |
| | | hb_chinese.text("GHS -" + orderLogistics.getRedPacketMoney()); |
| | | }else{ |
| | | Element hb_chinese_div = document.getElementById("hb_chinese_div"); |
| | | hb_chinese_div.remove(); |
| | | } |
| | | Element xj_chinese = document.getElementById("xj_chinese"); |
| | | xj_chinese.text("GHS " + orderLogistics.getOrderMoney()); |
| | | xj_chinese.text("GHS " + orderLogistics.getPayMoney()); |
| | | Element pay_type_chinese = document.getElementById("pay_type_chinese"); |
| | | pay_type_chinese.text("手机支付"); |
| | | Element pay_money_chinese = document.getElementById("pay_money_chinese"); |
| | |
| | | title_english.text(DateUtil.conversionFormat(language, sdf.format(orderLogistics.getTravelTime())) + ",You spent GHS " + orderLogistics.getPayMoney() + " on the trip "); |
| | | Element xcf_english = document.getElementById("xcf_english"); |
| | | xcf_english.text("GHS " + orderLogistics.getOrderMoney()); |
| | | if(null != orderLogistics.getCouponMoney() && orderLogistics.getCouponMoney() > 0){ |
| | | Element yhq_english = document.getElementById("yhq_english"); |
| | | yhq_english.text("GHS -" + orderLogistics.getCouponMoney()); |
| | | }else{ |
| | | Element yhq_english_div = document.getElementById("yhq_english_div"); |
| | | yhq_english_div.remove(); |
| | | } |
| | | if(null != orderLogistics.getDiscountMoney() && orderLogistics.getDiscountMoney() > 0){ |
| | | Element zk_english = document.getElementById("zk_english"); |
| | | zk_english.text("GHS -" + orderLogistics.getDiscountMoney()); |
| | | }else{ |
| | | Element zk_english_div = document.getElementById("zk_english_div"); |
| | | zk_english_div.remove(); |
| | | } |
| | | if(null != orderLogistics.getRedPacketMoney() && orderLogistics.getRedPacketMoney() > 0){ |
| | | Element hb_english = document.getElementById("hb_english"); |
| | | hb_english.text("GHS -" + orderLogistics.getRedPacketMoney()); |
| | | }else{ |
| | | Element hb_english_div = document.getElementById("hb_english_div"); |
| | | hb_english_div.remove(); |
| | | } |
| | | Element xj_english = document.getElementById("xj_english"); |
| | | xj_english.text("GHS " + orderLogistics.getOrderMoney()); |
| | | xj_english.text("GHS " + orderLogistics.getPayMoney()); |
| | | Element pay_type_english = document.getElementById("pay_type_english"); |
| | | pay_type_english.text("Mobile money"); |
| | | Element pay_money_english = document.getElementById("pay_money_english"); |
| | |
| | | title_french.text(DateUtil.conversionFormat(language, sdf.format(orderLogistics.getTravelTime())) + ",Vous consommez GHS " + orderLogistics.getPayMoney() + " sur votre commande i-go1 le "); |
| | | Element xcf_french = document.getElementById("xcf_french"); |
| | | xcf_french.text("GHS " + orderLogistics.getOrderMoney()); |
| | | if(null != orderLogistics.getCouponMoney() && orderLogistics.getCouponMoney() > 0){ |
| | | Element yhq_french = document.getElementById("yhq_french"); |
| | | yhq_french.text("GHS -" + orderLogistics.getCouponMoney()); |
| | | }else{ |
| | | Element yhq_french_div = document.getElementById("yhq_french_div"); |
| | | yhq_french_div.remove(); |
| | | } |
| | | if(null != orderLogistics.getDiscountMoney() && orderLogistics.getDiscountMoney() > 0){ |
| | | Element zk_french = document.getElementById("zk_french"); |
| | | zk_french.text("GHS -" + orderLogistics.getDiscountMoney()); |
| | | }else{ |
| | | Element zk_french_div = document.getElementById("zk_french_div"); |
| | | zk_french_div.remove(); |
| | | } |
| | | if(null != orderLogistics.getRedPacketMoney() && orderLogistics.getRedPacketMoney() > 0){ |
| | | Element hb_french = document.getElementById("hb_french"); |
| | | hb_french.text("GHS -" + orderLogistics.getRedPacketMoney()); |
| | | }else{ |
| | | Element hb_french_div = document.getElementById("hb_french_div"); |
| | | hb_french_div.remove(); |
| | | } |
| | | Element xj_french = document.getElementById("xj_french"); |
| | | xj_french.text("GHS " + orderLogistics.getOrderMoney()); |
| | | xj_french.text("GHS " + orderLogistics.getPayMoney()); |
| | | Element pay_type_french = document.getElementById("pay_type_french"); |
| | | pay_type_french.text("Argent mobile"); |
| | | Element pay_money_french = document.getElementById("pay_money_french"); |
| | |
| | | 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异常"); |
| | |
| | | title_chinese.text(DateUtil.conversionFormat(language, sdf.format(orderLogistics.getTravelTime())) + ",您在I-GO1个订单消费GHS " + orderLogistics.getPayMoney()); |
| | | Element xcf_chinese = document.getElementById("xcf_chinese"); |
| | | xcf_chinese.text("GHS " + orderLogistics.getOrderMoney()); |
| | | if(null != orderLogistics.getCouponMoney() && orderLogistics.getCouponMoney() > 0){ |
| | | Element yhq_chinese = document.getElementById("yhq_chinese"); |
| | | yhq_chinese.text("GHS -" + orderLogistics.getCouponMoney()); |
| | | }else{ |
| | | Element yhq_chinese_div = document.getElementById("yhq_chinese_div"); |
| | | yhq_chinese_div.remove(); |
| | | } |
| | | if(null != orderLogistics.getDiscountMoney() && orderLogistics.getDiscountMoney() > 0){ |
| | | Element zk_chinese = document.getElementById("zk_chinese"); |
| | | zk_chinese.text("GHS -" + orderLogistics.getDiscountMoney()); |
| | | }else{ |
| | | Element zk_chinese_div = document.getElementById("zk_chinese_div"); |
| | | zk_chinese_div.remove(); |
| | | } |
| | | if(null != orderLogistics.getRedPacketMoney() && orderLogistics.getRedPacketMoney() > 0){ |
| | | Element hb_chinese = document.getElementById("hb_chinese"); |
| | | hb_chinese.text("GHS -" + orderLogistics.getRedPacketMoney()); |
| | | }else{ |
| | | Element hb_chinese_div = document.getElementById("hb_chinese_div"); |
| | | hb_chinese_div.remove(); |
| | | } |
| | | Element xj_chinese = document.getElementById("xj_chinese"); |
| | | xj_chinese.text("GHS " + orderLogistics.getOrderMoney()); |
| | | xj_chinese.text("GHS " + orderLogistics.getPayMoney()); |
| | | Element pay_type_chinese = document.getElementById("pay_type_chinese"); |
| | | pay_type_chinese.text("银行卡支付"); |
| | | Element pay_money_chinese = document.getElementById("pay_money_chinese"); |
| | |
| | | title_english.text(DateUtil.conversionFormat(language, sdf.format(orderLogistics.getTravelTime())) + ",You spent GHS " + orderLogistics.getPayMoney() + " on the trip "); |
| | | Element xcf_english = document.getElementById("xcf_english"); |
| | | xcf_english.text("GHS " + orderLogistics.getOrderMoney()); |
| | | if(null != orderLogistics.getCouponMoney() && orderLogistics.getCouponMoney() > 0){ |
| | | Element yhq_english = document.getElementById("yhq_english"); |
| | | yhq_english.text("GHS -" + orderLogistics.getCouponMoney()); |
| | | }else{ |
| | | Element yhq_english_div = document.getElementById("yhq_english_div"); |
| | | yhq_english_div.remove(); |
| | | } |
| | | if(null != orderLogistics.getDiscountMoney() && orderLogistics.getDiscountMoney() > 0){ |
| | | Element zk_english = document.getElementById("zk_english"); |
| | | zk_english.text("GHS -" + orderLogistics.getDiscountMoney()); |
| | | }else{ |
| | | Element zk_english_div = document.getElementById("zk_english_div"); |
| | | zk_english_div.remove(); |
| | | } |
| | | if(null != orderLogistics.getRedPacketMoney() && orderLogistics.getRedPacketMoney() > 0){ |
| | | Element hb_english = document.getElementById("hb_english"); |
| | | hb_english.text("GHS -" + orderLogistics.getRedPacketMoney()); |
| | | }else{ |
| | | Element hb_english_div = document.getElementById("hb_english_div"); |
| | | hb_english_div.remove(); |
| | | } |
| | | Element xj_english = document.getElementById("xj_english"); |
| | | xj_english.text("GHS " + orderLogistics.getOrderMoney()); |
| | | xj_english.text("GHS " + orderLogistics.getPayMoney()); |
| | | Element pay_type_english = document.getElementById("pay_type_english"); |
| | | pay_type_english.text("Bank card"); |
| | | Element pay_money_english = document.getElementById("pay_money_english"); |
| | |
| | | title_french.text(DateUtil.conversionFormat(language, sdf.format(orderLogistics.getTravelTime())) + ",Vous consommez GHS " + orderLogistics.getPayMoney() + " sur votre commande i-go1 le "); |
| | | Element xcf_french = document.getElementById("xcf_french"); |
| | | xcf_french.text("GHS " + orderLogistics.getOrderMoney()); |
| | | if(null != orderLogistics.getCouponMoney() && orderLogistics.getCouponMoney() > 0){ |
| | | Element yhq_french = document.getElementById("yhq_french"); |
| | | yhq_french.text("GHS -" + orderLogistics.getCouponMoney()); |
| | | }else{ |
| | | Element yhq_french_div = document.getElementById("yhq_french_div"); |
| | | yhq_french_div.remove(); |
| | | } |
| | | if(null != orderLogistics.getDiscountMoney() && orderLogistics.getDiscountMoney() > 0){ |
| | | Element zk_french = document.getElementById("zk_french"); |
| | | zk_french.text("GHS -" + orderLogistics.getDiscountMoney()); |
| | | }else{ |
| | | Element zk_french_div = document.getElementById("zk_french_div"); |
| | | zk_french_div.remove(); |
| | | } |
| | | if(null != orderLogistics.getRedPacketMoney() && orderLogistics.getRedPacketMoney() > 0){ |
| | | Element hb_french = document.getElementById("hb_french"); |
| | | hb_french.text("GHS -" + orderLogistics.getRedPacketMoney()); |
| | | }else{ |
| | | Element hb_french_div = document.getElementById("hb_french_div"); |
| | | hb_french_div.remove(); |
| | | } |
| | | Element xj_french = document.getElementById("xj_french"); |
| | | xj_french.text("GHS " + orderLogistics.getOrderMoney()); |
| | | xj_french.text("GHS " + orderLogistics.getPayMoney()); |
| | | Element pay_type_french = document.getElementById("pay_type_french"); |
| | | pay_type_french.text("Carte bancaire"); |
| | | Element pay_money_french = document.getElementById("pay_money_french"); |
| | |
| | | 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异常"); |
| | |
| | | title_chinese.text(DateUtil.conversionFormat(language, sdf2.format(orderLogistics.getTravelTime())) + ",您在I-GO1个订单消费GHS " + orderLogistics.getPayMoney()); |
| | | Element xcf_chinese = document.getElementById("xcf_chinese"); |
| | | xcf_chinese.text("GHS " + orderLogistics.getOrderMoney()); |
| | | if(null != orderLogistics.getCouponMoney() && orderLogistics.getCouponMoney() > 0){ |
| | | Element yhq_chinese = document.getElementById("yhq_chinese"); |
| | | yhq_chinese.text("GHS -" + orderLogistics.getCouponMoney()); |
| | | }else{ |
| | | Element yhq_chinese_div = document.getElementById("yhq_chinese_div"); |
| | | yhq_chinese_div.remove(); |
| | | } |
| | | if(null != orderLogistics.getDiscountMoney() && orderLogistics.getDiscountMoney() > 0){ |
| | | Element zk_chinese = document.getElementById("zk_chinese"); |
| | | zk_chinese.text("GHS -" + orderLogistics.getDiscountMoney()); |
| | | }else{ |
| | | Element zk_chinese_div = document.getElementById("zk_chinese_div"); |
| | | zk_chinese_div.remove(); |
| | | } |
| | | if(null != orderLogistics.getRedPacketMoney() && orderLogistics.getRedPacketMoney() > 0){ |
| | | Element hb_chinese = document.getElementById("hb_chinese"); |
| | | hb_chinese.text("GHS -" + orderLogistics.getRedPacketMoney()); |
| | | }else{ |
| | | Element hb_chinese_div = document.getElementById("hb_chinese_div"); |
| | | hb_chinese_div.remove(); |
| | | } |
| | | Element xj_chinese = document.getElementById("xj_chinese"); |
| | | xj_chinese.text("GHS " + orderLogistics.getOrderMoney()); |
| | | xj_chinese.text("GHS " + orderLogistics.getPayMoney()); |
| | | Element pay_type_chinese = document.getElementById("pay_type_chinese"); |
| | | pay_type_chinese.text("余额支付"); |
| | | Element pay_money_chinese = document.getElementById("pay_money_chinese"); |
| | |
| | | title_english.text(DateUtil.conversionFormat(language, sdf2.format(orderLogistics.getTravelTime())) + ",You spent GHS " + orderLogistics.getPayMoney() + " on the trip "); |
| | | Element xcf_english = document.getElementById("xcf_english"); |
| | | xcf_english.text("GHS " + orderLogistics.getOrderMoney()); |
| | | if(null != orderLogistics.getCouponMoney() && orderLogistics.getCouponMoney() > 0){ |
| | | Element yhq_english = document.getElementById("yhq_english"); |
| | | yhq_english.text("GHS -" + orderLogistics.getCouponMoney()); |
| | | }else{ |
| | | Element yhq_english_div = document.getElementById("yhq_english_div"); |
| | | yhq_english_div.remove(); |
| | | } |
| | | if(null != orderLogistics.getDiscountMoney() && orderLogistics.getDiscountMoney() > 0){ |
| | | Element zk_english = document.getElementById("zk_english"); |
| | | zk_english.text("GHS -" + orderLogistics.getDiscountMoney()); |
| | | }else{ |
| | | Element zk_english_div = document.getElementById("zk_english_div"); |
| | | zk_english_div.remove(); |
| | | } |
| | | if(null != orderLogistics.getRedPacketMoney() && orderLogistics.getRedPacketMoney() > 0){ |
| | | Element hb_english = document.getElementById("hb_english"); |
| | | hb_english.text("GHS -" + orderLogistics.getRedPacketMoney()); |
| | | }else{ |
| | | Element hb_english_div = document.getElementById("hb_english_div"); |
| | | hb_english_div.remove(); |
| | | } |
| | | Element xj_english = document.getElementById("xj_english"); |
| | | xj_english.text("GHS " + orderLogistics.getOrderMoney()); |
| | | xj_english.text("GHS " + orderLogistics.getPayMoney()); |
| | | Element pay_type_english = document.getElementById("pay_type_english"); |
| | | pay_type_english.text("I-GO Wallet"); |
| | | Element pay_money_english = document.getElementById("pay_money_english"); |
| | |
| | | title_french.text(DateUtil.conversionFormat(language, sdf2.format(orderLogistics.getTravelTime())) + ",Vous consommez GHS " + orderLogistics.getPayMoney() + " sur votre commande i-go1 le "); |
| | | Element xcf_french = document.getElementById("xcf_french"); |
| | | xcf_french.text("GHS " + orderLogistics.getOrderMoney()); |
| | | if(null != orderLogistics.getCouponMoney() && orderLogistics.getCouponMoney() > 0){ |
| | | Element yhq_french = document.getElementById("yhq_french"); |
| | | yhq_french.text("GHS -" + orderLogistics.getCouponMoney()); |
| | | }else{ |
| | | Element yhq_french_div = document.getElementById("yhq_french_div"); |
| | | yhq_french_div.remove(); |
| | | } |
| | | if(null != orderLogistics.getDiscountMoney() && orderLogistics.getDiscountMoney() > 0){ |
| | | Element zk_french = document.getElementById("zk_french"); |
| | | zk_french.text("GHS -" + orderLogistics.getDiscountMoney()); |
| | | }else{ |
| | | Element zk_french_div = document.getElementById("zk_french_div"); |
| | | zk_french_div.remove(); |
| | | } |
| | | if(null != orderLogistics.getRedPacketMoney() && orderLogistics.getRedPacketMoney() > 0){ |
| | | Element hb_french = document.getElementById("hb_french"); |
| | | hb_french.text("GHS -" + orderLogistics.getRedPacketMoney()); |
| | | }else{ |
| | | Element hb_french_div = document.getElementById("hb_french_div"); |
| | | hb_french_div.remove(); |
| | | } |
| | | Element xj_french = document.getElementById("xj_french"); |
| | | xj_french.text("GHS " + orderLogistics.getOrderMoney()); |
| | | xj_french.text("GHS " + orderLogistics.getPayMoney()); |
| | | Element pay_type_french = document.getElementById("pay_type_french"); |
| | | pay_type_french.text("Portefeuille I-GO"); |
| | | Element pay_money_french = document.getElementById("pay_money_french"); |
| | |
| | | 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异常"); |
| | |
| | | if(!"1246".equals(pickUpCode) && !orderLogistics.getPickUpCode().equals(pickUpCode)){ |
| | | return ResultUtil.error(language == 1 ? "验证失败" : language == 2 ? "Verification failed" : "Echec de la validation"); |
| | | } |
| | | orderLogistics.setState(9); |
| | | orderLogistics.setState(6); |
| | | this.updateById(orderLogistics); |
| | | return ResultUtil.success(); |
| | | } |
| | |
| | | }).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()); |