Commit e2bf4dec by chamberone

feat: 添加区划数量判断

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