lsw 11 månader sedan
förälder
incheckning
7876e1683b

+ 187 - 144
admin-ui/src/views/dashboard/arows.vue

@@ -49,38 +49,72 @@
     </div>
     <!--待办事项-->
     <div v-if="row == '待办事项'">
-      <div class="yr" style="width: 33.333%">
-        <router-link to="/square/recharge?state=0">
-          <div class="rout">
-            <div class="rint" style="text-align: center; cursor: pointer">
-              <span class="icon" style="float: none; color: #2196f3">&#xe6b0;</span>
-              <span class="bages">{{cdata.recharge>100?'99+':cdata.recharge||0}}</span>
-              <div class="ctt">充值审核</div>
-            </div>
-          </div>
-        </router-link>
+      <div class="lab">
+        <div class="bsg"></div>
+        <div class="tit">结算广场待办事项</div>
       </div>
-      <div class="yr" style="width: 33.333%">
-        <router-link to="/square/out?state=0">
-          <div class="rout">
-            <div class="rint" style="text-align: center; cursor: pointer">
-              <span class="icon" style="float: none; color: #2196f3">&#xe6b0;</span>
-              <span class="bages">{{cdata.moneyOut>100?'99+':cdata.moneyOut||0}}</span>
-              <div class="ctt">提现审核</div>
+      <div class="boc">
+        <div class="yr" style="width: 33.333%">
+          <router-link to="/square/recharge?state=0">
+            <div class="rout">
+              <div class="rint" style="text-align: center; cursor: pointer">
+                <span class="icon" style="float: none; color: #2196f3">&#xe6b0;</span>
+                <span class="bages">{{ cdata.recharge > 100 ? '99+' : cdata.recharge || 0 }}</span>
+                <div class="ctt">企业充值审核</div>
+              </div>
             </div>
-          </div>
-        </router-link>
+          </router-link>
+        </div>
+        <div class="yr" style="width: 33.333%">
+          <router-link to="/square/out?state=0">
+            <div class="rout">
+              <div class="rint" style="text-align: center; cursor: pointer">
+                <span class="icon" style="float: none; color: #2196f3">&#xe6b0;</span>
+                <span class="bages">{{ cdata.moneyOut > 100 ? '99+' : cdata.moneyOut || 0 }}</span>
+                <div class="ctt">企业提现审核</div>
+              </div>
+            </div>
+          </router-link>
+        </div>
+        <div class="yr" style="width: 33.333%">
+          <router-link to="/square/pay?give=1">
+            <div class="rout">
+              <div class="rint" style="text-align: center; cursor: pointer">
+                <span class="icon" style="float: none; color: #2196f3">&#xe6b0;</span>
+                <span class="bages">{{ cdata.gives > 100 ? '99+' : cdata.gives || 0 }}</span>
+                <div class="ctt">业务发放审核</div>
+              </div>
+            </div>
+          </router-link>
+        </div>
       </div>
-      <div class="yr" style="width: 33.333%">
-        <router-link to="/square/pay?give=1">
-          <div class="rout">
-            <div class="rint" style="text-align: center; cursor: pointer">
-              <span class="icon" style="float: none; color: #2196f3">&#xe6b0;</span>
-              <span class="bages">{{cdata.gives>100?'99+':cdata.gives||0}}</span>
-              <div class="ctt">发放审核</div>
+      <div class="lab">
+        <div class="bsg"></div>
+        <div class="tit">招聘管理待办事项</div>
+      </div>
+      <div class="boc">
+        <div class="yr" style="width: 33.333%">
+          <router-link to="/job/enterprise?state=0">
+            <div class="rout">
+              <div class="rint" style="text-align: center; cursor: pointer">
+                <span class="icon" style="float: none; color: #2196f3">&#xe6b0;</span>
+                <span class="bages">{{ cdata.enterprise > 100 ? '99+' : cdata.enterprise || 0 }}</span>
+                <div class="ctt">企业认证审核</div>
+              </div>
             </div>
