[fix]风控上传页面

master
lujian 6 years ago
parent e94ee7e764
commit 1dbd7dca0c

@ -494,8 +494,13 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
@Override @Override
public void sendRefuseEmail(String riskId, String refuseDescription) 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")) { int resultType = event.getIntValue("result_type");
if (RiskResultTypeEnum.MATERIAL_NOT_PASS.getResultType().intValue() == resultType) {
throw new BadRequestException("Refused Already!"); throw new BadRequestException("Refused Already!");
} else if (RiskResultTypeEnum.MATERIAL_AUDIT_PASS.getResultType().intValue() == resultType) {
throw new BadRequestException("Passed Already!");
} else if (RiskResultTypeEnum.WAIT_FOR_AUDIT.getResultType().intValue() != resultType){
throw new BadRequestException();
} }
riskMaterialService.updateRiskMaterial(riskId, refuseDescription); riskMaterialService.updateRiskMaterial(riskId, refuseDescription);
Context ctx = getMailContext(event); Context ctx = getMailContext(event);
@ -975,8 +980,14 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
return result; return result;
} }
@Transactional
@Override @Override
public JSONObject riskEventMaterialPass(JSONObject params, JSONObject manager) { public JSONObject riskEventMaterialPass(JSONObject params, JSONObject manager) {
Integer resultType = params.getInteger("result_type");
if (!resultType.equals(RiskResultTypeEnum.WAIT_FOR_AUDIT.getResultType())) {
throw new BadRequestException("Can't Pass");
}
params.put("result_type", RiskResultTypeEnum.MATERIAL_AUDIT_PASS.getResultType());
riskEventMapper.update(params); riskEventMapper.update(params);
riskProcessLogService.addRiskProcessLog(params.getString("risk_id"), riskProcessLogService.addRiskProcessLog(params.getString("risk_id"),
manager.getString("manager_id"), manager.getString("manager_id"),

@ -41,6 +41,7 @@ public class RiskUploadServiceIpml implements RiskUploadService {
private StringRedisTemplate stringRedisTemplate; private StringRedisTemplate stringRedisTemplate;
private final String UPLOAD_MAIL_PREFIX = "UPLOAD_MAIL"; private final String UPLOAD_MAIL_PREFIX = "UPLOAD_MAIL";
@Transactional
@Override @Override
public void submitMaterial(JSONObject material) { public void submitMaterial(JSONObject material) {
String riskId = material.getString("risk_id"); String riskId = material.getString("risk_id");
@ -55,6 +56,8 @@ public class RiskUploadServiceIpml implements RiskUploadService {
for(int i=1;i<=10;i++){ for(int i=1;i<=10;i++){
if(material.containsKey("file"+i+"_url")){ if(material.containsKey("file"+i+"_url")){
List<String> urls = (List<String>)material.get("file"+i+"_url"); List<String> urls = (List<String>)material.get("file"+i+"_url");
if (urls == null || urls.isEmpty())
continue;
for(String url:urls){ for(String url:urls){
JSONObject file = new JSONObject(); JSONObject file = new JSONObject();
file.put("file_url",url); file.put("file_url",url);

@ -144,7 +144,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
industries.push(industry.label); industries.push(industry.label);
}); });
industries.push('未知行业'); industries.push('未知行业');
console.log(industries); // console.log(industries);
// 加载风险注册事件 // 加载风险注册事件
$scope.loadRiskEvents = function (page) { $scope.loadRiskEvents = function (page) {
var params = angular.copy($scope.params); var params = angular.copy($scope.params);
@ -509,8 +509,8 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
} }
]); ]);
app.controller('auditMaterialCtrl', ['$scope', '$state', '$http', '$uibModal', '$filter', '$sce', 'commonDialog', app.controller('auditMaterialCtrl', ['$scope', '$state', '$http', '$uibModal', '$filter', '$sce', 'commonDialog', 'Upload',
function ($scope, $state, $http, $uibModal, $filter, $sce, commonDialog) { function ($scope, $state, $http, $uibModal, $filter, $sce, commonDialog, Upload) {
// 一键下载功能 // 一键下载功能
$scope.downloadAsZip = function () { $scope.downloadAsZip = function () {
@ -543,6 +543,61 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
}; };
$scope.loadRiskMaterial(); $scope.loadRiskMaterial();
$scope.uploadShowFlag = ($scope.riskEvent.result_type == 1 || $scope.riskEvent.result_type == 4) ? true : false;
// 材料上传
$scope.uploadFile = function(files, index) {
if (files && files.length) {
var urls = new Array();
var value = 0;
$scope.riskMaterial.material[index].fileProgressValue = 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.riskMaterial.material[index].fileProgressValue;
alert('Upload Failed');
}, function (evt) {
value += parseInt(100 * evt.loaded / evt.total );
$scope.riskMaterial.material[index].fileProgressValue = value/(files.length*2);
})
}
$scope.riskMaterial.material[index].file = urls;
}
};
$scope.submit = function (form) {
var index = $scope.riskEvent.submit_url.lastIndexOf('=');
if (index < 0)
index = $scope.riskEvent.submit_url.lastIndexOf('/');
var codeKey = $scope.riskEvent.submit_url.substring(index + 1);
$scope.material.update_time=$filter('date')(new Date(), 'yyyy-MM-dd HH:mm:ss');
$scope.material.risk_id = $scope.riskEvent.risk_id;
for (var i = 0; i < $scope.riskMaterial.material.length; i++) {
var key = 'file' + (i + 1) + "_url";
$scope.material[key] = $scope.riskMaterial.material[i].file;
}
$scope.material.description = $scope.riskMaterial.description;
$http.post('/risk/upload/' + codeKey, $scope.material).then(function (resp) {
commonDialog.alert({
title: 'Success',
content: 'Submit successfully',
type: 'success'
});
$state.go('analysis_monitoring.risk_business');
}, function (resp) {
commonDialog.alert({
title: 'Error',
content: resp.data.message,
type: 'error'
});
});
};
// 材料审核 // 材料审核
$scope.auditMaterial = function(auditType) { $scope.auditMaterial = function(auditType) {
@ -553,7 +608,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
title: 'Warning', title: 'Warning',
contentHtml: $sce.trustAsHtml(warningMessageHTML) contentHtml: $sce.trustAsHtml(warningMessageHTML)
}).then(function () { }).then(function () {
$scope.riskEvent.result_type = auditType; // $scope.riskEvent.result_type = auditType;
$http.put(url, $scope.riskEvent).then(function (resp) { $http.put(url, $scope.riskEvent).then(function (resp) {
commonDialog.alert({title: 'Success', content: "材料已通过!"}); commonDialog.alert({title: 'Success', content: "材料已通过!"});
$state.go('^', {}, {reload: true}); $state.go('^', {}, {reload: true});

@ -24,45 +24,74 @@
</a> </a>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<div class="form-vertical"> <form novalidate name="uploadForm">
<div class="form-group" ng-if="riskMaterial.refuse_description != null"> <div class="form-vertical">
<label class="control-label col-sm-2">Refuse Reason</label> <div class="form-group" ng-if="riskMaterial.refuse_description != null">
<div class="col-sm-10"> <label class="control-label col-sm-2">Refuse Reason</label>
<div class="form-control-static"> <div class="col-sm-10">
<p ng-bind="riskMaterial.refuse_description"></p> <div class="form-control-static">
<p ng-bind="riskMaterial.refuse_description"></p>
</div>
</div> </div>
</div> </div>
</div>
<div class="form-group"> <div class="form-group" ng-repeat="item in riskMaterial.material">
<label class="control-label col-sm-2">Description:</label>
<div class="col-sm-10"> <div class="col-sm-12 text-left">
<div class="form-control-static"> <p>{{item.question}}</p>
<p ng-bind="riskMaterial.description"></p>
</div> </div>
</div> <div class="col-sm-12">
</div> <div class="col-xs-12">
<button class="btn btn-primary"
type="button"
ng-if="uploadShowFlag"
ngf-select="uploadFile($files, $index)"
ngf-multiple="true">
<i class="fa fa-upload"></i> Upload
</button>
</div>
&nbsp;&nbsp;<br>
<div class="col-xs-12">
<uib-progressbar value="item.fileProgressValue"
type="success"
animate="true"
ng-if="item.fileProgressValue"
max="100"
ng-if="uploadShowFlag"
>{{item.fileProgressValue}}%</uib-progressbar>
<div class="form-group" ng-repeat="item in riskMaterial.material"> <img class="col-xs-3 logo-width"
<div class="col-sm-12 text-left"> ng-repeat="url in (item.file)"
<p ng-bind="item.question"></p> ng-src="{{url}}">
</div>
</div>
</div> </div>
<div class="col-sm-12">
&nbsp;&nbsp;<br> <div class="form-group">
<div class="col-xs-12"> <label class="control-label col-sm-2">Description</label>
<a class="col-xs-3 logo-width" ng-repeat="url in item.file" target="_blank" ng-href="{{url}}"> <div class="col-sm-10">
<img class="col-xs-12" ng-src="{{url}}"> <textarea class="form-control" required
</a> ng-model="riskMaterial.description"
placeholder="No more than 500"
name="description"
ng-disabled="!uploadShowFlag"
maxlength="500"></textarea>
</div> </div>
</div> </div>
</div>
</div> </div>
</form>
</div> </div>
<div class="panel-footer"> <div class="panel-footer">
<a role="button" <a role="button"
ui-sref="analysis_monitoring.risk_business" ui-sref="analysis_monitoring.risk_business"
class="btn btn-info">返回 class="btn btn-info">返回
</a> </a>
<button
class="btn btn-success"
ng-disabled="!uploadShowFlag || (!riskMaterial.description)"
ng-if="uploadShowFlag"
ng-click="submit(uploadForm);">Submit</button>
</div> </div>
</div> </div>

@ -113,8 +113,8 @@
</form> </form>
<div style="text-align: center" ng-if="uploadShowFlag"> <div style="text-align: center" ng-if="uploadShowFlag">
<a role="button" style="margin-bottom: 25px;" class="btn btn-success btn-sm ng-scope" ng-disabled="!(allMaterialInfo.description)" <button style="margin-bottom: 25px;" class="btn btn-success btn-sm ng-scope" ng-disabled="!(allMaterialInfo.description)"
ng-click="submit(uploadForm)">Submit</a> ng-click="submit(uploadForm)">Submit</button>
</div> </div>
</div> </div>

@ -27,6 +27,7 @@
<input type="text" <input type="text"
class="form-control" class="form-control"
id="partner-code-search" id="partner-code-search"
ng-enter="loadRiskEvents(1)"
ng-model="params.clientMoniker"> ng-model="params.clientMoniker">
</div> </div>
</div> </div>
@ -41,6 +42,7 @@
class="form-control" class="form-control"
id="sub-merchant-id-search" id="sub-merchant-id-search"
placeholder="子商户号" placeholder="子商户号"
ng-enter="loadRiskEvents(1)"
ng-model="params.subMerchantId"> ng-model="params.subMerchantId">
</div> </div>
</div> </div>
@ -72,6 +74,7 @@
type="text" type="text"
name="order_ids" name="order_ids"
placeholder="多个订单请用逗号分隔" placeholder="多个订单请用逗号分隔"
ng-enter="loadRiskEvents(1)"
id="order-ids-input"> id="order-ids-input">
</div> </div>
</div> </div>

@ -126,7 +126,7 @@
<th>Result Type</th> <th>Result Type</th>
<th>Sub Merchant ID</th> <th>Sub Merchant ID</th>
<th>Description</th> <th>Description</th>
<th>Channel Result</th> <!--<th>Channel Result</th>-->
<th>Risk Manager</th> <th>Risk Manager</th>
<th>Create Time</th> <th>Create Time</th>
<th>Operation</th> <th>Operation</th>
@ -145,7 +145,7 @@
</td> </td>
<td ng-bind="riskEvent.sub_merchant_id"></td> <td ng-bind="riskEvent.sub_merchant_id"></td>
<td ng-bind="riskEvent.description | limitTo:20"></td> <td ng-bind="riskEvent.description | limitTo:20"></td>
<td ng-bind="riskEvent.channel_result"></td> <!--<td ng-bind="riskEvent.channel_result"></td>-->
<td ng-bind="riskEvent.fillin_person"></td> <td ng-bind="riskEvent.fillin_person"></td>
<td ng-bind="riskEvent.create_time"></td> <td ng-bind="riskEvent.create_time"></td>
<td> <td>

Loading…
Cancel
Save