Explorar el Código

新增用户档案面谈+面谈记录表

anderx hace 8 meses
padre
commit
e7bfdf4e4e

+ 29 - 3
src/main/java/com/goafanti/Interview/controller/UserArchivesInterviewController.java

@@ -3,6 +3,7 @@ package com.goafanti.Interview.controller;
 import com.goafanti.Interview.bo.UpdateUserBo;
 import com.goafanti.Interview.service.UserArchivesInterviewService;
 import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.controller.BaseController;
 import com.goafanti.common.model.UserArchivesInterview;
 import com.goafanti.core.shiro.token.TokenManager;
@@ -86,14 +87,21 @@ public class UserArchivesInterviewController extends BaseController {
     }
 
     /**
-     * 列表查询
+     * 客户档案面谈表列表查询
      *
      * @param in 参数
      * @return
      */
     @GetMapping("/list")
-    public Result<UserArchivesInterview> list(UserArchivesInterview in, Integer pageNo, Integer pageSize) {
-        return new Result<>().data(this.userArchivesInterviewService.list(in, pageNo, pageSize));
+    public Result list(UserArchivesInterview in, Integer pageNo, Integer pageSize) {
+        Result res = new Result<>();
+        if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)){
+            if (in.getUid()==null){
+                res.getError().add(buildError("客户ID不能为空"));
+                return res;
+            }
+        }
+        return res.data(this.userArchivesInterviewService.list(in, pageNo, pageSize));
     }
 
     /**
@@ -119,5 +127,23 @@ public class UserArchivesInterviewController extends BaseController {
         return res.data(this.userArchivesInterviewService.updateUser(in));
     }
 
+
+    /**
+     * 客户档案面谈信息及其他免谈信息
+     *
+     * @return
+     */
+    @GetMapping("/selectByPrdid")
+    public Result selectByPrdid(Integer prdid) {
+        Result res = new Result<>();
+        if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)){
+            if (prdid==null){
+                res.getError().add(buildError("客户ID不能为空"));
+                return res;
+            }
+        }
+        return res.data(this.userArchivesInterviewService.selectByPrdid(prdid));
+    }
+
 }
 

+ 2 - 0
src/main/java/com/goafanti/Interview/service/UserArchivesInterviewService.java

@@ -55,4 +55,6 @@ public interface UserArchivesInterviewService {
     Object updateUser(UpdateUserBo ua );
 
     Object pushUserFirstInterview();
+
+    Object selectByPrdid(Integer prdid);
 }

+ 16 - 3
src/main/java/com/goafanti/Interview/service/impl/UserArchivesInterviewServiceImpl.java

@@ -34,12 +34,12 @@ public class UserArchivesInterviewServiceImpl extends BaseMybatisDao<UserArchive
     private UserFirstInterviewMapper userFirstInterviewMapper;
     @Resource
     private UserDataLogMapper userDataLogMapper;
-    @Resource
-    private OrganizationIdentityMapper organizationIdentityMapper;
+
 
     @Override
     public Pagination<UserArchivesInterview> list(UserArchivesInterview userArchivesInterview, Integer pageNo, Integer pageSize) {
         Map<String, Object> params = new HashMap<>();
+        userArchivesInterview.setAid(TokenManager.getAdminId());
         params.put("in", userArchivesInterview);
         return (Pagination<UserArchivesInterview>) findPage("findUserArchivesInterviewList",
                 "findUserArchivesInterviewCount", params, pageNo, pageSize);
@@ -218,7 +218,20 @@ public class UserArchivesInterviewServiceImpl extends BaseMybatisDao<UserArchive
     }
 }
 
-private Map<String, List<OutPublicAidUid>> groupByAid(List<OutPublicAidUid> publicReleases) {
+    @Override
+    public Object selectByPrdid(Integer prdid) {
+        Map<String ,Object> res = new HashMap<>();
+        UserArchivesInterview uai = userArchivesInterviewMapper.selectByPrdid(prdid);
+        if (uai!=null){
+            res.put("data",uai);
+            List<UserArchivesInterview> list = userArchivesInterviewMapper.selectByUidAid(uai.getUid(), uai.getAid());
+            List<UserArchivesInterview> collect = list.stream().filter(e -> !e.getId().equals(uai.getId())).collect(Collectors.toList());
+            res.put("list",collect);
+        }
+        return res;
+    }
+
+    private Map<String, List<OutPublicAidUid>> groupByAid(List<OutPublicAidUid> publicReleases) {
     return publicReleases.stream()
             .filter(Objects::nonNull) // 过滤掉空对象
             .collect(Collectors.groupingBy(OutPublicAidUid::getAid));

+ 2 - 0
src/main/java/com/goafanti/common/dao/UserArchivesInterviewMapper.java

@@ -81,5 +81,7 @@ public interface UserArchivesInterviewMapper {
     List<UserArchivesInterview> selectByUidAid(@Param("uid") String uid, @Param("aid") String aid);
 
     List<UserArchivesInterview> selectByIds(String[] split1);
+
+    UserArchivesInterview selectByPrdid(Integer prdid);
 }
 

+ 6 - 0
src/main/java/com/goafanti/common/mapper/UserArchivesInterviewMapper.xml

@@ -247,5 +247,11 @@
             #{id}
         </foreach>
     </select>
+    <select id="selectByPrdid" resultMap="UserArchivesInterviewMap">
+        select
+        <include refid="UserArchivesInterviewAllSql"/>
+        from user_archives_interview
+        where prdid = #{prdid}
+    </select>
 </mapper>