From 6b43d9a95080a8ef2801dca0f284daa4af3fd561 Mon Sep 17 00:00:00 2001 From: zth <1205836521@qq.com> Date: Fri, 28 Jun 2024 16:28:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E8=AF=81=E9=87=91=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/BsSgcJsjdBuiEnteInfoService.java | 1 + .../controller/BzjAssertStatisController.java | 17 +- .../domain/BzjAssertStatisticsVo.java | 12 +- .../service/BzjAssertStatisService.java | 265 ++++++++++++++++++ 4 files changed, 289 insertions(+), 6 deletions(-) create mode 100644 jwtech-system/src/main/java/com/kms/statistics/service/BzjAssertStatisService.java diff --git a/jwtech-system/src/main/java/com/kms/build/service/BsSgcJsjdBuiEnteInfoService.java b/jwtech-system/src/main/java/com/kms/build/service/BsSgcJsjdBuiEnteInfoService.java index c60419b0..914d4321 100644 --- a/jwtech-system/src/main/java/com/kms/build/service/BsSgcJsjdBuiEnteInfoService.java +++ b/jwtech-system/src/main/java/com/kms/build/service/BsSgcJsjdBuiEnteInfoService.java @@ -50,6 +50,7 @@ public class BsSgcJsjdBuiEnteInfoService extends BaseService bsSgcJsjdBuiEnteInfos = bsSgcJsjdBuiEnteInfoMapper.selectList(queryWrapper); + if (ObjectUtil.isNotEmpty(bsSgcJsjdBuiEnteInfos)) { proInfo.setEnterpriseInfoList(bsSgcJsjdBuiEnteInfos); } diff --git a/jwtech-system/src/main/java/com/kms/statistics/controller/BzjAssertStatisController.java b/jwtech-system/src/main/java/com/kms/statistics/controller/BzjAssertStatisController.java index ea0a5ca2..06c51ffb 100644 --- a/jwtech-system/src/main/java/com/kms/statistics/controller/BzjAssertStatisController.java +++ b/jwtech-system/src/main/java/com/kms/statistics/controller/BzjAssertStatisController.java @@ -1,7 +1,12 @@ package com.kms.statistics.controller; +import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.jianwei.common.core.domain.SearchParam; +import com.kms.build.domain.BsSgcjsjdBuiProInfo; import com.kms.statistics.domain.BzjAssertStatisticsVo; +import com.kms.statistics.service.BzjAssertStatisService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -10,8 +15,16 @@ import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("/statistics/bzj") public class BzjAssertStatisController { + + @Autowired + BzjAssertStatisService bzjAssertStatisService; + @PostMapping - public IPagepage(){ - return null; + public IPagegetStatistics(SearchParam sp){ + if (ObjectUtil.isEmpty(sp.getData())){ + BsSgcjsjdBuiProInfo data=new BsSgcjsjdBuiProInfo(); + sp.setData(data); + } + return bzjAssertStatisService.iPage(sp); } } diff --git a/jwtech-system/src/main/java/com/kms/statistics/domain/BzjAssertStatisticsVo.java b/jwtech-system/src/main/java/com/kms/statistics/domain/BzjAssertStatisticsVo.java index aff7f99c..1dc41f1b 100644 --- a/jwtech-system/src/main/java/com/kms/statistics/domain/BzjAssertStatisticsVo.java +++ b/jwtech-system/src/main/java/com/kms/statistics/domain/BzjAssertStatisticsVo.java @@ -27,6 +27,10 @@ public class BzjAssertStatisticsVo { private String id; private String projectName; private String proCode; + private String proNo; + + /** 1是工资保证金 2是投标保证金 3履约保证金 4质量保证金*/ + private String type; @Excel(name = "缴存方式") @@ -38,10 +42,10 @@ public class BzjAssertStatisticsVo { @ApiModelProperty("缴存金额") private String depositAmount; - @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "最新缴存日期", width = 30, dateFormat = "yyyy-MM-dd") - @ApiModelProperty("最新缴存日期") - private Date depositAmountDate; +// @JsonFormat(pattern = "yyyy-MM-dd") +// @Excel(name = "最新缴存日期", width = 30, dateFormat = "yyyy-MM-dd") +// @ApiModelProperty("最新缴存日期") +// private Date depositAmountDate; @Excel(name = "是否缴存金额") @ApiModelProperty("缴存金额") diff --git a/jwtech-system/src/main/java/com/kms/statistics/service/BzjAssertStatisService.java b/jwtech-system/src/main/java/com/kms/statistics/service/BzjAssertStatisService.java new file mode 100644 index 00000000..f786106a --- /dev/null +++ b/jwtech-system/src/main/java/com/kms/statistics/service/BzjAssertStatisService.java @@ -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 IPageiPage(SearchParam 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 list = null; + String isMajor=null; + Map 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 bsSgcjsjdBuiProInfos = bsSgcjsjdBuiProInfoMapper.getCount(sysUser.getId(), sysUser.getUserType(), data.getId(), data.getProjectName(), + sysXzqhService.getSubString(data.getAdcd()), + "create_time", sp.getData().getProNo(),sp.getData().getProCode(),isMajor); + + ListbzjAssertStatisticsVoss=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()); + ListbzjAssertStatisticsVos=new ArrayList<>(); + + //工资保证金 + BzjAssertStatisticsVo bzjAssertStatisticsVo1=new BzjAssertStatisticsVo(); + LambdaQueryWrapperlw1=new LambdaQueryWrapper<>(); + List 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(); + LambdaQueryWrapperlw2=new LambdaQueryWrapper<>(); + List 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(); + LambdaQueryWrapperlw3=new LambdaQueryWrapper<>(); + List 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(); + LambdaQueryWrapperlw4=new LambdaQueryWrapper<>(); + List 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); + } + } + Pagepage=new Page<>(sp.getPageNum(), sp.getPageSize()); + page.setRecords(bzjAssertStatisticsVoss); + page.setTotal(bsSgcjsjdBuiProInfos.size()); + return page; + } + + +}