@@ -10,8 +10,8 @@ import com.ningdatech.basic.util.CollUtils; | |||
import com.ningdatech.kqapi.admin.model.req.MatterListReq; | |||
import com.ningdatech.kqapi.admin.model.vo.MatterDetailDTO; | |||
import com.ningdatech.kqapi.admin.model.vo.MatterListVO; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.NdKqZzsfwMenu; | |||
import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwMenuService; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.KqZzsfwMenu; | |||
import com.ningdatech.kqapi.zzsfw.service.IKqZzsfwMenuService; | |||
import lombok.RequiredArgsConstructor; | |||
import org.springframework.stereotype.Component; | |||
@@ -29,17 +29,17 @@ import java.util.List; | |||
@RequiredArgsConstructor | |||
public class AdminMatterManage { | |||
private final INdKqZzsfwMenuService zzsfwMenuService; | |||
private final IKqZzsfwMenuService zzsfwMenuService; | |||
public PageVo<MatterListVO> pageMatter(MatterListReq req) { | |||
Wrapper<NdKqZzsfwMenu> query = Wrappers.lambdaQuery(NdKqZzsfwMenu.class) | |||
.like(StrUtil.isNotBlank(req.getMatterName()), NdKqZzsfwMenu::getItemName, req.getMatterName()) | |||
.eq(req.getZoneId() != null, NdKqZzsfwMenu::getZoneId, req.getZoneId()) | |||
.eq(req.getWindowId() != null, NdKqZzsfwMenu::getWindowId, req.getWindowId()) | |||
.eq(req.getMatterType() != null, NdKqZzsfwMenu::getType, req.getMatterType()) | |||
.eq(req.getDepartment() != null, NdKqZzsfwMenu::getDepartment, req.getDepartment()) | |||
.orderByDesc(NdKqZzsfwMenu::getCreateOn); | |||
Page<NdKqZzsfwMenu> page = zzsfwMenuService.page(req.page(), query); | |||
Wrapper<KqZzsfwMenu> query = Wrappers.lambdaQuery(KqZzsfwMenu.class) | |||
.like(StrUtil.isNotBlank(req.getMatterName()), KqZzsfwMenu::getItemName, req.getMatterName()) | |||
.eq(req.getZoneId() != null, KqZzsfwMenu::getZoneId, req.getZoneId()) | |||
.eq(req.getWindowId() != null, KqZzsfwMenu::getWindowId, req.getWindowId()) | |||
.eq(req.getMatterType() != null, KqZzsfwMenu::getType, req.getMatterType()) | |||
.eq(req.getDepartment() != null, KqZzsfwMenu::getDepartment, req.getDepartment()) | |||
.orderByDesc(KqZzsfwMenu::getCreateOn); | |||
Page<KqZzsfwMenu> page = zzsfwMenuService.page(req.page(), query); | |||
if (page.getTotal() == 0) { | |||
return PageVo.empty(); | |||
} | |||
@@ -59,7 +59,7 @@ public class AdminMatterManage { | |||
} | |||
public MatterDetailDTO detail(Long id) { | |||
NdKqZzsfwMenu matter = zzsfwMenuService.getById(id); | |||
KqZzsfwMenu matter = zzsfwMenuService.getById(id); | |||
if (matter == null) { | |||
return null; | |||
} | |||
@@ -91,7 +91,7 @@ public class AdminMatterManage { | |||
} | |||
public void saveOrUpdate(MatterDetailDTO req) { | |||
NdKqZzsfwMenu matter = new NdKqZzsfwMenu(); | |||
KqZzsfwMenu matter = new KqZzsfwMenu(); | |||
matter.setId(req.getId()); | |||
matter.setFree(req.getFree()); | |||
matter.setOnlinePay(req.getOnlinePay()); | |||
@@ -3,20 +3,17 @@ package com.ningdatech.kqapi.admin.manage; | |||
import cn.hutool.core.bean.BeanUtil; | |||
import cn.hutool.core.util.StrUtil; | |||
import com.baomidou.mybatisplus.core.conditions.Wrapper; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
import com.ningdatech.basic.model.IdVo; | |||
import com.ningdatech.basic.model.PageVo; | |||
import com.ningdatech.basic.util.CollUtils; | |||
import com.ningdatech.kqapi.admin.model.entity.Window; | |||
import com.ningdatech.kqapi.admin.model.entity.Zone; | |||
import com.ningdatech.kqapi.admin.model.req.ListWindowReq; | |||
import com.ningdatech.kqapi.admin.model.req.WindowSaveReq; | |||
import com.ningdatech.kqapi.admin.model.vo.WindowDetailVO; | |||
import com.ningdatech.kqapi.admin.service.IWindowService; | |||
import com.ningdatech.kqapi.admin.service.IZoneService; | |||
import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwMenuService; | |||
import com.ningdatech.kqapi.zzsfw.service.IKqZzsfwMenuService; | |||
import lombok.RequiredArgsConstructor; | |||
import org.springframework.stereotype.Component; | |||
@@ -36,7 +33,7 @@ import java.util.stream.Collectors; | |||
public class WindowManage { | |||
private final IWindowService windowService; | |||
private final INdKqZzsfwMenuService zzsfwMenuService; | |||
private final IKqZzsfwMenuService zzsfwMenuService; | |||
public void windowSaveOrUpdate(WindowSaveReq req) { | |||
Window win = BeanUtil.copyProperties(req, Window.class); | |||
@@ -1,7 +1,7 @@ | |||
package com.ningdatech.kqapi.common.helper; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.NdKqZzsfwMattersDeduplicate; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.KqZzsfwMattersDeduplicate; | |||
import java.util.List; | |||
@@ -15,11 +15,11 @@ import java.util.List; | |||
*/ | |||
public interface MatterCacheHelper { | |||
NdKqZzsfwMattersDeduplicate getMatter(String qlName,String webapplyurl); | |||
KqZzsfwMattersDeduplicate getMatter(String qlName, String webapplyurl); | |||
String getUrl(String qlName); | |||
List<NdKqZzsfwMattersDeduplicate> all(); | |||
List<KqZzsfwMattersDeduplicate> all(); | |||
Boolean refreshAll(); | |||
} |
@@ -9,9 +9,9 @@ import com.ningdatech.kqapi.zzsfw.model.entity.ComponentsMatterEliminateEntity; | |||
import com.ningdatech.kqapi.zzsfw.service.ComponentsMatterEliminateService; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.DscSxAdsShareItemQltQlsxCommonIDVKq; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.MatterKey; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.NdKqZzsfwMattersDeduplicate; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.KqZzsfwMattersDeduplicate; | |||
import com.ningdatech.kqapi.zzsfw.service.IDscSxAdsShareItemQltQlsxCommonIDVKqService; | |||
import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwMatterDeduplicateService; | |||
import com.ningdatech.kqapi.zzsfw.service.IKqZzsfwMatterDeduplicateService; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.apache.commons.lang3.StringUtils; | |||
import org.springframework.beans.factory.InitializingBean; | |||
@@ -37,9 +37,9 @@ public abstract class AbstractMatterCacheHelper implements InitializingBean { | |||
private IDscSxAdsShareItemQltQlsxCommonIDVKqService kqService; | |||
@Autowired | |||
private INdKqZzsfwMatterDeduplicateService deduplicateService; | |||
private IKqZzsfwMatterDeduplicateService deduplicateService; | |||
protected LoadingCache<MatterKey, NdKqZzsfwMattersDeduplicate> mattersDupCache; | |||
protected LoadingCache<MatterKey, KqZzsfwMattersDeduplicate> mattersDupCache; | |||
protected LoadingCache<String, String> mattersUrlCache; | |||
@@ -87,17 +87,17 @@ public abstract class AbstractMatterCacheHelper implements InitializingBean { | |||
} | |||
} | |||
if(mattersDupCache.asMap().containsKey(key)){ | |||
NdKqZzsfwMattersDeduplicate dup = mattersDupCache.get(key); | |||
KqZzsfwMattersDeduplicate dup = mattersDupCache.get(key); | |||
dup.setCountNum(dup.getCountNum() + 1); | |||
mattersDupCache.put(key,dup); | |||
}else{ | |||
mattersDupCache.put(key,NdKqZzsfwMattersDeduplicate.of(m.getQlName(),kq_url)); | |||
mattersDupCache.put(key, KqZzsfwMattersDeduplicate.of(m.getQlName(),kq_url)); | |||
} | |||
}); | |||
return Boolean.TRUE; | |||
} | |||
protected NdKqZzsfwMattersDeduplicate get(String qlName,String url) { | |||
protected KqZzsfwMattersDeduplicate get(String qlName, String url) { | |||
MatterKey key = MatterKey.of(qlName, url); | |||
return mattersDupCache.get(key); | |||
} | |||
@@ -106,7 +106,7 @@ public abstract class AbstractMatterCacheHelper implements InitializingBean { | |||
return mattersUrlCache.get(qlName); | |||
} | |||
protected List<NdKqZzsfwMattersDeduplicate> all() { | |||
protected List<KqZzsfwMattersDeduplicate> all() { | |||
return Lists.newArrayList(mattersDupCache.asMap().values()); | |||
} | |||
@@ -116,10 +116,10 @@ public abstract class AbstractMatterCacheHelper implements InitializingBean { | |||
.refreshAfterWrite(7, TimeUnit.DAYS) | |||
.maximumSize(1024 * 100) | |||
.build(key -> { | |||
NdKqZzsfwMattersDeduplicate dup = deduplicateService.getOne(Wrappers.lambdaQuery(NdKqZzsfwMattersDeduplicate.class) | |||
.eq(NdKqZzsfwMattersDeduplicate::getQlName, key) | |||
KqZzsfwMattersDeduplicate dup = deduplicateService.getOne(Wrappers.lambdaQuery(KqZzsfwMattersDeduplicate.class) | |||
.eq(KqZzsfwMattersDeduplicate::getQlName, key) | |||
.last(BizConst.LIMIT_1) | |||
.isNotNull(NdKqZzsfwMattersDeduplicate::getWebapplyurl)); | |||
.isNotNull(KqZzsfwMattersDeduplicate::getWebapplyurl)); | |||
if (Objects.isNull(dup)) { | |||
//查不到直接返回null | |||
return null; | |||
@@ -130,10 +130,10 @@ public abstract class AbstractMatterCacheHelper implements InitializingBean { | |||
.refreshAfterWrite(7, TimeUnit.DAYS) | |||
.maximumSize(1024 * 100) | |||
.build(key -> { | |||
NdKqZzsfwMattersDeduplicate dup = deduplicateService.getOne(Wrappers.lambdaQuery(NdKqZzsfwMattersDeduplicate.class) | |||
.eq(NdKqZzsfwMattersDeduplicate::getQlName, key) | |||
KqZzsfwMattersDeduplicate dup = deduplicateService.getOne(Wrappers.lambdaQuery(KqZzsfwMattersDeduplicate.class) | |||
.eq(KqZzsfwMattersDeduplicate::getQlName, key) | |||
.last(BizConst.LIMIT_1) | |||
.isNotNull(NdKqZzsfwMattersDeduplicate::getWebapplyurl)); | |||
.isNotNull(KqZzsfwMattersDeduplicate::getWebapplyurl)); | |||
if (Objects.isNull(dup)) { | |||
//查不到直接返回null | |||
return null; | |||
@@ -157,10 +157,10 @@ public abstract class AbstractMatterCacheHelper implements InitializingBean { | |||
// .orderByDesc(DscSxAdsShareItemQltQlsxCommonIDVKq::getUpdateDate) | |||
// .last(BizConst.LIMIT_1) | |||
// ); | |||
NdKqZzsfwMattersDeduplicate dup = deduplicateService.getOne(Wrappers.lambdaQuery(NdKqZzsfwMattersDeduplicate.class) | |||
.eq(NdKqZzsfwMattersDeduplicate::getQlName, key) | |||
KqZzsfwMattersDeduplicate dup = deduplicateService.getOne(Wrappers.lambdaQuery(KqZzsfwMattersDeduplicate.class) | |||
.eq(KqZzsfwMattersDeduplicate::getQlName, key) | |||
.last(BizConst.LIMIT_1) | |||
.isNotNull(NdKqZzsfwMattersDeduplicate::getWebapplyurl)); | |||
.isNotNull(KqZzsfwMattersDeduplicate::getWebapplyurl)); | |||
if (Objects.isNull(dup)) { | |||
//查不到直接返回null | |||
return null; | |||
@@ -172,10 +172,10 @@ public abstract class AbstractMatterCacheHelper implements InitializingBean { | |||
.refreshAfterWrite(7, TimeUnit.DAYS) | |||
.maximumSize(1024 * 100) | |||
.build(key -> { | |||
NdKqZzsfwMattersDeduplicate dup = deduplicateService.getOne(Wrappers.lambdaQuery(NdKqZzsfwMattersDeduplicate.class) | |||
.eq(NdKqZzsfwMattersDeduplicate::getQlName, key) | |||
KqZzsfwMattersDeduplicate dup = deduplicateService.getOne(Wrappers.lambdaQuery(KqZzsfwMattersDeduplicate.class) | |||
.eq(KqZzsfwMattersDeduplicate::getQlName, key) | |||
.last(BizConst.LIMIT_1) | |||
.isNotNull(NdKqZzsfwMattersDeduplicate::getWebapplyurl)); | |||
.isNotNull(KqZzsfwMattersDeduplicate::getWebapplyurl)); | |||
if (Objects.isNull(dup)) { | |||
//查不到直接返回null | |||
return null; | |||
@@ -2,7 +2,7 @@ package com.ningdatech.kqapi.common.helper.impl; | |||
import com.ningdatech.kqapi.common.helper.MatterCacheHelper; | |||
import com.ningdatech.kqapi.common.helper.basic.AbstractMatterCacheHelper; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.NdKqZzsfwMattersDeduplicate; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.KqZzsfwMattersDeduplicate; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.apache.commons.lang3.StringUtils; | |||
import org.springframework.stereotype.Component; | |||
@@ -19,7 +19,7 @@ public class MattersCacheHelperImpl extends AbstractMatterCacheHelper implements | |||
@Override | |||
public NdKqZzsfwMattersDeduplicate getMatter(String qlName,String webapplyurl) { | |||
public KqZzsfwMattersDeduplicate getMatter(String qlName, String webapplyurl) { | |||
if (StringUtils.isBlank(qlName) || StringUtils.isBlank(webapplyurl)) { | |||
return null; | |||
} | |||
@@ -35,7 +35,7 @@ public class MattersCacheHelperImpl extends AbstractMatterCacheHelper implements | |||
} | |||
@Override | |||
public List<NdKqZzsfwMattersDeduplicate> all() { | |||
public List<KqZzsfwMattersDeduplicate> all() { | |||
return super.all(); | |||
} | |||
@@ -2,15 +2,15 @@ package com.ningdatech.kqapi.scheduler.manage; | |||
import cn.hutool.core.bean.BeanUtil; | |||
import com.alibaba.fastjson.JSON; | |||
import com.ningdatech.kqapi.zzsfw.model.dto.NdKqZzsfwMattersDeduplicateDTO; | |||
import com.ningdatech.kqapi.zzsfw.model.dto.NdKqZzsfwMenuDTO; | |||
import com.ningdatech.kqapi.zzsfw.model.dto.NdKqZzsfwPolicyDTO; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.NdKqZzsfwMattersDeduplicate; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.NdKqZzsfwMenu; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.NdKqZzsfwPolicy; | |||
import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwMatterDeduplicateService; | |||
import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwMenuService; | |||
import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwPolicyService; | |||
import com.ningdatech.kqapi.zzsfw.model.dto.KqZzsfwMattersDeduplicateDTO; | |||
import com.ningdatech.kqapi.zzsfw.model.dto.KqZzsfwMenuDTO; | |||
import com.ningdatech.kqapi.zzsfw.model.dto.KqZzsfwPolicyDTO; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.KqZzsfwMenu; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.KqZzsfwMattersDeduplicate; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.KqZzsfwPolicy; | |||
import com.ningdatech.kqapi.zzsfw.service.IKqZzsfwMatterDeduplicateService; | |||
import com.ningdatech.kqapi.zzsfw.service.IKqZzsfwMenuService; | |||
import com.ningdatech.kqapi.zzsfw.service.IKqZzsfwPolicyService; | |||
import lombok.RequiredArgsConstructor; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.springframework.http.HttpEntity; | |||
@@ -33,20 +33,20 @@ import java.util.List; | |||
@RequiredArgsConstructor | |||
public class SynManage { | |||
private final INdKqZzsfwMatterDeduplicateService deduplicateService; | |||
private final IKqZzsfwMatterDeduplicateService deduplicateService; | |||
private final INdKqZzsfwMenuService menuService; | |||
private final IKqZzsfwMenuService menuService; | |||
private final INdKqZzsfwPolicyService policyService; | |||
private final IKqZzsfwPolicyService policyService; | |||
private final RestTemplate restTemplate; | |||
public void synData() { | |||
log.info("同步数据开始"); | |||
//1.去重数据 | |||
List<NdKqZzsfwMattersDeduplicate> dups = deduplicateService.list(); | |||
for(NdKqZzsfwMattersDeduplicate dup : dups){ | |||
NdKqZzsfwMattersDeduplicateDTO dto = BeanUtil.copyProperties(dup,NdKqZzsfwMattersDeduplicateDTO.class); | |||
List<KqZzsfwMattersDeduplicate> dups = deduplicateService.list(); | |||
for(KqZzsfwMattersDeduplicate dup : dups){ | |||
KqZzsfwMattersDeduplicateDTO dto = BeanUtil.copyProperties(dup, KqZzsfwMattersDeduplicateDTO.class); | |||
HttpHeaders headers = new HttpHeaders(); | |||
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8"); | |||
headers.setContentType(type); | |||
@@ -58,9 +58,9 @@ public class SynManage { | |||
} | |||
//2.菜单数据 | |||
List<NdKqZzsfwMenu> menus = menuService.list(); | |||
for(NdKqZzsfwMenu menu : menus){ | |||
NdKqZzsfwMenuDTO dto = BeanUtil.copyProperties(menu,NdKqZzsfwMenuDTO.class); | |||
List<KqZzsfwMenu> menus = menuService.list(); | |||
for(KqZzsfwMenu menu : menus){ | |||
KqZzsfwMenuDTO dto = BeanUtil.copyProperties(menu, KqZzsfwMenuDTO.class); | |||
HttpHeaders headers = new HttpHeaders(); | |||
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8"); | |||
headers.setContentType(type); | |||
@@ -72,9 +72,9 @@ public class SynManage { | |||
} | |||
//3.其它数据 | |||
List<NdKqZzsfwPolicy> policies = policyService.list(); | |||
for(NdKqZzsfwPolicy policy : policies){ | |||
NdKqZzsfwPolicyDTO dto = BeanUtil.copyProperties(policy,NdKqZzsfwPolicyDTO.class); | |||
List<KqZzsfwPolicy> policies = policyService.list(); | |||
for(KqZzsfwPolicy policy : policies){ | |||
KqZzsfwPolicyDTO dto = BeanUtil.copyProperties(policy, KqZzsfwPolicyDTO.class); | |||
HttpHeaders headers = new HttpHeaders(); | |||
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8"); | |||
headers.setContentType(type); | |||
@@ -4,8 +4,8 @@ import cn.hutool.core.date.StopWatch; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.google.common.collect.Lists; | |||
import com.ningdatech.kqapi.common.model.entity.Item; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.NdKqZzsfwMenu; | |||
import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwMenuService; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.KqZzsfwMenu; | |||
import com.ningdatech.kqapi.zzsfw.service.IKqZzsfwMenuService; | |||
import lombok.RequiredArgsConstructor; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.apache.http.conn.ssl.NoopHostnameVerifier; | |||
@@ -51,7 +51,7 @@ public class CheckMattersUrlTask { | |||
public String active; | |||
@Autowired | |||
private INdKqZzsfwMenuService menuService; | |||
private IKqZzsfwMenuService menuService; | |||
/** | |||
* 每天9点 开始校检 链接 是不是可行 | |||
@@ -69,13 +69,13 @@ public class CheckMattersUrlTask { | |||
log.info("==========开始校检事项表里的链接 会不会404 如果404就隐藏"); | |||
List<NdKqZzsfwMenu> menus = menuService.list(Wrappers.lambdaQuery(NdKqZzsfwMenu.class) | |||
.eq(NdKqZzsfwMenu::getHasUrl, 1) | |||
.isNotNull(NdKqZzsfwMenu::getWebapplyurl)); | |||
List<KqZzsfwMenu> menus = menuService.list(Wrappers.lambdaQuery(KqZzsfwMenu.class) | |||
.eq(KqZzsfwMenu::getHasUrl, 1) | |||
.isNotNull(KqZzsfwMenu::getWebapplyurl)); | |||
Integer errNum = 0; | |||
List<String> errUrls = Lists.newArrayList(); | |||
for (NdKqZzsfwMenu menu : menus) { | |||
for (KqZzsfwMenu menu : menus) { | |||
RestTemplate restTemplate = new RestTemplate(generateHttpRequestFactory()); | |||
String url = "https://www.zjzwfw.gov.cn/jpaas-zjservice-server/open-api/item/getItemDetail"; | |||
MultiValueMap<String, String> map = new LinkedMultiValueMap<>(); | |||
@@ -97,10 +97,10 @@ public class CheckMattersUrlTask { | |||
//如果是空的 | |||
if(Objects.isNull(itemData.getItem())){ | |||
//隐藏 | |||
menuService.update(Wrappers.lambdaUpdate(NdKqZzsfwMenu.class) | |||
.eq(NdKqZzsfwMenu::getId,menu.getId()) | |||
.set(NdKqZzsfwMenu::getHasUrl,0) | |||
.set(NdKqZzsfwMenu::getWebapplyurl,null)); | |||
menuService.update(Wrappers.lambdaUpdate(KqZzsfwMenu.class) | |||
.eq(KqZzsfwMenu::getId,menu.getId()) | |||
.set(KqZzsfwMenu::getHasUrl,0) | |||
.set(KqZzsfwMenu::getWebapplyurl,null)); | |||
errNum += 1; | |||
errUrls.add(webapplyurl); | |||
} | |||
@@ -7,16 +7,13 @@ import com.github.benmanes.caffeine.cache.LoadingCache; | |||
import com.ningdatech.kqapi.common.constant.BizConst; | |||
import com.ningdatech.kqapi.common.enumeration.CommonEnum; | |||
import com.ningdatech.kqapi.common.helper.MatterCacheHelper; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.ComponentsMatterEliminateEntity; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.*; | |||
import com.ningdatech.kqapi.zzsfw.service.ComponentsMatterEliminateService; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.DscSxAdsShareItemQltQlsxCommonIDVKq; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.MatterKey; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.NdKqZzsfwMattersDeduplicate; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.NdKqZzsfwMenu; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.KqZzsfwMenu; | |||
import com.ningdatech.kqapi.zzsfw.manage.MatterManage; | |||
import com.ningdatech.kqapi.zzsfw.service.IDscSxAdsShareItemQltQlsxCommonIDVKqService; | |||
import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwMatterDeduplicateService; | |||
import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwMenuService; | |||
import com.ningdatech.kqapi.zzsfw.service.IKqZzsfwMatterDeduplicateService; | |||
import com.ningdatech.kqapi.zzsfw.service.IKqZzsfwMenuService; | |||
import lombok.RequiredArgsConstructor; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.apache.commons.lang3.StringUtils; | |||
@@ -53,10 +50,10 @@ public class SynTask { | |||
private MatterManage matterManage; | |||
@Autowired | |||
private INdKqZzsfwMatterDeduplicateService matterDeduplicateService; | |||
private IKqZzsfwMatterDeduplicateService matterDeduplicateService; | |||
@Autowired | |||
private INdKqZzsfwMenuService menuService; | |||
private IKqZzsfwMenuService menuService; | |||
@Autowired | |||
private IDscSxAdsShareItemQltQlsxCommonIDVKqService kqService; | |||
@@ -64,7 +61,7 @@ public class SynTask { | |||
@Autowired | |||
private ComponentsMatterEliminateService componentsMatterEliminateService; | |||
protected LoadingCache<MatterKey, NdKqZzsfwMattersDeduplicate> mattersDupCache; | |||
protected LoadingCache<MatterKey, KqZzsfwMattersDeduplicate> mattersDupCache; | |||
private final String KQ_ZZS_BASE_URL = "https://www.zjzwfw.gov.cn/zjservice-fe/#/workguide?localInnerCode=&siteCode=330000000000"; | |||
@@ -90,23 +87,23 @@ public class SynTask { | |||
//1.处理 去重数据 | |||
if(matterCacheHelper.refreshAll()){ | |||
matterManage.removeAllDup(); | |||
List<NdKqZzsfwMattersDeduplicate> allDup = matterCacheHelper.all(); | |||
List<KqZzsfwMattersDeduplicate> allDup = matterCacheHelper.all(); | |||
matterDeduplicateService.saveBatch(allDup); | |||
//2. 事项 | |||
List<NdKqZzsfwMenu> menus = menuService.list(); | |||
for(NdKqZzsfwMenu menu : menus){ | |||
List<KqZzsfwMenu> menus = menuService.list(); | |||
for(KqZzsfwMenu menu : menus){ | |||
String url = matterCacheHelper.getUrl(menu.getItemName()); | |||
if(StringUtils.isBlank(url)){ | |||
menuService.update(Wrappers.lambdaUpdate(NdKqZzsfwMenu.class) | |||
.eq(NdKqZzsfwMenu::getId,menu.getId()) | |||
.set(NdKqZzsfwMenu::getWebapplyurl,null) | |||
.set(NdKqZzsfwMenu::getHasUrl, CommonEnum.NO.getCode())); | |||
menuService.update(Wrappers.lambdaUpdate(KqZzsfwMenu.class) | |||
.eq(KqZzsfwMenu::getId,menu.getId()) | |||
.set(KqZzsfwMenu::getWebapplyurl,null) | |||
.set(KqZzsfwMenu::getHasUrl, CommonEnum.NO.getCode())); | |||
}else{ | |||
menuService.update(Wrappers.lambdaUpdate(NdKqZzsfwMenu.class) | |||
.eq(NdKqZzsfwMenu::getId,menu.getId()) | |||
.set(NdKqZzsfwMenu::getWebapplyurl,url) | |||
.set(NdKqZzsfwMenu::getHasUrl,CommonEnum.YES.getCode())); | |||
menuService.update(Wrappers.lambdaUpdate(KqZzsfwMenu.class) | |||
.eq(KqZzsfwMenu::getId,menu.getId()) | |||
.set(KqZzsfwMenu::getWebapplyurl,url) | |||
.set(KqZzsfwMenu::getHasUrl,CommonEnum.YES.getCode())); | |||
} | |||
} | |||
} | |||
@@ -117,20 +114,20 @@ public class SynTask { | |||
public void synMenu() { | |||
//2. 事项 | |||
List<NdKqZzsfwMenu> menus = menuService.list(); | |||
for(NdKqZzsfwMenu menu : menus){ | |||
List<KqZzsfwMenu> menus = menuService.list(); | |||
for(KqZzsfwMenu menu : menus){ | |||
String url = matterCacheHelper.getUrl(menu.getItemName()); | |||
log.info("当前缓存的数据 : {},{}",menu.getItemName(),url); | |||
if(StringUtils.isBlank(url)){ | |||
menuService.update(Wrappers.lambdaUpdate(NdKqZzsfwMenu.class) | |||
.eq(NdKqZzsfwMenu::getId,menu.getId()) | |||
.set(NdKqZzsfwMenu::getWebapplyurl,null) | |||
.set(NdKqZzsfwMenu::getHasUrl, CommonEnum.NO.getCode())); | |||
menuService.update(Wrappers.lambdaUpdate(KqZzsfwMenu.class) | |||
.eq(KqZzsfwMenu::getId,menu.getId()) | |||
.set(KqZzsfwMenu::getWebapplyurl,null) | |||
.set(KqZzsfwMenu::getHasUrl, CommonEnum.NO.getCode())); | |||
}else{ | |||
menuService.update(Wrappers.lambdaUpdate(NdKqZzsfwMenu.class) | |||
.eq(NdKqZzsfwMenu::getId,menu.getId()) | |||
.set(NdKqZzsfwMenu::getWebapplyurl,url) | |||
.set(NdKqZzsfwMenu::getHasUrl,CommonEnum.YES.getCode())); | |||
menuService.update(Wrappers.lambdaUpdate(KqZzsfwMenu.class) | |||
.eq(KqZzsfwMenu::getId,menu.getId()) | |||
.set(KqZzsfwMenu::getWebapplyurl,url) | |||
.set(KqZzsfwMenu::getHasUrl,CommonEnum.YES.getCode())); | |||
} | |||
} | |||
} | |||
@@ -159,12 +156,12 @@ public class SynTask { | |||
componentsMatterEliminateService.saveBatch(entityList); | |||
// 删除menu表 | |||
menuService.remove(new LambdaQueryWrapper<NdKqZzsfwMenu>() | |||
.in(NdKqZzsfwMenu::getItemName, keys)); | |||
menuService.remove(new LambdaQueryWrapper<KqZzsfwMenu>() | |||
.in(KqZzsfwMenu::getItemName, keys)); | |||
// 删除deduplicate表 | |||
matterDeduplicateService.remove(new LambdaQueryWrapper<NdKqZzsfwMattersDeduplicate>() | |||
.in(NdKqZzsfwMattersDeduplicate::getQlName, keys)); | |||
matterDeduplicateService.remove(new LambdaQueryWrapper<KqZzsfwMattersDeduplicate>() | |||
.in(KqZzsfwMattersDeduplicate::getQlName, keys)); | |||
return "剔除成功"; | |||
} | |||
@@ -191,18 +188,18 @@ public class SynTask { | |||
public String synSingle(String key){ | |||
DscSxAdsShareItemQltQlsxCommonIDVKq matter = getSynUrl(key); | |||
String url = KQ_ZZS_BASE_URL.replace("localInnerCode=", "localInnerCode=" + matter.getQlInnerCode()); | |||
List<NdKqZzsfwMenu> menus = menuService.list(Wrappers.lambdaQuery(NdKqZzsfwMenu.class) | |||
.eq(NdKqZzsfwMenu::getItemName, key)); | |||
List<KqZzsfwMenu> menus = menuService.list(Wrappers.lambdaQuery(KqZzsfwMenu.class) | |||
.eq(KqZzsfwMenu::getItemName, key)); | |||
menus.forEach(menu->{ | |||
menuService.update(Wrappers.lambdaUpdate(NdKqZzsfwMenu.class) | |||
.eq(NdKqZzsfwMenu::getId,menu.getId()) | |||
.set(NdKqZzsfwMenu::getWebapplyurl,url) | |||
.set(NdKqZzsfwMenu::getHasUrl,CommonEnum.YES.getCode())); | |||
menuService.update(Wrappers.lambdaUpdate(KqZzsfwMenu.class) | |||
.eq(KqZzsfwMenu::getId,menu.getId()) | |||
.set(KqZzsfwMenu::getWebapplyurl,url) | |||
.set(KqZzsfwMenu::getHasUrl,CommonEnum.YES.getCode())); | |||
}); | |||
// 更新缓存 | |||
MatterKey matterKey = MatterKey.of(matter.getQlName(),url); | |||
mattersDupCache.invalidate(matterKey); | |||
mattersDupCache.put(matterKey,NdKqZzsfwMattersDeduplicate.of(matter.getQlName(),url)); | |||
mattersDupCache.put(matterKey, KqZzsfwMattersDeduplicate.of(matter.getQlName(),url)); | |||
return "更新成功,rul:" + url; | |||
} | |||
} |
@@ -1,8 +1,8 @@ | |||
package com.ningdatech.kqapi.zzsfw.controller; | |||
import com.ningdatech.kqapi.common.exception.BizException; | |||
import com.ningdatech.kqapi.zzsfw.model.dto.NdKqZzsfwMattersDeduplicateDTO; | |||
import com.ningdatech.kqapi.zzsfw.model.dto.NdKqZzsfwMenuDTO; | |||
import com.ningdatech.kqapi.zzsfw.model.dto.KqZzsfwMattersDeduplicateDTO; | |||
import com.ningdatech.kqapi.zzsfw.model.dto.KqZzsfwMenuDTO; | |||
import com.ningdatech.kqapi.zzsfw.model.vo.MatterTopVO; | |||
import com.ningdatech.kqapi.zzsfw.model.vo.MattersVO; | |||
import com.ningdatech.kqapi.zzsfw.model.vo.TreeVO; | |||
@@ -30,7 +30,7 @@ import java.util.Objects; | |||
@RestController | |||
@RequestMapping("/api/v1/zzsfw/") | |||
@RequiredArgsConstructor | |||
public class NdKqZzsfwMenuController { | |||
public class KqZzsfwMenuController { | |||
private final MatterManage matterManage; | |||
@GetMapping("/matters") | |||
@@ -73,7 +73,7 @@ public class NdKqZzsfwMenuController { | |||
} | |||
@PostMapping("/save") | |||
public String save(@RequestBody NdKqZzsfwMenuDTO dto) { | |||
public String save(@RequestBody KqZzsfwMenuDTO dto) { | |||
return matterManage.save(dto); | |||
} | |||
@@ -83,7 +83,7 @@ public class NdKqZzsfwMenuController { | |||
} | |||
@PostMapping("/save-dup") | |||
public String saveDup(@RequestBody NdKqZzsfwMattersDeduplicateDTO dto) { | |||
public String saveDup(@RequestBody KqZzsfwMattersDeduplicateDTO dto) { | |||
return matterManage.saveDup(dto); | |||
} | |||
@@ -94,7 +94,7 @@ public class NdKqZzsfwMenuController { | |||
@PostMapping("/ddl") | |||
public String ddl(@RequestParam("sql") String sql) throws IOException { | |||
public String ddl(@RequestParam("sql") String sql) { | |||
return matterManage.ddl(sql); | |||
} | |||
@@ -1,8 +1,8 @@ | |||
package com.ningdatech.kqapi.zzsfw.controller; | |||
import com.ningdatech.kqapi.common.model.PageVo; | |||
import com.ningdatech.kqapi.zzsfw.model.dto.NdKqZzsfwPolicyDTO; | |||
import com.ningdatech.kqapi.zzsfw.model.vo.NdKqZzsfwPolicyVO; | |||
import com.ningdatech.kqapi.zzsfw.model.dto.KqZzsfwPolicyDTO; | |||
import com.ningdatech.kqapi.zzsfw.model.vo.ZzsfwPolicyVO; | |||
import com.ningdatech.kqapi.zzsfw.manage.PolicyManage; | |||
import lombok.RequiredArgsConstructor; | |||
import lombok.extern.slf4j.Slf4j; | |||
@@ -26,17 +26,17 @@ public class PolicyRegulationsController { | |||
private final PolicyManage policyManage; | |||
@GetMapping("/list") | |||
public PageVo<NdKqZzsfwPolicyVO> list(@RequestParam(defaultValue = "1") long pageNumber, @RequestParam(defaultValue = "10") long pageSize) { | |||
public PageVo<ZzsfwPolicyVO> list(@RequestParam(defaultValue = "1") long pageNumber, @RequestParam(defaultValue = "10") long pageSize) { | |||
return policyManage.list(pageNumber,pageSize); | |||
} | |||
@PostMapping("/save") | |||
public String save(@RequestBody NdKqZzsfwPolicyDTO dto) { | |||
public String save(@RequestBody KqZzsfwPolicyDTO dto) { | |||
return policyManage.save(dto); | |||
} | |||
@PostMapping("/save-batch") | |||
public String saveBatch(@RequestBody List<NdKqZzsfwPolicyDTO> dtos) { | |||
public String saveBatch(@RequestBody List<KqZzsfwPolicyDTO> dtos) { | |||
return policyManage.saveBatch(dtos); | |||
} | |||
@@ -5,16 +5,16 @@ import cn.hutool.core.collection.CollUtil; | |||
import cn.hutool.core.lang.Assert; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.ningdatech.kqapi.zzsfw.constants.ZzsfwMenuConstant; | |||
import com.ningdatech.kqapi.zzsfw.model.dto.NdKqZzsfwMattersDeduplicateDTO; | |||
import com.ningdatech.kqapi.zzsfw.model.dto.NdKqZzsfwMenuDTO; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.NdKqZzsfwMattersDeduplicate; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.NdKqZzsfwMenu; | |||
import com.ningdatech.kqapi.zzsfw.model.dto.KqZzsfwMattersDeduplicateDTO; | |||
import com.ningdatech.kqapi.zzsfw.model.dto.KqZzsfwMenuDTO; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.KqZzsfwMenu; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.KqZzsfwMattersDeduplicate; | |||
import com.ningdatech.kqapi.zzsfw.model.vo.MatterTopVO; | |||
import com.ningdatech.kqapi.zzsfw.model.vo.MattersVO; | |||
import com.ningdatech.kqapi.zzsfw.model.vo.TreeVO; | |||
import com.ningdatech.kqapi.zzsfw.enumeration.ItemTypeEnum; | |||
import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwMatterDeduplicateService; | |||
import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwMenuService; | |||
import com.ningdatech.kqapi.zzsfw.service.IKqZzsfwMatterDeduplicateService; | |||
import com.ningdatech.kqapi.zzsfw.service.IKqZzsfwMenuService; | |||
import lombok.RequiredArgsConstructor; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.apache.commons.lang3.StringUtils; | |||
@@ -57,19 +57,19 @@ public class MatterManage { | |||
@Value("${spring.datasource.password}") | |||
public String password; | |||
private final INdKqZzsfwMenuService menuService; | |||
private final IKqZzsfwMenuService menuService; | |||
private final INdKqZzsfwMatterDeduplicateService matterDeduplicateService; | |||
private final IKqZzsfwMatterDeduplicateService matterDeduplicateService; | |||
public List<TreeVO> getMatters() { | |||
List<NdKqZzsfwMenu> matters = menuService.list(Wrappers.lambdaQuery(NdKqZzsfwMenu.class) | |||
.orderByAsc(NdKqZzsfwMenu::getSort)); | |||
List<KqZzsfwMenu> matters = menuService.list(Wrappers.lambdaQuery(KqZzsfwMenu.class) | |||
.orderByAsc(KqZzsfwMenu::getSort)); | |||
if(CollUtil.isEmpty(matters)){ | |||
return Collections.emptyList(); | |||
} | |||
//如果是政府类型的 就隐藏 没有链接的 | |||
List<NdKqZzsfwMenu> finalMatters = matters.stream().filter(m -> Objects.nonNull(m.getType()) && | |||
List<KqZzsfwMenu> finalMatters = matters.stream().filter(m -> Objects.nonNull(m.getType()) && | |||
(!m.getType().equals(ItemTypeEnum.GOV.getCode()) || Objects.nonNull(m.getWebapplyurl()))) | |||
.collect(Collectors.toList()); | |||
Set<String> zoneSet = new HashSet<>(); | |||
@@ -88,14 +88,14 @@ public class MatterManage { | |||
* @return | |||
*/ | |||
public List<TreeVO> getZones() { | |||
List<NdKqZzsfwMenu> matters = menuService.list(Wrappers.lambdaQuery(NdKqZzsfwMenu.class) | |||
.orderByAsc(NdKqZzsfwMenu::getSort)); | |||
List<KqZzsfwMenu> matters = menuService.list(Wrappers.lambdaQuery(KqZzsfwMenu.class) | |||
.orderByAsc(KqZzsfwMenu::getSort)); | |||
if(CollUtil.isEmpty(matters)){ | |||
return Collections.emptyList(); | |||
} | |||
//如果是政府类型的 就隐藏 没有链接的 | |||
List<NdKqZzsfwMenu> finalMatters = matters.stream().filter(m -> Objects.nonNull(m.getType()) && | |||
List<KqZzsfwMenu> finalMatters = matters.stream().filter(m -> Objects.nonNull(m.getType()) && | |||
(!m.getType().equals(ItemTypeEnum.GOV.getCode()) || Objects.nonNull(m.getWebapplyurl()))) | |||
.collect(Collectors.toList()); | |||
Set<String> zoneSet = new HashSet<>(); | |||
@@ -108,15 +108,15 @@ public class MatterManage { | |||
} | |||
public List<TreeVO> getWindows(String zoneName) { | |||
List<NdKqZzsfwMenu> matters = menuService.list(Wrappers.lambdaQuery(NdKqZzsfwMenu.class) | |||
.eq(StringUtils.isNotBlank(zoneName),NdKqZzsfwMenu::getZoneName,zoneName) | |||
.orderByAsc(NdKqZzsfwMenu::getSort)); | |||
List<KqZzsfwMenu> matters = menuService.list(Wrappers.lambdaQuery(KqZzsfwMenu.class) | |||
.eq(StringUtils.isNotBlank(zoneName), KqZzsfwMenu::getZoneName,zoneName) | |||
.orderByAsc(KqZzsfwMenu::getSort)); | |||
if(CollUtil.isEmpty(matters)){ | |||
return Collections.emptyList(); | |||
} | |||
//如果是政府类型的 就隐藏 没有链接的 | |||
List<NdKqZzsfwMenu> finalMatters = matters.stream().filter(m -> Objects.nonNull(m.getType()) && | |||
List<KqZzsfwMenu> finalMatters = matters.stream().filter(m -> Objects.nonNull(m.getType()) && | |||
(!m.getType().equals(ItemTypeEnum.GOV.getCode()) || Objects.nonNull(m.getWebapplyurl()))) | |||
.collect(Collectors.toList()); | |||
@@ -131,15 +131,15 @@ public class MatterManage { | |||
} | |||
public List<TreeVO> getDepartments(String zoneName,String windowName) { | |||
List<NdKqZzsfwMenu> matters = menuService.list(Wrappers.lambdaQuery(NdKqZzsfwMenu.class) | |||
.eq(StringUtils.isNotBlank(windowName),NdKqZzsfwMenu::getWindow,windowName) | |||
.eq(StringUtils.isNotBlank(zoneName),NdKqZzsfwMenu::getZoneName,zoneName) | |||
.orderByAsc(NdKqZzsfwMenu::getSort)); | |||
List<KqZzsfwMenu> matters = menuService.list(Wrappers.lambdaQuery(KqZzsfwMenu.class) | |||
.eq(StringUtils.isNotBlank(windowName), KqZzsfwMenu::getWindow,windowName) | |||
.eq(StringUtils.isNotBlank(zoneName), KqZzsfwMenu::getZoneName,zoneName) | |||
.orderByAsc(KqZzsfwMenu::getSort)); | |||
if(CollUtil.isEmpty(matters)){ | |||
return Collections.emptyList(); | |||
} | |||
List<NdKqZzsfwMenu> finalMatters = matters.stream().filter(m -> Objects.nonNull(m.getType()) && | |||
List<KqZzsfwMenu> finalMatters = matters.stream().filter(m -> Objects.nonNull(m.getType()) && | |||
(!m.getType().equals(ItemTypeEnum.GOV.getCode()) || Objects.nonNull(m.getWebapplyurl()))) | |||
.collect(Collectors.toList()); | |||
@@ -154,18 +154,18 @@ public class MatterManage { | |||
} | |||
public List<MattersVO> matterList(String zoneName, String windowName, String department, Integer type) { | |||
List<NdKqZzsfwMenu> matters = menuService.list(Wrappers.lambdaQuery(NdKqZzsfwMenu.class) | |||
.eq(StringUtils.isNotBlank(windowName),NdKqZzsfwMenu::getWindow,windowName) | |||
.eq(StringUtils.isNotBlank(zoneName),NdKqZzsfwMenu::getZoneName,zoneName) | |||
.eq(StringUtils.isNotBlank(department),NdKqZzsfwMenu::getDepartment,department) | |||
.eq(Objects.nonNull(type),NdKqZzsfwMenu::getType,type) | |||
.orderByAsc(NdKqZzsfwMenu::getSort)); | |||
List<KqZzsfwMenu> matters = menuService.list(Wrappers.lambdaQuery(KqZzsfwMenu.class) | |||
.eq(StringUtils.isNotBlank(windowName), KqZzsfwMenu::getWindow,windowName) | |||
.eq(StringUtils.isNotBlank(zoneName), KqZzsfwMenu::getZoneName,zoneName) | |||
.eq(StringUtils.isNotBlank(department), KqZzsfwMenu::getDepartment,department) | |||
.eq(Objects.nonNull(type), KqZzsfwMenu::getType,type) | |||
.orderByAsc(KqZzsfwMenu::getSort)); | |||
if(CollUtil.isEmpty(matters)){ | |||
return Collections.emptyList(); | |||
} | |||
//如果是政府类型的 就隐藏 没有链接的 | |||
List<NdKqZzsfwMenu> finalMatters = matters.stream().filter(m -> Objects.nonNull(m.getType()) && | |||
List<KqZzsfwMenu> finalMatters = matters.stream().filter(m -> Objects.nonNull(m.getType()) && | |||
(!m.getType().equals(ItemTypeEnum.GOV.getCode()) || Objects.nonNull(m.getWebapplyurl()))) | |||
.collect(Collectors.toList()); | |||
@@ -180,7 +180,7 @@ public class MatterManage { | |||
} | |||
public MattersVO matter(Long id) { | |||
NdKqZzsfwMenu matter = menuService.getById(id); | |||
KqZzsfwMenu matter = menuService.getById(id); | |||
if(Objects.isNull(matter)){ | |||
return null; | |||
} | |||
@@ -190,7 +190,7 @@ public class MatterManage { | |||
return mattersVO; | |||
} | |||
private List<TreeVO> generateWindows(NdKqZzsfwMenu menu, List<NdKqZzsfwMenu> matters) { | |||
private List<TreeVO> generateWindows(KqZzsfwMenu menu, List<KqZzsfwMenu> matters) { | |||
Set<String> windowSet = new HashSet<>(); | |||
return matters.stream().filter(m -> StringUtils.isNotBlank(m.getZoneName()) && m.getZoneName().equals(menu.getZoneName()) | |||
&& windowSet.add(m.getWindow())) | |||
@@ -203,7 +203,7 @@ public class MatterManage { | |||
}).collect(Collectors.toList()); | |||
} | |||
private List<TreeVO> generateDepartment(NdKqZzsfwMenu menu, List<NdKqZzsfwMenu> matters) { | |||
private List<TreeVO> generateDepartment(KqZzsfwMenu menu, List<KqZzsfwMenu> matters) { | |||
Set<String> departmentSet = new HashSet<>(); | |||
return matters.stream().filter( m -> StringUtils.isNotBlank(m.getWindow()) && m.getWindow().equals(menu.getWindow()) && | |||
m.getZoneName().equals(menu.getZoneName()) && departmentSet.add(m.getDepartment())) | |||
@@ -216,7 +216,7 @@ public class MatterManage { | |||
}).collect(Collectors.toList()); | |||
} | |||
private List<TreeVO> generateItemType(NdKqZzsfwMenu menu, List<NdKqZzsfwMenu> matters) { | |||
private List<TreeVO> generateItemType(KqZzsfwMenu menu, List<KqZzsfwMenu> matters) { | |||
Set<Integer> typeSet = new HashSet<>(); | |||
return matters.stream().filter(m -> StringUtils.isNotBlank(m.getWindow()) && m.getWindow().equals(menu.getWindow()) && | |||
m.getZoneName().equals(menu.getZoneName()) && Objects.nonNull(m.getType()) && typeSet.add(m.getType())) | |||
@@ -235,7 +235,7 @@ public class MatterManage { | |||
.collect(Collectors.toList()); | |||
} | |||
private List<TreeVO> generateMatters(NdKqZzsfwMenu menu, List<NdKqZzsfwMenu> matters) { | |||
private List<TreeVO> generateMatters(KqZzsfwMenu menu, List<KqZzsfwMenu> matters) { | |||
return matters.stream().filter(m -> Objects.nonNull(m.getType()) && m.getType().equals(menu.getType()) && | |||
(!m.getType().equals(ItemTypeEnum.GOV.getCode()) || Objects.nonNull(m.getHasUrl()) && m.getHasUrl() == 1) && | |||
StringUtils.isNotBlank(m.getDepartment()) && | |||
@@ -256,8 +256,8 @@ public class MatterManage { | |||
} | |||
public List<MatterTopVO> topTen() { | |||
List<NdKqZzsfwMattersDeduplicate> topTen = matterDeduplicateService.list(Wrappers.lambdaQuery(NdKqZzsfwMattersDeduplicate.class) | |||
.orderByDesc(NdKqZzsfwMattersDeduplicate::getCountNum) | |||
List<KqZzsfwMattersDeduplicate> topTen = matterDeduplicateService.list(Wrappers.lambdaQuery(KqZzsfwMattersDeduplicate.class) | |||
.orderByDesc(KqZzsfwMattersDeduplicate::getCountNum) | |||
.last("limit 10")); | |||
return topTen.stream().map(m -> { | |||
MatterTopVO vo = new MatterTopVO(); | |||
@@ -268,12 +268,12 @@ public class MatterManage { | |||
}).collect(Collectors.toList()); | |||
} | |||
public String save(NdKqZzsfwMenuDTO dto) { | |||
public String save(KqZzsfwMenuDTO dto) { | |||
if(Objects.isNull(dto)){ | |||
return "保存失败 传入为空"; | |||
} | |||
NdKqZzsfwMenu entity = BeanUtil.copyProperties(dto,NdKqZzsfwMenu.class); | |||
KqZzsfwMenu entity = BeanUtil.copyProperties(dto, KqZzsfwMenu.class); | |||
if(menuService.save(entity)){ | |||
return "保存成功 :" + entity; | |||
}else{ | |||
@@ -281,12 +281,12 @@ public class MatterManage { | |||
} | |||
} | |||
public String saveDup(NdKqZzsfwMattersDeduplicateDTO dto) { | |||
public String saveDup(KqZzsfwMattersDeduplicateDTO dto) { | |||
if(Objects.isNull(dto)){ | |||
return "保存失败 传入为空"; | |||
} | |||
NdKqZzsfwMattersDeduplicate entity = BeanUtil.copyProperties(dto,NdKqZzsfwMattersDeduplicate.class); | |||
KqZzsfwMattersDeduplicate entity = BeanUtil.copyProperties(dto, KqZzsfwMattersDeduplicate.class); | |||
if(matterDeduplicateService.save(entity)){ | |||
return "保存成功 :" + entity; | |||
}else{ | |||
@@ -295,12 +295,12 @@ public class MatterManage { | |||
} | |||
public String removeAll() { | |||
menuService.remove(Wrappers.lambdaQuery(NdKqZzsfwMenu.class)); | |||
menuService.remove(Wrappers.lambdaQuery(KqZzsfwMenu.class)); | |||
return "删除成功"; | |||
} | |||
public String removeAllDup() { | |||
matterDeduplicateService.remove(Wrappers.lambdaQuery(NdKqZzsfwMattersDeduplicate.class)); | |||
matterDeduplicateService.remove(Wrappers.lambdaQuery(KqZzsfwMattersDeduplicate.class)); | |||
return "删除成功"; | |||
} | |||
@@ -346,7 +346,7 @@ public class MatterManage { | |||
telephone = decimalFormat2.format(row.getCell(7).getNumericCellValue()); | |||
System.out.println(telephone); | |||
} | |||
NdKqZzsfwMenu menu = new NdKqZzsfwMenu(); | |||
KqZzsfwMenu menu = new KqZzsfwMenu(); | |||
menu.setItemName(itemName); | |||
menu.setZoneName(zoneName); | |||
menu.setWindow(windowName); | |||
@@ -393,8 +393,8 @@ public class MatterManage { | |||
*/ | |||
public String update4_10() { | |||
//1.窗口后缀不是服务的 都加个服务 | |||
List<NdKqZzsfwMenu> list = menuService.list(); | |||
for (NdKqZzsfwMenu menu : list) { | |||
List<KqZzsfwMenu> list = menuService.list(); | |||
for (KqZzsfwMenu menu : list) { | |||
if(StringUtils.isNotBlank(menu.getWindow()) && !menu.getWindow().endsWith("服务")){ | |||
menu.setWindow(menu.getWindow() + "服务"); | |||
menuService.updateById(menu); | |||
@@ -5,10 +5,10 @@ import cn.hutool.core.collection.CollUtil; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
import com.ningdatech.kqapi.common.model.PageVo; | |||
import com.ningdatech.kqapi.zzsfw.model.dto.NdKqZzsfwPolicyDTO; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.NdKqZzsfwPolicy; | |||
import com.ningdatech.kqapi.zzsfw.model.vo.NdKqZzsfwPolicyVO; | |||
import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwPolicyService; | |||
import com.ningdatech.kqapi.zzsfw.model.dto.KqZzsfwPolicyDTO; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.KqZzsfwPolicy; | |||
import com.ningdatech.kqapi.zzsfw.model.vo.ZzsfwPolicyVO; | |||
import com.ningdatech.kqapi.zzsfw.service.IKqZzsfwPolicyService; | |||
import lombok.RequiredArgsConstructor; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.springframework.stereotype.Component; | |||
@@ -28,29 +28,29 @@ import java.util.stream.Collectors; | |||
@RequiredArgsConstructor | |||
public class PolicyManage { | |||
private final INdKqZzsfwPolicyService policyService; | |||
private final IKqZzsfwPolicyService policyService; | |||
public PageVo<NdKqZzsfwPolicyVO> list(long pageNumber, long pageSize) { | |||
Page<NdKqZzsfwPolicy> page = Page.of(pageNumber,pageSize); | |||
Page<NdKqZzsfwPolicy> pageRes = policyService.page(page, Wrappers.lambdaQuery(NdKqZzsfwPolicy.class) | |||
.orderByAsc(NdKqZzsfwPolicy::getSort)); | |||
public PageVo<ZzsfwPolicyVO> list(long pageNumber, long pageSize) { | |||
Page<KqZzsfwPolicy> page = Page.of(pageNumber,pageSize); | |||
Page<KqZzsfwPolicy> pageRes = policyService.page(page, Wrappers.lambdaQuery(KqZzsfwPolicy.class) | |||
.orderByAsc(KqZzsfwPolicy::getSort)); | |||
if(CollUtil.isEmpty(pageRes.getRecords())){ | |||
return PageVo.empty(); | |||
} | |||
List<NdKqZzsfwPolicyVO> res = pageRes.getRecords().stream() | |||
.map(p -> BeanUtil.copyProperties(p,NdKqZzsfwPolicyVO.class)) | |||
List<ZzsfwPolicyVO> res = pageRes.getRecords().stream() | |||
.map(p -> BeanUtil.copyProperties(p, ZzsfwPolicyVO.class)) | |||
.collect(Collectors.toList()); | |||
return PageVo.of(res,pageRes.getTotal()); | |||
} | |||
public String save(NdKqZzsfwPolicyDTO dto) { | |||
public String save(KqZzsfwPolicyDTO dto) { | |||
if(Objects.isNull(dto)){ | |||
return "保存失败 传入为空"; | |||
} | |||
NdKqZzsfwPolicy entity = BeanUtil.copyProperties(dto,NdKqZzsfwPolicy.class); | |||
KqZzsfwPolicy entity = BeanUtil.copyProperties(dto, KqZzsfwPolicy.class); | |||
if(policyService.save(entity)){ | |||
return "保存成功 :" + entity; | |||
}else{ | |||
@@ -59,7 +59,7 @@ public class PolicyManage { | |||
} | |||
public String removeAll() { | |||
policyService.remove(Wrappers.lambdaQuery(NdKqZzsfwPolicy.class)); | |||
policyService.remove(Wrappers.lambdaQuery(KqZzsfwPolicy.class)); | |||
return "删除成功"; | |||
} | |||
@@ -68,12 +68,12 @@ public class PolicyManage { | |||
* @param dtos | |||
* @return | |||
*/ | |||
public String saveBatch(List<NdKqZzsfwPolicyDTO> dtos) { | |||
public String saveBatch(List<KqZzsfwPolicyDTO> dtos) { | |||
if(CollUtil.isEmpty(dtos)){ | |||
return "保存失败 传入为空"; | |||
} | |||
List<NdKqZzsfwPolicy> entitys = dtos.stream().map(d -> BeanUtil.copyProperties(d,NdKqZzsfwPolicy.class)) | |||
List<KqZzsfwPolicy> entitys = dtos.stream().map(d -> BeanUtil.copyProperties(d, KqZzsfwPolicy.class)) | |||
.collect(Collectors.toList()); | |||
if(policyService.saveBatch(entitys)){ | |||
return "保存成功"; | |||
@@ -1,7 +1,7 @@ | |||
package com.ningdatech.kqapi.zzsfw.mapper; | |||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.NdKqZzsfwMattersDeduplicate; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.KqZzsfwMattersDeduplicate; | |||
/** | |||
* <p> | |||
@@ -11,6 +11,6 @@ import com.ningdatech.kqapi.zzsfw.model.entity.NdKqZzsfwMattersDeduplicate; | |||
* @author ZPF | |||
* @since 2023-10-27 | |||
*/ | |||
public interface NdKqZzsfwMatterDeduplicateMapper extends BaseMapper<NdKqZzsfwMattersDeduplicate> { | |||
public interface KqZzsfwMatterDeduplicateMapper extends BaseMapper<KqZzsfwMattersDeduplicate> { | |||
} |
@@ -1,7 +1,7 @@ | |||
package com.ningdatech.kqapi.zzsfw.mapper; | |||
import com.ningdatech.kqapi.admin.model.dto.MatterCountByWindowIdDTO; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.NdKqZzsfwMenu; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.KqZzsfwMenu; | |||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
import org.apache.ibatis.annotations.Param; | |||
@@ -16,7 +16,7 @@ import java.util.List; | |||
* @author ZPF | |||
* @since 2023-10-27 | |||
*/ | |||
public interface NdKqZzsfwMenuMapper extends BaseMapper<NdKqZzsfwMenu> { | |||
public interface KqZzsfwMenuMapper extends BaseMapper<KqZzsfwMenu> { | |||
List<MatterCountByWindowIdDTO> selectMatterCountByWindowIds(@Param("windowIds") Collection<Integer> windowIds); | |||
@@ -1,6 +1,6 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
<mapper namespace="com.ningdatech.kqapi.zzsfw.mapper.NdKqZzsfwMenuMapper"> | |||
<mapper namespace="com.ningdatech.kqapi.zzsfw.mapper.KqZzsfwMenuMapper"> | |||
<select id="selectMatterCountByWindowIds" | |||
resultType="com.ningdatech.kqapi.admin.model.dto.MatterCountByWindowIdDTO"> |
@@ -1,7 +1,7 @@ | |||
package com.ningdatech.kqapi.zzsfw.mapper; | |||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.NdKqZzsfwPolicy; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.KqZzsfwPolicy; | |||
/** | |||
* <p> | |||
@@ -11,6 +11,6 @@ import com.ningdatech.kqapi.zzsfw.model.entity.NdKqZzsfwPolicy; | |||
* @author ZPF | |||
* @since 2023-10-27 | |||
*/ | |||
public interface NdKqZzsfwPolicyMapper extends BaseMapper<NdKqZzsfwPolicy> { | |||
public interface KqZzsfwPolicyMapper extends BaseMapper<KqZzsfwPolicy> { | |||
} |
@@ -16,8 +16,8 @@ import java.time.LocalDateTime; | |||
* @since 2023-10-27 | |||
*/ | |||
@Data | |||
@ApiModel(value = "NdKqZzsfwMattersDeduplicate", description = "") | |||
public class NdKqZzsfwMattersDeduplicateDTO implements Serializable { | |||
@ApiModel(value = "NdKqZzsfwMattersDeduplicate") | |||
public class KqZzsfwMattersDeduplicateDTO implements Serializable { | |||
private static final long serialVersionUID = 1L; | |||
@@ -16,8 +16,8 @@ import java.time.LocalDateTime; | |||
* @since 2023-10-27 | |||
*/ | |||
@Data | |||
@ApiModel(value = "NdKqZzsfwMenu对象", description = "") | |||
public class NdKqZzsfwMenuDTO implements Serializable { | |||
@ApiModel(value = "NdKqZzsfwMenu对象") | |||
public class KqZzsfwMenuDTO implements Serializable { | |||
private static final long serialVersionUID = 1L; | |||
@@ -17,7 +17,7 @@ import java.time.LocalDateTime; | |||
*/ | |||
@Data | |||
@ApiModel(value = "NdKqZzsfwPolicyDTO", description = "") | |||
public class NdKqZzsfwPolicyDTO implements Serializable { | |||
public class KqZzsfwPolicyDTO implements Serializable { | |||
private static final long serialVersionUID = 1L; | |||
@@ -20,8 +20,8 @@ import java.time.LocalDateTime; | |||
*/ | |||
@Data | |||
@TableName("nd_kq_zzsfw_matters_deduplicate") | |||
@ApiModel(value = "NdKqZzsfwMattersDeduplicate", description = "") | |||
public class NdKqZzsfwMattersDeduplicate implements Serializable { | |||
@ApiModel(value = "NdKqZzsfwMattersDeduplicate") | |||
public class KqZzsfwMattersDeduplicate implements Serializable { | |||
private static final long serialVersionUID = 1L; | |||
@@ -41,8 +41,8 @@ public class NdKqZzsfwMattersDeduplicate implements Serializable { | |||
@ApiModelProperty("重复数") | |||
private Integer countNum = 0; | |||
public static NdKqZzsfwMattersDeduplicate of(String qlName, String webapplyurl) { | |||
NdKqZzsfwMattersDeduplicate dup = new NdKqZzsfwMattersDeduplicate(); | |||
public static KqZzsfwMattersDeduplicate of(String qlName, String webapplyurl) { | |||
KqZzsfwMattersDeduplicate dup = new KqZzsfwMattersDeduplicate(); | |||
dup.setQlName(qlName); | |||
dup.setWebapplyurl(webapplyurl); | |||
dup.setCountNum(1); |
@@ -19,7 +19,7 @@ import java.time.LocalDateTime; | |||
@Data | |||
@TableName("nd_kq_zzsfw_menu") | |||
@ApiModel(value = "NdKqZzsfwMenu对象") | |||
public class NdKqZzsfwMenu implements Serializable { | |||
public class KqZzsfwMenu implements Serializable { | |||
private static final long serialVersionUID = 1L; | |||
@@ -21,7 +21,7 @@ import java.time.LocalDateTime; | |||
@Data | |||
@TableName("nd_kq_zzsfw_policy") | |||
@ApiModel(value = "NdKqZzsfwPolicy对象", description = "") | |||
public class NdKqZzsfwPolicy implements Serializable { | |||
public class KqZzsfwPolicy implements Serializable { | |||
private static final long serialVersionUID = 1L; | |||
@@ -16,8 +16,8 @@ import java.time.LocalDateTime; | |||
* @since 2023-11-02 | |||
*/ | |||
@Data | |||
@ApiModel(value = "NdKqZzsfwPolicy VO", description = "") | |||
public class NdKqZzsfwPolicyVO implements Serializable { | |||
@ApiModel(value = "NdKqZzsfwPolicy VO") | |||
public class ZzsfwPolicyVO implements Serializable { | |||
private static final long serialVersionUID = 1L; | |||
@@ -1,7 +1,7 @@ | |||
package com.ningdatech.kqapi.zzsfw.service; | |||
import com.baomidou.mybatisplus.extension.service.IService; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.NdKqZzsfwMattersDeduplicate; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.KqZzsfwMattersDeduplicate; | |||
/** | |||
* <p> | |||
@@ -11,6 +11,6 @@ import com.ningdatech.kqapi.zzsfw.model.entity.NdKqZzsfwMattersDeduplicate; | |||
* @author ZPF | |||
* @since 2023-10-27 | |||
*/ | |||
public interface INdKqZzsfwMatterDeduplicateService extends IService<NdKqZzsfwMattersDeduplicate> { | |||
public interface IKqZzsfwMatterDeduplicateService extends IService<KqZzsfwMattersDeduplicate> { | |||
} |
@@ -1,7 +1,7 @@ | |||
package com.ningdatech.kqapi.zzsfw.service; | |||
import com.baomidou.mybatisplus.extension.service.IService; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.NdKqZzsfwMenu; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.KqZzsfwMenu; | |||
import java.util.Collection; | |||
import java.util.Map; | |||
@@ -14,7 +14,7 @@ import java.util.Map; | |||
* @author ZPF | |||
* @since 2023-10-27 | |||
*/ | |||
public interface INdKqZzsfwMenuService extends IService<NdKqZzsfwMenu> { | |||
public interface IKqZzsfwMenuService extends IService<KqZzsfwMenu> { | |||
Map<Integer, Integer> matterCountByWindowIds(Collection<Integer> windowIds); | |||
@@ -1,7 +1,7 @@ | |||
package com.ningdatech.kqapi.zzsfw.service; | |||
import com.baomidou.mybatisplus.extension.service.IService; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.NdKqZzsfwPolicy; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.KqZzsfwPolicy; | |||
/** | |||
* <p> | |||
@@ -11,6 +11,6 @@ import com.ningdatech.kqapi.zzsfw.model.entity.NdKqZzsfwPolicy; | |||
* @author ZPF | |||
* @since 2023-10-27 | |||
*/ | |||
public interface INdKqZzsfwPolicyService extends IService<NdKqZzsfwPolicy> { | |||
public interface IKqZzsfwPolicyService extends IService<KqZzsfwPolicy> { | |||
} |
@@ -0,0 +1,21 @@ | |||
package com.ningdatech.kqapi.zzsfw.service.impl; | |||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.KqZzsfwMattersDeduplicate; | |||
import com.ningdatech.kqapi.zzsfw.mapper.KqZzsfwMatterDeduplicateMapper; | |||
import com.ningdatech.kqapi.zzsfw.service.IKqZzsfwMatterDeduplicateService; | |||
import org.springframework.stereotype.Service; | |||
/** | |||
* <p> | |||
* 服务实现类 | |||
* </p> | |||
* | |||
* @author ZPF | |||
* @since 2023-10-27 | |||
*/ | |||
@Service | |||
public class KqZzsfwMatterDeduplicateServiceImpl extends ServiceImpl<KqZzsfwMatterDeduplicateMapper, KqZzsfwMattersDeduplicate> | |||
implements IKqZzsfwMatterDeduplicateService { | |||
} |
@@ -3,9 +3,9 @@ package com.ningdatech.kqapi.zzsfw.service.impl; | |||
import cn.hutool.core.collection.CollUtil; | |||
import com.ningdatech.basic.util.CollUtils; | |||
import com.ningdatech.kqapi.admin.model.dto.MatterCountByWindowIdDTO; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.NdKqZzsfwMenu; | |||
import com.ningdatech.kqapi.zzsfw.mapper.NdKqZzsfwMenuMapper; | |||
import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwMenuService; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.KqZzsfwMenu; | |||
import com.ningdatech.kqapi.zzsfw.mapper.KqZzsfwMenuMapper; | |||
import com.ningdatech.kqapi.zzsfw.service.IKqZzsfwMenuService; | |||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
import org.springframework.stereotype.Service; | |||
@@ -23,7 +23,7 @@ import java.util.Map; | |||
* @since 2023-10-27 | |||
*/ | |||
@Service | |||
public class NdKqZzsfwMenuServiceImpl extends ServiceImpl<NdKqZzsfwMenuMapper, NdKqZzsfwMenu> implements INdKqZzsfwMenuService { | |||
public class KqZzsfwMenuServiceImpl extends ServiceImpl<KqZzsfwMenuMapper, KqZzsfwMenu> implements IKqZzsfwMenuService { | |||
@Override | |||
public Map<Integer, Integer> matterCountByWindowIds(Collection<Integer> windowIds) { |
@@ -0,0 +1,21 @@ | |||
package com.ningdatech.kqapi.zzsfw.service.impl; | |||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.KqZzsfwPolicy; | |||
import com.ningdatech.kqapi.zzsfw.mapper.KqZzsfwPolicyMapper; | |||
import com.ningdatech.kqapi.zzsfw.service.IKqZzsfwPolicyService; | |||
import org.springframework.stereotype.Service; | |||
/** | |||
* <p> | |||
* 服务实现类 | |||
* </p> | |||
* | |||
* @author ZPF | |||
* @since 2023-10-27 | |||
*/ | |||
@Service | |||
public class KqZzsfwPolicyServiceImpl extends ServiceImpl<KqZzsfwPolicyMapper, KqZzsfwPolicy> | |||
implements IKqZzsfwPolicyService { | |||
} |
@@ -1,21 +0,0 @@ | |||
package com.ningdatech.kqapi.zzsfw.service.impl; | |||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.NdKqZzsfwMattersDeduplicate; | |||
import com.ningdatech.kqapi.zzsfw.mapper.NdKqZzsfwMatterDeduplicateMapper; | |||
import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwMatterDeduplicateService; | |||
import org.springframework.stereotype.Service; | |||
/** | |||
* <p> | |||
* 服务实现类 | |||
* </p> | |||
* | |||
* @author ZPF | |||
* @since 2023-10-27 | |||
*/ | |||
@Service | |||
public class NdKqZzsfwMatterDeduplicateServiceImpl extends ServiceImpl<NdKqZzsfwMatterDeduplicateMapper, NdKqZzsfwMattersDeduplicate> | |||
implements INdKqZzsfwMatterDeduplicateService { | |||
} |
@@ -1,21 +0,0 @@ | |||
package com.ningdatech.kqapi.zzsfw.service.impl; | |||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.NdKqZzsfwPolicy; | |||
import com.ningdatech.kqapi.zzsfw.mapper.NdKqZzsfwPolicyMapper; | |||
import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwPolicyService; | |||
import org.springframework.stereotype.Service; | |||
/** | |||
* <p> | |||
* 服务实现类 | |||
* </p> | |||
* | |||
* @author ZPF | |||
* @since 2023-10-27 | |||
*/ | |||
@Service | |||
public class NdKqZzsfwPolicyServiceImpl extends ServiceImpl<NdKqZzsfwPolicyMapper, NdKqZzsfwPolicy> | |||
implements INdKqZzsfwPolicyService { | |||
} |
@@ -5,6 +5,8 @@ security: | |||
password-login-url: /api/v1/user/auth/login/password | |||
logout-url: /api/v1/user/auth/logout | |||
ignore-auth-urls: | |||
- /api/v1/poclicy/** | |||
- /api/v1/zzsfw/** | |||
- /v2/api-docs | |||
- /swagger-ui.html | |||
- /webjars/** | |||
@@ -20,6 +22,8 @@ security: | |||
- /open/api/** | |||
- /api/v1/wechat/** | |||
ignore-csrf-urls: | |||
- /api/v1/poclicy/** | |||
- /api/v1/zzsfw/** | |||
- /api/v1/user/auth/** | |||
- /v2/api-docs | |||
- /swagger-ui.html | |||
@@ -3,10 +3,10 @@ package com.ningdatech.kqapi.menu; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.google.common.collect.Sets; | |||
import com.ningdatech.kqapi.AppTests; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.NdKqZzsfwMattersDeduplicate; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.NdKqZzsfwMenu; | |||
import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwMatterDeduplicateService; | |||
import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwMenuService; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.KqZzsfwMenu; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.KqZzsfwMattersDeduplicate; | |||
import com.ningdatech.kqapi.zzsfw.service.IKqZzsfwMatterDeduplicateService; | |||
import com.ningdatech.kqapi.zzsfw.service.IKqZzsfwMenuService; | |||
import org.apache.commons.lang3.StringUtils; | |||
import org.apache.poi.ss.usermodel.Row; | |||
import org.apache.poi.ss.usermodel.Sheet; | |||
@@ -33,10 +33,10 @@ import java.util.stream.Collectors; | |||
public class DuplicationTest extends AppTests { | |||
@Autowired | |||
private INdKqZzsfwMatterDeduplicateService matterDeduplicateService; | |||
private IKqZzsfwMatterDeduplicateService matterDeduplicateService; | |||
@Autowired | |||
private INdKqZzsfwMenuService menuService; | |||
private IKqZzsfwMenuService menuService; | |||
@Test | |||
public void test() throws IOException { | |||
@@ -53,7 +53,7 @@ public class DuplicationTest extends AppTests { | |||
//获取最大列数 | |||
Integer num = 1; | |||
matterDeduplicateService.remove(Wrappers.lambdaQuery(NdKqZzsfwMattersDeduplicate.class)); | |||
matterDeduplicateService.remove(Wrappers.lambdaQuery(KqZzsfwMattersDeduplicate.class)); | |||
for (int i = 2; i < rownum; i++) { | |||
row = sheet.getRow(i); | |||
@@ -65,7 +65,7 @@ public class DuplicationTest extends AppTests { | |||
System.out.println(row.getCell(1).getStringCellValue()); | |||
Double numericCellValue = row.getCell(2).getNumericCellValue(); | |||
NdKqZzsfwMattersDeduplicate menu = new NdKqZzsfwMattersDeduplicate(); | |||
KqZzsfwMattersDeduplicate menu = new KqZzsfwMattersDeduplicate(); | |||
menu.setWebapplyurl(row.getCell(1).getStringCellValue()); | |||
menu.setQlName(row.getCell(0).getStringCellValue()); | |||
menu.setCreateOn(LocalDateTime.now()); | |||
@@ -78,16 +78,16 @@ public class DuplicationTest extends AppTests { | |||
@Test | |||
public void syncUrl(){ | |||
List<NdKqZzsfwMenu> menus = menuService.list(Wrappers.lambdaQuery(NdKqZzsfwMenu.class)); | |||
List<KqZzsfwMenu> menus = menuService.list(Wrappers.lambdaQuery(KqZzsfwMenu.class)); | |||
List<NdKqZzsfwMattersDeduplicate> list = matterDeduplicateService.list(); | |||
List<KqZzsfwMattersDeduplicate> list = matterDeduplicateService.list(); | |||
Set<String> qlSet = Sets.newTreeSet(); | |||
Map<String, String> map = list.stream().filter(q -> qlSet.add(q.getQlName())) | |||
.filter(q -> StringUtils.isNotBlank(q.getWebapplyurl()) && StringUtils.isNotBlank(q.getQlName())) | |||
.collect(Collectors.toMap(q -> q.getQlName(), q -> q.getWebapplyurl())); | |||
for(NdKqZzsfwMenu menu : menus){ | |||
for(KqZzsfwMenu menu : menus){ | |||
String itemName = menu.getItemName(); | |||
if(map.containsKey(itemName)){ | |||
String url = map.get(itemName); | |||
@@ -2,9 +2,9 @@ package com.ningdatech.kqapi.menu; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.ningdatech.kqapi.AppTests; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.NdKqZzsfwMenu; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.KqZzsfwMenu; | |||
import com.ningdatech.kqapi.zzsfw.enumeration.ItemTypeEnum; | |||
import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwMenuService; | |||
import com.ningdatech.kqapi.zzsfw.service.IKqZzsfwMenuService; | |||
import org.apache.poi.ss.usermodel.*; | |||
import org.apache.poi.xssf.usermodel.XSSFWorkbook; | |||
import org.junit.Assert; | |||
@@ -27,7 +27,7 @@ import java.time.LocalDateTime; | |||
public class MenuTest extends AppTests{ // | |||
@Autowired | |||
private INdKqZzsfwMenuService menuService; | |||
private IKqZzsfwMenuService menuService; | |||
@Test | |||
public void test() throws IOException { | |||
@@ -44,7 +44,7 @@ public class MenuTest extends AppTests{ // | |||
//获取最大列数 | |||
Integer num = 1; | |||
menuService.remove(Wrappers.lambdaQuery(NdKqZzsfwMenu.class)); | |||
menuService.remove(Wrappers.lambdaQuery(KqZzsfwMenu.class)); | |||
for (int i = 2; i < rownum; i++) { | |||
row = sheet.getRow(i); | |||
@@ -59,7 +59,7 @@ public class MenuTest extends AppTests{ // | |||
String itemName = row.getCell(4).getStringCellValue(); | |||
System.out.println(itemName); | |||
NdKqZzsfwMenu menu = new NdKqZzsfwMenu(); | |||
KqZzsfwMenu menu = new KqZzsfwMenu(); | |||
menu.setItemName(itemName); | |||
menu.setZoneName(row.getCell(0).getStringCellValue()); | |||
menu.setWindow(row.getCell(1).getStringCellValue()); | |||
@@ -131,7 +131,7 @@ public class MenuTest extends AppTests{ // | |||
telephone = decimalFormat2.format(row.getCell(7).getNumericCellValue()); | |||
System.out.println(telephone); | |||
} | |||
NdKqZzsfwMenu menu = new NdKqZzsfwMenu(); | |||
KqZzsfwMenu menu = new KqZzsfwMenu(); | |||
menu.setItemName(itemName); | |||
menu.setZoneName(zoneName); | |||
menu.setWindow(windowName); | |||
@@ -3,8 +3,8 @@ package com.ningdatech.kqapi.menu; | |||
import cn.hutool.core.date.DateUtil; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.ningdatech.kqapi.AppTests; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.NdKqZzsfwPolicy; | |||
import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwPolicyService; | |||
import com.ningdatech.kqapi.zzsfw.model.entity.KqZzsfwPolicy; | |||
import com.ningdatech.kqapi.zzsfw.service.IKqZzsfwPolicyService; | |||
import org.apache.poi.ss.usermodel.Row; | |||
import org.apache.poi.ss.usermodel.Sheet; | |||
import org.apache.poi.ss.usermodel.Workbook; | |||
@@ -27,7 +27,7 @@ import java.util.Objects; | |||
public class PolicyTest extends AppTests { | |||
@Autowired | |||
private INdKqZzsfwPolicyService policyService; | |||
private IKqZzsfwPolicyService policyService; | |||
@Test | |||
public void test() throws IOException { | |||
@@ -36,7 +36,7 @@ public class PolicyTest extends AppTests { | |||
Assert.assertNotNull(workbook); | |||
Row row; | |||
policyService.remove(Wrappers.lambdaQuery(NdKqZzsfwPolicy.class)); | |||
policyService.remove(Wrappers.lambdaQuery(KqZzsfwPolicy.class)); | |||
if (workbook != null) { | |||
//获取最大行数 | |||
@@ -62,7 +62,7 @@ public class PolicyTest extends AppTests { | |||
String applyTime = Objects.nonNull(row.getCell(8)) ? row.getCell(8).getStringCellValue() : null; | |||
String url = Objects.nonNull(row.getCell(9)) ? row.getCell(9).getStringCellValue() : null; | |||
NdKqZzsfwPolicy policy = new NdKqZzsfwPolicy(); | |||
KqZzsfwPolicy policy = new KqZzsfwPolicy(); | |||
policy.setHeader(header); | |||
policy.setTitle(title); | |||
policy.setSecondTitle(secondTitle); | |||
@@ -1,5 +0,0 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
<mapper namespace="com.ningdatech.kqapi.zzsfw.mapper.NdKqZzsfwMenuMapper"> | |||
</mapper> |