mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-14 05:42:06 +08:00
移除executor模块资金管理相关代码
This commit is contained in:
-115
@@ -1,115 +0,0 @@
|
||||
package com.cf.imes.module.system.api.funds;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.common.util.Assert.AssertUtils;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import com.cf.imes.module.system.api.funds.dto.InvoiceTitleInfoDTO;
|
||||
import com.cf.imes.module.system.api.funds.dto.OrganAmountDTO;
|
||||
import com.cf.imes.module.system.dal.dataobject.funds.invoice.InvoiceTitleInfoDO;
|
||||
import com.cf.imes.module.system.dal.dataobject.funds.organamount.OrganAmountDO;
|
||||
import com.cf.imes.module.system.dal.mysql.funds.invoice.InvoiceTitleInfoMapper;
|
||||
import com.cf.imes.module.system.dal.mysql.funds.organamount.OrganAmountMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import static com.cf.imes.module.system.enums.ErrorCodeConstants.INVOICE_TITLE_NO_EXIST;
|
||||
import static com.cf.imes.module.system.enums.ErrorCodeConstants.ORGAN_AMOUNT_NO_EXIST;
|
||||
|
||||
|
||||
/**
|
||||
* @author 资金管理feign实现类
|
||||
*/
|
||||
@RestController
|
||||
@Validated
|
||||
@Slf4j
|
||||
public class SystemFundsApiImpl implements SystemFundsApi {
|
||||
|
||||
@Resource
|
||||
private OrganAmountMapper organAmountMapper;
|
||||
|
||||
|
||||
@Resource
|
||||
private InvoiceTitleInfoMapper invoiceTitleInfoMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> reduceOrganAmount(Long organId, BigDecimal invoiceAmount) {
|
||||
|
||||
OrganAmountDO organAmountDO = validateOrganAmountExists(organId);
|
||||
|
||||
BigDecimal invoiceableAmount = organAmountDO.getInvoiceableAmount().subtract(invoiceAmount);
|
||||
|
||||
if(invoiceableAmount.signum() < 0){
|
||||
invoiceableAmount = BigDecimal.valueOf(0);
|
||||
}
|
||||
|
||||
|
||||
organAmountDO.setInvoiceableAmount(invoiceableAmount);
|
||||
organAmountMapper.updateById(organAmountDO);
|
||||
|
||||
return CommonResult.success(Boolean.TRUE);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> addOrganAmount(Long organId, BigDecimal invoiceAmount) {
|
||||
|
||||
OrganAmountDO organAmountDO = validateOrganAmountExists(organId);
|
||||
|
||||
BigDecimal invoiceableAmount = organAmountDO.getInvoiceableAmount().add(invoiceAmount);
|
||||
|
||||
|
||||
organAmountDO.setInvoiceableAmount(invoiceableAmount);
|
||||
organAmountMapper.updateById(organAmountDO);
|
||||
|
||||
return CommonResult.success(Boolean.TRUE);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<OrganAmountDTO> getOrganAmount(Long organId) {
|
||||
|
||||
return CommonResult.success(BeanUtils.toBean(validateOrganAmountExists(organId),OrganAmountDTO.class));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public CommonResult<InvoiceTitleInfoDTO> getInvoiceTitle(Long invoiceTitleId) {
|
||||
|
||||
InvoiceTitleInfoDO invoiceTitleInfoDO = invoiceTitleInfoMapper.selectById(invoiceTitleId);
|
||||
|
||||
AssertUtils.notEmpty(invoiceTitleInfoDO,INVOICE_TITLE_NO_EXIST);
|
||||
|
||||
return CommonResult.success(BeanUtils.toBean(invoiceTitleInfoDO,InvoiceTitleInfoDTO.class));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private OrganAmountDO validateOrganAmountExists(Long organId) {
|
||||
|
||||
OrganAmountDO organAmountDO = organAmountMapper.selectOne(new LambdaUpdateWrapper<OrganAmountDO>()
|
||||
.eq(OrganAmountDO::getOrganId, organId)
|
||||
.eq(OrganAmountDO::getDeleted, false));
|
||||
|
||||
AssertUtils.notEmpty(organAmountDO,ORGAN_AMOUNT_NO_EXIST);
|
||||
|
||||
return organAmountDO;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
-6
@@ -56,12 +56,6 @@ public class OrganAmountDO extends BaseDO {
|
||||
*/
|
||||
private String currencyUnit;
|
||||
|
||||
|
||||
/**
|
||||
* 可开票金额
|
||||
*/
|
||||
private BigDecimal invoiceableAmount;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
|
||||
+1
-2
@@ -1,7 +1,6 @@
|
||||
package com.cf.imes.module.system.framework.rpc.config;
|
||||
|
||||
import com.cf.imes.module.executor.api.customplateno.OrderCustomPlateNoApi;
|
||||
import com.cf.imes.module.executor.api.funds.ExecutorFundsApi;
|
||||
import com.cf.imes.module.executor.api.orderProcess.OrderProcessApi;
|
||||
import com.cf.imes.module.executor.api.plan.OrderPlanApi;
|
||||
import com.cf.imes.module.infra.api.file.FileApi;
|
||||
@@ -10,6 +9,6 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableFeignClients(clients = {FileApi.class, WebSocketSenderApi.class, OrderProcessApi.class, OrderPlanApi.class, OrderCustomPlateNoApi.class, ExecutorFundsApi.class})
|
||||
@EnableFeignClients(clients = {FileApi.class, WebSocketSenderApi.class, OrderProcessApi.class, OrderPlanApi.class, OrderCustomPlateNoApi.class})
|
||||
public class RpcConfiguration {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user