检索历史修改
This commit is contained in:
+10
@@ -130,6 +130,16 @@ public class MybatisInterceptor implements Interceptor {
|
|||||||
ReflectionUtils.setField(field,parameter,sysUser.getOrgCode());
|
ReflectionUtils.setField(field,parameter,sysUser.getOrgCode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 注入逻辑删除默认值
|
||||||
|
if ("delFlag".equals(field.getName())) {
|
||||||
|
ReflectionUtils.makeAccessible(field);
|
||||||
|
Object localDelFlag = ReflectionUtils.getField(field,parameter);
|
||||||
|
if (localDelFlag == null || "".equals(localDelFlag)) {
|
||||||
|
// 登录人账号
|
||||||
|
ReflectionUtils.makeAccessible(field);
|
||||||
|
ReflectionUtils.setField(field,parameter,"0");
|
||||||
|
}
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("异常", e);
|
log.error("异常", e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -136,4 +136,27 @@ public class DateUtil {
|
|||||||
|
|
||||||
return dayStrings;
|
return dayStrings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author LQT
|
||||||
|
* @date 2023/11/16 9:24
|
||||||
|
* @param d 当前时间
|
||||||
|
* @param i 月份个月 比如 -3 为当前时间的前三个月 3 为当前时间后三个月
|
||||||
|
* @return java.util.List<java.lang.String>
|
||||||
|
*/
|
||||||
|
public static String getLastDate(Date d, int i) {
|
||||||
|
//得到日历
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
//把当前时间赋给日历
|
||||||
|
calendar.setTime(d);
|
||||||
|
//设置为前3月
|
||||||
|
calendar.add(Calendar.MONTH, i);
|
||||||
|
//得到前3月的时间
|
||||||
|
Date dBefore = calendar.getTime();
|
||||||
|
//设置时间格式
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
//格式化前3月的时间
|
||||||
|
return sdf.format(dBefore);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+8
@@ -10,6 +10,7 @@ import com.jero.common.system.base.controller.JeroController;
|
|||||||
import com.jero.common.system.query.QueryGenerator;
|
import com.jero.common.system.query.QueryGenerator;
|
||||||
import com.jero.common.util.MessageUtils;
|
import com.jero.common.util.MessageUtils;
|
||||||
import com.jero.common.api.vo.ResultCommon;
|
import com.jero.common.api.vo.ResultCommon;
|
||||||
|
import com.jero.modules.laws.common.util.DateUtil;
|
||||||
import com.jero.modules.laws.home.entity.LawsHomeNormalSearchHistory;
|
import com.jero.modules.laws.home.entity.LawsHomeNormalSearchHistory;
|
||||||
import com.jero.modules.laws.home.service.ILawsHomeNormalSearchHistoryService;
|
import com.jero.modules.laws.home.service.ILawsHomeNormalSearchHistoryService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@@ -21,7 +22,10 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
@@ -53,6 +57,10 @@ public class LawsHomeNormalSearchHistoryController extends JeroController<LawsHo
|
|||||||
HttpServletRequest req) {
|
HttpServletRequest req) {
|
||||||
QueryWrapper<LawsHomeNormalSearchHistory> queryWrapper = QueryGenerator.initQueryWrapper(lawsHomeNormalSearchHistory, req.getParameterMap());
|
QueryWrapper<LawsHomeNormalSearchHistory> queryWrapper = QueryGenerator.initQueryWrapper(lawsHomeNormalSearchHistory, req.getParameterMap());
|
||||||
Page<LawsHomeNormalSearchHistory> page = new Page<>(pageNo, pageSize);
|
Page<LawsHomeNormalSearchHistory> page = new Page<>(pageNo, pageSize);
|
||||||
|
// 三月前
|
||||||
|
String lastDate = DateUtil.getLastDate(new Date(), -3);
|
||||||
|
queryWrapper.ge("create_time",lastDate + " 00:00:00");
|
||||||
|
queryWrapper.orderByDesc("id");
|
||||||
IPage<LawsHomeNormalSearchHistory> pageList = lawsHomeNormalSearchHistoryService.page(page,queryWrapper);
|
IPage<LawsHomeNormalSearchHistory> pageList = lawsHomeNormalSearchHistoryService.page(page,queryWrapper);
|
||||||
return Result.OK(pageList);
|
return Result.OK(pageList);
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -46,8 +46,8 @@ public class LawsHomeNormalSearchHistory implements Serializable {
|
|||||||
private String createBy;
|
private String createBy;
|
||||||
|
|
||||||
/**创建日期*/
|
/**创建日期*/
|
||||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy年MM月dd EEEE")
|
||||||
@DateTimeFormat(pattern="yyyy年MM月dd EEEE")
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
@ApiModelProperty(value = "创建日期")
|
@ApiModelProperty(value = "创建日期")
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user