1、防水涂料应收计算修改

This commit is contained in:
llllon 2025-10-29 10:30:23 +08:00
parent 80ab462118
commit 3d4f40566a

View File

@ -88,13 +88,14 @@ public class WaterproofPaintAccountsReceivableJob implements IJob {
// 获取所有销售组织-客户组合 // 获取所有销售组织-客户组合
String bkgs = section.getBkgs(); String bkgs = section.getBkgs();
String sql = "SELECT QYGS, FCUSTNAME,SQ AS FPROVINCE, CS AS FCITY, QY AS FDISTRICT, XSZZ " + String sql = "SELECT QYGS, FCUSTNAME,SQ AS FPROVINCE, CS AS FCITY, QY AS FDISTRICT, XSZZ " +
" FROM " + section.getYsdTable() + " WHERE QYGS IS NOT NULL AND FCUSTNAME IS NOT NULL GROUP BY FCUSTNAME,XSZZ"; " FROM " + section.getYsdTable() + " WHERE FCUSTNAME IS NOT NULL";
if (bkgs.equals("北新防水")){ // if (bkgs.equals("北新防水")){
sql += " AND XSZZ !='北新防水工程(辽宁)有限公司' " + // sql += " AND XSZZ !='北新防水工程(辽宁)有限公司' " +
"AND XSZZ != '北新防水工程(四川)有限公司' AND F_SFNBJY ='否'"; // "AND XSZZ != '北新防水工程(四川)有限公司' AND F_SFNBJY ='否'";
}else { // }else {
sql += " AND F_SFNBJY ='否'"; // sql += " AND F_SFNBJY ='否'";
} // }
sql += " GROUP BY FCUSTNAME,XSZZ";
List<RowMap> customerMaps = DBSql.getMaps(sql); List<RowMap> customerMaps = DBSql.getMaps(sql);
// List<RowMap> customerMaps = new ArrayList<>(); // List<RowMap> customerMaps = new ArrayList<>();
// HashMap<String, Object> hashMap = new HashMap<>(); // HashMap<String, Object> hashMap = new HashMap<>();
@ -367,7 +368,8 @@ public class WaterproofPaintAccountsReceivableJob implements IJob {
" AND (" + dateCondition + ") "; " AND (" + dateCondition + ") ";
if (section.getBkgs().equals("北新防水")){ if (section.getBkgs().equals("北新防水")){
sql += " AND FSALEORGUNIT !='北新防水工程(辽宁)有限公司' " + sql += " AND FSALEORGUNIT !='北新防水工程(辽宁)有限公司' " +
"AND FSALEORGUNIT != '北新防水工程(四川)有限公司' AND F_SFNBJY ='否'"; " AND FSALEORGUNIT != '北新防水工程(四川)有限公司' AND F_SFNBJY ='否'" +
" AND FBILLTYPENAME IN ('价差销售收款单','销售收款单')";
}else { }else {
sql += " AND F_SFNBJY ='否'"; sql += " AND F_SFNBJY ='否'";
} }
@ -559,17 +561,24 @@ public class WaterproofPaintAccountsReceivableJob implements IJob {
String dateKey = current.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); String dateKey = current.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
String fullKey = keyPrefix + dateKey; String fullKey = keyPrefix + dateKey;
if (ysData != null) { if (ysData != null && skData != null && sktkData != null) {
result = result.add(ysData.getOrDefault(fullKey, BigDecimal.ZERO));
result = result.subtract(skData.getOrDefault(fullKey, BigDecimal.ZERO));
result = result.add(sktkData.getOrDefault(fullKey, BigDecimal.ZERO));
}
if (ysData != null && skData == null && sktkData == null) {
result = result.add(ysData.getOrDefault(fullKey, BigDecimal.ZERO)); result = result.add(ysData.getOrDefault(fullKey, BigDecimal.ZERO));
} }
if (skData != null) { if (ysData == null && skData != null && sktkData != null) {
result = result.subtract(skData.getOrDefault(fullKey, BigDecimal.ZERO)); result = result.add(skData.getOrDefault(fullKey, BigDecimal.ZERO));
result = result.subtract(sktkData.getOrDefault(fullKey, BigDecimal.ZERO));
} }
if (sktkData != null) { // if (sktkData != null) {
result = result.add(sktkData.getOrDefault(fullKey, BigDecimal.ZERO)); // result = result.subtract(sktkData.getOrDefault(fullKey, BigDecimal.ZERO));
} // }
current = current.plusDays(1); current = current.plusDays(1);
} }