wangning 7 years ago
parent caa60f6287
commit 2be8962d73

@ -0,0 +1,20 @@
package au.com.royalpay.payment.manage.mappers.log;
import org.apache.ibatis.annotations.Param;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
/**
* Created by yixian on 2016-10-14.
*/
@AutoMapper(tablename = "log_client_config", pkName = "id")
public interface ClientConfigLogMapper {
@AutoSql(type = SqlType.INSERT)
void saveLog(JSONObject log);
}

@ -0,0 +1,12 @@
package au.com.royalpay.payment.manage.merchants.core;
import com.alibaba.fastjson.JSONObject;
/**
* Created by yixian on 2016-06-25.
*/
public interface ClientConfigService {
void update(JSONObject record,JSONObject account);
}

@ -0,0 +1,17 @@
package au.com.royalpay.payment.manage.merchants.core.impls;
import au.com.royalpay.payment.manage.mappers.system.ClientConfigMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientConfigService;
import com.alibaba.fastjson.JSONObject;
import javax.annotation.Resource;
public class ClientConfigServiceImpl implements ClientConfigService {
@Resource
private ClientConfigMapper clientConfigMapper;
@Override
public void update(JSONObject record, JSONObject account) {
}
}

@ -21,6 +21,7 @@ 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.ClientConfigMapper;
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;
@ -147,6 +148,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Resource
private ClientMapper clientMapper;
@Resource
private ClientConfigMapper clientConfigMapper;
@Resource
private ClientDeviceMapper clientDeviceMapper;
@Resource
private ClientAccountMapper clientAccountMapper;
@ -2246,26 +2249,29 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
String pwdHash = PasswordUtils.hashPwd(pwd, salt);
client.put("refund_pwd", pwdHash);
client.put("refund_pwd_salt", salt);
clientMapper.update(client);
clientInfoCacheSupport.clearClientCache(client.getIntValue("client_id"));
JSONObject record = new JSONObject();
record.put("client_id",client.getIntValue("client_id"));
record.put("refund_pwd", pwdHash);
record.put("refund_pwd_salt", salt);
clientConfigMapper.update(record);
}
@Override
public void validRefundPwd(JSONObject account, String pwd) {
JSONObject client = getClientInfo(account.getIntValue("client_id"));
String salt = client.getString("refund_pwd_salt");
JSONObject clientConfig = clientConfigMapper.find(account.getIntValue("client_id"));
String salt = clientConfig.getString("refund_pwd_salt");
String pwdHash = PasswordUtils.hashPwd(pwd, salt);
if (!client.getString("refund_pwd").equals(pwdHash)) {
if (!clientConfig.getString("refund_pwd").equals(pwdHash)) {
throw new ForbiddenException("Invalid Pwd");
}
}
@Override
public void setWeekendDelay(int clientId, boolean delay) {
JSONObject clientUpdate = new JSONObject();
clientUpdate.put("client_id", clientId);
clientUpdate.put("weekend_delay", delay);
clientMapper.update(clientUpdate);
JSONObject record = new JSONObject();
record.put("client_id", clientId);
record.put("weekend_delay", delay);
clientConfigMapper.update(record);
}
@Override
@ -2658,8 +2664,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
JSONObject updateObj = new JSONObject();
updateObj.put("client_id", client.getIntValue("client_id"));
updateObj.put("paypad_version", paypad_version);
clientMapper.update(updateObj);
clientInfoCacheSupport.clearClientCache(clientId);
clientConfigMapper.update(updateObj);
}
@Override
@ -2672,7 +2677,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
JSONObject record = new JSONObject();
record.put("client_id", client_id);
record.put("manual_settle", manual_settle);
clientMapper.update(record);
clientConfigMapper.update(record);
JSONObject actClientLog = new JSONObject();
actClientLog.put("client_id", client_id);
@ -2682,8 +2687,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
actClientLog.put("operator_type", type);
clientsOperationLogMapper.save(actClientLog);
clientInfoCacheSupport.clearClientCache(client_id);
}
@Override
@ -2696,8 +2699,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
JSONObject updateObj = new JSONObject();
updateObj.put("client_id", client.getIntValue("client_id"));
updateObj.put("qrcode_surcharge", paySurcharge);
clientMapper.update(updateObj);
clientInfoCacheSupport.clearClientCache(clientId);
clientConfigMapper.update(updateObj);
}
@Override
@ -2710,8 +2712,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
JSONObject updateObj = new JSONObject();
updateObj.put("client_id", client.getIntValue("client_id"));
updateObj.put("api_surcharge", enableApiSurcharge);
clientMapper.update(updateObj);
clientInfoCacheSupport.clearClientCache(clientId);
clientConfigMapper.update(updateObj);
}
@Override
@ -2728,8 +2729,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
JSONObject updateObj = new JSONObject();
updateObj.put("client_id", client.getIntValue("client_id"));
updateObj.put("retail_surcharge", paySurcharge);
clientMapper.update(updateObj);
clientInfoCacheSupport.clearClientCache(clientId);
clientConfigMapper.update(updateObj);
}
@Override

Loading…
Cancel
Save