-          </div>
-        </router-link>
+          </router-link>
+        </div>
+        <div class="yr" style="width: 33.333%">
+          <router-link to="/job/position?audit=0">
+            <div class="rout">
+              <div class="rint" style="text-align: center; cursor: pointer">
+                <span class="icon" style="float: none; color: #2196f3">&#xe6b0;</span>
+                <span class="bages">{{ cdata.position > 100 ? '99+' : cdata.position || 0 }}</span>
+                <div class="ctt">职位发布审核</div>
+              </div>
+            </div>
+          </router-link>
+        </div>
       </div>
     </div>
     <div v-if="row == '统计概览'">
@@ -165,132 +199,141 @@
 </template>
 
 <script>
-  export default {
-    props: {
-      row: {
-        type: String
-      },
-      cdata: {
-        type: Object
-      }
+export default {
+  props: {
+    row: {
+      type: String
     },
-    data() {
-      return {
-        menu: [{
-            icon: '&#xe611;',
-            color: '#fab22e',
-            name: 'APP用户',
-            url: '/users',
-            hasPermi: 'work:user:list'
-          },
-          {
-            icon: '&#xe640;',
-            color: '#1890ff',
-            name: '企业管理',
-            url: '/square/company',
-            hasPermi: 'work:company:list'
-          },
-          {
-            icon: '&#xe645;',
-            color: '#9C27B0',
-            name: '充值管理',
-            url: '/square/recharge',
-            hasPermi: 'work:recharge:list'
-          },
-          {
-            icon: '&#xe628;',
-            color: '#3F51B5',
-            name: '提现管理',
-            url: '/square/out',
-            hasPermi: 'work:out:list'
-          },
-          {
-            icon: '&#xe645;',
-            color: '#FF9800',
-            name: '发放业务',
-            url: '/square/pay',
-            hasPermi: 'work:statement:pay'
-          },
-          {
-            icon: '&#xe60d;',
-            color: '#1890ff',
-            name: '用户管理',
-            url: '/system/user',
-            hasPermi: 'system:user:list'
-          },
-          {
-            icon: '&#xe60b;',
-            color: '#FFC107',
-            name: '角色管理',
-            url: '/system/role',
-            hasPermi: 'system:role:list'
-          },
-          {
-            icon: '&#xe62c;',
-            color: '#9E9E9E',
-            name: '操作日志',
-            url: '/system/operlog',
-            hasPermi: 'monitor:operlog:list'
-          }
-        ]
-      };
-    },
-    methods: {}
-  };
+    cdata: {
+      type: Object
+    }
+  },
+  data() {
+    return {
+      menu: [
+        {
+          icon: '&#xe611;',
+          color: '#fab22e',
+          name: 'APP用户',
+          url: '/users',
+          hasPermi: 'work:user:list'
+        },
+        {
+          icon: '&#xe640;',
+          color: '#1890ff',
+          name: '企业管理',
+          url: '/square/company',
+          hasPermi: 'work:company:list'
+        },
+        {
+          icon: '&#xe645;',
+          color: '#9C27B0',
+          name: '充值管理',
+          url: '/square/recharge',
+          hasPermi: 'work:recharge:list'
+        },
+        {
+          icon: '&#xe628;',
+          color: '#3F51B5',
+          name: '提现管理',
+          url: '/square/out',
+          hasPermi: 'work:out:list'
+        },
+        {
+          icon: '&#xe645;',
+          color: '#FF9800',
+          name: '发放业务',
+          url: '/square/pay',
+          hasPermi: 'work:statement:pay'
+        },
+        {
+          icon: '&#xe60d;',
+          color: '#1890ff',
+          name: '用户管理',
+          url: '/system/user',
+          hasPermi: 'system:user:list'
+        },
+        {
+          icon: '&#xe60b;',
+          color: '#FFC107',
+          name: '角色管理',
+          url: '/system/role',
+          hasPermi: 'system:role:list'
+        },
+        {
+          icon: '&#xe62c;',
+          color: '#9E9E9E',
+          name: '操作日志',
+          url: '/system/operlog',
+          hasPermi: 'monitor:operlog:list'
+        }
+      ]
+    };
+  },
+  methods: {}
+};
 </script>
 
 <style lang="scss" scoped>
-  .yrows {
-    margin-top: 10px;
-    .yr {
-      float: left;
-      width: 25%;
-      .rout {
-        padding: 6px;
-        .rint {
+.yrows {
+  margin-top: 10px;
+  .boc {
+    background-color: aliceblue;
+    overflow: hidden;
+    padding-top: 10px;
+    border-radius: 7px;
+    margin-bottom: 10px;
+    margin-top:-10px;
+  }
+  .yr {
+    float: left;
+    width: 25%;
+    .rout {
+      padding: 6px;
+      .rint {
+        padding: 10px;
+        border-radius: 5px;
+        overflow: hidden;
+        position: relative;
+        .icon {
+          float: left;
+          font-size: 30px;
+          background-color: white;
+          border-radius: 50%;
           padding: 10px;
-          border-radius: 5px;
-          overflow: hidden;
-          position: relative;
-          .icon {
-            float: left;
-            font-size: 30px;
-            background-color: white;
-            border-radius: 50%;
-            padding: 10px;
-            width: 50px;
-            height: 50px;
-            box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
-          }
-          .bages {
-            position: absolute;
-            background-color: red;
-            color: white;
-            padding: 0px 5px 0px 5px;
-            border-radius: 40px;
-            text-align: center;
-            top: 2px
-          }
-          .rcon {
-            float: left;
-            padding-left: 12px;
-            width: calc(100% - 55px);
-            .rtt {
-              color: #8c8c8c;
-              font-size: 14px;
-            }
-            .rdesc {
-              font-weight: bold;
-              padding-top: 7px;
-            }
-          }
-          .ctt {
+          width: 50px;
+          height: 50px;
+          box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+        }
+        .bages {
+          position: absolute;
+          background-color: red;
+          color: white;
+          padding: 0px 5px 0px 5px;
+          border-radius: 40px;
+          text-align: center;
+          top: 2px;
+        }
+        .rcon {
+          float: left;
+          padding-left: 12px;
+          width: calc(100% - 55px);
+          .rtt {
             color: #8c8c8c;
             font-size: 14px;
-            padding-top: 18px;
           }
+          .rdesc {
+            font-weight: bold;
+            padding-top: 7px;
+          }
+        }
+        .ctt {
+          color: #8c8c8c;
+          font-size: 14px;
+          padding-top: 18px;
         }
       }
     }
   }
+}
 </style>

+ 0 - 4
admin-ui/src/views/index_admin.vue

@@ -47,10 +47,6 @@
         <div class="out mar0">
           <div class="int">
             <div class="bos">
-              <div class="lab">
-                <div class="bsg"></div>
-                <div class="tit">待办事项</div>
-              </div>
               <arows :cdata="data" row="待办事项"></arows>
             </div>
           </div>

+ 8 - 2
admin-ui/src/views/work/banner/edit.vue

@@ -2,11 +2,17 @@
   <div class="cmain">
     <el-form ref="form" :model="form" :rules="rules" label-width="100px">
       <el-form-item label="轮播图片" prop="pic"><cropper v-model="form.pic" :fixed_number="[5, 2.3]"></cropper></el-form-item>
-      <el-form-item label="跳转链接" prop="contentTitle">
+      <el-form-item label="点击跳转到" prop="contentTitle">
         <el-input placeholder="请选择跳转链接,留空则点击图片不跳转" v-model="form.contentTitle" :disabled="true">
           <el-button slot="append" icon="el-icon-search" @click="add()"></el-button>
         </el-input>
       </el-form-item>
+      <el-form-item label="展示位置" prop="type">
+        <el-select v-model="form.type" placeholder="请选择">
+          <el-option label="首页" :value="0"></el-option>
+          <el-option label="服务业" :value="1"></el-option>
+        </el-select>
+      </el-form-item>
       <el-form-item label="显示顺序" prop="orderNum"><el-input type="number" :min="0" v-model="form.orderNum" placeholder="请输入显示顺序" /></el-form-item>
       <el-form-item label="状态" prop="state">
         <el-select v-model="form.state" placeholder="请选择">
@@ -27,7 +33,7 @@ import selectUrl from './select_url';
 export default {
   data() {
     return {
-      form: {contentTitle: '', contentId: '', orderNum: 0, state: 0 },
+      form: { contentTitle: '', contentId: '', orderNum: 0, state: 0, contentType: '' },
       rules: {
         pic: [{ required: true, message: '请上传图片', trigger: 'blur' }],
         contentTitle: [{ required: true, message: '请选择跳转链接', trigger: 'blur' }],

+ 10 - 3
admin-ui/src/views/work/banner/index.vue

@@ -10,10 +10,17 @@
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="图片" align="center" prop="pic">
         <template slot-scope="scope">
-          <el-image class="p_img" style="height: 45px;background-color: aliceblue;" :fit="'contain'" :src="baseUrl + scope.row.pic" :preview-src-list="[baseUrl + scope.row.pic]"></el-image>
+          <el-image class="p_img" style="height: 45px; background-color: aliceblue" :fit="'contain'" :src="baseUrl + scope.row.pic" :preview-src-list="[baseUrl + scope.row.pic]"></el-image>
         </template>
       </el-table-column>
-      <el-table-column label="跳转文章链接" align="center" prop="contentTitle"/>
+      <el-table-column label="展示位置" align="center" prop="type" width="130">
+        <template slot-scope="scope">
+          <el-tag type="success" v-if="scope.row.type == 0">首页</el-tag>
+          <el-tag type="danger" v-if="scope.row.type == 1">服务业</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="点击跳转到" align="center" prop="contentTitle" />
+      <el-table-column label="所属模块" align="center" prop="contentType" width="130"/>
       <el-table-column label="显示顺序" align="center" prop="orderNum" width="130" />
       <el-table-column label="状态" align="center" prop="state" width="130">
         <template slot-scope="scope">
@@ -80,7 +87,7 @@ export default {
       }
       if (tag == 'edit') {
         const id = row.id || this.ids[0];
-        this.iframe({ obj: edit, param: { id: id}, title: '编辑', width: '35%', height: '45%' });
+        this.iframe({ obj: edit, param: { id: id }, title: '编辑', width: '35%', height: '45%' });
       }
     },
     del(row) {

+ 18 - 4
admin-ui/src/views/work/banner/select_url.vue

@@ -1,6 +1,13 @@
 <template>
   <div class="cmain">
     <el-form :model="queryParams" ref="queryForm" @submit.native.prevent :inline="true" label-width="auto">
+      <el-form-item label="内容分类" prop="type">
+        <el-select v-model="queryParams.type" placeholder="请选择">
+          <el-option label="新闻资讯" value="新闻资讯"></el-option>
+          <el-option label="通知公告" value="通知公告"></el-option>
+          <el-option label="工作职位" value="工作职位"></el-option>
+        </el-select>
+      </el-form-item>
       <el-form-item label="标题" prop="title">
         <el-input v-model="queryParams.title" placeholder="请输入标题" clearable @keyup.enter.native="handleQuery" />
       </el-form-item>
@@ -16,7 +23,13 @@
         </template>
       </el-table-column>
       <el-table-column label="标题" prop="title" />
-      <el-table-column label="创建时间" align="center" prop="createTime" width="200" />
+      <el-table-column label="栏目" prop="type" align="center" v-if="queryParams.type == '新闻资讯'" width="150" />
+      <el-table-column label="发布企业" prop="enterpriseName" align="center" v-if="queryParams.type == '工作职位'" />
+      <el-table-column label="工作类型" prop="type" align="center" v-if="queryParams.type == '工作职位'" width="150">
+        <template slot-scope="scope">
+          {{ scope.row.type == 0 ? '全职' : '兼职' }}
+        </template>
+      </el-table-column>
       <template slot="empty">
         <el-empty></el-empty>
       </template>
@@ -41,7 +54,7 @@ export default {
       queryParams: {
         pageNum: 1,
         pageSize: 8,
-        state: 0,
+        type: '新闻资讯',
         title: null
       }
     };
@@ -58,7 +71,7 @@ export default {
     }
   },
   watch: {
-    'queryParams.columnId'(val) {
+    'queryParams.type'(val) {
       this.getList();
     }
   },
@@ -67,7 +80,7 @@ export default {
   },
   methods: {
     getList() {
-      this.get({ url: '/work/notice/list', data: this.queryParams }).then((response) => {
+      this.get({ url: '/work/banner/selectUrl', data: this.queryParams }).then((response) => {
         this.response = response;
       });
     },
@@ -95,6 +108,7 @@ export default {
     setSelect() {
       this.$parent.form.contentTitle = this.form.contentTitle;
       this.$parent.form.contentId = this.form.contentId;
+      this.$parent.form.contentType = this.queryParams.type;
       this.$layer.close(this.layerid);
     }
   }

+ 4 - 0
admin-ui/src/views/work/enterprise/index.vue

@@ -100,6 +100,9 @@ export default {
     };
   },
   created() {
+    if (this.$route.query.state) {
+      this.queryParams.state = this.$route.query.state;
+    }
     this.getList();
   },
   methods: {
@@ -114,6 +117,7 @@ export default {
     },
     resetQuery() {
       this.resetForm('queryForm');
+      this.queryParams.state = null;
       this.handleQuery();
     },
     selects(rows) {

+ 4 - 0
admin-ui/src/views/work/position/index.vue

@@ -123,6 +123,9 @@ export default {
     };
   },
   created() {
+    if (this.$route.query.audit) {
+      this.queryParams.audit = this.$route.query.audit;
+    }
     this.getList();
   },
   methods: {
@@ -141,6 +144,7 @@ export default {
     },
     resetQuery() {
       this.resetForm('queryForm');
+      this.queryParams.audit = null;
       this.dateRange = [];
       this.handleQuery();
     },

+ 17 - 9
app/pages/index/index.vue

@@ -12,7 +12,7 @@
 		</view>
 		<!--轮播图-->
 		<view class="banner">
-			<u-swiper circular :radius="5" :indicator="true" keyName="pic" :list="bannerList" :height="160" class="uni-swiper" @click="click"></u-swiper>
+			<u-swiper circular :radius="5" :indicator="true" keyName="pic" :list="bannerList" :height="160" class="uni-swiper" @click="BannerClick"></u-swiper>
 		</view>
 		<view class="tab">
 			<u-tabs :scrollable="false" :inactiveStyle="{ fontSize: '17px' }" :activeStyle="{ color: '#3c9cff', fontSize: '17px' }" :list="tab" @click="tabClick"></u-tabs>
@@ -35,8 +35,7 @@ export default {
 			],
 			list: [],
 			param: { pageNum: 1, pageSize: 8, type: 0, recommend: 1 },
-			bannerList: [],
-			noticeList: []
+			bannerList: []
 		};
 	},
 	onLoad() {
@@ -52,13 +51,9 @@ export default {
 		initData() {
 			//首页数据
 			this.http.request({
-				url: '/app/home/index',
+				url: '/app/home/banner/0',
 				success: (res) => {
-					this.contract = res.data.data.contract;
-					this.bannerList = res.data.data.bannerList;
-					res.data.data.noticeList.forEach((item) => {
-						this.noticeList.push(item.title);
-					});
+					this.bannerList = res.data.data;
 				}
 			});
 			//初始化所有地区
@@ -104,6 +99,19 @@ export default {
 			this.param.recommend = e.recommend;
 			this.getData();
 		},
+		//点击轮播图
+		BannerClick(index) {
+			let item = this.bannerList[index];
+			if (item.contentType == '新闻资讯') {
+				uni.navigateTo({ url: '/pages/news/detail?id=' + item.contentId });
+			}
+			if (item.contentType == '通知公告') {
+				uni.navigateTo({ url: '/pages/notice/detail?id=' + item.contentId });
+			}
+			if (item.contentType == '工作职位') {
+				uni.navigateTo({ url: '/pages/job/detail?id=' + item.contentId });
+			}
+		},
 		go(url) {
 			uni.navigateTo({ url: url });
 		}

+ 14 - 8
ruoyi-admin/src/main/java/com/ruoyi/web/work/api/Api_HomeController.java

@@ -8,6 +8,7 @@ import com.ruoyi.web.work.service.INewsService;
 import com.ruoyi.web.work.service.INoticeService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -32,13 +33,18 @@ public class Api_HomeController extends BaseController {
     @Autowired
     private INewsService newsService;
 
-    @GetMapping("/index")
-    public AjaxResult index() {
-        AjaxResult result = new AjaxResult();
-        result.put("bannerList", bannerService.homeList());
-        result.put("noticeList", noticeService.queryList("小程序通知"));
-        result.put("contract", contractService.selectContract());
-        result.put("newsList", newsService.homeList());
-        return AjaxResult.success(result);
+    @GetMapping("/banner/{type}")
+    public AjaxResult banner(@PathVariable("type") Integer type) {
+        return AjaxResult.success(bannerService.homeList(type));
+    }
+
+    @GetMapping("/news")
+    public AjaxResult news() {
+        return AjaxResult.success(newsService.homeList());
+    }
+
+    @GetMapping("/contract")
+    public AjaxResult contract() {
+        return AjaxResult.success(contractService.selectContract());
     }
 }

+ 51 - 16
ruoyi-admin/src/main/java/com/ruoyi/web/work/controller/BannerController.java

@@ -1,25 +1,29 @@
 package com.ruoyi.web.work.controller;
 
-import java.util.Arrays;
-import java.util.List;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.web.work.domain.Banner;
+import com.ruoyi.web.work.domain.News;
+import com.ruoyi.web.work.domain.Notice;
+import com.ruoyi.web.work.domain.Position;
 import com.ruoyi.web.work.service.IBannerService;
-import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.web.work.service.INewsService;
+import com.ruoyi.web.work.service.INoticeService;
+import com.ruoyi.web.work.service.IPositionService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 
 /**
  * 轮播图
+ *
  * @author lsw
  * @date 2024-04-15
  */
@@ -29,38 +33,69 @@ public class BannerController extends BaseController {
     @Autowired
     private IBannerService bannerService;
 
+    @Autowired
+    private INewsService newsService;
+
+    @Autowired
+    private INoticeService noticeService;
+
+    @Autowired
+    private IPositionService positionService;
+
+
     @PreAuthorize("@ss.hasPermi('work:banner:list')")
     @GetMapping("/list")
-    public TableDataInfo list(Banner banner){
+    public TableDataInfo list(Banner banner) {
         startPage();
         List<Banner> list = bannerService.selectList(banner);
         return getDataTable(list);
     }
 
+    @PreAuthorize("@ss.hasPermi('work:banner:edit')")
+    @GetMapping("/selectUrl")
+    public TableDataInfo selectUrl(String type, String title) {
+        if (type.equals("新闻资讯")) {
+            startPage();
+            List<News> list = newsService.selectList(new News().setTitle(title).setState(0));
+            return getDataTable(list);
+        }
+        if (type.equals("通知公告")) {
+            startPage();
+            List<Notice> list = noticeService.selectList(new Notice().setTitle(title).setState(0));
+            return getDataTable(list);
+        }
+        if (type.equals("工作职位")) {
+            startPage();
+            List<Position> list = positionService.selectList(new Position().setTitle(title).setAudit(1).setState(0));
+            return getDataTable(list);
+        }
+        return getDataTable(new ArrayList());
+    }
+
     @PreAuthorize("@ss.hasPermi('work:banner:query')")
     @GetMapping(value = "/detail/{id}")
-    public AjaxResult detail(@PathVariable("id") Long id){
+    public AjaxResult detail(@PathVariable("id") Long id) {
         return AjaxResult.success(bannerService.getById(id));
     }
 
     @PreAuthorize("@ss.hasPermi('work:banner:add')")
     @Log(title = "轮播图", businessType = BusinessType.INSERT)
     @PostMapping("/add")
-    public AjaxResult add(@RequestBody Banner banner){
+    public AjaxResult add(@RequestBody Banner banner) {
         return toAjax(bannerService.save(banner));
     }
 
     @PreAuthorize("@ss.hasPermi('work:banner:edit')")
     @Log(title = "轮播图", businessType = BusinessType.UPDATE)
     @PostMapping("/edit")
-    public AjaxResult edit(@RequestBody Banner banner){
+    public AjaxResult edit(@RequestBody Banner banner) {
         return toAjax(bannerService.updateById(banner));
     }
 
     @PreAuthorize("@ss.hasPermi('work:banner:remove')")
     @Log(title = "轮播图", businessType = BusinessType.DELETE)
     @GetMapping("/remove/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids){
+    public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(bannerService.removeByIds(Arrays.asList(ids)));
     }
 }

+ 6 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/Banner.java

@@ -24,12 +24,18 @@ public class Banner{
     @ApiModelProperty(value = "封面图")
     private String pic;
 
+    @ApiModelProperty(value = "轮播图类型")
+    private Integer type;
+
     @ApiModelProperty(value = "跳转链接")
     private String contentId;
 
     @ApiModelProperty(value = "链接标题")
     private String contentTitle;
 
+    @ApiModelProperty(value = "内容分类")
+    private String contentType;
+
     @ApiModelProperty(value = "状态:0=正常,1=停用")
     private Integer state;
 

+ 3 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/work/mapper/BannerMapper.java

@@ -2,6 +2,7 @@ package com.ruoyi.web.work.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ruoyi.web.work.domain.Banner;
+import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 
 import java.util.List;
@@ -13,6 +14,6 @@ import java.util.List;
 public interface BannerMapper extends BaseMapper<Banner> {
     List<Banner> selectList(Banner banner);
 
-    @Select("SELECT * FROM tb_banner WHERE state=0 ORDER BY order_num ASC LIMIT 5")
-    List<Banner> homeList();
+    @Select("SELECT * FROM tb_banner WHERE state=0 AND type=#{type} ORDER BY order_num ASC LIMIT 5")
+    List<Banner> homeList(@Param("type") Integer type);
 }

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/IBannerService.java

@@ -9,8 +9,8 @@ import java.util.List;
  * @author lsw
  * @date 2024-04-15
  */
-public interface IBannerService extends IService<Banner>{
+public interface IBannerService extends IService<Banner> {
     List<Banner> selectList(Banner banner);
 
-    List<Banner> homeList();
+    List<Banner> homeList(Integer type);
 }

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/BannerServiceImpl.java

@@ -24,7 +24,7 @@ public class BannerServiceImpl extends ServiceImpl<BannerMapper, Banner> impleme
     }
 
     @Override
-    public List<Banner> homeList() {
-        return bannerMapper.homeList();
+    public List<Banner> homeList(Integer type) {
+        return bannerMapper.homeList(type);
     }
 }

+ 3 - 1
ruoyi-admin/src/main/resources/mapper/work/CommonMapper.xml

@@ -30,7 +30,9 @@
                 ( SELECT COUNT( id ) FROM tb_money_out WHERE state = 0 ) AS moneyOut,
                 ( SELECT COUNT( id ) FROM tb_statement WHERE audit = 2 AND give = 1 ) AS gives,
                 ( SELECT COUNT( id ) FROM tb_packages) AS packages,
-                ( SELECT COUNT( id ) FROM tb_user WHERE is_contract=1) AS contracts
+                ( SELECT COUNT( id ) FROM tb_user WHERE is_contract=1) AS contracts,
+                ( SELECT COUNT( id ) FROM tb_enterprise WHERE state=0) AS enterprise,
+                ( SELECT COUNT( id ) FROM tb_position WHERE audit=0) AS position
     </select>
     <!--后台企业端每月交易金额统计-->
     <select id="record" resultType="java.util.Map">