智慧保安后台管理项目备份
tangzy
2021-08-27 e878a5f2d3ef56a9797207d8125ae53bd4310718
1.心里咨询
2 files modified
8 files added
454 ■■■■■ changed files
src/main/java/org/springblade/modules/FTP/monitor.java 19 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/resource/entity/Attach.java 1 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/talk/controller/TalkController.java 131 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/talk/dto/TalkDTO.java 34 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/talk/entity/Talk.java 82 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/talk/mapper/TalkMapper.java 43 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/talk/mapper/TalkMapper.xml 26 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/talk/service/ITalkService.java 41 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/talk/service/impl/TalkServiceImpl.java 41 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/talk/vo/TalkVO.java 36 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/FTP/monitor.java
@@ -68,16 +68,15 @@
            // 检验文件是否存在
            FTPFile[] files = ftp.listFiles();
            if (files.length==0){
            if (files.length == 0) {
                return false;
            }
            else {
                for (FTPFile file : files){
            } else {
                for (FTPFile file : files) {
                    String fileName = file.getName();
                    InputStream is = ftp.retrieveFileStream(new String(fileName.getBytes("GBK"), FTP.DEFAULT_CONTROL_ENCODING));
                    if (null==is){
                    if (null == is) {
                        return false;
                    }else {
                    } else {
                        String substring1 = fileName.substring(0, 1);
                        if (substring1.equals("w")) {
                            //把文件下载到本地
@@ -111,6 +110,14 @@
                            is.close();
                            ftp.completePendingCommand();
                        }
                        else {
                            //把文件下载到本地
                            FtpUtil.downloadFtpFile(ftpHost_dev, ftpUserName, ftpPassword, ftpPort, ftpPath, localPath, fileName);
                            //MysqlCenlint.deletess(fileName);
                            FtpUtil.deleteFile(ftpHost_dev, ftpPort, ftpUserName, ftpPassword, "anbao/", fileName);
                            is.close();
                            ftp.completePendingCommand();
                        }
                    }
                }
                return true;
src/main/java/org/springblade/modules/resource/entity/Attach.java
@@ -75,6 +75,7 @@
     */
    @TableField("notice_id")
    private Long noticeId;
    private String cardid;;
}
src/main/java/org/springblade/modules/talk/controller/TalkController.java
New file
@@ -0,0 +1,131 @@
/*
 *      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.talk.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.FTP.FtpUtil;
import org.springblade.modules.talk.entity.Talk;
import org.springblade.modules.talk.service.ITalkService;
import org.springblade.modules.talk.vo.TalkVO;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.validation.Valid;
import java.text.SimpleDateFormat;
import java.util.Map;
/**
 * 控制器
 *
 * @author BladeX
 * @since 2021-08-10
 */
@RestController
@AllArgsConstructor
@RequestMapping("blade-talk/talk")
@Api(value = "", tags = "接口")
public class TalkController extends BladeController {
    private final ITalkService talkService;
    /**
     * 详情
     */
    @GetMapping("/detail")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "详情", notes = "传入talk")
    public R<Talk> detail(Talk talk) {
        Talk detail = talkService.getOne(Condition.getQueryWrapper(talk));
        return R.data(detail);
    }
    /**
     * 分页
     */
    @GetMapping("/list")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "分页", notes = "传入talk")
    public R<IPage<Talk>> list(@ApiIgnore @RequestParam Map<String, Object> talk, Query query) {
        IPage<Talk> pages = talkService.page(Condition.getPage(query), Condition.getQueryWrapper(talk, Talk.class));
        return R.data(pages);
    }
    /**
     * 自定义分页
     */
    @GetMapping("/page")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "分页", notes = "传入talk")
    public R<IPage<TalkVO>> page(TalkVO talk, Query query) {
        IPage<TalkVO> pages = talkService.selectTalkPage(Condition.getPage(query), talk);
        return R.data(pages);
    }
    /**
     * 新增
     */
    @PostMapping("/save")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入talk")
    public R save(@Valid @RequestBody Talk talk) {
        talkService.save(talk);
        return R.success("新增成功");
    }
    /**
     * 修改
     */
    @PostMapping("/update")
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入talk")
    public R update(@Valid @RequestBody Talk talk) {
        return R.status(talkService.updateById(talk));
    }
    /**
     * 新增或修改
     */
    @PostMapping("/submit")
    @ApiOperationSupport(order = 6)
    @ApiOperation(value = "新增或修改", notes = "传入talk")
    public R submit(@Valid @RequestBody Talk talk) {
        return R.status(talkService.saveOrUpdate(talk));
    }
    /**
     * 删除
     */
    @PostMapping("/remove")
    @ApiOperationSupport(order = 8)
    @ApiOperation(value = "删除", notes = "传入ids")
    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
        return R.status(talkService.removeByIds(Func.toLongList(ids)));
    }
}
src/main/java/org/springblade/modules/talk/dto/TalkDTO.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.talk.dto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.modules.talk.entity.Talk;
/**
 * 数据传输对象实体类
 *
 * @author BladeX
 * @since 2021-08-10
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class TalkDTO extends Talk {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/talk/entity/Talk.java
New file
@@ -0,0 +1,82 @@
/*
 *      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.talk.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
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 2021-08-10
 */
