Merge branch 'develop'

# Conflicts:
#	pom.xml
master
luoyang 5 years ago
commit 31dcb12e8c

@ -9,7 +9,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId>
<version>1.3.5</version>
<version>1.3.6</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>1.4.0</jib-maven-plugin.version>

@ -57,6 +57,8 @@ public interface RetailAppService {
void sendTransactionDailyMessage(JSONObject tradeInfo, int clientId);
void sendRServicesApplyMessage(JSONObject applyInfo, JSONObject client);
void updateReadStatus(JSONObject device, String noticeId);
JSONObject getDevTokenByDevId(String devId);

@ -11,4 +11,6 @@ public interface RetailRSvcService {
* @return
*/
JSONObject findMchInfoBySourceCode(JSONObject device, String sourceCode);
JSONObject enterIntoServiceBySourceCode(String sourceCode, JSONObject params);
}

@ -79,7 +79,6 @@ import org.apache.commons.lang3.RandomUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.joda.time.DateTime;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.slf4j.LoggerFactory;
@ -1389,6 +1388,51 @@ public class RetailAppServiceImp implements RetailAppService {
}
}
@Override
public void sendRServicesApplyMessage(JSONObject applyInfo, JSONObject client) {
String amount = applyInfo.getBigDecimal("amount").setScale(2, RoundingMode.HALF_DOWN).toString();
String title = applyInfo.getString("title");
String remark = title + "已扣款成功!" + ",$" + amount + ".感谢您的使用,如有疑问或需帮助请拨打我们的客服电话1300 107 750或添加RoyalPay官方客服号:royalpay_1详询.";
String operatorTime = DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss");
logger.debug("sendRServicesMessage-{}-{} {}({}}-{}})",
client.getString("client_moniker"),
PlatformEnvironment.getEnv().getForeignCurrency(),
amount,
title,
operatorTime);
List<JSONObject> tokens = clientDeviceTokenMapper.listTokensByClient_id(client.getIntValue("client_id"));
for (JSONObject devToken : tokens) {
String token = devToken.getString("token");
if (token == null) {
continue;
}
JSONObject log = saveAppMessageLog(devToken.getString("dev_id"), devToken.getIntValue("client_id"), "notice", token,remark);
try {
JSONObject type = new JSONObject();
type.put("send_type", "notice");
type.put("id", applyInfo.getString("apply_id"));
AppMsgSender sender = senderMap.get(devToken.getString("client_type"));
if (sender == null) {
return;
}
JSONObject managerMsg = new JSONObject();
managerMsg.put("title", LocaleSupport.localeMessage("app.message.title.notice"));
managerMsg.put("body", LocaleSupport.localeMessage("app.message.rservices.body", title, amount));
managerMsg.put("type", type);
managerMsg.put("data", type);
managerMsg.put("msgType", "notice");
AppMessage appMessage = new AppManagerMessageBuilder(managerMsg).buildMessage();
sender.sendMessage(appMessage, devToken);
log.put("status", 2);
appMessageLogMapper.update(log);
} catch (Exception e) {
logger.error("出错了:", e);
appMessageLogMapper.updateStatus(log.getString("send_id"), 1, e.getMessage());
throw new ServerErrorException("Send App " + devToken.getString("client_type") + " Failed", e);
}
}
}
@Override
public void updateReadStatus(JSONObject device, String noticeId) {
String clientType = device.getString("client_type");

@ -1,7 +1,9 @@
package au.com.royalpay.payment.manage.appclient.core.impls;
import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
import au.com.royalpay.payment.manage.appclient.beans.RSvcMchBean;
import au.com.royalpay.payment.manage.appclient.core.RetailRSvcService;
import au.com.royalpay.payment.manage.mappers.system.ClientServicesApplyMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.tools.codec.AESCrypt;
import au.com.royalpay.payment.tools.device.DeviceSupport;
@ -20,6 +22,8 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.nio.charset.StandardCharsets;
import java.security.Key;
import java.util.Date;
import java.util.UUID;
@Service
public class RetailRSvcServiceImpl implements RetailRSvcService {
@ -31,6 +35,8 @@ public class RetailRSvcServiceImpl implements RetailRSvcService {
private DeviceSupport deviceSupport;
@Resource
private CommonIncrementalChannelMapper commonIncrementalChannelMapper;
@Resource
private ClientServicesApplyMapper clientServicesApplyMapper;
@Override
public JSONObject findMchInfoBySourceCode(JSONObject device, String sourceCode) {
@ -49,7 +55,6 @@ public class RetailRSvcServiceImpl implements RetailRSvcService {
result.put("enc_data", new JSONObject() {
{
put("credentialCode", encData(svcMchBean.getCredentialCode(), key, svcInfo.getString("channel_pub_key")));
put("payHost", encData(svcMchBean.getPayHost(), key, svcInfo.getString("channel_pub_key")));
put("partnerCode", encData(svcMchBean.getPartnerCode(), key, svcInfo.getString("channel_pub_key")));
put("merchantNumber", encData(svcMchBean.getMerchantNumber(), key, svcInfo.getString("channel_pub_key")));
@ -67,8 +72,56 @@ public class RetailRSvcServiceImpl implements RetailRSvcService {
return result;
}
@Override
public JSONObject enterIntoServiceBySourceCode(String sourceCode, JSONObject params) {
JSONObject result = new JSONObject();
JSONObject svcInfo = commonIncrementalChannelMapper.findIncreamentalChannelBySourceCode(sourceCode);
try {
if (svcInfo == null || StringUtils.isEmpty(svcInfo.getString("channel_pub_key"))
|| StringUtils.isEmpty(svcInfo.getString("platform_pub_key")) || StringUtils.isEmpty("platform_pri_key")) {
throw new BadRequestException("this channel config is wrong");
}
String signa = params.getString("sign");
params.remove(signa);
params = JSONObject.parseObject(JSON.toJSONString(params), Feature.OrderedField);
boolean checkSign = SignUtils.validSign(params.toJSONString(), signa, svcInfo.getString("channel_pub_key"));
if (!checkSign) {
throw new BadRequestException("sign is wrong");
}
JSONObject client = clientManager.getClientInfoByMoniker(params.getString("signClient"));
if (client == null) {
throw new InvalidShortIdException();
}
String aesKeyStr = Base64.encodeBase64String(AESCrypt.randomKey().getEncoded());
Key key = AESCrypt.fromKeyString(Base64.decodeBase64(aesKeyStr));
JSONObject serviceApply = new JSONObject();
serviceApply.put("apply_id", UUID.randomUUID().toString());
serviceApply.put("service_code", sourceCode);
serviceApply.put("client_id", client.getIntValue("client_id"));
serviceApply.put("title", params.getString("signData"));
serviceApply.put("amount", decData(params.getString("signPrice"), key, svcInfo.getString("platform_pri_key")));
serviceApply.put("apply_username", params.getString("signName"));
serviceApply.put("status", 0);
serviceApply.put("is_valid", 1);
serviceApply.put("create_time", new Date());
clientServicesApplyMapper.save(serviceApply);
result.put("result_code", "SUCCESS");
result.put("result_status", "PROCESSING");
} catch (Exception e) {
result.put("result_code", "SUCCESS");
result.put("result_status", "SYSTEMERROR");
result.put("result_msg", e.getMessage());
}
return result;
}
private String encData(String data, Key key, String publicKey) {
String pubKeyEncData = SignUtils.encData(data, publicKey);
return org.apache.commons.codec.binary.Base64.encodeBase64String(AESCrypt.encrypt(pubKeyEncData.getBytes(StandardCharsets.UTF_8), key));
}
private String decData(String data, Key key, String privateKey) {
String priKeyDecData = SignUtils.decData(data, privateKey);
return org.apache.commons.codec.binary.Base64.encodeBase64String(AESCrypt.encrypt(priKeyDecData.getBytes(StandardCharsets.UTF_8), key));
}
}

@ -4,10 +4,7 @@ import au.com.royalpay.payment.manage.appclient.core.RetailRSvcService;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.device.advise.AppClientController;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@ -23,4 +20,9 @@ public class RetailRSvcController {
return retailRSvcService.findMchInfoBySourceCode(device, source_code);
}
@PostMapping(value = "/{source_code}/enterService")
public JSONObject enterIntoServiceBySourceCode(@PathVariable String source_code, @RequestBody JSONObject params) {
return retailRSvcService.enterIntoServiceBySourceCode(source_code, params);
}
}

@ -5,7 +5,6 @@ import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
import au.com.royalpay.payment.core.tasksupport.SettlementSupport;
import au.com.royalpay.payment.manage.management.clearing.core.CleanService;
import au.com.royalpay.payment.manage.mappers.log.*;
import au.com.royalpay.payment.manage.mappers.payment.SysClientIncrementalMapper;
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.*;
@ -135,9 +134,9 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
@Resource
private ClearingDistributedSurchargeMapper clearingDistributedSurchargeMapper;
@Resource
private SysClientIncrementalMapper sysClientIncrementalMapper;
@Resource
private Locker locker;
@Resource
private ClientIncrementalMapper clientIncrementalMapper;
@Resource
private ClientDeviceMapper clientDeviceMapper;
@ -733,7 +732,7 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
new PageBounds(Order.formString("order_id.asc")));
for (JSONObject transaction : transactions) {
transaction.put("rate_value",StringUtils.defaultString(sysClientIncrementalMapper.findByChannelAndClientId(transaction.getString("client_id"),transaction.getString("source")) ,"0"));
transaction.put("rate_value",StringUtils.defaultString(clientIncrementalMapper.findByChannelAndClientId(transaction.getIntValue("client_id"),transaction.getString("source")) ,"0"));
}
String timezone_client = client.getString("timezone");
if (timezone_client != null) {

@ -1,25 +0,0 @@
package au.com.royalpay.payment.manage.mappers.payment;
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 org.apache.ibatis.annotations.Select;
import java.util.List;
/**
* Created by liuxinxin on 2019-11-12.
*/
@AutoMapper(tablename = "sys_client_incremental", pkName = "incremental_id")
public interface SysClientIncrementalMapper {
@Select("SELECT incremental_rate_value FROM sys_client_incremental WHERE channel = #{channel} AND client_id = #{client_id} ")
String findByChannelAndClientId(@Param("client_id") String clientId,@Param("channel") String channel);
@AutoSql(type = SqlType.SELECT)
List<JSONObject> find(@Param("client_id") String clientId);
}

@ -1,13 +1,12 @@
package au.com.royalpay.payment.manage.mappers.system;
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 org.apache.ibatis.annotations.Select;
import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
@ -34,4 +33,14 @@ public interface ClientIncrementalMapper {
@AutoSql(type = SqlType.UPDATE)
void update(JSONObject saveIncrementalService);
@Select("SELECT incremental_rate_value FROM sys_client_incremental WHERE channel = #{channel} AND client_id = #{client_id} ")
String findByChannelAndClientId(@Param("client_id") int clientId,@Param("channel") String channel);
@AutoSql(type = SqlType.SELECT)
List<JSONObject> find(@Param("client_id") int clientId);
@AutoSql(type = SqlType.SELECT)
JSONObject findBySourceCodeAndClientId(@Param("client_id") int clientId, @Param("source_code") String sourceCode);
}

@ -0,0 +1,32 @@
package au.com.royalpay.payment.manage.mappers.system;
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 com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.ibatis.annotations.Param;
/**
* Created by yishuqian on 06/03/2017.
*/
@AutoMapper(tablename = "sys_client_services_apply", pkName = "apply_id")
public interface ClientServicesApplyMapper {
@AutoSql(type = SqlType.INSERT)
void save(JSONObject partner);
@AutoSql(type = SqlType.UPDATE)
void update(JSONObject partner);
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "is_valid = 1")
JSONObject findApplyByApplyId(@Param("apply_id") String applyId);
@AutoSql(type = SqlType.SELECT)
JSONObject findApplyByClientId(@Param("client_id") int clientId);
PageList<JSONObject> listServicesApply(JSONObject params, PageBounds pageBounds);
}

@ -0,0 +1,70 @@
package au.com.royalpay.payment.manage.rservices.bean;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
/**
* Created by yixian on 2016-07-01.
*/
public class RServicesApplyQuery {
private int limit = 10;
private int page = 1;
private String clientMoniker;
private String serviceName;
private String status;
public JSONObject toJson(){
JSONObject json = new JSONObject();
if(StringUtils.isNotEmpty(clientMoniker)){
json.put("client_moniker",clientMoniker);
}
if(StringUtils.isNotEmpty(serviceName)){
json.put("service_name",serviceName);
}
if(StringUtils.isNotEmpty(status)){
json.put("status",status);
}
return json;
}
public int getLimit() {
return limit;
}
public void setLimit(int limit) {
this.limit = limit;
}
public int getPage() {
return page;
}
public void setPage(int page) {
this.page = page;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getClientMoniker() {
return clientMoniker;
}
public void setClientMoniker(String clientMoniker) {
this.clientMoniker = clientMoniker;
}
public String getServiceName() {
return serviceName;
}
public void setServiceName(String serviceName) {
this.serviceName = serviceName;
}
}

@ -0,0 +1,13 @@
package au.com.royalpay.payment.manage.rservices.core;
import au.com.royalpay.payment.manage.rservices.bean.RServicesApplyQuery;
import com.alibaba.fastjson.JSONObject;
public interface RServicesApplyService {
JSONObject getServicesApply(RServicesApplyQuery applyQuery);
void passServicesApply(String applyId, JSONObject manager);
void refuseServicesApply(String applyId, JSONObject manager);
}

@ -0,0 +1,207 @@
package au.com.royalpay.payment.manage.rservices.core.impl;
import au.com.royalpay.payment.core.TransactionService;
import au.com.royalpay.payment.manage.appclient.core.RetailAppService;
import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientIncrementalMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientServicesApplyMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.notice.core.MailService;
import au.com.royalpay.payment.manage.rservices.bean.RServicesApplyQuery;
import au.com.royalpay.payment.manage.rservices.core.RServicesApplyService;
import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi;
import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider;
import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage;
import au.com.royalpay.payment.tools.env.PlatformEnvironment;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.exceptions.ServerErrorException;
import au.com.royalpay.payment.tools.lock.Locker;
import au.com.royalpay.payment.tools.mappers.CommonIncrementalChannelMapper;
import au.com.royalpay.payment.tools.threadpool.RoyalThreadPoolExecutor;
import au.com.royalpay.payment.tools.utils.PageListUtils;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.Order;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.thymeleaf.context.Context;
import org.thymeleaf.spring5.SpringTemplateEngine;
import javax.annotation.Resource;
import java.util.Date;
import java.util.UUID;
@Service
public class RServicesApplyServiceImpl implements RServicesApplyService {
private Logger logger = LoggerFactory.getLogger(getClass());
@Resource
private MpWechatApiProvider mpWechatApiProvider;
@Resource
private ClientAccountMapper clientAccountMapper;
@Resource
private ClientManager clientManager;
@Resource
private ClientServicesApplyMapper clientServicesApplyMapper;
@Resource
private TransactionService transactionService;
@Resource
private RetailAppService retailAppService;
@Resource
private Locker locker;
@Resource
private RoyalThreadPoolExecutor royalThreadPoolExecutor;
@Resource
private SpringTemplateEngine thymeleaf;
@Resource
private CommonIncrementalChannelMapper commonIncrementalChannelMapper;
@Resource
private MailService mailService;
@Resource
private ClientIncrementalMapper clientIncrementalMapper;
@Override
public JSONObject getServicesApply(RServicesApplyQuery applyQuery) {
JSONObject params = applyQuery.toJson();
PageList<JSONObject> apply = clientServicesApplyMapper.listServicesApply(params, new PageBounds(applyQuery.getPage(), applyQuery.getLimit(), Order.formString("create_time.desc")));
return PageListUtils.buildPageListResult(apply);
}
@Override
public void passServicesApply(String applyId, JSONObject manager) {
JSONObject applyInfo = clientServicesApplyMapper.findApplyByApplyId(applyId);
if (applyInfo == null) {
throw new BadRequestException("签约服务申请不存在");
}
String lockKey = applyInfo.getIntValue("client_id") + "_processing_RServices_" + applyInfo.getString("service_code");
if (!locker.lock(lockKey, 120_000)) {
throw new ServerErrorException("Processing task, wait for a moment");
}
try {
applyInfo.put("operator", manager.getString("manager_id"));
applyInfo.put("operator_time", new Date());
applyInfo.put("status", 1);
clientServicesApplyMapper.update(applyInfo);
JSONObject clientServices = clientIncrementalMapper.findBySourceCodeAndClientId(applyInfo.getIntValue("client_id"), applyInfo.getString("service_code"));
JSONObject increment = commonIncrementalChannelMapper.findIncreamentalChannelBySourceCode(applyInfo.getString("service_code"));
if (clientServices == null) {
clientServices = new JSONObject();
clientServices.put("incremental_id", UUID.randomUUID().toString());
clientServices.put("client_id", applyInfo.getIntValue("client_id"));
clientServices.put("channel", increment.getIntValue("channel"));
clientServices.put("incremental_mode", 2);
clientServices.put("incremental_rate_value", 0);
clientServices.put("total_incremental_amount", applyInfo.getBigDecimal("amount"));
clientServices.put("create_time", applyInfo.getDate("create_time"));
clientServices.put("update_time", applyInfo.getDate("operator_time"));
clientServices.put("operator", applyInfo.getString("operator"));
clientServices.put("is_valid", 1);
clientIncrementalMapper.save(clientServices);
}else {
clientServices.put("incremental_mode", 2);
clientServices.put("incremental_rate_value", 0);
clientServices.put("total_incremental_amount", applyInfo.getBigDecimal("amount"));
clientServices.put("create_time", applyInfo.getDate("create_time"));
clientServices.put("update_time", applyInfo.getDate("operator_time"));
clientServices.put("operator", applyInfo.getString("operator"));
clientServices.put("is_valid", 1);
clientIncrementalMapper.update(clientServices);
}
afterPassProcessingApply(applyInfo);
} finally {
locker.unlock(lockKey);
}
}
@Override
public void refuseServicesApply(String applyId, JSONObject manager) {
JSONObject applyInfo = clientServicesApplyMapper.findApplyByApplyId(applyId);
if (applyInfo == null) {
throw new BadRequestException("签约服务申请不存在");
}
applyInfo.put("operator", manager.getString("manager_id"));
applyInfo.put("operator_time", new Date());
applyInfo.put("status", 2);
clientServicesApplyMapper.update(applyInfo);
}
private void afterPassProcessingApply(JSONObject applyInfo) {
JSONObject client = clientManager.getClientInfo(applyInfo.getIntValue("client_id"));
String orderId = "R-" + client.getString("client_moniker") + "-" + applyInfo.getString("service_code") + "-" + DateFormatUtils.format(new Date(), "yyyyMMddHHmmssSSS") + "-" + RandomStringUtils.random(3, true, false).toUpperCase();
JSONObject transaction = new JSONObject();
transaction.put("org_id", client.getIntValue("org_id"));
transaction.put("system_transaction_id", orderId);
transaction.put("order_id", orderId);
transaction.put("client_id", applyInfo.getIntValue("client_id"));
transaction.put("transaction_currency", PlatformEnvironment.getEnv().getForeignCurrency());
transaction.put("transaction_amount", applyInfo.getBigDecimal("amount"));
transaction.put("clearing_currency", PlatformEnvironment.getEnv().getForeignCurrency());
transaction.put("clearing_amount", applyInfo.getBigDecimal("amount"));
transaction.put("exchange_rate", 1);
transaction.put("channel", "System");
transaction.put("transaction_type", "Debit");
transaction.put("transaction_time", new Date());
transaction.put("clearing_status", 0);
transaction.put("remark", applyInfo.getString("service_code") + ":" + applyInfo.getString("title"));
transaction.put("system_generate", 1);
transactionService.saveTransaction(transaction);
sendNotify(applyInfo, client);
}
private void sendNotify(JSONObject applyInfo, JSONObject client) {
try {
retailAppService.sendRServicesApplyMessage(applyInfo, client);
} catch (Exception e) {
logger.error("R-services-{}付费成功app推送发送失败 - {}",client.getIntValue("client_id"), e);
}
JSONObject increment = commonIncrementalChannelMapper.findIncreamentalChannelBySourceCode(applyInfo.getString("service_code"));
JSONObject account = clientAccountMapper.findByUsernameForDuplicate(applyInfo.getString("apply_username"));
if (increment == null || account == null) {
return;
}
if (StringUtils.isNotBlank(account.getString("contact_email"))) {
Context ctx = new Context();
ctx.setVariable("img_url", PlatformEnvironment.getEnv().concatUrl("/static/images/royalpay_logo.png"));
ctx.setVariable("name", account.getString("display_name"));
ctx.setVariable("service_name", increment.getString("channel"));
ctx.setVariable("title", applyInfo.getString("title"));
ctx.setVariable("currency", "AUD");
ctx.setVariable("amount", applyInfo.getBigDecimal("amount").toPlainString());
ctx.setVariable("create_time", DateFormatUtils.format(applyInfo.getDate("create_time"),"yyyy-MM-dd HH:mm:ss"));
final String content = thymeleaf.process("mail/rservices_email_notice", ctx);
royalThreadPoolExecutor.execute(() -> {
try {
mailService.sendEmail("[RoyalPay]" + increment.getString("channel") + "付费成功通知", account.getString("contact_email"), "", content);
} catch (Exception e) {
logger.error("R-services-{}付费成功邮件发送失败 - {}",client.getIntValue("client_id"),account.getString("contact_email"), e);
}
});
}
if (StringUtils.isNotBlank(account.getString("wechat_openid"))) {
try {
MpWechatApi mpWechatApi = mpWechatApiProvider.getApiFromOpenId(account.getString("wechat_openid"));
if (mpWechatApi == null) {
return;
}
String templateId = mpWechatApi.getTemplateId("payment-success-cashier");
if (templateId == null) {
return;
}
TemplateMessage message = new TemplateMessage(account.getString("wechat_openid"), templateId, null);
message.put("first", "[RoyalPay]" + increment.getString("channel") + "付费成功通知", "#ff0000");
message.put("keyword1", applyInfo.getString("title"), "#0000ff");
message.put("keyword2", "支付金额: $" + applyInfo.getString("amount"), "#000000");
message.put("keyword3", "签约时间" + DateFormatUtils.format(applyInfo.getDate("create_time"),"yyyy-MM-dd HH:mm:ss"), "#000000");
message.put("keyword4", "申请人:" + account.getString("display_name"), "#000000");
message.put("remark", "感谢您的使用,如有疑问或需帮助,请拨打我们的客服电话:1300 107 750或添加RoyalPay官方客服号:royalpay_1详询.", "#ff0000");
mpWechatApi.sendTemplateMessage(message);
} catch (Exception e) {
logger.error("R-services-{}付费成功微信模版发送失败 - {}",client.getIntValue("client_id"),account.getString("wechat_openid"), e);
}
}
}
}

@ -0,0 +1,36 @@
package au.com.royalpay.payment.manage.rservices.web;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.rservices.bean.RServicesApplyQuery;
import au.com.royalpay.payment.manage.rservices.core.RServicesApplyService;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@RestController
@RequestMapping(value = "/sys/rservices")
public class RServicesApplyController {
@Resource
private RServicesApplyService rServicesApplyService;
@ManagerMapping(value = "/apply", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF, ManagerRole.DIRECTOR})
@GetMapping(value = "/apply")
public JSONObject getServicesApply(RServicesApplyQuery applyQuery) {
return rServicesApplyService.getServicesApply(applyQuery);
}
@ManagerMapping(value = "/apply/{applyId}/pass", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR})
public void passServicesApply(@PathVariable String applyId, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
rServicesApplyService.passServicesApply(applyId, manager);
}
@ManagerMapping(value = "/apply/{applyId}/refuse", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR})
public void refuseServicesApply(@PathVariable String applyId, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
rServicesApplyService.refuseServicesApply(applyId, manager);
}
}

@ -109,7 +109,7 @@ public class TradeLogServiceImpl implements TradeLogService {
@Resource
private ManagerCustomerRelationAlipayMapper managerCustomerRelationAlipayMapper;
@Resource
private SysClientIncrementalMapper sysClientIncrementalMapper;
private ClientIncrementalMapper clientIncrementalMapper;
@Resource
private ClientCustomersMapper clientCustomersMapper;
@Resource
@ -251,7 +251,7 @@ public class TradeLogServiceImpl implements TradeLogService {
}
PageList<JSONObject> logs = orderMapper.listIncrementalOrders(params, new PageBounds(query.getPage(), query.getLimit(), Order.formString("create_time.desc")));
for (JSONObject log : logs) {
log.put("rate_value",sysClientIncrementalMapper.findByChannelAndClientId(log.getString("client_id"),log.getString("source")));
log.put("rate_value",clientIncrementalMapper.findByChannelAndClientId(log.getIntValue("client_id"),log.getString("source")));
}
JSONObject result = PageListUtils.buildPageListResult(logs);
JSONObject analysis = orderMapper.analysisOrders(params);

@ -0,0 +1,22 @@
<?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.ClientServicesApplyMapper">
<select id="listServicesApply" resultType="com.alibaba.fastjson.JSONObject">
SELECT c.client_moniker,c.short_name,c.bd_user_name,c.approve_result,c.approve_time,c.open_status,
c.source as client_source,a.*,inc.channel
FROM sys_client_services_apply a
INNER JOIN sys_clients c on c.client_id = a.client_id and c.is_valid = 1
INNER JOIN sys_incremental_channels inc on a.service_code = inc.source_code and inc.is_valid = 1
<where>
<if test="client_moniker!=null">
and c.client_moniker = #{client_moniker}
</if>
<if test="service_name!=null">
and inc.service_code = #{service_name}
</if>
<if test="status!=null">
and a.status = #{status}
</if>
</where>
</select>
</mapper>

@ -97,6 +97,7 @@ app.message.body.clean=Today's clearing has been completed,settlement count is
app.message.title.daily_notice=Daily Transaction Report
app.message.title.annual_bill=Royal Pay thanks for your company in 2018
app.message.body.annual_bill=Come and check your annual bill
app.message.rservices.body={0}has been successfully payment!,${0}.Thank you for your use. If you have any questions or issues related to this adjustment, please dont hesitate to call 1300 107 750 or email info@royalpay.com.au.
app.label.pay=Pay

@ -93,6 +93,7 @@ app.message.body.clean=您今日的清算已完成,共
app.message.title.daily_notice=每日交易汇总提醒
app.message.title.annual_bill=2018年RoyalPay感谢有你
app.message.body.annual_bill=快来查收你的年度账单
app.message.rservices.body={0}已付款成功!,${0}.感谢您的使用,如有疑问或需帮助请拨打我们的客服电话1300 107 750或添加RoyalPay官方客服号:royalpay_1详询.
app.label.pay=支付
app.label.remark=备注

@ -0,0 +1,33 @@
<html xmlns:th="http://www.thymeleaf.org" lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
</head>
<body>
<div style="width: 91%;border: 1px #F2F2F2 solid;margin: 0 auto; ">
<div style="height: 3%;background-color: #F2F2F2;"></div>
<div style="text-align: center;margin-top: 2.5%;">
<img th:src="${img_url}"/>
</div>
<div style="width: 80.3%;margin: 0 auto;">
<p>您好,<span th:text="${name}"></span></p>
<p>您申请的<span th:text="${service_name}"></span>已付费成功:</p>
<div style="border: 1px #EAEAEA solid;margin-bottom: 5.5%;font-size: 12px;">
<p style="margin-left: 3%;">RoyalPay<span th:text="${service_name}"></span>付费成功通知:</p>
<ul>
<li style="margin-bottom: 6px;">签约内容:<span style="color: #EE6723;" th:text="${title}"></span><</li>
<li style="margin-bottom: 6px;">支付金额:<span style="color: #EE6723;" th:text="${currency}"></span>&nbsp;<span style="color: #EE6723;" th:text="${amount}"></span></li>
<li style="margin-bottom: 6px;">签约时间:<span style="color: #EE6723;" th:text="${create_time}"></span></li>
<li style="margin-bottom: 6px;">申请人:<span style="color: #EE6723;" th:text="${name}"></span></li>
</ul>
</div>
<span>RoyalPay客服与技术支持在此期间将竭诚为您服务如有疑问或需帮助请拨打我们的客服电话1300 107 750或添加RoyalPay官方客服号royalpay_1详询。</span><br />
<span>此致</span><br />
<span>RoyalPay</span>
</div>
<div style="height: 3%;background-color: #F2F2F2;margin-top: 6.5%;"></div>
</div>
</body>
</html>

@ -482,6 +482,11 @@ margin-bottom: 10%;"/>
<i class="fa fa-balance-scale"></i> <span>合规文件审核</span>
</a>
</li>
<li ui-sref-active="active">
<a ui-sref="r_services_apply" ui-sref-opts="{reload:true}">
<i class="fa fa-balance-scale"></i> <span>R-Services签约付费申请</span>
</a>
</li>
<li ui-sref-active="active">
<a ui-sref="contract">
<i class="fa fa-money"></i> <span>合同签约情况</span>

@ -87,4 +87,4 @@ require(['angular', 'jquery'], function (angular, $) {
angular.bootstrap(document.body, moduleNames)
})
}
});
});

