风控邮件

master
james.zhao 6 years ago
parent dd11125c0f
commit ccbd5a9c3a

@ -79,4 +79,6 @@ public interface OrderMapper {
List<JSONObject> listAnalysisClientCustomer(JSONObject params);
PageList<JSONObject> listTransactionsForApp(JSONObject params, PageBounds pageBounds);
JSONObject findOrderById(@Param("order_id") String orderId);
}

@ -4,9 +4,12 @@ import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
import com.alibaba.fastjson.JSONObject;
import org.apache.ibatis.annotations.Param;
@AutoMapper(tablename = "risk_material", pkName = "material_id")
public interface RiskMaterialMapper {
@AutoSql(type = SqlType.INSERT)
void save(JSONObject material);
JSONObject findOperatorById(@Param("risk_id") String risk_id);
}

@ -17,6 +17,8 @@ public interface MailService {
String sendEmail(String title, String mailTos, String mailCcs, String content, List<JSONObject> attachFiles) throws URISyntaxException, IOException;
String sendRiskEmail(String title, String mailTos, String mailCcs, String content, int order_type) throws URISyntaxException, IOException;
List<JSONObject> checkEmailStatus(String emailId);
void removeUnsub(Long id);

@ -266,4 +266,38 @@ public class MailServiceImp implements MailService {
}
}
@Override
public String sendRiskEmail(String title, String mailTos, String mailCcs, String content, int order_type) throws URISyntaxException, IOException {
NoticeBean noticeBean = new NoticeBean();
noticeBean.setTitle(title);
List<JSONObject> mailClients = new ArrayList<>();
JSONObject mailClient = new JSONObject();
mailClient.put("mailto", mailTos);
mailClient.put("mailcc", mailCcs);
mailClients.add(mailClient);
noticeBean.setMailClients(mailClients);
noticeBean.setContent(content);
noticeBean.setSenderAddress("riskcontrol@royalpay.com.au");
noticeBean.setPassword("RPrisk123");
if(order_type == 1 || order_type == 2){
noticeBean.setSenderAddress("risk@royalpay.com.au");
noticeBean.setPassword("Tunnelrisk123");
}
String postUrl = mailHost + "/mail/single?" + generateMailSignParam();
HttpRequestResult result = null;
try {
logger.info("===sendEmail===noticeBean:" + JSON.toJSON(noticeBean));
result = new HttpRequestGenerator(postUrl, RequestMethod.POST).setJSONEntity(noticeBean).setTimeout(60_000).execute();
if (result.isSuccess()) {
String mail_id = result.getResponseContentJSONObj().getString("mail_id");
return mail_id;
//System.out.println("send Mail=============="+mail_id);
} else {
throw new ServerErrorException("Error Connection");
}
} catch (URISyntaxException e) {
throw new ServerErrorException("Error Connection");
}
}
}

@ -57,4 +57,17 @@ public interface RiskBusinessService {
* @param riskId
*/
void downloadAuditMaterialZiP(String riskId, HttpServletResponse response);
/**
*
* @param riskId
*/
void sendUploadEmail(String riskId);
/**
*
* @param riskId
*/
void sendRefuseEmail(String riskId);
}

@ -0,0 +1,24 @@
package au.com.royalpay.payment.manage.riskbusiness.core;
import com.alibaba.fastjson.JSONObject;
public interface RiskUploadService {
/**
*
* @param material
*/
void submitMaterial(JSONObject material);
/**
*
* @param codeKey
*/
void deleteUploadMailKey(String codeKey);
/**
*
* @param codeKey
* @param risk_id
*/
void checkUploadMailKey(String codeKey,String risk_id);
}

