浏览代码

修改排行榜bug

igl 1 年之前
父节点
当前提交
eb0e3ff7a0

+ 10 - 0
vehicle-api/src/main/java/com/chelvc/cloud/vehicle/api/param/EditRankAwardConfigParams.java

@@ -20,6 +20,16 @@ public class EditRankAwardConfigParams implements Serializable {
     @NotNull(message = "主键不能为空")
     private Long id;
 
+    /**
+     * 类型:0-年;1-季;2-月;3-周;4-日  暂时默认传2
+     */
+    private Integer type = 2;
+
+    /**
+     * 平台类型:1-用户;2-商家  暂时默认传2
+     */
+    private Integer platformType = 2;
+
     /**
      * 排名
      */

+ 2 - 2
vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/service/impl/RankAwardConfigServiceImpl.java

@@ -79,8 +79,8 @@ public class RankAwardConfigServiceImpl extends ServiceImpl<RankAwardConfigMappe
         LambdaQueryWrapper<RankAwardConfig> wrapper = Wrappers.lambdaQuery();
         wrapper.eq(RankAwardConfig::getRank, rank);
         wrapper.eq(RankAwardConfig::getStatus, 0);
-        wrapper.eq(RankAwardConfig::getPlatformType, config.getPlatformType());
-        wrapper.eq(RankAwardConfig::getType, config.getType());
+        wrapper.eq(params.getPlatformType() != null, RankAwardConfig::getPlatformType, params.getPlatformType());
+        wrapper.eq(params.getType() != null, RankAwardConfig::getType, params.getType());
         wrapper.eq(RankAwardConfig::getRegionLevel, regionLevel);
         wrapper.ne(RankAwardConfig::getId, config.getId());
         if (baseMapper.selectCount(wrapper) > 0) {

+ 3 - 3
vehicle-server/src/main/resources/mapper/PlatformProfitRatioMapper.xml

@@ -5,7 +5,7 @@
     <resultMap type="com.chelvc.cloud.vehicle.api.dto.PlatformProfitRatioDTO" id="PlatformProfitRatioResult">
         <result property="id" column="id"/>
         <result property="ratio" column="ratio"/>
-        <result property="userId" column="user_id"/>
+        <result property="merchantId" column="merchant_id"/>
         <result property="turnover" column="turnover"/>
         <result property="name" column="name"/>
         <result property="updater" column="updater"/>
@@ -18,7 +18,7 @@
             t.*,m.name
         FROM
             platform_profit_ratio t
-            left join merchant m on m.user_id = t.user_id
+            left join merchant m on m.id = t.merchant_id
             ${ew.getCustomSqlSegment}
     </select>
 
@@ -30,4 +30,4 @@
         where
             id = #{id}
     </update>
-</mapper>
+</mapper>