@ -84,7 +84,7 @@
<img src="/static/images/royalpay_sign_s.png"
uib-tooltip="RoyalPay" ng-if="record.source=='system'"/>
<img src="/static/images/yangmaimai_sign.png"
uib-tooltip="R跨境商城" ng-if="record.source=='R跨境商城'"/>
uib-tooltip="RP跨境商城" ng-if="record.source=='RP跨境商城'"/>
{{record.order_id}}
</td>
<td ng-bind="record.cashback_amount|currency:'AUD '"></td>
@ -122,4 +122,4 @@
</div>
</div>
</div>
</div>
</div>

@ -118,7 +118,7 @@
</div>
</div>
<!-- 未开通服务展示 -->
<div class="col-md-3 col-sm-3 col-xs-12" ng-if="channel.name=='R跨境商城'" ng-repeat=" channel in channelOptions">
<div class="col-md-3 col-sm-3 col-xs-12" ng-if="channel.name=='RP跨境商城'" ng-repeat=" channel in channelOptions">
<div class="service-background">
<img class="row img_auto_height_width" ng-src="{{channel.logo_url}}">
<div class="row border-show">
@ -158,4 +158,4 @@
</div>
</div>
</div>
</div>
</div>

@ -139,8 +139,8 @@
ng-click="params.source='ALL';loadTradeLogs(1)">All</a> |
<a role="button" ng-class="{'bg-primary':params.source=='system'}"
ng-click="params.source='system';loadTradeLogs(1)">System</a> |
<a role="button" ng-class="{'bg-primary':params.source=='R跨境商城'}"
ng-click="params.source='R跨境商城';loadTradeLogs(1)">R跨境商城</a>
<a role="button" ng-class="{'bg-primary':params.source=='RP跨境商城'}"
ng-click="params.source='RP跨境商城';loadTradeLogs(1)">RP跨境商城</a>
</p>
</div>
</div>-->
@ -368,7 +368,7 @@
<img src="/static/images/clearing-icon.png" uib-tooltip="clearing" ng-if="trade.clearing_status=='1'"/>
<i class="fa fa-check-circle-o text-danger" uib-tooltip="Refund Audition Required" ng-if="trade.audition"></i>
<img src="/static/images/royalpay_sign_s.png" uib-tooltip="RoyalPay" ng-if="trade.source=='system'"/>
<img src="/static/images/yangmaimai_sign.png" uib-tooltip="R跨境商城" ng-if="trade.source=='R跨境商城'"/>
<img src="/static/images/yangmaimai_sign.png" uib-tooltip="RP跨境商城" ng-if="trade.source=='RP跨境商城'"/>
<img src="/static/images/wechatpay_sign.png" uib-tooltip="Znyoo" ng-if="trade.channel=='Znyoo'"/>
<img src="/static/images/wechatpay_sign.png" uib-tooltip="Wechat Pay" ng-if="trade.channel=='Wechat'"/>
<img src="/static/images/bestpay_sign.png" uib-tooltip="BestPay" alt="BestPay" ng-if="trade.channel=='Bestpay'"/>

