mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-14 13:42:07 +08:00
移除executor模块资金管理相关代码
This commit is contained in:
-47
@@ -1,47 +0,0 @@
|
||||
package com.cf.imes.module.system.api.funds;
|
||||
|
||||
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
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.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author 资金管理feign接口
|
||||
*/
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 晨丰:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 资金管理")
|
||||
public interface SystemFundsApi {
|
||||
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/funds";
|
||||
|
||||
|
||||
@GetMapping(PREFIX + "/amount/reduce")
|
||||
@Operation(summary = "减少组织可开票的金额")
|
||||
CommonResult<Boolean> reduceOrganAmount(@RequestParam("organId") Long organId,@RequestParam("invoiceAmount") BigDecimal invoiceAmount);
|
||||
|
||||
|
||||
@GetMapping(PREFIX + "/amount/add")
|
||||
@Operation(summary = "增加组织可开票的金额")
|
||||
CommonResult<Boolean> addOrganAmount(@RequestParam("organId") Long organId,@RequestParam("invoiceAmount") BigDecimal invoiceAmount);
|
||||
|
||||
|
||||
@GetMapping(PREFIX + "/amount/organ")
|
||||
@Operation(summary = "获取组织的资金信息")
|
||||
CommonResult<OrganAmountDTO> getOrganAmount(@RequestParam("organId") Long organId);
|
||||
|
||||
|
||||
@GetMapping(PREFIX + "/invoice/title")
|
||||
@Operation(summary = "获取发票的抬头信息")
|
||||
CommonResult<InvoiceTitleInfoDTO> getInvoiceTitle(@RequestParam("invoiceTitleId") Long invoiceTitleId);
|
||||
|
||||
|
||||
}
|
||||
-57
@@ -1,57 +0,0 @@
|
||||
package com.cf.imes.module.system.api.funds.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Schema(description = "RPC 服务 - 发票的抬头信息")
|
||||
@Data
|
||||
public class InvoiceTitleInfoDTO {
|
||||
|
||||
|
||||
@Schema(description = "抬头ID")
|
||||
private Long id;
|
||||
|
||||
|
||||
@Schema(description = "组织ID")
|
||||
private Long organId;
|
||||
|
||||
|
||||
@Schema(description = "发票抬头")
|
||||
private String invoiceTitle;
|
||||
|
||||
|
||||
@Schema(description = "开具类型")
|
||||
private Integer issueType;
|
||||
|
||||
|
||||
@Schema(description = "发票类型")
|
||||
private Integer invoiceType;
|
||||
|
||||
|
||||
@Schema(description = "纳税人识别号")
|
||||
private String taxpayerId;
|
||||
|
||||
|
||||
@Schema(description = "开户银行名称")
|
||||
private String bankName;
|
||||
|
||||
|
||||
@Schema(description = "开户银行账号")
|
||||
private String bankAccount;
|
||||
|
||||
|
||||
@Schema(description = "注册场所地址")
|
||||
private String registeredAddress;
|
||||
|
||||
|
||||
@Schema(description = "注册固定电话")
|
||||
private String fixedPhone;
|
||||
|
||||
|
||||
@Schema(description = "邮箱")
|
||||
private String email;
|
||||
|
||||
|
||||
}
|
||||
|
||||
-43
@@ -1,43 +0,0 @@
|
||||
package com.cf.imes.module.system.api.funds.dto;
|
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "RPC 服务 - 组织的资金信息")
|
||||
@Data
|
||||
public class OrganAmountDTO {
|
||||
|
||||
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
|
||||
@Schema(description = "组织ID")
|
||||
private Long organId;
|
||||
|
||||
|
||||
@Schema(description = "现金金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
|
||||
@Schema(description = "赠送金额")
|
||||
private BigDecimal giftAmount;
|
||||
|
||||
|
||||
@Schema(description = "货币类型")
|
||||
private Integer currency;
|
||||
|
||||
|
||||
@Schema(description = "货币单位")
|
||||
private String currencyUnit;
|
||||
|
||||
|
||||
@Schema(description = "可开票金额")
|
||||
private BigDecimal invoiceableAmount;
|
||||
|
||||
|
||||
|
||||
}
|
||||
-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