Forráskód Böngészése

油站公告修改

jk-GitHub-coder 4 éve
szülő
commit
587de94e56

+ 19 - 0
YijiaRestful/src/main/java/com/platform/yijia/controller/ElectronicMembershipCardController.java

@@ -0,0 +1,19 @@
+//package com.platform.yijia.controller;
+//
+//import org.springframework.stereotype.Controller;
+//import org.springframework.web.bind.annotation.RequestMapping;
+//
+///*
+// * <Title> ElectronicMembershipCardController </Title>
+// * <Description> 储蓄卡(电子会员卡)功能模块 </Description>
+// * @Author JK
+// * @Date 2021年3月22日
+// */
+//@Controller
+//@RequestMapping("/demo")
+//public class ElectronicMembershipCardController {
+//
+//
+//
+//
+//}

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

@@ -16,6 +16,7 @@ import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.*;
 import javax.annotation.Resource;
 import java.util.List;
+import java.util.Map;
 
 @Controller
 @RequestMapping("/demo")
@@ -31,6 +32,22 @@ public class StationController {
     private AppUserInfoService appUserInfoService;
 
 
+    //获取油站公告信息
+    @RequestMapping(value = "/getStationNoticeInfo", method = RequestMethod.GET)
+    @ResponseBody
+    public String getStationNoticeInfo(@RequestParam Integer stationId){
+        Gson gson =new Gson();
+        //返回结果集
+        ResultData resultData=null;
+        if(stationId !=null){
+            Map<String, Object> stationNoticeInfo = stationService.getStationNoticeInfo(stationId);
+            resultData =ResultData.success(stationNoticeInfo);
+        }else {
+            resultData =ResultData.error(CodeMsg.REQUEST_FAIL);
+        }
+        return gson.toJson(resultData);
+    }
+
     //获取油站轮播图
     @RequestMapping(value = "/getStationPicList", method = RequestMethod.GET)
     @ResponseBody

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

@@ -13,6 +13,9 @@ public interface StationInfoMapper {
     //获取油站轮播图片
     List<StationPic> getStationPicList (StationPic stationPic);
 
+    //获取油站公告
+    Map<String, Object> getStationNoticeInfo(Integer stationId);
+
     //获取该油站的优惠方式
     String getStationDiscountWay(String stationId);
 

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

@@ -11,6 +11,9 @@ import java.util.Map;
 
 public interface StationService {
 
+    //获取油站公告
+    Map<String, Object> getStationNoticeInfo(Integer stationId);
+
     //获取油站轮播图片
     List<StationPic> getStationPicList (StationPic stationPic);
 

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

@@ -23,6 +23,13 @@ public class StationServiceImpl implements StationService {
     @Resource
     private StationInfoMapper stationInfoMapper;
 
+
+    //获取油站公告
+    @Override
+    public Map<String, Object> getStationNoticeInfo(Integer stationId) {
+        return stationInfoMapper.getStationNoticeInfo(stationId);
+    }
+
     /**
      * 获取油站轮播图
      * @param stationPic

+ 15 - 2
YijiaRestful/src/main/resources/mapper/StationInfoMapper.xml

@@ -425,12 +425,25 @@
     where dept_id = #{stationId,jdbcType=INTEGER}
   </update>
 
+  <!--查询油站的公告-->
+  <select id="getStationNoticeInfo" parameterType="Integer" resultType="map">
+    SELECT
+        notice AS notice
+    FROM
+        station_pay
+    <where>
+      <if test="stationId !='' and stationId != null" >
+        station_id = #{stationId}
+      </if>
+    </where>
+  </select>
+
   <!--查询油站的优惠方式-->
   <select id="getStationDiscountWay" parameterType="String" resultType="String">
     SELECT
-    discount_setting AS discountSetting
+        discount_setting AS discountSetting
     FROM
-    station_pay
+        station_pay
     <where>
       <if test="stationId !='' and stationId != null" >
         station_id = #{stationId}