| | |
| | | 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(); |
| | | } |
| | | } |