[fix]风控处理流程显示

master
lujian 6 years ago
parent 473aa0adf9
commit 8cd3940c7c

@ -167,4 +167,6 @@ public interface RetailAppService {
JSONObject getStyle();
void cancelCouponAccuessLog(String accuess_id, String remark);
void submitMaterial(JSONObject material, JSONObject device);
}

@ -33,6 +33,9 @@ import au.com.royalpay.payment.manage.notice.core.NoticePartner;
import au.com.royalpay.payment.manage.openim.core.CustomerServiceService;
import au.com.royalpay.payment.manage.pushMessage.APNSMessageHelper;
import au.com.royalpay.payment.manage.pushMessage.bean.AppManagerMessageBuilder;
import au.com.royalpay.payment.manage.riskbusiness.core.RiskProcessLogService;
import au.com.royalpay.payment.manage.riskbusiness.core.RiskUploadService;
import au.com.royalpay.payment.manage.riskbusiness.enums.RiskResultTypeEnum;
import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean;
import au.com.royalpay.payment.manage.signin.core.SignInAccountService;
import au.com.royalpay.payment.manage.signin.core.impls.SignInAccountServiceImpl;
@ -176,6 +179,10 @@ public class RetailAppServiceImp implements RetailAppService {
private CouponAccuessLogMapper couponAccuessLogMapper;
@Resource
private CouponValidateService couponValidateService;
@Resource
private RiskProcessLogService riskProcessLogService;
@Resource
private RiskUploadService riskUploadService;
private Map<String, AppMsgSender> senderMap = new HashMap<>();
private final String fileName[] = { "client_bank_file", "client_id_file", "client_company_file" };
@ -1861,4 +1868,18 @@ public class RetailAppServiceImp implements RetailAppService {
return sourceStr;
}
@Override
public void submitMaterial(JSONObject material, JSONObject device) {
riskUploadService.submitMaterial(material);
JSONObject account = clientAccountMapper.findById(device.getString("account_id"));
if (account == null)
account = new JSONObject();
riskProcessLogService.addRiskProcessLog(material.getString("risk_id"),
account.getString("account_id"),
account.getString("display_name"),
RiskResultTypeEnum.WAIT_FOR_AUDIT.getRemark(),
RiskResultTypeEnum.SEND_EMAIL_TO_BD.getResultType(),
RiskResultTypeEnum.WAIT_FOR_AUDIT.getResultType());
}
}

