Merge remote-tracking branch 'origin/ls-dev' into ls-dev

dev
xiaocui 2021-05-10 14:43:32 +08:00
commit 82f189968f
1 changed files with 11 additions and 9 deletions

View File

@ -7,7 +7,6 @@ import com.cowr.model.PrepayCustomer;
import com.cowr.service.ssjygl.main.Config;
import com.cowr.service.ssjygl.main.SvrCacheData;
import com.cowr.service.ssjygl.sms.log.SmsService;
import com.cowr.sms.AliyunSmsService;
import com.jfinal.kit.StrKit;
import com.jfinal.log.Log;
import com.jfinal.plugin.activerecord.Db;
@ -202,6 +201,7 @@ public class StatSmsJob implements Job {
c.add(Calendar.DAY_OF_MONTH, -1);
String predaytm = DateTimeUtil.sdf.get().format(c.getTime()); // 前一日
String daytm = DateTimeUtil.sdf.get().format(now); // 当日
String sendtmtext = DateTimeUtil.sdfymd.get().format(c.getTime());
String year_start = DateTimeUtil.year_start.get().format(now);
@ -211,6 +211,7 @@ public class StatSmsJob implements Job {
String ordersql = "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" +
" where t.create_time >= ? \n" +
" and t.create_time < ? \n" +
" and t.state = 5";
String cusmersql = "select ifnull(sum(t.surplus), 0) customer_total_surplus from prepay_customer t";
String daysql = "select count(t.sn) total_cnt, ifnull(sum(t.weight), 0) total_weight, ifnull(sum(t.total_price), 0) total_price from order_temp t\n" +
@ -218,16 +219,17 @@ public class StatSmsJob implements Job {
" and t.create_time like '" + predaytm + "%'";
String revenuesql = "select ifnull(sum(t.weight), 0) weight, ifnull(sum(total_price), 0) total_price from order_temp t\n" +
"where t.state = 5\n" +
"and (t.customer_id = 17\n" +
"or t.customer_id = 24\n" +
"or t.customer_id = 60\n" +
"or t.customer_id = 61)\n" +
"and t.create_time >= ? ";
" where t.state = 5\n" +
" and (t.customer_id = 17\n" +
" or t.customer_id = 24\n" +
" or t.customer_id = 60\n" +
" or t.customer_id = 61)\n" +
" and t.create_time >= ? \n" +
" and t.create_time < ?";
JSONObject obj = new JSONObject();
Record orderobj = Db.findFirst(ordersql, year_start);
Record revenueobj = Db.findFirst(revenuesql, year_start);
Record orderobj = Db.findFirst(ordersql, year_start, daytm);
Record revenueobj = Db.findFirst(revenuesql, year_start, daytm);
Record allorderobj = Db.findFirst(allordersql);
Record customerobj = Db.findFirst(cusmersql);
Record dayobj = Db.findFirst(daysql);