123
This commit is contained in:
parent
49f38c29ab
commit
f0a0a8756e
@ -58,29 +58,9 @@ public class OrderService extends ServiceImpl<OrderMapper,Order> implements Orde
|
||||
}
|
||||
|
||||
public R<JSONObject> getOrder(Integer page, Integer num) {
|
||||
Page<Order> orderPage = new Page<>((long)page, (long)num);
|
||||
Page<Order> orderPage = new Page<>(page, num);
|
||||
Page<Order> orderPage1 = this.page(orderPage, null);
|
||||
orderPage1.getRecords().forEach(e -> {
|
||||
LambdaQueryWrapper<Store> orderVOLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
orderVOLambdaQueryWrapper.eq(Store::getId,e.getStoreId());
|
||||
Store store = storeMapper.getOne(orderVOLambdaQueryWrapper);
|
||||
e.setStoreName(store.getName());
|
||||
|
||||
LambdaQueryWrapper<Commission> commissionLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
commissionLambdaQueryWrapper
|
||||
.eq(Commission::getStoreId,e.getStoreId())
|
||||
.le(Commission::getPriceMax,e.getCommission())
|
||||
.ge(Commission::getPriceMin,e.getCommission());
|
||||
Commission commission = commissionMapper.selectOne(commissionLambdaQueryWrapper);
|
||||
if (commission != null){
|
||||
e.setCommission(commission.getCommission());
|
||||
}else{
|
||||
e.setCommission(0.0);
|
||||
}
|
||||
});
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.fluentPut("info", orderPage1.getRecords()).fluentPut("total", orderPage1.getTotal());
|
||||
return R.success(jsonObject);
|
||||
return getJsonObjectR(orderPage1);
|
||||
}
|
||||
|
||||
public R<Boolean> getOrderUserInfo(String content) {
|
||||
@ -107,6 +87,30 @@ public class OrderService extends ServiceImpl<OrderMapper,Order> implements Orde
|
||||
|
||||
Page<Order> orderPage = new Page<>((long)page, (long)num);
|
||||
Page<Order> orderPage1 = this.page(orderPage, orderLambdaQueryWrapper);
|
||||
|
||||
return getJsonObjectR(orderPage1);
|
||||
}
|
||||
|
||||
private R<JSONObject> getJsonObjectR(Page<Order> orderPage1) {
|
||||
orderPage1.getRecords().forEach(e -> {
|
||||
LambdaQueryWrapper<Store> orderVOLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
orderVOLambdaQueryWrapper.eq(Store::getId,e.getStoreId());
|
||||
Store store = storeMapper.getOne(orderVOLambdaQueryWrapper);
|
||||
e.setStoreName(store.getName());
|
||||
|
||||
LambdaQueryWrapper<Commission> commissionLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
commissionLambdaQueryWrapper
|
||||
.eq(Commission::getStoreId,e.getStoreId())
|
||||
.le(Commission::getPriceMax,e.getCommission())
|
||||
.ge(Commission::getPriceMin,e.getCommission());
|
||||
Commission commission = commissionMapper.selectOne(commissionLambdaQueryWrapper);
|
||||
if (commission != null){
|
||||
e.setCommission(commission.getCommission());
|
||||
}else{
|
||||
e.setCommission(0.0);
|
||||
}
|
||||
});
|
||||
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.fluentPut("info", orderPage1.getRecords()).fluentPut("total", orderPage1.getTotal());
|
||||
return R.success(jsonObject);
|
||||
|
@ -76,21 +76,13 @@ public class WebSocketService {
|
||||
public R<JSONObject> parseMessage(String userId, String message, ConcurrentHashMap<String, WebSocketController> webSocketMap){
|
||||
JSONObject parse = JSONObject.parse(message);
|
||||
String type = (String) parse.get("type");
|
||||
switch (type) {
|
||||
case "ping" -> {
|
||||
return ping(userId);
|
||||
}
|
||||
case "addVerifyInfo" -> {
|
||||
return addVerifyInfo(userId, parse);
|
||||
}
|
||||
case "getTime" -> {
|
||||
return getTime(userId);
|
||||
}
|
||||
case "confirmVerifyInfo" -> {
|
||||
return confirmVerifyInfo(parse,webSocketMap);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
return switch (type) {
|
||||
case "ping" -> ping(userId);
|
||||
case "addVerifyInfo" -> addVerifyInfo(userId, parse);
|
||||
case "getTime" -> getTime(userId);
|
||||
case "confirmVerifyInfo" -> confirmVerifyInfo(parse,webSocketMap);
|
||||
default -> null;
|
||||
};
|
||||
}
|
||||
|
||||
private R<JSONObject> confirmVerifyInfo(JSONObject parse, ConcurrentHashMap<String, WebSocketController> webSocketMap) {
|
||||
|
@ -30,9 +30,9 @@ spring:
|
||||
data:
|
||||
redis:
|
||||
database: 1
|
||||
host: wzpmc.cn
|
||||
host: localhost
|
||||
port: 6379
|
||||
password: MyCraftAdmin123
|
||||
# password: MyCraftAdmin123
|
||||
mvc:
|
||||
static-path-pattern: /static/**
|
||||
security:
|
||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user