lin
2024-04-19 f805ebc9eda4110736969dbdb211444e7297fb60
校园安全
7 files modified
9 files added
782 ■■■■ changed files
src/main/java/org/springblade/modules/nursingCheckIn/controller/NursingCheckInController.java 126 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/nursingCheckIn/dto/NursingCheckInDTO.java 34 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/nursingCheckIn/entity/NursingCheckInEntity.java 90 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/nursingCheckIn/mapper/NursingCheckInMapper.java 43 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/nursingCheckIn/mapper/NursingCheckInMapper.xml 63 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/nursingCheckIn/service/INursingCheckInService.java 43 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/nursingCheckIn/service/impl/NursingCheckInServiceImpl.java 43 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/nursingCheckIn/vo/NursingCheckInVO.java 35 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/nursingCheckIn/wrapper/NursingCheckInWrapper.java 50 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/patrol/controller/PatrolGroupController.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/patrol/service/IPatrolGroupService.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/patrol/service/impl/PatrolGroupServiceImpl.java 32 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/place/entity/PlaceExtEntity.java 93 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/place/mapper/PlaceExtMapper.xml 46 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/place/service/impl/PlaceServiceImpl.java 77 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/rotation/service/impl/RotationServiceImpl.java 3 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/nursingCheckIn/controller/NursingCheckInController.java
New file
@@ -0,0 +1,126 @@
/*
 *      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.nursingCheckIn.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
import javax.validation.Valid;
import org.springblade.core.secure.BladeUser;
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.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.nursingCheckIn.entity.NursingCheckInEntity;
import org.springblade.modules.nursingCheckIn.vo.NursingCheckInVO;
import org.springblade.modules.nursingCheckIn.wrapper.NursingCheckInWrapper;
import org.springblade.modules.nursingCheckIn.service.INursingCheckInService;
import org.springblade.core.boot.ctrl.BladeController;
/**
 * 护学打卡 控制器
 *
 * @author BladeX
 * @since 2024-04-18
 */
