生成合同

This commit is contained in:
1073413548 2024-08-09 18:03:48 +08:00
parent 811558346b
commit 9265cb946d
5 changed files with 20 additions and 7 deletions

View File

@ -43,7 +43,10 @@ public class PsContractBusiness extends TenantEntity {
* 服务总金额
*/
private BigDecimal businessAmount;
/**
* 服务类型辅助
*/
private String desc;
/**
* 结束时间
*/

View File

@ -47,7 +47,10 @@ public class PsContractBusinessBo {
*/
@NotNull(message = "服务总金额不能为空", groups = { AddGroup.class, EditGroup.class })
private BigDecimal businessAmount;
/**
* 服务类型辅助
*/
private String desc;
/**
* 结束时间
*/

View File

@ -56,7 +56,10 @@ public class PsContractBusinessVo implements Serializable {
*/
private BigDecimal businessAmount;
/**
* 服务类型辅助
*/
private String desc;
/**
* 结束时间
*/

View File

@ -81,12 +81,14 @@ public class PsContractInfoServiceImpl implements IPsContractInfoService {
//3.如果已存在合同则进行修改否则新增
if(add == null){
add = new PsContractInfo();
MapstructUtils.convert(bo, add);
add.setContractCode(UUID.randomUUID().toString().replaceAll("-", ""));//合同编码
add.setContractName("合同名称");//todo 合同名称
add.setCustomManager(LoginHelper.getUserId());//所属销售经理id
}else{
MapstructUtils.convert(bo, add);
}
add.setCompanyId(bo.getCompanyInfoBo().getId());//公司id
MapstructUtils.convert(bo, add);
bo.getBusinessList().forEach(item->{
BigDecimal mony = BigDecimal.ZERO;
if(CollectionUtils.isNotEmpty(item.getDetailBos())){
@ -100,7 +102,7 @@ public class PsContractInfoServiceImpl implements IPsContractInfoService {
add.setContractStatus(type == 1?ContractStatusEnum.INIT.getCode():ContractStatusEnum.CREATE.getCode());//合同状态
baseMapper.insertOrUpdate(add);
//4.删除所有服务类型和服务项目,.插入服务类型
businessService.saveList(bo.getBusinessList(),bo.getContractCode());
businessService.saveList(bo.getBusinessList(),add.getContractCode());
//7.生成合同
return makePdf(add,bo);
}
@ -371,7 +373,9 @@ public class PsContractInfoServiceImpl implements IPsContractInfoService {
//未付金额(合同金额-已付金额)
vo.setResidualMoney((vo.getContractAmount() == null ? BigDecimal.ZERO:vo.getContractAmount()).subtract(vo.getPayMoney()));
//付款周期
if(payList.size() == 1){
if(payList.size() == 0){
vo.setPeriod(null);
}else if(payList.size() == 1){
vo.setPeriod(1);
}else{
//包含最后一天

View File

@ -24,7 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from ps_contract_business bus
left join ps_contract_business_detail detail on bus.id = detail.business_id
where bus.del_flag = 0
and detail.del_flag = 0
and (detail.del_flag = 0 or detail.del_flag is null)
and bus.contract_code = #{contractCode}
</select>