浏览代码

应用管理

wangtuohang@126.com 2 月之前
父节点
当前提交
f362306dda
共有 20 个文件被更改,包括 1090 次插入0 次删除
  1. 139 0
      src/main/java/org/springblade/modules/application/history/controller/ApplicationHistoryController.java
  2. 94 0
      src/main/java/org/springblade/modules/application/history/excel/ApplicationHistoryExcel.java
  3. 38 0
      src/main/java/org/springblade/modules/application/history/mapper/ApplicationHistoryMapper.java
  4. 35 0
      src/main/java/org/springblade/modules/application/history/mapper/ApplicationHistoryMapper.xml
  5. 21 0
      src/main/java/org/springblade/modules/application/history/pojo/dto/ApplicationHistoryDTO.java
  6. 82 0
      src/main/java/org/springblade/modules/application/history/pojo/entity/ApplicationHistoryEntity.java
  7. 21 0
      src/main/java/org/springblade/modules/application/history/pojo/vo/ApplicationHistoryVO.java
  8. 36 0
      src/main/java/org/springblade/modules/application/history/service/IApplicationHistoryService.java
  9. 37 0
      src/main/java/org/springblade/modules/application/history/service/impl/ApplicationHistoryServiceImpl.java
  10. 32 0
      src/main/java/org/springblade/modules/application/history/wrapper/ApplicationHistoryWrapper.java
  11. 157 0
      src/main/java/org/springblade/modules/application/info/controller/ApplicationInfoController.java
  12. 94 0
      src/main/java/org/springblade/modules/application/info/excel/ApplicationInfoExcel.java
  13. 39 0
      src/main/java/org/springblade/modules/application/info/mapper/ApplicationInfoMapper.java
  14. 35 0
      src/main/java/org/springblade/modules/application/info/mapper/ApplicationInfoMapper.xml
  15. 21 0
      src/main/java/org/springblade/modules/application/info/pojo/dto/ApplicationInfoDTO.java
  16. 81 0
      src/main/java/org/springblade/modules/application/info/pojo/entity/ApplicationInfoEntity.java
  17. 21 0
      src/main/java/org/springblade/modules/application/info/pojo/vo/ApplicationInfoVO.java
  18. 37 0
      src/main/java/org/springblade/modules/application/info/service/IApplicationInfoService.java
  19. 38 0
      src/main/java/org/springblade/modules/application/info/service/impl/ApplicationInfoServiceImpl.java
  20. 32 0
      src/main/java/org/springblade/modules/application/info/wrapper/ApplicationInfoWrapper.java

+ 139 - 0
src/main/java/org/springblade/modules/application/history/controller/ApplicationHistoryController.java

