Commit 58bd47ff authored by 技术总监-万宁's avatar 技术总监-万宁

调整代码

parent 2f93ac1d
......@@ -6,14 +6,14 @@ import com.ssy.lingxi.system.dto.response.RuleConfigurationListResponse;
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;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
* @menu 规则配置-平台规则配置
* @author wrc
......@@ -22,26 +22,33 @@ import java.util.List;
@Api(tags = "规则配置平台规则配置")
@RestController
public class RuleConfigurationController {
@Resource
RuleConfigurationService ruleConfigurationService;
@ApiOperation(value = " 规则配置平台规则配置列表查询")
@GetMapping("/rule/configuration/list")
/**
* 查询平台规则配置
* @return 查询结果
*/
@RequestMapping(value = "/rule/configuration/list", method = RequestMethod.GET)
public Wrapper<List<RuleConfigurationListResponse>> ruleConfigurationList( ) {
return ruleConfigurationService.ruleConfigurationList();
}
@ApiOperation(value = " 规则配置平台规则配置修改")
@PostMapping("/rule/configuration/update")
public Wrapper ruleConfigurationUpdate(@RequestBody RuleConfigurationRequest request){
/**
* 修改平台规则配置状态
* @param request 接口参数
* @return 修改结果
*/
@RequestMapping(value = "/rule/configuration/update", method = RequestMethod.POST)
public Wrapper<Void> ruleConfigurationUpdate(@RequestBody RuleConfigurationRequest request){
return ruleConfigurationService.ruleConfigurationUpdate(request);
}
/**
*售后订单类型查询
* 查询订单类型
* @return 查询结果
*/
@GetMapping("/rule/getOrderType")
@RequestMapping(value = "/rule/getOrderType", method = RequestMethod.GET)
public Wrapper<List<RuleVO>> getOrderType() {
return ruleConfigurationService.getOrderType();
}
......
......@@ -14,20 +14,15 @@ import java.util.List;
*/
public interface RuleConfigurationService {
/**
* 查询支付方式配置
* @author wrc
* @date 2020/6/11
*/
Wrapper<List<RuleConfigurationListResponse>> ruleConfigurationList();
/**
* 修改支付方式
* @author wrc
* @date 2020/7/13
* 修改平台配置
* @param request 接口参数
* @return 修改结果
*/
Wrapper ruleConfigurationUpdate(RuleConfigurationRequest request);
Wrapper<Void> ruleConfigurationUpdate(RuleConfigurationRequest request);
// /**
......@@ -36,7 +31,8 @@ public interface RuleConfigurationService {
// Wrapper<List<RuleConfiguration>> getOrderType();
/**
*售后订单类型查询
* 查询订单类型
* @return 查询结果
*/
Wrapper<List<RuleVO>> getOrderType();
}
......@@ -42,9 +42,7 @@ public class RuleConfigurationServiceImpl implements RuleConfigurationService {
/**
* 查询平台规则配置
*
* @author wrc
* @date 2020/6/11
* @return 查询结果
*/
@Override
public Wrapper<List<RuleConfigurationListResponse>> ruleConfigurationList() {
......@@ -62,14 +60,13 @@ public class RuleConfigurationServiceImpl implements RuleConfigurationService {
}
/**
* 修改平台规则配置
* @param request
* @author wrc
* @date 2020/7/13
* 修改平台配置
* @param request 接口参数
* @return 修改结果
*/
@Transactional
@Override
public Wrapper ruleConfigurationUpdate(RuleConfigurationRequest request) {
public Wrapper<Void> ruleConfigurationUpdate(RuleConfigurationRequest request) {
List<com.ssy.lingxi.platform.manage.api.vo.response.RuleConfigurationResponse> ruleConfigurations =new ArrayList<>();
request.getRuleConfigurations().forEach(ruleConfiguration -> {
com.ssy.lingxi.platform.manage.api.vo.response.RuleConfigurationResponse ruleConfigurationNew=new RuleConfigurationResponse();
......@@ -110,17 +107,16 @@ public class RuleConfigurationServiceImpl implements RuleConfigurationService {
*/
@Override
public Wrapper<List<RuleVO>> getOrderType() {
List<RuleConfiguration> allByPlatformType = ruleConfigurationRepository.findAllByPlatformTypeAndIsPitchOn(CommonConstant.Type.ORDER_TYPE,CommonConstant.State.STATE_START,Sort.by("code").descending());
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(temp.getCode());
return ruleConfiguration;
}).collect(Collectors.toList());
return Wrapper.success(collect);
List<RuleConfiguration> ruleConfigurations = ruleConfigurationRepository.findAllByPlatformTypeAndIsPitchOn(CommonConstant.Type.ORDER_TYPE,CommonConstant.State.STATE_START,Sort.by("code").descending());
return Wrapper.success(ruleConfigurations.stream().map(temp -> {
RuleVO ruleVO = new RuleVO();
ruleVO.setIsPitchOn(temp.getIsPitchOn());
ruleVO.setPlatformType(temp.getPlatformType());
ruleVO.setPlatformTypeName(temp.getPlatformTypeName());
ruleVO.setPlatformWayName(temp.getPlatformWayName());
ruleVO.setId(temp.getCode());
return ruleVO;
}).collect(Collectors.toList()));
}
// /**
......
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