|
|
@ -1,5 +1,6 @@ |
|
|
|
package com.kms.build.service; |
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
@ -15,6 +16,10 @@ import com.kms.build.domain.dto.AssertStatisticsDto; |
|
|
|
import com.kms.build.domain.dto.HistogramDto; |
|
|
|
|
|
|
|
import com.kms.build.domain.dto.NumberDto; |
|
|
|
import com.kms.build.domain.vo.StageStatistics; |
|
|
|
import com.kms.build.mapper.BsSgcJsjdBuiComAccMapper; |
|
|
|
import com.kms.build.mapper.BsSgcJsjdBuiConstrMeasMapper; |
|
|
|
import com.kms.build.mapper.BsSgcJsjdBuiProgressPlanMapper; |
|
|
|
import com.kms.build.mapper.BsSgcjsjdBuiProInfoMapper; |
|
|
|
import com.kms.common.utils.UserUtils; |
|
|
|
import com.kms.earlyStage.domain.SpecialProjectInfo; |
|
|
@ -28,6 +33,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.time.Period; |
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
|
|
|
@ -47,6 +53,9 @@ public class BsSgcjsjdBuiProInfoService extends BaseService<BsSgcjsjdBuiProInfoM |
|
|
|
@Autowired |
|
|
|
private BsSgcJsjdBuiContInfoService bsSgcJsjdBuiContInfoService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private BsSgcJsjdBuiConstrMeasMapper bsSgcJsjdBuiConstrMeasMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private SysXzqhService sysXzqhService; |
|
|
|
|
|
|
@ -59,6 +68,11 @@ public class BsSgcjsjdBuiProInfoService extends BaseService<BsSgcjsjdBuiProInfoM |
|
|
|
@Autowired |
|
|
|
private BsSgcJsjdBuiComAccService bsSgcJsjdBuiComAccService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private BsSgcJsjdBuiComAccMapper bsSgcJsjdBuiComAccMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private BsSgcJsjdBuiProgressPlanMapper bsSgcJsjdBuiProgressPlanMapper; |
|
|
|
|
|
|
|
public IPage selectPage(SearchParam<BsSgcjsjdBuiProInfo> sp, String adcd) { |
|
|
|
|
|
|
@ -368,6 +382,64 @@ public class BsSgcjsjdBuiProInfoService extends BaseService<BsSgcjsjdBuiProInfoM |
|
|
|
return dto; |
|
|
|
} |
|
|
|
|
|
|
|
public StageStatistics getStageStatistics(SearchParam<BsSgcjsjdBuiProInfo> sp){ |
|
|
|
|
|
|
|
StageStatistics stageStatistics=new StageStatistics(); |
|
|
|
|
|
|
|
BsSgcJsjdBuiConstrMeas bsSgcJsjdBuiConstrMeas = bsSgcJsjdBuiConstrMeasMapper.selectOne(new QueryWrapper<BsSgcJsjdBuiConstrMeas>() |
|
|
|
.eq("proNo", sp.getData().getProNo()).eq("proCode", sp.getData().getProCode())); |
|
|
|
if (!ObjectUtil.isEmpty(bsSgcJsjdBuiConstrMeas)){ |
|
|
|
if (!ObjectUtil.isEmpty(bsSgcJsjdBuiConstrMeas.getReportTime1())){ |
|
|
|
stageStatistics.setPreliminaryApprovalDate(bsSgcJsjdBuiConstrMeas.getReportTime1()); |
|
|
|
stageStatistics.setCurrentStage("0"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
BsSgcjsjdBuiProInfo bsSgcjsjdBuiProInfo = bsSgcjsjdBuiProInfoMapper.selectOne(new QueryWrapper<BsSgcjsjdBuiProInfo>() |
|
|
|
.eq("proNo", sp.getData().getProNo()).eq("proCode", sp.getData().getProCode())); |
|
|
|
if (!ObjectUtil.isEmpty(bsSgcjsjdBuiProInfo)){ |
|
|
|
if (!ObjectUtil.isEmpty(bsSgcjsjdBuiProInfo.getCommencementDate())){ |
|
|
|
stageStatistics.setProjectStartedDate(bsSgcjsjdBuiProInfo.getCommencementDate()); |
|
|
|
if (!bsSgcjsjdBuiProInfo.getCommencementDate().before(new Date())){ |
|
|
|
stageStatistics.setCurrentStage("1"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
BsSgcJsjdBuiComAcc bsSgcJsjdBuiComAcc = bsSgcJsjdBuiComAccMapper.selectOne(new QueryWrapper<BsSgcJsjdBuiComAcc>() |
|
|
|
.eq("proNo", sp.getData().getProNo()).eq("proCode", sp.getData().getProCode())); |
|
|
|
if (!ObjectUtil.isEmpty(bsSgcJsjdBuiComAcc)){ |
|
|
|
if (!ObjectUtil.isEmpty(bsSgcJsjdBuiComAcc.getContractAcceptTime())){ |
|
|
|
stageStatistics.setProjectCompletedDate(bsSgcJsjdBuiComAcc.getContractAcceptTime()); |
|
|
|
stageStatistics.setCurrentStage("2"); |
|
|
|
} |
|
|
|
|
|
|
|
if (!ObjectUtil.isEmpty(bsSgcJsjdBuiComAcc.getContractAcceptTime())){ |
|
|
|
stageStatistics.setCompletionAcceptanceDate(bsSgcJsjdBuiComAcc.getContractAcceptTime()); |
|
|
|
stageStatistics.setCurrentStage("3"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
String mm = String.format(DateUtil.formatBetween(bsSgcjsjdBuiProInfo.getCommencementDate(), bsSgcjsjdBuiProInfo.getPlannedCompletionDate()), "MM"); |
|
|
|
stageStatistics.setTotalConstructionPeriod(mm); |
|
|
|
|
|
|
|
String mmn = String.format(DateUtil.formatBetween(bsSgcjsjdBuiProInfo.getCommencementDate(), new Date()), "MM"); |
|
|
|
stageStatistics.setElapseConstructionPeriod(mmn); |
|
|
|
|
|
|
|
BsSgcJsjdBuiProgressPlan bp = bsSgcJsjdBuiProgressPlanMapper.selectOne(new QueryWrapper<BsSgcJsjdBuiProgressPlan>() |
|
|
|
.eq("proNo", sp.getData().getProNo()).eq("proCode", sp.getData().getProCode())); |
|
|
|
BigDecimal total=bp.getV1().add(bp.getV2()).add(bp.getV3()).add(bp.getV4()) |
|
|
|
.add(bp.getV5()).add(bp.getV6()).add(bp.getV7()).add(bp.getV8()) |
|
|
|
.add(bp.getV9()).add(bp.getV10()).add(bp.getV11()).add(bp.getV12()); |
|
|
|
stageStatistics.setCompleteInvestmentAmount(total); |
|
|
|
|
|
|
|
stageStatistics.setPlanInvestmentAmount(bsSgcjsjdBuiProInfo.getCentralArrangedFunds() |
|
|
|
.add(bsSgcjsjdBuiProInfo.getProvincialFunding()).add(bsSgcjsjdBuiProInfo.getCityLevelFunds()) |
|
|
|
.add(bsSgcjsjdBuiProInfo.getCountyLevelFunds()).add(bsSgcjsjdBuiProInfo.getTownshipInvestments())); |
|
|
|
return stageStatistics; |
|
|
|
} |
|
|
|
|
|
|
|
@Data |
|
|
|
public class Use { |
|
|
|