bms2相关修改;

This commit is contained in:
王奎兴
2026-03-18 19:07:42 +08:00
parent 1b9d92ea76
commit 8fea8fe98e
7 changed files with 231 additions and 7 deletions
@@ -430,6 +430,50 @@ public class BillingStatementDomainService {
return this.insert(billingStatementDO);
}
/**
* 生成流水
*/
public Boolean generateFlowBySystem(BusinessDocumentPO businessDocumentPO) {
BillingStatementDO billingStatementDO = new BillingStatementDO();
String[] ignroreFields = new String[]{"billingStatementId","dataSources","createBy","createByName","createTime","updateBy","updateByName","updateTime"};
BeanUtils.copyProperties(businessDocumentPO,billingStatementDO,ignroreFields);
billingStatementDO.setBusinessDocumentId(businessDocumentPO.getBusinessDocumentId());
//设置业务日期:优先使用计费时间,如果没有则使用创建时间,如果还没有则使用当前日期
Date businessDate = businessDocumentPO.getBillingTime();
if (businessDate == null) {
businessDate = businessDocumentPO.getCreateTime();
}
if (businessDate == null) {
businessDate = new Date();
}
billingStatementDO.setBusinessDate(businessDate);
billingStatementDO.setBillingAmount(businessDocumentPO.getBillAmount());
billingStatementDO.setBillingState(1);
billingStatementDO.setDataSources(1);
//billingStatementDO.setCreateBy(loginUser.getUserPo().getUserId());
billingStatementDO.setCreateByName("system");
billingStatementDO.setCreateTime(new Date());
billingStatementDO.setBillingFlow(businessDocumentPO.getBusinessFlow());
billingStatementDO.setTopOrganizationId(businessDocumentPO.getTopOrganizationId());
billingStatementDO.setOrganizationId(businessDocumentPO.getOrganizationId());
billingStatementDO.setOrganizationName(businessDocumentPO.getOrganizationName());
//收款帐户信息
billingStatementDO.setPaymentAccountId(businessDocumentPO.getPaymentAccountId()); //收款帐户ID
billingStatementDO.setPaymentAccountName(businessDocumentPO.getPaymentAccountName()); //收款帐户名称
BigDecimal billingAmount = billingStatementDO.getBillingAmount();
Double taxRate = billingStatementDO.getTaxRate() != null ? billingStatementDO.getTaxRate() : 0.0;
BigDecimal taxAmount = billingAmount.divide(BigDecimal.ONE.add(new BigDecimal(taxRate).divide(BigDecimal.valueOf(100))),10, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(taxRate).divide(BigDecimal.valueOf(100))).setScale(2, BigDecimal.ROUND_HALF_UP);
BigDecimal taxFreeFee = billingAmount.subtract(taxAmount);
billingStatementDO.setTaxAmount(taxAmount);
billingStatementDO.setTaxFreeFee(taxFreeFee);
//处理数据
handleData(billingStatementDO);
return this.insert(billingStatementDO);
}
/**
* 处理生成收支流水数据
* @param billingStatementDO
@@ -136,6 +136,24 @@ public class BusinessDocumentDomainService {
}
/**
* 根据id生效业务单据信息
*/
public Boolean takeEffectByIdsBySystem(List<Long> businessDocumentIdLongList) {
if(businessDocumentIdLongList != null && businessDocumentIdLongList.size() > 0){
LambdaUpdateWrapper<BusinessDocument> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.set(BusinessDocument::getBusinessState,2);
//updateWrapper.set(BusinessDocument::getUpdateBy,loginUser.getUserPo().getUserId());
updateWrapper.set(BusinessDocument::getUpdateTime,new Date());
//updateWrapper.set(BusinessDocument::getUpdateByName,loginUser.getUserPo().getUserName());
updateWrapper.in(BusinessDocument::getBusinessDocumentId,businessDocumentIdLongList);
return businessDocumentService.update(updateWrapper);
}
return false;
}
/**
* 审核业务单据
*/
@@ -163,6 +181,30 @@ public class BusinessDocumentDomainService {
return false;
}
/**
* 审核业务单据
*/
public Boolean auditByIdsBySystem(List<Long> businessDocumentIdLongList, BusinessDocumentDTO businessDocumentDTO) {
if(businessDocumentIdLongList != null && businessDocumentIdLongList.size() > 0){
LambdaUpdateWrapper<BusinessDocument> updateWrapper = new LambdaUpdateWrapper<>();
if(businessDocumentDTO.getAuditOperation() == 1){
//同意
updateWrapper.set(BusinessDocument::getBusinessState,3);
}else {
//驳回
updateWrapper.set(BusinessDocument::getBusinessState,4);
}
updateWrapper.set(BusinessDocument::getReviewRemarks,businessDocumentDTO.getReviewRemarks());
//updateWrapper.set(BusinessDocument::getUpdateBy,loginUser.getUserPo().getUserId());
updateWrapper.set(BusinessDocument::getUpdateTime,new Date());
//updateWrapper.set(BusinessDocument::getUpdateByName,loginUser.getUserPo().getUserName());
updateWrapper.in(BusinessDocument::getBusinessDocumentId,businessDocumentIdLongList);
return businessDocumentService.update(updateWrapper);
}
return false;
}
public Boolean saveBatch(List<BusinessDocument> businessDocumentList) {
if(null != businessDocumentList && businessDocumentList.size() > 0){
return businessDocumentService.saveBatch(businessDocumentList);
@@ -76,7 +76,7 @@ public class SettlementCustomersDomainService {
public SettlementCustomers queryByCode(String settlementCustomersCode) {
LambdaQueryWrapper<SettlementCustomers> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(SettlementCustomers::getSettlementCustomersCode, settlementCustomersCode);
queryWrapper.eq(SettlementCustomers::getTopOrganizationId, SecurityUtils.getLoginUser().getUserPo().getTopOrganizationId());
//queryWrapper.eq(SettlementCustomers::getTopOrganizationId, SecurityUtils.getLoginUser().getUserPo().getTopOrganizationId());
queryWrapper.eq(SettlementCustomers::getDelFlag, 1);
return settlementCustomersService.getOne(queryWrapper);
}
@@ -84,4 +84,4 @@ public class SettlementCustomersDomainService {
}
}