|
@@ -636,10 +636,7 @@ public class SysAgencyLeaderServiceImpl extends ServiceImpl<SysAgencyLeaderMappe
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public BasePageResult<TeamInformation> queryTeamInfoPage(TeamInformationDto teamInformationDto) {
|
|
public BasePageResult<TeamInformation> queryTeamInfoPage(TeamInformationDto teamInformationDto) {
|
|
|
- String userId = teamInformationDto.getUserId();
|
|
|
|
|
- if (userId == null) {
|
|
|
|
|
- userId = BaseController.getUserId();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ String userId = BaseController.getUserId();
|
|
|
List<TeamInformation> informationList = new ArrayList<>();
|
|
List<TeamInformation> informationList = new ArrayList<>();
|
|
|
//机构负责人查询机构下的团队
|
|
//机构负责人查询机构下的团队
|
|
|
SysAgencyLeader sysAgencyLeaders = sysAgencyLeaderMapper.selectOne(new LambdaQueryWrapper<SysAgencyLeader>().eq(SysAgencyLeader::getUserId, userId)
|
|
SysAgencyLeader sysAgencyLeaders = sysAgencyLeaderMapper.selectOne(new LambdaQueryWrapper<SysAgencyLeader>().eq(SysAgencyLeader::getUserId, userId)
|
|
@@ -663,9 +660,11 @@ public class SysAgencyLeaderServiceImpl extends ServiceImpl<SysAgencyLeaderMappe
|
|
|
BigDecimal bigDecimal = new BigDecimal("0.00");
|
|
BigDecimal bigDecimal = new BigDecimal("0.00");
|
|
|
for (SysDept sysDept : sysDeptList) {
|
|
for (SysDept sysDept : sysDeptList) {
|
|
|
TeamInformation teamInformation = new TeamInformation();
|
|
TeamInformation teamInformation = new TeamInformation();
|
|
|
|
|
+ teamInformation.setUserName(sysAgencyLeaders.getUserName());
|
|
|
teamInformation.setDeptId(sysDept.getId());
|
|
teamInformation.setDeptId(sysDept.getId());
|
|
|
teamInformation.setDeptName(sysDept.getName());
|
|
teamInformation.setDeptName(sysDept.getName());
|
|
|
- List<SysUser> sysUsers = sysUserMapper.selectList(new LambdaQueryWrapper<SysUser>().likeRight(SysUser::getId, sysDept.getId()).eq(SysUser::getStatus, 1));
|
|
|
|
|
|
|
+ List<SysUser> sysUsers = sysUserMapper.selectList(new LambdaQueryWrapper<SysUser>()
|
|
|
|
|
+ .likeRight(SysUser::getId, sysDept.getId()).eq(SysUser::getStatus, 1));
|
|
|
teamInformation.setDeptManNum(sysUsers.size());
|
|
teamInformation.setDeptManNum(sysUsers.size());
|
|
|
List<InsOrders> insOrderList;
|
|
List<InsOrders> insOrderList;
|
|
|
//筛选订单,选择时间
|
|
//筛选订单,选择时间
|
|
@@ -689,36 +688,39 @@ public class SysAgencyLeaderServiceImpl extends ServiceImpl<SysAgencyLeaderMappe
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (insOrderList.size() > 0) {
|
|
if (insOrderList.size() > 0) {
|
|
|
- for (InsOrders insOrders : insOrderList) {
|
|
|
|
|
|
|
+ List<String> collect = insOrderList.stream().map(InsOrders::getOrderno).collect(Collectors.toList());
|
|
|
//查询订单下的所有子订单
|
|
//查询订单下的所有子订单
|
|
|
- List<InsAreaCompany> insAreaCompanies = insAreaCompanyMapper.selectList(new LambdaQueryWrapper<InsAreaCompany>().eq(InsAreaCompany::getOrderno, insOrders.getOrderno())
|
|
|
|
|
|
|
+ List<InsAreaCompany> insAreaCompanies = insAreaCompanyMapper.selectList(new LambdaQueryWrapper<InsAreaCompany>()
|
|
|
|
|
+ .in(InsAreaCompany::getOrderno, collect)
|
|
|
.eq(InsAreaCompany::getOrderstatus, 3));
|
|
.eq(InsAreaCompany::getOrderstatus, 3));
|
|
|
if (insAreaCompanies.size() > 0) {
|
|
if (insAreaCompanies.size() > 0) {
|
|
|
- for (InsAreaCompany insAreaCompany : insAreaCompanies) {
|
|
|
|
|
//累加每一个子订单的交强险费用+商业险费用+驾意险费用
|
|
//累加每一个子订单的交强险费用+商业险费用+驾意险费用
|
|
|
- bigDecimal = bigDecimal.add(insAreaCompany.getJqpremium()).add(insAreaCompany.getSypremium()).add(insAreaCompany.getJypremium());
|
|
|
|
|
|
|
+ BigDecimal jqpremium = insAreaCompanies.stream().map(InsAreaCompany::getJqpremium).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
|
|
+ BigDecimal sypremium = insAreaCompanies.stream().map(InsAreaCompany::getSypremium).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
|
|
+ BigDecimal jypremium = insAreaCompanies.stream().map(InsAreaCompany::getJypremium).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ bigDecimal = jqpremium.add(sypremium).add(jypremium);
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
teamInformation.setSumpremium(bigDecimal);
|
|
teamInformation.setSumpremium(bigDecimal);
|
|
|
- int num = 0;
|
|
|
|
|
|
|
+// int num = 0;
|
|
|
// 查团队有几人出单 :订单表中userid相等同时在 子订单表中状态为3已承保才为出单
|
|
// 查团队有几人出单 :订单表中userid相等同时在 子订单表中状态为3已承保才为出单
|
|
|
List<String> userIdList = sysUsers.stream().map(SysUser::getId).collect(Collectors.toList());
|
|
List<String> userIdList = sysUsers.stream().map(SysUser::getId).collect(Collectors.toList());
|
|
|
for (String s : userIdList) {
|
|
for (String s : userIdList) {
|
|
|
List<InsOrders> collect = insOrderList.stream().filter(InsOrders -> InsOrders.getUserid().equals(s)).collect(Collectors.toList());
|
|
List<InsOrders> collect = insOrderList.stream().filter(InsOrders -> InsOrders.getUserid().equals(s)).collect(Collectors.toList());
|
|
|
if (collect.size() > 0) {
|
|
if (collect.size() > 0) {
|
|
|
- InsOrders insOrders = collect.get(0);
|
|
|
|
|
- List<InsAreaCompany> insAreaCompanies1 = insAreaCompanyMapper.selectList(new LambdaQueryWrapper<InsAreaCompany>().eq(InsAreaCompany::getOrderno, insOrders.getOrderno())
|
|
|
|
|
|
|
+ List<String> insOrders = collect.stream().map(InsOrders::getOrderno).collect(Collectors.toList());
|
|
|
|
|
+ List<InsAreaCompany> insAreaCompanies1 = insAreaCompanyMapper.selectList(new LambdaQueryWrapper<InsAreaCompany>()
|
|
|
|
|
+ .in(InsAreaCompany::getOrderno, insOrders)
|
|
|
.eq(InsAreaCompany::getOrderstatus, 3));
|
|
.eq(InsAreaCompany::getOrderstatus, 3));
|
|
|
- if (insAreaCompanies1.size() > 0) {
|
|
|
|
|
- num++;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// if (insAreaCompanies1.size() > 0) {
|
|
|
|
|
+// num++;
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
|
|
+ teamInformation.setOrderManNum(insAreaCompanies1.size());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- teamInformation.setOrderManNum(num);
|
|
|
|
|
informationList.add(teamInformation);
|
|
informationList.add(teamInformation);
|
|
|
|
|
|
|
|
}
|
|
}
|