|
@@ -3,6 +3,7 @@ package com.minpay.shouhuo;
|
|
import com.google.zxing.WriterException;
|
|
import com.google.zxing.WriterException;
|
|
import com.min.util.OffSetUtil;
|
|
import com.min.util.OffSetUtil;
|
|
import com.minpay.common.bean.User;
|
|
import com.minpay.common.bean.User;
|
|
|
|
+import com.minpay.common.constant.Constant;
|
|
import com.minpay.common.constant.ServConstant;
|
|
import com.minpay.common.constant.ServConstant;
|
|
import com.minpay.common.format.IFormatService;
|
|
import com.minpay.common.format.IFormatService;
|
|
import com.minpay.common.service.ILogService;
|
|
import com.minpay.common.service.ILogService;
|
|
@@ -33,6 +34,7 @@ import net.sf.json.JSONObject;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import java.io.*;
|
|
import java.io.*;
|
|
|
|
+import java.net.URLEncoder;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
@@ -86,9 +88,13 @@ public class PersManageAction implements IMINAction {
|
|
// 创建查询条件
|
|
// 创建查询条件
|
|
Map<String, String> p = new HashMap<String, String>();
|
|
Map<String, String> p = new HashMap<String, String>();
|
|
User u = session.getUser();
|
|
User u = session.getUser();
|
|
|
|
+
|
|
p.put("dates", dates); // 创建日期
|
|
p.put("dates", dates); // 创建日期
|
|
p.put("perName", perName); //用户名称
|
|
p.put("perName", perName); //用户名称
|
|
p.put("state", state); //状态
|
|
p.put("state", state); //状态
|
|
|
|
+ if(!u.getBranchId().equals(Constant.ADMINISTRATION_SYSTEM_NUMBER)){
|
|
|
|
+ p.put("branchId", u.getBranchId());
|
|
|
|
+ }
|
|
p.put("channel", u.getChannel());//渠道
|
|
p.put("channel", u.getChannel());//渠道
|
|
p.put("roleid", roleid);
|
|
p.put("roleid", roleid);
|
|
MINRowBounds rows = new MINRowBounds(page, limit);
|
|
MINRowBounds rows = new MINRowBounds(page, limit);
|
|
@@ -162,13 +168,13 @@ public class PersManageAction implements IMINAction {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- @MINAction(value = PERSON_ADD)
|
|
|
|
|
|
+ @MINAction(value = PERSON_ADD,session = false)
|
|
public MINActionResult personAdd(
|
|
public MINActionResult personAdd(
|
|
@MINParam(key = "code") String code,
|
|
@MINParam(key = "code") String code,
|
|
@MINParam(key = "type") String type,
|
|
@MINParam(key = "type") String type,
|
|
@MINParam(key = "channel") String channel,
|
|
@MINParam(key = "channel") String channel,
|
|
- @MINParam(key = "equNo") String equNo,
|
|
|
|
- @MINParam(key = "version") String version,
|
|
|
|
|
|
+ @MINParam(key = "role") String role,
|
|
|
|
+ @MINParam(key = "branchId") String branchId,
|
|
HttpServletResponse response,
|
|
HttpServletResponse response,
|
|
MINHttpServletRequestContext request
|
|
MINHttpServletRequestContext request
|
|
) throws MINBusinessException {
|
|
) throws MINBusinessException {
|
|
@@ -187,7 +193,7 @@ public class PersManageAction implements IMINAction {
|
|
VmPersonInfExample personex = new VmPersonInfExample();
|
|
VmPersonInfExample personex = new VmPersonInfExample();
|
|
personex.createCriteria().andChannelEqualTo(channel).andTypeEqualTo(type).andOpenidEqualTo((String) result.get("openId"));
|
|
personex.createCriteria().andChannelEqualTo(channel).andTypeEqualTo(type).andOpenidEqualTo((String) result.get("openId"));
|
|
List<VmPersonInf> perLst = Service.lookup(IMINDataBaseService.class).getMybatisMapper(VmPersonInfMapper.class).selectByExample(personex);
|
|
List<VmPersonInf> perLst = Service.lookup(IMINDataBaseService.class).getMybatisMapper(VmPersonInfMapper.class).selectByExample(personex);
|
|
- if(perLst.size() > 1 ){
|
|
|
|
|
|
+ if(perLst.size() > 0 ){
|
|
throw new MINBusinessException("用户已存在!");
|
|
throw new MINBusinessException("用户已存在!");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -207,6 +213,8 @@ public class PersManageAction implements IMINAction {
|
|
person.setCreateTime(nowTime);
|
|
person.setCreateTime(nowTime);
|
|
person.setModifyUser(perId);
|
|
person.setModifyUser(perId);
|
|
person.setModifyTime(nowTime);
|
|
person.setModifyTime(nowTime);
|
|
|
|
+ person.setRole(role);
|
|
|
|
+ person.setUserId(branchId);
|
|
Service.lookup(IMINDataBaseService.class).getMybatisMapper(VmPersonInfMapper.class).insertSelective(person);
|
|
Service.lookup(IMINDataBaseService.class).getMybatisMapper(VmPersonInfMapper.class).insertSelective(person);
|
|
}else{
|
|
}else{
|
|
VmPersonInf vmPersonInf = perLst.get(0);
|
|
VmPersonInf vmPersonInf = perLst.get(0);
|
|
@@ -310,9 +318,27 @@ public class PersManageAction implements IMINAction {
|
|
.getSystemProperties().get(channel+"_TO_MACHINE_ERWERMA").getKey();// 为nginx根路径
|
|
.getSystemProperties().get(channel+"_TO_MACHINE_ERWERMA").getKey();// 为nginx根路径
|
|
// 加密客户号
|
|
// 加密客户号
|
|
OutputStream outputStream = new FileOutputStream(file);
|
|
OutputStream outputStream = new FileOutputStream(file);
|
|
|
|
+ String openUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?";
|
|
|
|
+ String redirect_uri = "http://xubing2.minpay.cc/adm/admin/wxuserManage/addUserTransfer.html?role=".concat(role).concat("&branchId=").concat(userId);
|
|
|
|
+ //在微信的appId
|
|
|
|
+ String appId = Service.lookup(IPublicService.class).getSysParValue(channel + "_APP_ID");
|
|
|
|
+ //配置参数
|
|
|
|
+ StringBuffer paramStr = new StringBuffer();
|
|
|
|
+ paramStr.append(openUrl);
|
|
|
|
+ paramStr.append("appid=");
|
|
|
|
+ paramStr.append(appId);
|
|
|
|
+ paramStr.append("&redirect_uri=");
|
|
|
|
+ paramStr.append(redirect_uri);
|
|
|
|
+ paramStr.append("&response_type=code&scope=snsapi_userinfo&state=STATE");
|
|
|
|
+ //String urlString = URLEncoder.encode(paramStr.toString(), "GBK");
|
|
|
|
+ String admUrl = Service.lookup(IPropertiesService.class)
|
|
|
|
+ .getSystemProperties().get(channel+"_ADM_URl").getKey();
|
|
|
|
+ admUrl = admUrl.concat("/admin/h5AddUser.html?role=").concat(role).concat("&branchId=").concat(userId);;
|
|
|
|
+ //String urlString = URLEncoder.encode(, "GBK");
|
|
|
|
+
|
|
// 生成二维码图片到本地
|
|
// 生成二维码图片到本地
|
|
try {
|
|
try {
|
|
- EquCodeCreateUtil.createQrCode(outputStream,address+"/"+userId+"/"+role,900,"JPEG");
|
|
|
|
|
|
+ EquCodeCreateUtil.createQrCode(outputStream,admUrl,900,"JPEG");
|
|
} catch (com.google.zxing.WriterException e) {
|
|
} catch (com.google.zxing.WriterException e) {
|
|
// TODO Auto-generated catch block
|
|
// TODO Auto-generated catch block
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|