Merge remote-tracking branch 'origin/master'
20 files modified
2 files added
| | |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入doorplateAddress") |
| | | public R<DoorplateAddressVO> detail(DoorplateAddressEntity doorplateAddress) { |
| | | bladeLogger.info("blade-doorplateAddress_detail", JsonUtil.toJson(doorplateAddress)); |
| | | bladeLogger.info("门牌地址详情查询", JsonUtil.toJson(doorplateAddress)); |
| | | DoorplateAddressEntity detail = doorplateAddressService.getOne(Condition.getQueryWrapper(doorplateAddress)); |
| | | return R.data(DoorplateAddressWrapper.build().entityVO(detail)); |
| | | } |
| | |
| | | @GetMapping("/getDetail") |
| | | @ApiLog("门牌地址表(总台账数据) 自定义详情") |
| | | public R getDetail(DoorplateAddressVO doorplateAddress) { |
| | | bladeLogger.info("blade-doorplateAddress_getDetail", JsonUtil.toJson(doorplateAddress)); |
| | | bladeLogger.info("门牌地址详情查询", JsonUtil.toJson(doorplateAddress)); |
| | | return R.data(doorplateAddressService.getDetail(doorplateAddress)); |
| | | } |
| | | |
| | |
| | | @GetMapping("/getFuncList") |
| | | @ApiLog("根据角色获取功能集合数据") |
| | | public R getFuncList(Integer type,String roleName) { |
| | | bladeLogger.info("blade-doorplateAddress_getFuncList", JsonUtil.toJson(ToObject.toMap("type:" + type,"roleName:"+ roleName))); |
| | | bladeLogger.info("根据角色获取功能集合数据", JsonUtil.toJson(ToObject.toMap("type:" + type,"roleName:"+ roleName))); |
| | | return R.data(doorplateAddressService.getFuncList(type,roleName)); |
| | | } |
| | | |
| | |
| | | */ |
| | | package org.springblade.modules.house.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import lombok.AllArgsConstructor; |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springblade.core.secure.BladeUser; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | | 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.DateUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.modules.house.entity.HouseTenantEntity; |
| | | import org.springblade.modules.house.excel.ExportHouseTenantExcel; |
| | | import org.springblade.modules.house.excel.HouseTenantExcel; |
| | | import org.springblade.modules.house.excel.ImportHouseholdExcel; |
| | | import org.springblade.modules.house.service.IHouseTenantService; |
| | | import org.springblade.modules.house.vo.HouseTenantVO; |
| | | import org.springblade.modules.house.wrapper.HouseTenantWrapper; |
| | | import org.springblade.modules.house.service.IHouseTenantService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 租户管理 控制器 |
| | |
| | | return R.status(houseTenantService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | @GetMapping("downLoadTenantTemplate") |
| | | @ApiOperationSupport(order = 14) |
| | | @ApiOperation(value = "导出模板") |
| | | public void downLoadTenantTemplate(HttpServletResponse response) { |
| | | List<HouseTenantExcel> list = new ArrayList<>(); |
| | | ExcelUtil.export(response, "租客数据模板", "租客数据表", list, HouseTenantExcel.class); |
| | | } |
| | | |
| | | @GetMapping("export-tenant") |
| | | @ApiOperationSupport(order = 15) |
| | | @ApiOperation(value = "导出租客") |
| | | public void exportTenant(HttpServletResponse response) { |
| | | List<ExportHouseTenantExcel> list = houseTenantService.export(); |
| | | ExcelUtil.export(response, "租客数据" + DateUtil.time(), "租客数据表", list, ExportHouseTenantExcel.class); |
| | | } |
| | | |
| | | /** |
| | | * 导入住户 |
| | | */ |
| | | @PostMapping("import-tenant") |
| | | @ApiOperationSupport(order = 12) |
| | | @ApiOperation(value = "导入住户", notes = "传入excel") |
| | | public R importUser(MultipartFile file, Integer isCovered) { |
| | | String data = houseTenantService.importUserTenant(ExcelUtil.read(file, HouseTenantExcel.class),isCovered==1); |
| | | return R.data(200,data,null); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | @ApiLog("住户 详情") |
| | | @ApiOperation(value = "详情", notes = "传入household") |
| | | public R<HouseholdVO> detail(HouseholdEntity household) { |
| | | bladeLogger.info("住户 详情", JsonUtil.toJson(household)); |
| | | bladeLogger.info("住户详情查询", JsonUtil.toJson(household)); |
| | | HouseholdEntity detail = householdService.getOne(Condition.getQueryWrapper(household).last("limit 1")); |
| | | return R.data(HouseholdWrapper.build().entityVO(detail)); |
| | | } |
| | |
| | | @ApiLog("住户 详情") |
| | | @ApiOperation(value = "详情", notes = "传入household") |
| | | public R getDetail(HouseholdEntity household) { |
| | | bladeLogger.info("住户 详情", JsonUtil.toJson(household)); |
| | | bladeLogger.info("住户详情查询", JsonUtil.toJson(household)); |
| | | return R.data(householdService.getDetail(household)); |
| | | } |
| | | |
| | |
| | | @ApiLog("住户 自定义分页") |
| | | @ApiOperation(value = "分页", notes = "传入household") |
| | | public R<IPage<HouseholdVO>> page(HouseholdVO household, Query query) { |
| | | bladeLogger.info("住户 自定义分页", JsonUtil.toJson(household)); |
| | | bladeLogger.info("住户列表信息查询", JsonUtil.toJson(household)); |
| | | IPage<HouseholdVO> pages = householdService.selectHouseholdPage(Condition.getPage(query), household); |
| | | return R.data(pages); |
| | | } |
| | |
| | | @ApiLog("住户 自定义分页") |
| | | @ApiOperation(value = "分页", notes = "传入household") |
| | | public R<IPage<HouseholdVO>> getKeynotePersonnelPage(HouseholdVO household, Query query) { |
| | | bladeLogger.info("住户 自定义分页", JsonUtil.toJson(household)); |
| | | bladeLogger.info("住户列表信息查询", JsonUtil.toJson(household)); |
| | | IPage<HouseholdVO> pages = householdService.getKeynotePersonnelPage(Condition.getPage(query), household); |
| | | return R.data(pages); |
| | | } |
| | |
| | | @ApiLog("住户 自定义新增或修改") |
| | | @ApiOperation(value = "自定义新增或修改", notes = "传入household") |
| | | public R saveOrUpdateHousehold(@Valid @RequestBody HouseholdVO household) { |
| | | bladeLogger.info("住户 自定义新增或修改", JsonUtil.toJson(household)); |
| | | bladeLogger.info("住户信息新增或修改", JsonUtil.toJson(household)); |
| | | return R.status(householdService.saveOrUpdateHousehold(household)); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "逻辑删除", notes = "传入ids") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | bladeLogger.info("住户 删除", JsonUtil.toJson(ids)); |
| | | bladeLogger.info("住户信息删除", JsonUtil.toJson(ids)); |
| | | // 返回 |
| | | return R.status(householdService.removeHousehold(ids)); |
| | | } |
| | |
| | | @ApiOperationSupport(order = 12) |
| | | @ApiOperation(value = "导入住户", notes = "传入excel") |
| | | public R importUser(MultipartFile file, Integer isCovered) { |
| | | bladeLogger.info("住户信息导入", JsonUtil.toJson(isCovered)); |
| | | String data = householdService.importUserHouseHold(ExcelUtil.read(file, ImportHouseholdExcel.class),isCovered==1); |
| | | return R.data(200,data,null); |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.house.excel; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.annotation.write.style.ColumnWidth; |
| | | import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
| | | import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springblade.common.excel.ExcelDictConverter; |
| | | import org.springblade.common.excel.ExcelDictItem; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ColumnWidth(25) |
| | | @HeadRowHeight(20) |
| | | @ContentRowHeight(18) |
| | | public class ExportHouseTenantExcel implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 2L; |
| | | |
| | | /** |
| | | * 出租屋ID |
| | | */ |
| | | @ExcelProperty(value = "房屋地址") |
| | | @ColumnWidth(25) |
| | | private String addressName; |
| | | /** |
| | | * 出租屋ID |
| | | */ |
| | | @ExcelProperty(value = "地址编码") |
| | | @ColumnWidth(25) |
| | | private String houseCode; |
| | | /** |
| | | * 姓名 |
| | | */ |
| | | @ExcelProperty(value = "姓名") |
| | | @ColumnWidth(25) |
| | | private String name; |
| | | /** |
| | | * 联系电话 |
| | | */ |
| | | @ExcelProperty(value = "联系电话") |
| | | @ColumnWidth(25) |
| | | private String phone; |
| | | /** |
| | | * 身份证 |
| | | */ |
| | | @ExcelProperty(value = "身份证") |
| | | @ColumnWidth(25) |
| | | private String idCard; |
| | | /** |
| | | * 户籍 |
| | | */ |
| | | @ExcelProperty(value = "户籍") |
| | | @ColumnWidth(25) |
| | | private String domicile; |
| | | /** |
| | | * 工作单位 |
| | | */ |
| | | @ExcelProperty(value = "工作单位") |
| | | @ColumnWidth(25) |
| | | private String workUnit; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ExcelProperty(value = "备注") |
| | | @ColumnWidth(25) |
| | | private String remark; |
| | | |
| | | |
| | | /** 性别 */ |
| | | @ExcelProperty(value = "性别",converter = ExcelDictConverter.class) |
| | | @ExcelDictItem(type = "sex") |
| | | @ColumnWidth(25) |
| | | private Integer gender; |
| | | |
| | | /** 民族 */ |
| | | @ExcelProperty(value = "民族",converter = ExcelDictConverter.class) |
| | | @ExcelDictItem(type = "nationType") |
| | | private Integer ethnicity; |
| | | |
| | | /** 创建时间 */ |
| | | @ExcelProperty(value = "创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.house.excel; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.annotation.write.style.ColumnWidth; |
| | | import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
| | | import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import lombok.Data; |
| | | import org.springblade.common.excel.ExcelDictConverter; |
| | | import org.springblade.common.excel.ExcelDictItem; |
| | | import org.springblade.common.excel.ExcelDictItemLabel; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @ColumnWidth(25) |
| | | @HeadRowHeight(20) |
| | | @ContentRowHeight(18) |
| | | public class HouseTenantExcel implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 2L; |
| | | |
| | | /** |
| | | * 出租屋ID |
| | | */ |
| | | @ExcelProperty(value = "地址编码") |
| | | @ColumnWidth(25) |
| | | private String houseCode; |
| | | /** |
| | | * 姓名 |
| | | */ |
| | | @ExcelProperty(value = "姓名") |
| | | @ColumnWidth(25) |
| | | private String name; |
| | | /** |
| | | * 联系电话 |
| | | */ |
| | | @ExcelProperty(value = "联系电话") |
| | | @ColumnWidth(25) |
| | | private String phone; |
| | | /** |
| | | * 身份证 |
| | | */ |
| | | @ExcelProperty(value = "身份证") |
| | | @ColumnWidth(25) |
| | | private String idCard; |
| | | /** |
| | | * 户籍 |
| | | */ |
| | | @ExcelProperty(value = "户籍") |
| | | @ColumnWidth(25) |
| | | private String domicile; |
| | | /** |
| | | * 工作单位 |
| | | */ |
| | | @ExcelProperty(value = "工作单位") |
| | | @ColumnWidth(25) |
| | | private String workUnit; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ExcelProperty(value = "备注") |
| | | @ColumnWidth(25) |
| | | private String remark; |
| | | |
| | | |
| | | /** 性别 1: 男 0:女 2: 未知 */ |
| | | @ColumnWidth(15) |
| | | @ExcelProperty( value = "性别",converter = ExcelDictConverter.class) |
| | | @ExcelDictItemLabel(type = "sex") |
| | | @ExcelDictItem(type = "sex") |
| | | private String gender; |
| | | |
| | | /** 民族 */ |
| | | @ColumnWidth(15) |
| | | @ExcelProperty( value = "民族",converter = ExcelDictConverter.class) |
| | | @ExcelDictItemLabel(type = "nationType") |
| | | @ExcelDictItem(type = "nationType") |
| | | private String ethnicity; |
| | | |
| | | } |
| | |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.modules.house.entity.HouseTenantEntity; |
| | | import org.springblade.modules.house.excel.ExportHouseTenantExcel; |
| | | import org.springblade.modules.house.excel.HouseTenantExcel; |
| | | import org.springblade.modules.house.vo.HouseTenantVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | * @return |
| | | */ |
| | | int removeByHousingRentalId(@Param("housingRentalId") Long housingRentalId); |
| | | |
| | | /** |
| | | * 导出租客 |
| | | * @return |
| | | */ |
| | | List<ExportHouseTenantExcel> export(); |
| | | } |
| | |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | <select id="export" resultType="org.springblade.modules.house.excel.ExportHouseTenantExcel"> |
| | | SELECT |
| | | jhr.house_code, |
| | | jda.address_name, |
| | | jht.NAME, |
| | | jht.phone, |
| | | jht.id_card, |
| | | jht.domicile, |
| | | jht.work_unit, |
| | | jht.remark, |
| | | jht.gender, |
| | | jht.ethnicity, |
| | | jht.create_time |
| | | FROM |
| | | jczz_house_tenant jht |
| | | LEFT JOIN jczz_house_rental jhr ON jht.housing_rental_id = jhr.id |
| | | LEFT JOIN jczz_doorplate_address jda on jda.address_code=jhr.house_code |
| | | WHERE |
| | | jht.is_deleted = 0 |
| | | |
| | | </select> |
| | | |
| | | <!--根据租房id删除租户信息--> |
| | | <update id="removeByHousingRentalId"> |
| | | update jczz_house_tenant set is_deleted = 1 where housing_rental_id = #{housingRentalId} |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.modules.house.entity.HouseTenantEntity; |
| | | import org.springblade.modules.house.excel.ExportHouseTenantExcel; |
| | | import org.springblade.modules.house.excel.HouseTenantExcel; |
| | | import org.springblade.modules.house.vo.HouseTenantVO; |
| | | import org.springblade.core.mp.base.BaseService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 租户管理 服务类 |
| | |
| | | * @return |
| | | */ |
| | | int removeByHousingRentalId(Long id); |
| | | |
| | | /** |
| | | * 导出租客 |
| | | * @return |
| | | */ |
| | | List<ExportHouseTenantExcel> export(); |
| | | |
| | | String importUserTenant(List<HouseTenantExcel> read, boolean b); |
| | | } |
| | |
| | | */ |
| | | package org.springblade.modules.house.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.modules.house.entity.HouseTenantEntity; |
| | | import org.springblade.modules.house.vo.HouseTenantVO; |
| | | import org.springblade.modules.house.mapper.HouseTenantMapper; |
| | | import org.springblade.modules.house.service.IHouseTenantService; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.logging.log4j.util.Strings; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.modules.house.entity.HouseRentalEntity; |
| | | import org.springblade.modules.house.entity.HouseTenantEntity; |
| | | import org.springblade.modules.house.excel.ExportHouseTenantExcel; |
| | | import org.springblade.modules.house.excel.HouseTenantExcel; |
| | | import org.springblade.modules.house.mapper.HouseTenantMapper; |
| | | import org.springblade.modules.house.service.IHouseRentalService; |
| | | import org.springblade.modules.house.service.IHouseTenantService; |
| | | import org.springblade.modules.house.vo.HouseTenantVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 租户管理 服务实现类 |
| | |
| | | @Service |
| | | public class HouseTenantServiceImpl extends ServiceImpl<HouseTenantMapper, HouseTenantEntity> implements IHouseTenantService { |
| | | |
| | | @Autowired |
| | | private IHouseRentalService iHouseRentalService; |
| | | |
| | | @Override |
| | | public IPage<HouseTenantVO> selectHouseTenantPage(IPage<HouseTenantVO> page, HouseTenantVO houseTenant) { |
| | | return page.setRecords(baseMapper.selectHouseTenantPage(page, houseTenant)); |
| | |
| | | |
| | | /** |
| | | * 根据租房id删除租户信息 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | public int removeByHousingRentalId(Long id) { |
| | | return baseMapper.removeByHousingRentalId(id); |
| | | } |
| | | |
| | | /** |
| | | * 导出租客 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<ExportHouseTenantExcel> export() { |
| | | return baseMapper.export(); |
| | | } |
| | | |
| | | @Override |
| | | public String importUserTenant(List<HouseTenantExcel> data, boolean b) { |
| | | List<HouseTenantEntity> HouseTenantList = new ArrayList<>(); |
| | | int totalNum = data.size(); |
| | | int importNum = 0; |
| | | int updateNum = 0; |
| | | int errorNum = 0; |
| | | for (HouseTenantExcel houseHoldExcel : data) { |
| | | HouseTenantVO houseTenantVO = Objects.requireNonNull(BeanUtil.copy(houseHoldExcel, HouseTenantVO.class)); |
| | | HouseRentalEntity houseRentalEntity = iHouseRentalService.getOne(Wrappers.<HouseRentalEntity>lambdaQuery() |
| | | .eq(HouseRentalEntity::getHouseCode, houseTenantVO.getHouseCode())); |
| | | if (houseRentalEntity != null) { |
| | | // 性别 |
| | | if (!Strings.isBlank(houseHoldExcel.getGender())) { |
| | | houseTenantVO.setGender(Integer.valueOf(houseHoldExcel.getGender())); |
| | | } |
| | | houseTenantVO.setHousingRentalId(houseRentalEntity.getId()); |
| | | HouseTenantList.add(houseTenantVO); |
| | | } else { |
| | | errorNum++; |
| | | } |
| | | } |
| | | importNum = saveBatch(HouseTenantList) ? HouseTenantList.size() : 0; |
| | | StringBuilder builder = new StringBuilder("导入完成!"); |
| | | builder.append("其中本次表格共有 ").append(totalNum).append(" 条数据,") |
| | | .append("成功导入 ").append(importNum).append(" 条数据。"); |
| | | // if (updateNum > 0) { |
| | | // builder.append("其中有 ").append(updateNum).append(" 条数据已存在。"); |
| | | // } |
| | | if (errorNum > 0) { |
| | | builder.append("共有 ").append(errorNum).append(" 条数据由于查询不到出租屋信息未导入!"); |
| | | } |
| | | return builder.toString(); |
| | | } |
| | | } |
| | |
| | | */ |
| | | package org.springblade.modules.house.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import org.springblade.modules.house.entity.HouseTenantEntity; |
| | | import org.springblade.core.tool.node.INode; |
| | | import lombok.Data; |
| | |
| | | public class HouseTenantVO extends HouseTenantEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "地址编码") |
| | | private String houseCode; |
| | | } |
| | |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页page", notes = "传入place") |
| | | public R<IPage<PlaceVO>> page(PlaceVO place, Query query) { |
| | | bladeLogger.info("blade-place_page", JsonUtil.toJson(place)); |
| | | bladeLogger.info("场所列表查询", JsonUtil.toJson(place)); |
| | | IPage<PlaceVO> pages = placeService.selectPlacePage(Condition.getPage(query), place); |
| | | return R.data(pages); |
| | | } |
| | |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "九小场所档案", notes = "传入place") |
| | | public R<IPage<PlaceVO>> ninePage(PlaceVO place, Query query) { |
| | | bladeLogger.info("blade-place_ninePage", JsonUtil.toJson(place)); |
| | | bladeLogger.info("九小场所档案列表查询", JsonUtil.toJson(place)); |
| | | IPage<PlaceVO> pages = placeService.selectNinePlacePage(Condition.getPage(query), place); |
| | | return R.data(pages); |
| | | } |
| | |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "企业商超列表查询", notes = "传入place") |
| | | public R<IPage<PlaceVO>> mallPage(PlaceVO place, Query query) { |
| | | bladeLogger.info("blade-place_mallPage", JsonUtil.toJson(place)); |
| | | bladeLogger.info("企业商超列表查询", JsonUtil.toJson(place)); |
| | | IPage<PlaceVO> pages = placeService.selectMallPage(Condition.getPage(query), place); |
| | | return R.data(pages); |
| | | } |
| | |
| | | @ApiLog("场所自定义新增") |
| | | @ApiOperation(value = "自定义新增", notes = "传入place") |
| | | public R add(@RequestBody PlaceVO placeVO){ |
| | | bladeLogger.info("场所自定义新增", JsonUtil.toJson(placeVO)); |
| | | bladeLogger.info("场所信息采集/修改", JsonUtil.toJson(placeVO)); |
| | | return R.status(placeService.addOrUpdate(placeVO)); |
| | | } |
| | | |
| | |
| | | @ApiLog("场所自定义新增/修改") |
| | | @ApiOperation(value = "自定义新增/修改", notes = "传入place") |
| | | public R addOrUpdate(@RequestBody PlaceVO placeVO){ |
| | | bladeLogger.info("场所自定义新增/修改", JsonUtil.toJson(placeVO)); |
| | | bladeLogger.info("场所信息采集/修改", JsonUtil.toJson(placeVO)); |
| | | return R.status(placeService.addOrUpdate(placeVO)); |
| | | } |
| | | |
| | |
| | | @ApiLog("场所表 自定义详情查询") |
| | | @ApiOperation(value = "场所表 自定义详情查询", notes = "传入ids") |
| | | public R<PlaceVO> getDetail(PlaceVO place) { |
| | | bladeLogger.info("场所表 自定义详情查询", JsonUtil.toJson(place)); |
| | | bladeLogger.info("场所表详情查询", JsonUtil.toJson(place)); |
| | | return R.data(placeService.getDetail(place)); |
| | | } |
| | | |
| | |
| | | */ |
| | | @PostMapping("/import-place") |
| | | public R importPlace(MultipartFile file, Integer isCovered) { |
| | | bladeLogger.info("场所信息批量导入", JsonUtil.toJson(isCovered)); |
| | | String data = placeService.importPlace(ExcelUtil.read(file, ImportPlaceExcel.class),isCovered==1); |
| | | return R.data(200,data,""); |
| | | } |
| | |
| | | /* |
| | | * 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.police.controller; |
| | | |
| | | import io.swagger.annotations.Api; |
| | |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import lombok.AllArgsConstructor; |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | | import org.springblade.core.secure.BladeUser; |
| | | import org.springblade.core.log.logger.BladeLogger; |
| | | 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.jackson.JsonUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.police.excel.PoliceAffairsGridExcel; |
| | | import org.springblade.modules.police.excel.PoliceAffairsGridImporter; |
| | | import org.springblade.modules.police.excel.PoliceStationExcel; |
| | | import org.springblade.modules.police.excel.PoliceStationImporter; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.modules.police.entity.PoliceAffairsGridEntity; |
| | | import org.springblade.modules.police.vo.PoliceAffairsGridVO; |
| | | import org.springblade.modules.police.wrapper.PoliceAffairsGridWrapper; |
| | | import org.springblade.modules.police.service.IPoliceAffairsGridService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | /** |
| | |
| | | public class PoliceAffairsGridController { |
| | | |
| | | private final IPoliceAffairsGridService policeAffairsGridService; |
| | | private final BladeLogger bladeLogger; |
| | | |
| | | /** |
| | | * 警务网格(辖区)表 详情 |
| | |
| | | } |
| | | |
| | | /** |
| | | * 警务网格(辖区)表 自定义新增或修改 |
| | | */ |
| | | @PostMapping("/saveOrUpdate") |
| | | @ApiOperationSupport(order = 8) |
| | | @ApiOperation(value = "自定义新增或修改", notes = "传入policeAffairsGrid") |
| | | public R saveOrUpdate(@Valid @RequestBody PoliceAffairsGridEntity policeAffairsGrid) { |
| | | bladeLogger.info("警务网格(辖区)表 自定义新增或修改",JsonUtil.toJson(policeAffairsGrid)); |
| | | return R.status(policeAffairsGridService.saveOrUpdatePoliceAffairsGrid(policeAffairsGrid)); |
| | | } |
| | | |
| | | /** |
| | | * 警务网格(辖区)表 新增或修改 |
| | | */ |
| | | @PostMapping("/submit") |
| | |
| | | return R.success("操作成功"); |
| | | } |
| | | |
| | | /** |
| | | * 派出所树查询 |
| | | */ |
| | | @GetMapping("/tree") |
| | | public R tree(PoliceStationEntity policeStation) { |
| | | return R.data(policeStationService.tree(policeStation)); |
| | | } |
| | | |
| | | } |
| | |
| | | * @param policeAffairsGrid |
| | | * @return |
| | | */ |
| | | List<PoliceAffairsGridVO> selectPoliceAffairsGridPage(IPage page, PoliceAffairsGridVO policeAffairsGrid); |
| | | List<PoliceAffairsGridVO> selectPoliceAffairsGridPage(IPage page, |
| | | @Param("policeAffairsGrid") PoliceAffairsGridVO policeAffairsGrid, |
| | | @Param("isAdministrator") Integer isAdministrator, |
| | | @Param("regionChildCodesList") List<String> regionChildCodesList, |
| | | @Param("gridCodeList") List<String> gridCodeList |
| | | ); |
| | | |
| | | /** |
| | | * 空间分析 |
| | |
| | | <mapper namespace="org.springblade.modules.police.mapper.PoliceAffairsGridMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="policeAffairsGridResultMap" type="org.springblade.modules.police.entity.PoliceAffairsGridEntity"> |
| | | <resultMap id="policeAffairsGridResultMap" type="org.springblade.modules.police.vo.PoliceAffairsGridVO"> |
| | | <result column="id" property="id"/> |
| | | <result column="object_id" property="objectId"/> |
| | | <result column="jws_code" property="jwsCode"/> |
| | |
| | | <result column="is_deleted" property="isDeleted"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <!--自定义分页查询--> |
| | | <select id="selectPoliceAffairsGridPage" resultMap="policeAffairsGridResultMap"> |
| | | select * from jczz_police_affairs_grid where is_deleted = 0 |
| | | <if test="policeAffairsGrid.communityName!=null and policeAffairsGrid.communityName!=''"> |
| | | and community_name like concat('%',#{policeAffairsGrid.communityName},'%') |
| | | </if> |
| | | <if test="policeAffairsGrid.jwGridCode!=null and policeAffairsGrid.jwGridCode!=''"> |
| | | and jw_grid_code like concat('%',#{policeAffairsGrid.jwGridCode},'%') |
| | | </if> |
| | | <if test="policeAffairsGrid.pcsCode!=null and policeAffairsGrid.pcsCode!=''"> |
| | | and pcs_code like concat('%',#{policeAffairsGrid.pcsCode},'%') |
| | | </if> |
| | | <if test="policeAffairsGrid.pcsName!=null and policeAffairsGrid.pcsName!=''"> |
| | | and pcs_name like concat('%',#{policeAffairsGrid.pcsName},'%') |
| | | </if> |
| | | <if test="isAdministrator==2"> |
| | | <choose> |
| | | <when test="policeAffairsGrid.roleName != null and policeAffairsGrid.roleName != ''"> |
| | | <if test="policeAffairsGrid.roleName=='mj'"> |
| | | <choose> |
| | | <when test="regionChildCodesList !=null and regionChildCodesList.size()>0"> |
| | | and community_code in |
| | | <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | </when> |
| | | <otherwise> |
| | | and community_code in ('') |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | | </when> |
| | | <otherwise> |
| | | <choose> |
| | | <when test="regionChildCodesList !=null and regionChildCodesList.size()>0"> |
| | | and community_code in |
| | | <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | </when> |
| | | <otherwise> |
| | | and community_code in ('') |
| | | </otherwise> |
| | | </choose> |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | | order by id desc,pcs_code desc |
| | | </select> |
| | | |
| | | <!--判断该点在哪个警务网格--> |
| | |
| | | */ |
| | | package org.springblade.modules.police.mapper; |
| | | |
| | | import org.apache.ibatis.annotations.MapKey; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.common.node.TreeStringNode; |
| | | import org.springblade.modules.police.entity.PoliceStationEntity; |
| | | import org.springblade.modules.police.vo.PoliceStationVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 派出所信息表 Mapper 接口 |
| | |
| | | */ |
| | | List<PoliceStationVO> selectPoliceStationPage(IPage page, PoliceStationVO policeStation); |
| | | |
| | | |
| | | /** |
| | | * 派出所树查询 |
| | | * @param policeStation |
| | | * @return |
| | | */ |
| | | @MapKey(value = "id") |
| | | Map<String, TreeStringNode> tree(@Param("policeStation") PoliceStationEntity policeStation); |
| | | } |
| | |
| | | select * from jczz_police_station where is_deleted = 0 |
| | | </select> |
| | | |
| | | <!--派出所树查询--> |
| | | <select id="tree" resultType="org.springblade.common.node.TreeStringNode"> |
| | | SELECT |
| | | code as id, |
| | | parent_code as parentId, |
| | | name |
| | | FROM jczz_police_station |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | * @return |
| | | */ |
| | | List<String> getCommunityCodeListByUserId(Long userId); |
| | | |
| | | /** |
| | | * 警务网格(辖区)表 自定义新增或修改 |
| | | * @param policeAffairsGrid |
| | | * @return |
| | | */ |
| | | boolean saveOrUpdatePoliceAffairsGrid(PoliceAffairsGridEntity policeAffairsGrid); |
| | | } |
| | |
| | | package org.springblade.modules.police.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.common.node.TreeStringNode; |
| | | import org.springblade.modules.police.entity.PoliceStationEntity; |
| | | import org.springblade.modules.police.excel.PoliceStationExcel; |
| | | import org.springblade.modules.police.vo.PoliceStationVO; |
| | |
| | | * @param isCovered |
| | | */ |
| | | void importPoliceStation(List<PoliceStationExcel> data, Boolean isCovered); |
| | | |
| | | /** |
| | | * 派出所树查询 |
| | | * @param policeStation |
| | | * @return |
| | | */ |
| | | List<TreeStringNode> tree(PoliceStationEntity policeStation); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.common.param.CommonParamSet; |
| | | import org.springblade.common.utils.SpringUtils; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.core.tool.utils.SpringUtil; |
| | | import org.springblade.modules.community.entity.CommunityEntity; |
| | | import org.springblade.modules.community.service.ICommunityService; |
| | | import org.springblade.modules.police.entity.PoliceAffairsGridEntity; |
| | | import org.springblade.modules.police.entity.PoliceStationEntity; |
| | | import org.springblade.modules.police.excel.PoliceAffairsGridExcel; |
| | |
| | | |
| | | @Override |
| | | public IPage<PoliceAffairsGridVO> selectPoliceAffairsGridPage(IPage<PoliceAffairsGridVO> page, PoliceAffairsGridVO policeAffairsGrid) { |
| | | return page.setRecords(baseMapper.selectPoliceAffairsGridPage(page, policeAffairsGrid)); |
| | | CommonParamSet commonParamSet = new CommonParamSet<>().invoke(PoliceAffairsGridVO.class, policeAffairsGrid); |
| | | return page.setRecords(baseMapper.selectPoliceAffairsGridPage(page, |
| | | policeAffairsGrid, |
| | | commonParamSet.getIsAdministrator(), |
| | | commonParamSet.getRegionChildCodesList(), |
| | | commonParamSet.getGridCodeList() |
| | | )); |
| | | } |
| | | |
| | | /** |
| | |
| | | public List<String> getCommunityCodeListByUserId(Long userId) { |
| | | return baseMapper.getCommunityCodeListByUserId(userId.toString()); |
| | | } |
| | | |
| | | /** |
| | | * 警务网格(辖区)表 自定义新增或修改 |
| | | * @param policeAffairsGrid |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean saveOrUpdatePoliceAffairsGrid(PoliceAffairsGridEntity policeAffairsGrid) { |
| | | boolean flag = false; |
| | | // 查询对应的派出所及社区名称 |
| | | IPoliceStationService policeStationService = SpringUtils.getBean(IPoliceStationService.class); |
| | | QueryWrapper<PoliceStationEntity> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("code",policeAffairsGrid.getPcsCode()); |
| | | List<PoliceStationEntity> policeStationEntityList = policeStationService.list(queryWrapper); |
| | | if (policeStationEntityList.size()>0){ |
| | | policeAffairsGrid.setPcsName(policeStationEntityList.get(0).getName()); |
| | | } |
| | | ICommunityService communityService = SpringUtils.getBean(ICommunityService.class); |
| | | QueryWrapper<CommunityEntity> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("code",policeAffairsGrid.getCommunityCode()); |
| | | List<CommunityEntity> communityEntityList = communityService.list(wrapper); |
| | | if (communityEntityList.size()>0){ |
| | | policeAffairsGrid.setCommunityName(communityEntityList.get(0).getName()); |
| | | } |
| | | if (null!=policeAffairsGrid.getId()){ |
| | | policeAffairsGrid.setGeom(null); |
| | | // 更新 |
| | | flag = updateById(policeAffairsGrid); |
| | | }else { |
| | | policeAffairsGrid.setGeom(null); |
| | | // 新增 |
| | | flag = save(policeAffairsGrid); |
| | | } |
| | | return flag; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.common.node.TreeStringNode; |
| | | import org.springblade.common.utils.NodeTreeUtil; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.modules.police.entity.PoliceStationEntity; |
| | | import org.springblade.modules.police.excel.PoliceStationExcel; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 派出所树查询 |
| | | * @param policeStation |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<TreeStringNode> tree(PoliceStationEntity policeStation) { |
| | | return NodeTreeUtil.getStringNodeTree(baseMapper.tree(policeStation)); |
| | | } |
| | | } |
| | |
| | | /* |
| | | * 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.police.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import org.springblade.modules.police.entity.PoliceAffairsGridEntity; |
| | | import org.springblade.core.tool.node.INode; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | |
| | | public class PoliceAffairsGridVO extends PoliceAffairsGridEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 社区编号 |
| | | */ |
| | | @ApiModelProperty(value = "社区编号") |
| | | private String communityCode; |
| | | |
| | | /** |
| | | * 角色别名 |
| | | */ |
| | | @ApiModelProperty(value = "角色别名") |
| | | private String roleName; |
| | | |
| | | } |