JK vor 4 Jahren
Ursprung
Commit
a04a3e7ff7

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

@@ -65,7 +65,7 @@ public class IntegralShoppingMallController {
         if(stationId !=null){
             IntegralShopPic integralShopPic = new IntegralShopPic();
             integralShopPic.setStationId(stationId);
-            List<IntegralShopPic> integralShopPicList = integralShopPicService.getIntegralShopPicList(integralShopPic);
+            IntegralShopPic integralShopPicList = integralShopPicService.getIntegralShopPicList(integralShopPic);
             resultData=ResultData.success(integralShopPicList);
         }else {
             resultData=ResultData.error(CodeMsg.REQUEST_FAIL);

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

@@ -561,6 +561,7 @@ public class PayController {
                             int integral =0;
                             if(stationInfos !=null && stationInfos.getIntegralFlag().equals("1")){                             //是否启用积分功能
                                 CalculateIntegral calculateIntegral = new CalculateIntegral();
+                                calculateIntegral.setGroupId(Integer.valueOf(infoMap.get("groupId").toString()));               //集团ID
                                 calculateIntegral.setCustomerGrade(customerManage.getGrade());                                  //客户等级
                                 calculateIntegral.setIntegralRuleFlag(stationInfos.getIntegralRuleFlag());                      //是否共享积分规则
                                 calculateIntegral.setOpenId(infoMap.get("minaOpenid").toString());                              //客户小程序ID
@@ -991,6 +992,12 @@ public class PayController {
         int integral =0;
         IntegralRule integralRule = new IntegralRule();
         integralRule.setStationId(calculateIntegral.getStationId());
+        //获取油站的积分规则是否共享
+        String integralRuleFlag = calculateIntegral.getIntegralRuleFlag();
+        if(StringUtils.isNotBlank(integralRuleFlag) && integralRuleFlag.equals("1")){
+            //如果共享则先根据集团ID查询集团规则
+            integralRule.setStationId(calculateIntegral.getGroupId());
+        }
         integralRule.setOilName(calculateIntegral.getOilName());
         //获取该油站的积分规则
         List<IntegralRule> integralRuleList = integralRuleService.getIntegralRule(integralRule);

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

@@ -7,5 +7,5 @@ import java.util.List;
 public interface IntegralShopPicMapper {
 
     //获取油站积分商城图片
-    List<IntegralShopPic> getIntegralShopPicList(IntegralShopPic integralShopPic);
+    IntegralShopPic getIntegralShopPicList(IntegralShopPic integralShopPic);
 }

+ 1 - 0
YijiaRestful/src/main/java/com/platform/yijia/pojo/CalculateIntegral.java

@@ -10,6 +10,7 @@ import java.math.BigDecimal;
 @Data
 public class CalculateIntegral {
     private Integer stationId;      //油站ID
+    private Integer groupId;        //集团ID
     private String stationName;     //油站名称
     private String oilName;         //油品名称
     private String oilType;         //油类:1.油品; 2.非油品

+ 10 - 5
YijiaRestful/src/main/java/com/platform/yijia/pojo/IntegralShopPic.java

@@ -7,10 +7,15 @@ import lombok.Data;
  */
 @Data
 public class IntegralShopPic {
-    private Integer id;                 //'商品主键id',
-    private String name;           //'图片名称',
-    private String url;              //'图片地址',
-    private String imgStatus;            //'图片状态',
+//    private Integer id;                 //'商品主键id',
+//    private String name;           //'图片名称',
+//    private String url;              //'图片地址',
+//    private String imgStatus;            //'图片状态',
     private Integer stationId;          //'油站ID',
-    private String stationName;         //油站名称
+//    private String stationName;         //油站名称
+    private String image1;
+    private String image2;
+    private String image3;
+    private String image4;
+    private String image5;
 }

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

@@ -129,6 +129,15 @@ public class StationInfo {
     private String wsPrintFlag;          //班结是否打印小票
     private String integralRuleFlag;     //是否共享积分规则
     private String cardRuleFlag;         //是否共享充值规则
+    private Integer groupId;             //集团ID
+
+    public Integer getGroupId() {
+        return groupId;
+    }
+
+    public void setGroupId(Integer groupId) {
+        this.groupId = groupId;
+    }
 
     public String getIntegralRuleFlag() {
         return integralRuleFlag;

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

@@ -8,6 +8,6 @@ import java.util.List;
 public interface IntegralShopPicService {
 
     //获取油站积分商城图片
-    List<IntegralShopPic> getIntegralShopPicList(IntegralShopPic integralShopPic);
+    IntegralShopPic getIntegralShopPicList(IntegralShopPic integralShopPic);
 
 }

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

@@ -17,7 +17,7 @@ public class IntegralShopPicServiceImpl implements IntegralShopPicService {
 
     //获取油站积分商城图片
     @Override
-    public List<IntegralShopPic> getIntegralShopPicList(IntegralShopPic integralShopPic) {
+    public IntegralShopPic getIntegralShopPicList(IntegralShopPic integralShopPic) {
         return integralShopPicMapper.getIntegralShopPicList(integralShopPic);
     }
 }

+ 16 - 12
YijiaRestful/src/main/resources/mapper/IntegralShopPicMapper.xml

@@ -3,25 +3,29 @@
 <mapper namespace="com.platform.yijia.dao.IntegralShopPicMapper">
   <!--积分规则返回结果-->
   <resultMap id="BaseResultMap" type="com.platform.yijia.pojo.IntegralShopPic">
-      <id     column="id"                     jdbcType="INTEGER" property="id" />
-      <result column="name"                   jdbcType="VARCHAR" property="name" />
-      <result column="url"                    jdbcType="VARCHAR" property="url" />
-      <result column="img_status"             jdbcType="VARCHAR" property="imgStatus" />
+<!--      <id     column="id"                     jdbcType="INTEGER" property="id" />-->
+<!--      <result column="name"                   jdbcType="VARCHAR" property="name" />-->
+<!--      <result column="url"                    jdbcType="VARCHAR" property="url" />-->
+<!--      <result column="img_status"             jdbcType="VARCHAR" property="imgStatus" />-->
+<!--      <result column="station_name"           jdbcType="VARCHAR" property="stationName" />-->
       <result column="station_id"             jdbcType="INTEGER" property="stationId" />
-      <result column="station_name"           jdbcType="VARCHAR" property="stationName" />
+      <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" />
   </resultMap>
 
   <!--查询油站积分商城图片信息-->
   <select id="getIntegralShopPicList" resultMap="BaseResultMap" parameterType="com.platform.yijia.pojo.IntegralShopPic">
     SELECT
-        id,
-        name,
-        url,
-        img_status,
-        station_id,
-        station_name
+          image1,
+          image2,
+          image3,
+          image4,
+          image5
     FROM
-        integral_shop_pic
+        integral_rule
     <where>
       <if test="stationId !=null and stationId !=''">
          AND station_id = #{stationId}

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

@@ -3,6 +3,7 @@
 <mapper namespace="com.platform.yijia.dao.StationInfoMapper">
   <resultMap id="BaseResultMap" type="com.platform.yijia.pojo.StationInfo">
     <id     column="dept_id"              jdbcType="INTEGER" property="stationId" />
+    <id     column="parent_id"            jdbcType="INTEGER" property="groupId" />
     <result column="dept_name"            jdbcType="VARCHAR" property="stationName" />
     <result column="dept_address"         jdbcType="VARCHAR" property="stationAddress" />
     <result column="oil_gun_num"          jdbcType="INTEGER" property="oilGunNum" />
@@ -80,6 +81,7 @@
   <select id="selectStationInfo" parameterType="com.platform.yijia.pojo.StationInfo" resultMap="BaseResultMap">
     SELECT
         dept_id,
+        parent_id,
         dept_name,
         dept_address,
         oil_gun_num,