Merge branch 'develop'

master
wangning 7 years ago
commit e88681bbca

@ -315,3 +315,25 @@ ADD COLUMN `globalpay_openid` varchar(100) NULL AFTER `kanga_openid`;
ALTER TABLE act_app_list ADD banner_img VARCHAR(200) NULL COMMENT 'App首页banner图片'; ALTER TABLE act_app_list ADD banner_img VARCHAR(200) NULL COMMENT 'App首页banner图片';
alter table act_app_list add column `msg_start_date` date DEFAULT NULL;
alter table act_app_list add column `msg_end_date` date DEFAULT NULL;
alter table act_app_list add column `msg_interval` smallint(3) DEFAULT NULL;
alter table sys_clients add column `manual_settle` tinyint(1) DEFAULT 0;
create table log_clients_operation(
id varchar(50) not null,
client_id int(11) not null,
operator_id varchar(50) not null comment '操作人者 账户ID',
operator_type SMALLINT (2) not null comment '操作人者类型',
create_time datetime not null,
operation varchar(50) DEFAULT NULL,
PRIMARY key(`id`)
);
alter table act_app_list MODIFY column is_show_window tinyint(1) DEFAULT 0 COMMENT 'app是否弹框'
alter table sys_clients_contract add column confirm_time datetime DEFAULT null comment '合同确认时间';

@ -1,12 +1,11 @@
package au.com.royalpay.payment.manage.activities.app_index.beans; package au.com.royalpay.payment.manage.activities.app_index.beans;
import au.com.royalpay.payment.core.exceptions.ParamInvalidException; import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.lang3.time.DateUtils;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
import javax.xml.crypto.Data;
import java.text.ParseException; import java.text.ParseException;
import java.util.Date; import java.util.Date;
@ -18,47 +17,37 @@ public class AppActBean {
private String act_name; private String act_name;
private String act_url; private String act_url;
private String params_json; private String params_json;
private Boolean is_valid = true; private boolean is_valid = true;
private String desc; private String desc;
private String act_content; private String act_content;
private String show_type; private String show_type;
private Boolean is_show_window; private boolean is_show_window;
private String act_img; private String act_img;
private String window_img; private String window_img;
private String active_date; private String active_date;
private String expire_date; private String expire_date;
private String banner_img; private String banner_img;
private String msg_start_date;
private String msg_end_date;
private String msg_interval;
public JSONObject toJsonParam(){ public JSONObject toJsonParam(){
JSONObject params = new JSONObject(); JSONObject params = new JSONObject();
if(StringUtils.isNotEmpty(act_name)){ params.put("act_name",act_name);
params.put("act_name",act_name); params.put("act_url",act_url);
} params.put("params_json",params_json);
if(StringUtils.isNotEmpty(act_url)){ params.put("desc",desc);
params.put("act_url",act_url); params.put("act_content",act_content);
} params.put("show_type",show_type);
if(StringUtils.isNotEmpty(params_json)){ params.put("act_img",act_img);
params.put("params_json",params_json); params.put("window_img",window_img);
} params.put("banner_img",banner_img);
if(StringUtils.isNotEmpty(desc)){ params.put("msg_interval",msg_interval);
params.put("desc",desc); params.put("is_show_window",is_show_window);
} params.put("is_valid",is_valid);
if(StringUtils.isNotEmpty(act_content)){ params.put("msg_start_date", msg_start_date);
params.put("act_content",act_content); params.put("msg_end_date", msg_end_date);
}
if(StringUtils.isNotEmpty(show_type)){
params.put("show_type",show_type);
}
if(StringUtils.isNotEmpty(act_img)){
params.put("act_img",act_img);
}
if(StringUtils.isNotEmpty(window_img)){
params.put("window_img",window_img);
}
if(StringUtils.isNotEmpty(banner_img)){
params.put("banner_img",banner_img);
}
if (active_date != null) { if (active_date != null) {
try { try {
Date fromDate = DateUtils.parseDate(active_date, DATE_PATTERNS); Date fromDate = DateUtils.parseDate(active_date, DATE_PATTERNS);
@ -75,8 +64,22 @@ public class AppActBean {
throw new ParamInvalidException("expire_date", "error.payment.valid.invalid_date_format"); throw new ParamInvalidException("expire_date", "error.payment.valid.invalid_date_format");
} }
} }
params.put("is_show_window",is_show_window); if (msg_start_date != null) {
params.put("is_valid",is_valid); try {
Date fromDate = DateUtils.parseDate(msg_start_date, DATE_PATTERNS);
params.put("msg_start_date", fromDate);
} catch (ParseException e) {
throw new ParamInvalidException("msg_start_date", "error.payment.valid.invalid_date_format");
}
}
if (msg_end_date != null) {
try {
Date fromDate = DateUtils.parseDate(msg_end_date, DATE_PATTERNS);
params.put("msg_end_date", fromDate);
} catch (ParseException e) {
throw new ParamInvalidException("msg_end_date", "error.payment.valid.invalid_date_format");
}
}
return params; return params;
} }
@ -183,4 +186,28 @@ public class AppActBean {
public void setBanner_img(String banner_img) { public void setBanner_img(String banner_img) {
this.banner_img = banner_img; this.banner_img = banner_img;
} }
public String getMsg_start_date() {
return msg_start_date;
}
public void setMsg_start_date(String msg_start_date) {
this.msg_start_date = msg_start_date;
}
public String getMsg_end_date() {
return msg_end_date;
}
public void setMsg_end_date(String msg_end_date) {
this.msg_end_date = msg_end_date;
}
public String getMsg_interval() {
return msg_interval;
}
public void setMsg_interval(String msg_interval) {
this.msg_interval = msg_interval;
}
} }

@ -20,4 +20,6 @@ public interface AppActService {
void updateAct(JSONObject manager,String act_id,AppActBean appActBean); void updateAct(JSONObject manager,String act_id,AppActBean appActBean);
JSONObject getLatestWindowNotice(); JSONObject getLatestWindowNotice();
void published(JSONObject manager,String act_id,boolean is_valid);
} }

@ -67,4 +67,13 @@ public class AppActServiceImp implements AppActService {
actAppMapper.newAppAct(params); actAppMapper.newAppAct(params);
return params; return params;
} }
@Override
public void published(JSONObject manager, String act_id, boolean is_valid) {
JSONObject params = new JSONObject();
params.put("act_id",act_id);
params.put("is_valid",is_valid);
params.put("update_time",new Date());
actAppMapper.updateAct(params);
}
} }

@ -3,15 +3,21 @@ package au.com.royalpay.payment.manage.activities.app_index.web;
import au.com.royalpay.payment.manage.activities.app_index.beans.AppActBean; import au.com.royalpay.payment.manage.activities.app_index.beans.AppActBean;
import au.com.royalpay.payment.manage.activities.app_index.beans.AppActQueryBean; import au.com.royalpay.payment.manage.activities.app_index.beans.AppActQueryBean;
import au.com.royalpay.payment.manage.activities.app_index.core.AppActService; import au.com.royalpay.payment.manage.activities.app_index.core.AppActService;
import au.com.royalpay.payment.manage.activities.monsettledelay.beans.MonDelayBean;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.tools.CommonConsts; import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole; import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.tools.utils.PageListUtils; import au.com.royalpay.payment.tools.utils.PageListUtils;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageList; import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@RestController @RestController
@RequestMapping("/manager/app/act") @RequestMapping("/manager/app/act")
@ -31,7 +37,7 @@ public class AppActController {
return appActService.getActDetail(manager,act_id); return appActService.getActDetail(manager,act_id);
} }
@ManagerMapping(value = "/new",method = RequestMethod.PUT,role = ManagerRole.SITE_MANAGER) @ManagerMapping(method = RequestMethod.PUT,role = ManagerRole.SITE_MANAGER)
public JSONObject newAppAct(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody AppActBean appActBean){ public JSONObject newAppAct(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody AppActBean appActBean){
return appActService.newAppAct(manager,appActBean); return appActService.newAppAct(manager,appActBean);
} }
@ -39,4 +45,9 @@ public class AppActController {
public void updateAppAct(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String act_id,@RequestBody AppActBean appActBean){ public void updateAppAct(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String act_id,@RequestBody AppActBean appActBean){
appActService.updateAct(manager,act_id,appActBean); appActService.updateAct(manager,act_id,appActBean);
} }
@ManagerMapping(value = "/published/{act_id}",method = RequestMethod.PUT,role = ManagerRole.SITE_MANAGER)
public void publishedAppAct(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String act_id,@RequestBody boolean is_valid){
appActService.published(manager,act_id,is_valid);
}
} }

