New file |
| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.query.YcFinancialManagementQuery; |
| | | import com.ruoyi.system.service.YcFinancialManagementService; |
| | | import com.ruoyi.system.service.YcRevenueExpenditureTypeService; |
| | | import com.ruoyi.system.vo.YcFinancialManagementVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 财务管理 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-07-15 |
| | | */ |
| | | @Api(tags = "财务数据汇总") |
| | | @RestController |
| | | @RequestMapping("/dataStatistics") |
| | | public class DataStatisticsController { |
| | | |
| | | |
| | | private final YcRevenueExpenditureTypeService ycRevenueExpenditureTypeService; |
| | | private final YcFinancialManagementService ycFinancialManagementService; |
| | | private final TokenService tokenService; |
| | | |
| | | @Autowired |
| | | public DataStatisticsController(YcRevenueExpenditureTypeService ycRevenueExpenditureTypeService, YcFinancialManagementService ycFinancialManagementService, TokenService tokenService) { |
| | | this.ycRevenueExpenditureTypeService = ycRevenueExpenditureTypeService; |
| | | this.ycFinancialManagementService = ycFinancialManagementService; |
| | | this.tokenService = tokenService; |
| | | } |
| | | |
| | | /** |
| | | * 查询财务管理列表 |
| | | */ |
| | | @ApiOperation( value = "查询财务管理分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public R<PageInfo<YcFinancialManagementVO>> pageList(@RequestBody YcFinancialManagementQuery query) { |
| | | return R.ok(ycFinancialManagementService.pageList(query)); |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.model.TRegion; |
| | | import com.ruoyi.system.service.TRegionService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 省市管理 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-02-29 |
| | | */ |
| | | @Api(tags = "省市管理") |
| | | @RestController |
| | | @RequestMapping("/tRegion") |
| | | public class TRegionController { |
| | | |
| | | private final TRegionService regionService; |
| | | |
| | | @Autowired |
| | | public TRegionController(TRegionService regionService) { |
| | | this.regionService = regionService; |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "查询省市管理") |
| | | @GetMapping(value = "/getRegion") |
| | | public R<List<List<TRegion>>> getRegion() { |
| | | return R.ok(regionService.getRegion()); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询省") |
| | | @PostMapping(value = "/getProvince") |
| | | public R<List<TRegion>> getProvince() { |
| | | return R.ok(regionService.list(Wrappers.lambdaQuery(TRegion.class).eq(TRegion::getParentId,0))); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.model.TRegion; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 省市 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-02-29 |
| | | */ |
| | | @Mapper |
| | | public interface TRegionMapper extends BaseMapper<TRegion> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * 省市管理 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-02-29 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_region") |
| | | @ApiModel(value="TRegion对象", description="省市管理") |
| | | public class TRegion implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "城市名称") |
| | | @TableField("name") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "城市代码") |
| | | @TableField("code") |
| | | private String code; |
| | | |
| | | @ApiModelProperty(value = "城市code") |
| | | @TableField("cityCode") |
| | | private String cityCode; |
| | | |
| | | @ApiModelProperty(value = "父级ID") |
| | | @TableField("parentId") |
| | | private Long parentId; |
| | | |
| | | @ApiModelProperty(value = "英文名称") |
| | | @TableField("english") |
| | | private String english; |
| | | |
| | | @ApiModelProperty(value = "首字母") |
| | | @TableField("initial") |
| | | private String initial; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.model.TRegion; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 省市管理 服务类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-02-29 |
| | | */ |
| | | public interface TRegionService extends IService<TRegion> { |
| | | |
| | | /** |
| | | * 查询省市管理 |
| | | * @return |
| | | */ |
| | | List<List<TRegion>> getRegion(); |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.system.mapper.TRegionMapper; |
| | | import com.ruoyi.system.model.TRegion; |
| | | import com.ruoyi.system.service.TRegionService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 省市管理 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-02-29 |
| | | */ |
| | | @Service |
| | | public class TRegionServiceImpl extends ServiceImpl<TRegionMapper, TRegion> implements TRegionService { |
| | | |
| | | @Override |
| | | public List<List<TRegion>> getRegion() { |
| | | String[] initials = {"A", "B", "C", "D", "E", "F", |
| | | "G", "H", "I", "J", "K", "L", |
| | | "M", "N", "O", "P", "Q", "R", |
| | | "S", "T", "U", "V", "W", "X", "Y", "Z"}; |
| | | List<TRegion> tRegions = this.baseMapper.selectList(Wrappers.lambdaQuery(TRegion.class)); |
| | | List<List<TRegion>> result = new ArrayList<>(); |
| | | for (String initial : initials) { |
| | | List<TRegion> init = tRegions.stream().filter(e -> e.getInitial().equals(initial) && !e.getCode().contains("0000")).collect(Collectors.toList()); |
| | | result.add(init); |
| | | } |
| | | return result; |
| | | } |
| | | } |