|
@@ -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);
|
|
|
+ }
|
|
|
}
|