Browse Source

更新企业档案与面谈接口修改

anderx 9 months ago
parent
commit
54ab5e63ba

+ 2 - 1
src/main/java/com/goafanti/Interview/controller/UserInterviewProjectController.java

@@ -4,6 +4,7 @@ import com.goafanti.Interview.service.UserInterviewProjectService;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.controller.BaseController;
 import com.goafanti.common.model.UserInterviewProject;
+import com.goafanti.common.model.UserInterviewProjectBo;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -80,7 +81,7 @@ public class UserInterviewProjectController extends BaseController {
      * @return
      */
     @GetMapping("/list")
-    public Result<UserInterviewProject> list(UserInterviewProject in, Integer pageNo, Integer pageSize) {
+    public Result<UserInterviewProjectBo> list(UserInterviewProject in, Integer pageNo, Integer pageSize) {
         return new Result<>().data(this.userInterviewProjectService.list(in, pageNo, pageSize));
     }
 

+ 8 - 2
src/main/java/com/goafanti/Interview/service/impl/UserInterviewProjectServiceImpl.java

@@ -1,10 +1,13 @@
 package com.goafanti.Interview.service.impl;
 
 import com.goafanti.Interview.service.UserInterviewProjectService;
+import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.UserInterviewProjectMapper;
 import com.goafanti.common.model.UserInterviewProject;
+import com.goafanti.common.model.UserInterviewProjectBo;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.core.shiro.token.TokenManager;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -24,10 +27,13 @@ public class UserInterviewProjectServiceImpl extends BaseMybatisDao<UserIntervie
 
 
     @Override
-    public Pagination<UserInterviewProject> list(UserInterviewProject userInterviewProject, Integer pageNo, Integer pageSize) {
+    public Pagination<UserInterviewProjectBo> list(UserInterviewProject userInterviewProject, Integer pageNo, Integer pageSize) {
         Map<String, Object> params = new HashMap<>();
+        if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)){
+            userInterviewProject.setAid(TokenManager.getAdminId());
+        }
         params.put("in", userInterviewProject);
-        return (Pagination<UserInterviewProject>) findPage("findUserInterviewProjectList",
+        return (Pagination<UserInterviewProjectBo>) findPage("findUserInterviewProjectList",
                 "findUserInterviewProjectCount", params, pageNo, pageSize);
     }
 

+ 15 - 4
src/main/java/com/goafanti/common/mapper/UserInterviewProjectMapper.xml

@@ -89,12 +89,23 @@
         where id = #{id}
     </update>
 
+    <resultMap type="com.goafanti.common.model.UserInterviewProjectBo" id="ListMap">
+        <result property="id" column="id" jdbcType="INTEGER"/>
+        <result property="uid" column="uid" jdbcType="VARCHAR"/>
+        <result property="aid" column="aid" jdbcType="VARCHAR"/>
+        <result property="pid" column="pid" jdbcType="VARCHAR"/>
+        <result property="examineStatus" column="examine_status" jdbcType="INTEGER"/>
+        <result property="examineStatusOther" column="examine_status_other" jdbcType="VARCHAR"/>
+        <result property="buyStatus" column="buy_status" jdbcType="INTEGER"/>
+        <result property="buyStatusOther" column="buy_status_other" jdbcType="VARCHAR"/>
+        <result property="name" column="bname" jdbcType="VARCHAR"/>
+    </resultMap>
     <!--查询指定行数据-->
-    <select id="findUserInterviewProjectList" resultMap="UserInterviewProjectMap">
+    <select id="findUserInterviewProjectList" resultMap="ListMap">
         select
-        <include refid="UserInterviewProjectAllSql"/>
-
-        from user_interview_project
+        a.id, a.uid, a.aid, a.pid, a.examine_status, a.examine_status_other, a.buy_status, a.buy_status_other,
+        b.bname name
+        from user_interview_project a left join business_project b on a.pid=b.id
         <where>
             <if test="id != null">
                 and id = #{id}

+ 14 - 0
src/main/java/com/goafanti/common/model/UserInterviewProjectBo.java

@@ -0,0 +1,14 @@
+package com.goafanti.common.model;
+
+public class UserInterviewProjectBo  extends UserInterviewProject{
+
+    private String name;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}