洪城义警-正式版后台
zengh
2022-09-14 df878618a8882fc057a5863738df43e1fcd878ea
密码修改
15 files modified
8 files added
696 ■■■■■ changed files
src/main/java/org/springblade/common/config/BladeConfiguration.java 1 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/depl/controller/DeplController.java 6 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/jurisdiction/controller/JurisdictionController.java 10 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/jurisdiction/mapper/JurisdictionMapper.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/jurisdiction/mapper/JurisdictionMapper.xml 33 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/jurisdiction/service/JurisdictionService.java 9 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/jurisdiction/service/impl/JurisdictionServiceImpl.java 11 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/entity/User.java 4 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml 1 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/taskqd/mapper/TaskqdMapper.xml 29 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/team/controller/TeamController.java 155 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/team/entity/Team.java 85 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/team/mapper/TeamMapper.java 50 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/team/mapper/TeamMapper.xml 27 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/team/service/ITeamService.java 39 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/team/service/impl/TeamServiceImpl.java 43 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/team/vo/TeamVO.java 21 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/team/wrapper/TeamWrapper.java 45 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/zc/controller/ZcController.java 108 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/zc/entity/Zc.java 4 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/zc/mapper/ZcMapper.xml 5 ●●●●● patch | view | raw | blame | history
src/main/resources/application-dev.yml 6 ●●●● patch | view | raw | blame | history
src/main/resources/application.yml 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/common/config/BladeConfiguration.java
@@ -102,6 +102,7 @@
        secureRegistry.excludePathPatterns("/collect/**");
        secureRegistry.excludePathPatterns("/investigate/**");
        secureRegistry.excludePathPatterns("/taskqd/**");
        secureRegistry.excludePathPatterns("/team/**");
        secureRegistry.excludePathPatterns("/taskfk/**");
        secureRegistry.excludePathPatterns("/sensitiveword/**");
        secureRegistry.excludePathPatterns("/trar/**");
src/main/java/org/springblade/modules/depl/controller/DeplController.java
@@ -184,10 +184,10 @@
        response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
        response.setHeader("Access-Control-Allow-Credentials","true");
        //填写你文件上传的地址以及相应信息
        String url = "http://61.131.136.25:2081";
        String url = "http://106.225.193.35:2081";
        String access = "zhbaadmin";
        String secret = "zhbapassword";
        String bucket = "zhba";
        String bucket = "hcyj";
        MinioClient minioClient =
            MinioClient.builder()
                .endpoint(url)
@@ -215,7 +215,7 @@
                .headers(headers)
                .build());
        in.close();
        String urls = "http://61.131.136.25:2081/zhba/" + newName;
        String urls = "http://106.225.193.35:2081/hcyj/" + newName;
        return R.data(urls);
    }
