|
@@ -178,6 +178,8 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
storePinkService.save(storePink);
|
|
storePinkService.save(storePink);
|
|
if (count == 1) {
|
|
if (count == 1) {
|
|
storePinkService.pinkSuccess(teamPink.getId());
|
|
storePinkService.pinkSuccess(teamPink.getId());
|
|
|
|
+ // 考虑是否回写主订单
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -877,21 +879,48 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public List<StoreOrder> appList(StoreOrderAppDTO dto) {
|
|
public List<StoreOrder> appList(StoreOrderAppDTO dto) {
|
|
|
|
+ Condition condition = new Condition(StoreOrder.class);
|
|
|
|
+ Example.Criteria criteria = condition.createCriteria();
|
|
|
|
+ criteria.andEqualTo("isDelete", 0);
|
|
|
|
+ condition.setOrderByClause("create_time DESC");
|
|
|
|
+ criteria.andEqualTo("uid", dto.getUserId());
|
|
|
|
+
|
|
|
|
+ Condition pinkCondition = new Condition(StorePink.class);
|
|
|
|
+ Example.Criteria pinkCriteria = pinkCondition.createCriteria();
|
|
|
|
+ pinkCriteria.andEqualTo("isDelete", 0);
|
|
|
|
+ pinkCriteria.andEqualTo("uid", dto.getUserId());
|
|
|
|
+
|
|
|
|
+ List<StorePink> pinkList = new ArrayList<>();
|
|
switch (dto.getType()) {
|
|
switch (dto.getType()) {
|
|
case 0:
|
|
case 0:
|
|
break;
|
|
break;
|
|
case 1:
|
|
case 1:
|
|
|
|
+ criteria.andEqualTo("paid", 0);
|
|
break;
|
|
break;
|
|
case 2:
|
|
case 2:
|
|
|
|
+ pinkCriteria.andEqualTo("status", 1);
|
|
|
|
+ pinkList = storePinkService.findByCondition(pinkCondition);
|
|
|
|
+ if (CollUtil.isNotEmpty(pinkList)) {
|
|
|
|
+ criteria.andIn("id", pinkList.stream().map(StorePink::getOrderIdKey).collect(Collectors.toList()));
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
case 3:
|
|
case 3:
|
|
|
|
+ pinkCriteria.andEqualTo("status", 2);
|
|
|
|
+ pinkList = storePinkService.findByCondition(pinkCondition);
|
|
|
|
+ if (CollUtil.isNotEmpty(pinkList)) {
|
|
|
|
+ criteria.andIn("id", pinkList.stream().map(StorePink::getOrderIdKey).collect(Collectors.toList()));
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
case 4:
|
|
case 4:
|
|
|
|
+
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- return Collections.emptyList();
|
|
|
|
|
|
+ List<StoreOrder> orderList = findByCondition(condition);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ return orderList;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -1187,14 +1216,19 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public Boolean goPay(GoPinkDTO dto) {
|
|
public Boolean goPay(GoPinkDTO dto) {
|
|
- // 扣取余额
|
|
|
|
-// accountDubboServiceClient.recharge()
|
|
|
|
-// Boolean b = accountDubboServiceClient.checkFee(user.getId(), storeOrder.getPayPrice());
|
|
|
|
|
|
+// StoreOrder storeOrder = findBy("orderId", dto.getOrderId());
|
|
|
|
+// // 扣取余额
|
|
|
|
+// Boolean b = accountDubboServiceClient.checkFee(dto.getUserId(), storeOrder.getPayPrice());
|
|
// if (!b){
|
|
// if (!b){
|
|
// return Result.fail(ResultCode.INSUFFICIENT_BALANCE);
|
|
// return Result.fail(ResultCode.INSUFFICIENT_BALANCE);
|
|
// }
|
|
// }
|
|
|
|
+// TransParam transParam = new TransParam();
|
|
|
|
+// transParam.builder()
|
|
|
|
+// .setBizId(dto.getOrderId())
|
|
|
|
+// .setDebitAccount(user.getId())
|
|
|
|
+// .setCreditAccount();
|
|
|
|
+// accountDubboServiceClient.trans(transParam);
|
|
//
|
|
//
|
|
-// StoreOrder storeOrder = findById(orderId);
|
|
|
|
// if (storeOrder.getPaid() == 1) {
|
|
// if (storeOrder.getPaid() == 1) {
|
|
|
|
|
|
if ("open".equals(dto.getType())) {
|
|
if ("open".equals(dto.getType())) {
|
|
@@ -1204,9 +1238,6 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
goPink(dto);
|
|
goPink(dto);
|
|
}
|
|
}
|
|
return true;
|
|
return true;
|
|
-// } else {
|
|
|
|
-// return false;
|
|
|
|
-// }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|