Commit e2bf4dec by chamberone

feat: 添加区划数量判断

1 parent db9afa68
...@@ -207,7 +207,7 @@ public class BusinessBlockServiceImpl implements BusinessBlockService { ...@@ -207,7 +207,7 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
block.setLayerId(layerId); block.setLayerId(layerId);
block.setLayerName(layerName); block.setLayerName(layerName);
block.setStatus(true); block.setStatus(true);
//block.setArea(0L); block.setAreaCount(0L);
block.setCreateTime(LocalDateTime.now()); block.setCreateTime(LocalDateTime.now());
block.setUpdateTime(block.getCreateTime()); block.setUpdateTime(block.getCreateTime());
entityManager.persist(block); entityManager.persist(block);
...@@ -219,8 +219,13 @@ public class BusinessBlockServiceImpl implements BusinessBlockService { ...@@ -219,8 +219,13 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
@Override @Override
public Result<?> businessServiceBlockUpdateAreaIds(String blockId, String areaIds) throws BusinessException { public Result<?> businessServiceBlockUpdateAreaIds(String blockId, String areaIds) throws BusinessException {
MapBlockInfoEntity block = mapBlockInfoDao.getById(Integer.parseInt(blockId)); MapBlockInfoEntity block = mapBlockInfoDao.getById(Integer.parseInt(blockId));
if(null != block) { if (null != block) {
block.setAreaIds(areaIds); block.setAreaIds(areaIds);
if (StringUtils.isBlank(areaIds)) {
block.setAreaCount(0L);
} else {
block.setAreaCount((long) areaIds.split(",").length);
}
} }
mapBlockInfoDao.save(block); mapBlockInfoDao.save(block);
mapBlockInfoDao.flush(); mapBlockInfoDao.flush();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!