Просмотр исходного кода

求职人员信息管理-页面增删改查实现

Liudijing 11 месяцев назад
Родитель
Сommit
40a21a6dac

+ 50 - 2
src/main/java/com/hz/employmentsite/controller/jobUserManager/JobuserController.java

@@ -7,12 +7,18 @@ import com.hz.employmentsite.filter.exception.BaseResponse;
 import com.hz.employmentsite.filter.exception.RespGenerstor;
 import com.hz.employmentsite.services.service.AccountService;
 import com.hz.employmentsite.services.service.jobUserManager.JobuserService;
+import com.hz.employmentsite.util.DateUtils;
+import com.hz.employmentsite.util.ExcelHelper;
+import com.hz.employmentsite.vo.companyService.PostVo;
 import com.hz.employmentsite.vo.jobUserManager.JobUserVo;
 import com.hz.employmentsite.vo.jobUserManager.JobhuntVo;
 import com.hz.employmentsite.vo.taskAndLog.DotaskVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 import java.util.UUID;
 
@@ -24,14 +30,16 @@ public class JobuserController {
     private JobuserService jobuserService;
     @Autowired
     private AccountService accountService;
+    @Autowired
+    private DateUtils dateUtils;
 
     @ResponseBody
     @GetMapping("/getList")
     public BaseResponse getList(@RequestParam("page") int pageIndex, @RequestParam("limit") int pageSize,
-                                @RequestParam(required = false) String name, @RequestParam(required = false) String siteId, @RequestParam(required = false) Integer jobStatus, @RequestParam(required = false) Integer sexId,
+                                @RequestParam(required = false) String name, @RequestParam(required = false) String siteID, @RequestParam(required = false) String jobStatus, @RequestParam(required = false) Integer sexId,
                                 @RequestParam(required = false) Integer educationTypeId, @RequestParam(required = false) Integer emphasisTypeId) {
 
-        PageInfo<JobUserVo> result = jobuserService.getList(pageIndex, pageSize, null, name, siteId, jobStatus, sexId, educationTypeId, emphasisTypeId);
+        PageInfo<JobUserVo> result = jobuserService.getList(pageIndex, pageSize, null, name, siteID, jobStatus, sexId, educationTypeId, emphasisTypeId);
         return RespGenerstor.success(result);
     }
 
@@ -77,4 +85,44 @@ public class JobuserController {
         return RespGenerstor.success(1);
     }
 
+    @GetMapping("/export")
+    public BaseResponse export(HttpServletResponse response, @RequestParam(required = false) Boolean isExport,
+                               @RequestParam("page") int pageIndex, @RequestParam("limit") int pageSize,
+                               @RequestParam(required = false) String name, @RequestParam(required = false) String siteId, @RequestParam(required = false) String jobStatus,
+                               @RequestParam(required = false) Integer sexId,@RequestParam(required = false) Integer educationTypeId,
+                               @RequestParam(required = false) Integer emphasisTypeId) throws Exception {
+        PageInfo<JobUserVo> result = jobuserService.getList(pageIndex, pageSize, null, name, siteId, jobStatus, sexId, educationTypeId, emphasisTypeId);
+
+        if(isExport == null || !isExport){
+            return RespGenerstor.success(result);
+        }else{
+            ExcelHelper excelHelper = new ExcelHelper();
+            ExcelHelper.ExcelData data = excelHelper.new ExcelData();
+            data.setTitles(Arrays.asList(new String[]{"序号", "姓名", "公民身份号码","性别", "民族", "联系电话", "所属驿站", "出生日期", "文化程度", "地址", "就业状态", "重点人员类别"}));
+            int i = 0;
+            List<List<Object>> rowDatas = new ArrayList();
+            for (JobUserVo item : result.getList()) {
+                List<Object> row = new ArrayList();
+                ++i;
+                row.add(i);
+                row.add(item.getName());
+                row.add(item.getIdentityNumber());
+                row.add(item.getGenderName());
+                row.add(item.getNation());
+                row.add(item.getUserMobile());
+                row.add(item.siteName);
+                row.add(dateUtils.dateToStr(item.getBirthDay()));
+                row.add(item.cultureName);
+                row.add(item.getAddress());
+                row.add(item.jobStatusName);
+                row.add(item.keyTypeName);
+                rowDatas.add(row);
+            }
+            data.setRows(rowDatas);
+            excelHelper.exportExcel(response, data);
+            return null;
+        }
+
+    }
+
 }

