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> <parent>
<groupId>au.com.royalpay.payment</groupId> <groupId>au.com.royalpay.payment</groupId>
<artifactId>payment-parent</artifactId> <artifactId>payment-parent</artifactId>
<version>2.3.2</version> <version>2.3.4</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId> <artifactId>manage</artifactId>
<version>2.4.1</version> <version>2.4.5</version>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>2.4.0</jib-maven-plugin.version> <jib-maven-plugin.version>2.4.0</jib-maven-plugin.version>
<yixsoft-batis.version>1.0.12</yixsoft-batis.version> <yixsoft-batis.version>1.0.12</yixsoft-batis.version>
<mysql.version>8.0.20</mysql.version> <mysql.version>8.0.20</mysql.version>
<image.version>${project.version}</image.version>
</properties> </properties>
<dependencies> <dependencies>
@ -299,41 +300,6 @@
</plugins> </plugins>
</build> </build>
</profile> </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> <profile>
<id>prod</id> <id>prod</id>
<build> <build>
@ -347,7 +313,7 @@
<image>192.168.0.84:5000/royalpay/openjdk:11.0.8</image> <image>192.168.0.84:5000/royalpay/openjdk:11.0.8</image>
</from> </from>
<to> <to>
<image>hkccr.ccs.tencentyun.com/rpay/manage:${project.version}</image> <image>hkccr.ccs.tencentyun.com/rpay/manage:${image.version}</image>
</to> </to>
<extraDirectories> <extraDirectories>
<paths> <paths>