@@ -0,0 +1,139 @@
+package org.springblade.modules.application.history.controller;
+
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import jakarta.validation.Valid;
+
+import org.springblade.core.secure.BladeUser;
+import org.springblade.core.secure.annotation.PreAuth;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.application.history.excel.ApplicationHistoryExcel;
+import org.springblade.modules.application.history.pojo.entity.ApplicationHistoryEntity;
+import org.springblade.modules.application.history.pojo.vo.ApplicationHistoryVO;
+import org.springblade.modules.application.history.service.IApplicationHistoryService;
+import org.springblade.modules.application.history.wrapper.ApplicationHistoryWrapper;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.tool.utils.DateUtil;
+import org.springblade.core.excel.util.ExcelUtil;
+import org.springblade.core.tool.constant.BladeConstant;
+import org.springblade.core.tool.constant.RoleConstant;
+
+import java.util.Map;
+import java.util.List;
+
+import jakarta.servlet.http.HttpServletResponse;
+
+/**
+ * 应用历史 控制器
+ *
+ * @author BladeX
+ * @since 2024-10-15
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("blade-history/history")
+@Tag(name = "应用历史", description = "应用历史接口")
+public class ApplicationHistoryController extends BladeController {
+
+	private final IApplicationHistoryService applicationHistoryService;
+
+	/**
+	 * 应用历史 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@Operation(summary = "详情", description = "传入history")
+	public R<ApplicationHistoryVO> detail(ApplicationHistoryEntity history) {
+		ApplicationHistoryEntity detail = applicationHistoryService.getOne(Condition.getQueryWrapper(history));
+		return R.data(ApplicationHistoryWrapper.build().entityVO(detail));
+	}
+
+	/**
+	 * 应用历史 分页
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@Operation(summary = "分页", description = "传入history")
+	public R<IPage<ApplicationHistoryVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> history, Query query) {
+		IPage<ApplicationHistoryEntity> pages = applicationHistoryService.page(Condition.getPage(query), Condition.getQueryWrapper(history, ApplicationHistoryEntity.class));
+		return R.data(ApplicationHistoryWrapper.build().pageVO(pages));
+	}
+
+	/**
+	 * 应用历史 自定义分页
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@Operation(summary = "分页", description = "传入history")
+	public R<IPage<ApplicationHistoryVO>> page(ApplicationHistoryVO history, Query query) {
+		IPage<ApplicationHistoryVO> pages = applicationHistoryService.selectHistoryPage(Condition.getPage(query), history);
+		return R.data(pages);
+	}
+
+	/**
+	 * 应用历史 新增
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@Operation(summary = "新增", description = "传入history")
+	public R save(@Valid @RequestBody ApplicationHistoryEntity history) {
+		return R.status(applicationHistoryService.save(history));
+	}
+
+	/**
+	 * 应用历史 修改
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@Operation(summary = "修改", description = "传入history")
+	public R update(@Valid @RequestBody ApplicationHistoryEntity history) {
+		return R.status(applicationHistoryService.updateById(history));
+	}
+
+	/**
+	 * 应用历史 新增或修改
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@Operation(summary = "新增或修改", description = "传入history")
+	public R submit(@Valid @RequestBody ApplicationHistoryEntity history) {
+		return R.status(applicationHistoryService.saveOrUpdate(history));
+	}
+
+	/**
+	 * 应用历史 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 7)
+	@Operation(summary = "逻辑删除", description = "传入ids")
+	public R remove(@Parameter(name = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(applicationHistoryService.deleteLogic(Func.toLongList(ids)));
+	}
+
+	/**
+	 * 导出数据
+	 */
+	@PreAuth(RoleConstant.HAS_ROLE_ADMIN)
+	@GetMapping("/export-history")
+	@ApiOperationSupport(order = 9)
+	@Operation(summary = "导出数据", description = "传入history")
+	public void exportHistory(@Parameter(hidden = true) @RequestParam Map<String, Object> history, BladeUser bladeUser, HttpServletResponse response) {
+		QueryWrapper<ApplicationHistoryEntity> queryWrapper = Condition.getQueryWrapper(history, ApplicationHistoryEntity.class);
+		//if (!AuthUtil.isAdministrator()) {
+		//	queryWrapper.lambda().eq(History::getTenantId, bladeUser.getTenantId());
+		//}
+		queryWrapper.lambda().eq(ApplicationHistoryEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
+		List<ApplicationHistoryExcel> list = applicationHistoryService.exportHistory(queryWrapper);
+		ExcelUtil.export(response, "应用历史数据" + DateUtil.time(), "应用历史数据表", list, ApplicationHistoryExcel.class);
+	}
+
+}

+ 94 - 0
src/main/java/org/springblade/modules/application/history/excel/ApplicationHistoryExcel.java

@@ -0,0 +1,94 @@
+package org.springblade.modules.application.history.excel;
+
+import lombok.Data;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import java.io.Serializable;
+import java.io.Serial;
+
+/**
+ * 应用历史 Excel实体类
+ *
+ * @author BladeX
+ * @since 2024-10-15
+ */
+@Data
+@ColumnWidth(25)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class ApplicationHistoryExcel implements Serializable {
+
+	@Serial
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 是否已删除
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("是否已删除")
+	private Integer isDeleted;
+	/**
+	 * 应用名称
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("应用名称")
+	private String name;
+	/**
+	 * 应用图标
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("应用图标")
+	private String icon;
+	/**
+	 * 应用类型 1=互联网 2=公安网
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("应用类型 1=互联网 2=公安网")
+	private Integer type;
+	/**
+	 * 应用地址
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("应用地址")
+	private String link;
+	/**
+	 * 版本代码
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("版本代码")
+	private Integer versionCode;
+	/**
+	 * 版本信息
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("版本信息")
+	private String versionName;
+	/**
+	 * 本次更新内容
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("本次更新内容")
+	private String versionDescription;
+	/**
+	 * 包名
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("包名")
+	private String packageName;
+	/**
+	 * md5
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("md5")
+	private String md5Value;
+	/**
+	 * 启动路径
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("启动路径")
+	private String qdlj;
+
+}

+ 38 - 0
src/main/java/org/springblade/modules/application/history/mapper/ApplicationHistoryMapper.java

@@ -0,0 +1,38 @@
+package org.springblade.modules.application.history.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.modules.application.history.excel.ApplicationHistoryExcel;
+import org.springblade.modules.application.history.pojo.entity.ApplicationHistoryEntity;
+import org.springblade.modules.application.history.pojo.vo.ApplicationHistoryVO;
+
+import java.util.List;
+
+/**
+ * 应用历史 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2024-10-15
+ */
+public interface ApplicationHistoryMapper extends BaseMapper<ApplicationHistoryEntity> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param history
+	 * @return
+	 */
+	List<ApplicationHistoryVO> selectHistoryPage(IPage page, ApplicationHistoryVO history);
+
+	/**
+	 * 获取导出数据
+	 *
+	 * @param queryWrapper
+	 * @return
+	 */
+	List<ApplicationHistoryExcel> exportHistory(@Param("ew") Wrapper<ApplicationHistoryEntity> queryWrapper);
+
+}

