Commit d94adb2fb0a04d86b04ed5118a4c5d524b0a853d

Authored by yeqianyong
1 parent b430679e

楚江ERP-导出类型抽成枚举

... ... @@ -15,6 +15,7 @@ import com.lframework.xingyun.basedata.service.office.OfficeService;
15 15 import com.lframework.xingyun.basedata.service.product.ProductVarietyService;
16 16 import com.lframework.xingyun.basedata.service.workshop.WorkshopService;
17 17 import com.lframework.xingyun.sc.bo.customer.develop.GetCustomerDevelopPlanBo;
  18 +import com.lframework.xingyun.sc.enums.ExportType;
18 19 import com.lframework.xingyun.sc.excel.customer.CustomerDevelopExportTaskWorker;
19 20 import com.lframework.xingyun.sc.vo.customer.develop.QueryCustomerDevelopPlanVo;
20 21 import com.lframework.xingyun.sc.service.customer.CustomerDevelopPlanService;
... ... @@ -160,6 +161,7 @@ public class CustomerDevelopPlanController extends DefaultBaseController {
160 161 @HasPermission({"customer-dev-manage:customer-dev-plan:export"})
161 162 @PostMapping("/export")
162 163 public InvokeResult<Void> export(@Valid QueryCustomerDevelopPlanVo vo) {
  164 + vo.setExportType(ExportType.CUSTOMER_DEVELOP.getCode());
163 165 ExportTaskUtil.exportTask("客户开发信息", CustomerDevelopExportTaskWorker.class, vo);
164 166 return InvokeResultBuilder.success();
165 167 }
... ...
  1 +package com.lframework.xingyun.sc.enums;
  2 +
  3 +import com.baomidou.mybatisplus.annotation.EnumValue;
  4 +import com.lframework.starter.web.core.enums.BaseEnum;
  5 +
  6 +public enum ExportType implements BaseEnum<String> {
  7 +
  8 +
  9 + CUSTOMER_DEVELOP("CUSTOMER_DEVELOP", "客户开发"), CUSTOMER_CREDIT("CUSTOMER_CREDIT", "客户资信");
  10 +
  11 +
  12 + @EnumValue
  13 + private final String code;
  14 +
  15 + private final String desc;
  16 +
  17 + ExportType(String code, String desc) {
  18 + this.code = code;
  19 + this.desc = desc;
  20 + }
  21 +
  22 + @Override
  23 + public String getCode() {
  24 + return this.code;
  25 + }
  26 +
  27 + @Override
  28 + public String getDesc() {
  29 + return this.desc;
  30 + }
  31 +
  32 +
  33 + /**
  34 + * 通过code获取desc
  35 + * @param code 状态码
  36 + * @return 描述信息
  37 + */
  38 + public static String getDescByCode(String code) {
  39 + for (ExportType status : ExportType.values()) {
  40 + if (status.getCode().equals(code)) {
  41 + return status.getDesc();
  42 + }
  43 + }
  44 + return null;
  45 + }
  46 +}
... ...
... ... @@ -77,5 +77,5 @@ public class QueryCustomerDevelopPlanVo extends SortPageVo implements BaseVo, Se
77 77 * 导出类型
78 78 */
79 79 @ApiModelProperty("导出类型")
80   - private String exportType = "CUSTOMER_DEVELOP";
  80 + private String exportType;
81 81 }
... ...