Compare commits
33 Commits
c52679cbda
...
e49b39e327
Author | SHA1 | Date |
---|---|---|
杜函宇 | e49b39e327 | 2 months ago |
杜函宇 | 8ccf1934aa | 2 months ago |
杜函宇 | 19a667c43a | 2 months ago |
杜函宇 | 9e29e2b043 | 2 months ago |
杜函宇 | 5ebaee19a5 | 2 months ago |
杜函宇 | 8850edfb21 | 2 months ago |
杜函宇 | 82fdd34ddd | 2 months ago |
杜函宇 | 9d1c0c75cc | 2 months ago |
杜函宇 | fa26e862d8 | 2 months ago |
杜函宇 | 442e9873c7 | 2 months ago |
杜函宇 | bcee7405c2 | 2 months ago |
杜函宇 | c57205254f | 2 months ago |
杜函宇 | 332aa7eaaf | 2 months ago |
杜函宇 | b86adcbf72 | 2 months ago |
杜函宇 | 112d7ac85b | 2 months ago |
杜函宇 | 71a772091f | 3 months ago |
杜函宇 | 2f8565b262 | 3 months ago |
杜函宇 | ab6b365e51 | 3 months ago |
杜函宇 | 87a3c8bf88 | 3 months ago |
杜函宇 | ac9701509b | 3 months ago |
杜函宇 | 235603393a | 3 months ago |
杜函宇 | b16bda3544 | 3 months ago |
杜函宇 | 148ef346b6 | 3 months ago |
杜函宇 | d5dc052624 | 3 months ago |
杜函宇 | de23667e4e | 3 months ago |
杜函宇 | 392485c8d7 | 3 months ago |
杜函宇 | dcc136434c | 3 months ago |
杜函宇 | 1471a2695c | 3 months ago |
杜函宇 | 6ebcb18c74 | 3 months ago |
杜函宇 | bf9920ed04 | 3 months ago |
杜函宇 | 53a6c8de95 | 3 months ago |
杜函宇 | aeb869bae7 | 3 months ago |
杜函宇 | a747c8ba5c | 3 months ago |
@ -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,ent,sightseer')")
|
||||
@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,68 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* 专项类型
|
||||
*/
|
||||
@ApiModelProperty("专项类型")
|
||||
private String specialType;
|
||||
|
||||
/**
|
||||
* 摘要
|
||||
*/
|
||||
@ApiModelProperty("摘要")
|
||||
private String summary;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.ruoyi.jjh.ent.entity.request;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 政务端首页智能提醒查询请求体
|
||||
* @author du
|
||||
* @since 2024/8/2 10:36
|
||||
*/
|
||||
@Data
|
||||
public class JRemindChiefAllRequest {
|
||||
|
||||
/**
|
||||
* 智能提醒内容
|
||||
*/
|
||||
@ApiModelProperty("智能提醒内容")
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
@ApiModelProperty("项目id")
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@ApiModelProperty("用户id")
|
||||
private Long userId;
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.ruoyi.jjh.ent.entity.request;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 企业获得资金拨付排名TOP5请求体
|
||||
* @author du
|
||||
* @since 2024/8/28 13:13
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("企业获得资金拨付排名TOP5请求体")
|
||||
public class JTop5FundRequest {
|
||||
|
||||
|
||||
/**
|
||||
* 年份 1.当前 2.近三年
|
||||
*/
|
||||
@NotBlank
|
||||
@ApiModelProperty("年份 1.当前 2.近三年 ")
|
||||
private Integer yearsChange;
|
||||
|
||||
|
||||
/**
|
||||
* 分类 1.总部专项 2.服务业专项
|
||||
*/
|
||||
@NotNull
|
||||
@ApiModelProperty("分类 1.总部专项 2.服务业专项")
|
||||
private Integer type;
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
@ApiModelProperty("项目id")
|
||||
private Long projectId;
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
package com.ruoyi.jjh.ent.mapper;
|
||||
|
||||
import com.ruoyi.jjh.ent.entity.JMemorandum;
|
||||
import com.ruoyi.jjh.ent.entity.JProject;
|
||||
import com.ruoyi.jjh.ent.entity.JProjectFund;
|
||||
import com.ruoyi.jjh.ent.entity.request.JTop5FundRequest;
|
||||
import com.ruoyi.jjh.ent.entity.response.JServicesDevelopResponse;
|
||||
import com.ruoyi.jjh.ent.entity.response.ThreeYearsFundResponse;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 政务端工作台表数据层
|
||||
*
|
||||
* @author du
|
||||
* @since 2024/5/6 13:57
|
||||
*/
|
||||
public interface JChiefWorkMapper{
|
||||
|
||||
/**
|
||||
* 政务端-工作台 服务业发展总览
|
||||
*/
|
||||
List<JServicesDevelopResponse> servicesDevelop();
|
||||
|
||||
/**
|
||||
* 政务端-工作台 企业获得资金拨付排名TOP5
|
||||
*/
|
||||
List<JProjectFund> getTop5Fund(@Param("req") JTop5FundRequest a);
|
||||
|
||||
/**
|
||||
* 政务端-工作台 当年已申报完成的项目
|
||||
*/
|
||||
List<JProject> currentYearFinish();
|
||||
|
||||
/**
|
||||
* 政务端-工作台 项目追踪情况
|
||||
*/
|
||||
List<JProject> projectTrace();
|
||||
|
||||
/**
|
||||
* 政务端-工作台 备忘录更新情况
|
||||
*/
|
||||
List<JMemorandum> memorandum();
|
||||
|
||||
/**
|
||||
* 政务端-工作台 近三年资金拨付情况
|
||||
*/
|
||||
List<ThreeYearsFundResponse> getThreeYearsFund(String years);
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package com.ruoyi.jjh.ent.service;
|
||||
|
||||
import com.ruoyi.jjh.ent.entity.JMemorandum;
|
||||
import com.ruoyi.jjh.ent.entity.JProject;
|
||||
import com.ruoyi.jjh.ent.entity.JProjectFund;
|
||||
import com.ruoyi.jjh.ent.entity.request.JTop5FundRequest;
|
||||
import com.ruoyi.jjh.ent.entity.response.JServicesDevelopResponse;
|
||||
import com.ruoyi.jjh.ent.entity.response.ThreeYearsFundResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 政务端工作台表业务层
|
||||
*
|
||||
* @author du
|
||||
* @since 2024/7/31 15:16
|
||||
*/
|
||||
public interface JChiefWorkService {
|
||||
|
||||
/**
|
||||
* 政务端-工作台 服务业发展总览
|
||||
*/
|
||||
List<JServicesDevelopResponse> servicesDevelop();
|
||||
|
||||
/**
|
||||
* 政务端-工作台 企业获得资金拨付排名TOP5
|
||||
*/
|
||||
List<JProjectFund> getTop5Fund(JTop5FundRequest a);
|
||||
|
||||
/**
|
||||
* 政务端-工作台 当年已申报完成的项目
|
||||
*/
|
||||
List<JProject> currentYearFinish();
|
||||
|
||||
/**
|
||||
* 政务端-工作台 项目追踪情况
|
||||
*/
|
||||
List<JProject> projectTrace();
|
||||
|
||||
/**
|
||||
* 政务端-工作台 备忘录更新情况
|
||||
*/
|
||||
List<JMemorandum> memorandum();
|
||||
|
||||
/**
|
||||
* 政务端-工作台 近三年资金拨付情况
|
||||
*/
|
||||
List<ThreeYearsFundResponse> getThreeYearsFund(String years);
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
package com.ruoyi.jjh.ent.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.jjh.ent.entity.JMemorandum;
|
||||
import com.ruoyi.jjh.ent.entity.JProject;
|
||||
import com.ruoyi.jjh.ent.entity.JProjectFund;
|
||||
import com.ruoyi.jjh.ent.entity.request.JTop5FundRequest;
|
||||
import com.ruoyi.jjh.ent.entity.response.JServicesDevelopResponse;
|
||||
import com.ruoyi.jjh.ent.entity.response.ThreeYearsFundResponse;
|
||||
import com.ruoyi.jjh.ent.mapper.JChiefWorkMapper;
|
||||
import com.ruoyi.jjh.ent.service.JChiefWorkService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 政务端工作台表业务处理层
|
||||
*
|
||||
* @author du
|
||||
* @since 2024/5/13 9:58
|
||||
*/
|
||||
@Service
|
||||
public class JChiefWorkImpl implements JChiefWorkService {
|
||||
|
||||
@Resource
|
||||
private JChiefWorkMapper jChiefWorkMapper;
|
||||
|
||||
/**
|
||||
* 政务端-工作台 服务业发展总览
|
||||
*/
|
||||
@Override
|
||||
public List<JServicesDevelopResponse> servicesDevelop() {
|
||||
return jChiefWorkMapper.servicesDevelop();
|
||||
}
|
||||
|
||||
/**
|
||||
* 政务端-工作台 企业获得资金拨付排名TOP5
|
||||
*/
|
||||
@Override
|
||||
public List<JProjectFund> getTop5Fund(JTop5FundRequest a) {
|
||||
List<JProjectFund> top5Fund = jChiefWorkMapper.getTop5Fund(a);
|
||||
if(a.getYearsChange() == 1){
|
||||
top5Fund.forEach(x-> x.setAppropriationTime(String.valueOf(LocalDate.now().getYear()-1)));
|
||||
}else {
|
||||
top5Fund.forEach(x-> x.setAppropriationTime(LocalDate.now().getYear() - 3 +"-"+
|
||||
(LocalDate.now().getYear() - 1)));
|
||||
}
|
||||
return top5Fund;
|
||||
}
|
||||
|
||||
/**
|
||||
* 政务端-工作台 当年已申报完成的项目
|
||||
*/
|
||||
@Override
|
||||
public List<JProject> currentYearFinish() {
|
||||
return jChiefWorkMapper.currentYearFinish();
|
||||
}
|
||||
/**
|
||||
* 政务端-工作台 项目追踪情况
|
||||
*/
|
||||
@Override
|
||||
public List<JProject> projectTrace() {
|
||||
return jChiefWorkMapper.projectTrace();
|
||||
}
|
||||
|
||||
/**
|
||||
* 政务端-工作台 备忘录更新情况
|
||||
*/
|
||||
@Override
|
||||
public List<JMemorandum> memorandum() {
|
||||
List<JMemorandum> memorandum = jChiefWorkMapper.memorandum();
|
||||
memorandum.forEach(x->{
|
||||
if(x.getContent().length()>10){
|
||||
x.setContent(x.getContent().substring(0, 10)+"...");
|
||||
}
|
||||
});
|
||||
return memorandum;
|
||||
}
|
||||
|
||||
/**
|
||||
* 政务端-工作台 近三年资金拨付情况
|
||||
*/
|
||||
@Override
|
||||
public List<ThreeYearsFundResponse> getThreeYearsFund(String years) {
|
||||
return jChiefWorkMapper.getThreeYearsFund( years);
|
||||
}
|
||||
}
|
@ -0,0 +1,99 @@
|
||||
<?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.JChiefWorkMapper">
|
||||
|
||||
<select id="servicesDevelop" resultType="com.ruoyi.jjh.ent.entity.response.JServicesDevelopResponse">
|
||||
SELECT
|
||||
a.develop_year,
|
||||
a.quarterly AS quarterly,
|
||||
IFNULL( a.value_added, 0 ) AS valueAdded,
|
||||
IFNULL( a.increase_speed, 0 ) AS increaseSpeed,
|
||||
IFNULL( a.gdp_proportion, 0 ) AS gdpProportion
|
||||
FROM
|
||||
j_services_develop a
|
||||
WHERE
|
||||
YEAR (
|
||||
NOW()) - 1 = a.develop_year
|
||||
AND a.quarterly IS NULL UNION
|
||||
(
|
||||
SELECT
|
||||
c.develop_year,
|
||||
c.quarterly AS quarterly,
|
||||
IFNULL( c.value_added, 0 ) AS valueAdded,
|
||||
IFNULL( c.increase_speed, 0 ) AS increaseSpeed,
|
||||
IFNULL( c.gdp_proportion, 0 ) AS gdpProportion
|
||||
FROM
|
||||
j_services_develop c
|
||||
WHERE
|
||||
YEAR (
|
||||
NOW()) = c.develop_year
|
||||
AND c.quarterly IS NOT NULL
|
||||
ORDER BY
|
||||
c.quarterly DESC
|
||||
LIMIT 1)
|
||||
</select>
|
||||
<select id="getTop5Fund" resultType="com.ruoyi.jjh.ent.entity.JProjectFund">
|
||||
SELECT
|
||||
IFNULL(ROUND(SUM(a.fund_amount) / 10000, 1 ),'-') AS fundAmount,
|
||||
a.qymc,
|
||||
a.project_name
|
||||
FROM
|
||||
j_project_fund a
|
||||
<where>
|
||||
<if test="req.type == 1 ">
|
||||
and a.project_name = '区级总部'
|
||||
</if>
|
||||
<if test="req.type != 1 ">
|
||||
and a.project_name != '区级总部'
|
||||
</if>
|
||||
<if test="req.yearsChange == 1 ">
|
||||
and a.appropriation_time like concat('%',YEAR(NOW())-1,'%')
|
||||
</if>
|
||||
<if test="req.yearsChange != 1 ">
|
||||
and SUBSTRING(a.appropriation_time, 1, 4) BETWEEN YEAR(DATE_SUB(CURDATE(), INTERVAL 3 YEAR)) AND YEAR(NOW())-1
|
||||
</if>
|
||||
</where>
|
||||
group by
|
||||
a.qymc,a.project_name
|
||||
ORDER BY SUM(a.fund_amount) DESC
|
||||
limit 5
|
||||
</select>
|
||||
<select id="currentYearFinish" resultType="com.ruoyi.jjh.ent.entity.JProject">
|
||||
select *
|
||||
from j_project
|
||||
where status = 5 and project_year = YEAR(NOW())
|
||||
order by update_time desc
|
||||
limit 10;
|
||||
</select>
|
||||
<select id="projectTrace" resultType="com.ruoyi.jjh.ent.entity.JProject">
|
||||
select *
|
||||
from j_project
|
||||
where status in(1,2,3)
|
||||
order by create_time desc
|
||||
limit 10;
|
||||
</select>
|
||||
<select id="memorandum" resultType="com.ruoyi.jjh.ent.entity.JMemorandum">
|
||||
select *
|
||||
from j_memorandum
|
||||
order by create_time desc
|
||||
limit 10;
|
||||
</select>
|
||||
<select id="getThreeYearsFund" resultType="com.ruoyi.jjh.ent.entity.response.ThreeYearsFundResponse">
|
||||
SELECT
|
||||
years,
|
||||
service_type,
|
||||
ROUND(plans_num,1) AS fundBudget,
|
||||
IFNULL(ROUND(COALESCE ( one_adjustments, 0 ) + COALESCE ( two_adjustments, 0 ),1), 0 ) AS additionBudget,
|
||||
IFNULL( ROUND(execute_num,1), 0 ) AS appropriationFund,
|
||||
IFNULL(
|
||||
ROUND( execute_num / ( COALESCE ( one_adjustments, 0 ) + COALESCE ( two_adjustments, 0 )+ COALESCE ( plans_num, 0 )) * 100, 0 ),
|
||||
0
|
||||
) AS implementationRate
|
||||
FROM
|
||||
j_dashboard
|
||||
WHERE
|
||||
years = #{years}
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,88 @@
|
||||
<?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 = #{projectSmallType} 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.response.JProjectFundResponse">
|
||||
SELECT
|
||||
ROUND( a.fund_amount / 100000000, 1 ) AS fundAmount,
|
||||
a.id,
|
||||
a.qymc,
|
||||
a.tyshxydm,
|
||||
a.project_name,
|
||||
a.appropriation_time,
|
||||
IF
|
||||
( a.project_name = '区级总部' || a.project_name = '市级服务业领军', b.id, NULL ) AS projectId
|
||||
FROM
|
||||
j_project_fund a
|
||||
LEFT JOIN ( SELECT id,project_year, credit_code FROM j_project WHERE
|
||||
project_small_type = 3 || project_small_type = 7 ) b ON a.tyshxydm = b.credit_code and SUBSTRING(a.appropriation_time, 1, 4) = b.project_year
|
||||
GROUP BY
|
||||
a.id,
|
||||
a.fund_amount,
|
||||
a.qymc, a.tyshxydm, a.project_name, a.appropriation_time, b.id
|
||||
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>
|
||||
order by create_time desc
|
||||
</select>
|
||||
<select id="usualFund" resultType="com.ruoyi.jjh.ent.entity.response.JProjectFundResponse">
|
||||
SELECT
|
||||
IFNULL(ROUND( a.fund_amount / 10000, 1 ),'-') AS fundAmount,
|
||||
a.id,
|
||||
a.qymc,
|
||||
a.tyshxydm,
|
||||
a.project_name,
|
||||
a.appropriation_time,
|
||||
a.special_type,
|
||||
a.summary
|
||||
FROM
|
||||
j_project_fund a
|
||||
LEFT JOIN j_project b ON a.tyshxydm = b.credit_code
|
||||
WHERE
|
||||
a.tyshxydm = #{username}
|
||||
GROUP BY
|
||||
a.ID,
|
||||
a.qymc, a.tyshxydm, a.project_name, a.appropriation_time,a.fund_amount,
|
||||
a.special_type,
|
||||
a.summary
|
||||
order by a.fund_amount desc
|
||||
LIMIT 10
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,152 @@
|
||||
package com.ruoyi.common.utils;
|
||||
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import javax.crypto.Cipher;
|
||||
import java.security.*;
|
||||
import java.security.interfaces.RSAPrivateKey;
|
||||
import java.security.interfaces.RSAPublicKey;
|
||||
import java.security.spec.PKCS8EncodedKeySpec;
|
||||
import java.security.spec.X509EncodedKeySpec;
|
||||
|
||||
/**
|
||||
* RSA加密解密
|
||||
*
|
||||
* @author ruoyi
|
||||
**/
|
||||
public class RsaUtils
|
||||
{
|
||||
// Rsa 私钥
|
||||
public static String privateKey = "MIIBVQIBADANBgkqhkiG9w0BAQEFAASCAT8wggE7AgEAAkEA4Qj9AvP1YzQ28Z5L\n" +
|
||||
"jgqlHl1tWu8lNN8u7nHe7XQLAQ2qYcRp9g8zPhJ8Gf33/++QsrE7RxEozcxL6Vv/\n" +
|
||||
"WhJWqwIDAQABAkAcTrklCfMwS30t36+5anVi4HXFHpgbkoegzwov7I0F0Kndk81M\n" +
|
||||
"WRPzriIsMWSKPwF5eS+FbopM+9qh6W8WFCyBAiEA88tPNwHuJ/35Z40jqspVYiTf\n" +
|
||||
"TLrzrVmgaXCMFG7UdvsCIQDsTT7UTL4JvH5BUX488uouyZt/DFyXCyVQOFglj9hQ\n" +
|
||||
"EQIhAJgIw//D3mdmRTDEneeWgqTP5cmOFQSYDidzHohnjWwdAiB721U2U+88DTek\n" +
|
||||
"JwHjEnQbCANgCWuyo93v+UiCj64S8QIhAJs6G4SSKS2hvYKYF+ERqkt0GTaDviSP\n" +
|
||||
"wg+zTdAgRmjr";
|
||||
|
||||
/**
|
||||
* 私钥解密
|
||||
*
|
||||
* @param text 待解密的文本
|
||||
* @return 解密后的文本
|
||||
*/
|
||||
public static String decryptByPrivateKey(String text) throws Exception
|
||||
{
|
||||
return decryptByPrivateKey(privateKey, text);
|
||||
}
|
||||
|
||||
/**
|
||||
* 公钥解密
|
||||
*
|
||||
* @param publicKeyString 公钥
|
||||
* @param text 待解密的信息
|
||||
* @return 解密后的文本
|
||||
*/
|
||||
public static String decryptByPublicKey(String publicKeyString, String text) throws Exception
|
||||
{
|
||||
X509EncodedKeySpec x509EncodedKeySpec = new X509EncodedKeySpec(Base64.decodeBase64(publicKeyString));
|
||||
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
|
||||
PublicKey publicKey = keyFactory.generatePublic(x509EncodedKeySpec);
|
||||
Cipher cipher = Cipher.getInstance("RSA");
|
||||
cipher.init(Cipher.DECRYPT_MODE, publicKey);
|
||||
byte[] result = cipher.doFinal(Base64.decodeBase64(text));
|
||||
return new String(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 私钥加密
|
||||
*
|
||||
* @param privateKeyString 私钥
|
||||
* @param text 待加密的信息
|
||||
* @return 加密后的文本
|
||||
*/
|
||||
public static String encryptByPrivateKey(String privateKeyString, String text) throws Exception
|
||||
{
|
||||
PKCS8EncodedKeySpec pkcs8EncodedKeySpec = new PKCS8EncodedKeySpec(Base64.decodeBase64(privateKeyString));
|
||||
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
|
||||
PrivateKey privateKey = keyFactory.generatePrivate(pkcs8EncodedKeySpec);
|
||||
Cipher cipher = Cipher.getInstance("RSA");
|
||||
cipher.init(Cipher.ENCRYPT_MODE, privateKey);
|
||||
byte[] result = cipher.doFinal(text.getBytes());
|
||||
return Base64.encodeBase64String(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 私钥解密
|
||||
*
|
||||
* @param privateKeyString 私钥
|
||||
* @param text 待解密的文本
|
||||
* @return 解密后的文本
|
||||
*/
|
||||
public static String decryptByPrivateKey(String privateKeyString, String text) throws Exception
|
||||
{
|
||||
PKCS8EncodedKeySpec pkcs8EncodedKeySpec5 = new PKCS8EncodedKeySpec(Base64.decodeBase64(privateKeyString));
|
||||
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
|
||||
PrivateKey privateKey = keyFactory.generatePrivate(pkcs8EncodedKeySpec5);
|
||||
Cipher cipher = Cipher.getInstance("RSA");
|
||||
cipher.init(Cipher.DECRYPT_MODE, privateKey);
|
||||
byte[] result = cipher.doFinal(Base64.decodeBase64(text));
|
||||
return new String(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 公钥加密
|
||||
*
|
||||
* @param publicKeyString 公钥
|
||||
* @param text 待加密的文本
|
||||
* @return 加密后的文本
|
||||
*/
|
||||
public static String encryptByPublicKey(String publicKeyString, String text) throws Exception
|
||||
{
|
||||
X509EncodedKeySpec x509EncodedKeySpec2 = new X509EncodedKeySpec(Base64.decodeBase64(publicKeyString));
|
||||
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
|
||||
PublicKey publicKey = keyFactory.generatePublic(x509EncodedKeySpec2);
|
||||
Cipher cipher = Cipher.getInstance("RSA");
|
||||
cipher.init(Cipher.ENCRYPT_MODE, publicKey);
|
||||
byte[] result = cipher.doFinal(text.getBytes());
|
||||
return Base64.encodeBase64String(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建RSA密钥对
|
||||
*
|
||||
* @return 生成后的公私钥信息
|
||||
*/
|
||||
public static RsaKeyPair generateKeyPair() throws NoSuchAlgorithmException
|
||||
{
|
||||
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA");
|
||||
keyPairGenerator.initialize(1024);
|
||||
KeyPair keyPair = keyPairGenerator.generateKeyPair();
|
||||
RSAPublicKey rsaPublicKey = (RSAPublicKey) keyPair.getPublic();
|
||||
RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) keyPair.getPrivate();
|
||||
String publicKeyString = Base64.encodeBase64String(rsaPublicKey.getEncoded());
|
||||
String privateKeyString = Base64.encodeBase64String(rsaPrivateKey.getEncoded());
|
||||
return new RsaKeyPair(publicKeyString, privateKeyString);
|
||||
}
|
||||
|
||||
/**
|
||||
* RSA密钥对对象
|
||||
*/
|
||||
public static class RsaKeyPair
|
||||
{
|
||||
private final String publicKey;
|
||||
private final String privateKey;
|
||||
|
||||
public RsaKeyPair(String publicKey, String privateKey)
|
||||
{
|
||||
this.publicKey = publicKey;
|
||||
this.privateKey = privateKey;
|
||||
}
|
||||
|
||||
public String getPublicKey()
|
||||
{
|
||||
return publicKey;
|
||||
}
|
||||
|
||||
public String getPrivateKey()
|
||||
{
|
||||
return privateKey;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue