调整短信

dev
lisai17@sina.com 2021-03-03 09:01:47 +08:00
parent 55baade462
commit 7703252729
5 changed files with 24 additions and 5 deletions

View File

@ -21,7 +21,7 @@ public class Const {
public static final long SUP_OFFLINE_TIME = 5 * 60 * 1000L; // 砂站离线时间限制,单位 毫秒
public static final String TEMP_CODE_AGGR_STAT = "SMS_205434464"; // 累计销售汇总
public static final String TEMP_CODE_AGGR_STAT_2 = "SMS_212280668"; // 累计销售汇总-实际营收
public static final String TEMP_CODE_AGGR_STAT_2 = "SMS_212486582"; // 累计销售汇总-实际营收
public static final String TEMP_CODE_DAY_STAT = "SMS_205430436"; // 日销售汇总
public static final String TEMP_CODE_CUSTOMER_DAY_STAT = "SMS_208985081"; // 客户日销售汇总
public static final String TEMP_CODE_PEIE = "SMS_203673037"; // 配额分配通知
@ -39,7 +39,7 @@ public class Const {
SMS_TEMP_MAP.put(TEMP_CODE_DEPOSIT_SUCCESS, "${time}${customer_name}在${vendor}的预存${amount}元,合计余额${surplus}元。");
SMS_TEMP_MAP.put(TEMP_CODE_DEPOSIT_FAIL, "${time}${customer_name}在${vendor}预存的${amount}元审核未通过,若有疑问请及时联系结算中心。");
SMS_TEMP_MAP.put(TEMP_CODE_AGGR_STAT, "截至${time1}累计销售黄砂${aggr_weight}吨,共计${aggr_price}元,运输${aggr_cnt}辆次。账户累计${aggr_total_price}元,其中预付费客户总余额${customer_total_surplus}元。${time2}当日销售黄砂${total_weight}吨,共计${total_price}元,运输${total_cnt}辆次。");
SMS_TEMP_MAP.put(TEMP_CODE_AGGR_STAT_2, "截至${time1}累计销售黄砂${aggr_weight}吨,共计${aggr_price}元,运输${aggr_cnt}辆次其中2020年充值客户运输${customer_weight}吨,共${customer_price}元,实际营收${revenue}元。账户累计${aggr_total_price}元,其中预付费客户总余额${customer_total_surplus}元。${time2}当日销售黄砂${total_weight}吨,共计${total_price}元,运输${total_cnt}辆次。");
SMS_TEMP_MAP.put(TEMP_CODE_AGGR_STAT_2, "截至${time1}累计销售黄砂${aggr_weight}吨,共计${aggr_price}元,运输${aggr_cnt}辆次其中2020年充值客户销售${customer_weight}吨,共${customer_price}元2021年新增客户销售${revenue_weight}吨,共${revenue}元。账户累计${aggr_total_price}元,其中预付费客户总余额${customer_total_surplus}元。${time2}当日销售黄砂${total_weight}吨,共计${total_price}元,运输${total_cnt}辆次。");
SMS_TEMP_MAP.put(TEMP_CODE_SURPLUS_WARN, "截至${time}${customer_name}在${vendor}的预存账户余额为${surplus}元。请及时关注。");
SMS_TEMP_MAP.put(TEMP_CODE_REFUND_SUCCESS, "${time}${customer_name}在${vendor}的退款${amount}元,合计余额${surplus}元。");
}

View File

@ -130,7 +130,7 @@ public class CheckUndonOrderclusterJob implements Job {
Result ret;
if (ordercluster.getCustomerId() != null) {
ret = OrderclusterSyncService.me.forwardCluster(ordercluster_id, surplus_weight, cutoff_time, user);
ret = OrderclusterSyncService.me.forwardCluster(ordercluster_id, surplus_weight, cutoff_time, user, true);
} else {
String trucks = Db.queryStr("select group_concat(t.truck_license) trucks from ordercluster_truck t\n" +
" where t.ordercluster_id = ?\n" +

View File

@ -7,6 +7,7 @@ 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;
@ -264,6 +265,7 @@ public class StatSmsJob implements Job {
obj.put("customer_weight", String.format("%.2f万", revenueobj.getBigDecimal("weight").divide(new BigDecimal("10000"), 2, BigDecimal.ROUND_HALF_UP)));
obj.put("customer_price", String.format("%.2f万", revenueobj.getBigDecimal("total_price").divide(new BigDecimal("10000"), 2, BigDecimal.ROUND_HALF_UP)));
obj.put("revenue", String.format("%.2f万", orderobj.getBigDecimal("aggr_price").subtract(revenueobj.getBigDecimal("total_price")).divide(new BigDecimal("10000"), 2, BigDecimal.ROUND_HALF_UP)));
obj.put("revenue_weight", String.format("%.2f万", orderobj.getBigDecimal("aggr_weight").subtract(revenueobj.getBigDecimal("weight")).divide(new BigDecimal("10000"), 2, BigDecimal.ROUND_HALF_UP)));
obj.put("customer_total_surplus", String.format("%.2f万", customerobj.getBigDecimal("customer_total_surplus").divide(new BigDecimal("10000"), 2, BigDecimal.ROUND_HALF_UP)));
obj.put("aggr_total_price", String.format("%.2f万", allorderobj.getBigDecimal("aggr_price").add(customerobj.getBigDecimal("customer_total_surplus")).divide(new BigDecimal("10000"), 2, BigDecimal.ROUND_HALF_UP)));
@ -273,7 +275,17 @@ public class StatSmsJob implements Job {
obj.put("total_weight", String.format("%.2f", dayobj.getBigDecimal("total_weight")));
obj.put("total_price", String.format("%.2f", dayobj.getBigDecimal("total_price")));
SmsService.me.sendStatAggr(obj);
// SmsService.me.sendStatAggr(obj);
try {
AliyunSmsService aliyunsms = new AliyunSmsService();
String content = aliyunsms.generator(Const.SMS_TEMP_MAP.get("SMS_212486582"), obj);
log.debug(content);
String response = aliyunsms.send("13627293906", "SMS_212486582", obj);
log.debug(content);
log.debug(response);
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
@Override

View File

@ -16,6 +16,7 @@ import com.cowr.service.ssjygl.driver.DriverController;
import com.cowr.service.ssjygl.invoice.invalidverify.InvoiceInvalidVerifyController;
import com.cowr.service.ssjygl.invoice.log.InvoiceLogController;
import com.cowr.service.ssjygl.invoice.receive.InvoiceReceiveController;
import com.cowr.service.ssjygl.jobs.StatSmsJob;
import com.cowr.service.ssjygl.netty.NettyServer;
import com.cowr.service.ssjygl.order.invalidverify.OrderInvalidVerifyController;
import com.cowr.service.ssjygl.order.ordercluster.OrderclusterController;
@ -297,6 +298,8 @@ public class Config extends JFinalConfig {
}
SyncTaskService.me.start();
new StatSmsJob().statAggr();
} catch (Exception e) {
log.error(e.getMessage(), e);
}

View File

@ -930,6 +930,10 @@ public class OrderclusterSyncService extends BaseSyncService {
* @return
*/
public Result forwardCluster(int ordercluster_id, BigDecimal total_weight, Date cutoff_time, Sysuser sysuser) {
return forwardCluster(ordercluster_id, total_weight, cutoff_time, sysuser, false);
}
public Result forwardCluster(int ordercluster_id, BigDecimal total_weight, Date cutoff_time, Sysuser sysuser, boolean isAuto) {
Ordercluster oldobj = Ordercluster.dao.findById(ordercluster_id);
if (oldobj == null) {
@ -1117,7 +1121,7 @@ public class OrderclusterSyncService extends BaseSyncService {
if (ret) {
SyncTaskService.me.send(synctask);
if (forwardoldobj[0] != null) {
if (forwardoldobj[0] != null && !isAuto) {
SmsService.me.sendPeiE(forwardoldobj[0]);
}
}