+ 35 - 0
src/main/java/org/springblade/modules/application/history/mapper/ApplicationHistoryMapper.xml

@@ -0,0 +1,35 @@
+<?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="org.springblade.modules.application.history.mapper.ApplicationHistoryMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="historyResultMap" type="org.springblade.modules.application.history.pojo.entity.ApplicationHistoryEntity">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="name" property="name"/>
+        <result column="icon" property="icon"/>
+        <result column="type" property="type"/>
+        <result column="link" property="link"/>
+        <result column="version_code" property="versionCode"/>
+        <result column="version_name" property="versionName"/>
+        <result column="version_description" property="versionDescription"/>
+        <result column="package_name" property="packageName"/>
+        <result column="md5_value" property="md5Value"/>
+        <result column="qdlj" property="qdlj"/>
+    </resultMap>
+
+    <select id="selectHistoryPage" resultMap="historyResultMap">
+        select * from application_history where is_deleted = 0
+    </select>
+
+    <select id="exportHistory" resultType="org.springblade.modules.application.history.excel.ApplicationHistoryExcel">
+        SELECT * FROM application_history ${ew.customSqlSegment}
+    </select>
+
+</mapper>

+ 21 - 0
src/main/java/org/springblade/modules/application/history/pojo/dto/ApplicationHistoryDTO.java

@@ -0,0 +1,21 @@
+package org.springblade.modules.application.history.pojo.dto;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.modules.application.history.pojo.entity.ApplicationHistoryEntity;
+
+import java.io.Serial;
+
+/**
+ * 应用历史 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2024-10-15
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ApplicationHistoryDTO extends ApplicationHistoryEntity {
+	@Serial
+	private static final long serialVersionUID = 1L;
+
+}

+ 82 - 0
src/main/java/org/springblade/modules/application/history/pojo/entity/ApplicationHistoryEntity.java

@@ -0,0 +1,82 @@
+package org.springblade.modules.application.history.pojo.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+import org.springblade.core.tenant.mp.TenantEntity;
+
+/**
+ * 应用历史 实体类
+ *
+ * @author BladeX
+ * @since 2024-10-15
+ */
+@Data
+@TableName("application_history")
+@Schema(description = "application_history对象")
+@EqualsAndHashCode(callSuper = true)
+public class ApplicationHistoryEntity extends BaseEntity {
+
+	/**
+	 * 应用名称
+	 */
+	@Schema(description = "应用名称")
+	private String name;
+	/**
+	 * 应用图标
+	 */
+	@Schema(description = "应用图标")
+	private String icon;
+	/**
+	 * 网络类型 1=互联网 2=公安网
+	 */
+	@Schema(description = "网络类型 1=互联网 2=公安网")
+	private Integer wlType;
+	/**
+	 * 应用类型 1=apk 2=小程序
+	 */
+	@Schema(description = "应用类型 1=apk 2=小程序")
+	private Integer yyType;
+	/**
+	 * 应用地址
+	 */
+	@Schema(description = "应用地址")
+	private String link;
+	/**
+	 * 版本代码
+	 */
+	@Schema(description = "版本代码")
+	private Integer versionCode;
+	/**
+	 * 版本信息
+	 */
+	@Schema(description = "版本信息")
+	private String versionName;
+	/**
+	 * 本次更新内容
+	 */
+	@Schema(description = "本次更新内容")
+	private String versionDescription;
+	/**
+	 * 包名
+	 */
+	@Schema(description = "包名")
+	private String packageName;
+	/**
+	 * md5
+	 */
+	@Schema(description = "md5")
+	private String md5Value;
+	/**
+	 * 启动路径
+	 */
+	@Schema(description = "启动路径")
+	private String qdlj;
+	/**
+	 * 统一接口地址
+	 */
+	@Schema(description = "统一接口地址")
+	private String jkdz;
+}

