Browse Source

看板1.0

master
uu 5 months ago
parent
commit
c71c3d57cb
  1. 11
      huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/HuzhouProjectController.java
  2. 3
      huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/HuzhouProjectinfoMapper.java
  3. 5
      huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/mapping/HuzhouProjectinfoMapper.xml
  4. 3
      huzhou/src/main/java/com/easy/admin/modules/huzhou/entity/HuzhouProjectinfo.java
  5. 25
      huzhou/src/main/java/com/easy/admin/modules/huzhou/service/IHuzhouProjectinfoService.java
  6. 137
      huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouProjectinfoServiceImpl.java
  7. 19
      huzhou/src/main/java/com/easy/admin/modules/huzhou/vo/NewFundOV.java
  8. 20
      huzhou/src/main/java/com/easy/admin/modules/huzhou/vo/TypeResponseOV.java

11
huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/HuzhouProjectController.java

@ -180,4 +180,15 @@ public class HuzhouProjectController {
return Result.OK(result); return Result.OK(result);
} }
/**
* 状态更新
* @param
* @param
*/
@GetMapping("/updateType")
public Result<?> UpdateType(){
Boolean result = projectinfoService.updateType();
return Result.OK(result);
}
} }

3
huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/HuzhouProjectinfoMapper.java

@ -45,4 +45,7 @@ public interface HuzhouProjectinfoMapper extends BaseMapper<HuzhouProjectinfo> {
*/ */
List<HuzhouProjectinfoOV> getProjectAndChildInfoPageList(@Param("info") HuzhouProjectinfo info); List<HuzhouProjectinfoOV> getProjectAndChildInfoPageList(@Param("info") HuzhouProjectinfo info);
Integer updateType();
} }

5
huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/mapping/HuzhouProjectinfoMapper.xml

@ -208,4 +208,9 @@ order by create_date desc
<select id="selectchildrenMapList" resultType="com.easy.admin.modules.huzhou.entity.HuzhouSubProjectinfo"> <select id="selectchildrenMapList" resultType="com.easy.admin.modules.huzhou.entity.HuzhouSubProjectinfo">
select * from huzhou_sub_projectinfo where project_id = #{id} order by create_date desc select * from huzhou_sub_projectinfo where project_id = #{id} order by create_date desc
</select> </select>
<update id="updateType" parameterType="com.easy.admin.modules.huzhou.entity.HuzhouProjectinfo">
UPDATE huzhou_projectinfo
SET type = "0"
WHERE type = "2" and (central_money='' or provincial_money='')
</update>
</mapper> </mapper>

3
huzhou/src/main/java/com/easy/admin/modules/huzhou/entity/HuzhouProjectinfo.java

@ -146,7 +146,10 @@ public class HuzhouProjectinfo extends BaseEntity {
* 2025年支付 * 2025年支付
*/ */
private Double payamount2025Money; private Double payamount2025Money;
private String reportType; private String reportType;
private String type;
} }

25
huzhou/src/main/java/com/easy/admin/modules/huzhou/service/IHuzhouProjectinfoService.java

@ -122,5 +122,30 @@ public interface IHuzhouProjectinfoService extends IService<HuzhouProjectinfo> {
*/ */
CountOV countByProperties(); CountOV countByProperties();
/**
* 更新状态
*
* @param
*/
Boolean updateType();
/**
* 返回项目总数量入库项目id列表配套项目id列表
*
* @param
*/
TypeResponseOV getIdsByType();
//返回入库项目的进度
ProjectProgressOV getProgressByType();
/**
* 根据id列表返回项目总进度和资金拨付情况
*
* @param
*/
NewFundOV getFundByType(List<String> ids);
} }

137
huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouProjectinfoServiceImpl.java

@ -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;
}
} }

19
huzhou/src/main/java/com/easy/admin/modules/huzhou/vo/NewFundOV.java

@ -0,0 +1,19 @@
package com.easy.admin.modules.huzhou.vo;
import lombok.Builder;
import lombok.Data;
import lombok.experimental.Accessors;
@Data
@Accessors(chain = true)
@Builder(toBuilder = true)
public class NewFundOV {
private String totalMoney;
private String totalCentral;
private String totalProvincial;
private String payAmount;
private String payCentral;
private String payProvincial;
}

20
huzhou/src/main/java/com/easy/admin/modules/huzhou/vo/TypeResponseOV.java

@ -0,0 +1,20 @@
package com.easy.admin.modules.huzhou.vo;
import lombok.Builder;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.List;
@Data
@Accessors(chain = true)
@Builder(toBuilder = true)
public class TypeResponseOV {
Integer total;
//主项目中的入库项目id列表
List<String> rkIdsList;
//子项目中的入库项目id列表
List<String> crkIdsList;
List<String> ptIdsList;
}
Loading…
Cancel
Save