@ -197,7 +197,7 @@
<img src="/static/images/royalpay_sign_s.png"
uib-tooltip="RoyalPay" ng-if="trade.source=='system'"/>
<img src="/static/images/yangmaimai_sign.png"
uib-tooltip="R跨境商城" ng-if="trade.source=='R跨境商城'"/>
uib-tooltip="RP跨境商城" ng-if="trade.source=='RP跨境商城'"/>
<img src="/static/images/wechatpay_sign.png"
uib-tooltip="Znyoo" ng-if="trade.channel=='Znyoo'"/>
<img src="/static/images/wechatpay_sign.png"

@ -416,6 +416,16 @@
</div>
</a>
</div>
<div class="col-sm-2 col-xs-6">
<a ui-sref="r_services_apply" ui-sref-opts="{reload:true}">
<div class="description-block">
<img src="/static/images/main_menu/transaction_arrears.png"/>
<div class="description-text">
<span>R-Services签约付费申请</span>
</div>
</div>
</a>
</div>
</div>
</div>
<div class="list-group" ng-if="(role=='salesmanager') || (role=='director')">

@ -325,7 +325,7 @@
<img src="/static/images/royalpay_sign_s.png"
uib-tooltip="RoyalPay" ng-if="trade.source=='system'"/>
<img src="/static/images/yangmaimai_sign.png"
uib-tooltip="R跨境商城" ng-if="trade.source=='R跨境商城'"/>
uib-tooltip="RP跨境商城" ng-if="trade.source=='RP跨境商城'"/>
<img src="/static/images/wechatpay_sign.png"
uib-tooltip="Znyoo" ng-if="trade.channel=='Znyoo'"/>
<img src="/static/images/wechatpay_sign.png"

