ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TOpenCityController.java
@@ -7,6 +7,8 @@ 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; @@ -19,6 +21,7 @@ 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; @@ -134,24 +137,15 @@ //获取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){ @@ -208,17 +202,8 @@ //获取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); @@ -229,7 +214,7 @@ tOpenCityBusinessService.update(business,new EntityWrapper<TOpenCityBusiness>().eq("openCityId",tOpenCity.getId())); //添加经营业务 testJSONStrToJSONArray(businessTypeStr,tOpenCity.getId()); return SUCCESS_TIP; return ResultUtil.success(); } /** ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TPubWithdrawalController.java
@@ -163,7 +163,7 @@ 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(); ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOpenCityMapper.xml
@@ -26,23 +26,30 @@ <!--根据条件查询开通城市列表--> <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> ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/City.java
@@ -23,6 +23,14 @@ //法文名称 @TableField("frenchName") private String frenchName; /** * 经度 */ private Double lon; /** * 纬度 */ private Double lat; public Integer getId() { return id; @@ -56,6 +64,22 @@ 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{" + ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GoogleMap/GoogleMapUtil.java
@@ -1,5 +1,6 @@ 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.*; @@ -89,8 +90,10 @@ 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(); @@ -124,6 +127,7 @@ 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(); ManagementIGOTravel/guns-admin/src/main/resources/application.yml
@@ -1,127 +1,3 @@ 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@ ManagementIGOTravel/guns-admin/src/main/resources/logback-spring.xml
@@ -212,7 +212,7 @@ </springProfile> <springProfile name="produce"> <root level="warn"> <root level="info"> <!-- 生产环境最好不配置console写文件 --> <appender-ref ref="DEBUG_FILE" /> <appender-ref ref="INFO_FILE" /> ManagementIGOTravel/guns-admin/src/main/webapp/static/modular/system/tOpenCity/tOpenCity_info.js
@@ -129,9 +129,13 @@ } //提交信息 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 + "!"); }); ManagementIGOTravel/guns-admin/src/main/webapp/static/modular/system/userActivity/addRegist.js
@@ -103,7 +103,15 @@ } 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();