1、物料分析计算处理
This commit is contained in:
parent
8a7b6ce38c
commit
2fdde8355b
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -443,7 +443,7 @@ public class DataLinkUpController {
|
||||
.addQuery("BINDID =", bindId)
|
||||
.list();
|
||||
//获取板块公司
|
||||
List<RowMap> maps = DBSql.getMaps("SELECT BKGS FROM " + targetTable + "GROUP BY BKGS");
|
||||
List<RowMap> maps = DBSql.getMaps("SELECT BKGS FROM " + targetTable + " GROUP BY BKGS");
|
||||
String bkgss = maps.stream().map(o -> o.getString("BKGS")).collect(Collectors.joining(","));
|
||||
String[] bkgsArr = bkgss.split(",");
|
||||
|
||||
|
||||
@ -106,8 +106,8 @@ public class WaterproofPaintAccountsReceivableJob implements IJob {
|
||||
// RDSAPI rdsapi = SDK.getCCAPI().getRDSAPI(RDS_ID);
|
||||
|
||||
// 查询销售组织和客户分组信息
|
||||
List<RowMap> maps = DBSql.getMaps("SELECT FMANAGEREGIONNAME, FCUSTNAME, FPROVINCE,FCITY FROM " +
|
||||
section.getYsdTable() + " GROUP BY FMANAGEREGIONNAME, FCUSTNAME, FPROVINCE,FCITY");
|
||||
List<RowMap> maps = DBSql.getMaps("SELECT QYGS, FCUSTNAME, SQ AS FPROVINCE,CS AS FCITY FROM " +
|
||||
section.getYsdTable() + " GROUP BY QYGS, FCUSTNAME, SQ,CS");
|
||||
|
||||
|
||||
if (maps == null || maps.isEmpty()) {
|
||||
@ -128,8 +128,8 @@ public class WaterproofPaintAccountsReceivableJob implements IJob {
|
||||
// 遍历每个销售组织-客户组合
|
||||
for (RowMap row : maps) {
|
||||
try {
|
||||
String manageRegionName = row.getString("FMANAGEREGIONNAME");
|
||||
String saleOrgUnit = row.getString("FSALEORGUNIT");
|
||||
String manageRegionName = row.getString("QYGS");
|
||||
String saleOrgUnit = row.getString("XSZZ");
|
||||
String custName = row.getString("FCUSTNAME");
|
||||
|
||||
// 查询省市区信息
|
||||
@ -214,8 +214,8 @@ public class WaterproofPaintAccountsReceivableJob implements IJob {
|
||||
try {
|
||||
// 查询应收单总额
|
||||
RowMap ysResult = DBSql.getMap(
|
||||
"SELECT SUM(FSALEAMOUNTRMB) as total FROM " + section.getYsdTable() +
|
||||
" WHERE FSALEORGUNIT = ? AND FCUSTNAME = ? AND FBILLDATE BETWEEN ? AND ?",
|
||||
"SELECT SUM(SSJERMB) as total FROM " + section.getYsdTable() +
|
||||
" WHERE XSZZ = ? AND FCUSTNAME = ? AND DZRQ BETWEEN ? AND ?",
|
||||
saleOrgUnit, custName, java.sql.Date.valueOf(startDate), java.sql.Date.valueOf(endDate)
|
||||
);
|
||||
|
||||
@ -258,8 +258,8 @@ public class WaterproofPaintAccountsReceivableJob implements IJob {
|
||||
LocalDate startDate, LocalDate endDate) {
|
||||
try {
|
||||
RowMap result = DBSql.getMap(
|
||||
"SELECT SUM(FSALEAMOUNTRMB) as total FROM " + section.getYsdTable() +
|
||||
" WHERE FSALEORGUNIT = ? AND FCUSTNAME = ? AND FBILLDATE BETWEEN ? AND ?",
|
||||
"SELECT SUM(SSJERMB) as total FROM " + section.getYsdTable() +
|
||||
" WHERE XSZZ = ? AND FCUSTNAME = ? AND DZRQ BETWEEN ? AND ?",
|
||||
saleOrgUnit, custName, java.sql.Date.valueOf(startDate), java.sql.Date.valueOf(endDate)
|
||||
);
|
||||
|
||||
|
||||
@ -12,6 +12,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -266,45 +267,27 @@ public class PurchaseDataSummaryServiceImpl implements DataSummaryService {
|
||||
// "FROM " + PROCUREMENT_PURCHASE_ORDER_SUMMARY +
|
||||
// " WHERE BKGS = ? AND CGRQ LIKE ? " +
|
||||
// "GROUP BY WLMC, XQGC";
|
||||
String currentMonthSql = "";
|
||||
String field = "";
|
||||
if ("泰山石膏".equals(bkgs)) {
|
||||
currentMonthSql = "SELECT WLMC, SLGC, SUM(DHJE) AS totalAmount, SUM(RKSL) AS totalQuantity " +
|
||||
"FROM " + BO_EU_DWD_ORDER_RKD_HZ +
|
||||
" WHERE BKGS = ? AND DJRQ LIKE ? " +
|
||||
"GROUP BY WLMC, SLGC";
|
||||
field = " SUM(DHJE) ";
|
||||
}else {
|
||||
currentMonthSql = "SELECT WLMC, SLGC, SUM(JSHJHYF) AS totalAmount, SUM(RKSL) AS totalQuantity " +
|
||||
field = " SUM(JSHJHYF) ";
|
||||
}
|
||||
String currentMonthSql = "SELECT WLMC, SLGC, "+field+" AS totalAmount, SUM(RKSL) AS totalQuantity " +
|
||||
"FROM " + BO_EU_DWD_ORDER_RKD_HZ +
|
||||
" WHERE BKGS = ? AND DJRQ LIKE ? " +
|
||||
"GROUP BY WLMC, SLGC";
|
||||
}
|
||||
List<RowMap> currentMonthData = DBSql.getMaps(currentMonthSql, bkgs, yearMonth + "%");
|
||||
|
||||
// 上月数据
|
||||
List<RowMap> lastMonthData = Collections.emptyList();
|
||||
if (StringUtils.isNotBlank(yearLastMonth)) {
|
||||
// String lastMonthSql = "SELECT WLMC, XQGC, SUM(JSHJ) AS totalAmount, SUM(YSSL) AS totalQuantity " +
|
||||
// "FROM " + PROCUREMENT_PURCHASE_ORDER_SUMMARY +
|
||||
// " WHERE BKGS = ? AND CGRQ LIKE ? " +
|
||||
// "GROUP BY WLMC, XQGC";
|
||||
// String lastMonthSql = "SELECT WLMC, SLGC, SUM(JSHJHYF) AS totalAmount, SUM(RKSL) AS totalQuantity " +
|
||||
// "FROM " + BO_EU_DWD_ORDER_RKD_HZ +
|
||||
// " WHERE BKGS = ? AND DJRQ LIKE ? " +
|
||||
// "GROUP BY WLMC, SLGC";
|
||||
lastMonthData = DBSql.getMaps(currentMonthSql, bkgs, yearLastMonth + "%");
|
||||
}
|
||||
|
||||
// 去年同期数据
|
||||
List<RowMap> lastYearMonthData = Collections.emptyList();
|
||||
if (StringUtils.isNotBlank(lastYearMonth)) {
|
||||
// String lastYearMonthSql = "SELECT WLMC, XQGC, SUM(JSHJ) AS totalAmount, SUM(YSSL) AS totalQuantity " +
|
||||
// "FROM " + PROCUREMENT_PURCHASE_ORDER_SUMMARY +
|
||||
// " WHERE BKGS = ? AND CGRQ LIKE ? " +
|
||||
// "GROUP BY WLMC, XQGC";
|
||||
// String lastYearMonthSql = "SELECT WLMC, SLGC, SUM(JSHJHYF) AS totalAmount, SUM(RKSL) AS totalQuantity " +
|
||||
// " FROM " + BO_EU_DWD_ORDER_RKD_HZ +
|
||||
// " WHERE BKGS = ? AND DJRQ LIKE ? " +
|
||||
// " GROUP BY WLMC, SLGC";
|
||||
lastYearMonthData = DBSql.getMaps(currentMonthSql, bkgs, lastYearMonth + "%");
|
||||
}
|
||||
|
||||
@ -379,36 +362,50 @@ public class PurchaseDataSummaryServiceImpl implements DataSummaryService {
|
||||
));
|
||||
|
||||
// 4. 获取所有基地
|
||||
Set<String> bases = new HashSet<>();
|
||||
for (RowMap row : currentMonthData) {
|
||||
bases.add(row.getString("SLGC"));
|
||||
}
|
||||
// Set<String> bases = new HashSet<>();
|
||||
// for (RowMap row : currentMonthData) {
|
||||
// bases.add(row.getString("SLGC"));
|
||||
// }
|
||||
|
||||
// 5. 批量插入
|
||||
List<BO> bos = new ArrayList<>();
|
||||
for (String wlmc : distinctList) {
|
||||
for (String base : bases) {
|
||||
for (RowMap currentMonthRow : currentMonthData) {
|
||||
String base = currentMonthRow.getString("SLGC");
|
||||
String wlmc = currentMonthRow.getString("WLMC");
|
||||
String key = wlmc + "|" + base;
|
||||
RowMap currentMonthRow = currentMonthMap.get(key);
|
||||
if (currentMonthRow == null || currentMonthRow.getDouble("totalAmount") == 0.0) continue;
|
||||
|
||||
double avgPrice = 0.00;
|
||||
BO summaryBO = new BO();
|
||||
summaryBO.set("BKGS", bkgs);
|
||||
summaryBO.set("JD", base);
|
||||
summaryBO.set("WLMC",wlmc);
|
||||
if (wlmc.equals("乳液") || wlmc.equals("钛白粉") || wlmc.equals("重钙")){
|
||||
summaryBO.set("CGZE", currentMonthRow.getDouble("totalAmount")/1000);
|
||||
avgPrice = currentMonthRow.getDouble("totalQuantity") != 0 ?
|
||||
(currentMonthRow.getDouble("totalAmount")/1000) / currentMonthRow.getDouble("totalQuantity") : 0;
|
||||
double totalQuantity = BigDecimal.valueOf(currentMonthRow.getDouble("totalQuantity"))
|
||||
.divide(BigDecimal.valueOf(1000), 4, BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||
double totalAmount = currentMonthRow.getDouble("totalAmount");
|
||||
|
||||
summaryBO.set("CGZL", totalQuantity);
|
||||
// 添加除数非零检查
|
||||
if (totalAmount != 0 && totalQuantity != 0) {
|
||||
avgPrice = BigDecimal.valueOf(totalAmount)
|
||||
.divide(BigDecimal.valueOf(totalQuantity), 2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||
} else {
|
||||
avgPrice = 0;
|
||||
}
|
||||
}else {
|
||||
summaryBO.set("CGZE", currentMonthRow.getDouble("totalAmount"));
|
||||
avgPrice = currentMonthRow.getDouble("totalQuantity") != 0 ?
|
||||
currentMonthRow.getDouble("totalAmount") / currentMonthRow.getDouble("totalQuantity") : 0;
|
||||
double totalQuantity = currentMonthRow.getDouble("totalQuantity");
|
||||
double totalAmount = currentMonthRow.getDouble("totalAmount");
|
||||
|
||||
summaryBO.set("CGZL", totalQuantity);
|
||||
// 添加除数非零检查
|
||||
if (totalAmount != 0 && totalQuantity != 0) {
|
||||
avgPrice = BigDecimal.valueOf(totalAmount)
|
||||
.divide(BigDecimal.valueOf(totalQuantity), 2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||
} else {
|
||||
avgPrice = 0;
|
||||
}
|
||||
}
|
||||
summaryBO.set("YEARMONTH", yearMonth);
|
||||
summaryBO.set("CGZE", currentMonthRow.getDouble("totalAmount"));
|
||||
summaryBO.set("CGZL", currentMonthRow.getDouble("totalQuantity"));
|
||||
|
||||
summaryBO.set("PJDJ", avgPrice);
|
||||
|
||||
// 添加上月数据
|
||||
@ -416,15 +413,32 @@ public class PurchaseDataSummaryServiceImpl implements DataSummaryService {
|
||||
if (lastMonthRow != null) {
|
||||
double lastMonthAvgPrice = 0.00;
|
||||
if (wlmc.equals("乳液") || wlmc.equals("钛白粉") || wlmc.equals("重钙")){
|
||||
summaryBO.set("SQCGZE", lastMonthRow.getDouble("totalAmount")/1000);
|
||||
lastMonthAvgPrice = lastMonthRow.getDouble("totalQuantity") != 0 ?
|
||||
(lastMonthRow.getDouble("totalAmount")/1000) / lastMonthRow.getDouble("totalQuantity") : 0;
|
||||
}else {
|
||||
summaryBO.set("SQCGZE", lastMonthRow.getDouble("totalAmount"));
|
||||
lastMonthAvgPrice = lastMonthRow.getDouble("totalQuantity") != 0 ?
|
||||
lastMonthRow.getDouble("totalAmount") / lastMonthRow.getDouble("totalQuantity") : 0;
|
||||
double totalQuantity = BigDecimal.valueOf(lastMonthRow.getDouble("totalQuantity"))
|
||||
.divide(BigDecimal.valueOf(1000), 2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||
double totalAmount = lastMonthRow.getDouble("totalAmount");
|
||||
|
||||
summaryBO.set("SQCGZL", totalQuantity);
|
||||
// 添加除数非零检查
|
||||
if (totalAmount != 0 && totalQuantity != 0) {
|
||||
lastMonthAvgPrice = BigDecimal.valueOf(totalAmount)
|
||||
.divide(BigDecimal.valueOf(totalQuantity), 2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||
} else {
|
||||
lastMonthAvgPrice = 0;
|
||||
}
|
||||
summaryBO.set("SQCGZL", lastMonthRow.getDouble("totalQuantity"));
|
||||
}else {
|
||||
double totalQuantity = lastMonthRow.getDouble("totalQuantity");
|
||||
double totalAmount = lastMonthRow.getDouble("totalAmount");
|
||||
|
||||
summaryBO.set("SQCGZL", totalQuantity);
|
||||
// 添加除数非零检查
|
||||
if (totalAmount != 0 && totalQuantity != 0) {
|
||||
lastMonthAvgPrice = BigDecimal.valueOf(totalAmount)
|
||||
.divide(BigDecimal.valueOf(totalQuantity), 2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||
} else {
|
||||
lastMonthAvgPrice = 0;
|
||||
}
|
||||
}
|
||||
summaryBO.set("SQCGZE", lastMonthRow.getDouble("totalAmount"));
|
||||
summaryBO.set("SQPJDJ", lastMonthAvgPrice);
|
||||
}
|
||||
|
||||
@ -433,22 +447,36 @@ public class PurchaseDataSummaryServiceImpl implements DataSummaryService {
|
||||
if (lastYearMonthRow != null) {
|
||||
double lastYearMonthAvgPrice = 0.00;
|
||||
if (wlmc.equals("乳液") || wlmc.equals("钛白粉") || wlmc.equals("重钙")){
|
||||
summaryBO.set("TQCGZE", lastYearMonthRow.getDouble("totalAmount")/1000);
|
||||
lastYearMonthAvgPrice = lastYearMonthRow.getDouble("totalQuantity") != 0 ?
|
||||
(lastYearMonthRow.getDouble("totalAmount")/1000) / lastYearMonthRow.getDouble("totalQuantity") : 0;
|
||||
}else {
|
||||
summaryBO.set("TQCGZL", lastYearMonthRow.getDouble("totalQuantity"));
|
||||
lastYearMonthAvgPrice = lastYearMonthRow.getDouble("totalQuantity") != 0 ?
|
||||
lastYearMonthRow.getDouble("totalAmount") / lastYearMonthRow.getDouble("totalQuantity") : 0;
|
||||
}
|
||||
double totalQuantity = BigDecimal.valueOf(lastYearMonthRow.getDouble("totalQuantity"))
|
||||
.divide(BigDecimal.valueOf(1000), 2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||
double totalAmount = lastYearMonthRow.getDouble("totalAmount");
|
||||
|
||||
summaryBO.set("TQCGZL", totalQuantity);
|
||||
// 添加除数非零检查
|
||||
if (totalAmount != 0 && totalQuantity != 0) {
|
||||
lastYearMonthAvgPrice = BigDecimal.valueOf(totalAmount)
|
||||
.divide(BigDecimal.valueOf(totalQuantity), 2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||
} else {
|
||||
lastYearMonthAvgPrice = 0;
|
||||
}
|
||||
}else {
|
||||
double totalQuantity = lastYearMonthRow.getDouble("totalQuantity");
|
||||
double totalAmount = lastYearMonthRow.getDouble("totalAmount");
|
||||
|
||||
summaryBO.set("TQCGZL", totalQuantity);
|
||||
// 添加除数非零检查
|
||||
if (totalAmount != 0 && totalQuantity != 0) {
|
||||
lastYearMonthAvgPrice = BigDecimal.valueOf(totalAmount)
|
||||
.divide(BigDecimal.valueOf(totalQuantity), 2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||
} else {
|
||||
lastYearMonthAvgPrice = 0;
|
||||
}
|
||||
}
|
||||
summaryBO.set("TQCGZE",lastYearMonthRow.getDouble("totalAmount"));
|
||||
summaryBO.set("TQPJDJ", lastYearMonthAvgPrice);
|
||||
}
|
||||
|
||||
bos.add(summaryBO);
|
||||
}
|
||||
}
|
||||
|
||||
if (!bos.isEmpty()) {
|
||||
// 批量插入数据
|
||||
int batchSize = 1000;
|
||||
@ -458,7 +486,6 @@ public class PurchaseDataSummaryServiceImpl implements DataSummaryService {
|
||||
SDK.getBOAPI().createDataBO(JD_PROCUREMENT_DETAILS_YEAR_MONTH, batch, UserContext.fromUID("admin"));
|
||||
}
|
||||
}
|
||||
|
||||
LOGGER.info("成功保存{}条月度基地汇总数据,板块:{}", bos.size(), bkgs);
|
||||
|
||||
} catch (Exception e) {
|
||||
@ -492,61 +519,27 @@ public class PurchaseDataSummaryServiceImpl implements DataSummaryService {
|
||||
// "FROM " + PROCUREMENT_PURCHASE_ORDER_SUMMARY +
|
||||
// " WHERE BKGS = ? AND CGRQ LIKE ? " +
|
||||
// "GROUP BY WLMC";
|
||||
String currentMonthSql = "";
|
||||
String field = "";
|
||||
if ("泰山石膏".equals(bkgs)) {
|
||||
currentMonthSql = "SELECT WLMC, SUM(DHJE) AS totalAmount, SUM(RKSL) AS totalQuantity " +
|
||||
" FROM " + BO_EU_DWD_ORDER_RKD_HZ +
|
||||
" WHERE BKGS = ? AND DJRQ LIKE ? " +
|
||||
" GROUP BY WLMC";
|
||||
field = " SUM(DHJE) ";
|
||||
}else {
|
||||
currentMonthSql = "SELECT WLMC, SUM(JSHJHYF) AS totalAmount, SUM(RKSL) AS totalQuantity " +
|
||||
field = " SUM(JSHJHYF) ";
|
||||
}
|
||||
String currentMonthSql = "SELECT WLMC, "+field+" AS totalAmount, SUM(RKSL) AS totalQuantity " +
|
||||
" FROM " + BO_EU_DWD_ORDER_RKD_HZ +
|
||||
" WHERE BKGS = ? AND DJRQ LIKE ? " +
|
||||
" GROUP BY WLMC";
|
||||
}
|
||||
List<RowMap> currentMonthData = DBSql.getMaps(currentMonthSql, bkgs, yearMonth + "%");
|
||||
|
||||
// 上月数据
|
||||
List<RowMap> lastMonthData = Collections.emptyList();
|
||||
if (StringUtils.isNotBlank(yearLastMonth)) {
|
||||
// String lastMonthSql = "SELECT WLMC, SUM(JSHJ) AS totalAmount, SUM(YSSL) AS totalQuantity " +
|
||||
// "FROM " + PROCUREMENT_PURCHASE_ORDER_SUMMARY +
|
||||
// " WHERE BKGS = ? AND CGRQ LIKE ? " +
|
||||
// "GROUP BY WLMC";
|
||||
// String lastMonthSql = "";
|
||||
// if ("泰山石膏".equals(bkgs)) {
|
||||
// lastMonthSql = "SELECT WLMC, SUM(DHJE) AS totalAmount, SUM(RKSL) AS totalQuantity " +
|
||||
// " FROM " + BO_EU_DWD_ORDER_RKD_HZ +
|
||||
// " WHERE BKGS = ? AND DJRQ LIKE ? " +
|
||||
// " GROUP BY WLMC";
|
||||
// }else {
|
||||
// lastMonthSql = "SELECT WLMC, SUM(JSHJHYF) AS totalAmount, SUM(RKSL) AS totalQuantity " +
|
||||
// " FROM " + BO_EU_DWD_ORDER_RKD_HZ +
|
||||
// " WHERE BKGS = ? AND DJRQ LIKE ? " +
|
||||
// " GROUP BY WLMC";
|
||||
// }
|
||||
lastMonthData = DBSql.getMaps(currentMonthSql, bkgs, yearLastMonth + "%");
|
||||
}
|
||||
|
||||
// 去年同期数据
|
||||
List<RowMap> lastYearMonthData = Collections.emptyList();
|
||||
if (StringUtils.isNotBlank(lastYearMonth)) {
|
||||
// String lastYearMonthSql = "SELECT WLMC, SUM(JSHJ) AS totalAmount, SUM(YSSL) AS totalQuantity " +
|
||||
// "FROM " + PROCUREMENT_PURCHASE_ORDER_SUMMARY +
|
||||
// " WHERE BKGS = ? AND CGRQ LIKE ? " +
|
||||
// "GROUP BY WLMC";
|
||||
// String lastYearMonthSql = "";
|
||||
// if ("泰山石膏".equals(bkgs)) {
|
||||
// lastYearMonthSql = "SELECT WLMC, SUM(DHJE) AS totalAmount, SUM(RKSL) AS totalQuantity " +
|
||||
// " FROM " + BO_EU_DWD_ORDER_RKD_HZ +
|
||||
// " WHERE BKGS = ? AND DJRQ LIKE ? " +
|
||||
// " GROUP BY WLMC";
|
||||
// }else {
|
||||
// lastYearMonthSql = "SELECT WLMC, SUM(JSHJHYF) AS totalAmount, SUM(RKSL) AS totalQuantity " +
|
||||
// " FROM " + BO_EU_DWD_ORDER_RKD_HZ +
|
||||
// " WHERE BKGS = ? AND DJRQ LIKE ? " +
|
||||
// " GROUP BY WLMC";
|
||||
// }
|
||||
lastYearMonthData = DBSql.getMaps(currentMonthSql, bkgs, lastYearMonth + "%");
|
||||
}
|
||||
|
||||
@ -618,37 +611,51 @@ public class PurchaseDataSummaryServiceImpl implements DataSummaryService {
|
||||
summaryBO.set("YEARMONTH", yearMonth);
|
||||
summaryBO.set("WLMC", wlmc);
|
||||
if (wlmc.equals("乳液") || wlmc.equals("钛白粉") || wlmc.equals("重钙")){
|
||||
summaryBO.set("CGZE", currentMonthRow.getDouble("totalAmount")/1000);
|
||||
avgPrice = currentMonthRow.getDouble("totalQuantity") != 0 ?
|
||||
(currentMonthRow.getDouble("totalAmount")/1000) / currentMonthRow.getDouble("totalQuantity") : 0;
|
||||
double totalQuantity = currentMonthRow.getDouble("totalQuantity");
|
||||
double totalAmount = currentMonthRow.getDouble("totalAmount");
|
||||
summaryBO.set("CGZL", totalQuantity!=0?totalQuantity/1000:0);
|
||||
if (totalAmount!=0 || totalQuantity!=0) {
|
||||
avgPrice = totalAmount / (totalQuantity / 1000);
|
||||
}else {
|
||||
summaryBO.set("CGZE", currentMonthRow.getDouble("totalAmount"));
|
||||
avgPrice = currentMonthRow.getDouble("totalQuantity") != 0 ?
|
||||
currentMonthRow.getDouble("totalAmount") / currentMonthRow.getDouble("totalQuantity") : 0;
|
||||
avgPrice = 0;
|
||||
}
|
||||
summaryBO.set("CGZL", currentMonthRow.getDouble("totalQuantity"));
|
||||
}else {
|
||||
double totalQuantity = currentMonthRow.getDouble("totalQuantity");
|
||||
double totalAmount = currentMonthRow.getDouble("totalAmount");
|
||||
summaryBO.set("CGZL", totalQuantity);
|
||||
if (totalAmount!=0 || totalQuantity!=0) {
|
||||
avgPrice = totalAmount / totalQuantity;
|
||||
}else {
|
||||
avgPrice = 0;
|
||||
}
|
||||
}
|
||||
summaryBO.set("CGZE", currentMonthRow.getDouble("totalAmount"));
|
||||
summaryBO.set("PJDJ", avgPrice);
|
||||
|
||||
// 添加上月数据
|
||||
RowMap lastMonthRow = lastMonthMap.get(wlmc);
|
||||
if (lastMonthRow != null) {
|
||||
double totalQuantity = lastMonthRow.getDouble("totalQuantity");
|
||||
double totalAmount = lastMonthRow.getDouble("totalAmount");
|
||||
if (wlmc.equals("乳液") || wlmc.equals("钛白粉") || wlmc.equals("重钙")){
|
||||
summaryBO.set("SQCGZE", lastMonthRow.getDouble("totalAmount")/1000);
|
||||
summaryBO.set("SQCGZL", totalQuantity!=0?totalQuantity/1000:0);
|
||||
}else {
|
||||
summaryBO.set("SQCGZE", lastMonthRow.getDouble("totalAmount"));
|
||||
summaryBO.set("SQCGZL", totalQuantity);
|
||||
}
|
||||
summaryBO.set("SQCGZL", lastMonthRow.getDouble("totalQuantity"));
|
||||
summaryBO.set("SQCGZE", totalAmount);
|
||||
}
|
||||
|
||||
// 添加去年同期数据
|
||||
RowMap lastYearMonthRow = lastYearMonthMap.get(wlmc);
|
||||
if (lastYearMonthRow != null) {
|
||||
double totalQuantity = lastYearMonthRow.getDouble("totalQuantity");
|
||||
double totalAmount = lastYearMonthRow.getDouble("totalAmount");
|
||||
if (wlmc.equals("乳液") || wlmc.equals("钛白粉") || wlmc.equals("重钙")){
|
||||
summaryBO.set("TQCGZE", lastYearMonthRow.getDouble("totalAmount")/1000);
|
||||
summaryBO.set("TQCGZL", totalQuantity!=0?totalQuantity/1000:0);
|
||||
}else {
|
||||
summaryBO.set("TQCGZE", lastYearMonthRow.getDouble("totalAmount"));
|
||||
summaryBO.set("TQCGZL", totalQuantity);
|
||||
}
|
||||
summaryBO.set("TQCGZL", lastYearMonthRow.getDouble("totalQuantity"));
|
||||
summaryBO.set("TQCGZE", totalAmount);
|
||||
}
|
||||
|
||||
summaryBO.set("BKGS", bkgs);
|
||||
@ -701,18 +708,16 @@ public class PurchaseDataSummaryServiceImpl implements DataSummaryService {
|
||||
// "FROM " + PROCUREMENT_PURCHASE_ORDER_SUMMARY +
|
||||
// " WHERE BKGS = ? AND CGRQ = ? " +
|
||||
// "GROUP BY WLMC";
|
||||
String querySql = "";
|
||||
String field = "";
|
||||
if ("泰山石膏".equals(bkgs)) {
|
||||
querySql = "SELECT WLMC, SUM(DHJE) AS totalAmount, SUM(RKSL) AS totalQuantity " +
|
||||
"FROM " + BO_EU_DWD_ORDER_RKD_HZ +
|
||||
" WHERE BKGS = ? AND DJRQ = ? " +
|
||||
"GROUP BY WLMC";
|
||||
field = " SUM(DHJE) ";
|
||||
}else {
|
||||
querySql = "SELECT WLMC, SUM(JSHJHYF) AS totalAmount, SUM(RKSL) AS totalQuantity " +
|
||||
field = " SUM(JSHJHYF) ";
|
||||
}
|
||||
String querySql = "SELECT WLMC, "+field+" AS totalAmount, SUM(RKSL) AS totalQuantity " +
|
||||
"FROM " + BO_EU_DWD_ORDER_RKD_HZ +
|
||||
" WHERE BKGS = ? AND DJRQ = ? " +
|
||||
"GROUP BY WLMC";
|
||||
}
|
||||
List<RowMap> dailyData = DBSql.getMaps(querySql, bkgs, dateStr);
|
||||
|
||||
// 3. 创建物料数据映射
|
||||
@ -744,15 +749,15 @@ public class PurchaseDataSummaryServiceImpl implements DataSummaryService {
|
||||
summaryBO.set("RQ", dateStr);
|
||||
summaryBO.set("WLMC", wlmc);
|
||||
if (wlmc.equals("乳液") || wlmc.equals("钛白粉") || wlmc.equals("重钙")){
|
||||
summaryBO.set("CGZE", row.getDouble("totalAmount")/1000);
|
||||
avgPrice = row.getDouble("totalQuantity") != 0 ?
|
||||
(row.getDouble("totalAmount")/1000) / row.getDouble("totalQuantity") : 0;
|
||||
summaryBO.set("CGZL", row.getDouble("totalQuantity")/1000);
|
||||
avgPrice = row.getDouble("totalAmount") != 0 ?
|
||||
row.getDouble("totalAmount") / (row.getDouble("totalQuantity")/1000) : 0;
|
||||
}else {
|
||||
summaryBO.set("CGZE", row.getDouble("totalAmount"));
|
||||
avgPrice = row.getDouble("totalQuantity") != 0 ?
|
||||
summaryBO.set("CGZL", row.getDouble("totalQuantity"));
|
||||
avgPrice = row.getDouble("totalAmount") != 0 ?
|
||||
row.getDouble("totalAmount") / row.getDouble("totalQuantity") : 0;
|
||||
}
|
||||
summaryBO.set("CGZL", row.getDouble("totalQuantity"));
|
||||
summaryBO.set("CGZE", row.getDouble("totalAmount"));
|
||||
summaryBO.set("PJDJ", avgPrice);
|
||||
summaryBO.set("BKGS", bkgs);
|
||||
bos.add(summaryBO);
|
||||
@ -843,7 +848,7 @@ public class PurchaseDataSummaryServiceImpl implements DataSummaryService {
|
||||
detailBO.set("RKSL", row.getDouble("RKSL")); // 入库数量
|
||||
detailBO.set("DW", row.getString("JLDW")); // 单位
|
||||
if ("泰山石膏".equals(bkgs)) {
|
||||
detailBO.set("RKDJ", row.getDouble("DHJE")); // 入库单价(含税单价含运费)
|
||||
detailBO.set("RKDJ", row.getDouble("HSDJHYF")); // 入库单价(含税单价含运费)
|
||||
detailBO.set("RKJE", row.getDouble("DHJE")); // 入库金额(金额含运费)
|
||||
}else {
|
||||
detailBO.set("RKDJ", row.getDouble("HSDJHYF")); // 入库单价(含税单价含运费)
|
||||
|
||||
@ -755,17 +755,30 @@ public class PurchaseDataSyncServiceImpl implements DataSyncService {
|
||||
bo.set(key, map.get(key));
|
||||
}
|
||||
}
|
||||
// LOGGER.info("明细汇总:字段值set完毕-01");
|
||||
if (bo!=null) {
|
||||
// 如果是采购_入库单汇总 刷新物料名称
|
||||
if (hzb.equals("BO_EU_DWD_ORDER_RKD_HZ")){
|
||||
if (hzb.equals("BO_EU_DWD_ORDER_RKD_HZ")) {
|
||||
String bkgs = bo.getString("BKGS");
|
||||
String wlmc = bo.getString("WLMC");
|
||||
String wlbm = bo.getString("WLBM");
|
||||
String jldw = bo.getString("JLDW");
|
||||
String wlfl = bo.getString("WLFL");
|
||||
Double djhyf = Double.parseDouble(bo.getString("DJHYF"));
|
||||
String newWlmc = purchaseUtil.materialClassificationFiltering(bkgs, wlmc, wlbm, jldw, djhyf, wlfl);
|
||||
Double djhyfs = bo.get("DJHYF",Double.class);
|
||||
double djhyf = djhyfs != null ? djhyfs : 0.0;
|
||||
// LOGGER.info("采购_入库单汇总,刷新物料名称------物料名称:{},板块公司:{},物料编码:{},入库单位:{},单价:{},物料分类:{}", wlmc, bkgs, wlbm, jldw, djhyf, wlfl);
|
||||
|
||||
String newWlmc = "";
|
||||
if (StringUtils.isNotBlank(wlmc) || StringUtils.isNotBlank(wlbm)
|
||||
|| StringUtils.isNotBlank(jldw)
|
||||
|| StringUtils.isNotBlank(wlfl)) {
|
||||
try {
|
||||
newWlmc = purchaseUtil.materialClassificationFiltering(bkgs, wlmc, wlbm, jldw, djhyf, wlfl);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (bkgs.equals("北新嘉宝莉")) {
|
||||
if (wlmc.contains("盖") && djhyf < 5.0){
|
||||
if (wlmc.contains("盖") && djhyf < 5.0) {
|
||||
continue;
|
||||
} else if (wlmc.contains("桶身") && gaiSum > 0) {
|
||||
Double djhyf1 = bo.get("DJHYF", Double.class);
|
||||
@ -773,20 +786,30 @@ public class PurchaseDataSyncServiceImpl implements DataSyncService {
|
||||
gaiSum--;
|
||||
}
|
||||
}
|
||||
bo.set("WLMC",newWlmc);
|
||||
bo.set("OLDWLMC",wlmc);
|
||||
// LOGGER.info("采购_入库单汇总,刷新物料名称------物料名称:{},板块公司:{},物料编码:{},入库单位:{},单价:{},物料分类:{}",wlmc,bkgs,wlbm,jldw,djhyf,wlfl);
|
||||
bo.set("WLMC", newWlmc);
|
||||
bo.set("OLDWLMC", wlmc);
|
||||
// LOGGER.info("明细汇总:物料分类更新完毕-02");
|
||||
} else {
|
||||
// LOGGER.info("明细汇总:物料名称为空不进行汇总-03");
|
||||
}
|
||||
// LOGGER.info("采购_入库单汇总,刷新物料名称------物料名称:{},板块公司:{},物料编码:{},入库单位:{},单价:{},物料分类:{}", wlmc, bkgs, wlbm, jldw, djhyf, wlfl);
|
||||
|
||||
if ("泰山石膏".equals(bkgs)){
|
||||
if ("泰山石膏".equals(bkgs)) {
|
||||
// 泰山石膏处理入库单金额 入库数量*含税单价
|
||||
Double rksl = bo.get("RKSL", Double.class);// 入库数量
|
||||
Double hsdjhyf = bo.get("HSDJHYF", Double.class);// 含税单价(含运费)
|
||||
BigDecimal multiply = BigDecimal.valueOf(rksl).multiply(BigDecimal.valueOf(hsdjhyf));
|
||||
bo.set("DHJE",multiply.doubleValue());
|
||||
// 处理可能为null的值,默认设为0.0
|
||||
double safeRksl = rksl != null ? rksl : 0.0;
|
||||
double safeHsdjhyf = hsdjhyf != null ? hsdjhyf : 0.0;
|
||||
|
||||
BigDecimal multiply = BigDecimal.valueOf(safeRksl).multiply(BigDecimal.valueOf(safeHsdjhyf));
|
||||
bo.set("DHJE", multiply.doubleValue());
|
||||
}
|
||||
}
|
||||
|
||||
bos.add(bo);
|
||||
// LOGGER.info("明细汇总:bo add完毕-04");
|
||||
}
|
||||
}
|
||||
|
||||
SDK.getBOAPI().createDataBO(hzb, bos, UserContext.fromUID("admin"));
|
||||
@ -799,6 +822,7 @@ public class PurchaseDataSyncServiceImpl implements DataSyncService {
|
||||
}catch (Exception e){
|
||||
LOGGER.error("汇总数据失败 [汇总表={}, 第几页={}]: {}",
|
||||
hzb, PAGE_SIZE, e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import com.actionsoft.bpms.bo.engine.BO;
|
||||
import com.actionsoft.bpms.commons.database.RowMap;
|
||||
import com.actionsoft.bpms.server.UserContext;
|
||||
import com.actionsoft.bpms.util.DBSql;
|
||||
import com.actionsoft.bpms.util.UtilDate;
|
||||
import com.actionsoft.sdk.local.SDK;
|
||||
import com.awspaas.user.apps.bnbm.datalinkup.entity.DateRange;
|
||||
import com.awspaas.user.apps.bnbm.datalinkup.service.DataSummaryService;
|
||||
@ -15,6 +16,7 @@ import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.sql.Timestamp;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
@ -373,22 +375,20 @@ public class SaleDataSummaryServiceImpl implements DataSummaryService {
|
||||
int lastYear = year - 1;
|
||||
int lastYearMonth = month; // 去年同月
|
||||
|
||||
// 获取板骨应收账款数据 - 当年1月到当前月
|
||||
BigDecimal boneTotal = getReceivableToMonth(year, month, bkgs);
|
||||
// 获取板块应收账款数据 - 当前月最新一天数据
|
||||
RowMap bkgsYsRowMap = getReceivableToMonth(year, month, bkgs);
|
||||
double qcye = bkgsYsRowMap.getDouble("QCYE");
|
||||
double ljxs = bkgsYsRowMap.getDouble("LJXS");
|
||||
double ljhk = bkgsYsRowMap.getDouble("LJHK");
|
||||
double receivable = bkgsYsRowMap.getDouble("receivable");
|
||||
// 获取去年同期的板骨应收账款数据 - 去年1月到去年同月
|
||||
BigDecimal boneLastYearTotal = getReceivableToMonth(lastYear, lastYearMonth, bkgs);
|
||||
BigDecimal boneYoy = calculateYoy(boneTotal, boneLastYearTotal);
|
||||
RowMap bkgsYsLastYearRowMap = getReceivableToMonth(lastYear, lastYearMonth, bkgs);
|
||||
double receivableLastYear = bkgsYsLastYearRowMap.getDouble("receivable");
|
||||
BigDecimal boneYoy = calculateYoy(BigDecimal.valueOf(receivable), BigDecimal.valueOf(receivableLastYear));//同比
|
||||
|
||||
// 获取涂料应收账款数据 - 当年1月到当前月
|
||||
BigDecimal paintTotal = getReceivableToMonth(year, month, bkgs);
|
||||
// 获取去年同期的涂料应收账款数据 - 去年1月到去年同月
|
||||
BigDecimal paintLastYearTotal = getReceivableToMonth(lastYear, lastYearMonth, bkgs);
|
||||
BigDecimal paintYoy = calculateYoy(paintTotal, paintLastYearTotal);
|
||||
|
||||
// 保存板骨数据
|
||||
saveReceivableYearData(yearMonth, boneTotal, boneYoy, bkgs);
|
||||
// 保存涂料数据
|
||||
saveReceivableYearData(yearMonth, paintTotal, paintYoy, bkgs);
|
||||
// 保存板块数据
|
||||
saveReceivableYearData(yearMonth, BigDecimal.valueOf(qcye), BigDecimal.valueOf(ljxs),
|
||||
BigDecimal.valueOf(ljhk), BigDecimal.valueOf(receivable), boneYoy, bkgs);
|
||||
|
||||
LOGGER.info("应收账款月度累计数据保存成功");
|
||||
} catch (Exception e) {
|
||||
@ -401,10 +401,14 @@ public class SaleDataSummaryServiceImpl implements DataSummaryService {
|
||||
/**
|
||||
* 保存应收账款月度累计数据
|
||||
*/
|
||||
private void saveReceivableYearData(String yearMonth, BigDecimal total, BigDecimal yoy, String bkgs) {
|
||||
private void saveReceivableYearData(String yearMonth,BigDecimal qcye, BigDecimal ljxs, BigDecimal ljhk,
|
||||
BigDecimal total, BigDecimal yoy, String bkgs) {
|
||||
BO receivableBO = createBaseBO(bkgs);
|
||||
receivableBO.set("YEARMONTH", yearMonth);
|
||||
// receivableBO.set("RECEIVABLE_TYPE", type);
|
||||
receivableBO.set("OPENING_BALANCE",qcye.setScale(2, RoundingMode.HALF_UP));
|
||||
receivableBO.set("CUMULATIVE_SALES",ljxs.setScale(2, RoundingMode.HALF_UP));
|
||||
receivableBO.set("CUMULATIVE_REPAYMENT",ljhk.setScale(2, RoundingMode.HALF_UP));
|
||||
receivableBO.set("ENDING_BALANCE", total.setScale(2, RoundingMode.HALF_UP)); // 期末余额
|
||||
receivableBO.set("YOY_RATE", yoy.setScale(2, RoundingMode.HALF_UP));
|
||||
saveSummaryData(receivableBO, RECEIVABLE_YEAR_TABLE);
|
||||
@ -630,14 +634,16 @@ public class SaleDataSummaryServiceImpl implements DataSummaryService {
|
||||
* 获取应收账款从1月到指定月份的累计值
|
||||
* 公式:期初余额 + 累计销售 - 累计回款
|
||||
*/
|
||||
private BigDecimal getReceivableToMonth(int year, int month, String bkgs) {
|
||||
StringBuilder sql = new StringBuilder("SELECT (SUM(QCYE) + SUM(LJXS) - SUM(LJXS)) AS receivable ")
|
||||
.append("FROM " + RECEIVABLE_DETAIL_TABLE + " ")
|
||||
.append("WHERE YEAR(RQ) = '"+year+"' AND MONTH(RQ) BETWEEN 1 AND '"+month+"' ")
|
||||
.append("AND BKGS = '"+bkgs+"' ");
|
||||
private RowMap getReceivableToMonth(int year, int month, String bkgs) {
|
||||
|
||||
double value = DBSql.getDouble(sql.toString(), "receivable");
|
||||
return BigDecimal.valueOf(value);
|
||||
StringBuilder sql = new StringBuilder("SELECT SUM(QCYE) AS QCYE, SUM(LJXS) AS LJXS , SUM(LJHK) AS LJHK, (SUM(QCYE) + SUM(LJXS) - SUM(LJHK)) AS receivable")
|
||||
.append(" FROM " + RECEIVABLE_DETAIL_TABLE)
|
||||
.append(" WHERE RQ = ( SELECT MAX(RQ) FROM "+RECEIVABLE_DETAIL_TABLE+
|
||||
" WHERE YEAR(RQ) = '"+year+"' AND MONTH(RQ) = '"+month+"' AND BKGS = '"+bkgs+"' ) ")
|
||||
.append(" AND BKGS ='"+bkgs+"'");
|
||||
|
||||
RowMap receivable = DBSql.getMap(sql.toString());
|
||||
return receivable;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -645,30 +651,27 @@ public class SaleDataSummaryServiceImpl implements DataSummaryService {
|
||||
*/
|
||||
private Map<String, BigDecimal> getMonthlyData(int year, int month, String productType, String dataType, String bkgs) {
|
||||
String field = "";
|
||||
String sql = "";
|
||||
if (bkgs.contains("泰山")){
|
||||
// field = "sales".equals(dataType) ? "SUM(XSSL)/10000" : "SUM(SSJERMB)";
|
||||
// field = "轻钢龙骨".equals(productType) ? "SUM(ZSSL)" : "SUM(SSJERMB)";
|
||||
if ("sales".equals(dataType) && "轻钢龙骨".equals(productType)){
|
||||
field = "SUM(ZSSL)";
|
||||
} else if ("sales".equals(dataType) && "石膏板".equals(productType)) {
|
||||
field = "SUM(XSSL)/10000";
|
||||
} else if ("revenue".equals(dataType)) {
|
||||
field = "SUM(SSJERMB)";
|
||||
if ("sales".equals(dataType)){
|
||||
if ("轻钢龙骨".equals(productType)){
|
||||
field = " SUM(ZSSL) ";
|
||||
} else if ("石膏板".equals(productType)) {
|
||||
field = " SUM(XSSL)/10000 ";
|
||||
}else {
|
||||
field = " SUM(ZSSL) ";
|
||||
}
|
||||
}else {
|
||||
field = " SUM(SSJERMB) ";
|
||||
}
|
||||
sql = "SELECT LB_2 AS brand, " + field + " AS value " +
|
||||
"FROM " + SALES_DETAIL_TABLE + " " +
|
||||
"WHERE YEAR(DZRQ) = ? AND MONTH(DZRQ) = ? AND LB_1 = ? AND BKGS = ? " +
|
||||
"AND (SQ LIKE '%新疆%' OR SQ LIKE '%海南%' OR SQ LIKE '%西藏%') " + // 模糊查询
|
||||
"GROUP BY LB_2";
|
||||
}else {
|
||||
field = "sales".equals(dataType) ? "SUM(ZSSL)" : "SUM(SSJERMB)";
|
||||
sql = "SELECT LB_2 AS brand, " + field + " AS value " +
|
||||
"FROM " + SALES_DETAIL_TABLE + " " +
|
||||
"WHERE YEAR(DZRQ) = ? AND MONTH(DZRQ) = ? AND LB_1 = ? AND BKGS = ? " +
|
||||
"AND (SQ LIKE '%新疆%' OR SQ LIKE '%海南%' OR SQ LIKE '%西藏%') " + // 模糊查询
|
||||
"GROUP BY LB_2";
|
||||
|
||||
}
|
||||
String sql = "SELECT LB_2 AS brand, " + field + " AS value " +
|
||||
" FROM " + SALES_DETAIL_TABLE + " " +
|
||||
" WHERE YEAR(DZRQ) = ? AND MONTH(DZRQ) = ? AND LB_1 = ? AND BKGS = ? " +
|
||||
" AND (SQ LIKE '%新疆%' OR SQ LIKE '%海南%' OR SQ LIKE '%西藏%') " + // 模糊查询
|
||||
" GROUP BY LB_2";
|
||||
Map<String, BigDecimal> result = new HashMap<>();
|
||||
List<RowMap> rows = DBSql.getMaps(sql, year, month, productType, bkgs);
|
||||
for (RowMap row : rows) {
|
||||
@ -686,7 +689,7 @@ public class SaleDataSummaryServiceImpl implements DataSummaryService {
|
||||
/*StringBuilder sql = new StringBuilder("SELECT SUM(YSYE) AS receivable ")
|
||||
.append("FROM " + RECEIVABLE_DETAIL_TABLE + " ")
|
||||
.append("WHERE YEAR(RQ) = '"+year+"' AND MONTH(RQ) = '"+month+"' AND BKGS = '"+bkgs+"' ");*/
|
||||
StringBuilder sql = new StringBuilder("SELECT YSYE AS receivable ")
|
||||
StringBuilder sql = new StringBuilder("SELECT SUM(YSYE) AS receivable ")
|
||||
.append("FROM " + RECEIVABLE_DETAIL_TABLE + " ")
|
||||
.append("WHERE RQ = ( ")
|
||||
.append(" SELECT MAX(RQ) ")
|
||||
|
||||
@ -16,8 +16,9 @@ public class PurchaseUtil {
|
||||
*/
|
||||
public static String materialClassificationFiltering(String bkgs, String wlmc, String wlbm, String jldw, Double djhyf, String wlfl) {
|
||||
String newWlmc = "";
|
||||
try {
|
||||
// 脱硫石膏
|
||||
if(("龙牌".equals(bkgs) || "梦牌".equals(bkgs) || "泰山石膏".equals(bkgs)) && wlmc.contains("脱硫石膏")){
|
||||
if (("龙牌".equals(bkgs) || "梦牌".equals(bkgs) || "泰山石膏".equals(bkgs)) && wlmc.contains("脱硫石膏")) {
|
||||
newWlmc = "脱硫石膏";
|
||||
}
|
||||
// 镀锌带钢
|
||||
@ -28,8 +29,8 @@ public class PurchaseUtil {
|
||||
newWlmc = "镀锌带钢";
|
||||
}
|
||||
// 煤炭
|
||||
else if ((("龙牌".equals(bkgs) || "梦牌".equals(bkgs))
|
||||
&& (wlmc.contains("煤炭") || wlmc.contains("煤炭") || wlmc.contains("煤炭")))) {
|
||||
else if (("龙牌".equals(bkgs) || "梦牌".equals(bkgs))
|
||||
&& (wlmc.contains("煤炭") || wlmc.contains("籽煤") || wlmc.contains("褐煤"))) {
|
||||
newWlmc = "煤炭";
|
||||
} else if ("泰山石膏".equals(bkgs) && (wlmc.contains("原煤") || wlmc.contains("水洗精煤") || wlmc.contains("褐煤"))) {
|
||||
newWlmc = "煤炭";
|
||||
@ -40,7 +41,7 @@ public class PurchaseUtil {
|
||||
newWlmc = "护面纸";
|
||||
}
|
||||
// 乳液
|
||||
else if ("北新嘉宝莉".equals(bkgs) && wlbm.startsWith("11M")){
|
||||
else if ("北新嘉宝莉".equals(bkgs) && wlbm.startsWith("11M")) {
|
||||
newWlmc = "乳液";
|
||||
} else if ("北新防水".equals(bkgs) && wlbm.startsWith("5070201")) {
|
||||
newWlmc = "乳液";
|
||||
@ -49,12 +50,12 @@ public class PurchaseUtil {
|
||||
}
|
||||
// 钛白粉
|
||||
else if (("北新防水".equals(bkgs) || "北新涂料".equals(bkgs) || "北新嘉宝莉".equals(bkgs))
|
||||
&& wlmc.contains("钛白粉")){
|
||||
&& wlmc.contains("钛白粉")) {
|
||||
newWlmc = "钛白粉";
|
||||
}
|
||||
// 重钙
|
||||
else if (("北新防水".equals(bkgs) || "北新涂料".equals(bkgs) || "北新嘉宝莉".equals(bkgs))
|
||||
&& wlmc.contains("重钙")){
|
||||
&& wlmc.contains("重钙")) {
|
||||
newWlmc = "重钙";
|
||||
}
|
||||
// 包装袋
|
||||
@ -90,10 +91,10 @@ public class PurchaseUtil {
|
||||
} else {
|
||||
newWlmc = wlmc;
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
return newWlmc;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
materialClassificationFiltering("龙牌", "龙牌憎水岩棉板100", "30351010A000569", "块", 10.0, "");
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user