jk-GitHub-coder 4 年之前
父节点
当前提交
2fa37ac3e4

+ 1 - 1
YijiaRestful/src/main/java/com/platform/yijia/controller/AppUserInfoController.java

@@ -443,7 +443,7 @@ public class AppUserInfoController {
             AppUserInfo appUserInfo =new AppUserInfo();
             CustomerPoints customerPoints =  new CustomerPoints();
             CustomerElectronicCard customerElectronicCard = new CustomerElectronicCard();   //客户电子卡
-            String openId = "";     //此参数用于查询该用户是否已注册过
+            String openId = request.getOpenId();     //此参数用于查询该用户是否已注册过
             if(StringUtils.isNotBlank(request.getBlogNickName())){
                 appUserInfo.setBlogNickName(request.getBlogNickName());
                 customerPoints.setCustomerName(request.getBlogNickName());

+ 42 - 2
YijiaRestful/src/main/java/com/platform/yijia/controller/StationController.java

@@ -18,6 +18,7 @@ import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.*;
 import javax.annotation.Resource;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -38,6 +39,26 @@ public class StationController {
     @Resource
     private AppUserInfoService appUserInfoService;
 
+
+    //获取油站列表
+    @RequestMapping(value = "/getStationListByAppId", method = RequestMethod.GET)
+    @ResponseBody
+    public String getStationListByAppId(@RequestParam String appId){
+        Gson gson =new Gson();
+        //返回结果集
+        ResultData resultData=null;
+        if(StringUtils.isNotBlank(appId)){
+            StationInfo stationInfo = new StationInfo();
+            stationInfo.setAppId(appId);
+            List<StationInfo> stationList = stationService.getStationListByAppId(stationInfo);
+            resultData = ResultData.success(stationList);
+        }else {
+            resultData = ResultData.error(CodeMsg.REQUEST_FAIL);
+        }
+
+        return gson.toJson(resultData);
+    }
+
     //获取油站公众号ID
     @RequestMapping(value = "/getStationGzhAppId", method = RequestMethod.GET)
     @ResponseBody
@@ -125,8 +146,27 @@ public class StationController {
         if(stationId !=null){
             StationInfo stationPic = new StationInfo();
             stationPic.setStationId(stationId);
-            List<StationInfo> stationPicList = stationService.getStationPicList(stationPic);
-            resultData =ResultData.success(stationPicList);
+            StationInfo stationPics = stationService.getStationPicList(stationPic);
+            List<String>  listPic = new ArrayList<>();
+            if(stationPics != null && StringUtils.isNotBlank(stationPics.getImage1())){
+                listPic.add(stationPics.getImage1());
+            }
+            if(stationPics != null && StringUtils.isNotBlank(stationPics.getImage2())){
+                listPic.add(stationPics.getImage2());
+            }
+            if(stationPics != null && StringUtils.isNotBlank(stationPics.getImage3())){
+                listPic.add(stationPics.getImage3());
+            }
+            if(stationPics != null && StringUtils.isNotBlank(stationPics.getImage4())){
+                listPic.add(stationPics.getImage4());
+            }
+            if(stationPics != null && StringUtils.isNotBlank(stationPics.getImage5())){
+                listPic.add(stationPics.getImage5());
+            }
+            Map map = new HashMap();
+            map.put("notice", stationPics.getNotice());
+            map.put("listPic", listPic);
+            resultData =ResultData.success(map);
         }else {
             resultData =ResultData.error(CodeMsg.REQUEST_FAIL);
         }

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

@@ -11,6 +11,9 @@ import org.apache.ibatis.annotations.Param;
 
 public interface StationInfoMapper {
 
+    //根据小程序ID查询油站列表
+    List<StationInfo> getStationListByAppId(StationInfo stationInfo);
+
     //获取油站的某个油品的价格和营销方案信息
     Map<String, Object> selectStationOilPriceAndDiscountSetting(Map<String, Object> map);
 
@@ -23,7 +26,7 @@ public interface StationInfoMapper {
     List<Map<String, Object>> getStationPrinterList(Integer stationId);
 
     //获取油站轮播图片
-    List<StationInfo> getStationPicList (StationInfo stationInfo);
+    StationInfo getStationPicList (StationInfo stationInfo);
 
     //获取油站公告
     Map<String, Object> getStationNoticeInfo(Integer stationId);

+ 45 - 0
YijiaRestful/src/main/java/com/platform/yijia/pojo/StationInfo.java

@@ -131,6 +131,51 @@ public class StationInfo {
     private String cardRuleFlag;         //是否共享充值规则
     private Integer groupId;             //集团ID
     private String singleStationFlag;    //'单站是否开启,1是 0否'
+    private String image1;
+    private String image2;
+    private String image3;
+    private String image4;
+    private String image5;
+
+    public String getImage2() {
+        return image2;
+    }
+
+    public void setImage2(String image2) {
+        this.image2 = image2;
+    }
+
+    public String getImage3() {
+        return image3;
+    }
+
+    public void setImage3(String image3) {
+        this.image3 = image3;
+    }
+
+    public String getImage4() {
+        return image4;
+    }
+
+    public void setImage4(String image4) {
+        this.image4 = image4;
+    }
+
+    public String getImage5() {
+        return image5;
+    }
+
+    public void setImage5(String image5) {
+        this.image5 = image5;
+    }
+
+    public String getImage1() {
+        return image1;
+    }
+
+    public void setImage1(String image1) {
+        this.image1 = image1;
+    }
 
     public String getSingleStationFlag() {
         return singleStationFlag;

+ 4 - 1
YijiaRestful/src/main/java/com/platform/yijia/service/StationService.java

@@ -10,6 +10,9 @@ import java.util.Map;
 
 public interface StationService {
 
+    //根据小程序获取油站列表
+    List<StationInfo> getStationListByAppId(StationInfo stationInfo);
+
     //获取油站的某个油品的价格和营销方案信息
     Map<String, Object> selectStationOilPriceAndDiscountSetting(Map<String, Object> map);
 
@@ -23,7 +26,7 @@ public interface StationService {
     Map<String, Object> getStationNoticeInfo(Integer stationId);
 
     //获取油站轮播图片
-    List<StationInfo> getStationPicList (StationInfo stationInfo);
+    StationInfo getStationPicList (StationInfo stationInfo);
 
     //跟据油站插叙有站列表 查询油站列表
     StationInfoVo stationInfoList(StationRequest stationRequest);

+ 6 - 1
YijiaRestful/src/main/java/com/platform/yijia/service/impl/StationServiceImpl.java

@@ -29,6 +29,11 @@ public class StationServiceImpl implements StationService {
     @Resource
     private StationPayManageMapper stationPayManageMapper;
 
+    @Override
+    public List<StationInfo> getStationListByAppId(StationInfo stationInfo) {
+        return stationInfoMapper.getStationListByAppId(stationInfo);
+    }
+
     //获取油站的某个油品的价格和营销方案信息
     @Override
     public Map<String, Object> selectStationOilPriceAndDiscountSetting(Map<String, Object> map) {
@@ -77,7 +82,7 @@ public class StationServiceImpl implements StationService {
      * @return
      */
     @Override
-    public List<StationInfo> getStationPicList(StationInfo stationInfo) {
+    public StationInfo getStationPicList(StationInfo stationInfo) {
         return stationInfoMapper.getStationPicList(stationInfo);
     }
 

+ 3 - 14
YijiaRestful/src/main/resources/mapper/AppUserInfoMapper.xml

@@ -204,13 +204,11 @@
     -->
     insert into app_user_info (user_id, user_type, blog_openid,
       mina_openid, mobile_phone, blog_nick_name,
-      sex_flag, registe_date, blog_token,
-      mina_token, blog_profile_photo, update_date, union_id,station_id
+      sex_flag, registe_date, blog_profile_photo, update_date, union_id,station_id
       )
     values (#{userId,jdbcType=INTEGER}, #{userType,jdbcType=VARCHAR}, #{blogOpenid,jdbcType=VARCHAR},
       #{minaOpenid,jdbcType=VARCHAR}, #{mobilePhone,jdbcType=VARCHAR}, #{blogNickName,jdbcType=VARCHAR},
-      #{sexFlag,jdbcType=VARCHAR}, #{registeDate,jdbcType=TIMESTAMP}, #{blogToken,jdbcType=VARCHAR},
-      #{minaToken,jdbcType=VARCHAR}, #{blogProfilePhoto,jdbcType=VARCHAR}, #{updateDate,jdbcType=TIMESTAMP},
+      #{sexFlag,jdbcType=VARCHAR}, #{registeDate,jdbcType=TIMESTAMP}, #{blogProfilePhoto,jdbcType=VARCHAR}, #{updateDate,jdbcType=TIMESTAMP},
       #{unionId,jdbcType=VARCHAR},#{stationId,jdbcType=INTEGER}
       )
   </insert>
@@ -504,21 +502,12 @@
       <if test="registeDate != null">
         registe_date = #{registeDate},
       </if>
-      <if test="blogToken != null">
-        blog_token = #{blogToken},
-      </if>
-      <if test="minaToken != null">
-        mina_token = #{minaToken},
-      </if>
       <if test="blogProfilePhoto != null">
         blog_profile_photo = #{blogProfilePhoto},
       </if>
       <if test="updateDate != null">
         update_date = #{updateDate},
       </if>
-      <if test="unionId !=null">
-        union_id = #{unionId}
-      </if>
     </set>
     <where>
       <if test="stationId !=null and stationId !=''">
@@ -528,7 +517,7 @@
         AND union_id = #{unionId}
       </if>
       <if test="mobilePhone !=null and mobilePhone !=''">
-        AND mobile_phone = #{mobilePhone},
+        AND mobile_phone = #{mobilePhone}
       </if>
     </where>
   </update>

+ 1 - 34
YijiaRestful/src/main/resources/mapper/CustomerPointsMapper.xml

@@ -21,7 +21,7 @@
 
   <!--查询列-->
   <sql id="Base_Column_List">
-    id, union_id, blog_openid, mina_openid, mobile_phone, customer_name, points, consumption_points, accumulate_points, invalid_points,
+    id, union_id, mobile_phone, customer_name, points, consumption_points, accumulate_points, invalid_points,
     recent_consumption_date, station_id, station_name, create_time
   </sql>
 
@@ -46,9 +46,6 @@
     <include refid="Base_Column_List" />
     FROM customer_points
     <where>
-<!--      <if test="minaOpenId !=null and minaOpenId !=''">-->
-<!--        mina_openid = #{minaOpenId}-->
-<!--      </if>-->
       <if test="unionId !=null and unionId !=''">
         union_id = #{unionId}
       </if>
@@ -66,12 +63,6 @@
       <if test="unionId !=null">
         union_id,
       </if>
-      <if test="blogOpenId !=null">
-        blog_openid,
-      </if>
-      <if test="minaOpenId !=null">
-        mina_openid,
-      </if>
       <if test="mobilePhone !=null">
         mobile_phone,
       </if>
@@ -107,12 +98,6 @@
       <if test="unionId !=null">
         #{unionId},
       </if>
-      <if test="blogOpenId !=null">
-        #{blogOpenId},
-      </if>
-      <if test="minaOpenId !=null">
-        #{minaOpenId},
-      </if>
       <if test="mobilePhone !=null">
         #{mobilePhone},
       </if>
@@ -151,12 +136,6 @@
     UPDATE
         customer_points
     <set>
-      <if test="blogOpenId !=null">
-        blog_openid =#{blogOpenId},
-      </if>
-      <if test="minaOpenId !=null">
-        mina_openid =#{minaOpenId},
-      </if>
       <if test="mobilePhone !=null">
         mobile_phone=#{mobilePhone},
       </if>
@@ -198,12 +177,6 @@
       <if test="unionId !=null and unionId !=''">
         AND union_id = #{unionId}
       </if>
-<!--      <if test="blogOpenId !=null and blogOpenId !=''">-->
-<!--        AND blog_openid = #{blogOpenId}-->
-<!--      </if>-->
-<!--      <if test="minaOpenId !=null and minaOpenId !=''">-->
-<!--        AND mina_openid = #{minaOpenId}-->
-<!--      </if>-->
     </where>
   </update>
 
@@ -220,12 +193,6 @@
       <if test="unionId !=null and unionId !=''">
         AND union_id = #{unionId}
       </if>
-<!--      <if test="blogOpenId !=null and blogOpenId !=''">-->
-<!--        AND blog_openid = #{blogOpenId}-->
-<!--      </if>-->
-<!--      <if test="minaOpenId !=null and minaOpenId !=''">-->
-<!--        AND mina_openid = #{minaOpenId}-->
-<!--      </if>-->
     </where>
   </select>
 

+ 0 - 1
YijiaRestful/src/main/resources/mapper/ElectronicMembershipCardMapper.xml

@@ -91,7 +91,6 @@
             T2.discount_amt_start,
             T2.discount_amt_end,
             T2.present_amt,
-            T2.oil_name,
             T2.status
         FROM
             customer_card_setting AS T1 LEFT JOIN customer_card_setting_detail AS T2 ON T1.id = T2.parent_id

+ 29 - 4
YijiaRestful/src/main/resources/mapper/StationInfoMapper.xml

@@ -12,6 +12,13 @@
     <result column="station_longitude"    jdbcType="VARCHAR" property="stationLongitude" />
     <result column="station_latitude"     jdbcType="VARCHAR" property="stationLatitude" />
     <result column="station_pic"          jdbcType="VARCHAR" property="stationPic" />
+
+    <result column="image1"               jdbcType="VARCHAR" property="image1" />
+    <result column="image2"               jdbcType="VARCHAR" property="image2" />
+    <result column="image3"               jdbcType="VARCHAR" property="image3" />
+    <result column="image4"               jdbcType="VARCHAR" property="image4" />
+    <result column="image5"               jdbcType="VARCHAR" property="image5" />
+
     <result column="notice"               jdbcType="VARCHAR" property="notice" />
     <result column="mno"                  jdbcType="INTEGER" property="mno" />
     <result column="print_setting"        jdbcType="VARCHAR" property="printSetting" />
@@ -43,6 +50,8 @@
   <!--查询油站轮播图片信息-->
   <select id="getStationPicList" resultMap="BaseResultMap" parameterType="com.platform.yijia.pojo.StationInfo">
     SELECT
+        dept_id,
+        dept_name,
         notice,
         image1,
         image2,
@@ -77,7 +86,24 @@
     </where>
   </select>
 
-
+  <!--根据小程序ID获取油站列表信息 -->
+  <select id="getStationListByAppId" parameterType="com.platform.yijia.pojo.StationInfo" resultMap="BaseResultMap">
+      SELECT
+          T1.dept_id,
+          T1.parent_id,
+          T1.dept_name,
+          T1.dept_address,
+          T1.station_longitude,
+          T1.station_latitude,
+          T1.station_pic
+      FROM          sys_dept      AS T1
+      <where>
+        <if test="appId !='' and appId != null" >
+          T1.app_id = #{appId}
+        </if>
+      </where>
+      ORDER BY T1.dept_id
+  </select>
   <!--获取油站信息-->
   <select id="selectStationInfo" parameterType="com.platform.yijia.pojo.StationInfo" resultMap="BaseResultMap">
     SELECT
@@ -104,8 +130,7 @@
         T1.integral_flag,
         T1.integral_print_flag,
         T2.card_rule_flag,
-        T2.integral_rule_flag,
-        T2.single_station_flag
+        T2.integral_rule_flag
     FROM          sys_dept      AS T1
         LEFT JOIN sys_dept      AS T2 ON T1.parent_id = T2.dept_id
     <where>
@@ -188,7 +213,7 @@
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
     -->
-    dept_id, dept_name, dept_address, oil_gun_num, leader, phone,
+    dept_id, parent_id, dept_name, dept_address, oil_gun_num, leader, phone,
     station_longitude, station_latitude, mno
   </sql>
   <sql id="Blob_Column_List">

+ 8 - 68
YijiaRestful/src/main/resources/mapper/StationOilGunMapper.xml

@@ -2,19 +2,12 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.platform.yijia.dao.StationOilGunMapper">
   <resultMap id="BaseResultMap" type="com.platform.yijia.pojo.StationOilGun">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-    -->
     <id column="oil_gun_id" jdbcType="INTEGER" property="oilGunId" />
     <result column="oil_gun_no" jdbcType="VARCHAR" property="oilGunNo" />
     <result column="oil_name" jdbcType="VARCHAR" property="oilName" />
     <result column="oil_price" jdbcType="DECIMAL" property="oilPrice" />
     <result column="station_id" jdbcType="INTEGER" property="stationId" />
-    <result column="station_name" jdbcType="VARCHAR" property="stationName" />
     <result column="date" jdbcType="TIMESTAMP" property="date" />
-    <result column="status" jdbcType="VARCHAR" property="status" />
-    <result column="oil_gun_type" jdbcType="VARCHAR" property="oilGunType" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <!--
@@ -83,17 +76,9 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-    -->
-    oil_gun_id, oil_gun_no, oil_name, oil_price, station_id, station_name, date, status, oil_gun_type
+    oil_gun_id, oil_gun_no, oil_name, oil_price, station_id, date
   </sql>
   <select id="selectByExample" parameterType="com.platform.yijia.pojo.StationOilGunExample" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-    -->
     select
     <if test="distinct">
       distinct
@@ -108,10 +93,6 @@
     </if>
   </select>
   <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-    -->
     select
     <include refid="Base_Column_List" />
     from station_oil_gun
@@ -141,11 +122,11 @@
       This element is automatically generated by MyBatis Generator, do not modify.
     -->
     insert into station_oil_gun (oil_gun_id, oil_gun_no, oil_name,
-      oil_price, station_id, station_name, oil_gun_type,
-      date, status)
+      oil_price, station_id,
+      date)
     values (#{oilGunId,jdbcType=INTEGER}, #{oilGunNo,jdbcType=VARCHAR}, #{oilName,jdbcType=VARCHAR},
-      #{oilPrice,jdbcType=DECIMAL}, #{stationId,jdbcType=INTEGER}, #{stationName,jdbcType=VARCHAR}, #{oilGunType,jdbcType=VARCHAR},
-      #{date,jdbcType=TIMESTAMP}, #{status,jdbcType=VARCHAR})
+      #{oilPrice,jdbcType=DECIMAL}, #{stationId,jdbcType=INTEGER},
+      #{date,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" parameterType="com.platform.yijia.pojo.StationOilGun">
     <!--
@@ -169,18 +150,10 @@
       <if test="stationId != null">
         station_id,
       </if>
-      <if test="stationName != null">
-        station_name,
-      </if>
+
       <if test="date != null">
         date,
       </if>
-      <if test="status != null">
-        status,
-      </if>
-      <if test="oilGunType != null">
-        oil_gun_type,
-      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="oilGunId != null">
@@ -198,18 +171,9 @@
       <if test="stationId != null">
         #{stationId,jdbcType=INTEGER},
       </if>
-      <if test="stationName != null">
-        #{stationName,jdbcType=VARCHAR},
-      </if>
       <if test="date != null">
         #{date,jdbcType=TIMESTAMP},
       </if>
-      <if test="status != null">
-        #{status,jdbcType=VARCHAR},
-      </if>
-      <if test="oilGunType != null">
-        #{oilGunType,jdbcType=VARCHAR},
-      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.platform.yijia.pojo.StationOilGunExample" resultType="java.lang.Long">
@@ -244,18 +208,9 @@
       <if test="record.stationId != null">
         station_id = #{record.stationId,jdbcType=INTEGER},
       </if>
-      <if test="record.stationName != null">
-        station_name = #{record.stationName,jdbcType=VARCHAR},
-      </if>
       <if test="record.date != null">
         date = #{record.date,jdbcType=TIMESTAMP},
       </if>
-      <if test="record.status != null">
-        status = #{record.status,jdbcType=VARCHAR},
-      </if>
-      <if test="record.oilGunType != null">
-        oil_gun_type = #{record.oilGunType,jdbcType=VARCHAR},
-      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -272,10 +227,7 @@
       oil_name = #{record.oilName,jdbcType=VARCHAR},
       oil_price = #{record.oilPrice,jdbcType=DECIMAL},
       station_id = #{record.stationId,jdbcType=INTEGER},
-      station_name = #{record.stationName,jdbcType=VARCHAR},
-      date = #{record.date,jdbcType=TIMESTAMP},
-      status = #{record.status,jdbcType=VARCHAR},
-     oil_gun_type = #{record.oilGunType,jdbcType=VARCHAR}
+      date = #{record.date,jdbcType=TIMESTAMP}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -299,18 +251,9 @@
       <if test="stationId != null">
         station_id = #{stationId,jdbcType=INTEGER},
       </if>
-      <if test="stationName != null">
-        station_name = #{stationName,jdbcType=VARCHAR},
-      </if>
       <if test="date != null">
         date = #{date,jdbcType=TIMESTAMP},
       </if>
-      <if test="status != null">
-        status = #{status,jdbcType=VARCHAR},
-      </if>
-      <if test="oilGunType != null">
-        oil_gun_type = #{oilGunType,jdbcType=VARCHAR},
-      </if>
     </set>
     where oil_gun_id = #{oilGunId,jdbcType=INTEGER}
   </update>
@@ -324,10 +267,7 @@
       oil_name = #{oilName,jdbcType=VARCHAR},
       oil_price = #{oilPrice,jdbcType=DECIMAL},
       station_id = #{stationId,jdbcType=INTEGER},
-      station_name = #{stationName,jdbcType=VARCHAR},
-      date = #{date,jdbcType=TIMESTAMP},
-      status = #{status,jdbcType=VARCHAR},
-    oil_gun_type = #{oilGunType,jdbcType=VARCHAR}
+      date = #{date,jdbcType=TIMESTAMP}
     where oil_gun_id = #{oilGunId,jdbcType=INTEGER}
   </update>