Browse Source

企业部门信息

v6
yanyan 1 year ago
parent
commit
734884b3ff
  1. 2
      lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/project/system/dept/mapper/DeptMapper.java
  2. 6
      lib/EmergencyService/zdxtEmergencyAuthService/src/main/resources/mapper/system/DeptMapper.xml
  3. 60
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/Zfztjdm111915ServiceImpl.java
  4. 6
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/Zfryjdm2405301Mapper.xml

2
lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/project/system/dept/mapper/DeptMapper.java

@ -62,7 +62,7 @@ public interface DeptMapper
*/
List<Dept> selectDeptList(Dept dept);
List<Dept> selectDeptByZone();
List<Dept> selectDeptByZone(Dept dept);
/**
* 根据部门信息获取当前及一下所有部门(下钻)

6
lib/EmergencyService/zdxtEmergencyAuthService/src/main/resources/mapper/system/DeptMapper.xml

@ -44,6 +44,7 @@
<result property="isMappingUnit" column="isMappingUnit"/>
<result property="srzUnitId" column="srzUnitId"/>
<result property="taskId" column="taskId"/>
<result property="creditcode" column="creditcode"/>
<result property="zone" column="zone"/>
</resultMap>
@ -190,11 +191,14 @@
</select>
<select id="selectDeptByZone" resultMap="DeptResult">
<select id="selectDeptByZone" parameterType="Dept" resultMap="DeptResult">
<include refid="selectDeptVo"/>
where d.del_flag = '0'
and d.zone is not null
and d.zone != 2
<if test="params.dataScope != null and params.dataScope != ''">
${params.dataScope}
</if>
order by d.parent_id, d.order_num
</select>

60
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/Zfztjdm111915ServiceImpl.java

@ -13,10 +13,8 @@ import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@Service
@ -43,11 +41,32 @@ public class Zfztjdm111915ServiceImpl implements IZfztjdm111915Service {
@DataScope(deptField = "d.dept_id")
public List<Zfztjdm111915> getDeptStaticList(Zfryjdm2405301 zfryjdm2405301) {
// int totalNumber=0;
//List<Zfztjdm111915> zfztjdm111915List = new ArrayList<>();
//List<Zfztjdm111915> zfztjdm111915List = zfztjdm111915Mapper.selectZfztjdmListAndDeptScope(zfryjdm2405301);
List<Zfztjdm111915> zfztjdm111915List = zfztjdm111915Mapper.selectZfztjdmListAndDeptScope(zfryjdm2405301);
List<Dept> depts = deptMapper.selectDeptByZone();
Map<String, Zfztjdm111915> map = zfztjdm111915List.stream()
.collect(Collectors.toMap(
Zfztjdm111915::getDeptId,
Function.identity(),
(v1, v2) -> v2 // 键冲突时保留新值
));
Dept dept1 = new Dept();
dept1.setParams(zfryjdm2405301.getParams());
List<Dept> depts = deptMapper.selectDeptByZone(dept1);
if (CollectionUtils.isEmpty(depts)) return new ArrayList<>();
HashSet<String> collect = depts.stream().map(Dept::getDeptId).collect(Collectors.toCollection(HashSet::new));
zfztjdm111915List = zfztjdm111915List.stream().filter(i -> collect.contains(i.getDeptId())).collect(Collectors.toList());
for (Dept dept : depts) {
Zfztjdm111915 zfztjdm111915 = new Zfztjdm111915();
zfztjdm111915.setDeptId(dept.getDeptId());
zfztjdm111915.setSubName(dept.getName());
zfztjdm111915.setCode(dept.getCreditcode());
if (map.containsKey(dept.getDeptId())) {
Zfztjdm111915 value = map.get(dept.getDeptId());
zfztjdm111915.setCode(value!=null?value.getCode():null);
}
zfztjdm111915List.add(zfztjdm111915);
}
//HashSet<String> collect = depts.stream().map(Dept::getDeptId).collect(Collectors.toCollection(HashSet::new));
//zfztjdm111915List = zfztjdm111915List.stream().filter(i -> collect.contains(i.getDeptId())).collect(Collectors.toList());
// Map<String,Zfztjdm111915> zfztjdm111915Map=zfztjdm111915List.stream().collect(Collectors.toMap(Zfztjdm111915::getCode, Function.identity()));
List<Zfztjdm111915> hasList=new ArrayList<>();
List<Zfryjdm2405301> zfryjdm2405301List = iZfryjdm2405301Service.selectZfryjdmAndUserListGroupBy(zfryjdm2405301);
@ -70,14 +89,32 @@ public class Zfztjdm111915ServiceImpl implements IZfztjdm111915Service {
}
}
@Override
@DataScope
@DataScope(deptField = "d.dept_id")
public int getZFRYNumber(Zfryjdm2405301 zfryjdm2405301) {
int totalNumber=0;
//List<Zfztjdm111915> zfztjdm111915List = new ArrayList<>();
List<Zfztjdm111915> zfztjdm111915List = zfztjdm111915Mapper.selectZfztjdmListAndDeptScope(zfryjdm2405301);
List<Dept> depts = deptMapper.selectDeptByZone();
Map<String, Zfztjdm111915> map = zfztjdm111915List.stream()
.collect(Collectors.toMap(
Zfztjdm111915::getDeptId,
Function.identity(),
(v1, v2) -> v2 // 键冲突时保留新值
));
Dept dept1 = new Dept();
dept1.setParams(zfryjdm2405301.getParams());
List<Dept> depts = deptMapper.selectDeptByZone(dept1);
if (CollectionUtils.isEmpty(depts)) return 0;
HashSet<String> collect = depts.stream().map(Dept::getDeptId).collect(Collectors.toCollection(HashSet::new));
zfztjdm111915List = zfztjdm111915List.stream().filter(i -> collect.contains(i.getDeptId())).collect(Collectors.toList());
for (Dept dept : depts) {
Zfztjdm111915 zfztjdm111915 = new Zfztjdm111915();
zfztjdm111915.setDeptId(dept.getDeptId());
zfztjdm111915.setSubName(dept.getName());
zfztjdm111915.setCode(dept.getCreditcode());
if (map.containsKey(dept.getDeptId())) {
Zfztjdm111915 value = map.get(dept.getDeptId());
zfztjdm111915.setCode(value!=null?value.getCode():null);
}
zfztjdm111915List.add(zfztjdm111915);
}
// Map<String,Zfztjdm111915> zfztjdm111915Map=zfztjdm111915List.stream().collect(Collectors.toMap(Zfztjdm111915::getCode, Function.identity()));
List<Zfryjdm2405301> zfryjdm2405301List = iZfryjdm2405301Service.selectZfryjdmAndUserListGroupBy(zfryjdm2405301);
for (int i = 0; i < zfztjdm111915List.size(); i++) {
@ -98,6 +135,7 @@ public class Zfztjdm111915ServiceImpl implements IZfztjdm111915Service {
}
@Override
@DataScope(deptField = "x.dept_id")
public List<Zfryjdm2405301> export(Zfryjdm2405301 zfryjdm2405301) {
List<Zfztjdm111915> zfztjdm111915List = this.selectZfztjdmListAndDept(zfryjdm2405301.getZfdw());
List<Zfryjdm2405301> hasList=new ArrayList<>();

6
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/Zfryjdm2405301Mapper.xml

@ -73,6 +73,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
group by z.sfzcode_encrypt)x
left join (select dept_id,ancestors,creditcode from sys_dept where status='0' and del_flag='0') d
on x.dept_id=d.dept_id
<where>
<if test="params.dataScope != null and params.dataScope != ''">
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
</where>
order by zzjgdm
</select>

Loading…
Cancel
Save