生成合同
This commit is contained in:
parent
811558346b
commit
9265cb946d
@ -43,7 +43,10 @@ public class PsContractBusiness extends TenantEntity {
|
|||||||
* 服务总金额
|
* 服务总金额
|
||||||
*/
|
*/
|
||||||
private BigDecimal businessAmount;
|
private BigDecimal businessAmount;
|
||||||
|
/**
|
||||||
|
* 服务类型辅助
|
||||||
|
*/
|
||||||
|
private String desc;
|
||||||
/**
|
/**
|
||||||
* 结束时间
|
* 结束时间
|
||||||
*/
|
*/
|
||||||
|
@ -47,7 +47,10 @@ public class PsContractBusinessBo {
|
|||||||
*/
|
*/
|
||||||
@NotNull(message = "服务总金额不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotNull(message = "服务总金额不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private BigDecimal businessAmount;
|
private BigDecimal businessAmount;
|
||||||
|
/**
|
||||||
|
* 服务类型辅助
|
||||||
|
*/
|
||||||
|
private String desc;
|
||||||
/**
|
/**
|
||||||
* 结束时间
|
* 结束时间
|
||||||
*/
|
*/
|
||||||
|
@ -56,7 +56,10 @@ public class PsContractBusinessVo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private BigDecimal businessAmount;
|
private BigDecimal businessAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务类型辅助
|
||||||
|
*/
|
||||||
|
private String desc;
|
||||||
/**
|
/**
|
||||||
* 结束时间
|
* 结束时间
|
||||||
*/
|
*/
|
||||||
|
@ -81,12 +81,14 @@ public class PsContractInfoServiceImpl implements IPsContractInfoService {
|
|||||||
//3.如果已存在合同,则进行修改,否则新增
|
//3.如果已存在合同,则进行修改,否则新增
|
||||||
if(add == null){
|
if(add == null){
|
||||||
add = new PsContractInfo();
|
add = new PsContractInfo();
|
||||||
|
MapstructUtils.convert(bo, add);
|
||||||
add.setContractCode(UUID.randomUUID().toString().replaceAll("-", ""));//合同编码
|
add.setContractCode(UUID.randomUUID().toString().replaceAll("-", ""));//合同编码
|
||||||
add.setContractName("合同名称");//todo 合同名称
|
add.setContractName("合同名称");//todo 合同名称
|
||||||
add.setCustomManager(LoginHelper.getUserId());//所属销售经理id
|
add.setCustomManager(LoginHelper.getUserId());//所属销售经理id
|
||||||
|
}else{
|
||||||
|
MapstructUtils.convert(bo, add);
|
||||||
}
|
}
|
||||||
add.setCompanyId(bo.getCompanyInfoBo().getId());//公司id
|
add.setCompanyId(bo.getCompanyInfoBo().getId());//公司id
|
||||||
MapstructUtils.convert(bo, add);
|
|
||||||
bo.getBusinessList().forEach(item->{
|
bo.getBusinessList().forEach(item->{
|
||||||
BigDecimal mony = BigDecimal.ZERO;
|
BigDecimal mony = BigDecimal.ZERO;
|
||||||
if(CollectionUtils.isNotEmpty(item.getDetailBos())){
|
if(CollectionUtils.isNotEmpty(item.getDetailBos())){
|
||||||
@ -100,7 +102,7 @@ public class PsContractInfoServiceImpl implements IPsContractInfoService {
|
|||||||
add.setContractStatus(type == 1?ContractStatusEnum.INIT.getCode():ContractStatusEnum.CREATE.getCode());//合同状态
|
add.setContractStatus(type == 1?ContractStatusEnum.INIT.getCode():ContractStatusEnum.CREATE.getCode());//合同状态
|
||||||
baseMapper.insertOrUpdate(add);
|
baseMapper.insertOrUpdate(add);
|
||||||
//4.删除所有服务类型和服务项目,.插入服务类型
|
//4.删除所有服务类型和服务项目,.插入服务类型
|
||||||
businessService.saveList(bo.getBusinessList(),bo.getContractCode());
|
businessService.saveList(bo.getBusinessList(),add.getContractCode());
|
||||||
//7.生成合同
|
//7.生成合同
|
||||||
return makePdf(add,bo);
|
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()));
|
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);
|
vo.setPeriod(1);
|
||||||
}else{
|
}else{
|
||||||
//包含最后一天
|
//包含最后一天
|
||||||
|
@ -24,7 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
from ps_contract_business bus
|
from ps_contract_business bus
|
||||||
left join ps_contract_business_detail detail on bus.id = detail.business_id
|
left join ps_contract_business_detail detail on bus.id = detail.business_id
|
||||||
where bus.del_flag = 0
|
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}
|
and bus.contract_code = #{contractCode}
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
Loading…
Reference in New Issue
Block a user