11-26-承包合同开票单位改为部门公司

This commit is contained in:
2025-11-26 19:01:14 +08:00
parent 03177f58f2
commit 5e9d36400c
3 changed files with 19 additions and 3 deletions

View File

@ -110,7 +110,7 @@ public class XzdContractDetailsBo extends BaseEntity {
/**
* 开票单位
*/
@NotNull(message = "开票单位不能为空", groups = { AddGroup.class, EditGroup.class })
// @NotNull(message = "开票单位不能为空", groups = { AddGroup.class, EditGroup.class })
private Long invoicingUnit;
/**

View File

@ -147,7 +147,7 @@ public class XzdContractDetailsVo implements Serializable {
private BigDecimal contractAmount;
/**
* 开票单位(供应商)
* 开票单位(供应商,现改为部门公司)
*/
@ExcelProperty(value = "开票单位")
private Long invoicingUnit;
@ -155,7 +155,7 @@ public class XzdContractDetailsVo implements Serializable {
/**
* 开票单位名称
*/
@Translation(type = TransConstant.XZD_KHXX_ID_TO_NAME, mapper = "invoicingUnit")
// @Translation(type = TransConstant.XZD_KHXX_ID_TO_NAME, mapper = "invoicingUnit")
private String invoicingUnitName;
/**

View File

@ -185,6 +185,17 @@ public class XzdContractDetailsServiceImpl extends ServiceImpl<XzdContractDetail
add.setContractCode(banBen);
add.setHtzt("正常");
//开票单位(部门) 要获取到顶级(公司)
if (bo.getInvoicingUnit() != null) {
SysDeptVo sysDeptVo = sysDeptService.selectDeptById(bo.getInvoicingUnit());
while (sysDeptVo != null && sysDeptVo.getParentId() != 100){
sysDeptVo = sysDeptService.selectDeptById(sysDeptVo.getParentId());
}
if (sysDeptVo != null) {
add.setInvoicingUnit(sysDeptVo.getDeptId());
}
}
boolean flag = baseMapper.insert(add) > 0;
if (!flag) {
return false;
@ -565,6 +576,11 @@ public class XzdContractDetailsServiceImpl extends ServiceImpl<XzdContractDetail
info.setContractAmount(changeVo.getPostChangeTotalCost());
}
//获取开票单位(部门公司)
SysDeptVo sysDeptVo = sysDeptService.selectDeptById(info.getInvoicingUnit());
if (sysDeptVo != null){
info.setInvoicingUnitName(sysDeptVo.getDeptName());
}
}
}