Commit 5037ce52 by landerliang@163.com

修复自动签章问题

parent 953f9721
......@@ -27,6 +27,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
......@@ -41,6 +42,7 @@ import org.springframework.web.client.RestTemplate;
//@EnableAsync
@RestController
@Api(hidden = true)
@EnableScheduling
@SpringBootApplication
@EnableTransactionManagement
@EnableJpaAuditing(auditorAwareRef = "auditorAware")
......
......@@ -42,4 +42,5 @@ public class ReportTask {
jsonObject.getString("snName1"),jsonObject.getString("snName2"),jsonObject.getString("snName3"));
log.info(">> 本次自动签章任务执行完毕!");
}
}
......@@ -123,11 +123,11 @@ public class ReportService {
* 自动下载检测报告并签章上传
*
*/
public void autoDownloadAndSignAndUploadReport(String account,String password,String snKey1,String snKey2,String snKey3,
public synchronized void autoDownloadAndSignAndUploadReport(String account,String password,String snKey1,String snKey2,String snKey3,
String snName1,String snName2,String snName3){
try {
try {
List<TestReportVo> testReportVos = carReportUtil.taskReportList(account, password);
log.info(">> 定时扫描未签章上传的检测报告,扫描结果:{} 条数据",testReportVos.size());
for(TestReportVo testReportVo:testReportVos){
......@@ -148,7 +148,7 @@ public class ReportService {
reportPdfVo.setUniqueString(testReportVo.getUniqueString());
reportPdfVo.setReportName(testReportVo.getInspectionReportNo() + ".pdf");
reportPdfVo.setReportNum(testReportVo.getInspectionReportNo());
reportPdfVo.setBusinessKey(testReportVo.getBusinessKey());
reportPdfVo.setBusinessKey(StrUtil.isNotBlank(testReportVo.getBusinessKey())?testReportVo.getBusinessKey():testReportVo.getInspectionNum());
reportPdfVo.setCreateTime(DateUtil.date());
reportPdfVo.setCarNum(testReportVo.getVLPN());
......
......@@ -94,7 +94,8 @@ public class CarReportUtil {
String body = webDriver.getPageSource();
body = body.replace("../../Scripts",host + "/Scripts")
.replace("../../Entities/",host + "/Entities/");
.replace("../../Entities/",host + "/Entities/")
.replace("../../Content",host + "/Content");
Document parse = Jsoup.parse(body);
Elements elementsByClass = parse.getElementsByClass("unit");
......@@ -154,7 +155,7 @@ public class CarReportUtil {
WebDriver driver = null;
int success = 0;
try {
log.info(">> 当前自动上传的检测报告信息:{}",reportPdfVo.toString());
//检测报告文件和其他至少四个文件(检测申请表、身份证、行驶证1、行驶证2)都有了才上传
if(FileUtil.exist(reportPdfVo.getPath())&&
FileUtil.exist(uploadFilePath + reportPdfVo.getCarNum() + MyConstants.APPLY_SUFFIX)&&
......@@ -171,7 +172,7 @@ public class CarReportUtil {
Map<String,Object> formData = new HashMap<>();
formData.put("umclData","{\"UploadFileDataID\":0,\"MAI_ID\":0}");
formData.put("folder","/Addins/Template/");
formData.put("businessKey", StrUtil.isNotBlank(reportPdfVo.getBusinessKey())?reportPdfVo.getBusinessKey():reportPdfVo.getReportNum());
formData.put("businessKey", reportPdfVo.getBusinessKey());
formData.put("BusinessType", "11");
formData.put("fileext", "*.pdf;*.jpg;*.png");
formData.put("UniqueString", reportPdfVo.getUniqueString());
......@@ -374,7 +375,7 @@ public class CarReportUtil {
Map<String,Object> formData = new HashMap<>();
formData.put("umclData","{\"UploadFileDataID\":0,\"MAI_ID\":0}");
formData.put("folder","/Addins/Template/");
formData.put("businessKey", StrUtil.isNotBlank(reportPdfVo.getBusinessKey())?reportPdfVo.getBusinessKey():reportPdfVo.getReportNum());
formData.put("businessKey", StrUtil.isNotBlank(reportPdfVo.getBusinessKey())?reportPdfVo.getBusinessKey():reportPdfVo.getBusinessKey());
formData.put("BusinessType", "11");
formData.put("fileext", "*.pdf;*.jpg;*.png");
formData.put("UniqueString", reportPdfVo.getUniqueString());
......
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