4 changed files with 289 additions and 6 deletions
@ -0,0 +1,265 @@ |
|||||
|
package com.kms.statistics.service; |
||||
|
|
||||
|
import cn.hutool.core.collection.CollectionUtil; |
||||
|
import cn.hutool.core.util.ObjectUtil; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
|
import com.jianwei.common.core.domain.SearchParam; |
||||
|
import com.jianwei.common.core.domain.entity.SysDept; |
||||
|
import com.jianwei.common.core.domain.entity.SysUser; |
||||
|
import com.jianwei.common.utils.StringUtils; |
||||
|
import com.kms.build.domain.BsSgcJsjdBuiSalaryEnsure; |
||||
|
import com.kms.build.domain.BsSgcjsjdBuiProInfo; |
||||
|
import com.kms.build.mapper.BsSgcJsjdBuiSalaryEnsureMapper; |
||||
|
import com.kms.build.mapper.BsSgcjsjdBuiProInfoMapper; |
||||
|
import com.kms.common.utils.UserUtils; |
||||
|
import com.kms.earlyStage.domain.BsSlgcQqjdLybzj; |
||||
|
import com.kms.earlyStage.domain.BsSlgcQqjdTbbzj; |
||||
|
import com.kms.earlyStage.domain.BsSlgcQqjdZlbzj; |
||||
|
import com.kms.earlyStage.mapper.BsSlgcQqjdLybzjMapper; |
||||
|
import com.kms.earlyStage.mapper.BsSlgcQqjdTbbzjMapper; |
||||
|
import com.kms.earlyStage.mapper.BsSlgcQqjdZlbzjMapper; |
||||
|
import com.kms.framework.web.domain.server.Sys; |
||||
|
import com.kms.statistics.domain.BzjAssertStatisticsVo; |
||||
|
import com.kms.system.service.SysDeptService; |
||||
|
import com.kms.system.service.SysXzqhService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
|
||||
|
@Service |
||||
|
public class BzjAssertStatisService { |
||||
|
@Autowired |
||||
|
BsSgcJsjdBuiSalaryEnsureMapper bsSgcJsjdBuiSalaryEnsureMapper; |
||||
|
|
||||
|
@Autowired |
||||
|
BsSlgcQqjdTbbzjMapper bsSlgcQqjdTbbzjMapper; |
||||
|
|
||||
|
@Autowired |
||||
|
BsSlgcQqjdLybzjMapper bsSlgcQqjdLybzjMapper; |
||||
|
|
||||
|
@Autowired |
||||
|
BsSlgcQqjdZlbzjMapper bsSlgcQqjdZlbzjMapper; |
||||
|
|
||||
|
@Autowired |
||||
|
SysDeptService sysDeptService; |
||||
|
|
||||
|
@Autowired |
||||
|
BsSgcjsjdBuiProInfoMapper bsSgcjsjdBuiProInfoMapper; |
||||
|
|
||||
|
@Autowired |
||||
|
SysXzqhService sysXzqhService; |
||||
|
|
||||
|
public IPage<BzjAssertStatisticsVo>iPage(SearchParam<BsSgcjsjdBuiProInfo> sp){ |
||||
|
SysUser sysUser = UserUtils.getUser(); |
||||
|
|
||||
|
BsSgcjsjdBuiProInfo data = sp.getData(); |
||||
|
|
||||
|
if (sysUser.getUserType().equals("00") && data.getAdcd() == null) { |
||||
|
String deptId = sysUser.getDeptId(); |
||||
|
SysDept sysDept = sysDeptService.get(deptId); |
||||
|
String xzqhId = sysDept.getXzqhId(); |
||||
|
data.setAdcd(xzqhId); |
||||
|
} |
||||
|
List<BsSgcjsjdBuiProInfo> list = null; |
||||
|
String isMajor=null; |
||||
|
Map<String, Object> params = sp.getParams(); |
||||
|
if (ObjectUtil.isNull(params)) { |
||||
|
list = bsSgcjsjdBuiProInfoMapper.getByUserPro(sysUser.getId(), sysUser.getUserType(), data.getId(), data.getProjectName(), |
||||
|
sysXzqhService.getSubString(data.getAdcd()), |
||||
|
"create_time", sp.getPageNum(), sp.getPageSize(),sp.getData().getProNo(),sp.getData().getProCode(),isMajor); |
||||
|
} else { |
||||
|
list = bsSgcjsjdBuiProInfoMapper.getByUserPro(sysUser.getId(), sysUser.getUserType(), data.getId(), |
||||
|
data.getProjectName(), sysXzqhService.getSubString(data.getAdcd()), (String) params.get("orderBy"), sp.getPageNum(), sp.getPageSize(),sp.getData().getProNo(),sp.getData().getProCode(),isMajor); |
||||
|
} |
||||
|
List<BsSgcjsjdBuiProInfo> bsSgcjsjdBuiProInfos = bsSgcjsjdBuiProInfoMapper.getCount(sysUser.getId(), sysUser.getUserType(), data.getId(), data.getProjectName(), |
||||
|
sysXzqhService.getSubString(data.getAdcd()), |
||||
|
"create_time", sp.getData().getProNo(),sp.getData().getProCode(),isMajor); |
||||
|
|
||||
|
List<BzjAssertStatisticsVo>bzjAssertStatisticsVoss=new ArrayList<>(); |
||||
|
if (CollectionUtil.isNotEmpty(list)){ |
||||
|
for (BsSgcjsjdBuiProInfo bs:list){ |
||||
|
BzjAssertStatisticsVo bzjAssertStatisticsVo=new BzjAssertStatisticsVo(); |
||||
|
bzjAssertStatisticsVo.setProjectName(bs.getProjectName()); |
||||
|
bzjAssertStatisticsVo.setProCode(bs.getProCode()); |
||||
|
bzjAssertStatisticsVo.setProNo(bs.getProNo()); |
||||
|
List<BzjAssertStatisticsVo>bzjAssertStatisticsVos=new ArrayList<>(); |
||||
|
|
||||
|
//工资保证金
|
||||
|
BzjAssertStatisticsVo bzjAssertStatisticsVo1=new BzjAssertStatisticsVo(); |
||||
|
LambdaQueryWrapper<BsSgcJsjdBuiSalaryEnsure>lw1=new LambdaQueryWrapper<>(); |
||||
|
List<BsSgcJsjdBuiSalaryEnsure> bsSgcJsjdBuiSalaryEnsures = bsSgcJsjdBuiSalaryEnsureMapper.selectList(lw1.eq(BsSgcJsjdBuiSalaryEnsure::getProNo, bs.getProNo()) |
||||
|
.eq(BsSgcJsjdBuiSalaryEnsure::getProCode, bs.getProCode())); |
||||
|
if (CollectionUtil.isNotEmpty(bsSgcJsjdBuiSalaryEnsures)){ |
||||
|
Integer depositAmount=0; |
||||
|
String[] depositMethods=new String[0]; |
||||
|
bzjAssertStatisticsVo1.setBsSgcJsjdBuiSalaryEnsures(bsSgcJsjdBuiSalaryEnsures); |
||||
|
for (BsSgcJsjdBuiSalaryEnsure be:bsSgcJsjdBuiSalaryEnsures){ |
||||
|
if (StringUtils.isNotEmpty(be.getDepositAmount())){ |
||||
|
depositAmount=depositAmount+Integer.parseInt(be.getDepositAmount()); |
||||
|
} |
||||
|
if (StringUtils.isNotEmpty(be.getBankGuaranteeLetterAmount())){ |
||||
|
depositAmount=depositAmount+Integer.parseInt(be.getBankGuaranteeLetterAmount()); |
||||
|
} |
||||
|
if (StringUtils.isNotEmpty(be.getGuaranteeCompanyAmount())){ |
||||
|
depositAmount=depositAmount+Integer.parseInt(be.getGuaranteeCompanyAmount()); |
||||
|
} |
||||
|
if (StringUtils.isNotEmpty(be.getInsuranceAmount())){ |
||||
|
depositAmount=depositAmount+Integer.parseInt(be.getInsuranceAmount()); |
||||
|
} |
||||
|
if (StringUtils.isNotEmpty(be.getDepositMethods())&&be.getDepositMethods().length>depositMethods.length){ |
||||
|
depositMethods=be.getDepositMethods(); |
||||
|
} |
||||
|
} |
||||
|
bzjAssertStatisticsVo1.setDepositMethods(depositMethods); |
||||
|
bzjAssertStatisticsVo1.setType("1"); |
||||
|
if (depositAmount>0){ |
||||
|
bzjAssertStatisticsVo1.setIsDeposit("1"); |
||||
|
}else { |
||||
|
bzjAssertStatisticsVo1.setIsDeposit("0"); |
||||
|
} |
||||
|
bzjAssertStatisticsVo1.setDepositAmount(String.valueOf(depositAmount)); |
||||
|
}else { |
||||
|
bzjAssertStatisticsVo1.setIsDeposit("0"); |
||||
|
} |
||||
|
|
||||
|
bzjAssertStatisticsVos.add(bzjAssertStatisticsVo1); |
||||
|
|
||||
|
//投标保证金
|
||||
|
BzjAssertStatisticsVo bzjAssertStatisticsVo2=new BzjAssertStatisticsVo(); |
||||
|
LambdaQueryWrapper<BsSlgcQqjdTbbzj>lw2=new LambdaQueryWrapper<>(); |
||||
|
List<BsSlgcQqjdTbbzj> bsSlgcQqjdTbbzjs = bsSlgcQqjdTbbzjMapper.selectList(lw2.eq(BsSlgcQqjdTbbzj::getProNo, bs.getProNo()) |
||||
|
.eq(BsSlgcQqjdTbbzj::getProjectCode, bs.getProCode())); |
||||
|
if (CollectionUtil.isNotEmpty(bsSlgcQqjdTbbzjs)){ |
||||
|
Integer depositAmount=0; |
||||
|
String[] depositMethods=new String[0]; |
||||
|
bzjAssertStatisticsVo2.setBsSlgcQqjdTbbzjs(bsSlgcQqjdTbbzjs); |
||||
|
for (BsSlgcQqjdTbbzj be:bsSlgcQqjdTbbzjs){ |
||||
|
if (StringUtils.isNotEmpty(be.getDepositAmount())){ |
||||
|
depositAmount=depositAmount+Integer.parseInt(be.getDepositAmount()); |
||||
|
} |
||||
|
if (StringUtils.isNotEmpty(be.getBankGuaranteeLetterAmount())){ |
||||
|
depositAmount=depositAmount+Integer.parseInt(be.getBankGuaranteeLetterAmount()); |
||||
|
} |
||||
|
if (StringUtils.isNotEmpty(be.getGuaranteeCompanyAmount())){ |
||||
|
depositAmount=depositAmount+Integer.parseInt(be.getGuaranteeCompanyAmount()); |
||||
|
} |
||||
|
if (StringUtils.isNotEmpty(be.getInsuranceAmount())){ |
||||
|
depositAmount=depositAmount+Integer.parseInt(be.getInsuranceAmount()); |
||||
|
} |
||||
|
if (StringUtils.isNotEmpty(be.getDepositMethods())&&be.getDepositMethods().length>depositMethods.length){ |
||||
|
depositMethods=be.getDepositMethods(); |
||||
|
} |
||||
|
} |
||||
|
bzjAssertStatisticsVo2.setDepositMethods(depositMethods); |
||||
|
bzjAssertStatisticsVo2.setType("2"); |
||||
|
if (depositAmount>0){ |
||||
|
bzjAssertStatisticsVo2.setIsDeposit("1"); |
||||
|
}else { |
||||
|
bzjAssertStatisticsVo2.setIsDeposit("0"); |
||||
|
} |
||||
|
bzjAssertStatisticsVo2.setDepositAmount(String.valueOf(depositAmount)); |
||||
|
}else { |
||||
|
bzjAssertStatisticsVo2.setIsDeposit("0"); |
||||
|
} |
||||
|
|
||||
|
bzjAssertStatisticsVos.add(bzjAssertStatisticsVo2); |
||||
|
|
||||
|
//履约保证金
|
||||
|
BzjAssertStatisticsVo bzjAssertStatisticsVo3=new BzjAssertStatisticsVo(); |
||||
|
LambdaQueryWrapper<BsSlgcQqjdLybzj>lw3=new LambdaQueryWrapper<>(); |
||||
|
List<BsSlgcQqjdLybzj> bsSlgcQqjdLybzjs = bsSlgcQqjdLybzjMapper.selectList(lw3.eq(BsSlgcQqjdLybzj::getProNo, bs.getProNo()) |
||||
|
.eq(BsSlgcQqjdLybzj::getProjectCode, bs.getProCode())); |
||||
|
if (CollectionUtil.isNotEmpty(bsSlgcQqjdLybzjs)){ |
||||
|
Integer depositAmount=0; |
||||
|
String[] depositMethods=new String[0]; |
||||
|
bzjAssertStatisticsVo2.setBsSlgcQqjdTbbzjs(bsSlgcQqjdTbbzjs); |
||||
|
for (BsSlgcQqjdLybzj be:bsSlgcQqjdLybzjs){ |
||||
|
if (StringUtils.isNotEmpty(be.getDepositAmount())){ |
||||
|
depositAmount=depositAmount+Integer.parseInt(be.getDepositAmount()); |
||||
|
} |
||||
|
if (StringUtils.isNotEmpty(be.getBankGuaranteeLetterAmount())){ |
||||
|
depositAmount=depositAmount+Integer.parseInt(be.getBankGuaranteeLetterAmount()); |
||||
|
} |
||||
|
if (StringUtils.isNotEmpty(be.getGuaranteeCompanyAmount())){ |
||||
|
depositAmount=depositAmount+Integer.parseInt(be.getGuaranteeCompanyAmount()); |
||||
|
} |
||||
|
if (StringUtils.isNotEmpty(be.getInsuranceAmount())){ |
||||
|
depositAmount=depositAmount+Integer.parseInt(be.getInsuranceAmount()); |
||||
|
} |
||||
|
if (StringUtils.isNotEmpty(be.getDepositMethods())&&be.getDepositMethods().length>depositMethods.length){ |
||||
|
depositMethods=be.getDepositMethods(); |
||||
|
} |
||||
|
} |
||||
|
bzjAssertStatisticsVo3.setDepositMethods(depositMethods); |
||||
|
bzjAssertStatisticsVo3.setType("3"); |
||||
|
if (depositAmount>0){ |
||||
|
bzjAssertStatisticsVo3.setIsDeposit("1"); |
||||
|
}else { |
||||
|
bzjAssertStatisticsVo3.setIsDeposit("0"); |
||||
|
} |
||||
|
bzjAssertStatisticsVo3.setDepositAmount(String.valueOf(depositAmount)); |
||||
|
}else { |
||||
|
bzjAssertStatisticsVo3.setIsDeposit("0"); |
||||
|
} |
||||
|
|
||||
|
bzjAssertStatisticsVos.add(bzjAssertStatisticsVo3); |
||||
|
|
||||
|
|
||||
|
//质量保证金
|
||||
|
BzjAssertStatisticsVo bzjAssertStatisticsVo4=new BzjAssertStatisticsVo(); |
||||
|
LambdaQueryWrapper<BsSlgcQqjdZlbzj>lw4=new LambdaQueryWrapper<>(); |
||||
|
List<BsSlgcQqjdZlbzj> bsSlgcQqjdZlbzjs = bsSlgcQqjdZlbzjMapper.selectList(lw4.eq(BsSlgcQqjdZlbzj::getProNo, bs.getProNo()) |
||||
|
.eq(BsSlgcQqjdZlbzj::getProjectCode, bs.getProCode())); |
||||
|
if (CollectionUtil.isNotEmpty(bsSlgcQqjdZlbzjs)){ |
||||
|
Integer depositAmount=0; |
||||
|
String[] depositMethods=new String[0]; |
||||
|
bzjAssertStatisticsVo1.setBsSgcJsjdBuiSalaryEnsures(bsSgcJsjdBuiSalaryEnsures); |
||||
|
for (BsSlgcQqjdZlbzj be:bsSlgcQqjdZlbzjs){ |
||||
|
if (StringUtils.isNotEmpty(be.getDepositAmount())){ |
||||
|
depositAmount=depositAmount+Integer.parseInt(be.getDepositAmount()); |
||||
|
} |
||||
|
if (StringUtils.isNotEmpty(be.getBankGuaranteeLetterAmount())){ |
||||
|
depositAmount=depositAmount+Integer.parseInt(be.getBankGuaranteeLetterAmount()); |
||||
|
} |
||||
|
if (StringUtils.isNotEmpty(be.getGuaranteeCompanyAmount())){ |
||||
|
depositAmount=depositAmount+Integer.parseInt(be.getGuaranteeCompanyAmount()); |
||||
|
} |
||||
|
if (StringUtils.isNotEmpty(be.getInsuranceAmount())){ |
||||
|
depositAmount=depositAmount+Integer.parseInt(be.getInsuranceAmount()); |
||||
|
} |
||||
|
if (StringUtils.isNotEmpty(be.getDepositMethods())&&be.getDepositMethods().length>depositMethods.length){ |
||||
|
depositMethods=be.getDepositMethods(); |
||||
|
} |
||||
|
} |
||||
|
bzjAssertStatisticsVo4.setDepositMethods(depositMethods); |
||||
|
bzjAssertStatisticsVo4.setType("4"); |
||||
|
if (depositAmount>0){ |
||||
|
bzjAssertStatisticsVo4.setIsDeposit("1"); |
||||
|
}else { |
||||
|
bzjAssertStatisticsVo4.setIsDeposit("0"); |
||||
|
} |
||||
|
bzjAssertStatisticsVo4.setDepositAmount(String.valueOf(depositAmount)); |
||||
|
}else { |
||||
|
bzjAssertStatisticsVo4.setIsDeposit("0"); |
||||
|
} |
||||
|
|
||||
|
bzjAssertStatisticsVos.add(bzjAssertStatisticsVo4); |
||||
|
|
||||
|
bzjAssertStatisticsVo.setChildren(bzjAssertStatisticsVos); |
||||
|
bzjAssertStatisticsVoss.add(bzjAssertStatisticsVo); |
||||
|
} |
||||
|
} |
||||
|
Page<BzjAssertStatisticsVo>page=new Page<>(sp.getPageNum(), sp.getPageSize()); |
||||
|
page.setRecords(bzjAssertStatisticsVoss); |
||||
|
page.setTotal(bsSgcjsjdBuiProInfos.size()); |
||||
|
return page; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
Loading…
Reference in new issue