+ 21 - 0
src/main/java/org/springblade/modules/application/history/pojo/vo/ApplicationHistoryVO.java

@@ -0,0 +1,21 @@
+package org.springblade.modules.application.history.pojo.vo;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.modules.application.history.pojo.entity.ApplicationHistoryEntity;
+
+import java.io.Serial;
+
+/**
+ * 应用历史 视图实体类
+ *
+ * @author BladeX
+ * @since 2024-10-15
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ApplicationHistoryVO extends ApplicationHistoryEntity {
+	@Serial
+	private static final long serialVersionUID = 1L;
+
+}

+ 36 - 0
src/main/java/org/springblade/modules/application/history/service/IApplicationHistoryService.java

@@ -0,0 +1,36 @@
+package org.springblade.modules.application.history.service;
+
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.modules.application.history.excel.ApplicationHistoryExcel;
+import org.springblade.modules.application.history.pojo.entity.ApplicationHistoryEntity;
+import org.springblade.modules.application.history.pojo.vo.ApplicationHistoryVO;
+
+import java.util.List;
+
+/**
+ * 应用历史 服务类
+ *
+ * @author BladeX
+ * @since 2024-10-15
+ */
+public interface IApplicationHistoryService extends BaseService<ApplicationHistoryEntity> {
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param history
+	 * @return
+	 */
+	IPage<ApplicationHistoryVO> selectHistoryPage(IPage<ApplicationHistoryVO> page, ApplicationHistoryVO history);
+
+	/**
+	 * 导出数据
+	 *
+	 * @param queryWrapper
+	 * @return
+	 */
+	List<ApplicationHistoryExcel> exportHistory(Wrapper<ApplicationHistoryEntity> queryWrapper);
+
+}

+ 37 - 0
src/main/java/org/springblade/modules/application/history/service/impl/ApplicationHistoryServiceImpl.java

@@ -0,0 +1,37 @@
+package org.springblade.modules.application.history.service.impl;
+
+import org.springblade.modules.application.history.excel.ApplicationHistoryExcel;
+import org.springblade.modules.application.history.mapper.ApplicationHistoryMapper;
+import org.springblade.modules.application.history.pojo.entity.ApplicationHistoryEntity;
+import org.springblade.modules.application.history.pojo.vo.ApplicationHistoryVO;
+import org.springblade.modules.application.history.service.IApplicationHistoryService;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import java.util.List;
+
+/**
+ * 应用历史 服务实现类
+ *
+ * @author BladeX
+ * @since 2024-10-15
+ */
+@Service
+public class ApplicationHistoryServiceImpl extends BaseServiceImpl<ApplicationHistoryMapper, ApplicationHistoryEntity> implements IApplicationHistoryService {
+
+	@Override
+	public IPage<ApplicationHistoryVO> selectHistoryPage(IPage<ApplicationHistoryVO> page, ApplicationHistoryVO history) {
+		return page.setRecords(baseMapper.selectHistoryPage(page, history));
+	}
+
+	@Override
+	public List<ApplicationHistoryExcel> exportHistory(Wrapper<ApplicationHistoryEntity> queryWrapper) {
+		List<ApplicationHistoryExcel> historyList = baseMapper.exportHistory(queryWrapper);
+		//historyList.forEach(history -> {
+		//	history.setTypeName(DictCache.getValue(DictEnum.YES_NO, History.getType()));
+		//});
+		return historyList;
+	}
+
+}

+ 32 - 0
src/main/java/org/springblade/modules/application/history/wrapper/ApplicationHistoryWrapper.java

