bms改造;
This commit is contained in:
+125
@@ -3,17 +3,27 @@ package com.mhd.bms.application.server.billingStatement;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.mhd.bms.application.server.billManage.BillManageApplicationService;
|
||||
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.mapper.BillingStatementMapper;
|
||||
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;
|
||||
import com.mhd.bms.domain.billingStatement.repository.todo.BillingStatementDO;
|
||||
import com.mhd.bms.domain.billingStatement.service.BillingStatementDomainService;
|
||||
import com.mhd.bms.domain.businessDocument.entity.BusinessDocument;
|
||||
import com.mhd.bms.domain.businessDocument.repository.facade.IBusinessDocumentService;
|
||||
import com.mhd.bms.domain.businessDocument.repository.po.BusinessDocumentPO;
|
||||
import com.mhd.bms.domain.settlementCustomers.entity.SettlementCustomers;
|
||||
import com.mhd.bms.domain.settlementCustomers.repository.mapper.SettlementCustomersMapper;
|
||||
import com.mhd.bms.domain.settlementCustomers.service.SettlementCustomersDomainService;
|
||||
import com.mhd.bms.domain.settlementCustomersParameters.entity.SettlementCustomersParameters;
|
||||
import com.mhd.bms.domain.settlementCustomersParameters.repository.mapper.SettlementCustomersParametersMapper;
|
||||
import com.mhd.bms.infrastructure.feign.vo.ContractManagePO;
|
||||
import com.mhd.bms.infrastructure.feign.vo.ExpenseAccountPO;
|
||||
import com.mhd.bms.interfaces.assembler.billingStatement.BillingStatementAssembler;
|
||||
@@ -39,6 +49,7 @@ import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
@@ -64,6 +75,16 @@ public class BillingStatementApplicationService {
|
||||
private BillManageApplicationService billManageApplicationService;
|
||||
@Autowired
|
||||
private BillManageDomainService billManageDomainService;
|
||||
@Autowired
|
||||
private IBusinessDocumentService businessDocumentService;
|
||||
@Autowired
|
||||
private IBillingStatementService billingStatementService;
|
||||
@Autowired
|
||||
private BillingStatementMapper billingStatementMapper;
|
||||
@Autowired
|
||||
private SettlementCustomersMapper settlementCustomersMapper;
|
||||
@Autowired
|
||||
private SettlementCustomersParametersMapper settlementCustomersParametersMapper;
|
||||
|
||||
|
||||
/**
|
||||
@@ -631,4 +652,108 @@ public class BillingStatementApplicationService {
|
||||
}
|
||||
return billingStatementDomainService.getBillDetailsList(billingStatementDO);
|
||||
}
|
||||
|
||||
public void pushBillManage(String shipperId) {
|
||||
SettlementCustomers settlementCustomers = settlementCustomersMapper.selectOne(new LambdaQueryWrapper<SettlementCustomers>()
|
||||
.eq(SettlementCustomers::getSettlementEntityId, shipperId)
|
||||
.eq(SettlementCustomers::getDelFlag, 1));
|
||||
if (ObjectUtil.isNull(settlementCustomers)) {
|
||||
//未找到结算对象
|
||||
return;
|
||||
}
|
||||
Long settlementCustomersId = settlementCustomers.getSettlementCustomersId();
|
||||
SettlementCustomersParameters settlementCustomersParameters = settlementCustomersParametersMapper.selectOne(new LambdaQueryWrapper<SettlementCustomersParameters>()
|
||||
.eq(SettlementCustomersParameters::getSettlementEntityId, settlementCustomersId));
|
||||
if (ObjectUtil.isNull(settlementCustomersParameters)) {
|
||||
//结算对象未配置参数
|
||||
return;
|
||||
}
|
||||
String content = settlementCustomersParameters.getContent();
|
||||
Map<String, Object> contentMap = JSON.parseObject(content, Map.class);
|
||||
//主费用开票策略
|
||||
String zfycl = (String) contentMap.get("zfycl");
|
||||
//附加费用开票策略
|
||||
String fjfykpcl = (String) contentMap.get("fjfykpcl");
|
||||
//合并开票
|
||||
Integer hbcp = (Integer) contentMap.get("hbcp");
|
||||
Boolean isMerge = false;
|
||||
if (hbcp == 1) {
|
||||
//判断是否合并开票
|
||||
isMerge = true;
|
||||
}
|
||||
|
||||
if (!isMerge) {
|
||||
List<BusinessDocument> list = businessDocumentService.list(new LambdaQueryWrapper<BusinessDocument>()
|
||||
.eq(BusinessDocument::getIsPush, 1)
|
||||
.eq(BusinessDocument::getSettlementCustomersId, settlementCustomersId)
|
||||
.eq(BusinessDocument::getBusinessState, 3)
|
||||
.eq(BusinessDocument::getDelFlag, 1));
|
||||
Map<String, List<BusinessDocument>> groupedMap = list.stream()
|
||||
.collect(Collectors.groupingBy(BusinessDocument::getOriginalBusinessNum));
|
||||
for (Map.Entry<String, List<BusinessDocument>> entry : groupedMap.entrySet()) {
|
||||
List<BusinessDocument> groupList = entry.getValue();
|
||||
String originalBusinessNum = entry.getKey();
|
||||
for (BusinessDocument businessDocument : groupList) {
|
||||
String businessFlow = businessDocument.getBusinessFlow();
|
||||
List<BillingStatement> billingStatements = billingStatementService.list(new LambdaQueryWrapper<BillingStatement>()
|
||||
.eq(BillingStatement::getBusinessFlow, businessFlow)
|
||||
.eq(BillingStatement::getBillingState, 1)
|
||||
.eq(BillingStatement::getDelFlag, 1));
|
||||
if (billingStatements != null && billingStatements.size() > 0) {
|
||||
List<BillingStatementADDVO> billingStatementADDVOS = new ArrayList<>();
|
||||
List<String> billingStatementIdList = new ArrayList<>();
|
||||
BigDecimal allAmount = BigDecimal.ZERO;
|
||||
BigDecimal allFreeFee = BigDecimal.ZERO;
|
||||
String settlementCurrency = "MOP";
|
||||
for (BillingStatement billingStatement : billingStatements) {
|
||||
settlementCurrency = billingStatement.getSettlementCurrency();
|
||||
String firstSubjectCode = billingStatement.getFirstSubjectCode();
|
||||
String firstSubjectName = billingStatement.getFirstSubjectName();
|
||||
Long organizationId = billingStatement.getOrganizationId();
|
||||
Map<String, Object> taxRateMap = billingStatementMapper.getTaxRate(organizationId, firstSubjectCode, firstSubjectName);
|
||||
//未找到费用科目
|
||||
if (taxRateMap == null) continue;
|
||||
Double taxRate = (Double) taxRateMap.get("taxRate");
|
||||
Long billingStatementId = billingStatement.getBillingStatementId();
|
||||
BillingStatementDTO billingStatementDTO = new BillingStatementDTO();
|
||||
billingStatementDTO.setBillingStatementIds(String.valueOf(billingStatementId));
|
||||
billingStatementDTO.setAuditOperation(1);
|
||||
//审核通过
|
||||
reviewBilling(billingStatementDTO);
|
||||
|
||||
BillingStatementADDVO billingStatementADDVO = new BillingStatementADDVO();
|
||||
BigDecimal amount = billingStatementDTO.getBillingAmount();
|
||||
BigDecimal taxAmount = amount.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 = amount.subtract(taxAmount);
|
||||
allAmount.add(amount);
|
||||
allFreeFee.add(taxFreeFee);
|
||||
billingStatementADDVO.setBillingStatementId(String.valueOf(billingStatementId));
|
||||
billingStatementADDVO.setTaxRate(taxRate);
|
||||
billingStatementADDVO.setTaxAmount(taxAmount);
|
||||
billingStatementADDVO.setTaxFreeFee(taxFreeFee);
|
||||
billingStatementADDVO.setFeeType(billingStatement.getServiceItemsName());
|
||||
billingStatementADDVO.setInvoiceItem(billingStatement.getFirstSubjectCode());
|
||||
billingStatementADDVO.setInvoiceItemName(billingStatement.getFirstSubjectName());
|
||||
billingStatementADDVOS.add(billingStatementADDVO);
|
||||
|
||||
billingStatementIdList.add(String.valueOf(billingStatementId));
|
||||
}
|
||||
String ids = String.join(",", billingStatementIdList);
|
||||
BillingStatementDTO billingStatementDTO1 = new BillingStatementDTO();
|
||||
billingStatementDTO1.setBillingStatementIds(ids);
|
||||
billingStatementDTO1.setBelongModuleCode("wms");
|
||||
billingStatementDTO1.setTaxAmount(allAmount);
|
||||
billingStatementDTO1.setBillingAmount(allAmount);
|
||||
billingStatementDTO1.setTaxFreeFee(allFreeFee);
|
||||
billingStatementDTO1.setSettlementCurrency(settlementCurrency);
|
||||
billingStatementDTO1.setBillingStatementList(billingStatementADDVOS);
|
||||
//生成账单
|
||||
generateBills(billingStatementDTO1);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -151,7 +151,7 @@ public class SettlementCustomersApplicationService {
|
||||
settlementCustomersDO.setOrganizationName(loginUser.getUserPo().getOrganizationName());
|
||||
Boolean insert = settlementCustomersDomainService.insert(settlementCustomersDO);
|
||||
if (insert) {
|
||||
List<SettlementCustomersNcConfigDTO> settlementCustomersNcConfigDTOList = settlementCustomersDO.getSettlementCustomersNcConfigDTOList();
|
||||
List<SettlementCustomersNcConfigDTO> settlementCustomersNcConfigDTOList = settlementCustomersDO.getSettlementCustomersNcConfigs();
|
||||
if (CollectionUtil.isNotEmpty(settlementCustomersNcConfigDTOList)) {
|
||||
for (SettlementCustomersNcConfigDTO settlementCustomersNcConfigDTO : settlementCustomersNcConfigDTOList) {
|
||||
SettlementCustomersNcConfig settlementCustomersNcConfig = new SettlementCustomersNcConfig();
|
||||
@@ -163,7 +163,7 @@ public class SettlementCustomersApplicationService {
|
||||
settlementCustomersNcConfigService.save(settlementCustomersNcConfig);
|
||||
}
|
||||
}
|
||||
List<SettlementCustomersParametersDTO> settlementCustomersParametersDTOList = settlementCustomersDO.getSettlementCustomersParametersDTOList();
|
||||
List<SettlementCustomersParametersDTO> settlementCustomersParametersDTOList = settlementCustomersDO.getSettlementCustomersParameters();
|
||||
if (CollectionUtil.isNotEmpty(settlementCustomersParametersDTOList)) {
|
||||
for (SettlementCustomersParametersDTO settlementCustomersParametersDTO : settlementCustomersParametersDTOList) {
|
||||
SettlementCustomersParameters settlementCustomersParameters = new SettlementCustomersParameters();
|
||||
@@ -260,7 +260,7 @@ public class SettlementCustomersApplicationService {
|
||||
//处理数据字典
|
||||
handleDict(settlementCustomersDO);
|
||||
|
||||
List<SettlementCustomersNcConfigDTO> settlementCustomersNcConfigDTOList = settlementCustomersDO.getSettlementCustomersNcConfigDTOList();
|
||||
List<SettlementCustomersNcConfigDTO> settlementCustomersNcConfigDTOList = settlementCustomersDO.getSettlementCustomersNcConfigs();
|
||||
if (CollectionUtil.isNotEmpty(settlementCustomersNcConfigDTOList)) {
|
||||
settlementCustomersNcConfigService.remove(new LambdaQueryWrapper<SettlementCustomersNcConfig>()
|
||||
.eq(SettlementCustomersNcConfig::getSettlementCustomersId, settlementCustomersDO.getSettlementCustomersId()));
|
||||
@@ -274,7 +274,7 @@ public class SettlementCustomersApplicationService {
|
||||
settlementCustomersNcConfigService.save(settlementCustomersNcConfig);
|
||||
}
|
||||
}
|
||||
List<SettlementCustomersParametersDTO> settlementCustomersParametersDTOList = settlementCustomersDO.getSettlementCustomersParametersDTOList();
|
||||
List<SettlementCustomersParametersDTO> settlementCustomersParametersDTOList = settlementCustomersDO.getSettlementCustomersParameters();
|
||||
if (CollectionUtil.isNotEmpty(settlementCustomersParametersDTOList)) {
|
||||
settlementCustomersParametersService.remove(new LambdaQueryWrapper<SettlementCustomersParameters>()
|
||||
.eq(SettlementCustomersParameters::getSettlementCustomersId, settlementCustomersDO.getSettlementCustomersId()));
|
||||
|
||||
@@ -222,4 +222,7 @@ public class BillingStatement extends BaseVOEntity{
|
||||
private BigDecimal billingUnitPrice;
|
||||
@ApiModelProperty("nc科目编码")
|
||||
private String ncSubjectCode;
|
||||
|
||||
@ApiModelProperty("仓储单号")
|
||||
private String wmsNumber;
|
||||
}
|
||||
+8
-1
@@ -1,6 +1,8 @@
|
||||
package com.mhd.bms.domain.billingStatement.repository.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mhd.bms.domain.billingStatement.entity.BillingStatement;
|
||||
import com.mhd.bms.domain.billingStatement.repository.po.BillingStatementCollectPO;
|
||||
@@ -42,4 +44,9 @@ public interface BillingStatementMapper extends BaseMapper<BillingStatement>
|
||||
* 根据账单id,查询流水明细列表
|
||||
*/
|
||||
List<BillingStatementPO> getDetailsByManageId(@Param("billManageId") Long billManageId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询税率
|
||||
*/
|
||||
Map<String,Object> getTaxRate(@Param("organizationId") Long organizationId, @Param("subjectCode") String subjectCode, @Param("subjectName") String subjectName);
|
||||
}
|
||||
+2
@@ -236,4 +236,6 @@ public class BillingStatementPO extends BaseVOEntity{
|
||||
private BigDecimal billingUnitPrice;
|
||||
@ApiModelProperty("nc科目编码")
|
||||
private String ncSubjectCode;
|
||||
@ApiModelProperty("仓储单号")
|
||||
private String wmsNumber;
|
||||
}
|
||||
+2
@@ -254,4 +254,6 @@ public class BillingStatementDO extends BaseVOEntity{
|
||||
private BigDecimal billingUnitPrice;
|
||||
@ApiModelProperty("nc科目编码")
|
||||
private String ncSubjectCode;
|
||||
@ApiModelProperty("仓储单号")
|
||||
private String wmsNumber;
|
||||
}
|
||||
+19
-8
@@ -396,7 +396,7 @@ public class BillingStatementDomainService {
|
||||
public Boolean generateFlow(BusinessDocumentPO businessDocumentPO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
throw new DigitalLogisticsException(UserError.TIMEOUT);
|
||||
// throw new DigitalLogisticsException(UserError.TIMEOUT);
|
||||
}
|
||||
BillingStatementDO billingStatementDO = new BillingStatementDO();
|
||||
String[] ignroreFields = new String[]{"billingStatementId","dataSources","createBy","createByName","createTime","updateBy","updateByName","updateTime"};
|
||||
@@ -414,13 +414,24 @@ public class BillingStatementDomainService {
|
||||
billingStatementDO.setBillingAmount(businessDocumentPO.getBillAmount());
|
||||
billingStatementDO.setBillingState(1);
|
||||
billingStatementDO.setDataSources(1);
|
||||
billingStatementDO.setCreateBy(loginUser.getUserPo().getUserId());
|
||||
billingStatementDO.setCreateByName(loginUser.getUserPo().getUserName());
|
||||
billingStatementDO.setCreateTime(new Date());
|
||||
billingStatementDO.setBillingFlow(businessDocumentPO.getBusinessFlow());
|
||||
billingStatementDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
billingStatementDO.setOrganizationId(loginUser.getUserPo().getOrganizationId());
|
||||
billingStatementDO.setOrganizationName(loginUser.getUserPo().getOrganizationName());
|
||||
if (loginUser==null) {
|
||||
billingStatementDO.setCreateBy(businessDocumentPO.getCreateBy());
|
||||
billingStatementDO.setCreateByName(businessDocumentPO.getCreateByName());
|
||||
billingStatementDO.setCreateTime(new Date());
|
||||
billingStatementDO.setBillingFlow(businessDocumentPO.getBusinessFlow());
|
||||
billingStatementDO.setTopOrganizationId(businessDocumentPO.getTopOrganizationId());
|
||||
billingStatementDO.setOrganizationId(businessDocumentPO.getOrganizationId());
|
||||
billingStatementDO.setOrganizationName(businessDocumentPO.getOrganizationName());
|
||||
} else {
|
||||
billingStatementDO.setCreateBy(loginUser.getUserPo().getUserId());
|
||||
billingStatementDO.setCreateByName(loginUser.getUserPo().getUserName());
|
||||
billingStatementDO.setCreateTime(new Date());
|
||||
billingStatementDO.setBillingFlow(businessDocumentPO.getBusinessFlow());
|
||||
billingStatementDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
billingStatementDO.setOrganizationId(loginUser.getUserPo().getOrganizationId());
|
||||
billingStatementDO.setOrganizationName(loginUser.getUserPo().getOrganizationName());
|
||||
}
|
||||
|
||||
//收款帐户信息
|
||||
billingStatementDO.setPaymentAccountId(businessDocumentPO.getPaymentAccountId()); //收款帐户ID
|
||||
billingStatementDO.setPaymentAccountName(businessDocumentPO.getPaymentAccountName()); //收款帐户名称
|
||||
|
||||
@@ -194,4 +194,9 @@ public class BusinessDocument extends BaseVOEntity{
|
||||
private BigDecimal billingUnitPrice;
|
||||
@ApiModelProperty("nc科目编码")
|
||||
private String ncSubjectCode;
|
||||
|
||||
@ApiModelProperty("是否推送")
|
||||
private Integer isPush;
|
||||
@ApiModelProperty("仓库类型")
|
||||
private String warehouseType;
|
||||
}
|
||||
+5
@@ -198,4 +198,9 @@ public class BusinessDocumentPO extends BaseVOEntity{
|
||||
private BigDecimal billingUnitPrice;
|
||||
@ApiModelProperty("nc科目编码")
|
||||
private String ncSubjectCode;
|
||||
|
||||
@ApiModelProperty("是否推送")
|
||||
private Integer isPush;
|
||||
@ApiModelProperty("仓库类型")
|
||||
private String warehouseType;
|
||||
}
|
||||
+4
-1
@@ -218,6 +218,9 @@ public class BusinessDocumentDO extends BaseVOEntity{
|
||||
private BigDecimal billingUnitPrice;
|
||||
@ApiModelProperty("nc科目编码")
|
||||
private String ncSubjectCode;
|
||||
|
||||
private Long billManageId;
|
||||
@ApiModelProperty("是否推送")
|
||||
private Integer isPush;
|
||||
@ApiModelProperty("仓库类型")
|
||||
private String warehouseType;
|
||||
}
|
||||
+21
-2
@@ -121,7 +121,13 @@ public class BusinessDocumentDomainService {
|
||||
public Boolean takeEffectByIds(List<Long> businessDocumentIdLongList) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
throw new DigitalLogisticsException(UserError.TIMEOUT);
|
||||
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);
|
||||
}
|
||||
if(businessDocumentIdLongList != null && businessDocumentIdLongList.size() > 0){
|
||||
LambdaUpdateWrapper<BusinessDocument> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
@@ -160,7 +166,20 @@ public class BusinessDocumentDomainService {
|
||||
public Boolean auditByIds(List<Long> businessDocumentIdLongList, BusinessDocumentDTO businessDocumentDTO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
throw new DigitalLogisticsException(UserError.TIMEOUT);
|
||||
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);
|
||||
}
|
||||
if(businessDocumentIdLongList != null && businessDocumentIdLongList.size() > 0){
|
||||
LambdaUpdateWrapper<BusinessDocument> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
|
||||
+2
-2
@@ -136,9 +136,9 @@ public class SettlementCustomersDO extends BaseVOEntity{
|
||||
@ApiModelProperty(name = "组织代码")
|
||||
private String orgCode;
|
||||
@ApiModelProperty("结算对象参数")
|
||||
private List<SettlementCustomersParametersDTO> settlementCustomersParametersDTOList;
|
||||
private List<SettlementCustomersParametersDTO> settlementCustomersParameters;
|
||||
|
||||
@ApiModelProperty("结算对象nc配置")
|
||||
private List<SettlementCustomersNcConfigDTO> settlementCustomersNcConfigDTOList;
|
||||
private List<SettlementCustomersNcConfigDTO> settlementCustomersNcConfigs;
|
||||
|
||||
}
|
||||
+2
-1
@@ -264,5 +264,6 @@ public class BillingStatementDTO extends BaseVOEntity{
|
||||
private BigDecimal billingUnitPrice;
|
||||
@ApiModelProperty("nc科目编码")
|
||||
private String ncSubjectCode;
|
||||
|
||||
@ApiModelProperty("仓储单号")
|
||||
private String wmsNumber;
|
||||
}
|
||||
+4
@@ -215,4 +215,8 @@ public class BusinessDocumentDTO extends BaseVOEntity{
|
||||
private String paymentAccountName;
|
||||
|
||||
private Long billManageId;
|
||||
@ApiModelProperty("仓库类型")
|
||||
private String warehouseType;
|
||||
@ApiModelProperty("是否推送")
|
||||
private Integer isPush;
|
||||
}
|
||||
+2
-2
@@ -137,7 +137,7 @@ public class SettlementCustomersDTO extends BaseVOEntity{
|
||||
private String orgCode;
|
||||
|
||||
@ApiModelProperty("结算对象参数")
|
||||
private List<SettlementCustomersParametersDTO> settlementCustomersParametersDTOList;
|
||||
private List<SettlementCustomersParametersDTO> settlementCustomersParameters;
|
||||
@ApiModelProperty("结算对象nc配置")
|
||||
private List<SettlementCustomersNcConfigDTO> settlementCustomersNcConfigDTOList;
|
||||
private List<SettlementCustomersNcConfigDTO> settlementCustomersNcConfigs;
|
||||
}
|
||||
@@ -21,6 +21,8 @@ import com.mhd.common.core.exception.ServiceException;
|
||||
import com.mhd.common.core.utils.StringUtils;
|
||||
import com.mhd.common.redis.enums.RedisLockTypeEnum;
|
||||
import com.mhd.common.redis.service.RedisLock;
|
||||
import com.xxl.job.core.context.XxlJobHelper;
|
||||
import com.xxl.job.core.handler.annotation.XxlJob;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.redisson.RedissonMultiLock;
|
||||
import org.redisson.api.RLock;
|
||||
@@ -327,4 +329,23 @@ public class BillingStatementApi extends BaseController {
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* 1. 简单任务示例(Bean模式)
|
||||
* 这里的 demoJobHandler 必须和调度中心配置一致
|
||||
*/
|
||||
@XxlJob("pushBillManage")
|
||||
public void pushBillManage() {
|
||||
// 获取任务参数(货主id)
|
||||
String shipperId = XxlJobHelper.getJobParam();
|
||||
logger.info("XXL-JOB 开始入库业务单推送bms计费流水,货主id参数:{}", shipperId);
|
||||
try {
|
||||
billingStatementApplicationService.pushBillManage(shipperId);
|
||||
// 设置任务执行结果
|
||||
XxlJobHelper.handleSuccess("入库业务单推送bms计费流水执行成功");
|
||||
} catch (Exception e) {
|
||||
logger.error("XXL-JOB 执行失败", e);
|
||||
XxlJobHelper.handleFail("入库业务单推送bms计费流水执行失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,10 +1,15 @@
|
||||
package com.mhd.bms.interfaces.facadeApi;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.mhd.bms.application.server.businessDocument.BusinessDocumentApplicationService;
|
||||
import com.mhd.bms.domain.businessDocument.entity.BusinessDocument;
|
||||
import com.mhd.bms.domain.businessDocument.repository.facade.IBusinessDocumentService;
|
||||
import com.mhd.bms.domain.businessDocument.repository.mapper.BusinessDocumentMapper;
|
||||
import com.mhd.common.core.domain.dto.BusinessDataPushDTO;
|
||||
import com.mhd.common.core.utils.IgnoreNullUtil;
|
||||
import com.mhd.system.api.domain.BusinessDocumentFeign;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -41,6 +46,9 @@ public class BusinessDocumentApi extends BaseController{
|
||||
@Resource
|
||||
private BusinessDocumentAssembler businessDocumentAssembler;
|
||||
|
||||
@Autowired
|
||||
private IBusinessDocumentService businessDocumentService;
|
||||
|
||||
/**
|
||||
* 分页查询业务单据列表
|
||||
*/
|
||||
@@ -79,6 +87,33 @@ public class BusinessDocumentApi extends BaseController{
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("保存业务单据")
|
||||
@PostMapping("/feignSave")
|
||||
public AjaxResult feignSave(@RequestBody BusinessDocumentFeign businessDocumentFeign)
|
||||
{
|
||||
try {
|
||||
BusinessDocument businessDocumentDO = new BusinessDocument();
|
||||
BeanUtils.copyProperties(businessDocumentFeign,businessDocumentDO);
|
||||
boolean save = businessDocumentService.save(businessDocumentDO);
|
||||
if (save) {
|
||||
Long businessDocumentId = businessDocumentDO.getBusinessDocumentId();
|
||||
BusinessDocumentDTO businessDocumentDTO = new BusinessDocumentDTO();
|
||||
businessDocumentDTO.setBusinessDocumentIds(String.valueOf(businessDocumentId));
|
||||
//生效
|
||||
takeEffectByIds(businessDocumentDTO);
|
||||
businessDocumentDTO.setAuditOperation(1);
|
||||
//审核
|
||||
auditByIds(businessDocumentDTO);
|
||||
}
|
||||
return toAjax(save);
|
||||
} catch (ServiceException e) {
|
||||
return AjaxResult.error(e.getMessage());
|
||||
} catch (Exception e){
|
||||
return AjaxResult.error("保存业务单据失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存业务单据
|
||||
*/
|
||||
|
||||
@@ -271,4 +271,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="getTaxRate" resultType="java.util.Map">
|
||||
SELECT
|
||||
RATE as "taxRate"
|
||||
FROM
|
||||
EXPENSE_ACCOUNT
|
||||
WHERE
|
||||
SUBJECT_CODE = #{subjectCode}
|
||||
AND SUBJECT_NAME = #{subjectName}
|
||||
AND DEL_FLAG = 1
|
||||
AND ORGANIZATION_ID = #{organizationId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user