|
@@ -18,10 +18,7 @@ import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
|
-import java.util.Arrays;
|
|
|
|
|
-import java.util.Calendar;
|
|
|
|
|
-import java.util.Date;
|
|
|
|
|
-import java.util.List;
|
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 弹框日志Controller
|
|
* 弹框日志Controller
|
|
@@ -45,6 +42,9 @@ public class WxAlertLogController extends ApiBaseController {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IAlertUpvoteLogService alertUpvoteLogService;
|
|
private IAlertUpvoteLogService alertUpvoteLogService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ISysUserShopExtService sysUserShopExtService;
|
|
|
|
|
+
|
|
|
|
|
|
|
|
@ApiOperation(value = "微信弹框",notes = "参数:{userId:1}")
|
|
@ApiOperation(value = "微信弹框",notes = "参数:{userId:1}")
|
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|
|
@@ -52,20 +52,39 @@ public class WxAlertLogController extends ApiBaseController {
|
|
|
})
|
|
})
|
|
|
@PostMapping("/getAlert")
|
|
@PostMapping("/getAlert")
|
|
|
public Object getAlertLog() throws ParseException {
|
|
public Object getAlertLog() throws ParseException {
|
|
|
- String userType="";
|
|
|
|
|
ParameterObject obj = getParameterObject();
|
|
ParameterObject obj = getParameterObject();
|
|
|
Long userId = Long.valueOf(obj.getString("userId"));
|
|
Long userId = Long.valueOf(obj.getString("userId"));
|
|
|
|
|
+ Set<String> userTypeSet = new HashSet<>();
|
|
|
|
|
+ List<String> userTypeList = new ArrayList<>();
|
|
|
SysUserExt sysUserExt = sysUserExtService.selectSysUserExtById(userId);
|
|
SysUserExt sysUserExt = sysUserExtService.selectSysUserExtById(userId);
|
|
|
- String salesLevel = sysUserExt.getSalesLevel();
|
|
|
|
|
- if(("customer_level").equals(salesLevel)||("reseller_level").equals(salesLevel) ){
|
|
|
|
|
- userType = "1";
|
|
|
|
|
- }else{
|
|
|
|
|
- userType = "0";
|
|
|
|
|
|
|
+ List<SysUserShopExt> sysUserShopExt = sysUserShopExtService.selectSysUserShopExtById(obj.getString("userId"));
|
|
|
|
|
+ if (sysUserShopExt != null && sysUserShopExt.size() > 0) {
|
|
|
|
|
+ for (SysUserShopExt shopExt : sysUserShopExt) {
|
|
|
|
|
+ userTypeSet.add(shopExt.getIsShopType());
|
|
|
|
|
+ }
|
|
|
|
|
+ for (String userType : userTypeSet){
|
|
|
|
|
+ if ("0".equals(userType)){
|
|
|
|
|
+ userTypeList.add("3");
|
|
|
|
|
+ }else {
|
|
|
|
|
+ userTypeList.add("4");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ AlertConfiguration alertConfiguration1 = null;
|
|
|
|
|
+ if (sysUserExt != null){
|
|
|
|
|
+ String salesLevel = sysUserExt.getSalesLevel();
|
|
|
|
|
+ if(("customer_level").equals(salesLevel)||("reseller_level").equals(salesLevel) ){
|
|
|
|
|
+ userTypeList.add("1");
|
|
|
|
|
+ }else{
|
|
|
|
|
+ userTypeList.add("0");
|
|
|
|
|
+ }
|
|
|
|
|
+ alertConfiguration1 = alertConfigurationService.selectAlertConfigurationByAlertStatus(userTypeList,sysUserExt.getOrgCode());
|
|
|
|
|
+ }else {
|
|
|
|
|
+ alertConfiguration1 = alertConfigurationService. selectAlertConfiguration(userTypeList);
|
|
|
}
|
|
}
|
|
|
- //是否有启动
|
|
|
|
|
- AlertConfiguration alertConfiguration1 = alertConfigurationService.selectAlertConfigurationByAlertStatus(userType,sysUserExt.getSalesLevel(),sysUserExt.getOrgCode());
|
|
|
|
|
|
|
+ //是否有启动弹窗
|
|
|
|
|
|
|
|
- if (alertConfiguration1!=null){
|
|
|
|
|
|
|
+ if (alertConfiguration1 != null){
|
|
|
//有启动
|
|
//有启动
|
|
|
alertConfiguration1.setIsClearCache(false);
|
|
alertConfiguration1.setIsClearCache(false);
|
|
|
Date datez = new Date();
|
|
Date datez = new Date();
|
|
@@ -78,155 +97,69 @@ public class WxAlertLogController extends ApiBaseController {
|
|
|
//满足时间
|
|
//满足时间
|
|
|
String[] split = alertConfiguration1.getUserType().split(",");
|
|
String[] split = alertConfiguration1.getUserType().split(",");
|
|
|
List<String> strings = Arrays.asList(split);
|
|
List<String> strings = Arrays.asList(split);
|
|
|
-
|
|
|
|
|
- if ((strings.contains("1") || strings.contains("2")) &&sysUserExt.getSalesLevel().equals("customer_level")){
|
|
|
|
|
- //满足类型对应a
|
|
|
|
|
- AlertLog alertLog = alertLogService.selectAlertLogByUserIdAndAlertId(userId, alertConfiguration1.getAlertId(),"0");
|
|
|
|
|
- //AlertLog log = alertLogService.selectAlertLogByUserIdAndAlertId(userId, alertConfiguration1.getAlertId(),null);
|
|
|
|
|
- /* if(log == null){
|
|
|
|
|
- alertConfiguration1.setIsClearCache(true);
|
|
|
|
|
- }*/
|
|
|
|
|
- if (alertLog!=null){
|
|
|
|
|
- if (alertLog.getAlertNum()<alertConfiguration1.getAlertNum()){
|
|
|
|
|
- Long count =alertLog.getAlertNum()+1;
|
|
|
|
|
- // 创建两个日期对象
|
|
|
|
|
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
- Date date1 = dateFormat.parse(sdf.format(alertLog.getCreateTime()));
|
|
|
|
|
- Date date2 = dateFormat.parse(sdf.format(alertConfiguration1.getAlertEndTime()));
|
|
|
|
|
- // 设置时间部分为零点
|
|
|
|
|
- Calendar calendar = Calendar.getInstance();
|
|
|
|
|
- calendar.setTime(date1);
|
|
|
|
|
- calendar.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
|
- calendar.set(Calendar.MINUTE, 0);
|
|
|
|
|
- calendar.set(Calendar.SECOND, 0);
|
|
|
|
|
- calendar.set(Calendar.MILLISECOND, 0);
|
|
|
|
|
- date1 = calendar.getTime();
|
|
|
|
|
- calendar.setTime(date2);
|
|
|
|
|
- calendar.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
|
- calendar.set(Calendar.MINUTE, 0);
|
|
|
|
|
- calendar.set(Calendar.SECOND, 0);
|
|
|
|
|
- calendar.set(Calendar.MILLISECOND, 0);
|
|
|
|
|
- date2 = calendar.getTime();
|
|
|
|
|
- int clearT = date1.compareTo(date2);
|
|
|
|
|
- if(count == alertConfiguration1.getAlertNum() && clearT==0){
|
|
|
|
|
- alertConfiguration1.setIsClearCache(true);
|
|
|
|
|
- alertLog.setIsClearCache("1");
|
|
|
|
|
|
|
+ if (sysUserExt != null){
|
|
|
|
|
+ if ((strings.contains("1") || strings.contains("2")) && sysUserExt.getSalesLevel().equals("customer_level")){
|
|
|
|
|
+ //满足类型对应a
|
|
|
|
|
+ AlertLog alertLog = alertLogService.selectAlertLogByUserIdAndAlertId(userId, alertConfiguration1.getAlertId(),"0");
|
|
|
|
|
+ if (alertLog!=null){
|
|
|
|
|
+ if (alertLog.getAlertNum()<alertConfiguration1.getAlertNum()){
|
|
|
|
|
+ updateAlertLog(alertConfiguration1,alertLog,sdf,"1");
|
|
|
|
|
+ return AjaxResult.success(alertConfiguration1);
|
|
|
|
|
+ }else {
|
|
|
|
|
+ return AjaxResult.warning("每日弹出次数已满");
|
|
|
}
|
|
}
|
|
|
- alertLog.setAlertNum(count);
|
|
|
|
|
- alertLogService.updateAlertLog(alertLog);
|
|
|
|
|
- return AjaxResult.success(alertConfiguration1);
|
|
|
|
|
}else {
|
|
}else {
|
|
|
- return AjaxResult.warning("每日弹出次数已满");
|
|
|
|
|
|
|
+ intAlertLog(alertConfiguration1,"1",now,sdf,userId,"1");
|
|
|
|
|
+ return AjaxResult.success(alertConfiguration1);
|
|
|
}
|
|
}
|
|
|
- }else {
|
|
|
|
|
- //加数据
|
|
|
|
|
- AlertLog alertLog1 = new AlertLog();
|
|
|
|
|
- alertLog1.setAlertId(alertConfiguration1.getAlertId());
|
|
|
|
|
- alertLog1.setUserId(userId);
|
|
|
|
|
- alertLog1.setUserType("1");
|
|
|
|
|
- alertLog1.setAlertNum(1L);
|
|
|
|
|
- // 创建两个日期对象
|
|
|
|
|
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
- Date date1 = dateFormat.parse(now);
|
|
|
|
|
- Date date2 = dateFormat.parse(sdf.format(alertConfiguration1.getAlertEndTime()));
|
|
|
|
|
- // 设置时间部分为零点
|
|
|
|
|
- Calendar calendar = Calendar.getInstance();
|
|
|
|
|
- calendar.setTime(date1);
|
|
|
|
|
- calendar.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
|
- calendar.set(Calendar.MINUTE, 0);
|
|
|
|
|
- calendar.set(Calendar.SECOND, 0);
|
|
|
|
|
- calendar.set(Calendar.MILLISECOND, 0);
|
|
|
|
|
- date1 = calendar.getTime();
|
|
|
|
|
- calendar.setTime(date2);
|
|
|
|
|
- calendar.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
|
- calendar.set(Calendar.MINUTE, 0);
|
|
|
|
|
- calendar.set(Calendar.SECOND, 0);
|
|
|
|
|
- calendar.set(Calendar.MILLISECOND, 0);
|
|
|
|
|
- date2 = calendar.getTime();
|
|
|
|
|
- int clearT = date1.compareTo(date2);
|
|
|
|
|
- if(clearT==0 && alertConfiguration1.getAlertNum()==1){
|
|
|
|
|
- alertConfiguration1.setIsClearCache(true);
|
|
|
|
|
- alertLog1.setIsClearCache("1");
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ if((strings.contains("0") || strings.contains("2")) && !sysUserExt.getSalesLevel().equals("customer_level")){
|
|
|
|
|
+ AlertLog alertLog = alertLogService.selectAlertLogByUserIdAndAlertId(userId, alertConfiguration1.getAlertId(),"0");
|
|
|
|
|
+ if (alertLog!=null){
|
|
|
|
|
+ if (alertLog.getAlertNum()<alertConfiguration1.getAlertNum()){
|
|
|
|
|
+ updateAlertLog(alertConfiguration1,alertLog,sdf,"1");
|
|
|
|
|
+ return AjaxResult.success(alertConfiguration1);
|
|
|
|
|
+ }else {
|
|
|
|
|
+ return AjaxResult.warning("每日弹出次数已满");
|
|
|
|
|
+ }
|
|
|
|
|
+ }else {
|
|
|
|
|
+ intAlertLog(alertConfiguration1,"1",now,sdf,userId,"0");
|
|
|
|
|
+ return AjaxResult.success(alertConfiguration1);
|
|
|
}
|
|
}
|
|
|
- alertLogService.insertAlertLog(alertLog1);
|
|
|
|
|
- return AjaxResult.success(alertConfiguration1);
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if((strings.contains("0") || strings.contains("2")) && !sysUserExt.getSalesLevel().equals("customer_level")){
|
|
|
|
|
- AlertLog alertLog = alertLogService.selectAlertLogByUserIdAndAlertId(userId, alertConfiguration1.getAlertId(),"0");
|
|
|
|
|
- /* AlertLog log = alertLogService.selectAlertLogByUserIdAndAlertId(userId, alertConfiguration1.getAlertId(),null);
|
|
|
|
|
- if(log == null){
|
|
|
|
|
- alertConfiguration1.setIsClearCache(true);
|
|
|
|
|
- }*/
|
|
|
|
|
- if (alertLog!=null){
|
|
|
|
|
- if (alertLog.getAlertNum()<alertConfiguration1.getAlertNum()){
|
|
|
|
|
- Long count =alertLog.getAlertNum()+1;
|
|
|
|
|
- // 创建两个日期对象
|
|
|
|
|
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
- Date date1 = dateFormat.parse(sdf.format(alertLog.getCreateTime()));
|
|
|
|
|
- Date date2 = dateFormat.parse(sdf.format(alertConfiguration1.getAlertEndTime()));
|
|
|
|
|
- // 设置时间部分为零点
|
|
|
|
|
- Calendar calendar = Calendar.getInstance();
|
|
|
|
|
- calendar.setTime(date1);
|
|
|
|
|
- calendar.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
|
- calendar.set(Calendar.MINUTE, 0);
|
|
|
|
|
- calendar.set(Calendar.SECOND, 0);
|
|
|
|
|
- calendar.set(Calendar.MILLISECOND, 0);
|
|
|
|
|
- date1 = calendar.getTime();
|
|
|
|
|
-
|
|
|
|
|
- calendar.setTime(date2);
|
|
|
|
|
- calendar.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
|
- calendar.set(Calendar.MINUTE, 0);
|
|
|
|
|
- calendar.set(Calendar.SECOND, 0);
|
|
|
|
|
- calendar.set(Calendar.MILLISECOND, 0);
|
|
|
|
|
- date2 = calendar.getTime();
|
|
|
|
|
- int clearT = date1.compareTo(date2);
|
|
|
|
|
- if(count == alertConfiguration1.getAlertNum() && clearT==0){
|
|
|
|
|
- alertConfiguration1.setIsClearCache(true);
|
|
|
|
|
- alertLog.setIsClearCache("1");
|
|
|
|
|
|
|
+ //判断该用户是否为金牌店或仿石漆
|
|
|
|
|
+ if (sysUserShopExt != null){
|
|
|
|
|
+ if((strings.contains("3") || strings.contains("2")) && userTypeSet.contains("0")){
|
|
|
|
|
+ AlertLog alertLog = alertLogService.selectAlertLogByUserIdAndAlertId(userId, alertConfiguration1.getAlertId(),"0");
|
|
|
|
|
+ if (alertLog!=null){
|
|
|
|
|
+ if (alertLog.getAlertNum()<alertConfiguration1.getAlertNum()){
|
|
|
|
|
+ updateAlertLog(alertConfiguration1,alertLog,sdf,"1");
|
|
|
|
|
+ return AjaxResult.success(alertConfiguration1);
|
|
|
|
|
+ }else {
|
|
|
|
|
+ return AjaxResult.warning("每日弹出次数已满");
|
|
|
}
|
|
}
|
|
|
- alertLog.setAlertNum(count);
|
|
|
|
|
- alertLogService.updateAlertLog(alertLog);
|
|
|
|
|
- return AjaxResult.success(alertConfiguration1);
|
|
|
|
|
}else {
|
|
}else {
|
|
|
- return AjaxResult.warning("每日弹出次数已满");
|
|
|
|
|
|
|
+ intAlertLog(alertConfiguration1,"1",now,sdf,userId,"3");
|
|
|
|
|
+ return AjaxResult.success(alertConfiguration1);
|
|
|
}
|
|
}
|
|
|
- }else {
|
|
|
|
|
- //加数据
|
|
|
|
|
- AlertLog alertLog1 = new AlertLog();
|
|
|
|
|
- alertLog1.setAlertId(alertConfiguration1.getAlertId());
|
|
|
|
|
- alertLog1.setUserId(userId);
|
|
|
|
|
- alertLog1.setUserType("0");
|
|
|
|
|
- alertLog1.setAlertNum(1L);
|
|
|
|
|
- // 创建两个日期对象
|
|
|
|
|
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
- Date date1 = dateFormat.parse(now);
|
|
|
|
|
- Date date2 = dateFormat.parse(sdf.format(alertConfiguration1.getAlertEndTime()));
|
|
|
|
|
- // 设置时间部分为零点
|
|
|
|
|
- Calendar calendar = Calendar.getInstance();
|
|
|
|
|
- calendar.setTime(date1);
|
|
|
|
|
- calendar.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
|
- calendar.set(Calendar.MINUTE, 0);
|
|
|
|
|
- calendar.set(Calendar.SECOND, 0);
|
|
|
|
|
- calendar.set(Calendar.MILLISECOND, 0);
|
|
|
|
|
- date1 = calendar.getTime();
|
|
|
|
|
- calendar.setTime(date2);
|
|
|
|
|
- calendar.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
|
- calendar.set(Calendar.MINUTE, 0);
|
|
|
|
|
- calendar.set(Calendar.SECOND, 0);
|
|
|
|
|
- calendar.set(Calendar.MILLISECOND, 0);
|
|
|
|
|
- date2 = calendar.getTime();
|
|
|
|
|
- int clearT = date1.compareTo(date2);
|
|
|
|
|
- if(clearT==0 && alertConfiguration1.getAlertNum()==1){
|
|
|
|
|
- alertConfiguration1.setIsClearCache(true);
|
|
|
|
|
- alertLog1.setIsClearCache("1");
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ if((strings.contains("4") || strings.contains("2")) && userTypeSet.contains("1")){
|
|
|
|
|
+ AlertLog alertLog = alertLogService.selectAlertLogByUserIdAndAlertId(userId, alertConfiguration1.getAlertId(),"0");
|
|
|
|
|
+ if (alertLog!=null){
|
|
|
|
|
+ if (alertLog.getAlertNum()<alertConfiguration1.getAlertNum()){
|
|
|
|
|
+ updateAlertLog(alertConfiguration1,alertLog,sdf,"1");
|
|
|
|
|
+ return AjaxResult.success(alertConfiguration1);
|
|
|
|
|
+ }else {
|
|
|
|
|
+ return AjaxResult.warning("每日弹出次数已满");
|
|
|
|
|
+ }
|
|
|
|
|
+ }else {
|
|
|
|
|
+ intAlertLog(alertConfiguration1,"1",now,sdf,userId,"4");
|
|
|
|
|
+ return AjaxResult.success(alertConfiguration1);
|
|
|
}
|
|
}
|
|
|
- alertLogService.insertAlertLog(alertLog1);
|
|
|
|
|
- return AjaxResult.success(alertConfiguration1);
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
return AjaxResult.warning("没有符合的弹框");
|
|
return AjaxResult.warning("没有符合的弹框");
|
|
|
-
|
|
|
|
|
} else {
|
|
} else {
|
|
|
//超时
|
|
//超时
|
|
|
return AjaxResult.warning("时间超时");
|
|
return AjaxResult.warning("时间超时");
|
|
@@ -237,6 +170,74 @@ public class WxAlertLogController extends ApiBaseController {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public void updateAlertLog(AlertConfiguration alertConfiguration,AlertLog alertLog,SimpleDateFormat sdf,String isClearCache)throws ParseException {
|
|
|
|
|
+ Long count =alertLog.getAlertNum()+1;
|
|
|
|
|
+ // 创建两个日期对象
|
|
|
|
|
+ Date date1 = getTimeStampV1(null,sdf,alertLog.getCreateTime());
|
|
|
|
|
+ Date date2 = getTimeStampV2(sdf,alertConfiguration.getAlertEndTime());
|
|
|
|
|
+ int clearT = date1.compareTo(date2);
|
|
|
|
|
+ if(count == alertConfiguration.getAlertNum() && clearT==0){
|
|
|
|
|
+ alertConfiguration.setIsClearCache(true);
|
|
|
|
|
+ alertLog.setIsClearCache(isClearCache);
|
|
|
|
|
+ }
|
|
|
|
|
+ alertLog.setAlertNum(count);
|
|
|
|
|
+ alertLogService.updateAlertLog(alertLog);
|
|
|
|
|
+ }
|
|
|
|
|
+ //初始化AlertLog对象
|
|
|
|
|
+ public void intAlertLog(AlertConfiguration alertConfiguration,String isClearCache,String now,SimpleDateFormat sdf,Long userId,String userType) throws ParseException {
|
|
|
|
|
+ //加数据
|
|
|
|
|
+ AlertLog alertLog1 = initAlertLog(userId,alertConfiguration.getAlertId());
|
|
|
|
|
+ alertLog1.setUserType(userType);
|
|
|
|
|
+ // 创建两个日期对象
|
|
|
|
|
+ Date date1 = getTimeStampV1(now,null,null);
|
|
|
|
|
+ Date date2 = getTimeStampV2(sdf,alertConfiguration.getAlertEndTime());
|
|
|
|
|
+ int clearT = date1.compareTo(date2);
|
|
|
|
|
+ if(clearT==0 && alertConfiguration.getAlertNum() == 1){
|
|
|
|
|
+ alertConfiguration.setIsClearCache(true);
|
|
|
|
|
+ alertLog1.setIsClearCache(isClearCache);
|
|
|
|
|
+ }
|
|
|
|
|
+ alertLogService.insertAlertLog(alertLog1);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //创建两个日期对象1
|
|
|
|
|
+ public static Date getTimeStampV1(String now,SimpleDateFormat sdf,Date lertEndTime) throws ParseException {
|
|
|
|
|
+ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
+ // 设置时间部分为零点
|
|
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
|
|
+ if (StringUtils.isEmpty(now)){
|
|
|
|
|
+ calendar.setTime(dateFormat.parse(sdf.format(lertEndTime)));
|
|
|
|
|
+ }else {
|
|
|
|
|
+ calendar.setTime(dateFormat.parse(now));
|
|
|
|
|
+ }
|
|
|
|
|
+ calendar.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
|
+ calendar.set(Calendar.MINUTE, 0);
|
|
|
|
|
+ calendar.set(Calendar.SECOND, 0);
|
|
|
|
|
+ calendar.set(Calendar.MILLISECOND, 0);
|
|
|
|
|
+ Date date = calendar.getTime();
|
|
|
|
|
+ return date;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //创建两个日期对象2
|
|
|
|
|
+ public static Date getTimeStampV2(SimpleDateFormat sdf,Date lertEndTime) throws ParseException {
|
|
|
|
|
+ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
|
|
+ calendar.setTime(dateFormat.parse(sdf.format(lertEndTime)));
|
|
|
|
|
+ calendar.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
|
+ calendar.set(Calendar.MINUTE, 0);
|
|
|
|
|
+ calendar.set(Calendar.SECOND, 0);
|
|
|
|
|
+ calendar.set(Calendar.MILLISECOND, 0);
|
|
|
|
|
+ Date date = calendar.getTime();
|
|
|
|
|
+ return date;
|
|
|
|
|
+ }
|
|
|
|
|
+ //封装相同逻辑
|
|
|
|
|
+ public AlertLog initAlertLog(Long userId,Long alertId){
|
|
|
|
|
+ AlertLog alertLog1 = new AlertLog();
|
|
|
|
|
+ alertLog1.setAlertId(alertId);
|
|
|
|
|
+ alertLog1.setUserId(userId);
|
|
|
|
|
+ alertLog1.setAlertNum(1L);
|
|
|
|
|
+ return alertLog1;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
@ApiOperation(value = "点赞状态",notes = "参数:{userId:1,alertId:1,status:1}")
|
|
@ApiOperation(value = "点赞状态",notes = "参数:{userId:1,alertId:1,status:1}")
|
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|