@RestController
@AllArgsConstructor
@RequestMapping("blade-nursingCheckIn/nursingCheckIn")
@Api(value = "护学打卡", tags = "护学打卡接口")
public class NursingCheckInController extends BladeController {
    private final INursingCheckInService nursingCheckInService;
    /**
     * 护学打卡 详情
     */
    @GetMapping("/detail")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "详情", notes = "传入nursingCheckIn")
    public R<NursingCheckInVO> detail(NursingCheckInEntity nursingCheckIn) {
        NursingCheckInEntity detail = nursingCheckInService.getOne(Condition.getQueryWrapper(nursingCheckIn));
        return R.data(NursingCheckInWrapper.build().entityVO(detail));
    }
    /**
     * 护学打卡 分页
     */
    @GetMapping("/list")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "分页", notes = "传入nursingCheckIn")
    public R<IPage<NursingCheckInVO>> list(NursingCheckInEntity nursingCheckIn, Query query) {
        IPage<NursingCheckInEntity> pages = nursingCheckInService.page(Condition.getPage(query), Condition.getQueryWrapper(nursingCheckIn));
        return R.data(NursingCheckInWrapper.build().pageVO(pages));
    }
    /**
     * 护学打卡 自定义分页
     */
    @GetMapping("/page")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "分页", notes = "传入nursingCheckIn")
    public R<IPage<NursingCheckInVO>> page(NursingCheckInVO nursingCheckIn, Query query) {
        IPage<NursingCheckInVO> pages = nursingCheckInService.selectNursingCheckInPage(Condition.getPage(query), nursingCheckIn);
        return R.data(pages);
    }
    /**
     * 护学打卡 新增
     */
    @PostMapping("/save")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入nursingCheckIn")
    public R save(@Valid @RequestBody NursingCheckInEntity nursingCheckIn) {
        return R.status(nursingCheckInService.save(nursingCheckIn));
    }
    /**
     * 护学打卡 修改
     */
    @PostMapping("/update")
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入nursingCheckIn")
    public R update(@Valid @RequestBody NursingCheckInEntity nursingCheckIn) {
        return R.status(nursingCheckInService.updateById(nursingCheckIn));
    }
    /**
     * 护学打卡 新增或修改
     */
    @PostMapping("/submit")
    @ApiOperationSupport(order = 6)
    @ApiOperation(value = "新增或修改", notes = "传入nursingCheckIn")
    public R submit(@Valid @RequestBody NursingCheckInEntity nursingCheckIn) {
        return R.status(nursingCheckInService.saveOrUpdate(nursingCheckIn));
    }
    /**
     * 护学打卡 删除
     */
    @PostMapping("/remove")
    @ApiOperationSupport(order = 7)
    @ApiOperation(value = "逻辑删除", notes = "传入ids")
    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
        return R.status(nursingCheckInService.removeBatchByIds(Func.toLongList(ids)));
    }
}
src/main/java/org/springblade/modules/nursingCheckIn/dto/NursingCheckInDTO.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.nursingCheckIn.dto;
import org.springblade.modules.nursingCheckIn.entity.NursingCheckInEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * 护学打卡 数据传输对象实体类
 *
 * @author BladeX
 * @since 2024-04-18
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class NursingCheckInDTO extends NursingCheckInEntity {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/nursingCheckIn/entity/NursingCheckInEntity.java
New file
@@ -0,0 +1,90 @@
/*
 *      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.nursingCheckIn.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.util.Date;
/**
 * 护学打卡 实体类
 *
 * @author BladeX
 * @since 2024-04-18
 */
@Data
@TableName("jczz_nursing_check_in")
@ApiModel(value = "NursingCheckIn对象", description = "护学打卡")
public class NursingCheckInEntity   {
    /** id */
    @ApiModelProperty(value = "主键ID", example = "")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;
    /** 创建人 */
    @ApiModelProperty(value = "创建人", example = "")
    @TableField("create_user")
    private Long createUser;
    /** 定位地址 */
    @ApiModelProperty(value = "定位地址", example = "")
    @TableField("location")
    private String location;
    /** 家长名称 */
    @ApiModelProperty(value = "家长名称", example = "")
    @TableField("name")
    private String name;
    /** 家长电话 */
    @ApiModelProperty(value = "家长电话", example = "")
    @TableField("phone")
    private String phone;
    /** 年级与班级 */
    @ApiModelProperty(value = "年级与班级", example = "")
    @TableField("grade_and_class")
    private String gradeAndClass;
    /** 图片 */
    @ApiModelProperty(value = "图片", example = "")
    @TableField("images")
    private String images;
    /** 场所id */
    @ApiModelProperty(value = "场所id", example = "")
    @TableField("place_id")
    private Long placeId;
    /** 1:民警 2:家长 */
    @ApiModelProperty(value = "1:民警 2:家长", example = "")
    @TableField("type")
    private String type;
    /** 创建时间 */
    @ApiModelProperty(value = "创建时间", example = "")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(value = "create_time",fill = FieldFill.INSERT)
    private Date createTime;
}
src/main/java/org/springblade/modules/nursingCheckIn/mapper/NursingCheckInMapper.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.nursingCheckIn.mapper;
import org.springblade.modules.nursingCheckIn.entity.NursingCheckInEntity;
import org.springblade.modules.nursingCheckIn.vo.NursingCheckInVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
/**
 * 护学打卡 Mapper 接口
 *
 * @author BladeX
 * @since 2024-04-18
 */
public interface NursingCheckInMapper extends BaseMapper<NursingCheckInEntity> {
    /**
     * 自定义分页
     *
     * @param page
     * @param nursingCheckIn
     * @return
     */
    List<NursingCheckInVO> selectNursingCheckInPage(IPage page, NursingCheckInVO nursingCheckIn);
}
src/main/java/org/springblade/modules/nursingCheckIn/mapper/NursingCheckInMapper.xml
New file
@@ -0,0 +1,63 @@
<?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.nursingCheckIn.mapper.NursingCheckInMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="nursingCheckInResultMap" type="org.springblade.modules.nursingCheckIn.entity.NursingCheckInEntity">
    </resultMap>
    <select id="selectNursingCheckInPage" resultMap="nursingCheckInResultMap">
        select * from jczz_nursing_check_in
    </select>
    <resultMap type="org.springblade.modules.nursingCheckIn.dto.NursingCheckInDTO" id="NursingCheckInDTOResult">
        <result property="id"    column="id"    />
        <result property="createUser"    column="create_user"    />
        <result property="location"    column="location"    />
        <result property="name"    column="name"    />
        <result property="phone"    column="phone"    />
        <result property="gradeAndClass"    column="grade_and_class"    />
        <result property="images"    column="images"    />
        <result property="placeId"    column="place_id"    />
        <result property="type"    column="type"    />
    </resultMap>
    <sql id="selectNursingCheckIn">
        select
            id,
            create_user,
            location,
            name,
            phone,
            grade_and_class,
            images,
            place_id,
            type
        from
            jczz_nursing_check_in
    </sql>
<!--    <select id="selectNursingCheckInById" parameterType="long" resultMap="NursingCheckInDTOResult">-->
<!--        <include refid="selectNursingCheckIn"/>-->
<!--        where-->
<!--        id = #{id}-->
<!--    </select>-->
<!--    <select id="selectNursingCheckInList" parameterType="org.springblade.modules..dto.NursingCheckInDTO" resultMap="NursingCheckInDTOResult">-->
<!--        <include refid="selectNursingCheckIn"/>-->
<!--        <where>-->
<!--            <if test="id != null "> and id = #{id}</if>-->
<!--            <if test="createUser != null "> and create_user = #{createUser}</if>-->
<!--            <if test="location != null  and location != ''"> and location = #{location}</if>-->
<!--            <if test="name != null  and name != ''"> and name = #{name}</if>-->
<!--            <if test="phone != null  and phone != ''"> and phone = #{phone}</if>-->
<!--            <if test="gradeAndClass != null  and gradeAndClass != ''"> and grade_and_class = #{gradeAndClass}</if>-->
<!--            <if test="images != null  and images != ''"> and images = #{images}</if>-->
<!--            <if test="placeId != null "> and place_id = #{placeId}</if>-->
<!--            <if test="type != null  and type != ''"> and type = #{type}</if>-->
<!--        </where>-->
<!--    </select>-->
</mapper>
src/main/java/org/springblade/modules/nursingCheckIn/service/INursingCheckInService.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.nursingCheckIn.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.modules.nursingCheckIn.entity.NursingCheckInEntity;
import org.springblade.modules.nursingCheckIn.vo.NursingCheckInVO;
import org.springblade.core.mp.base.BaseService;
import com.baomidou.mybatisplus.core.metadata.IPage;
/**
 * 护学打卡 服务类
 *
 * @author BladeX
 * @since 2024-04-18
 */
public interface INursingCheckInService extends IService<NursingCheckInEntity> {
    /**
     * 自定义分页
     *
     * @param page
     * @param nursingCheckIn
     * @return
     */
    IPage<NursingCheckInVO> selectNursingCheckInPage(IPage<NursingCheckInVO> page, NursingCheckInVO nursingCheckIn);
}
src/main/java/org/springblade/modules/nursingCheckIn/service/impl/NursingCheckInServiceImpl.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.nursingCheckIn.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.modules.nursingCheckIn.entity.NursingCheckInEntity;
import org.springblade.modules.nursingCheckIn.vo.NursingCheckInVO;
import org.springblade.modules.nursingCheckIn.mapper.NursingCheckInMapper;
import org.springblade.modules.nursingCheckIn.service.INursingCheckInService;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
/**
 * 护学打卡 服务实现类
 *
 * @author BladeX
 * @since 2024-04-18
 */
@Service
public class NursingCheckInServiceImpl extends ServiceImpl<NursingCheckInMapper, NursingCheckInEntity> implements INursingCheckInService {
    @Override
    public IPage<NursingCheckInVO> selectNursingCheckInPage(IPage<NursingCheckInVO> page, NursingCheckInVO nursingCheckIn) {
        return page.setRecords(baseMapper.selectNursingCheckInPage(page, nursingCheckIn));
    }
}
src/main/java/org/springblade/modules/nursingCheckIn/vo/NursingCheckInVO.java
New file
@@ -0,0 +1,35 @@
/*
 *      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.nursingCheckIn.vo;
import org.springblade.modules.nursingCheckIn.entity.NursingCheckInEntity;
import org.springblade.core.tool.node.INode;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * 护学打卡 视图实体类
 *
 * @author BladeX
 * @since 2024-04-18
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class NursingCheckInVO extends NursingCheckInEntity {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/nursingCheckIn/wrapper/NursingCheckInWrapper.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 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.nursingCheckIn.wrapper;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.modules.nursingCheckIn.entity.NursingCheckInEntity;
import org.springblade.modules.nursingCheckIn.vo.NursingCheckInVO;
import java.util.Objects;
/**
 * 护学打卡 包装类,返回视图层所需的字段
 *
 * @author BladeX
 * @since 2024-04-18
 */
public class NursingCheckInWrapper extends BaseEntityWrapper<NursingCheckInEntity, NursingCheckInVO>  {
    public static NursingCheckInWrapper build() {
        return new NursingCheckInWrapper();
     }
    @Override
    public NursingCheckInVO entityVO(NursingCheckInEntity nursingCheckIn) {
        NursingCheckInVO nursingCheckInVO = Objects.requireNonNull(BeanUtil.copy(nursingCheckIn, NursingCheckInVO.class));
        //User createUser = UserCache.getUser(nursingCheckIn.getCreateUser());
        //User updateUser = UserCache.getUser(nursingCheckIn.getUpdateUser());
        //nursingCheckInVO.setCreateUserName(createUser.getName());
        //nursingCheckInVO.setUpdateUserName(updateUser.getName());
        return nursingCheckInVO;
    }
}
src/main/java/org/springblade/modules/patrol/controller/PatrolGroupController.java
@@ -115,7 +115,7 @@
    @ApiOperation(value = "巡查指标组-批量删除", notes = "巡查指标组-批量删除")
    @PostMapping(value = "/deleteBatch")
    public R deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
        return R.data(patrolGroupService.removeByIds(Arrays.asList(ids.split(","))));
        return R.data(patrolGroupService.removePatrolGroupByIds(Arrays.asList(ids.split(","))));
    }
    /**
src/main/java/org/springblade/modules/patrol/service/IPatrolGroupService.java
@@ -55,4 +55,6 @@
    List<PatrolGroupDTO> getGroupDTORecord(String taskId);
    boolean addTwo(PatrolGroupVO patrolGroup);
    boolean removePatrolGroupByIds(List<String> asList);
}
src/main/java/org/springblade/modules/patrol/service/impl/PatrolGroupServiceImpl.java
@@ -2,8 +2,10 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.common.utils.NodeTreeUtil;
import org.springblade.common.utils.SpringUtils;
import org.springblade.core.tool.node.TreeNode;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.modules.patrol.dto.PatrolGroupDTO;
@@ -97,4 +99,34 @@
        }
        return false;
    }
    @Override
    public boolean removePatrolGroupByIds(List<String> asList) {
        if (asList == null || asList.isEmpty()) {
            return false;
        }
        // 将IPatrolGroupItemService实例化提到循环外部以避免重复实例化
        IPatrolGroupItemService bean = SpringUtils.getBean(IPatrolGroupItemService.class);
        boolean allSuccess = true; // 记录是否有任何操作失败
        for (String id : asList) {
            try {
                PatrolGroup patrolGroup = baseMapper.selectById(id);
                if (patrolGroup != null) {
                    patrolGroup.setIsDeleted(1);
                    int update = baseMapper.updateById(patrolGroup);
                    if (update > 0) {
                        allSuccess = bean.update(Wrappers.<PatrolGroupItem>lambdaUpdate()
                            .set(PatrolGroupItem::getIsDeleted, 1)
                            .eq(PatrolGroupItem::getGroupId, id));
                    }
                }
            } catch (Exception e) {
                // 记录或处理异常,例如日志记录
                // log.error("Failed to remove patrol group by id: " + id, e);
                allSuccess = false;
            }
        }
        return allSuccess;
    }
}
src/main/java/org/springblade/modules/place/entity/PlaceExtEntity.java
@@ -122,63 +122,9 @@
    @ApiModelProperty(value = "是否删除 0:否  1:是", example = "")
    @TableField("is_deleted")
    private Integer isDeleted;
//    /** 法人现住地址 */
//    @ApiModelProperty(value = "法人现住地址", example = "")
//    @TableField("legal_temp_address")
//    private String legalTempAddress;
//
//    /** 法人年龄 */
//    @ApiModelProperty(value = "法人年龄", example = "")
//    @TableField("legal_age")
//    private Integer legalAge;
//
//    /** 法人性别 */
//    @ApiModelProperty(value = "法人性别", example = "")
//    @TableField("legal_gender")
//    private Integer legalGender;
//
//    /** 法人身份证 */
    @ApiModelProperty(value = "法人身份证", example = "")
    @TableField("legal_id_card")
    private String legalIdCard;