+ 1 - 1
src/main/java/com/hz/employmentsite/mapper/cquery/JobuserCQuery.java

@@ -6,5 +6,5 @@ import org.apache.ibatis.annotations.Param;
 import java.util.List;
 
 public interface JobuserCQuery {
-    List<JobUserVo> selectJobuserList(@Param("jobuserID") String jobuserID,@Param("name") String name, @Param("siteId")String siteId, @Param("jobStatus")Integer jobStatus, @Param("sexId")Integer sexId, @Param("educationTypeId")Integer educationTypeId, @Param("emphasisTypeId")Integer emphasisTypeId);
+    List<JobUserVo> selectJobuserList(@Param("jobuserID") String jobuserID,@Param("name") String name, @Param("siteId")String siteId, @Param("jobStatus")String jobStatus, @Param("sexId")Integer sexId, @Param("educationTypeId")Integer educationTypeId, @Param("emphasisTypeId")Integer emphasisTypeId);
 }

+ 3 - 1
src/main/java/com/hz/employmentsite/services/impl/jobUserManager/JobuserServiceImpl.java

@@ -35,7 +35,7 @@ public class JobuserServiceImpl implements JobuserService {
     private PcExperienceMapper pcExperienceMapper;
 
     @Override
-    public PageInfo<JobUserVo> getList(Integer page, Integer rows, String jobuserID, String name, String siteId, Integer jobStatus, Integer sexId, Integer educationTypeId, Integer emphasisTypeId) {
+    public PageInfo<JobUserVo> getList(Integer page, Integer rows, String jobuserID, String name, String siteId, String jobStatus, Integer sexId, Integer educationTypeId, Integer emphasisTypeId) {
         PageHelper.startPage(page, rows);
 
         List<JobUserVo> list = jobuserCQuery.selectJobuserList(jobuserID, name, siteId, jobStatus, sexId, educationTypeId, emphasisTypeId);
@@ -115,6 +115,7 @@ public class JobuserServiceImpl implements JobuserService {
             dbData.setName(data.getName());
             dbData.setPyName(data.getPyName());
             dbData.setEngName(data.getEngName());
+            dbData.setJobStatusID(data.getJobStatusID());
             dbData.setSex(data.getSex());
             dbData.setNation(data.getNation());
             dbData.setPoliticsStatusID(data.getPoliticsStatusID());
@@ -151,6 +152,7 @@ public class JobuserServiceImpl implements JobuserService {
             dbData.setPyName(data.getPyName());
             dbData.setEngName(data.getEngName());
             dbData.setSex(data.getSex());
+            dbData.setJobStatusID(data.getJobStatusID());
             dbData.setNation(data.getNation());
             dbData.setPoliticsStatusID(data.getPoliticsStatusID());
             dbData.setBirthplace(data.getBirthplace());

+ 1 - 1
src/main/java/com/hz/employmentsite/services/service/jobUserManager/JobuserService.java

@@ -9,7 +9,7 @@ import com.hz.employmentsite.vo.taskAndLog.DotaskVo;
 import java.util.List;
 
 public interface JobuserService {
-    PageInfo<JobUserVo> getList(Integer page, Integer rows,String jobuserID, String name, String siteId, Integer jobStatus,Integer sexId,Integer educationTypeId,Integer emphasisTypeId);
+    PageInfo<JobUserVo> getList(Integer page, Integer rows,String jobuserID, String name, String siteId, String jobStatus,Integer sexId,Integer educationTypeId,Integer emphasisTypeId);
 
     JobUserVo getDataById(String id);
 

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

@@ -30,7 +30,7 @@
             and jobuser.siteId = #{siteId}
         </if>
         <if test="jobStatus != null and jobStatus != ''">
-            and jobuser.jobStatus = #{jobStatus}
+            and jobuser.jobStatusID = #{jobStatus}
         </if>
         <if test="sexId != null and sexId != ''">
             and jobuser.sex = #{sexId}

+ 9 - 7
vue/src/views/jobUserManager/jobuser/edit.vue

@@ -24,7 +24,8 @@
           </a-form-item>
         </a-col>
         <a-col :span="8">
-          <a-form-item label="性别" :label-col="{span:6}" name="sex">
+          <a-form-item label="性别" :label-col="{span:6}" name="sex"
+                       :rules="[{ required: true, message: '请选择性别!' }]">
             <a-select
               ref="select"
               v-model:value="dataModel.sex"
@@ -49,7 +50,8 @@
           </a-form-item>
         </a-col>
         <a-col :span="8">
-          <a-form-item label="政治面貌" :label-col="{span:6}" name="politicsStatusID">
+          <a-form-item label="政治面貌" :label-col="{span:6}" name="politicsStatusID"
+                       :rules="[{ required: true, message: '请选择政治面貌!' }]">
             <a-select
               ref="select"
               v-model:value="dataModel.politicsStatusID"
@@ -151,7 +153,7 @@
             label="身高"
             :label-col="{ span: 6 }"
             name="height"
-            :rules="[{ required: true, message: '请输入身高!' }]"
+            :rules="[{ required: false, message: '请输入身高!' }]"
           >
             <a-input v-model:value="dataModel.height" placeholder=""/>
           </a-form-item>
@@ -164,7 +166,7 @@
             label="视力"
             :label-col="{ span: 6 }"
             name="vision"
-            :rules="[{ required: true, message: '请输入视力!' }]"
+            :rules="[{ required: false, message: '请输入视力!' }]"
           >
             <a-input v-model:value="dataModel.vision" placeholder=""/>
           </a-form-item>
@@ -174,7 +176,7 @@
             label="体重"
             :label-col="{ span: 6 }"
             name="weight"
-            :rules="[{ required: true, message: '请输入体重!' }]"
+            :rules="[{ required: false, message: '请输入体重!' }]"
           >
             <a-input v-model:value="dataModel.weight" placeholder=""/>
           </a-form-item>
@@ -286,7 +288,7 @@
             label="邮政编码"
             :label-col="{ span: 6 }"
             name="postalCode"
-            :rules="[{ required: true, message: '请输入邮政编码!' }]"
+            :rules="[{ required: false, message: '请输入邮政编码!' }]"
           >
             <a-input v-model:value="dataModel.postalCode" placeholder=""/>
           </a-form-item>
@@ -587,7 +589,7 @@ export default defineComponent(
         if (formState.dataModel.regionCode) {
           get('system/area/getAreaList', {code: formState.dataModel.regionCode}).then(data => {
             streetList.value = data;
-            formState.dataModel.streetCode = "";
+            // formState.dataModel.streetCode = "";
           })
         }
       }

+ 34 - 3
vue/src/views/jobUserManager/jobuser/index.vue

@@ -97,6 +97,9 @@
       <a-row class="edit-operation">
         <a-col :span="24" style="text-align: right">
           <a-button type="primary" html-type="submit" @click='onAdd' functioncode="T01030102">新增</a-button>
+          <BExportExcel :title="'导出'" :filename="'求职人员信息'"
+                        :url="'Jobusermgr/Jobuser/export'"
+                        :params="{...searchParamsState, isExport: true, rows:10000}"></BExportExcel>
         </a-col>
       </a-row>
     </a-form>
@@ -125,16 +128,21 @@
 </template>
 
 <script lang="ts">
-import {reactive, ref, computed, defineComponent} from 'vue';
+import {reactive, ref, computed, defineComponent, createVNode} from 'vue';
 import type {FormInstance, TableColumnsType, TableProps, SelectProps} from 'ant-design-vue';
-import {getList} from '@/api/jobUserManager/jobuser';
+import {getList, del} from '@/api/jobUserManager/jobuser';
 import {getSysDictionaryList} from '@/api/system/dictionary';
 import {getPaginationTotalTitle} from '@/utils/common';
 import {useTabsViewStore} from "@/store/modules/tabsView";
 import {get} from "@/api/common";
+import {message, Modal} from "ant-design-vue";
+import {DownOutlined, ExclamationCircleOutlined, UpOutlined} from "@ant-design/icons-vue";
+import BExportExcel from "@/components/basic/excel/exportExcel/exportExcel.vue";
+import BImportExcel from "@/components/basic/excel/importExcel/importExcel.vue";
 
 export default defineComponent({
   name: 'JobUserList',
+  components: {DownOutlined, UpOutlined, BExportExcel, BImportExcel},
   setup() {
     const modalRoleUserRef = ref();
     const modalRoleEditRef = ref();
@@ -275,8 +283,31 @@ export default defineComponent({
       tabsViewStore.addTabByPath('/jobusermgr/jobseeker/edit', {id: item.jobuserID});
     };
 
-    const onDel=()=>{
+    const onDel = (item: any) => {
+      if (item) {
+        formState.selectedRowKeys.push(item.jobuserID as never)
+      }
 
+      if (formState.selectedRowKeys.length <= 0) {
+        message.warning('请选择需要删除的数据!');
+        return false;
+      }
+      Modal.confirm({
+        title: '确认删除?',
+        icon: createVNode(ExclamationCircleOutlined),
+        content: '',
+        okText: '确认删除',
+        okType: 'danger',
+        okButtonProps: {},
+        cancelText: '取消',
+        onOk() {
+          del(formState.selectedRowKeys).then(() => {
+            loadData();
+          });
+        },
+        onCancel() {
+        },
+      })
     }
 
     return {

+ 9 - 4
vue/src/views/taskAndLog/dotask/edit.vue

@@ -14,7 +14,8 @@
           </a-form-item>
         </a-col>
         <a-col :span="8">
-          <a-form-item label="任务类型" :label-col="{span:6}" name="workTypeID">
+          <a-form-item label="任务类型" :label-col="{span:6}" name="workTypeID"
+                       :rules="[{ required: true, message: '请选择任务类型!' }]">
             <a-select
               ref="select"
               v-model:value="dataModel.workTypeID"
@@ -42,7 +43,8 @@
       </a-row>
       <a-row :gutter="24">
         <a-col :span="8">
-          <a-form-item label="所属县区" :label-col="{span:6}" name="regionCode">
+          <a-form-item label="所属县区" :label-col="{span:6}" name="regionCode"
+                       :rules="[{ required: true, message: '请选择所属县区!' }]">
             <a-select
               ref="select"
               v-model:value="dataModel.regionCode"
@@ -55,7 +57,8 @@
           </a-form-item>
         </a-col>
         <a-col :span="8">
-          <a-form-item label="所属街道" :label-col="{span:6}" name="streetCode">
+          <a-form-item label="所属街道" :label-col="{span:6}" name="streetCode"
+                       :rules="[{ required: true, message: '请选择所属街道!' }]">
             <a-select
               ref="select"
               v-model:value="dataModel.streetCode"
@@ -69,7 +72,9 @@
       </a-row>
       <a-row>
         <a-col class="table-bottom-a1">
-          <a-form-item :label-col="{span:6}" label="" name="content">
+          <a-form-item :label-col="{span:6}" label="" name="content"
+                       :rules="[{ required: true, message: '请输入任务内容!' }]"
+          >
             <a-textarea v-model:value="dataModel.content" placeholder="任务内容" :rows="4"/>
           </a-form-item>
         </a-col>