Ver Fonte

2024年1月26日16:15:50

纪新园 há 1 ano atrás
pai
commit
14214433d9

+ 2 - 2
blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/impl/ReportsServiceImpl.java

@@ -466,10 +466,10 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 								Comparator.comparing(e -> e.getFeeCnName()))), ArrayList::new));
 						int count = 0;
 						for (FeeCenterReports fee : feeCenters) {
-							FeeCenterReports feeCenterReportsD = item.getFeeCenterList().stream()
+							FeeCenterReports feeCenterReportsD = feeCenterReportsList.stream()
 								.filter(e -> e.getFeeCnName().equals(fee.getFeeCnName()) && MagicValues.D.equals(e.getDc()))
 								.findFirst().orElse(null);
-							FeeCenterReports feeCenterReportsC = item.getFeeCenterList().stream()
+							FeeCenterReports feeCenterReportsC = feeCenterReportsList.stream()
 								.filter(e -> e.getFeeCnName().equals(fee.getFeeCnName()) && MagicValues.C.equals(e.getDc()))
 								.findFirst().orElse(null);
 							FeeCenterReports feeCenterReports1 = new FeeCenterReports();

+ 37 - 30
blade-service/blade-los/src/main/java/org/springblade/los/finance/invoices/service/impl/FinInvoicesServiceImpl.java

@@ -44,7 +44,6 @@ import org.springblade.los.finance.invoices.service.IFinInvoiceItemDetailService
 import org.springblade.los.finance.invoices.service.IFinInvoicesItemsService;
 import org.springblade.los.finance.invoices.service.IFinInvoicesService;
 import org.springblade.los.finance.invoices.vo.FinInvoicesVO;
-import org.springblade.system.entity.Dept;
 import org.springblade.system.feign.ISysClient;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -98,7 +97,7 @@ public class FinInvoicesServiceImpl extends ServiceImpl<FinInvoicesMapper, FinIn
 	public R submit(FinInvoices finInvoices) {
 		String deptId = "";
 		String deptName = "";
-		String branchId = deptUtils.getDeptPid()+"";
+		String branchId = deptUtils.getDeptPid() + "";
 		//获取部门ids对应中文名
 		if (ObjectUtils.isNotNull(AuthUtil.getDeptId())) {
 			deptId = AuthUtil.getDeptId();
@@ -294,25 +293,33 @@ public class FinInvoicesServiceImpl extends ServiceImpl<FinInvoicesMapper, FinIn
 				finAccBills.setUpdateUser(AuthUtil.getUserId());
 				finAccBills.setUpdateTime(new Date());
 				finAccBills.setUpdateUserName(AuthUtil.getUserName());
-				if ("CNY".equals(item.getCurCode())){
-					if ("C".equals(finAccBills.getAccountDc())){
-						if (item.getCurrentAmount().compareTo(finAccBills.getAmountCrLoc().subtract(finAccBills.getAppliedInvoiceAmount()).subtract(finAccBills.getUninvoicedAmount())) > 0) {
-							throw new RuntimeException("本次开票金额大于未开票金额");
+				if ("CNY".equals(item.getCurCode())) {
+					if ("C".equals(finAccBills.getAccountDc())) {
+						if (ObjectUtils.isNull(item.getApplySrcId())) {
+							if (item.getCurrentAmount().compareTo(finAccBills.getAmountCrLoc().subtract(finAccBills.getAppliedInvoiceAmount()).subtract(finAccBills.getUninvoicedAmount())) > 0) {
+								throw new RuntimeException("本次开票金额大于未开票金额");
+							}
 						}
-					}else{
-						if (item.getCurrentAmount().compareTo(finAccBills.getAmountDrLoc().subtract(finAccBills.getAppliedInvoiceAmount()).subtract(finAccBills.getUninvoicedAmount())) > 0) {
-							throw new RuntimeException("本次开票金额大于未开票金额");
+					} else {
+						if (ObjectUtils.isNull(item.getApplySrcId())) {
+							if (item.getCurrentAmount().compareTo(finAccBills.getAmountDrLoc().subtract(finAccBills.getAppliedInvoiceAmount()).subtract(finAccBills.getUninvoicedAmount())) > 0) {
+								throw new RuntimeException("本次开票金额大于未开票金额");
+							}
 						}
 					}
 					finAccBills.setUninvoicedAmount(finAccBills.getUninvoicedAmount().add(item.getCurrentAmount()));
-				}else{
-					if ("C".equals(finAccBills.getAccountDc())){
-						if (item.getCurrentAmount().compareTo(finAccBills.getAmountCrLoc().subtract(finAccBills.getAppliedInvoiceAmountUsd()).subtract(finAccBills.getUninvoicedAmountUsd())) > 0) {
-							throw new RuntimeException("本次开票金额大于未开票金额");
+				} else {
+					if ("C".equals(finAccBills.getAccountDc())) {
+						if (ObjectUtils.isNull(item.getApplySrcId())) {
+							if (item.getCurrentAmount().compareTo(finAccBills.getAmountCrLoc().subtract(finAccBills.getAppliedInvoiceAmountUsd()).subtract(finAccBills.getUninvoicedAmountUsd())) > 0) {
+								throw new RuntimeException("本次开票金额大于未开票金额");
+							}
 						}
-					}else{
-						if (item.getCurrentAmount().compareTo(finAccBills.getAmountDrLoc().subtract(finAccBills.getAppliedInvoiceAmountUsd()).subtract(finAccBills.getUninvoicedAmountUsd())) > 0) {
-							throw new RuntimeException("本次开票金额大于未开票金额");
+					} else {
+						if (ObjectUtils.isNull(item.getApplySrcId())) {
+							if (item.getCurrentAmount().compareTo(finAccBills.getAmountDrLoc().subtract(finAccBills.getAppliedInvoiceAmountUsd()).subtract(finAccBills.getUninvoicedAmountUsd())) > 0) {
+								throw new RuntimeException("本次开票金额大于未开票金额");
+							}
 						}
 					}
 					finAccBills.setUninvoicedAmountUsd(finAccBills.getUninvoicedAmountUsd().add(item.getCurrentAmount()));
@@ -507,23 +514,23 @@ public class FinInvoicesServiceImpl extends ServiceImpl<FinInvoicesMapper, FinIn
 				finAccBills.setUpdateUser(AuthUtil.getUserId());
 				finAccBills.setUpdateTime(new Date());
 				finAccBills.setUpdateUserName(AuthUtil.getUserName());
-				if ("CNY".equals(item.getCurCode())){
-					if ("C".equals(finAccBills.getAccountDc())){
+				if ("CNY".equals(item.getCurCode())) {
+					if ("C".equals(finAccBills.getAccountDc())) {
 						if (item.getCurrentAmount().compareTo(finAccBills.getUninvoicedAmount()) > 0) {
 							throw new RuntimeException("本次开票金额大于已开票金额");
 						}
-					}else{
+					} else {
 						if (item.getCurrentAmount().compareTo(finAccBills.getUninvoicedAmount()) > 0) {
 							throw new RuntimeException("本次开票金额大于已开票金额");
 						}
 					}
 					finAccBills.setUninvoicedAmount(finAccBills.getUninvoicedAmount().subtract(item.getCurrentAmount()));
-				}else{
-					if ("C".equals(finAccBills.getAccountDc())){
+				} else {
+					if ("C".equals(finAccBills.getAccountDc())) {
 						if (item.getCurrentAmount().compareTo(finAccBills.getUninvoicedAmountUsd()) > 0) {
 							throw new RuntimeException("本次开票金额大于已开票金额");
 						}
-					}else{
+					} else {
 						if (item.getCurrentAmount().compareTo(finAccBills.getUninvoicedAmountUsd()) > 0) {
 							throw new RuntimeException("本次开票金额大于已开票金额");
 						}
@@ -580,25 +587,25 @@ public class FinInvoicesServiceImpl extends ServiceImpl<FinInvoicesMapper, FinIn
 				if (finAccBills == null) {
 					throw new RuntimeException("未找到账单明细,操作失败");
 				}
-				if ("CNY".equals(item.getCurCode())){
+				if ("CNY".equals(item.getCurCode())) {
 					BigDecimal amount = finAccBills.getAppliedInvoiceAmount().subtract(finAccBills.getAppliedInvoiceAmountStl());
-					if ("C".equals(finAccBills.getAccountDc())){
+					if ("C".equals(finAccBills.getAccountDc())) {
 						if (item.getCurrentAmount().compareTo(finAccBills.getAmountCr().subtract(amount)) > 0) {
 							throw new RuntimeException("本次申请金额大于未申请金额");
 						}
-					}else{
+					} else {
 						if (item.getCurrentAmount().compareTo(finAccBills.getAmountDr().subtract(amount)) > 0) {
 							throw new RuntimeException("本次申请金额大于未申请金额");
 						}
 					}
 					finAccBills.setAppliedInvoiceAmount(finAccBills.getAppliedInvoiceAmount().add(item.getCurrentAmount()));
-				}else{
+				} else {
 					BigDecimal amount = finAccBills.getAppliedInvoiceAmountUsd().subtract(finAccBills.getAppliedInvoiceAmountStlUsd());
-					if ("C".equals(finAccBills.getAccountDc())){
+					if ("C".equals(finAccBills.getAccountDc())) {
 						if (item.getCurrentAmount().compareTo(finAccBills.getAmountCrUsd().subtract(amount)) > 0) {
 							throw new RuntimeException("本次申请金额大于未申请金额");
 						}
-					}else{
+					} else {
 						if (item.getCurrentAmount().compareTo(finAccBills.getAmountDrUsd().subtract(amount)) > 0) {
 							throw new RuntimeException("本次申请金额大于未申请金额");
 						}
@@ -675,12 +682,12 @@ public class FinInvoicesServiceImpl extends ServiceImpl<FinInvoicesMapper, FinIn
 				if (finAccBills == null) {
 					throw new RuntimeException("未找到账单明细,操作失败");
 				}
-				if ("CNY".equals(item.getCurCode())){
+				if ("CNY".equals(item.getCurCode())) {
 					if (item.getCurrentAmount().compareTo(finAccBills.getAppliedInvoiceAmount()) > 0) {
 						throw new RuntimeException("本次申请金额大于未申请金额");
 					}
 					finAccBills.setAppliedInvoiceAmount(finAccBills.getAppliedInvoiceAmount().subtract(item.getCurrentAmount()));
-				}else{
+				} else {
 					if (item.getCurrentAmount().compareTo(finAccBills.getAppliedInvoiceAmountUsd()) > 0) {
 						throw new RuntimeException("本次申请金额大于未申请金额");
 					}

+ 11 - 7
blade-service/blade-los/src/main/java/org/springblade/los/finance/stl/service/impl/FinStlBillsServiceImpl.java

@@ -1638,14 +1638,18 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 				item.setAppliedAmountStl(finAccBillsVO.getAppliedAmountStl());
 				item.setAppliedInvoiceAmountStl(finAccBillsVO.getAppliedInvoiceAmountStl());
 				item.setReconciliationAmount(finAccBillsVO.getReconciliationAmount());
-				BigDecimal amount = item.getAppliedAmount().subtract(item.getAppliedAmountStl());
-				item.setAppliedCurrentStlAmount(item.getAmount().subtract(amount).subtract(finAccBillsVO.getStlTtlAmount()));
-//				item.setAppliedInvoiceCurrentStlAmount(item.getAmount().subtract(item.getAppliedInvoiceAmount()).add(item.getAppliedInvoiceAmountStl()).subtract(finAccBillsVO.getUninvoicedAmount()));
-				item.setAppliedInvoiceCurrentStlAmount(item.getAmount().subtract(finAccBillsVO.getStlTtlAmount()));
-				item.setCurrentStlAmount(item.getAmount().subtract(finAccBillsVO.getStlTtlAmount()));
-				item.setReconciliationCurrentAmount(item.getAmount().subtract(item.getReconciliationAmount()));
+
+				item.setAppliedCurrentStlAmount(item.getCurrentStlAmount());
+				item.setAppliedInvoiceCurrentStlAmount(item.getCurrentStlAmount());
+				item.setReconciliationCurrentAmount(item.getCurrentStlAmount());
+				item.setAppliedInvoiceCurrentAmount(item.getCurrentStlAmount());
+				/*BigDecimal amount = finAccBillsVO.getAppliedAmount().subtract(finAccBillsVO.getAppliedAmountStl());
+				item.setAppliedCurrentStlAmount(finAccBillsVO.getAmount().subtract(amount).subtract(finAccBillsVO.getStlTtlAmount()));
+				item.setAppliedInvoiceCurrentStlAmount(finAccBillsVO.getAmount().subtract(finAccBillsVO.getStlTtlAmount()));
+//				item.setCurrentStlAmount(item.getAmount().subtract(finAccBillsVO.getStlTtlAmount()));
+				item.setReconciliationCurrentAmount(finAccBillsVO.getAmount().subtract(finAccBillsVO.getReconciliationAmount()));
 				BigDecimal invoice = finAccBillsVO.getAppliedInvoiceAmount().subtract(finAccBillsVO.getAppliedInvoiceAmountStl());
-				item.setAppliedInvoiceCurrentAmount(finAccBillsVO.getAmount().subtract(invoice).subtract(finAccBillsVO.getUninvoicedAmount()));
+				item.setAppliedInvoiceCurrentAmount(finAccBillsVO.getAmount().subtract(invoice).subtract(finAccBillsVO.getUninvoicedAmount()));*/
 			} else {
 				item.setAppliedAmount(new BigDecimal("0.00"));
 				item.setAppliedInvoiceAmount(new BigDecimal("0.00"));