From dca8b4cb56933c5cd9ec60181b716a7fb8a3180d Mon Sep 17 00:00:00 2001 From: 张天森 <1292933220@qq.com> Date: 星期三, 14 九月 2022 16:58:57 +0800 Subject: [PATCH] update --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoExpertServiceImpl.java | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 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 ed7dfa3..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,14 +54,20 @@ 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(expert.getUnit())); + expert.setIndustryCenterId(Long.parseLong(comSanshuoExpertDTO.getUnitId())); }else if(expert.getLevel()==3){ - expert.setStreetId(Long.parseLong(expert.getUnit())); + expert.setStreetId(Long.parseLong(comSanshuoExpertDTO.getUnitId())); }else if(expert.getLevel()==4){ - expert.setCommunityId(Long.parseLong(expert.getUnit())); + expert.setCommunityId(Long.parseLong(comSanshuoExpertDTO.getUnitId())); } int insert = comSanshuoExpertDao.insert(expert); if (insert>0){ -- Gitblit v1.7.1