@@ -0,0 +1,32 @@
+package org.springblade.modules.application.history.wrapper;
+
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.modules.application.history.pojo.entity.ApplicationHistoryEntity;
+import org.springblade.modules.application.history.pojo.vo.ApplicationHistoryVO;
+
+import java.util.Objects;
+
+/**
+ * 应用历史 包装类,返回视图层所需的字段
+ *
+ * @author BladeX
+ * @since 2024-10-15
+ */
+public class ApplicationHistoryWrapper extends BaseEntityWrapper<ApplicationHistoryEntity, ApplicationHistoryVO> {
+
+	public static ApplicationHistoryWrapper build() {
+		return new ApplicationHistoryWrapper();
+	}
+
+	@Override
+	public ApplicationHistoryVO entityVO(ApplicationHistoryEntity history) {
+		ApplicationHistoryVO historyVO = Objects.requireNonNull(BeanUtil.copyProperties(history, ApplicationHistoryVO.class));
+		//User createUser = UserCache.getUser(history.getCreateUser());
+		//User updateUser = UserCache.getUser(history.getUpdateUser());
+		//historyVO.setCreateUserName(createUser.getName());
+		//historyVO.setUpdateUserName(updateUser.getName());
+		return historyVO;
+	}
+
+}

+ 157 - 0
src/main/java/org/springblade/modules/application/info/controller/ApplicationInfoController.java

@@ -0,0 +1,157 @@
+package org.springblade.modules.application.info.controller;
+
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import jakarta.validation.Valid;
+
+import org.springblade.core.redis.cache.BladeRedis;
+import org.springblade.core.secure.BladeUser;
+import org.springblade.core.secure.annotation.PreAuth;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.application.history.pojo.entity.ApplicationHistoryEntity;
+import org.springblade.modules.application.history.service.IApplicationHistoryService;
+import org.springblade.modules.application.info.excel.ApplicationInfoExcel;
+import org.springblade.modules.application.info.pojo.entity.ApplicationInfoEntity;
+import org.springblade.modules.application.info.pojo.vo.ApplicationInfoVO;
+import org.springblade.modules.application.info.service.IApplicationInfoService;
+import org.springblade.modules.application.info.wrapper.ApplicationInfoWrapper;
+import org.springframework.beans.BeanUtils;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.tool.utils.DateUtil;
+import org.springblade.core.excel.util.ExcelUtil;
+import org.springblade.core.tool.constant.BladeConstant;
+import org.springblade.core.tool.constant.RoleConstant;
+import java.util.Map;
+import java.util.List;
+import jakarta.servlet.http.HttpServletResponse;
+
+/**
+ * 应用列表 控制器
+ *
+ * @author BladeX
+ * @since 2024-10-15
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("blade-info/info")
+@Tag(name = "应用列表", description = "应用列表接口")
+public class ApplicationInfoController extends BladeController {
+
+	private final BladeRedis bladeRedis;
+
+	private final IApplicationInfoService applicationInfoService;
+
+	private final IApplicationHistoryService applicationHistoryService;
+
+	/**
+	 * 应用列表 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@Operation(summary = "详情", description  = "传入info")
+	public R<ApplicationInfoVO> detail(ApplicationInfoEntity info) {
+		ApplicationInfoEntity detail = applicationInfoService.getOne(Condition.getQueryWrapper(info));
+		return R.data(ApplicationInfoWrapper.build().entityVO(detail));
+	}
+	/**
+	 * 应用列表 分页
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@Operation(summary = "分页", description  = "传入info")
+	public R<IPage<ApplicationInfoVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> info, Query query) {
+		IPage<ApplicationInfoEntity> pages = applicationInfoService.page(Condition.getPage(query), Condition.getQueryWrapper(info, ApplicationInfoEntity.class));
+		return R.data(ApplicationInfoWrapper.build().pageVO(pages));
+	}
+
+	/**
+	 * 应用列表 自定义分页
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@Operation(summary = "分页", description  = "传入info")
+	public R<IPage<ApplicationInfoVO>> page(@RequestParam Map<String, Object> params, Query query) {
+		IPage<ApplicationInfoVO> pages = applicationInfoService.selectInfoPage(Condition.getPage(query), params);
+		return R.data(pages);
+	}
+
+	/**
+	 * 应用列表 新增
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@Operation(summary = "新增", description  = "传入info")
+	public R save(@Valid @RequestBody ApplicationInfoEntity info) {
+		return R.status(applicationInfoService.save(info));
+	}
+
+	/**
+	 * 应用列表 修改
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@Operation(summary = "修改", description  = "传入info")
+	public R update(@Valid @RequestBody ApplicationInfoEntity info) {
+		return R.status(applicationInfoService.updateById(info));
+	}
+
+	/**
+	 * 应用列表 新增或修改
+	 */
+	@Transactional
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@Operation(summary = "新增或修改", description  = "传入info")
+	public R submit(@Valid @RequestBody ApplicationInfoEntity infoEntity) {
+//		if (infoEntity.getId() != null) {
+//			bladeRedis.del(infoEntity.getId().toString());
+//		}
+		applicationInfoService.saveOrUpdate(infoEntity);
+		// 保存记录
+		ApplicationHistoryEntity historyEntity = new ApplicationHistoryEntity();
+		BeanUtils.copyProperties(infoEntity, historyEntity);
+		applicationHistoryService.save(historyEntity);
+		// 修改缓存
+//		bladeRedis.set(infoEntity.getId().toString(), infoEntity.getJkdz());
+		return R.status(true);
+	}
+
+	/**
+	 * 应用列表 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 7)
+	@Operation(summary = "逻辑删除", description  = "传入ids")
+	public R remove(@Parameter(name = "主键集合", required = true) @RequestParam String ids) {
+		bladeRedis.del(ids.split(","));
+		return R.status(applicationInfoService.deleteLogic(Func.toLongList(ids)));
+	}
+
+	/**
+	 * 导出数据
+	 */
+	@PreAuth(RoleConstant.HAS_ROLE_ADMIN)
+	@GetMapping("/export-info")
+	@ApiOperationSupport(order = 9)
+	@Operation(summary = "导出数据", description  = "传入info")
+	public void exportInfo(@Parameter(hidden = true) @RequestParam Map<String, Object> info, BladeUser bladeUser, HttpServletResponse response) {
+		QueryWrapper<ApplicationInfoEntity> queryWrapper = Condition.getQueryWrapper(info, ApplicationInfoEntity.class);
+		//if (!AuthUtil.isAdministrator()) {
+		//	queryWrapper.lambda().eq(Info::getTenantId, bladeUser.getTenantId());
+		//}
+		queryWrapper.lambda().eq(ApplicationInfoEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
+		List<ApplicationInfoExcel> list = applicationInfoService.exportInfo(queryWrapper);
+		ExcelUtil.export(response, "应用列表数据" + DateUtil.time(), "应用列表数据表", list, ApplicationInfoExcel.class);
+	}
+
+}

