jk-GitHub-coder 3 rokov pred
rodič
commit
fdc646850e

+ 5 - 5
YijiaRestful/src/main/java/com/platform/yijia/controller/PayController.java

@@ -2486,9 +2486,9 @@ public class PayController {
                     if(count == 1){
                         //将用户消费的信息插入顾客表: 以手机号 油品名称 油站id为条件插入且存入 加油升数、实收金额、油站名称  根据订单号查询用户手机号
                         Map<String, Object> infoMap = payOrderService.getOrderInfoAndUserInfoByOrderNo(payOrder);   //获取该订单手机号、加油升数、实收金额、油站名称
-                        logger.info("根据订单查询用户手机号等订单信息"+ infoMap.toString());
+                        //logger.info("根据订单查询用户手机号等订单信息"+ infoMap.toString());
                         //手机号必须有
-                        if(infoMap != null && infoMap.containsKey("mobilePhone") && infoMap.get("mobilePhone") !=null ){
+                        //if(infoMap != null && infoMap.containsKey("mobilePhone") && infoMap.get("mobilePhone") !=null ){
                             int integral =0;
                             StationInfo stationInfo = new StationInfo();
                             stationInfo.setStationId(Integer.valueOf(infoMap.get("stationId").toString()));
@@ -2546,9 +2546,9 @@ public class PayController {
                                     }
                                 }
                             }
-                        }else{
-                            logger.info("该用户无手机号!");
-                        }
+//                        }else{
+//                            logger.info("该用户无手机号!");
+//                        }
                     }else {
                         logger.info("更新订单状态失败!");
                     }

+ 10 - 0
YijiaRestful/src/main/java/com/platform/yijia/controller/PayOrderController.java

