master
wangning 7 years ago
parent 7652436c54
commit f730c8fb42

@ -171,7 +171,7 @@ public class CustomersAnalysisServiceImp implements CustomersAnalysisService {
sendLog.put("send_time", new Date()); sendLog.put("send_time", new Date());
sendLog.put("open_id", openId); sendLog.put("open_id", openId);
sendLog.put("client_id", clientId); sendLog.put("client_id", clientId);
sendLog.put("account_id", account.getIntValue("account_id")); sendLog.put("account_id", account.getString("account_id"));
sendLog.put("account_name", account.getString("display_name")); sendLog.put("account_name", account.getString("display_name"));
sendLog.put("msg_type", "daily_notice"); sendLog.put("msg_type", "daily_notice");
sendLog.put("status", 0); sendLog.put("status", 0);

@ -54,7 +54,7 @@ public interface RetailAppService {
JSONObject getNoticeDetailById(JSONObject device, String noticeId); JSONObject getNoticeDetailById(JSONObject device, String noticeId);
void changeAccountPassword(JSONObject device, ChangePwdBean change, int account_id); void changeAccountPassword(JSONObject device, ChangePwdBean change, String account_id);
JSONObject bankAccountInfo(JSONObject device); JSONObject bankAccountInfo(JSONObject device);

@ -752,11 +752,11 @@ public class RetailAppServiceImp implements RetailAppService {
} }
@Override @Override
public void changeAccountPassword(JSONObject device, ChangePwdBean change, int account_id) { public void changeAccountPassword(JSONObject device, ChangePwdBean change, String account_id) {
String clientType = device.getString("client_type"); String clientType = device.getString("client_type");
deviceSupport.findRegister(clientType); deviceSupport.findRegister(clientType);
//JSONObject client = signInAccountService.getClient(account_id); //JSONObject client = signInAccountService.getClient(account_id);
if (device.getIntValue("account_id") != account_id) { if (!account_id.equals(device.getString("account_id"))) {
throw new ForbiddenException("You have no permission"); throw new ForbiddenException("You have no permission");
} }
signInAccountService.changeAccountPassword(device, change); signInAccountService.changeAccountPassword(device, change);
@ -1039,7 +1039,7 @@ public class RetailAppServiceImp implements RetailAppService {
deviceSupport.findRegister(clientType); deviceSupport.findRegister(clientType);
JSONObject account = clientAccountMapper.findById(device.getString("account_id")); JSONObject account = clientAccountMapper.findById(device.getString("account_id"));
JSONObject operator = new JSONObject(); JSONObject operator = new JSONObject();
operator.put("account_id", device.getIntValue("account_id")); operator.put("account_id", device.getString("account_id"));
operator.put("display_name", account.getString("display_name")); operator.put("display_name", account.getString("display_name"));
JSONArray clientIds = clientManager.getAllClientIds(device.getIntValue("client_id")); JSONArray clientIds = clientManager.getAllClientIds(device.getIntValue("client_id"));
if (!clientIds.contains(client_id)) { if (!clientIds.contains(client_id)) {

@ -1,14 +1,19 @@
package au.com.royalpay.payment.manage.appclient.web; package au.com.royalpay.payment.manage.appclient.web;
import java.math.BigDecimal; import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
import java.util.List; import au.com.royalpay.payment.manage.appclient.beans.AppClientBean;
import java.util.Map; import au.com.royalpay.payment.manage.appclient.beans.AppQueryBean;
import au.com.royalpay.payment.manage.appclient.core.RetailAppService;
import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean;
import au.com.royalpay.payment.manage.signin.core.SignInStatusManager;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.device.advise.AppClientController;
import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
import au.com.royalpay.payment.tools.http.HttpUtils;
import javax.annotation.Resource; import com.alibaba.fastjson.JSON;
import javax.validation.Valid; import com.alibaba.fastjson.JSONObject;
import au.com.royalpay.payment.tools.device.advise.AppClientController;
import org.apache.http.Consts;
import org.springframework.validation.Errors; import org.springframework.validation.Errors;
import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
@ -17,18 +22,12 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import com.alibaba.fastjson.JSON; import java.math.BigDecimal;
import com.alibaba.fastjson.JSONObject; import java.util.List;
import java.util.Map;
import au.com.royalpay.payment.core.exceptions.ParamInvalidException; import javax.annotation.Resource;
import au.com.royalpay.payment.manage.appclient.beans.AppClientBean; import javax.validation.Valid;
import au.com.royalpay.payment.manage.appclient.beans.AppQueryBean;
import au.com.royalpay.payment.manage.appclient.core.RetailAppService;
import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean;
import au.com.royalpay.payment.manage.signin.core.SignInStatusManager;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
import au.com.royalpay.payment.tools.http.HttpUtils;
/** /**
* Created by yishuqian on 28/03/2017. * Created by yishuqian on 28/03/2017.
@ -103,7 +102,7 @@ public class RetailAppController {
@RequestMapping(value = "/notice/{noticeId}", method = RequestMethod.PUT) @RequestMapping(value = "/notice/{noticeId}", method = RequestMethod.PUT)
public void updateNoticePartnerHasRead(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @PathVariable String noticeId, @RequestBody JSONObject account_param) { public void updateNoticePartnerHasRead(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @PathVariable String noticeId, @RequestBody JSONObject account_param) {
if (device.getIntValue("account_id") != account_param.getIntValue("account_id")) { if (device.getString("account_id").equals(account_param.getString("account_id")){
throw new ForbiddenException("You have no permission"); throw new ForbiddenException("You have no permission");
} }
retailAppService.updateReadStatus(device, noticeId); retailAppService.updateReadStatus(device, noticeId);
@ -118,7 +117,7 @@ public class RetailAppController {
/*我的页面begin*/ /*我的页面begin*/
@RequestMapping(value = "/partner_password/{account_id}", method = RequestMethod.PUT) @RequestMapping(value = "/partner_password/{account_id}", method = RequestMethod.PUT)
public void changePassword(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @PathVariable int account_id, @RequestBody @Valid ChangePwdBean change, Errors errors) { public void changePassword(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @PathVariable String account_id, @RequestBody @Valid ChangePwdBean change, Errors errors) {
HttpUtils.handleValidErrors(errors); HttpUtils.handleValidErrors(errors);
retailAppService.changeAccountPassword(device, change, account_id); retailAppService.changeAccountPassword(device, change, account_id);
} }

@ -392,7 +392,7 @@ public class PartnerLMServiceImp implements PartnerLMService {
JSONObject updateObj = new JSONObject(); JSONObject updateObj = new JSONObject();
updateObj.put("client_id", partner.getIntValue("client_id")); updateObj.put("client_id", partner.getIntValue("client_id"));
updateObj.put("customer_id", customer_id); updateObj.put("customer_id", customer_id);
updateObj.put("update_id", partner.getIntValue("account_id")); updateObj.put("update_id", partner.getString("account_id"));
updateObj.put("act_id", act_id); updateObj.put("act_id", act_id);
updateObj.put("channel", channel); updateObj.put("channel", channel);
actPartnerWechatRelationMapper.deleteBindWehcat(updateObj); actPartnerWechatRelationMapper.deleteBindWehcat(updateObj);

@ -1,14 +1,16 @@
package au.com.royalpay.payment.manage.signin.core.impls; package au.com.royalpay.payment.manage.signin.core.impls;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.manage.signin.beans.LoginInfo; import au.com.royalpay.payment.manage.signin.beans.LoginInfo;
import au.com.royalpay.payment.manage.signin.core.SignInAccountService; import au.com.royalpay.payment.manage.signin.core.SignInAccountService;
import au.com.royalpay.payment.manage.signin.core.SignInStatusManager; import au.com.royalpay.payment.manage.signin.core.SignInStatusManager;
import au.com.royalpay.payment.tools.connections.mpsupport.WechatAppApi; import au.com.royalpay.payment.tools.connections.mpsupport.WechatAppApi;
import au.com.royalpay.payment.tools.env.PlatformEnvironment; import au.com.royalpay.payment.tools.env.PlatformEnvironment;
import au.com.royalpay.payment.tools.exceptions.ForbiddenException; import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.tools.utils.QRCodeUtils; import au.com.royalpay.payment.tools.utils.QRCodeUtils;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang.RandomStringUtils; import org.apache.commons.lang.RandomStringUtils;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.BoundValueOperations; import org.springframework.data.redis.core.BoundValueOperations;
@ -16,9 +18,10 @@ import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import javax.annotation.Resource;
/** /**
* Created by yixian on 2016-06-29. * Created by yixian on 2016-06-29.
*/ */
@ -67,7 +70,7 @@ public class SignInStatusManagerImpl implements SignInStatusManager {
public String partnerSignIn(LoginInfo loginInfo) { public String partnerSignIn(LoginInfo loginInfo) {
JSONObject account = signInAccountService.clientLoginCheck(loginInfo); JSONObject account = signInAccountService.clientLoginCheck(loginInfo);
String statusKey = newStatusKey(); String statusKey = newStatusKey();
stringRedisTemplate.boundValueOps(partnerLoginRedisKey(statusKey)).set(account.getIntValue("account_id") + "", 30, TimeUnit.MINUTES); stringRedisTemplate.boundValueOps(partnerLoginRedisKey(statusKey)).set(account.getString("account_id") + "", 30, TimeUnit.MINUTES);
return statusKey; return statusKey;
} }
@ -206,7 +209,7 @@ public class SignInStatusManagerImpl implements SignInStatusManager {
public void clientQRCodeSignIn(String codeId, String openid, ModelAndView view) { public void clientQRCodeSignIn(String codeId, String openid, ModelAndView view) {
JSONObject account = signInAccountService.clientWechatSignIn(openid); JSONObject account = signInAccountService.clientWechatSignIn(openid);
String statusKey = newStatusKey(); String statusKey = newStatusKey();
stringRedisTemplate.boundValueOps(partnerLoginRedisKey(statusKey)).set(account.getIntValue("account_id") + "", 30, TimeUnit.MINUTES); stringRedisTemplate.boundValueOps(partnerLoginRedisKey(statusKey)).set(account.getString("account_id") + "", 30, TimeUnit.MINUTES);
stringRedisTemplate.boundValueOps(redisPrefix + ":client_qrcode_signin:code:" + codeId).set(statusKey, 1, TimeUnit.MINUTES); stringRedisTemplate.boundValueOps(redisPrefix + ":client_qrcode_signin:code:" + codeId).set(statusKey, 1, TimeUnit.MINUTES);
JSONObject res = new JSONObject(); JSONObject res = new JSONObject();
res.put("notitle", true); res.put("notitle", true);
@ -240,7 +243,7 @@ public class SignInStatusManagerImpl implements SignInStatusManager {
} }
} }
String statusKey = newStatusKey(); String statusKey = newStatusKey();
stringRedisTemplate.boundValueOps(partnerLoginRedisKey(statusKey)).set(account.getIntValue("account_id") + "", 30, TimeUnit.MINUTES); stringRedisTemplate.boundValueOps(partnerLoginRedisKey(statusKey)).set(account.getString("account_id") + "", 30, TimeUnit.MINUTES);
account = getCurrentClient(statusKey); account = getCurrentClient(statusKey);
account.put("sign_key", statusKey); account.put("sign_key", statusKey);
account.put("app_openid", openId); account.put("app_openid", openId);
@ -251,7 +254,7 @@ public class SignInStatusManagerImpl implements SignInStatusManager {
public String clientWechatSignIn(String openid) { public String clientWechatSignIn(String openid) {
JSONObject account = signInAccountService.clientWechatSignIn(openid); JSONObject account = signInAccountService.clientWechatSignIn(openid);
String statusKey = newStatusKey(); String statusKey = newStatusKey();
stringRedisTemplate.boundValueOps(partnerLoginRedisKey(statusKey)).set(account.getIntValue("account_id") + "", 30, TimeUnit.MINUTES); stringRedisTemplate.boundValueOps(partnerLoginRedisKey(statusKey)).set(account.getString("account_id") + "", 30, TimeUnit.MINUTES);
return statusKey; return statusKey;
} }
@ -283,7 +286,7 @@ public class SignInStatusManagerImpl implements SignInStatusManager {
if (account == null || account.size() <= 0) { if (account == null || account.size() <= 0) {
throw new ForbiddenException("用户不存在或已禁用"); throw new ForbiddenException("用户不存在或已禁用");
} }
stringRedisTemplate.boundValueOps(partnerLoginRedisKey(statusKey)).set("" + account.getIntValue("account_id"), 30, TimeUnit.MINUTES); stringRedisTemplate.boundValueOps(partnerLoginRedisKey(statusKey)).set("" + account.getString("account_id"), 30, TimeUnit.MINUTES);
stringRedisTemplate.boundValueOps(redisPrefix + ":app_qrcode_signin:code:" + codeId).set(statusKey, 1, TimeUnit.MINUTES); stringRedisTemplate.boundValueOps(redisPrefix + ":app_qrcode_signin:code:" + codeId).set(statusKey, 1, TimeUnit.MINUTES);
} }
@ -297,7 +300,7 @@ public class SignInStatusManagerImpl implements SignInStatusManager {
if (account == null || account.size() <= 0) { if (account == null || account.size() <= 0) {
throw new ForbiddenException("用户不存在或已禁用"); throw new ForbiddenException("用户不存在或已禁用");
} }
stringRedisTemplate.boundValueOps(partnerLoginRedisKey(statusKey)).set("" + account.getIntValue("account_id"), 30, TimeUnit.MINUTES); stringRedisTemplate.boundValueOps(partnerLoginRedisKey(statusKey)).set("" + account.getString("account_id"), 30, TimeUnit.MINUTES);
stringRedisTemplate.boundValueOps(redisPrefix + ":app_qrcode_signin:code:" + codeId).set(statusKey, 1, TimeUnit.MINUTES); stringRedisTemplate.boundValueOps(redisPrefix + ":app_qrcode_signin:code:" + codeId).set(statusKey, 1, TimeUnit.MINUTES);
} }

Loading…
Cancel
Save