+ 94 - 0
src/main/java/org/springblade/modules/application/info/excel/ApplicationInfoExcel.java

@@ -0,0 +1,94 @@
+package org.springblade.modules.application.info.excel;
+
+import lombok.Data;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import java.io.Serializable;
+import java.io.Serial;
+
+/**
+ * 应用列表 Excel实体类
+ *
+ * @author BladeX
+ * @since 2024-10-15
+ */
+@Data
+@ColumnWidth(25)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class ApplicationInfoExcel implements Serializable {
+
+	@Serial
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 是否已删除
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("是否已删除")
+	private Integer isDeleted;
+	/**
+	 * 应用名称
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("应用名称")
+	private String name;
+	/**
+	 * 应用图标
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("应用图标")
+	private String icon;
+	/**
+	 * 应用类型 1=互联网 2=公安网
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("应用类型 1=互联网 2=公安网")
+	private Integer type;
+	/**
+	 * 应用地址
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("应用地址")
+	private String link;
+	/**
+	 * 版本代码
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("版本代码")
+	private Integer versionCode;
+	/**
+	 * 版本信息
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("版本信息")
+	private String versionName;
+	/**
+	 * 本次更新内容
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("本次更新内容")
+	private String versionDescription;
+	/**
+	 * 包名
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("包名")
+	private String packageName;
+	/**
+	 * md5
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("md5")
+	private String md5Value;
+	/**
+	 * 启动路径
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("启动路径")
+	private String qdlj;
+
+}

+ 39 - 0
src/main/java/org/springblade/modules/application/info/mapper/ApplicationInfoMapper.java

@@ -0,0 +1,39 @@
+package org.springblade.modules.application.info.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.modules.application.info.excel.ApplicationInfoExcel;
+import org.springblade.modules.application.info.pojo.entity.ApplicationInfoEntity;
+import org.springblade.modules.application.info.pojo.vo.ApplicationInfoVO;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 应用列表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2024-10-15
+ */
+public interface ApplicationInfoMapper extends BaseMapper<ApplicationInfoEntity> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param params
+	 * @return
+	 */
+	List<ApplicationInfoVO> selectInfoPage(IPage page, @Param("params") Map<String, Object> params);
+
+	/**
+	 * 获取导出数据
+	 *
+	 * @param queryWrapper
+	 * @return
+	 */
+	List<ApplicationInfoExcel> exportInfo(@Param("ew") Wrapper<ApplicationInfoEntity> queryWrapper);
+
+}

