Merge branch 'develop' into shopify

master
ycfxx 3 years ago
commit 7eb95451bc

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -5,16 +5,17 @@
<parent>
<groupId>au.com.royalpay.payment</groupId>
<artifactId>payment-parent</artifactId>
<version>2.3.2</version>
<version>2.3.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId>
<version>2.4.1</version>
<version>2.4.5</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>2.4.0</jib-maven-plugin.version>
<yixsoft-batis.version>1.0.12</yixsoft-batis.version>
<mysql.version>8.0.20</mysql.version>
<image.version>${project.version}</image.version>
</properties>
<dependencies>
@ -299,41 +300,6 @@
</plugins>
</build>
</profile>
<profile>
<id>dev</id>
<build>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>${jib-maven-plugin.version}</version>
<configuration>
<from>
<image>192.168.0.84:5000/royalpay/openjdk:11.0.8</image>
</from>
<to>
<image>hkccr.ccs.tencentyun.com/cross-payment-dev/manage-dev:${project.version}
</image>
</to>
<extraDirectories>
<paths>
<path>extra/</path>
</paths>
</extraDirectories>
<allowInsecureRegistries>true</allowInsecureRegistries>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>prod</id>
<build>
@ -347,7 +313,7 @@
<image>192.168.0.84:5000/royalpay/openjdk:11.0.8</image>
</from>
<to>
<image>hkccr.ccs.tencentyun.com/rpay/manage:${project.version}</image>
<image>hkccr.ccs.tencentyun.com/rpay/manage:${image.version}</image>
</to>
<extraDirectories>
<paths>