//
//    /** 法人证件类型,业务字典  cardType */
//    @ApiModelProperty(value = "法人证件类型,业务字典  cardType", example = "")
//    @TableField("legal_card_type")
//    private String legalCardType;
//
//    /** 法人户籍地址 */
//    @ApiModelProperty(value = "法人户籍地址", example = "")
//    @TableField("legal_registered_address")
//    private String legalRegisteredAddress;
//
//    /** 法人岗位性质 */
//    @ApiModelProperty(value = "法人岗位性质", example = "")
//    @TableField("legal_job_nature")
//    private String legalJobNature;
//
//    /** 法人微信号 */
//    @ApiModelProperty(value = "法人微信号", example = "")
//    @TableField("legal_wx_account")
//    private String legalWxAccount;
//    /** 生日 */
//    @ApiModelProperty(value = "生日", example = "")
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
//    @TableField("birthday")
//    private Date birthday;
//
//    /** 民族 */
//    @ApiModelProperty(value = "民族", example = "")
//    @TableField("ethnicity")
//    private Integer ethnicity;
//
//    /** 工作单位(就职单位) */
//    @ApiModelProperty(value = "工作单位(就职单位)", example = "")
//    @TableField("employer")
//    private String employer;
    /** 房东名字 */
    @ApiModelProperty(value = "房东名字", example = "")