@ -152,11 +152,23 @@ tags:
description: | description: |
用于移动端APP调用微信/支付宝SDK支付调用API创建订单得到微信SDK调用参数将参数传递给SDK拉起微信/支付宝支付,并由客户端直接返回支付结果。 强烈建议获得支付结果后再调用RoyalPay订单查询API确认完成支付后再进行后续流程避免因超时自动撤单导致资金损失 用于移动端APP调用微信/支付宝SDK支付调用API创建订单得到微信SDK调用参数将参数传递给SDK拉起微信/支付宝支付,并由客户端直接返回支付结果。 强烈建议获得支付结果后再调用RoyalPay订单查询API确认完成支付后再进行后续流程避免因超时自动撤单导致资金损失
<img src="img/sdk_wechat_api_payment_cn.png"> <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 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) [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 - name: Custom

@ -160,11 +160,22 @@ tags:
Used for mobile Apps calling Wechat payment with Wechat/Alipay SDK. 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.* 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"> <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 Alipay:
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 Document](https://global.alipay.com/doc/app/intro)
[Alipay SDK for iOS](resources/api/AlipaySDKForiOS.zip)
[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 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) [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 - name: Custom

@ -6,15 +6,18 @@ import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList; import com.github.miemiedev.mybatis.paginator.domain.PageList;
import java.util.Date; import java.util.Date;
import java.util.List;
public interface ApsNoticeClientRepository { public interface ApsNoticeClientRepository {
void saveApsNoticeClient(ApsNoticeClient apsNoticeClient); void saveApsNoticeClient(ApsNoticeClient apsNoticeClient);
void updateApsNoticeClient(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); void updateApsNoticeClientByPartnerCode(Date modifyTime, String modifier, String partnerCode);
ApsNoticeClient getApsNoticeClientById(String id); 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.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList; import com.github.miemiedev.mybatis.paginator.domain.PageList;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public interface ApsNoticeClientsService { 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; 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.repository.ApsNoticeClientRepository;
import au.com.royalpay.payment.manage.apsKYC.domain.service.ApsNoticeClientsService; 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.ClientAccountMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.mappers.system.ManagerMapper; import au.com.royalpay.payment.manage.mappers.system.ManagerMapper;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList; import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.commons.lang3.StringUtils; 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.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; 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 @Service
public class ApsNoticeClientsServiceImpl implements ApsNoticeClientsService { public class ApsNoticeClientsServiceImpl implements ApsNoticeClientsService {
@ -20,12 +40,18 @@ public class ApsNoticeClientsServiceImpl implements ApsNoticeClientsService {
@Autowired @Autowired
private ManagerMapper managerMapper; private ManagerMapper managerMapper;
@Autowired
private ClientMapper clientMapper;
@Autowired @Autowired
private ClientAccountMapper clientAccountMapper; private ClientAccountMapper clientAccountMapper;
@Autowired
private ApsNoticeMapper apsNoticeMapper;
@Override @Override
public PageList<JSONObject> getApsNoticeClients(String id, PageBounds pageBounds) { public PageList<JSONObject> getApsNoticeClients(String id, String clientStatus, PageBounds pageBounds) {
PageList<JSONObject> apsNoticeClients = apsNoticeClientRepository.getApsNoticeClients(id, pageBounds); PageList<JSONObject> apsNoticeClients = apsNoticeClientRepository.getApsNoticeClients(id, clientStatus, pageBounds);
for (JSONObject apsNoticeClient : apsNoticeClients) { for (JSONObject apsNoticeClient : apsNoticeClients) {
if (apsNoticeClient.containsKey("modifier") && StringUtils.isNotBlank(apsNoticeClient.getString("modifier"))) { if (apsNoticeClient.containsKey("modifier") && StringUtils.isNotBlank(apsNoticeClient.getString("modifier"))) {
JSONObject modifier = managerMapper.findDetail(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; 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 org.springframework.stereotype.Repository;
import java.util.Date; import java.util.Date;
import java.util.List;
@Repository @Repository
public class ApsNoticeClientRepositoryImpl implements ApsNoticeClientRepository { public class ApsNoticeClientRepositoryImpl implements ApsNoticeClientRepository {
@ -28,8 +29,8 @@ public class ApsNoticeClientRepositoryImpl implements ApsNoticeClientRepository
} }
@Override @Override
public PageList<JSONObject> getApsNoticeClients(String id, PageBounds pageBounds) { public PageList<JSONObject> getApsNoticeClients(String id, String clientStatus, PageBounds pageBounds) {
return mapper.getApsNoticeClients(id, pageBounds); return mapper.getApsNoticeClients(id, clientStatus, pageBounds);
} }
@Override @Override
@ -41,4 +42,9 @@ public class ApsNoticeClientRepositoryImpl implements ApsNoticeClientRepository
public ApsNoticeClient getApsNoticeClientById(String id) { public ApsNoticeClient getApsNoticeClientById(String id) {
return mapper.getApsNoticeClientById(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 org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@RestController @RestController
@RequestMapping(value = "/aps/kyc") @RequestMapping(value = "/aps/kyc")
@ -74,9 +76,9 @@ public class RestApsKYCController {
@ManagerMapping(value = "/notice/clients", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.SALES_MANAGER}) @ManagerMapping(value = "/notice/clients", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.SALES_MANAGER})
public JSONObject getApsNoticeClients(@RequestParam(value = "page", defaultValue = "1") int page, public JSONObject getApsNoticeClients(@RequestParam(value = "page", defaultValue = "1") int page,
@RequestParam(value = "pageSize", defaultValue = "20") int pageSize, @RequestParam(value = "pageSize", defaultValue = "20") int pageSize,
@RequestParam String id) { @RequestParam String id, @RequestParam(required = false) String clientStatus) {
PageBounds pageBounds = new PageBounds(page, pageSize); 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); return PageListUtils.buildPageListResult(apply);
} }
@ -101,4 +103,15 @@ public class RestApsKYCController {
public void updateApsNoticeClient(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody ApsNoticeClient apsNoticeClient) { public void updateApsNoticeClient(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody ApsNoticeClient apsNoticeClient) {
apsNoticeService.updateApsNoticeClient(manager, 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 org.apache.ibatis.annotations.Param;
import java.util.Date; import java.util.Date;
import java.util.List;
@AutoMapper(tablename = "sys_aps_notice_clients", pkName = "id") @AutoMapper(tablename = "sys_aps_notice_clients", pkName = "id")
public interface ApsNoticeClientMapper { public interface ApsNoticeClientMapper {
@ -20,7 +21,7 @@ public interface ApsNoticeClientMapper {
@AutoSql(SqlType.UPDATE) @AutoSql(SqlType.UPDATE)
void updateApsNoticeClient(ApsNoticeClient apsNoticeClient); 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); 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) @AutoSql(SqlType.UPDATE)
void toUpdateApsKycClient(JSONObject updateReadTime); 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> listIncrementalOrders(JSONObject params, PageBounds pagination);
PageList<JSONObject> listIncrementalOrdersNew(JSONObject params, PageBounds pagination);
List<JSONObject> listOrdersNoPage(JSONObject params); List<JSONObject> listOrdersNoPage(JSONObject params);
PageList<JSONObject> listOrdersByClients(JSONObject params, PageBounds pagination); 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.EmailException;
import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
import au.com.royalpay.payment.core.impls.MerchantChannelApplicationManager; 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.mappers.SysClientMapper;
import au.com.royalpay.payment.core.utils.OrderExpiryRuleResolver; import au.com.royalpay.payment.core.utils.OrderExpiryRuleResolver;
import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper; 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.connections.mpsupport.exceptions.WechatException;
import au.com.royalpay.payment.tools.defines.IncrementalChannel; import au.com.royalpay.payment.tools.defines.IncrementalChannel;
import au.com.royalpay.payment.tools.defines.PayChannel; 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.PlatformEnvironment;
import au.com.royalpay.payment.tools.env.SysConfigManager; import au.com.royalpay.payment.tools.env.SysConfigManager;
import au.com.royalpay.payment.tools.exceptions.BadRequestException; import au.com.royalpay.payment.tools.exceptions.BadRequestException;
@ -331,7 +334,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
private ApsNoticeClientMapper apsNoticeClientMapper; private ApsNoticeClientMapper apsNoticeClientMapper;
DateTimeFormatter formatter = DateTimeFormat.forPattern("dd MMM yyyy"); DateTimeFormatter formatter = DateTimeFormat.forPattern("dd MMM yyyy");
@Resource
private MchChannelContractMapper mchChannelContractMapper;
@Resource @Resource
private SmsSender smsSender; private SmsSender smsSender;
@ -555,6 +559,29 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
client.put("enable_alipayplus", true); client.put("enable_alipayplus", true);
} }
client.put("enable_alipayaps", false); 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 resolverApsInStore = this.paymentApi.channelApi(PayChannel.ALIPAY_APS_IN_STORE.getChannelCode()).getChannelPermissionResolver();
MerchantChannelPermissionResolver resolverApsCashier = this.paymentApi.channelApi(PayChannel.ALIPAY_APS_CASHIER.getChannelCode()).getChannelPermissionResolver(); MerchantChannelPermissionResolver resolverApsCashier = this.paymentApi.channelApi(PayChannel.ALIPAY_APS_CASHIER.getChannelCode()).getChannelPermissionResolver();
if (!Objects.isNull(resolverApsInStore) && !Objects.isNull(resolverApsCashier) && if (!Objects.isNull(resolverApsInStore) && !Objects.isNull(resolverApsCashier) &&
@ -6141,7 +6168,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
JSONObject result = null; JSONObject result = null;
JSONObject expireInfo = clientContractService.getClientContractExpire(client_id, channel); JSONObject expireInfo = clientContractService.getClientContractExpire(client_id, channel);
JSONObject account = clientAccountMapper.findById(account_id); 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; return result;
} else { } else {
if (expireInfo.getBooleanValue("alert")) { if (expireInfo.getBooleanValue("alert")) {
@ -7150,13 +7177,22 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
client.put("isRetail", isRetail); client.put("isRetail", isRetail);
String pid = ""; String pid = "";
if (isRetail) { if (isRetail) {
//todo 测试需要 先都改成线上,上线此处需要改成线下
pid = AlipayEnvironment.getEnv().getAlipayPlusApsRetailConfig().getPid(); pid = AlipayEnvironment.getEnv().getAlipayPlusApsRetailConfig().getPid();
} else { } else {
pid = AlipayEnvironment.getEnv().getAlipayPlusApsOnlineConfig().getPid(); pid = AlipayEnvironment.getEnv().getAlipayPlusApsOnlineConfig().getPid();
} }
client.put("pid", pid); 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")); AlipayApsMerchantRegister alipayApsMerchantRegister = Optional.ofNullable(merchantChannelApplicationManager.getRegister(AlipayApsMerchantRegister.class)).orElseThrow(() -> new ServerErrorException("No AlipayAps registry found"));
AlipayPlusRegisterResult alipayPlusRegisterResult = alipayApsMerchantRegister.findMerchant(client); AlipayPlusRegisterResult alipayPlusRegisterResult = alipayApsMerchantRegister.findMerchant(client);
return alipayPlusRegisterResult.getRawResponse(); 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.PageListUtils;
import au.com.royalpay.payment.tools.utils.TimeZoneUtils; import au.com.royalpay.payment.tools.utils.TimeZoneUtils;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.Order; import com.github.miemiedev.mybatis.paginator.domain.Order;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
@ -211,6 +212,12 @@ public class TradeLogServiceImpl implements TradeLogService {
add(query.getGatewayChild()); 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, PageList<JSONObject> logs = orderMapper.listIncrementalOrdersByClients(params,
new PageBounds(query.getPage(), query.getLimit(), Order.formString("create_time.desc"))); new PageBounds(query.getPage(), query.getLimit(), Order.formString("create_time.desc")));
if (timezone != null) { if (timezone != null) {

@ -2,7 +2,7 @@ server:
port: 5555 port: 5555
spring: spring:
profiles: 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: mail:
host: '' host: ''
port: '' port: ''
@ -73,6 +73,7 @@ app:
control: control:
aes-key: Aa+MtthC4Ztq4Kfa9aL+UA== aes-key: Aa+MtthC4Ztq4Kfa9aL+UA==
run-tasks: false run-tasks: false
aps-online-prefix: '00-'
server: server:
ip: 127.0.0.1 ip: 127.0.0.1
settle: settle:

@ -14,6 +14,10 @@
SELECT * SELECT *
FROM sys_aps_notice_clients FROM sys_aps_notice_clients
where notice_id = #{id} where notice_id = #{id}
<if test="clientStatus != null">
and `status` = #{clientStatus}
</if>
ORDER BY status_time DESC
</select> </select>
<select id="getApsKycClient" resultType="com.alibaba.fastjson.JSONObject"> <select id="getApsKycClient" resultType="com.alibaba.fastjson.JSONObject">
SELECT c.*, SELECT c.*,
@ -27,5 +31,14 @@
AND c.is_valid = 0 AND c.is_valid = 0
AND c.handle = 0 AND c.handle = 0
</select> </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> </mapper>

@ -38,6 +38,41 @@
t.tax_amount, t.tax_amount,
t.surcharge_rate t.surcharge_rate
</sql> </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"> <sql id="gateway_keys">
SELECT SELECT
o.order_id order_id, o.order_id order_id,
@ -107,6 +142,73 @@
t.settle_amount, t.settle_amount,
t.transaction_time t.transaction_time
</sql> </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"> <update id="updateRefundAmount">
<![CDATA[ <![CDATA[
@ -439,6 +541,96 @@
</select> </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"> <select id="listOrdersNoPage" resultType="com.alibaba.fastjson.JSONObject">
<if test="gateway"> <if test="gateway">
<include refid="gateway_keys"/> <include refid="gateway_keys"/>
@ -551,21 +743,14 @@
<select id="listIncrementalOrdersByClients" resultType="com.alibaba.fastjson.JSONObject"> <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 ,ifnull(i.incremental_rate,0.00) as rate_value
FROM pmt_orders o 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_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 LEFT JOIN pmt_incremental_detail i on i.transaction_id = t.transaction_id
<where> <where>
<if test="from!=null">and o.create_time &gt;= #{from}</if> <if test="from!=null">and o.create_time &gt;= #{from}</if>
<if test="to!=null">and o.create_time &lt; #{to}</if> <if test="to!=null">and o.create_time &lt; #{to}</if>
@ -583,6 +768,15 @@
AND AND
o.source = #{source} o.source = #{source}
</if> </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> </where>
GROUP BY o.order_id GROUP BY o.order_id
</select> </select>

@ -1252,7 +1252,7 @@
FROM pmt_transactions t FROM pmt_transactions t
LEFT JOIN pmt_orders o ON o.order_id = t.order_id LEFT JOIN pmt_orders o ON o.order_id = t.order_id
LEFT JOIN pmt_refunds r ON r.refund_id = t.refund_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 INNER JOIN log_clearing_detail lcd ON t.clearing_order = lcd.clear_detail_id
WHERE t.channel != 'Settlement' WHERE t.channel != 'Settlement'
AND t.clearing_order = #{clearing_order} 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) { app.controller('ApsKYCCtrl', ['$scope', '$http', '$uibModal', 'commonDialog', function ($scope, $http, $uibModal, commonDialog) {
var that = $scope var that = $scope
that.status = [
{id: -1, label: '所有'},
{id: 0, label: '未读'},
{id: 1, label: '已读'},
{id: 2, label: '同意'},
{id: 3, label: '拒绝'}
]
that.params = {}; that.params = {};
that.noticeClients = {}; that.noticeClients = {};
that.showClients = false that.showClients = false
that.selectIndex = -1; that.selectIndex = -1;
that.clientStatus = -1;
that.loadApsNotice = function (page) { that.loadApsNotice = function (page) {
var params = angular.copy(that.params); var params = angular.copy(that.params);
params.page = page || that.pagination.page || 1; 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.getNoticeClients = function (title, id, page, index) {
that.selectIndex = index that.selectIndex = index
that.showClients = true that.showClients = true
@ -53,6 +74,9 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
var params = angular.copy(that.params); var params = angular.copy(that.params);
params.page = page || that.clientPagination.page || 1; params.page = page || that.clientPagination.page || 1;
params.id = that.clientId; params.id = that.clientId;
if (that.clientStatus != -1) {
params.clientStatus = that.clientStatus;
}
$http.get('/aps/kyc/notice/clients', {params: params}).then(function (resp) { $http.get('/aps/kyc/notice/clients', {params: params}).then(function (resp) {
that.noticeClients = resp.data.data; that.noticeClients = resp.data.data;
that.clientPagination = resp.data.pagination; that.clientPagination = resp.data.pagination;

@ -91,11 +91,23 @@
<div class="box box-danger" ng-if="showClients"> <div class="box box-danger" ng-if="showClients">
<div class="modal-body"> <div class="modal-body">
<h3>{{clientTitle}}—商户列表</h3> <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"> <div class="box-body table-responsive">
<table class="table table-bordered table-striped table-hover"> <table class="table table-bordered table-striped table-hover">
<thead> <thead>
<tr> <tr>
<th>商户名称</th> <th>商户名称</th>
<th>所属BD</th>
<th style="text-align: center">商户操作状态</th> <th style="text-align: center">商户操作状态</th>
<th style="text-align: center">运营操作状态</th> <th style="text-align: center">运营操作状态</th>
<th style="text-align: center">操作</th> <th style="text-align: center">操作</th>
@ -104,14 +116,15 @@
<tbody> <tbody>
<tr ng-repeat="item in noticeClients"> <tr ng-repeat="item in noticeClients">
<td>{{item.partner_code}}</td> <td>{{item.partner_code}}</td>
<td>{{item.bd_name ? item.bd_name : "未绑定BD"}}</td>
<td style="text-align: center"> <td style="text-align: center">
<span ng-if="item.status == 0" style="color: black">未读</span> <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 ng-if="item.status == 1"
}})</span> 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 ng-if="item.status == 2"
}})</span> 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 ng-if="item.status == 3"
}})</span> style="color: red">拒绝({{item.user_name}} {{ item.status_time}})</span>
</td> </td>
<td style="text-align: center"> <td style="text-align: center">
<a href="" type="button"><span ng-if="item.handle == 0">未处理</span></a> <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) { if (!$scope.paymentInfo) {
return 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() $scope.getComplianceInfo()
if ($scope.paymentInfo['enable_wechat'] && channel == 'wechat' && $scope.paymentInfo.open_status == 5 && info.length > 0) { if ($scope.paymentInfo['enable_wechat'] && channel == 'wechat' && $scope.paymentInfo.open_status == 5 && info.length > 0) {
commonDialog commonDialog

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

@ -27,7 +27,7 @@
<div class="col-sm-6"> <div class="col-sm-6">
<div class="input-group"> <div class="input-group">
<input type="number" name="retail_interchange_fee_value" stringToNumber2 class="form-control" ng-model="rate.retail_interchange_fee_value" <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 class="input-group-addon">%</div>
</div> </div>
<div ng-messages="rate_from.retail_interchange_fee_value.$error" ng-if="rate_from.retail_interchange_fee_value.$dirty"> <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% <i class="glyphicon glyphicon-alert"></i> No more than 10.0%
</div> </div>
<div class="small text-danger" ng-message="min"> <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>
<div class="small text-danger" ng-message="required"> <div class="small text-danger" ng-message="required">
<i class="glyphicon glyphicon-alert"></i> Required Field <i class="glyphicon glyphicon-alert"></i> Required Field
@ -51,7 +51,7 @@
<div class="col-sm-6"> <div class="col-sm-6">
<div class="input-group"> <div class="input-group">
<input type="number" name="retail_service_fee_value" stringToNumber2 class="form-control" ng-model="rate.retail_service_fee_value" <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 class="input-group-addon">%</div>
</div> </div>
<div ng-messages="rate_from.retail_service_fee_value.$error" ng-if="rate_from.retail_service_fee_value.$dirty"> <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% <i class="glyphicon glyphicon-alert"></i> No more than 10.0%
</div> </div>
<div class="small text-danger" ng-message="min"> <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>
<div class="small text-danger" ng-message="required"> <div class="small text-danger" ng-message="required">
<i class="glyphicon glyphicon-alert"></i> Required Field <i class="glyphicon glyphicon-alert"></i> Required Field
@ -76,7 +76,7 @@
<div class="col-sm-6"> <div class="col-sm-6">
<div class="input-group"> <div class="input-group">
<input type="number" name="online_interchange_fee_value" stringToNumber2 class="form-control" ng-model="rate.online_interchange_fee_value" <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 class="input-group-addon">%</div>
</div> </div>
<div ng-messages="rate_from.online_interchange_fee_value.$error" ng-if="rate_from.online_interchange_fee_value.$dirty"> <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% <i class="glyphicon glyphicon-alert"></i> No more than 10.0%
</div> </div>
<div class="small text-danger" ng-message="min"> <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>
<div class="small text-danger" ng-message="required"> <div class="small text-danger" ng-message="required">
<i class="glyphicon glyphicon-alert"></i> Required Field <i class="glyphicon glyphicon-alert"></i> Required Field
@ -100,7 +100,7 @@
<div class="col-sm-6"> <div class="col-sm-6">
<div class="input-group"> <div class="input-group">
<input type="number" name="online_service_fee_value" stringToNumber2 class="form-control" ng-model="rate.online_service_fee_value" <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 class="input-group-addon">%</div>
</div> </div>
<div ng-messages="rate_from.online_service_fee_value.$error" ng-if="rate_from.online_service_fee_value.$dirty"> <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% <i class="glyphicon glyphicon-alert"></i> No more than 10.0%
</div> </div>
<div class="small text-danger" ng-message="min"> <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>
<div class="small text-danger" ng-message="required"> <div class="small text-danger" ng-message="required">
<i class="glyphicon glyphicon-alert"></i> Required Field <i class="glyphicon glyphicon-alert"></i> Required Field

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

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

@ -2,316 +2,327 @@
* Created by davep on 2016-09-01. * Created by davep on 2016-09-01.
*/ */
define(['angular', 'uiRouter'], function () { define(['angular', 'uiRouter'], function () {
'use strict' 'use strict'
var app = angular.module('orderValidApp', ['ui.router']) var app = angular.module('orderValidApp', ['ui.router'])
app.config([ app.config([
'$stateProvider', '$stateProvider',
function ($stateProvider) { function ($stateProvider) {
$stateProvider $stateProvider
.state('order_valid', { .state('order_valid', {
url: '/order_validation', url: '/order_validation',
templateUrl: '/static/payment/validation/templates/valid-calendar.html', templateUrl: '/static/payment/validation/templates/valid-calendar.html',
controller: 'orderValidCalendarCtrl', controller: 'orderValidCalendarCtrl',
})
.state('order_valid.report', {
url: '/{date}',
templateUrl: '/static/payment/validation/templates/valid.html',
controller: 'orderValidationCtrl',
})
.state('order_valid.report_new', {
url: '/new/{date}',
templateUrl: '/static/payment/validation/templates/valid_new.html',
controller: 'orderValidationNewCtrl',
})
},
])
app.controller('orderValidCalendarCtrl', [
'$scope',
'$http',
'$filter',
'$state',
'commonDialog',
function ($scope, $http, $filter, $state, commonDialog) {
$scope.today = new Date()
$scope.loadValidatedDates = function (month) {
let monthStr = $filter('date')(month, 'yyyyMM')
$http.get('/sys/financial/validated_dates/' + monthStr).then(function (resp) {
$scope.validatedDates = resp.data
})
}
$scope.findReport = function (dateStr) {
if ($scope.validatedDates == null) {
return null
}
let filtered = $scope.validatedDates.filter(rp => rp.date === dateStr)
return filtered.length ? filtered[0] : null
}
$scope.checkDetail = function (date) {
const filterItem = $scope.validatedDates.filter(rp => rp.date === date)
const dateStr = date.replace(/\//g, '')
if (filterItem.length) {
if (filterItem[0].isOld) {
$state.go('order_valid.report', { date: dateStr })
} else {
sessionStorage.setItem('warningLevel', filterItem[0].warning_level)
$state.go('order_valid.report_new', { date: dateStr })
}
} else {
commonDialog
.confirm({
title: 'Confirm',
content: '是否确认重新执行对账?',
})
.then(function () {
$http
.get('/sys/financial/order_validations/' + dateStr, {
params: {
use_cache: false,
},
timeout: 300000,
}) })
.then( .state('order_valid.report', {
function () { url: '/{date}',
$state.reload() templateUrl: '/static/payment/validation/templates/valid.html',
}, controller: 'orderValidationCtrl',
function (resp) { })
$state.reload() .state('order_valid.report_new', {
} url: '/new/{date}',
) templateUrl: '/static/payment/validation/templates/valid_new.html',
}) controller: 'orderValidationNewCtrl',
}
}
},
])
// old
app.controller('orderValidationCtrl', [
'$scope',
'$http',
'$filter',
'$stateParams',
'commonDialog',
function ($scope, $http, $filter, $stateParams, commonDialog) {
$scope.date = $stateParams.date
$scope.startValid = function (forceRebuild) {
$scope.report = { loading: true }
$http
.get('/sys/financial/order_validations/' + $scope.date, {
params: {
use_cache: !forceRebuild,
},
timeout: 300000,
})
.then(
function (resp) {
$scope.report = resp.data
$scope.notExistsKeys = []
$scope.notEqualsKeys = []
angular.forEach($scope.report.not_exists, function (item) {
angular.forEach(item, function (val, key) {
if ($scope.notExistsKeys.indexOf(key) < 0) {
$scope.notExistsKeys.push(key)
}
}) })
}) },
angular.forEach($scope.report.not_equals, function (item) { ])
angular.forEach(item, function (val, key) { app.controller('orderValidCalendarCtrl', [
if ($scope.notExistsKeys.indexOf(key) < 0) { '$scope',
$scope.notExistsKeys.push(key) '$http',
} '$filter',
'$state',
'commonDialog',
function ($scope, $http, $filter, $state, commonDialog) {
$scope.today = new Date()
$scope.loadValidatedDates = function (month) {
let monthStr = $filter('date')(month, 'yyyyMM')
$http.get('/sys/financial/validated_dates/' + monthStr).then(function (resp) {
$scope.validatedDates = resp.data
}) })
})
},
function (resp) {
commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' })
$scope.report = null
} }
) $scope.findReport = function (dateStr) {
} if ($scope.validatedDates == null) {
$scope.startValid(false) return null
}
let filtered = $scope.validatedDates.filter(rp => rp.date === dateStr)
return filtered.length ? filtered[0] : null
}
$scope.checkDetail = function (date) {
const filterItem = $scope.validatedDates.filter(rp => rp.date === date)
const dateStr = date.replace(/\//g, '')
if (filterItem.length) {
if (filterItem[0].isOld) {
$state.go('order_valid.report', {date: dateStr})
} else {
sessionStorage.setItem('warningLevel', filterItem[0].warning_level)
$state.go('order_valid.report_new', {date: dateStr})
}
} else {
commonDialog
.confirm({
title: 'Confirm',
content: '是否确认重新执行对账?',
})
.then(function () {
$http
.get('/sys/financial/order_validations/' + dateStr, {
params: {
use_cache: false,
},
timeout: 300000,
})
.then(
function () {
$state.reload()
},
function (resp) {
$state.reload()
}
)
})
}
}
},
])
// old
app.controller('orderValidationCtrl', [
'$scope',
'$http',
'$filter',
'$stateParams',
'commonDialog',
function ($scope, $http, $filter, $stateParams, commonDialog) {
$scope.date = $stateParams.date
$scope.startValid = function (forceRebuild) {
$scope.report = {loading: true}
$http
.get('/sys/financial/order_validations/' + $scope.date, {
params: {
use_cache: !forceRebuild,
},
timeout: 300000,
})
.then(
function (resp) {
$scope.report = resp.data
$scope.notExistsKeys = []
$scope.notEqualsKeys = []
angular.forEach($scope.report.not_exists, function (item) {
angular.forEach(item, function (val, key) {
if ($scope.notExistsKeys.indexOf(key) < 0) {
$scope.notExistsKeys.push(key)
}
})
})
angular.forEach($scope.report.not_equals, function (item) {
angular.forEach(item, function (val, key) {
if ($scope.notExistsKeys.indexOf(key) < 0) {
$scope.notExistsKeys.push(key)
}
})
})
},
function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
$scope.report = null
}
)
}
$scope.startValid(false)
$scope.fixReport = function () { $scope.fixReport = function () {
var datePattern = $filter('date')($scope.valid.date, 'yyyyMMdd') var datePattern = $filter('date')($scope.valid.date, 'yyyyMMdd')
$http $http
.get('/sys/financial/order_validations', { .get('/sys/financial/order_validations', {
params: { params: {
date: datePattern, date: datePattern,
fix: true, fix: true,
}, },
}) })
.then( .then(
function (resp) { function (resp) {
commonDialog.alert({ title: 'Success', content: '修复完毕', type: 'success' }) commonDialog.alert({title: 'Success', content: '修复完毕', type: 'success'})
}, },
function (resp) { function (resp) {
commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' }) commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
}
)
} }
) },
} ])
}, // new
]) app.controller('orderValidationNewCtrl', [
// new '$scope',
app.controller('orderValidationNewCtrl', [ '$http',
'$scope', '$sce',
'$http', '$stateParams',
'$stateParams', 'commonDialog',
'commonDialog', '$uibModal',
'$uibModal', function ($scope, $http, $sce, $stateParams, commonDialog, $uibModal) {
function ($scope, $http, $stateParams, commonDialog, $uibModal) { // 清除sessionStorage
// 清除sessionStorage $scope.$on('$destroy', function () {
$scope.$on('$destroy', function () { sessionStorage.clear()
sessionStorage.clear()
})
$scope.date = angular.copy($stateParams.date)
$scope.date = $scope.date.substr(0, 4) + '-' + $scope.date.substr(4, 2) + '-' + $scope.date.substr(6)
$scope.warningLevel = JSON.parse(sessionStorage.getItem('warningLevel'))
$scope.validItAgain = function () {
commonDialog
.confirm({
title: 'Confirm reconciliations',
contentHtml: $sce.trustAsHtml('<input type="checkbox" id="isSendMessage">Agree to send push message'),
})
.then(function () {
var isSendMessage = document.getElementById('isSendMessage').checked
$http
.get('/sys/financial/order_validations/' + $stateParams.date, {
params: {
use_cache: false,
is_send_message: isSendMessage,
},
timeout: 300000,
})
.then($scope.startValid())
}) })
} $scope.date = angular.copy($stateParams.date)
// 加载渠道信息 $scope.date = $scope.date.substr(0, 4) + '-' + $scope.date.substr(4, 2) + '-' + $scope.date.substr(6)
$scope.startValid = function () { $scope.warningLevel = JSON.parse(sessionStorage.getItem('warningLevel'))
$http $scope.validItAgain = function () {
.get('/sys/financial/order_validation_new/' + $stateParams.date, { commonDialog
timeout: 300000, .confirm({
}) title: 'Confirm reconciliations',
.then( contentHtml: $sce.trustAsHtml('<input type="checkbox" id="isSendMessage">Agree to send push message'),
function (resp) { })
$scope.channelList = [] .then(function () {
for (let key in resp.data) { var isSendMessage = document.getElementById('isSendMessage').checked
const obj = {} $http
obj.key = key .get('/sys/financial/order_validations/' + $stateParams.date, {
obj.channel = resp.data[key] params: {
obj.selected = false use_cache: false,
$scope.channelList.push(obj) is_send_message: isSendMessage,
} },
$scope.channelList.map(item => { timeout: 300000,
const arr = item.channel.filter(f => { })
return f.success === false .then($scope.startValid())
}) })
item.status = arr.length ? 'FAILED' : 'SUCCESS' }
item.success = arr.length ? false : true // 加载渠道信息
}) $scope.startValid = function () {
if (sessionStorage.getItem('channel')) { $http
const channel = JSON.parse(sessionStorage.getItem('channel')) .get('/sys/financial/order_validation_new/' + $stateParams.date, {
channel.map(item => { timeout: 300000,
$scope.channelList.filter(f => f.key === item.key)[0].selected = item.selected })
}) .then(
} else { function (resp) {
$scope.channelList[0].selected = true $scope.channelList = []
} for (let key in resp.data) {
console.log($scope.channelList) const obj = {}
}, obj.key = key
function (resp) { obj.channel = resp.data[key]
commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' }) obj.selected = false
$scope.channelList.push(obj)
}
$scope.channelList.map(item => {
const arr = item.channel.filter(f => {
return f.success === false
})
item.status = arr.length ? 'FAILED' : 'SUCCESS'
item.success = arr.length ? false : true
})
if (sessionStorage.getItem('channel')) {
const channel = JSON.parse(sessionStorage.getItem('channel'))
channel.map(item => {
$scope.channelList.filter(f => f.key === item.key)[0].selected = item.selected
})
} else {
$scope.channelList[0].selected = true
}
console.log($scope.channelList)
},
function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
}
)
} }
)
}
$scope.startValid()
// 受否折叠
$scope.fold = function (index) {
$scope.channelList[index].selected = !$scope.channelList[index].selected
}
// 是否清除缓存
$scope.clear = function (channelName, flag) {
$http.post('/sys/financial/redo_channel_validation/' + $stateParams.date, { channel: channelName, cache: flag }).then(
function () {
$scope.startValid() $scope.startValid()
}, // 受否折叠
function (resp) { $scope.fold = function (index) {
commonDialog.alert({ title: 'failed', content: resp.data.message, type: 'error' }) $scope.channelList[index].selected = !$scope.channelList[index].selected
} }
) // 是否清除缓存
} $scope.clear = function (channelName, flag) {
// 处理 $http.post('/sys/financial/redo_channel_validation/' + $stateParams.date, {
$scope.handle = function (merchant) { channel: channelName,
sessionStorage.setItem('channel', JSON.stringify($scope.channelList)) cache: flag
$uibModal }).then(
.open({
templateUrl: '/static/payment/validation/templates/handle_desc.html',
controller: [
'$scope',
'$http',
'commonDialog',
'merchantInfo',
function ($scope, $http, commonDialog, merchantInfo) {
if (merchantInfo.resolve_msg) {
$scope.message = merchantInfo.resolve_msg
}
$scope.confirm = function () {
$http.post('/sys/financial/mark/resolve/message', { log_id: merchantInfo.log_id, message: $scope.message }).then(
function () { function () {
$scope.$close() $scope.startValid()
}, },
function (resp) { function (resp) {
commonDialog.alert({ title: 'failed', content: resp.data.message, type: 'error' }) commonDialog.alert({title: 'failed', content: resp.data.message, type: 'error'})
} }
) )
}
// 处理
$scope.handle = function (merchant) {
sessionStorage.setItem('channel', JSON.stringify($scope.channelList))
$uibModal
.open({
templateUrl: '/static/payment/validation/templates/handle_desc.html',
controller: [
'$scope',
'$http',
'commonDialog',
'merchantInfo',
function ($scope, $http, commonDialog, merchantInfo) {
if (merchantInfo.resolve_msg) {
$scope.message = merchantInfo.resolve_msg
}
$scope.confirm = function () {
$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'
})
}
)
}
},
],
resolve: {
merchantInfo: [
'$stateParams',
function () {
return merchant
},
],
},
})
.result.then(function () {
$scope.startValid()
})
}
// 下载
$scope.download = function (merchant, keyName) {
if (merchant != null) {
const params = {}
params.channel = keyName
params.pid = merchant.pid
params.billDate = merchant.bill_date
params.noCache = false
params.billType = ''
window.open(
'/sys/financial/downloadChannelReconciliationFile?billDate=' +
params.billDate +
'&channel=' +
params.channel +
'&noCache=' +
params.noCache +
'&pid=' +
params.pid +
'&billType=' +
params.billType
)
} }
}, }
], // 查看what
resolve: { $scope.checkStatus = function (transactionId) {
merchantInfo: [ $http.get('/sys/financial/get/transaction/status/' + transactionId, {}).then(
'$stateParams', function (resp) {
function () { commonDialog.alert({title: resp.data.statusInfo, content: '', type: 'success'})
return merchant },
}, function (resp) {
], commonDialog.alert({title: 'failed', content: resp.data.message, type: 'error'})
}, }
}) )
.result.then(function () { }
$scope.startValid() },
}) ])
} return app
// 下载
$scope.download = function (merchant, keyName) {
if (merchant != null) {
const params = {}
params.channel = keyName
params.pid = merchant.pid
params.billDate = merchant.bill_date
params.noCache = false
params.billType = ''
window.open(
'/sys/financial/downloadChannelReconciliationFile?billDate=' +
params.billDate +
'&channel=' +
params.channel +
'&noCache=' +
params.noCache +
'&pid=' +
params.pid +
'&billType=' +
params.billType
)
}
}
// 查看what
$scope.checkStatus = function (transactionId) {
$http.get('/sys/financial/get/transaction/status/' + transactionId, {}).then(
function (resp) {
commonDialog.alert({ title: resp.data.statusInfo, content: '', type: 'success' })
},
function (resp) {
commonDialog.alert({ title: 'failed', content: resp.data.message, type: 'error' })
}
)
}
},
])
return app
}) })

@ -110,7 +110,7 @@
</td> </td>
<td ng-bind="apply.apply_username"></td> <td ng-bind="apply.apply_username"></td>
<td ng-bind="apply.create_time|date:'dd/MMM/yyyy'"></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 <i class="fa fa-check"></i> PASS
</a>| </a>|
<a class="text-primary" role="button" title="REFUSE" style="color: red" ng-click="refuseApply(apply)"> <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'){ if(window.openmobilefun == 'alipay'){
paymentLink = '/api/v1.0/share_code/business/bills/'+window.billInfo.bill_code_id+'/alipay/mobile'; paymentLink = '/api/v1.0/share_code/business/bills/'+window.billInfo.bill_code_id+'/alipay/mobile';
}else{ }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(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'; 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'){ if(paymentFun == 'Bank'){
@ -184,16 +182,13 @@ $(document).ready(function () {
if(window.openmobilefun == 'alipay'){ if(window.openmobilefun == 'alipay'){
paymentLink = '/api/v1.0/share_code/bills/payment/orders/'+window.billInfo.bill_code_id+'/alipay/share_link' paymentLink = '/api/v1.0/share_code/bills/payment/orders/'+window.billInfo.bill_code_id+'/alipay/share_link'
}else{ }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(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' 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'){ if(paymentFun == 'Bank'){

@ -1,4 +1,4 @@
window = {}; window = window || {};
$(function () { $(function () {
'use strict'; 'use strict';
var winHeight = $(window).height(); var winHeight = $(window).height();
@ -6,7 +6,11 @@ $(function () {
if (ua.indexOf('micromessenger') >= 0) { if (ua.indexOf('micromessenger') >= 0) {
$(".weixin-tip").show().css("height", winHeight); $(".weixin-tip").show().css("height", winHeight);
} else { } else {
location.href = window.target_href; if (!window.retry_flag) {
location.href = window.target_href;
} else {
checkOrderStd(window.client_moniker, window.partner_order_id, true)
}
} }
decode(); decode();
@ -17,21 +21,59 @@ $(function () {
$('#complete').bind('touchstart', function () { $('#complete').bind('touchstart', function () {
checkOrderStd(window.client_moniker, window.partner_order_id, false); 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 () { $('#continue_use_browser').bind('touchstart', function () {
location.href = window.target_href; 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() { function decode() {
var redirect = window.redirect; var redirect = window.redirect;
while (redirect.indexOf('://') < 0) { while (redirect.indexOf('://') < 0) {
redirect = decodeURIComponent(redirect); redirect = decodeURIComponent(redirect);
if (redirect == window.redirect) { if (redirect === window.redirect) {
break; break;
} }
window.redirect = redirect; window.redirect = redirect;
} }
} }
function checkOrderStd(clientMoniker, merchantOrderId, needLoop) { function checkOrderStd(clientMoniker, merchantOrderId, needLoop) {
if (!clientMoniker || !merchantOrderId) { if (!clientMoniker || !merchantOrderId) {
return; 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