@ -4,9 +4,12 @@ import au.com.royalpay.payment.manage.activities.monsettledelay.core.ActMonDelay
import au.com.royalpay.payment.manage.mappers.act.ActAppMapper; import au.com.royalpay.payment.manage.mappers.act.ActAppMapper;
import au.com.royalpay.payment.manage.mappers.act.ActMonDelaySettleMapper; import au.com.royalpay.payment.manage.mappers.act.ActMonDelaySettleMapper;
import au.com.royalpay.payment.manage.mappers.act.ActMonDelaySettleRedPackMapper; import au.com.royalpay.payment.manage.mappers.act.ActMonDelaySettleRedPackMapper;
import au.com.royalpay.payment.manage.mappers.log.ClientsOperationLogMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper; import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.tools.device.DeviceSupport; import au.com.royalpay.payment.tools.device.DeviceSupport;
import au.com.royalpay.payment.tools.env.PlatformEnvironment; import au.com.royalpay.payment.tools.env.PlatformEnvironment;
import au.com.royalpay.payment.tools.env.RequestEnvironment;
import au.com.royalpay.payment.tools.exceptions.BadRequestException; import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.exceptions.ForbiddenException; import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
import au.com.royalpay.payment.tools.permission.enums.PartnerRole; import au.com.royalpay.payment.tools.permission.enums.PartnerRole;
@ -17,7 +20,9 @@ import com.github.miemiedev.mybatis.paginator.domain.Order;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList; import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.springframework.context.MessageSource;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -40,12 +45,15 @@ public class ActMonDelaySettleServiceImp implements ActMonDelaySettleService {
private ClientAccountMapper clientAccountMapper; private ClientAccountMapper clientAccountMapper;
@Resource @Resource
private ActAppMapper actAppMapper; private ActAppMapper actAppMapper;
@Resource
private ClientsOperationLogMapper clientsOperationLogMapper;
@Resource
private ClientManager clientManager;
@Resource
private MessageSource messageSource;
@Override @Override
public JSONObject getActNotice(JSONObject device) { public JSONObject getActNotice(JSONObject device) {
String clientType = device.getString("client_type");
deviceSupport.findRegister(clientType);
int client_id = device.getIntValue("client_id"); int client_id = device.getIntValue("client_id");
BigDecimal total_redpack = actMonDelaySettleRedPackMapper.getTotalRedPack(client_id); BigDecimal total_redpack = actMonDelaySettleRedPackMapper.getTotalRedPack(client_id);
JSONObject res = new JSONObject(); JSONObject res = new JSONObject();
@ -62,15 +70,14 @@ public class ActMonDelaySettleServiceImp implements ActMonDelaySettleService {
if (!act.getBoolean("is_valid")) { if (!act.getBoolean("is_valid")) {
throw new BadRequestException("Activity is not valid"); throw new BadRequestException("Activity is not valid");
} }
String clientType = device.getString("client_type");
deviceSupport.findRegister(clientType);
int client_id = device.getIntValue("client_id"); int client_id = device.getIntValue("client_id");
List<JSONObject> clientLogs = actMonDelaySettleMapper.clientLog(client_id); List<JSONObject> clientLogs = actMonDelaySettleMapper.clientLog(client_id);
JSONObject res = new JSONObject(); JSONObject res = new JSONObject();
res.put("operation_pause",false); res.put("operation_pause",false);
Boolean apply = false; Boolean apply = true;
if (!clientLogs.isEmpty()) { if (clientLogs.isEmpty()) {
apply = true; apply = false;
res.put("cancel_waring",messageSource.getMessage("sys.mondelay.cancel.waring", null, RequestEnvironment.getLocale()));
} }
if (new Date().compareTo(act.getDate("active_date")) < 0) { if (new Date().compareTo(act.getDate("active_date")) < 0) {
res.put("active", false); res.put("active", false);
@ -92,10 +99,12 @@ public class ActMonDelaySettleServiceImp implements ActMonDelaySettleService {
res.put("apply", apply); res.put("apply", apply);
res.put("total_redpack", total_redpack); res.put("total_redpack", total_redpack);
res.put("list", list); res.put("list", list);
return res; return res;
} }
@Override @Override
@Transactional
public void actApply(JSONObject device) { public void actApply(JSONObject device) {
LocalDateTime dt = LocalDateTime.now(); LocalDateTime dt = LocalDateTime.now();
if(dt.getDayOfWeek()== DayOfWeek.MONDAY && dt.getHour()<18){ if(dt.getDayOfWeek()== DayOfWeek.MONDAY && dt.getHour()<18){
@ -112,8 +121,6 @@ public class ActMonDelaySettleServiceImp implements ActMonDelaySettleService {
if (new Date().compareTo(act.getDate("expire_date")) > 0) { if (new Date().compareTo(act.getDate("expire_date")) > 0) {
throw new BadRequestException("The activity has expired"); throw new BadRequestException("The activity has expired");
} }
String clientType = device.getString("client_type");
deviceSupport.findRegister(clientType);
int client_id = device.getIntValue("client_id"); int client_id = device.getIntValue("client_id");
List<JSONObject> clientLogs = actMonDelaySettleMapper.clientLog(client_id); List<JSONObject> clientLogs = actMonDelaySettleMapper.clientLog(client_id);
if (!clientLogs.isEmpty()) { if (!clientLogs.isEmpty()) {
@ -129,16 +136,19 @@ public class ActMonDelaySettleServiceImp implements ActMonDelaySettleService {
device.put("rate", params.getBigDecimal("rate") == null ? new BigDecimal(0.15) : params.getBigDecimal("rate")); device.put("rate", params.getBigDecimal("rate") == null ? new BigDecimal(0.15) : params.getBigDecimal("rate"));
device.put("expire_time", act.getDate("expire_date")); device.put("expire_time", act.getDate("expire_date"));
actMonDelaySettleMapper.save(device); actMonDelaySettleMapper.save(device);
clientManager.changeManualSettle(client_id,true,device.getString("account_id"),1,"参加活动打开手动清算");
} }
@Override @Override
@Transactional
public void cancelAct(JSONObject device) { public void cancelAct(JSONObject device) {
LocalDateTime dt = LocalDateTime.now(); LocalDateTime dt = LocalDateTime.now();
if(dt.getDayOfWeek()== DayOfWeek.MONDAY && dt.getHour()<18){ if(dt.getDayOfWeek()== DayOfWeek.MONDAY && dt.getHour()<18){
throw new BadRequestException("每周一0点至18点为收益计算时间,暂停退出活动操作"); throw new BadRequestException("每周一0点至18点为收益计算时间,暂停退出活动操作");
} }
String clientType = device.getString("client_type");
deviceSupport.findRegister(clientType);
int client_id = device.getIntValue("client_id"); int client_id = device.getIntValue("client_id");
List<JSONObject> clientLogs = actMonDelaySettleMapper.clientLog(client_id); List<JSONObject> clientLogs = actMonDelaySettleMapper.clientLog(client_id);
if (clientLogs.isEmpty()) { if (clientLogs.isEmpty()) {
@ -148,6 +158,8 @@ public class ActMonDelaySettleServiceImp implements ActMonDelaySettleService {
clientLog.put("is_valid", 0); clientLog.put("is_valid", 0);
clientLog.put("expire_time", new Date()); clientLog.put("expire_time", new Date());
actMonDelaySettleMapper.update(clientLog); actMonDelaySettleMapper.update(clientLog);
clientManager.changeManualSettle(client_id,false,device.getString("account_id"),1,"退出活动关闭手动清算");
} }
} }

@ -1,5 +1,28 @@
package au.com.royalpay.payment.manage.analysis.core.impls; package au.com.royalpay.payment.manage.analysis.core.impls;
import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
import au.com.royalpay.payment.manage.analysis.beans.AnalysisBean;
import au.com.royalpay.payment.manage.analysis.core.DashboardAnalysisTask;
import au.com.royalpay.payment.manage.analysis.core.DashboardService;
import au.com.royalpay.payment.manage.analysis.mappers.ClientAnalysisMapper;
import au.com.royalpay.payment.manage.analysis.mappers.CustomerAndOrdersStatisticsMapper;
import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.mappers.system.ExchangeRateMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.tools.defines.TradeType;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.Order;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import org.apache.commons.lang3.time.DateUtils;
import org.apache.commons.lang3.time.DurationFormatUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
@ -12,28 +35,6 @@ import java.util.TreeMap;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.apache.commons.lang3.time.DateUtils;
import org.apache.commons.lang3.time.DurationFormatUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.Order;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
import au.com.royalpay.payment.manage.analysis.beans.AnalysisBean;
import au.com.royalpay.payment.manage.analysis.core.DashboardAnalysisTask;
import au.com.royalpay.payment.manage.analysis.core.DashboardService;
import au.com.royalpay.payment.manage.analysis.mappers.ClientAnalysisMapper;
import au.com.royalpay.payment.manage.analysis.mappers.CustomerAndOrdersStatisticsMapper;
import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.tools.defines.TradeType;
/** /**
* Created by davep on 2016-07-28. * Created by davep on 2016-07-28.
*/ */
@ -50,6 +51,8 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
private ClientMapper clientMapper; private ClientMapper clientMapper;
@Resource @Resource
private CustomerAndOrdersStatisticsMapper customerAndOrdersStatisticsMapper; private CustomerAndOrdersStatisticsMapper customerAndOrdersStatisticsMapper;
@Resource
private ExchangeRateMapper exchangeRateMapper;
@Override @Override
public JSONObject getCommonAnalysis1(JSONObject params) { public JSONObject getCommonAnalysis1(JSONObject params) {
@ -323,7 +326,8 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
} }
public void channelsExchangeRate(Date beginDate,Date endDate,Map<Date, JSONObject> exchangeRateMap, String channel){ public void channelsExchangeRate(Date beginDate,Date endDate,Map<Date, JSONObject> exchangeRateMap, String channel){
List<JSONObject> channelRates = transactionAnalysisMapper.listExchangeRates(beginDate, endDate,channel);
List<JSONObject> channelRates = exchangeRateMapper.listExchangeRates(beginDate, endDate,channel);
for (JSONObject analysisItem:channelRates){ for (JSONObject analysisItem:channelRates){
Date date = analysisItem.getDate("date"); Date date = analysisItem.getDate("date");
JSONObject dataItem = exchangeRateMap.get(date); JSONObject dataItem = exchangeRateMap.get(date);

@ -115,4 +115,6 @@ public interface RetailAppService {
JSONObject getCheckClientInfo(JSONObject device); JSONObject getCheckClientInfo(JSONObject device);
void changeManualSettle(JSONObject device,boolean manual_settle);
} }

@ -438,8 +438,8 @@ public class RetailAppServiceImp implements RetailAppService {
break; break;
} }
Calendar calendar = (Calendar) order.get("transaction_time"); Calendar calendar = (Calendar) order.get("transaction_time");
String trade_date = DateFormatUtils.format(calendar, "yyyy-MM-dd"); String trade_date = DateFormatUtils.format(calendar, "yyyy-MM-dd",calendar.getTimeZone());
String trade_time = DateFormatUtils.format(calendar, "HH:mm:ss"); String trade_time = DateFormatUtils.format(calendar, "HH:mm:ss",calendar.getTimeZone());
order.put("trade_date", trade_date); order.put("trade_date", trade_date);
order.put("trade_time", trade_time); order.put("trade_time", trade_time);
// todo // todo
@ -1385,6 +1385,11 @@ public class RetailAppServiceImp implements RetailAppService {
return clientManager.getCheckClientInfo(device.getIntValue("client_id"), device.getString("account_id")); return clientManager.getCheckClientInfo(device.getIntValue("client_id"), device.getString("account_id"));
} }
@Override
public void changeManualSettle(JSONObject device,boolean manual_settle) {
clientManager.changeManualSettle(device.getIntValue("client_id"),manual_settle,device.getString("account_id"),1,"商户修改手动清算配置");
}
private static boolean mathchLetterorNum(String str) { private static boolean mathchLetterorNum(String str) {
String regex = "[A-Za-z0-9]{8}"; String regex = "[A-Za-z0-9]{8}";
return str.matches(regex); return str.matches(regex);

@ -11,6 +11,7 @@ import au.com.royalpay.payment.manage.bill.bean.QueryBillBean;
import au.com.royalpay.payment.manage.bill.bean.QueryBillOrderBean; import au.com.royalpay.payment.manage.bill.bean.QueryBillOrderBean;
import au.com.royalpay.payment.manage.bill.core.BillOrderService; import au.com.royalpay.payment.manage.bill.core.BillOrderService;
import au.com.royalpay.payment.manage.bill.core.BillService; import au.com.royalpay.payment.manage.bill.core.BillService;
import au.com.royalpay.payment.manage.settlement.core.ManualSettleSupport;
import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean; import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean;
import au.com.royalpay.payment.manage.signin.core.SignInStatusManager; import au.com.royalpay.payment.manage.signin.core.SignInStatusManager;
import au.com.royalpay.payment.manage.system.core.ClientContractService; import au.com.royalpay.payment.manage.system.core.ClientContractService;
@ -22,6 +23,7 @@ import au.com.royalpay.payment.tools.http.HttpUtils;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.time.DateUtils;
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;
@ -29,9 +31,12 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; 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 org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.ParseException;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -58,6 +63,8 @@ public class RetailAppController {
private AppActService appActService; private AppActService appActService;
@Resource @Resource
private ClientContractService clientContractService; private ClientContractService clientContractService;
@Resource
private ManualSettleSupport manualSettleSupport;
@RequestMapping(value = "/token", method = RequestMethod.PUT) @RequestMapping(value = "/token", method = RequestMethod.PUT)
public void updateDevToken(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject token) { public void updateDevToken(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject token) {
@ -114,7 +121,7 @@ public class RetailAppController {
@RequestMapping("/transaction_log/{clearing_detail_id}") @RequestMapping("/transaction_log/{clearing_detail_id}")
public JSONObject getTransactionLogByClearingDetailId(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @PathVariable int clearing_detail_id, public JSONObject getTransactionLogByClearingDetailId(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @PathVariable int clearing_detail_id,
@RequestParam(required = false) String timezone) { @RequestParam(required = false) String timezone) {
return retailAppService.getTransactionLogsByClearingDetailId(device, clearing_detail_id, timezone); return retailAppService.getTransactionLogsByClearingDetailId(device, clearing_detail_id, timezone);
} }
@ -126,7 +133,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, public void updateNoticePartnerHasRead(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @PathVariable String noticeId,
@RequestBody JSONObject account_param) { @RequestBody JSONObject account_param) {
if (!device.getString("account_id").equals(account_param.getString("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");
} }
@ -147,7 +154,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 String account_id, public void changePassword(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @PathVariable String account_id,
@RequestBody @Valid ChangePwdBean change, Errors errors) { @RequestBody @Valid ChangePwdBean change, Errors errors) {
HttpUtils.handleValidErrors(errors); HttpUtils.handleValidErrors(errors);
retailAppService.changeAccountPassword(device, change, account_id); retailAppService.changeAccountPassword(device, change, account_id);
} }
@ -176,7 +183,7 @@ public class RetailAppController {
/* 活动页面 begin */ /* 活动页面 begin */
@RequestMapping(value = "/activities", method = RequestMethod.GET) @RequestMapping(value = "/activities", method = RequestMethod.GET)
public JSONObject getActivities(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestParam(defaultValue = "activity_page") String type, public JSONObject getActivities(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestParam(defaultValue = "activity_page") String type,
@RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "10") int limit) { @RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "10") int limit) {
return retailAppService.getActivities(device, type, page, limit); return retailAppService.getActivities(device, type, page, limit);
} }
@ -220,7 +227,7 @@ public class RetailAppController {
@RequestMapping(value = "/daily_transactions/date/{dateStr}", method = RequestMethod.GET) @RequestMapping(value = "/daily_transactions/date/{dateStr}", method = RequestMethod.GET)
public JSONObject listDailyTransactions(@PathVariable String dateStr, @RequestParam(defaultValue = "Australia/Melbourne") String timezone, public JSONObject listDailyTransactions(@PathVariable String dateStr, @RequestParam(defaultValue = "Australia/Melbourne") String timezone,
@RequestParam(defaultValue = "false") boolean thisdevice, @ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { @RequestParam(defaultValue = "false") boolean thisdevice, @ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
return retailAppService.listDailyTransactions(dateStr, timezone, thisdevice, device); return retailAppService.listDailyTransactions(dateStr, timezone, thisdevice, device);
} }
@ -271,7 +278,7 @@ public class RetailAppController {
@RequestMapping(value = "/cash_back/clean_info", method = RequestMethod.GET) @RequestMapping(value = "/cash_back/clean_info", method = RequestMethod.GET)
public JSONObject getCashbackCleanInfo(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, public JSONObject getCashbackCleanInfo(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device,
@RequestParam(value = "client_id", required = false) String client_id) { @RequestParam(value = "client_id", required = false) String client_id) {
if (client_id == null) { if (client_id == null) {
client_id = device.getString("client_id"); client_id = device.getString("client_id");
} }
@ -287,7 +294,7 @@ public class RetailAppController {
@RequestMapping(value = "/coupon/used", method = RequestMethod.GET) @RequestMapping(value = "/coupon/used", method = RequestMethod.GET)
public JSONObject getCoupons(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestParam(value = "page", defaultValue = "1") int page, public JSONObject getCoupons(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestParam(value = "page", defaultValue = "1") int page,
@RequestParam(value = "limit", defaultValue = "10") int limit) { @RequestParam(value = "limit", defaultValue = "10") int limit) {
return retailAppService.getCoupons(device, page, limit); return retailAppService.getCoupons(device, page, limit);
} }
@ -339,15 +346,15 @@ public class RetailAppController {
@RequestMapping(value = "/bills/orders/{bill_id}", method = RequestMethod.GET) @RequestMapping(value = "/bills/orders/{bill_id}", method = RequestMethod.GET)
public JSONObject getBillOrders(@PathVariable("bill_id") String bill_id, QueryBillOrderBean queryBillOrderBean, public JSONObject getBillOrders(@PathVariable("bill_id") String bill_id, QueryBillOrderBean queryBillOrderBean,
@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { @ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
JSONObject result = billOrderService.query(bill_id, device.getIntValue("client_id"), queryBillOrderBean); JSONObject result = billOrderService.query(bill_id, device.getIntValue("client_id"), queryBillOrderBean);
result.put("analysis", billOrderService.analysis(bill_id, device.getIntValue("client_id"), queryBillOrderBean)); result.put("analysis", billOrderService.analysis(bill_id, device.getIntValue("client_id"), queryBillOrderBean));
return result; return result;
} }
@RequestMapping(value = "/acts",method = RequestMethod.GET) @RequestMapping(value = "/acts", method = RequestMethod.GET)
public List<JSONObject> getIndexAct(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device){ public List<JSONObject> getIndexAct(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
return appActService.listAppActs(); return appActService.listAppActs();
} }
@ -373,12 +380,38 @@ public class RetailAppController {
public JSONObject generateSourceAgreeFile(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { public JSONObject generateSourceAgreeFile(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
JSONObject file = clientContractService.getSourceAgreement(device.getIntValue("client_id")); JSONObject file = clientContractService.getSourceAgreement(device.getIntValue("client_id"));
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
result.put("file_url",file.getString("file_value")); result.put("file_url", file.getString("file_value"));
return result; return result;
} }
@RequestMapping(value = "/file/agree/confirm", method = RequestMethod.POST) @RequestMapping(value = "/file/agree/confirm", method = RequestMethod.POST)
public void confirmSourceAgreeFile(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { public void confirmSourceAgreeFile(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
clientContractService.confirmSourceAgreement(device.getIntValue("client_id"),device.getString("account_id"),"App"); clientContractService.confirmSourceAgreement(device.getIntValue("client_id"), device.getString("account_id"), "App");
}
@RequestMapping(value = "/manual_settle", method = RequestMethod.GET)
public JSONObject getManualSettleStatus(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
return manualSettleSupport.findCurrentSettle(device.getIntValue("client_id"), true);
} }
@RequestMapping(value = "/manual_settle", method = RequestMethod.PUT)
public JSONObject requestManualSettle(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject data) {
String settleToStr = data.getString("settle_to");
if (settleToStr == null) {
throw new ParamInvalidException("settle_to", "error.payment.valid.param_missing");
}
try {
Date setteTo = DateUtils.parseDate(settleToStr, "yyyy-MM-dd");
return manualSettleSupport.requestManualSettle(setteTo, device.getString("account_id"));
} catch (ParseException e) {
throw new ParamInvalidException("settle_to", "error.payment.valid.invalid_time");
}
}
@RequestMapping(value = "/client/manual_settle", method = RequestMethod.PUT)
@ResponseBody
public void confirmSourceAgreeFile(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device,@RequestBody JSONObject data) {
retailAppService.changeManualSettle(device,data.getBoolean("manual_settle"));
}
} }

@ -4,7 +4,12 @@ import au.com.royalpay.payment.manage.management.clearing.core.CleanService;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole; import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.tools.CommonConsts; import au.com.royalpay.payment.tools.CommonConsts;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -18,13 +23,14 @@ public class ClearingConfigController {
@Resource @Resource
private CleanService cleanService; private CleanService cleanService;
@ManagerMapping(value = "/rate_warnings",method = RequestMethod.GET,role = {ManagerRole.ADMIN,ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF}) @ManagerMapping(value = "/rate_warnings", method = RequestMethod.GET, role = { ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF })
public JSONObject getRateWarnings(){ public JSONObject getRateWarnings() {
return cleanService.rateWarnings(); return cleanService.rateWarnings();
} }
@ManagerMapping(value = "/clients/{clientMoniker}/auto_rate",method = RequestMethod.PUT,role = {ManagerRole.ADMIN,ManagerRole.OPERATOR}) @ManagerMapping(value = "/clients/{clientMoniker}/auto_rate", method = RequestMethod.PUT, role = { ManagerRole.ADMIN, ManagerRole.OPERATOR })
public JSONObject generateRateAutomatically(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager){ public JSONObject generateRateAutomatically(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return cleanService.autoGenerateRate(clientMoniker,manager); return cleanService.autoGenerateRate(clientMoniker, manager);
} }
} }

@ -0,0 +1,16 @@
package au.com.royalpay.payment.manage.mappers.log;
import com.alibaba.fastjson.JSONObject;
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 2017-04-18.
*/
@AutoMapper(tablename = "log_clients_operation",pkName = "id")
public interface ClientsOperationLogMapper {
@AutoSql(type = SqlType.INSERT)
void save(JSONObject review);
}

@ -0,0 +1,31 @@
package au.com.royalpay.payment.manage.mappers.payment;
import cn.yixblog.support.mybatis.autosql.annotations.AdvanceSelect;
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
import com.alibaba.fastjson.JSONObject;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Create by yixian at 2018-03-20 18:05
*/
@AutoMapper(tablename = "task_client_manual_settle", pkName = "task_id")
public interface TaskManualSettleMapper {
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "request_time>curdate()")
JSONObject findTodayTask(@Param("client_id") int clientId);
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "clearing_order is null")
List<JSONObject> listActiveTasks(@Param("client_id") int clientId);
@AutoSql(type = SqlType.INSERT)
void save(JSONObject task);
@AutoSql(type = SqlType.UPDATE)
void update(JSONObject task);
}

@ -128,4 +128,6 @@ public interface TransactionMapper {
List<JSONObject> getClientRank(@Param("begin") Date begin, @Param("end") Date end); List<JSONObject> getClientRank(@Param("begin") Date begin, @Param("end") Date end);
List<JSONObject> listClientUnsettleDataByDate(@Param("client_id") int clientId);
} }

@ -1,5 +1,6 @@
package au.com.royalpay.payment.manage.mappers.system; package au.com.royalpay.payment.manage.mappers.system;
import java.sql.SQLType;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -23,4 +24,9 @@ public interface ClientsContractMapper {
JSONObject findByClientId(@Param("client_id") int clientId); JSONObject findByClientId(@Param("client_id") int clientId);
@AutoSql(type = SqlType.SELECT)
List<JSONObject> list();
List<JSONObject> listWithClientInfo();
} }

@ -0,0 +1,29 @@
package au.com.royalpay.payment.manage.mappers.system;
import java.util.Date;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.alibaba.fastjson.JSONObject;
import cn.yixblog.support.mybatis.autosql.annotations.AdvanceSelect;
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
/**
* Create by yixian at 2017-12-19 19:09
*/
@AutoMapper(tablename = "sys_exchange_rate", pkName = "id")
public interface ExchangeRateMapper {
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "type = 1")
JSONObject findMaxRate(@Param("create_date") Date create_time);
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "type = 2")
JSONObject findMinRate(@Param("create_date") Date create_time);
List<JSONObject> listExchangeRates(@Param("begin") Date begin, @Param("end") Date end, @Param("channel") String channel);
}

@ -0,0 +1,9 @@
package au.com.royalpay.payment.manage.merchants.core;
public interface ClientInfoCacheSupport {
void clearClientCache(int clientId);
void clearClientMonikerCache(String clientMoniker);
}

@ -36,10 +36,6 @@ public interface ClientManager {
JSONObject getClientInfo(int clientId); JSONObject getClientInfo(int clientId);
void clearClientCache(int clientId);
void clearClientMonikerCache(String clientMoniker);
JSONObject getClientInfoIgnoreInvalid(int clientId); JSONObject getClientInfoIgnoreInvalid(int clientId);
JSONObject getClientInfoByMoniker(String clientMoniker); JSONObject getClientInfoByMoniker(String clientMoniker);
@ -231,6 +227,7 @@ public interface ClientManager {
void changePaymentPage(JSONObject account, String paypad_version); void changePaymentPage(JSONObject account, String paypad_version);
void changeManualSettle(int client_id, boolean manual_settle,String operator_id,int type,String operation);
void changeQRCodePaySurcharge(JSONObject account, boolean paySurcharge); void changeQRCodePaySurcharge(JSONObject account, boolean paySurcharge);

@ -0,0 +1,40 @@
package au.com.royalpay.payment.manage.merchants.core.impls;
import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientInfoCacheSupport;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.signin.core.SignInAccountService;
import com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class ClientInfoCacheSupportImpl implements ClientInfoCacheSupport{
@Resource
private ClientAccountMapper clientAccountMapper;
@Resource
private SignInAccountService signInAccountService;
@Resource
private ClientManager clientManager;
@Resource
private ClientInfoCacheSupport clientInfoCacheSupport;
@Override
@CacheEvict(value = ":app_client_info:", key = "''+#clientId")
public void clearClientCache(int clientId) {
List<JSONObject> accounts = clientAccountMapper.listPartnerAccounts(clientId);
for (JSONObject acc : accounts) {
signInAccountService.clearAccountCache(acc.getString("account_id"));
}
JSONObject client = clientManager.getClientInfo(clientId);
clientInfoCacheSupport.clearClientMonikerCache(client.getString("client_moniker"));
}
@Override
@CacheEvict(value = ":app_client_info_moniker:", key = "#clientMoniker")
public void clearClientMonikerCache(String clientMoniker) {
}
}

@ -13,31 +13,13 @@ import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper
import au.com.royalpay.payment.manage.appclient.beans.AppClientBean; import au.com.royalpay.payment.manage.appclient.beans.AppClientBean;
import au.com.royalpay.payment.manage.device.core.DeviceManager; 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.financial.FinancialBDConfigMapper;
import au.com.royalpay.payment.manage.mappers.log.ClientsOperationLogMapper;
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper; import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
import au.com.royalpay.payment.manage.mappers.redpack.ActClientInvitationCodeMapper; import au.com.royalpay.payment.manage.mappers.redpack.ActClientInvitationCodeMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper; import au.com.royalpay.payment.manage.mappers.system.*;
import au.com.royalpay.payment.manage.mappers.system.ClientApplyMapper; import au.com.royalpay.payment.manage.merchants.beans.*;
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.ClientsContractMapper;
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.ClientComplyValidator;
import au.com.royalpay.payment.manage.merchants.core.ClientInfoCacheSupport;
import au.com.royalpay.payment.manage.merchants.core.ClientManager; import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.notice.core.MailService; import au.com.royalpay.payment.manage.notice.core.MailService;
import au.com.royalpay.payment.manage.signin.beans.TodoNotice; import au.com.royalpay.payment.manage.signin.beans.TodoNotice;
@ -66,21 +48,16 @@ import au.com.royalpay.payment.tools.merchants.qrboard.QRBoard;
import au.com.royalpay.payment.tools.merchants.qrboard.QRBoardProvider; import au.com.royalpay.payment.tools.merchants.qrboard.QRBoardProvider;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole; import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.tools.permission.enums.PartnerRole; import au.com.royalpay.payment.tools.permission.enums.PartnerRole;
import au.com.royalpay.payment.tools.utils.ImageUtils; import au.com.royalpay.payment.tools.utils.*;
import au.com.royalpay.payment.tools.utils.PageListUtils;
import au.com.royalpay.payment.tools.utils.PasswordUtils;
import au.com.royalpay.payment.tools.utils.PdfUtils;
import au.com.royalpay.payment.tools.utils.QRCodeUtils;
import au.com.royalpay.payment.tools.utils.TimeZoneUtils;
import au.com.royalpay.payment.tools.websocket.notify.PartnerPageEvent; import au.com.royalpay.payment.tools.websocket.notify.PartnerPageEvent;
import cn.yixblog.platform.http.HttpRequestGenerator;
import cn.yixblog.platform.http.HttpRequestResult;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.Order; import com.github.miemiedev.mybatis.paginator.domain.Order;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList; import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.RandomStringUtils;
@ -106,35 +83,23 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.thymeleaf.context.Context; import org.thymeleaf.context.Context;
import org.thymeleaf.spring4.SpringTemplateEngine; import org.thymeleaf.spring4.SpringTemplateEngine;
import javax.annotation.Resource;
import javax.imageio.ImageIO;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.awt.*; import java.awt.*;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream; import java.io.*;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import java.net.URL; import java.net.URL;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream; import java.util.zip.ZipOutputStream;
import javax.annotation.Resource;
import javax.imageio.ImageIO;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import cn.yixblog.platform.http.HttpRequestGenerator;
import cn.yixblog.platform.http.HttpRequestResult;
import static au.com.royalpay.payment.manage.permission.utils.OrgCheckUtils.checkOrgPermission; import static au.com.royalpay.payment.manage.permission.utils.OrgCheckUtils.checkOrgPermission;
/** /**
@ -219,6 +184,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
private ClientContractService clientContractService; private ClientContractService clientContractService;
@Resource @Resource
private MessageSource messageSource; private MessageSource messageSource;
@Resource
private ClientsOperationLogMapper clientsOperationLogMapper;
@Resource
private ClientInfoCacheSupport clientInfoCacheSupport;
private static final String SOURCE_AGREE_FILE = "source_agree_file"; private static final String SOURCE_AGREE_FILE = "source_agree_file";
private static final String CLIENT_BANK_FILE = "client_bank_file"; private static final String CLIENT_BANK_FILE = "client_bank_file";
@ -247,22 +216,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
return clientMapper.findClient(clientId); return clientMapper.findClient(clientId);
} }
@Override
@CacheEvict(value = ":app_client_info:", key = "''+#clientId")
public void clearClientCache(int clientId) {
List<JSONObject> accounts = clientAccountMapper.listPartnerAccounts(clientId);
for (JSONObject acc : accounts) {
signInAccountService.clearAccountCache(acc.getString("account_id"));
}
JSONObject client = getClientInfo(clientId);
clearClientMonikerCache(client.getString("client_moniker"));
}
@Override
@CacheEvict(value = ":app_client_info_moniker:", key = "#clientMoniker")
public void clearClientMonikerCache(String clientMoniker) {
}
@Override @Override
public JSONObject getClientInfoIgnoreInvalid(int clientId) { public JSONObject getClientInfoIgnoreInvalid(int clientId) {
return clientMapper.findClientIgnoreInvalid(clientId); return clientMapper.findClientIgnoreInvalid(clientId);
@ -571,7 +524,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
} }
clientMapper.update(updateInfo); clientMapper.update(updateInfo);
clearClientCache(clientId); clientInfoCacheSupport.clearClientCache(clientId);
} }
@Override @Override
@ -597,7 +550,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
clientMapper.update(update); clientMapper.update(update);
} }
} }
clearClientCache(clientId); clientInfoCacheSupport.clearClientCache(clientId);
} }
@Override @Override
@ -634,7 +587,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
saveClientAuditProcess(client.getIntValue("client_id"), open_status, 5, "合规通过", manager); saveClientAuditProcess(client.getIntValue("client_id"), open_status, 5, "合规通过", manager);
} }
} }
clearClientCache(client.getIntValue("client_id")); clientInfoCacheSupport.clearClientCache(client.getIntValue("client_id"));
} }
@Override @Override
@ -655,7 +608,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
saveClientAuditProcess(client.getIntValue("client_id"), 10, 1, "绿色通道申请通过", manager); saveClientAuditProcess(client.getIntValue("client_id"), 10, 1, "绿色通道申请通过", manager);
sendCommissionWechatMessage(client); sendCommissionWechatMessage(client);
initAdminUserAndSendEmail(manager, clientMoniker, client); initAdminUserAndSendEmail(manager, clientMoniker, client);
clearClientCache(client.getIntValue("client_id")); clientInfoCacheSupport.clearClientCache(client.getIntValue("client_id"));
} }
private void initAdminUserAndSendEmail(JSONObject manager, String clientMoniker, JSONObject client) { private void initAdminUserAndSendEmail(JSONObject manager, String clientMoniker, JSONObject client) {
@ -713,7 +666,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
sendInitEmail(client, account.getString("username"), pwd); sendInitEmail(client, account.getString("username"), pwd);
} }
} }
clearClientCache(clientId); clientInfoCacheSupport.clearClientCache(clientId);
} }
@Override @Override
@ -833,7 +786,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
int clientId = client.getIntValue("client_id"); int clientId = client.getIntValue("client_id");
updateClientApproveEmailStatus(clientId, 1); updateClientApproveEmailStatus(clientId, 1);
clearClientCache(clientId); clientInfoCacheSupport.clearClientCache(clientId);
} }
private void updateClientApproveEmailStatus(int clientId, int status) { private void updateClientApproveEmailStatus(int clientId, int status) {
@ -884,7 +837,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
checkOrgPermission(manager, client); checkOrgPermission(manager, client);
client.put(permissionKey, allow); client.put(permissionKey, allow);
clientMapper.update(client); clientMapper.update(client);
clearClientCache(client.getIntValue("client_id")); clientInfoCacheSupport.clearClientCache(client.getIntValue("client_id"));
} }
@Override @Override
@ -1071,7 +1024,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
Assert.notNull(partner); Assert.notNull(partner);
partner.put("enable_pay_notice", enable); partner.put("enable_pay_notice", enable);
clientMapper.update(partner); clientMapper.update(partner);
clearClientCache(partner.getIntValue("client_id")); clientInfoCacheSupport.clearClientCache(partner.getIntValue("client_id"));
} }
@Override @Override
@ -1099,7 +1052,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
Assert.notNull(partner, "Merchant is null"); Assert.notNull(partner, "Merchant is null");
partner.put("enable_refund_auth", enable); partner.put("enable_refund_auth", enable);
clientMapper.update(partner); clientMapper.update(partner);
clearClientCache(partner.getIntValue("client_id")); clientInfoCacheSupport.clearClientCache(partner.getIntValue("client_id"));
} }
@Override @Override
@ -1134,7 +1087,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
subClient.put("bd_user", managerId); subClient.put("bd_user", managerId);
clientMapper.update(subClient); clientMapper.update(subClient);
} }
clearClientCache(client.getIntValue("client_id")); clientInfoCacheSupport.clearClientCache(client.getIntValue("client_id"));
} }
@Override @Override
@ -1146,7 +1099,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
checkOrgPermission(manager, client); checkOrgPermission(manager, client);
client.put("credential_code", RandomStringUtils.random(32, true, true)); client.put("credential_code", RandomStringUtils.random(32, true, true));
clientMapper.update(client); clientMapper.update(client);
clearClientCache(client.getIntValue("client_id")); clientInfoCacheSupport.clearClientCache(client.getIntValue("client_id"));
} }
@Override @Override
@ -1217,7 +1170,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
update.put("client_id", client.getIntValue("client_id")); update.put("client_id", client.getIntValue("client_id"));
update.put("settle_hour", hour); update.put("settle_hour", hour);
clientMapper.update(update); clientMapper.update(update);
clearClientCache(client.getIntValue("client_id")); clientInfoCacheSupport.clearClientCache(client.getIntValue("client_id"));
} }
@Override @Override
@ -1689,7 +1642,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
partner.put("client_id", clientId); partner.put("client_id", clientId);
partner.put("timezone", timezone); partner.put("timezone", timezone);
clientMapper.update(partner); clientMapper.update(partner);
clearClientCache(clientId); clientInfoCacheSupport.clearClientCache(clientId);
} }
@Override @Override
@ -2191,8 +2144,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
client.put("refund_pwd", pwdHash); client.put("refund_pwd", pwdHash);
client.put("refund_pwd_salt", salt); client.put("refund_pwd_salt", salt);
clientMapper.update(client); clientMapper.update(client);
clearClientCache(client.getIntValue("client_id")); clientInfoCacheSupport.clearClientCache(client.getIntValue("client_id"));
clearClientMonikerCache(client.getString("client_moniker"));
} }
@Override @Override
@ -2224,7 +2176,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
update.put("client_id", clientId); update.put("client_id", clientId);
update.put("qrcode_surcharge", paySurcharge); update.put("qrcode_surcharge", paySurcharge);
clientMapper.update(update); clientMapper.update(update);
clearClientCache(clientId); clientInfoCacheSupport.clearClientCache(clientId);
} }
@Override @Override
@ -2238,7 +2190,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
update.put("client_id", clientId); update.put("client_id", clientId);
update.put("api_surcharge", enableApiSurcharge); update.put("api_surcharge", enableApiSurcharge);
clientMapper.update(update); clientMapper.update(update);
clearClientCache(clientId); clientInfoCacheSupport.clearClientCache(clientId);
} }
@Override @Override
@ -2252,7 +2204,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
update.put("client_id", clientId); update.put("client_id", clientId);
update.put("retail_surcharge", paySurcharge); update.put("retail_surcharge", paySurcharge);
clientMapper.update(update); clientMapper.update(update);
clearClientCache(clientId); clientInfoCacheSupport.clearClientCache(clientId);
} }
@Override @Override
@ -2266,7 +2218,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
update.put("client_id", clientId); update.put("client_id", clientId);
update.put("tax_in_surcharge", taxInSurcharge); update.put("tax_in_surcharge", taxInSurcharge);
clientMapper.update(update); clientMapper.update(update);
clearClientCache(clientId); clientInfoCacheSupport.clearClientCache(clientId);
} }
@Override @Override
@ -2282,13 +2234,13 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Override @Override
public void updateClientCleanDays(int clientId, int cleanDays) { public void updateClientCleanDays(int clientId, int cleanDays) {
clientMapper.updateCleanDays(clientId, cleanDays); clientMapper.updateCleanDays(clientId, cleanDays);
clearClientCache(clientId); clientInfoCacheSupport.clearClientCache(clientId);
} }
@Override @Override
public void updateClientEmail(int clientId, String contact_email) { public void updateClientEmail(int clientId, String contact_email) {
clientMapper.updateClientEmail(clientId, contact_email); clientMapper.updateClientEmail(clientId, contact_email);
clearClientCache(clientId); clientInfoCacheSupport.clearClientCache(clientId);
} }
@Override @Override
@ -2296,7 +2248,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
JSONObject client = clientDetail(manager, clientMoniker); JSONObject client = clientDetail(manager, clientMoniker);
int clientId = client.getIntValue("client_id"); int clientId = client.getIntValue("client_id");
clientMapper.disableClient(clientId); clientMapper.disableClient(clientId);
clearClientCache(clientId); clientInfoCacheSupport.clearClientCache(clientId);
} }
@Override @Override
@ -2590,7 +2542,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
checkOrgPermission(manager, client); checkOrgPermission(manager, client);
client.put("paypad_version", paypad_version); client.put("paypad_version", paypad_version);
clientMapper.update(client); clientMapper.update(client);
clearClientCache(client.getIntValue("client_id")); clientInfoCacheSupport.clearClientCache(client.getIntValue("client_id"));
} }
@Override @Override
@ -2604,7 +2556,31 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
updateObj.put("client_id", client.getIntValue("client_id")); updateObj.put("client_id", client.getIntValue("client_id"));
updateObj.put("paypad_version", paypad_version); updateObj.put("paypad_version", paypad_version);
clientMapper.update(updateObj); clientMapper.update(updateObj);
clearClientCache(clientId); clientInfoCacheSupport.clearClientCache(clientId);
}
@Override
@Transactional
public void changeManualSettle(int client_id, boolean manual_settle,String operator_id,int type,String operation) {
JSONObject client = getClientInfo(client_id);
if(client==null){
throw new BadRequestException("merchant not found");
}
JSONObject record = new JSONObject();
record.put("client_id",client_id);
record.put("manual_settle",manual_settle);
clientMapper.update(record);
JSONObject actClientLog = new JSONObject();
actClientLog.put("client_id",client_id);
actClientLog.put("operator_id",operator_id);
actClientLog.put("operation",operation);
actClientLog.put("create_time",new Date());
actClientLog.put("operator_type",type);
clientsOperationLogMapper.save(actClientLog);
clientInfoCacheSupport.clearClientCache(client_id);
} }
@Override @Override
@ -2618,7 +2594,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
updateObj.put("client_id", client.getIntValue("client_id")); updateObj.put("client_id", client.getIntValue("client_id"));
updateObj.put("qrcode_surcharge", paySurcharge); updateObj.put("qrcode_surcharge", paySurcharge);
clientMapper.update(updateObj); clientMapper.update(updateObj);
clearClientCache(clientId); clientInfoCacheSupport.clearClientCache(clientId);
} }
@Override @Override
@ -2632,7 +2608,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
updateObj.put("client_id", client.getIntValue("client_id")); updateObj.put("client_id", client.getIntValue("client_id"));
updateObj.put("api_surcharge", enableApiSurcharge); updateObj.put("api_surcharge", enableApiSurcharge);
clientMapper.update(updateObj); clientMapper.update(updateObj);
clearClientCache(clientId); clientInfoCacheSupport.clearClientCache(clientId);
} }
@Override @Override
@ -2650,7 +2626,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
updateObj.put("client_id", client.getIntValue("client_id")); updateObj.put("client_id", client.getIntValue("client_id"));
updateObj.put("retail_surcharge", paySurcharge); updateObj.put("retail_surcharge", paySurcharge);
clientMapper.update(updateObj); clientMapper.update(updateObj);
clearClientCache(clientId); clientInfoCacheSupport.clearClientCache(clientId);
} }
@Override @Override
@ -2678,7 +2654,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
updateObj.put("retail_surcharge", updateSurchargeDTO.getRetailSurcharge()); updateObj.put("retail_surcharge", updateSurchargeDTO.getRetailSurcharge());
clientMapper.update(updateObj); clientMapper.update(updateObj);
} }
clearClientCache(clientId); clientInfoCacheSupport.clearClientCache(clientId);
} }
@Override @Override
@ -2709,7 +2685,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} catch (Exception e) { } catch (Exception e) {
logger.error("RefusePartnerError=======:" + clientMoniker + "," + e.getMessage()); logger.error("RefusePartnerError=======:" + clientMoniker + "," + e.getMessage());
} }
clearClientCache(client.getIntValue("client_id")); clientInfoCacheSupport.clearClientCache(client.getIntValue("client_id"));
} }
@Override @Override
@ -2742,7 +2718,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
BigDecimal customerSurchargeRate = new BigDecimal(appClientBean.getCustomerSurchargeRate()).setScale(2, BigDecimal.ROUND_HALF_DOWN); BigDecimal customerSurchargeRate = new BigDecimal(appClientBean.getCustomerSurchargeRate()).setScale(2, BigDecimal.ROUND_HALF_DOWN);
setCustomerSurchargeRate(client.getString("client_moniker"), customerSurchargeRate); setCustomerSurchargeRate(client.getString("client_moniker"), customerSurchargeRate);
} }
clearClientCache(client_id); clientInfoCacheSupport.clearClientCache(client_id);
} }
@Override @Override
@ -2756,7 +2732,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
update.put("client_id", clientId); update.put("client_id", clientId);
update.put("skip_clearing", skip_clearing); update.put("skip_clearing", skip_clearing);
clientMapper.update(update); clientMapper.update(update);
clearClientCache(clientId); clientInfoCacheSupport.clearClientCache(clientId);
} }
@Override @Override
@ -2770,7 +2746,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
update.put("client_id", clientId); update.put("client_id", clientId);
update.put("gateway_upgrade", gatewayUpgrade); update.put("gateway_upgrade", gatewayUpgrade);
clientMapper.update(update); clientMapper.update(update);
clearClientCache(clientId); clientInfoCacheSupport.clearClientCache(clientId);
} }
private void sendMessagetoCompliance(JSONObject client, String bd_user_name) { private void sendMessagetoCompliance(JSONObject client, String bd_user_name) {

@ -2,14 +2,12 @@ package au.com.royalpay.payment.manage.merchants.web;
import au.com.royalpay.payment.core.exceptions.ParamInvalidException; import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean; import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean;
import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig;
import au.com.royalpay.payment.manage.merchants.core.ClientManager; import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.merchants.core.ClientSignEventSupport; import au.com.royalpay.payment.manage.merchants.core.ClientSignEventSupport;
import au.com.royalpay.payment.manage.permission.manager.PartnerMapping; import au.com.royalpay.payment.manage.permission.manager.PartnerMapping;
import au.com.royalpay.payment.manage.permission.manager.RequirePartner;
import au.com.royalpay.payment.manage.support.wechatclients.KangaLandWechatApiImpl; import au.com.royalpay.payment.manage.support.wechatclients.KangaLandWechatApiImpl;
import au.com.royalpay.payment.manage.support.wechatclients.RedpackWechatApiImpl; import au.com.royalpay.payment.manage.support.wechatclients.RedpackWechatApiImpl;
import au.com.royalpay.payment.tools.permission.enums.PartnerRole;
import au.com.royalpay.payment.manage.permission.manager.RequirePartner;
import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery; import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery;
import au.com.royalpay.payment.manage.tradelog.core.TradeLogService; import au.com.royalpay.payment.manage.tradelog.core.TradeLogService;
import au.com.royalpay.payment.tools.CommonConsts; import au.com.royalpay.payment.tools.CommonConsts;
@ -17,20 +15,31 @@ import au.com.royalpay.payment.tools.connections.mpsupport.beans.WxOauthType;
import au.com.royalpay.payment.tools.exceptions.BadRequestException; import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.exceptions.ForbiddenException; import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
import au.com.royalpay.payment.tools.http.HttpUtils; import au.com.royalpay.payment.tools.http.HttpUtils;
import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig;
import au.com.royalpay.payment.tools.permission.enums.PartnerRole;
import au.com.royalpay.payment.tools.permission.wechat.WechatMapping; import au.com.royalpay.payment.tools.permission.wechat.WechatMapping;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.validation.Errors; import org.springframework.validation.Errors;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.util.List; import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
/** /**
* view for partner client * view for partner client
* Created by yixian on 2016-07-03. * Created by yixian on 2016-07-03.
@ -348,4 +357,13 @@ public class PartnerViewController {
public void fullReleasePreAuthorization(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody TradeLogQuery query) throws Exception { public void fullReleasePreAuthorization(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody TradeLogQuery query) throws Exception {
tradeLogService.fullReleasePreAuthorization(account, query); tradeLogService.fullReleasePreAuthorization(account, query);
} }
@PartnerMapping(value = "/manual_settle", method = RequestMethod.PUT, roles = PartnerRole.ADMIN)
@ResponseBody
public void manualSettle(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestParam boolean manual_settle) {
clientManager.changeManualSettle(account.getIntValue("client_id"),manual_settle,account.getString("account_id"),1,"商户"+(manual_settle?"打开":"关闭")+"手动清算");
}
} }

@ -0,0 +1,16 @@
package au.com.royalpay.payment.manage.settlement.core;
import com.alibaba.fastjson.JSONObject;
import java.util.Date;
/**
* Create by yixian at 2018-03-20 17:42
*/
public interface ManualSettleSupport {
JSONObject requestManualSettle(Date settleTo, String accountId);
JSONObject findCurrentSettle(int clientId, boolean includingUnsettleData);
}

@ -0,0 +1,98 @@
package au.com.royalpay.payment.manage.settlement.core.impls;
import au.com.royalpay.payment.manage.mappers.log.ClearingLogMapper;
import au.com.royalpay.payment.manage.mappers.payment.TaskManualSettleMapper;
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper;
import au.com.royalpay.payment.manage.settlement.core.ManualSettleSupport;
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.merchants.core.MerchantInfoProvider;
import au.com.royalpay.payment.tools.permission.enums.PartnerRole;
import au.com.royalpay.payment.tools.utils.CurrencyAmountUtils;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* Create by yixian at 2018-03-20 17:44
*/
@Service
public class ManualSettleSupportImpl implements ManualSettleSupport {
@Resource
private MerchantInfoProvider merchantInfoProvider;
@Resource
private TransactionMapper transactionMapper;
@Resource
private TaskManualSettleMapper taskManualSettleMapper;
@Resource
private ClearingLogMapper clearingLogMapper;
@Resource
private ClientAccountMapper clientAccountMapper;
@Override
public JSONObject requestManualSettle(Date settleTo, String accountId) {
JSONObject account = clientAccountMapper.findById(accountId);
if (PartnerRole.getRole(account.getIntValue("role")) != PartnerRole.ADMIN) {
throw new ForbiddenException();
}
int clientId = account.getIntValue("client_id");
if (DateUtils.isSameDay(new Date(), settleTo)) {
throw new BadRequestException("Cannot settle today's transactions");
}
JSONObject currentTask = findCurrentSettle(clientId, false);
String taskId = currentTask.getString("task_id");
currentTask.put("request_time", new Date());
currentTask.put("client_id", clientId);
currentTask.put("applier_id", account.getString("account_id"));
currentTask.put("applier_name", account.getString("display_name"));
currentTask.put("settle_to", settleTo);
if (taskId != null) {
taskManualSettleMapper.update(currentTask);
} else {
taskManualSettleMapper.save(currentTask);
}
return currentTask;
}
@Override
public JSONObject findCurrentSettle(int clientId, boolean includingUnsettleData) {
JSONObject client = merchantInfoProvider.getClientInfo(clientId);
if (!client.getBooleanValue("manual_settle")) {
throw new ForbiddenException("Manual Settlement Not Enabled");
}
JSONObject todayTask = taskManualSettleMapper.findTodayTask(clientId);
if (todayTask != null) {
todayTask.put("settle_to", DateFormatUtils.format(todayTask.getDate("settle_to"), "yyyy-MM-dd"));
} else {
todayTask = new JSONObject();
}
List<JSONObject> settleLogs = clearingLogMapper.findByDate(new Date());
//今天未清算则锁定
todayTask.put("locked", settleLogs.isEmpty());
if (includingUnsettleData) {
List<JSONObject> unsettleReports = transactionMapper.listClientUnsettleDataByDate(clientId);
unsettleReports.parallelStream().forEach(report -> {
report.put("clearing_amount", CurrencyAmountUtils.scalePlatformCurrency(report.getBigDecimal("clearing_amount")));
BigDecimal settleAmount = report.getBigDecimal("settle_amount");
report.put("settle_amount", CurrencyAmountUtils.scalePlatformCurrency(settleAmount == null ? BigDecimal.ZERO : settleAmount));
report.put("date_str", DateFormatUtils.format(report.getDate("trans_date"), "yyyy-MM-dd"));
});
todayTask.put("unsettle", unsettleReports);
BigDecimal totalClearing = unsettleReports.stream().map(report -> report.getBigDecimal("clearing_amount")).reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
todayTask.put("total_clearing_amount", CurrencyAmountUtils.scalePlatformCurrency(totalClearing));
BigDecimal totalSettle = unsettleReports.stream().map(report -> report.getBigDecimal("settle_amount")).reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
todayTask.put("total_settle_amount", CurrencyAmountUtils.scalePlatformCurrency(totalSettle));
todayTask.put("desc", LocaleSupport.localeMessage("manual_settle.notice"));
}
return todayTask;
}
}

@ -0,0 +1,5 @@
/**
*
* Create by yixian at 2018-03-20 17:42
*/
package au.com.royalpay.payment.manage.settlement;

@ -0,0 +1,43 @@
package au.com.royalpay.payment.manage.settlement.web;
import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
import au.com.royalpay.payment.manage.permission.manager.PartnerMapping;
import au.com.royalpay.payment.manage.settlement.core.ManualSettleSupport;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.permission.enums.PartnerRole;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.text.ParseException;
import java.util.Date;
/**
* Create by yixian at 2018-03-20 20:30
*/
@RequestMapping("/client/manual_settle")
@RestController
public class ClientManualSettleController {
@Resource
private ManualSettleSupport manualSettleSupport;
@PartnerMapping(value = "/today", method = RequestMethod.GET, roles = {PartnerRole.ADMIN})
public JSONObject checkRequestInToday(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
return manualSettleSupport.findCurrentSettle(account.getIntValue("client_id"), true);
}
@PartnerMapping(value = "/today", method = RequestMethod.PUT, roles = {PartnerRole.ADMIN})
public JSONObject requestManualSettle(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody JSONObject data) {
String settleToStr = data.getString("settle_to");
if (settleToStr == null) {
throw new ParamInvalidException("settle_to", "error.payment.valid.param_missing");
}
try {
Date setteTo = DateUtils.parseDate(settleToStr, "yyyy-MM-dd");
return manualSettleSupport.requestManualSettle(setteTo, account.getString("account_id"));
} catch (ParseException e) {
throw new ParamInvalidException("settle_to", "error.payment.valid.invalid_time");
}
}
}

@ -320,7 +320,7 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati
"company_name", "address","business_name","business_structure", "abn","acn","company_phone","suburb","postcode","state","contact_person","contact_phone","contact_email", "company_name", "address","business_name","business_structure", "abn","acn","company_phone","suburb","postcode","state","contact_person","contact_phone","contact_email",
"short_name", "logo_url", "enable_refund", "enable_refund_auth", "retail_surcharge", "require_custinfo", "require_remark", "short_name", "logo_url", "enable_refund", "enable_refund_auth", "retail_surcharge", "require_custinfo", "require_remark",
"logo_thumbnail", "creator", "create_time", "approver", "approve_result", "approve_time", "timezone", "logo_thumbnail", "creator", "create_time", "approver", "approve_result", "approve_time", "timezone",
"has_children", "source", "customer_surcharge_rate", "enable_alipay", "enable_wechat", "enable_bestpay"}; "has_children", "source", "customer_surcharge_rate", "enable_alipay", "enable_wechat", "enable_bestpay","manual_settle"};
for (String col : columns) { for (String col : columns) {
simpleClient.put(col, client.get(col)); simpleClient.put(col, client.get(col));
} }

@ -2,6 +2,8 @@ package au.com.royalpay.payment.manage.system.core;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import java.util.List;
public interface ClientContractService { public interface ClientContractService {
JSONObject getOrGenerateSourceAgreement(int client_id,String channel); JSONObject getOrGenerateSourceAgreement(int client_id,String channel);
@ -12,4 +14,5 @@ public interface ClientContractService {
JSONObject getClientContractExpire(int client_id); JSONObject getClientContractExpire(int client_id);
List<JSONObject> list();
} }

@ -107,14 +107,15 @@ public class ClientContractServiceImpl implements ClientContractService {
if(contract.getBoolean("has_sign")){ if(contract.getBoolean("has_sign")){
return; return;
} }
Date now = new Date();
JSONObject account = clientAccountMapper.findById(account_id); JSONObject account = clientAccountMapper.findById(account_id);
contract.put("has_sign", 1); contract.put("has_sign", 1);
contract.put("sign_account_id",account_id); contract.put("sign_account_id",account_id);
contract.put("sign_channel",channel); contract.put("sign_channel",channel);
contract.put("confirm_time",now);
contract.put("signatory",account.getString("display_name")); contract.put("signatory",account.getString("display_name"));
clientsContractMapper.update(contract); clientsContractMapper.update(contract);
Date now = new Date();
List<JSONObject> rateInfo = clientRateMapper.minExpiryTime(client_id, null); List<JSONObject> rateInfo = clientRateMapper.minExpiryTime(client_id, null);
if(expire){ if(expire){
rateInfo.forEach((p)->{ rateInfo.forEach((p)->{
@ -214,4 +215,9 @@ public class ClientContractServiceImpl implements ClientContractService {
return result; return result;
} }
@Override
public List<JSONObject> list() {
return clientsContractMapper.listWithClientInfo();
}
} }

@ -0,0 +1,26 @@
package au.com.royalpay.payment.manage.system.web;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.system.core.ClientContractService;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import javax.annotation.Resource;
@RestController
@RequestMapping(value = "/manage/contract")
public class contractController {
@Resource
private ClientContractService clientContractService;
@ManagerMapping(value = "/list",method = RequestMethod.GET)
public List<JSONObject> list(){
return clientContractService.list();
}
}

@ -650,6 +650,7 @@
o.pre_authorization, o.pre_authorization,
o.refund_amount refund_fee, o.refund_amount refund_fee,
o.customer_id, o.customer_id,
o.order_detail,
t.clearing_amount, t.clearing_amount,
t.refund_id, t.refund_id,
t.transaction_time, t.transaction_time,

@ -31,20 +31,22 @@
<if test="trans_type==2">and t.refund_id is NOT NULL</if> <if test="trans_type==2">and t.refund_id is NOT NULL</if>
<if test="trans_type==3">and t.transaction_type='Debit' and t.refund_id is NULL</if> <if test="trans_type==3">and t.transaction_type='Debit' and t.refund_id is NULL</if>
<if test="channel!=null"> <if test="channel!=null">
and <foreach collection="channel" item="chan" open="(" close=")" separator=" or ">o.channel=#{chan}</foreach> and
<foreach collection="channel" item="chan" open="(" close=")" separator=" or ">o.channel=#{chan}
</foreach>
</if> </if>
</where> </where>
</select> </select>
<select id="listTransFlow" resultType="com.alibaba.fastjson.JSONObject"> <select id="listTransFlow" resultType="com.alibaba.fastjson.JSONObject">
SELECT t.*, SELECT t.*,
ifnull(o.client_order_id,'--') client_order_id, ifnull(o.client_order_id,'--') client_order_id,
if(t.channel='Settlement','clearing', if(t.channel='Settlement','clearing',
if(t.transaction_type='Credit','payment','refund')) trans_type, if(t.transaction_type='Credit','payment','refund')) trans_type,
t.system_transaction_id, t.system_transaction_id,
if(t.channel='Settlement', if(t.channel='Settlement',
if(locate('MERCHANT',t.system_transaction_id)>0, 'Transfer to Merchant','Merchant Service Fee'), if(locate('MERCHANT',t.system_transaction_id)>0, 'Transfer to Merchant','Merchant Service Fee'),
if(t.system_generate=0,t.order_id,t.remark)) order_id2, if(t.system_generate=0,t.order_id,t.remark)) order_id2,
if(t.channel='Settlement','-',CASE t.clearing_status if(t.channel='Settlement','-',CASE t.clearing_status
WHEN 0 THEN 'ReadyToClear' WHEN 0 THEN 'ReadyToClear'
WHEN 1 THEN 'Cleared' WHEN 1 THEN 'Cleared'
@ -72,7 +74,9 @@
<if test="trans_type==2">and t.refund_id is NOT NULL</if> <if test="trans_type==2">and t.refund_id is NOT NULL</if>
<if test="trans_type==3">and t.transaction_type='Debit' and t.refund_id is NULL</if> <if test="trans_type==3">and t.transaction_type='Debit' and t.refund_id is NULL</if>
<if test="channel!=null"> <if test="channel!=null">
and <foreach collection="channel" item="chan" open="(" close=")" separator=" or ">o.channel=#{chan}</foreach> and
<foreach collection="channel" item="chan" open="(" close=")" separator=" or ">o.channel=#{chan}
</foreach>
</if> </if>
</where> </where>
order by t.transaction_time desc order by t.transaction_time desc
@ -95,14 +99,22 @@
sum(if(t.transaction_type='Debit' AND t.refund_id is NOT NULL and o.pre_authorization=1,t.clearing_amount,0)) sum(if(t.transaction_type='Debit' AND t.refund_id is NOT NULL and o.pre_authorization=1,t.clearing_amount,0))
pre_refund_fee, pre_refund_fee,
ifnull(sum(if(t.transaction_type = 'Credit' and t.channel != 'Settlement',t.settle_amount,if(t.channel != 'Settlement',-t.settle_amount,0))),0) total_settle_amount, ifnull(sum(if(t.transaction_type = 'Credit' and t.channel != 'Settlement',t.settle_amount,if(t.channel !=
ifnull(sum(if(t.transaction_type = 'Credit' and t.channel != 'Settlement',t.royal_surcharge,if(t.channel != 'Settlement',-t.royal_surcharge,0))),0) total_royal_surcharge, 'Settlement',-t.settle_amount,0))),0) total_settle_amount,
ifnull(sum(if(t.transaction_type = 'Credit' and t.channel != 'Settlement',t.total_surcharge,if(t.channel != 'Settlement',-t.total_surcharge,0))),0) total_surcharge, ifnull(sum(if(t.transaction_type = 'Credit' and t.channel != 'Settlement',t.royal_surcharge,if(t.channel !=
ifnull(sum(if(t.transaction_type = 'Credit' and t.channel = 'Wechat',t.channel_surcharge,if(t.channel = 'Wechat',-t.channel_surcharge,0))),0) wechat_fee, 'Settlement',-t.royal_surcharge,0))),0) total_royal_surcharge,
ifnull(sum(if(t.transaction_type = 'Credit' and t.channel = 'Alipay',t.channel_surcharge,if(t.channel = 'Alipay',-t.channel_surcharge,0))),0) alipay_fee, ifnull(sum(if(t.transaction_type = 'Credit' and t.channel != 'Settlement',t.total_surcharge,if(t.channel !=
ifnull(sum(if(t.transaction_type = 'Credit' and t.channel = 'jd',t.channel_surcharge,if(t.channel = 'jd',-t.channel_surcharge,0))),0) jd_fee, 'Settlement',-t.total_surcharge,0))),0) total_surcharge,
ifnull(sum(if(t.transaction_type = 'Credit' and t.channel = 'Bestpay',t.channel_surcharge,if(t.channel = 'Bestpay',-t.channel_surcharge,0))),0) bestpay_fee, ifnull(sum(if(t.transaction_type = 'Credit' and t.channel = 'Wechat',t.channel_surcharge,if(t.channel =
ifnull(sum(if(t.transaction_type = 'Credit' and t.channel = 'AlipayOnline',t.channel_surcharge,if(t.channel = 'AlipayOnline',-t.channel_surcharge,0))),0) alipay_online_fee 'Wechat',-t.channel_surcharge,0))),0) wechat_fee,
ifnull(sum(if(t.transaction_type = 'Credit' and t.channel = 'Alipay',t.channel_surcharge,if(t.channel =
'Alipay',-t.channel_surcharge,0))),0) alipay_fee,
ifnull(sum(if(t.transaction_type = 'Credit' and t.channel = 'jd',t.channel_surcharge,if(t.channel =
'jd',-t.channel_surcharge,0))),0) jd_fee,
ifnull(sum(if(t.transaction_type = 'Credit' and t.channel = 'Bestpay',t.channel_surcharge,if(t.channel =
'Bestpay',-t.channel_surcharge,0))),0) bestpay_fee,
ifnull(sum(if(t.transaction_type = 'Credit' and t.channel = 'AlipayOnline',t.channel_surcharge,if(t.channel =
'AlipayOnline',-t.channel_surcharge,0))),0) alipay_online_fee
FROM pmt_transactions t FROM pmt_transactions t
left JOIN pmt_orders o on o.order_id=t.order_id left JOIN pmt_orders o on o.order_id=t.order_id
<where> <where>
@ -124,7 +136,9 @@
<if test="trans_type==2">and t.refund_id is NOT NULL</if> <if test="trans_type==2">and t.refund_id is NOT NULL</if>
<if test="trans_type==3">and t.transaction_type='Debit' and t.refund_id is NULL</if> <if test="trans_type==3">and t.transaction_type='Debit' and t.refund_id is NULL</if>
<if test="channel!=null"> <if test="channel!=null">
and <foreach collection="channel" item="chan" open="(" close=")" separator=" or ">o.channel=#{chan}</foreach> and
<foreach collection="channel" item="chan" open="(" close=")" separator=" or ">o.channel=#{chan}
</foreach>
</if> </if>
</where> </where>
</select> </select>
@ -172,12 +186,16 @@
<if test="to!=null">and t.transaction_time &lt; #{to}</if> <if test="to!=null">and t.transaction_time &lt; #{to}</if>
</select> </select>
<select id="listPreRefundClients" resultType="com.alibaba.fastjson.JSONObject"> <select id="listPreRefundClients" resultType="com.alibaba.fastjson.JSONObject">
select * SELECT *
from (select ifnull(sum(if(transaction_type = 'Credit', clearing_amount, -clearing_amount)), 0) amount, c.client_id client_id,max(t.transaction_time) transation_time,c.client_moniker client_moniker FROM (SELECT
from pmt_transactions t INNER join sys_clients c ifnull(sum(if(transaction_type = 'Credit', clearing_amount, -clearing_amount)), 0) amount,
on t.client_id = c.client_id and c.enable_refund_auth = 0 c.client_id client_id,
group by c.client_id) a max(t.transaction_time) transation_time,
where a.amount &lt; 0 c.client_moniker client_moniker
FROM pmt_transactions t INNER JOIN sys_clients c
ON t.client_id = c.client_id AND c.enable_refund_auth = 0
GROUP BY c.client_id) a
WHERE a.amount &lt; 0
</select> </select>
<select id="validAnalysis" resultType="com.alibaba.fastjson.JSONObject"> <select id="validAnalysis" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[ <![CDATA[
@ -279,7 +297,8 @@
<if test="to!=null">and t.transaction_time &lt; #{to}</if> <if test="to!=null">and t.transaction_time &lt; #{to}</if>
<if test="org_id!=null and org_ids==null">and c.org_id = #{org_id}</if> <if test="org_id!=null and org_ids==null">and c.org_id = #{org_id}</if>
<if test="org_ids!=null">and c.org_id in <if test="org_ids!=null">and c.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if> <foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
</if>
GROUP BY DATE(t.transaction_time) GROUP BY DATE(t.transaction_time)
order by t.clearing_time desc order by t.clearing_time desc
</select> </select>
@ -298,7 +317,8 @@
<if test="client_moniker!=null">and c.client_moniker=#{client_moniker}</if> <if test="client_moniker!=null">and c.client_moniker=#{client_moniker}</if>
<if test="org_id!=null and org_ids==null">and c.org_id = #{org_id}</if> <if test="org_id!=null and org_ids==null">and c.org_id = #{org_id}</if>
<if test="org_ids!=null">and c.org_id in <if test="org_ids!=null">and c.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if> <foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
</if>
GROUP BY c.client_id GROUP BY c.client_id
order by total desc order by total desc
</select> </select>
@ -317,7 +337,8 @@
<if test="client_moniker!=null">and c.client_moniker=#{client_moniker}</if> <if test="client_moniker!=null">and c.client_moniker=#{client_moniker}</if>
<if test="org_id!=null and org_ids==null">and c.org_id = #{org_id}</if> <if test="org_id!=null and org_ids==null">and c.org_id = #{org_id}</if>
<if test="org_ids!=null">and c.org_id in <if test="org_ids!=null">and c.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if> <foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
</if>
</select> </select>
<select id="getAusTracData" resultType="com.alibaba.fastjson.JSONObject"> <select id="getAusTracData" resultType="com.alibaba.fastjson.JSONObject">
@ -457,33 +478,33 @@
<![CDATA[ <![CDATA[
SELECT SELECT
sum(if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount)) * b.proportion sum(if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount)) * b.proportion
total, total,
t.client_id, t.client_id,
m.org_id, m.org_id,
c.approve_time client_create_time, c.approve_time client_create_time,
c.source client_source, c.source client_source,
date(t.transaction_time) trade_date, date(t.transaction_time) trade_date,
t.channel channel, t.channel channel,
ifnull((SELECT min(r.rate_value) ifnull((SELECT min(r.rate_value)
FROM sys_client_rates r FROM sys_client_rates r
WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND
r.expiry_time >= t.transaction_time AND r.expiry_time >= t.transaction_time AND
r.rate_name = 'Wechat'), 1) wechat_rate_value, r.rate_name = 'Wechat'), 1) wechat_rate_value,
ifnull((SELECT min(r.rate_value) ifnull((SELECT min(r.rate_value)
FROM sys_client_rates r FROM sys_client_rates r
WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND
r.expiry_time >= t.transaction_time AND r.expiry_time >= t.transaction_time AND
r.rate_name = 'Alipay'), 1) alipay_rate_value, r.rate_name = 'Alipay'), 1) alipay_rate_value,
ifnull((SELECT min(r.rate_value) ifnull((SELECT min(r.rate_value)
FROM sys_client_rates r FROM sys_client_rates r
WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND
r.expiry_time >= t.transaction_time AND r.expiry_time >= t.transaction_time AND
r.rate_name = 'Bestpay'), 1) bestpay_rate_value, r.rate_name = 'Bestpay'), 1) bestpay_rate_value,
ifnull((SELECT min(r.rate_value) ifnull((SELECT min(r.rate_value)
FROM sys_client_rates r FROM sys_client_rates r
WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND
r.expiry_time >= t.transaction_time AND r.expiry_time >= t.transaction_time AND
r.rate_name = 'jd'), 1) jd_rate_value, r.rate_name = 'jd'), 1) jd_rate_value,
ifnull((SELECT min(r.rate_value) ifnull((SELECT min(r.rate_value)
FROM sys_client_rates r FROM sys_client_rates r
WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND
@ -517,7 +538,7 @@
INNER JOIN sys_org so INNER JOIN sys_org so
ON c.referrer_id = so.org_id AND so.is_valid = 1 AND so.type = 1 AND so.commission = 1 ON c.referrer_id = so.org_id AND so.is_valid = 1 AND so.type = 1 AND so.commission = 1
WHERE year(t.transaction_time) = #{year} AND month(t.transaction_time) = #{month} AND t.channel != 'Settlement' WHERE year(t.transaction_time) = #{year} AND month(t.transaction_time) = #{month} AND t.channel != 'Settlement'
GROUP BY so.org_id, trade_date,t.client_id GROUP BY so.org_id, trade_date, t.client_id
ORDER BY c.org_id ASC, t.client_id ASC, trade_date ASC ORDER BY c.org_id ASC, t.client_id ASC, trade_date ASC
</select> </select>
@ -525,33 +546,33 @@
<![CDATA[ <![CDATA[
SELECT SELECT
sum(if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount)) sum(if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount))
total, total,
t.client_id client_id, t.client_id client_id,
c.approve_time client_create_time, c.approve_time client_create_time,
c.source client_source, c.source client_source,
date(t.transaction_time) trade_date, date(t.transaction_time) trade_date,
t.channel channel, t.channel channel,
ifnull(so.rate_value, 1) rate_value, ifnull(so.rate_value, 1) rate_value,
ifnull((SELECT min(r.rate_value) ifnull((SELECT min(r.rate_value)
FROM sys_client_rates r FROM sys_client_rates r
WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND
r.expiry_time >= t.transaction_time AND r.expiry_time >= t.transaction_time AND
r.rate_name = 'Wechat'), 1) wechat_rate_value, r.rate_name = 'Wechat'), 1) wechat_rate_value,
ifnull((SELECT min(r.rate_value) ifnull((SELECT min(r.rate_value)
FROM sys_client_rates r FROM sys_client_rates r
WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND
r.expiry_time >= t.transaction_time AND r.expiry_time >= t.transaction_time AND
r.rate_name = 'Alipay'), 1) alipay_rate_value, r.rate_name = 'Alipay'), 1) alipay_rate_value,
ifnull((SELECT min(r.rate_value) ifnull((SELECT min(r.rate_value)
FROM sys_client_rates r FROM sys_client_rates r
WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND
r.expiry_time >= t.transaction_time AND r.expiry_time >= t.transaction_time AND
r.rate_name = 'Bestpay'), 1) bestpay_rate_value, r.rate_name = 'Bestpay'), 1) bestpay_rate_value,
ifnull((SELECT min(r.rate_value) ifnull((SELECT min(r.rate_value)
FROM sys_client_rates r FROM sys_client_rates r
WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND
r.expiry_time >= t.transaction_time AND r.expiry_time >= t.transaction_time AND
r.rate_name = 'jd'), 1) jd_rate_value, r.rate_name = 'jd'), 1) jd_rate_value,
ifnull((SELECT min(r.rate_value) ifnull((SELECT min(r.rate_value)
FROM sys_client_rates r FROM sys_client_rates r
WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND
@ -561,7 +582,7 @@
INNER JOIN sys_clients c ON c.client_id = t.client_id INNER JOIN sys_clients c ON c.client_id = t.client_id
INNER JOIN sys_org so INNER JOIN sys_org so
ON c.org_id = so.org_id AND so.is_valid = 1 AND so.type = 0 AND so.parent_org_id = #{parent_org_id} ON c.org_id = so.org_id AND so.is_valid = 1 AND so.type = 0 AND so.parent_org_id = #{parent_org_id}
WHERE year(t.transaction_time) = #{year} AND month(t.transaction_time) = #{month} AND t.channel != 'Settlement' WHERE year(t.transaction_time) = #{year} AND month(t.transaction_time) = #{month} AND t.channel != 'Settlement'
GROUP BY t.client_id, trade_date, channel GROUP BY t.client_id, trade_date, channel
ORDER BY c.org_id ASC, t.client_id ASC, trade_date ASC ORDER BY c.org_id ASC, t.client_id ASC, trade_date ASC
]]> ]]>
@ -676,7 +697,8 @@
select sum(if(t.transaction_type='Credit',settle_amount,-settle_amount)) settle_amount , select sum(if(t.transaction_type='Credit',settle_amount,-settle_amount)) settle_amount ,
DATE_FORMAT(t.transaction_time,'%Y%m%d') weekend DATE_FORMAT(t.transaction_time,'%Y%m%d') weekend
from pmt_transactions t from pmt_transactions t
INNER JOIN log_clearing_detail d on d.clear_detail_id=t.clearing_order and DAYOFWEEK(d.report_date)>2 and clear_days = 1 INNER JOIN log_clearing_detail d on d.clear_detail_id=t.clearing_order and DAYOFWEEK(d.report_date)>2 and
clear_days = 1
where (DAYOFWEEK(t.transaction_time)=1 or DAYOFWEEK(t.transaction_time) = 7) where (DAYOFWEEK(t.transaction_time)=1 or DAYOFWEEK(t.transaction_time) = 7)
<if test="begin!=null"> <if test="begin!=null">
and t.transaction_time &gt; #{begin} and t.transaction_time &gt; #{begin}
@ -722,5 +744,15 @@
and t.clearing_order is not NULL and t.clearing_order is not NULL
group by client_id group by client_id
</select> </select>
<select id="listClientUnsettleDataByDate" resultType="com.alibaba.fastjson.JSONObject">
SELECT
date(transaction_time) trans_date,
sum(if(transaction_type = 'Credit', clearing_amount, -clearing_amount)) clearing_amount,
sum(if(transaction_type = 'Credit', settle_amount, -settle_amount)) settle_amount
FROM pmt_transactions t
WHERE t.client_id = #{client_id} AND t.clearing_status = 0
GROUP BY trans_date
ORDER BY trans_date DESC
</select>
</mapper> </mapper>

@ -7,4 +7,10 @@
order by create_time desc order by create_time desc
limit 1 limit 1
</select> </select>
<select id="listWithClientInfo" resultType="com.alibaba.fastjson.JSONObject">
select c.client_moniker client_moniker,cc.create_time create_time,cc.confirm_time confirm_time,a.display_name display_name from
sys_clients_contract cc left join sys_clients c on c.client_id = cc.client_id
left join sys_accounts a on a.account_id = cc.sign_account_id
</select>
</mapper> </mapper>

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="au.com.royalpay.payment.manage.mappers.system.ExchangeRateMapper">
<select id="listExchangeRates" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT
create_date mx ,
rate exchange_rate ,
create_date `date`
FROM sys_exchange_rate
WHERE create_date >= #{begin} And create_date <= #{end} AND channel = #{channel} and type = 1
GROUP BY
create_date
ORDER BY
`date` ASC
]]>
</select>
</mapper>

@ -0,0 +1 @@
manual_settle.notice=Settlement will be made on second work day after submitted this application. Your balance will not update during this time.

@ -0,0 +1 @@
manual_settle.notice=提现申请提交后会在第二个工作日到账,在此期间您的余额不会更新

@ -105,3 +105,6 @@ sys.contract.ordinary.info=Dear merchant, your service contract with ROYALPAY ha
sys.contract.ordinary.waring=Dear merchant, your service contract with ROYALPAY expires in {0} days. In order not to affect your normal use, please contact your supervisor or use your administrator account as soon as possible in order to renew your service contract. sys.contract.ordinary.waring=Dear merchant, your service contract with ROYALPAY expires in {0} days. In order not to affect your normal use, please contact your supervisor or use your administrator account as soon as possible in order to renew your service contract.
sys.contract.waring=Dear merchant, your service contract with ROYALPAY is due to expire in {0} days. In order not to affect your normal use, please see the latest service agreement for renewal. sys.contract.waring=Dear merchant, your service contract with ROYALPAY is due to expire in {0} days. In order not to affect your normal use, please see the latest service agreement for renewal.
sys.contract.info=Dear merchant, your service contract with ROYALPAY has expired. Please check the latest service agreement to renew your contract so as not to affect your normal use. sys.contract.info=Dear merchant, your service contract with ROYALPAY has expired. Please check the latest service agreement to renew your contract so as not to affect your normal use.
sys.mondelay.cancel.waring=this is mondelay cancel waring

@ -99,3 +99,5 @@ sys.contract.ordinary.info=尊敬的商户您与ROYALPAY的服务合同已到
sys.contract.ordinary.waring=尊敬的商户您与ROYALPAY的服务合同还有{0}天到期,为了不影响您的正常使用,请尽快联系您的主管或使用管理员账户登录以便进行服务续约 sys.contract.ordinary.waring=尊敬的商户您与ROYALPAY的服务合同还有{0}天到期,为了不影响您的正常使用,请尽快联系您的主管或使用管理员账户登录以便进行服务续约
sys.contract.waring=尊敬的商户您与ROYALPAY的服务合同还有{0}天到期,为了不影响您的正常使用,请查看最新服务协议进行续约。 sys.contract.waring=尊敬的商户您与ROYALPAY的服务合同还有{0}天到期,为了不影响您的正常使用,请查看最新服务协议进行续约。
sys.contract.info=尊敬的商户您与ROYALPAY的服务合同已到期为了不影响您的正常使用请查看最新服务协议进行续约。 sys.contract.info=尊敬的商户您与ROYALPAY的服务合同已到期为了不影响您的正常使用请查看最新服务协议进行续约。
sys.mondelay.cancel.waring=商户取消活动警告

@ -111,6 +111,8 @@
<script type="text/javascript" data-th-inline="javascript"> <script type="text/javascript" data-th-inline="javascript">
$(document).ready(function () { $(document).ready(function () {
var operation_pause= /*[[${operation_pause}]]*/false; var operation_pause= /*[[${operation_pause}]]*/false;
var cancel_waring= /*[[${cancel_waring}]]*/'';
function is_weixin() { function is_weixin() {
var ua = navigator.userAgent.toLowerCase(); var ua = navigator.userAgent.toLowerCase();
@ -124,13 +126,10 @@
if(operation_pause){ if(operation_pause){
return; return;
} }
var u = navigator.userAgent;
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
if(is_weixin()){ if(is_weixin()){
return;
} else if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) { } else if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
appCmd('{\"type\":\"cmd_join_mondelay\"'); window.webkit.messageHandlers.appCmd.postMessage({type:'cmd_join_mondelay'});
} else if (/(Android)/i.test(navigator.userAgent)) { } else if (/(Android)/i.test(navigator.userAgent)) {
android.appCmd('{\"type\":\"cmd_join_mondelay\"}'); android.appCmd('{\"type\":\"cmd_join_mondelay\"}');
} else { } else {
@ -141,18 +140,16 @@
if(operation_pause){ if(operation_pause){
return; return;
} }
var u = navigator.userAgent;
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
if(is_weixin()){ if(is_weixin()){
return;
} else if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) { } else if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
appCmd('{\"type\":\"cmd_cancel_mondelay\"'); window.webkit.messageHandlers.appCmd.postMessage({type:'cmd_cancel_mondelay',cancel_waring:cancel_waring});
} else if (/(Android)/i.test(navigator.userAgent)) { } else if (/(Android)/i.test(navigator.userAgent)) {
android.appCmd('{\"type\":\"cmd_cancel_mondelay\"}'); android.appCmd('{\"type\":\"cmd_cancel_mondelay\"}');
} else { } else {
} }
}); });
}) })
</script> </script>

@ -338,6 +338,12 @@ margin-bottom: 10%;"/>
<i class="fa fa-users"></i> <span>余额增值活动</span> <i class="fa fa-users"></i> <span>余额增值活动</span>
</a> </a>
</li> </li>
<li ui-sref-active="active" ng-if="('1000000000000'|withRole)">
<a ui-sref="contract">
<i class="fa fa-money"></i> <span>合同签约情况</span>
</a>
</li>
<li class="header nav-header" ng-if="('1000000000000'|withRole)">机构|Agent</li> <li class="header nav-header" ng-if="('1000000000000'|withRole)">机构|Agent</li>
<li ui-sref-active="active" ng-if="('1000000000000'|withRole)"> <li ui-sref-active="active" ng-if="('1000000000000'|withRole)">
<a ui-sref="analysis_agent" ui-sref-opts="{reload:true}"> <a ui-sref="analysis_agent" ui-sref-opts="{reload:true}">
@ -417,7 +423,6 @@ margin-bottom: 10%;"/>
<i class="fa fa-file-text-o"></i> <span>网站管理|Site Manage</span> <i class="fa fa-file-text-o"></i> <span>网站管理|Site Manage</span>
</a> </a>
</li> </li>
<li ui-sref-active="active" ng-if="('10'|withRole)||('1000000'|withRole)||('10000000'|withRole)"> <li ui-sref-active="active" ng-if="('10'|withRole)||('1000000'|withRole)||('10000000'|withRole)">
<a href="https://customer.royalpay.com.au/manage/sign_in" target="_blank"> <a href="https://customer.royalpay.com.au/manage/sign_in" target="_blank">
<i class="fa fa-file-text-o"></i> <span>积分商城|Integral Mall</span> <i class="fa fa-file-text-o"></i> <span>积分商城|Integral Mall</span>

@ -36,7 +36,7 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
$scope.act = {}; $scope.act = {};
$scope.act.act_id = act.act_id; $scope.act.act_id = act.act_id;
$scope.act.is_valid = !act.is_valid; $scope.act.is_valid = !act.is_valid;
$http.put('/manager/app/act/' + $scope.act.act_id, $scope.act).then(function (resp) { $http.put('/manager/app/act/published/'+$scope.act.act_id, $scope.act.is_valid).then(function (resp) {
commonDialog.alert({title: 'Success', content: '修改成功', type: 'success'}); commonDialog.alert({title: 'Success', content: '修改成功', type: 'success'});
$scope.loadActAppList(1); $scope.loadActAppList(1);
}, function (resp) { }, function (resp) {
@ -65,7 +65,13 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
if ($scope.actDetail.expire_date) { if ($scope.actDetail.expire_date) {
$scope.actDetail.expire_date = $filter('date')($scope.actDetail.expire_date, 'yyyy-MM-dd'); $scope.actDetail.expire_date = $filter('date')($scope.actDetail.expire_date, 'yyyy-MM-dd');
} }
$http.put('/manager/app/act/new', $scope.actDetail).then(function (resp) { if ($scope.actDetail.msg_start_date) {
$scope.actDetail.msg_start_date = $filter('date')($scope.actDetail.msg_start_date, 'yyyy-MM-dd');
}
if ($scope.actDetail.msg_end_date) {
$scope.actDetail.msg_end_date = $filter('date')($scope.actDetail.msg_end_date, 'yyyy-MM-dd');
}
$http.put('/manager/app/act', $scope.actDetail).then(function (resp) {
commonDialog.alert({title: 'Success', content: '新增成功', type: 'success'}); commonDialog.alert({title: 'Success', content: '新增成功', type: 'success'});
$state.go('^.detail',{act_id:resp.data.act_id},{reload:true}); $state.go('^.detail',{act_id:resp.data.act_id},{reload:true});
}, function (resp) { }, function (resp) {
@ -78,6 +84,12 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
$scope.ctrl = {dateInput: false}; $scope.ctrl = {dateInput: false};
$scope.actDetail.active_date = new Date($scope.actDetail.active_date); $scope.actDetail.active_date = new Date($scope.actDetail.active_date);
$scope.actDetail.expire_date = new Date($scope.actDetail.expire_date); $scope.actDetail.expire_date = new Date($scope.actDetail.expire_date);
if($scope.actDetail.msg_start_date){
$scope.actDetail.msg_start_date = new Date($scope.actDetail.msg_start_date);
}
if($scope.actDetail.msg_end_date){
$scope.actDetail.msg_end_date = new Date($scope.actDetail.msg_end_date);
}
$scope.submit = function () { $scope.submit = function () {
if ($scope.actDetail.active_date) { if ($scope.actDetail.active_date) {
$scope.actDetail.active_date = $filter('date')($scope.actDetail.active_date, 'yyyy-MM-dd'); $scope.actDetail.active_date = $filter('date')($scope.actDetail.active_date, 'yyyy-MM-dd');
@ -85,6 +97,12 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
if ($scope.actDetail.expire_date) { if ($scope.actDetail.expire_date) {
$scope.actDetail.expire_date = $filter('date')($scope.actDetail.expire_date, 'yyyy-MM-dd'); $scope.actDetail.expire_date = $filter('date')($scope.actDetail.expire_date, 'yyyy-MM-dd');
} }
if ($scope.actDetail.msg_start_date) {
$scope.actDetail.msg_start_date = $filter('date')($scope.actDetail.msg_start_date, 'yyyy-MM-dd');
}
if ($scope.actDetail.msg_end_date) {
$scope.actDetail.msg_end_date = $filter('date')($scope.actDetail.msg_end_date, 'yyyy-MM-dd');
}
$http.put('/manager/app/act/' + $scope.actDetail.act_id, $scope.actDetail).then(function (resp) { $http.put('/manager/app/act/' + $scope.actDetail.act_id, $scope.actDetail).then(function (resp) {
commonDialog.alert({title: 'Success', content: '修改成功', type: 'success'}); commonDialog.alert({title: 'Success', content: '修改成功', type: 'success'});
$state.reload(); $state.reload();

@ -3,9 +3,9 @@
<h1>APP_ACTIVITY</h1> <h1>APP_ACTIVITY</h1>
<ol class="breadcrumb"> <ol class="breadcrumb">
<li> <li>
<i class="fa fa-sitemap"></i> 网站管理 <i class="fa fa-sitemap" ui-sref="appAct"> 活动管理</i>
</li> </li>
<li class="active">Category - APP_ACTIVITY</li> <li class="active">活动详情</li>
</ol> </ol>
</section> </section>
<div class="content"> <div class="content">
@ -44,8 +44,7 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-xs-4 col-sm-2" <label class="control-label col-xs-4 col-sm-2">Activity Time*</label>
for="actDetail.act_name">Activity Time*</label>
<div class="col-xs-8 col-sm-4"> <div class="col-xs-8 col-sm-4">
<div style="display: inline-block" ng-class="{'has-error':appActForm.active_date.$invalid && appActForm.active_date.$dirty}"> <div style="display: inline-block" ng-class="{'has-error':appActForm.active_date.$invalid && appActForm.active_date.$dirty}">
<input class="form-control" id="date-from-input" <input class="form-control" id="date-from-input"
@ -108,6 +107,36 @@
ng-model="actDetail.banner_img"> ng-model="actDetail.banner_img">
</div> </div>
</div> </div>
<div class="form-group">
<label class="control-label col-xs-4 col-sm-2">Msg Date</label>
<div class="col-xs-8 col-sm-4">
<div style="display: inline-block">
<input class="form-control" id="date-from-input2"
ng-model="actDetail.msg_start_date"
uib-datepicker-popup size="10" placeholder="Start Date"
is-open="dateStart.open" ng-click="dateStart.open=true"
name="msg_start_date">
</div>
~
<div style="display: inline-block">
<input class="form-control" id="date-to-input2" ng-model="actDetail.msg_end_date"
uib-datepicker-popup size="10" placeholder="End Date"
is-open="dateEnd.open" ng-click="dateEnd.open=true"
name="msg_end_date">
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-4 col-sm-2" for="actDetail.act_img">Msg Interval</label>
<div class="col-xs-8 col-sm-4">
<div class="input-group">
<input type="number" class="form-control" id="actDetail.msg_interval"
ng-model="actDetail.msg_interval" aria-describedby="interval_h">
<span class="input-group-addon" id="interval_h">H</span>
</div>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-xs-4 col-sm-2">Show <label class="control-label col-xs-4 col-sm-2">Show

@ -3,9 +3,9 @@
<h1>APP_ACTIVITY</h1> <h1>APP_ACTIVITY</h1>
<ol class="breadcrumb"> <ol class="breadcrumb">
<li> <li>
<i class="fa fa-sitemap"></i> 网站管理 <i class="fa fa-sitemap">活动管理</i>
</li> </li>
<li class="active">Category - APP_ACTIVITY</li> <li class="active">APP_ACTIVITY</li>
</ol> </ol>
</section> </section>
@ -49,8 +49,8 @@
<tr ng-repeat="act in app_acts"> <tr ng-repeat="act in app_acts">
<td ng-bind="act.act_name"></td> <td ng-bind="act.act_name"></td>
<td ng-bind="act.create_time"></td> <td ng-bind="act.create_time"></td>
<td ng-bind="act.active_date"></td> <td ng-bind="act.active_date | limitTo:10""></td>
<td ng-bind="act.expire_date"></td> <td ng-bind="act.expire_date | limitTo:10""></td>
<td> <td>
<span ng-click="publishedOrIsValid(act)"> <span ng-click="publishedOrIsValid(act)">
<i class="text-success fa fa-check" ng-if="act.is_valid"></i> <i class="text-success fa fa-check" ng-if="act.is_valid"></i>

@ -220,6 +220,11 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct
}) })
}); });
}; };
$scope.manualSettle = function (manualSettle) {
$http.put('/client/partner_info/manual_settle?'+'manual_settle='+manualSettle).then(function (resp) {
})
};
$scope.getRates(); $scope.getRates();
}]); }]);
app.controller('clientSubPartnersCtrl', ['$scope', '$http', function ($scope, $http) { app.controller('clientSubPartnersCtrl', ['$scope', '$http', function ($scope, $http) {

@ -1,4 +1,11 @@
<div class="row"> <div class="row">
<div class="form-group" ng-if="([1]|withRole)">
<label class="col-sm-4">Manual Settle</label>
<div class="col-sm-6">
<input type="checkbox" ng-model="partner.manual_settle" bs-switch
switch-change="manualSettle(partner.manual_settle)">
</div>
</div>
<div class="col-sm-12"> <div class="col-sm-12">
<h3>Bank Account</h3> <h3>Bank Account</h3>
<div class="form-horizontal"> <div class="form-horizontal">

@ -0,0 +1,54 @@
/**
* Created by yishuqian on 01/06/2017.
*/
define(['angular'], function (angular) {
'use strict';
var app = angular.module('contractApp', ['ui.router']);
app.config(['$stateProvider', function ($stateProvider) {
$stateProvider.state('contract', {
url: '/contract',
templateUrl: '/static/sys/templates/contract_sign.html',
controller: 'contractAnalysisCtrl'
}).state('rate_warnings', {
url: '/rate_warnings',
templateUrl: '/static/analysis/templates/settle_warnings.html',
controller: 'settleWarningsCtrl'
})
}]);
app.controller('contractAnalysisCtrl', ['$scope', '$http', '$state', '$filter', 'commonDialog', function ($scope, $http, $state, $filter, commonDialog) {
$scope.getContractAnalysis = function () {
$http.get('/manage/contract/list').then(function (resp) {
$scope.contract_analysis = resp.data;
});
};
$scope.getContractAnalysis();
}]);
app.controller('settleWarningsCtrl', ['$scope', '$http', '$filter', 'commonDialog', function ($scope, $http, $filter, commonDialog) {
$scope.loadWarnings = function () {
$http.get('/manage/clearing/rate_warnings').then(function (resp) {
$scope.warning = resp.data;
})
};
$scope.loadWarnings();
$scope.generateRate = function (client) {
commonDialog.confirm({title: 'Confirm Required', content: '根据上季度总交易额自动计算下周期费率,确定执行?'}).then(function () {
$http.put('/manage/clearing/clients/' + client.client_moniker + '/auto_rate').then(function (resp) {
var content = 'New Rate value=' + resp.data.rate_value + '; expiry_time=' + $filter('date')(resp.data.expiry_time, 'dd/MMM/yyyy');
commonDialog.alert({
type: 'success',
title: 'New Rate Generated',
content: content
}).then(function () {
$scope.loadWarnings();
});
}, function (resp) {
commonDialog.alert({type: 'error', title: 'Error', content: resp.data.message});
})
})
}
}]);
return app;
});

@ -0,0 +1,35 @@
<div class="modal-header">Contract</div>
<ul class="nav nav-tabs">
<li ui-sref-active-eq="active" class="active">
<a ui-sref="contract">Contract</a>
</li>
<li ui-sref-active="active">
<a ui-sref="rate_warnings">Rate Warings</a>
</li>
</ul>
<div class="modal-body">
<div class="box box-danger">
<div class="box-header">商户合同情况</div>
<div class="box-body table-responsive">
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>Client Moniker</th>
<th>Create Time</th>
<th>Confirm Time</th>
<th>Account Name</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="contract in contract_analysis">
<td ng-bind="contract.client_moniker"></td>
<td ng-bind="contract.create_time|date:'dd/MMM/yyyy'"></td>
<td ng-bind="contract.confirm_time|date:'dd/MMM/yyyy'"></td>
<td ng-bind="contract.display_name"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>

@ -0,0 +1,23 @@
package au.com.royalpay.payment.manage.valid;
/**
* Create by yixian at 2018-03-21 10:36
*/
import au.com.royalpay.payment.tools.locale.LocaleSupport;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
@SpringBootTest
@ActiveProfiles({ "local", "alipay", "wechat", "jd", "bestpay" })
@RunWith(SpringRunner.class)
public class TestI18N {
@Test
public void test(){
System.out.println("------------------------"+ LocaleSupport.localeMessage("manual_settle.notice"));
}
}
Loading…
Cancel
Save