src/main/java/org/springblade/modules/jurisdiction/controller/JurisdictionController.java
@@ -119,6 +119,16 @@
        List<JurisdictionVO> tree = jurisdictionService.lazyTree(Func.toStrWithEmpty(tenantId, bladeUser.getTenantId()), parentId);
        return R.data(tree);
    }
    /**
     * 懒加载获取部门树形结构(带队伍)
     */
    @GetMapping("/lazy-team")
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "懒加载树形结构", notes = "树形结构")
    public R<List<JurisdictionVO>> lazyTeam(String tenantId, Long parentId, BladeUser bladeUser) {
        List<JurisdictionVO> tree = jurisdictionService.lazyTeam(Func.toStrWithEmpty(tenantId, bladeUser.getTenantId()), parentId);
        return R.data(tree);
    }
    /**
     * 懒加载获取部门树形结构
src/main/java/org/springblade/modules/jurisdiction/mapper/JurisdictionMapper.java
@@ -56,6 +56,7 @@
     * @return
     */
    List<JurisdictionVO> lazyTree(String tenantId, Long parentId);
    List<JurisdictionVO> lazyTeam(String tenantId, Long parentId);
    /**
     * 懒加载获取树形节点
@@ -63,6 +64,7 @@
     * @return
     */
    List<JurisdictionVO> lazyTrees();
    List<Map> listJur();
    /**
     * 获取部门名
src/main/java/org/springblade/modules/jurisdiction/mapper/JurisdictionMapper.xml
@@ -90,6 +90,34 @@
            and dept.tenant_id = #{param1}
        </if>
    </select>
    <select id="lazyTeam" resultMap="treeNodeResultMap">
        SELECT
        dept.id,
        dept.parent_id,
        dept.dept_name AS title,
        dept.id AS "value",
        dept.id AS "key",
        (
        SELECT
        CASE WHEN count(1) > 0 THEN 1 ELSE 0 END
        FROM
        (SELECT id,parent_id,dept_name,is_deleted FROM sys_jurisdiction
        UNION all
        SELECT id,police as parent_id,name as dept_name,is_deleted FROM sys_team
        ) jur
        WHERE
        jur.parent_id = dept.id and jur.is_deleted = 0
        ) AS "has_children"
        FROM
        (SELECT id,parent_id,dept_name,is_deleted FROM sys_jurisdiction
        UNION all
        SELECT id,police as parent_id,name as dept_name,is_deleted FROM sys_team
        )  dept
        WHERE dept.is_deleted = 0
        <if test="param1!=null and param1!=''">
            and dept.tenant_id = #{param1}
        </if>
    </select>
    <select id="lazyTrees" resultMap="treeNodeResultMap">
        SELECT dept.id,
@@ -106,6 +134,11 @@
        FROM sys_jurisdiction dept
        WHERE dept.is_deleted = 0
    </select>
    <select id="listJur" resultType="java.util.HashMap">
        SELECT dept_name AS title,id
        FROM sys_jurisdiction
        WHERE is_deleted = 0 and dept_name like '%派出所%'
    </select>
    <select id="Test" resultType="java.util.HashMap">
        SELECT wgmc, wgbj
src/main/java/org/springblade/modules/jurisdiction/service/JurisdictionService.java
@@ -56,6 +56,15 @@
     * @return
     */
    List<JurisdictionVO> lazyTree(String tenantId, Long parentId);
    /**
     * 懒加载树形结构
     *
     * @param tenantId
     * @param parentId
     * @return
     */
    List<JurisdictionVO> lazyTeam(String tenantId, Long parentId);
    List<Map> listJur();
    /**
     * 懒加载获取树形节点
src/main/java/org/springblade/modules/jurisdiction/service/impl/JurisdictionServiceImpl.java
@@ -75,11 +75,22 @@
        }
        return ForestNodeMerger.merge(baseMapper.lazyTree(tenantId, parentId));
    }
    @Override
    public List<JurisdictionVO> lazyTeam(String tenantId, Long parentId) {
        if (AuthUtil.isAdministrator()) {
            tenantId = StringPool.EMPTY;
        }
        return ForestNodeMerger.merge(baseMapper.lazyTeam(tenantId, parentId));
    }
    @Override
    public List<JurisdictionVO> lazyTrees() {
        return  ForestNodeMerger.merge(baseMapper.lazyTrees());
    }
    @Override
    public List<Map> listJur() {
        return  baseMapper.listJur();
    }
    @Override
src/main/java/org/springblade/modules/system/entity/User.java
@@ -162,6 +162,10 @@
     * 是否允许登录管理平台
     */
    private String isweb;
    /**
     * 所属队伍
     */
    private String team;
}
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
@@ -33,6 +33,7 @@
        <result column="cardid" property="cardid"/>
        <result column="district" property="district"/>
        <result column="jurisdiction" property="jurisdiction"/>
        <result column="team" property="team"/>
    </resultMap>
    <resultMap id="userResultMaps" type="org.springblade.modules.system.vo.UsersVo">
        <result column="id" property="id"/>
src/main/java/org/springblade/modules/taskqd/mapper/TaskqdMapper.xml
@@ -10,7 +10,6 @@
        <result column="time" property="time"/>
        <result column="province" property="province"/>
        <result column="city" property="city"/>
        <result column="county" property="county"/>
        <result column="jnum" property="jnum"/>
        <result column="line" property="line"/>
        <result column="rtype" property="rtype"/>
