[fix]风控上传页面

master
lujian 6 years ago
parent e94ee7e764
commit 1dbd7dca0c

@ -494,8 +494,13 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
@Override
public void sendRefuseEmail(String riskId, String refuseDescription) throws IOException {
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!");
} 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);
Context ctx = getMailContext(event);
@ -975,8 +980,14 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
return result;
}
@Transactional
@Override
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);
riskProcessLogService.addRiskProcessLog(params.getString("risk_id"),
manager.getString("manager_id"),

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

@ -144,7 +144,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
industries.push(industry.label);
});
industries.push('未知行业');
console.log(industries);
// console.log(industries);
// 加载风险注册事件
$scope.loadRiskEvents = function (page) {
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',
function ($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, Upload) {
// 一键下载功能
$scope.downloadAsZip = function () {
@ -543,6 +543,61 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
};
$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) {
@ -553,7 +608,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
title: 'Warning',
contentHtml: $sce.trustAsHtml(warningMessageHTML)
}).then(function () {
$scope.riskEvent.result_type = auditType;
// $scope.riskEvent.result_type = auditType;
$http.put(url, $scope.riskEvent).then(function (resp) {
commonDialog.alert({title: 'Success', content: "材料已通过!"});
$state.go('^', {}, {reload: true});

@ -24,45 +24,74 @@
</a>
</div>
<div class="panel-body">
<div class="form-vertical">
<div class="form-group" ng-if="riskMaterial.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="riskMaterial.refuse_description"></p>
<form novalidate name="uploadForm">
<div class="form-vertical">
<div class="form-group" ng-if="riskMaterial.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="riskMaterial.refuse_description"></p>
</div>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Description:</label>
<div class="col-sm-10">
<div class="form-control-static">
<p ng-bind="riskMaterial.description"></p>
<div class="form-group" ng-repeat="item in riskMaterial.material">
<div class="col-sm-12 text-left">
<p>{{item.question}}</p>
</div>
</div>
</div>
<div class="col-sm-12">
<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">
<div class="col-sm-12 text-left">
<p ng-bind="item.question"></p>
<img class="col-xs-3 logo-width"
ng-repeat="url in (item.file)"
ng-src="{{url}}">
</div>
</div>
</div>
<div class="col-sm-12">
&nbsp;&nbsp;<br>
<div class="col-xs-12">
<a class="col-xs-3 logo-width" ng-repeat="url in item.file" target="_blank" ng-href="{{url}}">
<img class="col-xs-12" ng-src="{{url}}">
</a>
<div class="form-group">
<label class="control-label col-sm-2">Description</label>
<div class="col-sm-10">
<textarea class="form-control" required
ng-model="riskMaterial.description"
placeholder="No more than 500"
name="description"
ng-disabled="!uploadShowFlag"
maxlength="500"></textarea>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
<div class="panel-footer">
<a role="button"
ui-sref="analysis_monitoring.risk_business"
class="btn btn-info">返回
</a>
<button
class="btn btn-success"
ng-disabled="!uploadShowFlag || (!riskMaterial.description)"
ng-if="uploadShowFlag"
ng-click="submit(uploadForm);">Submit</button>
</div>
</div>

@ -113,8 +113,8 @@
</form>
<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)"
ng-click="submit(uploadForm)">Submit</a>
<button style="margin-bottom: 25px;" class="btn btn-success btn-sm ng-scope" ng-disabled="!(allMaterialInfo.description)"
ng-click="submit(uploadForm)">Submit</button>
</div>
</div>

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

@ -126,7 +126,7 @@
<th>Result Type</th>
<th>Sub Merchant ID</th>
<th>Description</th>
<th>Channel Result</th>
<!--<th>Channel Result</th>-->
<th>Risk Manager</th>
<th>Create Time</th>
<th>Operation</th>
@ -145,7 +145,7 @@
</td>
<td ng-bind="riskEvent.sub_merchant_id"></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.create_time"></td>
<td>

Loading…
Cancel
Save