@@ -201,4 +147,43 @@
    private String landlordIdCard;
    /** 学生人数 */
    @ApiModelProperty(value = "学生人数", example = "")
    @TableField("student_number")
    private Integer studentNumber;
    /** 教职工人数 */
    @ApiModelProperty(value = "教职工人数", example = "")
    @TableField("workers_number")
    private Integer workersNumber;
    /** 专职保安 */
    @ApiModelProperty(value = "专职保安", example = "")
    @TableField("security_number")
    private Integer securityNumber;
    /** 专职门卫 */
    @ApiModelProperty(value = "专职门卫", example = "")
    @TableField("guard_number")
    private Integer guardNumber;
    /** 专兼职保卫人员 */
    @ApiModelProperty(value = "专兼职保卫人员", example = "")
    @TableField("temporary_security_number")
    private Integer temporarySecurityNumber;
    /** 走读/寄宿 */
    @ApiModelProperty(value = "走读/寄宿", example = "")
    @TableField("day_students_number")
    private Integer dayStudentsNumber;
    /** 住校生人员 */
    @ApiModelProperty(value = "住校生人员", example = "")
    @TableField("residential_students_number")
    private Integer residentialStudentsNumber;
    /** 宿舍管理人员 */
    @ApiModelProperty(value = "宿舍管理人员", example = "")
    @TableField("housemaster_number")
    private Integer housemasterNumber;
}
src/main/java/org/springblade/modules/place/mapper/PlaceExtMapper.xml
@@ -211,17 +211,6 @@
        <result property="updateUser"    column="update_user"    />
        <result property="updateTime"    column="update_time"    />
        <result property="isDeleted"    column="is_deleted"    />
