|
|
|
@ -1,14 +1,17 @@
|
|
|
|
|
package au.com.royalpay.payment.manage.dev.web;
|
|
|
|
|
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ManagerMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.support.wechatclients.RedpackWechatApiImpl;
|
|
|
|
|
import au.com.royalpay.payment.tools.connections.mpsupport.beans.WxOauthType;
|
|
|
|
|
import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
|
|
|
|
|
import au.com.royalpay.payment.tools.permission.wechat.WechatMapping;
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.globalfreepay.payment.tools.CommonConsts;
|
|
|
|
|
import com.globalfreepay.payment.tools.permission.wechat.WechatMapping;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
|
import org.springframework.ui.Model;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
@ -18,25 +21,19 @@ import java.net.URLDecoder;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping("/testMerchantPassword")
|
|
|
|
|
@Controller
|
|
|
|
|
@WechatMapping(value = "/testMerchantPassword", addonMp = {RedpackWechatApiImpl.class}, oauthType = WxOauthType.USERINFO)
|
|
|
|
|
public class TestMerchantPassword {
|
|
|
|
|
private Logger logger = LoggerFactory.getLogger(getClass());
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private ManagerMapper managerMapper;
|
|
|
|
|
|
|
|
|
|
@WechatMapping
|
|
|
|
|
public String testMerchantPassword(@PathVariable String accounts, @ModelAttribute(CommonConsts.WECHATINFO) JSONObject wxUser, Model modelMap) {
|
|
|
|
|
if (StringUtils.isBlank(accounts)) {
|
|
|
|
|
@WechatMapping(method = RequestMethod.GET)
|
|
|
|
|
public String testMerchantPassword(@RequestParam String[] accounts, @ModelAttribute(CommonConsts.WECHATINFO) JSONObject wxUser, Model modelMap) {
|
|
|
|
|
if (accounts == null) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
accounts = URLDecoder.decode(accounts, "UTF-8");
|
|
|
|
|
|
|
|
|
|
} catch (UnsupportedEncodingException e) {
|
|
|
|
|
logger.error("获取临时密码失败,转换url错误 : " + e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<String> openIds = managerMapper.listDevAndBdOpenId();
|
|
|
|
|
|
|
|
|
@ -44,9 +41,26 @@ public class TestMerchantPassword {
|
|
|
|
|
throw new ForbiddenException("无权限查看此页面");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
JSONArray array = JSONArray.parseArray(accounts);
|
|
|
|
|
JSONArray array = new JSONArray();
|
|
|
|
|
for (String account : accounts) {
|
|
|
|
|
try {
|
|
|
|
|
String accountDe = URLDecoder.decode(account, "UTF-8");
|
|
|
|
|
JSONObject accountJson = new JSONObject();
|
|
|
|
|
String temp[] = accountDe.split(",");
|
|
|
|
|
accountJson.put("username", temp[0]);
|
|
|
|
|
accountJson.put("password", temp[1]);
|
|
|
|
|
accountJson.put("role", temp[2]);
|
|
|
|
|
accountJson.put("client_moniker", temp[3]);
|
|
|
|
|
|
|
|
|
|
array.add(accountJson);
|
|
|
|
|
|
|
|
|
|
} catch (UnsupportedEncodingException e) {
|
|
|
|
|
logger.error("获取临时密码失败,转换url错误 : " + e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
modelMap.addAttribute("accounts", array);
|
|
|
|
|
|
|
|
|
|
return "templates/testMerchantPassword";
|
|
|
|
|
return "testMerchantPassword";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|