|
|
|
@ -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<>(); |
|
|
|
|