Commit f4520004 by sunxin

基础资料 筛选条件增加

parent d43e465c
......@@ -14,6 +14,7 @@ import com.ejweb.modules.report.entity.CtBbtcRegion;
import com.ejweb.modules.report.entity.ReportEntity;
import com.ejweb.modules.report.service.CtBbtcBusCategoryService;
import com.ejweb.modules.report.service.CtBbtcBusTypeService;
import com.ejweb.modules.report.service.CtBbtcRegionService;
import com.ejweb.modules.report.service.ReportService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -50,6 +51,9 @@ public class CtBbtcBusCategoryController extends BaseController {
private CtBbtcBusTypeService ctBbtcBusTypeService;
@Autowired
private CtBbtcRegionService ctBbtcRegionService;
@Autowired
private ReportService reportService;
@ModelAttribute
......@@ -102,6 +106,18 @@ public class CtBbtcBusCategoryController extends BaseController {
public String list(CtBbtcBusCategory ctBbtcBusCategory, HttpServletRequest request, HttpServletResponse response, Model model) {
Page<CtBbtcBusCategory> page = ctBbtcBusCategoryService.findPage(new Page<CtBbtcBusCategory>(request, response), ctBbtcBusCategory);
model.addAttribute("page", page);
/*回显查询条件*/
if(StringUtils.isNotBlank(ctBbtcBusCategory.getSupplementArea())){
CtBbtcRegion ctBbtcRegion = ctBbtcRegionService.get(ctBbtcBusCategory.getSupplementArea());
ctBbtcBusCategory.setSupplementArea(ctBbtcRegion.getName());
}
if(StringUtils.isNotBlank(ctBbtcBusCategory.getTypeName())){
CtBbtcBusType ctBbtcBusType = ctBbtcBusTypeService.get(ctBbtcBusCategory.getTypeName());
ctBbtcBusCategory.setTypeName(ctBbtcBusType.getName());
}
model.addAttribute("ctBbtcBusCategory", ctBbtcBusCategory);
return "modules/report/ctBbtcBusCategoryList";
}
......
......@@ -66,7 +66,7 @@ public class CtBbtcRegionController extends BaseController {
@RequiresPermissions("report:ctBbtcRegion:view")
@RequestMapping(value = {"list", ""})
public String list(CtBbtcRegion ctBbtcRegion, HttpServletRequest request, HttpServletResponse response, Model model) {
Page<CtBbtcRegion> page = ctBbtcRegionService.findPage(new Page<CtBbtcRegion>(request, response), ctBbtcRegion);
Page<CtBbtcRegion> page = ctBbtcRegionService.findPage(new Page<CtBbtcRegion>(request, response), ctBbtcRegion);
model.addAttribute("page", page);
return "modules/report/ctBbtcRegionList";
}
......
......@@ -84,6 +84,11 @@ public class SysUserController extends BaseController {
if (user.getOffice()==null || user.getOffice().getId()==null){
user.setOffice(UserUtils.getUser().getOffice());
}
/*跟据id查询 */
if(StringUtils.isNotBlank(user.getId())){
user = systemService.getUser(user.getId());
}
model.addAttribute("user", user);
List<Role> roleList = systemService.findAllRole();
for (int i = roleList.size() - 1 ; i>0 ; i--) {
......
......@@ -41,7 +41,15 @@
FROM ct_bbtc_bus_category a
<include refid="ctBbtcBusCategoryJoins"/>
<where>
<if test="ctBbtcGroup != null and ctBbtcGroup != ''">
AND a.ctBbtcGroup = #{ctBbtcGroup}
</if>
<if test="typeName != null and typeName != ''">
AND a.type = #{typeName}
</if>
<if test="supplementArea != null and supplementArea != ''">
AND a.supplementArea = #{supplementArea}
</if>
<if test="name != null and name != ''">
AND a.name LIKE
<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
......
......@@ -44,6 +44,9 @@
<if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
<if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
</if>
<if test="group != null and group != ''">
AND a.supplement_group = #{group}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
......
......@@ -136,8 +136,10 @@
<select id="get" resultType="User">
SELECT
<include refid="userColumns"/>
,cr.name AS areaName
FROM ct_bbtc_sys_user a
<include refid="userJoins"/>
LEFT JOIN ct_bbtc_region CR ON a.area = CR.id
WHERE a.id = #{id}
</select>
......
......@@ -6,7 +6,8 @@
<meta name="decorator" content="default"/>
<script type="text/javascript">
$(document).ready(function() {
getRegion();
getType();
});
function page(n,s){
$("#pageNo").val(n);
......@@ -14,6 +15,84 @@
$("#searchForm").submit();
return false;
}
function getRegion(){
var selectNode = $("#supplementArea");
selectNode.empty();//每次需要将上一次的数据进行清空
$("#supplementArea").append("<option value=''>请选择</option>");
var ts_describe= $("#supplementGroup").val();
if(ts_describe != null && ts_describe != ''){
$.ajax({
type: "POST",
url: "${ctx}/report/ctBbtcRegion/getRegionList?groupId="+ts_describe,
dataType: "json",
success: function(returnedData) {
var data1 = returnedData.ctBbtcRegionList;
// console.log(data1[0].name);
// console.log(data2[0].name);
/* var selectNode = $("#area");
selectNode.empty();//每次需要将上一次的数据进行清空
$("#area").append("<option value=''>请选择</option>");*/
if (data1 != '') {
var slsb=document.getElementById("supplementArea");
for (var i = 0;i < data1.length;i++){
slsb.append(new Option(data1[i].name,data1[i].id));
}
}
var area="${ctBbtcBusCategory.supplementArea}";
if( area != null && area != ''){
$("#supplementArea").val(area);
}
},error:function(data){
alert(系统错误);
}
});
}else{
/* top.$.jBox.tip('请选择被举报集团', 'warning');*/
}
}
/*跟据 集团区域 查询类型*/
function getType(){
var selectNode = $("#supplementType");
selectNode.empty();//每次需要将上一次的数据进行清空
selectNode.append("<option value=''>请选择</option>");
var ts_describe1= $("#supplementGroup").val();
var ts_describe2= $("#supplementArea").val();
if(ts_describe1 != null && ts_describe1 != '' && ts_describe2 != null && ts_describe2 != '' ){
$.ajax({
type: "POST",
url: "${ctx}/report/ctBbtcBusType/getTypeList?groupId="+ts_describe1+"&area="+ts_describe2,
dataType: "json",
success: function(returnedData) {
var data2 = returnedData.ctBbtcTypeList;
if (data2 != '') {
var slsb=document.getElementById("supplementType");
for (var i = 0;i < data2.length;i++){
slsb.append(new Option(data2[i].typeName,data2[i].parentId));
}
}
var type="${ctBbtcBusCategory.typeName}";
if( type != null && type != ''){
$("#supplementType").val(type);
}
},error:function(data){
alert("系统错误");
}
});
}else{
/*top.$.jBox.tip('请选择所属集团', 'warning');*/
}
}
function resetPageNo() {
$("#pageNo").val(0);
}
</script>
</head>
<body>
......@@ -25,11 +104,35 @@
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
<ul class="ul-form">
<li><label style="width: auto;">业务类别名称:</label>
<li><label>所属集团:</label>
<form:select id="supplementGroup" path="ctBbtcGroup" class="input-small required" onchange="getRegion()" cssStyle="width: 160px">
<form:option value="">请选择</form:option>
<form:options items="${fns:getDictList('supplement_group')}" itemLabel="label" itemValue="id"
htmlEscape="false"/>
</form:select>
</li>
<li><label>所属区域:</label>
<%-- <select id="supplementArea" path="supplementArea" class="input-small required" onchange="resetPageNo();">
<option value="">请选择</option>
&lt;%&ndash;<options items="${ctBbtcRegionList}" itemLabel="name" itemValue="id"&ndash;%&gt;
&lt;%&ndash;htmlEscape="false"/></select>&ndash;%&gt;
</select>--%>
<form:select id="supplementArea" onchange="getType();" path="supplementArea" class="input-medium " cssStyle="width: 160px" htmlEscape="false">
<form:option value="">请选择</form:option>
</form:select>
</li>
<li><label>业务类型:</label>
<form:select id="supplementType" onchange="resetPageNo();" path="typeName" class="input-small required" cssStyle="width: 160px">
<form:option value="">请选择</form:option>
</form:select>
</li>
<li>&nbsp;&nbsp;<label style="width: auto;">业务类别名称:</label>
<form:input path="name" htmlEscape="false" maxlength="255" class="input-medium"/>
</li>
<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
<li class="clearfix"></li>
</ul>
</form:form>
<sys:message content="${message}"/>
......
......@@ -25,6 +25,13 @@
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
<ul class="ul-form">
<li><label>所属集团:</label>
<form:select onchange="resetPageNo();" path="group" class="input-xlarge required" cssStyle="width: 230px">
<form:option value="">请选择</form:option>
<form:options items="${fns:getDictList('supplement_group')}" itemLabel="label" itemValue="id"
htmlEscape="false"/>
</form:select>
</li>
<li><label>区域名称:</label>
<form:input path="name" htmlEscape="false" maxlength="255" class="input-medium"/>
</li>
......
......@@ -55,6 +55,10 @@
slsb.append(new Option(data1[i].name,data1[i].id));
}
}
var supplementArea="${user.areaName}";
if( supplementArea != null && supplementArea != ''){
$("#supplementArea").val(supplementArea);
}
},error:function(data){
alert("系统错误");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment