ソースを参照

feat: 企业信息模块增加查询条件

zhangying 6 ヶ月 前
コミット
926a592add

+ 7 - 5
src/main/java/com/hz/employmentsite/controller/companyService/CompanyController.java

@@ -50,9 +50,10 @@ public class CompanyController {
                                                      @RequestParam(required = false) String companyCode, @RequestParam(required = false) String recordStatus,
                                                      @RequestParam(required = false) String regionCode, @RequestParam(required = false) String streetCode,
                                                      @RequestParam(required = false) String createUserId, @RequestParam(required = false) String workTime,
-                                                     @RequestParam(required = false) String loginUserID) { //loginUserID暂用来过滤app的当前登录人驿站的求职人员
+                                                     @RequestParam(required = false) String loginUserID, @RequestParam(required = false) String siteID,
+                                                     @RequestParam(required = false) Date startDate, @RequestParam(required = false) Date endDate) { //loginUserID暂用来过滤app的当前登录人驿站的求职人员
 
-        PageInfo<CompanyVo> result = companyService.getList(pageIndex, pageSize, companyIDList, companyName, companyCode, recordStatus, regionCode, streetCode, createUserId, workTime,loginUserID);
+        PageInfo<CompanyVo> result = companyService.getList(pageIndex, pageSize, companyIDList, companyName, companyCode, recordStatus, regionCode, streetCode, createUserId, workTime, loginUserID, siteID, startDate, endDate);
 
         return RespGenerstor.success(result);
     }
