部门端基础数据保存、基础数据导入模板下载、基础数据导入接口
| | |
| | | <dependency> |
| | | <groupId>cn.hutool</groupId> |
| | | <artifactId>hutool-all</artifactId> |
| | | <version>4.6.10</version> |
| | | </dependency> |
| | | |
| | | <!-- zxing生成二维码 --> |
| | |
| | | <version>1.2.78</version> |
| | | </dependency> |
| | | |
| | | <!-- easypoi --> |
| | | <dependency> |
| | | <groupId>cn.afterturn</groupId> |
| | | <artifactId>easypoi-base</artifactId> |
| | | <version>3.0.3</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.afterturn</groupId> |
| | | <artifactId>easypoi-web</artifactId> |
| | | <version>3.0.3</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.afterturn</groupId> |
| | | <artifactId>easypoi-annotation</artifactId> |
| | | <version>3.0.3</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot</artifactId> |
| | |
| | | <version>2.0.10</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.net.InetAddress; |
| | | import java.net.UnknownHostException; |
| | | |
| | | /** |
| | |
| | | "Swagger文档: \t\thttp://{}:{}/doc.html\n" + |
| | | "----------------------------------------------------------", |
| | | env.getProperty("spring.application.name", "后台"), |
| | | InetAddress.getLocalHost().getHostAddress(), |
| | | //InetAddress.getLocalHost().getHostAddress(), |
| | | "localhost", |
| | | env.getProperty("server.port", "8081")); |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.system.dto.BasicDataDTO; |
| | | import com.ruoyi.system.service.TbBasicDataService; |
| | | import com.ruoyi.system.vo.BasicDataReportingVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/3/19 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/current-quarter") |
| | | @RequiredArgsConstructor |
| | | @Api(tags = "当前季度数据相关接口") |
| | | public class CurrentQuarterController { |
| | | |
| | | private final TbBasicDataService tbBasicDataService; |
| | | |
| | | @ApiOperation("获取基础数据填报相关信息") |
| | | public R<BasicDataReportingVO> getBasicFields(@RequestParam("deptAreaCode") String deptAreaCode) { |
| | | //TODO 如果能够获取到当前登录用户,则不需要传区划代码 |
| | | try { |
| | | return tbBasicDataService.getBasicFields(deptAreaCode); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("获取基础数据填报相关信息异常", e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/save-basic-data") |
| | | @ApiOperation("保存当前季度数据") |
| | | public R<Void> saveBasicData(@RequestBody BasicDataDTO dto) { |
| | | try { |
| | | tbBasicDataService.saveBasicData(dto); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("保存当前季度数据异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | /** |
| | | * 导入模板下载 |
| | | */ |
| | | @GetMapping("/download") |
| | | @ApiOperation("模板下载") |
| | | public void downloadImportTemplate() { |
| | | try { |
| | | tbBasicDataService.downloadImportTemplate(); |
| | | } catch (Exception e) { |
| | | log.error("模板下载异常",e); |
| | | throw new ServiceException("模板下载失败,请联系管理员!"); |
| | | } |
| | | } |
| | | |
| | | @PostMapping("import") |
| | | @ApiOperation("基础数据导入") |
| | | public R<Void> importBasicData(@RequestPart("file") MultipartFile file) { |
| | | try { |
| | | tbBasicDataService.importBasicData(file); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("基础数据导入异常",e); |
| | | throw new ServiceException("基础数据导入失败,请联系管理员!"); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.web.core.config; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import com.ruoyi.common.config.RuoYiConfig; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.models.auth.In; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import com.ruoyi.common.config.RuoYiConfig; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.models.auth.In; |
| | | import springfox.documentation.builders.ApiInfoBuilder; |
| | | import springfox.documentation.builders.PathSelectors; |
| | | import springfox.documentation.builders.RequestHandlerSelectors; |
| | | import springfox.documentation.service.ApiInfo; |
| | | import springfox.documentation.service.ApiKey; |
| | | import springfox.documentation.service.AuthorizationScope; |
| | | import springfox.documentation.service.Contact; |
| | | import springfox.documentation.service.SecurityReference; |
| | | import springfox.documentation.service.SecurityScheme; |
| | | import springfox.documentation.service.*; |
| | | import springfox.documentation.spi.DocumentationType; |
| | | import springfox.documentation.spi.service.contexts.SecurityContext; |
| | | import springfox.documentation.spring.web.plugins.Docket; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Swagger2的接口配置 |
| | |
| | | // 用ApiInfoBuilder进行定制 |
| | | return new ApiInfoBuilder() |
| | | // 设置标题 |
| | | .title("标题:好莱坞小程序_接口文档") |
| | | .title("财政运行分析评估系统部门端接口文档") |
| | | // 描述 |
| | | .description("好莱坞小程序接口文档") |
| | | .description("财政运行分析评估系统部门端接口文档") |
| | | // 作者信息 |
| | | .contact(new Contact(ruoyiConfig.getName(), null, null)) |
| | | // 版本 |
| | |
| | | <setting name="logImpl" value="SLF4J" /> |
| | | <!-- 使用驼峰命名法转换字段 --> |
| | | <!-- <setting name="mapUnderscoreToCamelCase" value="true"/>--> |
| | | <!--开启枚举类自动转换--> |
| | | <setting name="defaultEnumTypeHandler" value="org.apache.ibatis.type.EnumOrdinalTypeHandler"/> |
| | | </settings> |
| | | |
| | | </configuration> |
| | |
| | | |
| | | import com.ruoyi.common.basic.PageDTO; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.BeanUtils; |
| | | import com.ruoyi.system.domain.TbBasicDataCategory; |
| | | import com.ruoyi.system.dto.BasicDataCategoryDTO; |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @PostMapping("/add") |
| | | @ApiOperation("添加") |
| | | public R<Void> add(@RequestBody @Validated BasicDataCategoryDTO dto) { |
| | | tbBasicDataCategoryService.add(dto); |
| | | try { |
| | | tbBasicDataCategoryService.add(dto); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("添加异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @PostMapping("/edit") |
| | | @ApiOperation("编辑") |
| | | public R<Void> add(@RequestBody @Validated BasicDataCategoryUpdateDTO dto) { |
| | | tbBasicDataCategoryService.update(dto); |
| | | try { |
| | | tbBasicDataCategoryService.update(dto); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("编辑异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation("删除") |
| | | public R<Void> delete(@RequestParam(value = "id") Integer id){ |
| | | tbBasicDataCategoryService.removeById(id); |
| | | try { |
| | | tbBasicDataCategoryService.removeById(id); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("删除异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @GetMapping("/get-details") |
| | | @ApiOperation("根据id获取详情") |
| | | public R<BasicDataCategoryVO> getDetails(@RequestParam(value = "id") Integer id){ |
| | | TbBasicDataCategory basicDataCategory = tbBasicDataCategoryService.getById(id); |
| | | BasicDataCategoryVO vo = BeanUtils.copyBean(basicDataCategory, BasicDataCategoryVO.class); |
| | | return R.ok(vo); |
| | | try { |
| | | TbBasicDataCategory basicDataCategory = tbBasicDataCategoryService.getById(id); |
| | | BasicDataCategoryVO vo = BeanUtils.copyBean(basicDataCategory, BasicDataCategoryVO.class); |
| | | return R.ok(vo); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("根据id获取详情异常", e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | @PostMapping("/show-hide") |
| | | @ApiOperation("隐藏显示操作") |
| | | public R<Void> showHide(@RequestBody ShowHideDTO dto) { |
| | | TbBasicDataCategory basicDataCategory = tbBasicDataCategoryService.getById(dto.getId()); |
| | | if (Objects.isNull(basicDataCategory)) { |
| | | throw new RuntimeException("非法参数"); |
| | | try { |
| | | tbBasicDataCategoryService.showHide(dto); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("隐藏显示操作异常", e); |
| | | return R.fail(); |
| | | } |
| | | tbBasicDataCategoryService.lambdaUpdate().set( TbBasicDataCategory::getStatus, dto.getStatus()).eq(TbBasicDataCategory::getId, dto.getId()).update(); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @PostMapping("/page") |
| | | @ApiOperation("分页条件查询") |
| | | public R<PageDTO<BasicDataCategoryVO>> page(@RequestBody BasicDataCategoryQuery query) { |
| | | return R.ok(tbBasicDataCategoryService.queryPage(query)); |
| | | try { |
| | | return R.ok(tbBasicDataCategoryService.queryPage(query)); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("分页条件查询异常", e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.basic.PageDTO; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.ShowStatusEnum; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.BeanUtils; |
| | | import com.ruoyi.system.domain.TbBasicDataCategory; |
| | | import com.ruoyi.system.dto.BasicDataConfigDTO; |
| | |
| | | @Slf4j |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @Api(tags = {"基础数据分类相关接口"}) |
| | | @Api(tags = {"基础数据配置相关接口"}) |
| | | @RequestMapping("/basic-data-config") |
| | | public class TbBasicDataConfigController { |
| | | |
| | |
| | | @GetMapping("/categories") |
| | | @ApiOperation(value = "获取分类列表") |
| | | public R<List<BasicDataCategoryVO>> queryBasicDataCategories() { |
| | | List<TbBasicDataCategory> list = tbBasicDataCategoryService.lambdaQuery().eq(TbBasicDataCategory::getStatus, ShowStatusEnum.SHOW).list(); |
| | | return R.ok(BeanUtils.copyList(list, BasicDataCategoryVO.class)); |
| | | try { |
| | | List<TbBasicDataCategory> list = tbBasicDataCategoryService.lambdaQuery().eq(TbBasicDataCategory::getStatus, ShowStatusEnum.SHOW).list(); |
| | | return R.ok(BeanUtils.copyList(list, BasicDataCategoryVO.class)); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("获取分类列表异常", e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | @PostMapping("/add") |
| | | @ApiOperation("添加") |
| | | public R<Void> add(@RequestBody @Validated BasicDataConfigDTO dto) { |
| | | tbBasicDataConfigService.add(dto); |
| | | try { |
| | | tbBasicDataConfigService.add(dto); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("添加异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @PostMapping("/edit") |
| | | @ApiOperation("编辑") |
| | | public R<Void> edit(@RequestBody @Validated BasicDataConfigUpdateDTO dto) { |
| | | tbBasicDataConfigService.edit(dto); |
| | | try { |
| | | tbBasicDataConfigService.edit(dto); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("编辑异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @GetMapping("/get-details") |
| | | @ApiOperation("获取详情") |
| | | public R<BasicDataConfigDetailVO> getDetails(Integer id) { |
| | | return R.ok(tbBasicDataConfigService.getDetails(id)); |
| | | try { |
| | | BasicDataConfigDetailVO details = tbBasicDataConfigService.getDetails(id); |
| | | return R.ok(details); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("获取详情异常", e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation("删除") |
| | | public R<Void> delete(Integer id) { |
| | | tbBasicDataConfigService.delete(id); |
| | | try { |
| | | tbBasicDataConfigService.delete(id); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("删除异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @PostMapping("show-hide") |
| | | @ApiOperation("隐藏显示操作") |
| | | public R<Void> showHide(@RequestBody ShowHideDTO dto) { |
| | | tbBasicDataConfigService.showHide(dto); |
| | | try { |
| | | tbBasicDataConfigService.showHide(dto); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("隐藏显示操作异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @PostMapping("/page") |
| | | @ApiOperation("分页条件查询") |
| | | public R<PageDTO<BasicDataConfigVO>> page(@RequestBody BasicDataConfigQuery query) { |
| | | return R.ok(tbBasicDataConfigService.queryPage(query)); |
| | | try { |
| | | PageDTO<BasicDataConfigVO> basicDataConfigVOPageDTO = tbBasicDataConfigService.queryPage(query); |
| | | return R.ok(basicDataConfigVOPageDTO); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("分页条件查询异常", e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | import com.ruoyi.common.basic.PageDTO; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.exception.GlobalException; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.BeanUtils; |
| | | import com.ruoyi.common.utils.ExcelUtil; |
| | | import com.ruoyi.system.domain.TbDept; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | ExcelUtil.exportExcel(list, "部门导入模板", "部门导入模板", TbDept.class, "部门导入模板", response); |
| | | } catch (Exception e) { |
| | | log.error("模板下载异常",e); |
| | | throw new GlobalException("模板下载失败,请联系管理员!"); |
| | | throw new ServiceException("模板下载失败,请联系管理员!"); |
| | | } |
| | | } |
| | | |
| | |
| | | */ |
| | | @PostMapping("/import") |
| | | @ApiOperation("导入") |
| | | public R<Object> importExcel(@RequestPart("file")MultipartFile file) { |
| | | public R<Void> importExcel(@RequestPart("file")MultipartFile file) { |
| | | try { |
| | | tbDeptService.importExcel(file); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("导入失败", e); |
| | | throw new RuntimeException(e.getMessage()); |
| | | } |
| | |
| | | @PostMapping("/page") |
| | | @ApiOperation("分页条件查询") |
| | | public R<PageDTO<DeptVO>> page(@RequestBody DeptQuery query) { |
| | | return R.ok(tbDeptService.queryPage(query)); |
| | | try { |
| | | return R.ok(tbDeptService.queryPage(query)); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("分页条件查询异常", e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | @GetMapping("/get-details") |
| | | @ApiOperation("根据id查询部门详情") |
| | | public R<DeptVO> getDetails(@RequestParam Integer id) { |
| | | TbDept dept = tbDeptService.getById(id); |
| | | return R.ok(BeanUtils.copyBean(dept,DeptVO.class)); |
| | | try { |
| | | TbDept dept = tbDeptService.getById(id); |
| | | return R.ok(BeanUtils.copyBean(dept,DeptVO.class)); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("根据id查询部门详情异常", e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | @PostMapping("/edit") |
| | | @ApiOperation("编辑") |
| | | public R<Object> edit(@RequestBody DeptUpdateDTO dto){ |
| | | TbDept tbDept = BeanUtils.copyBean(dto, TbDept.class); |
| | | tbDeptService.updateById(tbDept); |
| | | try { |
| | | TbDept tbDept = BeanUtils.copyBean(dto, TbDept.class); |
| | | tbDeptService.updateById(tbDept); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("编辑异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @PostMapping("/focus") |
| | | @ApiOperation("重点关注") |
| | | public R<Object> focus(@RequestBody DeptFocusDTO dto){ |
| | | TbDept dept = tbDeptService.getById(dto.getId()); |
| | | if (Objects.isNull(dept)) { |
| | | throw new RuntimeException("非法参数"); |
| | | } |
| | | tbDeptService.lambdaUpdate() |
| | | .eq(TbDept::getId, dto.getId()) |
| | | .set(TbDept::getFocussed, dto.getFocussed()) |
| | | .update(); |
| | | tbDeptService.focus(dto); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.ruoyi.common.basic.PageDTO; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.utils.BeanUtils; |
| | | import com.ruoyi.system.domain.TbFieldCategory; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.system.dto.FieldCategoryDTO; |
| | | import com.ruoyi.system.dto.ShowHideDTO; |
| | | import com.ruoyi.system.dto.update.FieldCategoryUpdateDTO; |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @PostMapping("/add") |
| | | @ApiOperation("添加") |
| | | public R<Object> add(@RequestBody @Validated FieldCategoryDTO dto) { |
| | | tbFieldCategoryService.add(dto); |
| | | try { |
| | | tbFieldCategoryService.add(dto); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("添加异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @GetMapping("/get-details") |
| | | @ApiOperation("根据id获取字段分类详情") |
| | | public R<FieldCategoryDetailVO> getById(@RequestParam(value = "id") Integer id) { |
| | | TbFieldCategory oneCategory = tbFieldCategoryService.getById(id); |
| | | if (Objects.isNull(oneCategory)) { |
| | | return R.ok(new FieldCategoryDetailVO()); |
| | | try { |
| | | FieldCategoryDetailVO vo = tbFieldCategoryService.getDetailsById(id); |
| | | return R.ok(vo); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("根据id获取字段分类详情异常", e); |
| | | return R.fail(); |
| | | } |
| | | FieldCategoryDetailVO vo = BeanUtils.copyBean(oneCategory, FieldCategoryDetailVO.class); |
| | | //根据一级分类id,查询二级分类 |
| | | List<TbFieldCategory> twoCategoryList = tbFieldCategoryService.lambdaQuery().eq(TbFieldCategory::getParentId, oneCategory.getId()).list(); |
| | | twoCategoryList.forEach(item->{ |
| | | FieldCategoryDetailVO twoCategoryVO = BeanUtils.copyBean(item, FieldCategoryDetailVO.class); |
| | | vo.getChildren().add(twoCategoryVO); |
| | | //根据二级分类id,查询三级分类 |
| | | List<TbFieldCategory> threeCategoryList = tbFieldCategoryService.lambdaQuery().eq(TbFieldCategory::getParentId, item.getId()).list(); |
| | | threeCategoryList.forEach(threeCategory->{ |
| | | FieldCategoryDetailVO threeCategoryVO = BeanUtils.copyBean(threeCategory, FieldCategoryDetailVO.class); |
| | | twoCategoryVO.getChildren().add(threeCategoryVO); |
| | | }); |
| | | }); |
| | | return R.ok(vo); |
| | | } |
| | | |
| | | /** |
| | |
| | | @PostMapping("/page") |
| | | @ApiOperation("分页条件查询") |
| | | public R<PageDTO<FieldCategoryVO>> page(@RequestBody FieldCategoryQuery query) { |
| | | return R.ok(tbFieldCategoryService.queryPage(query)); |
| | | try { |
| | | return R.ok(tbFieldCategoryService.queryPage(query)); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("分页条件查询异常", e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | @PostMapping("/show-hide") |
| | | @ApiOperation("隐藏显示操作") |
| | | public R<Void> showHide(@RequestBody ShowHideDTO dto) { |
| | | tbFieldCategoryService.showHide(dto); |
| | | try { |
| | | tbFieldCategoryService.showHide(dto); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("隐藏显示操作异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @DeleteMapping("/delete-children") |
| | | @ApiOperation("编辑页面删除子字段分类") |
| | | public R<Object> deleteChildren(@RequestParam(value = "id") Integer id){ |
| | | tbFieldCategoryService.deleteChildren(id); |
| | | try { |
| | | tbFieldCategoryService.deleteChildren(id); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("编辑页面删除子字段分类异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation("列表页面删除分类") |
| | | public R<Void> delete(@RequestParam(value = "id") Integer id){ |
| | | tbFieldCategoryService.delete(id); |
| | | try { |
| | | tbFieldCategoryService.delete(id); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("列表页面删除分类异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @PutMapping("/edit") |
| | | @ApiOperation("编辑") |
| | | public R<Object> edit(@RequestBody FieldCategoryUpdateDTO dto) { |
| | | tbFieldCategoryService.edit(dto); |
| | | try { |
| | | tbFieldCategoryService.edit(dto); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("编辑异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | |
| | | import com.ruoyi.common.basic.PageDTO; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.BeanUtils; |
| | | import com.ruoyi.system.domain.TbField; |
| | | import com.ruoyi.system.dto.FieldDTO; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @GetMapping("/categories") |
| | | @ApiOperation(value = "获取分类列表",notes = "一级分类id传0,二级分类传一级分类id,三级分类同理") |
| | | public R<List<FieldCategoryVO>> queryFieldCategories(@RequestParam Integer id) { |
| | | return R.ok(tbFieldCategoryService.queryFieldCategories(id)); |
| | | try { |
| | | return R.ok(tbFieldCategoryService.queryFieldCategories(id)); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("获取分类列表异常", e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | @PostMapping("/add") |
| | | @ApiOperation("添加字段") |
| | | public R<Void> add(@RequestBody @Validated FieldDTO dto){ |
| | | tbFieldService.add(dto); |
| | | try { |
| | | tbFieldService.add(dto); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("添加字段异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @GetMapping("/influenced-data") |
| | | @ApiOperation("隐藏字段,获取同步隐藏的基础数据") |
| | | public R<List<String>> influencedData(@RequestParam Integer id) { |
| | | return R.ok(tbFieldService.influencedData(id)); |
| | | public R<String> influencedData(@RequestParam Integer id) { |
| | | try { |
| | | return R.ok(tbFieldService.influencedData(id)); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("获取同步隐藏的基础数据异常", e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | /** |
| | | * 隐藏显示操作 |
| | |
| | | @PostMapping("/show-hide") |
| | | @ApiOperation("隐藏显示操作") |
| | | public R<Void> showHide(@RequestBody ShowHideDTO dto) { |
| | | tbFieldService.showHide(dto); |
| | | try { |
| | | tbFieldService.showHide(dto); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("隐藏显示操作异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @PostMapping("/edit") |
| | | @ApiOperation("编辑字段") |
| | | public R<Void> add(@RequestBody @Validated FieldUpdateDTO dto){ |
| | | TbField field = tbFieldService.getById(dto.getId()); |
| | | if (Objects.isNull(field)) { |
| | | throw new RuntimeException("参数异常"); |
| | | try { |
| | | tbFieldService.update(dto); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("编辑字段异常", e); |
| | | return R.fail(); |
| | | } |
| | | TbField tbField = BeanUtils.copyBean(dto, TbField.class); |
| | | tbFieldService.updateById(tbField); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @PostMapping("/page") |
| | | @ApiOperation("分页条件查询") |
| | | public R<PageDTO<FieldVO>> page(@RequestBody FieldQuery query) { |
| | | return R.ok(tbFieldService.queryPage(query)); |
| | | try { |
| | | return R.ok(tbFieldService.queryPage(query)); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("分页条件查询异常", e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | @GetMapping("/get-details") |
| | | @ApiOperation("获取详情") |
| | | public R<FieldVO> getDetails(@RequestParam Integer id){ |
| | | TbField field = tbFieldService.getById(id); |
| | | return R.ok(BeanUtils.copyBean(field, FieldVO.class)); |
| | | try { |
| | | TbField field = tbFieldService.getById(id); |
| | | return R.ok(BeanUtils.copyBean(field, FieldVO.class)); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("获取详情", e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation("删除") |
| | | public R<Void> delete(@RequestParam Integer id){ |
| | | tbFieldService.removeById(id); |
| | | try { |
| | | tbFieldService.removeById(id); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("获取详情", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | <artifactId>commons-jexl3</artifactId> |
| | | <version>3.3</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>easyexcel</artifactId> |
| | | <version>3.3.4</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | </project> |
New file |
| | |
| | | package com.ruoyi.common; |
| | | |
| | | public class NumberDisplaceChineseUtil { |
| | | |
| | | final static String[] unitArray= {"","十","百","千","万","十","百","千","亿","十","百","千","万"}; |
| | | final static String[] numArray = {"零","一","二","三","四","五","六","七","八","九"}; |
| | | |
| | | public static String numberToChinese(Integer number) throws Exception{ |
| | | if (number == null) { |
| | | return ""; |
| | | } |
| | | if (number == 0) { |
| | | return "零"; |
| | | } |
| | | char[] charArray= String.valueOf(number).toCharArray(); |
| | | int arrayLength = charArray.length; |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | |
| | | for(int i = 0; i<arrayLength; i++){ |
| | | int num = Integer.valueOf(charArray[i] + ""); |
| | | boolean isZero = num == 0; |
| | | String unit = unitArray[(arrayLength - 1) - i]; |
| | | if (isZero) { |
| | | continue; |
| | | }else { |
| | | if(i==0){ |
| | | stringBuilder.append(numArray[num]); |
| | | stringBuilder.append(unit); |
| | | }else{ |
| | | if(charArray[i-1]=='0'){ |
| | | stringBuilder.append("零"); |
| | | stringBuilder.append(numArray[num]); |
| | | stringBuilder.append(unit); |
| | | }else{ |
| | | stringBuilder.append(numArray[num]); |
| | | stringBuilder.append(unit); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | String numString = stringBuilder.toString(); |
| | | if(numString.length() > 1){ |
| | | if(numString.toCharArray()[0]== '一' && numString.toCharArray()[1] == '十'){ |
| | | return numString.substring(1); |
| | | } |
| | | } |
| | | return numString; |
| | | } |
| | | |
| | | public static void main(String[] args) throws Exception { |
| | | String s = numberToChinese(1234567890); |
| | | System.out.println(s); |
| | | } |
| | | } |
| | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 通过desc获取美剧 |
| | | * @param desc |
| | | * @return |
| | | */ |
| | | public static DisabledEnum getByDesc(String desc) { |
| | | DisabledEnum[] resultTypes = DisabledEnum.values(); |
| | | for (DisabledEnum resultType : resultTypes) { |
| | | if (desc.equals(resultType.getDesc())) { |
| | | return resultType; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.enums; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.EnumValue; |
| | | import com.fasterxml.jackson.annotation.JsonValue; |
| | | import lombok.Getter; |
| | | import lombok.AllArgsConstructor; |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum ReportingStatusEnum { |
| | | UNFILLED(1, "未填报"), |
| | | MISSING_DATA(2, "数据缺失"), |
| | | FILLED(3, "已填报"); |
| | | @EnumValue |
| | | private final Integer code; |
| | | @JsonValue |
| | | private final String desc; |
| | | |
| | | public static ReportingStatusEnum getEnumByCode(Integer code) { |
| | | for (ReportingStatusEnum e : ReportingStatusEnum.values()) { |
| | | if (e.code.equals(code)) { |
| | | return e; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | <!-- </exclusions>--> |
| | | </dependency> |
| | | |
| | | <!--easy-poi--> |
| | | <dependency> |
| | | <groupId>cn.afterturn</groupId> |
| | | <artifactId>easypoi-spring-boot-starter</artifactId> |
| | | <version>4.0.0</version> |
| | | <exclusions> |
| | | <exclusion> |
| | | <artifactId>guava</artifactId> |
| | | <groupId>com.google.guava</groupId> |
| | | </exclusion> |
| | | </exclusions> |
| | | <version>4.4.0</version> |
| | | </dependency> |
| | | |
| | | <!--mybatis-plus--> |
| | |
| | | <groupId>cn.hutool</groupId> |
| | | <artifactId>hutool-all</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>easyexcel</artifactId> |
| | | <version>3.3.4</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | </project> |
| | |
| | | package com.ruoyi.system.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.ruoyi.common.enums.ReportingStatusEnum; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | @TableField("quarter") |
| | | private String quarter; |
| | | |
| | | @ApiModelProperty(value = "所属部门id") |
| | | @ApiModelProperty(value = "区划代码") |
| | | @TableField("dept_area_code") |
| | | private String deptAreaCode; |
| | | |
| | |
| | | |
| | | @ApiModelProperty(value = "填报状态(1=未填报 2=数据缺失 3=已填报)") |
| | | @TableField("status") |
| | | private Integer status; |
| | | private ReportingStatusEnum status; |
| | | |
| | | @ApiModelProperty(value = "删除标志(0代表存在 1代表删除)") |
| | | @TableField("del_flag") |
| | |
| | | @TableField("field_value") |
| | | private String fieldValue; |
| | | |
| | | @ApiModelProperty(value = "删除标志(0代表存在 1代表删除)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private String delFlag; |
| | | |
| | | @ApiModelProperty(value = "创建人") |
| | | @TableField("create_by") |
| | | private String createBy; |
| | |
| | | |
| | | import cn.afterturn.easypoi.excel.annotation.Excel; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.ruoyi.common.enums.ShowStatusEnum; |
| | | import com.ruoyi.common.enums.DisabledEnum; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | |
| | | @ApiModelProperty(value = "县级标志(不包含直辖市的区 0:否 1:是)") |
| | | @TableField("county_flag") |
| | | @Excel(name = "县级标志 是/否",replace = {"是_1","否_2"}) |
| | | private ShowStatusEnum countyFlag; |
| | | @Excel(name = "县级标志 是/否",replace = {"是_1","否_0"}) |
| | | private DisabledEnum countyFlag; |
| | | |
| | | @ApiModelProperty(value = "负责人") |
| | | @TableField("person_in_charge") |
New file |
| | |
| | | package com.ruoyi.system.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/3/21 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "当前季度基础数据数据传输对象") |
| | | public class BasicDataDTO { |
| | | |
| | | //TODO 登录功能好了之后删掉 |
| | | @ApiModelProperty(value = "区划代码") |
| | | private String deptAreaCode; |
| | | |
| | | @ApiModelProperty(value = "转移支付规模") |
| | | private String transferPaymentScale; |
| | | |
| | | @ApiModelProperty(value = "当期GDP") |
| | | private String currentGdp; |
| | | |
| | | @ApiModelProperty(value = "动态字段") |
| | | private List<BasicDataFieldDTO> fields = new ArrayList<>(); |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/3/21 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "当前季度基础数据字段数据传输对象") |
| | | public class BasicDataFieldDTO { |
| | | |
| | | @ApiModelProperty(value = "字段id") |
| | | private Integer fieldId; |
| | | |
| | | @ApiModelProperty(value = "字段值") |
| | | private String fieldValue; |
| | | } |
| | |
| | | import cn.afterturn.easypoi.excel.entity.result.ExcelVerifyHandlerResult; |
| | | import cn.afterturn.easypoi.handler.inter.IExcelVerifyHandler; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.domain.TbDept; |
| | | import lombok.RequiredArgsConstructor; |
| | | import com.ruoyi.system.importExcel.DeptExcel; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | |
| | | * @date 2024/3/13 |
| | | */ |
| | | @Component |
| | | @RequiredArgsConstructor |
| | | public class DeptVerifyHandler implements IExcelVerifyHandler<TbDept> { |
| | | public class DeptVerifyHandler implements IExcelVerifyHandler<DeptExcel> { |
| | | @Override |
| | | public ExcelVerifyHandlerResult verifyHandler(TbDept obj) { |
| | | public ExcelVerifyHandlerResult verifyHandler(DeptExcel obj) { |
| | | ExcelVerifyHandlerResult result = new ExcelVerifyHandlerResult(true); |
| | | if (StringUtils.isEmpty(obj.getAreaName()) || StringUtils.isEmpty(obj.getAreaCode()) || |
| | | StringUtils.isEmpty(obj.getAreaLevel()) || StringUtils.isNull(obj.getCountyFlag()) || |
New file |
| | |
| | | package com.ruoyi.system.importExcel; |
| | | |
| | | import cn.afterturn.easypoi.excel.annotation.Excel; |
| | | import com.ruoyi.system.vo.FieldVO; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/3/21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ApiModel(value="基础数据导入Excel对象") |
| | | public class BasicDataExcel implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 8626000917362659046L; |
| | | |
| | | @ApiModelProperty(value = "季度") |
| | | @Excel(name = "填报季度") |
| | | private String quarter; |
| | | |
| | | @ApiModelProperty(value = "转移支付规模") |
| | | @Excel(name = "转移支付规模") |
| | | private String transferPaymentScale; |
| | | |
| | | @ApiModelProperty(value = "当期GDP") |
| | | @Excel(name = "当期GDP") |
| | | private String currentGdp; |
| | | private List<FieldVO> fieldVOS; |
| | | |
| | | @Excel(name = "备注") |
| | | private String remark; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.importExcel; |
| | | |
| | | import cn.afterturn.easypoi.excel.annotation.Excel; |
| | | import com.ruoyi.common.enums.DisabledEnum; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * 部门管理表 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-03-13 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ApiModel(value="部门导入Excel对象") |
| | | public class DeptExcel implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "部门地区") |
| | | @Excel(name = "部门地区") |
| | | private String areaName; |
| | | |
| | | @ApiModelProperty(value = "别名") |
| | | @Excel(name = "别名") |
| | | private String areaAlias; |
| | | |
| | | @ApiModelProperty(value = "区划代码") |
| | | @Excel(name = "区划代码") |
| | | private String areaCode; |
| | | |
| | | @ApiModelProperty(value = "级次(省、市、县)") |
| | | @Excel(name = "级次(省、市、县)") |
| | | private String areaLevel; |
| | | |
| | | @ApiModelProperty(value = "县级标志(不包含直辖市的区 0:否 1:是)") |
| | | @Excel(name = "县级标志 是/否",enumImportMethod = "getByDesc") |
| | | private DisabledEnum countyFlag; |
| | | |
| | | @ApiModelProperty(value = "负责人") |
| | | @Excel(name = "负责人") |
| | | private String personInCharge; |
| | | |
| | | @ApiModelProperty(value = "登录账号") |
| | | @Excel(name = "登录账号") |
| | | private String account; |
| | | |
| | | @ApiModelProperty(value = "联系电话") |
| | | @Excel(name = "联系电话") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "登录密码") |
| | | @Excel(name = "登录密码") |
| | | private String password; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.importExcel; |
| | | |
| | | import cn.afterturn.easypoi.excel.annotation.Excel; |
| | | import com.ruoyi.common.enums.FieldTypeEnum; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/3/21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ApiModel(value="动态字段导入Excel对象") |
| | | public class FieldExcel implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -3195855772711996257L; |
| | | |
| | | @Excel(name = "字段名") |
| | | private String fieldName; |
| | | |
| | | private FieldTypeEnum fieldType; |
| | | |
| | | private String levelOneCategory; |
| | | |
| | | private String levelTwoCategory; |
| | | |
| | | private String levelThreeCategory; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.listener; |
| | | |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.alibaba.excel.util.ListUtils; |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.google.common.collect.Lists; |
| | | import com.ruoyi.common.NumberDisplaceChineseUtil; |
| | | import com.ruoyi.common.enums.ReportingStatusEnum; |
| | | import com.ruoyi.common.enums.ShowStatusEnum; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.system.domain.TbBasicData; |
| | | import com.ruoyi.system.domain.TbBasicDataField; |
| | | import com.ruoyi.system.domain.TbDept; |
| | | import com.ruoyi.system.domain.TbField; |
| | | import com.ruoyi.system.service.TbBasicDataFieldService; |
| | | import com.ruoyi.system.service.TbBasicDataService; |
| | | import com.ruoyi.system.service.TbFieldService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Slf4j |
| | | public class BasicDataListener extends AnalysisEventListener<Map<Integer, String>> { |
| | | /** |
| | | * 每隔5条存储数据库,实际使用中可以100条,然后清理list ,方便内存回收 |
| | | */ |
| | | private static final int BATCH_COUNT = 10; |
| | | private List<Map<Integer, String>> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT); |
| | | public TbBasicDataService tbBasicDataService; |
| | | public List<TbField> fieldList; |
| | | public TbFieldService tbFieldService; |
| | | public TbDept dept; |
| | | public TbBasicDataFieldService tbBasicDataFieldService; |
| | | public BasicDataListener() { |
| | | } |
| | | |
| | | public BasicDataListener(TbBasicDataService tbBasicDataService, List<TbField> fieldList, TbFieldService tbFieldService, TbDept dept, TbBasicDataFieldService tbBasicDataFieldService) { |
| | | this.tbBasicDataService = tbBasicDataService; |
| | | this.fieldList = fieldList; |
| | | this.tbFieldService = tbFieldService; |
| | | this.dept = dept; |
| | | this.tbBasicDataFieldService = tbBasicDataFieldService; |
| | | } |
| | | |
| | | @Override |
| | | public void invoke(Map<Integer, String> data, AnalysisContext context) { |
| | | log.info("解析到一条数据:{}", JSON.toJSONString(data)); |
| | | cachedDataList.add(data); |
| | | if (cachedDataList.size() >= BATCH_COUNT) { |
| | | try { |
| | | saveData(); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void doAfterAllAnalysed(AnalysisContext context) { |
| | | try { |
| | | saveData(); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | log.info("所有数据解析完成!"); |
| | | } |
| | | |
| | | /** |
| | | * 加上存储数据库 |
| | | */ |
| | | private void saveData() throws Exception { |
| | | Map<Integer, String> headMap = cachedDataList.get(2); |
| | | Map<Integer, String> quarterMap = cachedDataList.get(4); |
| | | Map<Integer, String> dataMap = cachedDataList.get(5); |
| | | log.info("{}条数据,开始存储数据库!", cachedDataList.size()); |
| | | log.info("表头:{}", JSON.toJSONString(headMap)); |
| | | log.info("填写的数据:{}",JSON.toJSONString(dataMap)); |
| | | int remarkIndex = headMap.size()-1; |
| | | Map<Integer, String> dynamicFieldsMap = headMap.entrySet().stream().filter(entry -> { |
| | | return !(Lists.newArrayList(0, 1, 2, 3).contains(entry.getKey()) || entry.getKey() == remarkIndex); |
| | | }).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); |
| | | List<String> dynamicFields = new ArrayList<>(dynamicFieldsMap.values()); |
| | | List<String> collect = fieldList.stream().map(TbField::getFieldName).collect(Collectors.toList()); |
| | | boolean flag = new ArrayList<>(dynamicFields).containsAll(collect); |
| | | if (dynamicFields.size() != collect.size() || flag){ |
| | | throw new ServiceException("导入失败,请下载最新的导入模板"); |
| | | } |
| | | Date date = new Date(); |
| | | //当前所在季度 |
| | | int quarterOfYear = DateUtils.getQuarterOfYear(date); |
| | | String quarterOfYearStr = NumberDisplaceChineseUtil.numberToChinese(quarterOfYear); |
| | | LocalDate now = LocalDate.now(); |
| | | TbBasicData tbBasicData = new TbBasicData(); |
| | | tbBasicData.setQuarter(String.format("%s年%s",now.getYear(),quarterMap.get(1))); |
| | | tbBasicData.setTransferPaymentScale(dataMap.get(2)); |
| | | tbBasicData.setCurrentGdp(dataMap.get(3)); |
| | | tbBasicData.setDeptAreaCode(dept.getAreaCode()); |
| | | tbBasicData.setRemark(dataMap.get(remarkIndex)); |
| | | tbBasicData.setStatus(ReportingStatusEnum.MISSING_DATA); |
| | | tbBasicDataService.saveOrUpdate(tbBasicData); |
| | | tbBasicDataFieldService.remove(Wrappers.<TbBasicDataField>lambdaQuery().eq(TbBasicDataField::getBasicDataId, tbBasicData)); |
| | | for (Map.Entry<Integer, String> integerStringEntry : dynamicFieldsMap.entrySet()) { |
| | | Optional<TbField> tbField = tbFieldService.lambdaQuery().eq(TbField::getFieldName, integerStringEntry.getValue()) |
| | | .eq(TbField::getStatus, ShowStatusEnum.SHOW).oneOpt(); |
| | | if (tbField.isPresent()) { |
| | | TbBasicDataField tbBasicDataField = new TbBasicDataField(); |
| | | tbBasicDataField.setBasicDataId(tbBasicData.getId()); |
| | | tbBasicDataField.setFieldId(tbField.get().getId()); |
| | | tbBasicDataField.setFieldValue(dataMap.get(integerStringEntry.getKey())); |
| | | tbBasicDataFieldService.save(tbBasicDataField); |
| | | } |
| | | } |
| | | log.info("存储数据库成功!"); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.common.basic.PageDTO; |
| | | import com.ruoyi.system.domain.TbBasicDataCategory; |
| | | import com.ruoyi.system.dto.BasicDataCategoryDTO; |
| | | import com.ruoyi.system.dto.ShowHideDTO; |
| | | import com.ruoyi.system.dto.update.BasicDataCategoryUpdateDTO; |
| | | import com.ruoyi.system.query.BasicDataCategoryQuery; |
| | | import com.ruoyi.system.vo.BasicDataCategoryVO; |
| | |
| | | void update(BasicDataCategoryUpdateDTO dto); |
| | | |
| | | PageDTO<BasicDataCategoryVO> queryPage(BasicDataCategoryQuery query); |
| | | |
| | | void showHide(ShowHideDTO dto); |
| | | } |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.domain.TbBasicData; |
| | | import com.ruoyi.system.dto.BasicDataDTO; |
| | | import com.ruoyi.system.vo.BasicDataReportingVO; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TbBasicDataService extends IService<TbBasicData> { |
| | | |
| | | R<BasicDataReportingVO> getBasicFields(String deptAreaCode) throws Exception; |
| | | |
| | | void saveBasicData(BasicDataDTO dto); |
| | | |
| | | void downloadImportTemplate() throws Exception; |
| | | |
| | | void importBasicData(MultipartFile file) throws IOException; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.basic.PageDTO; |
| | | import com.ruoyi.system.domain.TbDept; |
| | | import com.ruoyi.system.dto.update.DeptFocusDTO; |
| | | import com.ruoyi.system.query.DeptQuery; |
| | | import com.ruoyi.system.vo.DeptVO; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | |
| | | PageDTO<DeptVO> queryPage(DeptQuery query); |
| | | |
| | | void importExcel(MultipartFile file) throws Exception; |
| | | |
| | | void focus(DeptFocusDTO dto); |
| | | } |
| | |
| | | import com.ruoyi.system.dto.ShowHideDTO; |
| | | import com.ruoyi.system.dto.update.FieldCategoryUpdateDTO; |
| | | import com.ruoyi.system.query.FieldCategoryQuery; |
| | | import com.ruoyi.system.vo.FieldCategoryDetailVO; |
| | | import com.ruoyi.system.vo.FieldCategoryVO; |
| | | |
| | | import java.util.List; |
| | |
| | | |
| | | List<FieldCategoryVO> queryFieldCategories(Integer id); |
| | | |
| | | FieldCategoryDetailVO getDetailsById(Integer id); |
| | | } |
| | |
| | | import com.ruoyi.system.domain.TbField; |
| | | import com.ruoyi.system.dto.FieldDTO; |
| | | import com.ruoyi.system.dto.ShowHideDTO; |
| | | import com.ruoyi.system.dto.update.FieldUpdateDTO; |
| | | import com.ruoyi.system.query.FieldQuery; |
| | | import com.ruoyi.system.vo.FieldVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | PageDTO<FieldVO> queryPage(FieldQuery query); |
| | | |
| | | List<String> influencedData(Integer id); |
| | | String influencedData(Integer id); |
| | | |
| | | void update(FieldUpdateDTO dto); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.basic.PageDTO; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.BeanUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.domain.TbBasicDataCategory; |
| | | import com.ruoyi.system.dto.BasicDataCategoryDTO; |
| | | import com.ruoyi.system.dto.ShowHideDTO; |
| | | import com.ruoyi.system.dto.update.BasicDataCategoryUpdateDTO; |
| | | import com.ruoyi.system.mapper.TbBasicDataCategoryMapper; |
| | | import com.ruoyi.system.query.BasicDataCategoryQuery; |
| | |
| | | .page(new Page<>(query.getPageNum(), query.getPageSize())); |
| | | return PageDTO.of(page,BasicDataCategoryVO.class); |
| | | } |
| | | |
| | | @Override |
| | | public void showHide(ShowHideDTO dto) { |
| | | TbBasicDataCategory basicDataCategory = this.getById(dto.getId()); |
| | | if (Objects.isNull(basicDataCategory)) { |
| | | throw new ServiceException("非法参数"); |
| | | } |
| | | this.lambdaUpdate().set( TbBasicDataCategory::getStatus, dto.getStatus()).eq(TbBasicDataCategory::getId, dto.getId()).update(); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.common.basic.PageDTO; |
| | | import com.ruoyi.common.enums.CalculateTypeEnum; |
| | | import com.ruoyi.common.enums.ShowStatusEnum; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.BeanUtils; |
| | | import com.ruoyi.common.utils.Checker; |
| | | import com.ruoyi.common.utils.CollUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.domain.TbBasicDataConfig; |
| | |
| | | public void add(BasicDataConfigDTO dto) { |
| | | TbBasicDataConfig tbBasicDataConfig = BeanUtils.copyBean(dto, TbBasicDataConfig.class); |
| | | //参数校验 |
| | | Integer calculateType = tbBasicDataConfig.getCalculateType().getCode(); |
| | | CalculateTypeEnum calculateType = tbBasicDataConfig.getCalculateType(); |
| | | List<CalculateDTO> dtoList = dto.getDtoList(); |
| | | if (CalculateTypeEnum.NUMBER.getCode().equals(calculateType) && StringUtils.isBlank(dto.getNumberCalculateFormula())) { |
| | | throw new RuntimeException("计算公式不能为空"); |
| | | if (CalculateTypeEnum.NUMBER.equals(calculateType) && StringUtils.isBlank(dto.getNumberCalculateFormula())) { |
| | | throw new ServiceException("计算公式不能为空"); |
| | | } |
| | | if ((CalculateTypeEnum.TEXT.getCode().equals(calculateType) || CalculateTypeEnum.PERCENTAGE.getCode().equals(calculateType)) |
| | | && CollUtils.isEmpty(dtoList)) { |
| | | throw new RuntimeException("计算公式不能为空"); |
| | | boolean verify = (CalculateTypeEnum.TEXT.equals(calculateType) || CalculateTypeEnum.PERCENTAGE.equals(calculateType)) && CollUtils.isNotEmpty(dtoList); |
| | | if (verify) { |
| | | CollUtils.check(dto.getDtoList(), new Checker<CalculateDTO>() { |
| | | @Override |
| | | public void check(CalculateDTO data) { |
| | | if (StringUtils.isBlank(data.getKey())) { |
| | | throw new ServiceException("基础数据配置key不能为空"); |
| | | } |
| | | if (StringUtils.isBlank(data.getValue())) { |
| | | throw new ServiceException("基础数据配置value不能为空"); |
| | | } |
| | | } |
| | | }); |
| | | } else { |
| | | throw new ServiceException("计算公式不能为空"); |
| | | } |
| | | this.save(tbBasicDataConfig); |
| | | if ((CalculateTypeEnum.TEXT.getCode().equals(calculateType) || CalculateTypeEnum.PERCENTAGE.getCode().equals(calculateType))) { |
| | | if (verify) { |
| | | List<TbBasicDataConfigDetail> details = BeanUtils.copyList(dtoList, TbBasicDataConfigDetail.class); |
| | | List<TbBasicDataConfigDetail> collect = details.stream().peek(item -> item.setBasicDataConfigId(tbBasicDataConfig.getId())).collect(Collectors.toList()); |
| | | tbBasicDataConfigDetailService.saveBatch(collect); |
| | |
| | | public void edit(BasicDataConfigUpdateDTO dto) { |
| | | TbBasicDataConfig tbBasicDataConfig = BeanUtils.copyBean(dto, TbBasicDataConfig.class); |
| | | //参数校验 |
| | | Integer calculateType = tbBasicDataConfig.getCalculateType().getCode(); |
| | | CalculateTypeEnum calculateType = tbBasicDataConfig.getCalculateType(); |
| | | List<CalculateDTO> dtoList = dto.getDtoList(); |
| | | if (CalculateTypeEnum.NUMBER.getCode().equals(calculateType) && StringUtils.isBlank(dto.getNumberCalculateFormula())) { |
| | | throw new RuntimeException("计算公式不能为空"); |
| | | if (CalculateTypeEnum.NUMBER.equals(calculateType) && StringUtils.isBlank(dto.getNumberCalculateFormula())) { |
| | | throw new ServiceException("计算公式不能为空"); |
| | | } |
| | | if ((CalculateTypeEnum.TEXT.getCode().equals(calculateType) || CalculateTypeEnum.PERCENTAGE.getCode().equals(calculateType)) |
| | | && CollUtils.isEmpty(dtoList)) { |
| | | throw new RuntimeException("计算公式不能为空"); |
| | | boolean verify = CalculateTypeEnum.TEXT.equals(calculateType) || CalculateTypeEnum.PERCENTAGE.equals(calculateType); |
| | | if (verify && CollUtils.isEmpty(dtoList)) { |
| | | throw new ServiceException("计算公式不能为空"); |
| | | } |
| | | this.updateById(tbBasicDataConfig); |
| | | if ((CalculateTypeEnum.TEXT.getCode().equals(calculateType) || CalculateTypeEnum.PERCENTAGE.getCode().equals(calculateType))) { |
| | | if (verify) { |
| | | //删除原来的配置信息,重新添加新的 |
| | | tbBasicDataConfigDetailService.lambdaUpdate().eq(TbBasicDataConfigDetail::getBasicDataConfigId, tbBasicDataConfig.getId()).remove(); |
| | | List<TbBasicDataConfigDetail> details = BeanUtils.copyList(dtoList, TbBasicDataConfigDetail.class); |
| | |
| | | public BasicDataConfigDetailVO getDetails(Integer id) { |
| | | TbBasicDataConfig config = this.getById(id); |
| | | if (Objects.isNull(config)) { |
| | | throw new RuntimeException("非法参数"); |
| | | throw new ServiceException("非法参数"); |
| | | } |
| | | BasicDataConfigDetailVO vo = BeanUtils.copyBean(config, BasicDataConfigDetailVO.class); |
| | | Integer code = vo.getCalculateType().getCode(); |
| | |
| | | public void delete(Integer id) { |
| | | TbBasicDataConfig config = this.getById(id); |
| | | if (Objects.isNull(config)) { |
| | | throw new RuntimeException("非法参数"); |
| | | throw new ServiceException("非法参数"); |
| | | } |
| | | this.removeById(id); |
| | | } |
| | |
| | | public void showHide(ShowHideDTO dto) { |
| | | TbBasicDataConfig config = this.getById(dto.getId()); |
| | | if (Objects.isNull(config)) { |
| | | throw new RuntimeException("非法参数"); |
| | | throw new ServiceException("非法参数"); |
| | | } |
| | | if (ShowStatusEnum.SHOW.equals(dto.getStatus())) { |
| | | //查询改配置所使用字段状态 |
| | |
| | | List<TbField> list = fieldMapper.selectList(Wrappers.<TbField>lambdaQuery().in(TbField::getId, Arrays.asList(split)).eq(TbField::getStatus, ShowStatusEnum.HIDE)); |
| | | if (CollUtils.isNotEmpty(list)) { |
| | | String fieldNames = list.stream().map(TbField::getFieldName).collect(Collectors.joining(",")); |
| | | throw new RuntimeException(String.format("字段“%s”已被隐藏,请重新配置后再次操作!", fieldNames)); |
| | | throw new ServiceException(String.format("字段“%s”已被隐藏,请重新配置后再次操作!", fieldNames)); |
| | | } |
| | | } |
| | | this.lambdaUpdate().set( TbBasicDataConfig::getStatus, dto.getStatus()).eq(TbBasicDataConfig::getId, dto.getId()).update(); |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.google.common.collect.Lists; |
| | | import com.ruoyi.common.NumberDisplaceChineseUtil; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.ReportingStatusEnum; |
| | | import com.ruoyi.common.enums.ShowStatusEnum; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.BeanUtils; |
| | | import com.ruoyi.common.utils.CollUtils; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.system.domain.TbBasicData; |
| | | import com.ruoyi.system.domain.TbBasicDataField; |
| | | import com.ruoyi.system.domain.TbDept; |
| | | import com.ruoyi.system.domain.TbField; |
| | | import com.ruoyi.system.dto.BasicDataDTO; |
| | | import com.ruoyi.system.listener.BasicDataListener; |
| | | import com.ruoyi.system.mapper.TbBasicDataMapper; |
| | | import com.ruoyi.system.service.TbBasicDataFieldService; |
| | | import com.ruoyi.system.service.TbBasicDataService; |
| | | import com.ruoyi.system.service.TbDeptService; |
| | | import com.ruoyi.system.service.TbFieldService; |
| | | import com.ruoyi.system.vo.BasicDataReportingVO; |
| | | import com.ruoyi.system.vo.FieldReportingVO; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.time.Instant; |
| | | import java.time.LocalDate; |
| | | import java.time.ZoneId; |
| | | import java.util.*; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author mitao |
| | | * @since 2024-03-13 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class TbBasicDataServiceImpl extends ServiceImpl<TbBasicDataMapper, TbBasicData> implements TbBasicDataService { |
| | | |
| | | private final TbDeptService tbDeptService; |
| | | private final HttpServletResponse response; |
| | | private final TbFieldService tbFieldService; |
| | | private final TbBasicDataFieldService tbBasicDataFieldService; |
| | | |
| | | @Override |
| | | public R<BasicDataReportingVO> getBasicFields(String deptAreaCode) throws Exception { |
| | | BasicDataReportingVO vo = new BasicDataReportingVO(); |
| | | //校验区划代码 |
| | | TbDept dept = tbDeptService.getOne(Wrappers.<TbDept>lambdaQuery().eq(TbDept::getAreaCode, deptAreaCode)); |
| | | if (Objects.isNull(dept)) { |
| | | throw new ServiceException(String.format("区划代码%s不存在", deptAreaCode)); |
| | | } |
| | | Date date = new Date(); |
| | | //当前所在季度 |
| | | int quarterOfYear = DateUtils.getQuarterOfYear(date); |
| | | String quarterOfYearStr = NumberDisplaceChineseUtil.numberToChinese(quarterOfYear); |
| | | Map<String, Date> quarterDate = DateUtils.getQuarterDate(date); |
| | | //当前季度开始 |
| | | Date quarterStart = quarterDate.get("first"); |
| | | //当前季度结束 |
| | | Date quarterEnd = quarterDate.get("last"); |
| | | //判断当前时间是否在季度初1-15号 |
| | | Instant instant = quarterStart.toInstant(); |
| | | LocalDate quarterStartLocalDate = instant.atZone(ZoneId.systemDefault()).toLocalDate(); |
| | | LocalDate fifteenDaysLimit = quarterStartLocalDate.plusDays(15); |
| | | LocalDate now = LocalDate.now(); |
| | | vo.setQuarter(String.format("%s年%s季度",now.getYear(),quarterOfYearStr)); |
| | | vo.setStatus(ReportingStatusEnum.UNFILLED); |
| | | //如果当前时间不在规定范围内:季度初1-15号 |
| | | if (now.isBefore(quarterStartLocalDate) || now.isAfter(fifteenDaysLimit)) { |
| | | return R.ok(vo,"请于季度初1-15号上传季度数据。"); |
| | | } |
| | | //查询是否有当前季度的填报记录 |
| | | TbBasicData basicData = this.getOne(Wrappers.<TbBasicData>lambdaQuery() |
| | | .eq(TbBasicData::getDeptAreaCode, dept.getAreaCode()) |
| | | .between(TbBasicData::getCreateTime, quarterStart,quarterEnd)); |
| | | //查询需要填写的字段 |
| | | List<TbField> list = tbFieldService.lambdaQuery().eq(TbField::getStatus, ShowStatusEnum.SHOW).list(); |
| | | if (CollUtils.isNotEmpty(list)) { |
| | | List<FieldReportingVO> fieldReportingVOS = BeanUtils.copyList(list, FieldReportingVO.class); |
| | | vo.setFields(fieldReportingVOS); |
| | | } |
| | | if (Objects.isNull(basicData)) { |
| | | vo.setQuarter(String.format("%s年%s季度",now.getYear(),quarterOfYearStr)); |
| | | vo.setStatus(ReportingStatusEnum.UNFILLED); |
| | | return R.ok(vo); |
| | | }else { |
| | | vo.setStatus(basicData.getStatus()); |
| | | //查询已填报数据 包含数据缺失和已填报 |
| | | List<TbBasicDataField> basicDataFields = tbBasicDataFieldService.lambdaQuery() |
| | | .eq(TbBasicDataField::getBasicDataId, basicData.getId()).list(); |
| | | if (CollUtils.isNotEmpty(basicDataFields)) { |
| | | Map<Integer, TbBasicDataField> fieldMap = basicDataFields.stream() |
| | | .collect(Collectors.toMap(TbBasicDataField::getFieldId, Function.identity())); |
| | | vo.getFields().forEach(item -> { |
| | | TbBasicDataField tbBasicDataField = fieldMap.get(item.getId()); |
| | | if (Objects.nonNull(tbBasicDataField)) { |
| | | item.setValue(tbBasicDataField.getFieldValue()); |
| | | } |
| | | }); |
| | | return R.ok(vo); |
| | | } |
| | | } |
| | | return R.ok(vo); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveBasicData(BasicDataDTO dto) { |
| | | //TODO |
| | | //LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | //数据校验 |
| | | if (Objects.isNull(dto) || CollUtils.isEmpty(dto.getFields())) { |
| | | return; |
| | | } |
| | | |
| | | TbBasicData tbBasicData = BeanUtils.copyBean(dto, TbBasicData.class); |
| | | this.saveOrUpdate(tbBasicData); |
| | | //保存基础数据动态字段数据 |
| | | List<TbBasicDataField> tbBasicDataFields = BeanUtils.copyList(dto.getFields(), TbBasicDataField.class); |
| | | tbBasicDataFields.forEach(item -> item.setBasicDataId(tbBasicData.getId())); |
| | | //将该基础数据的动态字段数据全部删除 |
| | | tbBasicDataFieldService.remove(null); |
| | | tbBasicDataFieldService.saveBatch(tbBasicDataFields); |
| | | } |
| | | |
| | | @Override |
| | | public void downloadImportTemplate() throws Exception { |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | String fileName = "地方财政运行及“三保”情况统计表"; |
| | | // 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系 |
| | | response.setHeader("Content-disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8") + ".xlsx"); |
| | | //查询需要填写的动态字段 |
| | | List<TbField> list = tbFieldService.lambdaQuery().eq(TbField::getStatus, ShowStatusEnum.SHOW).list(); |
| | | // 这里需要设置不关闭流 |
| | | EasyExcel.write(response.getOutputStream()).head(head(list)) |
| | | .autoCloseStream(Boolean.FALSE).sheet("模板") |
| | | .doWrite(dataList(list)); |
| | | } |
| | | |
| | | private List<List<Object>> dataList(List<TbField> list) throws Exception { |
| | | //TODO |
| | | //LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | TbDept dept = tbDeptService.getById(44); |
| | | //当前所在季度 |
| | | int quarterOfYear = DateUtils.getQuarterOfYear(new Date()); |
| | | String quarterOfYearStr = NumberDisplaceChineseUtil.numberToChinese(quarterOfYear); |
| | | List<List<Object>> excellist = new ArrayList<List<Object>>(); |
| | | List<List<String>> head = head(list); |
| | | List<Object> columnNo = Lists.newArrayList("栏号"); |
| | | for (int i = 1; i < head.size(); i++) { |
| | | columnNo.add(String.valueOf(i)); |
| | | } |
| | | excellist.add(columnNo); |
| | | excellist.add(Lists.newArrayList(dept.getAreaName(), String.format("%s季度",quarterOfYearStr))); |
| | | return excellist; |
| | | } |
| | | |
| | | private List<List<String>> head(List<TbField> list) { |
| | | List<List<String>> headTitles = Lists.newArrayList(); |
| | | //固定字段 |
| | | headTitles.add(Lists.newArrayList("地区")); |
| | | headTitles.add(Lists.newArrayList("填报季度")); |
| | | headTitles.add(Lists.newArrayList("转移支付规模")); |
| | | headTitles.add(Lists.newArrayList("当期GDP")); |
| | | list.forEach(item ->{ |
| | | headTitles.add(Lists.newArrayList(item.getLevelOneCategory(), item.getLevelTwoCategory(), item.getLevelThreeCategory(), item.getFieldName())); |
| | | }); |
| | | headTitles.add(Lists.newArrayList("备注")); |
| | | return headTitles; |
| | | } |
| | | |
| | | @Override |
| | | public void importBasicData(MultipartFile file) throws IOException { |
| | | //TODO |
| | | //LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | TbDept dept = tbDeptService.getById(44); |
| | | //查询需要填写的动态字段 |
| | | List<TbField> fieldList = tbFieldService.lambdaQuery().eq(TbField::getStatus, ShowStatusEnum.SHOW).list(); |
| | | EasyExcel.read(file.getInputStream(), new BasicDataListener(this,fieldList,tbFieldService,dept,tbBasicDataFieldService)).sheet().doRead(); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.basic.PageDTO; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.BeanUtils; |
| | | import com.ruoyi.common.utils.CollUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.domain.TbDept; |
| | | import com.ruoyi.system.dto.update.DeptFocusDTO; |
| | | import com.ruoyi.system.handler.DeptVerifyHandler; |
| | | import com.ruoyi.system.importExcel.DeptExcel; |
| | | import com.ruoyi.system.mapper.TbDeptMapper; |
| | | import com.ruoyi.system.query.DeptQuery; |
| | | import com.ruoyi.system.service.TbDeptService; |
| | |
| | | //使用自定义校验规则 |
| | | importParams.setVerifyHandler(deptVerifyHandler); |
| | | InputStream inputStream = file.getInputStream(); |
| | | ExcelImportResult<TbDept> result = ExcelImportUtil.importExcelMore(inputStream, TbDept.class, importParams); |
| | | ExcelImportResult<DeptExcel> result = ExcelImportUtil.importExcelMore(inputStream, DeptExcel.class, importParams); |
| | | inputStream.close(); |
| | | List<TbDept> list = result.getList(); |
| | | if (Objects.requireNonNull(result).isVerfiyFail() || CollectionUtils.isEmpty(list)) { |
| | | throw new RuntimeException("文件校验失败,请检查数据填写是否完整"); |
| | | List<DeptExcel> list = result.getList(); |
| | | |
| | | if (result.isVerifyFail() || CollectionUtils.isEmpty(list)) { |
| | | throw new ServiceException("文件校验失败,请检查数据填写是否完整"); |
| | | } |
| | | List<String> strings = hasDuplicateAreaCode(list); |
| | | if (!CollectionUtils.isEmpty(strings)) { |
| | | throw new RuntimeException(String.format("区划代码%s重复,请修改后重新导入", String.join(",", strings))); |
| | | throw new ServiceException(String.format("区划代码%s重复,请修改后重新导入", String.join(",", strings))); |
| | | }else { |
| | | List<TbDept> tbDeptList = BeanUtils.copyList(list, TbDept.class); |
| | | this.remove(null); |
| | | this.saveBatch(list); |
| | | tbDeptList.forEach(dept->{ |
| | | dept.setPassword(SecurityUtils.encryptPassword(dept.getPassword())); |
| | | }); |
| | | this.saveBatch(tbDeptList); |
| | | } |
| | | } |
| | | |
| | |
| | | * @param deptList 部门列表 |
| | | * @return 重复的区划代码 |
| | | */ |
| | | public List<String> hasDuplicateAreaCode(List<TbDept> deptList) { |
| | | public List<String> hasDuplicateAreaCode(List<DeptExcel> deptList) { |
| | | Set<String> areaCodes = new HashSet<>(); |
| | | List<String> result = new ArrayList<>(); |
| | | for (TbDept dept : deptList) { |
| | | for (DeptExcel dept : deptList) { |
| | | if (!areaCodes.add(dept.getAreaCode())) { |
| | | result.add(dept.getAreaCode()); |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public void focus(DeptFocusDTO dto) { |
| | | TbDept dept = this.getById(dto.getId()); |
| | | if (Objects.isNull(dept)) { |
| | | throw new ServiceException("非法参数"); |
| | | } |
| | | this.lambdaUpdate() |
| | | .eq(TbDept::getId, dto.getId()) |
| | | .set(TbDept::getFocussed, dto.getFocussed()) |
| | | .update(); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.basic.PageDTO; |
| | | import com.ruoyi.common.enums.ShowStatusEnum; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.BeanUtils; |
| | | import com.ruoyi.common.utils.CollUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | |
| | | import com.ruoyi.system.mapper.TbFieldCategoryMapper; |
| | | import com.ruoyi.system.query.FieldCategoryQuery; |
| | | import com.ruoyi.system.service.TbFieldCategoryService; |
| | | import com.ruoyi.system.vo.FieldCategoryDetailVO; |
| | | import com.ruoyi.system.vo.FieldCategoryVO; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | } |
| | | |
| | | private void updateCategoryAndChildren(Integer id, ShowStatusEnum status) { |
| | | TbFieldCategory category = this.getById(id); |
| | | if (Objects.isNull(category)) { |
| | | throw new RuntimeException("非法id"); |
| | | } |
| | | TbFieldCategory category = this.validateParam(id); |
| | | this.lambdaUpdate() |
| | | .eq(TbFieldCategory::getId, id) |
| | | .set(TbFieldCategory::getStatus, status) |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void delete(Integer id) { |
| | | //一级分类 |
| | | TbFieldCategory category = this.getById(id); |
| | | if (Objects.isNull(category)) { |
| | | throw new RuntimeException("非法参数"); |
| | | } |
| | | validateParam(id); |
| | | //查询是否有二级分类 |
| | | List<TbFieldCategory> threeCategoryList = this.lambdaQuery().eq(TbFieldCategory::getParentId, id).list(); |
| | | if (CollectionUtils.isNotEmpty(threeCategoryList)) { |
| | |
| | | this.removeById(id); |
| | | } |
| | | |
| | | private TbFieldCategory validateParam(Integer id) { |
| | | TbFieldCategory category = this.getById(id); |
| | | if (Objects.isNull(category)) { |
| | | throw new ServiceException("非法参数"); |
| | | } |
| | | return category; |
| | | } |
| | | |
| | | @Override |
| | | public void edit(FieldCategoryUpdateDTO dto) { |
| | | validateParam(dto.getId()); |
| | | //更新一级分类 |
| | | updateCategory(dto); |
| | | List<FieldCategoryUpdateDTO> children = dto.getChildren(); |
| | |
| | | .list(); |
| | | return BeanUtils.copyList(list, FieldCategoryVO.class); |
| | | } |
| | | |
| | | @Override |
| | | public FieldCategoryDetailVO getDetailsById(Integer id) { |
| | | TbFieldCategory oneCategory = this.getById(id); |
| | | if (Objects.isNull(oneCategory)) { |
| | | return new FieldCategoryDetailVO(); |
| | | } |
| | | FieldCategoryDetailVO vo = BeanUtils.copyBean(oneCategory, FieldCategoryDetailVO.class); |
| | | //根据一级分类id,查询二级分类 |
| | | List<TbFieldCategory> twoCategoryList = this.lambdaQuery().eq(TbFieldCategory::getParentId, oneCategory.getId()).list(); |
| | | twoCategoryList.forEach(item->{ |
| | | FieldCategoryDetailVO twoCategoryVO = BeanUtils.copyBean(item, FieldCategoryDetailVO.class); |
| | | vo.getChildren().add(twoCategoryVO); |
| | | //根据二级分类id,查询三级分类 |
| | | List<TbFieldCategory> threeCategoryList = this.lambdaQuery().eq(TbFieldCategory::getParentId, item.getId()).list(); |
| | | threeCategoryList.forEach(threeCategory->{ |
| | | FieldCategoryDetailVO threeCategoryVO = BeanUtils.copyBean(threeCategory, FieldCategoryDetailVO.class); |
| | | twoCategoryVO.getChildren().add(threeCategoryVO); |
| | | }); |
| | | }); |
| | | return vo; |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.common.enums.FieldInputTypeEnum; |
| | | import com.ruoyi.common.enums.FieldTypeEnum; |
| | | import com.ruoyi.common.enums.ShowStatusEnum; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.BeanUtils; |
| | | import com.ruoyi.common.utils.CollUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | |
| | | import com.ruoyi.system.domain.TbFieldCategory; |
| | | import com.ruoyi.system.dto.FieldDTO; |
| | | import com.ruoyi.system.dto.ShowHideDTO; |
| | | import com.ruoyi.system.dto.update.FieldUpdateDTO; |
| | | import com.ruoyi.system.mapper.TbFieldMapper; |
| | | import com.ruoyi.system.query.FieldQuery; |
| | | import com.ruoyi.system.service.TbBasicDataConfigService; |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.concurrent.CompletableFuture; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | //1:数字 2:文本 3:百分比 |
| | | if (FieldTypeEnum.TEXT.getCode().equals(fieldType)) { |
| | | if (StringUtils.isNull(dto.getTextInputType())) { |
| | | throw new RuntimeException("输入类型不能为空"); |
| | | throw new ServiceException("输入类型不能为空"); |
| | | } else if (FieldInputTypeEnum.FIXED_CONTENT.getCode().equals(dto.getTextInputType()) && StringUtils.isBlank(dto.getTextContent())) { |
| | | throw new RuntimeException("内容设置不能为空"); |
| | | throw new ServiceException("内容设置不能为空"); |
| | | } |
| | | } |
| | | TbField tbField = BeanUtils.copyBean(dto, TbField.class); |
| | |
| | | log.info("======主线程执行showHide{}",Thread.currentThread().getName() ); |
| | | TbField field = this.getById(dto.getId()); |
| | | if (StringUtils.isNull(field)) { |
| | | throw new RuntimeException("非法参数"); |
| | | throw new ServiceException("非法参数"); |
| | | } |
| | | //隐藏字段 |
| | | this.lambdaUpdate().set(TbField::getStatus, dto.getStatus()).eq(TbField::getId, dto.getId()).update(); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<String> influencedData(Integer id) { |
| | | //List<TbBasicDataConfig> list = tbBasicDataConfigService.lambdaQuery().like(TbBasicDataConfig::getFieldIdStr, id).list(); |
| | | List<TbBasicDataConfig> list = tbBasicDataConfigService.lambdaQuery().eq(TbBasicDataConfig::getStatus, ShowStatusEnum.SHOW.getCode()).list(); |
| | | public String influencedData(Integer id) { |
| | | List<TbBasicDataConfig> list = tbBasicDataConfigService.lambdaQuery().eq(TbBasicDataConfig::getStatus, ShowStatusEnum.SHOW).list(); |
| | | if (CollUtils.isEmpty(list)) { |
| | | return CollUtils.emptyList(); |
| | | return ""; |
| | | } |
| | | List<String> collect = list.stream().map(config -> { |
| | | String collect = list.stream().map(config -> { |
| | | String fieldIdStr = config.getFieldIdStr(); |
| | | String[] split = fieldIdStr.split(","); |
| | | //字符串数组转为List |
| | | List<String> idList = new ArrayList<>(Arrays.asList(split)); |
| | | List<String> idList = Arrays.asList(split); |
| | | if (idList.contains(id.toString())) { |
| | | return config.getTypeName(); |
| | | } |
| | | return null; |
| | | }).collect(Collectors.toList()); |
| | | if (CollUtils.isEmpty(collect)) { |
| | | return CollUtils.emptyList(); |
| | | }).filter(Objects::nonNull).collect(Collectors.joining(",")); |
| | | if (StringUtils.isBlank(collect)) { |
| | | return ""; |
| | | } |
| | | return collect; |
| | | } |
| | | |
| | | @Override |
| | | public void update(FieldUpdateDTO dto) { |
| | | TbField field = this.getById(dto.getId()); |
| | | if (Objects.isNull(field)) { |
| | | throw new ServiceException("参数异常"); |
| | | } |
| | | TbField tbField = BeanUtils.copyBean(dto, TbField.class); |
| | | this.updateById(tbField); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.vo; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/3/19 |
| | | */ |
| | | public class BasicDataFieldVO { |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.vo; |
| | | |
| | | import com.ruoyi.common.enums.ReportingStatusEnum; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/3/18 |
| | | */ |
| | | @Data |
| | | @ApiModel(value="基础数据填报视图对象") |
| | | public class BasicDataReportingVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 8457240440217226595L; |
| | | |
| | | @ApiModelProperty(value = "季度") |
| | | private String quarter; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "填报状态(1=未填报 2=数据缺失 3=已填报)") |
| | | private ReportingStatusEnum status; |
| | | |
| | | @ApiModelProperty(value = "首次填报时间") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "填报完成时间") |
| | | private LocalDateTime updateTime; |
| | | |
| | | //1:未填报 2:数据缺失 3:已填报 |
| | | @ApiModelProperty(value = "动态字段") |
| | | private List<FieldReportingVO> fields = new ArrayList<>(); |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.vo; |
| | | |
| | | import com.ruoyi.common.enums.FieldTypeEnum; |
| | | import com.ruoyi.common.enums.ShowStatusEnum; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @ApiModel(value="数据上报字段视图对象") |
| | | public class FieldReportingVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -7412686975187928384L; |
| | | |
| | | @ApiModelProperty(value = "字段id") |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "字段名") |
| | | private String fieldName; |
| | | |
| | | @ApiModelProperty(value = "字段类型(1=数字 2=文本 3=百分比)") |
| | | private FieldTypeEnum fieldType; |
| | | |
| | | @ApiModelProperty(value = "一级分类id") |
| | | private Integer levelOneCategoryId; |
| | | |
| | | @ApiModelProperty(value = "二级分类id") |
| | | private Integer levelTwoCategoryId; |
| | | |
| | | @ApiModelProperty(value = "三级分类id") |
| | | private Integer levelThreeCategoryId; |
| | | |
| | | @ApiModelProperty(value = "一级分类") |
| | | private String levelOneCategory; |
| | | |
| | | @ApiModelProperty(value = "二级分类") |
| | | private String levelTwoCategory; |
| | | |
| | | @ApiModelProperty(value = "三级分类") |
| | | private String levelThreeCategory; |
| | | |
| | | @ApiModelProperty(value = "隐藏状态(0=展示中 1=已隐藏)") |
| | | private ShowStatusEnum status; |
| | | |
| | | @ApiModelProperty(value = "数字最小值") |
| | | private Integer numMin; |
| | | |
| | | @ApiModelProperty(value = "数字最大值") |
| | | private Integer numMax; |
| | | |
| | | @ApiModelProperty(value = "文本输入类型(1=手动输入 2=固定内容)") |
| | | private Integer textInputType; |
| | | |
| | | @ApiModelProperty(value = "文本最少字数") |
| | | private Integer textMinNum; |
| | | |
| | | @ApiModelProperty(value = "文本最多字数") |
| | | private Integer textMaxNum; |
| | | |
| | | @ApiModelProperty(value = "文本内容设置(不同内容以','隔开)") |
| | | private String textContent; |
| | | |
| | | @ApiModelProperty(value = "部门上报的值") |
| | | private String value; |
| | | } |
| | |
| | | package com.ruoyi.system.vo; |
| | | |
| | | import com.ruoyi.common.enums.FieldTypeEnum; |
| | | import com.ruoyi.common.enums.ShowStatusEnum; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | private String fieldName; |
| | | |
| | | @ApiModelProperty(value = "字段类型(1=数字 2=文本 3=百分比)") |
| | | private Integer fieldType; |
| | | private FieldTypeEnum fieldType; |
| | | |
| | | @ApiModelProperty(value = "一级分类id") |
| | | private Integer levelOneCategoryId; |