洪城义警-正式版后台
zengh
2022-05-24 82b999fe00c856dfd68f58ee0972dd634605a203
1、注册调整
2、批量审核
7 files modified
8 files added
482 ■■■■■ changed files
src/main/java/org/springblade/common/config/BladeConfiguration.java 1 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/version/controller/VersionController.java 129 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/version/dto/VersionDTO.java 34 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/version/entity/Version.java 72 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/version/mapper/VersionMapper.java 42 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/version/mapper/VersionMapper.xml 23 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/version/service/IVersionService.java 43 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/version/service/impl/VersionServiceImpl.java 43 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/version/vo/VersionVO.java 36 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/zc/controller/ZcController.java 12 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/zc/mapper/ZcMapper.java 1 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/zc/mapper/ZcMapper.xml 8 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/zc/service/IZcService.java 3 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/zc/service/impl/ZcServiceImpl.java 7 ●●●●● patch | view | raw | blame | history
src/main/resources/application-dev.yml 28 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/common/config/BladeConfiguration.java
@@ -111,6 +111,7 @@
        secureRegistry.excludePathPatterns("/vote/vote/**");
        secureRegistry.excludePathPatterns("/useroption/useroption/**");
        secureRegistry.excludePathPatterns("/energyTree/**");
        secureRegistry.excludePathPatterns("/version/**");
        return secureRegistry;
    }
src/main/java/org/springblade/modules/version/controller/VersionController.java
New file
@@ -0,0 +1,129 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.version.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
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.version.entity.Version;
import org.springblade.modules.version.service.IVersionService;
import org.springblade.modules.version.vo.VersionVO;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.List;
/**
 * 控制器
 * 版本更新
 *
 * @author BladeX
 * @since 2022-01-06
 */
@RestController
@AllArgsConstructor
@RequestMapping("/version")
@Api(value = "", tags = "接口")
public class VersionController extends BladeController {
    private final IVersionService versionService;
    /**
     * 详情
     */
    @GetMapping("/detail")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "详情", notes = "传入version")
    public R<Version> detail(Version version) {
        Version detail = versionService.getOne(Condition.getQueryWrapper(version));
        return R.data(detail);
    }
    /**
     * 分页
     */
    @GetMapping("/list")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "分页", notes = "传入version")
    public R<IPage<Version>> list(Version version, Query query) {
        IPage<Version> pages = versionService.page(Condition.getPage(query), Condition.getQueryWrapper(version));
        return R.data(pages);
    }
    /**
     * 自定义分页
     */
    @GetMapping("/page")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "分页", notes = "传入version")
    public R<IPage<VersionVO>> page(VersionVO version, Query query) {
        IPage<VersionVO> pages = versionService.selectVersionPage(Condition.getPage(query), version);
        return R.data(pages);
    }
    /**
     * 新增
     */
    @PostMapping("/save")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入version")
    public R save(@Valid @RequestBody Version version) {
        return R.status(versionService.save(version));
    }
    /**
     * 修改
     */
    @PostMapping("/update")
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入version")
    public R update(@Valid @RequestBody Version version) {
        return R.status(versionService.updateById(version));
    }
    /**
     * 新增或修改
     */
    @PostMapping("/submit")
    @ApiOperationSupport(order = 6)
    @ApiOperation(value = "新增或修改", notes = "传入version")
    public R submit(@Valid @RequestBody Version version) {
        return R.status(versionService.saveOrUpdate(version));
    }
    /**
     * 删除
     */
    @PostMapping("/remove")
    @ApiOperationSupport(order = 8)
    @ApiOperation(value = "删除", notes = "传入ids")
    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
        return R.status(versionService.removeByIds(Func.toLongList(ids)));
    }
}
src/main/java/org/springblade/modules/version/dto/VersionDTO.java
New file
@@ -0,0 +1,34 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.version.dto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.modules.version.entity.Version;
/**
 * 数据传输对象实体类
 *
 * @author BladeX
 * @since 2022-01-06
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class VersionDTO extends Version {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/version/entity/Version.java
New file
@@ -0,0 +1,72 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.version.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
 * 实体类
 *
 * @author BladeX
 * @since 2022-01-06
 */
