完成用户账号不足5元短信发送提示
This commit is contained in:
parent
84c96a235c
commit
374036ed76
@ -14,6 +14,6 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|||||||
@FeignClient(contextId = "smsService",value = ServiceNameConstants.XHPC_GENERAL, fallbackFactory = SmsFallbackFactory.class)
|
@FeignClient(contextId = "smsService",value = ServiceNameConstants.XHPC_GENERAL, fallbackFactory = SmsFallbackFactory.class)
|
||||||
public interface SmsService {
|
public interface SmsService {
|
||||||
|
|
||||||
@PostMapping("/send")
|
@PostMapping("/sms/send")
|
||||||
R sendNotice(String phone, String content);
|
R sendNotice(String phone, String content);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,6 +43,7 @@ public class XhpcSmsController extends BaseController {
|
|||||||
@GetMapping(value = "/send")
|
@GetMapping(value = "/send")
|
||||||
public void send(String phone , String content){
|
public void send(String phone , String content){
|
||||||
|
|
||||||
|
xhpcSmsService.sendNotice(phone, content);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -106,12 +106,11 @@ public class RealtimeDataLogic implements ServiceLogic {
|
|||||||
cacheOrder.put("realtimeDataList", realtimeDataList);
|
cacheOrder.put("realtimeDataList", realtimeDataList);
|
||||||
REDIS.setCacheMap(orderkey, cacheOrder);
|
REDIS.setCacheMap(orderkey, cacheOrder);
|
||||||
if ((balance - cacheRealtimeData.getAmountCharged()) < 500) {
|
if ((balance - cacheRealtimeData.getAmountCharged()) < 500) {
|
||||||
String alerted = (String) cacheOrder.get("alerted");
|
String alerted = (String) cacheOrder.get("lt5alerted");
|
||||||
String tel = (String) cacheOrder.get("tel");
|
String tel = (String) cacheOrder.get("tel");
|
||||||
if (alerted == null && tel != null) {
|
if (alerted == null && tel != null) {
|
||||||
// todo send sms
|
|
||||||
smsService.sendNotice(tel,"【小华充电】尊敬的用户,你的账户余额小于5元,为不影响您的正常充电,请您尽快充值交费,谢谢。");
|
smsService.sendNotice(tel,"【小华充电】尊敬的用户,你的账户余额小于5元,为不影响您的正常充电,请您尽快充值交费,谢谢。");
|
||||||
cacheOrder.put("alerted", "true");
|
cacheOrder.put("lt5alerted", "true");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user