Commit 2f93ac1d authored by 技术总监-万宁's avatar 技术总监-万宁

修改获取订单类型

parent 8a7b1395
......@@ -3,7 +3,7 @@ package com.ssy.lingxi.system.controller;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.system.dto.request.RuleConfigurationRequest;
import com.ssy.lingxi.system.dto.response.RuleConfigurationListResponse;
import com.ssy.lingxi.system.entity.RuleConfiguration;
import com.ssy.lingxi.system.model.response.RuleVO;
import com.ssy.lingxi.system.service.RuleConfigurationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -42,16 +42,7 @@ public class RuleConfigurationController {
*售后订单类型查询
*/
@GetMapping("/rule/getOrderType")
public Wrapper<List<RuleConfiguration>> getOrderType() {
public Wrapper<List<RuleVO>> getOrderType() {
return ruleConfigurationService.getOrderType();
}
}
package com.ssy.lingxi.system.model.response;
import java.io.Serializable;
/**
* 获取平台规则配置返回
* @author 万宁
* @version 2.0.0
* @date 2021-08-05
*/
public class RuleVO implements Serializable {
private static final long serialVersionUID = -9084675120961709951L;
private Integer id;
private Integer platformType;
private String platformWayName;
private Integer isPitchOn;
private String platformTypeName;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getPlatformType() {
return platformType;
}
public void setPlatformType(Integer platformType) {
this.platformType = platformType;
}
public String getPlatformWayName() {
return platformWayName;
}
public void setPlatformWayName(String platformWayName) {
this.platformWayName = platformWayName;
}
public Integer getIsPitchOn() {
return isPitchOn;
}
public void setIsPitchOn(Integer isPitchOn) {
this.isPitchOn = isPitchOn;
}
public String getPlatformTypeName() {
return platformTypeName;
}
public void setPlatformTypeName(String platformTypeName) {
this.platformTypeName = platformTypeName;
}
}
......@@ -3,7 +3,7 @@ package com.ssy.lingxi.system.service;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.system.dto.request.RuleConfigurationRequest;
import com.ssy.lingxi.system.dto.response.RuleConfigurationListResponse;
import com.ssy.lingxi.system.entity.RuleConfiguration;
import com.ssy.lingxi.system.model.response.RuleVO;
import java.util.List;
......@@ -30,8 +30,13 @@ public interface RuleConfigurationService {
// /**
// *售后订单类型查询
// */
// Wrapper<List<RuleConfiguration>> getOrderType();
/**
*售后订单类型查询
*/
Wrapper<List<RuleConfiguration>> getOrderType();
Wrapper<List<RuleVO>> getOrderType();
}
......@@ -12,6 +12,7 @@ import com.ssy.lingxi.system.dao.RuleConfigurationRepository;
import com.ssy.lingxi.system.dto.request.RuleConfigurationRequest;
import com.ssy.lingxi.system.dto.response.RuleConfigurationListResponse;
import com.ssy.lingxi.system.entity.RuleConfiguration;
import com.ssy.lingxi.system.model.response.RuleVO;
import com.ssy.lingxi.system.service.RuleConfigurationService;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;
......@@ -108,17 +109,35 @@ public class RuleConfigurationServiceImpl implements RuleConfigurationService {
* 售后订单类型查询
*/
@Override
public Wrapper<List<RuleConfiguration>> getOrderType() {
public Wrapper<List<RuleVO>> getOrderType() {
List<RuleConfiguration> allByPlatformType = ruleConfigurationRepository.findAllByPlatformTypeAndIsPitchOn(CommonConstant.Type.ORDER_TYPE,CommonConstant.State.STATE_START,Sort.by("code").descending());
List<RuleConfiguration> collect = allByPlatformType.stream().map(temp -> {
RuleConfiguration ruleConfiguration = new RuleConfiguration();
List<RuleVO> collect = allByPlatformType.stream().map(temp -> {
RuleVO ruleConfiguration = new RuleVO();
ruleConfiguration.setIsPitchOn(temp.getIsPitchOn());
ruleConfiguration.setPlatformType(temp.getPlatformType());
ruleConfiguration.setPlatformTypeName(temp.getPlatformTypeName());
ruleConfiguration.setPlatformWayName(temp.getPlatformWayName());
ruleConfiguration.setId(Long.valueOf(temp.getCode()));
ruleConfiguration.setId(temp.getCode());
return ruleConfiguration;
}).collect(Collectors.toList());
return Wrapper.success(collect);
}
// /**
// * 售后订单类型查询
// */
// @Override
// public Wrapper<List<RuleConfiguration>> getOrderType() {
// List<RuleConfiguration> allByPlatformType = ruleConfigurationRepository.findAllByPlatformTypeAndIsPitchOn(CommonConstant.Type.ORDER_TYPE,CommonConstant.State.STATE_START,Sort.by("code").descending());
// List<RuleConfiguration> collect = allByPlatformType.stream().map(temp -> {
// RuleConfiguration ruleConfiguration = new RuleConfiguration();
// ruleConfiguration.setIsPitchOn(temp.getIsPitchOn());
// ruleConfiguration.setPlatformType(temp.getPlatformType());
// ruleConfiguration.setPlatformTypeName(temp.getPlatformTypeName());
// ruleConfiguration.setPlatformWayName(temp.getPlatformWayName());
// ruleConfiguration.setId(Long.valueOf(temp.getCode()));
// return ruleConfiguration;
// }).collect(Collectors.toList());
// return Wrapper.success(collect);
// }
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment