|
|
@@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.util.List;
|
|
|
+import java.util.Optional;
|
|
|
|
|
|
/**
|
|
|
* @author chan
|
|
|
@@ -44,12 +45,19 @@ public class ShopConfigController {
|
|
|
private final ZfbShopOrderDayLimitMapper zfbShopOrderDayLimitMapper;
|
|
|
|
|
|
@GetMapping
|
|
|
- public Result<SearchResult<ShopConfig>> get(){
|
|
|
- SearchResult<ShopConfig> searchResult = beanSearcher.search(ShopConfig.class, MapUtils.flatBuilder(request.getParameterMap()).build());
|
|
|
- searchResult.getDataList().forEach((shopConfig)->{
|
|
|
- shopConfig.setChannelCount(channelService.count(Wrappers.lambdaQuery(Channel.class).eq(Channel::getWxShopId,shopConfig.getAppId()).or().eq(Channel::getZfbShopId,shopConfig.getAppId())));
|
|
|
- });
|
|
|
- return GatewayResponse.SUCCESS.newBuilder().toResult(searchResult);
|
|
|
+ public Result<SearchResult<ShopConfig>> get() {
|
|
|
+ SearchResult<ShopConfig> searchResult = beanSearcher.search(ShopConfig.class, MapUtils.flatBuilder(request.getParameterMap()).build());
|
|
|
+ searchResult.getDataList().forEach((shopConfig) -> {
|
|
|
+ shopConfig.setChannelCount(channelService.count(Wrappers.lambdaQuery(Channel.class).eq(Channel::getWxShopId, shopConfig.getAppId()).or().eq(Channel::getZfbShopId, shopConfig.getAppId())));
|
|
|
+
|
|
|
+ Optional.ofNullable(zfbShopOrderDayLimitMapper.selectOne(Wrappers.lambdaQuery(ZfbShopOrderDayLimit.class)
|
|
|
+ .eq(ZfbShopOrderDayLimit::getAppId, shopConfig.getAppId())
|
|
|
+ .last("limit 1"))).ifPresent(limit -> {
|
|
|
+ shopConfig.setDayLimitOrders(limit.getDayLimitOrders());
|
|
|
+ shopConfig.setDayLimitStatus(limit.getStatus());
|
|
|
+ });
|
|
|
+ });
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(searchResult);
|
|
|
}
|
|
|
|
|
|
@PostMapping
|