Преглед изворни кода

入职奖励岗位取消热门相关

LiFei пре 4 година
родитељ
комит
b7fde04c8e

+ 30 - 1
happy-job-base-system/src/main/webapp/webpage/modules/hpposition/hpRewardPositionList.js

@@ -136,7 +136,7 @@ $(document).ready(function() {
                    }
                    }
                    ,{
                    ,{
                        field: 'positionStatus',
                        field: 'positionStatus',
-                       title: '状态',
+                       title: '职位状态',
                        sortable: false,
                        sortable: false,
                        sortName: 'positionStatus',
                        sortName: 'positionStatus',
                        formatter:function(value, row , index){
                        formatter:function(value, row , index){
@@ -150,6 +150,16 @@ $(document).ready(function() {
 
 
                    }
                    }
                    ,{
                    ,{
+                       field: 'isHot',
+                       title: '热门状态',
+                       sortable: false,
+                       sortName: 'isHot',
+                       formatter:function(value, row , index){
+                           return jp.getDictLabel(${fns:toJson(fns:getDictList('is_hot'))}, value, "-");
+                       }
+
+                   }
+                   ,{
                        field: 'positionCategory',
                        field: 'positionCategory',
                        title: '职位类型',
                        title: '职位类型',
                        sortable: false,
                        sortable: false,
@@ -251,6 +261,7 @@ $(document).ready(function() {
                 'check-all.bs.table uncheck-all.bs.table', function () {
                 'check-all.bs.table uncheck-all.bs.table', function () {
             $('#remove').prop('disabled', ! $('#hpRewardPositionTable').bootstrapTable('getSelections').length);
             $('#remove').prop('disabled', ! $('#hpRewardPositionTable').bootstrapTable('getSelections').length);
             $('#publishAll').prop('disabled', ! $('#hpRewardPositionTable').bootstrapTable('getSelections').length);
             $('#publishAll').prop('disabled', ! $('#hpRewardPositionTable').bootstrapTable('getSelections').length);
+          $('#cancelHot').prop('disabled', ! $('#hpRewardPositionTable').bootstrapTable('getSelections').length);
             $('#downAll').prop('disabled', ! $('#hpRewardPositionTable').bootstrapTable('getSelections').length);
             $('#downAll').prop('disabled', ! $('#hpRewardPositionTable').bootstrapTable('getSelections').length);
             $('#view,#edit').prop('disabled', $('#hpRewardPositionTable').bootstrapTable('getSelections').length!=1);
             $('#view,#edit').prop('disabled', $('#hpRewardPositionTable').bootstrapTable('getSelections').length!=1);
         });
         });
@@ -467,6 +478,24 @@ function hot(id,isHot) {
 }
 }
 
 
 
 
+    function cancelHot(){
+        jp.confirm('确认将该岗位记录取消热门吗?', function(){
+            jp.loading();
+            jp.get("${ctx}/hpposition/hpRewardPosition/cancelHot?ids=" + getIdSelections(), function(data){
+                if(data.success){
+                    $('#hpRewardPositionTable').bootstrapTable('refresh');
+                    jp.success(data.msg);
+                }else{
+                    jp.error(data.msg);
+                }
+            })
+
+        })
+    }
+
+
+
+
 //再次发布
 //再次发布
 function rePublish(id) {
 function rePublish(id) {
     jp.go("${ctx}/hpposition/hpRewardPosition/form/rePublish?id=" + id);
     jp.go("${ctx}/hpposition/hpRewardPosition/form/rePublish?id=" + id);

+ 19 - 7
happy-job-base-system/src/main/webapp/webpage/modules/hpposition/hpRewardPositionList.jsp

@@ -50,15 +50,15 @@
 	<div id="search-collapse" class="collapse">
 	<div id="search-collapse" class="collapse">
 		<div class="accordion-inner">
 		<div class="accordion-inner">
 			<form:form id="searchForm" modelAttribute="hpRewardPosition" class="form form-horizontal well clearfix">
 			<form:form id="searchForm" modelAttribute="hpRewardPosition" class="form form-horizontal well clearfix">
-			 <div class="col-xs-12 col-sm-3 col-md-2">
+			 <div class="col-xs-12 col-sm-4 col-md-3">
 				<label class="label-item single-overflow pull-left" title="岗位名称:">岗位名称:</label>
 				<label class="label-item single-overflow pull-left" title="岗位名称:">岗位名称:</label>
 				<form:input path="positionName" htmlEscape="false" maxlength="100" class="form-control input-sm" />
 				<form:input path="positionName" htmlEscape="false" maxlength="100" class="form-control input-sm" />
 			</div>
 			</div>
-			 <div class="col-xs-12 col-sm-3 col-md-2">
+			 <div class="col-xs-12 col-sm-4 col-md-3">
 				<label class="label-item single-overflow pull-left" title="所属公司:">所属公司:</label>
 				<label class="label-item single-overflow pull-left" title="所属公司:">所属公司:</label>
 				<form:input path="hpCompany.companyName" htmlEscape="false" maxlength="11" class="form-control input-sm" />
 				<form:input path="hpCompany.companyName" htmlEscape="false" maxlength="11" class="form-control input-sm" />
 			</div>
 			</div>
-			 <div class="col-xs-12 col-sm-3 col-md-2">
+			 <div class="col-xs-12 col-sm-4 col-md-3">
 				<div class="form-group">
 				<div class="form-group">
 					<label class="label-item single-overflow pull-left" title="发布时间:">&nbsp;发布时间:</label>
 					<label class="label-item single-overflow pull-left" title="发布时间:">&nbsp;发布时间:</label>
 					<div class="col-xs-12">
 					<div class="col-xs-12">
@@ -71,7 +71,7 @@
 					</div>
 					</div>
 				</div>
 				</div>
 			</div>
 			</div>
-			 <div class="col-xs-12 col-sm-3 col-md-2">
+			 <div class="col-xs-12 col-sm-4 col-md-3">
 				<div class="form-group">
 				<div class="form-group">
 					<label class="label-item single-overflow pull-left" title="截至时间:">&nbsp;截至时间:</label>
 					<label class="label-item single-overflow pull-left" title="截至时间:">&nbsp;截至时间:</label>
 					<div class="col-xs-12">
 					<div class="col-xs-12">
@@ -84,7 +84,7 @@
 					</div>
 					</div>
 				</div>
 				</div>
 			</div>
 			</div>
-			 <div class="col-xs-12 col-sm-3 col-md-2">
+			 <div class="col-xs-12 col-sm-4 col-md-3">
 				<div class="form-group">
 				<div class="form-group">
 					<label class="label-item single-overflow pull-left" title="更新时间:">&nbsp;更新时间:</label>
 					<label class="label-item single-overflow pull-left" title="更新时间:">&nbsp;更新时间:</label>
 					<div class="col-xs-12">
 					<div class="col-xs-12">
@@ -97,14 +97,21 @@
 					</div>
 					</div>
 				</div>
 				</div>
 			</div>
 			</div>
-				<div class="col-xs-12 col-sm-3 col-md-2">
+				<div class="col-xs-12 col-sm-4 col-md-3">
 					<label class="label-item single-overflow pull-left" title="职位状态:">职位状态:</label>
 					<label class="label-item single-overflow pull-left" title="职位状态:">职位状态:</label>
 					<form:select path="positionStatus" class="form-control input-sm m-b">
 					<form:select path="positionStatus" class="form-control input-sm m-b">
 						<form:option value="" label="全部"/>
 						<form:option value="" label="全部"/>
 						<form:options items="${fns:getDictList('position_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
 						<form:options items="${fns:getDictList('position_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
 					</form:select>
 					</form:select>
 				</div>
 				</div>
-		 <div class="col-xs-12 col-sm-3 col-md-2">
+				<div class="col-xs-12 col-sm-4 col-md-3">
+					<label class="label-item single-overflow pull-left" title="热门状态:">热门状态:</label>
+					<form:select path="isHot"  class="form-control input-sm m-b">
+						<form:option value="" label="全部"/>
+						<form:options items="${fns:getDictList('is_hot')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+					</form:select>
+				</div>
+		 <div class="col-xs-12 col-sm-4 col-md-3">
 			<div style="margin-top:26px">
 			<div style="margin-top:26px">
 			  <a  id="search" class="btn btn-primary btn-rounded  btn-bordered btn-sm"><i class="fa fa-search"></i> 查询</a>
 			  <a  id="search" class="btn btn-primary btn-rounded  btn-bordered btn-sm"><i class="fa fa-search"></i> 查询</a>
 			  <a  id="reset" class="btn btn-primary btn-rounded  btn-bordered btn-sm" ><i class="fa fa-refresh"></i> 重置</a>
 			  <a  id="reset" class="btn btn-primary btn-rounded  btn-bordered btn-sm" ><i class="fa fa-refresh"></i> 重置</a>
@@ -126,6 +133,11 @@
 				<i class="glyphicon glyphicon-refresh"></i> 刷新
 				<i class="glyphicon glyphicon-refresh"></i> 刷新
 			</button>
 			</button>
 		</shiro:hasPermission>
 		</shiro:hasPermission>
+		<shiro:hasPermission name="hpposition:hpRewardPosition:cancelHot">
+			<button id="cancelHot" class="btn btn-success" disabled onclick="cancelHot()">
+				<i class="glyphicon glyphicon-remove"></i>取消热门
+			</button>
+		</shiro:hasPermission>
 		<shiro:hasPermission name="hpposition:hpRewardPosition:del">
 		<shiro:hasPermission name="hpposition:hpRewardPosition:del">
 			<button id="downAll" class="btn btn-danger" disabled onclick="downAll()">
 			<button id="downAll" class="btn btn-danger" disabled onclick="downAll()">
 				<i class="glyphicon glyphicon-remove"></i> 下架
 				<i class="glyphicon glyphicon-remove"></i> 下架

+ 4 - 0
happy-job-module-hpjob/src/main/java/com/jeeplus/modules/hpposition/mapper/xml/HpRewardPositionMapper.xml

@@ -175,6 +175,10 @@
 				AND a.is_publish =0
 				AND a.is_publish =0
 				and a.del_flag = #{DEL_FLAG_NORMAL}
 				and a.del_flag = #{DEL_FLAG_NORMAL}
 			</if>
 			</if>
+			<if test="isHot != null">
+				AND a.is_hot =#{isHot}
+				and a.del_flag = #{DEL_FLAG_NORMAL}
+			</if>
 		</where>
 		</where>
 		<choose>
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">

+ 11 - 0
happy-job-module-hpjob/src/main/java/com/jeeplus/modules/hpposition/service/HpRewardPositionService.java

@@ -271,4 +271,15 @@ public class HpRewardPositionService extends CrudService<HpRewardPositionMapper,
     public void updateForQrcode(HpRewardPosition hpRewardPosition) {
     public void updateForQrcode(HpRewardPosition hpRewardPosition) {
         mapper.updateForQrcode(hpRewardPosition);
         mapper.updateForQrcode(hpRewardPosition);
     }
     }
+
+    @Transactional(readOnly = false)
+    public void cancelHotMany(String[] idArray) {
+        for(String id:idArray){
+            HpRewardPosition hpRewardPosition=get(id);
+            if(hpRewardPosition.getIsHot()){
+                hpRewardPosition.setIsHot(false);
+                save(hpRewardPosition);
+            }
+        }
+    }
 }
 }

+ 14 - 0
happy-job-module-hpjob/src/main/java/com/jeeplus/modules/hpposition/web/HpRewardPositionController.java

@@ -320,4 +320,18 @@ public class HpRewardPositionController extends BaseController {
         return j;
         return j;
     }
     }
 
 
+    /**
+     * 批量岗位取消热门
+     */
+    @ResponseBody
+    @RequiresPermissions("hpposition:hpRewardPosition:cancelHot")
+    @RequestMapping(value = "cancelHot")
+    public AjaxJson cancelHot(String ids) {
+        AjaxJson j = new AjaxJson();
+        String idArray[] = ids.split(",");
+        hpRewardPositionService.cancelHotMany(idArray);
+        j.setSuccess(true);
+        j.setMsg("入职奖励岗位取消热门成功");
+        return j;
+    }
 }
 }