@ -348,8 +348,8 @@
<th>Input Amount</th>
<th>System Rate</th>
<th>System Profit</th>
<th>R跨境商城 Rate</th>
<th>R跨境商城 Profit</th>
<th>RP跨境商城 Rate</th>
<th>RP跨境商城 Profit</th>
<th>Status</th>
<th>Create Time</th>
<th>Operation</th>
@ -366,7 +366,7 @@
<img src="/static/images/royalpay_sign_s.png"
uib-tooltip="RoyalPay" ng-if="trade.source=='system'"/>
<img src="/static/images/yangmaimai_sign.png"
uib-tooltip="R跨境商城" ng-if="trade.source=='R跨境商城'"/>
uib-tooltip="RP跨境商城" ng-if="trade.source=='RP跨境商城'"/>
<img src="/static/images/wechatpay_sign.png"
uib-tooltip="WechatPay" ng-if="trade.channel=='Wechat'"/>
<img src="/static/images/wechatpay_sign.png"

@ -101,8 +101,8 @@
ng-click="params.source='ALL';loadTradeLogs(1)">All</a> |
<a role="button" ng-class="{'bg-primary':params.source=='system'}"
ng-click="params.source='system';loadTradeLogs(1)">System</a> |
<a role="button" ng-class="{'bg-primary':params.source=='R跨境商城'}"
ng-click="params.source='R跨境商城';loadTradeLogs(1)">R跨境商城</a>
<a role="button" ng-class="{'bg-primary':params.source=='RP跨境商城'}"
ng-click="params.source='RP跨境商城';loadTradeLogs(1)">RP跨境商城</a>
</p>
</div>
</div>-->
@ -330,7 +330,7 @@
<img src="/static/images/clearing-icon.png" uib-tooltip="clearing" ng-if="trade.clearing_status=='1'"/>
<i class="fa fa-check-circle-o text-danger" uib-tooltip="Refund Audition Required" ng-if="trade.audition"></i>
<img src="/static/images/royalpay_sign_s.png" uib-tooltip="RoyalPay" ng-if="trade.source=='system'"/>
<img src="/static/images/yangmaimai_sign.png" uib-tooltip="R跨境商城" ng-if="trade.source=='R跨境商城'"/>
<img src="/static/images/yangmaimai_sign.png" uib-tooltip="RP跨境商城" ng-if="trade.source=='RP跨境商城'"/>
<img src="/static/images/wechatpay_sign.png" uib-tooltip="Znyoo" ng-if="trade.channel=='Znyoo'"/>
<img src="/static/images/wechatpay_sign.png" uib-tooltip="Wechat Pay" ng-if="trade.channel=='Wechat'"/>
<img src="/static/images/bestpay_sign.png" uib-tooltip="BestPay" alt="BestPay" ng-if="trade.channel=='Bestpay'"/>