@@ -119,17 +118,29 @@
        select qd.* from sys_taskqd qd LEFT JOIN sys_jurisdiction j ON j.id = qd.jurisdiction where 1=1 AND
        <if test="type==0">
            (qd.rtype = "2" or qd.rtype = "0") AND
            find_in_set(#{serid}, serid) and qd.tasktype=#{tasktype}) A LEFT JOIN (SELECT COUNT(*) as num,hdid,serid
            <if test="serid != '1123598821738675201'">
                find_in_set(#{serid}, serid) and
            </if>
            qd.tasktype=#{tasktype}) A LEFT JOIN (SELECT COUNT(*) as num,hdid,serid
            FROM
            sys_taskfk WHERE
            serid=#{serid} GROUP BY hdid,serid) B ON A.id=B.hdid
            sys_taskfk WHERE 1 = 1
            <if test="serid != '1123598821738675201'">
                and serid=#{serid}
            </if>
            GROUP BY hdid,serid) B ON A.id=B.hdid
        </if>
        <if test="type==2">
            qd.rtype = "1" AND
            find_in_set(#{serid}, serid) and qd.tasktype=#{tasktype}) A LEFT JOIN (SELECT COUNT(*) as num,hdid,serid
            <if test="serid != '1123598821738675201'">
                find_in_set(#{serid}, serid) and
            </if>
            qd.tasktype=#{tasktype}) A LEFT JOIN (SELECT COUNT(*) as num,hdid,serid
            FROM
            sys_taskfk WHERE
            serid=#{serid} GROUP BY hdid,serid) B ON A.id=B.hdid
            sys_taskfk WHERE 1 = 1
            <if test="serid != '1123598821738675201'">
                and serid=#{serid}
            </if>
            GROUP BY hdid,serid) B ON A.id=B.hdid
        </if>
        <if test="type==1">
            <if test="jurisdiction!='1372091709474910209'">
@@ -138,7 +149,9 @@
                </if>
                qd.rtype = "2"
                and qd.tasktype=#{tasktype}
                and (!find_in_set(#{serid}, serid) OR serid IS NULL )
                <if test="serid != '1123598821738675201'">
                    and (!find_in_set(#{serid}, serid) OR serid IS NULL )
                </if>
                and
                ((j.id =#{jurisdiction} or
                j.parent_id = #{jurisdiction}) or (j.id =#{workjurisdiction} or
src/main/java/org/springblade/modules/team/controller/TeamController.java
New file
@@ -0,0 +1,155 @@
/*
 *      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 team,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  team, 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.team.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSort;
import io.swagger.annotations.*;
import lombok.AllArgsConstructor;
import org.apache.poi.ss.formula.functions.T;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.launch.constant.AppConstant;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tenant.annotation.TenantDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.jurisdiction.service.JurisdictionService;
import org.springblade.modules.jurisdiction.vo.JurisdictionVO;
import org.springblade.modules.team.entity.Team;
import org.springblade.modules.team.service.ITeamService;
import org.springblade.modules.team.vo.TeamVO;
import org.springblade.modules.team.wrapper.TeamWrapper;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
import java.util.Map;
/**
 * 控制器
 *
 * @author Chill
 */
@TenantDS
@RestController
@RequestMapping("/team")
@AllArgsConstructor
@ApiSort(2)
@Api(value = "队伍管理", tags = "队伍管理接口")
public class TeamController extends BladeController {
    private final ITeamService teamService;
    private final JurisdictionService jurisdictionService;
    /**
     * 详情
     */
    @GetMapping("/detail")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "详情", notes = "传入team")
    public R<TeamVO> detail(Team team) {
        Team detail = teamService.getOne(Condition.getQueryWrapper(team));
        return R.data(TeamWrapper.build().entityVO(detail));
    }
    /**
     * 分页
     */
    @GetMapping("/list")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "分页", notes = "传入team")
    public R<IPage<TeamVO>> list(@ApiIgnore @RequestParam Map<String, Object> team, Query query) {
        IPage<Team> pages = teamService.page(Condition.getPage(query), Condition.getQueryWrapper(team, Team.class));
        return R.data(TeamWrapper.build().pageVO(pages));
    }
    /**
     * 多表联合查询自定义分页
     */
    @GetMapping("/page")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "分页", notes = "传入team")
    public R<IPage<TeamVO>> page(@ApiIgnore TeamVO team, Query query) {
        IPage<TeamVO> pages = teamService.selectTeamPage(Condition.getPage(query), team);
        return R.data(pages);
    }
    /**
     * 新增
     */
    @PostMapping("/save")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入team")
    public R save(@RequestBody Team team) {
        return R.status(teamService.save(team));
    }
    /**
     * 修改
     */
    @PostMapping("/update")
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入team")
    public R update(@RequestBody Team team) {
        return R.status(teamService.updateById(team));
    }
    /**
     * 新增或修改
     */
    @PostMapping("/submit")
    @ApiOperationSupport(order = 6)
    @ApiOperation(value = "新增或修改", notes = "传入team")
    public R submit(@RequestBody Team team) {
        return R.status(teamService.saveOrUpdate(team));
    }
    /**
     * 删除
     */
    @PostMapping("/remove")
    @ApiOperationSupport(order = 7)
    @ApiOperation(value = "逻辑删除", notes = "传入team")
    public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) {
        boolean temp = teamService.removeByIds(Func.toLongList(ids));
        return R.status(temp);
    }
    /**
     * 生成默认队伍
     */
    @GetMapping("/addTeam")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "分页", notes = "传入team")
    public R<IPage<TeamVO>> addTeam() {
        List<Map> list = jurisdictionService.listJur();
        for (int i = 0; i < list.size(); i++) {
            String name = list.get(i).get("title").toString().split("派出所")[0];
            Team team = new Team();
            team.setIsBrand("0");
            team.setIsDeleted(0);
            team.setName(name + "义警队");
            team.setNumber(20);
            team.setPolice(list.get(i).get("id").toString());
            teamService.saveOrUpdate(team);
        }
        return R.data(null);
    }
}
src/main/java/org/springblade/modules/team/entity/Team.java
New file
@@ -0,0 +1,85 @@
/*
 *      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.team.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
 * 实体类
 *
 * @author Chill
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("sys_team")
public class Team extends TenantEntity {
    private static final long serialVersionUID = 1L;
    /**
     * 队伍名称
     */
    @ApiModelProperty(value = "队伍名称")
    private String name;
    /**
     * 所属派出所
     */
    @ApiModelProperty(value = "所属派出所")
    private String police;
    /**
     * 队伍人数
     */
    @ApiModelProperty(value = "队伍人数")
    private Integer number;
    /**
     * 队伍口号
     */
    @ApiModelProperty(value = "队伍口号")
    private String slogan;
    /**
     * 是否为品牌队伍
     */
    @ApiModelProperty(value = "是否为品牌队伍")
    private String isBrand;
    /**
     * 队标
     */
    @ApiModelProperty(value = "队标")
    private String url;
    @ApiModelProperty("是否已删除")
    private Integer isDeleted;
}
src/main/java/org/springblade/modules/team/mapper/TeamMapper.java
New file
@@ -0,0 +1,50 @@
/*
 *      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 team,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  team, 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.team.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.team.entity.Team;
import org.springblade.modules.team.vo.TeamVO;
import java.util.List;
/**
 * Mapper 接口
 *
 * @author Chill
 */
public interface TeamMapper extends BaseMapper<Team> {
    /**
     * 前N条数据
     *
     * @param number 数量
     * @return List<Notice>
     */
    List<Team> topList(Integer number);
    /**
     * 自定义分页
     *
     * @param page   分页
     * @param team 实体
     * @return List<NoticeVO>
     */
    List<TeamVO> selectTeamPage(IPage page, TeamVO team);
}
src/main/java/org/springblade/modules/team/mapper/TeamMapper.xml
New file
@@ -0,0 +1,27 @@
<?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.team.mapper.TeamMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="noticeResultMap" type="org.springblade.modules.team.entity.Team">
        <result column="id" property="id"/>
    </resultMap>
    <select id="topList" resultMap="noticeResultMap">
    </select>
    <select id="selectTeamPage" resultType="org.springblade.modules.team.vo.TeamVO">
        select team.*,user.real_name from sys_team team
        LEFT JOIN blade_user user on team.create_user = user.id
        where 1 = 1
        <if test="team.name !='' and team.name !=null">
            and team.name like CONCAT("%",#{team.name},"%")
        </if>
        <if test="team.police !='' and team.police !=null">
            and team.police = #{team.police}
        </if>
        ORDER BY is_brand DESC,number DESC
    </select>
</mapper>
src/main/java/org/springblade/modules/team/service/ITeamService.java
New file
@@ -0,0 +1,39 @@
/*
 *      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 team,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  team, 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.team.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import org.springblade.modules.team.entity.Team;
import org.springblade.modules.team.vo.TeamVO;
/**
 * 服务类
 *
 * @author Chill
 */
public interface ITeamService extends BaseService<Team> {
    /**
     * 自定义分页
     * @param page
     * @param team
     * @return
     */
    IPage<TeamVO> selectTeamPage(IPage<TeamVO> page, TeamVO team);
}
src/main/java/org/springblade/modules/team/service/impl/TeamServiceImpl.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 team,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  team, 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.team.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.modules.team.entity.Team;
import org.springblade.modules.team.mapper.TeamMapper;
import org.springblade.modules.team.service.ITeamService;
import org.springblade.modules.team.vo.TeamVO;
import org.springframework.stereotype.Service;
/**
 * 服务实现类
 *
 * @author Chill
 */
@Service
public class TeamServiceImpl extends BaseServiceImpl<TeamMapper, Team> implements ITeamService {
    @Override
    public IPage<TeamVO> selectTeamPage(IPage<TeamVO> page, TeamVO team) {
        // 若不使用mybatis-plus自带的分页方法,则不会自动带入tenantId,所以我们需要自行注入
        team.setTenantId(AuthUtil.getTenantId());
        return page.setRecords(baseMapper.selectTeamPage(page, team));
    }
}
src/main/java/org/springblade/modules/team/vo/TeamVO.java
New file
@@ -0,0 +1,21 @@
package org.springblade.modules.team.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.modules.team.entity.Team;
/**
 * 通知公告视图类
 *
 * @author Chill
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class TeamVO extends Team {
    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    private String realName;
}
src/main/java/org/springblade/modules/team/wrapper/TeamWrapper.java
New file
@@ -0,0 +1,45 @@
/*
 *      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 team,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  team, 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.team.wrapper;
import org.springblade.common.cache.DictCache;
import org.springblade.common.enums.DictEnum;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.modules.team.entity.Team;
import org.springblade.modules.team.vo.TeamVO;
import java.util.Objects;
/**
 * Notice包装类,返回视图层所需的字段
 *
 * @author Chill
 */
public class TeamWrapper extends BaseEntityWrapper<Team, TeamVO> {
    public static TeamWrapper build() {
        return new TeamWrapper();
    }
    @Override
    public TeamVO entityVO(Team team) {
        TeamVO teamVO = Objects.requireNonNull(BeanUtil.copy(team, TeamVO.class));
        return teamVO;
    }
}
src/main/java/org/springblade/modules/zc/controller/ZcController.java
@@ -228,7 +228,7 @@
    /**
     * 新增
     */
    @PostMapping("/inster")
/*    @PostMapping("/inster")
    @ApiOperation(value = "新增", notes = "传入zc")
    public R inster(@Valid @RequestBody Zc zc) {
        //当前时间
@@ -334,6 +334,112 @@
//            + ")";
        FtpUtil.sqlFileUpload(s);
        return R.success("新增成功");
    }*/
    @PostMapping("/inster")
    @ApiOperation(value = "新增", notes = "传入zc")
    public R inster(@Valid @RequestBody Zc zc) {
        //当前时间
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String times = df.format(new Date());
        zc.setZctime(times);
        //保留未脱敏数据
        String names = zc.getSname();
        String cardids = zc.getCardid();
        String phones = zc.getPhone();
        //数据脱敏处理
//        String name = DesensitizedUtil.desensitizedName(zc.getSname());
//        String cardid = DesensitizedUtil.desensitizedIdNumber(zc.getCardid());
//        String phone = DesensitizedUtil.desensitizedPhoneNumber(zc.getPhone());
        //帐号默认姓+身份证后四位
        zc.setUsername(zc.getPhone());
        Integer userCount = iUserService.selectCount(zc.getUsername());
        if (userCount > 0) {
            throw new org.springblade.core.log.exception.ServiceException(StringUtil.format("当前用户 [{}] 已存在!", zc.getUsername()));
        }
        zcService.inster(zc);
        System.out.println("插入id++++++++++++"+zc.getId());
        //内网储存完整数据
        String s = "insert into act_zc(id,username,password,sname,sex,phone,zctime,parent_id,jurisdiction,cardid,address,workjurisdiction)" +
            "values(" + "'" + zc.getId() + "'" +
            "," + "'" + zc.getUsername() + "'" +
            "," + "'" + zc.getPassword() + "'" +
            "," + "'" + names + "'" +
            "," + "'" + zc.getSex() + "'" +
            "," + "'" + phones + "'" +
            "," + "'" + zc.getZctime() + "'" +
            "," + "'" + zc.getParentId() + "'" +
            "," + "'" + zc.getJurisdiction() + "'" +
            "," + "'" + cardids + "'" +
            "," + "'" + zc.getAddress() + "'" +
            "," + "'" + zc.getWorkjurisdiction() + "'"
            + ");"
            +
            "insert into blade_user(account,password,real_name,sex,phone,workjurisdiction,role_id,jurisdiction,cardid,address)" +
            "values(" +
            "'" + zc.getUsername() + "'" +
            "," + "'" + DigestUtil.encrypt(zc.getPassword()) + "'" +
            "," + "'" + names + "'" +
            "," + "'" + zc.getSex() + "'" +
            "," + "'" + phones + "'" +
            "," + "'" + zc.getWorkjurisdiction() + "'" +
            "," + "'" + zc.getParentId() + "'" +
            "," + "'" + zc.getJurisdiction() + "'" +
            "," + "'" + cardids + "'" +
            "," + "'" + zc.getAddress() + "'"
            + ")";
        System.out.println("插入语句++++++++++++"+s);
        //同时新增到用户表
        User user = new User();
        user.setAccount(zc.getUsername());
        user.setPassword(DigestUtil.encrypt(zc.getPassword()));
        user.setRealName(zc.getSname());
        user.setSex(Integer.valueOf(zc.getSex()));
        user.setPhone(zc.getPhone());
        //user.setDeptId(zc.getDeptid());
        user.setRoleId(zc.getParentId());
        user.setWorkaddress(zc.getWorkaddress());
        user.setWorkjurisdiction(zc.getWorkjurisdiction());
        user.setExamination_type("0");
        user.setExamination_mx("正常");
        user.setFirstlogin("0");
        user.setCardid(zc.getCardid());
        user.setTeam(zc.getTeam());
        if (!zc.getSignals().equals("")) {
            user.setSignals(zc.getSignals());
        }
        user.setStype("0");
        if (!zc.getAddress().equals("")) {
            user.setAddress(zc.getAddress());
            user.setJurisdiction(zc.getJurisdiction());
        }
        if (!zc.getJobUnit().equals("")) {
            user.setJobUnit(zc.getJobUnit());
        }
        iUserService.saveOrUpdate(user);
//        String s = "insert into act_zc(id,username,password,sname,sex,phone,zctime,deptid,parent_id,jurisdiction,cardid,address)" +
//            "values(" + "'" + zc.getId() + "'" +
//            "," + "'" + zc.getUsername() + "'" +
//            "," + "'" + zc.getPassword() + "'" +
//            "," + "'" + zc.getSname() + "'" +
//            "," + "'" + zc.getSex() + "'" +
//            "," + "'" + zc.getPhone() + "'" +
//            "," + "'" + zc.getZctime() + "'" +
//            "," + "'" + zc.getDeptid() + "'" +
//            "," + "'" + zc.getParentId() + "'" +
//            "," + "'" + zc.getJurisdiction() + "'" +
//            "," + "'" + zc.getCardid() + "'" +
//            "," + "'" + zc.getAddress() + "'"
//            + ")";
        FtpUtil.sqlFileUpload(s);
        return R.success("新增成功");
    }
    /**
src/main/java/org/springblade/modules/zc/entity/Zc.java
@@ -128,5 +128,9 @@
    private String signals;
    @TableField("job_unit")
    private String jobUnit;
    /**
     * 所属队伍
     */
    private String team;
}
src/main/java/org/springblade/modules/zc/mapper/ZcMapper.xml
@@ -20,6 +20,7 @@
        <result column="examination_mx" property="examination_mx"/>
        <result column="audit_time" property="auditTime"/>
        <result column="address" property="address"/>
        <result column="team" property="team"/>
    </resultMap>
@@ -53,9 +54,9 @@
    <!--注册新增-->
    <insert id="inster" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
        insert into act_zc(username, password, sname, sex, phone, zctime, deptid, parent_id, jurisdiction, cardid,address,workaddress, workjurisdiction, signals,job_unit)
        insert into act_zc(username, password, sname, sex, phone, zctime, deptid, parent_id, jurisdiction, cardid,address,workaddress, workjurisdiction, signals,job_unit,team)
        values (#{username}, #{password}, #{sname}, #{sex}, #{phone}, #{zctime}, #{deptid}, #{parentId},
                #{jurisdiction}, #{cardid},#{address},#{workaddress},#{workjurisdiction},#{signals},#{jobUnit})
                #{jurisdiction}, #{cardid},#{address},#{workaddress},#{workjurisdiction},#{signals},#{jobUnit},#{team})
    </insert>
    <select id="selectType" resultType="String">
src/main/resources/application-dev.yml
@@ -29,9 +29,9 @@
#      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
    url: jdbc:mysql://106.225.193.35: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
    password: HCyj@2022
    # PostgreSQL
@@ -49,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://106.225.193.35:3306/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
src/main/resources/application.yml
@@ -1,6 +1,6 @@
#服务器配置
server:
  port: 83
  port: 8383
  undertow:
    # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
    io-threads: 16