累计销售汇总短信定时任务修改-2
parent
a40e760cbe
commit
d7950fc935
|
|
@ -213,6 +213,7 @@ public class StatSmsJob implements Job {
|
|||
String daytm = DateTimeUtil.sdf.get().format(now); // 当日
|
||||
String sendtmtext = DateTimeUtil.sdfymd.get().format(c.getTime());
|
||||
String year_start = DateTimeUtil.year_start.get().format(now);
|
||||
String year = DateTimeUtil.year.get().format(now); // 当前年
|
||||
|
||||
String allordersql = "select count(t.sn) aggr_cnt, ifnull(sum(t.weight), 0) aggr_weight, ifnull(sum(t.total_price), 0) aggr_price \n" +
|
||||
" from order_temp t \n" +
|
||||
|
|
@ -278,21 +279,25 @@ public class StatSmsJob implements Job {
|
|||
return;
|
||||
}
|
||||
|
||||
BigDecimal aggr_weight = orderobj.getBigDecimal("aggr_weight")
|
||||
.subtract(new BigDecimal("27.34"))
|
||||
.subtract(subtractobj.getBigDecimal("weight"));
|
||||
BigDecimal aggr_price = orderobj.getBigDecimal("aggr_price")
|
||||
.subtract(new BigDecimal("2011.27"))
|
||||
.subtract(subtractobj.getBigDecimal("total_price"));
|
||||
|
||||
if ("2021".equals(year)) {
|
||||
aggr_weight = aggr_weight.subtract(new BigDecimal("5853.39"));
|
||||
aggr_price = aggr_price.subtract(new BigDecimal("410322.58"));
|
||||
}
|
||||
|
||||
obj.put("aggr_cnt", orderobj.get("aggr_cnt"));
|
||||
obj.put("aggr_weight", String.format("%.2f万",
|
||||
orderobj.getBigDecimal("aggr_weight")
|
||||
.subtract(new BigDecimal("27.34"))
|
||||
.subtract(new BigDecimal("5853.39"))
|
||||
.subtract(subtractobj.getBigDecimal("weight"))
|
||||
.divide(new BigDecimal("10000"), 2, BigDecimal.ROUND_HALF_UP)
|
||||
aggr_weight.divide(new BigDecimal("10000"), 2, BigDecimal.ROUND_HALF_UP)
|
||||
)
|
||||
);
|
||||
obj.put("aggr_price", String.format("%.2f万",
|
||||
orderobj.getBigDecimal("aggr_price")
|
||||
.subtract(new BigDecimal("2011.27"))
|
||||
.subtract(new BigDecimal("410322.58"))
|
||||
.subtract(subtractobj.getBigDecimal("total_price"))
|
||||
.divide(new BigDecimal("10000"), 2, BigDecimal.ROUND_HALF_UP)
|
||||
aggr_price.divide(new BigDecimal("10000"), 2, BigDecimal.ROUND_HALF_UP)
|
||||
)
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue