浏览代码

支付通道列表

yubin 1 周之前
父节点
当前提交
5e03c0477d

+ 1 - 2
cif-service/src/main/java/com/txz/cif/web/bo/PaymentChannelBO.java

@@ -8,12 +8,11 @@ import lombok.*;
 @Getter
 @Setter
 @NoArgsConstructor
-@AllArgsConstructor
+
 @Builder
 @ApiModel(value = "支付通道")
 public class PaymentChannelBO extends PaymentChannel {
 
-        private MidChannelMethod midChannelMethod;
 
 
 }

+ 24 - 15
cif-service/src/main/java/com/txz/cif/web/mng/PaymentChannelController.java

@@ -16,8 +16,10 @@ import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.txz.cif.service.PaymentMethodService;
 import com.txz.cif.service.UserService;
+import com.txz.cif.web.bo.PaymentChannelBO;
 import com.txz.cif.web.para.PaymentChannelParam;
 import com.txz.cif.web.para.updateparam.PaymentChannelUpdateParam;
+import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -31,7 +33,9 @@ import tk.mybatis.mapper.entity.Example.Criteria;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 
+import java.util.ArrayList;
 import java.util.List;
+import java.util.stream.Collectors;
 
 
 /**
@@ -136,23 +140,28 @@ public class PaymentChannelController {
 //        return ResultGenerator.genSuccessResult(paymentChannel);
 //    }
 
-//    @PostMapping("/list")
-//	@ApiOperation(value = "paymentChannel获取列表",httpMethod = "POST")
-//    public Result<List<PaymentChannel>> list(@RequestBody PaymentChannel paymentChannel, @RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "0") Integer size) {
-//
+    @PostMapping("/list")
+	@ApiOperation(value = "paymentChannel获取列表",httpMethod = "POST")
+    public Result<List<PaymentChannelBO>> list() {
+
 //        PageHelper.startPage(page, size);
 //
 //        Condition condition = new Condition(paymentChannel.getClass());
 //        Criteria criteria = condition.createCriteria();
-////        criteria.andEqualTo("name", city.getName());
-//		PageInfo pageInfo = null;
-//		try {
-//    		 List<PaymentChannel> list = paymentChannelService.findByCondition(condition);
-//    		 pageInfo = new PageInfo(list);
-//		} catch (Exception e) {
-//			log.error("查询对象操作异常e:{}",e);
-//			return ResultGenerator.genFailResult(ResultCode.INTERNAL_SERVER_ERROR);
-//		}
-//        return ResultGenerator.genSuccessResult(pageInfo);
-//    }
+//        criteria.andEqualTo("name", city.getName());
+	//	PageInfo pageInfo = null;
+		List<PaymentChannelBO> resultList = new ArrayList<>();
+		Byte b = (byte) 1;
+		try {
+    		 List<PaymentChannel> list = paymentChannelService.findAll();
+			 if(!CollectionUtils.isEmpty(list)) {
+				 resultList = list.stream().filter(a -> b.equals(a.getIsValid())).map(a -> BeanUtil.toBean(a, PaymentChannelBO.class)).collect(Collectors.toList());
+			 }
+
+		} catch (Exception e) {
+			log.error("查询对象操作异常e:{}",e);
+			return ResultGenerator.genFailResult(ResultCode.INTERNAL_SERVER_ERROR);
+		}
+        return ResultGenerator.genSuccessResult(resultList);
+    }
 }

+ 19 - 0
cif-service/src/main/java/com/txz/cif/web/para/BasePageParam.java

@@ -0,0 +1,19 @@
+package com.txz.cif.web.para;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.*;
+
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+public class BasePageParam {
+
+    @ApiModelProperty(value="page")
+    private Integer page;
+
+    @ApiModelProperty(value="size")
+    private Integer size;
+
+}