@Data
@TableName("sys_talk")
@ApiModel(value = "Talk对象", description = "Talk对象")
public class Talk implements Serializable {
    private static final long serialVersionUID = 1L;
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
    * 标题
    */
        @ApiModelProperty(value = "标题")
        private String title;
    /**
    * 谈话对象
    */
        @ApiModelProperty(value = "谈话对象")
        private String realName;
    /**
    * 谈话内容
    */
        @ApiModelProperty(value = "谈话内容")
        private String talkcontent;
    /**
    * 谈话时间
    */
        @ApiModelProperty(value = "谈话时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
        @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private Date talktime;
    /**
    * 结论
    */
        @ApiModelProperty(value = "结论")
        private String conclusion;
    /**
    * 评价
    */
        @ApiModelProperty(value = "评价")
        private String evaluate;
        private String deptid;
        private String imgurl;
}
src/main/java/org/springblade/modules/talk/mapper/TalkMapper.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.talk.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.talk.entity.Talk;
import org.springblade.modules.talk.vo.TalkVO;
import java.util.List;
/**
 *  Mapper 接口
 *
 * @author BladeX
 * @since 2021-08-10
 */
public interface TalkMapper extends BaseMapper<Talk> {
    /**
     * 自定义分页
     *
     * @param page
     * @param talk
     * @return
     */
    List<TalkVO> selectTalkPage(IPage page, TalkVO talk);
}
src/main/java/org/springblade/modules/talk/mapper/TalkMapper.xml
New file
@@ -0,0 +1,26 @@
<?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.talk.mapper.TalkMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="talkResultMap" type="org.springblade.modules.talk.entity.Talk">
        <id column="id" property="id"/>
        <result column="title" property="title"/>
        <result column="real_name" property="realName"/>
        <result column="talkcontent" property="talkcontent"/>
        <result column="talktime" property="talktime"/>
        <result column="conclusion" property="conclusion"/>
        <result column="evaluate" property="evaluate"/>
        <result column="deptid" property="deptid"/>
        <result column="imgurl" property="imgurl"/>
    </resultMap>
    <select id="selectTalkPage" resultMap="talkResultMap">
        select * from sys_talk where 1=1
        <if test="talk.deptid!=null and alk.deptid!='' and alk.deptid!='1123598813738675201'">
            deptid=#{talk.deptid}
        </if>
    </select>
</mapper>
src/main/java/org/springblade/modules/talk/service/ITalkService.java
New file
@@ -0,0 +1,41 @@
/*
 *      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.talk.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.modules.talk.entity.Talk;
import org.springblade.modules.talk.vo.TalkVO;
/**
 *  服务类
 *
 * @author BladeX
 * @since 2021-08-10
 */
public interface ITalkService extends IService<Talk> {
    /**
     * 自定义分页
     *
     * @param page
     * @param talk
     * @return
     */
    IPage<TalkVO> selectTalkPage(IPage<TalkVO> page, TalkVO talk);
}
src/main/java/org/springblade/modules/talk/service/impl/TalkServiceImpl.java
New file
@@ -0,0 +1,41 @@
/*
 *      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.talk.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.modules.talk.entity.Talk;
import org.springblade.modules.talk.mapper.TalkMapper;
import org.springblade.modules.talk.service.ITalkService;
import org.springblade.modules.talk.vo.TalkVO;
import org.springframework.stereotype.Service;
/**
 *  服务实现类
 *
 * @author BladeX
 * @since 2021-08-10
 */
@Service
public class TalkServiceImpl extends ServiceImpl<TalkMapper, Talk> implements ITalkService {
    @Override
    public IPage<TalkVO> selectTalkPage(IPage<TalkVO> page, TalkVO talk) {
        return page.setRecords(baseMapper.selectTalkPage(page, talk));
    }
}
src/main/java/org/springblade/modules/talk/vo/TalkVO.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.talk.vo;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.modules.talk.entity.Talk;
/**
 * 视图实体类
 *
 * @author BladeX
 * @since 2021-08-10
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "TalkVO对象", description = "TalkVO对象")
public class TalkVO extends Talk {
    private static final long serialVersionUID = 1L;
}