合约规划调整
This commit is contained in:
parent
6398185761
commit
90708aeb71
@ -12,6 +12,8 @@ import com.zhgd.xmgl.modules.basicdata.service.ICompanyService;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IDictionaryItemService;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IDictionaryService;
|
||||
import com.zhgd.xmgl.modules.cost.entity.CostContract;
|
||||
import com.zhgd.xmgl.modules.cost.entity.CostContractPay;
|
||||
import com.zhgd.xmgl.modules.cost.service.ICostContractPayService;
|
||||
import com.zhgd.xmgl.modules.cost.service.ICostContractService;
|
||||
import com.zhgd.xmgl.modules.project.entity.Project;
|
||||
import com.zhgd.xmgl.modules.project.entity.ProjectSupplier;
|
||||
@ -60,6 +62,9 @@ public class ProjectDataController {
|
||||
@Autowired
|
||||
private ICostContractService costContractService;
|
||||
|
||||
@Autowired
|
||||
private ICostContractPayService costContractPayService;
|
||||
|
||||
@Autowired
|
||||
private ICompanyService companyService;
|
||||
|
||||
@ -141,7 +146,7 @@ public class ProjectDataController {
|
||||
return Result.success(null);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获合同数据进行同步", notes = "获取供应商数据进行同步", httpMethod="POST")
|
||||
@ApiOperation(value = "获合同数据进行同步", notes = "获合同数据进行同步", httpMethod="POST")
|
||||
@GetMapping(value = "/getContract")
|
||||
public Result<Map<String, Object>> getContract() {
|
||||
String url = "/api/cube/restful/interface/getModeDataPageList/cghtlb";
|
||||
@ -166,6 +171,31 @@ public class ProjectDataController {
|
||||
return Result.success(null);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获合同支付数据进行同步", notes = "获合同支付数据进行同步", httpMethod="POST")
|
||||
@GetMapping(value = "/getContractPay")
|
||||
public Result<Map<String, Object>> getContractPay() {
|
||||
String url = "/api/cube/restful/interface/getModeDataPageList/FKGL";
|
||||
String systemid = "HTFK";
|
||||
String d_password = "D0679C10846644E193F45E2F08067735";
|
||||
JSONObject mainTable = new JSONObject();
|
||||
String result = doAction(url, systemid, d_password, mainTable);
|
||||
if (StringUtils.isNotBlank(result)) {
|
||||
JSONObject obj = JSONObject.parseObject(result);
|
||||
JSONArray jsonArray = obj.getJSONArray("result");
|
||||
List<CostContractPay> contractPayList = new ArrayList<>();
|
||||
for (int i = 0; i < jsonArray.size(); i++) {
|
||||
JSONObject projectObj = jsonArray.getJSONObject(i).getJSONObject("mainTable");
|
||||
CostContractPay costContractPay = JSONObject.parseObject(JSON.toJSONString(projectObj), CostContractPay.class);
|
||||
contractPayList.add(costContractPay);
|
||||
|
||||
JSONArray detailArray = jsonArray.getJSONObject(i).getJSONArray("detail1");
|
||||
System.out.println(detailArray);
|
||||
}
|
||||
costContractPayService.saveOrUpdateBatch(contractPayList);
|
||||
}
|
||||
return Result.success(null);
|
||||
}
|
||||
|
||||
/**
|
||||
*restful接口调用案例
|
||||
*以getModeDataPageList为例
|
||||
|
||||
@ -0,0 +1,115 @@
|
||||
package com.zhgd.xmgl.modules.cost.controller;
|
||||
|
||||
import com.zhgd.annotation.OperLog;
|
||||
import com.zhgd.xmgl.util.PageUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.jeecg.common.util.oConvertUtils;
|
||||
import com.zhgd.xmgl.modules.cost.entity.CostContractPay;
|
||||
import com.zhgd.xmgl.modules.cost.service.ICostContractPayService;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
|
||||
/**
|
||||
* @Title: Controller
|
||||
* @Description: 合同支付
|
||||
* @author: pengj
|
||||
* @date: 2024-08-30
|
||||
* @version: V1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/xmgl/costContractPay")
|
||||
@Slf4j
|
||||
@Api(tags = "合同支付管理")
|
||||
public class CostContractPayController {
|
||||
@Autowired
|
||||
private ICostContractPayService costContractPayService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "合同支付管理", operType = "分页查询", operDesc = "分页列表查询合同支付信息")
|
||||
@ApiOperation(value = " 分页列表查询合同支付信息", notes = "分页列表查询合同支付信息", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "pageNo", value = "页数", paramType = "body", required = true, defaultValue = "1", dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "body", required = true, defaultValue = "10", dataType = "Integer")
|
||||
})
|
||||
@PostMapping(value = "/page")
|
||||
public Result<IPage<CostContractPay>> queryPageList(@ApiIgnore @RequestBody Map<String, Object> map) {
|
||||
QueryWrapper<CostContractPay> queryWrapper = QueryGenerator.initPageQueryWrapper(CostContractPay.class, map);
|
||||
Page<CostContractPay> page = PageUtil.getPage(map);
|
||||
IPage<CostContractPay> pageList = costContractPayService.pageList(page, queryWrapper);
|
||||
return Result.success(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param costContractPay
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "合同支付管理", operType = "列表查询", operDesc = "列表查询合同支付信息")
|
||||
@ApiOperation(value = " 列表查询合同支付信息", notes = "列表查询合同支付信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/list")
|
||||
public Result<List<CostContractPay>> queryList(@RequestBody CostContractPay costContractPay) {
|
||||
QueryWrapper<CostContractPay> queryWrapper = QueryGenerator.initQueryWrapper(costContractPay);
|
||||
List<CostContractPay> list = costContractPayService.list(queryWrapper);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "合同支付管理", operType = "查询", operDesc = "通过id查询合同支付信息")
|
||||
@ApiOperation(value = "通过id查询合同支付信息", notes = "通过id查询合同支付信息", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "id", value = "合同支付ID", paramType = "body", required = true, dataType = "Integer")
|
||||
@PostMapping(value = "/queryById")
|
||||
public Result<CostContractPay> queryById(@ApiIgnore @RequestBody Map<String, Object> map) {
|
||||
Result<CostContractPay> result = new Result<CostContractPay>();
|
||||
CostContractPay costContractPay = costContractPayService.getById(MapUtils.getString(map, "id"));
|
||||
if (costContractPay == null) {
|
||||
result.error500("未找到对应实体");
|
||||
} else {
|
||||
result.setResult(costContractPay);
|
||||
result.setSuccess(true);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@ -93,7 +93,7 @@ public class CostPayPlanController {
|
||||
public Result<IPage<CostPayPlan>> queryPageList(@ApiIgnore @RequestBody Map<String, Object> map) {
|
||||
QueryWrapper<CostPayPlan> queryWrapper = QueryGenerator.initPageQueryWrapper(CostPayPlan.class, map);
|
||||
Page<CostPayPlan> page = PageUtil.getPage(map);
|
||||
IPage<CostPayPlan> pageList = costPayPlanService.page(page, queryWrapper);
|
||||
IPage<CostPayPlan> pageList = costPayPlanService.pageList(page, queryWrapper);
|
||||
return Result.success(pageList);
|
||||
}
|
||||
|
||||
|
||||
@ -5,7 +5,9 @@ import com.zhgd.xmgl.modules.cost.entity.CostContractPlan;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -24,4 +26,16 @@ public class CostContractPlanDto extends CostContractPlan {
|
||||
|
||||
@ApiModelProperty(value = "祖级关系")
|
||||
private String ancestors;
|
||||
|
||||
@ApiModelProperty(value = "目标+调整")
|
||||
private BigDecimal goal = new BigDecimal(0);
|
||||
|
||||
@ApiModelProperty(value = "待发生合约")
|
||||
private BigDecimal toOccur = new BigDecimal(0);
|
||||
|
||||
@ApiModelProperty(value = "已发生金额")
|
||||
private BigDecimal underApproval = new BigDecimal(0);
|
||||
|
||||
@ApiModelProperty(value = "科目余量")
|
||||
private BigDecimal allowance = new BigDecimal(0);
|
||||
}
|
||||
|
||||
@ -0,0 +1,117 @@
|
||||
package com.zhgd.xmgl.modules.cost.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* @Description: 合同支付
|
||||
* @author: pengj
|
||||
* @date: 2024-08-30
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("cost_contract_pay")
|
||||
@ApiModel(value = "CostContractPay实体类", description = "CostContractPay")
|
||||
public class CostContractPay implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 合同支付ID
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
@ApiModelProperty(value = "合同支付ID")
|
||||
private Integer id;
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
@Excel(name = "合同名称", width = 15)
|
||||
@ApiModelProperty(value = "合同名称")
|
||||
private String htmc;
|
||||
/**
|
||||
* 申请人
|
||||
*/
|
||||
@Excel(name = "申请人", width = 15)
|
||||
@ApiModelProperty(value = "申请人")
|
||||
private String sqr;
|
||||
/**
|
||||
* 申请日期
|
||||
*/
|
||||
@Excel(name = "申请日期", width = 15)
|
||||
@ApiModelProperty(value = "申请日期")
|
||||
private String sqrq;
|
||||
/**
|
||||
* 所属公司
|
||||
*/
|
||||
@Excel(name = "所属公司", width = 15)
|
||||
@ApiModelProperty(value = "所属公司")
|
||||
private String sgs;
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@Excel(name = "所属部门", width = 15)
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private String sbm;
|
||||
/**
|
||||
* 合同编号
|
||||
*/
|
||||
@Excel(name = "合同编号", width = 15)
|
||||
@ApiModelProperty(value = "合同编号")
|
||||
private String htbh;
|
||||
/**
|
||||
* 合同金额
|
||||
*/
|
||||
@Excel(name = "合同金额", width = 15)
|
||||
@ApiModelProperty(value = "合同金额")
|
||||
private String htje;
|
||||
/**
|
||||
* 已付金额
|
||||
*/
|
||||
@Excel(name = "已付金额", width = 15)
|
||||
@ApiModelProperty(value = "已付金额")
|
||||
private String yfje;
|
||||
/**
|
||||
* 本次支付金额
|
||||
*/
|
||||
@Excel(name = "本次支付金额", width = 15)
|
||||
@ApiModelProperty(value = "本次支付金额")
|
||||
private String bczfje;
|
||||
/**
|
||||
* 相对方签约主体
|
||||
*/
|
||||
@Excel(name = "相对方签约主体", width = 15)
|
||||
@ApiModelProperty(value = "相对方签约主体")
|
||||
private String xdfqyzt;
|
||||
/**
|
||||
* 相对方签约主体开户行
|
||||
*/
|
||||
@Excel(name = "相对方签约主体开户行", width = 15)
|
||||
@ApiModelProperty(value = "相对方签约主体开户行")
|
||||
private String xdfqyztkhx;
|
||||
/**
|
||||
* 相对方签约主体银行账号
|
||||
*/
|
||||
@Excel(name = "相对方签约主体银行账号", width = 15)
|
||||
@ApiModelProperty(value = "相对方签约主体银行账号")
|
||||
private String xdfqyztyxzh;
|
||||
/**
|
||||
* 所属项目
|
||||
*/
|
||||
@Excel(name = "所属项目", width = 15)
|
||||
@ApiModelProperty(value = "所属项目")
|
||||
private String sxm;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "申请人")
|
||||
private String sqrName;
|
||||
}
|
||||
@ -40,6 +40,24 @@ public class CostContractPlan implements Serializable {
|
||||
@Excel(name = "合约名称", width = 15)
|
||||
@ApiModelProperty(value = "合约名称")
|
||||
private String contractName;
|
||||
/**
|
||||
* 合约类别
|
||||
*/
|
||||
@Excel(name = "合约类别", width = 15)
|
||||
@ApiModelProperty(value = "合约类别")
|
||||
private String contractType;
|
||||
/**
|
||||
* 合约属性(0:合同;1:费用)
|
||||
*/
|
||||
@Excel(name = "合约属性(0:合同;1:费用)", width = 15)
|
||||
@ApiModelProperty(value = "合约属性(0:合同;1:费用)")
|
||||
private Integer nature;
|
||||
/**
|
||||
* 合同范围及界面描述
|
||||
*/
|
||||
@Excel(name = "合同范围及界面描述", width = 15)
|
||||
@ApiModelProperty(value = "合同范围及界面描述")
|
||||
private String content;
|
||||
/**
|
||||
* 成本科目ID
|
||||
*/
|
||||
@ -52,12 +70,6 @@ public class CostContractPlan implements Serializable {
|
||||
@Excel(name = "项目SN", width = 15)
|
||||
@ApiModelProperty(value = "项目SN")
|
||||
private String projectSn;
|
||||
/**
|
||||
* 目标+调整
|
||||
*/
|
||||
@Excel(name = "目标+调整", width = 15)
|
||||
@ApiModelProperty(value = "目标+调整")
|
||||
private String goal;
|
||||
/**
|
||||
* 合同金额
|
||||
*/
|
||||
@ -65,29 +77,37 @@ public class CostContractPlan implements Serializable {
|
||||
@ApiModelProperty(value = "合同金额")
|
||||
private String contractAmount;
|
||||
/**
|
||||
* 在途成本
|
||||
* 预计签约日期
|
||||
*/
|
||||
@Excel(name = "在途成本", width = 15)
|
||||
@ApiModelProperty(value = "在途成本")
|
||||
private String underApproval;
|
||||
/**
|
||||
* 待发生合约
|
||||
*/
|
||||
@Excel(name = "待发生合约", width = 15)
|
||||
@ApiModelProperty(value = "待发生合约")
|
||||
private String toOccur;
|
||||
/**
|
||||
* 预估变更
|
||||
*/
|
||||
@Excel(name = "预估变更", width = 15)
|
||||
@ApiModelProperty(value = "预估变更")
|
||||
private String estimatedChange;
|
||||
/**
|
||||
* 规划余量
|
||||
*/
|
||||
@Excel(name = "规划余量", width = 15)
|
||||
@ApiModelProperty(value = "规划余量")
|
||||
private String allowance;
|
||||
@Excel(name = "预计签约日期", width = 15)
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "预计签约日期")
|
||||
private Date signingDate;
|
||||
// /**
|
||||
// * 在途成本
|
||||
// */
|
||||
// @Excel(name = "在途成本", width = 15)
|
||||
// @ApiModelProperty(value = "在途成本")
|
||||
// private String underApproval;
|
||||
// /**
|
||||
// * 待发生合约
|
||||
// */
|
||||
// @Excel(name = "待发生合约", width = 15)
|
||||
// @ApiModelProperty(value = "待发生合约")
|
||||
// private String toOccur;
|
||||
// /**
|
||||
// * 预估变更
|
||||
// */
|
||||
// @Excel(name = "预估变更", width = 15)
|
||||
// @ApiModelProperty(value = "预估变更")
|
||||
// private String estimatedChange;
|
||||
// /**
|
||||
// * 规划余量
|
||||
// */
|
||||
// @Excel(name = "规划余量", width = 15)
|
||||
// @ApiModelProperty(value = "规划余量")
|
||||
// private String allowance;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
|
||||
@ -90,6 +90,10 @@ public class CostPayPlan implements Serializable {
|
||||
@ApiModelProperty(value = "应付总进度款")
|
||||
private String totalPayAmount;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "申请人")
|
||||
private String applyByName;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "产值列表")
|
||||
private List<CostQuantity> costQuantityList;
|
||||
|
||||
@ -0,0 +1,19 @@
|
||||
package com.zhgd.xmgl.modules.cost.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.zhgd.xmgl.modules.cost.entity.CostContractPay;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 合同支付
|
||||
* @author: pengj
|
||||
* @date: 2024-08-30
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface CostContractPayMapper extends BaseMapper<CostContractPay> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zhgd.xmgl.modules.cost.mapper.CostContractPayMapper">
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,18 @@
|
||||
package com.zhgd.xmgl.modules.cost.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.xmgl.modules.cost.entity.CostContractPay;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 合同支付
|
||||
* @author: pengj
|
||||
* @date: 2024-08-30
|
||||
* @version: V1.0
|
||||
*/
|
||||
public interface ICostContractPayService extends IService<CostContractPay> {
|
||||
|
||||
IPage<CostContractPay> pageList(Page page, Wrapper<CostContractPay> wrapper);
|
||||
}
|
||||
@ -1,5 +1,7 @@
|
||||
package com.zhgd.xmgl.modules.cost.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.xmgl.modules.cost.dto.ContractPayOverviewDto;
|
||||
import com.zhgd.xmgl.modules.cost.entity.CostPayPlan;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
@ -14,6 +16,7 @@ import java.util.List;
|
||||
*/
|
||||
public interface ICostPayPlanService extends IService<CostPayPlan> {
|
||||
|
||||
Page<CostPayPlan> pageList(Page page, Wrapper<CostPayPlan> wrapper);
|
||||
|
||||
CostPayPlan queryById(String id);
|
||||
|
||||
|
||||
@ -0,0 +1,42 @@
|
||||
package com.zhgd.xmgl.modules.cost.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
|
||||
import com.zhgd.xmgl.modules.cost.entity.CostContractPay;
|
||||
import com.zhgd.xmgl.modules.cost.mapper.CostContractPayMapper;
|
||||
import com.zhgd.xmgl.modules.cost.service.ICostContractPayService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 合同支付
|
||||
* @author: pengj
|
||||
* @date: 2024-08-30
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class CostContractPayServiceImpl extends ServiceImpl<CostContractPayMapper, CostContractPay> implements ICostContractPayService {
|
||||
|
||||
@Autowired
|
||||
private ISystemUserService systemUserService;
|
||||
|
||||
@Override
|
||||
public IPage<CostContractPay> pageList(Page page, Wrapper<CostContractPay> wrapper) {
|
||||
Page<CostContractPay> pageList = this.page(page, wrapper);
|
||||
List<SystemUser> systemUserList = systemUserService.list();
|
||||
for (CostContractPay record : pageList.getRecords()) {
|
||||
List<SystemUser> users = systemUserList.stream().filter(s -> s.getUserId().toString().equals(record.getSqr())).collect(Collectors.toList());
|
||||
record.setSqrName(users.size() > 0 ? users.get(0).getRealName() : "");
|
||||
}
|
||||
return pageList;
|
||||
}
|
||||
}
|
||||
@ -9,10 +9,7 @@ import com.zhgd.xmgl.modules.cost.dto.DynamicCostDto;
|
||||
import com.zhgd.xmgl.modules.cost.entity.*;
|
||||
import com.zhgd.xmgl.modules.cost.mapper.CostContractPayPlanMapper;
|
||||
import com.zhgd.xmgl.modules.cost.mapper.CostContractPlanMapper;
|
||||
import com.zhgd.xmgl.modules.cost.service.ICostContractPayPlanService;
|
||||
import com.zhgd.xmgl.modules.cost.service.ICostContractPlanService;
|
||||
import com.zhgd.xmgl.modules.cost.service.ICostContractService;
|
||||
import com.zhgd.xmgl.modules.cost.service.ICostSubjectService;
|
||||
import com.zhgd.xmgl.modules.cost.service.*;
|
||||
import com.zhgd.xmgl.modules.cost.vo.CostContractPlanVo;
|
||||
import com.zhgd.xmgl.modules.project.entity.vo.ProjectInfoExtVo;
|
||||
import com.zhgd.xmgl.security.util.SecurityUtils;
|
||||
@ -42,6 +39,9 @@ public class CostContractPlanServiceImpl extends ServiceImpl<CostContractPlanMap
|
||||
@Autowired
|
||||
private ICostSubjectService costSubjectService;
|
||||
|
||||
@Autowired
|
||||
private ICostBudgetService costBudgetService;
|
||||
|
||||
@Autowired
|
||||
private ICostContractService costContractService;
|
||||
|
||||
@ -51,16 +51,18 @@ public class CostContractPlanServiceImpl extends ServiceImpl<CostContractPlanMap
|
||||
@Override
|
||||
public List<CostContractPlanDto> tree(QueryWrapper<CostSubject> wrapper, ProjectInfoExtVo projectInfoBySn) {
|
||||
List<CostSubject> allSubList = costSubjectService.list(wrapper);
|
||||
List<CostContractPlanDto> allPlanList = convert(allSubList);
|
||||
List<CostSubject> parentSubList = allSubList.stream().filter(l -> l.getParentId().toString().equals("0") && StringUtils.isNotBlank(l.getName())).collect(Collectors.toList());
|
||||
List<CostContractPlanDto> parentPlanList = convert(parentSubList);
|
||||
if (allPlanList.size() > 0) {
|
||||
List<CostContractPlan> planList = this.list(Wrappers.<CostContractPlan>lambdaQuery()
|
||||
List<CostContractPlanDto> resultList = new ArrayList<>();
|
||||
if (allSubList.size() > 0) {
|
||||
List<CostBudget> budgetList = costBudgetService.list(Wrappers.<CostBudget>lambdaQuery()
|
||||
.eq(CostBudget::getProjectSn, projectInfoBySn.getProjectSn()));
|
||||
List<CostContract> contractList = costContractService.list(Wrappers.<CostContract>lambdaQuery()
|
||||
.eq(CostContract::getProjectSn, projectInfoBySn.getProjectSn()));
|
||||
List<CostContractPlan> contractPlanList = this.list(Wrappers.<CostContractPlan>lambdaQuery()
|
||||
.eq(CostContractPlan::getProjectSn, projectInfoBySn.getProjectSn()));
|
||||
List<CostContractPlanDto> planDtoList = convert1(planList);
|
||||
getChildren(parentPlanList, allPlanList, planDtoList);
|
||||
resultList = getChildren(parentSubList, allSubList, budgetList, contractList, contractPlanList, 0L);
|
||||
}
|
||||
return parentPlanList;
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -69,11 +71,11 @@ public class CostContractPlanServiceImpl extends ServiceImpl<CostContractPlanMap
|
||||
List<CostSubject> parentSubList = allSubList.stream().filter(l -> l.getParentId().toString().equals("0") && StringUtils.isNotBlank(l.getName())).collect(Collectors.toList());
|
||||
List<DynamicCostDto> resultList = new ArrayList<>();
|
||||
if (allSubList.size() > 0) {
|
||||
List<CostContractPlan> contractPlanList = this.list(Wrappers.<CostContractPlan>lambdaQuery()
|
||||
.eq(CostContractPlan::getProjectSn, projectInfoBySn.getProjectSn()));
|
||||
List<CostBudget> costBudgetList = costBudgetService.list(Wrappers.<CostBudget>lambdaQuery()
|
||||
.eq(CostBudget::getProjectSn, projectInfoBySn.getProjectSn()));
|
||||
List<CostContract> contractList = costContractService.list(Wrappers.<CostContract>lambdaQuery()
|
||||
.eq(CostContract::getProjectSn, projectInfoBySn.getProjectSn()));
|
||||
resultList = getDynamicChildren(parentSubList, allSubList, contractPlanList, contractList);
|
||||
resultList = getDynamicChildren(parentSubList, allSubList, costBudgetList, contractList);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
@ -83,9 +85,9 @@ public class CostContractPlanServiceImpl extends ServiceImpl<CostContractPlanMap
|
||||
List<CostContractPayPlan> costContractPayPlanList = costContractPlanVo.getCostContractPayPlanList();
|
||||
costContractPlanVo.setCreateBy(SecurityUtils.getUser().getRealName());
|
||||
costContractPlanVo.setCreateTime(new Date());
|
||||
BigDecimal b1 = new BigDecimal(costContractPlanVo.getContractAmount()).add(new BigDecimal(costContractPlanVo.getUnderApproval()))
|
||||
.add(new BigDecimal(costContractPlanVo.getEstimatedChange())).add(new BigDecimal(costContractPlanVo.getToOccur()));
|
||||
costContractPlanVo.setAllowance(new BigDecimal(costContractPlanVo.getGoal()).subtract(b1).toString());
|
||||
// BigDecimal b1 = new BigDecimal(costContractPlanVo.getContractAmount()).add(new BigDecimal(costContractPlanVo.getUnderApproval()))
|
||||
// .add(new BigDecimal(costContractPlanVo.getEstimatedChange())).add(new BigDecimal(costContractPlanVo.getToOccur()));
|
||||
// costContractPlanVo.setAllowance(new BigDecimal(costContractPlanVo.getGoal()).subtract(b1).toString());
|
||||
boolean flag = this.save(costContractPlanVo);
|
||||
if (flag) {
|
||||
for (CostContractPayPlan costContractPayPlan : costContractPayPlanList) {
|
||||
@ -106,9 +108,9 @@ public class CostContractPlanServiceImpl extends ServiceImpl<CostContractPlanMap
|
||||
costContractPayPlanService.saveBatch(costContractPayPlanList);
|
||||
costContractPlanVo.setUpdateBy(SecurityUtils.getUser().getRealName());
|
||||
costContractPlanVo.setUpdateTime(new Date());
|
||||
BigDecimal b1 = new BigDecimal(costContractPlanVo.getContractAmount()).add(new BigDecimal(costContractPlanVo.getUnderApproval()))
|
||||
.add(new BigDecimal(costContractPlanVo.getEstimatedChange())).add(new BigDecimal(costContractPlanVo.getToOccur()));
|
||||
costContractPlanVo.setAllowance(new BigDecimal(costContractPlanVo.getGoal()).subtract(b1).toString());
|
||||
// BigDecimal b1 = new BigDecimal(costContractPlanVo.getContractAmount()).add(new BigDecimal(costContractPlanVo.getUnderApproval()))
|
||||
// .add(new BigDecimal(costContractPlanVo.getEstimatedChange())).add(new BigDecimal(costContractPlanVo.getToOccur()));
|
||||
// costContractPlanVo.setAllowance(new BigDecimal(costContractPlanVo.getGoal()).subtract(b1).toString());
|
||||
return this.updateById(costContractPlanVo);
|
||||
}
|
||||
|
||||
@ -131,58 +133,82 @@ public class CostContractPlanServiceImpl extends ServiceImpl<CostContractPlanMap
|
||||
return this.removeById(costContractPlan.getId());
|
||||
}
|
||||
|
||||
private void getChildren(List<CostContractPlanDto> list, List<CostContractPlanDto> allList, List<CostContractPlanDto> planList) {
|
||||
for (CostContractPlanDto costContractPlan : list) {
|
||||
costContractPlan.setType(0);
|
||||
List<CostContractPlanDto> childrenList = allList.stream().filter(a -> a.getSubjectId().toString().equals(costContractPlan.getId().toString())).collect(Collectors.toList());
|
||||
//计算总额
|
||||
List<String> subIds = allList.stream().filter(a -> a.getAncestors().contains(costContractPlan.getId().toString()))
|
||||
.map(c -> c.getId().toString()).collect(Collectors.toList());
|
||||
subIds.add(costContractPlan.getId().toString());
|
||||
List<CostContractPlanDto> filterList = planList.stream().filter(p -> subIds.contains(p.getSubjectId().toString())).collect(Collectors.toList());
|
||||
costContractPlan.setGoal(filterList.stream().map(s -> new BigDecimal(s.getGoal())).reduce(BigDecimal.ZERO, BigDecimal::add).toString());
|
||||
costContractPlan.setContractAmount(filterList.stream().map(s -> new BigDecimal(s.getContractAmount())).reduce(BigDecimal.ZERO, BigDecimal::add).toString());
|
||||
costContractPlan.setUnderApproval(filterList.stream().map(s -> new BigDecimal(s.getUnderApproval())).reduce(BigDecimal.ZERO, BigDecimal::add).toString());
|
||||
costContractPlan.setToOccur(filterList.stream().map(s -> new BigDecimal(s.getToOccur())).reduce(BigDecimal.ZERO, BigDecimal::add).toString());
|
||||
costContractPlan.setEstimatedChange(filterList.stream().map(s -> new BigDecimal(s.getEstimatedChange())).reduce(BigDecimal.ZERO, BigDecimal::add).toString());
|
||||
costContractPlan.setAllowance(filterList.stream().map(s -> new BigDecimal(s.getAllowance())).reduce(BigDecimal.ZERO, BigDecimal::add).toString());
|
||||
if (childrenList.size() > 0) {
|
||||
costContractPlan.setLastLevel(false);
|
||||
getChildren(childrenList, allList, planList);
|
||||
} else {
|
||||
costContractPlan.setLastLevel(true);
|
||||
childrenList = planList.stream().filter(p -> p.getSubjectId().toString().equals(costContractPlan.getId().toString())).collect(Collectors.toList());
|
||||
// private void getChildren(List<CostContractPlanDto> list, List<CostContractPlanDto> allList, List<CostContractPlanDto> planList, List<CostBudget> budgetList) {
|
||||
// for (CostContractPlanDto costContractPlan : list) {
|
||||
// costContractPlan.setType(0);
|
||||
// List<CostContractPlanDto> childrenList = allList.stream().filter(a -> a.getSubjectId().toString().equals(costContractPlan.getId().toString())).collect(Collectors.toList());
|
||||
// //计算总额
|
||||
// List<String> subIds = allList.stream().filter(a -> a.getAncestors().contains(costContractPlan.getId().toString()))
|
||||
// .map(c -> c.getId().toString()).collect(Collectors.toList());
|
||||
// subIds.add(costContractPlan.getId().toString());
|
||||
// costContractPlan.setGoal(filterList.stream().map(s -> new BigDecimal(s.getGoal())).reduce(BigDecimal.ZERO, BigDecimal::add).toString());
|
||||
// costContractPlan.setContractAmount(filterList.stream().map(s -> new BigDecimal(s.getContractAmount())).reduce(BigDecimal.ZERO, BigDecimal::add).toString());
|
||||
// costContractPlan.setUnderApproval(filterList.stream().map(s -> new BigDecimal(s.getUnderApproval())).reduce(BigDecimal.ZERO, BigDecimal::add).toString());
|
||||
// costContractPlan.setToOccur(filterList.stream().map(s -> new BigDecimal(s.getToOccur())).reduce(BigDecimal.ZERO, BigDecimal::add).toString());
|
||||
// costContractPlan.setEstimatedChange(filterList.stream().map(s -> new BigDecimal(s.getEstimatedChange())).reduce(BigDecimal.ZERO, BigDecimal::add).toString());
|
||||
// costContractPlan.setAllowance(filterList.stream().map(s -> new BigDecimal(s.getAllowance())).reduce(BigDecimal.ZERO, BigDecimal::add).toString());
|
||||
// if (childrenList.size() > 0) {
|
||||
// costContractPlan.setLastLevel(false);
|
||||
// getChildren(childrenList, allList, planList, budgetList);
|
||||
// } else {
|
||||
// costContractPlan.setLastLevel(true);
|
||||
// childrenList = planList.stream().filter(p -> p.getSubjectId().toString().equals(costContractPlan.getId().toString())).collect(Collectors.toList());
|
||||
// }
|
||||
// costContractPlan.setChildren(childrenList);
|
||||
// }
|
||||
// }
|
||||
private List<CostContractPlanDto> getChildren(List<CostSubject> list, List<CostSubject> allList, List<CostBudget> costBudgetList, List<CostContract> contractList, List<CostContractPlan> contractPlanList, Long subjectId) {
|
||||
List<CostContractPlanDto> costContractPlanDtoList = new ArrayList<>();
|
||||
if (list.size() > 0) {
|
||||
for (CostSubject costSubject : list) {
|
||||
List<CostSubject> children = allList.stream().filter(a -> a.getParentId().toString().equals(costSubject.getId().toString())).collect(Collectors.toList());
|
||||
CostContractPlanDto costContractPlanDto = new CostContractPlanDto();
|
||||
costContractPlanDto.setId(costSubject.getId());
|
||||
costContractPlanDto.setSubjectId(costSubject.getParentId());
|
||||
costContractPlanDto.setContractName(costSubject.getName());
|
||||
// 查询合约
|
||||
List<CostContract> contracts = contractList.stream().filter(c -> c.getSubjectId().toString().equals(costSubject.getId().toString())).collect(Collectors.toList());
|
||||
costContractPlanDto.setGoal(costBudgetList.stream().filter(c -> c.getSubjectId().toString().equals(costSubject.getId().toString()))
|
||||
.map(c -> new BigDecimal(c.getBudgetCost())).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||
costContractPlanDto.setUnderApproval(contracts.stream().map(c -> c.getHthszj()).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||
BigDecimal subtract = costContractPlanDto.getGoal().subtract(costContractPlanDto.getUnderApproval());
|
||||
costContractPlanDto.setAllowance(subtract);
|
||||
costContractPlanDto.setType(0);
|
||||
costContractPlanDto.setLastLevel(children.size() > 0 ? false : true);
|
||||
costContractPlanDto.setChildren(getChildren(children, allList, costBudgetList, contractList, contractPlanList, costSubject.getId()));
|
||||
costContractPlanDtoList.add(costContractPlanDto);
|
||||
}
|
||||
} else {
|
||||
List<CostContractPlan> contractPlans = contractPlanList.stream().filter(p -> p.getSubjectId().toString().equals(subjectId.toString())).collect(Collectors.toList());
|
||||
for (CostContractPlan contractPlan : contractPlans) {
|
||||
CostContractPlanDto costContractPlanDto = new CostContractPlanDto();
|
||||
BeanUtils.copyProperties(contractPlan, costContractPlanDto);
|
||||
costContractPlanDto.setType(1);
|
||||
costContractPlanDtoList.add(costContractPlanDto);
|
||||
}
|
||||
costContractPlan.setChildren(childrenList);
|
||||
}
|
||||
return costContractPlanDtoList;
|
||||
}
|
||||
|
||||
private List<DynamicCostDto> getDynamicChildren(List<CostSubject> list, List<CostSubject> allList, List<CostContractPlan> contractPlanList, List<CostContract> contractList) {
|
||||
private List<DynamicCostDto> getDynamicChildren(List<CostSubject> list, List<CostSubject> allList, List<CostBudget> costBudgetList, List<CostContract> contractList) {
|
||||
List<DynamicCostDto> dynamicCostDtoList = new ArrayList<>();
|
||||
for (CostSubject costSubject : list) {
|
||||
DynamicCostDto dynamicCostDto = new DynamicCostDto();
|
||||
dynamicCostDto.setSubjectId(costSubject.getId());
|
||||
dynamicCostDto.setSubjectName(costSubject.getName());
|
||||
// 查询合约
|
||||
List<CostSubject> children = allList.stream().filter(a -> Arrays.asList(a.getAncestors().split(",")).contains(costSubject.getId().toString())).collect(Collectors.toList());
|
||||
List<String> childrenSubIds = children.stream().map(c -> c.getId().toString()).collect(Collectors.toList());
|
||||
List<CostContractPlan> contractPlans = new ArrayList<>();
|
||||
List<CostContract> contracts = new ArrayList<>();
|
||||
if (childrenSubIds.size() > 0) {
|
||||
contractPlans = contractPlanList.stream().filter(c -> childrenSubIds.contains(c.getSubjectId().toString())).collect(Collectors.toList());
|
||||
contracts = contractList.stream().filter(c -> childrenSubIds.contains(c.getSubjectId().toString())).collect(Collectors.toList());
|
||||
} else {
|
||||
contractPlans = contractPlanList.stream().filter(c -> c.getSubjectId().toString().equals(costSubject.getId().toString())).collect(Collectors.toList());
|
||||
contracts = contractList.stream().filter(c -> c.getSubjectId().toString().equals(costSubject.getId().toString())).collect(Collectors.toList());
|
||||
}
|
||||
dynamicCostDto.setGoal(contractPlans.stream().map(c -> new BigDecimal(c.getGoal())).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||
List<CostSubject> children = allList.stream().filter(a -> a.getParentId().toString().equals(costSubject.getId().toString())).collect(Collectors.toList());
|
||||
// List<CostSubject> allChildren = allList.stream().filter(a -> Arrays.asList(a.getAncestors().split(",")).contains(costSubject.getId().toString())).collect(Collectors.toList());
|
||||
List<CostContract> contracts = contractList.stream().filter(c -> c.getSubjectId().toString().equals(costSubject.getId().toString())).collect(Collectors.toList());
|
||||
dynamicCostDto.setGoal(costBudgetList.stream().filter(c -> c.getSubjectId().toString().equals(costSubject.getId().toString()))
|
||||
.map(c -> new BigDecimal(c.getBudgetCost())).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||
dynamicCostDto.setContractAmount(contracts.stream().filter(c -> c.getZt().equals("已生效")).map(c -> c.getHthszj()).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||
dynamicCostDto.setUnderApproval(contracts.stream().filter(c -> c.getZt().equals("内审中")).map(c -> c.getHthszj()).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||
dynamicCostDto.setDynamicCost(dynamicCostDto.getContractAmount().add(dynamicCostDto.getUnderApproval()).add(dynamicCostDto.getToOccur()).add(dynamicCostDto.getContractAmount()));
|
||||
BigDecimal subtract = dynamicCostDto.getGoal().subtract(dynamicCostDto.getDynamicCost());
|
||||
dynamicCostDto.setCostDifference(dynamicCostDto.getGoal().compareTo(new BigDecimal(0)) > 0 ? subtract.divide(dynamicCostDto.getGoal(), 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).toString() : "0");
|
||||
dynamicCostDto.setAllowance(subtract);
|
||||
dynamicCostDto.setChildren(getDynamicChildren(children, allList, contractPlanList, contractList));
|
||||
dynamicCostDto.setChildren(getDynamicChildren(children, allList, costBudgetList, contractList));
|
||||
dynamicCostDtoList.add(dynamicCostDto);
|
||||
}
|
||||
return dynamicCostDtoList;
|
||||
|
||||
@ -1,11 +1,17 @@
|
||||
package com.zhgd.xmgl.modules.cost.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
|
||||
import com.zhgd.xmgl.modules.cost.dto.ContractPayOverviewDto;
|
||||
import com.zhgd.xmgl.modules.cost.entity.CostContractPay;
|
||||
import com.zhgd.xmgl.modules.cost.entity.CostPayPlan;
|
||||
import com.zhgd.xmgl.modules.cost.entity.CostQuantity;
|
||||
import com.zhgd.xmgl.modules.cost.mapper.CostPayPlanMapper;
|
||||
import com.zhgd.xmgl.modules.cost.mapper.CostQuantityMapper;
|
||||
import com.zhgd.xmgl.modules.cost.service.ICostContractPayService;
|
||||
import com.zhgd.xmgl.modules.cost.service.ICostPayPlanService;
|
||||
import com.zhgd.xmgl.modules.cost.service.ICostQuantityService;
|
||||
import com.zhgd.xmgl.modules.project.entity.Project;
|
||||
@ -18,6 +24,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 资金计划
|
||||
@ -34,6 +41,23 @@ public class CostPayPlanServiceImpl extends ServiceImpl<CostPayPlanMapper, CostP
|
||||
@Autowired
|
||||
private IProjectService projectService;
|
||||
|
||||
@Autowired
|
||||
private ICostContractPayService costContractPayService;
|
||||
|
||||
@Autowired
|
||||
private ISystemUserService systemUserService;
|
||||
|
||||
@Override
|
||||
public Page<CostPayPlan> pageList(Page page, Wrapper<CostPayPlan> wrapper) {
|
||||
Page<CostPayPlan> pageList = this.page(page, wrapper);
|
||||
List<SystemUser> systemUserList = systemUserService.list();
|
||||
for (CostPayPlan record : pageList.getRecords()) {
|
||||
List<SystemUser> users = systemUserList.stream().filter(s -> s.getUserId().toString().equals(record.getApplyBy())).collect(Collectors.toList());
|
||||
record.setApplyByName(users.size() > 0 ? users.get(0).getRealName() : "");
|
||||
}
|
||||
return pageList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CostPayPlan queryById(String id) {
|
||||
List<CostQuantity> list = costQuantityService.list(Wrappers.<CostQuantity>lambdaQuery().eq(CostQuantity::getPayPlanId, id));
|
||||
@ -46,13 +70,15 @@ public class CostPayPlanServiceImpl extends ServiceImpl<CostPayPlanMapper, CostP
|
||||
public List<ContractPayOverviewDto> payOverview(String projectSn) {
|
||||
List<ContractPayOverviewDto> overviewDtos = new ArrayList<>();
|
||||
List<Project> projects = projectService.list();
|
||||
List<CostContractPay> costContractPayList = costContractPayService.list();
|
||||
List<CostPayPlan> list = this.list();
|
||||
for (Project project : projects) {
|
||||
ContractPayOverviewDto contractPayOverviewDto = new ContractPayOverviewDto();
|
||||
contractPayOverviewDto.setProjectId(project.getProjectId());
|
||||
contractPayOverviewDto.setProjectName(project.getProjectName());
|
||||
contractPayOverviewDto.setPlanPayAmount(list.stream().map(l -> new BigDecimal(l.getPayAmount())).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||
contractPayOverviewDto.setPayAmount(new BigDecimal(0));
|
||||
contractPayOverviewDto.setPayAmount(costContractPayList.stream().filter(c -> c.getSxm().equals(project.getProjectId().toString()))
|
||||
.map(c -> new BigDecimal(c.getBczfje())).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||
contractPayOverviewDto.setCostDifference(contractPayOverviewDto.getPlanPayAmount().subtract(contractPayOverviewDto.getPayAmount()));
|
||||
if (contractPayOverviewDto.getPlanPayAmount().compareTo(new BigDecimal(0)) != 0) {
|
||||
contractPayOverviewDto.setCostDifferenceRatio(contractPayOverviewDto.getCostDifference().divide(contractPayOverviewDto.getPlanPayAmount(), 2, BigDecimal.ROUND_HALF_UP)
|
||||
|
||||
@ -199,8 +199,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
||||
}
|
||||
wrapper.eq(Company::getCompanyType, 3);
|
||||
List<Company> list = companyService.list(wrapper);
|
||||
List<Project> proList = this.list(Wrappers.<Project>lambdaQuery()
|
||||
.eq(Project::getNature, companyProjectDto.getNature()));
|
||||
LambdaQueryWrapper<Project> wrapper1 = Wrappers.<Project>lambdaQuery();
|
||||
if(companyProjectDto.getNature() != null) {
|
||||
wrapper1.eq(Project::getNature, companyProjectDto.getNature());
|
||||
}
|
||||
List<Project> proList = this.list(wrapper1);
|
||||
List<CompanyProjectDto> dtoList = new ArrayList<>();
|
||||
for (Company company : list) {
|
||||
CompanyProjectDto first = new CompanyProjectDto();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user