jiaosong
2023-10-26 54e95c228558c54a008214f63fa1df72835f6254
server/services/src/main/java/com/doumee/service/business/impl/SitesServiceImpl.java
@@ -102,7 +102,15 @@
    @Override
    public void updateById(Sites sites) {
        LoginUserInfo principal = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
        QueryWrapper<Sites> wrapper = new QueryWrapper<>();
        wrapper.lambda()
                .eq(Sites::getCode,sites.getCode());
        Sites count = sitesMapper.selectOne(wrapper);
        if (Objects.nonNull(count) && !count.getId().equals(sites.getId())){
            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"站点编号已存在");
        }
        Sites update = new Sites();
        update.setId(sites.getId());
        update.setCreateDate(new Date());
        update.setEditor(principal.getId());
        update.setName(sites.getName());