<!--        <result property="legalTempAddress"    column="legal_temp_address"    />-->
<!--        <result property="legalAge"    column="legal_age"    />-->
<!--        <result property="legalGender"    column="legal_gender"    />-->
<!--        <result property="legalIdCard"    column="legal_id_card"    />-->
<!--        <result property="legalCardType"    column="legal_card_type"    />-->
<!--        <result property="legalRegisteredAddress"    column="legal_registered_address"    />-->
<!--        <result property="legalJobNature"    column="legal_job_nature"    />-->
<!--        <result property="legalWxAccount"    column="legal_wx_account"    />-->
<!--        <result property="birthday"    column="birthday"    />-->
<!--        <result property="ethnicity"    column="ethnicity"    />-->
<!--        <result property="employer"    column="employer"    />-->
    </resultMap>
    <sql id="selectJczzPlaceExt">
@@ -244,41 +233,6 @@
        from
            jczz_place_ext
    </sql>
<!--    <select id="selectJczzPlaceExtById" parameterType="long" resultMap="JczzPlaceExtDTOResult">-->
<!--        <include refid="selectJczzPlaceExt"/>-->
<!--        where-->
<!--        id = #{id}-->
<!--    </select>-->
<!--    <select id="selectJczzPlaceExtList" parameterType="jczzplaceext.dto.JczzPlaceExtDTO" resultMap="JczzPlaceExtDTOResult">-->
<!--        <include refid="selectJczzPlaceExt"/>-->
<!--        <where>-->
<!--            <if test="id != null "> and id = #{id}</if>-->
<!--            <if test="placeId != null "> and place_id = #{placeId}</if>-->
<!--            <if test="imageUrls != null  and imageUrls != ''"> and image_urls = #{imageUrls}</if>-->
<!--            <if test="legalPerson != null  and legalPerson != ''"> and legal_person = #{legalPerson}</if>-->
<!--            <if test="legalTel != null  and legalTel != ''"> and legal_tel = #{legalTel}</if>-->
<!--            <if test="planImageUrls != null  and planImageUrls != ''"> and plan_image_urls = #{planImageUrls}</if>-->
<!--            <if test="confirmUserId != null "> and confirm_user_id = #{confirmUserId}</if>-->
<!--            <if test="confirmFlag != null "> and confirm_flag = #{confirmFlag}</if>-->
<!--            <if test="confirmTime != null "> and confirm_time = #{confirmTime}</if>-->
<!--            <if test="confirmNotion != null  and confirmNotion != ''"> and confirm_notion = #{confirmNotion}</if>-->
<!--            <if test="createUser != null "> and create_user = #{createUser}</if>-->
<!--            <if test="createTime != null "> and create_time = #{createTime}</if>-->
<!--            <if test="updateUser != null "> and update_user = #{updateUser}</if>-->
<!--            <if test="updateTime != null "> and update_time = #{updateTime}</if>-->
<!--            <if test="isDeleted != null "> and is_deleted = #{isDeleted}</if>-->
<!--            <if test="legalTempAddress != null  and legalTempAddress != ''"> and legal_temp_address = #{legalTempAddress}</if>-->
<!--            <if test="legalAge != null "> and legal_age = #{legalAge}</if>-->
<!--            <if test="legalGender != null "> and legal_gender = #{legalGender}</if>-->
<!--            <if test="legalIdCard != null  and legalIdCard != ''"> and legal_id_card = #{legalIdCard}</if>-->
<!--            <if test="legalCardType != null  and legalCardType != ''"> and legal_card_type = #{legalCardType}</if>-->
<!--            <if test="legalRegisteredAddress != null  and legalRegisteredAddress != ''"> and legal_registered_address = #{legalRegisteredAddress}</if>-->
<!--            <if test="legalJobNature != null  and legalJobNature != ''"> and legal_job_nature = #{legalJobNature}</if>-->
<!--            <if test="legalWxAccount != null  and legalWxAccount != ''"> and legal_wx_account = #{legalWxAccount}</if>-->
<!--        </where>-->
<!--    </select>-->
</mapper>
src/main/java/org/springblade/modules/place/service/impl/PlaceServiceImpl.java
@@ -217,6 +217,11 @@
        jwGridCodeBind(placeVO);
        // 保存从业人员
        savePlacePractitioner(placeVO);
        // 判断是否校园
        if (placeVO.getLabel().startsWith("1601")) {
            // 校园的新增一个主体用户和一个通用用户
            addSchoolUser(placeVO);
        }
        // 返回结果
        return flag;
    }
