|
@@ -60,6 +60,7 @@ import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
+import java.util.concurrent.CompletableFuture;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -131,6 +132,10 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
BigDecimal mainJe = null;
|
|
BigDecimal mainJe = null;
|
|
|
String bxlb = null;
|
|
String bxlb = null;
|
|
|
String bm = null;
|
|
String bm = null;
|
|
|
|
|
+ String fkzhxx = null;
|
|
|
|
|
+ String fkzh = null;
|
|
|
|
|
+ String yhqc = null;
|
|
|
|
|
+ String sfct = null;
|
|
|
|
|
|
|
|
// 遍历收集主表字段值
|
|
// 遍历收集主表字段值
|
|
|
for (Map formComponentValue : formComponentValues) {
|
|
for (Map formComponentValue : formComponentValues) {
|
|
@@ -155,17 +160,29 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
if ("DDSelectField_1TP75OVCPAAO0".equals(id)) {
|
|
if ("DDSelectField_1TP75OVCPAAO0".equals(id)) {
|
|
|
bxlb = value != null ? String.valueOf(value) : "";
|
|
bxlb = value != null ? String.valueOf(value) : "";
|
|
|
}
|
|
}
|
|
|
- if ("DepartmentField_OKBSJN0MD6O0".equals(id)) {
|
|
|
|
|
|
|
+ if ("DepartmentField_1RD2SROH579C0".equals(id)) {
|
|
|
bm = value != null ? String.valueOf(value) : "";
|
|
bm = value != null ? String.valueOf(value) : "";
|
|
|
}
|
|
}
|
|
|
|
|
+ if ("DDSelectField_11D6S45JKFHS0".equals(id)) {
|
|
|
|
|
+ fkzhxx = value != null ? String.valueOf(value) : "";
|
|
|
|
|
+ }
|
|
|
|
|
+ if ("TextField_1S1VV9PIIQWW0".equals(id)) {
|
|
|
|
|
+ fkzh = value != null ? String.valueOf(value) : "";
|
|
|
|
|
+ }
|
|
|
|
|
+ if ("TextField_ZUVAAH3FIGW0".equals(id)) {
|
|
|
|
|
+ yhqc = value != null ? String.valueOf(value) : "";
|
|
|
|
|
+ }
|
|
|
|
|
+ if ("DDSelectField_DEKPLHARB6O0".equals(id)) {
|
|
|
|
|
+ sfct = value != null ? String.valueOf(value) : "否";
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 判断主表状态 - 无发票
|
|
// 判断主表状态 - 无发票
|
|
|
if ("否".equals(zt)) {
|
|
if ("否".equals(zt)) {
|
|
|
- Map<String, Object> result = new HashMap<>();
|
|
|
|
|
- result.put("je", mainJe);
|
|
|
|
|
- result.put("status", "否");
|
|
|
|
|
- result.put("message", "无发票报销");
|
|
|
|
|
|
|
+// Map<String, Object> result = new HashMap<>();
|
|
|
|
|
+// result.put("je", mainJe);
|
|
|
|
|
+// result.put("status", "否");
|
|
|
|
|
+// result.put("message", "无发票报销");
|
|
|
// 保存基础报销记录
|
|
// 保存基础报销记录
|
|
|
InvoiceLibrary baseInvoice = new InvoiceLibrary();
|
|
InvoiceLibrary baseInvoice = new InvoiceLibrary();
|
|
|
baseInvoice.setOaId(processInstanceId);
|
|
baseInvoice.setOaId(processInstanceId);
|
|
@@ -186,9 +203,14 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
baseInvoice.setBuyerTaxId("");
|
|
baseInvoice.setBuyerTaxId("");
|
|
|
baseInvoice.setSellerName("");
|
|
baseInvoice.setSellerName("");
|
|
|
baseInvoice.setSellerTaxId("");
|
|
baseInvoice.setSellerTaxId("");
|
|
|
|
|
+ baseInvoice.setFormName("员工费用报销");
|
|
|
|
|
+ baseInvoice.setPaySubject(fkzhxx != null ? fkzhxx : "");
|
|
|
|
|
+ baseInvoice.setPayAccount(fkzh != null ? fkzh : "");
|
|
|
|
|
+ baseInvoice.setBankName(yhqc != null ? yhqc : "");
|
|
|
|
|
+ baseInvoice.setIsLongTerm(sfct != null ? sfct : "");
|
|
|
baseMapper.insert(baseInvoice);
|
|
baseMapper.insert(baseInvoice);
|
|
|
- addWorkflowComment(processInstanceId, userId, result);
|
|
|
|
|
- return McR.success(result);
|
|
|
|
|
|
|
+ addWorkflowComment(processInstanceId, userId, "报销总金额:"+mainJe);
|
|
|
|
|
+ return McR.success();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 判断主表状态 - 有发票
|
|
// 判断主表状态 - 有发票
|
|
@@ -341,7 +363,7 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
terminateWorkflow(accessToken, processInstanceId, userId, errorMsg);
|
|
terminateWorkflow(accessToken, processInstanceId, userId, errorMsg);
|
|
|
return McR.error("400", errorMsg);
|
|
return McR.error("400", errorMsg);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ BigDecimal totalAmount = BigDecimal.ZERO;
|
|
|
// ========== 第二遍遍历:保存发票数据(校验通过后) ==========
|
|
// ========== 第二遍遍历:保存发票数据(校验通过后) ==========
|
|
|
for (Map<String, Object> parsedData : parsedInvoiceDataList) {
|
|
for (Map<String, Object> parsedData : parsedInvoiceDataList) {
|
|
|
JSONObject invoice = (JSONObject) parsedData.get("invoice");
|
|
JSONObject invoice = (JSONObject) parsedData.get("invoice");
|
|
@@ -349,7 +371,11 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
Object responseData = parsedData.get("responseData");
|
|
Object responseData = parsedData.get("responseData");
|
|
|
|
|
|
|
|
allResults.add(responseData);
|
|
allResults.add(responseData);
|
|
|
-
|
|
|
|
|
|
|
+ // 汇总 amount
|
|
|
|
|
+ BigDecimal amount = invoice.getBigDecimal("amount");
|
|
|
|
|
+ if (amount != null) {
|
|
|
|
|
+ totalAmount = totalAmount.add(amount);
|
|
|
|
|
+ }
|
|
|
// 构建InvoiceLibrary对象
|
|
// 构建InvoiceLibrary对象
|
|
|
InvoiceLibrary invoiceLibrary = new InvoiceLibrary();
|
|
InvoiceLibrary invoiceLibrary = new InvoiceLibrary();
|
|
|
invoiceLibrary.setOaId(processInstanceId);
|
|
invoiceLibrary.setOaId(processInstanceId);
|
|
@@ -374,6 +400,11 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
invoiceLibrary.setSellerName(invoice.getString("sellerName") != null ? invoice.getString("sellerName") : "");
|
|
invoiceLibrary.setSellerName(invoice.getString("sellerName") != null ? invoice.getString("sellerName") : "");
|
|
|
invoiceLibrary.setSellerTaxId(invoice.getString("sellerTaxId") != null ? invoice.getString("sellerTaxId") : "");
|
|
invoiceLibrary.setSellerTaxId(invoice.getString("sellerTaxId") != null ? invoice.getString("sellerTaxId") : "");
|
|
|
invoiceLibrary.setOaStatus("0");
|
|
invoiceLibrary.setOaStatus("0");
|
|
|
|
|
+ invoiceLibrary.setFormName("员工费用报销");
|
|
|
|
|
+ invoiceLibrary.setPaySubject(fkzhxx != null ? fkzhxx : "");
|
|
|
|
|
+ invoiceLibrary.setPayAccount(fkzh != null ? fkzh : "");
|
|
|
|
|
+ invoiceLibrary.setBankName(yhqc != null ? yhqc : "");
|
|
|
|
|
+ invoiceLibrary.setIsLongTerm(sfct != null ? sfct : "");
|
|
|
invoiceLibrary.setInvoiceStatus("0");
|
|
invoiceLibrary.setInvoiceStatus("0");
|
|
|
invoiceLibrary.setDep(bm != null ? bm : "");
|
|
invoiceLibrary.setDep(bm != null ? bm : "");
|
|
|
invoiceLibrary.setAccountTitle(bxlb != null ? bxlb : "");
|
|
invoiceLibrary.setAccountTitle(bxlb != null ? bxlb : "");
|
|
@@ -392,7 +423,7 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
log.info("成功保存 {} 条发票记录", invoiceList.size());
|
|
log.info("成功保存 {} 条发票记录", invoiceList.size());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- addWorkflowComment(processInstanceId, userId, allResults);
|
|
|
|
|
|
|
+ addWorkflowComment1(processInstanceId, userId, totalAmount);
|
|
|
return McR.success(allResults);
|
|
return McR.success(allResults);
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@@ -420,8 +451,30 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
* @param remark 终止原因备注
|
|
* @param remark 终止原因备注
|
|
|
*/
|
|
*/
|
|
|
private void terminateWorkflow(String accessToken, String processInstanceId, String operatingUserId, String remark) {
|
|
private void terminateWorkflow(String accessToken, String processInstanceId, String operatingUserId, String remark) {
|
|
|
|
|
+ // 异步延迟15秒后执行终止
|
|
|
|
|
+ CompletableFuture.runAsync(() -> {
|
|
|
|
|
+ try {
|
|
|
|
|
+ log.info("延迟15秒后开始终止审批流程: processInstanceId={}, remark={}", processInstanceId, remark);
|
|
|
|
|
+ Thread.sleep(15000);
|
|
|
|
|
+
|
|
|
|
|
+ // 实际执行终止操作
|
|
|
|
|
+ doTerminateWorkflow(accessToken, processInstanceId, operatingUserId, remark);
|
|
|
|
|
+
|
|
|
|
|
+ } catch (InterruptedException e) {
|
|
|
|
|
+ Thread.currentThread().interrupt();
|
|
|
|
|
+ log.error("延迟终止流程被中断: processInstanceId={}", processInstanceId, e);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("异步执行终止流程异常: processInstanceId={}", processInstanceId, e);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 实际执行钉钉审批流程终止
|
|
|
|
|
+ */
|
|
|
|
|
+ private void doTerminateWorkflow(String accessToken, String processInstanceId, String operatingUserId, String remark) {
|
|
|
try {
|
|
try {
|
|
|
- log.info("开始终止审批流程: processInstanceId={}, remark={}", processInstanceId, remark);
|
|
|
|
|
|
|
+ log.info("开始调用钉钉API终止审批流程: processInstanceId={}", processInstanceId);
|
|
|
|
|
|
|
|
// 构建请求URL
|
|
// 构建请求URL
|
|
|
String url = "https://api.dingtalk.com/v1.0/workflow/processInstances/terminate";
|
|
String url = "https://api.dingtalk.com/v1.0/workflow/processInstances/terminate";
|
|
@@ -438,6 +491,8 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
requestBody.put("remark", remark);
|
|
requestBody.put("remark", remark);
|
|
|
requestBody.put("operatingUserId", operatingUserId);
|
|
requestBody.put("operatingUserId", operatingUserId);
|
|
|
|
|
|
|
|
|
|
+ log.info("钉钉终止请求参数: {}", requestBody);
|
|
|
|
|
+
|
|
|
// 发送POST请求
|
|
// 发送POST请求
|
|
|
HttpEntity<Map<String, Object>> requestEntity = new HttpEntity<>(requestBody, headers);
|
|
HttpEntity<Map<String, Object>> requestEntity = new HttpEntity<>(requestBody, headers);
|
|
|
RestTemplate restTemplate = new RestTemplate();
|
|
RestTemplate restTemplate = new RestTemplate();
|
|
@@ -445,9 +500,6 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
|
|
|
|
|
if (response.getStatusCode().is2xxSuccessful()) {
|
|
if (response.getStatusCode().is2xxSuccessful()) {
|
|
|
log.info("审批流程终止成功: processInstanceId={}, response={}", processInstanceId, response.getBody());
|
|
log.info("审批流程终止成功: processInstanceId={}, response={}", processInstanceId, response.getBody());
|
|
|
-
|
|
|
|
|
- // 同时添加审批评论,让用户更清楚终止原因
|
|
|
|
|
-// addWorkflowComment(processInstanceId, operatingUserId, "流程已终止,原因: " + remark);
|
|
|
|
|
} else {
|
|
} else {
|
|
|
log.error("审批流程终止失败: processInstanceId={}, statusCode={}, response={}",
|
|
log.error("审批流程终止失败: processInstanceId={}, statusCode={}, response={}",
|
|
|
processInstanceId, response.getStatusCode(), response.getBody());
|
|
processInstanceId, response.getStatusCode(), response.getBody());
|
|
@@ -780,6 +832,10 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
BigDecimal mainJe = null;
|
|
BigDecimal mainJe = null;
|
|
|
String bxlb = null;
|
|
String bxlb = null;
|
|
|
String bm = null;
|
|
String bm = null;
|
|
|
|
|
+ String fkzhxx = null;
|
|
|
|
|
+ String fkzh = null;
|
|
|
|
|
+ String yhqc = null;
|
|
|
|
|
+ String sfct = null;
|
|
|
|
|
|
|
|
// 遍历收集主表字段值
|
|
// 遍历收集主表字段值
|
|
|
for (Map formComponentValue : formComponentValues) {
|
|
for (Map formComponentValue : formComponentValues) {
|
|
@@ -807,14 +863,27 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
if ("DepartmentField_RF93A6VHA9C0".equals(id)) {
|
|
if ("DepartmentField_RF93A6VHA9C0".equals(id)) {
|
|
|
bm = value != null ? String.valueOf(value) : "";
|
|
bm = value != null ? String.valueOf(value) : "";
|
|
|
}
|
|
}
|
|
|
|
|
+ if ("DDSelectField_23RVAEKUM5UO0".equals(id)) {
|
|
|
|
|
+ fkzhxx = value != null ? String.valueOf(value) : "";
|
|
|
|
|
+ }
|
|
|
|
|
+ if ("TextField_1TE3AOHRMD4W0".equals(id)) {
|
|
|
|
|
+ fkzh = value != null ? String.valueOf(value) : "";
|
|
|
|
|
+ }
|
|
|
|
|
+ if ("TextField_EN2MDZIMUTK0".equals(id)) {
|
|
|
|
|
+ yhqc = value != null ? String.valueOf(value) : "";
|
|
|
|
|
+ }
|
|
|
|
|
+ if ("DDSelectField_P2EFYKN5ALC0".equals(id)) {
|
|
|
|
|
+ sfct = value != null ? String.valueOf(value) : "否";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 判断主表状态 - 无发票
|
|
// 判断主表状态 - 无发票
|
|
|
if ("否".equals(zt)) {
|
|
if ("否".equals(zt)) {
|
|
|
- Map<String, Object> result = new HashMap<>();
|
|
|
|
|
- result.put("je", mainJe);
|
|
|
|
|
- result.put("status", "否");
|
|
|
|
|
- result.put("message", "无发票报销");
|
|
|
|
|
|
|
+// Map<String, Object> result = new HashMap<>();
|
|
|
|
|
+// result.put("je", mainJe);
|
|
|
|
|
+// result.put("status", "否");
|
|
|
|
|
+// result.put("message", "无发票报销");
|
|
|
// 保存基础报销记录
|
|
// 保存基础报销记录
|
|
|
InvoiceLibrary baseInvoice = new InvoiceLibrary();
|
|
InvoiceLibrary baseInvoice = new InvoiceLibrary();
|
|
|
baseInvoice.setOaId(processInstanceId);
|
|
baseInvoice.setOaId(processInstanceId);
|
|
@@ -822,6 +891,10 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
baseInvoice.setInvoiceStatus("0");
|
|
baseInvoice.setInvoiceStatus("0");
|
|
|
baseInvoice.setDep(bm != null ? bm : "");
|
|
baseInvoice.setDep(bm != null ? bm : "");
|
|
|
baseInvoice.setAccountTitle(bxlb != null ? bxlb : "");
|
|
baseInvoice.setAccountTitle(bxlb != null ? bxlb : "");
|
|
|
|
|
+ baseInvoice.setPaySubject(fkzhxx != null ? fkzhxx : "");
|
|
|
|
|
+ baseInvoice.setPayAccount(fkzh != null ? fkzh : "");
|
|
|
|
|
+ baseInvoice.setBankName(yhqc != null ? yhqc : "");
|
|
|
|
|
+ baseInvoice.setIsLongTerm(sfct != null ? sfct : "");
|
|
|
baseInvoice.setPayAmount(mainJe != null ? mainJe : BigDecimal.ZERO);
|
|
baseInvoice.setPayAmount(mainJe != null ? mainJe : BigDecimal.ZERO);
|
|
|
baseInvoice.setCreatedAt(LocalDateTime.now());
|
|
baseInvoice.setCreatedAt(LocalDateTime.now());
|
|
|
baseInvoice.setUpdatedAt(LocalDateTime.now());
|
|
baseInvoice.setUpdatedAt(LocalDateTime.now());
|
|
@@ -835,9 +908,10 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
baseInvoice.setBuyerTaxId("");
|
|
baseInvoice.setBuyerTaxId("");
|
|
|
baseInvoice.setSellerName("");
|
|
baseInvoice.setSellerName("");
|
|
|
baseInvoice.setSellerTaxId("");
|
|
baseInvoice.setSellerTaxId("");
|
|
|
|
|
+ baseInvoice.setFormName("付款申请");
|
|
|
baseMapper.insert(baseInvoice);
|
|
baseMapper.insert(baseInvoice);
|
|
|
- addWorkflowComment(processInstanceId, userId, result);
|
|
|
|
|
- return McR.success(result);
|
|
|
|
|
|
|
+ addWorkflowComment(processInstanceId, userId, "报销总金额:"+mainJe);
|
|
|
|
|
+ return McR.success();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 判断主表状态 - 有发票
|
|
// 判断主表状态 - 有发票
|
|
@@ -990,7 +1064,7 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
terminateWorkflow(accessToken, processInstanceId, userId, errorMsg);
|
|
terminateWorkflow(accessToken, processInstanceId, userId, errorMsg);
|
|
|
return McR.error("400", errorMsg);
|
|
return McR.error("400", errorMsg);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ BigDecimal totalAmount = BigDecimal.ZERO;
|
|
|
// ========== 第二遍遍历:保存发票数据(校验通过后) ==========
|
|
// ========== 第二遍遍历:保存发票数据(校验通过后) ==========
|
|
|
for (Map<String, Object> parsedData : parsedInvoiceDataList) {
|
|
for (Map<String, Object> parsedData : parsedInvoiceDataList) {
|
|
|
JSONObject invoice = (JSONObject) parsedData.get("invoice");
|
|
JSONObject invoice = (JSONObject) parsedData.get("invoice");
|
|
@@ -998,7 +1072,10 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
Object responseData = parsedData.get("responseData");
|
|
Object responseData = parsedData.get("responseData");
|
|
|
|
|
|
|
|
allResults.add(responseData);
|
|
allResults.add(responseData);
|
|
|
-
|
|
|
|
|
|
|
+ BigDecimal amount = invoice.getBigDecimal("amount");
|
|
|
|
|
+ if (amount != null) {
|
|
|
|
|
+ totalAmount = totalAmount.add(amount);
|
|
|
|
|
+ }
|
|
|
// 构建InvoiceLibrary对象
|
|
// 构建InvoiceLibrary对象
|
|
|
InvoiceLibrary invoiceLibrary = new InvoiceLibrary();
|
|
InvoiceLibrary invoiceLibrary = new InvoiceLibrary();
|
|
|
invoiceLibrary.setOaId(processInstanceId);
|
|
invoiceLibrary.setOaId(processInstanceId);
|
|
@@ -1023,7 +1100,12 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
invoiceLibrary.setSellerName(invoice.getString("sellerName") != null ? invoice.getString("sellerName") : "");
|
|
invoiceLibrary.setSellerName(invoice.getString("sellerName") != null ? invoice.getString("sellerName") : "");
|
|
|
invoiceLibrary.setSellerTaxId(invoice.getString("sellerTaxId") != null ? invoice.getString("sellerTaxId") : "");
|
|
invoiceLibrary.setSellerTaxId(invoice.getString("sellerTaxId") != null ? invoice.getString("sellerTaxId") : "");
|
|
|
invoiceLibrary.setOaStatus("0");
|
|
invoiceLibrary.setOaStatus("0");
|
|
|
|
|
+ invoiceLibrary.setFormName("付款申请");
|
|
|
invoiceLibrary.setInvoiceStatus("0");
|
|
invoiceLibrary.setInvoiceStatus("0");
|
|
|
|
|
+ invoiceLibrary.setPaySubject(fkzhxx != null ? fkzhxx : "");
|
|
|
|
|
+ invoiceLibrary.setPayAccount(fkzh != null ? fkzh : "");
|
|
|
|
|
+ invoiceLibrary.setBankName(yhqc != null ? yhqc : "");
|
|
|
|
|
+ invoiceLibrary.setIsLongTerm(sfct != null ? sfct : "");
|
|
|
invoiceLibrary.setDep(bm != null ? bm : "");
|
|
invoiceLibrary.setDep(bm != null ? bm : "");
|
|
|
invoiceLibrary.setAccountTitle(bxlb != null ? bxlb : "");
|
|
invoiceLibrary.setAccountTitle(bxlb != null ? bxlb : "");
|
|
|
invoiceLibrary.setPayAmount(mainJe != null ? mainJe : BigDecimal.ZERO);
|
|
invoiceLibrary.setPayAmount(mainJe != null ? mainJe : BigDecimal.ZERO);
|
|
@@ -1041,7 +1123,7 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
log.info("成功保存 {} 条发票记录", invoiceList.size());
|
|
log.info("成功保存 {} 条发票记录", invoiceList.size());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- addWorkflowComment(processInstanceId, userId, allResults);
|
|
|
|
|
|
|
+ addWorkflowComment1(processInstanceId, userId, totalAmount);
|
|
|
return McR.success(allResults);
|
|
return McR.success(allResults);
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@@ -1094,7 +1176,10 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
BigDecimal mainJe = null;
|
|
BigDecimal mainJe = null;
|
|
|
String bxlb = null;
|
|
String bxlb = null;
|
|
|
String bm = null;
|
|
String bm = null;
|
|
|
-
|
|
|
|
|
|
|
+ String fkzhxx = null;
|
|
|
|
|
+ String fkzh = null;
|
|
|
|
|
+ String yhqc = null;
|
|
|
|
|
+ String sfct = null;
|
|
|
// 遍历收集主表字段值
|
|
// 遍历收集主表字段值
|
|
|
for (Map formComponentValue : formComponentValues) {
|
|
for (Map formComponentValue : formComponentValues) {
|
|
|
String id = String.valueOf(formComponentValue.get("id"));
|
|
String id = String.valueOf(formComponentValue.get("id"));
|
|
@@ -1118,17 +1203,29 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
if ("DDSelectField_YLLB7AD1ATS0".equals(id)) {
|
|
if ("DDSelectField_YLLB7AD1ATS0".equals(id)) {
|
|
|
bxlb = value != null ? String.valueOf(value) : "";
|
|
bxlb = value != null ? String.valueOf(value) : "";
|
|
|
}
|
|
}
|
|
|
-// if ("DepartmentField_OKBSJN0MD6O0".equals(id)) {
|
|
|
|
|
-// bm = value != null ? String.valueOf(value) : "";
|
|
|
|
|
-// }
|
|
|
|
|
|
|
+ if ("DepartmentField_ZI9KALEYOTC0".equals(id)) {
|
|
|
|
|
+ bm = value != null ? String.valueOf(value) : "";
|
|
|
|
|
+ }
|
|
|
|
|
+ if ("DDSelectField_1WEX2WWCJ3PC0".equals(id)) {
|
|
|
|
|
+ fkzhxx = value != null ? String.valueOf(value) : "";
|
|
|
|
|
+ }
|
|
|
|
|
+ if ("TextField_2W39FPCZH1A0".equals(id)) {
|
|
|
|
|
+ fkzh = value != null ? String.valueOf(value) : "";
|
|
|
|
|
+ }
|
|
|
|
|
+ if ("TextField_QW7HJIR7T800".equals(id)) {
|
|
|
|
|
+ yhqc = value != null ? String.valueOf(value) : "";
|
|
|
|
|
+ }
|
|
|
|
|
+ if ("DDSelectField_12JNC3P1K5V40".equals(id)) {
|
|
|
|
|
+ sfct = value != null ? String.valueOf(value) : "否";
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 判断主表状态 - 无发票
|
|
// 判断主表状态 - 无发票
|
|
|
if ("否".equals(zt)) {
|
|
if ("否".equals(zt)) {
|
|
|
- Map<String, Object> result = new HashMap<>();
|
|
|
|
|
- result.put("je", mainJe);
|
|
|
|
|
- result.put("status", "否");
|
|
|
|
|
- result.put("message", "无发票报销");
|
|
|
|
|
|
|
+// Map<String, Object> result = new HashMap<>();
|
|
|
|
|
+// result.put("总金额", mainJe);
|
|
|
|
|
+// result.put("status", "否");
|
|
|
|
|
+// result.put("message", "无发票报销");
|
|
|
// 保存基础报销记录
|
|
// 保存基础报销记录
|
|
|
InvoiceLibrary baseInvoice = new InvoiceLibrary();
|
|
InvoiceLibrary baseInvoice = new InvoiceLibrary();
|
|
|
baseInvoice.setOaId(processInstanceId);
|
|
baseInvoice.setOaId(processInstanceId);
|
|
@@ -1141,6 +1238,10 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
baseInvoice.setUpdatedAt(LocalDateTime.now());
|
|
baseInvoice.setUpdatedAt(LocalDateTime.now());
|
|
|
baseInvoice.setInvoiceCode("");
|
|
baseInvoice.setInvoiceCode("");
|
|
|
baseInvoice.setInvoiceNumber("");
|
|
baseInvoice.setInvoiceNumber("");
|
|
|
|
|
+ baseInvoice.setPaySubject(fkzhxx != null ? fkzhxx : "");
|
|
|
|
|
+ baseInvoice.setPayAccount(fkzh != null ? fkzh : "");
|
|
|
|
|
+ baseInvoice.setBankName(yhqc != null ? yhqc : "");
|
|
|
|
|
+ baseInvoice.setIsLongTerm(sfct != null ? sfct : "");
|
|
|
baseInvoice.setInvoiceType("");
|
|
baseInvoice.setInvoiceType("");
|
|
|
baseInvoice.setAmount(BigDecimal.ZERO);
|
|
baseInvoice.setAmount(BigDecimal.ZERO);
|
|
|
baseInvoice.setTaxAmount(BigDecimal.ZERO);
|
|
baseInvoice.setTaxAmount(BigDecimal.ZERO);
|
|
@@ -1149,9 +1250,10 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
baseInvoice.setBuyerTaxId("");
|
|
baseInvoice.setBuyerTaxId("");
|
|
|
baseInvoice.setSellerName("");
|
|
baseInvoice.setSellerName("");
|
|
|
baseInvoice.setSellerTaxId("");
|
|
baseInvoice.setSellerTaxId("");
|
|
|
|
|
+ baseInvoice.setFormName("合作商付款申请");
|
|
|
baseMapper.insert(baseInvoice);
|
|
baseMapper.insert(baseInvoice);
|
|
|
- addWorkflowComment(processInstanceId, userId, result);
|
|
|
|
|
- return McR.success(result);
|
|
|
|
|
|
|
+ addWorkflowComment(processInstanceId, userId, "报销总金额:"+mainJe);
|
|
|
|
|
+ return McR.success();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 判断主表状态 - 有发票
|
|
// 判断主表状态 - 有发票
|
|
@@ -1304,7 +1406,7 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
terminateWorkflow(accessToken, processInstanceId, userId, errorMsg);
|
|
terminateWorkflow(accessToken, processInstanceId, userId, errorMsg);
|
|
|
return McR.error("400", errorMsg);
|
|
return McR.error("400", errorMsg);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ BigDecimal totalAmount = BigDecimal.ZERO;
|
|
|
// ========== 第二遍遍历:保存发票数据(校验通过后) ==========
|
|
// ========== 第二遍遍历:保存发票数据(校验通过后) ==========
|
|
|
for (Map<String, Object> parsedData : parsedInvoiceDataList) {
|
|
for (Map<String, Object> parsedData : parsedInvoiceDataList) {
|
|
|
JSONObject invoice = (JSONObject) parsedData.get("invoice");
|
|
JSONObject invoice = (JSONObject) parsedData.get("invoice");
|
|
@@ -1312,7 +1414,10 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
Object responseData = parsedData.get("responseData");
|
|
Object responseData = parsedData.get("responseData");
|
|
|
|
|
|
|
|
allResults.add(responseData);
|
|
allResults.add(responseData);
|
|
|
-
|
|
|
|
|
|
|
+ BigDecimal amount = invoice.getBigDecimal("amount");
|
|
|
|
|
+ if (amount != null) {
|
|
|
|
|
+ totalAmount = totalAmount.add(amount);
|
|
|
|
|
+ }
|
|
|
// 构建InvoiceLibrary对象
|
|
// 构建InvoiceLibrary对象
|
|
|
InvoiceLibrary invoiceLibrary = new InvoiceLibrary();
|
|
InvoiceLibrary invoiceLibrary = new InvoiceLibrary();
|
|
|
invoiceLibrary.setOaId(processInstanceId);
|
|
invoiceLibrary.setOaId(processInstanceId);
|
|
@@ -1338,12 +1443,16 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
invoiceLibrary.setSellerTaxId(invoice.getString("sellerTaxId") != null ? invoice.getString("sellerTaxId") : "");
|
|
invoiceLibrary.setSellerTaxId(invoice.getString("sellerTaxId") != null ? invoice.getString("sellerTaxId") : "");
|
|
|
invoiceLibrary.setOaStatus("0");
|
|
invoiceLibrary.setOaStatus("0");
|
|
|
invoiceLibrary.setInvoiceStatus("0");
|
|
invoiceLibrary.setInvoiceStatus("0");
|
|
|
|
|
+ invoiceLibrary.setFormName("合作商付款申请");
|
|
|
invoiceLibrary.setDep(bm != null ? bm : "");
|
|
invoiceLibrary.setDep(bm != null ? bm : "");
|
|
|
invoiceLibrary.setAccountTitle(bxlb != null ? bxlb : "");
|
|
invoiceLibrary.setAccountTitle(bxlb != null ? bxlb : "");
|
|
|
invoiceLibrary.setPayAmount(mainJe != null ? mainJe : BigDecimal.ZERO);
|
|
invoiceLibrary.setPayAmount(mainJe != null ? mainJe : BigDecimal.ZERO);
|
|
|
invoiceLibrary.setCreatedAt(LocalDateTime.now());
|
|
invoiceLibrary.setCreatedAt(LocalDateTime.now());
|
|
|
invoiceLibrary.setUpdatedAt(LocalDateTime.now());
|
|
invoiceLibrary.setUpdatedAt(LocalDateTime.now());
|
|
|
-
|
|
|
|
|
|
|
+ invoiceLibrary.setPaySubject(fkzhxx != null ? fkzhxx : "");
|
|
|
|
|
+ invoiceLibrary.setPayAccount(fkzh != null ? fkzh : "");
|
|
|
|
|
+ invoiceLibrary.setBankName(yhqc != null ? yhqc : "");
|
|
|
|
|
+ invoiceLibrary.setIsLongTerm(sfct != null ? sfct : "");
|
|
|
invoiceList.add(invoiceLibrary);
|
|
invoiceList.add(invoiceLibrary);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1355,7 +1464,7 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
log.info("成功保存 {} 条发票记录", invoiceList.size());
|
|
log.info("成功保存 {} 条发票记录", invoiceList.size());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- addWorkflowComment(processInstanceId, userId, allResults);
|
|
|
|
|
|
|
+ addWorkflowComment1(processInstanceId, userId, totalAmount);
|
|
|
return McR.success(allResults);
|
|
return McR.success(allResults);
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@@ -1408,6 +1517,10 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
BigDecimal mainJe = null;
|
|
BigDecimal mainJe = null;
|
|
|
String bxlb = null;
|
|
String bxlb = null;
|
|
|
String bm = null;
|
|
String bm = null;
|
|
|
|
|
+ String fkzhxx = null;
|
|
|
|
|
+ String fkzh = null;
|
|
|
|
|
+ String yhqc = null;
|
|
|
|
|
+ String sfct = null;
|
|
|
|
|
|
|
|
// 遍历收集主表字段值
|
|
// 遍历收集主表字段值
|
|
|
for (Map formComponentValue : formComponentValues) {
|
|
for (Map formComponentValue : formComponentValues) {
|
|
@@ -1429,20 +1542,33 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-// if ("DDSelectField_1TP75OVCPAAO0".equals(id)) {
|
|
|
|
|
-// bxlb = value != null ? String.valueOf(value) : "";
|
|
|
|
|
-// }
|
|
|
|
|
-// if ("DepartmentField_OKBSJN0MD6O0".equals(id)) {
|
|
|
|
|
-// bm = value != null ? String.valueOf(value) : "";
|
|
|
|
|
-// }
|
|
|
|
|
|
|
+ if ("DDSelectField_1UX0JVU89Q000".equals(id)) {
|
|
|
|
|
+ bxlb = value != null ? String.valueOf(value) : "";
|
|
|
|
|
+ }
|
|
|
|
|
+ if ("DepartmentField_1HCL8SNLQORK0".equals(id)) {
|
|
|
|
|
+ bm = value != null ? String.valueOf(value) : "";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if ("DDSelectField_GLW8YHBHSLS0".equals(id)) {
|
|
|
|
|
+ fkzhxx = value != null ? String.valueOf(value) : "";
|
|
|
|
|
+ }
|
|
|
|
|
+ if ("TextField_1PR1HQ4H28SG0".equals(id)) {
|
|
|
|
|
+ fkzh = value != null ? String.valueOf(value) : "";
|
|
|
|
|
+ }
|
|
|
|
|
+ if ("TextField_1UPR1XZTI3VK".equals(id)) {
|
|
|
|
|
+ yhqc = value != null ? String.valueOf(value) : "";
|
|
|
|
|
+ }
|
|
|
|
|
+ if ("DDSelectField_1TMBRS8T7DPC0".equals(id)) {
|
|
|
|
|
+ sfct = value != null ? String.valueOf(value) : "否";
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 判断主表状态 - 无发票
|
|
// 判断主表状态 - 无发票
|
|
|
if ("否".equals(zt)) {
|
|
if ("否".equals(zt)) {
|
|
|
- Map<String, Object> result = new HashMap<>();
|
|
|
|
|
- result.put("je", mainJe);
|
|
|
|
|
- result.put("status", "否");
|
|
|
|
|
- result.put("message", "无发票报销");
|
|
|
|
|
|
|
+// Map<String, Object> result = new HashMap<>();
|
|
|
|
|
+// result.put("je", mainJe);
|
|
|
|
|
+// result.put("status", "否");
|
|
|
|
|
+// result.put("message", "无发票报销");
|
|
|
// 保存基础报销记录
|
|
// 保存基础报销记录
|
|
|
InvoiceLibrary baseInvoice = new InvoiceLibrary();
|
|
InvoiceLibrary baseInvoice = new InvoiceLibrary();
|
|
|
baseInvoice.setOaId(processInstanceId);
|
|
baseInvoice.setOaId(processInstanceId);
|
|
@@ -1460,12 +1586,17 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
baseInvoice.setTaxAmount(BigDecimal.ZERO);
|
|
baseInvoice.setTaxAmount(BigDecimal.ZERO);
|
|
|
baseInvoice.setTotalAmount(BigDecimal.ZERO);
|
|
baseInvoice.setTotalAmount(BigDecimal.ZERO);
|
|
|
baseInvoice.setBuyerName("");
|
|
baseInvoice.setBuyerName("");
|
|
|
|
|
+ baseInvoice.setFormName("合作商报销申请");
|
|
|
|
|
+ baseInvoice.setPaySubject(fkzhxx != null ? fkzhxx : "");
|
|
|
|
|
+ baseInvoice.setPayAccount(fkzh != null ? fkzh : "");
|
|
|
|
|
+ baseInvoice.setBankName(yhqc != null ? yhqc : "");
|
|
|
|
|
+ baseInvoice.setIsLongTerm(sfct != null ? sfct : "");
|
|
|
baseInvoice.setBuyerTaxId("");
|
|
baseInvoice.setBuyerTaxId("");
|
|
|
baseInvoice.setSellerName("");
|
|
baseInvoice.setSellerName("");
|
|
|
baseInvoice.setSellerTaxId("");
|
|
baseInvoice.setSellerTaxId("");
|
|
|
baseMapper.insert(baseInvoice);
|
|
baseMapper.insert(baseInvoice);
|
|
|
- addWorkflowComment(processInstanceId, userId, result);
|
|
|
|
|
- return McR.success(result);
|
|
|
|
|
|
|
+ addWorkflowComment(processInstanceId, userId, "报销总金额:"+mainJe);
|
|
|
|
|
+ return McR.success();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 判断主表状态 - 有发票
|
|
// 判断主表状态 - 有发票
|
|
@@ -1618,7 +1749,7 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
terminateWorkflow(accessToken, processInstanceId, userId, errorMsg);
|
|
terminateWorkflow(accessToken, processInstanceId, userId, errorMsg);
|
|
|
return McR.error("400", errorMsg);
|
|
return McR.error("400", errorMsg);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ BigDecimal totalAmount = BigDecimal.ZERO;
|
|
|
// ========== 第二遍遍历:保存发票数据(校验通过后) ==========
|
|
// ========== 第二遍遍历:保存发票数据(校验通过后) ==========
|
|
|
for (Map<String, Object> parsedData : parsedInvoiceDataList) {
|
|
for (Map<String, Object> parsedData : parsedInvoiceDataList) {
|
|
|
JSONObject invoice = (JSONObject) parsedData.get("invoice");
|
|
JSONObject invoice = (JSONObject) parsedData.get("invoice");
|
|
@@ -1626,7 +1757,10 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
Object responseData = parsedData.get("responseData");
|
|
Object responseData = parsedData.get("responseData");
|
|
|
|
|
|
|
|
allResults.add(responseData);
|
|
allResults.add(responseData);
|
|
|
-
|
|
|
|
|
|
|
+ BigDecimal amount = invoice.getBigDecimal("amount");
|
|
|
|
|
+ if (amount != null) {
|
|
|
|
|
+ totalAmount = totalAmount.add(amount);
|
|
|
|
|
+ }
|
|
|
// 构建InvoiceLibrary对象
|
|
// 构建InvoiceLibrary对象
|
|
|
InvoiceLibrary invoiceLibrary = new InvoiceLibrary();
|
|
InvoiceLibrary invoiceLibrary = new InvoiceLibrary();
|
|
|
invoiceLibrary.setOaId(processInstanceId);
|
|
invoiceLibrary.setOaId(processInstanceId);
|
|
@@ -1657,7 +1791,11 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
invoiceLibrary.setPayAmount(mainJe != null ? mainJe : BigDecimal.ZERO);
|
|
invoiceLibrary.setPayAmount(mainJe != null ? mainJe : BigDecimal.ZERO);
|
|
|
invoiceLibrary.setCreatedAt(LocalDateTime.now());
|
|
invoiceLibrary.setCreatedAt(LocalDateTime.now());
|
|
|
invoiceLibrary.setUpdatedAt(LocalDateTime.now());
|
|
invoiceLibrary.setUpdatedAt(LocalDateTime.now());
|
|
|
-
|
|
|
|
|
|
|
+ invoiceLibrary.setPaySubject(fkzhxx != null ? fkzhxx : "");
|
|
|
|
|
+ invoiceLibrary.setPayAccount(fkzh != null ? fkzh : "");
|
|
|
|
|
+ invoiceLibrary.setBankName(yhqc != null ? yhqc : "");
|
|
|
|
|
+ invoiceLibrary.setIsLongTerm(sfct != null ? sfct : "");
|
|
|
|
|
+ invoiceLibrary.setFormName("合作商报销申请");
|
|
|
invoiceList.add(invoiceLibrary);
|
|
invoiceList.add(invoiceLibrary);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1669,7 +1807,7 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
log.info("成功保存 {} 条发票记录", invoiceList.size());
|
|
log.info("成功保存 {} 条发票记录", invoiceList.size());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- addWorkflowComment(processInstanceId, userId, allResults);
|
|
|
|
|
|
|
+ addWorkflowComment1(processInstanceId, userId, totalAmount);
|
|
|
return McR.success(allResults);
|
|
return McR.success(allResults);
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@@ -1722,6 +1860,10 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
BigDecimal mainJe = null;
|
|
BigDecimal mainJe = null;
|
|
|
String bxlb = null;
|
|
String bxlb = null;
|
|
|
String bm = null;
|
|
String bm = null;
|
|
|
|
|
+ String fkzhxx = null;
|
|
|
|
|
+ String fkzh = null;
|
|
|
|
|
+ String yhqc = null;
|
|
|
|
|
+ String sfct = null;
|
|
|
|
|
|
|
|
// 遍历收集主表字段值
|
|
// 遍历收集主表字段值
|
|
|
for (Map formComponentValue : formComponentValues) {
|
|
for (Map formComponentValue : formComponentValues) {
|
|
@@ -1744,20 +1886,32 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
// 如果需要这两个字段,请取消注释并填写正确的字段ID
|
|
// 如果需要这两个字段,请取消注释并填写正确的字段ID
|
|
|
- // if ("DDSelectField_1TP75OVCPAAO0".equals(id)) {
|
|
|
|
|
- // bxlb = value != null ? String.valueOf(value) : "";
|
|
|
|
|
- // }
|
|
|
|
|
- // if ("DepartmentField_OKBSJN0MD6O0".equals(id)) {
|
|
|
|
|
- // bm = value != null ? String.valueOf(value) : "";
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ if ("DDSelectField_1UX0JVU89Q000".equals(id)) {
|
|
|
|
|
+ bxlb = value != null ? String.valueOf(value) : "";
|
|
|
|
|
+ }
|
|
|
|
|
+ if ("DepartmentField_1BJT6UY9Y5B40".equals(id)) {
|
|
|
|
|
+ bm = value != null ? String.valueOf(value) : "";
|
|
|
|
|
+ }
|
|
|
|
|
+ if ("DDSelectField_1D77TV92WXEO0".equals(id)) {
|
|
|
|
|
+ fkzhxx = value != null ? String.valueOf(value) : "";
|
|
|
|
|
+ }
|
|
|
|
|
+ if ("TextField_3CQPLF9BVBO0".equals(id)) {
|
|
|
|
|
+ fkzh = value != null ? String.valueOf(value) : "";
|
|
|
|
|
+ }
|
|
|
|
|
+ if ("TextField_YSFYQQ305SG0".equals(id)) {
|
|
|
|
|
+ yhqc = value != null ? String.valueOf(value) : "";
|
|
|
|
|
+ }
|
|
|
|
|
+ if ("DDSelectField_1AYKIPZ3435S0".equals(id)) {
|
|
|
|
|
+ sfct = value != null ? String.valueOf(value) : "否";
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 判断主表状态 - 无发票
|
|
// 判断主表状态 - 无发票
|
|
|
if ("否".equals(zt)) {
|
|
if ("否".equals(zt)) {
|
|
|
- Map<String, Object> result = new HashMap<>();
|
|
|
|
|
- result.put("je", mainJe);
|
|
|
|
|
- result.put("status", "否");
|
|
|
|
|
- result.put("message", "无发票报销");
|
|
|
|
|
|
|
+// Map<String, Object> result = new HashMap<>();
|
|
|
|
|
+// result.put("je", mainJe);
|
|
|
|
|
+// result.put("status", "否");
|
|
|
|
|
+// result.put("message", "无发票报销");
|
|
|
// 保存基础报销记录
|
|
// 保存基础报销记录
|
|
|
InvoiceLibrary baseInvoice = new InvoiceLibrary();
|
|
InvoiceLibrary baseInvoice = new InvoiceLibrary();
|
|
|
baseInvoice.setOaId(processInstanceId);
|
|
baseInvoice.setOaId(processInstanceId);
|
|
@@ -1765,10 +1919,15 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
baseInvoice.setInvoiceStatus("0");
|
|
baseInvoice.setInvoiceStatus("0");
|
|
|
baseInvoice.setDep(bm != null ? bm : "");
|
|
baseInvoice.setDep(bm != null ? bm : "");
|
|
|
baseInvoice.setAccountTitle(bxlb != null ? bxlb : "");
|
|
baseInvoice.setAccountTitle(bxlb != null ? bxlb : "");
|
|
|
|
|
+ baseInvoice.setPaySubject(fkzhxx != null ? fkzhxx : "");
|
|
|
|
|
+ baseInvoice.setPayAccount(fkzh != null ? fkzh : "");
|
|
|
|
|
+ baseInvoice.setBankName(yhqc != null ? yhqc : "");
|
|
|
|
|
+ baseInvoice.setIsLongTerm(sfct != null ? sfct : "");
|
|
|
baseInvoice.setPayAmount(mainJe != null ? mainJe : BigDecimal.ZERO);
|
|
baseInvoice.setPayAmount(mainJe != null ? mainJe : BigDecimal.ZERO);
|
|
|
baseInvoice.setCreatedAt(LocalDateTime.now());
|
|
baseInvoice.setCreatedAt(LocalDateTime.now());
|
|
|
baseInvoice.setUpdatedAt(LocalDateTime.now());
|
|
baseInvoice.setUpdatedAt(LocalDateTime.now());
|
|
|
baseInvoice.setInvoiceCode("");
|
|
baseInvoice.setInvoiceCode("");
|
|
|
|
|
+ baseInvoice.setFormName("出差费用报销");
|
|
|
baseInvoice.setInvoiceNumber("");
|
|
baseInvoice.setInvoiceNumber("");
|
|
|
baseInvoice.setInvoiceType("");
|
|
baseInvoice.setInvoiceType("");
|
|
|
baseInvoice.setAmount(BigDecimal.ZERO);
|
|
baseInvoice.setAmount(BigDecimal.ZERO);
|
|
@@ -1779,8 +1938,8 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
baseInvoice.setSellerName("");
|
|
baseInvoice.setSellerName("");
|
|
|
baseInvoice.setSellerTaxId("");
|
|
baseInvoice.setSellerTaxId("");
|
|
|
baseMapper.insert(baseInvoice);
|
|
baseMapper.insert(baseInvoice);
|
|
|
- addWorkflowComment(processInstanceId, userId, result);
|
|
|
|
|
- return McR.success(result);
|
|
|
|
|
|
|
+ addWorkflowComment(processInstanceId, userId, "报销总金额:"+mainJe);
|
|
|
|
|
+ return McR.success();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 判断主表状态 - 有发票
|
|
// 判断主表状态 - 有发票
|
|
@@ -1937,14 +2096,17 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
terminateWorkflow(accessToken, processInstanceId, userId, errorMsg);
|
|
terminateWorkflow(accessToken, processInstanceId, userId, errorMsg);
|
|
|
return McR.error("400", errorMsg);
|
|
return McR.error("400", errorMsg);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ BigDecimal totalAmount = BigDecimal.ZERO;
|
|
|
// ========== 第二遍遍历:保存发票数据(校验通过后) ==========
|
|
// ========== 第二遍遍历:保存发票数据(校验通过后) ==========
|
|
|
for (Map<String, Object> parsedData : parsedInvoiceDataList) {
|
|
for (Map<String, Object> parsedData : parsedInvoiceDataList) {
|
|
|
JSONObject invoice = (JSONObject) parsedData.get("invoice");
|
|
JSONObject invoice = (JSONObject) parsedData.get("invoice");
|
|
|
Object responseData = parsedData.get("responseData");
|
|
Object responseData = parsedData.get("responseData");
|
|
|
|
|
|
|
|
allResults.add(responseData);
|
|
allResults.add(responseData);
|
|
|
-
|
|
|
|
|
|
|
+ BigDecimal amount = invoice.getBigDecimal("amount");
|
|
|
|
|
+ if (amount != null) {
|
|
|
|
|
+ totalAmount = totalAmount.add(amount);
|
|
|
|
|
+ }
|
|
|
// 构建InvoiceLibrary对象
|
|
// 构建InvoiceLibrary对象
|
|
|
InvoiceLibrary invoiceLibrary = new InvoiceLibrary();
|
|
InvoiceLibrary invoiceLibrary = new InvoiceLibrary();
|
|
|
invoiceLibrary.setOaId(processInstanceId);
|
|
invoiceLibrary.setOaId(processInstanceId);
|
|
@@ -1975,7 +2137,11 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
invoiceLibrary.setPayAmount(mainJe != null ? mainJe : BigDecimal.ZERO);
|
|
invoiceLibrary.setPayAmount(mainJe != null ? mainJe : BigDecimal.ZERO);
|
|
|
invoiceLibrary.setCreatedAt(LocalDateTime.now());
|
|
invoiceLibrary.setCreatedAt(LocalDateTime.now());
|
|
|
invoiceLibrary.setUpdatedAt(LocalDateTime.now());
|
|
invoiceLibrary.setUpdatedAt(LocalDateTime.now());
|
|
|
-
|
|
|
|
|
|
|
+ invoiceLibrary.setPaySubject(fkzhxx != null ? fkzhxx : "");
|
|
|
|
|
+ invoiceLibrary.setPayAccount(fkzh != null ? fkzh : "");
|
|
|
|
|
+ invoiceLibrary.setBankName(yhqc != null ? yhqc : "");
|
|
|
|
|
+ invoiceLibrary.setIsLongTerm(sfct != null ? sfct : "");
|
|
|
|
|
+ invoiceLibrary.setFormName("出差费用报销");
|
|
|
invoiceList.add(invoiceLibrary);
|
|
invoiceList.add(invoiceLibrary);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1989,7 +2155,7 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
log.warn("没有有效的发票数据可保存");
|
|
log.warn("没有有效的发票数据可保存");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- addWorkflowComment(processInstanceId, userId, allResults);
|
|
|
|
|
|
|
+ addWorkflowComment1(processInstanceId, userId, totalAmount);
|
|
|
return McR.success(allResults);
|
|
return McR.success(allResults);
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@@ -2042,7 +2208,10 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
BigDecimal mainJe = null;
|
|
BigDecimal mainJe = null;
|
|
|
String bxlb = null;
|
|
String bxlb = null;
|
|
|
String bm = null;
|
|
String bm = null;
|
|
|
-
|
|
|
|
|
|
|
+ String fkzhxx = null;
|
|
|
|
|
+ String fkzh = null;
|
|
|
|
|
+ String yhqc = null;
|
|
|
|
|
+ String sfct = null;
|
|
|
// 遍历收集主表字段值
|
|
// 遍历收集主表字段值
|
|
|
for (Map formComponentValue : formComponentValues) {
|
|
for (Map formComponentValue : formComponentValues) {
|
|
|
String id = String.valueOf(formComponentValue.get("id"));
|
|
String id = String.valueOf(formComponentValue.get("id"));
|
|
@@ -2064,20 +2233,32 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
// 如果需要这两个字段,请取消注释并填写正确的字段ID
|
|
// 如果需要这两个字段,请取消注释并填写正确的字段ID
|
|
|
- // if ("DDSelectField_1TP75OVCPAAO0".equals(id)) {
|
|
|
|
|
- // bxlb = value != null ? String.valueOf(value) : "";
|
|
|
|
|
- // }
|
|
|
|
|
- // if ("DepartmentField_OKBSJN0MD6O0".equals(id)) {
|
|
|
|
|
- // bm = value != null ? String.valueOf(value) : "";
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ if ("DDSelectField_YLLB7AD1ATS0".equals(id)) {
|
|
|
|
|
+ bxlb = value != null ? String.valueOf(value) : "";
|
|
|
|
|
+ }
|
|
|
|
|
+ if ("DepartmentField_RF93A6VHA9C0".equals(id)) {
|
|
|
|
|
+ bm = value != null ? String.valueOf(value) : "";
|
|
|
|
|
+ }
|
|
|
|
|
+ if ("DDSelectField_IQXAGL7Z8XC0".equals(id)) {
|
|
|
|
|
+ fkzhxx = value != null ? String.valueOf(value) : "";
|
|
|
|
|
+ }
|
|
|
|
|
+ if ("TextField_3W9CLQOZZ540".equals(id)) {
|
|
|
|
|
+ fkzh = value != null ? String.valueOf(value) : "";
|
|
|
|
|
+ }
|
|
|
|
|
+ if ("TextField_9PJ4JW8KTCS0".equals(id)) {
|
|
|
|
|
+ yhqc = value != null ? String.valueOf(value) : "";
|
|
|
|
|
+ }
|
|
|
|
|
+ if ("DDSelectField_21L6KT7DT70G0".equals(id)) {
|
|
|
|
|
+ sfct = value != null ? String.valueOf(value) : "否";
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 判断主表状态 - 无发票
|
|
// 判断主表状态 - 无发票
|
|
|
if ("否".equals(zt)) {
|
|
if ("否".equals(zt)) {
|
|
|
- Map<String, Object> result = new HashMap<>();
|
|
|
|
|
- result.put("je", mainJe);
|
|
|
|
|
- result.put("status", "否");
|
|
|
|
|
- result.put("message", "无发票报销");
|
|
|
|
|
|
|
+// Map<String, Object> result = new HashMap<>();
|
|
|
|
|
+// result.put("je", mainJe);
|
|
|
|
|
+// result.put("status", "否");
|
|
|
|
|
+// result.put("message", "无发票报销");
|
|
|
// 保存基础报销记录
|
|
// 保存基础报销记录
|
|
|
InvoiceLibrary baseInvoice = new InvoiceLibrary();
|
|
InvoiceLibrary baseInvoice = new InvoiceLibrary();
|
|
|
baseInvoice.setOaId(processInstanceId);
|
|
baseInvoice.setOaId(processInstanceId);
|
|
@@ -2095,12 +2276,17 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
baseInvoice.setTaxAmount(BigDecimal.ZERO);
|
|
baseInvoice.setTaxAmount(BigDecimal.ZERO);
|
|
|
baseInvoice.setTotalAmount(BigDecimal.ZERO);
|
|
baseInvoice.setTotalAmount(BigDecimal.ZERO);
|
|
|
baseInvoice.setBuyerName("");
|
|
baseInvoice.setBuyerName("");
|
|
|
|
|
+ baseInvoice.setFormName("批量付款申请(一对多)");
|
|
|
|
|
+ baseInvoice.setPaySubject(fkzhxx != null ? fkzhxx : "");
|
|
|
|
|
+ baseInvoice.setPayAccount(fkzh != null ? fkzh : "");
|
|
|
|
|
+ baseInvoice.setBankName(yhqc != null ? yhqc : "");
|
|
|
|
|
+ baseInvoice.setIsLongTerm(sfct != null ? sfct : "");
|
|
|
baseInvoice.setBuyerTaxId("");
|
|
baseInvoice.setBuyerTaxId("");
|
|
|
baseInvoice.setSellerName("");
|
|
baseInvoice.setSellerName("");
|
|
|
baseInvoice.setSellerTaxId("");
|
|
baseInvoice.setSellerTaxId("");
|
|
|
baseMapper.insert(baseInvoice);
|
|
baseMapper.insert(baseInvoice);
|
|
|
- addWorkflowComment(processInstanceId, userId, result);
|
|
|
|
|
- return McR.success(result);
|
|
|
|
|
|
|
+ addWorkflowComment(processInstanceId, userId, "报销总金额:"+mainJe);
|
|
|
|
|
+ return McR.success();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 判断主表状态 - 有发票
|
|
// 判断主表状态 - 有发票
|
|
@@ -2257,14 +2443,17 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
terminateWorkflow(accessToken, processInstanceId, userId, errorMsg);
|
|
terminateWorkflow(accessToken, processInstanceId, userId, errorMsg);
|
|
|
return McR.error("400", errorMsg);
|
|
return McR.error("400", errorMsg);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ BigDecimal totalAmount = BigDecimal.ZERO;
|
|
|
// ========== 第二遍遍历:保存发票数据(校验通过后) ==========
|
|
// ========== 第二遍遍历:保存发票数据(校验通过后) ==========
|
|
|
for (Map<String, Object> parsedData : parsedInvoiceDataList) {
|
|
for (Map<String, Object> parsedData : parsedInvoiceDataList) {
|
|
|
JSONObject invoice = (JSONObject) parsedData.get("invoice");
|
|
JSONObject invoice = (JSONObject) parsedData.get("invoice");
|
|
|
Object responseData = parsedData.get("responseData");
|
|
Object responseData = parsedData.get("responseData");
|
|
|
|
|
|
|
|
allResults.add(responseData);
|
|
allResults.add(responseData);
|
|
|
-
|
|
|
|
|
|
|
+ BigDecimal amount = invoice.getBigDecimal("amount");
|
|
|
|
|
+ if (amount != null) {
|
|
|
|
|
+ totalAmount = totalAmount.add(amount);
|
|
|
|
|
+ }
|
|
|
// 构建InvoiceLibrary对象
|
|
// 构建InvoiceLibrary对象
|
|
|
InvoiceLibrary invoiceLibrary = new InvoiceLibrary();
|
|
InvoiceLibrary invoiceLibrary = new InvoiceLibrary();
|
|
|
invoiceLibrary.setOaId(processInstanceId);
|
|
invoiceLibrary.setOaId(processInstanceId);
|
|
@@ -2295,7 +2484,11 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
invoiceLibrary.setPayAmount(mainJe != null ? mainJe : BigDecimal.ZERO);
|
|
invoiceLibrary.setPayAmount(mainJe != null ? mainJe : BigDecimal.ZERO);
|
|
|
invoiceLibrary.setCreatedAt(LocalDateTime.now());
|
|
invoiceLibrary.setCreatedAt(LocalDateTime.now());
|
|
|
invoiceLibrary.setUpdatedAt(LocalDateTime.now());
|
|
invoiceLibrary.setUpdatedAt(LocalDateTime.now());
|
|
|
-
|
|
|
|
|
|
|
+ invoiceLibrary.setFormName("批量付款申请(一对多)");
|
|
|
|
|
+ invoiceLibrary.setPaySubject(fkzhxx != null ? fkzhxx : "");
|
|
|
|
|
+ invoiceLibrary.setPayAccount(fkzh != null ? fkzh : "");
|
|
|
|
|
+ invoiceLibrary.setBankName(yhqc != null ? yhqc : "");
|
|
|
|
|
+ invoiceLibrary.setIsLongTerm(sfct != null ? sfct : "");
|
|
|
invoiceList.add(invoiceLibrary);
|
|
invoiceList.add(invoiceLibrary);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -2309,7 +2502,7 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
log.warn("没有有效的发票数据可保存");
|
|
log.warn("没有有效的发票数据可保存");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- addWorkflowComment(processInstanceId, userId, allResults);
|
|
|
|
|
|
|
+ addWorkflowComment1(processInstanceId, userId, totalAmount);
|
|
|
return McR.success(allResults);
|
|
return McR.success(allResults);
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@@ -2328,15 +2521,40 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void updateSfctByOaId(Map map) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ String oaId = UtilMap.getString(map, "oaId");
|
|
|
|
|
+ String sfct = UtilMap.getString(map, "sfct");
|
|
|
|
|
+ sfct = (sfct == null || sfct.trim().isEmpty()) ? "否" : sfct;
|
|
|
|
|
+ // 创建更新条件
|
|
|
|
|
+ LambdaUpdateWrapper<InvoiceLibrary> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
|
|
+ updateWrapper.eq(InvoiceLibrary::getOaId, oaId)
|
|
|
|
|
+ .set(InvoiceLibrary::getIsLongTerm, sfct)
|
|
|
|
|
+ .set(InvoiceLibrary::getUpdatedAt, LocalDateTime.now());
|
|
|
|
|
+
|
|
|
|
|
+ int updateCount = baseMapper.update(null, updateWrapper);
|
|
|
|
|
+
|
|
|
|
|
+ if (updateCount > 0) {
|
|
|
|
|
+ log.info("更新成功: 共更新{}条记录", updateCount);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ log.warn("未找到符合条件的记录: oaId={}", oaId);
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+
|
|
|
|
|
+ throw new RuntimeException("更新OA状态失败", e);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 添加钉钉审批评论
|
|
* 添加钉钉审批评论
|
|
|
*/
|
|
*/
|
|
|
- private void addWorkflowComment(String processInstanceId, String userId, Object content) {
|
|
|
|
|
|
|
+ private void addWorkflowComment(String processInstanceId, String userId, Object totalAmount) {
|
|
|
try {
|
|
try {
|
|
|
Map<String, Object> body = new HashMap<>();
|
|
Map<String, Object> body = new HashMap<>();
|
|
|
body.put("processInstanceId", processInstanceId);
|
|
body.put("processInstanceId", processInstanceId);
|
|
|
- body.put("text", JSON.toJSONString(content));
|
|
|
|
|
|
|
+ body.put("text", totalAmount);
|
|
|
body.put("commentUserId", userId);
|
|
body.put("commentUserId", userId);
|
|
|
|
|
|
|
|
String result = UtilHttp.doPost(
|
|
String result = UtilHttp.doPost(
|
|
@@ -2351,7 +2569,25 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
log.error("添加审批评论失败", e);
|
|
log.error("添加审批评论失败", e);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ private void addWorkflowComment1(String processInstanceId, String userId, BigDecimal totalAmount) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ Map<String, Object> body = new HashMap<>();
|
|
|
|
|
+ body.put("processInstanceId", processInstanceId);
|
|
|
|
|
+ body.put("text", "发票总金额:"+totalAmount);
|
|
|
|
|
+ body.put("commentUserId", userId);
|
|
|
|
|
|
|
|
|
|
+ String result = UtilHttp.doPost(
|
|
|
|
|
+ "https://api.dingtalk.com/v1.0/workflow/processInstances/comments",
|
|
|
|
|
+ ddClient.initTokenHeader(),
|
|
|
|
|
+ null,
|
|
|
|
|
+ body
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ log.info("添加审批评论成功: {}", result);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("添加审批评论失败", e);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
/**
|
|
/**
|
|
|
* 从 Map 中获取字符串值
|
|
* 从 Map 中获取字符串值
|
|
|
*/
|
|
*/
|
|
@@ -2511,8 +2747,7 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
.amount(UtilNumber.setBigDecimal(UtilMap.getString_first(prop, "Total", "Fare")))
|
|
.amount(UtilNumber.setBigDecimal(UtilMap.getString_first(prop, "Total", "Fare")))
|
|
|
.tax(UtilNumber.setBigDecimal(UtilMap.getString_first(prop, "Tax")))
|
|
.tax(UtilNumber.setBigDecimal(UtilMap.getString_first(prop, "Tax")))
|
|
|
.excludingTax(UtilNumber.setBigDecimal(UtilMap.getString(prop, "PretaxAmount")))
|
|
.excludingTax(UtilNumber.setBigDecimal(UtilMap.getString(prop, "PretaxAmount")))
|
|
|
- .buyerName(StringUtils.isBlank(guyuanNameRepalce(UtilMap.getString(prop, "Buyer")))
|
|
|
|
|
- ? "上海能辉科技股份有限公司" : guyuanNameRepalce(UtilMap.getString(prop, "Buyer")))
|
|
|
|
|
|
|
+ .buyerName(StringUtils.defaultString(guyuanNameRepalce(UtilMap.getString(prop, "Buyer"))))
|
|
|
.buyerTaxId(StringUtils.isBlank(UtilMap.getString(prop, "BuyerTaxID"))
|
|
.buyerTaxId(StringUtils.isBlank(UtilMap.getString(prop, "BuyerTaxID"))
|
|
|
? "" : UtilMap.getString(prop, "BuyerTaxID"))
|
|
? "" : UtilMap.getString(prop, "BuyerTaxID"))
|
|
|
.sellerName(guyuanNameRepalce(UtilMap.getString_first(prop, "Seller", "Issuer")))
|
|
.sellerName(guyuanNameRepalce(UtilMap.getString_first(prop, "Seller", "Issuer")))
|
|
@@ -2614,7 +2849,7 @@ public class InvoiceLibraryServiceImpl extends ServiceImpl<InvoiceLibraryMapper,
|
|
|
@RequestParam(defaultValue = "download") String option) throws IOException {
|
|
@RequestParam(defaultValue = "download") String option) throws IOException {
|
|
|
|
|
|
|
|
// 根据fileId获取实际文件路径,这里简化处理,实际可能需要从数据库查询
|
|
// 根据fileId获取实际文件路径,这里简化处理,实际可能需要从数据库查询
|
|
|
- Path filePath = Paths.get("C://Users//EDY//Desktop//项目//琦王//files//").resolve(fileId).normalize();
|
|
|
|
|
|
|
+ Path filePath = Paths.get("D://qiwang//files//").resolve(fileId).normalize();
|
|
|
|
|
|
|
|
// 检查文件是否存在
|
|
// 检查文件是否存在
|
|
|
if (!Files.exists(filePath)) {
|
|
if (!Files.exists(filePath)) {
|