@@ -2249,6 +2249,16 @@ public class PayOrderController {
             payOrder.setOilPirce(oilPrice);
             BigDecimal divide = new BigDecimal(payOrderRequest.getReceivableAmt()).divide(new BigDecimal(oilPrice), 4, BigDecimal.ROUND_HALF_UP);
             payOrder.setOrderLiters(divide.toString());
+            if(stationInfos.getIsLngFlagGroup() !=null && stationInfos.getIsLngFlagGroup().equals("1")){
+                //如果是加气站
+                payOrder.setSellAmt(Double.valueOf(payOrderRequest.getReceivableAmt()));
+                payOrder.setSellDiscountAmt(Double.valueOf("0.00"));
+                payOrder.setSellOilPrice(Double.valueOf(oilPrice));
+                payOrder.setDriverDiscountAmt(Double.valueOf("0.00"));
+                payOrder.setDriverOilPrice(Double.valueOf(oilPrice));
+                resultMap.put("driverDiscountAmt", "0.00");
+                resultMap.put("sellDiscountAmt", "0.00");
+            }
             resultMap.put("discountAmt", "0.00");                                          //优惠价格
             resultMap.put("amt", payOrderRequest.getReceivableAmt());                   //实收价格
             resultMap.put("receivableAmt", payOrderRequest.getReceivableAmt());         //应收价格

+ 53 - 0
YijiaRestful/src/main/java/com/platform/yijia/controller/StationController.java

@@ -67,6 +67,58 @@ public class StationController {
         return gson.toJson(resultData);
     }
 
+    //支付宝小程序获取油站列表
+    @RequestMapping(value = "/getStationListToAliPay", method = RequestMethod.GET)
+    @ResponseBody
+    public String getStationListToAliPay(){
+        Gson gson =new Gson();
+        //返回结果集
+        ResultData resultData=null;
+        StationInfo stationInfo = new StationInfo();
+        List<StationInfo> stationList = stationService.getStationListToAliPay(stationInfo);
+        logger.info("支付宝小程序无经纬度油站列表:"+stationList.toString());
+        resultData = ResultData.success(stationList);
+        return gson.toJson(resultData);
+    }
+
+    /**
+     * 支付宝小程序坐标获取油站列表
+     */
+    @RequestMapping(value = "/getStationInfoListNewToAliPay", method = RequestMethod.GET)
+    @ResponseBody
+    public String getStationInfoListNewToAliPay(@RequestParam String stationLongitude,String stationLatitude,Integer pageNum,Integer pageSize){
+        Gson gson =new Gson();
+        //返回结果集
+        ResultData resultData= null;
+        StationRequest stationRequest = new StationRequest();
+        stationRequest.setJiBie("2");
+        if(StringUtils.isNotBlank(stationLatitude) && StringUtils.isNotBlank(stationLongitude)){
+            stationRequest.setStationLatitude(stationLatitude);
+            stationRequest.setStationLongitude(stationLongitude);
+            stationRequest.setPageNum(pageNum);
+            stationRequest.setPageSize(pageSize);
+            //调用接口 根据坐标筛选距离最近的加油站
+            StationInfoVo stationInfoVo = stationService.stationInfoList(stationRequest);
+            logger.info("支付宝小程序有经纬度获取油站列表:"+stationInfoVo.toString());
+            JSONObject location = BaiduMapUtil.getLocation(stationLongitude, stationLatitude);
+            if(location !=null && location.containsKey("status") && location.get("status").toString().equals("0")){
+                JSONObject result = location.getJSONObject("result").getJSONObject("addressComponent");
+                if(!result.getString("street").equals("")){
+                    stationInfoVo.setAddress(result.getString("street"));
+                }else {
+                    stationInfoVo.setAddress("未知街道");
+                }
+                resultData=ResultData.success(stationInfoVo);
+            }else {
+                resultData=ResultData.error(CodeMsg.BAIDUMAP_FAIL);
+            }
+        }else {
+            resultData=ResultData.error(CodeMsg.REQUEST_FAIL);
+        }
+        return gson.toJson(resultData);
+    }
+
+
     //获取油站公众号ID
     @RequestMapping(value = "/getStationGzhAppId", method = RequestMethod.GET)
     @ResponseBody
@@ -231,6 +283,7 @@ public class StationController {
             StationRequest stationRequest = new StationRequest();
             //StationInfo stationInfo = new StationInfo();
             stationRequest.setAppId(appId);
+            stationRequest.setJiBie("2");
             //stationInfo.setAppId(appId);
             if(StringUtils.isNotBlank(stationLatitude) && StringUtils.isNotBlank(stationLongitude)){
                 stationRequest.setStationLatitude(stationLatitude);

+ 4 - 0
YijiaRestful/src/main/java/com/platform/yijia/dao/StationInfoMapper.java

@@ -15,6 +15,10 @@ public interface StationInfoMapper {
     //根据小程序ID查询油站列表
     List<StationInfo> getStationListByAppId(StationInfo stationInfo);
 
+    //支付宝小程序查询油站列表
+    List<StationInfo> getStationListToAliPay(StationInfo stationInfo);
+
+
     //获取油站的某个油品的价格和营销方案信息
     Map<String, Object> selectStationOilPriceAndDiscountSetting(Map<String, Object> map);
 

+ 9 - 0
YijiaRestful/src/main/java/com/platform/yijia/param/request/StationRequest.java

@@ -17,6 +17,15 @@ public class StationRequest {
     private String userType;
     private String token;
     private String appId;       //小程序APPID
+    private String jiBie;
+
+    public String getJiBie() {
+        return jiBie;
+    }
+
+    public void setJiBie(String jiBie) {
+        this.jiBie = jiBie;
+    }
 
     public String getAppId() {
         return appId;

+ 5 - 0
YijiaRestful/src/main/java/com/platform/yijia/pojo/StationInfoExample.java

@@ -933,6 +933,11 @@ public class StationInfoExample {
             addCriterion("gzh_app_id =", value, "gzhAppId");
             return (Criteria) this;
         }
+
+        public Criteria andJiBieEqualTo(String value) {
+            addCriterion("ji_bie =", value, "jiBie");
+            return (Criteria) this;
+        }
     }
 
     /**

+ 3 - 0
YijiaRestful/src/main/java/com/platform/yijia/service/StationService.java

@@ -16,6 +16,9 @@ public interface StationService {
     //根据小程序获取油站列表
     List<StationInfo> getStationListByAppId(StationInfo stationInfo);
 
+    //支付宝小程序查询油站列表
+    List<StationInfo> getStationListToAliPay(StationInfo stationInfo);
+
     //获取油站的某个油品的价格和营销方案信息
     Map<String, Object> selectStationOilPriceAndDiscountSetting(Map<String, Object> map);
 

+ 7 - 0
YijiaRestful/src/main/java/com/platform/yijia/service/impl/StationServiceImpl.java

@@ -34,6 +34,12 @@ public class StationServiceImpl implements StationService {
         return stationInfoMapper.getStationListByAppId(stationInfo);
     }
 
+    //支付宝小程序查询油站列表
+    @Override
+    public List<StationInfo> getStationListToAliPay(StationInfo stationInfo) {
+        return stationInfoMapper.getStationListToAliPay(stationInfo);
+    }
+
     //更新LNG平台加气油站余额
     @Override
     public void updateStationBalance(StationInfo stationInfo) {
@@ -150,6 +156,7 @@ public class StationServiceImpl implements StationService {
         if(StringUtils.isNotBlank(stationRequest.getAppId())){
             example.or().andGzhAppIdEqualTo(stationRequest.getAppId());
         }
+        example.or().andJiBieEqualTo(stationRequest.getJiBie());
         // 数据库查询门店数据
         List<StationInfo> stationInfolist = stationInfoMapper.selectByExample(example);
         // 入参坐标拼接

+ 21 - 1
YijiaRestful/src/main/resources/mapper/StationInfoMapper.xml

@@ -124,12 +124,32 @@
           T1.station_pic
       FROM          sys_dept      AS T1
       <where>
+            T1.ji_bie = "2"
         <if test="appId !='' and appId != null" >
-          T1.app_id = #{appId}
+          AND T1.app_id = #{appId}
         </if>
       </where>
       ORDER BY T1.dept_id
   </select>
+
+  <!--支付宝小程序获取油站列表信息 -->
+  <select id="getStationListToAliPay" parameterType="com.platform.yijia.pojo.StationInfo" resultMap="BaseResultMap">
+    SELECT
+      T1.dept_id,
+      T1.parent_id,
+      T1.dept_name,
+      T1.city,
+      T1.dept_address,
+      T1.station_longitude,
+      T1.station_latitude,
+      T1.station_pic
+    FROM          sys_dept      AS T1
+    <where>
+        T1.ji_bie = "2" AND T1.parent_id !=3
+    </where>
+    ORDER BY T1.dept_id
+  </select>
+
   <!--获取油站信息-->
   <select id="selectStationInfo" parameterType="com.platform.yijia.pojo.StationInfo" resultMap="BaseResultMap">
     SELECT