Authored by mingdan.ge

cps推广mq修改

@@ -46,6 +46,8 @@ public interface UnionShareOrdersMapper { @@ -46,6 +46,8 @@ public interface UnionShareOrdersMapper {
46 int updateStatusById(@Param("id")int id,@Param("oldStatus")String oldStatus,@Param("newStatus")String newStatus,@Param("updateTime")int updateTime); 46 int updateStatusById(@Param("id")int id,@Param("oldStatus")String oldStatus,@Param("newStatus")String newStatus,@Param("updateTime")int updateTime);
47 47
48 int updateStatusByUid(@Param("promoteUid")int promoteUid,@Param("settlementCode")String settlementCode,@Param("oldStatus")String oldStatus,@Param("newStatus")String newStatus,@Param("updateTime")int updateTime); 48 int updateStatusByUid(@Param("promoteUid")int promoteUid,@Param("settlementCode")String settlementCode,@Param("oldStatus")String oldStatus,@Param("newStatus")String newStatus,@Param("updateTime")int updateTime);
  49 + int updateStatusByCode(@Param("settlementCode")String settlementCode,@Param("oldStatus")String oldStatus,@Param("newStatus")String newStatus,@Param("updateTime")int updateTime);
  50 +
49 51
50 int updateByPrimaryKey(UnionShareOrders record); 52 int updateByPrimaryKey(UnionShareOrders record);
51 53
@@ -276,6 +276,12 @@ @@ -276,6 +276,12 @@
276 update_time = #{updateTime,jdbcType=INTEGER} 276 update_time = #{updateTime,jdbcType=INTEGER}
277 where promote_uid = #{promoteUid,jdbcType=INTEGER} and status = #{oldStatus,jdbcType=VARCHAR} 277 where promote_uid = #{promoteUid,jdbcType=INTEGER} and status = #{oldStatus,jdbcType=VARCHAR}
278 </update> 278 </update>
  279 + <update id="updateStatusByCode" >
  280 + update union_share_orders
  281 + set status = #{newStatus,jdbcType=VARCHAR},
  282 + update_time = #{updateTime,jdbcType=INTEGER}
  283 + where settlement_code = #{settlementCode,jdbcType=VARCHAR} and status = #{oldStatus,jdbcType=VARCHAR}
  284 + </update>
279 285
280 <select id="selectRecentlyOrderLimitTen" resultMap="BaseResultMap"> 286 <select id="selectRecentlyOrderLimitTen" resultMap="BaseResultMap">
281 select 287 select
@@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
19 from union_share_settlement 19 from union_share_settlement
20 where id = #{id,jdbcType=INTEGER} 20 where id = #{id,jdbcType=INTEGER}
21 </select> 21 </select>
22 - <select id="selectByCode" resultMap="BaseResultMap" parameterType="java.lang.Integer" > 22 + <select id="selectByCode" resultMap="BaseResultMap" parameterType="java.lang.String" >
23 select 23 select
24 <include refid="Base_Column_List" /> 24 <include refid="Base_Column_List" />
25 from union_share_settlement 25 from union_share_settlement
@@ -29,16 +29,9 @@ public class UnionSettleUpdateConsumer implements YhConsumer { @@ -29,16 +29,9 @@ public class UnionSettleUpdateConsumer implements YhConsumer {
29 if (null == o) { 29 if (null == o) {
30 return; 30 return;
31 } 31 }
32 - List<Object> list = JsonUtil.jsonToObject(o.toString(), List.class);  
33 - list.forEach(l->{  
34 - try {  
35 - ShareSettlementBo bo = JsonUtil.jsonToObject(l.toString(), ShareSettlementBo.class);  
36 - //TODO 提现结算单状态变更  
37 - unionShareService.updateSettlementStatus(bo);  
38 - } catch (Exception e) {  
39 - logger.warn("UnionSettleUpdateConsumer,handleMessage fail! obj is {}, e {}",l,e.getMessage());  
40 - }  
41 - }); 32 + ShareSettlementBo bo = JsonUtil.jsonToObject(o.toString(), ShareSettlementBo.class);
  33 + //TODO 提现结算单状态变更
  34 + unionShareService.updateSettlementStatus(bo);
42 35
43 } catch (Exception e) { 36 } catch (Exception e) {
44 logger.warn("UnionSettleUpdateConsumer,handleMessage fail! obj is {}, e {}",o,e.getMessage()); 37 logger.warn("UnionSettleUpdateConsumer,handleMessage fail! obj is {}, e {}",o,e.getMessage());
@@ -666,7 +666,7 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport @@ -666,7 +666,7 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport
666 unionShareSettlementMapper.updateByPrimaryKeySelective(updateReq); 666 unionShareSettlementMapper.updateByPrimaryKeySelective(updateReq);
667 667
668 //更新关联订单状态 668 //更新关联订单状态
669 - unionShareOrdersMapper.updateStatusByUid(bo.getPromoteUid(),bo.getSettlementCode(), ShareOrdersStatusEnum.SETTLE.getCode(), ShareOrdersStatusEnum.HAS_SETTLE.getCode(), updateReq.getUpdateTime()); 669 + unionShareOrdersMapper.updateStatusByCode(bo.getSettlementCode(), ShareOrdersStatusEnum.SETTLE.getCode(), ShareOrdersStatusEnum.HAS_SETTLE.getCode(), updateReq.getUpdateTime());
670 670
671 //清缓存 671 //清缓存
672 clearShareOrderRedis(bo.getPromoteUid()); 672 clearShareOrderRedis(bo.getPromoteUid());