|
@@ -119,8 +119,8 @@ public class RedEnvelopeServiceImpl extends AbstractService<RedEnvelope> impleme
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public List<EarningsDTO> sumWithOrderNo(String orderNo) {
|
|
|
|
|
- return cRedEnvelopeMapper.sumWithOrderNo(orderNo);
|
|
|
|
|
|
|
+ public List<EarningsDTO> sumWithOrderNo(String orderNo, Long userId) {
|
|
|
|
|
+ return cRedEnvelopeMapper.sumWithOrderNo(orderNo, userId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -128,12 +128,12 @@ public class RedEnvelopeServiceImpl extends AbstractService<RedEnvelope> impleme
|
|
|
flowService.settle(redEnvelope);
|
|
flowService.settle(redEnvelope);
|
|
|
update(RedEnvelope.builder().id(redEnvelope.getId()).status(2).build());
|
|
update(RedEnvelope.builder().id(redEnvelope.getId()).status(2).build());
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public BigDecimal sumByStatus(HashMap map) {
|
|
public BigDecimal sumByStatus(HashMap map) {
|
|
|
return cRedEnvelopeMapper.sumByStatus(map);
|
|
return cRedEnvelopeMapper.sumByStatus(map);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
public static void main(String[] args) {
|
|
public static void main(String[] args) {
|
|
|
System.out.println(DateUtil.now());
|
|
System.out.println(DateUtil.now());
|
|
|
}
|
|
}
|
|
@@ -175,12 +175,12 @@ public class RedEnvelopeServiceImpl extends AbstractService<RedEnvelope> impleme
|
|
|
}
|
|
}
|
|
|
// 直推红包
|
|
// 直推红包
|
|
|
try {
|
|
try {
|
|
|
- //判断当前用户是否第一次下单
|
|
|
|
|
|
|
+ // 判断当前用户是否第一次下单
|
|
|
Condition c = new Condition(RedEnvelope.class);
|
|
Condition c = new Condition(RedEnvelope.class);
|
|
|
- c.createCriteria().andEqualTo("userId",userId.getUserId())
|
|
|
|
|
- .andIn("bizType",CollUtil.newArrayList(BizTypeEnum.OPEN_GROUP_RED_ENVELOPE.getKey(),BizTypeEnum.JOIN_GROUP_RED_ENVELOPE.getKey()));
|
|
|
|
|
- int count = countByCondition(c);
|
|
|
|
|
- if (count == 0){
|
|
|
|
|
|
|
+ c.createCriteria().andEqualTo("userId", userId.getUserId())
|
|
|
|
|
+ .andIn("bizType", CollUtil.newArrayList(BizTypeEnum.OPEN_GROUP_RED_ENVELOPE.getKey(), BizTypeEnum.JOIN_GROUP_RED_ENVELOPE.getKey()));
|
|
|
|
|
+ int count = countByCondition(c);
|
|
|
|
|
+ if (count == 0) {
|
|
|
com.txz.operating.result.Result<ConfigDTO> openRedEnvelopeRate = operatingConfigDubboServiceClient.getConfigByCode("invited_amount");
|
|
com.txz.operating.result.Result<ConfigDTO> openRedEnvelopeRate = operatingConfigDubboServiceClient.getConfigByCode("invited_amount");
|
|
|
log.info("operatingConfigDubboServiceClient.getConfigByCode openRedEnvelopeRate:" + JSONObject.toJSONString(openRedEnvelopeRate));
|
|
log.info("operatingConfigDubboServiceClient.getConfigByCode openRedEnvelopeRate:" + JSONObject.toJSONString(openRedEnvelopeRate));
|
|
|
String amountStr = openRedEnvelopeRate.getData().getValueInfo();
|
|
String amountStr = openRedEnvelopeRate.getData().getValueInfo();
|
|
@@ -260,7 +260,7 @@ public class RedEnvelopeServiceImpl extends AbstractService<RedEnvelope> impleme
|
|
|
try {
|
|
try {
|
|
|
noticeDubboServiceClient.addRewardNotice(getNoticeEunm(bizType), param.getUserIds().get(0).getOrderNo(), redEnvelope.getUserId());
|
|
noticeDubboServiceClient.addRewardNotice(getNoticeEunm(bizType), param.getUserIds().get(0).getOrderNo(), redEnvelope.getUserId());
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
- log.error("发送消息异常",e);
|
|
|
|
|
|
|
+ log.error("发送消息异常", e);
|
|
|
}
|
|
}
|
|
|
return redEnvelope;
|
|
return redEnvelope;
|
|
|
} else {
|
|
} else {
|