|
@@ -1,6 +1,7 @@
|
|
|
package com.ruoyi.system.service.impl;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.nio.charset.StandardCharsets;
|
|
|
import java.text.DecimalFormat;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
@@ -21,11 +22,13 @@ import com.ruoyi.system.mapper.ReceptionPersonnelMapper;
|
|
|
import com.ruoyi.system.mapper.SysUserMapper;
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.apache.commons.lang3.math.NumberUtils;
|
|
|
+import org.apache.logging.log4j.util.Base64Util;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.ruoyi.system.mapper.BomanReservatMapper;
|
|
|
import com.ruoyi.system.domain.BomanReservat;
|
|
|
import com.ruoyi.system.service.IBomanReservatService;
|
|
|
+import sun.misc.BASE64Encoder;
|
|
|
|
|
|
import static com.ruoyi.common.constant.Constants.RESERVAT_PERSONNEL_NUM;
|
|
|
|
|
@@ -127,10 +130,12 @@ public class BomanReservatServiceImpl implements IBomanReservatService {
|
|
|
int num = receptionPersonnelMapper.selectReceptionPersonnelCount();
|
|
|
if (bomanReservats != null){
|
|
|
if (bomanReservats.size() >= num ){
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ if (bomanReservats.size() + 1 == num){
|
|
|
//插入redis该时段接待人员已满
|
|
|
String keyPersonnel = Constants.RESERVAT_PERSONNEL_NUM + bomanReservat.getVisitDate() + "_" + reservatConfigTimeId;
|
|
|
redisCache.setCacheObject(keyPersonnel,"Y",24, TimeUnit.HOURS);
|
|
|
- return 0;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -237,15 +242,13 @@ public class BomanReservatServiceImpl implements IBomanReservatService {
|
|
|
|
|
|
//审核通过给团队发送通过短信
|
|
|
if ("3".equals(bomanReservat.getVisitType())) {
|
|
|
- String visitPhone = bomanReservat.getVisitPhone();
|
|
|
+ String visitPhone = reservat.getVisitPhone();
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
-
|
|
|
- jsonObject.put("code", bomanReservat.getReservatId());
|
|
|
+ jsonObject.put("code", new BASE64Encoder().encodeBuffer(String.valueOf(reservat.getReservatId()).getBytes(StandardCharsets.UTF_8)));
|
|
|
//陵园预约通过通知 = SMS_464336030
|
|
|
SendSmsUtils.sendSms(visitPhone, "SMS_464336030", jsonObject.toString());
|
|
|
System.out.println("给(" + visitPhone + ")团队发送了审核通过的短信");
|
|
|
}
|
|
|
-
|
|
|
return i > 0 ? AjaxResult.success() : AjaxResult.error();
|
|
|
}
|
|
|
|