From 6c2a340fd15873928db86ccf7147c03661d9a1e0 Mon Sep 17 00:00:00 2001 From: F Date: Tue, 16 Jan 2024 11:02:38 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B3=E6=8A=A5=E6=8C=87=E5=8D=97=E4=B8=8E?= =?UTF-8?q?=E7=94=B3=E6=8A=A5=E8=AE=A1=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GuideDeclarationController.java | 108 ++++++++++ .../declaration/dao/GuideDeclarationDao.java | 20 ++ .../declaration/dto/GuideDeclarationDTO.java | 49 +++++ .../entity/GuideDeclarationEntity.java | 48 +++++ .../excel/GuideDeclarationExcel.java | 33 +++ .../redis/GuideDeclarationRedis.java | 34 +++ .../service/GuideDeclarationService.java | 34 +++ .../impl/GuideDeclarationServiceImpl.java | 106 +++++++++ .../ApplicationSchemeController.java | 107 +++++++++ .../dkha/scheme/dao/ApplicationSchemeDao.java | 20 ++ .../dkha/scheme/dto/ApplicationSchemeDTO.java | 58 +++++ .../entity/ApplicationSchemeEntity.java | 59 +++++ .../scheme/excel/ApplicationSchemeExcel.java | 39 ++++ .../scheme/redis/ApplicationSchemeRedis.java | 34 +++ .../service/ApplicationSchemeService.java | 34 +++ .../impl/ApplicationSchemeServiceImpl.java | 99 +++++++++ .../guidedeclaration-add-or-update.vue | 183 ++++++++++++++++ .../guide-declaration/guidedeclaration.vue | 182 ++++++++++++++++ .../applicationscheme-add-or-update.vue | 203 ++++++++++++++++++ .../modules/scheme/applicationscheme.vue | 127 +++++++++++ 20 files changed, 1577 insertions(+) create mode 100644 back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/guide/declaration/controller/GuideDeclarationController.java create mode 100644 back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/guide/declaration/dao/GuideDeclarationDao.java create mode 100644 back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/guide/declaration/dto/GuideDeclarationDTO.java create mode 100644 back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/guide/declaration/entity/GuideDeclarationEntity.java create mode 100644 back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/guide/declaration/excel/GuideDeclarationExcel.java create mode 100644 back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/guide/declaration/redis/GuideDeclarationRedis.java create mode 100644 back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/guide/declaration/service/GuideDeclarationService.java create mode 100644 back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/guide/declaration/service/impl/GuideDeclarationServiceImpl.java create mode 100644 back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/scheme/controller/ApplicationSchemeController.java create mode 100644 back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/scheme/dao/ApplicationSchemeDao.java create mode 100644 back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/scheme/dto/ApplicationSchemeDTO.java create mode 100644 back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/scheme/entity/ApplicationSchemeEntity.java create mode 100644 back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/scheme/excel/ApplicationSchemeExcel.java create mode 100644 back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/scheme/redis/ApplicationSchemeRedis.java create mode 100644 back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/scheme/service/ApplicationSchemeService.java create mode 100644 back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/scheme/service/impl/ApplicationSchemeServiceImpl.java create mode 100644 front/dkha-web-sz-main/src/views/modules/guide-declaration/guidedeclaration-add-or-update.vue create mode 100644 front/dkha-web-sz-main/src/views/modules/guide-declaration/guidedeclaration.vue create mode 100644 front/dkha-web-sz-main/src/views/modules/scheme/applicationscheme-add-or-update.vue create mode 100644 front/dkha-web-sz-main/src/views/modules/scheme/applicationscheme.vue diff --git a/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/guide/declaration/controller/GuideDeclarationController.java b/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/guide/declaration/controller/GuideDeclarationController.java new file mode 100644 index 00000000..f36abd3e --- /dev/null +++ b/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/guide/declaration/controller/GuideDeclarationController.java @@ -0,0 +1,108 @@ +/** + * Copyright 2023 UESTC + */ + +package com.dkha.guide.declaration.controller; + +import com.dkha.commons.tools.constant.Constant; +import com.dkha.commons.tools.page.PageData; +import com.dkha.commons.tools.excel.ExcelUtils; +import com.dkha.commons.tools.utils.Result; +import com.dkha.commons.tools.validator.AssertUtils; +import com.dkha.commons.tools.validator.ValidatorUtils; +import com.dkha.commons.tools.validator.group.AddGroup; +import com.dkha.commons.tools.validator.group.UpdateGroup; +import com.dkha.commons.tools.validator.group.DefaultGroup; +import com.dkha.guide.declaration.dto.GuideDeclarationDTO; +import com.dkha.guide.declaration.excel.GuideDeclarationExcel; +import com.dkha.guide.declaration.service.GuideDeclarationService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 项目申报指南 + * + * @author li.zhan 719901725@qq.com + * @since v1.0.0 2024-01-09 + */ +@RestController +@RequestMapping("guidedeclaration") +@Api(tags="项目申报指南") +public class GuideDeclarationController { + @Autowired + private GuideDeclarationService GuideDeclarationService; + + @GetMapping("page") + @ApiOperation("分页") + @ApiImplicitParams({ + @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") , + @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") , + @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") , + @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") + }) + public Result> page(@ApiIgnore @RequestParam Map params){ + PageData page = GuideDeclarationService.page(params); + + return new Result>().ok(page); + } + + @GetMapping("{id}") + @ApiOperation("信息") + public Result get(@PathVariable("id") String id){ + GuideDeclarationDTO data = GuideDeclarationService.get(id); + + return new Result().ok(data); + } + + @PostMapping + @ApiOperation("保存") + public Result save(@RequestBody GuideDeclarationDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + + GuideDeclarationService.save(dto); + + return new Result(); + } + + @PutMapping + @ApiOperation("修改") + public Result update(@RequestBody GuideDeclarationDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + + GuideDeclarationService.update(dto); + + return new Result(); + } + + @DeleteMapping + @ApiOperation("删除") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + + GuideDeclarationService.delete(ids); + + return new Result(); + } + + @GetMapping("export") + @ApiOperation("导出") + public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { + List list = GuideDeclarationService.list(params); + + ExcelUtils.exportExcelToTarget(response, null, list, GuideDeclarationExcel.class); + } + +} \ No newline at end of file diff --git a/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/guide/declaration/dao/GuideDeclarationDao.java b/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/guide/declaration/dao/GuideDeclarationDao.java new file mode 100644 index 00000000..67f25ff9 --- /dev/null +++ b/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/guide/declaration/dao/GuideDeclarationDao.java @@ -0,0 +1,20 @@ +/** + * Copyright 2023 UESTC + */ + +package com.dkha.guide.declaration.dao; + +import com.dkha.commons.mybatis.dao.BaseDao; +import com.dkha.guide.declaration.entity.GuideDeclarationEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 项目申报指南 + * + * @author li.zhan 719901725@qq.com + * @since v1.0.0 2024-01-09 + */ +@Mapper +public interface GuideDeclarationDao extends BaseDao { + +} \ No newline at end of file diff --git a/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/guide/declaration/dto/GuideDeclarationDTO.java b/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/guide/declaration/dto/GuideDeclarationDTO.java new file mode 100644 index 00000000..eea5d61a --- /dev/null +++ b/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/guide/declaration/dto/GuideDeclarationDTO.java @@ -0,0 +1,49 @@ +/** + * Copyright 2023 UESTC + */ + +package com.dkha.guide.declaration.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 项目申报指南 + * + * @author li.zhan 719901725@qq.com + * @since v1.0.0 2024-01-09 + */ +@Data +@ApiModel(value = "项目申报指南") +public class GuideDeclarationDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "") + private Long id; + + @ApiModelProperty(value = "项目指南名称") + private String guideName; + + @ApiModelProperty(value = "类别(0算法类、1科研类、2技术开发类") + private Integer guideType; + + @ApiModelProperty(value = "级别(0区级、1市级、2省级、3国家级") + private Integer guideLevel; + + @ApiModelProperty(value = "附件地址") + private String attachmentUrl; + + @ApiModelProperty(value = "创建人") + private String creator; + + @ApiModelProperty(value = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date createDate; + +} \ No newline at end of file diff --git a/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/guide/declaration/entity/GuideDeclarationEntity.java b/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/guide/declaration/entity/GuideDeclarationEntity.java new file mode 100644 index 00000000..7a977bc2 --- /dev/null +++ b/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/guide/declaration/entity/GuideDeclarationEntity.java @@ -0,0 +1,48 @@ +/** + * Copyright 2023 UESTC + */ + +package com.dkha.guide.declaration.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; + +import com.dkha.commons.mybatis.entity.BaseEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 项目申报指南 + * + * @author li.zhan 719901725@qq.com + * @since v1.0.0 2024-01-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("zhyy_project_guide_declaration") +public class GuideDeclarationEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 项目指南名称 + */ + private String guideName; + /** + * 类别(0算法类、1科研类、2技术开发类 + */ + private Integer guideType; + /** + * 级别(0区级、1市级、2省级、3国家级 + */ + private Integer guideLevel; + /** + * 附件地址 + */ + private String attachmentUrl; + +} \ No newline at end of file diff --git a/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/guide/declaration/excel/GuideDeclarationExcel.java b/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/guide/declaration/excel/GuideDeclarationExcel.java new file mode 100644 index 00000000..300e1ae3 --- /dev/null +++ b/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/guide/declaration/excel/GuideDeclarationExcel.java @@ -0,0 +1,33 @@ +/** + * Copyright 2023 UESTC + */ + +package com.dkha.guide.declaration.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 项目申报指南 + * + * @author li.zhan 719901725@qq.com + * @since v1.0.0 2024-01-09 + */ +@Data +public class GuideDeclarationExcel { + @Excel(name = "") + private Long id; + @Excel(name = "项目指南名称") + private String guideName; + @Excel(name = "类别(0算法类、1科研类、2技术开发类") + private Integer guideType; + @Excel(name = "级别(0区级、1市级、2省级、3国家级") + private Integer guideLevel; + @Excel(name = "附件地址") + private String attachmentUrl; + @Excel(name = "日期") + private Date creationDate; + +} \ No newline at end of file diff --git a/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/guide/declaration/redis/GuideDeclarationRedis.java b/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/guide/declaration/redis/GuideDeclarationRedis.java new file mode 100644 index 00000000..1e586120 --- /dev/null +++ b/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/guide/declaration/redis/GuideDeclarationRedis.java @@ -0,0 +1,34 @@ +/** + * Copyright 2023 UESTC + */ + +package com.dkha.guide.declaration.redis; + +import com.dkha.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 项目申报指南 + * + * @author li.zhan 719901725@qq.com + * @since v1.0.0 2024-01-09 + */ +@Component +public class GuideDeclarationRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/guide/declaration/service/GuideDeclarationService.java b/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/guide/declaration/service/GuideDeclarationService.java new file mode 100644 index 00000000..97f55ed1 --- /dev/null +++ b/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/guide/declaration/service/GuideDeclarationService.java @@ -0,0 +1,34 @@ +/** + * Copyright 2023 UESTC + */ + +package com.dkha.guide.declaration.service; + +import com.dkha.commons.mybatis.service.BaseService; +import com.dkha.commons.tools.page.PageData; +import com.dkha.guide.declaration.dto.GuideDeclarationDTO; +import com.dkha.guide.declaration.entity.GuideDeclarationEntity; + +import java.util.List; +import java.util.Map; + +/** + * 项目申报指南 + * + * @author li.zhan 719901725@qq.com + * @since v1.0.0 2024-01-09 + */ +public interface GuideDeclarationService extends BaseService { + + PageData page(Map params); + + List list(Map params); + + GuideDeclarationDTO get(String id); + + void save(GuideDeclarationDTO dto); + + void update(GuideDeclarationDTO dto); + + void delete(String[] ids); +} \ No newline at end of file diff --git a/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/guide/declaration/service/impl/GuideDeclarationServiceImpl.java b/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/guide/declaration/service/impl/GuideDeclarationServiceImpl.java new file mode 100644 index 00000000..4b9ea354 --- /dev/null +++ b/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/guide/declaration/service/impl/GuideDeclarationServiceImpl.java @@ -0,0 +1,106 @@ +/** + * Copyright 2023 UESTC + */ + +package com.dkha.guide.declaration.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.dkha.commons.fileupload.minio.MinioUtil; +import com.dkha.commons.mybatis.enums.DelFlagEnum; +import com.dkha.commons.mybatis.service.impl.BaseServiceImpl; +import com.dkha.commons.tools.constant.Constant; +import com.dkha.commons.tools.exception.RenException; +import com.dkha.commons.tools.page.PageData; +import com.dkha.commons.tools.utils.ConvertUtils; +import com.dkha.guide.declaration.dao.GuideDeclarationDao; +import com.dkha.guide.declaration.dto.GuideDeclarationDTO; +import com.dkha.guide.declaration.entity.GuideDeclarationEntity; +import com.dkha.guide.declaration.redis.GuideDeclarationRedis; +import com.dkha.guide.declaration.service.GuideDeclarationService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 项目申报指南 + * + * @author li.zhan 719901725@qq.com + * @since v1.0.0 2024-01-09 + */ +@Service +public class GuideDeclarationServiceImpl extends BaseServiceImpl implements GuideDeclarationService { + @Autowired + private GuideDeclarationRedis GuideDeclarationRedis; + @Autowired + private MinioUtil minioUtil; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, Constant.CREATE_DATE, false), + getWrapper(params) + ); + + return getPageData(page, GuideDeclarationDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GuideDeclarationDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String guideName = (String) params.get("guideName"); + String createDate = (String) params.get("createDate"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.like(StringUtils.isNotBlank(guideName), "guide_name", guideName); + wrapper.like(params.get("guideType") != null, "guide_type", params.get("guideType")); + wrapper.like(params.get("guideLevel") != null, "guide_level", params.get("guideLevel")); + wrapper.like(StringUtils.isNotBlank(createDate), "create_date", createDate); + + return wrapper; + } + + @Override + public GuideDeclarationDTO get(String id) { + GuideDeclarationEntity entity = baseDao.selectById(id); + + return ConvertUtils.sourceToTarget(entity, GuideDeclarationDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GuideDeclarationDTO dto) { + GuideDeclarationEntity entity = ConvertUtils.sourceToTarget(dto, GuideDeclarationEntity.class); + + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GuideDeclarationDTO dto) { + GuideDeclarationEntity entity = ConvertUtils.sourceToTarget(dto, GuideDeclarationEntity.class); + + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + //逻辑删除 + //logicDelete(ids, GuideDeclarationEntity.class); + + //物理删除 + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/scheme/controller/ApplicationSchemeController.java b/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/scheme/controller/ApplicationSchemeController.java new file mode 100644 index 00000000..5a7d08e3 --- /dev/null +++ b/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/scheme/controller/ApplicationSchemeController.java @@ -0,0 +1,107 @@ +/** + * Copyright 2023 UESTC + */ + +package com.dkha.scheme.controller; + +import com.dkha.commons.tools.constant.Constant; +import com.dkha.commons.tools.page.PageData; +import com.dkha.commons.tools.excel.ExcelUtils; +import com.dkha.commons.tools.utils.Result; +import com.dkha.commons.tools.validator.AssertUtils; +import com.dkha.commons.tools.validator.ValidatorUtils; +import com.dkha.commons.tools.validator.group.AddGroup; +import com.dkha.commons.tools.validator.group.UpdateGroup; +import com.dkha.commons.tools.validator.group.DefaultGroup; +import com.dkha.scheme.dto.ApplicationSchemeDTO; +import com.dkha.scheme.excel.ApplicationSchemeExcel; +import com.dkha.scheme.service.ApplicationSchemeService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * + * + * @author li.zhan 719901725@qq.com + * @since v1.0.0 2024-01-11 + */ +@RestController +@RequestMapping("scheme") +@Api(tags="") +public class ApplicationSchemeController { + @Autowired + private ApplicationSchemeService ApplicationSchemeService; + + @GetMapping("page") + @ApiOperation("分页") + @ApiImplicitParams({ + @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") , + @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") , + @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") , + @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") + }) + public Result> page(@ApiIgnore @RequestParam Map params){ + PageData page = ApplicationSchemeService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + @ApiOperation("信息") + public Result get(@PathVariable("id") String id){ + ApplicationSchemeDTO data = ApplicationSchemeService.get(id); + + return new Result().ok(data); + } + + @PostMapping + @ApiOperation("保存") + public Result save(@RequestBody ApplicationSchemeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + + ApplicationSchemeService.save(dto); + + return new Result(); + } + + @PutMapping + @ApiOperation("修改") + public Result update(@RequestBody ApplicationSchemeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + + ApplicationSchemeService.update(dto); + + return new Result(); + } + + @DeleteMapping + @ApiOperation("删除") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + + ApplicationSchemeService.delete(ids); + + return new Result(); + } + + @GetMapping("export") + @ApiOperation("导出") + public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { + List list = ApplicationSchemeService.list(params); + + ExcelUtils.exportExcelToTarget(response, null, list, ApplicationSchemeExcel.class); + } + +} \ No newline at end of file diff --git a/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/scheme/dao/ApplicationSchemeDao.java b/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/scheme/dao/ApplicationSchemeDao.java new file mode 100644 index 00000000..40e75a3a --- /dev/null +++ b/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/scheme/dao/ApplicationSchemeDao.java @@ -0,0 +1,20 @@ +/** + * Copyright 2023 UESTC + */ + +package com.dkha.scheme.dao; + +import com.dkha.commons.mybatis.dao.BaseDao; +import com.dkha.scheme.entity.ApplicationSchemeEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * + * + * @author li.zhan 719901725@qq.com + * @since v1.0.0 2024-01-11 + */ +@Mapper +public interface ApplicationSchemeDao extends BaseDao { + +} \ No newline at end of file diff --git a/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/scheme/dto/ApplicationSchemeDTO.java b/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/scheme/dto/ApplicationSchemeDTO.java new file mode 100644 index 00000000..d439a23a --- /dev/null +++ b/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/scheme/dto/ApplicationSchemeDTO.java @@ -0,0 +1,58 @@ +/** + * Copyright 2023 UESTC + */ + +package com.dkha.scheme.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.io.Serializable; +import java.util.Date; + +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + + +/** + * @author li.zhan 719901725@qq.com + * @since v1.0.0 2024-01-11 + */ +@Data +@ApiModel(value = "") +public class ApplicationSchemeDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "") + private Long id; + + @ApiModelProperty(value = "计划名称") + private String schemeName; + + @ApiModelProperty(value = "类别(1算法类、2科研类、3技术开发类") + private Integer schemeType; + + @ApiModelProperty(value = "级别(0区级、1市级、2省级、3国家级") + private Integer schemeLevel; + + @ApiModelProperty(value = "计划开始时间") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd") + private Date startDate; + + @ApiModelProperty(value = "计划结束时间") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd") + private Date endDate; + + @ApiModelProperty(value = "创建人") + private String creator; + + @ApiModelProperty(value = "创建时间") + private Date createDate; + + @ApiModelProperty(value = "申报指南id") + private Long guideId; + +} \ No newline at end of file diff --git a/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/scheme/entity/ApplicationSchemeEntity.java b/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/scheme/entity/ApplicationSchemeEntity.java new file mode 100644 index 00000000..b9d808f9 --- /dev/null +++ b/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/scheme/entity/ApplicationSchemeEntity.java @@ -0,0 +1,59 @@ +/** + * Copyright 2023 UESTC + */ + +package com.dkha.scheme.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; + +import com.dkha.commons.mybatis.entity.BaseEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +/** + * + * + * @author li.zhan 719901725@qq.com + * @since v1.0.0 2024-01-11 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("zhyy_project_application_scheme") +public class ApplicationSchemeEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 计划名称 + */ + private String schemeName; + /** + * 类别(1算法类、2科研类、3技术开发类 + */ + private Integer schemeType; + /** + * 级别(0区级、1市级、2省级、3国家级 + */ + private Integer schemeLevel; + /** + * 计划开始时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date startDate; + /** + * 计划结束时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + + private Date endDate; + /** + * 申报指南id + */ + private Long guideId; +} \ No newline at end of file diff --git a/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/scheme/excel/ApplicationSchemeExcel.java b/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/scheme/excel/ApplicationSchemeExcel.java new file mode 100644 index 00000000..f335e69c --- /dev/null +++ b/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/scheme/excel/ApplicationSchemeExcel.java @@ -0,0 +1,39 @@ +/** + * Copyright 2023 UESTC + */ + +package com.dkha.scheme.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * + * + * @author li.zhan 719901725@qq.com + * @since v1.0.0 2024-01-11 + */ +@Data +public class ApplicationSchemeExcel { + @Excel(name = "") + private Long id; + @Excel(name = "计划名称") + private Long schemeName; + @Excel(name = "类别(1算法类、2科研类、3技术开发类") + private Integer schemeType; + @Excel(name = "级别(0区级、1市级、2省级、3国家级") + private Integer schemeLevel; + @Excel(name = "计划开始时间") + private Date startDate; + @Excel(name = "计划结束时间") + private Date endDate; + @Excel(name = "创建人") + private String creator; + @Excel(name = "创建时间") + private Date createDate; + @Excel(name = "申报指南id") + private Long guideId; + +} \ No newline at end of file diff --git a/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/scheme/redis/ApplicationSchemeRedis.java b/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/scheme/redis/ApplicationSchemeRedis.java new file mode 100644 index 00000000..e7bd4289 --- /dev/null +++ b/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/scheme/redis/ApplicationSchemeRedis.java @@ -0,0 +1,34 @@ +/** + * Copyright 2023 UESTC + */ + +package com.dkha.scheme.redis; + +import com.dkha.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * + * + * @author li.zhan 719901725@qq.com + * @since v1.0.0 2024-01-11 + */ +@Component +public class ApplicationSchemeRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/scheme/service/ApplicationSchemeService.java b/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/scheme/service/ApplicationSchemeService.java new file mode 100644 index 00000000..2fbac9e5 --- /dev/null +++ b/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/scheme/service/ApplicationSchemeService.java @@ -0,0 +1,34 @@ +/** + * Copyright 2023 UESTC + */ + +package com.dkha.scheme.service; + +import com.dkha.commons.mybatis.service.BaseService; +import com.dkha.commons.tools.page.PageData; +import com.dkha.scheme.dto.ApplicationSchemeDTO; +import com.dkha.scheme.entity.ApplicationSchemeEntity; + +import java.util.List; +import java.util.Map; + +/** + * + * + * @author li.zhan 719901725@qq.com + * @since v1.0.0 2024-01-11 + */ +public interface ApplicationSchemeService extends BaseService { + + PageData page(Map params); + + List list(Map params); + + ApplicationSchemeDTO get(String id); + + void save(ApplicationSchemeDTO dto); + + void update(ApplicationSchemeDTO dto); + + void delete(String[] ids); +} \ No newline at end of file diff --git a/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/scheme/service/impl/ApplicationSchemeServiceImpl.java b/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/scheme/service/impl/ApplicationSchemeServiceImpl.java new file mode 100644 index 00000000..2ba8d2fd --- /dev/null +++ b/back/dkha-sz-main/dkha-module/dkha-system/dkha-system-server/src/main/java/com/dkha/scheme/service/impl/ApplicationSchemeServiceImpl.java @@ -0,0 +1,99 @@ +/** + * Copyright 2023 UESTC + */ + +package com.dkha.scheme.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.dkha.commons.mybatis.service.impl.BaseServiceImpl; +import com.dkha.commons.tools.constant.Constant; +import com.dkha.commons.tools.page.PageData; +import com.dkha.commons.tools.utils.ConvertUtils; +import com.dkha.scheme.dao.ApplicationSchemeDao; +import com.dkha.scheme.dto.ApplicationSchemeDTO; +import com.dkha.scheme.entity.ApplicationSchemeEntity; +import com.dkha.scheme.redis.ApplicationSchemeRedis; +import com.dkha.scheme.service.ApplicationSchemeService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * + * + * @author li.zhan 719901725@qq.com + * @since v1.0.0 2024-01-11 + */ +@Service +public class ApplicationSchemeServiceImpl extends BaseServiceImpl implements ApplicationSchemeService { + @Autowired + private ApplicationSchemeRedis ApplicationSchemeRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, Constant.CREATE_DATE, false), + getWrapper(params) + ); + + return getPageData(page, ApplicationSchemeDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ApplicationSchemeDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String schemeName = (String) params.get("schemeName"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.like(StringUtils.isNotBlank(schemeName), "scheme_name", schemeName); + wrapper.like(params.get("schemeType") != null, "scheme_type", params.get("schemeType")); + wrapper.like(params.get("schemeLevel") != null, "scheme_level", params.get("schemeLevel")); + + return wrapper; + } + + @Override + public ApplicationSchemeDTO get(String id) { + ApplicationSchemeEntity entity = baseDao.selectById(id); + + return ConvertUtils.sourceToTarget(entity, ApplicationSchemeDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ApplicationSchemeDTO dto) { + ApplicationSchemeEntity entity = ConvertUtils.sourceToTarget(dto, ApplicationSchemeEntity.class); + + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ApplicationSchemeDTO dto) { + ApplicationSchemeEntity entity = ConvertUtils.sourceToTarget(dto, ApplicationSchemeEntity.class); + + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + //逻辑删除 + //logicDelete(ids, ApplicationSchemeEntity.class); + + //物理删除 + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/front/dkha-web-sz-main/src/views/modules/guide-declaration/guidedeclaration-add-or-update.vue b/front/dkha-web-sz-main/src/views/modules/guide-declaration/guidedeclaration-add-or-update.vue new file mode 100644 index 00000000..970e5d3d --- /dev/null +++ b/front/dkha-web-sz-main/src/views/modules/guide-declaration/guidedeclaration-add-or-update.vue @@ -0,0 +1,183 @@ + + + diff --git a/front/dkha-web-sz-main/src/views/modules/guide-declaration/guidedeclaration.vue b/front/dkha-web-sz-main/src/views/modules/guide-declaration/guidedeclaration.vue new file mode 100644 index 00000000..30fd8835 --- /dev/null +++ b/front/dkha-web-sz-main/src/views/modules/guide-declaration/guidedeclaration.vue @@ -0,0 +1,182 @@ + + + diff --git a/front/dkha-web-sz-main/src/views/modules/scheme/applicationscheme-add-or-update.vue b/front/dkha-web-sz-main/src/views/modules/scheme/applicationscheme-add-or-update.vue new file mode 100644 index 00000000..e7c1a88a --- /dev/null +++ b/front/dkha-web-sz-main/src/views/modules/scheme/applicationscheme-add-or-update.vue @@ -0,0 +1,203 @@ + + + + diff --git a/front/dkha-web-sz-main/src/views/modules/scheme/applicationscheme.vue b/front/dkha-web-sz-main/src/views/modules/scheme/applicationscheme.vue new file mode 100644 index 00000000..10b4e3fb --- /dev/null +++ b/front/dkha-web-sz-main/src/views/modules/scheme/applicationscheme.vue @@ -0,0 +1,127 @@ + + +