Authored by mingdan.ge

cps推广mq修改

... ... @@ -46,6 +46,8 @@ public interface UnionShareOrdersMapper {
int updateStatusById(@Param("id")int id,@Param("oldStatus")String oldStatus,@Param("newStatus")String newStatus,@Param("updateTime")int updateTime);
int updateStatusByUid(@Param("promoteUid")int promoteUid,@Param("settlementCode")String settlementCode,@Param("oldStatus")String oldStatus,@Param("newStatus")String newStatus,@Param("updateTime")int updateTime);
int updateStatusByCode(@Param("settlementCode")String settlementCode,@Param("oldStatus")String oldStatus,@Param("newStatus")String newStatus,@Param("updateTime")int updateTime);
int updateByPrimaryKey(UnionShareOrders record);
... ...
... ... @@ -276,6 +276,12 @@
update_time = #{updateTime,jdbcType=INTEGER}
where promote_uid = #{promoteUid,jdbcType=INTEGER} and status = #{oldStatus,jdbcType=VARCHAR}
</update>
<update id="updateStatusByCode" >
update union_share_orders
set status = #{newStatus,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=INTEGER}
where settlement_code = #{settlementCode,jdbcType=VARCHAR} and status = #{oldStatus,jdbcType=VARCHAR}
</update>
<select id="selectRecentlyOrderLimitTen" resultMap="BaseResultMap">
select
... ...
... ... @@ -19,7 +19,7 @@
from union_share_settlement
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectByCode" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
<select id="selectByCode" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from union_share_settlement
... ...
... ... @@ -29,16 +29,9 @@ public class UnionSettleUpdateConsumer implements YhConsumer {
if (null == o) {
return;
}
List<Object> list = JsonUtil.jsonToObject(o.toString(), List.class);
list.forEach(l->{
try {
ShareSettlementBo bo = JsonUtil.jsonToObject(l.toString(), ShareSettlementBo.class);
//TODO 提现结算单状态变更
unionShareService.updateSettlementStatus(bo);
} catch (Exception e) {
logger.warn("UnionSettleUpdateConsumer,handleMessage fail! obj is {}, e {}",l,e.getMessage());
}
});
ShareSettlementBo bo = JsonUtil.jsonToObject(o.toString(), ShareSettlementBo.class);
//TODO 提现结算单状态变更
unionShareService.updateSettlementStatus(bo);
} catch (Exception e) {
logger.warn("UnionSettleUpdateConsumer,handleMessage fail! obj is {}, e {}",o,e.getMessage());
... ...
... ... @@ -666,7 +666,7 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport
unionShareSettlementMapper.updateByPrimaryKeySelective(updateReq);
//更新关联订单状态
unionShareOrdersMapper.updateStatusByUid(bo.getPromoteUid(),bo.getSettlementCode(), ShareOrdersStatusEnum.SETTLE.getCode(), ShareOrdersStatusEnum.HAS_SETTLE.getCode(), updateReq.getUpdateTime());
unionShareOrdersMapper.updateStatusByCode(bo.getSettlementCode(), ShareOrdersStatusEnum.SETTLE.getCode(), ShareOrdersStatusEnum.HAS_SETTLE.getCode(), updateReq.getUpdateTime());
//清缓存
clearShareOrderRedis(bo.getPromoteUid());
... ...