From 634049809ba850fbdea4625ffe115a684c1d0c18 Mon Sep 17 00:00:00 2001 From: manailin <261030956@qq.com> Date: 星期四, 15 九月 2022 09:11:44 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/sanshuohuitang_dev' into sanshuohuitang_dev --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoExpertServiceImpl.java | 27 +++++++++++++++++++++------ 1 files changed, 21 insertions(+), 6 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoExpertServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoExpertServiceImpl.java index b7e781c..36d7e9f 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoExpertServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoExpertServiceImpl.java @@ -54,8 +54,21 @@ public R addExpert(ComSanshuoExpertDTO comSanshuoExpertDTO) { ComSanshuoExpert expert=new ComSanshuoExpert(); BeanUtil.copyProperties(comSanshuoExpertDTO,expert); + //处理id + if (nonNull(comSanshuoExpertDTO.getUnit())){ + String id = comSanshuoExpertDTO.getUnit(); + String[] split = id.split(","); + comSanshuoExpertDTO.setUnitId(split[split.length]); + } expert.setId(Snowflake.getId()); expert.setCreateTime(new Date()); + if (expert.getLevel()==2){ + expert.setIndustryCenterId(Long.parseLong(comSanshuoExpertDTO.getUnitId())); + }else if(expert.getLevel()==3){ + expert.setStreetId(Long.parseLong(comSanshuoExpertDTO.getUnitId())); + }else if(expert.getLevel()==4){ + expert.setCommunityId(Long.parseLong(comSanshuoExpertDTO.getUnitId())); + } int insert = comSanshuoExpertDao.insert(expert); if (insert>0){ try { @@ -93,12 +106,14 @@ Integer range=null; if (nonNull(loginUserInfo)){ if (nonNull(loginUserInfo.getUserType()) || nonNull(loginUserInfo.getType())){ - if (loginUserInfo.getUserType().equals(1)){ - range=3; - id=loginUserInfo.getStreetId(); - }else if (loginUserInfo.getUserType().equals(2)){ - range=4; - id=loginUserInfo.getCommunityId(); + if (nonNull(loginUserInfo.getUserType())){ + if (loginUserInfo.getUserType().equals(1)){ + range=3; + id=loginUserInfo.getStreetId(); + }else if (loginUserInfo.getUserType().equals(2)){ + range=4; + id=loginUserInfo.getCommunityId(); + } }else if (loginUserInfo.getType().equals(11)){ range=2; id=loginUserInfo.getCommunityId(); -- Gitblit v1.7.1