Ver código fonte

兼职岗位取消热门相关

LiFei 4 anos atrás
pai
commit
d9181b07e2

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

@@ -136,7 +136,7 @@ $(document).ready(function() {
                    }
                    ,{
                        field: 'positionStatus',
-                       title: '状态',
+                       title: '职位状态',
                        sortable: false,
                        sortName: 'positionStatus',
                        formatter:function(value, row , index){
@@ -148,6 +148,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: '职位类型',
                        sortable: false,
@@ -244,6 +254,7 @@ $(document).ready(function() {
                 'check-all.bs.table uncheck-all.bs.table', function () {
             $('#remove').prop('disabled', ! $('#hpParttimePositionTable').bootstrapTable('getSelections').length);
             $('#publishAll').prop('disabled', ! $('#hpParttimePositionTable').bootstrapTable('getSelections').length);
+          $('#cancelHot').prop('disabled', ! $('#hpParttimePositionTable').bootstrapTable('getSelections').length);
             $('#downAll').prop('disabled', ! $('#hpParttimePositionTable').bootstrapTable('getSelections').length);
             $('#view,#edit').prop('disabled', $('#hpParttimePositionTable').bootstrapTable('getSelections').length!=1);
         });
@@ -463,6 +474,23 @@ function hot(id,isHot) {
 }
 
 
+function cancelHot(){
+
+    jp.confirm('确认将该岗位记录取消热门吗?', function(){
+        jp.loading();
+        jp.get("${ctx}/hpposition/hpParttimePosition/cancelHot?ids=" + getIdSelections(), function(data){
+            if(data.success){
+                $('#hpParttimePositionTable').bootstrapTable('refresh');
+                jp.success(data.msg);
+            }else{
+                jp.error(data.msg);
+            }
+        })
+
+    })
+}
+
+
 //再次发布
 function rePublish(id) {
     jp.go("${ctx}/hpposition/hpParttimePosition/form/rePublish?id=" + id);

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

@@ -50,15 +50,15 @@
 	<div id="search-collapse" class="collapse">
 		<div class="accordion-inner">
 			<form:form id="searchForm" modelAttribute="hpParttimePosition" 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">
@@ -71,7 +71,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">
@@ -84,7 +84,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">
@@ -97,14 +97,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>
@@ -126,6 +133,11 @@
 				<i class="glyphicon glyphicon-refresh"></i> 刷新
 			</button>
 		</shiro:hasPermission>
+		<shiro:hasPermission name="hpposition:hpParttimePosition:cancelHot">
+			<button id="cancelHot" class="btn btn-success" disabled onclick="cancelHot()">
+				<i class="glyphicon glyphicon-remove"></i>取消热门
+			</button>
+		</shiro:hasPermission>
 		<shiro:hasPermission name="hpposition:hpParttimePosition: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/HpParttimePositionMapper.xml

@@ -155,6 +155,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 != ''">

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

@@ -270,4 +270,15 @@ public class HpParttimePositionService extends CrudService<HpParttimePositionMap
     public void updateForQrcode(HpParttimePosition hpParttimePosition) {
         mapper.updateForQrcode(hpParttimePosition);
     }
+
+    @Transactional(readOnly = false)
+    public void cancelHotMany(String[] idArray) {
+        for(String id:idArray){
+            HpParttimePosition hpParttimePosition=get(id);
+            if(hpParttimePosition.getIsHot()){
+                hpParttimePosition.setIsHot(false);
+                save(hpParttimePosition);
+            }
+        }
+    }
 }

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

@@ -317,4 +317,19 @@ public class HpParttimePositionController extends BaseController {
         return j;
     }
 
+
+    /**
+     * 批量岗位取消热门
+     */
+    @ResponseBody
+    @RequiresPermissions("hpposition:hpParttimePosition:cancelHot")
+    @RequestMapping(value = "cancelHot")
+    public AjaxJson cancelHot(String ids) {
+        AjaxJson j = new AjaxJson();
+        String idArray[] = ids.split(",");
+        hpParttimePositionService.cancelHotMany(idArray);
+        j.setSuccess(true);
+        j.setMsg("兼职岗位取消热门成功");
+        return j;
+    }
 }