@ -1,18 +1,30 @@
package au.com.royalpay.payment.manage.riskbusiness.core.impl;
import au.com.royalpay.payment.core.exceptions.EmailException;
import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
import au.com.royalpay.payment.manage.mappers.payment.OrderMapper;
import au.com.royalpay.payment.manage.mappers.riskbusiness.RiskEventMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientBDMapper;
import au.com.royalpay.payment.manage.notice.core.MailService;
import au.com.royalpay.payment.manage.riskbusiness.core.RiskBusinessService;
import au.com.royalpay.payment.tools.env.PlatformEnvironment;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.threadpool.RoyalThreadPoolExecutor;
import au.com.royalpay.payment.tools.utils.PageListUtils;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.Order;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import org.thymeleaf.context.Context;
import org.thymeleaf.spring4.SpringTemplateEngine;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@ -20,9 +32,13 @@ import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.Date;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import java.util.concurrent.TimeUnit;
/**
* @Author lvjian
@ -31,14 +47,23 @@ import java.util.zip.ZipOutputStream;
@Service
public class RiskBusinessServiceImpl implements RiskBusinessService {
@Autowired
@Resource
private RiskEventMapper riskEventMapper;
@Autowired
private OrderMapper orderMapper;
@Autowired
@Resource
private ClientMapper clientMapper;
@Resource
private ClientBDMapper clientBDMapper;
@Resource
private OrderMapper orderMapper;
@Resource
private StringRedisTemplate stringRedisTemplate;
@Resource
private SpringTemplateEngine thymeleaf;
@Resource
private MailService mailService;
@Resource
private RoyalThreadPoolExecutor royalThreadPoolExecutor;
private final String UPLOAD_MAIL_PREFIX = "UPLOAD_MAIL";
@Override
public List<JSONObject> getRiskEvents(JSONObject params) {
@ -87,6 +112,13 @@ public class RiskBusinessServiceImpl implements RiskBusinessService {
@Override
public void addRiskEvent(JSONObject params) {
JSONObject client = clientMapper.findClientByMoniker(params.getString("client_moniker"));
if(client == null){
throw new InvalidShortIdException();
}
if(client.containsKey("sub_merchant_id")){
params.put("sub_merchant_id",client.getString("sub_merchant_id"));
}
riskEventMapper.save(params);
}
@ -123,4 +155,93 @@ public class RiskBusinessServiceImpl implements RiskBusinessService {
e.printStackTrace();
}
}
@Override
public void sendUploadEmail(String riskId) {
JSONObject event = getRiskEventDetail(riskId);
Context ctx = getMailContext(event);
final List<String> emails = (List<String>)ctx.getVariable("emails");
final String content = thymeleaf.process("mail/risk_upload_mail.html", ctx);
royalThreadPoolExecutor.execute(() -> {
try {
String emailId = mailService.sendRiskEmail("Your merchants needs to submit risk materials", emails.isEmpty() ? "" : StringUtils.join(emails, ","),
"", content, event.getIntValue("order_type"));
event.put("email_status",1);
event.put("result_type",1);
riskEventMapper.update(event);
} catch (Exception e) {
throw new EmailException("Email Sending Failed", e);
}
});
}
@Override
public void sendRefuseEmail(String riskId) {
JSONObject event = getRiskEventDetail(riskId);
Context ctx = getMailContext(event);
ctx.setVariable("refuse",true);
final List<String> emails = (List<String>)ctx.getVariable("emails");
final String content = thymeleaf.process("mail/risk_upload_mail.html", ctx);
royalThreadPoolExecutor.execute(() -> {
try {
String emailId = mailService.sendRiskEmail("Your merchants needs to resubmit risk materials", emails.isEmpty() ? "" : StringUtils.join(emails, ","),
"", content, event.getIntValue("order_type"));
event.put("email_status",2);
event.put("result_type",4);
riskEventMapper.update(event);
} catch (Exception e) {
throw new EmailException("Email Sending Failed", e);
}
});
}
private Context getMailContext(JSONObject event){
JSONObject client = clientMapper.findClientByMonikerAll(event.getString("client_moniker"));
if (client == null) {
throw new InvalidShortIdException();
}
String codeKey = RandomStringUtils.random(20, true, true);
while(stringRedisTemplate.boundValueOps(getRiskUploadKey(codeKey)).get()!=null ){
codeKey = RandomStringUtils.random(20, true, true);
}
String codeKeyValue = RandomStringUtils.random(10, true, true);
String expireDay = "7";
stringRedisTemplate.boundValueOps(getRiskUploadKey(codeKey)).set(codeKeyValue, Long.parseLong(expireDay), TimeUnit.DAYS);
String uploadUrl = PlatformEnvironment.getEnv().concatUrl("/risk/upload/") + event.getString("risk_id") + "/" + codeKey;
List<JSONObject> bds = clientBDMapper.listClientBDInfoAvailable(client.getIntValue("client_id"), new Date());
List<String> bdNames = new ArrayList<>();
List<String> emails = new ArrayList<>();
for (JSONObject bd : bds) {
String bdName = bd.getString("display_name");
if (StringUtils.isNotEmpty(bdName)) {
bdNames.add(bdName);
}
String email = bd.getString("email");
if (StringUtils.isNotEmpty(email)) {
emails.add(email);
}
}
String bdNamesStr = bdNames.isEmpty() ? "" : StringUtils.join(bdNames, ",");
String reply_date = DateFormatUtils.format(DateUtils.addDays(event.getDate("reply_email_date"),-1),"yyyy年MM月dd日");
String[] orderIds = event.getString("order_ids").split(",");
List<JSONObject> orders = new ArrayList();
for(String orderId : orderIds){
JSONObject order = orderMapper.findOrderById(orderId);
if(order==null){
throw new BadRequestException("Order: "+orderId+" not exists");
}
orders.add(order);
}
Context ctx = new Context();
ctx.setVariable("bdNamesStr", bdNamesStr);
ctx.setVariable("reply_date", reply_date);
ctx.setVariable("orders", orders);
ctx.setVariable("client", client);
ctx.setVariable("uploadUrl", uploadUrl);
ctx.setVariable("emails", emails);
return ctx;
}
private String getRiskUploadKey(String codeKey){
return UPLOAD_MAIL_PREFIX + codeKey;
}
}

@ -0,0 +1,95 @@
package au.com.royalpay.payment.manage.riskbusiness.core.impl;
import au.com.royalpay.payment.core.exceptions.EmailException;
import au.com.royalpay.payment.manage.mappers.riskbusiness.RiskEventMapper;
import au.com.royalpay.payment.manage.mappers.riskbusiness.RiskMaterialMapper;
import au.com.royalpay.payment.manage.notice.core.MailService;
import au.com.royalpay.payment.manage.riskbusiness.core.RiskBusinessService;
import au.com.royalpay.payment.manage.riskbusiness.core.RiskUploadService;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.threadpool.RoyalThreadPoolExecutor;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import org.thymeleaf.context.Context;
import org.thymeleaf.spring4.SpringTemplateEngine;
import javax.annotation.Resource;
import java.text.ParseException;
import java.util.Date;
@Service
public class RiskUploadServiceIpml implements RiskUploadService {
@Resource
private RiskMaterialMapper riskMaterialMapper;
@Resource
private RiskEventMapper riskEventMapper;
@Resource
private StringRedisTemplate stringRedisTemplate;
@Resource
private MailService mailService;
@Resource
private RoyalThreadPoolExecutor royalThreadPoolExecutor;
@Resource
private SpringTemplateEngine thymeleaf;
private final String UPLOAD_MAIL_PREFIX = "UPLOAD_MAIL";
@Override
public void submitMaterial(JSONObject material) {
riskMaterialMapper.save(material);
JSONObject event = riskEventMapper.findById(material.getString("risk_id"));
event.put("result_type",2);
riskEventMapper.update(event);
JSONObject operator = riskMaterialMapper.findOperatorById(material.getString("risk_id"));
if(operator.containsKey("email")){
Context ctx = new Context();
ctx.setVariable("client_moniker", event.getString("client_moniker"));
ctx.setVariable("short_name", event.getString("short_name"));
ctx.setVariable("create_time", DateFormatUtils.format(event.getDate("create_time"),"yyyy-MM-dd HH:mm:ss"));
ctx.setVariable("operator", operator.getString("display_name"));
final String content = thymeleaf.process("mail/risk_operator_notice", ctx);
royalThreadPoolExecutor.execute(() -> {
try {
String emailId = mailService.sendRiskEmail(event.getString("client_moniker")+" has submitted the material",operator.getString("email") ,
"", content, event.getIntValue("order_type"));
} catch (Exception e) {
throw new EmailException("Email Sending Failed", e);
}
});
}
}
@Override
public void deleteUploadMailKey(String codeKey) {
stringRedisTemplate.delete(getRiskUploadKey(codeKey));
}
@Override
public void checkUploadMailKey(String codeKey,String risk_id) {
JSONObject event = riskEventMapper.findById(risk_id);
//到期日前一天的下午6点前url可用
try {
String reply = DateFormatUtils.format(DateUtils.addDays(event.getDate("reply_email_date"),-1),"yyyy-MM-dd 18:00:00");
if(new Date().after( DateUtils.parseDate(reply,new String[]{"yyyy-MM-dd HH:mm:ss"}))){
deleteUploadMailKey(codeKey);
throw new BadRequestException("Url expired");
}
} catch (ParseException e) {
e.printStackTrace();
}
if (StringUtils.isNotEmpty(codeKey)) {
String redisUpload = stringRedisTemplate.boundValueOps(getRiskUploadKey(codeKey)).get();
if (redisUpload == null) {
throw new BadRequestException("Url expired");
}
}
}
private String getRiskUploadKey(String codeKey){
return UPLOAD_MAIL_PREFIX + codeKey;
}
}

@ -10,6 +10,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
@ -18,7 +22,8 @@ import java.util.List;
* @Date 2018/10/10 1:12
*/
@RestController
@ManagerMapping(value = "/risk/business/", role = {ManagerRole.OPERATOR, ManagerRole.ADMIN})
//@ManagerMapping(value = "/risk/business/", role = {ManagerRole.OPERATOR, ManagerRole.ADMIN})
@RequestMapping(value = "/risk/business/")
public class RiskBusinessController {
@Autowired
@ -42,6 +47,7 @@ public class RiskBusinessController {
@PostMapping(value = "events")
public void RegisterRiskEvent(@RequestBody JSONObject params,
@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
params.put("fillin_id", manager.getString("manager_id"));
params.put("fillin_person", manager.getString("display_name"));
riskBusinessService.addRiskEvent(params);
}
@ -55,5 +61,16 @@ public class RiskBusinessController {
public void downloadComplianceZip(@PathVariable("risk_id") String riskId, HttpServletResponse response) throws Exception {
riskBusinessService.downloadAuditMaterialZiP(riskId, response);
}
@RequestMapping(value = "/{risk_id}/upload_mail",method = RequestMethod.PUT)
public void uploadEmail(@PathVariable String risk_id) {
riskBusinessService.sendUploadEmail(risk_id);
}
@RequestMapping(value = "/{risk_id}/refuse",method = RequestMethod.PUT)
public void refuseEmail(@PathVariable String risk_id) {
riskBusinessService.sendRefuseEmail(risk_id);
}
}

@ -0,0 +1,42 @@
package au.com.royalpay.payment.manage.riskbusiness.web;
import au.com.royalpay.payment.manage.riskbusiness.core.RiskUploadService;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource;
@RestController
@RequestMapping("/risk/upload")
public class RiskFileUploadController {
@Resource
private RiskUploadService riskUploadService;
/**
*
* @param codeKey
* @param risk_id
* @return
*/
@RequestMapping(value = "/{risk_id}/{codeKey}", method = RequestMethod.GET)
public ModelAndView jumpVerifyMail(@PathVariable String codeKey, @PathVariable String risk_id) {
//检查codekey是否有效
riskUploadService.checkUploadMailKey(codeKey,risk_id);
ModelAndView view = new ModelAndView("mail/risk_upload");
view.addObject("codeKey", codeKey);
view.addObject("risk_id",risk_id);
return view;
}
/**
*
* @param codeKey
* @param material
*/
@RequestMapping(value = "/{codeKey}", method = RequestMethod.POST)
public void upload(@PathVariable String codeKey, @RequestBody JSONObject material) {
riskUploadService.submitMaterial(material);
riskUploadService.deleteUploadMailKey(codeKey);
}
}

@ -27,6 +27,10 @@ public class AttachmentController {
public JSONObject uploadImage(@RequestParam MultipartFile file) throws IOException {
return attachmentClient.uploadFile(file,false);
}
@RequestMapping(value = "/riskFiles", method = RequestMethod.POST)
public JSONObject uploadRiskImage(@RequestParam MultipartFile file) throws IOException {
return attachmentClient.uploadFile(file,false);
}
@RequestMapping(value = "/secret_files", method = RequestMethod.POST)
@RequirePartner

@ -738,5 +738,80 @@
<if test="clearing_status!=null">and t.clearing_status=#{clearing_status}</if>
</where>
</select>
<select id="findOrderById" resultType="com.alibaba.fastjson.JSONObject">
SELECT
o.order_id order_id,
o.currency,
o.channel,
o.create_time,
o.confirm_time pay_time,
format(o.total_amount,2) total_amount,
format(o.display_amount,2) display_amount,
format(o.refund_amount,2) refund_amount,
format(t.exchange_rate,6) exchange_rate,
CASE o.status
WHEN 0
THEN 'Creating'
WHEN 1
THEN 'Failed Create Order'
WHEN 2
THEN 'Wait For Payment'
WHEN 3
THEN 'Closed'
WHEN 4
THEN 'Payment Failed'
WHEN 5
THEN 'Payment Successful'
WHEN 6
THEN 'Partial Refund'
WHEN 7
THEN 'Full Refund'
END AS `status`,
CASE o.gateway
WHEN 0
THEN '线下扫码'
WHEN 1
THEN '线下扫码'
WHEN 2
THEN '商户静态码'
WHEN 3
THEN '线上网关'
WHEN 4
THEN 'JSAPI网关'
WHEN 5
THEN '线下网关'
WHEN 6
THEN '线下网关'
WHEN 7
THEN '商户静态码'
WHEN 8
THEN 'Mobile H5'
WHEN 9
THEN '第三方网关'
WHEN 10
THEN 'APP网关'
WHEN 11
THEN '账单码'
WHEN 12
THEN '小程序'
WHEN 13
THEN '原生二维码'
WHEN 14
THEN '账单链接'
END AS gateway,
p.client_moniker partner_code,
p.short_name partner_name,
format(t.clearing_amount,2) clearing_amount
FROM pmt_orders o
INNER JOIN sys_clients p
ON p.client_id = o.client_id
AND p.is_valid = 1
LEFT JOIN pmt_transactions t
ON t.order_id = o.order_id
AND t.refund_id IS NULL
AND t.transaction_type = 'Credit'
AND t.channel != 'System'
WHERE o.order_id = #{order_id}
</select>
</mapper>

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="au.com.royalpay.payment.manage.mappers.riskbusiness.RiskMaterialMapper">
<select id="findOperatorById" resultType="com.alibaba.fastjson.JSONObject">
SELECT m.*
FROM risk_material r
LEFT JOIN risk_event e
ON r.risk_id = e.risk_id
LEFT JOIN sys_managers m
ON e.fillin_id = m.manager_id
WHERE r.risk_id = #{risk_id}
LIMIT 1
</select>
</mapper>

@ -0,0 +1,24 @@
<html xmlns:th="http://www.thymeleaf.org" lang="zh">
<h4>Dear <span th:text="${operator}"></span> :</h4>
<p>您好,您于<span th:text="${create_time}"></span>创建的风控事件单已经接收到了商户<span th:text="${short_name}"></span>(<span th:text="${client_moniker}"></span>)的风控材料,请及时审核。</p>
<h4>Best Regards</h4>
<p>
<img style="width: 120px;height: 120px"
src="https://mpay.royalpay.com.au/static/images/logo_new.jpg"> <br>
Contact Us<br>
Email:<br>
<a href="mailto:info@royalpay.com.au">info@royalpay.com.au</a> <br>
Tel:<br>
1300 10 77 50<br>
<br>
Service WeChat Account:<br>
<img src="https://mpay.royalpay.com.au/static/images/customer_service.jpg"
style="width: 60px"><br>
Level 14, 383 Kent Street, Sydney NSW 2000<br>
<br>
Level 11, 15 William Street, Melbourne VIC 3000
</p>
<p>Tunnel Show Pty Ltd trading as RoyalPay<br>
Representative of AFSL licensee 448066
</p>
</html>

@ -0,0 +1,434 @@
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1" user-scalable="no">
<title>RoyalPay | Risk Materials</title>
<meta name="description"
content=" As Australias first WeChat Cross-Border payment gatewayWe are working to build a bridge between Australian merchants and Chinese consumers.Marketing Tools like WeChat Coupons,Membership Cards,Lucky Money are provided to all merchants to Increase sales which is proved effective in the wechat ecology.">
<meta name="keywords"
content="澳洲微信支付、澳洲跨境支付、行业解决方案、澳洲支付、澳洲商圈、微信营销、公众号、Wechat、Official Account、Industry Solution、Cross-Border Payment、Australia Wechat">
<!-- Bootstrap 3.3.5 -->
<link href="/static/css/merchant_application.css" rel="stylesheet">
<link href="/static/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Font Awesome -->
<link href="/static/lib/font-awesome-4.6.3/css/font-awesome.min.css" rel="stylesheet">
<!-- Font Awesome -->
<!-- Ionicons -->
<!-- Theme style -->
<link rel="stylesheet" href="/static/css/index_register.css">
<link rel="stylesheet" href="/static/lib/dist/css/AdminLTE.min.css">
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<script type="text/javascript" src="/static/lib/jquery/jquery-2.1.4.min.js"></script>
<script type="text/javascript" src="/static/lib/angularjs/angular.min.js"></script>
<script type="text/javascript" src="/static/lib/angularjs/angular-messages.js"></script>
<script type="text/javascript" src="/static/lib/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/static/riskupload/risk_upload.js"></script>
<script type="text/javascript" src="/static/lib/ngfileupload/ng-file-upload.min.js"></script>
<style type="text/css">
.register-box-bg {
background-color: rgba(255, 255, 255, 0.9);
box-shadow: 0px 2px 20px 2px rgba(0, 0, 0, 0.3);
filter: alpha(opacity=40);
/*opacity: 0.7;*/
}
@media (min-width: 544px) {
.content-with {
width: 800px;
}
.register-box {
margin-top: 10%;
}
body .progress {
display: block;
}
body .step_show {
display: none;
}
.button_width{
width: 20%;
}
.input-group .form-control{
position: relative;
z-index: 2;
float: left;
width: 80%;
margin-bottom: 0;
}
}
@media (max-width: 544px) {
body .progress {
display: none;
}
.content_align{
width: 80%;
}
body .step_show {
display: block;
}
.button_width{
width: 35%;
}
.input-group .form-control{
position: relative;
z-index: 2;
float: left;
width: 65%;
margin-bottom: 0;
}
.register-box {
width: 89%;
}
}
@media (max-width: 544px) {
.logo-width {
width: 50%;
}
}
</style>
<script>
var _hmt = _hmt || [];
(function () {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?d7e727bd889ea69d369cba051844dfe5";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
</head>
<body class="pace-done fp-viewing-0" ng-app="riskUploadApp" ng-controller="riskUploadCtrl">
<!--[if lte IE 8]>
<span class="lower-ie"></span>
<![endif]-->
<div class="pace pace-inactive">
<div class="pace-progress" data-progress-text="100%" data-progress="99"
style="transform: translate3d(100%, 0px, 0px);">
<div class="pace-progress-inner"></div>
</div>
<div class="pace-activity"></div>
</div>
<div id="main">
<div id="page-index" class="register-page">
<nav id="header" class="navbar navbar-dark navbar-full navbar-bg">
<div class="container">
<div class="navbar-header">
<button class="navbar-toggle collapsed" type="button" data-toggle="collapse"
data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="https://www.royalpay.com.au/">
<img src="/static/images/logo.svg" alt="" class="navbar--logo"
style="width: 275px;height: 32px;display: block;margin-top: 3.2%;">
</a>
</div>
<ul class="nav navbar-nav navbar-right navbar-collapse collapse">
<li id="nav-index" class="nav-item">
<a href="https://www.royalpay.com.au/" class="nav-link">Home</a>
</li>
<li class="nav-item dropdown">
<a role="button" class="nav-link dropdown-toggle" data-toggle="dropdown">Wechat</a>
<ul class="dropdown-menu">
<li><a href="https://www.royalpay.com.au/feature.html" target="_blank">Features</a></li>
<li><a href="https://www.royalpay.com.au/industry.html" target="_blank">Industry</a></li>
<li><a href="https://www.royalpay.com.au/marketing.html" target="_blank">Marketing</a></li>
</ul>
</li>
<li class="nav-item dropdown">
<a role="button" class="nav-link dropdown-toggle" data-toggle="dropdown">GATEWAY API</a>
<ul class="dropdown-menu">
<li><a href="https://mpay.royalpay.com.au/docs/en/" target="_blank">En</a></li>
<li><a href="https://mpay.royalpay.com.au/docs/cn/" target="_blank">中文</a></li>
</ul>
</li>
<li class="nav-item">
<a role="button" class="nav-link dropdown-toggle" data-toggle="dropdown">About Us</a>
<ul class="dropdown-menu">
<li><a href="https://www.royalpay.com.au/about.html" target="_blank">About Us</a></li>
<li><a href="https://www.royalpay.com.au/c_news.html">News</a></li>
<li><a href="https://www.royalpay.com.au/c_career.html">Career</a></li>
</ul>
</li>
<li class="nav-item">
<a href="https://www.royalpay.com.au/download.html" class="nav-link">App</a>
</li>
<li class="nav-item hidden-xs hidden-sm">
<a href="https://mpay.royalpay.com.au/login.html" target="_blank"
class="btn btn-success signin">Sign In</a>
</li>
<li class="nav-item hidden-xs hidden-sm">
<a href="https://mpay.royalpay.com.au/partner_register.html" target="_blank"
class="btn btn-success signin">Apply</a>
</li>
</ul>
</div>
</nav>
<div id="fullpage" class="fullpage-wrapper">
<div class="register-box content-with" style="margin-top:4%">
<div class="register-box-body register-box-bg">
<p class="login-box-msg">Easy BusinessEasy Payment</p>
<p class="small text-info">Image size should not exceed 3MB</p>
<form novalidate name="uploadForm">
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-3">* Material No.1</label>
<div class="col-sm-3">
<div class="form-control-static">
<button class="btn btn-primary" type="button"
ngf-select="uploadFile1($file)">
<i class="fa fa-upload"></i> Upload
</button>
</div>
<uib-progressbar value="file1Progress.value"
ng-if="file1Progress"></uib-progressbar>
<img ng-src="{{material.file1_url}}" class="col-sm-10 logo-width"></a>
</div>
<label class="control-label col-sm-3">* Material No.2</label>
<div class="col-sm-3">
<div class="form-control-static">
<button class="btn btn-primary" type="button"
ngf-select="uploadFile2($file)">
<i class="fa fa-upload"></i> Upload
</button>
</div>
<uib-progressbar value="file2Progress.value"
ng-if="file2Progress"></uib-progressbar>
<img ng-src="{{material.file2_url}}" class="col-sm-10 logo-width"></a>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">* Material No.3</label>
<div class="col-sm-3">
<div class="form-control-static">
<button class="btn btn-primary" type="button"
ngf-select="uploadFile3($file)">
<i class="fa fa-upload"></i> Upload
</button>
</div>
<uib-progressbar value="file3Progress.value"
ng-if="file3Progress"></uib-progressbar>
<img ng-src="{{material.file3_url}}" class="col-sm-10 logo-width"></a>
</div>
<label class="control-label col-sm-3">* Material No.4</label>
<div class="col-sm-3">
<div class="form-control-static">
<button class="btn btn-primary" type="button"
ngf-select="uploadFile4($file)">
<i class="fa fa-upload"></i> Upload
</button>
</div>
<uib-progressbar value="file4Progress.value"
ng-if="file4Progress"></uib-progressbar>
<img ng-src="{{material.file4_url}}" class="col-sm-10 logo-width"></a>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">* Material No.5</label>
<div class="col-sm-3">
<div class="form-control-static">
<button class="btn btn-primary" type="button"
ngf-select="uploadFile5($file)">
<i class="fa fa-upload"></i> Upload
</button>
</div>
<uib-progressbar value="file5Progress.value"
ng-if="file5Progress"></uib-progressbar>
<img ng-src="{{material.file5_url}}" class="col-sm-10 logo-width"></a>
</div>
<label class="control-label col-sm-3">* Material No.6</label>
<div class="col-sm-3">
<div class="form-control-static">
<button class="btn btn-primary" type="button"
ngf-select="uploadFile6($file)">
<i class="fa fa-upload"></i> Upload
</button>
</div>
<uib-progressbar value="file6Progress.value"
ng-if="file6Progress"></uib-progressbar>
<img ng-src="{{material.file6_url}}" class="col-sm-10 logo-width"></a>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">* Material No.7</label>
<div class="col-sm-3">
<div class="form-control-static">
<button class="btn btn-primary" type="button"
ngf-select="uploadFile7($file)">
<i class="fa fa-upload"></i> Upload
</button>
</div>
<uib-progressbar value="file7Progress.value"
ng-if="file7Progress"></uib-progressbar>
<img ng-src="{{material.file7_url}}" class="col-sm-10 logo-width"></a>
</div>
<label class="control-label col-sm-3">* Material No.8</label>
<div class="col-sm-3">
<div class="form-control-static">
<button class="btn btn-primary" type="button"
ngf-select="uploadFile8($file)">
<i class="fa fa-upload"></i> Upload
</button>
</div>
<uib-progressbar value="file8Progress.value"
ng-if="file8Progress"></uib-progressbar>
<img ng-src="{{material.file8_url}}" class="col-sm-10 logo-width"></a>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">* Material No.9</label>
<div class="col-sm-3">
<div class="form-control-static">
<button class="btn btn-primary" type="button"
ngf-select="uploadFile9($file)">
<i class="fa fa-upload"></i> Upload
</button>
</div>
<uib-progressbar value="file9Progress.value"
ng-if="file9Progress"></uib-progressbar>
<img ng-src="{{material.file9_url}}" class="col-sm-10 logo-width"></a>
</div>
<label class="control-label col-sm-3">* Material No.10</label>
<div class="col-sm-3">
<div class="form-control-static">
<button class="btn btn-primary" type="button"
ngf-select="uploadFile10($file)">
<i class="fa fa-upload"></i> Upload
</button>
</div>
<uib-progressbar value="file10Progress.value"
ng-if="file10Progress"></uib-progressbar>
<img ng-src="{{material.file10_url}}" class="col-sm-10 logo-width"></a>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">* Description</label>
<div class="col-sm-9">
<textarea class="form-control" required
ng-model="material.description" placeholder="Less than 500 characters"
name="description"
maxlength="500"></textarea>
<input id="codeKey" type="text" class="hidden" name="codeKey"
ng-model="codeKey">
<input id="risk_id" type="text" class="hidden" name="risk_id"
ng_model="material.risk_id">
</div>
</div>
</div>
</div>
</form>
<div style="text-align: center">
<a role="button" style="margin-bottom: 25px;" class="btn btn-success btn-sm ng-scope"
ng-click="submit(uploadForm)">Submit</a>
</div>
</div>
</div>
<script type="text/javascript" data-th-inline="javascript">
$(document).ready(function () {
window.codeKey = /*[[${codeKey}]]*/'';
window.risk_id = /*[[${risk_id}]]*/'';
$('#codeKey').val(window.codeKey).trigger('input');
$('#risk_id').val(window.risk_id).trigger('input');
})
</script>
</div>
<section class="section section-six fp-auto-height footer">
<div class="container">
<div class="row margin-bottom">
<div class="col-md-4 footer-item">
CONTACT US
<hr>
Level 14<br>
383 Kent Street<br>
Sydney NSW 2000<br>
<br>
Level 11<br>
15 William Street<br>
Melbourne VIC 3000<br>
<br>
1300-10-77-50<br>
03 9448 8865<br>
info@royalpay.com.au
</div>
<div class="col-md-4 sitemap footer-item">
SITE MAP
<hr>
<div class="row">
<div class="col-xs-6">
<p><a href="/">RoyalPay</a></p>
<p><a href="https://mpay.royalpay.com.au/docs/en/">Gateway API</a></p>
<p><a href="https://www.royalpay.com.au/industry.html">Industry Solution</a></p>
<p><a href="https://www.royalpay.com.au/marketing.html">Marketing Service</a></p>
</div>
<div class="col-xs-6">
<p><a href="https://www.royalpay.com.au/about.html">About Us</a></p>
<p><a href="https://www.royalpay.com.au/c_news.html">News</a></p>
<p><a href="https://www.royalpay.com.au/c_career.html">Career</a></p>
<p><a href="https://www.royalpay.com.au/download.html">Downloads</a></p>
</div>
</div>
</div>
<div class="col-md-4 footer-item">
SUPPORT
<hr>
<div class="row">
<div class="col-xs-6 qr-box">
<img src="/static/css/img/qr_royalpay.png">
RoyalPay WeChat Official Account
</div>
<div class="col-xs-6 qr-box">
<img src="/static/css/img/qr_service.png">
Customer Service
</div>
</div>
</div>
</div>
</div>
<div class="copyright">
<div class="container">
<div class="row">
<div class="col-xs-12 text-center">
© 2016 Tunnel Show Pty. Ltd. | Representative of AFSL licensee 448066
</div>
</div>
</div>
</div>
</section>
</div>
</div>
</div>
<div id="fp-nav" class="right"></div>
<div id="cli_dialog_div"></div>
</body>
</html>

@ -0,0 +1,53 @@
<html xmlns:th="http://www.thymeleaf.org" lang="zh">
<h4>Dear <span th:text="${bdNamesStr}"></span> :</h4>
<p>您好<span th:if="${refuse}">,您提交的风控材料已被拒绝</span>。请于<span th:text="${reply_date}"></span>下午6:00悉尼时间前提供被查商户<span th:text="${client.short_name}"></span> (<span th:text="${client.client_moniker}"></span>)的以下材料</p>
<p>请提供以下被查单号的小票, 物流单据(如有邮寄产品的情况), 以及消费者与买家的聊天记录等来佐证被查交易单号。 被查交易单号如下:</p>
<table style="border: 1.0px solid;border-collapse: collapse;">
<thead>
<tr>
<th style="border: 1.0px solid;border-collapse: collapse;">Order ID</th>
<th style="border: 1.0px solid;border-collapse: collapse;">Amount</th>
<th style="border: 1.0px solid;border-collapse: collapse;">Input Amount</th>
<th style="border: 1.0px solid;border-collapse: collapse;">AUD Amount</th>
<th style="border: 1.0px solid;border-collapse: collapse;">Exchange Rate</th>
<th style="border: 1.0px solid;border-collapse: collapse;">Status</th>
<th style="border: 1.0px solid;border-collapse: collapse;">Create Time</th>
<th style="border: 1.0px solid;border-collapse: collapse;">Gateway</th>
</tr>
</thead>
<tbody>
<tr th:each="order : ${orders}">
<td th:text="${order.order_id}" style="border: 1.0px solid;border-collapse: collapse;"></td>
<td th:text="${order.total_amount}" style="border: 1.0px solid;border-collapse: collapse;"></td>
<td th:text="${order.display_amount}" style="border: 1.0px solid;border-collapse: collapse;"></td>
<td th:text="${order.clearing_amount}" style="border: 1.0px solid;border-collapse: collapse;"></td>
<td th:text="${order.exchange_rate}" style="border: 1.0px solid;border-collapse: collapse;"></td>
<td th:text="${order.status}" style="border: 1.0px solid;border-collapse: collapse;"></td>
<td th:text="${order.create_time}" style="border: 1.0px solid;border-collapse: collapse;"></td>
<td th:text="${order.gateway}" style="border: 1.0px solid;border-collapse: collapse;"></td>
</tr>
</tbody>
</table>
<p>请点击此链接上传所需材料<a th:href="${uploadUrl}"><span th:text="${uploadUrl}"></span></a></p>
<p>如果提交的材料不齐, 则有关停支付的风险。还请按时提供商户材料并直接回复该邮件, 感谢,辛苦。</p>
<h4>Best Regards</h4>
<p>
<img style="width: 120px;height: 120px"
src="https://mpay.royalpay.com.au/static/images/logo_new.jpg"> <br>
Contact Us<br>
Email:<br>
<a href="mailto:info@royalpay.com.au">info@royalpay.com.au</a> <br>
Tel:<br>
1300 10 77 50<br>
<br>
Service WeChat Account:<br>
<img src="https://mpay.royalpay.com.au/static/images/customer_service.jpg"
style="width: 60px"><br>
Level 14, 383 Kent Street, Sydney NSW 2000<br>
<br>
Level 11, 15 William Street, Melbourne VIC 3000
</p>
<p>Tunnel Show Pty Ltd trading as RoyalPay<br>
Representative of AFSL licensee 448066
</p>
</html>

@ -0,0 +1,190 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1" user-scalable="no">
<meta name="description" content="">
<title>Risk Materials | Success</title>
<link href="static/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="static/lib/font-awesome-4.6.3/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" href="./static/css/index_register.css">
<link rel="stylesheet" href="static/lib/dist/css/AdminLTE.min.css">
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<script type="text/javascript" src="/static/lib/jquery/jquery-2.1.4.min.js"></script>
<script type="text/javascript" src="/static/lib/angularjs/angular.min.js"></script>
<script type="text/javascript" src="/static/lib/angularjs/angular-messages.js"></script>
<script type="text/javascript" src="/static/lib/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/static/lib/blocs.min.js"></script>
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?d7e727bd889ea69d369cba051844dfe5";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
</head>
<body class="pace-done fp-viewing-0">
<!--[if lte IE 8]>
<span class="lower-ie"></span>
<![endif]-->
<div class="pace pace-inactive">
<div class="pace-progress" data-progress-text="100%" data-progress="99"
style="transform: translate3d(100%, 0px, 0px);">
<div class="pace-progress-inner"></div>
</div>
<div class="pace-activity"></div>
</div>
<div id="main">
<div id="page-index">
<nav id="header" class="navbar navbar-dark navbar-full navbar-fixed-top navbar-bg" style="position: absolute">
<div class="container">
<div class="navbar-header">
<button class="navbar-toggle collapsed" type="button" data-toggle="collapse"
data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="https://www.royalpay.com.au/">
<img src="static/css/img/logo_w.png" alt="" class="navbar--logo">
</a>
<span class="navbar-brand" style="margin-left: 10px;padding-left: 10px;border-left: 1px solid #fff;">
<img src="static/css/img/wechatpay.png" class="navbar--logo" style="transform: translateY(50%);height: 60%;">
</span>
</div>
<ul class="nav navbar-nav navbar-right navbar-collapse collapse">
<li id="nav-index" class="nav-item">
<a href="https://www.royalpay.com.au/index.html" class="nav-link">Home</a>
</li>
<li class="nav-item dropdown">
<a role="button" class="nav-link dropdown-toggle" data-toggle="dropdown">GATEWAY API</a>
<ul class="dropdown-menu">
<li><a href="https://mpay.royalpay.com.au/docs/en/" target="_blank">En</a></li>
<li><a href="https://mpay.royalpay.com.au/docs/cn/" target="_blank">中文</a></li>
</ul>
</li>
<li class="nav-item">
<a href="https://www.royalpay.com.au/industry.html" class="nav-link">Industry</a>
</li>
<li class="nav-item">
<a href="https://www.royalpay.com.au/marketing.html" class="nav-link">Marketing</a>
</li>
<li class="nav-item">
<a role="button" class="nav-link dropdown-toggle" data-toggle="dropdown">About Us</a>
<ul class="dropdown-menu">
<li><a href="https://www.royalpay.com.au/industry.html" target="_blank">About Us</a></li>
<li><a href="https://www.royalpay.com.au/c_news.html">News</a></li>
<li><a href="https://www.royalpay.com.au/c_career.html">Career</a></li>
</ul>
</li>
<li class="nav-item">
<a href="https://www.royalpay.com.au/download.html" class="nav-link">Downloads</a>
</li>
<li class="nav-item">
<a href="https://mpay.royalpay.com.au/login.html" target="_blank" class="nav-link">Sign In</a>
</li>
</ul>
</div>
</nav>
<div id="fullpage" class="fullpage-wrapper">
<section class="section section-industry"></section>
<section class="section section-two" style="padding-bottom: 50px;">
<div class="container">
<div class="container">
<!--<div class="row">-->
<!--<div class="col-sm-12">-->
<!--</div>-->
<!--</div>-->
<section class="content-header" style="text-align: center">
<img src="static/images/pay_success.png" style="width: 120px">
<h3>We have received your materials, our risk manager will review soon,</h3>
<h3>please wait for result.</h3>
</section>
</div>
</div>
</section>
<section class="section section-six fp-auto-height footer">
<div class="container">
<div class="row margin-bottom">
<div class="col-md-4 footer-item">
CONTACT US
<hr>
Level 14<br>
383 Kent Street<br>
Sydney NSW 2000<br>
<br>
Level 11<br>
15 William Street<br>
Melbourne VIC 3000<br>
<br>
1300-10-77-50<br>
03 9448 8865<br>
info@royalpay.com.au
</div>
<div class="col-md-4 sitemap footer-item">
SITE MAP
<hr>
<div class="row">
<div class="col-xs-6">
<p><a href="/">RoyalPay</a></p>
<p><a href="https://mpay.royalpay.com.au/docs/en/">Gateway API</a></p>
<p><a href="https://www.royalpay.com.au/industry.html">Industry Solution</a></p>
<p><a href="https://www.royalpay.com.au/marketing.html">Marketing Service</a></p>
</div>
<div class="col-xs-6">
<p><a href="https://www.royalpay.com.au/about.html">About Us</a></p>
<p><a href="https://www.royalpay.com.au/c_news.html">News</a></p>
<p><a href="https://www.royalpay.com.au/c_career.html">Career</a></p>
<p><a href="https://www.royalpay.com.au/download.html">Downloads</a></p>
</div>
</div>
</div>
<div class="col-md-4 footer-item">
SUPPORT
<hr>
<div class="row">
<div class="col-xs-6 qr-box">
<img src="static/css/img/qr_royalpay.png">
RoyalPay WeChat Official Account
</div>
<div class="col-xs-6 qr-box">
<img src="static/css/img/qr_service.png">
Customer Service
</div>
</div>
</div>
</div>
</div>
<div class="copyright">
<div class="container">
<div class="row">
<div class="col-xs-12 text-center">
© 2016 Tunnel Show Pty. Ltd. | Representative of AFSL licensee 448066
</div>
</div>
</div>
</div>
</section>
</div>
</div>
</div>
<div id="fp-nav" class="right"></div>
<div id="cli_dialog_div"></div>
</body>
</html>

@ -23,7 +23,8 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
var emailStatusMap = {
"0": "未发送",
"1": "已发送"
"1": "已发送",
"2": "打回并已发送"
};
var app = angular.module('riskBusinessApp', ['ui.router']);
@ -173,6 +174,18 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
$scope.loadRiskEventDetail = function(riskId) {
$http.get('/risk/business/events/' + riskId)
}
$scope.resendUploadEmail = function () {
commonDialog.confirm({
title: 'Warning',
content: 'Please confirm sending mail.'
}).then(function () {
$http.put('/risk/business/' + $scope.riskEvent.risk_id + '/upload_mail').then(function () {
$state.reload();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
})
})
};
}
]);

@ -160,7 +160,7 @@
</div>
<a role="button"
class="btn btn-info">Send Email
class="btn btn-info" ng-click="resendUploadEmail()">Send Email
</a>
</div>
</div>

@ -0,0 +1,201 @@
// define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], function (angular) {
// 'use strict';
var app = angular.module('riskUploadApp',['ngFileUpload']);
app.controller('riskUploadCtrl', ['$scope','$http','Upload','$filter',function ($scope,$http,Upload,$filter) {
$scope.material={};
$scope.codeKey=document.getElementById('codeKey').value;
$scope.material.risk_id=document.getElementById('risk_id').value;
$scope.material.update_time=$filter('date')(new Date(), 'yyyy-MM-dd HH:mm:ss');
$scope.uploadFile1 = function (file) {
if (file != null) {
$scope.file1Progress = {value: 0};
Upload.upload({
url: '/attachment/riskFiles',
data: {file: file}
}).then(function (resp) {
delete $scope.file1Progress;
$scope.material.file1_url = resp.data.url;
}, function (resp) {
delete $scope.file1Progress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.file1Progress.value = parseInt(100 * evt.loaded / evt.total);
})
}
};
$scope.uploadFile2 = function (file) {
if (file != null) {
$scope.file2Progress = {value: 0};
Upload.upload({
url: '/attachment/riskFiles',
data: {file: file}
}).then(function (resp) {
delete $scope.file2Progress;
$scope.material.file2_url = resp.data.url;
}, function (resp) {
delete $scope.file2Progress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.file2Progress.value = parseInt(100 * evt.loaded / evt.total);
})
}
};
$scope.uploadFile3 = function (file) {
if (file != null) {
$scope.file3Progress = {value: 0};
Upload.upload({
url: '/attachment/riskFiles',
data: {file: file}
}).then(function (resp) {
delete $scope.file3Progress;
$scope.material.file3_url = resp.data.url;
}, function (resp) {
delete $scope.file3Progress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.file3Progress.value = parseInt(100 * evt.loaded / evt.total);
})
}
};
$scope.uploadFile4 = function (file) {
if (file != null) {
$scope.file4Progress = {value: 0};
Upload.upload({
url: '/attachment/riskFiles',
data: {file: file}
}).then(function (resp) {
delete $scope.file4Progress;
$scope.material.file4_url = resp.data.url;
}, function (resp) {
delete $scope.file4Progress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.file4Progress.value = parseInt(100 * evt.loaded / evt.total);
})
}
};
$scope.uploadFile5 = function (file) {
if (file != null) {
$scope.file5Progress = {value: 0};
Upload.upload({
url: '/attachment/riskFiles',
data: {file: file}
}).then(function (resp) {
delete $scope.file5Progress;
$scope.material.file5_url = resp.data.url;
}, function (resp) {
delete $scope.file5Progress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.file5Progress.value = parseInt(100 * evt.loaded / evt.total);
})
}
};
$scope.uploadFile6 = function (file) {
if (file != null) {
$scope.file6Progress = {value: 0};
Upload.upload({
url: '/attachment/riskFiles',
data: {file: file}
}).then(function (resp) {
delete $scope.file6Progress;
$scope.material.file6_url = resp.data.url;
}, function (resp) {
delete $scope.file6Progress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.file6Progress.value = parseInt(100 * evt.loaded / evt.total);
})
}
};
$scope.uploadFile7 = function (file) {
if (file != null) {
$scope.file7Progress = {value: 0};
Upload.upload({
url: '/attachment/riskFiles',
data: {file: file}
}).then(function (resp) {
delete $scope.file7Progress;
$scope.material.file7_url = resp.data.url;
}, function (resp) {
delete $scope.file7Progress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.file7Progress.value = parseInt(100 * evt.loaded / evt.total);
})
}
};
$scope.uploadFile8 = function (file) {
if (file != null) {
$scope.file8Progress = {value: 0};
Upload.upload({
url: '/attachment/riskFiles',
data: {file: file}
}).then(function (resp) {
delete $scope.file8Progress;
$scope.material.file8_url = resp.data.url;
}, function (resp) {
delete $scope.file8Progress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.file8Progress.value = parseInt(100 * evt.loaded / evt.total);
})
}
};
$scope.uploadFile9 = function (file) {
if (file != null) {
$scope.file9Progress = {value: 0};
Upload.upload({
url: '/attachment/riskFiles',
data: {file: file}
}).then(function (resp) {
delete $scope.file9Progress;
$scope.material.file9_url = resp.data.url;
}, function (resp) {
delete $scope.file9Progress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.file9Progress.value = parseInt(100 * evt.loaded / evt.total);
})
}
};
$scope.uploadFile10 = function (file) {
if (file != null) {
$scope.file10Progress = {value: 0};
Upload.upload({
url: '/attachment/riskFiles',
data: {file: file}
}).then(function (resp) {
delete $scope.file10Progress;
$scope.material.file10_url = resp.data.url;
}, function (resp) {
delete $scope.file10Progress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.file10Progress.value = parseInt(100 * evt.loaded / evt.total);
})
}
};
$scope.submit = function (form) {
$http.post('/risk/upload/'+$scope.codeKey, $scope.material).then(function (resp) {
// commonDialog.alert({title: 'Success', content: 'Submit successfully', type: 'success'});
alert('Submit successfully');
window.location.href="/risk_upload_success.html";
}, function (resp) {
alert('Submit failed');
// commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
});
}
}])
// return app;
//
// })
Loading…
Cancel
Save