src/main/java/org/springblade/modules/circle/entity/CircleEntity.java
@@ -23,6 +23,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.EqualsAndHashCode; import org.springblade.core.tenant.mp.TenantEntity; import org.springframework.format.annotation.DateTimeFormat; import java.util.Date; @@ -49,7 +50,7 @@ /** 创建时间 */ @ApiModelProperty(value = "创建时间", example = "") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @TableField(value = "create_time",fill = FieldFill.INSERT) private Date createTime; src/main/java/org/springblade/modules/grid/controller/GridController.java
@@ -178,5 +178,12 @@ return R.data(gridService.getGridTree(grid)); } /** * 综治网格信息 */ @ApiOperation(value = "获取综治网格信息", notes = "传入houseCode") @GetMapping("/gridInfoByHouseCode") public R gridInfoByHouseCode( @RequestParam("houseCode") String houseCode) { return R.data(gridService.gridInfoByHouseCode(houseCode)); } } src/main/java/org/springblade/modules/grid/mapper/GridMapper.java
@@ -19,7 +19,9 @@ import org.apache.ibatis.annotations.MapKey; import org.apache.ibatis.annotations.Param; import org.springblade.common.node.TreeStringNode; import org.springblade.modules.doorplateAddress.entity.DoorplateAddressEntity; import org.springblade.modules.grid.entity.GridEntity; import org.springblade.modules.grid.entity.GridmanEntity; import org.springblade.modules.grid.vo.GridVO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -90,4 +92,8 @@ */ @MapKey(value = "id") Map<String, TreeStringNode> getGridTree(); List<GridmanEntity> gridInfo(String houseCode); List<DoorplateAddressEntity> gridAoiName(Integer id); } src/main/java/org/springblade/modules/grid/mapper/GridMapper.xml
@@ -87,19 +87,48 @@ <!--网格树--> <select id="getGridTree" resultType="org.springblade.common.node.TreeStringNode"> SELECT code as id, parent_code as parentId, name FROM blade_region where district_code = '361102' SELECT code as id, parent_code as parentId, name FROM blade_region where district_code = '361102' union all ( select id, community_code as parentId, grid_name as name from jczz_grid where is_deleted = 0 ) (select id, community_code as parentId, grid_name as name from jczz_grid where is_deleted = 0) </select> <select id="gridInfo" resultType="org.springblade.modules.grid.entity.GridmanEntity"> SELECT jg.id, jg.grid_name, jgm.pic_url, jgm.mobile, jgm.gridman_name FROM jczz_grid jg LEFT JOIN jczz_gridman jgm ON jgm.grid_id = jg.id LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id WHERE jgr.house_code = #{houseCode} AND jg.is_deleted = '0' AND jgm.is_deleted = '0' </select> <select id="gridAoiName" resultType="org.springblade.modules.doorplateAddress.entity.DoorplateAddressEntity"> SELECT aoi_name, GROUP_CONCAT(building_name) building_name FROM (SELECT DISTINCT aoi_name, building_name FROM jczz_doorplate_address WHERE address_code IN (SELECT jgr.house_code FROM jczz_grid jg LEFT JOIN jczz_gridman jgm ON jgm.grid_id = jg.id LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id WHERE jg.id = #{id})) a GROUP BY aoi_name </select> </mapper> src/main/java/org/springblade/modules/grid/service/IGridService.java
@@ -100,4 +100,6 @@ * @return */ Object getGridTree(GridVO grid); Object gridInfoByHouseCode(String houseCode); } src/main/java/org/springblade/modules/grid/service/impl/GridServiceImpl.java
@@ -17,35 +17,30 @@ package org.springblade.modules.grid.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springblade.common.utils.NodeTreeUtil; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.utils.BeanUtil; import org.springblade.modules.doorplateAddress.entity.DoorplateAddressEntity; import org.springblade.modules.doorplateAddress.service.IDoorplateAddressService; import org.springblade.modules.grid.entity.GridEntity; import org.springblade.modules.grid.entity.GridRangeEntity; import org.springblade.modules.grid.entity.GridmanEntity; import org.springblade.modules.grid.excel.GridExcel; import org.springblade.modules.grid.service.IGridRangeService; import org.springblade.modules.grid.vo.GridVO; import org.springblade.modules.grid.mapper.GridMapper; import org.springblade.modules.grid.service.IGridRangeService; import org.springblade.modules.grid.service.IGridService; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.modules.grid.vo.GridVO; import org.springblade.modules.place.vo.PlaceVO; import org.springblade.modules.system.entity.Dept; import org.springblade.modules.system.entity.Region; import org.springblade.modules.system.entity.User; import org.springblade.modules.system.service.IDeptService; import org.springblade.modules.system.service.IRegionService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.metadata.IPage; import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Objects; import java.util.*; /** * 网格表 服务实现类 @@ -269,6 +264,7 @@ /** * 网格树 * * @param grid * @return */ @@ -276,4 +272,16 @@ public Object getGridTree(GridVO grid) { return NodeTreeUtil.getStringNodeTree(baseMapper.getGridTree()); } @Override public Object gridInfoByHouseCode(String houseCode) { Map<String, Object> objectObjectHashMap = new HashMap<>(); List<GridmanEntity> gridmanEntities = baseMapper.gridInfo(houseCode); Integer id = gridmanEntities.get(0).getId(); objectObjectHashMap.put("grid", gridmanEntities); List<DoorplateAddressEntity> result = baseMapper.gridAoiName(id); objectObjectHashMap.put("doorplateAddress", result); return objectObjectHashMap; } } src/main/java/org/springblade/modules/house/entity/UserHouseLabelEntity.java
@@ -16,10 +16,7 @@ */ package org.springblade.modules.house.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.*; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import lombok.Data; @@ -27,6 +24,7 @@ import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import java.util.Date; /** * 住户-标签 实体类 @@ -85,4 +83,7 @@ @TableField("household_id") private Long householdId; @TableField(value = "create_time",fill = FieldFill.INSERT) private Date createTime; } src/main/java/org/springblade/modules/house/excel/HouseAndHoldExcel.java
@@ -221,6 +221,11 @@ @ExcelProperty( "备注") private String remarks; /** 备注 */ @ColumnWidth(15) @ExcelProperty( "重点人群") private String labelId; } src/main/java/org/springblade/modules/house/service/impl/HouseServiceImpl.java
@@ -18,27 +18,35 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.commons.lang3.StringUtils; import org.apache.logging.log4j.util.Strings; import org.springblade.common.utils.IdUtils; import org.springblade.common.utils.NodeTreeUtil; import org.springblade.common.utils.SpringUtils; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.utils.BeanUtil; import org.springblade.modules.grid.service.IGridService; import org.springblade.modules.house.entity.HouseEntity; import org.springblade.modules.house.entity.HouseholdEntity; import org.springblade.modules.house.entity.UserHouseLabelEntity; import org.springblade.modules.house.excel.HouseAndHoldExcel; import org.springblade.modules.house.excel.HouseExcel; import org.springblade.modules.house.mapper.HouseMapper; import org.springblade.modules.house.service.IHouseService; import org.springblade.modules.house.service.IHouseholdService; import org.springblade.modules.house.service.IUserHouseLabelService; import org.springblade.modules.house.vo.HouseParam; import org.springblade.modules.house.vo.HouseTree; import org.springblade.modules.house.vo.HouseVO; import org.springblade.modules.label.entity.LabelEntity; import org.springblade.modules.label.service.ILabelService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.math.BigDecimal; import java.util.*; /** @@ -149,7 +157,8 @@ @Transactional(rollbackFor = Exception.class) public void importHouseAndHold(List<HouseAndHoldExcel> data, Boolean isCovered) { for (HouseAndHoldExcel houseAndHoldExcel : data) { // System.out.println("houseAndHoldExcel = " + houseAndHoldExcel); // System.out.println(houseAndHoldExcel); System.out.println("houseAndHoldExcel = " + houseAndHoldExcel); // 保存房屋数据--一个一个插入,防止一个表格中存在多个地址编号相同的数据 saveHouseData(houseAndHoldExcel); // 保存住户数据(包含标签)--一个一个插入,防止一个表格中存在多个地址编号相同的数据 @@ -210,7 +219,7 @@ QueryWrapper<HouseholdEntity> wrapper = new QueryWrapper<>(); wrapper.eq("house_code",houseAndHoldExcel.getHouseCode()) .eq("is_deleted",0) .eq("phone_number",houseAndHoldExcel.getPhoneNumber()); .eq("name",houseAndHoldExcel.getName()); HouseholdEntity one = householdService.getOne(wrapper); // 不存在则插入,存在则不操作 if (null == one){ @@ -265,7 +274,29 @@ householdEntity.setUpdateTime(new Date()); householdEntity.setUpdateUser(AuthUtil.getUserId()); // 新增 householdService.save(householdEntity); boolean save = householdService.save(householdEntity); if (save) { String labelId = houseAndHoldExcel.getLabelId(); if (StringUtils.isBlank(labelId)) { return; } String[] split = labelId.split(","); IUserHouseLabelService bean = SpringUtils.getBean(IUserHouseLabelService.class); ILabelService bean1 = SpringUtils.getBean(ILabelService.class); for (String s : split) { LabelEntity one1 = bean1.getOne(Wrappers.<LabelEntity>lambdaQuery().eq(LabelEntity::getLabelName, s)); if (one1 != null) { UserHouseLabelEntity userHouseLabelEntity = new UserHouseLabelEntity(); userHouseLabelEntity.setLabelId(BigDecimal.valueOf(one1.getId()).longValue()); userHouseLabelEntity.setHouseholdId(householdEntity.getId()); userHouseLabelEntity.setLableType(1); userHouseLabelEntity.setLabelName(s); userHouseLabelEntity.setHouseCode(houseAndHoldExcel.getHouseCode()); bean.save(userHouseLabelEntity); } } } } } src/main/java/org/springblade/modules/place/entity/PlaceExtEntity.java
@@ -16,10 +16,7 @@ */ package org.springblade.modules.place.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableName; 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; @@ -127,6 +124,7 @@ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @ApiModelProperty("创建时间") @TableField(fill = FieldFill.INSERT) private Date createTime; /** src/main/java/org/springblade/modules/place/mapper/PlaceMapper.xml
@@ -16,15 +16,17 @@ select jp.*, bu.real_name as username,bu.phone as phone, bx.real_name as createUserName from jczz_place jp bx.real_name as createUserName, jpe.confirm_flag confirmFlag from jczz_place jp left join blade_user bu on bu.id = jp.principal_user_id and bu.is_deleted = 0 left join blade_user bx on bx.id = jp.create_user and bx.is_deleted = 0 LEFT JOIN jczz_place_ext jpe on jpe.place_id=jp.id left join ( select a.* from jczz_place_poi_label a inner join ( select place_id,max(id) as id from jczz_place_poi_label b group by place_id ) b on a.id = b.id select a.* from jczz_place_poi_label a inner join ( select place_id,max(id) as id from jczz_place_poi_label b group by place_id ) b on a.id = b.id ) jppl on jppl.place_id = jp.id where jp.is_deleted = 0 <if test="place.roleName!=null and place.roleName!=''"> @@ -72,6 +74,7 @@ and bu.real_name != "" and bu.phone != "" </if> order by jpe.create_time desc </select> <!--查询场所集合信息--> src/main/java/org/springblade/modules/place/vo/PlaceVO.java
@@ -16,6 +16,7 @@ */ package org.springblade.modules.place.vo; import io.swagger.annotations.ApiModelProperty; import org.springblade.modules.doorplateAddress.entity.DoorplateAddressEntity; import org.springblade.modules.doorplateAddress.vo.DoorplateAddressVO; import org.springblade.modules.grid.vo.GridVO; @@ -55,6 +56,9 @@ */ private Integer addressType; @ApiModelProperty(value = "确认标记 1:待审核 2:审核通过 3:审核不通过") private Integer confirmFlag; /** * 采集人姓名 */ src/main/resources/application.yml
@@ -216,6 +216,7 @@ - /public_discuss/publicDiscuss/detail - /blade-userPublicEnroll/userPublicEnroll/page - /blade-topics/topics/lists - /blade-household/household/getHouseholdOtherInfo # - /blade-doorplateAddress/doorplateAddress/** # - /blade-house/house/** # - /blade-label/label/**