@ -152,11 +152,23 @@ tags:
description: |
用于移动端APP调用微信/支付宝SDK支付调用API创建订单得到微信SDK调用参数将参数传递给SDK拉起微信/支付宝支付,并由客户端直接返回支付结果。 强烈建议获得支付结果后再调用RoyalPay订单查询API确认完成支付后再进行后续流程避免因超时自动撤单导致资金损失
<img src="img/sdk_wechat_api_payment_cn.png">
关于客户端和支付宝整和的更多信息:[支付宝SDK文档](https://global.alipay.com/doc/app_cn/about)
关于客户端和微信整合的更多信息:[微信SDK文档](https://pay.weixin.qq.com/wiki/doc/api/app/app.php?chapter=11_1)
[Alipay SDK for Android](resources/api/alipaySdk-20160825.jar)
[Alipay SDK for iOS](resources/api/AlipaySDKForiOS.zip)
关于客户端和支付宝整和的更多信息:
[支付宝SDK文档](https://global.alipay.com/doc/app_cn/about)
[Alipay+接入文档](/resources/api/AlipayPlusAppIntegrationGuide.pdf)
关于客户端和微信整合的更多信息:
[微信SDK文档](https://pay.weixin.qq.com/wiki/doc/api/app/app.php?chapter=11_1)
[Alipay SDK for Android](/resources/api/alipaySdk-20160825.jar)
[Alipay SDK for iOS](/resources/api/AlipaySDKForiOS.zip)
[Wechat SDK for Android](https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1419319167&token=&lang=zh_CN)
[Wechat SDK for iOS](https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1419319164&lang=zh_CN)
- name: Custom

@ -160,11 +160,22 @@ tags:
Used for mobile Apps calling Wechat payment with Wechat/Alipay SDK.
Call this api to create order and get param string for SDK calling. Call SDK api with the param to start payment and get payment result from Wechat app *It is strongly advised to request RoyalPay order query Api to confirm that the order has been paid in order to cancelling order by system at the same time.*
<img src="img/sdk_wechat_api_payment_en.png">
More information for integration with Alipay: [Alipay SDK Document](https://global.alipay.com/doc/app/intro)
More information for integration with Wechat: [Wechat SDK Document](https://pay.weixin.qq.com/wiki/doc/api/app/app.php?chapter=11_1)
[Alipay SDK for Android](resources/api/alipaySdk-20160825.jar)
[Alipay SDK for iOS](resources/api/AlipaySDKForiOS.zip)
More information for integration with Alipay:
[Alipay SDK Document](https://global.alipay.com/doc/app/intro)
[Alipay+ SDK Document](/resources/api/AlipayPlusAppIntegrationGuide.pdf)
More information for integration with Wechat:
[Wechat SDK Document](https://pay.weixin.qq.com/wiki/doc/api/app/app.php?chapter=11_1)
[Alipay SDK for Android](/resources/api/alipaySdk-20160825.jar)
[Alipay SDK for iOS](/resources/api/AlipaySDKForiOS.zip)
[Wechat SDK for Android](https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1419319167&token=&lang=zh_CN)
[Wechat SDK for iOS](https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1419319164&lang=zh_CN)
- name: Custom

@ -6,15 +6,18 @@ import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import java.util.Date;
import java.util.List;
public interface ApsNoticeClientRepository {
void saveApsNoticeClient(ApsNoticeClient apsNoticeClient);
void updateApsNoticeClient(ApsNoticeClient apsNoticeClient);
PageList<JSONObject> getApsNoticeClients(String id, PageBounds pageBounds);
PageList<JSONObject> getApsNoticeClients(String id, String clientStatus, PageBounds pageBounds);
void updateApsNoticeClientByPartnerCode(Date modifyTime, String modifier, String partnerCode);
ApsNoticeClient getApsNoticeClientById(String id);
List<ApsNoticeClient> apsNoticeClients(String id, String clientStatus);
}

@ -4,6 +4,11 @@ import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public interface ApsNoticeClientsService {
PageList<JSONObject> getApsNoticeClients(String id, PageBounds pageBounds);
PageList<JSONObject> getApsNoticeClients(String id, String clientStatus, PageBounds pageBounds);
void exportApsNoticeClients(String id, String clientStatus, HttpServletRequest request, HttpServletResponse response);
}

@ -1,16 +1,36 @@
package au.com.royalpay.payment.manage.apsKYC.domain.service.Impl;
import au.com.royalpay.payment.manage.apsKYC.domain.entity.ApsNotice;
import au.com.royalpay.payment.manage.apsKYC.domain.entity.ApsNoticeClient;
import au.com.royalpay.payment.manage.apsKYC.domain.repository.ApsNoticeClientRepository;
import au.com.royalpay.payment.manage.apsKYC.domain.service.ApsNoticeClientsService;
import au.com.royalpay.payment.manage.mappers.apskyc.ApsNoticeMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.mappers.system.ManagerMapper;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.xssf.usermodel.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Service
public class ApsNoticeClientsServiceImpl implements ApsNoticeClientsService {
@ -20,12 +40,18 @@ public class ApsNoticeClientsServiceImpl implements ApsNoticeClientsService {
@Autowired
private ManagerMapper managerMapper;
@Autowired
private ClientMapper clientMapper;
@Autowired
private ClientAccountMapper clientAccountMapper;
@Autowired
private ApsNoticeMapper apsNoticeMapper;
@Override
public PageList<JSONObject> getApsNoticeClients(String id, PageBounds pageBounds) {
PageList<JSONObject> apsNoticeClients = apsNoticeClientRepository.getApsNoticeClients(id, pageBounds);
public PageList<JSONObject> getApsNoticeClients(String id, String clientStatus, PageBounds pageBounds) {
PageList<JSONObject> apsNoticeClients = apsNoticeClientRepository.getApsNoticeClients(id, clientStatus, pageBounds);
for (JSONObject apsNoticeClient : apsNoticeClients) {
if (apsNoticeClient.containsKey("modifier") && StringUtils.isNotBlank(apsNoticeClient.getString("modifier"))) {
JSONObject modifier = managerMapper.findDetail(apsNoticeClient.getString("modifier"));
@ -43,7 +69,181 @@ public class ApsNoticeClientsServiceImpl implements ApsNoticeClientsService {
}
}
}
JSONObject clinet = clientMapper.findClientByMoniker(apsNoticeClient.getString("partner_code"));
if (clinet != null && clinet.containsKey("bd_user_name") && StringUtils.isNotBlank(clinet.getString("bd_user_name"))) {
apsNoticeClient.put("bd_name", clinet.getString("bd_user_name"));
}
}
return apsNoticeClients;
}
@Override
public void exportApsNoticeClients(String id, String clientStatus, HttpServletRequest request, HttpServletResponse response) {
List<ApsNoticeClient> apsNoticeClients = apsNoticeClientRepository.apsNoticeClients(id, clientStatus);
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
OutputStream os = null;
XSSFWorkbook xWorkbook = null;
try {
ApsNotice apsNotice = apsNoticeMapper.getApsNoticesById(id);
String fileName = apsNotice.getTitle() + "(" + df.format(new Date()) + ").xlsx";
fileName = new String(fileName.getBytes("gbk"), "iso8859-1");
os = response.getOutputStream();
response.reset();
response.setHeader("Content-disposition", "attachment; filename = " + fileName);
response.setContentType("application/octet-streem");
//创建表格工作空间
xWorkbook = new XSSFWorkbook();
//创建一个新表格
XSSFSheet xSheet = xWorkbook.createSheet("商户列表");
//set Sheet页头部
setSheetHeader(xWorkbook, xSheet);
//set Sheet页内容
setSheetContent(xWorkbook, xSheet, apsNoticeClients);
xWorkbook.write(os);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (null != os) {
try {
os.close();
} catch (Exception e) {
e.printStackTrace();
}
}
if (null != xWorkbook) {
try {
xWorkbook.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
private void setSheetContent(XSSFWorkbook xWorkbook, XSSFSheet xSheet, List<ApsNoticeClient> apsNoticeClients) {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//创建内容样式(头部以下的样式)
CellStyle cs = xWorkbook.createCellStyle();
cs.setWrapText(true);
//设置水平垂直居中
cs.setAlignment(CellStyle.ALIGN_CENTER);
cs.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
if (null != apsNoticeClients && apsNoticeClients.size() > 0) {
for (int i = 0; i < apsNoticeClients.size(); i++) {
XSSFRow xRow = xSheet.createRow(i + 1);
//设置第一列
XSSFCell xCell0 = xRow.createCell(0);
xCell0.setCellStyle(cs);
xCell0.setCellValue(apsNoticeClients.get(i).getPartnerCode());
//设置第二列
XSSFCell xCell1 = xRow.createCell(1);
xCell1.setCellStyle(cs);
JSONObject clinet = clientMapper.findClientByMoniker(apsNoticeClients.get(i).getPartnerCode());
if (clinet != null && clinet.containsKey("bd_user_name") && StringUtils.isNotBlank(clinet.getString("bd_user_name"))) {
xCell1.setCellValue(clinet.getString("bd_user_name"));
} else {
xCell1.setCellValue("未配置BD");
}
//设置第三列
XSSFCell xCell2 = xRow.createCell(2);
xCell2.setCellStyle(cs);
xCell2.setCellValue(apsNoticeClients.get(i).getStatus());
String userName = "未知";
if (StringUtils.isNotBlank(apsNoticeClients.get(i).getUserId())) {
if (!apsNoticeClients.get(i).getUserId().equals("0")) {
JSONObject user = clientAccountMapper.findDetail(apsNoticeClients.get(i).getUserId());
if (user != null) {
userName = user.getString("username");
}
}
}
switch (apsNoticeClients.get(i).getStatus()) {
case 0: {
xCell2.setCellValue("未读");
break;
}
case 1: {
xCell2.setCellValue("已读(" + userName + ":" + df.format(apsNoticeClients.get(i).getReadTime()) + ")");
break;
}
case 2: {
xCell2.setCellValue("同意(" + userName + ":" + df.format(apsNoticeClients.get(i).getStatusTime()) + ")");
break;
}
case 3: {
xCell2.setCellValue("拒绝(" + userName + ":" + df.format(apsNoticeClients.get(i).getStatusTime()) + ")");
break;
}
}
//设置第四列
XSSFCell xCell3 = xRow.createCell(3);
xCell3.setCellStyle(cs);
switch (apsNoticeClients.get(i).getHandle()) {
case 0: {
xCell3.setCellValue("未处理");
break;
}
case 1: {
if (StringUtils.isNotBlank(apsNoticeClients.get(i).getModifier())) {
JSONObject modifier = managerMapper.findDetail(apsNoticeClients.get(i).getModifier());
if (modifier != null) {
xCell3.setCellValue("已处理(" + modifier.getString("username") + ":" + df.format(apsNoticeClients.get(i).getModifyTime()) + ")");
} else {
xCell3.setCellValue("已处理(未知用户:" + df.format(apsNoticeClients.get(i).getModifyTime()) + ")");
}
}
break;
}
}
}
}
}
private void setSheetHeader(XSSFWorkbook xWorkbook, XSSFSheet xSheet) {
//设置表格的宽度 xSheet.setColumnWidth(0, 20 * 256); 中的数字 20 自行设置为自己适用的
xSheet.setColumnWidth(0, 10 * 256);
xSheet.setColumnWidth(1, 25 * 256);
xSheet.setColumnWidth(2, 40 * 256);
xSheet.setColumnWidth(3, 40 * 256);
//创建表格的样式
CellStyle cs = xWorkbook.createCellStyle();
//设置水平、垂直居中
cs.setAlignment(CellStyle.ALIGN_CENTER);
cs.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
//设置字体
Font headerFont = xWorkbook.createFont();
headerFont.setFontHeightInPoints((short) 12);
/*headerFont.setBoldweight(XSSFFont.BOLDWEIGHT_BOLD);*/
headerFont.setBoldweight(XSSFFont.BOLDWEIGHT_BOLD);
headerFont.setFontName("宋体");
cs.setFont(headerFont);
cs.setWrapText(true);//是否自动换行
//创建一行
XSSFRow xRow0 = xSheet.createRow(0);
//设置每一列
XSSFCell xCell0 = xRow0.createCell(0);
xCell0.setCellStyle(cs);
xCell0.setCellValue("商户名称");
XSSFCell xCell1 = xRow0.createCell(1);
xCell1.setCellStyle(cs);
xCell1.setCellValue("所属BD");
XSSFCell xCell2 = xRow0.createCell(2);
xCell2.setCellStyle(cs);
xCell2.setCellValue("商户操作状态");
XSSFCell xCell3 = xRow0.createCell(3);
xCell3.setCellStyle(cs);
xCell3.setCellValue("运营操作状态");
}
}

@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.util.Date;
import java.util.List;
@Repository
public class ApsNoticeClientRepositoryImpl implements ApsNoticeClientRepository {
@ -28,8 +29,8 @@ public class ApsNoticeClientRepositoryImpl implements ApsNoticeClientRepository
}
@Override
public PageList<JSONObject> getApsNoticeClients(String id, PageBounds pageBounds) {
return mapper.getApsNoticeClients(id, pageBounds);
public PageList<JSONObject> getApsNoticeClients(String id, String clientStatus, PageBounds pageBounds) {
return mapper.getApsNoticeClients(id, clientStatus, pageBounds);
}
@Override
@ -41,4 +42,9 @@ public class ApsNoticeClientRepositoryImpl implements ApsNoticeClientRepository
public ApsNoticeClient getApsNoticeClientById(String id) {
return mapper.getApsNoticeClientById(id);
}
@Override
public List<ApsNoticeClient> apsNoticeClients(String id, String clientStatus) {
return mapper.apsNoticeClients(id, clientStatus);
}
}

@ -15,6 +15,8 @@ import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@RestController
@RequestMapping(value = "/aps/kyc")
@ -74,9 +76,9 @@ public class RestApsKYCController {
@ManagerMapping(value = "/notice/clients", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.SALES_MANAGER})
public JSONObject getApsNoticeClients(@RequestParam(value = "page", defaultValue = "1") int page,
@RequestParam(value = "pageSize", defaultValue = "20") int pageSize,
@RequestParam String id) {
@RequestParam String id, @RequestParam(required = false) String clientStatus) {
PageBounds pageBounds = new PageBounds(page, pageSize);
PageList<JSONObject> apply = apsNoticeClientsService.getApsNoticeClients(id, pageBounds);
PageList<JSONObject> apply = apsNoticeClientsService.getApsNoticeClients(id, clientStatus, pageBounds);
return PageListUtils.buildPageListResult(apply);
}
@ -101,4 +103,15 @@ public class RestApsKYCController {
public void updateApsNoticeClient(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody ApsNoticeClient apsNoticeClient) {
apsNoticeService.updateApsNoticeClient(manager, apsNoticeClient);
}
/**
*
*
* @param id
* @param clientStatus
*/
@ManagerMapping(value = "/notice/clients/excel", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.SALES_MANAGER})
public void exportApsNoticeClients(@RequestParam String id, @RequestParam(required = false) String clientStatus, HttpServletRequest request, HttpServletResponse response) throws Exception {
apsNoticeClientsService.exportApsNoticeClients(id, clientStatus, request, response);
}
}

@ -10,6 +10,7 @@ import com.yixsoft.support.mybatis.autosql.annotations.SqlType;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
@AutoMapper(tablename = "sys_aps_notice_clients", pkName = "id")
public interface ApsNoticeClientMapper {
@ -20,7 +21,7 @@ public interface ApsNoticeClientMapper {
@AutoSql(SqlType.UPDATE)
void updateApsNoticeClient(ApsNoticeClient apsNoticeClient);
PageList<JSONObject> getApsNoticeClients(String id, PageBounds pageBounds);
PageList<JSONObject> getApsNoticeClients(String id,String clientStatus, PageBounds pageBounds);
void updateApsNoticeClientByPartnerCode(@Param("modify_time") Date modifyTime, @Param("modifier") String modifier, @Param("partner_code") String partnerCode);
@ -31,4 +32,6 @@ public interface ApsNoticeClientMapper {
@AutoSql(SqlType.UPDATE)
void toUpdateApsKycClient(JSONObject updateReadTime);
List<ApsNoticeClient> apsNoticeClients(String id, String clientStatus);
}

@ -32,6 +32,8 @@ public interface OrderMapper {
PageList<JSONObject> listIncrementalOrders(JSONObject params, PageBounds pagination);
PageList<JSONObject> listIncrementalOrdersNew(JSONObject params, PageBounds pagination);
List<JSONObject> listOrdersNoPage(JSONObject params);
PageList<JSONObject> listOrdersByClients(JSONObject params, PageBounds pagination);

@ -32,6 +32,8 @@ import au.com.royalpay.payment.core.beans.MerchantApplicationResult;
import au.com.royalpay.payment.core.exceptions.EmailException;
import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
import au.com.royalpay.payment.core.impls.MerchantChannelApplicationManager;
import au.com.royalpay.payment.core.mappers.MchChannelContractDAO;
import au.com.royalpay.payment.core.mappers.MchChannelContractMapper;
import au.com.royalpay.payment.core.mappers.SysClientMapper;
import au.com.royalpay.payment.core.utils.OrderExpiryRuleResolver;
import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper;
@ -87,6 +89,7 @@ import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage
import au.com.royalpay.payment.tools.connections.mpsupport.exceptions.WechatException;
import au.com.royalpay.payment.tools.defines.IncrementalChannel;
import au.com.royalpay.payment.tools.defines.PayChannel;
import au.com.royalpay.payment.tools.defines.TradeType;
import au.com.royalpay.payment.tools.env.PlatformEnvironment;
import au.com.royalpay.payment.tools.env.SysConfigManager;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
@ -331,7 +334,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
private ApsNoticeClientMapper apsNoticeClientMapper;
DateTimeFormatter formatter = DateTimeFormat.forPattern("dd MMM yyyy");
@Resource
private MchChannelContractMapper mchChannelContractMapper;
@Resource
private SmsSender smsSender;
@ -555,6 +559,29 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
client.put("enable_alipayplus", true);
}
client.put("enable_alipayaps", false);
Map<String, JSONObject> channelPermissions = new HashMap<>();
for (PaymentChannelApi channelApi : paymentApi.channels()) {
try {
MchChannelContract contract = channelApi.initContractSource().
findMchContract(client.getIntValue("client_id"), TradeType.CLIENT_CODE, PlatformEnvironment.getEnv().getForeignCurrencyEnum().toCurrencyInfo());
JSONObject config = new JSONObject();
config.put("channel", channelApi.channel());
if (contract != null) {
config.put("enable", contract.isValid());
config.put("pid", contract.getPid());
config.put("mid", contract.getMid());
config.put("mcc", contract.getMccCode());
} else {
config.put("enable", false);
//aps渠道的默认值展示
config.put("mid", client.getString("client_moniker"));
}
channelPermissions.put(channelApi.channel().toLowerCase(), config);
} catch (Exception e) {
logger.error(e.getMessage(), e);
}
}
client.put("available_channels", channelPermissions);
MerchantChannelPermissionResolver resolverApsInStore = this.paymentApi.channelApi(PayChannel.ALIPAY_APS_IN_STORE.getChannelCode()).getChannelPermissionResolver();
MerchantChannelPermissionResolver resolverApsCashier = this.paymentApi.channelApi(PayChannel.ALIPAY_APS_CASHIER.getChannelCode()).getChannelPermissionResolver();
if (!Objects.isNull(resolverApsInStore) && !Objects.isNull(resolverApsCashier) &&
@ -6141,7 +6168,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
JSONObject result = null;
JSONObject expireInfo = clientContractService.getClientContractExpire(client_id, channel);
JSONObject account = clientAccountMapper.findById(account_id);
if (PartnerRole.getRole(account.getIntValue("role")) == PartnerRole.CASHIER) {
if (account == null || PartnerRole.getRole(account.getIntValue("role")) == PartnerRole.CASHIER) {
return result;
} else {
if (expireInfo.getBooleanValue("alert")) {
@ -7150,13 +7177,22 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
client.put("isRetail", isRetail);
String pid = "";
if (isRetail) {
//todo 测试需要 先都改成线上,上线此处需要改成线下
pid = AlipayEnvironment.getEnv().getAlipayPlusApsRetailConfig().getPid();
} else {
pid = AlipayEnvironment.getEnv().getAlipayPlusApsOnlineConfig().getPid();
}
client.put("pid", pid);
List<MchChannelContractDAO> channelContractDAOS = mchChannelContractMapper.listByPidClientId(isRetail ? PayChannel.ALIPAY_APS_IN_STORE.getChannelCode() : PayChannel.ALIPAY_APS_CASHIER.getChannelCode(), pid, client.getInteger("client_id"));
MchChannelContractDAO mchChannelContractDAO = channelContractDAOS.stream().max(Comparator.comparing(MchChannelContractDAO::getCreateTime)).orElse(null);
String mid = client.getString("client_moniker");
//数据库有数据
if (mchChannelContractDAO != null && StringUtils.isNotEmpty(mchChannelContractDAO.getMid())) {
mid = mchChannelContractDAO.getMid();
} else {
mid = client.getString("client_moniker");
}
client.put("mid", mid);
AlipayApsMerchantRegister alipayApsMerchantRegister = Optional.ofNullable(merchantChannelApplicationManager.getRegister(AlipayApsMerchantRegister.class)).orElseThrow(() -> new ServerErrorException("No AlipayAps registry found"));
AlipayPlusRegisterResult alipayPlusRegisterResult = alipayApsMerchantRegister.findMerchant(client);
return alipayPlusRegisterResult.getRawResponse();

@ -33,6 +33,7 @@ import au.com.royalpay.payment.tools.utils.CurrencyAmountUtils;
import au.com.royalpay.payment.tools.utils.PageListUtils;
import au.com.royalpay.payment.tools.utils.TimeZoneUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.Order;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
@ -211,6 +212,12 @@ public class TradeLogServiceImpl implements TradeLogService {
add(query.getGatewayChild());
}});
}
JSONArray clientIds = clientManager.getAllClientIds(client.getIntValue("client_id"));
logger.info("====>clientIds:{}",clientIds.size());
if (clientIds.size() > 1) {
String[] arr = new String[clientIds.size()];
params.put("client_ids", clientIds.toArray(arr));
}
PageList<JSONObject> logs = orderMapper.listIncrementalOrdersByClients(params,
new PageBounds(query.getPage(), query.getLimit(), Order.formString("create_time.desc")));
if (timezone != null) {

@ -2,7 +2,7 @@ server:
port: 5555
spring:
profiles:
active: dev,alipay,bestpay,jd,wechat,rpay,yeepay,rppaysvc,common,alipayplusaps
active: dev,alipay,bestpay,jd,wechat,rpay,yeepay,rppaysvc,common,alipayplusaps,apsinstore,apscashier
mail:
host: ''
port: ''
@ -73,6 +73,7 @@ app:
control:
aes-key: Aa+MtthC4Ztq4Kfa9aL+UA==
run-tasks: false
aps-online-prefix: '00-'
server:
ip: 127.0.0.1
settle:

@ -14,6 +14,10 @@
SELECT *
FROM sys_aps_notice_clients
where notice_id = #{id}
<if test="clientStatus != null">
and `status` = #{clientStatus}
</if>
ORDER BY status_time DESC
</select>
<select id="getApsKycClient" resultType="com.alibaba.fastjson.JSONObject">
SELECT c.*,
@ -27,5 +31,14 @@
AND c.is_valid = 0
AND c.handle = 0
</select>
<select id="apsNoticeClients" resultType="au.com.royalpay.payment.manage.apsKYC.domain.entity.ApsNoticeClient">
SELECT *
FROM sys_aps_notice_clients
where notice_id = #{id}
<if test="clientStatus != null">
and `status` = #{clientStatus}
</if>
ORDER BY status_time DESC
</select>
</mapper>

@ -38,6 +38,41 @@
t.tax_amount,
t.surcharge_rate
</sql>
<sql id="tradelog_list_keys_2">
SELECT
o.order_id,
o.client_id,
o.total_amount,
o.display_amount,
o.customer_payment_amount,
o.coupon_payment_amount,
o.currency,
o.create_time,
o.confirm_time,
o.status,
o.order_description,
o.order_detail,
o.client_order_id,
o.gateway,
o.channel,
o.pay_type,
o.pre_authorization,
o.refund_amount refund_fee,
o.customer_id,
o.source,
sum(t.clearing_amount) clearing_amount,
t.refund_id,
t.transaction_time,
t.transaction_type,
t.transaction_id,
t.exchange_rate,
t.clearing_status,
t.settle_amount,
t.incremental_surcharge,
t.total_surcharge,
t.tax_amount,
t.surcharge_rate
</sql>
<sql id="gateway_keys">
SELECT
o.order_id order_id,
@ -107,6 +142,73 @@
t.settle_amount,
t.transaction_time
</sql>
<sql id="gateway_keys_2">
SELECT
o.order_id order_id,
format(o.total_amount * 100, 0) total_fee,
format(o.customer_payment_amount * 100, 0) real_fee,
o.currency,
o.channel,
o.create_time,
o.confirm_time pay_time,
o.pre_authorization,
o.source,
o.pay_type,
CASE o.status
WHEN 0
THEN 'SUBMITTING'
WHEN 1
THEN 'SUBMIT_FAIL'
WHEN 2
THEN 'WAITING_PAYMENT'
WHEN 3
THEN 'CLOSED'
WHEN 4
THEN 'PAYMENT_FAIL'
WHEN 5
THEN 'SUCCESS'
WHEN 6
THEN 'PARTIAL_REFUND'
WHEN 7
THEN 'FULL_REFUND'
END AS `status`,
o.order_description order_body,
o.client_order_id partner_order_id,
CASE o.gateway
WHEN 0
THEN 'Retail In-Store'
WHEN 1
THEN 'Retail In-Store'
WHEN 2
THEN 'QR Code'
WHEN 3
THEN 'Online API'
WHEN 4
THEN 'In-APP H5'
WHEN 5
THEN 'Retail API'
WHEN 6
THEN 'Retail API'
WHEN 7
THEN 'QR Code'
WHEN 8
THEN 'Mobile H5'
WHEN 9
THEN 'Third Party Gateway'
WHEN 10
THEN 'APP'
WHEN 12
THEN 'MICROAPP'
WHEN 13
THEN 'Native QR Code'
WHEN 14
THEN 'Share Link'
END AS gateway,
format(o.refund_amount * 100, 0) refund_fee,
t.clearing_status,
t.settle_amount,
t.transaction_time
</sql>
<update id="updateRefundAmount">
<![CDATA[
@ -439,6 +541,96 @@
</select>
<select id="listIncrementalOrdersNew" resultType="com.alibaba.fastjson.JSONObject">
<if test="gateway">
<include refid="gateway_keys_2"/>
</if>
<if test="!gateway">
<include refid="tradelog_list_keys_2"/>
</if>
,ifnull(sci.incremental_rate_value,0) as rate_value
FROM (
select oo.order_id,oo.client_id,oo.total_amount,oo.display_amount,
oo.customer_payment_amount,oo.coupon_payment_amount,oo.currency,
oo.create_time,oo.confirm_time,oo.status,oo.order_description,oo.order_detail,
oo.client_order_id,oo.gateway,oo.channel,oo.pre_authorization,oo.refund_amount,oo.customer_id,oo.source,oo.pay_type
from pmt_orders oo
<where>
<if test="search_text != null">
<bind name="name_pattern" value="'%' + search_text + '%'"/>
<if test="text_type == 'remark'">
AND oo.order_detail LIKE #{name_pattern}
</if>
<if test="text_type == 'channel'">
AND oo.channel = #{search_text}
</if>
<if test="text_type == 'order_id'">
AND oo.order_id = #{search_text}
</if>
</if>
<if test="order_id != null">
AND oo.order_id = #{order_id}
</if>
<if test="trade_type != null">
AND oo.gateway IN
<foreach collection="trade_type" item="gateway" open="(" close=")" separator=",">
#{gateway}
</foreach>
</if>
<if test="from != null">
AND oo.create_time &gt;= #{from}
</if>
<if test="to != null">
AND oo.create_time &lt; #{to}
</if>
<if test="date != null">
AND oo.transaction_date = DATE(#{date})
</if>
<if test="dev_id != null">
AND oo.dev_id = #{dev_id}
</if>
<if test="status != null">
AND
<foreach collection="status" item="std" open="(" close=")" separator=" or ">
oo.status = #{std}
</foreach>
</if>
<if test="channel != null">
AND
<foreach collection="channel" item="chan" open="(" close=")" separator=" or ">
oo.channel = #{chan}
</foreach>
</if>
<if test="source != 'ALL'">
AND
oo.source = #{source}
</if>
</where>
) o
INNER JOIN pmt_transactions t
ON t.order_id = o.order_id
AND t.refund_id IS NULL
AND t.transaction_type = 'Credit'
LEFT JOIN sys_client_incremental sci on sci.client_id = o.client_id
<if test="client_ids != null">
AND o.client_id IN
<foreach collection="client_ids" open="(" close=")" separator="," item="client_id">
#{client_id}
</foreach>
</if>
<if test="client_ids == null and client_id != null">
AND o.client_id = #{client_id}
</if>
<where>
<if test="onlyIncrementAmount != null">
t.incremental_surcharge >0
</if>
</where>
GROUP BY o.order_id
</select>
<select id="listOrdersNoPage" resultType="com.alibaba.fastjson.JSONObject">
<if test="gateway">
<include refid="gateway_keys"/>
@ -551,21 +743,14 @@
<select id="listIncrementalOrdersByClients" resultType="com.alibaba.fastjson.JSONObject">
<include refid="tradelog_list_keys"/>
<include refid="tradelog_list_keys_2"/>
,ifnull(i.incremental_rate,0.00) as rate_value
FROM pmt_orders o
INNER JOIN sys_clients p ON p.client_id=o.client_id and p.is_valid=1
<if test="client_ids!=null">
AND p.client_id IN
<foreach collection="client_ids" open="(" close=")" separator="," item="client_id">
#{client_id}
</foreach>
</if>
<if test="client_ids==null and client_id !=null">
and (p.client_id=#{client_id} or p.parent_client_id=#{client_id})
</if>
LEFT JOIN pmt_transactions t on t.order_id=o.order_id and t.refund_id is null and t.transaction_type='Credit'
LEFT JOIN pmt_incremental_detail i on i.transaction_id = t.transaction_id
<where>
<if test="from!=null">and o.create_time &gt;= #{from}</if>
<if test="to!=null">and o.create_time &lt; #{to}</if>
@ -583,6 +768,15 @@
AND
o.source = #{source}
</if>
<if test="client_ids!=null">
AND o.client_id IN
<foreach collection="client_ids" open="(" close=")" separator="," item="client_id">
#{client_id}
</foreach>
</if>
<if test="client_ids==null and client_id !=null">
and o.client_id=#{client_id}
</if>
</where>
GROUP BY o.order_id
</select>

@ -1252,7 +1252,7 @@
FROM pmt_transactions t
LEFT JOIN pmt_orders o ON o.order_id = t.order_id
LEFT JOIN pmt_refunds r ON r.refund_id = t.refund_id
LEFT JOIN sys_client_incremental sci on sci.client_id = t.client_id
LEFT JOIN sys_client_incremental sci on sci.client_id = t.client_id and sci.channel=o.source and sci.is_valid=1
INNER JOIN log_clearing_detail lcd ON t.clearing_order = lcd.clear_detail_id
WHERE t.channel != 'Settlement'
AND t.clearing_order = #{clearing_order}

@ -14,10 +14,18 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
app.controller('ApsKYCCtrl', ['$scope', '$http', '$uibModal', 'commonDialog', function ($scope, $http, $uibModal, commonDialog) {
var that = $scope
that.status = [
{id: -1, label: '所有'},
{id: 0, label: '未读'},
{id: 1, label: '已读'},
{id: 2, label: '同意'},
{id: 3, label: '拒绝'}
]
that.params = {};
that.noticeClients = {};
that.showClients = false
that.selectIndex = -1;
that.clientStatus = -1;
that.loadApsNotice = function (page) {
var params = angular.copy(that.params);
params.page = page || that.pagination.page || 1;
@ -40,6 +48,19 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
});
})
};
that.changeClientStatus = function (clientStatus, page) {
that.clientStatus = clientStatus
if (that.showClients) {
that.loadApsNoticeClients(page);
}
};
that.download = function () {
var url = "/aps/kyc/notice/clients/excel?id=" + that.clientId
if (that.clientStatus != -1) {
url = url + "&clientStatus=" + that.clientStatus
}
return url;
}
that.getNoticeClients = function (title, id, page, index) {
that.selectIndex = index
that.showClients = true
@ -53,6 +74,9 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
var params = angular.copy(that.params);
params.page = page || that.clientPagination.page || 1;
params.id = that.clientId;
if (that.clientStatus != -1) {
params.clientStatus = that.clientStatus;
}
$http.get('/aps/kyc/notice/clients', {params: params}).then(function (resp) {
that.noticeClients = resp.data.data;
that.clientPagination = resp.data.pagination;

@ -91,11 +91,23 @@
<div class="box box-danger" ng-if="showClients">
<div class="modal-body">
<h3>{{clientTitle}}—商户列表</h3>
<div style="display: flex;align-items: center;">
<lable>商户操作状态:</lable>
<select ng-model="clientStatus" style="margin-right: 30px;width: 100px;height: 30px;"
ng-change="changeClientStatus(clientStatus,1)"
ng-options="status.id as status.label for status in status">
</select>
<a ng-href="{{ download() }}" class="btn btn-success" type="button"
ng-if="noticeClients != null && noticeClients != ''">
<i class="fa sa-download"></i> 导出EXCEL
</a>
</div>
<div class="box-body table-responsive">
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>商户名称</th>
<th>所属BD</th>
<th style="text-align: center">商户操作状态</th>
<th style="text-align: center">运营操作状态</th>
<th style="text-align: center">操作</th>
@ -104,14 +116,15 @@
<tbody>
<tr ng-repeat="item in noticeClients">
<td>{{item.partner_code}}</td>
<td>{{item.bd_name ? item.bd_name : "未绑定BD"}}</td>
<td style="text-align: center">
<span ng-if="item.status == 0" style="color: black">未读</span>
<span ng-if="item.status == 1" style="color: #c09d03">已读({{item.user_name}} {{ item.read_time
}})</span>
<span ng-if="item.status == 2" style="color: #00a65a">同意({{item.user_name}} {{ item.status_time
}})</span>
<span ng-if="item.status == 3" style="color: red">拒绝({{item.user_name}} {{ item.status_time
}})</span>
<span ng-if="item.status == 1"
style="color: #c09d03">已读({{item.user_name}} {{ item.read_time}})</span>
<span ng-if="item.status == 2"
style="color: #00a65a">同意({{item.user_name}} {{ item.status_time}})</span>
<span ng-if="item.status == 3"
style="color: red">拒绝({{item.user_name}} {{ item.status_time}})</span>
</td>
<td style="text-align: center">
<a href="" type="button"><span ng-if="item.handle == 0">未处理</span></a>

@ -2485,30 +2485,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
if (!$scope.paymentInfo) {
return
}
// if (!$scope.init.channel[channel]) {
// $scope.init.channel[channel] = true
// return
// }
if($scope.paymentInfo.aps_config_id){
if(channel == 'alipay' && !$scope.paymentInfo.alipay_cn_switch){
commonDialog.alert({
title: 'ERROR',
content: "Please switch AlipayCN to Alipay channel, and then close Alipay channel",
type: 'error',
})
$scope.loadPartnerPaymentInfo()
return;
}
if (channel == 'alipayaps' && $scope.paymentInfo.alipay_cn_switch) {
commonDialog.alert({
title: 'ERROR',
content: "Please switch AlipayCN to Alipay channel, and then close Alipay+(APS) channel",
type: 'error',
})
$scope.loadPartnerPaymentInfo()
return;
}
}
$scope.getComplianceInfo()
if ($scope.paymentInfo['enable_wechat'] && channel == 'wechat' && $scope.paymentInfo.open_status == 5 && info.length > 0) {
commonDialog

@ -281,10 +281,7 @@
<th>Transaction Fee</th>
<th>Active Time</th>
<th>Expire Time</th>
<th
ng-if="bankCtrl.rate_name=='Wechat'">
Clean Days
</th>
<th>Clean Days</th>
<th>Update Time</th>
<th>Operator</th>
<th>Remark</th>
@ -299,10 +296,7 @@
<td ng-bind="'$ '+rate.transaction_fee"></td>
<td ng-bind="rate.active_time|date:'yyyy-MM-dd'"></td>
<td ng-bind="rate.expiry_time|date:'yyyy-MM-dd'"></td>
<td
ng-if="rate.rate_name=='Wechat'">
T+{{rate.clean_days}}
</td>
<td>T+{{rate.clean_days}}</td>
<td ng-bind="rate.update_time|date:'yyyy-MM-dd'"></td>
<td ng-bind="rate.operator_name||'系统生成'"></td>
<td ng-bind="rate.remark|limitTo:20" title="{{rate.remark}}"></td>

@ -27,7 +27,7 @@
<div class="col-sm-6">
<div class="input-group">
<input type="number" name="retail_interchange_fee_value" stringToNumber2 class="form-control" ng-model="rate.retail_interchange_fee_value"
min="0.6" max="10" step="0.1" id="retail_interchange_fee_value_input" required>
min="0.1" max="10" step="0.01" id="retail_interchange_fee_value_input" required>
<div class="input-group-addon">%</div>
</div>
<div ng-messages="rate_from.retail_interchange_fee_value.$error" ng-if="rate_from.retail_interchange_fee_value.$dirty">
@ -35,7 +35,7 @@
<i class="glyphicon glyphicon-alert"></i> No more than 10.0%
</div>
<div class="small text-danger" ng-message="min">
<i class="glyphicon glyphicon-alert"></i> No less than 0.6%
<i class="glyphicon glyphicon-alert"></i> No less than 0.1%
</div>
<div class="small text-danger" ng-message="required">
<i class="glyphicon glyphicon-alert"></i> Required Field
@ -51,7 +51,7 @@
<div class="col-sm-6">
<div class="input-group">
<input type="number" name="retail_service_fee_value" stringToNumber2 class="form-control" ng-model="rate.retail_service_fee_value"
min="0.6" max="10" step="0.1" id="retail_service_fee_value_input" required>
min="0.1" max="10" step="0.01" id="retail_service_fee_value_input" required>
<div class="input-group-addon">%</div>
</div>
<div ng-messages="rate_from.retail_service_fee_value.$error" ng-if="rate_from.retail_service_fee_value.$dirty">
@ -59,7 +59,7 @@
<i class="glyphicon glyphicon-alert"></i> No more than 10.0%
</div>
<div class="small text-danger" ng-message="min">
<i class="glyphicon glyphicon-alert"></i> No less than 0.6%
<i class="glyphicon glyphicon-alert"></i> No less than 0.1%
</div>
<div class="small text-danger" ng-message="required">
<i class="glyphicon glyphicon-alert"></i> Required Field
@ -76,7 +76,7 @@
<div class="col-sm-6">
<div class="input-group">
<input type="number" name="online_interchange_fee_value" stringToNumber2 class="form-control" ng-model="rate.online_interchange_fee_value"
min="0.6" max="10" step="0.1" id="online_interchange_fee_value_input" required>
min="0.1" max="10" step="0.01" id="online_interchange_fee_value_input" required>
<div class="input-group-addon">%</div>
</div>
<div ng-messages="rate_from.online_interchange_fee_value.$error" ng-if="rate_from.online_interchange_fee_value.$dirty">
@ -84,7 +84,7 @@
<i class="glyphicon glyphicon-alert"></i> No more than 10.0%
</div>
<div class="small text-danger" ng-message="min">
<i class="glyphicon glyphicon-alert"></i> No less than 0.6%
<i class="glyphicon glyphicon-alert"></i> No less than 0.1%
</div>
<div class="small text-danger" ng-message="required">
<i class="glyphicon glyphicon-alert"></i> Required Field
@ -100,7 +100,7 @@
<div class="col-sm-6">
<div class="input-group">
<input type="number" name="online_service_fee_value" stringToNumber2 class="form-control" ng-model="rate.online_service_fee_value"
min="0.6" max="10" step="0.1" id="online_service_fee_value_input" required>
min="0.1" max="10" step="0.01" id="online_service_fee_value_input" required>
<div class="input-group-addon">%</div>
</div>
<div ng-messages="rate_from.online_service_fee_value.$error" ng-if="rate_from.online_service_fee_value.$dirty">
@ -108,7 +108,7 @@
<i class="glyphicon glyphicon-alert"></i> No more than 10.0%
</div>
<div class="small text-danger" ng-message="min">
<i class="glyphicon glyphicon-alert"></i> No less than 0.6%
<i class="glyphicon glyphicon-alert"></i> No less than 0.1%
</div>
<div class="small text-danger" ng-message="required">
<i class="glyphicon glyphicon-alert"></i> Required Field

@ -104,9 +104,7 @@
datepicker-options="{minDate:rate.active_time}">
</div>
</div>
<div class="form-group" ng-if="rate.rate_name=='Wechat'
|| rate.rate_name=='rpaypmt_card'
|| rate.rate_name=='rpaypmt_dd'">
<div class="form-group">
<label class="control-label col-sm-4" for="clean_days_input">Clean Days</label>
<div class="col-sm-6">
<div class="input-group">

@ -245,8 +245,8 @@
<img src="/static/images/alipay_aps_big.svg" style="width: 20px;height: 20px;"
uib-tooltip="AlipayPlus" />
<h5 style="margin-left: 5px;">
Alipay+(Retail) : <span ng-bind="partnerInfo.client_moniker"></span>
<span ng-if="!partnerInfo.client_moniker">none</span>
Alipay+(Retail) : <span ng-bind="partnerInfo.available_channels.apsinstore.mid"></span>
<span ng-if="!partnerInfo.available_channels.apsinstore.mid">none</span>
</h5>
</div>
@ -284,8 +284,8 @@
<img src="/static/images/alipay_aps_big.svg" style="width: 20px;height: 20px;"
uib-tooltip="AlipayPlus" />
<h5 style="margin-left: 5px;">
Alipay+(Online) : <span ng-bind="partnerInfo.client_moniker"></span>
<span ng-if="!partnerInfo.client_moniker">none</span>
Alipay+(Online) : <span ng-bind="partnerInfo.available_channels.apscashier.mid"></span>
<span ng-if="!partnerInfo.available_channels.apscashier.mid">none</span>
</h5>
</div>

@ -51,10 +51,10 @@ define(['angular', 'uiRouter'], function () {
const dateStr = date.replace(/\//g, '')
if (filterItem.length) {
if (filterItem[0].isOld) {
$state.go('order_valid.report', { date: dateStr })
$state.go('order_valid.report', {date: dateStr})
} else {
sessionStorage.setItem('warningLevel', filterItem[0].warning_level)
$state.go('order_valid.report_new', { date: dateStr })
$state.go('order_valid.report_new', {date: dateStr})
}
} else {
commonDialog
@ -93,7 +93,7 @@ define(['angular', 'uiRouter'], function () {
function ($scope, $http, $filter, $stateParams, commonDialog) {
$scope.date = $stateParams.date
$scope.startValid = function (forceRebuild) {
$scope.report = { loading: true }
$scope.report = {loading: true}
$http
.get('/sys/financial/order_validations/' + $scope.date, {
params: {
@ -122,7 +122,7 @@ define(['angular', 'uiRouter'], function () {
})
},
function (resp) {
commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' })
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
$scope.report = null
}
)
@ -140,10 +140,10 @@ define(['angular', 'uiRouter'], function () {
})
.then(
function (resp) {
commonDialog.alert({ title: 'Success', content: '修复完毕', type: 'success' })
commonDialog.alert({title: 'Success', content: '修复完毕', type: 'success'})
},
function (resp) {
commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' })
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
}
)
}
@ -153,10 +153,11 @@ define(['angular', 'uiRouter'], function () {
app.controller('orderValidationNewCtrl', [
'$scope',
'$http',
'$sce',
'$stateParams',
'commonDialog',
'$uibModal',
function ($scope, $http, $stateParams, commonDialog, $uibModal) {
function ($scope, $http, $sce, $stateParams, commonDialog, $uibModal) {
// 清除sessionStorage
$scope.$on('$destroy', function () {
sessionStorage.clear()
@ -217,7 +218,7 @@ define(['angular', 'uiRouter'], function () {
console.log($scope.channelList)
},
function (resp) {
commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' })
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
}
)
}
@ -228,12 +229,15 @@ define(['angular', 'uiRouter'], function () {
}
// 是否清除缓存
$scope.clear = function (channelName, flag) {
$http.post('/sys/financial/redo_channel_validation/' + $stateParams.date, { channel: channelName, cache: flag }).then(
$http.post('/sys/financial/redo_channel_validation/' + $stateParams.date, {
channel: channelName,
cache: flag
}).then(
function () {
$scope.startValid()
},
function (resp) {
commonDialog.alert({ title: 'failed', content: resp.data.message, type: 'error' })
commonDialog.alert({title: 'failed', content: resp.data.message, type: 'error'})
}
)
}
@ -253,12 +257,19 @@ define(['angular', 'uiRouter'], function () {
$scope.message = merchantInfo.resolve_msg
}
$scope.confirm = function () {
$http.post('/sys/financial/mark/resolve/message', { log_id: merchantInfo.log_id, message: $scope.message }).then(
$http.post('/sys/financial/mark/resolve/message', {
log_id: merchantInfo.log_id,
message: $scope.message
}).then(
function () {
$scope.$close()
},
function (resp) {
commonDialog.alert({ title: 'failed', content: resp.data.message, type: 'error' })
commonDialog.alert({
title: 'failed',
content: resp.data.message,
type: 'error'
})
}
)
}
@ -304,10 +315,10 @@ define(['angular', 'uiRouter'], function () {
$scope.checkStatus = function (transactionId) {
$http.get('/sys/financial/get/transaction/status/' + transactionId, {}).then(
function (resp) {
commonDialog.alert({ title: resp.data.statusInfo, content: '', type: 'success' })
commonDialog.alert({title: resp.data.statusInfo, content: '', type: 'success'})
},
function (resp) {
commonDialog.alert({ title: 'failed', content: resp.data.message, type: 'error' })
commonDialog.alert({title: 'failed', content: resp.data.message, type: 'error'})
}
)
}

@ -110,7 +110,7 @@
</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)">
<td ng-if="apply.status==0 && ('10'|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)">

@ -158,14 +158,12 @@ $(document).ready(function () {
if(window.openmobilefun == 'alipay'){
paymentLink = '/api/v1.0/share_code/business/bills/'+window.billInfo.bill_code_id+'/alipay/mobile';
}else{
paymentLink = '/api/v1.0/share_code/business/bills/'+window.billInfo.bill_code_id+'/alipay/mobile/redirectApp?priorityChannel=Alipay';
paymentLink = '/api/v1.0/share_code/business/bills/'+window.billInfo.bill_code_id+'/alipay/mobile/redirectApp?priorityChannel=AlipayOnline';
}
}
if(paymentFun == 'AlipayAps'){
if(window.openmobilefun == 'alipayaps'|| window.openmobilefun == 'alipayaps_cn'){
if(window.openmobilefun == 'alipayaps'){
paymentLink = '/api/v1.0/share_code/business/bills/'+window.billInfo.bill_code_id+'/alipay_aps/mobile';
}else{
paymentLink = '/api/v1.0/share_code/business/bills/'+window.billInfo.bill_code_id+'/alipay_aps/mobile/redirectApp?priorityChannel=AlipayAps';
}
}
if(paymentFun == 'Bank'){
@ -184,16 +182,13 @@ $(document).ready(function () {
if(window.openmobilefun == 'alipay'){
paymentLink = '/api/v1.0/share_code/bills/payment/orders/'+window.billInfo.bill_code_id+'/alipay/share_link'
}else{
paymentLink = '/api/v1.0/share_code/bills/payment/'+window.billInfo.bill_code_id+'/alipay/mobile/redirectApp?priorityChannel=Alipay';
paymentLink = '/api/v1.0/share_code/bills/payment/'+window.billInfo.bill_code_id+'/alipay/mobile/redirectApp?priorityChannel=AlipayOnline';
}
}
if(paymentFun == 'AlipayAps'){
if(window.openmobilefun == 'alipayaps'|| window.openmobilefun == 'alipayaps_cn'){
if(window.openmobilefun == 'alipayaps'){
paymentLink = '/api/v1.0/share_code/bills/payment/orders/'+window.billInfo.bill_code_id+'/alipay_aps/share_link'
}else{
paymentLink = '/api/v1.0/share_code/bills/payment/'+window.billInfo.bill_code_id+'/alipay_aps/mobile/redirectApp?priorityChannel=AlipayAps';
}
}
if(paymentFun == 'Bank'){

@ -1,4 +1,4 @@
window = {};
window = window || {};
$(function () {
'use strict';
var winHeight = $(window).height();
@ -6,7 +6,11 @@ $(function () {
if (ua.indexOf('micromessenger') >= 0) {
$(".weixin-tip").show().css("height", winHeight);
} else {
if (!window.retry_flag) {
location.href = window.target_href;
} else {
checkOrderStd(window.client_moniker, window.partner_order_id, true)
}
}
decode();
@ -17,21 +21,59 @@ $(function () {
$('#complete').bind('touchstart', function () {
checkOrderStd(window.client_moniker, window.partner_order_id, false);
});
$('#refresh').bind('touchstart', function () {
if (window.refresh_cooldown > 0) {
return;
}
window.refresh_cooldown = 10;
function replaceTxt() {
window.refresh_cooldown = window.refresh_cooldown - 1
if (window.refresh_cooldown > 0) {
$('#refresh').find('a').text('正在查询订单,请' + window.refresh_cooldown + '秒后重试')
setTimeout(replaceTxt, 1000)
} else {
$('#refresh').find('a').text('已完成付款')
}
}
setTimeout(replaceTxt, 1000)
replaceTxt()
checkOrderStd(window.client_moniker, window.partner_order_id, false);
});
$('#retry_btn').bind('touchstart', function () {
location.href = window.target_href;
})
$('#continue_use_browser').bind('touchstart', function () {
location.href = window.target_href;
});
$('#copy_link').bind('touchstart', function () {
var current_href = location.href;
$("#copy_link_btn").attr("data-clipboard-text", current_href);
var btn = document.getElementById('copy_link_btn');
var clipboard = new ClipboardJS(btn);
clipboard.on('success', function (e) {
alert("复制成功!");
e.clearSelection();
});
clipboard.on('error', function (e) {
alert("复制失败!");
});
});
function decode() {
var redirect = window.redirect;
while (redirect.indexOf('://') < 0) {
redirect = decodeURIComponent(redirect);
if (redirect == window.redirect) {
if (redirect === window.redirect) {
break;
}
window.redirect = redirect;
}
}
function checkOrderStd(clientMoniker, merchantOrderId, needLoop) {
if (!clientMoniker || !merchantOrderId) {
return;

@ -0,0 +1,69 @@
window = {};
$(function () {
'use strict';
var winHeight = $(window).height();
var ua = navigator.userAgent.toLowerCase();
if (ua.indexOf('micromessenger') >= 0) {
$(".weixin-tip").show().css("height", winHeight);
} else {
callAlipayAps();
}
decode();
$('.close-weixin-tip').bind('touchstart', function () {
$(".weixin-tip").hide();
checkOrderStd(window.client_moniker, window.partner_order_id, true);
});
$('#complete').bind('touchstart', function () {
checkOrderStd(window.client_moniker, window.partner_order_id, false);
});
$('#refresh').bind('touchstart', function () {
checkOrderStd(window.client_moniker, window.partner_order_id, false);
});
$('#continue_use_browser').bind('touchstart', function () {
callAlipayAps();
});
$('#continue_use_browser').bind('touchstart', function () {
callAlipayAps();
});
function decode() {
var redirect = window.redirect;
while (redirect.indexOf('://') < 0) {
redirect = decodeURIComponent(redirect);
if (redirect == window.redirect) {
break;
}
window.redirect = redirect;
}
}
function checkOrderStd(clientMoniker, merchantOrderId, needLoop) {
if (!clientMoniker || !merchantOrderId) {
return;
}
$.ajax({
url: '/api/v1.0/payment/clients/' + clientMoniker + '/orders/' + merchantOrderId + '/status',
method: 'GET',
dataType: 'json',
success: function (res) {
if (res.paid) {
location.href = window.redirect + (window.redirect.indexOf('?') < 0 ? '?' : '&') + 'success=true&time=' + res.time + '&nonce_str=' + res.nonce_str + '&sign=' + res.sign;
} else {
if (needLoop) {
setTimeout(checkOrderStd(clientMoniker, merchantOrderId, needLoop), 3000);
}
if (!needLoop && !res.paid) {
alert("订单未支付,请稍后再试");
}
}
},
error: function (res) {
if (needLoop && res.message) {
alert(res.message);
}
}
})
}
})
;
Loading…
Cancel
Save