|
@@ -2,6 +2,7 @@ package com.fire.admin.rest;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.fire.admin.request.ChannelPageParam;
|
|
|
+import com.fire.admin.request.ChannelSetInvalidParam;
|
|
|
import com.fire.admin.service.ChannelInfoService;
|
|
|
import com.fire.dto.ChannelInfo;
|
|
|
import com.fire.dto.ChannelSupplier;
|
|
@@ -12,9 +13,9 @@ import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiModelProperty;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@@ -29,13 +30,9 @@ import java.util.List;
|
|
|
@Slf4j
|
|
|
public class ChannelInfoRest {
|
|
|
|
|
|
+ @Resource
|
|
|
private ChannelInfoService channelInfoService;
|
|
|
|
|
|
- @Autowired
|
|
|
- public ChannelInfoRest(ChannelInfoService channelInfoService) {
|
|
|
- this.channelInfoService = channelInfoService;
|
|
|
- }
|
|
|
-
|
|
|
@PostMapping("/list")
|
|
|
@ApiOperation(value = "通道列表", notes = "channel_list.py")
|
|
|
public BaseRestResponse channelInfoList(@RequestBody ChannelPageParam channelPageParam) {
|
|
@@ -60,8 +57,8 @@ public class ChannelInfoRest {
|
|
|
|
|
|
@GetMapping("/supplierInfo")
|
|
|
@ApiModelProperty(value = "获取供应商信息", notes = "get_supplier_info.py")
|
|
|
- public BaseRestResponse getSupplierInfo() {
|
|
|
- List<ChannelSupplier> supplierList = channelInfoService.getSupplierInfo();
|
|
|
+ public BaseRestResponse getSupplierInfo(String supplierName) {
|
|
|
+ List<ChannelSupplier> supplierList = channelInfoService.getSupplierInfo(supplierName);
|
|
|
if (supplierList != null) {
|
|
|
return new BaseRestResponse(supplierList);
|
|
|
} else {
|
|
@@ -87,7 +84,7 @@ public class ChannelInfoRest {
|
|
|
@ApiOperation(value = "通道逻辑删除", notes = "delete_channelInfo.py")
|
|
|
public BaseResponse deleteChannelById(@PathVariable("channelId") Long channelId) {
|
|
|
try {
|
|
|
- channelInfoService.deleteChannelById(channelId);
|
|
|
+ channelInfoService.deleteChannelAndProductByChannelId(channelId);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
log.error("参数异常!");
|
|
@@ -96,9 +93,9 @@ public class ChannelInfoRest {
|
|
|
}
|
|
|
|
|
|
@PutMapping("/setIsValid")
|
|
|
- @ApiOperation(value = "置无效/有效", notes = "set_isvalid.py")
|
|
|
- public BaseResponse setInvalid(Long channelId, Integer isValid) {
|
|
|
- channelInfoService.setInvalid(channelId, isValid);
|
|
|
+ @ApiOperation(value = "通道置无效/有效", notes = "set_isvalid.py")
|
|
|
+ public BaseResponse setInvalid(@RequestBody ChannelSetInvalidParam channelSetInvalidParam) {
|
|
|
+ channelInfoService.setInvalid(channelSetInvalidParam.getChannelId(), channelSetInvalidParam.getIsValid());
|
|
|
return new BaseResponse();
|
|
|
}
|
|
|
}
|