diff --git a/kn-service-api/biz-vordm-api/src/main/java/com/kening/vordm/entity/HotspotArea.java b/kn-service-api/biz-vordm-api/src/main/java/com/kening/vordm/entity/HotspotArea.java index 7492d2a..ff95e2f 100644 --- a/kn-service-api/biz-vordm-api/src/main/java/com/kening/vordm/entity/HotspotArea.java +++ b/kn-service-api/biz-vordm-api/src/main/java/com/kening/vordm/entity/HotspotArea.java @@ -17,4 +17,8 @@ public class HotspotArea { * 频次 */ private Integer value; + /** + * 名称 + */ + private String nameNew; } diff --git a/kn-service-api/biz-vordm-api/src/main/java/com/kening/vordm/entity/Websites.java b/kn-service-api/biz-vordm-api/src/main/java/com/kening/vordm/entity/Websites.java index c8a3340..f52d2ab 100644 --- a/kn-service-api/biz-vordm-api/src/main/java/com/kening/vordm/entity/Websites.java +++ b/kn-service-api/biz-vordm-api/src/main/java/com/kening/vordm/entity/Websites.java @@ -49,7 +49,7 @@ public class Websites implements Serializable { /** * 网站灾害对应id */ - private Long websiteId; + private String websiteId; /** * 上传的管理人员 diff --git a/kn-service/biz-vordm/src/main/java/com/kening/vordm/controller/DisasterInfoController.java b/kn-service/biz-vordm/src/main/java/com/kening/vordm/controller/DisasterInfoController.java index fb9c123..6cc27db 100644 --- a/kn-service/biz-vordm/src/main/java/com/kening/vordm/controller/DisasterInfoController.java +++ b/kn-service/biz-vordm/src/main/java/com/kening/vordm/controller/DisasterInfoController.java @@ -2,7 +2,6 @@ package com.kening.vordm.controller; import cn.hutool.core.bean.BeanUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.StringUtils; diff --git a/kn-service/biz-vordm/src/main/java/com/kening/vordm/controller/WebsitesController.java b/kn-service/biz-vordm/src/main/java/com/kening/vordm/controller/WebsitesController.java new file mode 100644 index 0000000..4d42bf7 --- /dev/null +++ b/kn-service/biz-vordm/src/main/java/com/kening/vordm/controller/WebsitesController.java @@ -0,0 +1,48 @@ +package com.kening.vordm.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.kening.vordm.entity.Websites; +import com.kening.vordm.service.WebsitesService; +import lombok.RequiredArgsConstructor; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; + +import java.util.Date; + +@RestController +@RequiredArgsConstructor +@RequestMapping("/ui/websites") +public class WebsitesController { + + private final WebsitesService websitesService; + + + @GetMapping("/websitesPage") + public R> websitesPage(Query query, Websites websites){ + return R.data(websitesService.websitesPage(Condition.getPage(query),websites)); + } + + @PostMapping("/saveWebsites") + public R saveWebsites(@RequestBody Websites websites){ + websites.setCreateTime(new Date()); + return R.status(websitesService.save(websites)); + } + + @DeleteMapping("/remove") + public R remove(@RequestParam String id){ + return R.status(websitesService.removeByIds(Func.toLongList(id))); + } + + @PostMapping("/updateWebsites") + public R updateWebsites(@RequestBody Websites websites){ + return R.status(websitesService.updateById(websites)); + } + + @GetMapping("/getWebsitesById") + public R getWebsitesById(Long id){ + return R.data(websitesService.getById(id)); + } +} diff --git a/kn-service/biz-vordm/src/main/java/com/kening/vordm/mapper/HotspotMapper.xml b/kn-service/biz-vordm/src/main/java/com/kening/vordm/mapper/HotspotMapper.xml index fc9c1fb..8c9e2a4 100644 --- a/kn-service/biz-vordm/src/main/java/com/kening/vordm/mapper/HotspotMapper.xml +++ b/kn-service/biz-vordm/src/main/java/com/kening/vordm/mapper/HotspotMapper.xml @@ -25,6 +25,7 @@ + SELECT id,title,link,provider,disaster_id,create_time,website_id,upload_id + FROM websites + + + and disaster_id = #{websites.disasterId} + + + diff --git a/kn-service/biz-vordm/src/main/java/com/kening/vordm/service/WebsitesService.java b/kn-service/biz-vordm/src/main/java/com/kening/vordm/service/WebsitesService.java index a4c2cde..65aeb44 100644 --- a/kn-service/biz-vordm/src/main/java/com/kening/vordm/service/WebsitesService.java +++ b/kn-service/biz-vordm/src/main/java/com/kening/vordm/service/WebsitesService.java @@ -1,8 +1,10 @@ package com.kening.vordm.service; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; import com.kening.vordm.entity.Websites; +import com.kening.vordm.vo.CallForHelpVo; /** * @author G1393 @@ -11,4 +13,5 @@ import com.kening.vordm.entity.Websites; */ public interface WebsitesService extends IService { + IPage websitesPage(IPage page, Websites websites); } diff --git a/kn-service/biz-vordm/src/main/java/com/kening/vordm/service/impl/AdministratorServiceImpl.java b/kn-service/biz-vordm/src/main/java/com/kening/vordm/service/impl/AdministratorServiceImpl.java index 3d48c2a..67bd11b 100644 --- a/kn-service/biz-vordm/src/main/java/com/kening/vordm/service/impl/AdministratorServiceImpl.java +++ b/kn-service/biz-vordm/src/main/java/com/kening/vordm/service/impl/AdministratorServiceImpl.java @@ -52,11 +52,16 @@ public class AdministratorServiceImpl extends BaseServiceImpllambdaQuery().eq(Administrator::getEmail,administrator.getEmail())); + if(adminNew!=null){ + throw new RuntimeException("The email has been registered"); + } //校验账号是否存在 Administrator admin = getOne(Wrappers.lambdaQuery().eq(Administrator::getAccount,administrator.getAccount())); if(admin!=null){ throw new RuntimeException("The account has been registered"); } + String tenantId = baseMapper.getChiefTenant("VORDM"); administrator.setTenantId(tenantId); administrator.setUserType(1); diff --git a/kn-service/biz-vordm/src/main/java/com/kening/vordm/service/impl/WebsitesServiceImpl.java b/kn-service/biz-vordm/src/main/java/com/kening/vordm/service/impl/WebsitesServiceImpl.java index a3dfb33..632c8c6 100644 --- a/kn-service/biz-vordm/src/main/java/com/kening/vordm/service/impl/WebsitesServiceImpl.java +++ b/kn-service/biz-vordm/src/main/java/com/kening/vordm/service/impl/WebsitesServiceImpl.java @@ -1,5 +1,7 @@ package com.kening.vordm.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.kening.vordm.entity.Websites; import com.kening.vordm.mapper.WebsitesMapper; @@ -15,4 +17,8 @@ import org.springframework.stereotype.Service; public class WebsitesServiceImpl extends ServiceImpl implements WebsitesService { + @Override + public IPage websitesPage(IPage page, Websites websites) { + return this.baseMapper.websitesPage(page, websites); + } }