| | |
| | | import org.springblade.modules.grid.entity.GridRangeEntity; |
| | | import org.springblade.modules.grid.service.IGridRangeService; |
| | | import org.springblade.modules.grid.service.IGridService; |
| | | import org.springblade.modules.grid.service.IGridmanService; |
| | | import org.springblade.modules.grid.vo.GridVO; |
| | | import org.springblade.modules.place.entity.*; |
| | | import org.springblade.modules.place.excel.PlaceAndRelExcel; |
| | |
| | | |
| | | @Autowired |
| | | private IGridRangeService gridRangeService; |
| | | |
| | | @Autowired |
| | | private IGridmanService gridmanService; |
| | | |
| | | /** |
| | | * 自定义列表查询 |
| | |
| | | // 插入 |
| | | gridRangeService.save(gridRangeEntity); |
| | | } |
| | | }else { |
| | | // 判断网格员,查询对应网格人对应的网格id |
| | | Integer gridId = gridmanService.getGridIdByUserId(AuthUtil.getUserId()); |
| | | if (null!=gridId){ |
| | | // 判断关联关系表是否存在 |
| | | QueryWrapper<GridRangeEntity> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("grid_id",gridId).eq("house_code",placeVO.getHouseCode()); |
| | | GridRangeEntity one = gridRangeService.getOne(wrapper); |
| | | if (null==one){ |
| | | // 新增 |
| | | GridRangeEntity gridRangeEntity = new GridRangeEntity(); |
| | | gridRangeEntity.setHouseCode(placeVO.getHouseCode()); |
| | | gridRangeEntity.setGridId(gridId); |
| | | // 插入 |
| | | gridRangeService.save(gridRangeEntity); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |