|
@ -1,26 +1,17 @@ |
|
|
package com.easy.admin.modules.huzhou.service.impl; |
|
|
package com.easy.admin.modules.huzhou.service.impl; |
|
|
|
|
|
|
|
|
import cn.hutool.core.util.RandomUtil; |
|
|
|
|
|
import com.baomidou.mybatisplus.annotation.TableField; |
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
import com.easy.admin.activiti.constant.ActivitiVariableConst; |
|
|
|
|
|
import com.easy.admin.auth.model.SysRole; |
|
|
|
|
|
import com.easy.admin.auth.model.SysUser; |
|
|
import com.easy.admin.auth.model.SysUser; |
|
|
import com.easy.admin.auth.model.SysUserRole; |
|
|
|
|
|
import com.easy.admin.auth.service.SysDeptService; |
|
|
|
|
|
import com.easy.admin.auth.service.SysRoleService; |
|
|
|
|
|
import com.easy.admin.auth.service.SysUserRoleService; |
|
|
|
|
|
import com.easy.admin.auth.service.SysUserService; |
|
|
import com.easy.admin.auth.service.SysUserService; |
|
|
import com.easy.admin.common.core.common.select.Select; |
|
|
import com.easy.admin.common.core.common.select.Select; |
|
|
import com.easy.admin.common.core.exception.EasyException; |
|
|
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.HuzhouProcessinfoMapper; |
|
|
|
|
|
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; |
|
@ -29,29 +20,19 @@ import com.easy.admin.modules.huzhou.service.*; |
|
|
import com.easy.admin.modules.huzhou.vo.*; |
|
|
import com.easy.admin.modules.huzhou.vo.*; |
|
|
import com.easy.admin.sys.model.SysDict; |
|
|
import com.easy.admin.sys.model.SysDict; |
|
|
import com.easy.admin.sys.service.SysDictService; |
|
|
import com.easy.admin.sys.service.SysDictService; |
|
|
import com.easy.admin.util.PasswordUtil; |
|
|
|
|
|
import com.easy.admin.util.ShiroUtil; |
|
|
|
|
|
import javassist.expr.NewArray; |
|
|
|
|
|
import kotlin.collections.EmptyList; |
|
|
|
|
|
import org.activiti.engine.IdentityService; |
|
|
|
|
|
import org.activiti.engine.RuntimeService; |
|
|
import org.activiti.engine.RuntimeService; |
|
|
import org.activiti.engine.TaskService; |
|
|
import org.activiti.engine.TaskService; |
|
|
import org.activiti.engine.impl.identity.Authentication; |
|
|
|
|
|
import org.activiti.engine.runtime.ProcessInstance; |
|
|
import org.activiti.engine.runtime.ProcessInstance; |
|
|
import org.activiti.engine.task.Task; |
|
|
import org.activiti.engine.task.Task; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
|
import com.easy.admin.common.api.vo.Result; |
|
|
|
|
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
|
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
|
|
import org.apache.poi.ss.usermodel.*; |
|
|
import org.apache.poi.ss.usermodel.*; |
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
|
|
import org.springframework.beans.BeanUtils; |
|
|
import org.springframework.beans.BeanUtils; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.context.annotation.Bean; |
|
|
|
|
|
import org.springframework.context.annotation.Lazy; |
|
|
import org.springframework.context.annotation.Lazy; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
import org.springframework.web.server.session.CookieWebSessionIdResolver; |
|
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
import java.io.IOException; |
|
|
import java.io.IOException; |
|
@ -559,6 +540,7 @@ 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){ |
|
@ -716,5 +698,122 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public Boolean updateType() { |
|
|
|
|
|
Boolean result=projectinfoMapper.updateType()>0; |
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public TypeResponseOV getIdsByType() { |
|
|
|
|
|
HuzhouProjectinfo projectInfo =new HuzhouProjectinfo(); |
|
|
|
|
|
projectInfo.setStage("0"); |
|
|
|
|
|
ProjectInfoAuthSelect projectInfoAuthSelect = CommonUtils.setGetProjectInfoAuth(projectInfo); |
|
|
|
|
|
List<HuzhouProjectinfoOV> projectAndChildInfoPageList = projectinfoMapper.getProjectAndChildInfoPageList(projectInfoAuthSelect); |
|
|
|
|
|
Map<String, List<HuzhouProjectinfoOV>> zxmMap = projectAndChildInfoPageList.stream().collect(Collectors.groupingBy(HuzhouProjectinfo::getType)); |
|
|
|
|
|
List<List<HuzhouSubProjectinfo>> cxm = projectAndChildInfoPageList.stream().map(HuzhouProjectinfoOV::getChildren) |
|
|
|
|
|
.filter(children -> children.size() > 0).collect(Collectors.toList()); |
|
|
|
|
|
Map<String, List<HuzhouSubProjectinfo>> cxmMap = cxm.stream().flatMap(x -> x.stream()) |
|
|
|
|
|
.collect(Collectors.groupingBy(HuzhouProjectinfo::getType)); |
|
|
|
|
|
int zxmNum=0; |
|
|
|
|
|
int cxmNum=0; |
|
|
|
|
|
for (String key:zxmMap.keySet()) { |
|
|
|
|
|
zxmNum= zxmMap.get(key).size()+zxmNum; |
|
|
|
|
|
} |
|
|
|
|
|
for (String key:cxmMap.keySet()) { |
|
|
|
|
|
cxmNum= zxmMap.get(key).size()+cxmNum; |
|
|
|
|
|
} |
|
|
|
|
|
int total = zxmNum + cxmNum; |
|
|
|
|
|
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> ptIds= zxmMap.get("2").stream().map(x -> x.getId()).collect(Collectors.toList()); |
|
|
|
|
|
ptIds.addAll(cxmMap.get("2").stream().map(x->x.getId()).collect(Collectors.toList())); |
|
|
|
|
|
TypeResponseOV result = TypeResponseOV.builder().total(total).rkIdsList(rkIds).crkIdsList(crkIds).ptIdsList(ptIds).build(); |
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public ProjectProgressOV getProgressByType() { |
|
|
|
|
|
int fininshNum=0; |
|
|
|
|
|
int unfininshNum=0; |
|
|
|
|
|
//1、查询所有入库项目
|
|
|
|
|
|
//2、查询所有项目对应的计划阶段
|
|
|
|
|
|
List<String> projectIds = this.getIdsByType().getRkIdsList(); |
|
|
|
|
|
List<String> cprojectIds = this.getIdsByType().getCrkIdsList(); |
|
|
|
|
|
projectIds.addAll(cprojectIds); |
|
|
|
|
|
if(projectIds.size()!=0){ |
|
|
|
|
|
List<HuzhouPlaninfo> planInfoList = planinfoService.listByProjectIds(projectIds); |
|
|
|
|
|
fininshNum = (int) planInfoList.stream().filter(x -> (x.getIsfinish().equals("2"))).count(); |
|
|
|
|
|
unfininshNum = planInfoList.size()-fininshNum; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ProjectProgressOV result = ProjectProgressOV.builder().fininshNum(fininshNum).unfininshNum(unfininshNum).build(); |
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public NewFundOV getFundByType(List<String> ids) { |
|
|
|
|
|
List<String> projectIds = this.getIdsByType().getRkIdsList(); |
|
|
|
|
|
List<String> zprojectIds = new ArrayList<>(projectIds); |
|
|
|
|
|
List<String> cprojectIds = this.getIdsByType().getCrkIdsList(); |
|
|
|
|
|
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; |
|
|
|
|
|
if(projectIds.size()!=0){ |
|
|
|
|
|
List<HuzhouContractinfo> contractInfoList = contractinfoService.ListByProjectIds(projectIds); |
|
|
|
|
|
List<HuzhouPlaninfo> planInfoList = planinfoService.listByProjectIds(projectIds); |
|
|
|
|
|
Map<String,HuzhouContractinfo> contractMoneyMap; |
|
|
|
|
|
List<String> finishPlanTaskList; |
|
|
|
|
|
for(String projectId:projectIds){ |
|
|
|
|
|
contractMoneyMap = contractInfoList.stream().filter(x -> x.getProjectId().equals(projectId)) |
|
|
|
|
|
.collect(Collectors.toMap(HuzhouContractinfo::getTaskName,o->o)); |
|
|
|
|
|
finishPlanTaskList = planInfoList.stream().filter(x->x.getProjectId().equals(projectId)) |
|
|
|
|
|
.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)) |
|
|
|
|
|
.totalCentral(String.valueOf(totalCentral)).payCentral(String.valueOf(payCentral)) |
|
|
|
|
|
.totalProvincial(String.valueOf(totalProvincial)).payProvincial(String.valueOf(payProvincial)).build(); |
|
|
|
|
|
} |
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|