parent
148ef346b6
commit
b16bda3544
@ -0,0 +1,98 @@
|
||||
package com.ruoyi.jjh.ent.controller;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.jjh.ent.entity.JProject;
|
||||
import com.ruoyi.jjh.ent.entity.JProjectFund;
|
||||
import com.ruoyi.jjh.ent.entity.response.FundStatisticsResponse;
|
||||
import com.ruoyi.jjh.ent.entity.response.JProjectFundResponse;
|
||||
import com.ruoyi.jjh.ent.service.JProjectFundService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 项目资金表(j_project_fund)控制层
|
||||
* @author du
|
||||
* @since 2024/8/8 15:31
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/jjh/jProjectFund")
|
||||
@Api(tags = "项目资金表")
|
||||
public class JProjectFundController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private JProjectFundService jProjectFundService;
|
||||
|
||||
/**
|
||||
* 查询该项目id下的资金情况
|
||||
*
|
||||
* @return 所有数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasAnyRoles('admin,other-gov,gov')")
|
||||
@ApiOperation(value = "查询该项目id下的资金情况", response = JProjectFund.class)
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult selectFund(@PathVariable Long id) {
|
||||
return success(jProjectFundService.selectFund(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 政务端-工作台 资金引导拨付情况统计
|
||||
*/
|
||||
@PreAuthorize("@ss.hasAnyRoles('admin,other-gov,gov')")
|
||||
@ApiOperation(value = "政务端-工作台 资金引导拨付情况统计", response = FundStatisticsResponse.class)
|
||||
@GetMapping("/fundStatistics")
|
||||
public AjaxResult fundStatistics() {
|
||||
return success(jProjectFundService.fundStatistics());
|
||||
}
|
||||
|
||||
/**
|
||||
* 政务端-工作台 拨付资金企业申请情况TOP5
|
||||
*/
|
||||
@PreAuthorize("@ss.hasAnyRoles('admin,other-gov,gov')")
|
||||
@ApiOperation(value = "政务端-工作台 拨付资金企业申请情况TOP5", response = JProjectFund.class)
|
||||
@GetMapping("/appropriationTop5")
|
||||
public AjaxResult appropriationTop5() {
|
||||
return success(jProjectFundService.appropriationTop5());
|
||||
}
|
||||
|
||||
/**
|
||||
* 企业端-首页 企业荣誉资质关联项目进展
|
||||
*/
|
||||
@PreAuthorize("@ss.hasAnyRoles('admin,ent')")
|
||||
@ApiOperation(value = "企业端-首页企业荣誉资质 关联项目进展", response = JProject.class)
|
||||
@GetMapping("/enterpriseProject")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "type", value = "1企业荣誉资质 2关联项目进展", required = true),
|
||||
})
|
||||
public AjaxResult getEnterpriseProject(@RequestParam Integer type) {
|
||||
String creditCode = null;
|
||||
try {
|
||||
creditCode = SecurityUtils.getUsername();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
return success(jProjectFundService.getEnterpriseProject(type,creditCode));
|
||||
}
|
||||
|
||||
/**
|
||||
* 企业端-首页 往年专项资金申报
|
||||
*/
|
||||
@PreAuthorize("@ss.hasAnyRoles('admin,ent')")
|
||||
@ApiOperation(value = "企业端-首页 往年专项资金申报", response = JProjectFundResponse.class)
|
||||
@GetMapping("/usualFund")
|
||||
public AjaxResult usualFund() {
|
||||
String username = null;
|
||||
try {
|
||||
username = SecurityUtils.getUsername();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
return success(jProjectFundService.usualFund(username));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package com.ruoyi.jjh.ent.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 项目资金表(j_project_fund)实体类
|
||||
* @author du
|
||||
* @since 2024/8/8 15:40
|
||||
*/
|
||||
@ApiModel("项目表")
|
||||
@TableName(value = "j_project_fund")
|
||||
@Data
|
||||
public class JProjectFund {
|
||||
/**
|
||||
* Id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 企业名称
|
||||
*/
|
||||
@ApiModelProperty("企业名称")
|
||||
private String qymc;
|
||||
|
||||
/**
|
||||
* 统一社会信用代码
|
||||
*/
|
||||
@ApiModelProperty("统一社会信用代码")
|
||||
private String tyshxydm;
|
||||
|
||||
/**
|
||||
* 项目
|
||||
*/
|
||||
@ApiModelProperty("项目")
|
||||
private String projectName;
|
||||
|
||||
/**
|
||||
* 项目金额
|
||||
*/
|
||||
@ApiModelProperty("项目金额")
|
||||
private Double fundAmount;
|
||||
|
||||
/**
|
||||
* 拨付时间
|
||||
*/
|
||||
@ApiModelProperty("拨付时间")
|
||||
private String appropriationTime;
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.ruoyi.jjh.ent.entity.response;
|
||||
|
||||
import com.ruoyi.jjh.ent.entity.JProjectFund;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 往年专项资金申报返回体
|
||||
* @author du
|
||||
* @since 2024/8/12 11:19
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("往年专项资金申报返回体")
|
||||
public class JProjectFundResponse extends JProjectFund {
|
||||
|
||||
/**
|
||||
* 项目大类
|
||||
*/
|
||||
@ApiModelProperty("项目大类")
|
||||
private Integer projectBigType;
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.jjh.ent.mapper.JProjectFundMapper">
|
||||
<select id="selectFund" resultType="com.ruoyi.jjh.ent.entity.JProjectFund">
|
||||
SELECT
|
||||
a.*
|
||||
FROM
|
||||
j_project_fund a
|
||||
WHERE
|
||||
( a.project_name = '区级总部' or a.project_name = '市级服务业领军')
|
||||
and a.tyshxydm=#{creditCode}
|
||||
</select>
|
||||
|
||||
<select id="fundStatistics" resultType="com.ruoyi.jjh.ent.entity.response.FundStatisticsResponse">
|
||||
SELECT
|
||||
b.type,
|
||||
ROUND( sum( a.fund_amount / 100000000 ), 1 ) AS fundSum
|
||||
FROM
|
||||
j_project_fund a
|
||||
LEFT JOIN ( SELECT id, IF ( project_name = '区级总部' || project_name = '市级服务业领军', project_name, '其他' ) AS type FROM j_project_fund ) b ON a.id = b.id
|
||||
GROUP BY
|
||||
b.type
|
||||
</select>
|
||||
<select id="appropriationTop5" resultType="com.ruoyi.jjh.ent.entity.JProjectFund">
|
||||
SELECT
|
||||
ROUND( a.fund_amount / 100000000 , 1 ) AS fundAmount,
|
||||
a.id,
|
||||
a.qymc,
|
||||
a.tyshxydm,
|
||||
a.project_name,
|
||||
a.appropriation_time
|
||||
FROM
|
||||
j_project_fund a
|
||||
ORDER BY
|
||||
a.fund_amount DESC
|
||||
LIMIT 5
|
||||
</select>
|
||||
<select id="getEnterpriseProject" resultType="com.ruoyi.jjh.ent.entity.JProject">
|
||||
SELECT
|
||||
a.*
|
||||
FROM
|
||||
j_project a
|
||||
<where>
|
||||
<if test="creditCode != null and creditCode != '' ">
|
||||
and a.credit_code = #{creditCode}
|
||||
</if>
|
||||
<if test="type == 1 ">
|
||||
and a.status = 5
|
||||
</if>
|
||||
<if test="type == 2">
|
||||
and a.status != 5
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="usualFund" resultType="com.ruoyi.jjh.ent.entity.response.JProjectFundResponse">
|
||||
SELECT
|
||||
a.fund_amount,
|
||||
a.id,
|
||||
a.qymc,
|
||||
a.tyshxydm,
|
||||
a.project_name,
|
||||
a.appropriation_time,
|
||||
IF
|
||||
( a.project_name = '区级总部' || a.project_name = '市级服务业领军', b.project_big_type, NULL ) AS projectBigType
|
||||
FROM
|
||||
j_project_fund a
|
||||
LEFT JOIN j_project b ON a.tyshxydm = b.credit_code
|
||||
WHERE
|
||||
a.tyshxydm = #{username}
|
||||
GROUP BY
|
||||
a.ID
|
||||
LIMIT 10
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in new issue