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;
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,16 +22,17 @@ public class RouterConfig implements CommandLineRunner {
@Autowired
private GetCreditCommand getCreditCommand;
@Autowired
private SignContractCommand signContractCommand;
private GetSignContractCommand getSignContractCommand;
@Autowired
private SyncCreditCommand syncCreditCommand;
@Autowired
private SyncLoanCommand syncLoanCommand;
@Autowired
private SaveProtocolCommand saveProtocolCommand;
@Autowired
private BackedCommand backedCommand;
@Autowired
private SignContractCommand signContractCommand;
private static HashMap<String, AbstractCommand> commandHashMap = new HashMap<>();
......@@ -48,10 +49,11 @@ public class RouterConfig implements CommandLineRunner {
commandHashMap.put("getCredit",getCreditCommand);
commandHashMap.put("loanSubmit", loanSubmitCommand);
commandHashMap.put("getLoanResult", loanStatusCommand);
commandHashMap.put("signContract",saveProtocolCommand);
commandHashMap.put("getSignContract",signContractCommand);
commandHashMap.put("signContract",signContractCommand);
commandHashMap.put("getSignContract",getSignContractCommand);
commandHashMap.put("syncLoan",syncLoanCommand);
commandHashMap.put("syncCreditResult",syncCreditCommand);
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