Commit a4eb4e5b authored by 张庆's avatar 张庆

Merge remote-tracking branch 'origin/master'

parents eebb161b f41cd772
package com.jqtx.windows.command;
import com.alibaba.fastjson.JSONObject;
import com.jqtx.infrastructure.oss.starter.config.OssUtils;
import com.jqtx.windows.common.factory.AbstractCommand;
import com.jqtx.windows.common.factory.RuntimeContextHolder;
import com.jqtx.windows.component.model.GetSignContractModel;
import com.jqtx.windows.infrastructure.feign.IProtocalFeignService;
import com.jqtx.windows.web.response.GetSignContractResponse;
import com.jqtx.windows.web.response.JsonResult;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class GetSignContractCommand extends AbstractCommand {
@Autowired
private IProtocalFeignService iProtocalFeignService;
@Autowired
private OssUtils ossUtils;
@Override
public JsonResult execute() {
String requestBody = RuntimeContextHolder.currentRuntimeContext().getRequestBody();
GetSignContractModel getSignContractModel = JSONObject.parseObject(requestBody, GetSignContractModel.class);
GetSignContractResponse getSignContractResponse=new GetSignContractResponse();
JsonResult<String> rongdanPdfJsonResult = iProtocalFeignService.getFilePathPdf(getSignContractModel.getLoanNo(), "rongdan");
if (rongdanPdfJsonResult.isSuccess() && StringUtils.isNotEmpty(rongdanPdfJsonResult.getResult())){
getSignContractResponse.setSignStatus("SIGN");
String path = ossUtils.generateTempURL(rongdanPdfJsonResult.getResult());
getSignContractResponse.setContractFileUrl(path);
}else {
getSignContractResponse.setSignStatus("SIGN_ING");
}
return JsonResult.success(getSignContractResponse);
}
}
package com.jqtx.windows.command; package com.jqtx.windows.command;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jqtx.infrastructure.oss.starter.config.OssUtils;
import com.jqtx.windows.common.factory.AbstractCommand; import com.jqtx.windows.common.factory.AbstractCommand;
import com.jqtx.windows.common.factory.RuntimeContextHolder; import com.jqtx.windows.common.factory.RuntimeContextHolder;
import com.jqtx.windows.component.model.GetSignContractModel; import com.jqtx.windows.component.model.GetSignContractModel;
import com.jqtx.windows.infrastructure.feign.IProtocalFeignService; import com.jqtx.windows.infrastructure.feign.IProtocalFeignService;
import com.jqtx.windows.web.response.GetSignContractResponse; import com.jqtx.windows.web.request.SignContractRequest;
import com.jqtx.windows.web.response.JsonResult; import com.jqtx.windows.web.response.JsonResult;
import org.apache.commons.lang3.StringUtils;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class SignContractCommand extends AbstractCommand { public class SignContractCommand extends AbstractCommand {
@Autowired @Autowired
private IProtocalFeignService iProtocalFeignService; private IProtocalFeignService iProtocalFeignService;
@Autowired
private OssUtils ossUtils;
@Override @Override
public JsonResult execute() { public JsonResult execute() {
String requestBody = RuntimeContextHolder.currentRuntimeContext().getRequestBody(); String requestBody = RuntimeContextHolder.currentRuntimeContext().getRequestBody();
GetSignContractModel getSignContractModel = JSONObject.parseObject(requestBody, GetSignContractModel.class); SignContractRequest signContractRequest = JSONObject.parseObject(requestBody, SignContractRequest.class);
GetSignContractResponse getSignContractResponse=new GetSignContractResponse(); iProtocalFeignService.uploadRongdan(signContractRequest);
JsonResult<String> rongdanPdfJsonResult = iProtocalFeignService.getFilePathPdf(getSignContractModel.getLoanNo(), "rongdan"); return JsonResult.success();
if (rongdanPdfJsonResult.isSuccess() && StringUtils.isNotEmpty(rongdanPdfJsonResult.getResult())){
getSignContractResponse.setSignStatus("SIGN");
String path = ossUtils.generateTempURL(rongdanPdfJsonResult.getResult());
getSignContractResponse.setContractFileUrl(path);
}else {
getSignContractResponse.setSignStatus("SIGN_ING");
}
return JsonResult.success(getSignContractResponse);
} }
} }
...@@ -18,8 +18,8 @@ public class Swagger2Config { ...@@ -18,8 +18,8 @@ public class Swagger2Config {
@Bean @Bean
public Docket createRestApi(Environment environment) { public Docket createRestApi(Environment environment) {
Profiles profiles=Profiles.of("dev","test");
boolean flag=environment.acceptsProfiles(profiles); boolean flag=true;
return new Docket(DocumentationType.SWAGGER_2).pathMapping("/") return new Docket(DocumentationType.SWAGGER_2).pathMapping("/")
.apiInfo(apiInfo()).enable(flag) .apiInfo(apiInfo()).enable(flag)
.select() .select()
......
...@@ -2,6 +2,7 @@ package com.jqtx.windows.infrastructure.feign; ...@@ -2,6 +2,7 @@ package com.jqtx.windows.infrastructure.feign;
import com.jqtx.windows.component.model.UploadPdfRequest; import com.jqtx.windows.component.model.UploadPdfRequest;
import com.jqtx.windows.infrastructure.feign.hytric.IProtocolFeignServiceHystric; import com.jqtx.windows.infrastructure.feign.hytric.IProtocolFeignServiceHystric;
import com.jqtx.windows.web.request.SignContractRequest;
import com.jqtx.windows.web.response.JsonResult; import com.jqtx.windows.web.response.JsonResult;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -16,4 +17,8 @@ public interface IProtocalFeignService { ...@@ -16,4 +17,8 @@ public interface IProtocalFeignService {
@PostMapping("/attach/uploadProtocolPdf") @PostMapping("/attach/uploadProtocolPdf")
JsonResult<String> uploadProtocolPdf(@RequestBody UploadPdfRequest uploadPdfRequest); JsonResult<String> uploadProtocolPdf(@RequestBody UploadPdfRequest uploadPdfRequest);
@PostMapping("/attach/uploadRongdan")
JsonResult<String> uploadRongdan(@RequestBody SignContractRequest signContractRequest);
} }
...@@ -22,16 +22,17 @@ public class RouterConfig implements CommandLineRunner { ...@@ -22,16 +22,17 @@ public class RouterConfig implements CommandLineRunner {
@Autowired @Autowired
private GetCreditCommand getCreditCommand; private GetCreditCommand getCreditCommand;
@Autowired @Autowired
private SignContractCommand signContractCommand; private GetSignContractCommand getSignContractCommand;
@Autowired @Autowired
private SyncCreditCommand syncCreditCommand; private SyncCreditCommand syncCreditCommand;
@Autowired @Autowired
private SyncLoanCommand syncLoanCommand; private SyncLoanCommand syncLoanCommand;
@Autowired
private SaveProtocolCommand saveProtocolCommand;
@Autowired @Autowired
private BackedCommand backedCommand; private BackedCommand backedCommand;
@Autowired
private SignContractCommand signContractCommand;
private static HashMap<String, AbstractCommand> commandHashMap = new HashMap<>(); private static HashMap<String, AbstractCommand> commandHashMap = new HashMap<>();
...@@ -48,10 +49,11 @@ public class RouterConfig implements CommandLineRunner { ...@@ -48,10 +49,11 @@ public class RouterConfig implements CommandLineRunner {
commandHashMap.put("getCredit",getCreditCommand); commandHashMap.put("getCredit",getCreditCommand);
commandHashMap.put("loanSubmit", loanSubmitCommand); commandHashMap.put("loanSubmit", loanSubmitCommand);
commandHashMap.put("getLoanResult", loanStatusCommand); commandHashMap.put("getLoanResult", loanStatusCommand);
commandHashMap.put("signContract",saveProtocolCommand); commandHashMap.put("signContract",signContractCommand);
commandHashMap.put("getSignContract",signContractCommand); commandHashMap.put("getSignContract",getSignContractCommand);
commandHashMap.put("syncLoan",syncLoanCommand); commandHashMap.put("syncLoan",syncLoanCommand);
commandHashMap.put("syncCreditResult",syncCreditCommand); commandHashMap.put("syncCreditResult",syncCreditCommand);
commandHashMap.put("syncBack",backedCommand); commandHashMap.put("syncBack",backedCommand);
} }
} }
package com.jqtx.windows.web.request;
import lombok.Data;
@Data
public class SignContractRequest {
private String orderNo;
private String loanNo;
private byte[] contractPdfFileBase64;
private String signKeyword;
}
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