列表筛选项折叠效果
parent
c53df0d684
commit
ad04d75ac8
|
@ -95,6 +95,7 @@ public class ProjectController extends BaseController {
|
|||
model.put("admin", InterfaceUtil.getAdmin());
|
||||
model.put("deptList", deptService.findAll());
|
||||
ConcurrentHashMap<String, String> searchInfo = getSearchInfo(keywords, model);
|
||||
model.putIfAbsent("extend", "0");
|
||||
Page<Project> page = projectService.list(searchInfo, pageNumber, pageSize);
|
||||
List<Project> list = page.getList();
|
||||
if(CollectionUtil.isNotEmpty(list)){
|
||||
|
|
|
@ -59,6 +59,13 @@ public class ProjectService {
|
|||
if(StrUtil.isNotEmpty(searchInfo.get("status")) && !"-1".equals(searchInfo.get("status"))){
|
||||
queryHelper.addCondition("p.status=?", Integer.parseInt(searchInfo.get("status")));
|
||||
}
|
||||
queryHelper.addCondition(StrUtil.isNotEmpty(searchInfo.get("projectNo")),"p.project_no LIKE ?", "%"+searchInfo.get("projectNo")+"%");
|
||||
queryHelper.addCondition(StrUtil.isNotEmpty(searchInfo.get("name")),"p.name LIKE ?", "%"+searchInfo.get("name")+"%");
|
||||
queryHelper.addCondition(StrUtil.isNotEmpty(searchInfo.get("creatorName")),"p.creator_name LIKE ?", "%"+searchInfo.get("creatorName")+"%");
|
||||
queryHelper.addCondition(StrUtil.isNotEmpty(searchInfo.get("customer")),"p.customer LIKE ?", "%"+searchInfo.get("customer")+"%");
|
||||
queryHelper.addCondition(StrUtil.isNotEmpty(searchInfo.get("terminalCustomer")),"p.terminal_customer LIKE ?", "%"+searchInfo.get("terminalCustomer")+"%");
|
||||
queryHelper.addCondition(StrUtil.isNotEmpty(searchInfo.get("principal")),"p.principal LIKE ?", "%"+searchInfo.get("principal")+"%");
|
||||
|
||||
///
|
||||
/*if(StrUtil.isNotEmpty(searchInfo.get("approveId"))){
|
||||
int approveId = Integer.parseInt(searchInfo.get("approveId"));
|
||||
|
@ -79,63 +86,60 @@ public class ProjectService {
|
|||
if(StrUtil.isNotEmpty(searchInfo.get("type")) && !"-1".equals(searchInfo.get("type"))){
|
||||
queryHelper.addCondition("p.type=?", Integer.parseInt(searchInfo.get("type")));
|
||||
}
|
||||
if(StrUtil.isNotEmpty(searchInfo.get("isSecond")) && !"-1".equals(searchInfo.get("isSecond"))){
|
||||
queryHelper.addCondition("p.is_second=?", Integer.parseInt(searchInfo.get("isSecond")));
|
||||
}
|
||||
if(StrUtil.isNotEmpty(searchInfo.get("signType")) && !"-1".equals(searchInfo.get("signType"))){
|
||||
queryHelper.addCondition("p.sign_type=?", Integer.parseInt(searchInfo.get("signType")));
|
||||
}
|
||||
if(StrUtil.isNotEmpty(searchInfo.get("resolvePlan")) && !"-1".equals(searchInfo.get("resolvePlan"))){
|
||||
queryHelper.addCondition("p.resolve_plan=?", Integer.parseInt(searchInfo.get("resolvePlan")));
|
||||
}
|
||||
if(StrUtil.isNotEmpty(searchInfo.get("underwrittenMode")) && !"-1".equals(searchInfo.get("underwrittenMode"))){
|
||||
queryHelper.addCondition("p.underwritten_mode=?", Integer.parseInt(searchInfo.get("underwrittenMode")));
|
||||
}
|
||||
if(StrUtil.isNotEmpty(searchInfo.get("certainty")) && !"-1".equals(searchInfo.get("certainty"))){
|
||||
queryHelper.addCondition("p.certainty=?", Integer.parseInt(searchInfo.get("certainty")));
|
||||
}
|
||||
queryHelper.addCondition(StrUtil.isNotEmpty(searchInfo.get("projectNo")),"p.project_no LIKE ?", "%"+searchInfo.get("projectNo")+"%");
|
||||
queryHelper.addCondition(StrUtil.isNotEmpty(searchInfo.get("name")),"p.name LIKE ?", "%"+searchInfo.get("name")+"%");
|
||||
queryHelper.addCondition(StrUtil.isNotEmpty(searchInfo.get("creatorName")),"p.creator_name LIKE ?", "%"+searchInfo.get("creatorName")+"%");
|
||||
queryHelper.addCondition(StrUtil.isNotEmpty(searchInfo.get("industryScenario")),"p.industry_scenario LIKE ?", "%"+searchInfo.get("industryScenario")+"%");
|
||||
queryHelper.addCondition(StrUtil.isNotEmpty(searchInfo.get("customer")),"p.customer LIKE ?", "%"+searchInfo.get("customer")+"%");
|
||||
queryHelper.addCondition(StrUtil.isNotEmpty(searchInfo.get("terminalCustomer")),"p.terminal_customer LIKE ?", "%"+searchInfo.get("terminalCustomer")+"%");
|
||||
queryHelper.addCondition(StrUtil.isNotEmpty(searchInfo.get("principal")),"p.principal LIKE ?", "%"+searchInfo.get("principal")+"%");
|
||||
/**
|
||||
* 只选择了一个时间的情况,就项目时间包括这个时间的
|
||||
*/
|
||||
if(StrUtil.isNotEmpty(searchInfo.get("startDate")) && StrUtil.isEmpty(searchInfo.get("endDate"))){
|
||||
String time = searchInfo.get("startDate") + " 00:00:00";
|
||||
queryHelper.addCondition("p.start_date<=? AND p.end_date>=?", time, time);
|
||||
}
|
||||
if(StrUtil.isNotEmpty(searchInfo.get("endDate")) && StrUtil.isEmpty(searchInfo.get("startDate"))){
|
||||
String time = searchInfo.get("endDate") + " 00:00:00";
|
||||
queryHelper.addCondition("p.start_date<=? AND p.end_date>=?", time, time);
|
||||
}
|
||||
/**
|
||||
* 两个时间都选了,则包含项目时间
|
||||
*/
|
||||
if(StrUtil.isNotEmpty(searchInfo.get("startDate")) && StrUtil.isNotEmpty(searchInfo.get("endDate"))){
|
||||
String startTime = searchInfo.get("startDate") + " 00:00:00";
|
||||
String endTime = searchInfo.get("endDate") + " 23:59:59";
|
||||
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);
|
||||
}
|
||||
if(StrUtil.isNotEmpty(searchInfo.get("contractStartTime"))){
|
||||
String time = searchInfo.get("contractStartTime") + " 00:00:00";
|
||||
queryHelper.addCondition("p.contract_time>=?", time);
|
||||
}
|
||||
if(StrUtil.isNotEmpty(searchInfo.get("contractEndTime"))){
|
||||
String time = searchInfo.get("contractEndTime") + " 00:00:00";
|
||||
queryHelper.addCondition("p.contract_time<=?", time);
|
||||
if(StrUtil.isNotEmpty(searchInfo.get("extend")) && "0".equals(searchInfo.get("extend"))) {
|
||||
if (StrUtil.isNotEmpty(searchInfo.get("isSecond")) && !"-1".equals(searchInfo.get("isSecond"))) {
|
||||
queryHelper.addCondition("p.is_second=?", Integer.parseInt(searchInfo.get("isSecond")));
|
||||
}
|
||||
if (StrUtil.isNotEmpty(searchInfo.get("signType")) && !"-1".equals(searchInfo.get("signType"))) {
|
||||
queryHelper.addCondition("p.sign_type=?", Integer.parseInt(searchInfo.get("signType")));
|
||||
}
|
||||
if (StrUtil.isNotEmpty(searchInfo.get("resolvePlan")) && !"-1".equals(searchInfo.get("resolvePlan"))) {
|
||||
queryHelper.addCondition("p.resolve_plan=?", Integer.parseInt(searchInfo.get("resolvePlan")));
|
||||
}
|
||||
queryHelper.addCondition(StrUtil.isNotEmpty(searchInfo.get("industryScenario")), "p.industry_scenario LIKE ?", "%" + searchInfo.get("industryScenario") + "%");
|
||||
/**
|
||||
* 只选择了一个时间的情况,就项目时间包括这个时间的
|
||||
*/
|
||||
if (StrUtil.isNotEmpty(searchInfo.get("startDate")) && StrUtil.isEmpty(searchInfo.get("endDate"))) {
|
||||
String time = searchInfo.get("startDate") + " 00:00:00";
|
||||
queryHelper.addCondition("p.start_date<=? AND p.end_date>=?", time, time);
|
||||
}
|
||||
if (StrUtil.isNotEmpty(searchInfo.get("endDate")) && StrUtil.isEmpty(searchInfo.get("startDate"))) {
|
||||
String time = searchInfo.get("endDate") + " 00:00:00";
|
||||
queryHelper.addCondition("p.start_date<=? AND p.end_date>=?", time, time);
|
||||
}
|
||||
/**
|
||||
* 两个时间都选了,则包含项目时间
|
||||
*/
|
||||
if (StrUtil.isNotEmpty(searchInfo.get("startDate")) && StrUtil.isNotEmpty(searchInfo.get("endDate"))) {
|
||||
String startTime = searchInfo.get("startDate") + " 00:00:00";
|
||||
String endTime = searchInfo.get("endDate") + " 23:59:59";
|
||||
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);
|
||||
}
|
||||
if (StrUtil.isNotEmpty(searchInfo.get("contractStartTime"))) {
|
||||
String time = searchInfo.get("contractStartTime") + " 00:00:00";
|
||||
queryHelper.addCondition("p.contract_time>=?", time);
|
||||
}
|
||||
if (StrUtil.isNotEmpty(searchInfo.get("contractEndTime"))) {
|
||||
String time = searchInfo.get("contractEndTime") + " 00:00:00";
|
||||
queryHelper.addCondition("p.contract_time<=?", time);
|
||||
}
|
||||
}
|
||||
|
||||
//项目可见性,根据角色和人员id
|
||||
|
|
|
@ -145,7 +145,7 @@
|
|||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<tr class="extendCondition" <#if extend='1'> hidden</#if>>
|
||||
<th class="am-text-middle" style="width: 10%">是否二次合作</th>
|
||||
<td style="width: 15%">
|
||||
<div class="am-u-sm-10">
|
||||
|
@ -185,7 +185,7 @@
|
|||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<tr class="extendCondition" <#if extend='1'> hidden</#if>>
|
||||
<th class="am-text-middle" style="width: 10%">最后更新时间</th>
|
||||
<td style="width: 15%">
|
||||
<div class="am-u-sm-10">
|
||||
|
@ -248,6 +248,9 @@
|
|||
<tr>
|
||||
<td colspan="8">
|
||||
<div align='right'>
|
||||
<button type="button" class="am-btn am-btn-default am-btn-sm am-text-secondary"
|
||||
id="extend" value="${extend!}">隐藏筛选项
|
||||
</button>
|
||||
<@shiro.hasPermission name="PROJECT_QUERY">
|
||||
<button type="button" class="am-btn am-btn-default am-btn-sm am-text-secondary"
|
||||
id="submit-btn">搜索
|
||||
|
@ -652,6 +655,19 @@
|
|||
|
||||
$(function () {
|
||||
|
||||
$("#extend").on("click", function () {
|
||||
var extend = $("#extend").val();
|
||||
if (extend === '0') {
|
||||
$(".extendCondition").hide();
|
||||
$("#extend").val(1);
|
||||
$("#extend").text("扩展筛选项");
|
||||
} else {
|
||||
$(".extendCondition").show();
|
||||
$("#extend").val(0);
|
||||
$("#extend").text("隐藏筛选项");
|
||||
}
|
||||
});
|
||||
|
||||
$("#submit-btn").on("click", function () {
|
||||
$("#pageNumber").val(1);
|
||||
setKeywords();
|
||||
|
@ -668,6 +684,8 @@
|
|||
|
||||
function setKeywords() {
|
||||
var keywordsObj = {};
|
||||
var extend = $("#extend").val();
|
||||
keywordsObj.extend = extend;
|
||||
if ($("#projectNo").val())
|
||||
keywordsObj.projectNo = $("#projectNo").val();
|
||||
if ($("#name").val())
|
||||
|
@ -676,12 +694,6 @@
|
|||
keywordsObj.creatorName = $("#creatorName").val();
|
||||
if ($("#status").val())
|
||||
keywordsObj.status = $("#status").val();
|
||||
if ($("#isSecond").val())
|
||||
keywordsObj.isSecond = $("#isSecond").val();
|
||||
if ($("#signType").val())
|
||||
keywordsObj.signType = $("#signType").val();
|
||||
if ($("#resolvePlan").val())
|
||||
keywordsObj.resolvePlan = $("#resolvePlan").val();
|
||||
if ($("#approveStatus").val())
|
||||
keywordsObj.approveStatus = $("#approveStatus").val();
|
||||
if ($("#deptId").val())
|
||||
|
@ -692,26 +704,34 @@
|
|||
keywordsObj.underwrittenMode = $("#underwrittenMode").val();
|
||||
if ($("#certainty").val())
|
||||
keywordsObj.certainty = $("#certainty").val();
|
||||
if ($("#industryScenario").val())
|
||||
keywordsObj.industryScenario = $("#industryScenario").val();
|
||||
if (extend === '0') {
|
||||
if ($("#isSecond").val())
|
||||
keywordsObj.isSecond = $("#isSecond").val();
|
||||
if ($("#signType").val())
|
||||
keywordsObj.signType = $("#signType").val();
|
||||
if ($("#resolvePlan").val())
|
||||
keywordsObj.resolvePlan = $("#resolvePlan").val();
|
||||
if ($("#startDate").val())
|
||||
keywordsObj.startDate = $("#startDate").val();
|
||||
if ($("#endDate").val())
|
||||
keywordsObj.endDate = $("#endDate").val();
|
||||
if ($("#startUpdateDate").val())
|
||||
keywordsObj.startUpdateDate = $("#startUpdateDate").val();
|
||||
if ($("#endUpdateDate").val())
|
||||
keywordsObj.endUpdateDate = $("#endUpdateDate").val();
|
||||
if ($("#contractStartTime").val())
|
||||
keywordsObj.contractStartTime = $("#contractStartTime").val();
|
||||
if ($("#contractEndTime").val())
|
||||
keywordsObj.contractEndTime = $("#contractEndTime").val();
|
||||
if ($("#industryScenario").val())
|
||||
keywordsObj.industryScenario = $("#industryScenario").val();
|
||||
}
|
||||
if ($("#customer").val())
|
||||
keywordsObj.customer = $("#customer").val();
|
||||
if ($("#terminalCustomer").val())
|
||||
keywordsObj.terminalCustomer = $("#terminalCustomer").val();
|
||||
if ($("#principal").val())
|
||||
keywordsObj.principal = $("#principal").val();
|
||||
if ($("#startDate").val())
|
||||
keywordsObj.startDate = $("#startDate").val();
|
||||
if ($("#endDate").val())
|
||||
keywordsObj.endDate = $("#endDate").val();
|
||||
if ($("#startUpdateDate").val())
|
||||
keywordsObj.startUpdateDate = $("#startUpdateDate").val();
|
||||
if ($("#endUpdateDate").val())
|
||||
keywordsObj.endUpdateDate = $("#endUpdateDate").val();
|
||||
if ($("#contractStartTime").val())
|
||||
keywordsObj.contractStartTime = $("#contractStartTime").val();
|
||||
if ($("#contractEndTime").val())
|
||||
keywordsObj.contractEndTime = $("#contractEndTime").val();
|
||||
var keywords = "";
|
||||
if (!$.isEmptyObject(keywordsObj)) {
|
||||
keywords = JSON.stringify(keywordsObj);
|
||||
|
|
Loading…
Reference in New Issue