bms2相关修改;
This commit is contained in:
+13
-3
@@ -31,6 +31,7 @@ import com.mhd.bms.interfaces.dto.businessDocument.BusinessDocumentDTO;
|
||||
import com.mhd.common.core.domain.dto.BusinessDataPushDTO;
|
||||
import com.mhd.common.core.domain.po.OrganizationPo;
|
||||
import com.mhd.common.core.domain.po.SysDictDataVo;
|
||||
import com.mhd.common.core.domain.po.UserPo;
|
||||
import com.mhd.common.core.enums.BelongModuleCode;
|
||||
import com.mhd.common.core.enums.DictCode;
|
||||
import com.mhd.common.core.exception.ServiceException;
|
||||
@@ -151,6 +152,9 @@ public class BusinessDocumentApplicationService {
|
||||
businessDocumentDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
businessDocumentDO.setOrganizationId(loginUser.getUserPo().getOrganizationId());
|
||||
businessDocumentDO.setOrganizationName(loginUser.getUserPo().getOrganizationName());
|
||||
UserPo userPo = loginUser.getUserPo();
|
||||
businessDocumentDO.setCreateBy(userPo.getUserId());
|
||||
businessDocumentDO.setCreateByName(userPo.getUserName());
|
||||
//校验使用的表单是否必填校验
|
||||
checkDoucumentType(businessDocumentDO);
|
||||
//处理数据
|
||||
@@ -412,6 +416,9 @@ public class BusinessDocumentApplicationService {
|
||||
checkDoucumentType(businessDocumentDO);
|
||||
//处理数据
|
||||
handleDate(businessDocumentDO);
|
||||
UserPo userPo = loginUser.getUserPo();
|
||||
businessDocumentDO.setUpdateBy(userPo.getUserId());
|
||||
businessDocumentDO.setUpdateByName(userPo.getUserName());
|
||||
return businessDocumentDomainService.update(businessDocumentDO);
|
||||
}
|
||||
|
||||
@@ -588,8 +595,11 @@ public class BusinessDocumentApplicationService {
|
||||
if(businessDocumentPO.getBusinessState()!=2){
|
||||
throw new ServiceException("所选记录"+ businessDocumentPO.getBusinessFlow() +"不是已生效状态不可操作");
|
||||
}
|
||||
//生成计费流水
|
||||
billingStatementDomainService.generateFlow(businessDocumentPO);
|
||||
Integer auditOperation = businessDocumentDTO.getAuditOperation();
|
||||
if(auditOperation != null && auditOperation == 1){
|
||||
//生成计费流水
|
||||
billingStatementDomainService.generateFlow(businessDocumentPO);
|
||||
}
|
||||
businessDocumentIdLongList.add(businessDocumentIdLong);
|
||||
}
|
||||
if(businessDocumentIdLongList.size()>0){
|
||||
@@ -883,4 +893,4 @@ public class BusinessDocumentApplicationService {
|
||||
log.info("定时任务进入BMS业务单据保存--结束");
|
||||
return businessDocumentDomainService.insert(businessDocumentDO);
|
||||
}
|
||||
}
|
||||
}
|
||||
+17
-3
@@ -4,7 +4,9 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.mhd.bms.domain.settlementCustomers.entity.SettlementCustomers;
|
||||
import com.mhd.bms.domain.settlementCustomers.repository.mapper.SettlementCustomersMapper;
|
||||
import com.mhd.bms.domain.settlementCustomers.repository.po.SettlementCustomersPO;
|
||||
import com.mhd.bms.domain.settlementCustomers.repository.todo.SettlementCustomersDO;
|
||||
import com.mhd.bms.domain.settlementCustomers.service.SettlementCustomersDomainService;
|
||||
@@ -51,6 +53,8 @@ public class SettlementCustomersApplicationService {
|
||||
private SystemServiceFeign systemServiceFeign;
|
||||
@Autowired
|
||||
private UserServiceFeign userServiceFeign;
|
||||
@Autowired
|
||||
private SettlementCustomersMapper settlementCustomersMapper;
|
||||
|
||||
|
||||
/**
|
||||
@@ -283,7 +287,12 @@ public class SettlementCustomersApplicationService {
|
||||
saveEntity.setSettlementMethodCode("monthly_settle");
|
||||
saveEntity.setMainRole(1);
|
||||
saveEntity.setCustomerTypeCode("customer"); //从货主同步过来的 默认客户
|
||||
saveEntity(saveEntity);
|
||||
Long settlementEntityId = saveEntity.getSettlementEntityId();
|
||||
List<SettlementCustomers> settlementCustomers = settlementCustomersMapper.selectList(new LambdaQueryWrapper<SettlementCustomers>().eq(SettlementCustomers::getSettlementEntityId, settlementEntityId));
|
||||
if(settlementCustomers != null && settlementCustomers.size() > 0){
|
||||
} else {
|
||||
saveEntity(saveEntity);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -309,7 +318,12 @@ public class SettlementCustomersApplicationService {
|
||||
saveEntity.setSettlementMethodCode("monthly_settle");
|
||||
saveEntity.setMainRole(1);
|
||||
saveEntity.setCustomerTypeCode("customer");
|
||||
saveEntity(saveEntity);
|
||||
Long settlementEntityId = saveEntity.getSettlementEntityId();
|
||||
List<SettlementCustomers> settlementCustomers = settlementCustomersMapper.selectList(new LambdaQueryWrapper<SettlementCustomers>().eq(SettlementCustomers::getSettlementEntityId, settlementEntityId));
|
||||
if(settlementCustomers != null && settlementCustomers.size() > 0){
|
||||
} else {
|
||||
saveEntity(saveEntity);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -344,4 +358,4 @@ public class SettlementCustomersApplicationService {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
+10
-2
@@ -220,7 +220,11 @@ public class BillManageImpl extends ServiceImpl<BillManageMapper, BillManage> im
|
||||
for (BmsMakeOutInvoiceItem item1 : bmsMakeOutInvoiceItems) {
|
||||
if(item1.getInvoiceValue().compareTo(BigDecimal.ZERO)>0){
|
||||
Ysitem item=new Ysitem();
|
||||
item.setSo_deptid("NG0408");
|
||||
if (deptValue != null && !deptValue.isEmpty()) {
|
||||
item.setSo_deptid(deptValue);
|
||||
} else {
|
||||
item.setSo_deptid("NG0408");
|
||||
}
|
||||
if (deptValue != null && !deptValue.isEmpty()) {
|
||||
item.setPk_deptid(deptValue);
|
||||
} else {
|
||||
@@ -478,7 +482,11 @@ public class BillManageImpl extends ServiceImpl<BillManageMapper, BillManage> im
|
||||
String settlementCurrencyNcCode = settlementCurrency;
|
||||
makerCodeNc=documentPreparerNcCode;
|
||||
SKitem item=new SKitem();
|
||||
item.setSo_deptid("NG0408");
|
||||
if (deptValue != null && !deptValue.isEmpty()) {
|
||||
item.setSo_deptid(deptValue);
|
||||
} else {
|
||||
item.setSo_deptid("NG0408");
|
||||
}
|
||||
if (deptValue != null && !deptValue.isEmpty()) {
|
||||
item.setPk_deptid(deptValue);
|
||||
} else {
|
||||
|
||||
@@ -256,4 +256,9 @@ public class BillManageDO extends BaseVOEntity{
|
||||
private Double taxRate;
|
||||
@ApiModelProperty("结算币种")
|
||||
private String settlementCurrency;
|
||||
private String receivablePushTimeEnd;
|
||||
private String receivablePushTimeStart;
|
||||
private String paymentPushTimeEnd;
|
||||
private String paymentPushTimeStart;
|
||||
|
||||
}
|
||||
+4
-2
@@ -1,6 +1,7 @@
|
||||
package com.mhd.bms.domain.billingRules.service;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.mhd.bms.domain.billingRules.entity.BillingParams;
|
||||
import com.mhd.bms.domain.billingRules.repository.facade.IBillingParamsService;
|
||||
import com.mhd.bms.domain.billingRules.repository.po.BillingParamsPO;
|
||||
@@ -121,7 +122,8 @@ public class BillingParamsDomainService {
|
||||
}
|
||||
billingParamsList.add(billingParams);
|
||||
}
|
||||
return billingParamsService.saveOrUpdateBatch(billingParamsList);
|
||||
billingParamsService.remove(new LambdaQueryWrapper<BillingParams>().eq(BillingParams::getBillingRulesId, billingRulesDO.getBillingRulesId()));
|
||||
return billingParamsService.saveBatch(billingParamsList);
|
||||
}
|
||||
|
||||
|
||||
@@ -136,4 +138,4 @@ public class BillingParamsDomainService {
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+33
-1
@@ -12,6 +12,7 @@ import com.mhd.bms.domain.billManage.repository.po.BillManagePO;
|
||||
import com.mhd.bms.domain.billManage.service.BillManageDomainService;
|
||||
import com.mhd.bms.domain.billingStatement.entity.BillingStatement;
|
||||
import com.mhd.bms.domain.billingStatement.repository.facade.IBillingStatementService;
|
||||
import com.mhd.bms.domain.billingStatement.repository.po.BillingStatementADDVO;
|
||||
import com.mhd.bms.domain.billingStatement.repository.po.BillingStatementCollectPO;
|
||||
import com.mhd.bms.domain.billingStatement.repository.po.BillingStatementPO;
|
||||
import com.mhd.bms.domain.billingStatement.repository.todo.BillingStatementCollectDO;
|
||||
@@ -37,6 +38,7 @@ import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
@@ -265,7 +267,29 @@ public class BillingStatementDomainService {
|
||||
updateWrapper.set(BillingStatement::getUpdateTime,new Date());
|
||||
updateWrapper.set(BillingStatement::getUpdateByName,loginUser.getUserPo().getUserName());
|
||||
updateWrapper.set(BillingStatement::getBillManageId,billingStatementDTO.getBillManageId());
|
||||
return billingStatementService.update(updateWrapper);
|
||||
boolean update = billingStatementService.update(updateWrapper);
|
||||
List<BillingStatementADDVO> billingStatementList = billingStatementDTO.getBillingStatementList();
|
||||
for (BillingStatementADDVO billingStatementADDVO : billingStatementList) {
|
||||
String billingStatementIds = billingStatementADDVO.getBillingStatementId();
|
||||
Set<String> billings = Stream.of(billingStatementIds.split(",")).collect(Collectors.toSet());
|
||||
if (billings != null && billings.size() > 0) {
|
||||
for (String billing : billings) {
|
||||
Long billingStatementId = Long.valueOf(billing);
|
||||
Double taxRate = billingStatementADDVO.getTaxRate();
|
||||
BillingStatement billingStatement = billingStatementService.getById(billingStatementId);
|
||||
if (billingStatement != null) {
|
||||
BigDecimal billingAmount = billingStatement.getBillingAmount();
|
||||
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);
|
||||
billingStatement.setTaxAmount(taxAmount);
|
||||
billingStatement.setTaxFreeFee(taxFreeFee);
|
||||
billingStatement.setTaxRate(taxRate);
|
||||
billingStatementService.updateById(billingStatement);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return update;
|
||||
}
|
||||
|
||||
|
||||
@@ -390,6 +414,14 @@ public class BillingStatementDomainService {
|
||||
billingStatementDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
billingStatementDO.setOrganizationId(loginUser.getUserPo().getOrganizationId());
|
||||
billingStatementDO.setOrganizationName(loginUser.getUserPo().getOrganizationName());
|
||||
|
||||
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);
|
||||
|
||||
+1
@@ -138,4 +138,5 @@ public class BmsInvoiceListQueryDTO implements Serializable {
|
||||
@ApiModelProperty(value = "一级组织ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
private String billNumber;
|
||||
}
|
||||
+2
-1
@@ -176,5 +176,6 @@ public class BusinessDocument extends BaseVOEntity{
|
||||
private String salesmanId;
|
||||
@ApiModelProperty("业务员名称")
|
||||
private String salesmanName;
|
||||
|
||||
@ApiModelProperty("税率")
|
||||
private String taxRate;
|
||||
}
|
||||
+2
@@ -181,4 +181,6 @@ public class BusinessDocumentPO extends BaseVOEntity{
|
||||
private String salesmanId;
|
||||
@ApiModelProperty("业务员名称")
|
||||
private String salesmanName;
|
||||
@ApiModelProperty("税率")
|
||||
private String taxRate;
|
||||
}
|
||||
+2
@@ -201,4 +201,6 @@ public class BusinessDocumentDO extends BaseVOEntity{
|
||||
private String salesmanId;
|
||||
@ApiModelProperty("业务员名称")
|
||||
private String salesmanName;
|
||||
@ApiModelProperty("税率")
|
||||
private String taxRate;
|
||||
}
|
||||
@@ -58,6 +58,10 @@ public class PaymentWallet extends BaseVOEntity{
|
||||
@Excel(name = "手机号")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty("银行卡号")
|
||||
@Excel(name = "银行卡号")
|
||||
private String bankCardNo;
|
||||
|
||||
@ApiModelProperty("支付方式编码")
|
||||
@Excel(name = "支付方式编码")
|
||||
private String paymentMethodCode;
|
||||
@@ -71,4 +75,4 @@ public class PaymentWallet extends BaseVOEntity{
|
||||
private Long paymentManageId;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+5
-1
@@ -57,6 +57,10 @@ public class PaymentWalletPO extends BaseVOEntity{
|
||||
@Excel(name = "手机号")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty("银行卡号")
|
||||
@Excel(name = "银行卡号")
|
||||
private String bankCardNo;
|
||||
|
||||
@ApiModelProperty("支付方式编码")
|
||||
@Excel(name = "支付方式编码")
|
||||
private String paymentMethodCode;
|
||||
@@ -71,4 +75,4 @@ public class PaymentWalletPO extends BaseVOEntity{
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+5
-1
@@ -57,6 +57,10 @@ public class PaymentWalletDO extends BaseVOEntity{
|
||||
@Excel(name = "手机号")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty("银行卡号")
|
||||
@Excel(name = "银行卡号")
|
||||
private String bankCardNo;
|
||||
|
||||
@ApiModelProperty("支付方式编码")
|
||||
@Excel(name = "支付方式编码")
|
||||
private String paymentMethodCode;
|
||||
@@ -74,4 +78,4 @@ public class PaymentWalletDO extends BaseVOEntity{
|
||||
|
||||
@ApiModelProperty(name = "权限菜单ID")
|
||||
private Long permissionMenuId;
|
||||
}
|
||||
}
|
||||
@@ -267,4 +267,9 @@ public class BillManageDTO extends BaseVOEntity{
|
||||
|
||||
@ApiModelProperty("业务员ID")
|
||||
private String salesmanName;
|
||||
|
||||
private String receivablePushTimeEnd;
|
||||
private String receivablePushTimeStart;
|
||||
private String paymentPushTimeEnd;
|
||||
private String paymentPushTimeStart;
|
||||
}
|
||||
+2
@@ -207,4 +207,6 @@ public class BusinessDocumentDTO extends BaseVOEntity{
|
||||
private String salesmanId;
|
||||
@ApiModelProperty("业务员名称")
|
||||
private String salesmanName;
|
||||
@ApiModelProperty("税率")
|
||||
private String taxRate;
|
||||
}
|
||||
+5
-1
@@ -56,6 +56,10 @@ public class PaymentWalletDTO extends BaseVOEntity{
|
||||
@Excel(name = "手机号")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty("银行卡号")
|
||||
@Excel(name = "银行卡号")
|
||||
private String bankCardNo;
|
||||
|
||||
@ApiModelProperty("支付方式编码")
|
||||
@Excel(name = "支付方式编码")
|
||||
private String paymentMethodCode;
|
||||
@@ -77,4 +81,4 @@ public class PaymentWalletDTO extends BaseVOEntity{
|
||||
|
||||
@ApiModelProperty(name = "权限菜单ID")
|
||||
private Long permissionMenuId;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user