浏览代码

会计项目excel导入优化

huangguoce 1 月之前
父节点
当前提交
f1bb9f2035

+ 8 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/controller/ReimbursementInfoController.java

@@ -19,6 +19,7 @@ import com.jeeplus.assess.reimbursement.reimbursementInfo.service.ReimbursementI
 import com.jeeplus.logging.annotation.ApiLog;
 import com.jeeplus.sys.domain.WorkAttachmentInfo;
 import com.jeeplus.sys.feign.IDictApi;
+import com.jeeplus.sys.service.dto.UserDTO;
 import com.jeeplus.utils.StringUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -124,6 +125,13 @@ public class ReimbursementInfoController {
         return ResponseEntity.ok(list);
     }
 
+    @ApiOperation(value = "根据姓名获取单个有资质用户数据")
+    @GetMapping(value = "/getUserBySignatureScribe")
+    public String getUserBySignatureScribe(@RequestParam String name,@RequestParam String userId) {
+        String currentUserId = service.getUserBySignatureScribe(name,userId);
+        return currentUserId;
+    }
+
 
     @ApiLog(value = "评估报销数据")
     @GetMapping("exportFile")

+ 58 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/service/ReimbursementInfoService.java

@@ -1367,6 +1367,8 @@ public class ReimbursementInfoService {
         return newList;
     }
 
+
+
     /**
      * 用户树形数据处理
      * @param userList
@@ -2011,6 +2013,62 @@ public class ReimbursementInfoService {
         }
     }
 
+    //单个用户查询(用于查询会计公司有资质的员工)
+    public String getUserBySignatureScribe(String name,String userId) {
+        UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getById(userId);
+        List<TreeUserDto> list = new ArrayList<>();
+        List<TreeUserDto> officeList = Lists.newArrayList();
+        List<String> strings = SpringUtil.getBean(IUserApi.class).hasUser();
+
+        List<TreeUserDto> officeAllList = infoMapper.findOfficeListByIdList(strings);
+
+        // 查询部门
+        if(userDTO.isAdmin() || (null != userDTO.getTenantDTO() && "10002".equals(userDTO.getTenantDTO().getId()))|| (null != userDTO.getTenantDTO() && "10004".equals(userDTO.getTenantDTO().getId()))){
+            officeList = infoMapper.findOfficeListByNotTenantId("10000");
+        }else{
+            officeList = infoMapper.findOfficeListByCompanyId(userDTO.getCompanyDTO().getId());
+        }
+        List<TreeUserDto> filterList = new ArrayList<>();
+        filterList.addAll(officeList);
+        filterList.addAll(officeAllList);
+        //查询综合管理公司
+        UserDTO dtoByName = SpringUtil.getBean(IUserApi.class).getByLoginNameNoTen("潘中");
+        List<TreeUserDto> officeList1 = infoMapper.findOfficeListByCompanyId2(dtoByName.getCompanyDTO().getId());
+        filterList.addAll(officeList1);
+        //当前登录人所属部门是中审江苏分所下的管理咨询部时
+        List<TreeUserDto> zsUserList = null;
+        String officeId = "";
+        for (TreeUserDto dto : officeList) {
+            if (dto.getName().equals("管理咨询部")){
+                officeId = dto.getId();
+                break;
+            }
+
+        }
+        if (userDTO.isAdmin() || (StringUtils.isNotBlank(officeId) && userDTO.getOfficeDTO().getId().equals(officeId))){
+            List<TreeUserDto> zsOfficeList = infoMapper.findOfficeListByCompanyId2(officeId);
+            filterList.addAll(zsOfficeList);
+            //查询管理咨询部下的用户信息
+            zsUserList=infoMapper.findZhglgsUserList3(name,officeId);
+        }
+        //如果当前登录人是会计公司,则查询有资质的员工
+        List<TreeUserDto> certUserList = infoMapper.findCertUserList(name);
+        //查询综合管理公司用户信息
+        List<TreeUserDto> userList1=infoMapper.findZhglgsUserList2(name);
+        List<TreeUserDto> combinedList = new ArrayList<>();
+        combinedList.addAll(certUserList);
+        combinedList.addAll(userList1);
+        if (zsUserList != null){
+            combinedList.addAll(zsUserList);
+        }
+        Optional<TreeUserDto> user = combinedList.stream()
+                .filter(u -> name.equals(u.getName()))
+                .findFirst();
+        if(user.isPresent()){
+            return user.get().getId();
+        }
+        return null;
+    }
 
 
     /**