mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-13 21:32:07 +08:00
资金管理接口,ES索引统一枚举
This commit is contained in:
+47
@@ -0,0 +1,47 @@
|
||||
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
@@ -0,0 +1,57 @@
|
||||
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
@@ -0,0 +1,43 @@
|
||||
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;
|
||||
|
||||
|
||||
|
||||
}
|
||||
+15
-3
@@ -2,17 +2,17 @@ package com.cf.imes.module.system.api.organ;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.module.system.api.organ.dto.OrgStatisticsReqDTO;
|
||||
import com.cf.imes.module.system.api.organ.dto.OrganizationDTO;
|
||||
import com.cf.imes.module.system.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
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.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -42,4 +42,16 @@ public interface OrganApi {
|
||||
@GetMapping(PREFIX + "/warn/org")
|
||||
@Operation(summary = "组织过期日期统计")
|
||||
CommonResult<Map<String, List<Object>>> getWarnToOrg();
|
||||
|
||||
|
||||
@GetMapping(PREFIX + "/organ-details")
|
||||
@Operation(summary = "根据组织ID获取组织的详细信息")
|
||||
CommonResult<OrganizationDTO> getOrganDetails(@RequestParam("organId") Long organId);
|
||||
|
||||
|
||||
@GetMapping(PREFIX + "/name-details")
|
||||
@Operation(summary = "根据组织名称获取组织的信息")
|
||||
CommonResult<List<OrganizationDTO>> getOrganDetailsByName(@RequestParam("organName") String organName);
|
||||
|
||||
|
||||
}
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package com.cf.imes.module.system.api.organ.dto;
|
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author 组织的信息
|
||||
*/
|
||||
@Schema(description = "RPC 服务 - 组织的信息 Resp DTO")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OrganizationDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1788458794035807655L;
|
||||
|
||||
|
||||
@Schema(description = "组织ID")
|
||||
private Long id;
|
||||
|
||||
|
||||
@Schema(description = "组织名称")
|
||||
private String name;
|
||||
|
||||
|
||||
|
||||
}
|
||||
+25
-1
@@ -420,6 +420,21 @@ public class ErrorCodeConstants {
|
||||
public static final ErrorCode INVOICE_FILE_UPLOAD_FAILED = new ErrorCode(1_002_043_005, "发票附件上传失败,请重新上传");
|
||||
public static final ErrorCode INVOICE_FILE_IS_NULL_NOT_DOWNLOAD = new ErrorCode(1_002_043_006, "发票附件不存在,无法下载");
|
||||
public static final ErrorCode INVOICE_FILE_DATA_ERROR = new ErrorCode(1_002_043_007, "发票附件下载失败,请重新下载或稍等重试");
|
||||
public static final ErrorCode PURCHASE_RECORD_NO_EXIST = new ErrorCode(1_002_043_008, "当前发票对应的购买记录有误,请删除重新创建发票");
|
||||
public static final ErrorCode INVOICE_TITLE_NO_EXIST = new ErrorCode(1_002_043_009, "发票抬头信息有误,请进行查看");
|
||||
public static final ErrorCode THIS_INVOICE_IS_FAIL = new ErrorCode(1_002_043_010, "当前发票以开票,无法再次进行开票");
|
||||
public static final ErrorCode THIS_INVOICE_IS_SUCCESS = new ErrorCode(1_002_043_011, "当前发票已经开票,无法再次进行开票");
|
||||
public static final ErrorCode PRODUCTS_IS_EXIST = new ErrorCode(1_002_043_012, "当前名称的产品已存在,无法新增产品");
|
||||
public static final ErrorCode PRODUCTS_NO_DELETE = new ErrorCode(1_002_043_013, "当前产品以上架,无法删除,请下架后再删除");
|
||||
public static final ErrorCode PRODUCTS_NO_UPDATE = new ErrorCode(1_002_043_014, "当前产品以上架,无法进行修改");
|
||||
public static final ErrorCode PRODUCTS_DETAIL_NO_UPDATE = new ErrorCode(1_002_043_016, "定价规则对应的产品已上架,无法进行修改");
|
||||
public static final ErrorCode ADVERTISEMENT_START_TIME_ERROR = new ErrorCode(1_003_043_017, "广告开始时间选择有误,应等于或大于当日");
|
||||
public static final ErrorCode ADVERTISEMENT_TIME_ERROR = new ErrorCode(1_003_043_018, "时间选择有误,结束时间应大于或等于开始时间");
|
||||
public static final ErrorCode ADVERTISEMENT_NAME_IS_EXIST = new ErrorCode(1_003_043_019, "当前名称的广告已存在,请重新命名");
|
||||
public static final ErrorCode ADVERTISEMENT_NO_DELETE = new ErrorCode(1_003_043_020, "当前广告已经发布,无法删除,请结束发布后再删除");
|
||||
public static final ErrorCode ADVERTISEMENT_REPUBLISH_NO_TIME = new ErrorCode(1_003_043_021, "广告重新发布,应重新选择投放时间");
|
||||
public static final ErrorCode RECHARGE_ACTIVE_NAME_IS_EXIST = new ErrorCode(1_004_043_022, "当前赠送金活动名称已存在,请修改");
|
||||
public static final ErrorCode IMAGE_UPLOAD_ERROR = new ErrorCode(1_004_043_023, "图片上传失败,请重试或重新选择图片");
|
||||
|
||||
//=========== 支付相关 1-002-044-000 ============
|
||||
public static final ErrorCode PAY_CHANNEL_NOT_SUPPORT = new ErrorCode(1_002_044_000, "暂不支持的支付渠道,请使用其他支付渠道");
|
||||
@@ -437,7 +452,7 @@ public class ErrorCodeConstants {
|
||||
public static final ErrorCode PRODUCTS_DETAIL_DURATION_EXIST = new ErrorCode(1_002_045_005, "存在当前时长的产品定价规则");
|
||||
public static final ErrorCode PRODUCTS_DETAIL_OUTPUT_EXIST = new ErrorCode(1_002_045_006, "存在当前产量的产品定价规则");
|
||||
public static final ErrorCode PRODUCTS_DURATION_NUM_ERR = new ErrorCode(1_002_045_007, "产品定价规则,时长数据设置有误");
|
||||
public static final ErrorCode PRODUCTS_DURATION_INT_ERR = new ErrorCode(1_002_045_008, "产品定价规则,时长数据为正整数");
|
||||
public static final ErrorCode PRODUCTS_DURATION_INT_ERR = new ErrorCode(1_002_045_008, "产品定价规则:时长必须为整数且大于 0");
|
||||
public static final ErrorCode PRODUCTS_DURATION_UNIT_ERR = new ErrorCode(1_002_045_009, "产品定价规则,时长单位设置有误");
|
||||
|
||||
//=========== 广告相关 1-002-046-000 ============
|
||||
@@ -451,4 +466,13 @@ public class ErrorCodeConstants {
|
||||
|
||||
public static final ErrorCode RECHARGE_ACTIVE_NO_EXIST = new ErrorCode(1_004_001_001, "当前赠送金活动不存在");
|
||||
|
||||
|
||||
|
||||
|
||||
//=========== 解析器管理 1-002-044-000 ============
|
||||
public static final ErrorCode PARSER_NO_EXIST = new ErrorCode(1_002_044_001, "当前解析器不存在,请重新选择");
|
||||
|
||||
public static final ErrorCode PARSER_TEMPLATE_NO_EXIST = new ErrorCode(1_002_044_002, "当前解析器模板不存在,请重新选择");
|
||||
|
||||
|
||||
}
|
||||
|
||||
+3
-28
@@ -5,7 +5,6 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 广告状态单位态枚举
|
||||
@@ -16,10 +15,9 @@ import java.util.Objects;
|
||||
@AllArgsConstructor
|
||||
public enum AdvertisementStatusEnum implements IntArrayValuable {
|
||||
|
||||
ALL(0, "全部"),
|
||||
UNPUBLISHED(1, "未发布"),
|
||||
PUBLISHED(2, "已发布"),
|
||||
ENDED(3, "已结束");
|
||||
UNPUBLISHED(0, "未发布"),
|
||||
PUBLISHED(1, "已发布"),
|
||||
ENDED(2, "已结束");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(AdvertisementStatusEnum::getStatus).toArray();
|
||||
|
||||
@@ -37,28 +35,5 @@ public enum AdvertisementStatusEnum implements IntArrayValuable {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
public static boolean isAll(String name) {
|
||||
return Objects.equals(ALL.name, name);
|
||||
}
|
||||
|
||||
public static boolean isUnpublished(String name) {
|
||||
return Objects.equals(UNPUBLISHED.name, name);
|
||||
}
|
||||
|
||||
public static boolean isPublished(String name) {
|
||||
return Objects.equals(PUBLISHED.name, name);
|
||||
}
|
||||
|
||||
public static boolean isEnded(String name) {
|
||||
return Objects.equals(ENDED.name, name);
|
||||
}
|
||||
|
||||
public static Integer getNameByStatus(String name) {
|
||||
for (AdvertisementStatusEnum e : values()) {
|
||||
if (e.getName().equals(name)) {
|
||||
return e.getStatus();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -16,9 +16,9 @@ import java.util.Objects;
|
||||
@AllArgsConstructor
|
||||
public enum DurationUnitEnum implements IntArrayValuable {
|
||||
|
||||
YEAR(0, "year"),
|
||||
MONTH(1, "month"),
|
||||
DAY(2, "day");
|
||||
YEAR(0, "年"),
|
||||
MONTH(1, "月"),
|
||||
DAY(2, "日");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(DurationUnitEnum::getStatus).toArray();
|
||||
|
||||
|
||||
+4
-4
@@ -16,10 +16,10 @@ import java.util.Objects;
|
||||
@AllArgsConstructor
|
||||
public enum ProductStatusEnum implements IntArrayValuable {
|
||||
|
||||
PRODUCT_ALL(0, "全部"),
|
||||
PRODUCT_WAITING_UPDATES(1, "待上架"),
|
||||
PRODUCT_UPDATES(2, "已上架"),
|
||||
PRODUCT_DELIS(3, "已下架");
|
||||
|
||||
PRODUCT_WAITING_UPDATES(0, "待上架"),
|
||||
PRODUCT_UPDATES(1, "已上架"),
|
||||
PRODUCT_DELIS(2, "已下架");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ProductStatusEnum::getStatus).toArray();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user