Merge branch 'develop_device_offline' into develop

# Conflicts:
#	src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java
master
wangning 7 years ago
commit 198b60e0d9

@ -14,5 +14,7 @@ public interface DeviceManager {
void toggleDeviceAvailable(JSONObject manager, String devId, boolean enable);
void deviceOffline(String accountId);
JSONObject listDevOrders(JSONObject manager, String devId, TradeLogQuery query);
}

@ -6,20 +6,23 @@ import au.com.royalpay.payment.manage.device.core.DeviceManager;
import au.com.royalpay.payment.manage.mappers.payment.OrderMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientDeviceMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery;
import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.tools.utils.PageListUtils;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.Order;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import javax.annotation.Resource;
import java.util.Arrays;
import javax.annotation.Resource;
import static au.com.royalpay.payment.manage.permission.utils.OrgCheckUtils.checkOrgPermission;
/**
@ -93,6 +96,11 @@ public class DeviceManagerImp implements DeviceManager {
clientDeviceMapper.update(device);
}
@Override
public void deviceOffline(String accountId) {
clientDeviceMapper.deviceOffline(accountId);
}
@Override
public JSONObject listDevOrders(JSONObject manager, String devId,TradeLogQuery query) {
JSONObject device = clientDeviceMapper.find(devId);

@ -39,4 +39,6 @@ public interface ClientDeviceMapper {
void save(JSONObject devInfo);
PageList<JSONObject> listDevices(JSONObject params, PageBounds pagination);
void deviceOffline(@Param("account_id") String accountId);
}

@ -11,6 +11,7 @@ import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
import au.com.royalpay.payment.core.utils.OrderExpiryRuleResolver;
import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper;
import au.com.royalpay.payment.manage.appclient.beans.AppClientBean;
import au.com.royalpay.payment.manage.device.core.DeviceManager;
import au.com.royalpay.payment.manage.mappers.financial.FinancialBDConfigMapper;
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
import au.com.royalpay.payment.manage.mappers.redpack.ActClientInvitationCodeMapper;
@ -36,6 +37,27 @@ import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo;
import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean;
import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery;
import au.com.royalpay.payment.manage.merchants.beans.SubMerchantIdApply;
import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientApplyMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientAuditProcessMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientBDMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientBankAccountMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientDeviceMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientFilesMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientRateMapper;
import au.com.royalpay.payment.manage.mappers.system.CommoditiesMapper;
import au.com.royalpay.payment.manage.mappers.system.ManagerMapper;
import au.com.royalpay.payment.manage.mappers.system.OrgMapper;
import au.com.royalpay.payment.manage.mappers.system.SysWxMerchantApplyMapper;
import au.com.royalpay.payment.manage.merchants.beans.ActivityPosterBuilder;
import au.com.royalpay.payment.manage.merchants.beans.BankAccountInfo;
import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo;
import au.com.royalpay.payment.manage.merchants.beans.ClientRateConfig;
import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo;
import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean;
import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery;
import au.com.royalpay.payment.manage.merchants.beans.SubMerchantIdApply;
import au.com.royalpay.payment.manage.merchants.core.ClientComplyValidator;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.notice.core.MailService;
@ -206,6 +228,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
private SysWxMerchantApplyMapper sysWxMerchantApplyMapper;
@Resource
private SpringTemplateEngine thymeleaf;
@Resource
private DeviceManager deviceManager;
@Resource
private FinancialBDConfigMapper financialBDConfigMapper;
@ -941,6 +965,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
@Override
@Transactional
public void resetAccountPwd(JSONObject manager, String clientMoniker, String accountId, String pwd) {
JSONObject account = checkAndFindAccount(manager, clientMoniker, accountId);
String salt = PasswordUtils.newSalt();
@ -948,6 +973,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
account.put("salt", salt);
account.put("password_hash", pwdHash);
account.put("password_aes", PasswordUtils.encryptAESPwd(pwd));
deviceManager.deviceOffline(accountId);
clientAccountMapper.update(account);
signInAccountService.clearAccountCache(accountId);
}

@ -1,6 +1,7 @@
package au.com.royalpay.payment.manage.signin.core.impls;
import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
import au.com.royalpay.payment.manage.device.core.DeviceManager;
import au.com.royalpay.payment.manage.management.sysconfig.core.PermissionManager;
import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
@ -20,7 +21,9 @@ import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
import au.com.royalpay.payment.tools.locale.LocaleSupport;
import au.com.royalpay.payment.tools.utils.PasswordUtils;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.cache.annotation.CacheEvict;
@ -28,16 +31,18 @@ import org.springframework.cache.annotation.Cacheable;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import org.thymeleaf.context.Context;
import org.thymeleaf.spring4.SpringTemplateEngine;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
/**
* account service for sign in
* Created by yixian on 2016-06-29.
@ -62,6 +67,8 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati
private SpringTemplateEngine thymeleaf;
@Resource
private SignInStatusManager signInStatusManager;
@Resource
private DeviceManager deviceManager;
private ApplicationEventPublisher publisher;
@Override
@ -181,6 +188,7 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati
}
@Override
@Transactional
public void changeAccountPassword(JSONObject clientStatus, ChangePwdBean change) {
JSONObject account = clientAccountMapper.findDetail(clientStatus.getString("account_id"));
String salt = account.getString("salt");
@ -195,6 +203,7 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati
account.put("password_aes", PasswordUtils.encryptAESPwd(change.getPwd()));
account.put("is_password_expired", 0);
clientAccountMapper.update(account);
deviceManager.deviceOffline(clientStatus.getString("account_id"));
}
@Override

@ -48,4 +48,11 @@
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
</where>
</select>
<update id="deviceOffline">
update sys_clients_devices
set is_offline = 1
where
account_id = #{account_id}
</update>
</mapper>
Loading…
Cancel
Save