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

企业服务管理-新增静态页面

Liudijing 1 éve
szülő
commit
b18e699f9b

+ 14 - 0
src/main/java/com/hz/employmentsite/controller/companyService/PostController.java

@@ -1,6 +1,8 @@
 package com.hz.employmentsite.controller.companyService;
 
 import com.github.pagehelper.PageInfo;
+import com.hz.employmentsite.filter.exception.BaseErrorEnum;
+import com.hz.employmentsite.filter.exception.BaseException;
 import com.hz.employmentsite.filter.exception.BaseResponse;
 import com.hz.employmentsite.filter.exception.RespGenerstor;
 import com.hz.employmentsite.services.service.AccountService;
@@ -9,6 +11,8 @@ import com.hz.employmentsite.vo.companyService.PostVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.List;
+
 @RestController
 @RequestMapping(value = "/api/companyService/post")
 public class PostController {
@@ -47,4 +51,14 @@ public class PostController {
         return RespGenerstor.success(data);
     }
 
+    @ResponseBody
+    @GetMapping("/delete")
+    public BaseResponse<Integer> delete(String id) {
+        Integer result = postService.delete(id);
+        if (result <= 0)
+            throw new BaseException(BaseErrorEnum.DELETE_NOT_DATA_ERROR);
+        return RespGenerstor.success(1);
+    }
+
+
 }

+ 6 - 4
src/main/java/com/hz/employmentsite/services/impl/companyService/PostServiceImpl.java

