Merge remote-tracking branch 'origin/master'
10 files modified
9 files added
| New file |
| | |
| | | /* |
| | | * 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.community.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.community.entity.CommunityEntity; |
| | | import org.springblade.modules.community.vo.CommunityVO; |
| | | import org.springblade.modules.community.wrapper.CommunityWrapper; |
| | | import org.springblade.modules.community.service.ICommunityService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | |
| | | /** |
| | | * 社区表 控制器 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-12-21 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("blade-community/community") |
| | | @Api(value = "社区表", tags = "社区表接口") |
| | | public class CommunityController { |
| | | |
| | | private final ICommunityService communityService; |
| | | |
| | | /** |
| | | * 社区表 详情 |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入community") |
| | | public R<CommunityVO> detail(CommunityEntity community) { |
| | | CommunityEntity detail = communityService.getOne(Condition.getQueryWrapper(community)); |
| | | return R.data(CommunityWrapper.build().entityVO(detail)); |
| | | } |
| | | /** |
| | | * 社区表 分页 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入community") |
| | | public R<IPage<CommunityVO>> list(CommunityEntity community, Query query) { |
| | | IPage<CommunityEntity> pages = communityService.page(Condition.getPage(query), Condition.getQueryWrapper(community)); |
| | | return R.data(CommunityWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | | /** |
| | | * 社区表 自定义分页 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入community") |
| | | public R<IPage<CommunityVO>> page(CommunityVO community, Query query) { |
| | | IPage<CommunityVO> pages = communityService.selectCommunityPage(Condition.getPage(query), community); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 社区表 新增 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入community") |
| | | public R save(@Valid @RequestBody CommunityEntity community) { |
| | | return R.status(communityService.save(community)); |
| | | } |
| | | |
| | | /** |
| | | * 社区表 修改 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入community") |
| | | public R update(@Valid @RequestBody CommunityEntity community) { |
| | | return R.status(communityService.updateById(community)); |
| | | } |
| | | |
| | | /** |
| | | * 社区表 新增或修改 |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入community") |
| | | public R submit(@Valid @RequestBody CommunityEntity community) { |
| | | return R.status(communityService.saveOrUpdate(community)); |
| | | } |
| | | |
| | | /** |
| | | * 社区表 删除 |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "逻辑删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | return R.status(communityService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.community.dto; |
| | | |
| | | import org.springblade.modules.community.entity.CommunityEntity; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * 社区表 数据传输对象实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-12-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class CommunityDTO extends CommunityEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.community.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import lombok.Data; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.core.tenant.mp.TenantEntity; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | /** |
| | | * 社区表 实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-12-21 |
| | | */ |
| | | @Data |
| | | @TableName("jczz_community") |
| | | @ApiModel(value = "Community对象", description = "社区表") |
| | | public class CommunityEntity implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @ApiModelProperty("主键id") |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 街道编号 |
| | | */ |
| | | @ApiModelProperty(value = "街道编号") |
| | | private String streetCode; |
| | | /** |
| | | * 社区编号 |
| | | */ |
| | | @ApiModelProperty(value = "社区编号") |
| | | private String code; |
| | | /** |
| | | * 社区名称 |
| | | */ |
| | | @ApiModelProperty(value = "社区名称") |
| | | private String name; |
| | | /** |
| | | * 图片url |
| | | */ |
| | | @ApiModelProperty(value = "图片url") |
| | | private String picUrl; |
| | | /** |
| | | * 地址 |
| | | */ |
| | | @ApiModelProperty(value = "地址") |
| | | private String address; |
| | | /** |
| | | * 社区负责民警user_id |
| | | */ |
| | | @ApiModelProperty(value = "社区负责民警user_id") |
| | | private Long resPoliceUserId; |
| | | /** |
| | | * 中心坐标-经度 |
| | | */ |
| | | @ApiModelProperty(value = "中心坐标-经度") |
| | | private String lng; |
| | | /** |
| | | * 中心坐标-纬度 |
| | | */ |
| | | @ApiModelProperty(value = "中心坐标-纬度") |
| | | private String lat; |
| | | /** |
| | | * 简介 |
| | | */ |
| | | @ApiModelProperty(value = "简介") |
| | | private String remark; |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @ApiModelProperty("创建人") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private String createUser; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty("创建时间") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 更新人 |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @ApiModelProperty("更新人") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private String updateUser; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty("更新时间") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 是否删除 |
| | | */ |
| | | @TableLogic |
| | | @ApiModelProperty("是否已删除 0:否 1:是") |
| | | private Integer isDeleted; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.community.mapper; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.modules.community.entity.CommunityEntity; |
| | | import org.springblade.modules.community.vo.CommunityVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 社区表 Mapper 接口 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-12-21 |
| | | */ |
| | | public interface CommunityMapper extends BaseMapper<CommunityEntity> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param community |
| | | * @return |
| | | */ |
| | | List<CommunityVO> selectCommunityPage(IPage page,@Param("community") CommunityVO community); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | <?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.community.mapper.CommunityMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="communityResultMap" type="org.springblade.modules.community.entity.CommunityEntity"> |
| | | <result column="id" property="id"/> |
| | | <result column="street_code" property="streetCode"/> |
| | | <result column="code" property="code"/> |
| | | <result column="name" property="name"/> |
| | | <result column="pic_url" property="picUrl"/> |
| | | <result column="address" property="address"/> |
| | | <result column="res_police_user_id" property="resPoliceUserId"/> |
| | | <result column="lng" property="lng"/> |
| | | <result column="lat" property="lat"/> |
| | | <result column="remark" property="remark"/> |
| | | <result column="create_user" property="createUser"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="update_user" property="updateUser"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | <result column="is_deleted" property="isDeleted"/> |
| | | </resultMap> |
| | | |
| | | <!--自定义分页列表查询--> |
| | | <select id="selectCommunityPage" resultType="org.springblade.modules.community.vo.CommunityVO"> |
| | | select * from jczz_community |
| | | where is_deleted = 0 |
| | | <if test="community.name !=null and community.name!=''"> |
| | | and name like concat('%',#{community.name},'%') |
| | | </if> |
| | | <if test="community.code !=null and community.code!=''"> |
| | | and code like concat('%',#{community.code},'%') |
| | | </if> |
| | | <if test="community.streetCode !=null and community.streetCode!=''"> |
| | | and street_code like concat('%',#{community.streetCode},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| New file |
| | |
| | | /* |
| | | * 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.community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.modules.community.entity.CommunityEntity; |
| | | import org.springblade.modules.community.vo.CommunityVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | /** |
| | | * 社区表 服务类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-12-21 |
| | | */ |
| | | public interface ICommunityService extends IService<CommunityEntity> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param community |
| | | * @return |
| | | */ |
| | | IPage<CommunityVO> selectCommunityPage(IPage<CommunityVO> page, CommunityVO community); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.modules.community.entity.CommunityEntity; |
| | | import org.springblade.modules.community.vo.CommunityVO; |
| | | import org.springblade.modules.community.mapper.CommunityMapper; |
| | | import org.springblade.modules.community.service.ICommunityService; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | /** |
| | | * 社区表 服务实现类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-12-21 |
| | | */ |
| | | @Service |
| | | public class CommunityServiceImpl extends ServiceImpl<CommunityMapper, CommunityEntity> implements ICommunityService { |
| | | |
| | | @Override |
| | | public IPage<CommunityVO> selectCommunityPage(IPage<CommunityVO> page, CommunityVO community) { |
| | | return page.setRecords(baseMapper.selectCommunityPage(page, community)); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.community.vo; |
| | | |
| | | import org.springblade.modules.community.entity.CommunityEntity; |
| | | import org.springblade.core.tool.node.INode; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * 社区表 视图实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-12-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class CommunityVO extends CommunityEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.community.wrapper; |
| | | |
| | | import org.springblade.core.mp.support.BaseEntityWrapper; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.modules.community.entity.CommunityEntity; |
| | | import org.springblade.modules.community.vo.CommunityVO; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 社区表 包装类,返回视图层所需的字段 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-12-21 |
| | | */ |
| | | public class CommunityWrapper extends BaseEntityWrapper<CommunityEntity, CommunityVO> { |
| | | |
| | | public static CommunityWrapper build() { |
| | | return new CommunityWrapper(); |
| | | } |
| | | |
| | | @Override |
| | | public CommunityVO entityVO(CommunityEntity community) { |
| | | CommunityVO communityVO = Objects.requireNonNull(BeanUtil.copy(community, CommunityVO.class)); |
| | | |
| | | //User createUser = UserCache.getUser(community.getCreateUser()); |
| | | //User updateUser = UserCache.getUser(community.getUpdateUser()); |
| | | //communityVO.setCreateUserName(createUser.getName()); |
| | | //communityVO.setUpdateUserName(updateUser.getName()); |
| | | |
| | | return communityVO; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | return R.data(doorplateAddressService.placeDataHandle()); |
| | | } |
| | | |
| | | /** |
| | | * 社区数据处理 |
| | | * @return |
| | | */ |
| | | @GetMapping("/communityDataHandle") |
| | | public R communityDataHandle(){ |
| | | return R.data(doorplateAddressService.communityDataHandle()); |
| | | } |
| | | |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | DoorplateAddressVO getDoorplateAddressVODetail(@Param("doorplateAddress") DoorplateAddressVO doorplateAddress); |
| | | |
| | | /** |
| | | * 查询所有的社区集合信息 |
| | | * @return |
| | | */ |
| | | List<DoorplateAddressEntity> getAllCommunityList(); |
| | | } |
| | |
| | | <select id="getDoorplateAddressVODetail" resultType="org.springblade.modules.doorplateAddress.vo.DoorplateAddressVO"> |
| | | select jda.* from jczz_doorplate_address jda where address_code = #{doorplateAddress.addressCode} |
| | | </select> |
| | | |
| | | <!--查询所有的社区集合信息--> |
| | | <select id="getAllCommunityList" resultType="org.springblade.modules.doorplateAddress.entity.DoorplateAddressEntity"> |
| | | SELECT |
| | | jda.nei_code, |
| | | jda.nei_name, |
| | | jda.town_street_code |
| | | FROM |
| | | jczz_doorplate_address jda |
| | | WHERE |
| | | 1 = 1 |
| | | GROUP BY |
| | | jda.nei_code, |
| | | jda.nei_name, |
| | | jda.town_street_code |
| | | </select> |
| | | </mapper> |
| | |
| | | * 门牌地址表(总台账数据) 自定义详情 |
| | | */ |
| | | Object getDetail(DoorplateAddressVO doorplateAddress); |
| | | |
| | | /** |
| | | * 社区数据处理 |
| | | * @return |
| | | */ |
| | | Object communityDataHandle(); |
| | | } |
| | |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.modules.category.dto.CategoryLabelDTO; |
| | | import org.springblade.modules.category.service.ICategoryLabelService; |
| | | import org.springblade.modules.community.entity.CommunityEntity; |
| | | import org.springblade.modules.community.service.ICommunityService; |
| | | import org.springblade.modules.district.entity.DistrictEntity; |
| | | import org.springblade.modules.district.service.IDistrictService; |
| | | import org.springblade.modules.doorplateAddress.entity.DoorplateAddressEntity; |
| | |
| | | |
| | | @Autowired |
| | | private ICategoryLabelService iCategoryLabelService; |
| | | |
| | | @Autowired |
| | | private ICommunityService communityService; |
| | | |
| | | |
| | | @Override |
| | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 社区数据处理 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Object communityDataHandle() { |
| | | // 查询所有的社区差值 |
| | | List<DoorplateAddressEntity> doorplateAddressEntities = baseMapper.getAllCommunityList(); |
| | | // 遍历,插入库 |
| | | for (DoorplateAddressEntity doorplateAddressEntity : doorplateAddressEntities) { |
| | | QueryWrapper<CommunityEntity> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("name",doorplateAddressEntity.getNeiName()) |
| | | .eq("code",doorplateAddressEntity.getNeiCode()) |
| | | .eq("is_deleted",0); |
| | | CommunityEntity one = communityService.getOne(queryWrapper); |
| | | if (null==one){ |
| | | // 插入 |
| | | CommunityEntity communityEntity = new CommunityEntity(); |
| | | communityEntity.setCode(doorplateAddressEntity.getNeiCode()); |
| | | communityEntity.setName(doorplateAddressEntity.getNeiName()); |
| | | communityEntity.setStreetCode(doorplateAddressEntity.getTownStreetCode().replaceAll("0+$", "")); |
| | | //新增操作 |
| | | communityService.save(communityEntity); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | return R.data(UserWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 按条件查询用户信息 |
| | | * @param user |
| | | * @return |
| | | */ |
| | | @GetMapping("/getUserListByParam") |
| | | public R getUserListByParam(UserVO user) { |
| | | return R.data(userService.getUserListByParam(user)); |
| | | } |
| | | |
| | | /** |
| | | * 新增或修改 |
| | | */ |
| | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.modules.system.excel.UserExcel; |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.vo.UserVO; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | */ |
| | | List<UserExcel> exportUser(@Param("ew") Wrapper<User> queryWrapper); |
| | | |
| | | /** |
| | | * 按条件查询用户信息 |
| | | * @param user |
| | | * @return |
| | | */ |
| | | List<UserVO> getUserListByParam(@Param("user") UserVO user); |
| | | } |
| | |
| | | SELECT id, tenant_id, user_type, account, name, real_name, email, phone, birthday, role_id, dept_id, post_id FROM blade_user ${ew.customSqlSegment} |
| | | </select> |
| | | |
| | | <!--按条件查询用户信息--> |
| | | <select id="getUserListByParam" resultType="org.springblade.modules.system.vo.UserVO"> |
| | | SELECT id, account, name, real_name, phone, role_id, dept_id, post_id FROM blade_user |
| | | where is_deleted = 0 |
| | | <if test="user.roleId!=null and user.roleId!=''"> |
| | | and role_id like concat('%',#{user.roleId},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | * @return |
| | | */ |
| | | UserVO platformDetail(User user); |
| | | |
| | | /** |
| | | * 按条件查询用户信息 |
| | | * @param user |
| | | * @return |
| | | */ |
| | | List<UserVO> getUserListByParam(UserVO user); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import lombok.AllArgsConstructor; |
| | | import org.apache.logging.log4j.util.Strings; |
| | | import org.springblade.common.cache.DictCache; |
| | | import org.springblade.common.cache.ParamCache; |
| | | import org.springblade.common.cache.SysCache; |
| | |
| | | return userVO; |
| | | } |
| | | |
| | | /** |
| | | * 按条件查询用户信息 |
| | | * @param user |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<UserVO> getUserListByParam(UserVO user) { |
| | | if (!Strings.isBlank(user.getRoleName())){ |
| | | // 查询对应的角色id |
| | | String roleIds = roleService.getRoleIds("000000", user.getRoleName()); |
| | | user.setRoleId(roleIds); |
| | | } |
| | | return baseMapper.getUserListByParam(user); |
| | | } |
| | | } |