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;
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.request.SignContractRequest;
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.stereotype.Service;
@Service
public class SignContractCommand 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);
SignContractRequest signContractRequest = JSONObject.parseObject(requestBody, SignContractRequest.class);
iProtocalFeignService.uploadRongdan(signContractRequest);
return JsonResult.success();
}
}
......@@ -18,8 +18,8 @@ public class Swagger2Config {
@Bean
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("/")
.apiInfo(apiInfo()).enable(flag)
.select()
......
......@@ -2,6 +2,7 @@ package com.jqtx.windows.infrastructure.feign;
import com.jqtx.windows.component.model.UploadPdfRequest;
import com.jqtx.windows.infrastructure.feign.hytric.IProtocolFeignServiceHystric;
import com.jqtx.windows.web.request.SignContractRequest;
import com.jqtx.windows.web.response.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -16,4 +17,8 @@ public interface IProtocalFeignService {
@PostMapping("/attach/uploadProtocolPdf")
JsonResult<String> uploadProtocolPdf(@RequestBody UploadPdfRequest uploadPdfRequest);
@PostMapping("/attach/uploadRongdan")
JsonResult<String> uploadRongdan(@RequestBody SignContractRequest signContractRequest);
}
......@@ -22,7 +22,7 @@ public class RouterConfig implements CommandLineRunner {
@Autowired
private GetCreditCommand getCreditCommand;
@Autowired
private SignContractCommand signContractCommand;
private GetSignContractCommand signContractCommand;
@Autowired
private SyncCreditCommand syncCreditCommand;
@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