Merge remote-tracking branch 'origin/dev' into dev

master
yqyg16603827325@126.com 3 years ago
commit 06e54fae69

@ -80,6 +80,7 @@
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-client</artifactId>
<version>2.12.0</version>
</dependency>
<dependency>

@ -15,26 +15,25 @@ import javax.annotation.Resource;
* @date 2021/7/19
* 怀
*/
@Slf4j
@ElasticSimpleJob(
jobName = "NegativeJob", cron = "0 0/1 * * * ?", shardingTotalCount = 1, overwrite = true, jobEvent = false
)
@Component
public class NegativeJob implements SimpleJob {
@Resource
private TimerTaskService timerTaskService;
private static NegativeJob negativeJob;
@PostConstruct
public void init() {
negativeJob = this;
}
@Override
public void execute(ShardingContext shardingContext) {
//@Slf4j
//@ElasticSimpleJob(
// jobName = "NegativeJob", cron = "0 0/1 * * * ?", shardingTotalCount = 1, overwrite = true, jobEvent = false
//)
//@Component
//public class NegativeJob implements SimpleJob {
// @Resource
// private TimerTaskService timerTaskService;
//
// private static NegativeJob negativeJob;
//
// @PostConstruct
// public void init() {
// negativeJob = this;
// }
//
// @Override
// public void execute(ShardingContext shardingContext) {
// negativeJob.timerTaskService.sendMessage(AppSettingTypeEnum.MESSAGE_BAD_REVIEW.getType());
}
}
// }
//
//}

@ -18,24 +18,24 @@ import javax.annotation.Resource;
* <p>
* cron 0 0/10 8-22 * * ? 822 10
*/
@Slf4j
@Component
@ElasticSimpleJob(
jobName = "PositiveThankJob", cron = "0 0/5 * * * ?", shardingTotalCount = 1, overwrite = true, jobEvent = false)
public class PositiveThankJob implements SimpleJob {
@Resource
private TimerTaskService timerTaskService;
private static PositiveThankJob positiveThankJob;
@PostConstruct
public void init() {
positiveThankJob = this;
}
@Override
public void execute(ShardingContext shardingContext) {
//@Slf4j
//@Component
//@ElasticSimpleJob(
// jobName = "PositiveThankJob", cron = "0 0/5 * * * ?", shardingTotalCount = 1, overwrite = true, jobEvent = false)
//public class PositiveThankJob implements SimpleJob {
// @Resource
// private TimerTaskService timerTaskService;
//
// private static PositiveThankJob positiveThankJob;
//
// @PostConstruct
// public void init() {
// positiveThankJob = this;
// }
//
// @Override
// public void execute(ShardingContext shardingContext) {
// positiveThankJob.timerTaskService.sendMessage(AppSettingTypeEnum.MESSAGE_PRAISE.getType(), TradeEnum.TRADE_FINISHED.toString());
}
}
// }
//
//}

@ -19,6 +19,7 @@ import javax.persistence.Query;
import javax.transaction.Transactional;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -35,25 +36,21 @@ public class TradeJpa {
@Transactional(rollbackOn = Exception.class)
public List<TopTrade> getConfirmReceipt(@RequestBody AppSetting appSetting, String tradeStatus) {
StringBuilder sql = new StringBuilder();
StringBuilder sql;
if (appSetting.getType().equals(AppSettingTypeEnum.MESSAGE_RETURN_REMINDER.getType())) {
//退款
sql = getRefundSql();
} else {
sql = getSql();
}
//实际付款 限定的范围
//实付最小金额
Double minPayment = appSetting.getPaymentFloor();
//实付最大金额
Double maxPayment = appSetting.getPaymentCeiling();
if (minPayment != null && minPayment > 0) {
sql.append("and t.payment >= :minPayment ");
}
if (maxPayment != null) {
if (maxPayment != null && maxPayment > 0) {
sql.append("and t.payment <= :maxPayment ");
}
//订单状态
if (StrUtil.isNotEmpty(tradeStatus)) {
if (appSetting.getType().equals(AppSettingTypeEnum.MESSAGE_RETURN_REMINDER.getType())) {
sql.append("and o.status = :tradeStatus ");
@ -61,8 +58,6 @@ public class TradeJpa {
sql.append("and t.status = :tradeStatus ");
}
}
//如果是催评,需要订单未进行过评价
if (AppSettingTypeEnum.MESSAGE_REMINDER.getType() == appSetting.getType()) {
sql.append("and t.buyer_rate = :buyerRate ");
@ -91,24 +86,21 @@ public class TradeJpa {
day = DateUtil.offset(DateUtil.date(), DateField.MINUTE, -limitMinute);
}
}
if (null != day) {
sql.append("and t.created < :offDay ");
}
//卖家昵称
String sellerNick = appSetting.getSellerNick();
if (StrUtil.isNotEmpty(sellerNick)) {
sql.append("and t.seller_nick = :sellerNick ");
}
Query query = entityManager.createNativeQuery(sql.toString());
//设置参数
if (null != minPayment) {
if (null != minPayment && minPayment > 0) {
query.setParameter("minPayment", minPayment);
}
if (null != maxPayment) {
if (null != maxPayment && maxPayment > 0) {
query.setParameter("maxPayment", maxPayment);
}
if (null != tradeStatus) {
query.setParameter("tradeStatus", tradeStatus);
}
@ -123,7 +115,6 @@ public class TradeJpa {
if (null != sellerNick) {
query.setParameter("sellerNick", sellerNick);
}
query.unwrap(NativeQueryImpl.class).setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP);
List list = query.getResultList();
return getTradeInfo(list);
@ -131,14 +122,13 @@ public class TradeJpa {
private List<TopTrade> getTradeInfo(List list) {
List<TopTrade> tradeList = new ArrayList<>();
for (Object obj : list) {
Map row = (Map) obj;
TopTrade trade = new TopTrade();
trade.setBuyerNick((String) row.get("buyerNick"));
BigInteger tid = (BigInteger) row.get("tid");
trade.setTid(tid.longValue());
trade.setPayment((String) row.get("payTime"));
trade.setPayTime((Date) row.get("payTime"));
trade.setTitle((String) row.get("title"));
trade.setPayment((String) row.get("payment"));
trade.setReceiverName((String) row.get("receiverName"));

@ -27,5 +27,4 @@ public class TopTrade extends BaseTrade implements Serializable {
@ApiModelProperty(value = "id")
private Long id;
}

@ -77,7 +77,9 @@ public class TimerTaskServiceImpl implements TimerTaskService {
continue;
}
List<TopTrade> list = tradeJpa.getConfirmReceipt(as, tradeStatus);
if (CollUtil.isEmpty(list)) {
continue;
}
//过滤黑名单
List<TopTrade> tradeList = filterBlack(list, sellerNick);
//条件过滤
@ -131,7 +133,7 @@ public class TimerTaskServiceImpl implements TimerTaskService {
list.removeIf(trade -> autoTaskMessageInfoJpa.countByTidAndSendType(trade.getTid(), settingType) > 0);
}
//预支预付款
if (as.getEnablePrepaidOrder() != null&&as.getEnablePrepaidOrder() && CollUtil.isNotEmpty(list)) {
if (as.getEnablePrepaidOrder() != null && as.getEnablePrepaidOrder() && CollUtil.isNotEmpty(list)) {
list.removeIf(trade -> trade.getStepTradeStatus().equals(StepTradeStatusEnum.FRONT_PAID_FINAL_NOPAID.toString()));
}
//不发送的旗帜

Loading…
Cancel
Save