|
@ -12,6 +12,7 @@ import com.easy.admin.common.core.exception.EasyException; |
|
|
import com.easy.admin.common.util.CommonUtils; |
|
|
import com.easy.admin.common.util.CommonUtils; |
|
|
import com.easy.admin.modules.huzhou.common.HuzhouCommonUtils; |
|
|
import com.easy.admin.modules.huzhou.common.HuzhouCommonUtils; |
|
|
import com.easy.admin.modules.huzhou.common.TemplateExcelUtils; |
|
|
import com.easy.admin.modules.huzhou.common.TemplateExcelUtils; |
|
|
|
|
|
import com.easy.admin.modules.huzhou.dao.HuzhouContractinfoMapper; |
|
|
import com.easy.admin.modules.huzhou.dao.HuzhouProjectinfoHistoryMapper; |
|
|
import com.easy.admin.modules.huzhou.dao.HuzhouProjectinfoHistoryMapper; |
|
|
import com.easy.admin.modules.huzhou.dao.HuzhouProjectinfoMapper; |
|
|
import com.easy.admin.modules.huzhou.dao.HuzhouProjectinfoMapper; |
|
|
import com.easy.admin.modules.huzhou.dao.HuzhouSubProjectinfoMapper; |
|
|
import com.easy.admin.modules.huzhou.dao.HuzhouSubProjectinfoMapper; |
|
@ -86,6 +87,9 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM |
|
|
@Lazy |
|
|
@Lazy |
|
|
IHuzhouContractinfoService contractinfoService; |
|
|
IHuzhouContractinfoService contractinfoService; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
HuzhouContractinfoMapper contractinfoMapper; |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
|
|
|
|
|
|
public void submitProject(MultipartFile[] multipartFile,HuzhouProjectinfo info) throws IOException { |
|
|
public void submitProject(MultipartFile[] multipartFile,HuzhouProjectinfo info) throws IOException { |
|
@ -540,7 +544,6 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM |
|
|
ProjectInfoAuthSelect projectInfoAuthSelect = CommonUtils.setGetProjectInfoAuth(projectInfo); |
|
|
ProjectInfoAuthSelect projectInfoAuthSelect = CommonUtils.setGetProjectInfoAuth(projectInfo); |
|
|
List<HuzhouProjectinfoOV> projectAndChildInfoPageList = projectinfoMapper.getProjectAndChildInfoPageList(projectInfoAuthSelect); |
|
|
List<HuzhouProjectinfoOV> projectAndChildInfoPageList = projectinfoMapper.getProjectAndChildInfoPageList(projectInfoAuthSelect); |
|
|
List<String> zIds = projectAndChildInfoPageList.stream().map(x -> x.getId()).collect(Collectors.toList()); |
|
|
List<String> zIds = projectAndChildInfoPageList.stream().map(x -> x.getId()).collect(Collectors.toList()); |
|
|
// List<List<String>> cIds0 = projectAndChildInfoPageList.stream().filter(x -> x.getChildren().size() > 0).map(x -> x.getChildren().stream().map(o -> o.getId()).collect(Collectors.toList())).collect(Collectors.toList());
|
|
|
|
|
|
List<String> cIds = new ArrayList<>(); |
|
|
List<String> cIds = new ArrayList<>(); |
|
|
for(HuzhouProjectinfoOV info:projectAndChildInfoPageList){ |
|
|
for(HuzhouProjectinfoOV info:projectAndChildInfoPageList){ |
|
|
if(info.getChildren()!=null){ |
|
|
if(info.getChildren()!=null){ |
|
@ -711,10 +714,15 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM |
|
|
ProjectInfoAuthSelect projectInfoAuthSelect = CommonUtils.setGetProjectInfoAuth(projectInfo); |
|
|
ProjectInfoAuthSelect projectInfoAuthSelect = CommonUtils.setGetProjectInfoAuth(projectInfo); |
|
|
List<HuzhouProjectinfoOV> projectAndChildInfoPageList = projectinfoMapper.getProjectAndChildInfoPageList(projectInfoAuthSelect); |
|
|
List<HuzhouProjectinfoOV> projectAndChildInfoPageList = projectinfoMapper.getProjectAndChildInfoPageList(projectInfoAuthSelect); |
|
|
Map<String, List<HuzhouProjectinfoOV>> zxmMap = projectAndChildInfoPageList.stream().collect(Collectors.groupingBy(HuzhouProjectinfo::getType)); |
|
|
Map<String, List<HuzhouProjectinfoOV>> zxmMap = projectAndChildInfoPageList.stream().collect(Collectors.groupingBy(HuzhouProjectinfo::getType)); |
|
|
List<List<HuzhouSubProjectinfo>> cxm = projectAndChildInfoPageList.stream().map(HuzhouProjectinfoOV::getChildren) |
|
|
List<HuzhouSubProjectinfo> cxm = new ArrayList<>(); |
|
|
.filter(children -> children.size() > 0).collect(Collectors.toList()); |
|
|
for(HuzhouProjectinfoOV info:projectAndChildInfoPageList){ |
|
|
Map<String, List<HuzhouSubProjectinfo>> cxmMap = cxm.stream().flatMap(x -> x.stream()) |
|
|
if(info.getChildren()!=null){ |
|
|
.collect(Collectors.groupingBy(HuzhouProjectinfo::getType)); |
|
|
for(HuzhouSubProjectinfo child:info.getChildren()){ |
|
|
|
|
|
cxm.add(child); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
Map<String, List<HuzhouSubProjectinfo>> cxmMap = cxm.stream().collect(Collectors.groupingBy(HuzhouProjectinfo::getType)); |
|
|
int zxmNum=0; |
|
|
int zxmNum=0; |
|
|
int cxmNum=0; |
|
|
int cxmNum=0; |
|
|
for (String key:zxmMap.keySet()) { |
|
|
for (String key:zxmMap.keySet()) { |
|
@ -724,6 +732,7 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM |
|
|
cxmNum= zxmMap.get(key).size()+cxmNum; |
|
|
cxmNum= zxmMap.get(key).size()+cxmNum; |
|
|
} |
|
|
} |
|
|
int total = zxmNum + cxmNum; |
|
|
int total = zxmNum + cxmNum; |
|
|
|
|
|
|
|
|
List<String> rkIds = zxmMap.get("1").stream().map(x -> x.getId()).collect(Collectors.toList()); |
|
|
List<String> rkIds = zxmMap.get("1").stream().map(x -> x.getId()).collect(Collectors.toList()); |
|
|
List<String> crkIds = cxmMap.get("1").stream().map(x->x.getId()).collect(Collectors.toList()); |
|
|
List<String> crkIds = cxmMap.get("1").stream().map(x->x.getId()).collect(Collectors.toList()); |
|
|
List<String> ptIds= zxmMap.get("2").stream().map(x -> x.getId()).collect(Collectors.toList()); |
|
|
List<String> ptIds= zxmMap.get("2").stream().map(x -> x.getId()).collect(Collectors.toList()); |
|
@ -753,62 +762,20 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public NewFundOV getFundByType(List<String> ids) { |
|
|
public NewFundOV getFundByType() { |
|
|
List<String> projectIds = this.getIdsByType().getRkIdsList(); |
|
|
List<String> projectIds = this.getIdsByType().getRkIdsList(); |
|
|
List<String> zprojectIds = new ArrayList<>(projectIds); |
|
|
|
|
|
List<String> cprojectIds = this.getIdsByType().getCrkIdsList(); |
|
|
List<String> cprojectIds = this.getIdsByType().getCrkIdsList(); |
|
|
projectIds.addAll(cprojectIds); |
|
|
projectIds.addAll(cprojectIds); |
|
|
BigDecimal totalAmount = new BigDecimal("0.00"); |
|
|
|
|
|
BigDecimal payAmount = new BigDecimal("0.00"); |
|
|
|
|
|
BigDecimal payCentral = new BigDecimal("0.00"); |
|
|
|
|
|
BigDecimal payProvincial = new BigDecimal("0.00"); |
|
|
|
|
|
NewFundOV result = null; |
|
|
NewFundOV result = null; |
|
|
if(projectIds.size()!=0){ |
|
|
if(projectIds.size()!=0){ |
|
|
List<HuzhouContractinfo> contractInfoList = contractinfoService.ListByProjectIds(projectIds); |
|
|
Map<String, BigDecimal> totalMap = contractinfoMapper.getTotalByProjectIds(projectIds); |
|
|
List<HuzhouPlaninfo> planInfoList = planinfoService.listByProjectIds(projectIds); |
|
|
Map<String, BigDecimal> paymentMap = contractinfoMapper.getPaymentsByProjectIds(projectIds); |
|
|
Map<String,HuzhouContractinfo> contractMoneyMap; |
|
|
BigDecimal totalAmount = totalMap.get("totalAcount"); |
|
|
List<String> finishPlanTaskList; |
|
|
BigDecimal totalCentral = totalMap.get("centralAcount"); |
|
|
for(String projectId:projectIds){ |
|
|
BigDecimal totalProvincial = totalMap.get("provincialAcount"); |
|
|
contractMoneyMap = contractInfoList.stream().filter(x -> x.getProjectId().equals(projectId)) |
|
|
BigDecimal payAmount = paymentMap.get("totalPayment"); |
|
|
.collect(Collectors.toMap(HuzhouContractinfo::getTaskName,o->o)); |
|
|
BigDecimal payCentral = paymentMap.get("centralPayment"); |
|
|
finishPlanTaskList = planInfoList.stream().filter(x->x.getProjectId().equals(projectId)) |
|
|
BigDecimal payProvincial = paymentMap.get("provincialPayment"); |
|
|
.filter(x->x.getIsfinish().equals("2")).map(x->x.getTaskName()).collect(Collectors.toList()); |
|
|
|
|
|
for(String key:contractMoneyMap.keySet()){ |
|
|
|
|
|
if(finishPlanTaskList.contains(key)){ |
|
|
|
|
|
payAmount=payAmount.add(new BigDecimal(Double.toString(contractMoneyMap.get(key).getTotalMoney()))); |
|
|
|
|
|
payCentral=payCentral.add(new BigDecimal(Double.toString(contractMoneyMap.get(key).getCentralMoney()))); |
|
|
|
|
|
payProvincial=payProvincial.add(new BigDecimal(Double.toString(contractMoneyMap.get(key).getProvincialMoney()))); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
BigDecimal zxmTotal = new BigDecimal("0.00"); |
|
|
|
|
|
BigDecimal cxmTotal = new BigDecimal("0.00"); |
|
|
|
|
|
BigDecimal zxmCentral = new BigDecimal("0.00"); |
|
|
|
|
|
BigDecimal cxmCentral = new BigDecimal("0.00"); |
|
|
|
|
|
BigDecimal zxmProvincial = new BigDecimal("0.00"); |
|
|
|
|
|
BigDecimal cxmProvincial = new BigDecimal("0.00"); |
|
|
|
|
|
|
|
|
|
|
|
if(zprojectIds.size()!=0) { |
|
|
|
|
|
LambdaQueryWrapper<HuzhouProjectinfo> query = new LambdaQueryWrapper<>(new HuzhouProjectinfo()) |
|
|
|
|
|
.in(HuzhouProjectinfo::getId, zprojectIds) |
|
|
|
|
|
.select(HuzhouProjectinfo::getId, HuzhouProjectinfo::getTotalMoney); |
|
|
|
|
|
List<HuzhouProjectinfo> projectInfoList = projectinfoMapper.selectList(query); |
|
|
|
|
|
zxmTotal = new BigDecimal(Double.toString(projectInfoList.stream().mapToDouble(x -> x.getTotalMoney()).sum())); |
|
|
|
|
|
zxmCentral = new BigDecimal(Double.toString(projectInfoList.stream().mapToDouble(x -> x.getCentralMoney()).sum())); |
|
|
|
|
|
zxmProvincial = new BigDecimal(Double.toString(projectInfoList.stream().mapToDouble(x -> x.getProvincialMoney()).sum())); |
|
|
|
|
|
} |
|
|
|
|
|
if(cprojectIds.size()!=0){ |
|
|
|
|
|
LambdaQueryWrapper<HuzhouSubProjectinfo> cquery = new LambdaQueryWrapper<>(new HuzhouSubProjectinfo()) |
|
|
|
|
|
.in(HuzhouSubProjectinfo::getId,cprojectIds) |
|
|
|
|
|
.select(HuzhouSubProjectinfo::getId,HuzhouSubProjectinfo::getTotalMoney); |
|
|
|
|
|
List<HuzhouSubProjectinfo> subProjectInfoList=subProjectinfoMapper.selectList(cquery); |
|
|
|
|
|
cxmTotal = new BigDecimal(Double.toString(subProjectInfoList.stream().mapToDouble(x -> x.getTotalMoney()).sum())); |
|
|
|
|
|
cxmCentral = new BigDecimal(Double.toString(subProjectInfoList.stream().mapToDouble(x -> x.getCentralMoney()).sum())); |
|
|
|
|
|
cxmProvincial = new BigDecimal(Double.toString(subProjectInfoList.stream().mapToDouble(x -> x.getProvincialMoney()).sum())); |
|
|
|
|
|
} |
|
|
|
|
|
BigDecimal totalMoney = zxmTotal.add(cxmTotal); |
|
|
|
|
|
BigDecimal totalCentral = zxmCentral.add(cxmCentral); |
|
|
|
|
|
BigDecimal totalProvincial = zxmProvincial.add(cxmProvincial); |
|
|
|
|
|
result=NewFundOV.builder().totalMoney(String.valueOf(totalAmount)).payAmount(String.valueOf(payAmount)) |
|
|
result=NewFundOV.builder().totalMoney(String.valueOf(totalAmount)).payAmount(String.valueOf(payAmount)) |
|
|
.totalCentral(String.valueOf(totalCentral)).payCentral(String.valueOf(payCentral)) |
|
|
.totalCentral(String.valueOf(totalCentral)).payCentral(String.valueOf(payCentral)) |
|
|
.totalProvincial(String.valueOf(totalProvincial)).payProvincial(String.valueOf(payProvincial)).build(); |
|
|
.totalProvincial(String.valueOf(totalProvincial)).payProvincial(String.valueOf(payProvincial)).build(); |
|
@ -816,4 +783,6 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|