增加角色相关,进件相关修改,后台增加用户默认通道,前台默认通道

This commit is contained in:
liuyingfang
2023-06-28 10:05:28 +08:00
parent e26d85f4c9
commit fe7e9f2074
11 changed files with 183 additions and 9 deletions

View File

@@ -0,0 +1,71 @@
package cn.pluss.platform.controller;
import cn.pluss.platform.api.Result;
import cn.pluss.platform.api.ResultGenerator;
import cn.pluss.platform.entity.MerchantChannelStatus;
import cn.pluss.platform.enums.ZfbChannel;
import cn.pluss.platform.exception.MsgException;
import cn.pluss.platform.merchantChannelStatus.MerchantChannelStatusService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author lyf
*/
@RestController
@RequestMapping("/zxfAttestation")
public class ZfbAttestationController {
@Resource
private MerchantChannelStatusService merchantChannelStatusService;
/**
* 支付认证
* @param params
* @return
*/
@PostMapping
public Result<Object> Attestation(@RequestBody Map<String, String> params) {
List<MerchantChannelStatus> merchantCode = merchantChannelStatusService.getMerchantCodeByInfo(params.get("merchantCode"));
List<Object> result = new ArrayList<>();
for (MerchantChannelStatus channelStatus : merchantCode) {
switch (channelStatus.getChannel()){
case 1:
HashMap<Object, Object> merchantCodeMap = new HashMap<>();
merchantCodeMap.put("virChannelFlag", channelStatus.getVirChannelFlag());
merchantCodeMap.put("url", ZfbChannel.SXF_CHANNEL.getUrl());
merchantCodeMap.put("nameChannel",ZfbChannel.SXF_CHANNEL.getName());
result.add(merchantCodeMap);
break;
case 4:
HashMap<Object, Object> merchantCodeMap4 = new HashMap<>();
merchantCodeMap4.put("virChannelFlag", channelStatus.getVirChannelFlag());
merchantCodeMap4.put("url", ZfbChannel.YS_CHANNEL.getUrl());
merchantCodeMap4.put("nameChannel",ZfbChannel.YS_CHANNEL.getName());
result.add(merchantCodeMap4);
break;
case 5:
HashMap<Object, Object> merchantCodeMap5 = new HashMap<>();
merchantCodeMap5.put("virChannelFlag", channelStatus.getVirChannelFlag());
merchantCodeMap5.put("url", ZfbChannel.LKL_CHANNEL.getUrl());
merchantCodeMap5.put("nameChannel",ZfbChannel.LKL_CHANNEL.getName());
result.add(merchantCodeMap5);
break;
case 6:
HashMap<Object, Object> merchantCodeMap6 = new HashMap<>();
merchantCodeMap6.put("virChannelFlag", channelStatus.getVirChannelFlag());
merchantCodeMap6.put("url", ZfbChannel.YS_CHANNEL.getUrl());
merchantCodeMap6.put("nameChannel",ZfbChannel.YS_CHANNEL.getName());
result.add(merchantCodeMap6);
break;
default:
throw new MsgException("未知通道");
}
}
return ResultGenerator.genSuccessResult(result);
}
}