查询订单优化
This commit is contained in:
@ -671,7 +671,7 @@ public class OrderServiceImpl implements OrderService {
|
||||
//去查看订单是否支付成功
|
||||
LambdaQueryWrapper<OrderSubPO> querySubOrderWrapper = new LambdaQueryWrapper<>();
|
||||
querySubOrderWrapper.eq(OrderSubPO::getOrderId, orderMainPO.getOrderId())
|
||||
.in(OrderSubPO::getSuborderType, Arrays.asList(SubOrderTypeEnum.RENTBATTEY.getCode(), SubOrderTypeEnum.RENTCAR.getCode()))
|
||||
.in(OrderSubPO::getSuborderType, Arrays.asList(SubOrderTypeEnum.OVERDUE.getCode(), SubOrderTypeEnum.RENTCAR.getCode()))
|
||||
.ne(OrderSubPO::getPayStatus, PayStatusEnum.SUCCESS).orderByDesc(OrderSubPO::getCreatedAt).last(" limit 1");
|
||||
OrderSubPO orderSubPO = orderSubRepo.getOne(querySubOrderWrapper);
|
||||
if(orderSubPO!=null){
|
||||
|
||||
43
src/main/java/com/sczx/order/thirdpart/dto/SysConfigDTO.java
Normal file
43
src/main/java/com/sczx/order/thirdpart/dto/SysConfigDTO.java
Normal file
@ -0,0 +1,43 @@
|
||||
package com.sczx.order.thirdpart.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ApiModel(value = "SysConfigDTO")
|
||||
@Data
|
||||
public class SysConfigDTO {
|
||||
|
||||
|
||||
@ApiModelProperty("参数主键")
|
||||
private Integer configId;
|
||||
|
||||
@ApiModelProperty("参数名称")
|
||||
private String configName;
|
||||
|
||||
@ApiModelProperty("参数键名")
|
||||
private String configKey;
|
||||
|
||||
@ApiModelProperty("参数键值")
|
||||
private String configValue;
|
||||
|
||||
@ApiModelProperty("系统内置(Y是 N否)")
|
||||
private String configType;
|
||||
|
||||
@ApiModelProperty("创建者")
|
||||
private String createBy;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty("更新者")
|
||||
private String updateBy;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
}
|
||||
@ -2,11 +2,12 @@ package com.sczx.order.thirdpart.facade;
|
||||
|
||||
import com.sczx.order.common.Result;
|
||||
import com.sczx.order.thirdpart.dto.CompanyStoreDTO;
|
||||
import com.sczx.order.thirdpart.dto.SysConfigDTO;
|
||||
import com.sczx.order.thirdpart.dto.SysDictDataDTO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(name = "sczx-store", url = "${sczx-store.ribbon.listOfServers:}")
|
||||
public interface StoreFacade {
|
||||
@ -17,4 +18,11 @@ public interface StoreFacade {
|
||||
|
||||
@GetMapping("/sys/getDictDataByDicTypeAndValue")
|
||||
Result<SysDictDataDTO> getDictDataByDicTypeAndValue(@RequestParam(name = "dicType") String dicType, @RequestParam(name = "dicValue") String dicValue);
|
||||
|
||||
|
||||
@PostMapping("/listConfigByConfigKey")
|
||||
Result<List<SysConfigDTO>> listConfigByConfigKey(@RequestBody List<String> configKeys);
|
||||
|
||||
@GetMapping("/getConfigByConfigKey")
|
||||
Result<SysConfigDTO> getConfigByConfigKey(@RequestParam(name = "configKey") String configKey);
|
||||
}
|
||||
|
||||
@ -3,12 +3,15 @@ package com.sczx.order.thirdpart.integration;
|
||||
import com.sczx.order.common.Result;
|
||||
import com.sczx.order.exception.InnerException;
|
||||
import com.sczx.order.thirdpart.dto.CompanyStoreDTO;
|
||||
import com.sczx.order.thirdpart.dto.SysConfigDTO;
|
||||
import com.sczx.order.thirdpart.dto.SysDictDataDTO;
|
||||
import com.sczx.order.thirdpart.facade.StoreFacade;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class StoreInteg {
|
||||
@ -41,4 +44,32 @@ public class StoreInteg {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public List<SysConfigDTO> listConfigByConfigKey(List<String> configKeys){
|
||||
try{
|
||||
Result<List<SysConfigDTO>> result = storeFacade.listConfigByConfigKey(configKeys);
|
||||
if(result.isSuccess()){
|
||||
return result.getData();
|
||||
}
|
||||
} catch (Exception e){
|
||||
log.error("根据系统配置key获取配置失败",e);
|
||||
throw new InnerException("根据系统配置key获取配置失败");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public SysConfigDTO getConfigByConfigKey(String configKey){
|
||||
try{
|
||||
Result<SysConfigDTO> result = storeFacade.getConfigByConfigKey(configKey);
|
||||
if(result.isSuccess()){
|
||||
return result.getData();
|
||||
}
|
||||
} catch (Exception e){
|
||||
log.error("根据系统配置key获取配置失败",e);
|
||||
throw new InnerException("根据系统配置key获取配置失败");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user