@@ -50,6 +50,7 @@ public class PostServiceImpl implements PostService {
             dbData.setPostID(UUID.randomUUID().toString());
             dbData.setWorkCode(data.getWorkCode());
             dbData.setWorkName(data.getWorkName());
+            dbData.setValidTime(data.getValidTime());
             dbData.setRecruitCount(data.getRecruitCount());
             dbData.setCompanyID(data.getCompanyID());
             dbData.setPostName(data.getPostName());
@@ -65,7 +66,7 @@ public class PostServiceImpl implements PostService {
             dbData.setWelfare(data.getWelfare());
             dbData.setUserName(data.getUserName());
             dbData.setUserMobile(data.getUserMobile());
-            dbData.setPostEmail(data.getPostEmial());
+            dbData.setPostEmail(data.getPostEmail());
             dbData.setWorkTime(data.getWorkTime());
             dbData.setIsTrail(data.getIsTrail());
             dbData.setTrailtime(data.getTrailtime());
@@ -76,6 +77,7 @@ public class PostServiceImpl implements PostService {
             result = pcPostMapper.insert(dbData);
         } else {
             dbData.setWorkCode(data.getWorkCode());
+            dbData.setValidTime(data.getValidTime());
             dbData.setWorkName(data.getWorkName());
             dbData.setRecruitCount(data.getRecruitCount());
             dbData.setCompanyID(data.getCompanyID());
@@ -92,7 +94,7 @@ public class PostServiceImpl implements PostService {
             dbData.setWelfare(data.getWelfare());
             dbData.setUserName(data.getUserName());
             dbData.setUserMobile(data.getUserMobile());
-            dbData.setPostEmail(data.getPostEmial());
+            dbData.setPostEmail(data.getPostEmail());
             dbData.setWorkTime(data.getWorkTime());
             dbData.setIsTrail(data.getIsTrail());
             dbData.setTrailtime(data.getTrailtime());
@@ -106,11 +108,11 @@ public class PostServiceImpl implements PostService {
     }
 
     @Override
-    public int delete(List<String> idList) {
+    public int delete(String id) {
         int result = 0;
         PcPostExample exp = new PcPostExample();
         PcPostExample.Criteria cro = exp.or();
-        cro.andPostIDIn(idList);
+        cro.andPostIDEqualTo(id);
         result = pcPostMapper.deleteByExample(exp);
 
         return result;

+ 1 - 1
src/main/java/com/hz/employmentsite/services/service/companyService/PostService.java

@@ -8,7 +8,7 @@ import java.util.List;
 public interface PostService {
     PageInfo<PostVo> getList(Integer page, Integer rows, String postID,String postName, Integer minCount, Integer maxCount, String companyName,int RecordStatus,String WorkNmae);
     Integer save(PostVo data, String userId);
-    int delete(List<String> idList);
+    int delete(String id);
     PostVo getDataById(String id);
 
 }

+ 6 - 0
src/main/java/com/hz/employmentsite/vo/companyService/CompanyVo.java

@@ -47,4 +47,10 @@ public class CompanyVo {
     public Date modifyTime;
 
     public String SiteName;
+
+    public String regionName;
+
+    public String streetName;
+
+    public  Integer postCount;
 }

+ 2 - 2
src/main/java/com/hz/employmentsite/vo/companyService/PostVo.java

@@ -38,7 +38,7 @@ public class PostVo {
 
     public String userMobile;
 
-    public String postEmial;
+    public String postEmail;
 
     public Integer workTime;
 
@@ -62,5 +62,5 @@ public class PostVo {
 
     public String companyName;
 
-    public String validTime;
+    public Date validTime;
 }

+ 9 - 1
src/main/resources/mapping/cquery/CompanyCQuery.xml

@@ -2,7 +2,15 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.hz.employmentsite.mapper.cquery.CompanyCQuery">
     <select id="getList" resultType="com.hz.employmentsite.vo.companyService.CompanyVo">
-        select   *  from pc_company where 1=1
+
+        select company.*,city.name as regionName,area.name as streetName,
+        (select count(*) from pc_post where CompanyID=company.CompanyID) as postCount
+        from pc_company company
+        left join area_code city
+        on company.RegionCode = city.code
+        left join area_code area
+        on company.StreetCode = area.code
+        where 1=1
         <if test="primaryKey!='' and primaryKey!=null">
             and companyID in (${primaryKey})
         </if>

+ 1 - 1
src/main/resources/mapping/cquery/PostCQuery.xml

@@ -13,7 +13,7 @@
                 and post.postName like Concat('%',#{postName},'%')
             </if>
             <if test="minCount != null and minCount != ''">
-                and post.RecruitCount >= #{minCount}
+                and post.RecruitCount <![CDATA[ >= ]]> #{minCount}
             </if>
             <if test="maxCount != null and maxCount != ''">
                 and post.RecruitCount <![CDATA[ <= ]]> #{maxCount}

+ 3 - 3
vue/src/api/companyService/post.ts

@@ -36,12 +36,12 @@ export function save(data: any) {
   })
 }
 
-export function del(data: any) {
+export function del(id: any) {
   return request<object>(
     {
       url: "companyService/post/delete",
-      method: 'post',
-      data: data,
+      method: 'get',
+      params: {id}
     },
     {
       isNew: true,

+ 3 - 3
vue/src/router/asyncModules/companyService.ts

@@ -1,7 +1,7 @@
 export default {
-    'companyService/company/index': () => import('@/views/companyService/company/index.vue'),
-  'companyService/company/add': () => import('@/views/companyService/company/edit.vue'),
-  'companyService/company/edit': () => import('@/views/companyService/company/edit.vue'),
+  'companyService/enterprise/index': () => import('@/views/companyService/company/index.vue'),
+  'companyService/enterprise/add': () => import('@/views/companyService/company/edit.vue'),
+  'companyService/enterprise/edit': () => import('@/views/companyService/company/edit.vue'),
   'companyService/post/index': () => import('@/views/companyService/post/index.vue'),
   'companyService/post/add': () => import('@/views/companyService/post/edit.vue'),
   'companyService/post/edit': () => import('@/views/companyService/post/edit.vue')

+ 3 - 3
vue/src/views/companyService/company/edit.vue

@@ -248,9 +248,9 @@ export default defineComponent(
     const tabsViewStore = useTabsViewStore();
 
     const onClose = () => {
-      tabsViewStore.closeCurrentTabByPath('/companyService/post/add');
-      tabsViewStore.closeCurrentTabByPath('/companyService/post/edit');
-      router.push({ name: '/companyService/post/index' });
+      tabsViewStore.closeCurrentTabByPath('/companyService/enterprise/add');
+      tabsViewStore.closeCurrentTabByPath('/companyService/enterprise/edit');
+      router.push({ name: '/companyService/enterprise/index' });
     };
 
     const onFinish=()=>{

+ 54 - 24
vue/src/views/companyService/company/index.vue

@@ -7,8 +7,8 @@
             <a-input v-model:value="searchParams.companyName" placeholder=""/>
           </a-form-item>
         </a-col>
-        <a-col :span="7">
-          <a-form-item label="统一信用代码" :label-col="{span:7}" name="CompanyCode">
+        <a-col :span="6">
+          <a-form-item label="统一信用代码" :label-col="{span:6}" name="CompanyCode">
             <a-input v-model:value="searchParams.companyCode" placeholder=""/>
           </a-form-item>
         </a-col>
@@ -17,24 +17,40 @@
             <a-input v-model:value="searchParams.recordStatus" placeholder=""/>
           </a-form-item>
         </a-col>
-        <a-col :span="5" style="text-align: right">
+        <a-col :span="6" style="text-align: right">
           <a-button type="primary" html-type="submit" @click="onSearch">查询</a-button>
         </a-col>
       </a-row>
       <a-row :gutter="24">
         <a-col :span="6">
-          <a-form-item label="所属县区" :label-col="{span:6}" name="RegionCode">
-            <a-input v-model:value="searchParams.regionCode" placeholder=""/>
+          <a-form-item label="所属县区" :label-col="{span:6}" name="regionCode">
+            <a-select
+              ref="select"
+              v-model:value="searchParams.regionCode"
+              :options="regionList"
+              :field-names="{ label: 'name', value: 'code' }"
+              :allow-clear="true"
+              @change="changeCity"
+            >
+            </a-select>
           </a-form-item>
         </a-col>
-        <a-col :span="7">
-          <a-form-item label="所属街道" :label-col="{span:7}" name="StreetCode">
-            <a-input v-model:value="searchParams.streetCode" placeholder=""/>
+        <a-col :span="6">
+          <a-form-item label="所属街道" :label-col="{span:6}" name="streetCode">
+            <a-select
+              ref="select"
+              v-model:value="searchParams.streetCode"
+              :options="streetList"
+              :field-names="{ label: 'name', value: 'code' }"
+              :allow-clear="true"
+              @change="loadData"
+            >
+            </a-select>
           </a-form-item>
         </a-col>
         <a-col :span="6">
         </a-col>
-        <a-col :span="5">
+        <a-col :span="6">
         </a-col>
       </a-row>
       <a-row class="edit-operation">
@@ -62,7 +78,6 @@
         </template>
       </a-table>
     </div>
-    <InstitutionEditForm ref="institutionEditModelRef" :loadData="loadData"></InstitutionEditForm>
   </div>
 </template>
 
@@ -72,16 +87,15 @@ import {DownOutlined, ExclamationCircleOutlined, UpOutlined} from '@ant-design/i
 import type {FormInstance} from 'ant-design-vue';
 import type {TableColumnsType, TableProps} from 'ant-design-vue';
 import {getList, del} from '@/api/companyService/company';
-import InstitutionEditForm from "@/views/baseSettings/institution/edit.vue";
 import BExportExcel from "@/components/basic/excel/exportExcel/exportExcel.vue";
 import {getPaginationTotalTitle} from "@/utils/common";
-import {message, Modal} from "ant-design-vue";
+import {message, Modal, SelectProps} from "ant-design-vue";
 import dayjs from "dayjs";
 import { useTabsViewStore } from '@/store/modules/tabsView';
+import {get} from "@/api/common";
 
 export default defineComponent({
-  name: 'CompanyList',
-  components: {InstitutionEditForm, DownOutlined, UpOutlined, BExportExcel},
+  components: { DownOutlined, UpOutlined, BExportExcel},
   setup() {
     const formRef = ref<FormInstance>();
     const searchParams = reactive({
@@ -107,13 +121,13 @@ export default defineComponent({
         customRender: item => `${searchParams.pageSize * (searchParams.pageIndex - 1) + item.index + 1}`
       },
       {title: '企业名称', dataIndex: 'companyName', key: 'companyName', align: "center"},
-      {title: '所属县区', dataIndex: 'regionCode', key: 'regionCode', width: 120, align: "center"},
-      {title: '所属街道', dataIndex: 'streetCode', key: 'streetCode', align: "center"},
+      {title: '所属县区', dataIndex: 'regionName', key: 'regionName', width: 120, align: "center"},
+      {title: '所属街道', dataIndex: 'streetName', key: 'streetName', align: "center"},
       {title: '统一信用代码', dataIndex: 'companyCode', key: 'companyCode', align: "center"},
       {title: '企业状态', dataIndex: 'recordStatus', key: 'recordStatus', align: "center"},
       {title: '参保人数', dataIndex: 'peopleCount', key: 'peopleCount', align: "center"},
       {title: '企业规模', dataIndex: 'companyModel', key: 'companyModel', align: "center"},
-      {title: '当前岗位数量', dataIndex: 'positionCount', key: 'positionCount', align: "center"},
+      {title: '当前岗位数量', dataIndex: 'postCount', key: 'postCount', align: "center"},
       {title: '录入人', dataIndex: 'createUser', key: 'createUser', align: "center"},
       {
         title: '录入时间   ', dataIndex: 'createTime', key: 'createTime', align: "center", customRender: (item) => {
@@ -130,10 +144,27 @@ export default defineComponent({
       showTotal: total => getPaginationTotalTitle(total)
     }));
 
+    const regionList = ref<SelectProps['options']>();
+    const streetList = ref<SelectProps['options']>();
     const dataList = ref([]);
     const institutionEditModelRef = ref();
     const tabsViewStore = useTabsViewStore();
 
+    const changeCity=()=>{
+      get('system/area/getAreaList',{code:searchParams.regionCode}).then(data=>{
+        console.log(data);
+        streetList.value=data;
+        console.log(streetList.value);
+      })
+      loadData();
+    }
+
+    get('system/area/getCityList',{}).then(data=>{
+      console.log(data);
+      regionList.value=data;
+      console.log(regionList.value);
+    });
+
     const loadData = async function () {
       formState.loading = true;
       const result: any = await getList(searchParams);
@@ -185,18 +216,15 @@ export default defineComponent({
       });
     };
 
-    // const onOperates = (id: string, operation: string, isDetail: boolean) => {
-    //   institutionEditModelRef.value.show(id, operation, isDetail);
-    // };
-
     const onAdd = () => {
-      tabsViewStore.addTabByPath('/companyService/company/add', null);
+      tabsViewStore.addTabByPath('/companyService/enterprise/add', null);
     };
     const onEdit = (item: any) => {
-      tabsViewStore.addTabByPath('/companyService/company/edit', { id: item.CompanyID });
+      tabsViewStore.addTabByPath('/companyService/enterprise/edit', { id: item.CompanyID });
     };
 
     return {
+      changeCity,
       formRef,
       searchParams,
       formState,
@@ -210,7 +238,9 @@ export default defineComponent({
       onDel,
       onAdd,
       onEdit,
-      loadData
+      loadData,
+      regionList,
+      streetList
     };
   },
   created() {

+ 2 - 2
vue/src/views/companyService/post/edit.vue

@@ -182,10 +182,10 @@
           <a-form-item
             label="邮箱"
             :label-col="{ span: 6 }"
-            name="postEmial"
+            name="postEmail"
             :rules="[{ required: true, message: '请输入邮箱!' }]"
           >
-            <a-input v-model:value="dataModel.postEmial" placeholder=""/>
+            <a-input v-model:value="dataModel.postEmail" placeholder=""/>
           </a-form-item>
         </a-col>
       </a-row>

+ 35 - 19
vue/src/views/companyService/post/index.vue

@@ -10,8 +10,9 @@
         <a-col :span="6">
           <a-form-item label="" :label-col="{span:3}" name="">
             <label style="margin-left:26px;">招聘人数:</label>
-            <a-input type="number" v-model:value="searchParams.minCount" style="width: 30%;margin-right: 10px;" placeholder=""/>
-            <a-input type="number" v-model:value="searchParams.maxCount" style="width: 30%;"  placeholder=""/>
+            <a-input type="number" v-model:value="searchParams.minCount" style="width: 30%;margin-right: 10px;"
+                     placeholder=""/>
+            <a-input type="number" v-model:value="searchParams.maxCount" style="width: 30%;" placeholder=""/>
           </a-form-item>
         </a-col>
         <a-col :span="6">
@@ -56,7 +57,7 @@
                :loading="formState.loading"
                @change="handleTableChange"
                :row-selection="{ selectedRowKeys: formState.selectedRowKeys, onChange: onSelectChange}"
-               :row-key="record=>record.institutionID"
+               :row-key="record=>record.postID"
                bordered>
         <template #bodyCell="{ column, text, record }">
           <template v-if="column.key === 'operation'">
@@ -72,27 +73,30 @@
 </template>
 
 <script lang="ts">
-import {reactive, ref, computed, defineComponent} from 'vue';
+import {reactive, ref, computed, defineComponent, createVNode} from 'vue';
 import {DownOutlined, UpOutlined} from '@ant-design/icons-vue';
 import type {FormInstance} from 'ant-design-vue';
+import {Modal} from 'ant-design-vue';
 import type {TableColumnsType, TableProps} from 'ant-design-vue';
-import {getList} from '@/api/companyService/post';
+import {getList, del} from '@/api/companyService/post';
 import BExportExcel from "@/components/basic/excel/exportExcel/exportExcel.vue";
 import {getPaginationTotalTitle} from "@/utils/common";
+import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
 import dayjs from 'dayjs';
-import { useRoute } from 'vue-router';
+import {useRoute} from 'vue-router';
 import {useTabsViewStore} from "@/store/modules/tabsView";
+
 export default defineComponent({
-  components: { DownOutlined, UpOutlined, BExportExcel},
-  setup() {
+  components: {DownOutlined, UpOutlined, BExportExcel},
+  setup: function () {
     const formRef = ref<FormInstance>();
     const searchParams = reactive({
       pageIndex: 1,
       pageSize: 20,
       primaryKey: '',
-      minCount:0,
-      maxCount:0,
-      recordStatus:1
+      minCount: 0,
+      maxCount: 0,
+      recordStatus: 1
     });
     const formState = reactive({
       total: 0,
@@ -110,7 +114,7 @@ export default defineComponent({
       {title: '招聘人数', dataIndex: 'recruitCount', key: 'recruitCount', width: 120, align: "center"},
       {
         title: '有效开始日期', dataIndex: 'createTime', key: 'createTime', align: "center", customRender: (item) => {
-          return item.record.createTime==null?"": (dayjs(item.record.createTime).format('YYYY-MM-DD'))
+          return item.record.createTime == null ? "" : (dayjs(item.record.createTime).format('YYYY-MM-DD'))
         }
       },
       {title: '有效期(天)', dataIndex: 'validDay', key: 'validDay', align: "center"},
@@ -148,12 +152,12 @@ export default defineComponent({
     }
 
     const onAdd = () => {
-      tabsViewStore.addTabByPath('/companyService/post/add', null);
+      tabsViewStore.addTabByPath('/companyService/post/add', {});
     };
     const onEdit = (item: any) => {
       console.log(item);
       console.log(item.postID);
-      tabsViewStore.addTabByPath('/companyService/post/edit', { id: item.postID });
+      tabsViewStore.addTabByPath('/companyService/post/edit', {id: item.postID});
     };
 
     const handleTableChange: TableProps['onChange'] = (pag: { pageSize: number; current: number },) => {
@@ -171,7 +175,23 @@ export default defineComponent({
     }
 
     const onDel = (item: any) => {
-      console.log(item);
+      console.log(item.postID);
+      Modal.confirm({
+        title: '确认删除该岗位?',
+        icon: createVNode(ExclamationCircleOutlined),
+        content: '',
+        okText: '确认删除',
+        okType: 'danger',
+        okButtonProps: {},
+        cancelText: '取消',
+        onOk() {
+          del(item.postID).then(() => {
+            loadData();
+          });
+        },
+        onCancel() {
+        },
+      })
     };
 
     const importPost = () => {
@@ -180,9 +200,6 @@ export default defineComponent({
     const exportPost = () => {
       console.log('导出');
     }
-    const onOperates = () => {
-      console.log('新增');
-    };
 
     return {
       formRef,
@@ -194,7 +211,6 @@ export default defineComponent({
       handleTableChange,
       onSelectChange,
       onSearch,
-      onOperates,
       importPost,
       exportPost,
       onDel,

+ 1 - 1
vue/src/views/taskAndLog/dotask/edit.vue

@@ -145,7 +145,7 @@ export default defineComponent(
     };
     const onClose = () => {
       tabsViewStore.closeCurrentTabByPath('/taskAndLog/dotask/add');
-      tabsViewStore.closeCurrentTabByPath('taskAndLog/dotask/edit');
+      tabsViewStore.closeCurrentTabByPath('/taskAndLog/dotask/edit');
       router.push({ name: '/taskAndLog/dotask/index' });
     };