+ 35 - 0
src/main/java/org/springblade/modules/application/info/mapper/ApplicationInfoMapper.xml

@@ -0,0 +1,35 @@
+<?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="org.springblade.modules.application.info.mapper.ApplicationInfoMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="infoResultMap" type="org.springblade.modules.application.info.pojo.entity.ApplicationInfoEntity">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="name" property="name"/>
+        <result column="icon" property="icon"/>
+        <result column="type" property="type"/>
+        <result column="link" property="link"/>
+        <result column="version_code" property="versionCode"/>
+        <result column="version_name" property="versionName"/>
+        <result column="version_description" property="versionDescription"/>
+        <result column="package_name" property="packageName"/>
+        <result column="md5_value" property="md5Value"/>
+        <result column="qdlj" property="qdlj"/>
+    </resultMap>
+
+    <select id="selectInfoPage" resultMap="infoResultMap">
+        select * from application_info where is_deleted = 0
+    </select>
+
+    <select id="exportInfo" resultType="org.springblade.modules.application.info.excel.ApplicationInfoExcel">
+        SELECT * FROM application_info ${ew.customSqlSegment}
+    </select>
+
+</mapper>

+ 21 - 0
src/main/java/org/springblade/modules/application/info/pojo/dto/ApplicationInfoDTO.java

@@ -0,0 +1,21 @@
+package org.springblade.modules.application.info.pojo.dto;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.modules.application.info.pojo.entity.ApplicationInfoEntity;
+
+import java.io.Serial;
+
+/**
+ * 应用列表 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2024-10-15
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ApplicationInfoDTO extends ApplicationInfoEntity {
+	@Serial
+	private static final long serialVersionUID = 1L;
+
+}

+ 81 - 0
src/main/java/org/springblade/modules/application/info/pojo/entity/ApplicationInfoEntity.java

@@ -0,0 +1,81 @@
+package org.springblade.modules.application.info.pojo.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+/**
+ * 应用列表 实体类
+ *
+ * @author BladeX
+ * @since 2024-10-15
+ */
+@Data
+@TableName("application_info")
+@Schema(description = "Info对象")
+@EqualsAndHashCode(callSuper = true)
+public class ApplicationInfoEntity extends BaseEntity {
+
+	/**
+	 * 应用名称
+	 */
+	@Schema(description = "应用名称")
+	private String name;
+	/**
+	 * 应用图标
+	 */
+	@Schema(description = "应用图标")
+	private String icon;
+	/**
+	 * 网络类型 1=互联网 2=公安网
+	 */
+	@Schema(description = "网络类型 1=互联网 2=公安网")
+	private Integer wlType;
+	/**
+	 * 应用类型 1=apk 2=小程序
+	 */
+	@Schema(description = "应用类型 1=apk 2=小程序")
+	private Integer yyType;
+	/**
+	 * 应用地址
+	 */
+	@Schema(description = "应用地址")
+	private String link;
+	/**
+	 * 版本代码
+	 */
+	@Schema(description = "版本代码")
+	private Integer versionCode;
+	/**
+	 * 版本信息
+	 */
+	@Schema(description = "版本信息")
+	private String versionName;
+	/**
+	 * 本次更新内容
+	 */
+	@Schema(description = "本次更新内容")
+	private String versionDescription;
+	/**
+	 * 包名
+	 */
+	@Schema(description = "包名")
+	private String packageName;
+	/**
+	 * md5
+	 */
+	@Schema(description = "md5")
+	private String md5Value;
+	/**
+	 * 启动路径
+	 */
+	@Schema(description = "启动路径")
+	private String qdlj;
+	/**
+	 * 统一接口地址
+	 */
+	@Schema(description = "统一接口地址")
+	private String jkdz;
+}

+ 21 - 0
src/main/java/org/springblade/modules/application/info/pojo/vo/ApplicationInfoVO.java