@ -177,7 +177,7 @@
<tr ng-repeat="tr in report.report|propsFilter:{transaction_type:'Credit',channel:ctrl.channel,transaction_time:ctrl.day}:true">
<td>
<img src="/static/images/royalpay_sign_s.png" uib-tooltip="RoyalPay" ng-if="tr.source=='system'"/>
<img src="/static/images/yangmaimai_sign.png" uib-tooltip="R跨境商城" ng-if="tr.source=='R跨境商城'"/>
<img src="/static/images/yangmaimai_sign.png" uib-tooltip="RP跨境商城" ng-if="tr.source=='RP跨境商城'"/>
<img class="channel-icon" ng-src="{{tr.channel|channel_image}}">{{tr.order_id}}
</td>
<td ng-bind="tr.transaction_time"></td>

@ -117,8 +117,8 @@
ng-click="params.source='ALL';loadTradeLogs(1)">All</a> |
<a role="button" ng-class="{'bg-primary':params.source=='system'}"
ng-click="params.source='system';loadTradeLogs(1)">System</a> |
<a role="button" ng-class="{'bg-primary':params.source=='R跨境商城'}"
ng-click="params.source='R跨境商城';loadTradeLogs(1)">R跨境商城</a>
<a role="button" ng-class="{'bg-primary':params.source=='RP跨境商城'}"
ng-click="params.source='RP跨境商城';loadTradeLogs(1)">RP跨境商城</a>
</p>
</div>
</div>
@ -431,7 +431,7 @@
<img src="/static/images/clearing-icon.png" uib-tooltip="clearing" ng-if="trade.clearing_status=='1'"/>
<i class="fa fa-check-circle-o text-danger" uib-tooltip="Refund Audition Required" ng-if="trade.audition"></i>
<img src="/static/images/royalpay_sign_s.png" uib-tooltip="RoyalPay" ng-if="trade.source=='system'"/>
<img src="/static/images/yangmaimai_sign.png" uib-tooltip="R跨境商城" ng-if="trade.source=='R跨境商城'"/>
<img src="/static/images/yangmaimai_sign.png" uib-tooltip="RP跨境商城" ng-if="trade.source=='RP跨境商城'"/>
<img src="/static/images/wechatpay_sign.png" uib-tooltip="Znyoo" ng-if="trade.channel=='Znyoo'"/>
<img src="/static/images/wechatpay_sign.png" uib-tooltip="Wechat Pay" ng-if="trade.channel=='Wechat'"/>
<img src="/static/images/bestpay_sign.png" uib-tooltip="BestPay" alt="BestPay" ng-if="trade.channel=='Bestpay'"/>