@@ -132,9 +133,10 @@ public class CompanyController {
                                @RequestParam("pageIndex") int pageIndex, @RequestParam("pageSize") Integer pageSize,
                                @RequestParam(required = false) List<String> companyIDList, @RequestParam(required = false) String companyName,
                                @RequestParam(required = false) String companyCode, @RequestParam(required = false) String recordStatus,
-                               @RequestParam(required = false) String regionCode, @RequestParam(required = false) String streetCode
-    ) throws Exception {
-        PageInfo<CompanyVo> result = companyService.getList(pageIndex, pageSize, companyIDList, companyName, companyCode, recordStatus, regionCode, streetCode, null, null, null);
+                               @RequestParam(required = false) String regionCode, @RequestParam(required = false) String streetCode,
+                               @RequestParam(required = false) String siteID, @RequestParam(required = false) Date startDate,
+                               @RequestParam(required = false) Date endDate) throws Exception {
+        PageInfo<CompanyVo> result = companyService.getList(pageIndex, pageSize, companyIDList, companyName, companyCode, recordStatus, regionCode, streetCode, null, null, null, siteID, startDate, endDate);
         if (isExport == null || !isExport) {
             return RespGenerstor.success(result);
         } else {

+ 11 - 6
src/main/java/com/hz/employmentsite/controller/companyService/PostController.java

@@ -5,7 +5,6 @@ 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.model.PcCompanyExample;
 import com.hz.employmentsite.services.service.AccountService;
 import com.hz.employmentsite.services.service.companyService.PostService;
 import com.hz.employmentsite.util.DateUtils;
@@ -40,9 +39,12 @@ public class PostController {
                                 @RequestParam(required = false) String companyName,
                                 @RequestParam(required = false) String recordStatus,
                                 @RequestParam(required = false) String companyID,
-                                @RequestParam(required = false) String loginUserID) { //loginUserID暂用来过滤app的当前登录人驿站的求职人员
+                                @RequestParam(required = false) String loginUserID,
+                                @RequestParam(required = false) String siteID,
+                                @RequestParam(required = false) Date startDate,
+                                @RequestParam(required = false) Date endDate) { //loginUserID暂用来过滤app的当前登录人驿站的求职人员
 
-        PageInfo<PostVo> result = postService.getList(pageIndex, pageSize, postIDList, professionName, minCount, maxCount, companyName, recordStatus,companyID,loginUserID);
+        PageInfo<PostVo> result = postService.getList(pageIndex, pageSize, postIDList, professionName, minCount, maxCount, companyName, recordStatus, companyID, loginUserID, siteID, startDate, endDate);
         return RespGenerstor.success(result);
     }
 
@@ -106,7 +108,7 @@ public class PostController {
     @GetMapping("/getPostsByCompanyID")
     public BaseResponse<List<PostVo>> getPostsByCompanyID(@RequestParam(required = false) String companyId) {
 //        var dataList = postService.getDataListByCompanyID(companyId);
-        PageInfo<PostVo> result = postService.getList(1, 99999, null, null, null, null, null, null, companyId,null);
+        PageInfo<PostVo> result = postService.getList(1, 99999, null, null, null, null, null, null, companyId, null, null, null, null);
         return RespGenerstor.success(result.getList());
     }
 
@@ -137,8 +139,11 @@ public class PostController {
                                @RequestParam(required = false) Integer minCount,
                                @RequestParam(required = false) Integer maxCount,
                                @RequestParam(required = false) String companyName,
-                               @RequestParam(required = false) String recordStatus ) throws Exception {
-        PageInfo<PostVo> result = postService.getList(pageIndex, pageSize, postIDList, professionName, minCount, maxCount, companyName, recordStatus,null,null);
+                               @RequestParam(required = false) String recordStatus,
+                               @RequestParam(required = false) String siteID,
+                               @RequestParam(required = false) Date startDate,
+                               @RequestParam(required = false) Date endDate) throws Exception {
+        PageInfo<PostVo> result = postService.getList(pageIndex, pageSize, postIDList, professionName, minCount, maxCount, companyName, recordStatus, null, null, siteID, startDate, endDate);
 
         if (isExport == null || !isExport) {
             return RespGenerstor.success(result);

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

@@ -3,6 +3,7 @@ package com.hz.employmentsite.mapper.cquery;
 import com.hz.employmentsite.vo.companyService.CompanyVo;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.Date;
 import java.util.List;
 
 public interface CompanyCQuery {
@@ -10,5 +11,6 @@ public interface CompanyCQuery {
                             @Param("companyCode") String companyCode, @Param("recordStatus") String recordStatus,
                             @Param("regionCode") String regionCode, @Param("streetCode") String streetCode,
                             @Param("createUserId") String createUserId, @Param("workTime") String workTime,
-                            @Param("curLoginUserSiteID") String curLoginUserSiteID);
+                            @Param("curLoginUserSiteID") String curLoginUserSiteID, @Param("siteID") String siteID,
+                            @Param("startDate") Date startDate, @Param("endDate") Date endDate);
 }

+ 9 - 3
src/main/java/com/hz/employmentsite/mapper/cquery/PostCQuery.java

@@ -1,14 +1,20 @@
 package com.hz.employmentsite.mapper.cquery;
 
 import com.hz.employmentsite.model.PcPost;
-import com.hz.employmentsite.vo.companyService.RecommendPostVo;
 import com.hz.employmentsite.vo.companyService.PostVo;
+import com.hz.employmentsite.vo.companyService.RecommendPostVo;
 import org.apache.ibatis.annotations.Param;
+
+import java.util.Date;
 import java.util.List;
 
 public interface PostCQuery {
-    List<PostVo> selectPostList(@Param("postIDList")String postIDList,@Param("professionName") String professionName, @Param("minCount")Integer minCount, @Param("maxCount")Integer maxCount,
-                                @Param("companyName")String companyName, @Param("RecordStatus") String RecordStatus,@Param("companyID")String companyID,@Param("curLoginUserSiteCompanyIDs")String curLoginUserSiteCompanyIDs);
+    List<PostVo> selectPostList(@Param("postIDList") String postIDList, @Param("professionName") String professionName,
+                                @Param("minCount") Integer minCount, @Param("maxCount") Integer maxCount,
+                                @Param("companyName") String companyName, @Param("RecordStatus") String RecordStatus,
+                                @Param("companyID") String companyID, @Param("curLoginUserSiteCompanyIDs") String curLoginUserSiteCompanyIDs,
+                                @Param("siteID") String siteID, @Param("startDate") Date startDate,
+                                @Param("endDate") Date endDate);
 
     List<RecommendPostVo> selectRecommendPostList(@Param("jobUserID") String jobUserID);
 

+ 4 - 3
src/main/java/com/hz/employmentsite/services/impl/companyService/CompanyServiceImpl.java

@@ -62,7 +62,8 @@ public class CompanyServiceImpl implements CompanyService {
                                        List<String> companyIDList, String companyName,
                                        String companyCode, String recordStatus,
                                        String regionCode, String streetCode,
-                                       String createUserId, String workTime, String loginUserID) {
+                                       String createUserId, String workTime, String loginUserID,
+                                       String siteID, Date startDate, Date endDate) {
         PageHelper.startPage(pageIndex, pageSize);
         String curLoginUserSiteID = "";
         if (!stringUtils.IsNullOrEmpty(loginUserID)) {
@@ -70,7 +71,7 @@ public class CompanyServiceImpl implements CompanyService {
             siteUserExp.or().andUserIDEqualTo(loginUserID);
             curLoginUserSiteID = pcSiteUserMapper.selectByExample(siteUserExp).get(0).getSiteID();
         }
-        List<CompanyVo> dataList = companyCQuery.getList(stringUtils.ListToInSql(companyIDList), companyName, companyCode, recordStatus, regionCode, streetCode, createUserId, workTime, curLoginUserSiteID);
+        List<CompanyVo> dataList = companyCQuery.getList(stringUtils.ListToInSql(companyIDList), companyName, companyCode, recordStatus, regionCode, streetCode, createUserId, workTime, curLoginUserSiteID, siteID, startDate, endDate);
         PageInfo<CompanyVo> result = new PageInfo(dataList);
         return result;
     }
@@ -224,7 +225,7 @@ public class CompanyServiceImpl implements CompanyService {
         }else{
             ids.add(id);
         }
-        return companyCQuery.getList(stringUtils.ListToInSql(ids), null, null, null, null, null, null, null,null).stream().findFirst().orElse(null);
+        return companyCQuery.getList(stringUtils.ListToInSql(ids), null, null, null, null, null, null, null, null, null, null, null).stream().findFirst().orElse(null);
     }
 
     @Override

+ 9 - 5
src/main/java/com/hz/employmentsite/services/impl/companyService/PostServiceImpl.java

@@ -51,21 +51,25 @@ public class PostServiceImpl implements PostService {
     private DictionaryService dictionaryService;
 
     @Override
-    public PageInfo<PostVo> getList(Integer page, Integer rows, List<String> postIDList, String professionName, Integer minCount, Integer maxCount, String companyName, String recordStatus,String companyID,String loginUserID) {
+    public PageInfo<PostVo> getList(Integer page, Integer rows, List<String> postIDList,
+                                    String professionName, Integer minCount, Integer maxCount,
+                                    String companyName, String recordStatus, String companyID,
+                                    String loginUserID, String siteID, Date startDate,
+                                    Date endDate) {
         PageHelper.startPage(page, rows);
         List<String> curLoginUserSiteCompanyIDs = new ArrayList<>();
-        if(!stringUtils.IsNullOrEmpty(loginUserID)){
+        if (!stringUtils.IsNullOrEmpty(loginUserID)) {
             PcSiteUserExample siteUserExp = new PcSiteUserExample();
             siteUserExp.or().andUserIDEqualTo(loginUserID);
             var curLoginUserSiteID = pcSiteUserMapper.selectByExample(siteUserExp).get(0).getSiteID();
             PcCompanyExample companyExp = new PcCompanyExample();
             companyExp.or().andSiteIDEqualTo(curLoginUserSiteID);
             var curLoginUserSiteCompanyList = companyMapper.selectByExample(companyExp).stream().toList();
-            for(PcCompany curLoginUserSiteCompany : curLoginUserSiteCompanyList){
+            for (PcCompany curLoginUserSiteCompany : curLoginUserSiteCompanyList) {
                 curLoginUserSiteCompanyIDs.add(curLoginUserSiteCompany.getCompanyID());
             }
         }
-        List<PostVo> list = postCQuery.selectPostList(stringUtils.ListToInSql(postIDList), professionName, minCount, maxCount, companyName, recordStatus,companyID,stringUtils.ListToInSql(curLoginUserSiteCompanyIDs));
+        List<PostVo> list = postCQuery.selectPostList(stringUtils.ListToInSql(postIDList), professionName, minCount, maxCount, companyName, recordStatus, companyID, stringUtils.ListToInSql(curLoginUserSiteCompanyIDs), siteID, startDate, endDate);
         PageInfo<PostVo> result = new PageInfo(list);
         return result;
 
@@ -237,7 +241,7 @@ public class PostServiceImpl implements PostService {
         }else{
             ids.add(id);
         }
-        return postCQuery.selectPostList(stringUtils.ListToInSql(ids), null, null, null, null, null,null,null).stream().findFirst().orElse(null);
+        return postCQuery.selectPostList(stringUtils.ListToInSql(ids), null, null, null, null, null, null, null, null, null, null).stream().findFirst().orElse(null);
     }
 
     @Override

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

@@ -6,6 +6,7 @@ import com.hz.employmentsite.model.PcSite;
 import com.hz.employmentsite.vo.companyService.AppCompanyPostVo;
 import com.hz.employmentsite.vo.companyService.CompanyVo;
 
+import java.util.Date;
 import java.util.List;
 
 public interface CompanyService {
@@ -14,7 +15,8 @@ public interface CompanyService {
                                 List<String> companyIDList, String companyName,
                                 String companyCode, String recordStatus,
                                 String regionCode, String streetCode,
-                                String createUserId, String workTime,String loginUserID);
+                                String createUserId, String workTime, String loginUserID,
+                                String siteID, Date startDate, Date endDate);
 
     List<PcCompany> getCompanyBySiteIDList(String siteID);
 

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

@@ -1,18 +1,31 @@
 package com.hz.employmentsite.services.service.companyService;
+
 import com.github.pagehelper.PageInfo;
-import com.hz.employmentsite.model.PcPost;
-import com.hz.employmentsite.vo.companyService.RecommendPostVo;
 import com.hz.employmentsite.vo.companyService.PostVo;
+import com.hz.employmentsite.vo.companyService.RecommendPostVo;
+
+import java.util.Date;
 import java.util.List;
 
 public interface PostService {
-    PageInfo<PostVo> getList(Integer page, Integer rows, List<String> postIDList,String professionName, Integer minCount, Integer maxCount, String companyName,String RecordStatus,String companyID,String loginUserID);
+    PageInfo<PostVo> getList(Integer page, Integer rows, List<String> postIDList,
+                             String professionName, Integer minCount, Integer maxCount,
+                             String companyName, String RecordStatus, String companyID,
+                             String loginUserID, String siteID, Date startDate,
+                             Date endDate);
+
     PageInfo<RecommendPostVo> getCommendPostList(Integer page, Integer rows, String jobUserID);
+
     Integer saveCommendPost(RecommendPostVo data, String userId);
+
     int save(PostVo data, String userId);
+
     int delete(List<String> ids);
+
     PostVo getDataById(String id);
+
     List<PostVo> getDataListByCompanyID(String companyID);
+
     List<PostVo> importPost(List<PostVo> dataList, String userID);
 
     int deletePostAndRecommendMgt(String id);

+ 13 - 0
src/main/resources/mapping/cquery/CompanyCQuery.xml

@@ -55,6 +55,19 @@
         <if test="curLoginUserSiteID!='' and curLoginUserSiteID!=null">
             and company.siteID = #{curLoginUserSiteID}
         </if>
+        <if test="siteID!='' and siteID!=null">
+            and company.siteID = #{siteID}
+        </if>
+        <if test="startDate != null and endDate == null">
+            and company.CreateTime <![CDATA[ >= ]]> #{startDate}
+        </if>
+        <if test="endDate != null and startDate == null">
+            and company.CreateTime <![CDATA[ <= ]]> #{endDate}
+        </if>
+        <if test="startDate != null and endDate != null">
+            and company.CreateTime <![CDATA[ >= ]]> #{startDate}
+            and company.CreateTime <![CDATA[ <= ]]> #{endDate}
+        </if>
         order by company.CreateTime desc,postCount desc
     </select>
 

+ 13 - 0
src/main/resources/mapping/cquery/PostCQuery.xml

@@ -48,6 +48,19 @@
             <if test="curLoginUserSiteCompanyIDs != '' and curLoginUserSiteCompanyIDs != null">
                 and post.companyID in (${curLoginUserSiteCompanyIDs})
             </if>
+            <if test="siteID!='' and siteID!=null">
+                and company.siteID = #{siteID}
+            </if>
+            <if test="startDate != null and endDate == null">
+                and post.CreateTime <![CDATA[ >= ]]> #{startDate}
+            </if>
+            <if test="endDate != null and startDate == null">
+                and post.CreateTime <![CDATA[ <= ]]> #{endDate}
+            </if>
+            <if test="startDate != null and endDate != null">
+                and post.CreateTime <![CDATA[ >= ]]> #{startDate}
+                and post.CreateTime <![CDATA[ <= ]]> #{endDate}
+            </if>
         </where>
         group by
         post.postID,post.workCode,post.workName,post.recruitCount,post.companyID,post.postName,post.recordStatus,post.workNature,post.validDay,

+ 38 - 2
vue/src/views/companyService/company/index.vue

@@ -74,8 +74,26 @@
           </a-form-item>
         </a-col>
         <a-col :span="6">
+          <a-form-item label="所属驿站" :label-col="{span:6}" name="siteID">
+            <a-select
+              ref="select"
+              v-model:value="searchParams.siteID"
+              :options="siteList"
+              :field-names="{ label: 'siteName', value: 'siteID' }"
+              :allow-clear="true"
+              @change="loadData"
+            >
+            </a-select>
+          </a-form-item>
         </a-col>
         <a-col :span="6">
+          <a-form-item label="登记时间" :label-col="{span:4}">
+            <a-date-picker v-model:value="searchParams.startDate" picker="date" value-format="YYYY-MM-DD"
+                           style="width: 120px;"/>
+            <label style="margin:10px;">-</label>
+            <a-date-picker v-model:value="searchParams.endDate" picker="date" value-format="YYYY-MM-DD"
+                           style="width: 120px"/>
+          </a-form-item>
         </a-col>
       </a-row>
       <a-row class="edit-operation">
@@ -133,6 +151,7 @@ import {useTabsViewStore} from '@/store/modules/tabsView';
 import {get} from "@/api/common";
 import type {ImportProps} from '@/components/basic/excel/importExcel/ImportProps';
 import PositionShowModal from './show.vue';
+import {getSiteList} from "@/api/baseSettings/siteInfo";
 
 export default defineComponent({
   components: {DownOutlined, UpOutlined, BExportExcel, BImportExcel, PositionShowModal},
@@ -146,7 +165,10 @@ export default defineComponent({
       companyCode: '',
       recordStatus: '',
       regionCode: '',
-      streetCode: ''
+      streetCode: '',
+      siteID: "",
+      startDate: "",
+      endDate: ""
     });
     // 导出Excel查询参数
     const exportSearchParams = computed(() => {
@@ -219,6 +241,7 @@ export default defineComponent({
       },
       {title: '操作', key: 'operation', fixed: 'right', width: 150, align: "center"},
     ];
+    const siteList = ref<Array<any>>([])
     const pagination = computed(() => ({
       total: formState.total,
       current: searchParams.pageIndex,
@@ -253,6 +276,16 @@ export default defineComponent({
       // console.log(regionList.value);
     });
 
+    // 获取驿站数据
+    const getAllSites = () => {
+      getSiteList({
+        pageIndex: 1,
+        pageSize: 9999
+      }).then((result: any) => {
+        siteList.value = result.list;
+      })
+    }
+
     const loadData = async function () {
       formState.loading = true;
       const result: any = await getList(searchParams);
@@ -337,11 +370,14 @@ export default defineComponent({
       regionList,
       streetList,
       onDetail,
-      exportSearchParams
+      exportSearchParams,
+      getAllSites,
+      siteList
     };
   },
   created() {
     this.loadData();
+    this.getAllSites();
   },
   activated() {
     if (history.state.params?.reload)

+ 43 - 4
vue/src/views/companyService/post/index.vue

@@ -22,9 +22,9 @@
         </a-col>
         <a-col :span="6">
           <a-form-item label="招聘人数" :label-col="{span:6}" name="recruitCount">
-            <a-input type="number" v-model:value="searchParams.minCount" style="width:110px;" placeholder="" />
+            <a-input type="number" v-model:value="searchParams.minCount" style="width:120px;" placeholder=""/>
             <label style="margin:10px;">-</label>
-            <a-input type="number" v-model:value="searchParams.maxCount" style="width:110px;" placeholder="" />
+            <a-input type="number" v-model:value="searchParams.maxCount" style="width:120px;" placeholder=""/>
           </a-form-item>
         </a-col>
         <a-col :span="6" style="text-align: left">
@@ -65,6 +65,28 @@
             </a-select>
           </a-form-item>
         </a-col>
+        <a-col :span="6">
+          <a-form-item label="所属驿站" :label-col="{span:6}" name="siteID">
+            <a-select
+              ref="select"
+              v-model:value="searchParams.siteID"
+              :options="siteList"
+              :field-names="{ label: 'siteName', value: 'siteID' }"
+              :allow-clear="true"
+              @change="loadData"
+            >
+            </a-select>
+          </a-form-item>
+        </a-col>
+        <a-col :span="6">
+          <a-form-item label="登记时间" :label-col="{span:6}">
+            <a-date-picker v-model:value="searchParams.startDate" picker="date" value-format="YYYY-MM-DD"
+                           style="width: 120px;"/>
+            <label style="margin:10px;">-</label>
+            <a-date-picker v-model:value="searchParams.endDate" picker="date" value-format="YYYY-MM-DD"
+                           style="width: 120px"/>
+          </a-form-item>
+        </a-col>
       </a-row>
       <a-row class="edit-operation">
         <a-col :span="24" style="text-align: right">
@@ -123,6 +145,7 @@ import {useTabsViewStore} from "@/store/modules/tabsView";
 import type {ImportProps} from "@/components/basic/excel/importExcel/ImportProps";
 import {get} from "@/api/common";
 import Recommend from "@/views/companyService/post/recommend.vue";
+import {getSiteList} from "@/api/baseSettings/siteInfo";
 
 export default defineComponent({
   components: {DownOutlined, UpOutlined, BExportExcel, BImportExcel, Recommend},
@@ -134,7 +157,10 @@ export default defineComponent({
       minCount: null,
       maxCount: null,
       professionName: null,
-      recordStatus: null
+      recordStatus: null,
+      siteID: "",
+      startDate: "",
+      endDate: ""
     });
     // 导出Excel查询参数
     const exportSearchParams = computed(() => {
@@ -146,6 +172,7 @@ export default defineComponent({
     const companyList = ref<SelectProps['options']>();
     const postStatusList = [{name: '启用', value: 1}, {name: '禁用', value: 0}];
     const recommendRef = ref();
+    const siteList = ref<Array<any>>([]);
     const importOptions = ref<ImportProps>({
       title: '导入',
       url: 'companyService/post/importPost',
@@ -234,6 +261,15 @@ export default defineComponent({
       formState.total = result.total;
       formState.loading = false;
     }
+    // 获取驿站数据
+    const getAllSites = () => {
+      getSiteList({
+        pageIndex: 1,
+        pageSize: 9999
+      }).then((result: any) => {
+        siteList.value = result.list;
+      })
+    }
 
     const onAdd = () => {
       tabsViewStore.addTabByPath('/companyService/post/add', {});
@@ -335,12 +371,15 @@ export default defineComponent({
       postStatusList,
       companyList,
       onDetail,
-      exportSearchParams
+      exportSearchParams,
+      siteList,
+      getAllSites
     };
   },
   created() {
     this.loadData();
     this.getCompanyList();
+    this.getAllSites();
   },
   activated() {
     const route = useRoute();