@Data
@TableName("blade_version")
@ApiModel(value = "Version对象", description = "Version对象")
public class Version implements Serializable {
    private static final long serialVersionUID = 1L;
    private Long id;
    /**
     * 版本号
     */
    private String version;
    /**
     * 地址
     */
    private String address;
    /**
     * 时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private String time;
    /**
     * 内容
     */
    private String content;
    /**
     * 版本名称
     */
    private String name;
    /**
     * 安装包大小
     */
    private String size;
}
src/main/java/org/springblade/modules/version/mapper/VersionMapper.java
New file
@@ -0,0 +1,42 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.version.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.version.entity.Version;
import org.springblade.modules.version.vo.VersionVO;
import java.util.List;
/**
 *  Mapper 接口
 *
 * @author BladeX
 * @since 2022-01-06
 */
public interface VersionMapper extends BaseMapper<Version> {
    /**
     * 自定义分页
     *
     * @param page
     * @param version
     * @return
     */
    List<VersionVO> selectVersionPage(IPage page, VersionVO version);
}
src/main/java/org/springblade/modules/version/mapper/VersionMapper.xml
New file
@@ -0,0 +1,23 @@
<?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.version.mapper.VersionMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="versionResultMap" type="org.springblade.modules.version.entity.Version">
        <id column="id" property="id"/>
        <result column="version" property="version"/>
        <result column="time" property="time"/>
        <result column="address" property="address"/>
        <result column="content" property="content"/>
        <result column="name" property="name"/>
        <result column="size" property="size"/>
    </resultMap>
    <select id="selectVersionPage" resultMap="versionResultMap">
        select *
        from blade_version
    </select>
</mapper>
src/main/java/org/springblade/modules/version/service/IVersionService.java
New file
@@ -0,0 +1,43 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.version.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.modules.version.entity.Version;
import org.springblade.modules.version.vo.VersionVO;
import java.util.List;
/**
 * 服务类
 *
 * @author BladeX
 * @since 2022-01-06
 */
public interface IVersionService extends IService<Version> {
    /**
     * 自定义分页
     *
     * @param page
     * @param version
     * @return
     */
    IPage<VersionVO> selectVersionPage(IPage<VersionVO> page, VersionVO version);
}
src/main/java/org/springblade/modules/version/service/impl/VersionServiceImpl.java
New file
@@ -0,0 +1,43 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.version.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.modules.version.entity.Version;
import org.springblade.modules.version.mapper.VersionMapper;
import org.springblade.modules.version.service.IVersionService;
import org.springblade.modules.version.vo.VersionVO;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 *  服务实现类
 *
 * @author BladeX
 * @since 2022-01-06
 */
