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

会计报销调整-报销人新增中审公司

sangwenwei 6 месяцев назад
Родитель
Сommit
e51bdf661e

+ 2 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/mapper/ReimbursementInfoMapper.java

@@ -110,6 +110,8 @@ public interface ReimbursementInfoMapper extends BaseMapper<ReimbursementInfo> {
     @InterceptorIgnore(tenantLine = "true")
     List<TreeUserDto> findZhglgsUserList( @Param("name")String name);
     @InterceptorIgnore(tenantLine = "true")
+    List<TreeUserDto> findZsUserList( @Param("name")String name,@Param("zsOfficeName")String zsOfficeName);
+    @InterceptorIgnore(tenantLine = "true")
     List<TreeUserDto> findCwglgsUserList( @Param("name")String name);
     @InterceptorIgnore(tenantLine = "true")
     List<TreeUserDto> findZhglgsUserList2( @Param("name")String name);

+ 17 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/mapper/xml/ReimbursementInfoMapper.xml

@@ -175,6 +175,23 @@
 		</if>
 	</select>
 
+	<select id="findZsUserList" resultType="com.jeeplus.assess.reimbursement.reimbursementInfo.service.dto.TreeUserDto">
+		SELECT
+		a.id,
+		a.`name`,
+		a.office_id AS parent_id,
+		b.`name` AS office_name,
+		true AS is_user
+		FROM
+		sys_user a
+		LEFT JOIN sys_office b ON a.office_id = b.id
+		WHERE
+		a.del_flag = 0 and a.is_admin is null and a.tenant_id = '10004' and b.name = #{zsOfficeName}
+		<if test="name != null and name != ''">
+			and a.`name` LIKE CONCAT ('%', #{name}, '%')
+		</if>
+	</select>
+
 	<select id="findCwglgsUserList" resultType="com.jeeplus.assess.reimbursement.reimbursementInfo.service.dto.TreeUserDto">
 		SELECT
 		a.id,

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

@@ -961,6 +961,29 @@ public class ReimbursementInfoService {
         UserDTO dtoByName = SpringUtil.getBean(IUserApi.class).getByLoginNameNoTen("潘中");
         List<TreeUserDto> officeList1 = infoMapper.findOfficeListByCompanyId2(dtoByName.getCompanyDTO().getId());
         filterList.addAll(officeList1);
+        //当前登录人是审计一部或审计二部员工
+        List<TreeUserDto> offices = Lists.newArrayList();
+        String zsOfficeName = "";
+        if (userDTO.getOfficeDTO().getName().contains("审计一部")){
+            //获取中审公司的张宁部门
+            offices =  infoMapper.findOfficeListByTenantId("10004");
+            for (TreeUserDto office : offices) {
+                if (office.getName().equals("张宁部门") || office.getName().equals("中审江苏分所")){
+                    filterList.add(office);
+                }
+                zsOfficeName = "张宁部门";
+            }
+        }else if (userDTO.getOfficeDTO().getName().contains("审计二部") ){
+            //获取中审公司的孙文宝部门
+            offices =  infoMapper.findOfficeListByTenantId("10004");
+            for (TreeUserDto office : offices) {
+                if (office.getName().equals("孙文宝部门") || office.getName().equals("中审江苏分所")){
+                    filterList.add(office);
+                }
+                zsOfficeName = "孙文宝部门";
+            }
+        }
+
         ArrayList<TreeUserDto> treeUsers = new ArrayList<>();
         //如果当前登录人角色是多公司报销则查询全部公司
         if (CollectionUtil.isNotEmpty(userDTO.getRoleDTOList())){
@@ -1063,12 +1086,18 @@ public class ReimbursementInfoService {
         List<TreeUserDto> userList = infoMapper.findUserList(name);
         //查询综合管理公司用户信息
         List<TreeUserDto> userList1=infoMapper.findZhglgsUserList(name);
+
         /*if (CollectionUtils.isNotEmpty(userList)) {
             list.addAll(userList);
         }*/
         ArrayList<TreeUserDto> treeUserDtos = new ArrayList<>();
         treeUserDtos.addAll(userList);
         treeUserDtos.addAll(userList1);
+        //查询中审公司用户信息
+        if (null != userDTO && null != userDTO.getOfficeDTO() && StringUtils.isNotBlank(userDTO.getOfficeDTO().getName()) && (userDTO.getOfficeDTO().getName().contains("审计一部") || userDTO.getOfficeDTO().getName().contains("审计二部"))){
+            List<TreeUserDto> zsUserList=infoMapper.findZsUserList(name,zsOfficeName);
+            treeUserDtos.addAll(zsUserList);
+        }
 
         if(null != userDTO && null != userDTO.getOfficeDTO() && StringUtils.isNotBlank(userDTO.getOfficeDTO().getId()) && ("1826176524081065985".equals(userDTO.getOfficeDTO().getId()) || "1826176609011527681".equals(userDTO.getOfficeDTO().getId()))) {
             //查询会计公司用户信息
@@ -1088,6 +1117,11 @@ public class ReimbursementInfoService {
                 list.add(officeDto);
             }
         }
+        for (TreeUserDto officeDto : offices) {
+            if("0".equals(officeDto.getParentId())){
+                list.add(officeDto);
+            }
+        }
         //去重
         List<TreeUserDto> newList = list.stream().collect(Collectors.collectingAndThen(
                 Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(TreeUserDto::getId))), ArrayList::new)