项目增加最后更新时间
parent
c96422616d
commit
127b104237
|
@ -71,8 +71,8 @@ public class ProjectController extends BaseController{
|
|||
public void export(@RequestParam(value = "keywords",required = false) String keywords, HttpServletResponse httpServletResponse) throws IOException {
|
||||
Map<String, String> searchInfo = getSearchInfo(keywords);
|
||||
downloadHeader(httpServletResponse , Utils.generateExcelName("项目报表"), "application/octet-stream");
|
||||
String[] headers = {"项目名称","项目类型","项目状态","审核状态","当前审核人","项目创建者","部门名称","项目开始时间","项目结束时间"};
|
||||
String[] exportColumns = {"name","typeDesc","statusDesc","approveStatusDesc","approveName","creatorName","deptName","startDate","endDate"};
|
||||
String[] headers = {"项目名称","项目类型","项目状态","审核状态","当前审核人","项目创建者","部门名称","项目开始时间","项目结束时间","最后更新时间"};
|
||||
String[] exportColumns = {"name","typeDesc","statusDesc","approveStatusDesc","approveName","creatorName","deptName","startDate","endDate","lastUpdateTime"};
|
||||
ExportUtils.exportToExcel(headers, exportColumns, 1, 10000,
|
||||
httpServletResponse.getOutputStream(), (pN, pS) -> projectService.list(searchInfo, pN, pS).getList());
|
||||
}
|
||||
|
@ -261,6 +261,50 @@ public class ProjectController extends BaseController{
|
|||
|
||||
return ResponseMsg.buildSuccessMsg("成功");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 待我审核项目列表
|
||||
*/
|
||||
@RequestMapping("/listApprove")
|
||||
public String listApprove(@RequestParam(value = "keywords",required = false) String keywords,
|
||||
@RequestParam(value = PAGE_NUMBER, defaultValue = DEFAULT_PAGE_NUMBER) int pageNumber,
|
||||
@RequestParam(value = PAGE_SIZE, defaultValue = DEFAULT_PAGE_SIZE) int pageSize,
|
||||
Map<String, Object> model) {
|
||||
//当前登录人的角色类型
|
||||
model.put("keywords",keywords);
|
||||
model.put("deptList", deptRepository.findAll());
|
||||
ConcurrentHashMap<String, String> searchInfo = getSearchInfo(keywords,model);
|
||||
model.put("pager",projectService.list(searchInfo,pageNumber,pageSize));
|
||||
return "admin/project_list_approve";
|
||||
}
|
||||
|
||||
/**
|
||||
* 待我审核项目导出
|
||||
*/
|
||||
@RequestMapping("/exportApprove")
|
||||
public void exportApprove(@RequestParam(value = "keywords",required = false) String keywords, HttpServletResponse httpServletResponse) throws IOException {
|
||||
Map<String, String> searchInfo = getSearchInfo(keywords);
|
||||
downloadHeader(httpServletResponse , Utils.generateExcelName("待我审核项目报表"), "application/octet-stream");
|
||||
String[] headers = {"项目名称","项目类型","项目状态","审核状态","当前审核人","项目创建者","部门名称","项目开始时间","项目结束时间","最后更新时间"};
|
||||
String[] exportColumns = {"name","typeDesc","statusDesc","approveStatusDesc","approveName","creatorName","deptName","startDate","endDate","lastUpdateTime"};
|
||||
ExportUtils.exportToExcel(headers, exportColumns, 1, 10000,
|
||||
httpServletResponse.getOutputStream(), (pN, pS) -> projectService.list(searchInfo, pN, pS).getList());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@InitBinder
|
||||
public void initBinder(WebDataBinder webDataBinder){
|
||||
webDataBinder.addCustomFormatter(new DateFormatter("yyyy-MM-dd"));
|
||||
|
|
|
@ -150,6 +150,12 @@ public class Project {
|
|||
@Column(name = "create_time")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date createTime;
|
||||
/**
|
||||
* 最后更新时间
|
||||
*/
|
||||
@Column(name = "last_update_time")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date lastUpdateTime;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
|
@ -422,4 +428,12 @@ public class Project {
|
|||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Date getLastUpdateTime() {
|
||||
return lastUpdateTime;
|
||||
}
|
||||
|
||||
public void setLastUpdateTime(Date lastUpdateTime) {
|
||||
this.lastUpdateTime = lastUpdateTime;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -73,6 +73,16 @@ public class ProjectService {
|
|||
queryHelper.addCondition("p.start_date>=? AND p.end_date<=?", startTime, endTime);
|
||||
}
|
||||
|
||||
if(StrUtil.isNotEmpty(searchInfo.get("startUpdateDate"))){
|
||||
String time = searchInfo.get("startUpdateDate") + " 00:00:00";
|
||||
queryHelper.addCondition("p.last_update_time>=?", time);
|
||||
}
|
||||
if(StrUtil.isNotEmpty(searchInfo.get("endUpdateDate"))){
|
||||
String time = searchInfo.get("endUpdateDate") + " 00:00:00";
|
||||
queryHelper.addCondition("p.last_update_time<=?", time);
|
||||
}
|
||||
|
||||
|
||||
return queryHelper;
|
||||
}
|
||||
|
||||
|
@ -134,7 +144,9 @@ public class ProjectService {
|
|||
project.setDeptId(admin.getId());
|
||||
project.setDeptName("工程部");
|
||||
|
||||
project.setCreateTime(new Date());
|
||||
Date now = new Date();
|
||||
project.setCreateTime(now);
|
||||
project.setLastUpdateTime(now);
|
||||
|
||||
project = projectRepository.saveAndFlush(project);
|
||||
return project;
|
||||
|
@ -155,6 +167,8 @@ public class ProjectService {
|
|||
|
||||
p.setApproveStatusEstimate(approveStatusEnum.getApproveStatus());
|
||||
|
||||
p.setLastUpdateTime(new Date());
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<th class="am-text-middle">项目周期</th>
|
||||
<td colspan="3">
|
||||
<td>
|
||||
<div class="am-u-sm-10">
|
||||
<div class="am-form am-form-inline">
|
||||
<div class="am-form-group am-form-icon">
|
||||
|
@ -105,6 +105,25 @@
|
|||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<th class="am-text-middle">最后更新时间</th>
|
||||
<td>
|
||||
<div class="am-u-sm-10">
|
||||
<div class="am-form am-form-inline">
|
||||
<div class="am-form-group am-form-icon">
|
||||
<i class="am-icon-calendar"></i>
|
||||
<input type="text" class="am-form-field am-input-sm" id="startUpdateDate"
|
||||
value="${startUpdateDate!}" placeholder="开始日期" data-am-datepicker>
|
||||
</div>
|
||||
<div class="am-form-group">至</div>
|
||||
<div class="am-form-group am-form-icon">
|
||||
<i class="am-icon-calendar"></i>
|
||||
<input type="text" class="am-form-field am-input-sm" id="endUpdateDate"
|
||||
value="${endUpdateDate!}"
|
||||
placeholder="结束日期" data-am-datepicker>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
|
@ -155,6 +174,7 @@
|
|||
<th class="table-title">项目创建者</th>
|
||||
<th class="table-title">部门名称</th>
|
||||
<th class="table-title">项目周期</th>
|
||||
<th class="table-title">最后更新时间</th>
|
||||
<th class="table-title">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
@ -170,6 +190,7 @@
|
|||
<td>${list.creatorName!}</td>
|
||||
<td>${list.deptName!}</td>
|
||||
<td>${list.startDate?string("yyyy-MM")} ~ ${list.endDate?string("yyyy-MM")}</td>
|
||||
<td>${list.lastUpdateTime?string("yyyy-MM-dd HH:mm:ss")} ~ ${list.endDate?string("yyyy-MM-dd HH:mm:ss")}</td>
|
||||
<td>
|
||||
<div class="am-btn-toolbar">
|
||||
<div class="am-btn-group am-btn-group-xs">
|
||||
|
@ -254,6 +275,10 @@
|
|||
keywordsObj.startDate = $("#startDate").val();
|
||||
if ($("#endDate").val())
|
||||
keywordsObj.endDate = $("#endDate").val();
|
||||
if ($("#startUpdateDate").val())
|
||||
keywordsObj.startUpdateDate = $("#startUpdateDate").val();
|
||||
if ($("#endUpdateDate").val())
|
||||
keywordsObj.endDate = $("#endUpdateDate").val();
|
||||
var keywords = "";
|
||||
if (!$.isEmptyObject(keywordsObj)) {
|
||||
keywords = JSON.stringify(keywordsObj);
|
||||
|
|
Loading…
Reference in New Issue