@ -150,8 +150,8 @@
ng-click="params.source='ALL';loadTradeLogs(1)">All</a> |
<a role="button" ng-class="{'bg-primary':params.source=='system'}"
ng-click="params.source='system';loadTradeLogs(1)">System</a> |
<a role="button" ng-class="{'bg-primary':params.source=='R跨境商城'}"
ng-click="params.source='R跨境商城';loadTradeLogs(1)">R跨境商城</a>
<a role="button" ng-class="{'bg-primary':params.source=='RP跨境商城'}"
ng-click="params.source='RP跨境商城';loadTradeLogs(1)">RP跨境商城</a>
</p>
</div>
</div>
@ -465,7 +465,7 @@
<img src="/static/images/royalpay_sign_s.png"
uib-tooltip="RoyalPay" ng-if="trade.source=='system'"/>
<img src="/static/images/yangmaimai_sign.png"
uib-tooltip="R跨境商城" ng-if="trade.source=='R跨境商城'"/>
uib-tooltip="RP跨境商城" ng-if="trade.source=='RP跨境商城'"/>
<img src="/static/images/wechatpay_sign.png"
uib-tooltip="WechatPay" ng-if="trade.channel=='Wechat'"/>
<img src="/static/images/wechatpay_sign.png"

@ -326,7 +326,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
}]);
app.controller('globalIncrementalTradeLogCtrl', ['$scope', '$http', '$filter', 'commonDialog', 'refunder', 'orderService','$sce',
function ($scope, $http, $filter, commonDialog, refunder, orderService,$sce) {
$scope.params = {source: 'R跨境商城',status: 'PAID',channel:'ALL', textType: 'all', datefrom: new Date(), dateto: new Date(),org_name:'ALL'};
$scope.params = {source: 'RP跨境商城',status: 'PAID',channel:'ALL', textType: 'all', datefrom: new Date(), dateto: new Date(),org_name:'ALL'};
$scope.pagination = {};
$scope.today = new Date();

@ -113,7 +113,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.tradeLogs[i].htmlTooltip = $sce.trustAsHtml('<div style="width: 180px">' +
'<h5>手续费组成</h5>'+'<div style="background-color: #EFEFF5;height: 1px;margin-bottom: 10px;"></div>'+
'<p>system:'+ system_surcharge +'</p>' +
'<p>R跨境商城:'+ incremental_surcharge +'</p>' +
'<p>RP跨境商城:'+ incremental_surcharge +'</p>' +
'<p>tax amount:'+ tax_amount +'</p>' +
'</div>');
}
@ -326,7 +326,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
app.controller('IncrementalTradeLogCtrl', ['$scope', '$http', '$filter', '$timeout', 'partnerRefunder', 'orderService', 'commonDialog',
function ($scope, $http, $filter, $timeout, partnerRefunder, orderService, commonDialog) {
$scope.params = {source: 'R跨境商城',status: 'PAID', channel :'ALL' ,textType: 'all', datefrom: new Date(), dateto: new Date()};
$scope.params = {source: 'RP跨境商城',status: 'PAID', channel :'ALL' ,textType: 'all', datefrom: new Date(), dateto: new Date()};
$scope.pagination = {};
$scope.today = new Date();
$scope.isAll = true;

@ -0,0 +1,81 @@
/**
* Created by kira on 01/06/2017.
*/
define(['angular'], function (angular) {
'use strict';
var app = angular.module('RServicesApplyApp', ['ui.router']);
app.config(['$stateProvider', function ($stateProvider) {
$stateProvider.state('r_services_apply', {
url: '/r_services_apply',
templateUrl: '/static/rservicesapply/templates/r-services-apply.html',
controller: 'RServicesApplyCtrl'
});
}]);
app.controller('RServicesApplyCtrl', ['$scope', '$http', 'commonDialog', '$sce', '$state',
function ($scope, $http, commonDialog, $sce, $state) {
$scope.pagination = {};
$scope.params = {};
$scope.loadServicesApply = function (page) {
var params = angular.copy($scope.params);
params.page = page || $scope.pagination.page || 1;
$http.get('/sys/rservices/apply', {params: params}).then(function (resp) {
$scope.apply = resp.data;
$scope.pagination = resp.data.pagination;
});
};
$scope.loadServicesApply(1);
$scope.statusSelected = function (arr) {
return $scope.params.status != null && $scope.params.status.filter(function (status) {
return arr.indexOf(status) >= 0
}).length > 0
};
$scope.serviceTypeSelected = function (arr) {
return $scope.params.serviceName != null && $scope.params.serviceName.filter(function (status) {
return arr.indexOf(status) >= 0
}).length > 0
};
$scope.passApply = function (apply) {
var contentHtml = $sce.trustAsHtml(
'[<b><span style="color: red">' + apply.client_moniker + '</span></b>]即将签约[' +
'<b><span style="color: red">' + apply.channel + '</span></b>]服务<br>服务内容:[' +
'<b><span style="color: red">' + apply.title + '</span></b>]<br>需要扣款[' +
'<b><span style="color: red">AUD ' + apply.amount + '</span></b>]<br>申请人[' +
'<b><span style="color: red"> ' + apply.apply_username + '</span></b>]' +
'<br>请确认扣款信息是否正确'
);
commonDialog.confirm({
title: '请确认扣款信息',
contentHtml: contentHtml
}).then(function () {
$http.put('/sys/rservices/apply/'+ apply.apply_id +'/pass').then(function () {
commonDialog.alert({type: 'success', title: 'Success', content: '扣款成功!'});
$state.reload();
}, function (resp) {
commonDialog.alert({type: 'error', title: 'Error', content: resp.data.message});
})
})
};
$scope.refuseApply = function (apply) {
var contentHtml = $sce.trustAsHtml(
'[<b><span style="color: red">' + apply.client_moniker + '</span></b>]签约[' +
'<b><span style="color: red">' + apply.channel + '</span></b>]服务服务内容:[' +
'<b><span style="color: red">' + apply.title + '</span></b>]需要扣款[' +
'<b><span style="color: red">AUD ' + apply.amount + '</span></b>]申请人[' +
'<b><span style="color: red"> ' + apply.apply_username + '</span>]' +
'<br>请确认是否拒绝申请'
);
commonDialog.confirm({
title: '拒绝R-Services扣款申请',
contentHtml: contentHtml
}).then(function () {
$http.put('/sys/rservices/apply/'+ apply.apply_id +'/refuse').then(function () {
commonDialog.alert({type: 'success', title: 'Success', content: '拒绝成功!'});
$state.reload();
}, function (resp) {
commonDialog.alert({type: 'error', title: 'Error', content: resp.data.message});
})
})
};
}]);
return app;
});

@ -0,0 +1,145 @@
<section class="content-header">
<h1>R-Services服务扣费申请</h1>
<ol class="breadcrumb">
<li>
<i class="fa fa-sitemap"></i> Compliance Management
</li>
<li class="active">R-Services服务扣费申请</li>
</ol>
</section>
<div class="box box-warning" style="margin-top: 30px;">
<div class="box-header">
<div class="row">
<div class="col-sm-12">
<div class="form-horizontal">
<div class="form-group col-xs-12">
<label class="col-xs-4 col-sm-2 control-label">Partner Code</label>
<div class="col-sm-5 col-xs-8">
<input class="form-control" placeholder=""
ng-model="params.clientMoniker">
</div>
</div>
<div class="form-group col-xs-12">
<label class="control-label col-xs-4 col-sm-2">R-Services</label>
<div class="col-sm-10 col-xs-8">
<p class="form-control-static">
<a role="button" ng-class="{'bg-primary':params.serviceName==null}"
ng-click="params.serviceName=null;loadServicesApply(1)">All</a> |
<a role="button" ng-class="{'bg-primary':serviceTypeSelected(['RYCBSM'])}"
ng-click="params.serviceName=['RYCBSM'];loadServicesApply(1)">RP跨境商城</a>|
<a role="button" ng-class="{'bg-primary':serviceTypeSelected(['METECH'])}"
ng-click="params.serviceName=['METECH'];loadServicesApply(1)">Menu Technology</a>
</p>
</div>
</div>
<div class="form-group col-xs-12">
<label class="control-label col-xs-4 col-sm-2">审核状态:</label>
<div class="col-sm-10 col-xs-8">
<p class="form-control-static">
<a role="button" ng-class="{'bg-primary':params.status==null}"
ng-click="params.status=null;loadServicesApply(1)">All</a> |
<a role="button" ng-class="{'bg-primary':statusSelected([0])}"
ng-click="params.status=[0];loadServicesApply(1)">待审核</a>|
<a role="button" ng-class="{'bg-primary':statusSelected([1])}"
ng-click="params.status=[1];loadServicesApply(1)">通过</a>|
<a role="button" ng-class="{'bg-primary':statusSelected([2])}"
ng-click="params.status=[2];loadServicesApply(1)">打回</a>
</p>
</div>
</div>
<button class="btn btn-success" type="button" ng-click="loadServicesApply()">
<i class="fa fa-search"></i> Search
</button>
</div>
</div>
</div>
</div>
</div>
<div class="box box-danger">
<div class="modal-body">
<div class="box-body table-responsive">
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>Client Moniker</th>
<th>Short Name</th>
<th>Compliance Status</th>
<th>Service Name</th>
<th>Amount</th>
<th>Service Title</th>
<th>Status</th>
<th>Apply Username</th>
<th>Apply Time</th>
<th>Operation</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="apply in apply.data">
<td ng-bind="apply.client_moniker"></td>
<td ng-bind="apply.short_name"></td>
<td ng-class="{'bg-green':(apply.approve_result==2 && (apply.client_source==1 || apply.client_source==2)),'bg-red':((apply.open_status==1||apply.open_status==2||apply.open_status==4) && apply.approve_result!=3)||(apply.approve_result==3 && (!apply.open_status || apply.open_status==1 || apply.open_status == 4))||(apply.approve_result==4 && !apply.open_status)||(apply.open_status==10)}">
<span ng-if="apply.approve_result==1 && apply.approve_time">通过({{apply.approve_time}})</span>
<span ng-if="!apply.open_status && !apply.approve_result && apply.approve_result!=5 && apply.client_source!=4">资料完善中</span>
<span ng-if="!apply.open_status && !apply.approve_result && apply.approve_result!=5 && apply.client_source==4">(自助开通)资料完善中</span>
<span ng-if="!apply.open_status && apply.approve_result==2 && apply.approve_time">自助开通试用中({{apply.approve_time}}~{{apply.expiry_time}})</span>
<span ng-if="apply.approve_result==0 && apply.approve_time">不通过({{apply.approve_time}})</span>
<span ng-if="apply.approve_result==5 && apply.approve_time && apply.refuse_remark">申请打回({{apply.refuse_remark|limitTo:15}})</span>
<span ng-if="(apply.open_status==1||apply.open_status==4) && apply.approve_result!=3"><i
ng-if="apply.refuse_remark.length>0" class="fa fa-reply" aria-hidden="true"
title="被打回重新提交"></i>等待合规</span>
<span ng-if="apply.approve_result==3 && (!apply.open_status || apply.open_status==4)">自助开通(等待合规)</span>
<span ng-if="apply.open_status==2">合同制作完成</span>
<span ng-if="apply.open_status==3 && apply.approve_result!=5">等待BD上传材料审核</span>
<span ng-if="apply.open_status==10">绿色通道申请中</span>
<span ng-if="apply.approve_result==4 && !apply.open_status"><i
ng-if="apply.refuse_remark.length>0" class="fa fa-reply" aria-hidden="true"
title="被打回重新提交"></i>等待合规</span>
</td>
<td ng-bind="apply.channel"></td>
<td ng-bind="apply.amount|currency:'AUD'"></td>
<td ng-bind="apply.title"></td>
<td>
<span ng-if="apply.status==0">待审核</span>
<span ng-if="apply.status==1">通过</span>
<span ng-if="apply.status==2">打回</span>
</td>
<td ng-bind="apply.apply_username"></td>
<td ng-bind="apply.create_time|date:'dd/MMM/yyyy'"></td>
<td ng-if="apply.status==0 && ('01'|withRole)"><a class="text-primary" role="button" title="PASS" style="color:green" ng-click="passApply(apply)">
<i class="fa fa-check"></i> PASS
</a>|
<a class="text-primary" role="button" title="REFUSE" style="color: red" ng-click="refuseApply(apply)">
<i class="fa fa-times"></i> REFUSE
</a>
</td>
<td ng-if="apply.status!=0">
<span ng-if="apply.status==1">通过({{apply.operator_time}})</span>
<span ng-if="apply.status==2">打回({{apply.operator_time}})</span>
</td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
<uib-pagination ng-if="apply.data.length"
class="pagination"
total-items="pagination.totalCount"
boundary-links="true"
ng-model="pagination.page"
items-per-page="pagination.limit"
max-size="10"
ng-change="loadServicesApply()"
previous-text="&lsaquo;"
next-text="&rsaquo;"
first-text="&laquo;"
last-text="&raquo;"></uib-pagination>
<div class="col-xs-12">Total Records:{{pagination.totalCount}};Total Pages:{{pagination.totalPages}}</div>
</div>
</div>
</div>
Loading…
Cancel
Save