Forráskód Böngészése

全职岗位取消热门相关

LiFei 4 éve
szülő
commit
d00095a98a

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

@@ -135,7 +135,7 @@ $(document).ready(function() {
 		    }
             ,{
                        field: 'positionStatus',
-                       title: '状态',
+                       title: '职位状态',
                        sortable: false,
                        sortName: 'positionStatus',
                        formatter:function(value, row , index){
@@ -147,6 +147,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',
                        title: '职位类型',
@@ -251,6 +261,7 @@ $(document).ready(function() {
                 'check-all.bs.table uncheck-all.bs.table', function () {
             $('#remove').prop('disabled', ! $('#hpFulltimePositionTable').bootstrapTable('getSelections').length);
             $('#publishAll').prop('disabled', ! $('#hpFulltimePositionTable').bootstrapTable('getSelections').length);
+          $('#cancelHot').prop('disabled', ! $('#hpFulltimePositionTable').bootstrapTable('getSelections').length);
             $('#downAll').prop('disabled', ! $('#hpFulltimePositionTable').bootstrapTable('getSelections').length);
             $('#view,#edit').prop('disabled', $('#hpFulltimePositionTable').bootstrapTable('getSelections').length!=1);
         });
@@ -350,6 +361,24 @@ $(document).ready(function() {
 		})
   }
 
+
+    function cancelHot(){
+
+        jp.confirm('确认将该岗位记录取消热门吗?', function(){
+            jp.loading();
+            jp.get("${ctx}/hpposition/hpFulltimePosition/cancelHot?ids=" + getIdSelections(), function(data){
+                if(data.success){
+                    $('#hpFulltimePositionTable').bootstrapTable('refresh');
+                    jp.success(data.msg);
+                }else{
+                    jp.error(data.msg);
+                }
+            })
+
+        })
+    }
+
+
   function del(id,delFlag) {
       var content;
       if(delFlag == 1){

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

@@ -51,15 +51,15 @@
 	<div id="search-collapse" class="collapse">
 		<div class="accordion-inner">
 			<form:form id="searchForm" modelAttribute="hpFulltimePosition" 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>
 				<form:input path="positionName" htmlEscape="false" maxlength="100"  class="form-control input-sm"/>
 			</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:input path="hpCompany.companyName" htmlEscape="false" maxlength="11"  class=" form-control input-sm"/>
 			</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">
 					<label class="label-item single-overflow pull-left" title="发布时间">&nbsp;发布时间:</label>
 					<div class="col-xs-12">
@@ -72,7 +72,7 @@
 					</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">
 					<label class="label-item single-overflow pull-left" title="截至时间:">&nbsp;截至时间:</label>
 					<div class="col-xs-12">
@@ -85,7 +85,7 @@
 					</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">
 					<label class="label-item single-overflow pull-left" title="更新时间:">&nbsp;更新时间:</label>
 					<div class="col-xs-12">
@@ -98,14 +98,21 @@
 					</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>
 					<form:select path="positionStatus"  class="form-control input-sm m-b">
 						<form:option value="" label="全部"/>
 						<form:options items="${fns:getDictList('position_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
 					</form:select>
 				</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">
 				  <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>
@@ -127,6 +134,11 @@
 				<i class="glyphicon glyphicon-refresh"></i> 刷新
 			</button>
 		</shiro:hasPermission>
+		<shiro:hasPermission name="hpposition:hpFulltimePosition:cancelHot">
+			<button id="cancelHot" class="btn btn-success" disabled onclick="cancelHot()">
+				<i class="glyphicon glyphicon-remove"></i>取消热门
+			</button>
+		</shiro:hasPermission>
 		<shiro:hasPermission name="hpposition:hpFulltimePosition:del">
 			<button id="downAll" class="btn btn-danger" disabled onclick="downAll()">
 				<i class="glyphicon glyphicon-remove"></i> 下架

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

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

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

@@ -953,4 +953,14 @@ public class HpFulltimePositionService extends CrudService<HpFulltimePositionMap
         return j;
     }
 
+    @Transactional(readOnly = false)
+    public void cancelHotMany(String[] idArray) {
+        for(String id:idArray){
+            HpFulltimePosition hpFulltimePosition=get(id);
+            if(hpFulltimePosition.getIsHot()){
+                hpFulltimePosition.setIsHot(false);
+                save(hpFulltimePosition);
+            }
+        }
+    }
 }

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

@@ -360,4 +360,20 @@ public class HpFulltimePositionController extends BaseController {
         j = hpFulltimePositionService.createQrcodeUrl();
         return j;
     }
+
+
+    /**
+     * 批量全职岗位取消热门
+     */
+    @ResponseBody
+    @RequiresPermissions("hpposition:hpFulltimePosition:cancelHot")
+    @RequestMapping(value = "cancelHot")
+    public AjaxJson cancelHot(String ids) {
+        AjaxJson j = new AjaxJson();
+        String idArray[] = ids.split(",");
+        hpFulltimePositionService.cancelHotMany(idArray);
+        j.setSuccess(true);
+        j.setMsg("全职岗位取消热门成功");
+        return j;
+    }
 }