Showing
4 changed files
with
10 additions
and
5 deletions
@@ -8,9 +8,10 @@ | @@ -8,9 +8,10 @@ | ||
8 | <result column="begin_time" property="beginTime" jdbcType="INTEGER"/> | 8 | <result column="begin_time" property="beginTime" jdbcType="INTEGER"/> |
9 | <result column="end_time" property="endTime" jdbcType="INTEGER"/> | 9 | <result column="end_time" property="endTime" jdbcType="INTEGER"/> |
10 | <result column="quantity" property="quantity" jdbcType="INTEGER"/> | 10 | <result column="quantity" property="quantity" jdbcType="INTEGER"/> |
11 | + <result column="update_time" property="updateTime" jdbcType="INTEGER"/> | ||
11 | </resultMap> | 12 | </resultMap> |
12 | <sql id="Base_Column_List"> | 13 | <sql id="Base_Column_List"> |
13 | - id, stats_code, uid, begin_time, end_time, quantity | 14 | + id, stats_code, uid, begin_time, end_time, quantity, update_time |
14 | </sql> | 15 | </sql> |
15 | 16 | ||
16 | <select id="selectStatsResult" resultMap="BaseResultMap"> | 17 | <select id="selectStatsResult" resultMap="BaseResultMap"> |
@@ -25,9 +26,9 @@ | @@ -25,9 +26,9 @@ | ||
25 | </select> | 26 | </select> |
26 | 27 | ||
27 | <insert id="insert" parameterType="com.yohoufo.dal.order.model.SellerOrderStatsResult"> | 28 | <insert id="insert" parameterType="com.yohoufo.dal.order.model.SellerOrderStatsResult"> |
28 | - insert into seller_order_stats_result (id, uid, stats_code,begin_time, end_time, quantity) | 29 | + insert into seller_order_stats_result (id, uid, stats_code,begin_time, end_time, quantity, update_time) |
29 | values (#{id,jdbcType=BIGINT}, #{uid,jdbcType=INTEGER}, #{statsCode,jdbcType=VARCHAR}, | 30 | values (#{id,jdbcType=BIGINT}, #{uid,jdbcType=INTEGER}, #{statsCode,jdbcType=VARCHAR}, |
30 | - #{beginTime,jdbcType=INTEGER}, #{endTime,jdbcType=INTEGER}, #{quantity,jdbcType=INTEGER}) | ||
31 | - ON DUPLICATE KEY UPDATE quantity = #{quantity,jdbcType=INTEGER} + quantity | 31 | + #{beginTime,jdbcType=INTEGER}, #{endTime,jdbcType=INTEGER}, #{quantity,jdbcType=INTEGER}, #{updateTime,jdbcType=INTEGER}) |
32 | + ON DUPLICATE KEY UPDATE quantity = #{quantity,jdbcType=INTEGER} + quantity,update_time = #{updateTime,jdbcType=INTEGER} | ||
32 | </insert> | 33 | </insert> |
33 | </mapper> | 34 | </mapper> |
@@ -49,7 +49,7 @@ public class SellerOrderStatsConfigCacheService { | @@ -49,7 +49,7 @@ public class SellerOrderStatsConfigCacheService { | ||
49 | try { | 49 | try { |
50 | List<SellerOrderStatsConfig> configs = sellerOrderStatsConfigMapper.selectEnabledStatsConfig(); | 50 | List<SellerOrderStatsConfig> configs = sellerOrderStatsConfigMapper.selectEnabledStatsConfig(); |
51 | if (CollectionUtils.isEmpty(configs)) { | 51 | if (CollectionUtils.isEmpty(configs)) { |
52 | - logger.info("there is no seller order stats config"); | 52 | + logger.info("key {}, old value is {}, new value is empty", key, oldValue); |
53 | return Lists.newArrayList(); | 53 | return Lists.newArrayList(); |
54 | } | 54 | } |
55 | List<SellerOrderStatsConfiguration> configurations = new ArrayList<>(configs.size()); | 55 | List<SellerOrderStatsConfiguration> configurations = new ArrayList<>(configs.size()); |
1 | package com.yohoufo.order.service.stats.impl; | 1 | package com.yohoufo.order.service.stats.impl; |
2 | 2 | ||
3 | +import com.yohoufo.common.utils.DateUtil; | ||
3 | import com.yohoufo.dal.order.SellerOrderStatsResultMapper; | 4 | import com.yohoufo.dal.order.SellerOrderStatsResultMapper; |
4 | import com.yohoufo.dal.order.model.SellerOrderStatsResult; | 5 | import com.yohoufo.dal.order.model.SellerOrderStatsResult; |
5 | import com.yohoufo.order.model.bo.PlatformServiceFeeDefinition; | 6 | import com.yohoufo.order.model.bo.PlatformServiceFeeDefinition; |
@@ -40,6 +41,7 @@ public class SellerOrderQuantityStatsProcessor implements StatsProcessor<SellerO | @@ -40,6 +41,7 @@ public class SellerOrderQuantityStatsProcessor implements StatsProcessor<SellerO | ||
40 | quantityResult.setBeginTime(timeTuple.getKey()); | 41 | quantityResult.setBeginTime(timeTuple.getKey()); |
41 | quantityResult.setEndTime(timeTuple.getValue()); | 42 | quantityResult.setEndTime(timeTuple.getValue()); |
42 | quantityResult.setQuantity(1); | 43 | quantityResult.setQuantity(1); |
44 | + quantityResult.setUpdateTime(DateUtil.getCurrentTimeSecond()); | ||
43 | 45 | ||
44 | logger.info("[{}] db update seller order stats result:{}", entry.getSellerUid(), quantityResult); | 46 | logger.info("[{}] db update seller order stats result:{}", entry.getSellerUid(), quantityResult); |
45 | //插入或更新 | 47 | //插入或更新 |
-
Please register or login to post a comment