@@ -232,7 +237,7 @@
            IPlacePractitionerService practitionerService = SpringUtil.getBean(IPlacePractitionerService.class);
            // 查询对应已存在的租户
            QueryWrapper<PlacePractitionerEntity> wrapper = new QueryWrapper<>();
            wrapper.eq("place_id", placeVO.getId()).eq("is_deleted",0);
            wrapper.eq("place_id", placeVO.getId()).eq("is_deleted", 0);
            List<PlacePractitionerEntity> oldList = practitionerService.list(wrapper);
            // 取出从业人员信息
            List<PlacePractitionerEntity> placePractitionerList = placeVO.getPlacePractitioner();
@@ -713,6 +718,48 @@
    }
    /**
     * 新增校方主体账号和通用账号
     *
     * @param placeVO
     * @return
     */
    @Transactional(rollbackFor = Exception.class)
    public User addSchoolUser(PlaceVO placeVO) {
        User newUser = new User();
        if (StringUtils.isNotBlank(placeVO.getPlaceName())) {
//            placeVO.setPrincipal(placeVO.getPrincipal());
//            placeVO.setPrincipalPhone(placeVO.getPrincipalPhone());
            //如果用户不存在,则新增一个用户
            newUser.setAccount(placeVO.getPlaceName() + "主体");
            newUser.setName(placeVO.getPlaceName() + "-主体");
            newUser.setRealName(placeVO.getPlaceName() + "-主体");
            // 社区群众部门
            newUser.setDeptId("1727979636479037441");
            // 校园主体,
            newUser.setRoleId("1780786647371706370");
            //默认密码为 123456
            newUser.setPassword("123456");
            // 设置机构
            // 用户新增
            newUser.setId(null);
            boolean submit = userService.submit(newUser);
            // 校园通用
            newUser.setId(null);
            newUser.setRoleId("1780786746076262402");
            newUser.setAccount(placeVO.getPlaceName() + "通用");
            newUser.setName(placeVO.getPlaceName() + "-通用");
            newUser.setRealName(placeVO.getPlaceName() + "-通用");
            boolean submit2 = userService.submit(newUser);
            //绑定id
//            placeVO.setPrincipalUserId(newUser.getId());
            //给人员打上场所负责人的标签
//            baseMapper.saveUserLabel(newUser.getId(), 1002);
        }
        return newUser;
    }
    /**
     * 场所负责人和用户绑定
     *
     * @param placeVO
@@ -725,7 +772,7 @@
            placeVO.setPrincipalPhone(placeVO.getPrincipalPhone());
            //根据手机号查询库里的数据
            List<User> list = userService.getUserListByPhoneOrAccount(placeVO.getPrincipalPhone());
            if (list.size()>0) {
            if (list.size() > 0) {
                User user = list.get(0);
                //如果用户存在,则该用户id绑定场所
                placeVO.setPrincipalUserId(user.getId());
@@ -972,7 +1019,7 @@
                // 来源 1:地址总表  2:国控采集 3:商超
                if (!Strings.isBlank(placeExcel.getHouseCode())) {
                    placeEntity.setSource(1);
                }else {
                } else {
                    placeEntity.setSource(2);
                    // 并生成36位的houseCode
                    placeEntity.setHouseCode(IdUtils.getIdBy36());
@@ -983,7 +1030,7 @@
                    placeEntity.setNineType(Integer.parseInt(placeExcel.getNineType()));
                }
                // 网格绑定处理
                importGridHandle(placeExcel,placeEntity);
                importGridHandle(placeExcel, placeEntity);
                // 新增
                save(placeEntity);
                // 保存详情
@@ -998,7 +1045,7 @@
                }
                // 房屋编号绑定处理
                houseCodeBindHandle(placeEntity);
            }else {
            } else {
                // 更新
                Long userId = updateUser(placeExcel);
                // 插入场所
@@ -1025,7 +1072,7 @@
                    placeEntity.setNineType(Integer.parseInt(placeExcel.getNineType()));
                }
                // 网格绑定处理
                importGridHandle(placeExcel,placeEntity);
                importGridHandle(placeExcel, placeEntity);
                // 更新
                updateById(placeEntity);
                // 场所标签信息处理
@@ -1042,15 +1089,16 @@
    /**
     * 导入是网格数据绑定处理
     *
     * @param placeExcel
     * @param placeEntity
     */
    private void importGridHandle(PlaceExcel placeExcel, PlaceVO placeEntity) {
        if (!Strings.isBlank(placeExcel.getCommunityName()) &&
            !Strings.isBlank(placeExcel.getGridName())){
            !Strings.isBlank(placeExcel.getGridName())) {
            // 查询对应的网格信息
            GridEntity gridEntity = gridService.getGridInfoByParam(placeExcel.getCommunityName(),placeExcel.getGridName());
            if (null!=gridEntity){
            GridEntity gridEntity = gridService.getGridInfoByParam(placeExcel.getCommunityName(), placeExcel.getGridName());
            if (null != gridEntity) {
                // 设置场所范围
                placeEntity.setGridId(gridEntity.getId());
                placeEntity.setGridCode(gridEntity.getGridCode());
@@ -1060,8 +1108,8 @@
                gridRangeEntity.setGridCode(gridEntity.getGridCode());
                gridRangeEntity.setHouseCode(placeEntity.getHouseCode());
                UpdateWrapper<GridRangeEntity> updateWrapper = new UpdateWrapper<>();
                updateWrapper.eq("house_code",placeEntity.getHouseCode());
                gridRangeService.update(gridRangeEntity,updateWrapper);
                updateWrapper.eq("house_code", placeEntity.getHouseCode());
                gridRangeService.update(gridRangeEntity, updateWrapper);
            }
        }
    }
@@ -1666,15 +1714,17 @@
    /**
     * 查询所有场所数据
     *
     * @return
     */
    @Override
    public List<PlaceVO> getAllList(int i,int size) {
        return baseMapper.getAllList(i,size);
    public List<PlaceVO> getAllList(int i, int size) {
        return baseMapper.getAllList(i, size);
    }
    /**
     * 查询所有场所数据总数
     *
     * @return
     */
    @Override
@@ -1684,6 +1734,7 @@
    /**
     * 查询对应的社区编号
     *
     * @param id
     * @return
     */
src/main/java/org/springblade/modules/rotation/service/impl/RotationServiceImpl.java
@@ -99,6 +99,9 @@
        if(AuthUtils.isJd(userRole)){
            rotation.setType(2);
        }
        if(AuthUtils.isAdministratorOrAdmin(userRole)){
            rotation.setType(null);
        }
        if (StringUtils.isNotBlank(rotation.getAoiCode())) {
            // 查询房屋的小区
            IDistrictService bean = SpringUtils.getBean(IDistrictService.class);