|
@@ -33,6 +33,7 @@ import org.springframework.stereotype.Service;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
+import static com.jkcredit.invoice.common.CommonConst.COMPUTE;
|
|
|
import static com.jkcredit.invoice.common.CommonConst.NOT_FOUND;
|
|
|
import static com.jkcredit.invoice.common.CommonConst.ONE;
|
|
|
import static com.jkcredit.invoice.common.CommonConst.REC_STATUS_UN;
|
|
@@ -50,6 +51,8 @@ import static java.util.stream.Collectors.toList;
|
|
|
@Slf4j
|
|
|
public class NoCarInterServiceImpl implements NoCarInterService {
|
|
|
|
|
|
+ private static final String PDF = "pdf";
|
|
|
+
|
|
|
|
|
|
@Autowired
|
|
|
NoCarBillWayImportService noCarWaybillMapperImprt;
|
|
@@ -338,6 +341,22 @@ public class NoCarInterServiceImpl implements NoCarInterService {
|
|
|
result.setMsg("日期格式有误");
|
|
|
return result;
|
|
|
}
|
|
|
+
|
|
|
+ if(StringUtils.isNotBlank(waybillFileName) && StringUtils.isNotBlank(base64Str) && null != contractType){
|
|
|
+ String fileType = waybillFileName.substring(waybillFileName.lastIndexOf(".") + 1).toLowerCase();
|
|
|
+ if (!PDF.equals(fileType)) {
|
|
|
+ result.setMsg("必须是pdf文件!");
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ int base64StrLength = base64Str.length();
|
|
|
+ if (COMPUTE < base64StrLength) {
|
|
|
+ result.setMsg("pdf不可超过10M!");
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ base64Str = base64Str.replaceAll(" ", "+");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
CustomerRec customerRec = new CustomerRec();
|
|
|
customerRec.setCustomerName(appKey);
|
|
|
customerRec.setCompanyReferencenum(taxplayerCode);
|
|
@@ -563,6 +582,22 @@ public class NoCarInterServiceImpl implements NoCarInterService {
|
|
|
result.setMsg("客户:" + appKey + ";税号" + taxplayerCode + "未在平台备案成功,请先做备案");
|
|
|
return result;
|
|
|
}
|
|
|
+
|
|
|
+ if(StringUtils.isNotBlank(waybillFileName) && StringUtils.isNotBlank(base64Str) && null != contractType){
|
|
|
+ String fileType = waybillFileName.substring(waybillFileName.lastIndexOf(".") + 1).toLowerCase();
|
|
|
+ if (!PDF.equals(fileType)) {
|
|
|
+ result.setMsg("必须是pdf文件!");
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ int base64StrLength = base64Str.length();
|
|
|
+ if (COMPUTE < base64StrLength) {
|
|
|
+ result.setMsg("pdf不可超过10M!");
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ base64Str = base64Str.replaceAll(" ", "+");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
NoCarWayBill noCarWayBill = getNoCarWayBills(appKey, num, plateNumber, plateColor, startTime, sourceAddr, destAddr, predictEndTime, fee, titleType, taxplayerCode, customerRec);
|
|
|
|
|
|
noCarWayBill.setWaybillFileName(waybillFileName);
|