mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-17 20:45:06 +08:00
[feat] 新增预算管理功能
This commit is contained in:
@ -0,0 +1,24 @@
|
||||
package cn.iocoder.yudao.module.cms.api.contract;
|
||||
|
||||
import cn.iocoder.yudao.module.cms.api.contract.dto.ContractDetailRespDTO;
|
||||
import cn.iocoder.yudao.module.cms.api.contract.dto.ContractRespDTO;
|
||||
|
||||
public interface ContractApi {
|
||||
|
||||
/**
|
||||
* 获得合同部分信息
|
||||
*/
|
||||
ContractRespDTO getContract(Long id);
|
||||
|
||||
/**
|
||||
* 获得合同detail信息
|
||||
*/
|
||||
ContractDetailRespDTO getContractDetailById(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 判断合同是否存在
|
||||
*/
|
||||
void vaildContractExist(Long id);
|
||||
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package cn.iocoder.yudao.module.cms.api.contract.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class ContractDetailRespDTO {
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 合同类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 合同进展
|
||||
*/
|
||||
private String progress;
|
||||
/**
|
||||
* 合同状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 签订合同总额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 审定金额
|
||||
*/
|
||||
private BigDecimal approvedAmount;
|
||||
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package cn.iocoder.yudao.module.cms.api.contract.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class ContractRespDTO {
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 合同类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 合同进展
|
||||
*/
|
||||
private String progress;
|
||||
/**
|
||||
* 合同状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 签订合同总额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 审定金额
|
||||
*/
|
||||
private BigDecimal approvedAmount;
|
||||
/**
|
||||
* 计费方式
|
||||
*/
|
||||
private String countType;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package cn.iocoder.yudao.module.cms.api.outscontract;
|
||||
|
||||
import cn.iocoder.yudao.module.cms.api.contract.dto.ContractRespDTO;
|
||||
import cn.iocoder.yudao.module.cms.api.outscontract.dto.OutscontractRespDTO;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
public interface OutscontractApi {
|
||||
|
||||
OutscontractRespDTO getOutsContract(Long id);
|
||||
|
||||
BigDecimal getOutsContractAmount(Long contractId);
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package cn.iocoder.yudao.module.cms.api.outscontract.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class OutscontractRespDTO {
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 主合同id
|
||||
*/
|
||||
private Long contractId;
|
||||
/**
|
||||
* 外包合同金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String code;
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package cn.iocoder.yudao.module.cms.api.contract;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.cms.api.contract.dto.ContractDetailRespDTO;
|
||||
import cn.iocoder.yudao.module.cms.api.contract.dto.ContractRespDTO;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.contract.ContractDO;
|
||||
import cn.iocoder.yudao.module.cms.dal.mysql.contract.ContractMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.CONTRACT_NOT_EXISTS;
|
||||
import static cn.iocoder.yudao.module.pms.enums.ErrorCodeConstants.PROJECT_NOT_EXISTS;
|
||||
|
||||
@Service
|
||||
@Validated
|
||||
public class ContractImpl implements ContractApi{
|
||||
|
||||
@Resource
|
||||
private ContractMapper contractMapper;
|
||||
|
||||
@Override
|
||||
public ContractRespDTO getContract(Long id) {
|
||||
ContractDO contractDO = contractMapper.selectById(id);
|
||||
ContractRespDTO contractRespDTO = BeanUtils.toBean(contractDO, ContractRespDTO.class);
|
||||
return contractRespDTO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContractDetailRespDTO getContractDetailById(Long id) {
|
||||
// 优化
|
||||
ContractDO contractRespDTO1 = contractMapper.selectById(id);
|
||||
ContractDetailRespDTO contractDetailRespDTO = BeanUtils.toBean(contractRespDTO1, ContractDetailRespDTO.class);
|
||||
return contractDetailRespDTO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void vaildContractExist(Long id) {
|
||||
if (contractMapper.selectById(id)==null) {
|
||||
throw exception(CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package cn.iocoder.yudao.module.cms.api.outscontract;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.cms.api.outscontract.dto.OutscontractRespDTO;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.outscontract.OutsContractDO;
|
||||
import cn.iocoder.yudao.module.cms.dal.mysql.outscontract.OutsContractMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Validated
|
||||
public class OutscontractImpl implements OutscontractApi{
|
||||
|
||||
@Resource
|
||||
private OutsContractMapper outsContractMapper;
|
||||
|
||||
@Override
|
||||
public OutscontractRespDTO getOutsContract(Long id) {
|
||||
OutsContractDO outsContractDO = outsContractMapper.selectById(id);
|
||||
OutscontractRespDTO outscontractRespDTO = BeanUtils.toBean(outsContractDO, OutscontractRespDTO.class);
|
||||
return outscontractRespDTO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getOutsContractAmount(Long contractId) {
|
||||
List<OutsContractDO> contractIds = outsContractMapper.selectList("contract_id", contractId);
|
||||
BigDecimal res = new BigDecimal(0);
|
||||
for (OutsContractDO contract:contractIds){
|
||||
res = res.add(contract.getAmount());
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
}
|
@ -24,7 +24,6 @@ public interface ContractMapper extends BaseMapperX<ContractDO> {
|
||||
.eqIfPresent(ContractDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(ContractDO::getCountType, reqVO.getCountType())
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -217,12 +217,12 @@ public class ContractServiceImpl implements ContractService {
|
||||
// 7.暂定结算数 √
|
||||
|
||||
ProjectRespDTO project = projectApi.getProject(projectId);
|
||||
contractRespVO.setCode(project.getCode());
|
||||
contractRespVO.setDrawingCompany(project.getDrawingCompany());
|
||||
contractRespVO.setExpectedContractAmount(project.getContractAmount());
|
||||
contractRespVO.setCode(project.getCode()); // 项目编号
|
||||
contractRespVO.setDrawingCompany(project.getDrawingCompany()); // 出图公司
|
||||
contractRespVO.setExpectedContractAmount(project.getContractAmount()); // 预计合同金额
|
||||
ProjectDetailRespDTO projectDetail = projectApi.getProjectDetailById(projectId);
|
||||
contractRespVO.setTrackingDep(projectDetail.getTrackingDepName());
|
||||
contractRespVO.setProjectManager(projectDetail.getProjectManagerName());
|
||||
contractRespVO.setTrackingDep(projectDetail.getTrackingDepName()); // 主控部门
|
||||
contractRespVO.setProjectManager(projectDetail.getProjectManagerName()); // 项目经理
|
||||
|
||||
//分包合同商议提示 TODO 待优化
|
||||
// ExtContractDO extContractDO = extContractMapper.selectOne("project_id", projectId);
|
||||
|
Reference in New Issue
Block a user