#add 根据统一社会代码和年份查下该企业的营收和税收
parent
bff2f38abc
commit
a68e930e04
|
@ -1,18 +1,40 @@
|
|||
package org.sk.module.data.controller.finance;
|
||||
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import org.sk.module.data.dal.bo.finance.FinanceBO;
|
||||
import org.sk.module.data.dal.param.finance.FinanceParam;
|
||||
import org.sk.module.data.dal.vo.FinanceVO;
|
||||
import org.sk.module.data.service.finance.FinanceService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/finance")
|
||||
public class FinanceController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private FinanceService financeService;
|
||||
|
||||
|
||||
@GetMapping("/get")
|
||||
public String get() {
|
||||
return "hello wzc";
|
||||
}
|
||||
|
||||
@GetMapping("/getFinanceInfo")
|
||||
public CommonResult<FinanceVO> getFinanceInfo(@Valid @RequestBody FinanceParam financeParam) {
|
||||
|
||||
FinanceBO result = financeService.getFinanceByCreditCodeAndYear(financeParam.getCreditCode(),
|
||||
financeParam.getYear());
|
||||
|
||||
return CommonResult.success(BeanUtils.toBean(result, FinanceVO.class));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
package org.sk.module.data.dal.param.finance;
|
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Schema(description = "财务数据 Request VO")
|
||||
@Data
|
||||
public class FinanceParam {
|
||||
|
||||
@NotBlank(message = "社会统一代码不能为空")
|
||||
private String creditCode;
|
||||
|
||||
@NotBlank(message = "年份不能为空")
|
||||
private String year;
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package org.sk.module.data.dal.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class FinanceVO {
|
||||
|
||||
@Schema(description = "企业名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "企业")
|
||||
private String comName;
|
||||
|
||||
@Schema(description = "社会统一信用代码", requiredMode = Schema.RequiredMode.REQUIRED, example = "008x")
|
||||
private String creditCode;
|
||||
|
||||
@Schema(description = "营收(万)", requiredMode = Schema.RequiredMode.REQUIRED, example = "23.10")
|
||||
private BigDecimal Income;
|
||||
|
||||
@Schema(description = "税收(万)", requiredMode = Schema.RequiredMode.REQUIRED, example = "3")
|
||||
private BigDecimal tax;
|
||||
|
||||
@Schema(description = "年份", requiredMode = Schema.RequiredMode.REQUIRED, example = "2022")
|
||||
private String year;
|
||||
}
|
Loading…
Reference in New Issue