Merge branch 'develop'

master
yixian 4 years ago
commit 6af5029bf0

@ -257,4 +257,7 @@ public interface RetailAppService {
JSONObject getAccountBindInfos(JSONObject device);
JSONObject postAppMessage(JSONObject device, RetailAppMessage message);
void submitEmailCertificate(JSONObject material, JSONObject device);
}

@ -2944,6 +2944,26 @@ public class RetailAppServiceImp implements RetailAppService {
return resp;
}
@Override
public void submitEmailCertificate(JSONObject material, JSONObject device) {
riskUploadService.submitEmailCertificate(material);
JSONObject event = riskBusinessService.getRiskEventDetail(material.getString("risk_id"));
//材料审核通过后可以重新提交
if (event.getIntValue("result_type") == 3) {
return;
}
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());
}
private void exportCBBankAggregateFile(JSONObject client, HttpServletResponse httpResponse) {
httpResponse.setContentType("application/pdf");
httpResponse.setHeader("content-disposition", "attachment;filename=" + client.getString("client_moniker") + "_AGREEMENT_" + new Date() + ".pdf");

@ -686,6 +686,16 @@ public class RetailAppController {
public JSONObject getRiskEventMaterialsRemark(@PathVariable("risk_id") String riskId) {
return riskBusinessService.getRiskEventMaterialsRemark(riskId);
}
/**
* app
*
* @param riskId
* @return
*/
@GetMapping(value = "/risk/business/events/{risk_id}/emailscreenshot")
public JSONObject getEmailScreenshot(@PathVariable("risk_id") String riskId) {
return riskBusinessService.getEmailScreenshot(riskId);
}
/**
* app
@ -697,6 +707,16 @@ public class RetailAppController {
retailAppService.submitMaterial(material, device);
}
/**
*
* @param material
* @param device
*/
@PostMapping(value = "/risk/business/events/emailscreenshot")
public void uploadEmailCertificate(@RequestBody JSONObject material, @ModelAttribute(RETAIL_DEVICE) JSONObject device) {
retailAppService.submitEmailCertificate(material, device);
}
@PostMapping("/risk/business/upload/files")
public JSONObject uploadImage(@RequestParam MultipartFile file) throws Exception {
return attachmentClient.uploadFile(file, false);

@ -15,4 +15,7 @@ public interface RiskFileMapper {
@AutoSql(SqlType.SELECT)
List<JSONObject> findAllFiles(@Param("material_id") String material_id);
@AutoSql(SqlType.SELECT)
List<JSONObject> findEmailScreenshot(@Param("material_id") String material_id,@Param("file_type") String file_type);
}

@ -146,4 +146,12 @@ public interface RiskBusinessService {
void updateRiskEventRemark(String riskId, String remark);
void markChargebackStatus(String riskId, JSONObject manager, ChargebackStatus status);
/**
*
* @param riskId
* @return
*/
JSONObject getEmailScreenshot(String riskId);
}

@ -8,6 +8,11 @@ public interface RiskUploadService {
* @param material
*/
void submitMaterial(JSONObject material);
/**
*
* @param material
*/
void submitEmailCertificate(JSONObject material);
/**
*

@ -71,6 +71,7 @@ import org.thymeleaf.context.Context;
import org.thymeleaf.spring5.SpringTemplateEngine;
import javax.annotation.Resource;
import javax.rmi.CORBA.Util;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@ -1432,6 +1433,28 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
}
}
@Override
public JSONObject getEmailScreenshot(String riskId) {
JSONObject riskEvent = riskEventMapper.findById(riskId);
JSONObject result = new JSONObject();
if (riskEvent == null || riskEvent.isEmpty()) return result;
List<JSONObject> riskMaterialList = riskMaterialMapper.findAllMaterials(riskEvent.getString("risk_id"));
if (riskMaterialList != null && !riskMaterialList.isEmpty()) {
JSONObject fileNew = riskMaterialList.get(0);
List<JSONObject> files = riskFileMapper.findEmailScreenshot(fileNew.getString("material_id"),"0");
logger.info("====>files:"+files);
for (JSONObject file : files) {
// int fileType = file.getIntValue("file_type");
result.put("fileUrl" , file.getString("file_url"));
}
result.put("description", fileNew.getString("description"));
}
return result;
}
private List<String> getShopTemplate() {
return Arrays.asList("1.与调查交易金额对应的购物小票/发票存根照片 要求:照片应清晰,必须显示商户名称、商户地址、购物时间、物品名称、购物金额等;\n" +
"Photos of shopping receipts/ invoice stubs Requirement corresponding with the investigated orders Requirement: The photos should be clear and must show Merchant name, Business address, Transaction time, Product information, Quantity purchased, etc;",

@ -69,6 +69,37 @@ public class RiskUploadServiceIpml implements RiskUploadService {
// }
}
@Override
public void submitEmailCertificate(JSONObject material) {
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()) && !resultType.equals(RiskResultTypeEnum.MATERIAL_AUDIT_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(riskId).get(0).getString("material_id"));
if(material.containsKey("file0_url")){
JSONArray urls = material.getJSONArray("file0_url");
if (urls == null || urls.isEmpty())
throw new BadRequestException("Picture cannot be empty");
for(Object url:urls){
JSONObject file = new JSONObject();
file.put("file_url",url.toString());
file.put("file_type",0);
file.put("material_id",material.getString("material_id"));
riskFileMapper.save(file);
}
}
if(event.getIntValue("result_type")!= RiskResultTypeEnum.MATERIAL_AUDIT_PASS.getResultType()){
event.put("result_type", RiskResultTypeEnum.WAIT_FOR_AUDIT.getResultType());
riskEventMapper.update(event);
}
}
@Override
public void deleteUploadMailKey(String codeKey) {
stringRedisTemplate.delete(getRiskUploadKey(codeKey));

@ -152,10 +152,10 @@
<update id="postponeMerchantRateByClientId">
<![CDATA[
INSERT sys_client_rates (manager_id, client_id, rate_name, rate_value, transaction_fee, active_time, expiry_time, create_time, update_time, manager_name, clean_days, remark)
INSERT sys_client_rates (manager_id, client_id, rate_name, rate_value, transaction_fee, active_time, expiry_time, create_time, update_time, manager_name, clean_days, remark,ext_rates,pay_type)
SELECT CONCAT('System-', CURRENT_DATE()),r.client_id,r.rate_name,r.rate_value,r.transaction_fee,DATE_ADD(r.expiry_time, INTERVAL 1 day),
IF(DATE_ADD( r.expiry_time, INTERVAL 1 YEAR )<=NOW(),DATE_ADD( r.expiry_time, INTERVAL 2 YEAR ),DATE_ADD( r.expiry_time, INTERVAL 1 YEAR )) expiry_time,NOW(), NOW(),
CONCAT('System-', CURRENT_DATE()),r.clean_days,'费率自动延期一年'
CONCAT('System-', CURRENT_DATE()),r.clean_days,'费率自动延期一年',r.ext_rates,r.pay_type
FROM (select rr.* from sys_client_rates rr
WHERE rr.client_id = #{client_id}
and rr.rate_name = #{channel}

@ -6815,6 +6815,8 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
function ($scope, $http, $uibModal, $state, subMerchantInfo, $filter, merchantIds, commonDialog, wechatGoodMcc, businessTypesMap) {
$scope.wxIndustries = angular.copy(wxMerchantIndustries)
$scope.subMerchantInfo = angular.copy(subMerchantInfo)
$scope.subMerchantInfo.address= subMerchantInfo.address+","+subMerchantInfo.suburb
+","+subMerchantInfo.state+","+subMerchantInfo.country;
$scope.subMerchantInfo.company_register_no = subMerchantInfo.abn ? subMerchantInfo.abn : subMerchantInfo.acn
$scope.wechatMccIndustries = wechatGoodMcc.configs()
$scope.merchantIds = merchantIds.data
@ -6993,7 +6995,8 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.subMerchantInfo.short_name = $scope.merchantInfo.short_name
$scope.subMerchantInfo.industry = $scope.merchantInfo.industry
$scope.subMerchantInfo.company_website = $scope.merchantInfo.company_website
$scope.subMerchantInfo.address = $scope.merchantInfo.address
$scope.subMerchantInfo.address = $scope.merchantInfo.address+","+$scope.merchantInfo.suburb
+","+$scope.merchantInfo.state+","+$scope.merchantInfo.country;
$scope.subMerchantInfo.company_phone = $scope.merchantInfo.company_phone
$scope.subMerchantInfo.contact_person = $scope.merchantInfo.contact_person
$scope.subMerchantInfo.contact_phone = $scope.merchantInfo.contact_phone

Loading…
Cancel
Save