@ -635,8 +635,8 @@ public class RetailAppController {
* @param material
*/
@PostMapping(value = "/risk/business/events")
public void uploadMaterial(@RequestBody JSONObject material) {
riskUploadService.submitMaterial(material);
public void uploadMaterial(@RequestBody JSONObject material, @ModelAttribute(RETAIL_DEVICE) JSONObject device) {
retailAppService.submitMaterial(material, device);
}
@RequestMapping(value = "/risk/business/upload/files", method = RequestMethod.POST)

@ -0,0 +1,24 @@
package au.com.royalpay.payment.manage.mappers.riskbusiness;
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.ibatis.annotations.Param;
/**
* @Description:
* @Author: lujian
* @Date: 2018/11/22 15:32
*/
@AutoMapper(tablename = "risk_process_log", pkName = "risk_process_id")
public interface RiskProcessLogMapper {
@AutoSql(type = SqlType.SELECT)
PageList<JSONObject> getRiskProcessLogs(@Param("risk_id") String riskId, PageBounds pagination);
@AutoSql(type = SqlType.INSERT)
void addRiskProcessLog(JSONObject log);
}

@ -110,5 +110,7 @@ public interface RiskBusinessService {
*/
JSONObject getRiskEventMaterialsRemark(String riskId);
JSONObject riskEventMaterialPass(JSONObject params, JSONObject manager);
JSONObject updateIsSendClient(String riskId);
}

@ -0,0 +1,28 @@
package au.com.royalpay.payment.manage.riskbusiness.core;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
/**
* @Description:
* @Author: lujian
* @Date: 2018/11/22 15:40
*/
public interface RiskProcessLogService {
/**
*
* @param riskId
* @return
*/
PageList<JSONObject> getRiskProcessLogs(String riskId);
/**
*
* @param log
*/
void addRiskProcessLog(JSONObject log);
void addRiskProcessLog(String riskId, String operatorId, String operator, String remark, int resultTypeFrom, int resultTypeTo);
}

@ -17,6 +17,7 @@ import au.com.royalpay.payment.manage.notice.core.MailService;
import au.com.royalpay.payment.manage.pushMessage.APNSMessageHelper;
import au.com.royalpay.payment.manage.pushMessage.bean.AppManagerMessageBuilder;
import au.com.royalpay.payment.manage.riskbusiness.core.RiskBusinessService;
import au.com.royalpay.payment.manage.riskbusiness.core.RiskProcessLogService;
import au.com.royalpay.payment.manage.riskbusiness.enums.RiskEmailStatusEnum;
import au.com.royalpay.payment.manage.riskbusiness.enums.RiskResultTypeEnum;
import au.com.royalpay.payment.manage.signin.beans.TodoNotice;
@ -95,6 +96,9 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
private RoyalThreadPoolExecutor royalThreadPoolExecutor;
private final String UPLOAD_MAIL_PREFIX = "UPLOAD_MAIL";
@Resource
private RiskProcessLogService riskProcessLogService;
@Resource
private RiskMaterialMapper riskMaterialMapper;
@Resource
@ -271,6 +275,13 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
public void addRiskEvent(JSONObject params, JSONObject manager) {
params = getEvent(params);
riskEventMapper.save(params);
params = riskEventMapper.findAll(params).get(0);
riskProcessLogService.addRiskProcessLog(params.getString("risk_id"),
params.getString("fillin_id"),
params.getString("fillin_person"),
RiskResultTypeEnum.NOT_HANDLED.getRemark(),
RiskResultTypeEnum.NOT_HANDLED.getResultType(),
RiskResultTypeEnum.NOT_HANDLED.getResultType());
}
@Override
@ -336,6 +347,12 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
event.put("result_type", RiskResultTypeEnum.ALREADY_HANDLED.getResultType());
}
riskEventMapper.update(event);
riskProcessLogService.addRiskProcessLog(event.getString("risk_id"),
event.getString("fillin_id"),
event.getString("fillin_person"),
RiskResultTypeEnum.SEND_EMAIL_TO_BD.getRemark(),
RiskResultTypeEnum.NOT_HANDLED.getResultType(),
RiskResultTypeEnum.SEND_EMAIL_TO_BD.getResultType());
if(event.getIntValue("is_send_client") == 1){
sendAppRiskMessage(event);
}
@ -416,10 +433,17 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
try {
String emailId = mailService.sendRiskEmail("You need to resubmit risk materials", emailsTos.isEmpty() ? "" : StringUtils.join(emailsTos, ","),
emailsCcs.isEmpty() ? "" : StringUtils.join(emailsCcs, ","), "",content, null,event.getIntValue("order_type"));
event.put("email_status",2);
event.put("email_status",RiskEmailStatusEnum.BACK_AND_SEND.getEmailStatus());
event.put("result_type",RiskResultTypeEnum.MATERIAL_NOT_PASS.getResultType());
event.put("submit_url",uploadUrl);
riskEventMapper.update(event);
// 日志记录
riskProcessLogService.addRiskProcessLog(riskId,
event.getString("fillin_id"),
event.getString("fillin_person"),
RiskResultTypeEnum.MATERIAL_NOT_PASS.getRemark(),
RiskResultTypeEnum.WAIT_FOR_AUDIT.getResultType(),
RiskResultTypeEnum.MATERIAL_NOT_PASS.getResultType());
} catch (Exception e) {
throw new EmailException("Email Sending Failed", e);
}
@ -462,14 +486,13 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
expireDay = "3";
}
)*/
// 原来设定的过期时间是7天,现在改成半个月
String expireDay = "180";
// 原来设定的过期时间是7天
String expireDay = "3650";
stringRedisTemplate.boundValueOps(getRiskUploadKey(codeKey)).set(codeKeyValue, Long.parseLong(expireDay), TimeUnit.DAYS);
String uploadUrl = PlatformEnvironment.getEnv().concatUrl("/risk/upload/") + event.getString("risk_id") + "/" + codeKey;
int orderType = event.getIntValue("order_type");
if (orderType == 1 || orderType == 2)
uploadUrl = PlatformEnvironment.getEnv().concatUrl("/manage.html#/analysis/monitoring/") + event.getString("risk_id") + "/bd/detail?codeKey=" + codeKey;
//uploadUrl = "localhost:9009" + "/manage.html#/analysis/monitoring/" + event.getString("risk_id") + "/bd/detail";
List<JSONObject> bds = clientBDMapper.listClientBDInfoAvailable(client.getIntValue("client_id"), new Date());
List<String> bdNames = new ArrayList<>();
List<String> bdEmails = new ArrayList<>();
@ -509,6 +532,11 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
}
List<JSONObject> orders = new ArrayList();
int isSendClient = event.getIntValue("is_send_client");
ctx.setVariable("emailsTos", bdEmails);
if (isSendClient == 1) {
ctx.setVariable("emailsTos", clientEmails);
ctx.setVariable("emailsCcs", bdEmails);
}
switch (event.getIntValue("order_type")){
case 1:
case 2:
@ -521,7 +549,6 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
}
ctx.setVariable("orders", orders);
ctx.setVariable("title","Your merchants needs to submit risk materials");
ctx.setVariable("emailsTos", bdEmails);
break;
case 3:
for(String orderId : realOrderIds){
@ -548,12 +575,6 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
// ctx.setVariable("files",attachList);
case 4:
ctx.setVariable("title","RoyalPay风控调查 — " + client.getString("short_name"));
ctx.setVariable("emailsTos", bdEmails);
if (isSendClient == 1) {
ctx.setVariable("emailsTos", clientEmails);
ctx.setVariable("emailsCcs", bdEmails);
}
break;
}
return ctx;
@ -866,6 +887,18 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
return result;
}
@Override
public JSONObject riskEventMaterialPass(JSONObject params, JSONObject manager) {
riskEventMapper.update(params);
riskProcessLogService.addRiskProcessLog(params.getString("risk_id"),
manager.getString("manager_id"),
manager.getString("display_name"),
RiskResultTypeEnum.MATERIAL_AUDIT_PASS.getRemark(),
params.getIntValue("result_type"),
RiskResultTypeEnum.MATERIAL_AUDIT_PASS.getResultType());
return params;
}
@Override
public JSONObject updateIsSendClient(String riskId) {
JSONObject event = riskEventMapper.findById(riskId);

@ -0,0 +1,45 @@
package au.com.royalpay.payment.manage.riskbusiness.core.impl;
import au.com.royalpay.payment.manage.mappers.riskbusiness.RiskProcessLogMapper;
import au.com.royalpay.payment.manage.riskbusiness.core.RiskProcessLogService;
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.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* @Description:
* @Author: lujian
* @Date: 2018/11/22 15:46
*/
@Service
public class RiskProcessLogServiceImpl implements RiskProcessLogService {
@Resource
private RiskProcessLogMapper riskProcessLogMapper;
@Override
public PageList<JSONObject> getRiskProcessLogs(String riskId) {
return riskProcessLogMapper.getRiskProcessLogs(riskId, new PageBounds(Order.formString("create_time")));
}
@Override
public void addRiskProcessLog(JSONObject log) {
riskProcessLogMapper.addRiskProcessLog(log);
}
@Override
public void addRiskProcessLog(String riskId, String operatorId, String operator, String remark, int resultTypeFrom, int resultTypeTo) {
JSONObject log = new JSONObject();
log.put("risk_id", riskId);
log.put("operator_id", operatorId);
log.put("operator", operator);
log.put("remark", remark);
log.put("result_type_from", resultTypeFrom);
log.put("result_type_to", resultTypeTo);
riskProcessLogMapper.addRiskProcessLog(log);
}
}

@ -7,6 +7,7 @@ import au.com.royalpay.payment.manage.mappers.riskbusiness.RiskMaterialMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
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.RiskProcessLogService;
import au.com.royalpay.payment.manage.riskbusiness.core.RiskUploadService;
import au.com.royalpay.payment.manage.riskbusiness.enums.RiskResultTypeEnum;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
@ -17,6 +18,7 @@ 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.springframework.transaction.annotation.Transactional;
import org.thymeleaf.context.Context;
import org.thymeleaf.spring4.SpringTemplateEngine;
@ -34,15 +36,22 @@ public class RiskUploadServiceIpml implements RiskUploadService {
@Resource
private RiskEventMapper riskEventMapper;
@Resource
private RiskProcessLogService riskProcessLogService;
@Resource
private StringRedisTemplate stringRedisTemplate;
private final String UPLOAD_MAIL_PREFIX = "UPLOAD_MAIL";
@Override
public void submitMaterial(JSONObject material) {
JSONObject event = riskEventMapper.findById(material.getString("risk_id"));
String riskId = material.getString("risk_id");
JSONObject event = riskEventMapper.findById(riskId);
Integer resultType = event.getInteger("result_type");
if (!resultType.equals(RiskResultTypeEnum.SEND_EMAIL_TO_BD.getResultType()) && !resultType.equals(RiskResultTypeEnum.MATERIAL_NOT_PASS.getResultType())) {
throw new BadRequestException("Committed Already");
}
material.put("update_time", DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss"));
riskMaterialMapper.save(material);
material.put("material_id",riskMaterialMapper.findAllMaterials(material.getString("risk_id")).get(0).getString("material_id"));
material.put("material_id",riskMaterialMapper.findAllMaterials(riskId).get(0).getString("material_id"));
for(int i=1;i<=10;i++){
if(material.containsKey("file"+i+"_url")){
List<String> urls = (List<String>)material.get("file"+i+"_url");
@ -67,16 +76,17 @@ public class RiskUploadServiceIpml implements RiskUploadService {
@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();
}
// 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();

@ -15,6 +15,15 @@ public enum RiskResultTypeEnum {
private Integer resultType;
private static final String[] REMARK_ARR = {
"风控事件已创建",
"已发送邮件,资料完善中",
"资料已提交,等待审核",
"材料审核通过",
"材料打回",
"已处理"
};
RiskResultTypeEnum(Integer resultType) {
this.resultType = resultType;
}
@ -26,4 +35,8 @@ public enum RiskResultTypeEnum {
public void setResultType(Integer resultType) {
this.resultType = resultType;
}
public String getRemark() {
return REMARK_ARR[resultType];
}
}

@ -6,23 +6,17 @@ import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.riskbusiness.bean.RiskEventQuery;
import au.com.royalpay.payment.manage.riskbusiness.core.RiskBusinessService;
import au.com.royalpay.payment.manage.riskbusiness.core.RiskMaterialService;
import au.com.royalpay.payment.manage.riskbusiness.core.RiskProcessLogService;
import au.com.royalpay.payment.manage.riskbusiness.enums.RiskResultTypeEnum;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import com.alibaba.fastjson.JSONObject;
import com.sun.org.apache.xerces.internal.impl.dv.xs.BooleanDV;
import com.sun.org.apache.xpath.internal.operations.Bool;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
@ -43,6 +37,9 @@ public class RiskBusinessController {
@Autowired
private ClientManager clientManager;
@Autowired
private RiskProcessLogService riskProcessLogService;
@GetMapping(value = "events")
public JSONObject getRiskEvents(RiskEventQuery riskEventQuery, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
JSONObject params = riskEventQuery.toJSON();
@ -55,6 +52,7 @@ public class RiskBusinessController {
JSONObject riskEvent = riskBusinessService.getRiskEventDetail(riskId);
List<JSONObject> tradeLogs = riskBusinessService.getRiskEventOrderList(riskEvent);
riskEvent.put("tradeLogs", tradeLogs);
riskEvent.put("process_logs", riskProcessLogService.getRiskProcessLogs(riskId));
return riskEvent;
}
@ -71,6 +69,12 @@ public class RiskBusinessController {
riskBusinessService.updateRiskEvent(params);
}
@PutMapping(value = "events/pass")
public void riskEventMaterialPass(@RequestBody JSONObject params,
@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
riskBusinessService.riskEventMaterialPass(params, manager);
}
@GetMapping(value = "/{risk_id}/download/materialsAsZIP")
public void downloadComplianceZip(@PathVariable("risk_id") String riskId, HttpServletResponse response) throws Exception {
riskBusinessService.downloadAuditMaterialZiP(riskId, response);
@ -129,8 +133,8 @@ public class RiskBusinessController {
params.put("result_type", RiskResultTypeEnum.ALREADY_HANDLED.getResultType());
}
riskBusinessService.updateRiskEvent(params);
}
@RequestMapping(value = "/{risk_id}/urge",method = RequestMethod.PUT)
public void urgeEmail(@PathVariable String risk_id) throws IOException {
riskBusinessService.sendUrgeEmail(risk_id);

@ -1,7 +1,10 @@
package au.com.royalpay.payment.manage.riskbusiness.web;
import au.com.royalpay.payment.manage.riskbusiness.core.RiskBusinessService;
import au.com.royalpay.payment.manage.riskbusiness.core.RiskProcessLogService;
import au.com.royalpay.payment.manage.riskbusiness.core.RiskUploadService;
import au.com.royalpay.payment.manage.riskbusiness.enums.RiskResultTypeEnum;
import au.com.royalpay.payment.tools.CommonConsts;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
@ -15,6 +18,8 @@ public class RiskFileUploadController {
private RiskUploadService riskUploadService;
@Resource
private RiskBusinessService riskBusinessService;
@Resource
private RiskProcessLogService riskProcessLogService;
/**
*
@ -41,9 +46,17 @@ public class RiskFileUploadController {
* @param material
*/
@RequestMapping(value = "/{codeKey}", method = RequestMethod.POST)
public void upload(@PathVariable String codeKey, @RequestBody JSONObject material) {
public void upload(@PathVariable String codeKey,
@RequestBody JSONObject material,
@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
// riskUploadService.checkUploadMailKey(codeKey, material.getString("risk_id"));
riskUploadService.submitMaterial(material);
riskProcessLogService.addRiskProcessLog(material.getString("risk_id"),
manager.getString("manager_id"),
manager.getString("display_name"),
RiskResultTypeEnum.WAIT_FOR_AUDIT.getRemark(),
RiskResultTypeEnum.SEND_EMAIL_TO_BD.getResultType(),
RiskResultTypeEnum.WAIT_FOR_AUDIT.getResultType());
riskUploadService.deleteUploadMailKey(codeKey);
}

@ -0,0 +1,33 @@
package au.com.royalpay.payment.manage.riskbusiness.web;
import au.com.royalpay.payment.manage.riskbusiness.core.RiskProcessLogService;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.JsonObject;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.xml.bind.util.JAXBSource;
import java.util.List;
/**
* @Description:
* @Author: lujian
* @Date: 2018/11/22 15:52
*/
@RestController
@RequestMapping(value = "/risk/business/process/logs")
public class RiskProcessLogController {
@Resource
private RiskProcessLogService riskProcessLogService;
@GetMapping(value = "/{risk_id}")
public List<JSONObject> getRiskProcessLogs(@PathVariable("risk_id") String riskId) {
return riskProcessLogService.getRiskProcessLogs(riskId);
}
@PostMapping
public void addRiskProcessLog(@RequestBody JSONObject log) {
riskProcessLogService.addRiskProcessLog(log);
}
}

@ -170,6 +170,11 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
if (riskEvent.data.is_send_client == 1)
riskEvent.data.is_send_client = true;
$scope.riskEvent = riskEvent.data;
$http.get('/risk/business/process/logs/' + $scope.riskEvent.risk_id).then(function (resp) {
$scope.riskEvent.process_logs = resp.data;
});
// 编辑表格的数据保存对象,重新从源数据复制,从而取消保存操作时不会更新视图
$scope.riskEventEdit = angular.copy(riskEvent.data);
//var index = $scope.riskEvent.order_ids.lastIndexOf(",");
@ -333,6 +338,31 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
$scope.material={};
$scope.material.update_time=$filter('date')(new Date(), 'yyyy-MM-dd HH:mm:ss');
$scope.material.risk_id = $scope.riskEvent.risk_id;
// $scope.uploadFile = function(files, index) {
// if (files && files.length) {
// var urls = new Array();
// var value = 0;
// var progressKey = 'fileProgress' + (index + 1);
// $scope[progressKey] = {value: 0};
// for (var i = 0; i < files.length; i++) {
// var file = files[i];
// Upload.upload({
// url: '/attachment/riskFiles',
// data: {file: file}
// }).then(function (resp) {
// urls.push(resp.data.url);
// }, function (resp) {
// delete $scope[progressKey];
// alert('Upload Failed');
// }, function (evt) {
// value += parseInt(100 * evt.loaded / evt.total );
// $scope[progressKey].value = value/(files.length*2);
// })
// }
// var fileKey = 'file' + (index + 1) +'_url';
// $scope.material[fileKey] = urls;
// }
// };
$scope.uploadFile1 = function (files) {
if (files && files.length) {
var urls = new Array();
@ -540,7 +570,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
// 材料审核
$scope.auditMaterial = function(auditType) {
var url = '/risk/business/events';
var url = '/risk/business/events/pass';
var warningMessageHTML = '是否确定<span style="color: green; font-weight: bolder; font-size: 20px;">通过</span>该材料?';
if (auditType == 3) {
commonDialog.confirm({
@ -656,7 +686,13 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
$scope.riskEvent.is_send_client = $scope.is_send_client;
var saveRiskBtn = document.getElementById('save-risk-btn');
var saveRiskBtnInnerHtmlBak = saveRiskBtn.innerHTML;
saveRiskBtn.disabled = true;
saveRiskBtn.innerHTML = "<i class='fa fa-spinner fa-spin '></i> Processing";
$http.post('/risk/business/events', $scope.riskEvent).then(function (resp) {
saveRiskBtn.innerHTML = saveRiskBtnInnerHtmlBak;
saveRiskBtn.disabled = false;
commonDialog.alert({
title: 'Success',
content: 'Register new riskEvent successfully',
@ -664,6 +700,8 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
});
$state.go('^',{}, {reload: true});
}, function (resp) {
saveRiskBtn.innerHTML = saveRiskBtnInnerHtmlBak;
saveRiskBtn.disabled = false;
commonDialog.alert({
title: 'Error',
content: resp.data.message,

@ -246,11 +246,17 @@
</div>
</div>
<div class="btn-group margin-bottom margin-top">
<div class="margin-bottom margin-top">
<button class="btn btn-success"
type="button"
id="save-risk-btn"
ng-click="save(riskEventForm)">Save
</button>
<a role="button"
style="margin-left: 10px;"
ui-sref="analysis_monitoring.risk_business"
class="btn btn-warning">cancel
</a>
</div>
</form>
</div>

@ -1,4 +1,15 @@
<div class="content">
<div class="box box-body" ng-if="riskEvent.process_logs != null">
<div class="box-body table-responsive pad">
<small ng-repeat="log in riskEvent.process_logs">
<div class="btn-group-vertical" style="margin-top: 5px">
<button type="button" class="btn btn-xs btn-primary" ng-class="{'btn-danger': log.result_type_to == 4, 'btn-success': log.result_type_to == 3, 'btn-warning': log.result_type_to == 1}">{{log.remark}}</button>
<button type="button" class="btn btn-xs btn-primary" ng-class="{'btn-danger': log.result_type_to == 4, 'btn-success': log.result_type_to == 3, 'btn-warning': log.result_type_to == 1}">{{log.operator}} | {{log.create_time}}</button>
</div>
<i class="fa fa-arrow-right" aria-hidden="true" style="margin-top: 5px" ng-if="riskEvent.process_logs.length > ($index + 1)"></i>
</small>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="nav-tabs-custom">

Loading…
Cancel
Save