add app接口、代码优化

master
luoyang 5 years ago
parent 4703b26ede
commit 5ccff0ef78

@ -201,4 +201,8 @@ public interface RetailAppService {
void getSourceAggregateFile(JSONObject device, HttpServletResponse httpResponse);
JSONObject getClientAggregateFile(JSONObject device, MultipartFile file) throws IOException;
void uploadGreenChannelAuthFiles(JSONObject device, ClientAuthFilesInfo filesInfo);
void commitAuthFilesToCompliance(JSONObject device);
}

@ -2287,6 +2287,27 @@ public class RetailAppServiceImp implements RetailAppService {
return exportImgAggregateFile(client);
}
@Override
public void uploadGreenChannelAuthFiles(JSONObject device, ClientAuthFilesInfo clientAuthFilesInfo) {
String clientType = device.getString("client_type");
deviceSupport.findRegister(clientType);
JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id"));
JSONObject account = clientAccountMapper.findById(device.getString("account_id"));
clientAuthFilesInfo.setAuthStatus(0);
clientAuthFilesInfo.setFile_agreement_info(null);
clientAuthFilesInfo.setFile_apply_info(null);
clientManager.uploadAuthFilesForWaitCompliance(account, client.getString("client_moniker"), clientAuthFilesInfo);
}
@Override
public void commitAuthFilesToCompliance(JSONObject device) {
String clientType = device.getString("client_type");
deviceSupport.findRegister(clientType);
JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id"));
JSONObject account = clientAccountMapper.findById(device.getString("account_id"));
clientManager.commitAuthFilesToCompliance(client.getString("client_moniker"), account);
}
private JSONObject exportImgAggregateFile(JSONObject client) throws IOException{
JSONObject result = new JSONObject();
InputStream stream = null;

@ -751,4 +751,24 @@ public class RetailAppController {
return retailAppService.getClientAggregateFile(device, file);
}
/**
*
* @param device
* @param filesInfo url
*/
@RequestMapping(value = "/client/auth_file", method = RequestMethod.PUT)
public void uploadGreenChannelAuthFiles(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device,@RequestBody ClientAuthFilesInfo filesInfo){
retailAppService.uploadGreenChannelAuthFiles(device, filesInfo);
}
/**
*
* @param device
*/
@RequestMapping(value = "/client/auth_file/commit_to_compliance", method = RequestMethod.POST)
public void commitToComplianceAuthFiles(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device){
retailAppService.commitAuthFilesToCompliance(device);
}
}

@ -559,13 +559,9 @@ public class PartnerViewController {
@PartnerMapping(value = "/update/wait_compliance_file", method = RequestMethod.PUT)
@ResponseBody
public void updateWaitComplianceFile(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody ClientAuthFilesInfo filesInfo) {
JSONObject client = account.getJSONObject("client");
/*if (client.getIntValue("approve_result") != 1 && client.getIntValue("source") == 4){
JSONObject manager = new JSONObject();
manager.put("display_name","client");
clientManager.uploadAuthFiles(manager, account.getString("client_moniker"), filesInfo);
}*/
if (true){
JSONObject client = clientManager.getClientInfo(account.getIntValue("client_id"));
JSONObject authFileStatus = signInAccountService.checkAuthFileStatus(client);
if (authFileStatus.getBooleanValue("client_less_file")) {
JSONObject manager = new JSONObject();
manager.put("display_name","client");
clientManager.uploadAuthFilesForWaitCompliance(manager, account.getString("client_moniker"), filesInfo);

@ -1,18 +0,0 @@
<?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.system.ClientComplianceCompanyMapper">
<select id="findFileByClientAndType" resultType="com.alibaba.fastjson.JSONObject">
select * from sys_files
where client_id = #{client_id}
and file_name = #{file_name}
and status = 1
and is_valid = 1
order by last_update_date desc
</select>
<update id="confirmAgreeFile">
update sys_files
set state = 2
where file_name = 'source_agree_file'
and client_id = #{client_id}
</update>
</mapper>

@ -3807,7 +3807,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.file_id = file_id;
/*$http.put('/sys/partners/' + $scope.partner.client_moniker + '/saveAdditional_content', {additional_content: $scope.partner.additional_content}).then(function (resp) {*/
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/delete',{file_id: $scope.file_id}).then(function (resp) {
$http.put('/sys/partners/auth_file/' + $scope.file_id + '/delete').then(function (resp) {
$state.reload();
})
};

@ -955,20 +955,20 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
$scope.clientComplianceViewCommit= function () {
if(!$scope.file.client_agree_file)
if(!$scope.file.client_files.client_agree_file)
{
commonDialog.alert({title: 'Error', content: '请提交* Agreement', type: 'error'});
return;
}else if(!$scope.file.client_id_file)
}else if(!$scope.file.client_files.client_id_file)
{
commonDialog.alert({title: 'Error', content:'请提交* ID', type: 'error'});
return;
}else if(!$scope.file.client_bank_file)
}else if(!$scope.file.client_files.client_bank_file)
{
commonDialog.alert({title: 'Error', content: '请提交* bank statement', type: 'error'});
return;
}
else if(!$scope.file.client_company_file)
else if(!$scope.file.client_files.client_company_file)
{
commonDialog.alert({title: 'Error', content: '请提交* Certificate of Registration', type: 'error'});
return;

Loading…
Cancel
Save