@@ -0,0 +1,21 @@
+package org.springblade.modules.application.info.pojo.vo;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.modules.application.info.pojo.entity.ApplicationInfoEntity;
+
+import java.io.Serial;
+
+/**
+ * 应用列表 视图实体类
+ *
+ * @author BladeX
+ * @since 2024-10-15
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ApplicationInfoVO extends ApplicationInfoEntity {
+	@Serial
+	private static final long serialVersionUID = 1L;
+
+}

+ 37 - 0
src/main/java/org/springblade/modules/application/info/service/IApplicationInfoService.java

@@ -0,0 +1,37 @@
+package org.springblade.modules.application.info.service;
+
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.modules.application.info.excel.ApplicationInfoExcel;
+import org.springblade.modules.application.info.pojo.entity.ApplicationInfoEntity;
+import org.springblade.modules.application.info.pojo.vo.ApplicationInfoVO;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 应用列表 服务类
+ *
+ * @author BladeX
+ * @since 2024-10-15
+ */
+public interface IApplicationInfoService extends BaseService<ApplicationInfoEntity> {
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param params
+	 * @return
+	 */
+	IPage<ApplicationInfoVO> selectInfoPage(IPage<ApplicationInfoVO> page, Map<String, Object> params);
+
+	/**
+	 * 导出数据
+	 *
+	 * @param queryWrapper
+	 * @return
+	 */
+	List<ApplicationInfoExcel> exportInfo(Wrapper<ApplicationInfoEntity> queryWrapper);
+
+}

+ 38 - 0
src/main/java/org/springblade/modules/application/info/service/impl/ApplicationInfoServiceImpl.java

@@ -0,0 +1,38 @@
+package org.springblade.modules.application.info.service.impl;
+
+import org.springblade.modules.application.info.excel.ApplicationInfoExcel;
+import org.springblade.modules.application.info.mapper.ApplicationInfoMapper;
+import org.springblade.modules.application.info.pojo.entity.ApplicationInfoEntity;
+import org.springblade.modules.application.info.pojo.vo.ApplicationInfoVO;
+import org.springblade.modules.application.info.service.IApplicationInfoService;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.mp.base.BaseServiceImpl;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 应用列表 服务实现类
+ *
+ * @author BladeX
+ * @since 2024-10-15
+ */
+@Service
+public class ApplicationInfoServiceImpl extends BaseServiceImpl<ApplicationInfoMapper, ApplicationInfoEntity> implements IApplicationInfoService {
+
+	@Override
+	public IPage<ApplicationInfoVO> selectInfoPage(IPage<ApplicationInfoVO> page, Map<String, Object> params) {
+		return page.setRecords(baseMapper.selectInfoPage(page, params));
+	}
+
+	@Override
+	public List<ApplicationInfoExcel> exportInfo(Wrapper<ApplicationInfoEntity> queryWrapper) {
+		List<ApplicationInfoExcel> infoList = baseMapper.exportInfo(queryWrapper);
+		//infoList.forEach(info -> {
+		//	info.setTypeName(DictCache.getValue(DictEnum.YES_NO, Info.getType()));
+		//});
+		return infoList;
+	}
+}

+ 32 - 0
src/main/java/org/springblade/modules/application/info/wrapper/ApplicationInfoWrapper.java

@@ -0,0 +1,32 @@
+package org.springblade.modules.application.info.wrapper;
+
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.modules.application.info.pojo.entity.ApplicationInfoEntity;
+import org.springblade.modules.application.info.pojo.vo.ApplicationInfoVO;
+
+import java.util.Objects;
+
+/**
+ * 应用列表 包装类,返回视图层所需的字段
+ *
+ * @author BladeX
+ * @since 2024-10-15
+ */
+public class ApplicationInfoWrapper extends BaseEntityWrapper<ApplicationInfoEntity, ApplicationInfoVO> {
+
+	public static ApplicationInfoWrapper build() {
+		return new ApplicationInfoWrapper();
+	}
+
+	@Override
+	public ApplicationInfoVO entityVO(ApplicationInfoEntity info) {
+		ApplicationInfoVO infoVO = Objects.requireNonNull(BeanUtil.copyProperties(info, ApplicationInfoVO.class));
+		//User createUser = UserCache.getUser(info.getCreateUser());
+		//User updateUser = UserCache.getUser(info.getUpdateUser());
+		//infoVO.setCreateUserName(createUser.getName());
+		//infoVO.setUpdateUserName(updateUser.getName());
+		return infoVO;
+	}
+
+}