[fix]重复提交

master
lujian 6 years ago
parent 5a856b2f95
commit 50aae1323a

@ -68,8 +68,10 @@ public interface RiskBusinessService {
/** /**
* *
* @param riskId * @param riskId
* @param refuseDescription
* @throws IOException
*/ */
void sendRefuseEmail(String riskId) throws IOException; void sendRefuseEmail(String riskId, String refuseDescription) throws IOException;
/** /**
* *

@ -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.APNSMessageHelper;
import au.com.royalpay.payment.manage.pushMessage.bean.AppManagerMessageBuilder; 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.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.core.RiskProcessLogService;
import au.com.royalpay.payment.manage.riskbusiness.enums.RiskEmailStatusEnum; import au.com.royalpay.payment.manage.riskbusiness.enums.RiskEmailStatusEnum;
import au.com.royalpay.payment.manage.riskbusiness.enums.RiskResultTypeEnum; import au.com.royalpay.payment.manage.riskbusiness.enums.RiskResultTypeEnum;
@ -102,6 +103,8 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
@Resource @Resource
private RiskMaterialMapper riskMaterialMapper; private RiskMaterialMapper riskMaterialMapper;
@Resource @Resource
private RiskMaterialService riskMaterialService;
@Resource
private RiskFileMapper riskFileMapper; private RiskFileMapper riskFileMapper;
@Resource @Resource
private ClientDeviceTokenMapper clientDeviceTokenMapper; private ClientDeviceTokenMapper clientDeviceTokenMapper;
@ -424,8 +427,11 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
} }
@Override @Override
public void sendRefuseEmail(String riskId) throws IOException { public void sendRefuseEmail(String riskId, String refuseDescription) throws IOException {
JSONObject event = getRiskEventDetail(riskId); JSONObject event = getRiskEventDetail(riskId);
if (RiskResultTypeEnum.MATERIAL_NOT_PASS.getResultType().intValue() == event.getIntValue("result_type")) {
throw new BadRequestException("Refused Already!");
}
Context ctx = getMailContext(event); Context ctx = getMailContext(event);
ctx.setVariable("refuse",true); ctx.setVariable("refuse",true);
ctx.setVariable("refuse_description", riskMaterialMapper.findAllMaterials(riskId).get(0).getString("refuse_description")); ctx.setVariable("refuse_description", riskMaterialMapper.findAllMaterials(riskId).get(0).getString("refuse_description"));
@ -441,6 +447,7 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
event.put("result_type",RiskResultTypeEnum.MATERIAL_NOT_PASS.getResultType()); event.put("result_type",RiskResultTypeEnum.MATERIAL_NOT_PASS.getResultType());
event.put("submit_url",uploadUrl); event.put("submit_url",uploadUrl);
riskEventMapper.update(event); riskEventMapper.update(event);
riskMaterialService.updateRiskMaterial(riskId, refuseDescription);
// 日志记录 // 日志记录
riskProcessLogService.addRiskProcessLog(riskId, riskProcessLogService.addRiskProcessLog(riskId,
event.getString("fillin_id"), event.getString("fillin_id"),

@ -87,9 +87,8 @@ public class RiskBusinessController {
} }
@RequestMapping(value = "/{risk_id}/refuse",method = RequestMethod.PUT) @RequestMapping(value = "/{risk_id}/refuse",method = RequestMethod.PUT)
public void refuseEmail(@PathVariable String risk_id, @RequestBody JSONObject otherParams) throws IOException { public void refuseEmail(@PathVariable("risk_id") String riskId, @RequestBody JSONObject otherParams) throws IOException {
riskMaterialService.updateRiskMaterial(risk_id, otherParams.getString("refuse_description")); riskBusinessService.sendRefuseEmail(riskId, otherParams.getString("refuse_description"));
riskBusinessService.sendRefuseEmail(risk_id);
} }
@GetMapping(value = "/{risk_id}/material") @GetMapping(value = "/{risk_id}/material")

@ -57,6 +57,14 @@
<form novalidate name="uploadForm"> <form novalidate name="uploadForm">
<div class="panel-body"> <div class="panel-body">
<div class="form-horizontal"> <div class="form-horizontal">
<div class="form-group" ng-if="allMaterialInfo.refuse_description != null">
<label class="control-label col-sm-2">Refuse Reason</label>
<div class="col-sm-10">
<div class="form-control-static">
<p ng-bind="allMaterialInfo.refuse_description"></p>
</div>
</div>
</div>
<div class="form-group" ng-repeat="item in allMaterialInfo.material"> <div class="form-group" ng-repeat="item in allMaterialInfo.material">
<div class="col-sm-12 text-left"> <div class="col-sm-12 text-left">
<p>{{item.question}}</p> <p>{{item.question}}</p>

@ -160,13 +160,13 @@
<button class="btn btn-primary" <button class="btn btn-primary"
type="button" type="button"
ng-click="loadRiskEvents(1)"> ng-click="loadRiskEvents(1)">
<i class="fa fa-search"></i>Search <i class="fa fa-search"></i> Search
</button> </button>
<a role="button" <a role="button"
class="btn btn-info" class="btn btn-info"
ui-sref=".new_riskEvent" ui-sref=".new_riskEvent"
title="New Event"> title="New Event">
<i class="fa fa-plus"></i>New Event <i class="fa fa-plus"></i> New Event
</a> </a>
</div> </div>
</div> </div>

Loading…
Cancel
Save