Commit c0183624 authored by shangying's avatar shangying

sonar问题修改1

parent b1419a92
......@@ -19,7 +19,7 @@ public class BootstrapNew {
private String passportapiHttp;
@Test
public void testStart() {
public void startTest() {
String nameSpace1=nameSpace;
System.out.println("Hello,World!!!"+nameSpace1);
......
......@@ -27,9 +27,9 @@ public class OneClickDataController {
@Autowired
private OneClickDataOperateService oneClickDataOperateService;
@Autowired
OneClickDataQueueOperateService oneClickDataQueueOperateService;
private OneClickDataQueueOperateService oneClickDataQueueOperateService;
OneClickModel oneClickModelNew;
private OneClickModel oneClickModelNew;
@PostMapping("/v1/type")
public Result OneClickDataOperate(@RequestBody @Valid OneClickModel oneClickModel) throws Exception {
......
......@@ -38,7 +38,7 @@ public interface OneClickDataRespository extends JpaRepository<OneClickData, Lon
// 通过授信状态查询,申请类型是非1的
@Query(value = "select * from one_click_data where credit_status = ?1 and type not in ?2 order by id desc limit 1", nativeQuery = true)
List<OneClickData> findByCreditStatusNotInType(Integer creditStatus,Integer type);
List<OneClickData> findByCreditStatusAndTypeNotIn(Integer creditStatus,Integer type);
// 通过id修改 放款loanid
@Transactional(rollbackFor = Exception.class)
......
......@@ -36,23 +36,23 @@ import java.util.Map;
@Slf4j
@Service
public class ApplyLoanServiceImpl implements ApplyLoanService {
String idNo = ChineseIDCardNumberGenerator.generate();
String orderNo="testOrderNo_0001";
private String idNo = ChineseIDCardNumberGenerator.generate();
private String orderNo="testOrderNo_0001";
@Value("${qapi.http.net}")
private String qapiHttp;
@Autowired
OneClickDataRespository oneClickDataRespository;
private OneClickDataRespository oneClickDataRespository;
@Autowired
CLFCenterServiceImpl clfCenterService;
private CLFCenterServiceImpl clfCenterService;
@Autowired
PhoneInfoService phoneInfoService;
private PhoneInfoService phoneInfoService;
OneClickOV oneClickOV;
ClfChannelConfiguration clfChannelConfiguration;
public static String md5Keywy = "qEAxMJBv";
public static String aesKeywy = "sxD8KO79EDK0N0AJ";
private OneClickOV oneClickOV;
private ClfChannelConfiguration clfChannelConfiguration;
private String md5Keywy = "qEAxMJBv";
private String aesKeywy = "sxD8KO79EDK0N0AJ";
Result oneClickReslut=null;
@Override
......@@ -87,10 +87,13 @@ public class ApplyLoanServiceImpl implements ApplyLoanService {
JSONObject bizData= (JSONObject) JSONObject.parse(getDecryptionResult.get("bizData").toString());
log.info("bizData={}",bizData);
String code=bizData.get("code").toString();
String codeCompare=bizData.get("code").toString();
String businessCode=bizData.get("businessCode").toString();
String businessCodeCompare=bizData.get("businessCode").toString();
String msg=bizData.get("msg").toString();
log.info("msg={}",msg);
if(code.equals("0") && businessCode.equals("0000")){
if(code.equals(codeCompare) && businessCode.equals(businessCodeCompare)){
//申请的数据插入数据库 one_click_data
OneClickData oneClickData=new OneClickData();
oneClickData.setPhone(oneClickModel.getPhone());
......
......@@ -33,17 +33,17 @@ public class CashWithdrawalServiceImpl implements CashWithdrawalService{
@Value("${qapi.http.net}")
private String qapiHttp;
@Autowired
OneClickDataRespository oneClickDataRespository;
private OneClickDataRespository oneClickDataRespository;
@Autowired
CLFCenterServiceImpl clfCenterService;
private CLFCenterServiceImpl clfCenterService;
@Autowired
PhoneInfoService phoneInfoService;
private PhoneInfoService phoneInfoService;
@Autowired
LoanOperationService loanOperationService;
private LoanOperationService loanOperationService;
ClfChannelConfiguration clfChannelConfiguration;
public static String md5Keywy = "qEAxMJBv";
public static String aesKeywy = "sxD8KO79EDK0N0AJ";
private ClfChannelConfiguration clfChannelConfiguration;
private String md5Keywy = "qEAxMJBv";
private String aesKeywy = "sxD8KO79EDK0N0AJ";
/**
*申请提现请求
* */
......
......@@ -35,16 +35,16 @@ import java.util.Objects;
public class CreditGrantingServiceImpl implements CreditGrantingService{
@Autowired
ApplyLoanService applyLoanService;
private ApplyLoanService applyLoanService;
@Autowired
PhoneInfoService phoneInfoService;
private PhoneInfoService phoneInfoService;
@Autowired
OneClickDataRespository oneClickDataRespository;
private OneClickDataRespository oneClickDataRespository;
@Autowired
FundsAllocationplanServiceImpl fundsAllocationplanService;
private FundsAllocationplanServiceImpl fundsAllocationplanService;
public static String txAmount = "2000";
public static String rate = "0";
......@@ -53,7 +53,7 @@ public class CreditGrantingServiceImpl implements CreditGrantingService{
@Override
public Result authAmountAuditNotify(OneClickModel oneClickModel) throws Exception {
String auditResult="true";
if(oneClickModel.getType().equals("2") || oneClickModel.getType().equals("4") || oneClickModel.getType().equals("5")|| oneClickModel.getType().equals("6") || oneClickModel.getType().equals("7")){
if("2".equals(oneClickModel.getType()) || "4".equals(oneClickModel.getType()) || "5".equals(oneClickModel.getType())|| "6".equals(oneClickModel.getType()) || "7".equals(oneClickModel.getType())){
auditResult="true";
}else if(oneClickModel.getType().equals("3")){
auditResult="false";
......@@ -66,9 +66,9 @@ public class CreditGrantingServiceImpl implements CreditGrantingService{
@Override
public Result authAmountAuditNotifyMq(OneClickData oneClickData, QuotaCredit quotaCredit) throws Exception {
String auditResult="true";
if(oneClickData.getType().equals("2") || oneClickData.getType().equals("4") || oneClickData.getType().equals("5")|| oneClickData.getType().equals("6") || oneClickData.getType().equals("7")){
if("2".equals(oneClickData.getType()) || "4".equals(oneClickData.getType()) || "5".equals(oneClickData.getType())|| "6".equals(oneClickData.getType()) || "7".equals(oneClickData.getType())){
auditResult="true";
}else if(oneClickData.getType().equals("3")){
}else if("3".equals(oneClickData.getType())){
auditResult="false";
}else {
log.info("非授信需要的状态,打印一下oneClickModel.getType()={}",oneClickData.getType());
......@@ -140,8 +140,10 @@ public class CreditGrantingServiceImpl implements CreditGrantingService{
// log.info("打印一下quotaCredit1={}",quotaCredit1);
// }
JSONObject result = HttpRequest.doPostReturnResponseJson(url, paras, header);
String statusCode=result.get("statusCode").toString().trim();
String context=result.get("context").toString().trim();
if(result.get("statusCode").toString().trim().equals("200") && result.get("context").toString().trim().equals("success")){
if("200".equals(statusCode) && "success".equals(context)){
//从数据库中获取当前的订单
log.info("userId={},CreditStatusEnum={},LoanStatusEnum={},channel={}", userId, CreditStatusEnum.DEFAULT.getCode(), LoanStatusEnum.DEFAULT.getCode(),oneClickModel.getChannel());
OneClickData oneClickData=oneClickDataRespository.findByUserIdAndCreditStatusAndLoanStatusAndChannelCode(userId.toString().trim(), CreditStatusEnum.DEFAULT.getCode(), LoanStatusEnum.DEFAULT.getCode(), oneClickModel.getChannel().toString().trim());
......@@ -233,8 +235,9 @@ public class CreditGrantingServiceImpl implements CreditGrantingService{
log.info("获取paras={},获取header={}",paras,header);
JSONObject result = HttpRequest.doPostReturnResponseJson(url, paras, header);
if(result.get("statusCode").toString().trim().equals("200") && result.get("context").toString().trim().equals("success")){
String statusCode=result.get("statusCode").toString().trim();
String context=result.get("context").toString().trim();
if("200".equals(statusCode) && "success".equals(context)) {
//把授信请求通知的数据存放到表one_click_data中
int update= oneClickDataRespository.updateById(quotaRecordOrderNo.toString().trim(), quotaRecordOrderNo.toString().trim(), String.valueOf(productId).toString().trim(), getToken.toString().trim(),quotaCredit.getProductType(), oneClickData.getId());
......
......@@ -49,7 +49,8 @@ public class FundsAllocationplanServiceImpl implements FundsAllocationplanServic
String url = opapiHttp + "/user/login?auth=dXNlcj14dWV6aiZwYXNzd29yZD0xMjMxMjNxd2Vxd2U%3D";
JSONObject result = HttpRequest.doGetReturnResponseJson(url);
JSONObject resultData = (JSONObject) result.get("data");
if(result.get("businessCode").toString().trim().equals("0000")){
String businessCode=result.get("businessCode").toString().trim();
if("0000".equals(businessCode)){
log.info("打印token:{}",resultData.get("token").toString().trim());
return resultData.get("token").toString().trim();
}else{
......@@ -76,7 +77,9 @@ public class FundsAllocationplanServiceImpl implements FundsAllocationplanServic
header.put("Content-Type", "application/x-www-form-urlencoded");
header.put("x-auth-token", loginOPToken());
JSONObject result = HttpRequest.doPostReturnResponseJson(url, paras, header);
if(result.get("businessCode").toString().trim().equals("0000") && result.get("code").toString().trim().equals("0000") ){
String businessCode=result.get("businessCode").toString().trim();
String code=result.get("code").toString().trim();
if("0000".equals(businessCode) && "0000".equals(code) ){
boo=true;
}else {
boo=false;
......@@ -113,7 +116,9 @@ public class FundsAllocationplanServiceImpl implements FundsAllocationplanServic
JSONObject result = HttpRequest.doPostReturnResponseJson(url,paras, header);
if(result.get("businessCode").toString().trim().equals("0000") && result.get("code").toString().trim().equals("0000") ){
String businessCode=result.get("businessCode").toString().trim();
String code=result.get("code").toString().trim();
if("0000".equals(businessCode) && "0000".equals(code) ){
boo=true;
}else {
boo=false;
......
......@@ -18,7 +18,7 @@ import java.util.Map;
*/
public class GuangDaXiaoDaiServiceImpl implements GuangDaXiaoDaiService {
@Autowired
ILoanApplicationManifestHistoryRepository loanApplicationManifestHistoryRepository;
private ILoanApplicationManifestHistoryRepository loanApplicationManifestHistoryRepository;
@Value("{gyxdapi.http.net}")
private String gyxdHttp;
@Override
......@@ -49,7 +49,8 @@ public class GuangDaXiaoDaiServiceImpl implements GuangDaXiaoDaiService {
if(!result.get("data").toString().trim().isEmpty()) {
JSONObject resultData = (JSONObject) result.get("data");
if(result.get("businessCode").toString().trim().equals("0000")){
String businessCode=result.get("businessCode").toString().trim();
if("0000".equals(businessCode)){
return resultData.get("token").toString().trim();
}else {
......
......@@ -32,17 +32,17 @@ import java.util.Objects;
public class LoanOperationServiceImpl implements LoanOperationService{
@Autowired
LoanApplicationHistoryRepository loanApplicationHistoryRepository;
private LoanApplicationHistoryRepository loanApplicationHistoryRepository;
@Autowired
XYQBCenterService xyqbCenterService;
private XYQBCenterService xyqbCenterService;
@Autowired
WaitingFundingCorpOperatePeopleRepository waitingFundingCorpOperatePeopleRepository;
private WaitingFundingCorpOperatePeopleRepository waitingFundingCorpOperatePeopleRepository;
@Autowired
OneClickDataRespository oneClickDataRespository;
private OneClickDataRespository oneClickDataRespository;
@Autowired
LoanOperationService loanOperationService;
private LoanOperationService loanOperationService;
@Autowired
FundsAllocationplanService fundsAllocationplanService;
private FundsAllocationplanService fundsAllocationplanService;
@Value("${opapi.http.net}")
private String opapiHttp;
@Value("${clotho.http.net}")
......@@ -155,7 +155,8 @@ public class LoanOperationServiceImpl implements LoanOperationService{
// 查看当前的放款单的状态是21
LoanApplicationHistory loanApplicationHistory= loanOperationService.selectLoanId(Long.valueOf(oneClickData.getUserId().trim()), oneClickData.getBizType());
if(loanApplicationHistory.getProgress().getDescription().trim().equals(LoanProgress.FINAL_SENDED_TO_FUNDING_CORP.getDescription().trim()) ){
String progress=loanApplicationHistory.getProgress().getDescription().trim();
if(LoanProgress.FINAL_SENDED_TO_FUNDING_CORP.getDescription().trim().equals(progress) ){
//系统自动打款,无需调用打款操作
return payNotify(oneClickData, payStatus);
}else{
......@@ -193,7 +194,9 @@ public class LoanOperationServiceImpl implements LoanOperationService{
header.put("Content-Type", "application/x-www-form-urlencoded");
header.put("x-auth-token", fundsAllocationplanService.loginOPToken());
JSONObject result = HttpRequest.doPostReturnResponseJson(url, paras, header);
if (result.get("businessCode").toString().trim().equals("0000") && result.get("code").toString().trim().equals("0000")) {
String businessCode=result.get("businessCode").toString().trim();
String code=result.get("code").toString().trim();
if ("0000".equals(businessCode) && "0000".equals(code)) {
// 需要咨询这个接口
// 待续中。。。。。。
......
package cn.quantgroup.cashloanflowboss.api.oneclickdata.service.Impl; import cn.quantgroup.cashloanflowboss.api.oneclickdata.entity.OneClickData;import cn.quantgroup.cashloanflowboss.api.oneclickdata.repository.OneClickDataRespository;import cn.quantgroup.cashloanflowboss.api.oneclickdata.repository.OneClickJobConfigRepository;import cn.quantgroup.cashloanflowboss.api.oneclickdata.service.CreditGrantingService;import cn.quantgroup.cashloanflowboss.api.oneclickdata.service.OneClickDataOperateJobService;import cn.quantgroup.cashloanflowboss.api.oneclickdata.service.PhoneInfoService;import cn.quantgroup.cashloanflowboss.spi.xyqb.entity.QuotaCredit;import lombok.extern.slf4j.Slf4j;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.stereotype.Service; import java.util.List;import java.util.Objects; /** * Created by shang on 2019/12/12. */@Slf4j@Servicepublic class OneClickDataOperateJobServiceImpl implements OneClickDataOperateJobService { @Autowired PhoneInfoService phoneInfoService; @Autowired OneClickDataRespository oneClickDataRespository; @Autowired CreditGrantingService creditGrantingService; @Override public void excuteCreditSuccessJob() { } @Override public void excuteCreditFailJob() { } @Override public void excuteSelectCreditStatusJob() { //查找请求类型:2授信成功、4放款成功、5放款失败、6清算的单,并且当前的授信状态是0授信中 List<OneClickData> oneClickDataList=oneClickDataRespository.findByCreditStatusNotInType(0, 1); for(OneClickData oneClickData:oneClickDataList) { // 当前授信中的单在apply_quota 查看状态是apply_status=1 时间倒序,进行授信请求操作 QuotaCredit quotaCredit1 = phoneInfoService.selectUserAuditRecords(Long.parseLong(oneClickData.getUserId()), Long.parseLong(oneClickData.getChannelCode())); if (Objects.isNull(quotaCredit1)){ log.info("不符合授信审核申请的条件"); }else { //如何条件的单进行授信申请请求 log.info("符合授信审核申请的条件oneClickData={},quotaCredit1={}", oneClickData, quotaCredit1); try { creditGrantingService.authAmountAuditNotifyMq(oneClickData,quotaCredit1); }catch (Exception e){ log.info("进入异常e={}",e.getMessage()); } } } } @Override public void excuteFundSucessJob() { } @Override public void excuteFundFailJob() { } @Override public void excuteSelectFundStatusJob() { } }
\ No newline at end of file
package cn.quantgroup.cashloanflowboss.api.oneclickdata.service.Impl; import cn.quantgroup.cashloanflowboss.api.oneclickdata.entity.OneClickData;import cn.quantgroup.cashloanflowboss.api.oneclickdata.repository.OneClickDataRespository;import cn.quantgroup.cashloanflowboss.api.oneclickdata.repository.OneClickJobConfigRepository;import cn.quantgroup.cashloanflowboss.api.oneclickdata.service.CreditGrantingService;import cn.quantgroup.cashloanflowboss.api.oneclickdata.service.OneClickDataOperateJobService;import cn.quantgroup.cashloanflowboss.api.oneclickdata.service.PhoneInfoService;import cn.quantgroup.cashloanflowboss.spi.xyqb.entity.QuotaCredit;import lombok.extern.slf4j.Slf4j;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.stereotype.Service; import java.util.List;import java.util.Objects; /** * Created by shang on 2019/12/12. */@Slf4j@Servicepublic class OneClickDataOperateJobServiceImpl implements OneClickDataOperateJobService { @Autowired private PhoneInfoService phoneInfoService; @Autowired private OneClickDataRespository oneClickDataRespository; @Autowired private CreditGrantingService creditGrantingService; @Override public void excuteCreditSuccessJob() { } @Override public void excuteCreditFailJob() { } @Override public void excuteSelectCreditStatusJob() { //查找请求类型:2授信成功、4放款成功、5放款失败、6清算的单,并且当前的授信状态是0授信中 List<OneClickData> oneClickDataList=oneClickDataRespository.findByCreditStatusAndTypeNotIn(0, 1); if(oneClickDataList.size()>0 || oneClickDataList !=null) { for (OneClickData oneClickData : oneClickDataList) { // 当前授信中的单在apply_quota 查看状态是apply_status=1 时间倒序,进行授信请求操作 QuotaCredit quotaCredit1 = phoneInfoService.selectUserAuditRecords(Long.parseLong(oneClickData.getUserId()), Long.parseLong(oneClickData.getChannelCode())); if (Objects.isNull(quotaCredit1)) { log.info("不符合授信审核申请的条件"); } else { //如何条件的单进行授信申请请求 log.info("符合授信审核申请的条件oneClickData={},quotaCredit1={}", oneClickData, quotaCredit1); try { creditGrantingService.authAmountAuditNotifyMq(oneClickData, quotaCredit1); } catch (Exception e) { log.info("进入异常e={}", e.getMessage()); } } } }else{ log.info("oneClickDataList为空={}",oneClickDataList); } } @Override public void excuteFundSucessJob() { } @Override public void excuteFundFailJob() { } @Override public void excuteSelectFundStatusJob() { } }
\ No newline at end of file
......
......@@ -29,7 +29,7 @@ import java.util.Objects;
public class OneClickDataOperateServiceImpl implements OneClickDataOperateService {
@Autowired
OneClickDataRespository oneClickDataRespository;
private OneClickDataRespository oneClickDataRespository;
@Autowired
private ApplyLoanService applyLoanService;
@Autowired
......
......@@ -26,15 +26,15 @@ import java.util.Objects;
public class OneClickDataQueueOperateServiceImpl implements OneClickDataQueueOperateService {
@Autowired
OneClickDataRespository oneClickDataRespository;
private OneClickDataRespository oneClickDataRespository;
@Autowired
CashWithdrawalService cashWithdrawalService;
private CashWithdrawalService cashWithdrawalService;
@Autowired
LoanOperationService loanOperationService;
private LoanOperationService loanOperationService;
@Autowired
CreditGrantingService creditGrantingService;
private CreditGrantingService creditGrantingService;
@Autowired
PhoneInfoService phoneInfoService;
private PhoneInfoService phoneInfoService;
@Override
public void getCreditNotifyIsSucess(String queueMsg) {
JSONObject queueMsgJson=(JSONObject)JSONObject.parse(queueMsg);
......@@ -47,9 +47,9 @@ public class OneClickDataQueueOperateServiceImpl implements OneClickDataQueueOpe
log.info("获取oneClickData:{},获取noticeType:{}",oneClickData,noticeType);
if(Objects.isNull(oneClickData)){
}else{
if(noticeType.equals("FUAD_ASSIFN_SUCC")){
if("FUAD_ASSIFN_SUCC".equals(noticeType)){
getFundAssifnSucc(oneClickData);
} else if(noticeType.equals("FUND_SUCC")){
} else if("FUND_SUCC".equals(noticeType)){
// 提现成功了,收到放款成功消息,修改oneClickData的放款状态
oneClickDataRespository.updateLoanStatusById(LoanStatusEnum.CHECK_REPAYMENT_PLAN.getCode(), oneClickData.getId());
......@@ -131,13 +131,16 @@ public class OneClickDataQueueOperateServiceImpl implements OneClickDataQueueOpe
public void isNotSecondRiskSucc(JSONObject result,OneClickData oneClickData){
if(result.get("statusCode").toString().trim().equals("200") && result.get("context").toString().trim().equals("success")){
String statusCode=result.get("statusCode").toString().trim();
String context=result.get("context").toString().trim();
if("200".equals(statusCode) && "success".equals(context)){
// 查看当前的放款单的状态是20
LoanApplicationHistory loanApplicationHistory= loanOperationService.selectLoanId(Long.valueOf(oneClickData.getUserId().trim()), oneClickData.getBizType());
log.info("获取查询的二次风控请求成功后的loanApplicationHistory={}",loanApplicationHistory);
log.info("打印一下progress={},LoanProgress.WAITING_FUND获取的值:{}",loanApplicationHistory.getProgress().getDescription(),LoanProgress.WAITING_FUND.getDescription());
// 获取的放款状态是 "发起提现,等待二次风控审核" "等待马上金融放款" "已发送给马上金融, 等待放款"
if(loanApplicationHistory.getProgress().getDescription().trim().equals(LoanProgress.WAITING_FUND.getDescription()) || loanApplicationHistory.getProgress().getDescription().trim().equals(LoanProgress.START_ORDER.getDescription())|| loanApplicationHistory.getProgress().getDescription().trim().equals(LoanProgress.FINAL_SENDED_TO_FUNDING_CORP.getDescription())){
String progress=loanApplicationHistory.getProgress().getDescription().trim();
if(LoanProgress.WAITING_FUND.getDescription().equals(progress) || LoanProgress.START_ORDER.getDescription().equals(progress)|| LoanProgress.FINAL_SENDED_TO_FUNDING_CORP.getDescription().equals(progress)){
updateContrantAndApplyLendingNotify(oneClickData,loanApplicationHistory);
}else{
......@@ -160,7 +163,8 @@ public class OneClickDataQueueOperateServiceImpl implements OneClickDataQueueOpe
public void updateContrantAndApplyLendingNotify(OneClickData oneClickData,LoanApplicationHistory loanApplicationHistory){
// 放款状态:等待马上金融放款20
if(loanApplicationHistory.getProgress().getDescription().trim().equals(LoanProgress.FINAL_SENDED_TO_FUNDING_CORP.getDescription())){
String progress=loanApplicationHistory.getProgress().getDescription().trim();
if(LoanProgress.FINAL_SENDED_TO_FUNDING_CORP.getDescription().equals(progress)){
oneClickDataRespository.updateLoanStatusById(LoanStatusEnum.TO_JRWAITLOAN.getCode(), oneClickData.getId());
}else {
oneClickDataRespository.updateLoanStatusById(LoanStatusEnum.WAIT_JRLOAN.getCode(), oneClickData.getId());
......@@ -188,7 +192,8 @@ public class OneClickDataQueueOperateServiceImpl implements OneClickDataQueueOpe
}
JSONObject result=new JSONObject();
//如果已经体现了:21 ,就不需要在调用体现操作,而是直接通知
if(loanApplicationHistory1.getProgress().getDescription().trim().equals(LoanProgress.FINAL_SENDED_TO_FUNDING_CORP.getDescription())){
String progress=loanApplicationHistory1.getProgress().getDescription().trim();
if(LoanProgress.FINAL_SENDED_TO_FUNDING_CORP.getDescription().equals(progress)){
result =loanOperationService.payNotify(oneClickData, payStatus);
} else {
......@@ -202,11 +207,12 @@ public class OneClickDataQueueOperateServiceImpl implements OneClickDataQueueOpe
// 查看当前的放款单的状态是21
LoanApplicationHistory loanApplicationHistory = loanOperationService.selectLoanId(Long.valueOf(oneClickData.getUserId().trim()), oneClickData.getBizType());
log.info("放款请求成功后的loanApplicationHistory={}", loanApplicationHistory);
if (loanApplicationHistory.getProgress().getDescription().trim().equals(LoanProgress.FINAL_SENDED_TO_FUNDING_CORP.getDescription())) {
String progress1=loanApplicationHistory.getProgress().getDescription().trim();
if (LoanProgress.FINAL_SENDED_TO_FUNDING_CORP.getDescription().equals(progress1)) {
//修改打款状态21
oneClickDataRespository.updateLoanStatusById(LoanStatusEnum.TO_JRWAITLOAN.getCode(), oneClickData.getId());
}else if(loanApplicationHistory.getProgress().getDescription().trim().equals(LoanProgress.CHECK_REPAYMENT_PLAN.getDescription())){
}else if(LoanProgress.CHECK_REPAYMENT_PLAN.getDescription().equals(progress1)){
// 提现成功了,收到放款成功消息,修改oneClickData的放款状态
oneClickDataRespository.updateLoanStatusById(LoanStatusEnum.CHECK_REPAYMENT_PLAN.getCode(), oneClickData.getId());
......
......@@ -36,9 +36,9 @@ public class PhoneInfoServiceImpl implements PhoneInfoService {
@Value("${api.http.net}")
private String apiHttp;
@Autowired
QuotaCreditRepository quotaCreditRepository;
private QuotaCreditRepository quotaCreditRepository;
@Autowired
XyqbUserService xyqbUserService;
private XyqbUserService xyqbUserService;
public String getToken(String phone,String createdFrom) throws Exception {
......@@ -57,8 +57,9 @@ public class PhoneInfoServiceImpl implements PhoneInfoService {
header.put("Authorization", verification);
JSONObject result = HttpRequest.doPostReturnResponseJson(url, paras, header);
JSONObject resultDate = (JSONObject) result.get("data");
if(result.get("code").toString().trim().equals("0000") && result.get("businessCode").toString().trim().equals("0000")){
String code=result.get("code").toString().trim();
String businessCode=result.get("businessCode").toString().trim();
if("0000".equals(code) && "0000".equals(businessCode)){
token = resultDate.get("token").toString().trim();
}else{
......
......@@ -15,7 +15,7 @@ import org.springframework.stereotype.Service;
public class ScheduleServiceImpl implements ScheduleService {
@Autowired
JolyneService jolyneService;
private JolyneService jolyneService;
/**
*应用风险处理工作
* */
......
//package cn.quantgroup.cashloanflowboss.spi.job.service;
//
//import cn.quantgroup.cashloanflowboss.api.oneclickdata.service.OneClickDataOperateJobService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.scheduling.annotation.Scheduled;
//import org.springframework.stereotype.Service;
//
///**
// * Created by shang on 2019/12/26.
// */
//@Service
//public class SelectCreditStatusJobNew {
// @Autowired
// private OneClickDataOperateJobService oneClickDataOperateJobService;
//
// @Scheduled(cron = "0 0/1 * * * ?")
//// @Scheduled(cron = "0 45 20 * * ?")
// public void execute() {
// System.out.print("hello WORLD");
// oneClickDataOperateJobService.excuteSelectCreditStatusJob();
// }
//}
package cn.quantgroup.cashloanflowboss.spi.job.service;
import cn.quantgroup.cashloanflowboss.api.oneclickdata.service.OneClickDataOperateJobService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
/**
* Created by shang on 2019/12/26.
*/
@Service
public class SelectCreditStatusJobNew {
@Autowired
private OneClickDataOperateJobService oneClickDataOperateJobService;
@Scheduled(cron = "0 0/1 * * * ?")
// @Scheduled(cron = "0 45 20 * * ?")
public void execute() {
System.out.print("hello WORLD");
oneClickDataOperateJobService.excuteSelectCreditStatusJob();
}
}
......@@ -2,7 +2,7 @@ package cn.quantgroup.cashloanflowboss.utils;
import org.apache.commons.lang3.StringUtils;
import java.util.Random;
import java.security.SecureRandom;
/**
* <pre>
......@@ -20,7 +20,8 @@ import java.util.Random;
public class BankCardNumberGenerator {
public static String generate() {
Random random = new Random(System.currentTimeMillis());
SecureRandom random= new SecureRandom();
random.setSeed(System.currentTimeMillis());
Integer prev = 622126 + random.nextInt(925 + 1 - 126);
return generateByPrefix(prev);
}
......@@ -31,7 +32,8 @@ public class BankCardNumberGenerator {
* </pre>
*/
public static String generateByPrefix(Integer prefix) {
Random random = new Random(System.currentTimeMillis());
SecureRandom random= new SecureRandom();
random.setSeed(System.currentTimeMillis());
String bardNo = prefix
+ StringUtils.leftPad(random.nextInt(999999999) + "", 12, "0");
......@@ -68,7 +70,7 @@ public class BankCardNumberGenerator {
throw new RuntimeException("没有该银行的相关卡号信息");
}
Integer prefix = candidatePrefixes[new Random().nextInt(candidatePrefixes.length)];
Integer prefix = candidatePrefixes[new SecureRandom().nextInt(candidatePrefixes.length)];
return generateByPrefix(prefix);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment