Commit edd9d600 authored by BlackJokerCJ's avatar BlackJokerCJ

修改提交

parent 77d8172f
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,7 +22,7 @@ public class RouterConfig implements CommandLineRunner { ...@@ -22,7 +22,7 @@ public class RouterConfig implements CommandLineRunner {
@Autowired @Autowired
private GetCreditCommand getCreditCommand; private GetCreditCommand getCreditCommand;
@Autowired @Autowired
private SignContractCommand signContractCommand; private GetSignContractCommand signContractCommand;
@Autowired @Autowired
private SyncCreditCommand syncCreditCommand; private SyncCreditCommand syncCreditCommand;
@Autowired @Autowired
......
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