@Service
public class VersionServiceImpl extends ServiceImpl<VersionMapper, Version> implements IVersionService {
    @Override
    public IPage<VersionVO> selectVersionPage(IPage<VersionVO> page, VersionVO version) {
        return page.setRecords(baseMapper.selectVersionPage(page, version));
    }
}
src/main/java/org/springblade/modules/version/vo/VersionVO.java
New file
@@ -0,0 +1,36 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.version.vo;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.modules.version.entity.Version;
/**
 * 视图实体类
 *
 * @author BladeX
 * @since 2022-01-06
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "VersionVO对象", description = "VersionVO对象")
public class VersionVO extends Version {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/zc/controller/ZcController.java
@@ -184,6 +184,16 @@
        return R.success("成功");
    }
    /**
     * 新增或修改
     */
    @PostMapping("/examineList")
    @ApiOperationSupport(order = 6)
    @ApiOperation(value = "新增或修改", notes = "传入zc")
    public R examineList(@Valid @RequestParam String ids,String names) {
        zcService.updateExamine(ids,Func.toStrList(names));
        return R.success("成功");
    }
    /**
     * 删除
@@ -211,7 +221,7 @@
        String phone = DesensitizedUtil.desensitizedPhoneNumber(zc.getPhone());
        //帐号默认姓+身份证后四位
        zc.setUsername(name.substring(0,1)+zc.getCardid().substring(zc.getCardid().length()-4));
        zc.setUsername(name.substring(0, 1) + zc.getCardid().substring(zc.getCardid().length() - 4));
        Integer userCount = iUserService.selectCount(zc.getUsername());
        if (userCount > 0) {
            throw new org.springblade.core.log.exception.ServiceException(StringUtil.format("当前用户 [{}] 已存在!", zc.getUsername()));
src/main/java/org/springblade/modules/zc/mapper/ZcMapper.java
@@ -42,6 +42,7 @@
    void inster(Zc zc);
    String selectType(String username);
    boolean updateExamine(String ids,List names);
    Integer selecyZcCount(String account);
    void deleteZc(String account);
src/main/java/org/springblade/modules/zc/mapper/ZcMapper.xml
@@ -61,6 +61,14 @@
        where username = #{param1}
    </select>
    <update id="updateExamine">
        update act_zc set type=1 where id in (${ids});
        update blade_user set stype=1,firstlogin = "1" where  account in
        <foreach collection="names" index="index" item="item" open="(" separator="," close=")">
            "${item}"
        </foreach>
    </update>
    <select id="selecyZcCount" resultType="java.lang.Integer">
        select count(*)
        from act_zc
src/main/java/org/springblade/modules/zc/service/IZcService.java
@@ -21,6 +21,8 @@
import org.springblade.modules.zc.entity.Zc;
import org.springblade.modules.zc.vo.ZcVO;
import java.util.List;
/**
 *  服务类
 *
@@ -39,6 +41,7 @@
    IPage<ZcVO> selectZcPage(IPage<ZcVO> page, ZcVO zc);
    void inster(Zc zc);
    String selectType(String username);
    boolean updateExamine(String ids, List names);
    Integer selecyZcCount(String account);
    void deleteZc(String account);
}
src/main/java/org/springblade/modules/zc/service/impl/ZcServiceImpl.java
@@ -25,6 +25,8 @@
import org.springblade.modules.zc.vo.ZcVO;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 *  服务实现类
 *
@@ -51,6 +53,11 @@
    }
    @Override
    public boolean updateExamine(String ids, List names) {
        return baseMapper.updateExamine(ids,names);
    }
    @Override
    public Integer selecyZcCount(String account) {
        return baseMapper.selecyZcCount(account);
    }
src/main/resources/application-dev.yml
@@ -2,11 +2,11 @@
spring:
  redis:
    ##redis 单机环境配置
#    host: 127.0.0.1
#    port: 6379
    host: 127.0.0.1
    port: 6379
    host: 192.168.90.24
    port: 6382
#    host: 192.168.90.24
#    port: 6382
    password:
    database: 0
    ssl: false
@@ -16,16 +16,20 @@
    #  commandTimeout: 5000
  datasource:
    # MySql
    url: jdbc:mysql://192.168.90.24:2083/qfqkpublic?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
    username: root
    password: ZHba@0112
#    url: jdbc:mysql://61.131.136.25:2083/qfqkpublic?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
#
#    url: jdbc:mysql://192.168.90.24:2083/qfqkpublic?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true&allowMultiQueries=true
#    username: root
#    password: ZHba@0112
#    url: jdbc:mysql://36.134.81.48:3306/qfqkpublic?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
#    url: jdbc:mysql://61.131.136.25:2083/qfqkpublic?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true&allowMultiQueries=true
#    username: root
#    password: ZHba@0112
      url: jdbc:mysql://localhost:2083/qfqkpublic?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true&allowMultiQueries=true
      username: root
      password: ZHba@0112
#    url: jdbc:mysql://36.134.81.48:3306/qfqkpublic?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true&allowMultiQueries=true
#    username: root
#    password: jfpt123
@@ -45,7 +49,7 @@
#ftp 设置
ftp:
  sqlConnect: jdbc:mysql://192.168.90.24:2083/qfqkpublic?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
  sqlConnect: jdbc:mysql://localhost:2083/qfqkpublic?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
  ftpHost: 117.40.91.118
  ftpPort: 21
  ftpUserName: zhbain